车辆接口更新

This commit is contained in:
wangshiming
2022-01-26 10:16:37 +08:00
parent 5b6737f76a
commit 5b7261022b
20 changed files with 589 additions and 93 deletions

View File

@ -4,7 +4,7 @@
* @Author : Shiming * @Author : Shiming
* @Date : 2022-01-18 09:51:21 * @Date : 2022-01-18 09:51:21
* @LastEditors : Shiming * @LastEditors : Shiming
* @LastEditTime : 2022-01-25 16:49:35 * @LastEditTime : 2022-01-26 09:41:06
* @FilePath : \\tms-obc-web\\proxy.conf.js * @FilePath : \\tms-obc-web\\proxy.conf.js
* Copyright (C) 2022 huzhenhong. All rights reserved. * Copyright (C) 2022 huzhenhong. All rights reserved.
*/ */
@ -20,7 +20,7 @@ module.exports = {
// } // }
'//api': { '//api': {
target: { target: {
host: 'tms-api-dev.eascs.com', host: 'tms-api-test.eascs.com',
protocol: 'https:', protocol: 'https:',
port: 443 port: 443
}, },

View File

@ -227,7 +227,7 @@ export class PayableOrderComponent implements OnInit {
return [ return [
{ title: '', index: 'key', type: 'checkbox' }, { title: '', index: 'key', type: 'checkbox' },
{ title: '核销单号', index: 'phxcode', type: 'link', width: 140 }, { title: '核销单号', index: 'phxcode', type: 'link', width: 140 },
{ title: '网络货运人', index: 'ltdId', width: 140 }, { title: '网络货运人', index: 'ltdName', width: 140 },
{ title: '核销日期', index: 'phxdate', type: 'date', width: 160 }, { title: '核销日期', index: 'phxdate', type: 'date', width: 160 },
{ title: '付款账户', index: 'shipperaccount', width: 120 }, { title: '付款账户', index: 'shipperaccount', width: 120 },
{ title: '收款账户', index: 'ltdaccount', width: 120 }, { title: '收款账户', index: 'ltdaccount', width: 120 },
@ -247,7 +247,7 @@ export class PayableOrderComponent implements OnInit {
}, },
{ title: '银行类型', index: 'banktype', type: 'enum', enum: { '1': '平安', '2': '浦发' }, width: 120 }, { title: '银行类型', index: 'banktype', type: 'enum', enum: { '1': '平安', '2': '浦发' }, width: 120 },
{ title: '付款类型', index: 'brmtype', type: 'enum', enum: { '1': '费用款项' }, width: 120 }, { title: '付款类型', index: 'brmtype', type: 'enum', enum: { '1': '费用款项' }, width: 120 },
{ title: '收款人', index: 'artoname', width: 120 }, { title: '收款人', index: 'driver2IdName', width: 120 },
{ title: '结算客户', index: 'cno', width: 120 }, { title: '结算客户', index: 'cno', width: 120 },
{ title: '银行水单', index: 'bankreceipt', width: 120 }, { title: '银行水单', index: 'bankreceipt', width: 120 },
{ title: '创建时间', index: 'createTime', width: 160 }, { title: '创建时间', index: 'createTime', width: 160 },

View File

@ -473,6 +473,6 @@ export class insuranceManagementListComponent implements OnInit {
// 修改订单 // 修改订单
changeOrder(value: any) { changeOrder(value: any) {
this.router.navigate(['order-management/bulk-detailChange', value.id]); this.router.navigate(['/insurance-management/list-set', value.id]);
} }
} }

View File

@ -0,0 +1,20 @@
<!--
* @Description :
* @Version : 1.0
* @Author : Shiming
* @Date : 2021-12-06 20:20:26
* @LastEditors : Shiming
* @LastEditTime : 2022-01-26 09:27:28
* @FilePath : \\tms-obc-web\\src\\app\\routes\\insurance-management\\components\\set\\set.component.html
* Copyright (C) 2022 huzhenhong. All rights reserved.
-->
<page-header-wrapper [title]="''" [logo]="logo">
<ng-template #logo>
<button nz-button nz-tooltip nzTooltipTitle="返回上一页" (click)="goBack()">
<i nz-icon nzType="left" nzTheme="outline"></i>
</button>
</ng-template>
</page-header-wrapper>
<nz-card>
<!-- <app-insurance-table></app-insurance-table> -->
</nz-card>

View File

@ -0,0 +1,94 @@
:host {
.btn-size {
font-size: 14px;
}
.bdr {
border-right: 1px solid #ccc;
}
.bdl {
border-left: 1px solid #ccc;
}
.source-info {
p {
margin-bottom: .5em;
}
}
.freight-info-box {
width: 95%;
}
.freigth-label {
display : inline-block;
width : 50px;
text-align: right;
}
::ng-deep {
.approval-status {
.ant-steps {
width : 70%;
margin: 0 auto;
}
}
// .ant-tabs-top>.ant-tabs-nav,
// .ant-tabs-bottom>.ant-tabs-nav,
// .ant-tabs-top>div>.ant-tabs-nav,
// .ant-tabs-bottom>div>.ant-tabs-nav {
// margin: 0;
// }
// .ant-anchor-ink::before {
// width: 0;
// }
// .ant-tabs-card.ant-tabs-top>.ant-tabs-nav .ant-tabs-tab+.ant-tabs-tab,
// .ant-tabs-card.ant-tabs-bottom>.ant-tabs-nav .ant-tabs-tab+.ant-tabs-tab,
// .ant-tabs-card.ant-tabs-top>div>.ant-tabs-nav .ant-tabs-tab+.ant-tabs-tab,
// .ant-tabs-card.ant-tabs-bottom>div>.ant-tabs-nav .ant-tabs-tab+.ant-tabs-tab {
// margin-left: 40px
// }
}
.leftPadding {
padding-right: 100px;
}
.handling-info {
min-height: 100px;
border: 1px solid #ccc;
.loading-row {
display: flex;
}
.handling-info-icon {
width: 32px;
height: 32px;
margin-right: 24px;
color: #fff;
line-height: 32px;
text-align: center;
border-radius: 50%;
&.loading-bg {
background-color: #50D4AB;
}
&.unloaing-bg {
background: #F66F6A;
}
}
.info {
flex: 1;
}
.time-info {
margin-left: 56px;
}
}
}

View File

@ -0,0 +1,24 @@
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
import { insuranceManagementSetComponent } from './set.component';
describe('insuranceManagementSetComponent', () => {
let component: insuranceManagementSetComponent;
let fixture: ComponentFixture<insuranceManagementSetComponent>;
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [ insuranceManagementSetComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(insuranceManagementSetComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,45 @@
/*
* @Description :
* @Version : 1.0
* @Author : Shiming
* @Date : 2021-12-06 20:20:26
* @LastEditors : Shiming
* @LastEditTime : 2022-01-25 20:43:37
* @FilePath : \\tms-obc-web\\src\\app\\routes\\insurance-management\\components\\set\\set.component.ts
* Copyright (C) 2022 huzhenhong. All rights reserved.
*/
import { Router } from '@angular/router';
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { STColumn } from '@delon/abc/st';
import { _HttpClient } from '@delon/theme';
import { NzMessageService } from 'ng-zorro-antd/message';
import { NzModalService } from 'ng-zorro-antd/modal';
import { InsuranceManagementService } from '../../services/insurance-management.service';
import { NzCardComponent } from 'ng-zorro-antd/card';
@Component({
selector: 'app-insurance-management-set',
templateUrl: './set.component.html',
styleUrls: ['./set.component.less']
})
export class insuranceManagementSetComponent implements OnInit {
constructor(
private route: ActivatedRoute,
private msgSrv: NzMessageService,
private service: InsuranceManagementService,
) {
}
ngOnInit(): void {
this.initData()
}
initData() {
}
goBack() {
window.history.go(-1);
}
}

View File

@ -11,11 +11,12 @@
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router'; import { RouterModule, Routes } from '@angular/router';
import { insuranceManagementListComponent } from './components/list/list.component'; import { insuranceManagementListComponent } from './components/list/list.component';
import { insuranceManagementSetComponent } from './components/set/set.component';
const routes: Routes = [ const routes: Routes = [
{ path: 'list', component: insuranceManagementListComponent }, { path: 'list', component: insuranceManagementListComponent },
// { path: 'list-detail/:id', component: OrderManagementVehicleDetailComponent }, { path: 'list-set/:id', component: insuranceManagementSetComponent },
] ]
@NgModule({ @NgModule({
imports: [RouterModule.forChild(routes)], imports: [RouterModule.forChild(routes)],

View File

@ -4,7 +4,7 @@
* @Author : Shiming * @Author : Shiming
* @Date : 2022-01-06 09:24:00 * @Date : 2022-01-06 09:24:00
* @LastEditors : Shiming * @LastEditors : Shiming
* @LastEditTime : 2022-01-25 17:22:04 * @LastEditTime : 2022-01-25 20:45:45
* @FilePath : \\tms-obc-web\\src\\app\\routes\\insurance-management\\insurance-management.module.ts * @FilePath : \\tms-obc-web\\src\\app\\routes\\insurance-management\\insurance-management.module.ts
* Copyright (C) 2022 huzhenhong. All rights reserved. * Copyright (C) 2022 huzhenhong. All rights reserved.
*/ */
@ -12,15 +12,18 @@
import { NgModule, Type } from '@angular/core'; import { NgModule, Type } from '@angular/core';
import { SharedModule } from '@shared'; import { SharedModule } from '@shared';
import { insuranceManagementListComponent } from './components/list/list.component'; import { insuranceManagementListComponent } from './components/list/list.component';
import { insuranceManagementSetComponent } from './components/set/set.component';
import { InsuranceManagementRoutingModule } from './insurance-management-routing.module'; import { InsuranceManagementRoutingModule } from './insurance-management-routing.module';
const COMPONENTS: Type<void>[] = [ const COMPONENTS: Type<void>[] = [
insuranceManagementListComponent insuranceManagementListComponent,
insuranceManagementSetComponent
]; ];
@NgModule({ @NgModule({
imports: [ imports: [
SharedModule, SharedModule,
InsuranceManagementRoutingModule InsuranceManagementRoutingModule,
], ],
declarations: COMPONENTS, declarations: COMPONENTS,
}) })

View File

@ -6,13 +6,26 @@
</div> </div>
<div class="rightBox"> <div class="rightBox">
<nz-tabset [nzSize]="'small'"> <nz-tabset [nzSize]="'small'">
<nz-tab nzTitle="操作权限"> <!-- <nz-tab nzTitle="操作权限">
<div *ngFor="let item of origin?.buttonInfoList"> <div *ngFor="let item of origin?.buttonInfoList">
<label nz-checkbox [(ngModel)]="item.checked" (ngModelChange)="addAuthority(origin, node, item)">{{ item.title <label nz-checkbox [(ngModel)]="item.checked" (ngModelChange)="addAuthority(origin, node, item)">{{ item.title
}}</label> }}</label>
</div> </div>
<nz-empty nzNotFoundImage="simple" *ngIf="origin?.buttonInfoList?.length === 0"> <nz-empty nzNotFoundImage="simple" *ngIf="origin?.buttonInfoList?.length === 0">
</nz-empty> </nz-empty>
</nz-tab> -->
<nz-tab nzTitle="操作权限">
<div *ngIf="origin.buttonInfoList && origin.buttonInfoList.length">
<label style="width: 100%"
nz-checkbox
[(ngModel)]="item.checked"
*ngFor="let item of origin.buttonInfoList"
(ngModelChange)="addAuthority(origin, node, item)"
[disabled]="source === 'onlyAuth'"
>{{ item.permissionsName }}</label
>
</div>
<nz-empty nzNotFoundImage="simple" *ngIf="origin.buttonInfoList && origin.buttonInfoList.length === 0"> </nz-empty>
</nz-tab> </nz-tab>
<nz-tab nzTitle="数据权限"> <nz-tab nzTitle="数据权限">
<div *ngIf="origin.dictList?.length>0" se-container [labelWidth]="100"> <div *ngIf="origin.dictList?.length>0" se-container [labelWidth]="100">

View File

@ -1,74 +1,86 @@
<!-- <!--
* @Author: your name * @Description :
* @Date: 2021-12-29 13:12:35 * @Version : 1.0
* @LastEditTime: 2021-12-29 16:15:24 * @Author : Shiming
* @LastEditors: Please set LastEditors * @Date : 2022-01-21 15:39:30
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @LastEditors : Shiming
* @FilePath: \tms-obc-web\src\app\routes\ticket-management\components\invoice-requested\invoice-requested.component.html * @LastEditTime : 2022-01-26 09:36:07
* @FilePath : \\tms-obc-web\\src\\app\\routes\\ticket-management\\components\\invoice-requested\\invoice-requested.component.html
* Copyright (C) 2022 huzhenhong. All rights reserved.
--> -->
<page-header-wrapper [title]="'开票申请'">
</page-header-wrapper>
<page-header-wrapper [title]="'开票申请'"> </page-header-wrapper>
<nz-card class="search-box" nzBordered> <nz-card class="search-box" nzBordered>
<div nz-row nzGutter="8"> <div nz-row nzGutter="8">
<div nz-col [nzXl]="_$expand ? 24 : 18" [nzLg]="24" [nzSm]="24" [nzXs]="24"> <div nz-col [nzXl]="_$expand ? 24 : 18" [nzLg]="24" [nzSm]="24" [nzXs]="24">
<sf #sf [schema]="searchSchema" <sf
[ui]="{ '*': { spanLabelFixed: 90,grid: { lg: 8, md: 12, sm: 12, xs: 24 } }}" [compact]="true" #sf
[button]="'none'"></sf> [schema]="searchSchema"
</div> [ui]="{ '*': { spanLabelFixed: 90, grid: { lg: 8, md: 12, sm: 12, xs: 24 } } }"
<div nz-col [nzXl]="_$expand ? 24 : 6" [nzLg]="24" [nzSm]="24" [nzXs]="24" class="text-right"> [compact]="true"
<button nz-button nzType="primary" [nzLoading]="service.http.loading" (click)="st?.load(1)">查询</button> [button]="'none'"
<button nz-button (click)="resetSF()">重置</button> ></sf>
<button nz-button> 导出</button>
<button nz-button nzType="link" (click)="expandToggle()">
{{ !_$expand ? '展开' : '收起' }}
<i nz-icon [nzType]="!_$expand ? 'down' : 'up'"></i>
</button>
</div>
</div> </div>
<div nz-col [nzXl]="_$expand ? 24 : 6" [nzLg]="24" [nzSm]="24" [nzXs]="24" class="text-right">
<button nz-button nzType="primary" [nzLoading]="service.http.loading" (click)="st?.load(1)">查询</button>
<button nz-button (click)="resetSF()">重置</button>
<button nz-button> 导出</button>
<button nz-button nzType="link" (click)="expandToggle()">
{{ !_$expand ? '展开' : '收起' }}
<i nz-icon [nzType]="!_$expand ? 'down' : 'up'"></i>
</button>
</div>
</div>
</nz-card> </nz-card>
<nz-card class="content-box" nzBordered> <nz-card class="content-box" nzBordered>
<nz-tabset [nzTabBarExtraContent]="extraTemplate"> <nz-tabset [nzTabBarExtraContent]="extraTemplate">
<nz-tab nzTitle="待受理" (nzClick)="selectChange(1)"></nz-tab> <nz-tab nzTitle="待受理" (nzClick)="selectChange(1)"></nz-tab>
<nz-tab nzTitle="处理中" (nzClick)="selectChange(2)"></nz-tab> <nz-tab nzTitle="处理中" (nzClick)="selectChange(2)"></nz-tab>
<nz-tab nzTitle="已拒绝" (nzClick)="selectChange(4)"></nz-tab> <nz-tab nzTitle="已拒绝" (nzClick)="selectChange(4)"></nz-tab>
<nz-tab nzTitle="已完成" (nzClick)="selectChange(3)"></nz-tab> <nz-tab nzTitle="已完成" (nzClick)="selectChange(3)"></nz-tab>
<nz-tab nzTitle="全部" (nzClick)="selectChange(null)"></nz-tab> <nz-tab nzTitle="全部" (nzClick)="selectChange(null)"></nz-tab>
</nz-tabset> </nz-tabset>
<ng-template #extraTemplate> <ng-template #extraTemplate>
<div class="d-flex align-items-center"> <div class="d-flex align-items-center">
<div class="mr-md"> <div class="mr-md">
已选择 已选择
<strong class="text-red">{{ selectedRows.length }}</strong> 条数据&nbsp;&nbsp; 开票金额总计 <strong class="text-red">{{ selectedRows.length }}</strong> 条数据&nbsp;&nbsp; 开票金额总计
<strong class="text-red">{{totalCallNo }}</strong> <strong class="text-red">{{ totalCallNo }}</strong>
<a *ngIf="totalCallNo > 0" (click)="st.clearCheck()" class="ml-lg">清空</a> <a *ngIf="totalCallNo > 0" (click)="st.clearCheck()" class="ml-lg">清空</a>
</div> </div>
<button nz-button (click)="this.batchRequested()">开票</button> <button nz-button (click)="this.batchRequested()">开票</button>
<!-- <button nz-button (click)="this.rejectAction(selectedRows)">驳回</button> <!-- <button nz-button (click)="this.rejectAction(selectedRows)">驳回</button>
<button nz-button (click)="changePice(selectedRows)">修改地址</button>--> <button nz-button (click)="changePice(selectedRows)">修改地址</button>-->
<button nz-button (click)="printOrder(selectedRows)">打印面单</button> <button nz-button (click)="printOrder(selectedRows)">打印面单</button>
</div> </div>
</ng-template> </ng-template>
<st #st [data]="service.$api_get_invoice_requested_page" [columns]="columns" <st
[req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, process: beforeReq }" #st
[res]="{ reName: { list: 'data.records', total: 'data.total' }, process:afterRes }" [data]="service.$api_get_invoice_requested_page"
[page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100, 200, 300, 500, 1000] }" [columns]="columns"
[loading]="service.http.loading" [scroll]="{ x:'1200px',y: '370px' }" (change)="stChange($event)"> [req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, process: beforeReq }"
<ng-template st-row="vatappcode" let-item let-index="index" let-column="column"> [res]="{ reName: { list: 'data.records', total: 'data.total' }, process: afterRes }"
{{ item.vatappcode }} <br> <label class="text-primary">待受理</label> [page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100, 200, 300, 500, 1000] }"
</ng-template> [loading]="service.http.loading"
</st> [scroll]="{ x: '1200px', y: '370px' }"
(change)="stChange($event)"
>
<ng-template st-row="vatappcode" let-item let-index="index" let-column="column">
{{ item.vatappcode }} <br />
<label class="text-primary">待受理</label>
</ng-template>
</st>
</nz-card> </nz-card>
<ng-template #rejectModal> <ng-template #rejectModal>
<div nz-row nzGutter="8"> <div nz-row nzGutter="8">
<div nz-col nzSpan="24" se-container [labelWidth]="80"> <div nz-col nzSpan="24" se-container [labelWidth]="80">
<se [col]="1" label="备注" required> <se [col]="1" label="备注" required>
<textarea nz-input rows="3" placeholder="请说明驳回原因" style="width: 325px;margin-left: 14px;"></textarea> <textarea nz-input rows="3" placeholder="请说明驳回原因" style="width: 325px; margin-left: 14px"></textarea>
</se> </se>
</div>
</div> </div>
</ng-template> </div>
</ng-template>

View File

@ -357,7 +357,7 @@ export class InvoiceRequestedComponent implements OnInit {
{ title: '', index: 'key', type: 'checkbox' }, { title: '', index: 'key', type: 'checkbox' },
{ title: '申请编号', render: 'vatappcode', width: 180 }, { title: '申请编号', render: 'vatappcode', width: 180 },
{ title: '网络货运人', index: 'ltdName', width: 120 }, { title: '网络货运人', index: 'ltdName', width: 120 },
{ title: '购买方', index: 'projectName', width: 90 }, { title: '购买方', index: 'arto', width: 90 },
{ title: '订单数', index: 'ordlines', width: 90 }, { title: '订单数', index: 'ordlines', width: 90 },
{ {
title: '申请金额', title: '申请金额',

View File

@ -1,26 +1,36 @@
<!-- <!--
* @Author: your name * @Description :
* @Date: 2021-12-23 16:50:17 * @Version : 1.0
* @LastEditTime: 2021-12-31 13:40:11 * @Author : Shiming
* @LastEditors: Please set LastEditors * @Date : 2022-01-18 15:57:44
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @LastEditors : Shiming
* @FilePath: \tms-obc-web\src\app\routes\ticket-management\components\invoice-requested\requested-invoice-modal\requested-invoice-modal.component.html * @LastEditTime : 2022-01-26 09:35:59
* @FilePath : \\tms-obc-web\\src\\app\\routes\\ticket-management\\components\\invoice-requested\\requested-invoice-modal\\requested-invoice-modal.component.html
* Copyright (C) 2022 huzhenhong. All rights reserved.
--> -->
<app-requested-detail [id]="id"></app-requested-detail> <app-requested-detail [id]="id"></app-requested-detail>
<st #st [data]="service.$api_get_invoice_requested_order_detail" [columns]="columns" bordered size="small" <st
[req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, process: beforeReq}" #st
[res]="{ reName: { list: 'data.records', total: 'data.total' } }" [data]="service.$api_get_invoice_requested_order_detail"
[page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100, 200, 300, 500, 1000] }" [columns]="columns"
[loading]="service.http.loading" [scroll]="{ x:'1200px',y: '200px' }" (change)="stChange($event)" class="mt-md"> bordered
<ng-template st-row="billHCode" let-item let-index="index" let-column="column"> size="small"
<a class="text-primary"> {{ item.billHCode }}</a> [req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, process: beforeReq }"
</ng-template> [res]="{ reName: { list: 'data.records', total: 'data.total' } }"
[page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100, 200, 300, 500, 1000] }"
[loading]="service.http.loading"
[scroll]="{ x: '1200px', y: '200px' }"
(change)="stChange($event)"
class="mt-md"
>
<ng-template st-row="billHCode" let-item let-index="index" let-column="column">
<a class="text-primary"> {{ item.billHCode }}</a>
</ng-template>
</st> </st>
<div class="modal-footer text-center"> <div class="modal-footer text-center">
<button nz-button type="button">移除</button>
<button nz-button type="button">移除</button> <button nz-button type="button" (click)="saveManage()">手工处理</button>
<button nz-button type="button" (click)="saveManage()">手工处理</button> <button nz-button type="submit" nzType="primary" [nzLoading]="service.http.loading" (click)="saveManage()">自动开票</button>
<button nz-button type="submit" nzType="primary" [nzLoading]="service.http.loading" </div>
(click)="saveManage()">自动开票</button>
</div>

View File

@ -0,0 +1,12 @@
/*
* @Description :
* @Version : 1.0
* @Author : Shiming
* @Date : 2022-01-25 20:20:07
* @LastEditors : Shiming
* @LastEditTime : 2022-01-25 20:28:47
* @FilePath : \\tms-obc-web\\src\\app\\shared\\components\\insurance-table\\index.ts
* Copyright (C) 2022 huzhenhong. All rights reserved.
*/
export * from './insurance-table.module'
export * from './insurance-table.service'

View File

@ -0,0 +1,63 @@
<div nz-row>
<div nz-col nzSpan="24">
<div class="mb-md ml-xl" style="text-align: right;">
<button nz-button nzType="primary" (click)="add()">新增公里数</button>
<button class="ml-md" nz-button nzType="primary" (click)="save()">保存</button>
</div>
<nz-table #groupingTable [nzData]="data" nzBordered nzSize="small" [nzFrontPagination]="false"
[nzScroll]="{ x: '1200px' }" [nzShowPagination]="false" class="ml-xl" style="max-width: 1100px;">
<thead>
<tr>
<th rowspan="2" nzWidth="200px" nzAlign="center" nzLeft>公里数</th>
<th rowspan="2" nzWidth="130px" nzAlign="center">计算方式</th>
<th nzWidth="220px" nzAlign="center" *ngFor="let item of headers">车长(米)</th>
<th rowspan="2" nzWidth="60px" nzAlign="center" nzRight>操作</th>
</tr>
<tr>
<th nzWidth="220px" nzAlign="center" *ngFor="let item of headers;let i = index">
<div style="display: flex;align-items: center;justify-content: space-between;">
<label style="width: 65px;text-align: right;"> {{item.startLength}}</label>
<label>-</label>
<nz-input-number [ngModel]="item.endLength" (ngModelChange)="changeEndLength($event,i)"
[nzMin]="0" [nzFormatter]="formatterDollar" nzSize="small" class="mr-sm" disabled>
</nz-input-number>
</div>
</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let item of groupingTable.data;let i = index">
<td nzWidth="200px" nzAlign="center" nzLeft>
<div style="display: flex;align-items: center;justify-content: space-between;">
<label style="width: 65px;text-align: right;"> {{item.startKm}}</label>
<label>-</label>
<nz-input-number [ngModel]="item.endKm" (ngModelChange)="changeEndKm($event,i)" [nzMin]="0"
[nzFormatter]="formatterDollar" nzSize="small">
</nz-input-number>
</div>
</td>
<td nzWidth="130px" nzAlign="center">{{computeMode[item.computeMode] }}</td>
<td nzWidth="220px" nzAlign="center" *ngFor="let node of item.configValue">
<div style="display: flex;align-items: center;justify-content: center;">
<label>最高</label>
<nz-input-number [(ngModel)]="node.maxPrice" [nzMin]="0" nzSize="small" style="width: 55px;"
class="ml-sm mr-sm">
</nz-input-number>
<label>预警</label>
<nz-input-number [(ngModel)]="node.ewPrice" [nzMin]="0" nzSize="small" style="width: 55px;"
class="ml-sm">
</nz-input-number>
</div>
</td>
<td nzWidth="60px" nzAlign="center" nzRight>
<a *ngIf="i === groupingTable.data.length-1 && groupingTable.data.length>2" nz-popconfirm
nzPopconfirmTitle="是否确认删除?" (nzOnConfirm)="deleteRow(i)">删除</a>
</td>
</tr>
</tbody>
</nz-table>
</div>
</div>

View File

@ -0,0 +1,14 @@
:host::ng-deep {
nz-input-number {
width: 85px;
input {
width : 100%;
margin: 0;
}
.ant-input-number-handler-wrap {
display: none;
}
}
}

View File

@ -0,0 +1,136 @@
import { Component, OnInit } from '@angular/core';
import { BaseService } from '@shared';
@Component({
selector: 'app-insurance-table',
templateUrl: './insurance-table.component.html',
styleUrls: ['./insurance-table.component.less']
})
export class InsuranceTableComponent implements OnInit {
data: any[] = [];
headers: any[] = [];
formatterDollar = (value: number): string => `${value} (含)`;
computeMode: any = {
0: '总运价',
1: '单公里运价'
};
constructor(public service: BaseService) {}
ngOnInit(): void {
this.loadHeaders();
this.loadData();
}
loadHeaders() {
this.service.request('/api/mdc/cuc/freightConfigItem/list').subscribe(res => {
if (res) {
this.headers = res;
}
});
}
loadData() {
this.service.request('/api/mdc/cuc/freightConfig/list').subscribe(res => {
if (res) {
this.data = res;
}
});
}
/**
* 修改结束车长
* @param event 车长
* @param i 下标
*/
changeEndLength(event: any, i: number) {
if (event <= this.headers[i].startLength) {
this.headers[i].endLength = this.headers[i].startLength + 1;
this.changeNextStartLength(event, i + 1);
return;
}
this.headers[i].endLength = event;
this.changeNextStartLength(event, i + 1);
}
/**
* 修改结束公里数
* @param event 车长
* @param i 下标
*/
changeEndKm(event: any, i: number) {
if (event <= this.data[i].startKm) {
this.data[i].endKm = this.data[i].startKm + 1;
this.changeNextStartKm(event, i + 1);
return;
}
this.data[i].endKm = event;
this.changeNextStartKm(event, i + 1);
}
add() {
console.log(this.data);
const tem = this.data[this.data?.length - 1];
if (tem && tem.endKm) {
const list = this.headers.map(item => ({
ewPrice: null,
itemId: item.id,
maxPrice: null
}));
this.data.push({
computeMode: 1,
configValue: list,
endKm: '',
startKm: tem.endKm
});
this.data = [...this.data];
} else {
this.service.msgSrv.warning('请填写完整公里数');
}
}
deleteRow(index: number) {
this.data = this.data.filter((d, i) => index !== i);
}
save() {
this.service.request('/api/mdc/cuc/freightConfig/saveBatch', this.data).subscribe(res => {
if (res) {
console.log(res);
this.service.msgSrv.success('修改成功');
this.loadData();
}
});
}
/**
* 遍历同步后置位车长
* @param event 车长
* @param i 下标
*/
private changeNextStartLength(event: number, i: number) {
if (this.headers[i]) {
this.headers[i].startLength = event;
if (this.headers[i].endLength <= event) {
this.headers[i].endLength = this.headers[i].startLength + 0.5;
this.changeNextStartLength(event + 0.5, i + 1);
}
}
}
/**
* 遍历同步后置位公里数
* @param event 车长
* @param i 下标
*/
private changeNextStartKm(event: number, i: number) {
if (this.data[i]) {
this.data[i].startKm = event;
if (this.data[i].endKm <= event) {
this.data[i].endKm = this.data[i].startKm + 1;
this.changeNextStartKm(event + 1, i + 1);
}
}
}
}

View File

@ -0,0 +1,30 @@
/*
* @Description :
* @Version : 1.0
* @Author : Shiming
* @Date : 2022-01-25 20:23:54
* @LastEditors : Shiming
* @LastEditTime : 2022-01-25 20:35:32
* @FilePath : \\tms-obc-web\\src\\app\\shared\\components\\insurance-table\\insurance-table.module.ts
* Copyright (C) 2022 huzhenhong. All rights reserved.
*/
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { NzInputNumberModule } from 'ng-zorro-antd/input-number';
import { NzTableModule } from 'ng-zorro-antd/table';
import { InsuranceTableComponent } from './insurance-table.component';
const COMPONENTS = [InsuranceTableComponent];
const COMPONENTSs = [
NzTableModule,
NzInputNumberModule
];
@NgModule({
declarations: COMPONENTS,
imports: [CommonModule, FormsModule,COMPONENTSs],
exports: COMPONENTS
})
export class InsuranceTableModule {}

View File

@ -0,0 +1,18 @@
/*
* @Description :
* @Version : 1.0
* @Author : Shiming
* @Date : 2022-01-25 20:21:04
* @LastEditors : Shiming
* @LastEditTime : 2022-01-25 20:35:52
* @FilePath : \\tms-obc-web\\src\\app\\shared\\components\\insurance-table\\insurance-table.service.ts
* Copyright (C) 2022 huzhenhong. All rights reserved.
*/
import { Injectable } from '@angular/core';
@Injectable({ providedIn: 'root' })
export class InsuranceService {
}

View File

@ -1,10 +1,10 @@
/* /*
* @Author: your name * @Author: your name
* @Date: 2021-11-29 10:04:12 * @Date: 2021-11-29 10:04:12
* @LastEditTime: 2021-12-13 10:42:19 * @LastEditTime : 2022-01-25 20:34:23
* @LastEditors: Please set LastEditors * @LastEditors : Shiming
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \tms-obc-web\src\app\shared\index.ts * @FilePath : \\tms-obc-web\\src\\app\\shared\\index.ts
*/ */
// Modules // Modules
export * from './components/delay/index'; export * from './components/delay/index';
@ -19,6 +19,7 @@ export * from './components/captcha/index';
export * from './components/amap/index'; export * from './components/amap/index';
export * from './components/dict-select/index'; export * from './components/dict-select/index';
export * from './components/dynamic-setting'; export * from './components/dynamic-setting';
export * from './components/insurance-table/index';
// Utils // Utils
export * from './utils'; export * from './utils';