Merge branch 'develop' of gitlab.eascs.com:tms-ui/tms-obc-web into develop

This commit is contained in:
Lingzi
2022-03-03 10:39:39 +08:00
149 changed files with 3158 additions and 1838 deletions

40
package-lock.json generated
View File

@ -5172,6 +5172,14 @@
} }
} }
}, },
"css-line-break": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/css-line-break/-/css-line-break-2.1.0.tgz",
"integrity": "sha512-FHcKFCZcAha3LwfVBhCQbW2nCNbkZXn7KVUJcsT5/P8YmfsVja0FMPJr0B903j/E69HUphKiV9iQArX8SDYA4w==",
"requires": {
"utrie": "^1.0.2"
}
},
"css-loader": { "css-loader": {
"version": "6.2.0", "version": "6.2.0",
"resolved": "https://registry.npmmirror.com/css-loader/download/css-loader-6.2.0.tgz?cache=0&sync_timestamp=1635967924209&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Fcss-loader%2Fdownload%2Fcss-loader-6.2.0.tgz", "resolved": "https://registry.npmmirror.com/css-loader/download/css-loader-6.2.0.tgz?cache=0&sync_timestamp=1635967924209&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Fcss-loader%2Fdownload%2Fcss-loader-6.2.0.tgz",
@ -8113,6 +8121,15 @@
"integrity": "sha1-e15vfmZen7QfMAB+2eDUHpf7IUA=", "integrity": "sha1-e15vfmZen7QfMAB+2eDUHpf7IUA=",
"dev": true "dev": true
}, },
"html2canvas": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/html2canvas/-/html2canvas-1.4.1.tgz",
"integrity": "sha512-fPU6BHNpsyIhr8yyMpTLLxAbkaK8ArIBcmZIRiBLiDhjeqvXolaEmDGmELFuX9I4xDcaKKcJl+TKZLqruBbmWA==",
"requires": {
"css-line-break": "^2.1.0",
"text-segmentation": "^1.0.3"
}
},
"htmlparser2": { "htmlparser2": {
"version": "3.10.1", "version": "3.10.1",
"resolved": "https://registry.npmmirror.com/htmlparser2/download/htmlparser2-3.10.1.tgz?cache=0&sync_timestamp=1636640940074&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Fhtmlparser2%2Fdownload%2Fhtmlparser2-3.10.1.tgz", "resolved": "https://registry.npmmirror.com/htmlparser2/download/htmlparser2-3.10.1.tgz?cache=0&sync_timestamp=1636640940074&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Fhtmlparser2%2Fdownload%2Fhtmlparser2-3.10.1.tgz",
@ -22662,6 +22679,14 @@
} }
} }
}, },
"text-segmentation": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/text-segmentation/-/text-segmentation-1.0.3.tgz",
"integrity": "sha512-iOiPUo/BGnZ6+54OsWxZidGCsdU8YbE4PSpdPinp7DeMtUJNJBoJ/ouUSTJjHkh1KntHaltHl/gDs2FC4i5+Nw==",
"requires": {
"utrie": "^1.0.2"
}
},
"text-table": { "text-table": {
"version": "0.2.0", "version": "0.2.0",
"resolved": "https://registry.npm.taobao.org/text-table/download/text-table-0.2.0.tgz", "resolved": "https://registry.npm.taobao.org/text-table/download/text-table-0.2.0.tgz",
@ -23211,6 +23236,21 @@
"integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=", "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=",
"dev": true "dev": true
}, },
"utrie": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/utrie/-/utrie-1.0.2.tgz",
"integrity": "sha512-1MLa5ouZiOmQzUbjbu9VmjLzn1QLXBhwpUa7kdLUQK+KQ5KA9I1vk5U4YHe/X2Ch7PYnJfWuWT+VbuxbGwljhw==",
"requires": {
"base64-arraybuffer": "^1.0.2"
},
"dependencies": {
"base64-arraybuffer": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-1.0.2.tgz",
"integrity": "sha512-I3yl4r9QB5ZRY3XuJVEPfc2XhZO6YweFPI+UovAzn+8/hb3oJ6lnysaFcjVpkCPfVWFUDvoZ8kmVDP7WyRtYtQ=="
}
}
},
"uuid": { "uuid": {
"version": "3.4.0", "version": "3.4.0",
"resolved": "https://registry.npmmirror.com/uuid/download/uuid-3.4.0.tgz", "resolved": "https://registry.npmmirror.com/uuid/download/uuid-3.4.0.tgz",

View File

@ -56,6 +56,7 @@
"@swimlane/ngx-charts": "^18.0.1", "@swimlane/ngx-charts": "^18.0.1",
"ajv": "^8.6.2", "ajv": "^8.6.2",
"file-saver": "^2.0.5", "file-saver": "^2.0.5",
"html2canvas": "^1.4.1",
"js-base64": "^3.6.1", "js-base64": "^3.6.1",
"masonry-layout": "^4.2.2", "masonry-layout": "^4.2.2",
"ng-gallery": "^5.0.0", "ng-gallery": "^5.0.0",

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-02-25 17:52:10 * @LastEditTime : 2022-03-02 15:55:18
* @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.
*/ */

View File

@ -34,6 +34,7 @@ export class StartupService {
private coreSrv: CoreService private coreSrv: CoreService
) { ) {
iconSrv.addIcon(...ICONS_AUTO, ...ICONS); iconSrv.addIcon(...ICONS_AUTO, ...ICONS);
this.settingService.setLayout('fixSiderbar', true);
} }
// TODO: 退出登录时需要清理用户信息 // TODO: 退出登录时需要清理用户信息

View File

@ -51,8 +51,6 @@ export class LayoutProMenuComponent implements OnInit, OnDestroy {
} }
}); });
this.menus = res; this.menus = res;
console.log(res);
this.openStatus(); this.openStatus();
} }

View File

@ -32,3 +32,11 @@
} }
} }
} }
.total-footer {
position : absolute;
bottom : 30px;
height : 32px;
margin : 16px 0;
line-height: 32px;
}

View File

@ -78,19 +78,19 @@ export class ContractManagementFrameComponent implements OnInit {
title: '签约对象', title: '签约对象',
width: '100px', width: '100px',
className: 'text-center', className: 'text-center',
index: 'signingObject' index: 'signingObjectLabel'
}, },
{ {
title: '合同类型', title: '合同类型',
width: '100px', width: '100px',
className: 'text-center', className: 'text-center',
index: 'contractType' index: 'contractTypeLabel'
}, },
{ {
title: '合同名称', title: '合同名称',
width: '100px', width: '100px',
className: 'text-center', className: 'text-center',
index: 'contractName' index: 'templateName'
}, },
{ title: '网络货运人', index: 'enterpriseInfoName', width: '120px', className: 'text-center' }, { title: '网络货运人', index: 'enterpriseInfoName', width: '120px', className: 'text-center' },
{ title: '合同对象', index: 'contractObjectName', width: '120px', className: 'text-center' }, { title: '合同对象', index: 'contractObjectName', width: '120px', className: 'text-center' },

View File

@ -1,10 +1,11 @@
import { OnChanges } from '@angular/core';
/* /*
* @Description : * @Description :
* @Version : 1.0 * @Version : 1.0
* @Author : Shiming * @Author : Shiming
* @Date : 2022-01-05 11:01:55 * @Date : 2022-01-05 11:01:55
* @LastEditors : Shiming * @LastEditors : Shiming
* @LastEditTime : 2022-02-24 20:06:26 * @LastEditTime : 2022-02-28 20:22:46
* @FilePath : \\tms-obc-web\\src\\app\\routes\\contract-management\\components\\contract-template-detail\\contract-template-detail.component.ts * @FilePath : \\tms-obc-web\\src\\app\\routes\\contract-management\\components\\contract-template-detail\\contract-template-detail.component.ts
* Copyright (C) 2022 huzhenhong. All rights reserved. * Copyright (C) 2022 huzhenhong. All rights reserved.
*/ */
@ -29,7 +30,7 @@ export class ContractManagementTemplateTextComponent implements OnInit {
public route: ActivatedRoute, public route: ActivatedRoute,
private datePipe: DatePipe, private datePipe: DatePipe,
private router: Router, private router: Router,
public shipperservice: ShipperBaseService, public shipperservice: ShipperBaseService
) {} ) {}
textStatus = '新建模板'; textStatus = '新建模板';
@ViewChild('sf', { static: false }) sf!: SFComponent; @ViewChild('sf', { static: false }) sf!: SFComponent;
@ -40,6 +41,7 @@ export class ContractManagementTemplateTextComponent implements OnInit {
sfdata: any; sfdata: any;
sfdata2: any; sfdata2: any;
title: any; title: any;
Types: any;
templateHTML: any; templateHTML: any;
detailList: any = { detailList: any = {
templateName: '' templateName: ''
@ -76,29 +78,56 @@ export class ContractManagementTemplateTextComponent implements OnInit {
templateType: { templateType: {
title: '模板类型', title: '模板类型',
type: 'string', type: 'string',
default: '', enum: [
{ label: '框架合同', value: 'KJ' },
{ label: '明细合同', value: 'MX' },
{ label: '合伙人合同', value: 'HHR' }
],
ui: { ui: {
widget: 'dict-select', widget: 'select',
params: { dictKey: 'contract:template:type' }, placeholder: '请选择',
containAllLable: true, change: (tag: any, org: any) => {
visibleIf: { console.log(tag);
_$expand: (value: boolean) => value switch (tag) {
case 'MX':
this.Types = [
{ label: '订单合同', value: '1' },
{ label: '订单补充协议', value: '2' },
{ label: '运单合同', value: '3' },
{ label: '运单补充协议', value: '4' },
{ label: '委托代收合同', value: '5' }
];
this.sf.getProperty('/contractType')!.schema.enum = this.Types;
this.sf.getProperty('/contractType')!.widget.reset(this.Types);
this.sf.setValue('/contractType', this.Types);
return;
break;
case 'KJ':
this.Types = [
{ label: '网络货物运输服务合同', value: '6' },
{ label: '运输服务承揽合同', value: '7' }
];
this.sf.getProperty('/contractType')!.schema.enum = this.Types;
this.sf.getProperty('/contractType')!.widget.reset(this.Types);
this.sf.setValue('/contractType', this.Types);
return;
break;
case 'HHR':
this.Types = [
{ label: '企业合伙人入驻合同', value: '8' },
{ label: '个人合伙人入驻合同', value: '9' }
];
this.sf.getProperty('/contractType')!.schema.enum = this.Types;
this.sf.getProperty('/contractType')!.widget.reset(this.Types);
this.sf.setValue('/contractType', this.Types);
return;
break;
default:
break;
}
}
} }
} as SFSelectWidgetSchema
}, },
// contractType: {
// title: '单据类型',
// type: 'string',
// default: '',
// ui: {
// widget: 'dict-select',
// params: { dictKey: 'contract:document:type' },
// containAllLable: true,
// visibleIf: {
// templateType: value => value === 'MX'
// }
// } as SFSelectWidgetSchema
// },
signingObject: { signingObject: {
type: 'string', type: 'string',
title: '承包商对象', title: '承包商对象',
@ -114,13 +143,11 @@ export class ContractManagementTemplateTextComponent implements OnInit {
contractType: { contractType: {
title: '合同类型', title: '合同类型',
type: 'string', type: 'string',
default: '', enum: this.Types,
ui: { ui: {
widget: 'dict-select', widget: 'select',
containsAllLable: true, placeholder: '请选择'
params: { dictKey: 'contract:type' }, }
containAllLable: true,
} as SFSelectWidgetSchema
}, },
resourceType: { resourceType: {
title: '货源类型', title: '货源类型',
@ -133,7 +160,7 @@ export class ContractManagementTemplateTextComponent implements OnInit {
visibleIf: { visibleIf: {
templateType: value => value === 'MX' templateType: value => value === 'MX'
} }
} as SFSelectWidgetSchema, } as SFSelectWidgetSchema
}, },
enterpriseInfoId: { enterpriseInfoId: {
type: 'string', type: 'string',
@ -147,7 +174,7 @@ export class ContractManagementTemplateTextComponent implements OnInit {
}, },
asyncData: () => this.shipperservice.getNetworkFreightForwarder() asyncData: () => this.shipperservice.getNetworkFreightForwarder()
} }
}, }
}, },
required: ['templateName', 'templateType'] required: ['templateName', 'templateType']
}; };
@ -182,7 +209,7 @@ export class ContractManagementTemplateTextComponent implements OnInit {
this.service.request(url, { id: this.route.snapshot.params.id }).subscribe(res => { this.service.request(url, { id: this.route.snapshot.params.id }).subscribe(res => {
if (res) { if (res) {
this.detailList = res; this.detailList = res;
this.title = this.detailList?.templateName this.title = this.detailList?.templateName;
this.sfdata = res; this.sfdata = res;
this.sfdata2 = res; this.sfdata2 = res;
} }
@ -208,7 +235,7 @@ export class ContractManagementTemplateTextComponent implements OnInit {
...this.sf2.value, ...this.sf2.value,
templateTitle: this.title || this.detailList.templateName templateTitle: this.title || this.detailList.templateName
}; };
console.log(params) console.log(params);
this.service.request(this.service.$api_save_contractTemplate, params).subscribe((res: any) => { this.service.request(this.service.$api_save_contractTemplate, params).subscribe((res: any) => {
if (res) { if (res) {
this.service.msgSrv.success('保存成功!'); this.service.msgSrv.success('保存成功!');

View File

@ -131,19 +131,19 @@ export class ContractManagementTemplateFrameComponent implements OnInit {
title: '签约对象', title: '签约对象',
width: '100px', width: '100px',
className: 'text-center', className: 'text-center',
render: 'signingObject' render: 'signingObjectLabel'
}, },
{ {
title: '合同类型', title: '合同类型',
width: '100px', width: '100px',
className: 'text-center', className: 'text-center',
index: 'contractType' index: 'contractTypeLabel'
}, },
{ {
title: '货源类型', title: '货源类型',
width: '100px', width: '100px',
className: 'text-center', className: 'text-center',
index: 'resourceType' index: 'resourceTypeLabel'
}, },
{ title: '创建人', index: 'createUserId', width: '120px', className: 'text-center' }, { title: '创建人', index: 'createUserId', width: '120px', className: 'text-center' },
{ {

View File

@ -131,19 +131,19 @@ export class ContractManagementTemplatePartnerComponent implements OnInit {
title: '签约对象', title: '签约对象',
width: '100px', width: '100px',
className: 'text-center', className: 'text-center',
index: 'signingObject' index: 'signingObjectLabel'
}, },
{ {
title: '合同类型', title: '合同类型',
width: '100px', width: '100px',
className: 'text-center', className: 'text-center',
index: 'contractType' index: 'contractTypeLabel'
}, },
{ {
title: '货源类型', title: '货源类型',
width: '100px', width: '100px',
className: 'text-center', className: 'text-center',
index: 'resourceType' index: 'resourceTypeLabel'
}, },
{ title: '创建人', index: 'createUserId', width: '120px', className: 'text-center' }, { title: '创建人', index: 'createUserId', width: '120px', className: 'text-center' },
{ {

View File

@ -131,19 +131,19 @@ export class ContractManagementTemplateDetailComponent implements OnInit {
title: '签约对象', title: '签约对象',
width: '100px', width: '100px',
className: 'text-center', className: 'text-center',
index: 'signingObject' index: 'signingObjectLabel'
}, },
{ {
title: '合同类型', title: '合同类型',
width: '100px', width: '100px',
className: 'text-center', className: 'text-center',
index: 'contractType' index: 'contractTypeLabel'
}, },
{ {
title: '货源类型', title: '货源类型',
width: '100px', width: '100px',
className: 'text-center', className: 'text-center',
index: 'resourceType' index: 'resourceTypeLabel'
}, },
{ title: '创建人', index: 'createUserId', width: '120px', className: 'text-center' }, { title: '创建人', index: 'createUserId', width: '120px', className: 'text-center' },
{ {

View File

@ -49,7 +49,7 @@ export class AdvanceCollectionComponent implements OnInit {
} }
exportList() { exportList() {
this.service.downloadFile(this.service.$mock_url, { ...this.sf.value, pageIndex: this.st.pi, pageSize: this.st.ps }); this.service.downloadFile(this.service.$mock_url, { ...this.sf.value, pageSize: -1 });
} }
private initSF(): SFSchema { private initSF(): SFSchema {

View File

@ -30,13 +30,13 @@
{{ costInfo?.armoeny | currency }} {{ costInfo?.armoeny | currency }}
</se> </se>
<se label="开票金额" required> <se label="开票金额" required>
{{ costInfo?.arkpmoney | currency }} {{ costInfo?.armoeny | currency }}
</se> </se>
<se label="收款金额" required> <se label="收款金额" required>
{{ costInfo?.armoeny | currency }} {{ costInfo?.armoeny | currency }}
</se> </se>
</se-container> </se-container>
<se-container col="3" labelWidth="100" *ngIf="textStatus" class="mt-md"> <se-container col="3" labelWidth="120" *ngIf="textStatus" class="mt-md">
<se-title class="mb-md" style="font-size: 18px">基本信息(应付费用)</se-title> <se-title class="mb-md" style="font-size: 18px">基本信息(应付费用)</se-title>
<se label="网络货运人" required> <se label="网络货运人" required>
{{ costInfo?.ltdName }} {{ costInfo?.ltdName }}
@ -44,7 +44,7 @@
<se label="费用类型" required> <se label="费用类型" required>
{{ costInfo?.feetypeLabel }} {{ costInfo?.feetypeLabel }}
</se> </se>
<se label="应付核销" required> {{ costInfo?.hrmoney}}</se> <se label="应付核销" required> {{ costInfo?.hrmoney | currency}}</se>
<se label="费用备注"> <se label="费用备注">
{{ costInfo?.hrremarks }} {{ costInfo?.hrremarks }}
</se> </se>
@ -103,8 +103,8 @@
<nz-tab nzTitle="开票信息"> <nz-tab nzTitle="开票信息">
<st #st [scroll]="{ x: '2000px' }" [data]="costInfo?.ficoVatappDatailList" [columns]="columns.requested" <st #st [scroll]="{ x: '2000px' }" [data]="costInfo?.ficoVatappDatailList" [columns]="columns.requested"
[page]="{ show: false }" [loading]="service.http.loading" [scroll]="{ x: '1200px', y: '370px' }"> [page]="{ show: false }" [loading]="service.http.loading" [scroll]="{ x: '1200px', y: '370px' }">
<ng-template st-row="vatnotax" let-item let-index="index"> <ng-template st-row="armoney" let-item let-index="index">
{{ item.vatnotax | currency}} {{ item.armoney | currency}}
</ng-template> </ng-template>
<ng-template st-row="vatmoney" let-item let-index="index"> <ng-template st-row="vatmoney" let-item let-index="index">
{{ item.vatmoney | currency}} {{ item.vatmoney | currency}}
@ -114,7 +114,7 @@
</ng-template> </ng-template>
</st> </st>
</nz-tab> </nz-tab>
<nz-tab nzTitle="收款信息"> <nz-tab nzTitle="收款信息" *ngIf="!textStatus">
<st #st [scroll]="{ x: '2000px' }" [data]="costInfo?.ficoAhxLList" [columns]="columns.collection" <st #st [scroll]="{ x: '2000px' }" [data]="costInfo?.ficoAhxLList" [columns]="columns.collection"
[page]="{ show: false }" [loading]="service.http.loading" [scroll]="{ x: '1200px', y: '370px' }"> [page]="{ show: false }" [loading]="service.http.loading" [scroll]="{ x: '1200px', y: '370px' }">
<ng-template st-row="ahxmoney" let-item let-index="index"> <ng-template st-row="ahxmoney" let-item let-index="index">
@ -139,6 +139,9 @@
<ng-template st-row="no" let-item let-index="index" let-column="column"> <ng-template st-row="no" let-item let-index="index" let-column="column">
{{ index + 1 }} {{ index + 1 }}
</ng-template> </ng-template>
<ng-template st-row="phxmoney" let-item let-index="index" let-column="column">
{{ item.phxmoney | currency}}
</ng-template>
</st> </st>
</nz-tab> </nz-tab>
</nz-tabset> </nz-tabset>

View File

@ -54,10 +54,10 @@ export class CostManagementDetailComponent implements OnInit {
{ title: '费用科目', index: 'feeSubName', className: 'text-left', width: 200 }, { title: '费用科目', index: 'feeSubName', className: 'text-left', width: 200 },
{ {
title: '税率', title: '税率',
index: 'hrvatrate', index: 'arvatrate',
className: 'text-right', className: 'text-right',
width: 200, width: 200,
format: item => `${item.hrvatrate ? ((item.hrvatrate as number) * 100).toFixed(2) : 0}%` format: item => `${item.arvatrate ? ((item.arvatrate as number) * 100).toFixed(2) : 0}%`
}, },
{ title: '费用金额', render: 'hrvatmoney', className: 'text-right', width: 200 }, { title: '费用金额', render: 'hrvatmoney', className: 'text-right', width: 200 },
{ title: '收/付款金额', render: 'armoney', className: 'text-right', width: 200 }, { title: '收/付款金额', render: 'armoney', className: 'text-right', width: 200 },
@ -67,9 +67,9 @@ export class CostManagementDetailComponent implements OnInit {
{ title: '序号', render: 'no', width: 70, className: 'text-left' }, { title: '序号', render: 'no', width: 70, className: 'text-left' },
{ title: '费用明细号', index: 'feeLId', className: 'text-left', width: 200 }, { title: '费用明细号', index: 'feeLId', className: 'text-left', width: 200 },
{ title: '发票申请', index: 'vatinvcode', className: 'text-left', width: 200 }, { title: '发票申请', index: 'vatinvcode', className: 'text-left', width: 200 },
{ title: '发票类型', index: 'vatapptype', className: 'text-left', width: 200 }, { title: '发票类型', index: 'invoicetypeLabel', className: 'text-left', width: 200 },
{ title: '发票号', index: 'vatappcode', className: 'text-left', width: 200 }, { title: '发票号', index: 'invoiceno', className: 'text-left', width: 200 },
{ title: '发票日期', index: 'vatappdate', className: 'text-left', width: 200 }, { title: '发票日期', index: 'invoicedate', className: 'text-left', width: 200 },
{ title: '发票状态', index: 'stsLabel', className: 'text-left', width: 200 }, { title: '发票状态', index: 'stsLabel', className: 'text-left', width: 200 },
{ title: '应收金额', render: 'armoney', className: 'text-left', width: 200 }, { title: '应收金额', render: 'armoney', className: 'text-left', width: 200 },
{ title: '开票金额', render: 'vatmoney', className: 'text-left', width: 200 } { title: '开票金额', render: 'vatmoney', className: 'text-left', width: 200 }
@ -100,9 +100,9 @@ export class CostManagementDetailComponent implements OnInit {
{ title: '付款单号', index: 'phxHId' }, { title: '付款单号', index: 'phxHId' },
{ title: '要求日期', index: 'billTime' }, { title: '要求日期', index: 'billTime' },
{ title: '确认日期', index: 'feedate' }, { title: '确认日期', index: 'feedate' },
{ title: '付款状态', index: 'callNo' }, // { title: '付款状态', index: 'callNo' },
{ title: '应付金额', index: 'callNo' }, { title: '应付金额', render: 'phxmoney' },
{ title: '付款金额', index: 'phxmoney' } { title: '付款金额', render: 'phxmoney' }
] ]
}; };
} }

View File

@ -90,7 +90,7 @@ export class CostManagementComponent implements OnInit {
} }
exportList() { exportList() {
this.service.downloadFile(this.service.$mock_url, { ...this.sf.value, pageIndex: this.st.pi, pageSize: this.st.ps }); this.service.downloadFile(this.service.$mock_url, { ...this.sf.value, pageSize: -1 });
} }
routeTo(url: string, params?: any, status?: any) { routeTo(url: string, params?: any, status?: any) {
@ -188,9 +188,10 @@ export class CostManagementComponent implements OnInit {
searchLoadingText: '搜索中...', searchLoadingText: '搜索中...',
allowClear: true, allowClear: true,
onSearch: (q: any) => { onSearch: (q: any) => {
if (!!q) { let str = q.replace(/^\s+|\s+$/g, '');
if (str) {
return this.service return this.service
.request(this.service.$api_enterpriceList, { enterpriseName: q }) .request(this.service.$api_enterpriceList, { enterpriseName: str })
.pipe(map((res: any) => (res as any[]).map(i => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum)))) .pipe(map((res: any) => (res as any[]).map(i => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum))))
.toPromise(); .toPromise();
} else { } else {
@ -212,9 +213,10 @@ export class CostManagementComponent implements OnInit {
searchLoadingText: '搜索中...', searchLoadingText: '搜索中...',
allowClear: true, allowClear: true,
onSearch: (q: any) => { onSearch: (q: any) => {
if (!!q) { let str = q.replace(/^\s+|\s+$/g, '');
if (str) {
return this.service return this.service
.request(this.service.$api_enterpriceList, { enterpriseName: q }) .request(this.service.$api_enterpriceList, { enterpriseName: str })
.pipe(map((res: any) => (res as any[]).map(i => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum)))) .pipe(map((res: any) => (res as any[]).map(i => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum))))
.toPromise(); .toPromise();
} else { } else {
@ -300,13 +302,13 @@ export class CostManagementComponent implements OnInit {
{ {
text: '浏览', text: '浏览',
click: item => this.routeTo('/financial-management/cost-management/detail/' + item.id, { status: item?.feetypeLabel }), click: item => this.routeTo('/financial-management/cost-management/detail/' + item.id, { status: item?.feetypeLabel }),
acl: { ability: ['FINANCIAL-COST-view'] }, acl: { ability: ['FINANCIAL-COST-view'] }
}, },
{ {
text: '审核', text: '审核',
click: item => this.auditAction(item), click: item => this.auditAction(item),
iif: item => item.sts === 2, iif: item => item.sts === 2,
acl: { ability: ['FINANCIAL-COST-audit'] }, acl: { ability: ['FINANCIAL-COST-audit'] }
} }
// { // {
// text: '修改', // text: '修改',

View File

@ -15,17 +15,17 @@
</nz-statistic> </nz-statistic>
</nz-col> </nz-col>
<nz-col [nzXl]="5" [nzLg]="8" [nzSm]="12"> <nz-col [nzXl]="5" [nzLg]="8" [nzSm]="12">
<nz-statistic [nzValue]="(params?.availableBalance || 0)+'' " [nzTitle]="'账户余额'" <nz-statistic [nzValue]="((params?.availableBalance || 0) | currency)+'' " [nzTitle]="'账户余额'"
[nzValueStyle]="{'font-size':'16px',color:'red'}"> [nzValueStyle]="{'font-size':'16px',color:'red'}">
</nz-statistic> </nz-statistic>
</nz-col> </nz-col>
<nz-col [nzXl]="5" [nzLg]="8" [nzSm]="12"> <nz-col [nzXl]="5" [nzLg]="8" [nzSm]="12">
<nz-statistic [nzValue]="(info?.incomeAmount || 0) +''" [nzTitle]="'收入金额'" <nz-statistic [nzValue]="((info?.incomeAmount || 0) | currency) +''" [nzTitle]="'收入金额'"
[nzValueStyle]="{'font-size':'16px',color:'red'}"> [nzValueStyle]="{'font-size':'16px',color:'red'}">
</nz-statistic> </nz-statistic>
</nz-col> </nz-col>
<nz-col [nzXl]="5" [nzLg]="8" [nzSm]="12"> <nz-col [nzXl]="5" [nzLg]="8" [nzSm]="12">
<nz-statistic [nzValue]="(info?.payAmount || 0) +''" [nzTitle]="'支出金额'" <nz-statistic [nzValue]="((info?.payAmount || 0)| currency) +''" [nzTitle]="'支出金额'"
[nzValueStyle]="{'font-size':'16px',color:'red'}"> [nzValueStyle]="{'font-size':'16px',color:'red'}">
</nz-statistic> </nz-statistic>
</nz-col> </nz-col>

View File

@ -74,7 +74,7 @@ export class DriverAccountDetailComponent implements OnInit {
stChange(e: STChange): void {} stChange(e: STChange): void {}
exportList() { exportList() {
this.service.downloadFile(this.service.$mock_url, { ...this.sf.value, pageIndex: this.st.pi, pageSize: this.st.ps }); this.service.downloadFile(this.service.$mock_url, { ...this.sf.value, pageSize: -1 });
} }
goBack() { goBack() {

View File

@ -74,7 +74,7 @@ export class DriverAccountComponent implements OnInit {
} }
exportList() { exportList() {
this.service.downloadFile(this.service.$mock_url, { ...this.sf.value, pageIndex: this.st.pi, pageSize: this.st.ps }); this.service.downloadFile(this.service.$mock_url, { ...this.sf.value, pageSize: -1 });
} }
private initSF(): SFSchema { private initSF(): SFSchema {

View File

@ -57,4 +57,9 @@
[res]="{ reName: { list: 'data.records', total: 'data.total' } }" [res]="{ reName: { list: 'data.records', total: 'data.total' } }"
[page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100, 200, 300, 500, 1000] }" [page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100, 200, 300, 500, 1000] }"
[loading]="service.http.loading" [scroll]="{ x:'1200px',y: '300px' }" (change)="stChange($event)"></st> [loading]="service.http.loading" [scroll]="{ x:'1200px',y: '300px' }" (change)="stChange($event)"></st>
<div class="total-footer text-md" *ngIf="st?.list?.length !== 0 ">
合计 <label class="text-red-dark">{{ static?.total }}</label> 项,收入
<label class="text-red-dark font-weight-bold">{{ static?.incomeAmount | currency }}</label>,支出
<label class="text-red-dark font-weight-bold">{{static?.payAmount | currency }}</label>
</div>
</nz-card> </nz-card>

View File

@ -20,7 +20,7 @@ export class FreightAccountDetailComponent implements OnInit {
info: any = {}; info: any = {};
params: any = {}; params: any = {};
static: any = {};
_$expand = false; _$expand = false;
constructor(public service: FreightAccountService, private nzModalService: NzModalService, private route: ActivatedRoute) { constructor(public service: FreightAccountService, private nzModalService: NzModalService, private route: ActivatedRoute) {
this.params = route.snapshot.queryParams; this.params = route.snapshot.queryParams;
@ -46,6 +46,7 @@ export class FreightAccountDetailComponent implements OnInit {
} }
}); });
} }
this.loadStatistics(requestOptions.body);
return requestOptions; return requestOptions;
}; };
@ -71,10 +72,18 @@ export class FreightAccountDetailComponent implements OnInit {
}); });
} }
loadStatistics(params: any) {
this.service.request(this.service.$api_get_shipper_account_balance_detail, params).subscribe(res => {
if (res) {
this.static = res;
}
});
}
stChange(e: STChange): void {} stChange(e: STChange): void {}
exportList() { exportList() {
this.service.downloadFile(this.service.$mock_url, { ...this.sf.value, pageIndex: this.st.pi, pageSize: this.st.ps }); this.service.downloadFile(this.service.$mock_url, { ...this.sf.value, pageSize: -1 });
} }
goBack() { goBack() {
@ -186,12 +195,15 @@ export class FreightAccountDetailComponent implements OnInit {
private initST(): STColumn[] { private initST(): STColumn[] {
return [ return [
{ title: '交易时间', index: 'createTime', type: 'date' }, { title: '交易时间', index: 'createTime', type: 'date', width: 170 },
{ title: '流水号', index: 'transactionNumber' }, { title: '流水号', index: 'transactionNumber', width: 170 },
{ title: '交易类型', index: 'tradeTypeLabel', className: 'text-center' }, { title: '交易类型', index: 'tradeTypeLabel', className: 'text-center', width: 140 },
{ title: '关联单号', index: 'businessNumber' }, { title: '交易单号', index: 'businessNumber', width: 170 },
{ title: '所属项目', index: 'projectId' }, { title: '订单号', index: 'orderSn', width: 170 },
{ title: '收支类型', index: 'incomeTypeLabel', className: 'text-center' }, { title: '运单号', index: 'transportSn', width: 170 },
{ title: '货主', index: 'enterpriseName' , width: 170},
{ title: '所属项目', index: 'projectName' , width: 170},
{ title: '收支类型', index: 'incomeTypeLabel', className: 'text-center', width: 140 },
{ {
title: '交易金额', title: '交易金额',
index: 'amount', index: 'amount',
@ -207,7 +219,10 @@ export class FreightAccountDetailComponent implements OnInit {
type: 'widget', type: 'widget',
className: 'text-right', className: 'text-right',
widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.accountBalance }) } widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.accountBalance }) }
} },
{ title: '付款方', index: 'payName' , width: 170},
{ title: '收款方', index: 'payeeName', width: 170 },
{ title: '备注', index: 'tradeContent', width: 170 }
]; ];
} }
} }

View File

@ -80,7 +80,7 @@ export class FreightAccountComponent implements OnInit {
} }
exportList() { exportList() {
this.service.downloadFile(this.service.$mock_url, { ...this.sf.value, pageIndex: this.st.pi, pageSize: this.st.ps }); this.service.downloadFile(this.service.$mock_url, { ...this.sf.value, pageSize: -1 });
} }
private initSF(): SFSchema { private initSF(): SFSchema {
@ -167,10 +167,10 @@ export class FreightAccountComponent implements OnInit {
private initST(): STColumn[] { private initST(): STColumn[] {
return [ return [
{ title: '企业名称', width: 140, index: 'tenantName' }, { title: '企业名称', width: 170, index: 'tenantName' },
{ title: '联系人', width: 120, index: 'name' }, { title: '联系人', width: 120, index: 'name' },
{ title: '联系人电话', width: 140, index: 'phone' }, { title: '联系人电话', width: 140, index: 'phone' },
{ title: '网络货运人', width: 140, index: 'ltdName' }, { title: '网络货运人', width: 170, index: 'ltdName' },
{ title: '银行类型', width: 120, index: 'bankTypeLabel' }, { title: '银行类型', width: 120, index: 'bankTypeLabel' },
{ title: '虚拟账户', width: 140, index: 'virtualAccount' }, { title: '虚拟账户', width: 140, index: 'virtualAccount' },
{ {
@ -199,7 +199,7 @@ export class FreightAccountComponent implements OnInit {
{ {
title: '状态', title: '状态',
index: 'stateDeletedLabel', index: 'stateDeletedLabel',
width: 80, width: 80
}, },
{ {
title: '操作', title: '操作',

View File

@ -29,7 +29,7 @@
{{headerInfo?.ltdAccountId}} {{headerInfo?.ltdAccountId}}
</se> </se>
<se label="应付已核销" required> <se label="应付已核销" required>
{{headerInfo?.payMoney}} {{headerInfo?.payMoney | currency}}
</se> </se>
</div> </div>
<div nz-col [nzXl]="8" [nzLg]="8" [nzSm]="8" [nzXs]="8" se-container [labelWidth]="150" col="1"> <div nz-col [nzXl]="8" [nzLg]="8" [nzSm]="8" [nzXs]="8" se-container [labelWidth]="150" col="1">
@ -37,7 +37,7 @@
{{headerInfo?.payDate}} {{headerInfo?.payDate}}
</se> </se>
<se label="收款账户" required> <se label="收款账户" required>
{{headerInfo?.ltdaccountId}} {{headerInfo?.hrBankName}} - {{headerInfo?.hrBankNo}}
</se> </se>
<se label="确认日期" required> <se label="确认日期" required>
{{headerInfo?.payDate}} {{headerInfo?.payDate}}
@ -51,7 +51,7 @@
{{headerInfo?.payModeLabel}} {{headerInfo?.payModeLabel}}
</se> </se>
<se label="付款类型" required> <se label="付款类型" required>
{{headerInfo?.payType}} {{headerInfo?.payTypeLabel}}
</se> </se>
<se label="付款金额" required> <se label="付款金额" required>
{{headerInfo?.payMoney |currency}} {{headerInfo?.payMoney |currency}}

View File

@ -36,9 +36,9 @@
{{ item.orderPaymentCode }} <br> <a>{{ item.paymentStatusLabel }}</a> {{ item.orderPaymentCode }} <br> <a>{{ item.paymentStatusLabel }}</a>
</ng-template> </ng-template>
<ng-template st-row="amountDetails" let-item let-index="index" let-column="column"> <ng-template st-row="amountDetails" let-item let-index="index" let-column="column">
预付:{{ item.price }}<br /> 预付:{{ item.price | currency }}<br />
<ng-container *ngIf="item.payType==='1'"> <ng-container *ngIf="item.payType==='1'">
附加费: {{ item.surcharge }} 附加费: {{ item.surcharge| currency }}
</ng-container> </ng-container>
</ng-template> </ng-template>
<ng-template st-row="billCode" let-item let-index="index" let-column="column"> <ng-template st-row="billCode" let-item let-index="index" let-column="column">

View File

@ -242,7 +242,7 @@ export class PaymentRecordComponent implements OnInit {
{ {
title: '支付金额', title: '支付金额',
render: 'payAmount', render: 'payAmount',
width: 120, width: 140,
type: 'widget', type: 'widget',
className: 'text-right', className: 'text-right',
widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.payAmount }) } widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.payAmount }) }
@ -256,7 +256,7 @@ export class PaymentRecordComponent implements OnInit {
(item.amountDetails as Array<any>).forEach(detail => { (item.amountDetails as Array<any>).forEach(detail => {
surcharge += detail.surcharge || 0; surcharge += detail.surcharge || 0;
}); });
item.surcharge = surcharge; item.surcharge = surcharge.toFixed(2);
item.price = item.amountDetails?.[0]?.price || 0; item.price = item.amountDetails?.[0]?.price || 0;
return ''; return '';
} }

View File

@ -65,7 +65,7 @@ export class PlatformAccountDetailComponent implements OnInit {
stChange(e: STChange): void {} stChange(e: STChange): void {}
exportList() { exportList() {
this.service.downloadFile(this.service.$mock_url, { ...this.sf.value, pageIndex: this.st.pi, pageSize: this.st.ps }); this.service.downloadFile(this.service.$mock_url, { ...this.sf.value, pageSize: -1 });
} }
goBack() { goBack() {

View File

@ -52,7 +52,13 @@
</nz-card> </nz-card>
<nz-card class="content-box"> <nz-card class="content-box">
<st #st [data]="service.$api_get_platform_account_page" [columns]="columns" [req]="{ process: beforeReq }" [page]="{}" <st #st [data]="service.$api_get_platform_account_page" [columns]="columns" [req]="{ process: beforeReq }"
[scroll]="{ x: '1200px' }" [loading]="service.http.loading"> [page]="{}" [scroll]="{ x: '1200px' }" [loading]="service.http.loading">
</st> </st>
<div class="total-footer text-md" *ngIf="st?.list?.length !== 0 ">
合计 <label class="text-red-dark">{{ static?.total }}</label> 项,收入
<label class="text-red-dark font-weight-bold">{{ static?.incomeAmount | currency }}</label>,支出
<label class="text-red-dark font-weight-bold">{{static?.payAmount | currency }}</label>
</div>
</nz-card> </nz-card>

View File

@ -19,6 +19,8 @@ export class PlatformAccountComponent implements OnInit {
columns: STColumn[] = this.initST(); columns: STColumn[] = this.initST();
info: any = {}; info: any = {};
static: any = {};
constructor(public service: FreightAccountService, private router: Router, private nzModalService: NzModalService) {} constructor(public service: FreightAccountService, private router: Router, private nzModalService: NzModalService) {}
ngOnInit(): void { ngOnInit(): void {
@ -29,6 +31,7 @@ export class PlatformAccountComponent implements OnInit {
if (this.sf) { if (this.sf) {
Object.assign(requestOptions.body, { ...this.sf.value }); Object.assign(requestOptions.body, { ...this.sf.value });
} }
this.loadStatistics(requestOptions.body);
return requestOptions; return requestOptions;
}; };
@ -44,6 +47,14 @@ export class PlatformAccountComponent implements OnInit {
}); });
} }
loadStatistics(params: any) {
this.service.request(this.service.$api_get_platform_account_statistics, params).subscribe(res => {
if (res) {
this.static = res;
}
});
}
/** /**
* 重置表单 * 重置表单
*/ */

View File

@ -42,10 +42,10 @@ export class ReceivableOrderDetailComponent implements OnInit {
} }
beforeReq = (requestOptions: STRequestOptions) => { beforeReq = (requestOptions: STRequestOptions) => {
Object.assign(requestOptions.body, { billHId: this.billHId }); Object.assign(requestOptions.body, { ahxHId: this.id });
if (this.sf) { if (this.sf) {
Object.assign(requestOptions.body, { Object.assign(requestOptions.body, {
...this.sf.value, ...this.sf.value
}); });
if (this.sf.value.feedate?.[0]) { if (this.sf.value.feedate?.[0]) {
Object.assign(requestOptions.body, { Object.assign(requestOptions.body, {
@ -108,7 +108,7 @@ export class ReceivableOrderDetailComponent implements OnInit {
widget: 'select', widget: 'select',
placeholder: '请选择', placeholder: '请选择',
allowClear: true, allowClear: true,
asyncData: () => this.service.getCloseAccount(), asyncData: () => this.service.getCloseAccount()
}, },
default: '' default: ''
}, },
@ -122,7 +122,7 @@ export class ReceivableOrderDetailComponent implements OnInit {
expand: (value: boolean) => value expand: (value: boolean) => value
} }
} as SFDateWidgetSchema } as SFDateWidgetSchema
}, }
// billTime: { // billTime: {
// title: '订单日期', // title: '订单日期',
// type: 'string', // type: 'string',
@ -146,8 +146,8 @@ export class ReceivableOrderDetailComponent implements OnInit {
{ title: '订单号', index: 'billHCode', width: 100 }, { title: '订单号', index: 'billHCode', width: 100 },
// { title: '订单日期', index: 'billTime', width: 150 }, // { title: '订单日期', index: 'billTime', width: 150 },
// { title: '费用类型', index: 'cnoName', width: 90 }, // { title: '费用类型', index: 'cnoName', width: 90 },
// { title: '订单费用科目', index: 'feeSubId', width: 100 }, { title: '订单费用科目', index: 'billLTypeLabel', width: 100 },
{ title: '费用科目', index: 'feeSubId', width: 140 }, { title: '费用科目', index: 'feeSubName', width: 140 },
{ title: '结算客户', index: 'cnoName', width: 100 }, { title: '结算客户', index: 'cnoName', width: 100 },
{ {
title: '已收金额', title: '已收金额',

View File

@ -49,7 +49,7 @@ export class RechargeRecordComponent implements OnInit {
} }
exportList() { exportList() {
this.service.downloadFile(this.service.$mock_url, { ...this.sf.value, pageIndex: this.st.pi, pageSize: this.st.ps }); this.service.downloadFile(this.service.$mock_url, { ...this.sf.value, pageSize: -1 });
} }
private initSF(): SFSchema { private initSF(): SFSchema {
@ -162,9 +162,16 @@ export class RechargeRecordComponent implements OnInit {
{ title: '网络货运人', index: 'ltdName', width: 160 }, { title: '网络货运人', index: 'ltdName', width: 160 },
{ title: '银行类型', index: 'bankTypeLabel', width: 100 }, { title: '银行类型', index: 'bankTypeLabel', width: 100 },
{ title: '账户类型', index: 'accountTypeLabel', width: 100 }, { title: '账户类型', index: 'accountTypeLabel', width: 100 },
{ title: '账户名称', index: 'rechargeName', width: 140 }, { title: '账户名称', index: 'rechargeName', width: 160 },
{ title: '虚拟账户', index: 'virtualAccount', width: 100 }, { title: '虚拟账户', index: 'virtualAccount', width: 100 },
{ title: '充值金额', index: 'rechargeAmount', width: 100 }, {
title: '充值金额',
index: 'rechargeAmount',
width: 160,
type: 'widget',
className: 'text-right',
widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.rechargeAmount }) }
},
{ title: '充值银行账户', render: 'transferBankAccount', width: 200 }, { title: '充值银行账户', render: 'transferBankAccount', width: 200 },
{ title: '充值方式', index: 'payChannelLabel', width: 100 }, { title: '充值方式', index: 'payChannelLabel', width: 100 },
{ title: '充值状态', index: 'rechargeStatusLabel', width: 100 }, { title: '充值状态', index: 'rechargeStatusLabel', width: 100 },

View File

@ -25,8 +25,8 @@
<nz-tabset> <nz-tabset>
<nz-tab nzTitle="全部" (nzClick)="changeRefundStatus()"></nz-tab> <nz-tab nzTitle="全部" (nzClick)="changeRefundStatus()"></nz-tab>
<nz-tab nzTitle="待审核" (nzClick)="changeRefundStatus('1')"></nz-tab> <nz-tab nzTitle="待审核" (nzClick)="changeRefundStatus('1')"></nz-tab>
<nz-tab nzTitle="退款中" (nzClick)="changeRefundStatus('2')"></nz-tab> <nz-tab nzTitle="退款中" (nzClick)="changeRefundStatus('4')"></nz-tab>
<nz-tab nzTitle="退款成功" (nzClick)="changeRefundStatus('3')"></nz-tab> <nz-tab nzTitle="退款成功" (nzClick)="changeRefundStatus('2')"></nz-tab>
<nz-tab nzTitle="退款失败" (nzClick)="changeRefundStatus('5')"></nz-tab> <nz-tab nzTitle="退款失败" (nzClick)="changeRefundStatus('5')"></nz-tab>
</nz-tabset> </nz-tabset>

View File

@ -24,18 +24,20 @@ export class RefundRecordComponent implements OnInit {
refundStatus: any = ''; refundStatus: any = '';
msg = ''; msg = '';
constructor(public service: FreightAccountService, private nzModalService: NzModalService, private router: Router) {} constructor(public service: FreightAccountService, private nzModalService: NzModalService, private router: Router) {}
ngOnInit(): void {} ngOnInit(): void {
}
beforeReq = (requestOptions: STRequestOptions) => { beforeReq = (requestOptions: STRequestOptions) => {
Object.assign(requestOptions.body, { refundStatus: this.refundStatus || null }); Object.assign(requestOptions.body, { refundStatus: this.refundStatus || null });
if (this.sf) { if (this.sf) {
Object.assign(requestOptions.body, { Object.assign(requestOptions.body, {
...this.sf.value, ...this.sf.value,
createTime: { refundExecuteTime: {
start: this.sf.value.createTime?.[0] || '', start: this.sf.value.refundExecuteTime?.[0] || '',
end: this.sf.value.createTime?.[1] || '' end: this.sf.value.refundExecuteTime?.[1] || ''
} }
}); });
} }
@ -58,7 +60,7 @@ export class RefundRecordComponent implements OnInit {
type: 'default', type: 'default',
onClick: () => { onClick: () => {
if (!this.msg) { if (!this.msg) {
this.service.msgSrv.warning('请填写原因') this.service.msgSrv.warning('请填写原因');
return false; return false;
} }
this.service this.service
@ -250,10 +252,10 @@ export class RefundRecordComponent implements OnInit {
private initST(): STColumn[] { private initST(): STColumn[] {
return [ return [
{ title: '退款单号', render: 'orderRefundCode', width: 190 }, { title: '退款单号', render: 'orderRefundCode', width: 190 },
{ title: '退款类型', index: 'refundTypeLabel', width: 130 }, { title: '退款类型', index: 'refundTypeLabel', width: 140 },
{ title: '退款金额', render: 'refundAmount', className: 'text-right', width: 160 }, { title: '退款金额', render: 'refundAmount', className: 'text-right', width: 180 },
{ title: '退款时间', index: 'applyTime', width: 170 }, { title: '退款时间', index: 'refundExecuteTime', width: 170 },
{ title: '货主', index: 'shipperId', width: 150 }, { title: '企业名称', index: 'enterpriseInfoName', width: 150 },
{ title: '所属项目', index: 'enterpriseProjectName', width: 140 }, { title: '所属项目', index: 'enterpriseProjectName', width: 140 },
{ title: '支付单', render: 'billRefundPaymentVOS', width: 150 }, { title: '支付单', render: 'billRefundPaymentVOS', width: 150 },
{ title: '订单号', index: 'billCode', width: 150 }, { title: '订单号', index: 'billCode', width: 150 },

View File

@ -22,7 +22,7 @@
<!-- <button nz-button nzType="primary" [nzLoading]="service.http.loading" style="float: right;">打印</button> --> <!-- <button nz-button nzType="primary" [nzLoading]="service.http.loading" style="float: right;">打印</button> -->
</se-title> </se-title>
<se label="帐套" required> <se label="帐套" required>
{{info?.ltdId}} {{info?.vcltdcode}} - {{info?.vcltdname}}
</se> </se>
<se label="凭证类型" required> <se label="凭证类型" required>
{{info?.vctype}} {{info?.vctype}}

View File

@ -13,9 +13,7 @@ import { Component, OnInit, ViewChild } from '@angular/core';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
import { STComponent, STColumn, STRequestOptions, STChange } from '@delon/abc/st'; import { STComponent, STColumn, STRequestOptions, STChange } from '@delon/abc/st';
import { SFComponent, SFSchema, SFDateWidgetSchema } from '@delon/form'; import { SFComponent, SFSchema, SFDateWidgetSchema } from '@delon/form';
import { ShipperBaseService } from '@shared';
import { NzModalService } from 'ng-zorro-antd/modal'; import { NzModalService } from 'ng-zorro-antd/modal';
import { AddCollectionInvoiceModalComponent } from 'src/app/routes/ticket-management/components/input-invoice/add-collection-invoice-modal/add-collection-invoice-modal.component';
import { FreightAccountService } from '../../services/freight-account.service'; import { FreightAccountService } from '../../services/freight-account.service';
@Component({ @Component({
@ -294,7 +292,7 @@ export class VoucherManagementComponent implements OnInit {
return [ return [
{ title: '', index: 'key', type: 'checkbox', width: 60, className: 'text-center', fixed: 'left' }, { title: '', index: 'key', type: 'checkbox', width: 60, className: 'text-center', fixed: 'left' },
{ title: '凭证号', index: 'vccode', type: 'link', width: 200 }, { title: '凭证号', index: 'vccode', type: 'link', width: 200 },
{ title: '帐套', index: 'ltdId', width: 200 }, { title: '帐套', index: 'ltdId', width: 200,format:item=>`${item.vcltdcode}-${item.vcltdname}` },
{ title: '凭证时间', index: 'vctime', type: 'date', width: 200 }, { title: '凭证时间', index: 'vctime', type: 'date', width: 200 },
{ title: '凭证类型', index: 'vctype', width: 200 }, { title: '凭证类型', index: 'vctype', width: 200 },
{ title: '序号', index: 'invmoney', width: 200, format: _ => '1' }, { title: '序号', index: 'invmoney', width: 200, format: _ => '1' },

View File

@ -47,7 +47,7 @@
{{formData?.bankSerialNumber}} {{formData?.bankSerialNumber}}
</se> </se>
<se label="提现至银行卡"> <se label="提现至银行卡">
{{formData?.bankId}} {{formData?.bankCardNumber}}
</se> </se>
<se label="银行回单" col="1"> <se label="银行回单" col="1">
<a (click)="downBack()">{{formData?.refundStatus==='3'?'下载回单':'暂无回单'}}</a> <a (click)="downBack()">{{formData?.refundStatus==='3'?'下载回单':'暂无回单'}}</a>

View File

@ -25,6 +25,8 @@ export class FreightAccountService extends ShipperBaseService {
// 运营端获取平台余额 // 运营端获取平台余额
$api_get_platform_account_header = '/api/fcc/accountBalance/getPlatformBalanceByOperator'; $api_get_platform_account_header = '/api/fcc/accountBalance/getPlatformBalanceByOperator';
// 运营端获取平台余额 // 运营端获取平台余额
$api_get_platform_account_statistics = '/api/fcc/accountBalanceDetail/getAccountBalancePlatformIncomeDetailByOperator';
// 运营端获取平台余额
$api_get_platform_account_page = '/api/fcc/accountBalance/getPlatformAccountBalanceByOperator'; $api_get_platform_account_page = '/api/fcc/accountBalance/getPlatformAccountBalanceByOperator';
// 运营端获取账户余额交易明细 // 运营端获取账户余额交易明细
$api_get_platform_account_detail_page = '/api/fcc/accountBalanceDetail/getAccountBalanceByPage'; $api_get_platform_account_detail_page = '/api/fcc/accountBalanceDetail/getAccountBalanceByPage';

View File

@ -4,7 +4,7 @@
* @Author : Shiming * @Author : Shiming
* @Date : 2022-01-12 10:52:50 * @Date : 2022-01-12 10:52:50
* @LastEditors : Shiming * @LastEditors : Shiming
* @LastEditTime : 2022-02-24 20:03:23 * @LastEditTime : 2022-02-28 17:00:48
* @FilePath : \\tms-obc-web\\src\\app\\routes\\insurance-management\\components\\list\\list.component.html * @FilePath : \\tms-obc-web\\src\\app\\routes\\insurance-management\\components\\list\\list.component.html
* Copyright (C) 2022 huzhenhong. All rights reserved. * Copyright (C) 2022 huzhenhong. All rights reserved.
--> -->
@ -91,6 +91,11 @@
<div> <div>
{{ item?.billCode }} {{ item?.billCode }}
</div> </div>
</ng-template>
<ng-template st-row="resourceCode" let-item let-index="index">
<div>
{{ item?.resourceCode }}
</div>
<div> <div>
{{ item?.resourceStatusLabel }} {{ item?.resourceStatusLabel }}
</div> </div>

View File

@ -213,9 +213,10 @@ export class insuranceManagementListComponent implements OnInit {
_$expand: (value: boolean) => value _$expand: (value: boolean) => value
}, },
onSearch: (q: any) => { onSearch: (q: any) => {
if (!!q) { let str =q.replace(/^\s+|\s+$/g,"");
if (str) {
return this.service return this.service
.request(this.service.$api_enterpriceList, { enterpriseName: q }) .request(this.service.$api_enterpriceList, { enterpriseName: str })
.pipe(map((res: any) => (res as any[]).map(i => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum)))) .pipe(map((res: any) => (res as any[]).map(i => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum))))
.toPromise(); .toPromise();
} else { } else {
@ -412,7 +413,7 @@ export class insuranceManagementListComponent implements OnInit {
{ {
title: '货源编号', title: '货源编号',
className: 'text-right', className: 'text-right',
index: 'resourceCode', render: 'resourceCode',
width: '150px' width: '150px'
}, },
{ {
@ -480,6 +481,7 @@ export class insuranceManagementListComponent implements OnInit {
{ {
text: '查看保单', text: '查看保单',
click: _record => this.showImg(_record), click: _record => this.showImg(_record),
iif: item => item.insureStatus == '2'
// acl: { ability: ['VEHICLE-LIST-view'] }, // acl: { ability: ['VEHICLE-LIST-view'] },
// iif: item => // iif: item =>
// item.billStatus == '4' || item.billStatus == '5' || item.billStatus == '2' || item.billStatus == '3' || item.billStatus == '1' // item.billStatus == '4' || item.billStatus == '5' || item.billStatus == '2' || item.billStatus == '3' || item.billStatus == '1'
@ -487,6 +489,7 @@ export class insuranceManagementListComponent implements OnInit {
{ {
text: '退保费', text: '退保费',
click: _record => this.retreatPrice(_record), click: _record => this.retreatPrice(_record),
iif: item => item.insureStatus == '2'
// acl: { ability: ['VEHICLE-LIST-view'] }, // acl: { ability: ['VEHICLE-LIST-view'] },
} }
] ]
@ -531,7 +534,7 @@ export class insuranceManagementListComponent implements OnInit {
nzContent: '退还后不可撤销,请谨慎操作!', nzContent: '退还后不可撤销,请谨慎操作!',
nzCancelText: '取消', nzCancelText: '取消',
nzOnOk: () => { nzOnOk: () => {
this.service.request(this.service.$api_del_many, [value.id]).subscribe(res => { this.service.request(this.service.$api_get_addINPBillRefundApplication, {id: value.id}).subscribe(res => {
if (res) { if (res) {
this.service.msgSrv.success('删除菜单成功'); this.service.msgSrv.success('删除菜单成功');
} }

View File

@ -4,7 +4,7 @@
* @Author : Shiming * @Author : Shiming
* @Date : 2021-12-03 15:31:52 * @Date : 2021-12-03 15:31:52
* @LastEditors : Shiming * @LastEditors : Shiming
* @LastEditTime : 2022-02-10 10:40:56 * @LastEditTime : 2022-02-28 17:11:54
* @FilePath : \\tms-obc-web\\src\\app\\routes\\insurance-management\\services\\insurance-management.service.ts * @FilePath : \\tms-obc-web\\src\\app\\routes\\insurance-management\\services\\insurance-management.service.ts
* Copyright (C) 2022 huzhenhong. All rights reserved. * Copyright (C) 2022 huzhenhong. All rights reserved.
*/ */
@ -27,6 +27,8 @@ export class InsuranceManagementService extends ShipperBaseService {
// 保险费公司认证 // 保险费公司认证
$api_get_submitAuthInfo = `/api/sdc/premiumInfo/submitAuthInfo`; $api_get_submitAuthInfo = `/api/sdc/premiumInfo/submitAuthInfo`;
// 退保费
$api_get_addINPBillRefundApplication = `/billRefundApplication/addINPBillRefundApplication`;
constructor(public injector: Injector, public eaCacheSrv: EACacheService) { constructor(public injector: Injector, public eaCacheSrv: EACacheService) {
super(injector, eaCacheSrv); super(injector, eaCacheSrv);

View File

@ -4,7 +4,7 @@
* @Author : Shiming * @Author : Shiming
* @Date : 2021-12-24 16:58:02 * @Date : 2021-12-24 16:58:02
* @LastEditors : Shiming * @LastEditors : Shiming
* @LastEditTime : 2022-01-20 20:32:44 * @LastEditTime : 2022-03-01 13:42:44
* @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\components\\bulk-detail-change\\bulk-detail-change.component.html * @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\components\\bulk-detail-change\\bulk-detail-change.component.html
* Copyright (C) 2022 huzhenhong. All rights reserved. * Copyright (C) 2022 huzhenhong. All rights reserved.
--> -->
@ -89,6 +89,7 @@
(click)="openMap('start', idx)" (click)="openMap('start', idx)"
formControlName="loadAddress{{ idx }}" formControlName="loadAddress{{ idx }}"
placeholder="请输入装货地" placeholder="请输入装货地"
readonly="true"
/> />
</nz-input-group> </nz-input-group>
</div> </div>
@ -141,6 +142,7 @@
formControlName="unloadAddress{{ idx }}" formControlName="unloadAddress{{ idx }}"
placeholder="请输入卸货地" placeholder="请输入卸货地"
name="unloadAddress{{ idx }}" name="unloadAddress{{ idx }}"
readonly="true"
/> />
</nz-input-group> </nz-input-group>
</div> </div>

View File

@ -4,7 +4,7 @@
* @Author : Shiming * @Author : Shiming
* @Date : 2021-12-06 20:20:26 * @Date : 2021-12-06 20:20:26
* @LastEditors : Shiming * @LastEditors : Shiming
* @LastEditTime : 2022-02-15 14:52:18 * @LastEditTime : 2022-03-02 11:14:37
* @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\components\\bulk-detail\\bulk-detail.component.html * @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\components\\bulk-detail\\bulk-detail.component.html
* Copyright (C) 2022 huzhenhong. All rights reserved. * Copyright (C) 2022 huzhenhong. All rights reserved.
--> -->
@ -62,17 +62,13 @@
<div style="width: 60%; margin: 0 auto"> <div style="width: 60%; margin: 0 auto">
   
<nz-steps [nzCurrent]="i?.scheduleVOList?.length + 1" nzLabelPlacement="vertical"> <nz-steps [nzCurrent]="i?.scheduleVOList?.length + 1" nzLabelPlacement="vertical">
 
<nz-step <nz-step
*ngFor="let item of i?.scheduleVOList" *ngFor="let item of i?.scheduleVOList"
[nzTitle]="item.state" [nzTitle]="item.state"
[nzSubtitle]="item.stateTime" [nzSubtitle]="item.stateTime"
[nzStatus]="item.displayStatus === 'SHOW' ? 'finish' : 'wait'" [nzStatus]="item.displayStatus === 'SHOW' ? 'finish' : 'wait'"
> ></nz-step>
  </nz-steps>
</nz-step>
 </nz-steps
>
</div> </div>
</div> </div>
</nz-card> </nz-card>
@ -95,8 +91,8 @@
{{ i?.unloadPlanTime }} {{ i?.unloadPlanTime }}
</sv> </sv>
<sv label="接单数量"> {{ i?.acceptWeight }}吨,{{ i?.acceptVolume }}方,{{ i?.acceptNumber }}件 </sv> <sv label="接单数量"> {{ i?.acceptWeight }}吨,{{ i?.acceptVolume }}方,{{ i?.acceptNumber }}件 </sv>
<sv label="装货数量"> {{ i?.acceptWeight }}吨,{{ i?.acceptVolume }}方,{{ i?.acceptNumber }}件 </sv> <sv *ngIf="i?.billStatus =='3' || i?.billStatus =='4' || i?.billStatus =='5'" label="装货数量"> {{ i?.acceptWeight }}吨,{{ i?.acceptVolume }}方,{{ i?.acceptNumber }}件 </sv>
<sv label="卸货数量"> {{ i?.settlementWeight }}吨,{{ i?.settlementVolume }}方,{{ i?.acceptNumber }}件 </sv> <sv *ngIf="i?.billStatus =='4' || i?.billStatus =='5'" label="卸货数量"> {{ i?.settlementWeight }}吨,{{ i?.settlementVolume }}方,{{ i?.acceptNumber }}件 </sv>
</sv-container> </sv-container>
<div class="mt-md"> <div class="mt-md">
<h4 class="text-md" <h4 class="text-md"
@ -140,7 +136,8 @@
</nz-card> </nz-card>
<nz-card nzTitle="运费信息" #distannce3> <nz-card nzTitle="运费信息" #distannce3>
<h2>{{i?.goodsInfoList?.[0]?.freightPrice}}{{i?.goodsInfoList?.[0]?.freightTypeLabel}}(以发货为准,保留小数)</h2> <h2>{{i?.goodsInfoList?.[0]?.freightPrice}}{{i?.goodsInfoList?.[0]?.freightTypeLabel}}(以发货为准,保留小数)</h2>
<st #st [data]="i?.billExpenseDetails" [columns]="logColumns" [ps]="0" [page]="{ show: false, showSize: false }"> <st #st [data]="billExpenses" [columns]="logColumns" [ps]="0" [page]="{ show: false, showSize: false }">
<ng-template st-row="PriceType" let-item let-index="index"> 到付 </ng-template>
<ng-template st-row="price" let-item let-index="index"> <ng-template st-row="price" let-item let-index="index">
{{ item.price | currency }} {{ item.price | currency }}
</ng-template> </ng-template>
@ -205,11 +202,11 @@
<nz-card nzTitle="轨迹信息" style="width: 100%" [nzExtra]="extraTemplate" #distannce5> <nz-card nzTitle="轨迹信息" style="width: 100%" [nzExtra]="extraTemplate" #distannce5>
<div nz-row> <div nz-row>
<div nz-col [nzSpan]="12"> <div nz-col [nzSpan]="12">
<st #st [data]="i?.auditRecordList" [columns]="logColumns" [ps]="0" [page]="{ show: false, showSize: false }"> <st [scroll]="{y: '500px'}" #st [data]="addressItems" [columns]="logColumns" [ps]="0" [page]="{ show: false, showSize: false }">
</st> </st>
</div> </div>
<div nz-col [nzSpan]="12"> <div nz-col [nzSpan]="12">
<amap-path-simplifier [MapList]="MapList"></amap-path-simplifier> <amap-path-simplifier [mapWidth]="'100%'" [mapHeight]="'600px'" [MapList]="MapList"></amap-path-simplifier>
</div> </div>
</div> </div>
</nz-card> </nz-card>

View File

@ -4,7 +4,7 @@
* @Author : Shiming * @Author : Shiming
* @Date : 2021-12-06 20:20:26 * @Date : 2021-12-06 20:20:26
* @LastEditors : Shiming * @LastEditors : Shiming
* @LastEditTime : 2022-02-22 10:16:11 * @LastEditTime : 2022-03-02 11:15:45
* @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\components\\bulk-detail\\bulk-detail.component.ts * @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\components\\bulk-detail\\bulk-detail.component.ts
* Copyright (C) 2022 huzhenhong. All rights reserved. * Copyright (C) 2022 huzhenhong. All rights reserved.
*/ */
@ -25,15 +25,16 @@ import format from 'date-fns/format';
styleUrls: ['./bulk-detail.component.less'] styleUrls: ['./bulk-detail.component.less']
}) })
export class OrderManagementBulkeDetailComponent implements OnInit { export class OrderManagementBulkeDetailComponent implements OnInit {
MapList: any; MapList: any[]=[];
id = this.route.snapshot.params.id; id = this.route.snapshot.params.id;
billExpenses: any[] = []; //运费信息表格信息
i: any; i: any;
imges: any; imges: any;
totalObj: any; totalObj: any;
attObj: any; attObj: any;
isVisible = false; isVisible = false;
logColumns: STColumn[] = [ logColumns: STColumn[] = [
{ title: '款项', index: 'expenseName' }, { title: '款项', index: 'costName', render: 'PriceType' },
{ title: '运输费(元)', render: 'price' }, { title: '运输费(元)', render: 'price' },
{ title: '附加费(元)', render: 'surcharge' }, { title: '附加费(元)', render: 'surcharge' },
{ title: '支付时间', index: 'paymentTime' }, { title: '支付时间', index: 'paymentTime' },
@ -70,8 +71,10 @@ export class OrderManagementBulkeDetailComponent implements OnInit {
this.service.request(this.service.$api_getBulkBillDetail, { id: this.id }).subscribe(res => { this.service.request(this.service.$api_getBulkBillDetail, { id: this.id }).subscribe(res => {
if (res) { if (res) {
this.i = res; this.i = res;
this.attObj = this.i?.billExpenseDetails?.filter((data: any) => data.expenseCode === 'ATT')[0]; console.log(this.i.billExpenseDetails )
this.totalObj = this.i?.billExpenseDetails?.filter((data: any) => data.expenseCode === 'TOTAL')[0]; this.billExpenses = this.i?.billExpenseDetails?.filter((data: any) => data.expenseCode === 'TRA');
console.log(this.billExpenses )
this.i.scheduleVOList = this.i?.scheduleVOList?.filter((data:any)=>data.displayStatus !=="HIDE");
} }
}); });
} }
@ -122,17 +125,18 @@ export class OrderManagementBulkeDetailComponent implements OnInit {
this.service.request(this.service.$api_get_getTrajectory, { id: this.id }).subscribe(res => { this.service.request(this.service.$api_get_getTrajectory, { id: this.id }).subscribe(res => {
if (res) { if (res) {
const points = res.trackArray; const points = res.trackArray;
let list :any[] = [];
points?.forEach((item: any) => { points?.forEach((item: any) => {
this.MapList.push({ list.push({
name: item.hgt, name: item.hgt,
lnglat: [Number((Number(item.lon) / 600000).toFixed(6)), Number((Number(item.lat) / 600000).toFixed(6))] lnglat: [Number((Number(item.lon) / 600000).toFixed(6)), Number((Number(item.lat) / 600000).toFixed(6))]
}); });
}); });
this.MapList = list;
this.addressItems = res.parkArray; this.addressItems = res.parkArray;
if(this.addressItems && this.addressItems.length > 0){ if(this.addressItems && this.addressItems.length > 0){
this.addressItems.forEach(item => { this.addressItems.forEach(item => {
item.parkBte = this.getLocalTime(item.parkBte); item.vinOutTime = this.getLocalTime(item.vinOutTime);
item.parkEte = this.getLocalTime(item.parkEte);
}); });
} }
} }

View File

@ -4,7 +4,7 @@
* @Author : Shiming * @Author : Shiming
* @Date : 2022-01-12 10:52:50 * @Date : 2022-01-12 10:52:50
* @LastEditors : Shiming * @LastEditors : Shiming
* @LastEditTime : 2022-02-28 13:59:36 * @LastEditTime : 2022-03-02 14:56:27
* @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\components\\bulk\\bulk.component.html * @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\components\\bulk\\bulk.component.html
* Copyright (C) 2022 huzhenhong. All rights reserved. * Copyright (C) 2022 huzhenhong. All rights reserved.
--> -->
@ -32,11 +32,11 @@
<sf #sf [schema]="schema" [ui]="ui" [compact]="true" [button]="'none'"></sf> <sf #sf [schema]="schema" [ui]="ui" [compact]="true" [button]="'none'"></sf>
</div> </div>
<div nz-col [nzSpan]="_$expand ? 24 : 6" [class.text-right]="_$expand"> <div nz-col [nzSpan]="_$expand ? 24 : 6" [class.text-right]="_$expand">
<button nz-button nzType="primary" [nzLoading]="service.http.loading" (click)="search()" acl [acl-ability]="['ORDER-BULK-search']" <button nz-button nzType="primary" [nzLoading]="loading" (click)="search()" acl [acl-ability]="['ORDER-BULK-search']"
>查询</button >查询</button
> >
<button nz-button nzType="primary" [disabled]="service.http.loading">导出</button> <button nz-button nzType="primary" [disabled]="loading">导出</button>
<button nz-button [disabled]="service.http.loading" (click)="resetSF()">重置</button> <button nz-button [disabled]="loading" (click)="resetSF()">重置</button>
<button nz-button nzType="link" (click)="expandToggle()"> <button nz-button nzType="link" (click)="expandToggle()">
{{ !_$expand ? '展开' : '收起' }} {{ !_$expand ? '展开' : '收起' }}
<i nz-icon [nzType]="!_$expand ? 'down' : 'up'"></i> <i nz-icon [nzType]="!_$expand ? 'down' : 'up'"></i>
@ -63,8 +63,8 @@
[scroll]="{ x: '2000px' }" [scroll]="{ x: '2000px' }"
[data]="service.$api_get_listBulkPage" [data]="service.$api_get_listBulkPage"
[columns]="columns" [columns]="columns"
[req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, params: reqParams }" [req]="{ process: beforeReq }"
[res]="{ reName: { list: 'data.records', total: 'data.total' } }" [res]="{ reName: { list: 'data.records', total: 'data.total' } , process: afterRes}"
[page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100, 200, 300, 500, 1000] }" [page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100, 200, 300, 500, 1000] }"
[loading]="service.http.loading" [loading]="service.http.loading"
> >
@ -81,6 +81,9 @@
<ng-template st-row="payeeName" let-item let-index="index"> <ng-template st-row="payeeName" let-item let-index="index">
<div> {{ item?.payeeName }}/{{ item?.payeePhone }} </div> <div> {{ item?.payeeName }}/{{ item?.payeePhone }} </div>
</ng-template> </ng-template>
<ng-template st-row="createUserName" let-item let-index="index">
<div> {{ item?.createUserName }}/{{ item?.createUserPhone }} </div>
</ng-template>
<ng-template st-row="billCode" let-item let-index="index"> <ng-template st-row="billCode" let-item let-index="index">
<a [routerLink]="'bulk-detail/' + item.id">{{ item.billCode }}</a> <a [routerLink]="'bulk-detail/' + item.id">{{ item.billCode }}</a>
<div> <div>
@ -125,8 +128,8 @@
[bordered]="true" [bordered]="true"
[data]="service.$api_get_listChangeApply" [data]="service.$api_get_listChangeApply"
[columns]="columnsFloat" [columns]="columnsFloat"
[req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, params: changeParams }" [req]="{ process: beforeReq }"
[res]="{ reName: { list: 'data', total: 'data.total' } }" [res]="{ reName: { list: 'data.records', total: 'data.total' } , process: afterRes}"
[page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100, 200, 300, 500, 1000] }" [page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100, 200, 300, 500, 1000] }"
> >
<ng-template st-row="order" let-item let-index="index"> <ng-template st-row="order" let-item let-index="index">

View File

@ -1,5 +1,5 @@
import { Component, OnInit, ViewChild } from '@angular/core'; import { Component, OnInit, ViewChild } from '@angular/core';
import { STColumn, STComponent } from '@delon/abc/st'; import { STColumn, STComponent, STRequestOptions } from '@delon/abc/st';
import { SFComponent, SFDateWidgetSchema, SFSchema, SFSchemaEnum, SFSelectWidgetSchema, SFUISchema } from '@delon/form'; import { SFComponent, SFDateWidgetSchema, SFSchema, SFSchemaEnum, SFSelectWidgetSchema, SFUISchema } from '@delon/form';
import { ModalHelper, _HttpClient } from '@delon/theme'; import { ModalHelper, _HttpClient } from '@delon/theme';
import { NzModalService } from 'ng-zorro-antd/modal'; import { NzModalService } from 'ng-zorro-antd/modal';
@ -27,6 +27,7 @@ export class OrderManagementBulkComponent implements OnInit {
isVisibleEvaluate = false; isVisibleEvaluate = false;
isVisible = false; isVisible = false;
_$expand = false; _$expand = false;
loading: boolean = true;
changeId: any; // 主页面查看运费变更记录id - 用于运费变更记录 changeId: any; // 主页面查看运费变更记录id - 用于运费变更记录
changeViewId: any; // 查看运费变更记录id - 用于查看 changeViewId: any; // 查看运费变更记录id - 用于查看
ViewCause: any; // 变更运费查看数据 ViewCause: any; // 变更运费查看数据
@ -44,20 +45,6 @@ export class OrderManagementBulkComponent implements OnInit {
columnsFloatView: STColumn[] = []; columnsFloatView: STColumn[] = [];
demoValue: any; demoValue: any;
resourceStatus: any; resourceStatus: any;
datass: any = [
{
one: '1',
two: '1',
three: '1',
id: 1
},
{
one: '2',
two: '2',
three: '2',
id: 2
}
];
tabs = { tabs = {
cancelQuantity: 0, cancelQuantity: 0,
receivedQuantity: 0, receivedQuantity: 0,
@ -94,6 +81,34 @@ export class OrderManagementBulkComponent implements OnInit {
} }
}; };
} }
beforeReq = (requestOptions: STRequestOptions) => {
const a: any = {};
if (this.resourceStatus) {
a.billStatus = this.resourceStatus;
}
const params: any = Object.assign({}, this.sf?.value || {});
delete params._$expand;
if (this.sf) {
Object.assign(requestOptions.body, {
...a,
...params,
createTime: {
start: this.sf?.value?.createTime?.[0] || '',
end: this.sf?.value?.createTime?.[1] || ''
}
});
}
this.loading = true;
return requestOptions;
};
afterRes = (data: any[], rawData?: any) => {
console.log(data)
this.loading = false
return data.map(item => ({
...item,
disabled: item.billStatus !== '4'
}));
};
get selectedRows() { get selectedRows() {
return this.st?.list.filter(item => item.checked) || []; return this.st?.list.filter(item => item.checked) || [];
} }
@ -182,9 +197,10 @@ export class OrderManagementBulkComponent implements OnInit {
searchLoadingText: '搜索中...', searchLoadingText: '搜索中...',
allowClear: true, allowClear: true,
onSearch: (q: any) => { onSearch: (q: any) => {
if (!!q) { let str =q.replace(/^\s+|\s+$/g,"");
if (str) {
return this.service return this.service
.request(this.service.$api_enterpriceList, { enterpriseName: q }) .request(this.service.$api_enterpriceList, { enterpriseName: str })
.pipe(map((res: any) => (res as any[]).map(i => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum)))) .pipe(map((res: any) => (res as any[]).map(i => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum))))
.toPromise(); .toPromise();
} else { } else {
@ -413,6 +429,7 @@ export class OrderManagementBulkComponent implements OnInit {
className: 'text-right', className: 'text-right',
render: 'mybidDetailInfo' render: 'mybidDetailInfo'
}, },
{ title: '录单员', render: 'createUserName', width: '200px', className: 'text-left' },
{ title: '网络货运人', index: 'enterpriseInfoName', width: '250px', className: 'text-left' }, { title: '网络货运人', index: 'enterpriseInfoName', width: '250px', className: 'text-left' },
{ title: '货主', index: 'shipperAppUserName', width: '250px', className: 'text-left' }, { title: '货主', index: 'shipperAppUserName', width: '250px', className: 'text-left' },
{ title: '所属项目', index: 'enterpriseProjectName', width: '250px', className: 'text-left' }, { title: '所属项目', index: 'enterpriseProjectName', width: '250px', className: 'text-left' },

View File

@ -156,9 +156,10 @@ export class OrderManagementComplianceAuditComponent implements OnInit {
searchLoadingText: '搜索中...', searchLoadingText: '搜索中...',
allowClear: true, allowClear: true,
onSearch: (q: any) => { onSearch: (q: any) => {
if (!!q) { let str =q.replace(/^\s+|\s+$/g,"");
if (str) {
return this.service return this.service
.request(this.service.$api_enterpriceList, { enterpriseName: q }) .request(this.service.$api_enterpriceList, { enterpriseName: str })
.pipe(map((res: any) => (res as any[]).map(i => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum)))) .pipe(map((res: any) => (res as any[]).map(i => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum))))
.toPromise(); .toPromise();
} else { } else {

View File

@ -131,9 +131,10 @@ export class OrderManagementReceiptsAuditComponent implements OnInit {
searchLoadingText: '搜索中...', searchLoadingText: '搜索中...',
allowClear: true, allowClear: true,
onSearch: (q: any) => { onSearch: (q: any) => {
if (!!q) { let str =q.replace(/^\s+|\s+$/g,"");
if (str) {
return this.service return this.service
.request(this.service.$api_enterpriceList, { enterpriseName: q }) .request(this.service.$api_enterpriceList, { enterpriseName: str })
.pipe(map((res: any) => (res as any[]).map(i => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum)))) .pipe(map((res: any) => (res as any[]).map(i => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum))))
.toPromise(); .toPromise();
} else { } else {

View File

@ -4,7 +4,7 @@
* @Author : Shiming * @Author : Shiming
* @Date : 2021-12-23 13:39:58 * @Date : 2021-12-23 13:39:58
* @LastEditors : Shiming * @LastEditors : Shiming
* @LastEditTime : 2022-02-28 13:40:47 * @LastEditTime : 2022-03-01 13:41:57
* @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\components\\vehicle-detail-change\\vehicle-detail-change.component.html * @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\components\\vehicle-detail-change\\vehicle-detail-change.component.html
* Copyright (C) 2022 huzhenhong. All rights reserved. * Copyright (C) 2022 huzhenhong. All rights reserved.
--> -->
@ -78,6 +78,7 @@
(click)="openMap('start', idx)" (click)="openMap('start', idx)"
formControlName="loadAddress{{ idx }}" formControlName="loadAddress{{ idx }}"
placeholder="请输入装货地" placeholder="请输入装货地"
readonly="true"
/> />
</nz-input-group> </nz-input-group>
<!-- <span style="padding: 0 10px" <!-- <span style="padding: 0 10px"
@ -130,6 +131,7 @@
(click)="openMap('end', idx)" (click)="openMap('end', idx)"
formControlName="unloadAddress{{ idx }}" formControlName="unloadAddress{{ idx }}"
placeholder="请输入卸货地" placeholder="请输入卸货地"
readonly="true"
/> />
</nz-input-group> </nz-input-group>
<!-- <span style="padding: 0 10px" <!-- <span style="padding: 0 10px"

View File

@ -4,7 +4,7 @@
* @Author : Shiming * @Author : Shiming
* @Date : 2021-12-28 14:42:03 * @Date : 2021-12-28 14:42:03
* @LastEditors : Shiming * @LastEditors : Shiming
* @LastEditTime : 2022-02-28 13:40:31 * @LastEditTime : 2022-03-02 16:28:37
* @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\components\\vehicle-detail\\vehicle-detail.component.html * @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\components\\vehicle-detail\\vehicle-detail.component.html
* Copyright (C) 2022 huzhenhong. All rights reserved. * Copyright (C) 2022 huzhenhong. All rights reserved.
--> -->
@ -62,18 +62,11 @@
<div class="approval-status"> <div class="approval-status">
<div style="width: 60%; margin: 0 auto"> <div style="width: 60%; margin: 0 auto">
   
<nz-steps [nzCurrent]="approvalLsit?.length + 1" nzLabelPlacement="vertical"> <nz-steps [nzCurrent]="i?.scheduleVOList?.length + 1" nzLabelPlacement="vertical">
  <nz-step *ngFor="let item of i?.scheduleVOList" [nzTitle]="item.state" [nzSubtitle]="item.stateTime"
<nz-step [nzDescription]="item.cancelReason ? '取消原因' + item.cancelReason : ''"
*ngFor="let item of approvalLsit" [nzStatus]="item.displayStatus === 'SHOW' ? 'finish' : 'wait'"></nz-step>
[nzTitle]="item?.state" </nz-steps>
[nzSubtitle]="item?.stateTime"
[nzStatus]="item?.displayStatus === 'SHOW' ? 'finish' : 'wait'"
>
 
</nz-step>
 </nz-steps
>
</div> </div>
</div> </div>
</nz-card> </nz-card>
@ -139,7 +132,7 @@
<nz-card nzTitle="保险待定"> </nz-card> <nz-card nzTitle="保险待定"> </nz-card>
<nz-card nzTitle="运费信息" #distannce3> <nz-card nzTitle="运费信息" #distannce3>
<st #st [data]="i?.billExpenseDetails" [columns]="logColumns" [ps]="0" [page]="{ show: false, showSize: false }"> <st #st [data]="billExpenses" [columns]="logColumns" [ps]="0" [page]="{ show: false, showSize: false }">
<ng-template st-row="price" let-item let-index="index"> <ng-template st-row="price" let-item let-index="index">
{{ item.price | currency }} {{ item.price | currency }}
</ng-template> </ng-template>
@ -202,11 +195,11 @@
<nz-card nzTitle="轨迹信息" style="width: 100%" id="distannce5" [nzExtra]="extraTemplate" #distannce5> <nz-card nzTitle="轨迹信息" style="width: 100%" id="distannce5" [nzExtra]="extraTemplate" #distannce5>
<div nz-row> <div nz-row>
<div nz-col [nzSpan]="12"> <div nz-col [nzSpan]="12">
<st #st [data]="i?.auditRecordList" [columns]="logColumns" [ps]="0" [page]="{ show: false, showSize: false }"> <st [scroll]="{y: '500px'}" #st [data]="addressItems" [columns]="logColumns" [ps]="0" [page]="{ show: false, showSize: false }">
</st> </st>
</div> </div>
<div nz-col [nzSpan]="12"> <div nz-col [nzSpan]="12">
<amap-path-simplifier [MapList]="MapList"></amap-path-simplifier> <amap-path-simplifier [mapWidth]="'100%'" [mapHeight]="'600px'" [MapList]="MapList"></amap-path-simplifier>
</div> </div>
</div> </div>
</nz-card> </nz-card>

View File

@ -4,7 +4,7 @@
* @Author : Shiming * @Author : Shiming
* @Date : 2021-12-28 14:42:03 * @Date : 2021-12-28 14:42:03
* @LastEditors : Shiming * @LastEditors : Shiming
* @LastEditTime : 2022-02-28 11:45:39 * @LastEditTime : 2022-03-02 16:19:31
* @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\components\\vehicle-detail\\vehicle-detail.component.ts * @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\components\\vehicle-detail\\vehicle-detail.component.ts
* Copyright (C) 2022 huzhenhong. All rights reserved. * Copyright (C) 2022 huzhenhong. All rights reserved.
*/ */
@ -23,37 +23,22 @@ import { OrderManagementService } from '../../services/order-management.service'
}) })
export class OrderManagementVehicleDetailComponent implements OnInit { export class OrderManagementVehicleDetailComponent implements OnInit {
id = this.route.snapshot.params.id; id = this.route.snapshot.params.id;
MapList: any; MapList: any[]=[];
i: any = { i: any = {
unLoadingPlaceList: [], unLoadingPlaceList: [],
billExpenseDetails: [], billExpenseDetails: [],
goodsInfoList: [], goodsInfoList: [],
goodsResource: [] goodsResource: []
}; };
billExpenses: any[] = []; //运费信息表格信息
imges: any; imges: any;
attObj: any; attObj: any;
totalObj: any; totalObj: any;
approvalLsit: any; approvalLsit: any;
isVisible = false; isVisible = false;
logColumns: STColumn[] = [ logColumns: STColumn[] = [
{ title: '款项', index: 'expenseCodeLabel' }, { title: '时间', index: 'vinOutTime' },
{ title: '小计(元)', render: 'price' }, { title: '地点', index: 'cityName' },
{ title: '运输费(元)', render: 'price' },
{ title: '附加费(元)', render: 'surcharge' },
{ title: '支付时间', index: 'paymentTime' },
{
title: '支付状态',
className: 'text-center',
index: 'paymentStatus',
type: 'badge',
width: '120px',
badge: {
'1': { text: '待申请', color: 'warning' },
'2': { text: '已支付', color: 'success' },
'3': { text: '已拒绝', color: 'warning' },
'4': { text: '申请中', color: 'warning' }
}
}
]; ];
trajectory = 'car'; trajectory = 'car';
addressItems: any[] = []; //打点地址数据组 addressItems: any[] = []; //打点地址数据组
@ -68,21 +53,15 @@ export class OrderManagementVehicleDetailComponent implements OnInit {
ngOnInit(): void { ngOnInit(): void {
this.initData(); this.initData();
this.MapInit(); this.MapInit()
} }
initData() { initData() {
this.service.request(this.service.$api_get_getWholeBillDetail, { id: this.id }).subscribe(res => { this.service.request(this.service.$api_get_getWholeBillDetail, { id: this.id }).subscribe(res => {
if (res) { if (res) {
this.i = res; this.i = res;
this.approvalLsit = res.scheduleVOList; this.billExpenses = this.i?.billExpenseDetails?.filter((data:any)=>data.expenseCode ==="PRE" || data.expenseCode ==="RECE" ||data.expenseCode ==="BACK" )
this.attObj = this.i?.billExpenseDetails?.filter((data: any) => data.expenseCode === 'ATT')[0]; this.i.scheduleVOList = this.i?.scheduleVOList?.filter((data:any)=>data.displayStatus !=="HIDE");
this.totalObj = this.i?.billExpenseDetails?.filter((data: any) => data.expenseCode === 'TOTAL')[0];
this.approvalLsit.map((item: any, key: any) => {
if (item.displayStatus === 'HIDE') {
delete this.approvalLsit[key];
}
});
} }
}); });
} }
@ -129,39 +108,23 @@ export class OrderManagementVehicleDetailComponent implements OnInit {
// elf['elementRef'].nativeElement.className = 'target-fix' // elf['elementRef'].nativeElement.className = 'target-fix'
} }
} }
// MapInit() {
// this.service.request('/api/sdc/billShipper/getTrajectoryByBillId', { id: this.id }).subscribe(res => {
// if (res?.trackArray) {
// const points = res?.trackArray;
// const list: any[] = [];
// points.forEach((item: any) => {
// list.push({
// name: item?.hgt,
// lnglat: [Number((Number(item?.lon) / 600000).toFixed(6)), Number((Number(item?.lat) / 600000).toFixed(6))]
// });
// });
// console.log(list);
// this.MapList = list;
// }
// });
// }
// 获取轨迹 // 获取轨迹
MapInit() { MapInit() {
this.service.request(this.service.$api_get_getTrajectory, { id: this.id }).subscribe(res => { this.service.request(this.service.$api_get_getTrajectory, { id: this.id }).subscribe(res => {
if (res) { if (res) {
const points = res.trackArray; const points = res.trackArray;
let list :any[] = [];
points?.forEach((item: any) => { points?.forEach((item: any) => {
this.MapList.push({ list.push({
name: item.hgt, name: item.hgt,
lnglat: [Number((Number(item.lon) / 600000).toFixed(6)), Number((Number(item.lat) / 600000).toFixed(6))] lnglat: [Number((Number(item.lon) / 600000).toFixed(6)), Number((Number(item.lat) / 600000).toFixed(6))]
}); });
}); });
this.MapList = list;
this.addressItems = res.parkArray; this.addressItems = res.parkArray;
if(this.addressItems && this.addressItems.length > 0){ if(this.addressItems && this.addressItems.length > 0){
this.addressItems.forEach(item => { this.addressItems.forEach(item => {
item.parkBte = this.getLocalTime(item.parkBte); item.vinOutTime = this.getLocalTime(item.vinOutTime);
item.parkEte = this.getLocalTime(item.parkEte);
}); });
} }
} }

View File

@ -4,7 +4,7 @@
* @Author : Shiming * @Author : Shiming
* @Date : 2022-01-12 10:52:50 * @Date : 2022-01-12 10:52:50
* @LastEditors : Shiming * @LastEditors : Shiming
* @LastEditTime : 2022-02-28 13:59:54 * @LastEditTime : 2022-03-02 14:57:31
* @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\components\\vehicle\\vehicle.component.html * @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\components\\vehicle\\vehicle.component.html
* Copyright (C) 2022 huzhenhong. All rights reserved. * Copyright (C) 2022 huzhenhong. All rights reserved.
--> -->
@ -32,9 +32,9 @@
<sf #sf [schema]="schema" [ui]="ui" [compact]="true" [button]="'none'"></sf> <sf #sf [schema]="schema" [ui]="ui" [compact]="true" [button]="'none'"></sf>
</div> </div>
<div nz-col [nzSpan]="_$expand ? 24 : 6" class="text-right"> <div nz-col [nzSpan]="_$expand ? 24 : 6" class="text-right">
<button nz-button nzType="primary" [nzLoading]="service.http.loading" (click)="search()" acl [acl-ability]="['ORDER-VEHICLE-search']">查询</button> <button nz-button nzType="primary" [nzLoading]="loading" (click)="search()" acl [acl-ability]="['ORDER-VEHICLE-search']">查询</button>
<button nz-button nzType="primary" [disabled]="service.http.loading">导出</button> <button nz-button nzType="primary" [disabled]="loading">导出</button>
<button nz-button [disabled]="service.http.loading" (click)="resetSF()">重置</button> <button nz-button [disabled]="loading" (click)="resetSF()">重置</button>
<button nz-button nzType="link" (click)="expandToggle()"> <button nz-button nzType="link" (click)="expandToggle()">
{{ !_$expand ? '展开' : '收起' }} {{ !_$expand ? '展开' : '收起' }}
<i nz-icon [nzType]="!_$expand ? 'down' : 'up'"></i> <i nz-icon [nzType]="!_$expand ? 'down' : 'up'"></i>
@ -62,8 +62,8 @@
[scroll]="{ x: '1200px' }" [scroll]="{ x: '1200px' }"
[data]="service.$api_get_listWholePage" [data]="service.$api_get_listWholePage"
[columns]="columns" [columns]="columns"
[req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, params: reqParams }" [req]="{ process: beforeReq }"
[res]="{ reName: { list: 'data.records', total: 'data.total' } }" [res]="{ reName: { list: 'data.records', total: 'data.total' } , process: afterRes}"
[page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100, 200, 300, 500, 1000] }" [page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100, 200, 300, 500, 1000] }"
> >
<ng-template st-row="billCode" let-item let-index="index"> <ng-template st-row="billCode" let-item let-index="index">
@ -83,6 +83,9 @@
<span>{{ item?.goodsNumber ? item?.goodsNumber + '件' : '' }}</span> <span>{{ item?.goodsNumber ? item?.goodsNumber + '件' : '' }}</span>
</div> </div>
</ng-template> </ng-template>
<ng-template st-row="createUserName" let-item let-index="index">
<div> {{ item?.createUserName }}/{{ item?.createUserPhone }} </div>
</ng-template>
<ng-template st-row="mybidDetailInfo" let-item let-index="index"> <ng-template st-row="mybidDetailInfo" let-item let-index="index">
<div *ngIf="item.mybidDetailInfo.length > 0"> <div *ngIf="item.mybidDetailInfo.length > 0">
<p *ngFor="let data of item.mybidDetailInfo"> <p *ngFor="let data of item.mybidDetailInfo">

View File

@ -1,6 +1,6 @@
import { Component, OnInit, ViewChild } from '@angular/core'; import { Component, OnInit, ViewChild } from '@angular/core';
import { Router, ActivatedRoute } from '@angular/router'; import { Router, ActivatedRoute } from '@angular/router';
import { STColumn, STComponent } from '@delon/abc/st'; import { STColumn, STComponent, STRequestOptions } from '@delon/abc/st';
import { SFComponent, SFDateWidgetSchema, SFSchema, SFSchemaEnum, SFSelectWidgetSchema, SFUISchema } from '@delon/form'; import { SFComponent, SFDateWidgetSchema, SFSchema, SFSchemaEnum, SFSelectWidgetSchema, SFUISchema } from '@delon/form';
import { ShipperBaseService } from '@shared'; import { ShipperBaseService } from '@shared';
import { NzModalService } from 'ng-zorro-antd/modal'; import { NzModalService } from 'ng-zorro-antd/modal';
@ -12,6 +12,7 @@ import { VehicleFreightPeopleComponent } from '../../modal/vehicle/freight-peopl
import { VehicleModifyCaptainComponent } from '../../modal/vehicle/modify-captain/modify-captain.component'; import { VehicleModifyCaptainComponent } from '../../modal/vehicle/modify-captain/modify-captain.component';
import { VehicleModifyRateComponent } from '../../modal/vehicle/modify-rate/modify-rate.component'; import { VehicleModifyRateComponent } from '../../modal/vehicle/modify-rate/modify-rate.component';
import { VehicleUpdateFreightComponent } from '../../modal/vehicle/update-freight/update-freight.component'; import { VehicleUpdateFreightComponent } from '../../modal/vehicle/update-freight/update-freight.component';
import { OneCarOrderViewtrackComponent } from '../../modal/vehicle/view-track/view-track.component';
import { OrderManagementService } from '../../services/order-management.service'; import { OrderManagementService } from '../../services/order-management.service';
@ -27,6 +28,7 @@ export class OrderManagementVehicleComponent implements OnInit {
isVisibleView = false; isVisibleView = false;
isVisibleEvaluate = false; isVisibleEvaluate = false;
isVisible = false; isVisible = false;
loading: boolean = true;
changeId: any; // 主页面查看运费变更记录id - 用于运费变更记录 changeId: any; // 主页面查看运费变更记录id - 用于运费变更记录
changeViewId: any; // 查看运费变更记录id - 用于查看 changeViewId: any; // 查看运费变更记录id - 用于查看
ViewCause: any; // 变更运费查看数据 ViewCause: any; // 变更运费查看数据
@ -102,6 +104,33 @@ resourceStatus: any;
}, },
}; };
} }
beforeReq = (requestOptions: STRequestOptions) => {
const a:any = {};
if(this.resourceStatus) {
a.billStatus = this.resourceStatus;
}
const params: any = Object.assign({}, this.sf?.value || {});
delete params._$expand;
if (this.sf) {
Object.assign(requestOptions.body, {
...a,
...params,
createTime: {
start: this.sf?.value?.createTime?.[0] || '',
end: this.sf?.value?.createTime?.[1] || '',
},
});
}
this.loading = true;
return requestOptions;
};
afterRes = (data: any[], rawData?: any) => {
console.log(data)
this.loading = false
return data.map(item => ({
...item,
}));
};
get selectedRows() { get selectedRows() {
return this.st?.list.filter((item) => item.checked) || []; return this.st?.list.filter((item) => item.checked) || [];
} }
@ -178,9 +207,10 @@ resourceStatus: any;
searchLoadingText: '搜索中...', searchLoadingText: '搜索中...',
allowClear: true, allowClear: true,
onSearch: (q: any) => { onSearch: (q: any) => {
if (!!q) { let str =q.replace(/^\s+|\s+$/g,"");
if (str) {
return this.service return this.service
.request(this.service.$api_enterpriceList, { enterpriseName: q}) .request(this.service.$api_enterpriceList, { enterpriseName: str})
.pipe(map((res: any) => (res as any[]).map((i) => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum)))) .pipe(map((res: any) => (res as any[]).map((i) => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum))))
.toPromise(); .toPromise();
} else { } else {
@ -360,6 +390,7 @@ resourceStatus: any;
className: 'text-right', className: 'text-right',
render: 'mybidDetailInfo', render: 'mybidDetailInfo',
}, },
{ title: '录单员', render: 'createUserName', width: '200px', className: 'text-left' },
{ title: '网络货运人', index: 'enterpriseInfoName', width: '250px', className: 'text-left' }, { title: '网络货运人', index: 'enterpriseInfoName', width: '250px', className: 'text-left' },
{ title: '货主', index: 'shipperAppUserName', width: '250px', className: 'text-left' }, { title: '货主', index: 'shipperAppUserName', width: '250px', className: 'text-left' },
{ title: '关联运单号', index: 'wayBillCode', width: '170px', className: 'text-left' }, { title: '关联运单号', index: 'wayBillCode', width: '170px', className: 'text-left' },
@ -458,8 +489,8 @@ resourceStatus: any;
}, },
{ {
text: '查看轨迹 ', text: '查看轨迹 ',
click: (_record) => this.cancellation(_record), click: (_record) => this.viewTrack(_record),
iif: item => item.billStatus == '4' || item.billStatus == '5' || item.billStatus == '2' || item.billStatus == '3', iif: item => item.billStatus !== '1' && item.billStatus !== '6',
// acl: { ability: ['VEHICLE-LIST-view'] }, // acl: { ability: ['VEHICLE-LIST-view'] },
}, },
@ -856,4 +887,22 @@ resourceStatus: any;
} }
}); });
} }
/**
*查看轨迹
*/
viewTrack(item: any) {
const modalRef = this.modal.create({
nzTitle: '查看轨迹',
nzContent: OneCarOrderViewtrackComponent,
nzWidth: '800px',
nzComponentParams: {
i: item,
},
nzFooter: null
});
modalRef.afterClose.subscribe((res: boolean) => {
if(res) {
}
});
}
} }

View File

@ -4,7 +4,7 @@
* @Author : Shiming * @Author : Shiming
* @Date : 2021-12-14 15:02:52 * @Date : 2021-12-14 15:02:52
* @LastEditors : Shiming * @LastEditors : Shiming
* @LastEditTime : 2022-01-18 17:20:49 * @LastEditTime : 2022-03-02 13:43:55
* @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\modal\\bulk\\confir-receipt\\confir-receipt.component.html * @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\modal\\bulk\\confir-receipt\\confir-receipt.component.html
* Copyright (C) 2022 huzhenhong. All rights reserved. * Copyright (C) 2022 huzhenhong. All rights reserved.
--> -->
@ -18,7 +18,7 @@ nzMessage="签收后不可再修改运费,请确保运费等信息准确无误
<sv-container col="1"> <sv-container col="1">
<sv label="货物单价"> <sv label="货物单价">
<span> <span>
{{detailList?.goodsInfoVO?.freightPrice}} {{detailList?.goodsInfoVO?.freightType}} {{detailList?.goodsInfoVO?.freightPrice}} {{detailList?.goodsInfoVO?.freightTypeLabel}}
</span> </span>
</sv> </sv>
<sv label="结算依据"> <sv label="结算依据">
@ -37,7 +37,7 @@ nzMessage="签收后不可再修改运费,请确保运费等信息准确无误
<div>{{detailList?.goodsInfoVO?.weight}}吨</div> <div>{{detailList?.goodsInfoVO?.weight}}吨</div>
</sv> </sv>
<sv label="装货体积"> <sv label="装货体积">
<div>{{detailList?.goodsInfoVO?.volume}}</div> <div>{{detailList?.goodsInfoVO?.volume}}</div>
</sv> </sv>
</sv-container> </sv-container>
<sv-container col="2"> <sv-container col="2">
@ -50,7 +50,7 @@ nzMessage="签收后不可再修改运费,请确保运费等信息准确无误
</sv-container> </sv-container>
<sv-container col="1"> <sv-container col="1">
<sv label="总运费"> <sv label="总运费">
<div>{{detailList?.price}} 元</div> <div>{{detailList?.price | currency}} 元</div>
</sv> </sv>
<sv label="司机车辆"> <sv label="司机车辆">
<div>{{detailList?.driverName}} / {{detailList?.driverPhone}}/ {{detailList?.carNo}}</div> <div>{{detailList?.driverName}} / {{detailList?.driverPhone}}/ {{detailList?.carNo}}</div>
@ -69,7 +69,7 @@ nzMessage="签收后不可再修改运费,请确保运费等信息准确无误
[nzPreview]="handlePreview1" [nzPreview]="handlePreview1"
[nzBeforeUpload]="beforeUpload" [nzBeforeUpload]="beforeUpload"
(nzChange)="handleChange1($event)" (nzChange)="handleChange1($event)"
>beforeUpload >
<div> <div>
<i nz-icon nzType="plus"></i> <i nz-icon nzType="plus"></i>
<div style="margin-top: 8px">请上传图片</div> <div style="margin-top: 8px">请上传图片</div>

View File

@ -4,7 +4,7 @@
* @Author : Shiming * @Author : Shiming
* @Date : 2021-12-14 14:03:07 * @Date : 2021-12-14 14:03:07
* @LastEditors : Shiming * @LastEditors : Shiming
* @LastEditTime : 2022-02-23 14:20:32 * @LastEditTime : 2022-03-01 19:27:32
* @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\modal\\bulk\\update-freight\\update-freight.component.html * @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\modal\\bulk\\update-freight\\update-freight.component.html
* Copyright (C) 2022 huzhenhong. All rights reserved. * Copyright (C) 2022 huzhenhong. All rights reserved.
--> -->
@ -19,6 +19,7 @@
[ngModel]="i.value" [ngModel]="i.value"
(ngModelChange)="i.setValue($event)" (ngModelChange)="i.setValue($event)"
placeholder="请输入" placeholder="请输入"
(change)="changeNumVal()"
oninput="if(value>99999)value=99999;if(value<0)value=0" oninput="if(value>99999)value=99999;if(value<0)value=0"
/> />
</nz-input-group> </nz-input-group>

View File

@ -4,7 +4,7 @@
* @Author : Shiming * @Author : Shiming
* @Date : 2021-12-14 14:03:07 * @Date : 2021-12-14 14:03:07
* @LastEditors : Shiming * @LastEditors : Shiming
* @LastEditTime : 2022-02-23 14:23:26 * @LastEditTime : 2022-03-01 19:27:28
* @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\modal\\bulk\\update-freight\\update-freight.component.ts * @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\modal\\bulk\\update-freight\\update-freight.component.ts
* Copyright (C) 2022 huzhenhong. All rights reserved. * Copyright (C) 2022 huzhenhong. All rights reserved.
*/ */
@ -50,7 +50,6 @@ export class UpdateFreightComponent implements OnInit {
placeholder: '请输入', placeholder: '请输入',
widget: 'custom', widget: 'custom',
grid: { span: 12 }, grid: { span: 12 },
change: (val: any) => this.changeNumVal()
} as SFStringWidgetSchema, } as SFStringWidgetSchema,
default: data.freightPrice default: data.freightPrice
}, },
@ -181,18 +180,19 @@ export class UpdateFreightComponent implements OnInit {
} }
changeNumVal() { changeNumVal() {
console.log('444')
if (this.calculateSub) { if (this.calculateSub) {
this.calculateSub.unsubscribe(); this.calculateSub.unsubscribe();
} }
const params = { billId: this.data.billId, changeCause: this.sf.value.changeCause, dto: {...this.sf.value} } const params = { billId: this.data.billId, changeCause: this.sf.value.changeCause, dto: {...this.sf.value} }
this.calculateSub = this.service this.calculateSub = this.service
.request(this.service.$api_calculate_cost, params) .request(this.service.$api_calculate_cost, params)
.subscribe((res: any) => { .subscribe(res => {
if (res) { if (res) {
Object.assign(this.data, { Object.assign(this.data, {
totalAmount: res.totalAmount,
totalFreight: res.totalFreight, totalFreight: res.totalFreight,
freight: res.freight, totalSurcharge: res.totalSurcharge
surcharge: res.surcharge
}); });
} }
}); });

View File

@ -4,7 +4,7 @@
* @Author : Shiming * @Author : Shiming
* @Date : 2022-02-22 13:53:29 * @Date : 2022-02-22 13:53:29
* @LastEditors : Shiming * @LastEditors : Shiming
* @LastEditTime : 2022-02-22 15:51:53 * @LastEditTime : 2022-02-28 15:56:46
* @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\modal\\vehicle\\cancel-confirm\\cancel-confirm.component.ts * @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\modal\\vehicle\\cancel-confirm\\cancel-confirm.component.ts
* Copyright (C) 2022 huzhenhong. All rights reserved. * Copyright (C) 2022 huzhenhong. All rights reserved.
*/ */
@ -75,6 +75,7 @@ export class OneCarOrderCancelConfirmComponent implements OnInit {
initData() { initData() {
let indexId = 0 let indexId = 0
let index = 0 let index = 0
let indexSurcharge = 0
this.i?.mybidDetailInfo.forEach((ele: any) => { this.i?.mybidDetailInfo.forEach((ele: any) => {
if(this.sts == 1) { if(this.sts == 1) {
// 大宗 // 大宗
@ -83,25 +84,21 @@ export class OneCarOrderCancelConfirmComponent implements OnInit {
} }
if (ele?.paymentStatusLabel == '已支付') { if (ele?.paymentStatusLabel == '已支付') {
indexId += 1; indexId += 1;
indexSurcharge += ele?.surcharge;
} }
} else { } else {
// 整车 // 整车
if (ele?.paymentStatusLabel == '已支付') { if (ele?.paymentStatusLabel == '已支付') {
indexId += 1; indexId += 1;
index += ele?.price; index += ele?.price;
indexSurcharge += ele?.surcharge;
} }
console.log(ele.expenseCode) console.log(ele.expenseCode)
} }
if (ele.expenseCode == '"ATT"' || ele.expenseCode == 'ATT'){
if(ele?.paymentStatusLabel == '已支付') {
this.ATTPrice = ele.price;
} else {
this.ATTPrice = 0;
}
}
}); });
this.index = indexId this.index = indexId
this.List = index this.List = index
this.ATTPrice = indexSurcharge
console.log(this.index) console.log(this.index)
console.log(this.List) console.log(this.List)
} }

View File

@ -4,7 +4,7 @@
* @Author : Shiming * @Author : Shiming
* @Date : 2021-12-15 13:17:42 * @Date : 2021-12-15 13:17:42
* @LastEditors : Shiming * @LastEditors : Shiming
* @LastEditTime : 2022-01-18 17:21:57 * @LastEditTime : 2022-03-02 13:50:12
* @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\modal\\vehicle\\confir-receipt\\confir-receipt.component.html * @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\modal\\vehicle\\confir-receipt\\confir-receipt.component.html
* Copyright (C) 2022 huzhenhong. All rights reserved. * Copyright (C) 2022 huzhenhong. All rights reserved.
--> -->
@ -17,7 +17,20 @@
<sv-container col="1"> <sv-container col="1">
<sv label="费用明细"> <sv label="费用明细">
<st #st [widthMode]="{ type: 'strict' }" [data]="costDetail" [columns]="columns" bordered="true" [page]="{ show: false }"></st> <st #st [widthMode]="{ type: 'strict' }" [data]="costDetail" [columns]="columns" bordered="true" [page]="{ show: false }">
<ng-template st-row="PRE" let-item let-index="index">
{{item.PRE | currency}}
</ng-template>
<ng-template st-row="RECE" let-item let-index="index">
{{ item.RECE | currency }}
</ng-template>
<ng-template st-row="BACK" let-item let-index="index">
{{ item.BACK | currency }}
</ng-template>
<ng-template st-row="traiPrice" let-item let-index="index">
{{ item.traiPrice | currency }}
</ng-template>
</st>
</sv> </sv>
<sv label="司机车辆"> <sv label="司机车辆">
<div>{{ dataInfo?.driverName }} / {{ dataInfo?.driverPhone }}/ {{ dataInfo?.carNo }}</div> <div>{{ dataInfo?.driverName }} / {{ dataInfo?.driverPhone }}/ {{ dataInfo?.carNo }}</div>

View File

@ -4,7 +4,7 @@
* @Author : Shiming * @Author : Shiming
* @Date : 2021-12-15 13:17:42 * @Date : 2021-12-15 13:17:42
* @LastEditors : Shiming * @LastEditors : Shiming
* @LastEditTime : 2022-02-25 15:34:07 * @LastEditTime : 2022-03-02 13:52:27
* @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\modal\\vehicle\\confir-receipt\\confir-receipt.component.ts * @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\modal\\vehicle\\confir-receipt\\confir-receipt.component.ts
* Copyright (C) 2022 huzhenhong. All rights reserved. * Copyright (C) 2022 huzhenhong. All rights reserved.
*/ */
@ -143,23 +143,27 @@ export class VehicleConfirReceiptComponent implements OnInit {
this.columns = [ this.columns = [
{ {
title: '预付', title: '预付',
index: 'PRE' index: 'PRE',
render:'PRE'
}, },
{ {
title: '到付', title: '到付',
index: 'RECE' index: 'RECE',
}, render:'RECE'
{
title: '油卡',
index: 'OIL'
}, },
// {
// title: '油卡',
// index: 'OIL'
// },
{ {
title: '回单付', title: '回单付',
index: 'BACK' index: 'BACK',
render:'BACK'
}, },
{ {
title: '总运费', title: '总运费',
index: 'traiPrice' index: 'traiPrice',
render:'traiPrice'
} }
]; ];
} }

View File

@ -0,0 +1,34 @@
<!--
* @Description :
* @Version : 1.0
* @Author : Shiming
* @Date : 2022-02-22 13:53:29
* @LastEditors : Shiming
* @LastEditTime : 2022-03-02 16:18:46
* @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\modal\\vehicle\\view-track\\view-track.component.html
* Copyright (C) 2022 huzhenhong. All rights reserved.
-->
<div>
<nz-card nzTitle="轨迹信息" [nzExtra]="extraTemplate" >
<div style="display: flex; flex: 1;">
<div style=" flex: 1;">
<st #st [scroll]="{y: '500px'}" [data]="addressItems" [columns]="logColumns" [ps]="0" [page]="{ show: false, showSize: false }">
</st>
</div>
<div style="flex: 1;" >
<amap-path-simplifier [mapWidth]="'100%'" [mapHeight]="'600px'" [MapList]="MapList"></amap-path-simplifier>
</div>
</div>
</nz-card>
<ng-template #extraTemplate>
<nz-radio-group [(ngModel)]="trajectory">
<label nz-radio-button nzValue="car">车辆轨迹</label>
<label nz-radio-button nzValue="driver">司机轨迹</label>
</nz-radio-group>
</ng-template>
</div>
<div class="modal-footer">
<button nz-button type="button" (click)="close(false)">取消</button>
<button nz-button type="submit" nzType="primary" (click)="close(true)">确认</button>
</div>

View File

@ -0,0 +1,11 @@
:host {
::ng-deep {
// .mapBox {
// iframe, canvas {
// width: 400px !important;
// }
// }
}
}

View File

@ -0,0 +1,84 @@
/*
* @Description :
* @Version : 1.0
* @Author : Shiming
* @Date : 2022-02-22 13:53:29
* @LastEditors : Shiming
* @LastEditTime : 2022-03-02 16:02:51
* @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\modal\\vehicle\\view-track\\view-track.component.ts
* Copyright (C) 2022 huzhenhong. All rights reserved.
*/
import { Component, OnInit, ViewChild } from '@angular/core';
import { STColumn } from '@delon/abc/st';
import {
SFComponent,
SFCustomWidgetSchema,
SFNumberWidgetSchema,
SFRadioWidgetSchema,
SFSchema,
SFTextareaWidgetSchema,
SFUISchema
} from '@delon/form';
import format from 'date-fns/format';
import { _HttpClient } from '@delon/theme';
import { NzMessageService } from 'ng-zorro-antd/message';
import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal';
import { OrderManagementService } from '../../../services/order-management.service';
@Component({
selector: 'app-order-management-view-track',
styleUrls: ['./view-track.component.less'],
templateUrl: './view-track.component.html'
})
export class OneCarOrderViewtrackComponent implements OnInit {
i: any; // 单行数据
MapList:any[] = []; //地图点位数据组
trajectory = 'car';
addressItems: any[] = []; //打点地址数据组
logColumns: STColumn[] = [
{ title: '时间', index: 'vinOutTime' },
{ title: '地点', index: 'cityName' },
];
constructor(
private modalRef: NzModalRef,
private modal: NzModalService,
private msgSrv: NzMessageService,
public service: OrderManagementService
) {}
ngOnInit(): void {
console.log(this.i);
this.MapInit();
}
// 获取轨迹
MapInit() {
this.service.request(this.service.$api_get_getTrajectory, { id: this.i.id }).subscribe(res => {
if (res) {
const points = res.trackArray;
let list :any[] = [];
points?.forEach((item: any) => {
list.push({
name: item.hgt,
lnglat: [Number((Number(item.lon) / 600000).toFixed(6)), Number((Number(item.lat) / 600000).toFixed(6))]
});
});
this.MapList = list;
// this.addressItems = res.parkArray;
this.addressItems = res.cityArray;
if(this.addressItems && this.addressItems.length > 0){
this.addressItems.forEach(item => {
item.vinOutTime = this.getLocalTime(item.vinOutTime);
});
}
}
});
}
close(value: boolean): void {
this.modalRef.close(false);
}
getLocalTime(time: any) {
return format(new Date(parseInt(time)), 'yyyy-MM-dd HH:mm:ss');
}
}

View File

@ -36,6 +36,7 @@ import { VehicleModifyRateComponent } from './modal/vehicle/modify-rate/modify-r
import { VehicleSureArriveComponent } from './modal/vehicle/sure-arrive/sure-arrive.component'; import { VehicleSureArriveComponent } from './modal/vehicle/sure-arrive/sure-arrive.component';
import { VehicleSureDepartComponent } from './modal/vehicle/sure-depart/sure-depart.component'; import { VehicleSureDepartComponent } from './modal/vehicle/sure-depart/sure-depart.component';
import { VehicleUpdateFreightComponent } from './modal/vehicle/update-freight/update-freight.component'; import { VehicleUpdateFreightComponent } from './modal/vehicle/update-freight/update-freight.component';
import { OneCarOrderViewtrackComponent } from './modal/vehicle/view-track/view-track.component';
import { OrderManagementRoutingModule } from './order-management-routing.module'; import { OrderManagementRoutingModule } from './order-management-routing.module';
const COMPONENTS: Type<void>[] = [ const COMPONENTS: Type<void>[] = [
@ -62,7 +63,8 @@ const COMPONENTS: Type<void>[] = [
OrderManagementReceiptsAuditComponent, OrderManagementReceiptsAuditComponent,
orderManagementVoucherViewComponent, orderManagementVoucherViewComponent,
OrderManagementComplianceAuditComponent, OrderManagementComplianceAuditComponent,
OneCarOrderCancelConfirmComponent OneCarOrderCancelConfirmComponent,
OneCarOrderViewtrackComponent
]; ];
@NgModule({ @NgModule({

View File

@ -4,7 +4,7 @@
* @Author : Shiming * @Author : Shiming
* @Date : 2021-12-03 15:31:52 * @Date : 2021-12-03 15:31:52
* @LastEditors : Shiming * @LastEditors : Shiming
* @LastEditTime : 2022-02-28 12:01:42 * @LastEditTime : 2022-03-01 19:21:53
* @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\services\\order-management.service.ts * @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\services\\order-management.service.ts
* Copyright (C) 2022 huzhenhong. All rights reserved. * Copyright (C) 2022 huzhenhong. All rights reserved.
*/ */

View File

@ -1,46 +1,30 @@
<!--
* @Description :
* @Version : 1.0
* @Author : Shiming
* @Date : 2021-12-03 11:10:14
* @LastEditors : Shiming
* @LastEditTime : 2022-01-18 17:27:30
* @FilePath : \\tms-obc-web\\src\\app\\routes\\supply-management\\components\\assigned-car\\assigned-car.component.html
* Copyright (C) 2022 huzhenhong. All rights reserved.
-->
<div> <div>
<div nz-row> <div nz-row>
<div nz-col nzSpan="18"> <div nz-col nzSpan="18">
<sf #sf [schema]="schema" mode="search" [ui]="ui" [compact]="true" (formSubmit)="st.load(1)" (formReset)="reset()"></sf> <sf #sf [schema]="schema" mode="search" [ui]="ui" [compact]="true" (formSubmit)="st.load(1)"
</div> (formReset)="reset()"></sf>
<div nz-col nzSpan="6">
<button nz-button nzType="primary" style="margin-bottom: 24px" (click)="addDriver()"><i nz-icon nzType="plus"></i>添加司机</button>
</div> </div>
<!-- <div nz-col nzSpan="6">
<button nz-button nzType="primary" style="margin-bottom: 24px" (click)="addDriver()"><i nz-icon
nzType="plus"></i>添加司机</button>
</div> -->
</div> </div>
<div> <div>
<st <st #st [data]="service.$api_get_practice_car_list"
#st
[data]="service.$api_get_practice_car_list"
[req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, params: reqParams }" [req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, params: reqParams }"
[columns]="columns" [columns]="columns" [res]="{ reName: { list: 'data.records', total: 'data.total' },process:dataProcess }"
[res]="{ reName: { list: 'data.records', total: 'data.total' }, process: dataProcess }"
[page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100, 200, 300, 500, 1000] }" [page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100, 200, 300, 500, 1000] }"
(change)="changeSt($event)" (change)="changeSt($event)">
>
<ng-template st-row="carId" let-item let-index="index"> <ng-template st-row="carId" let-item let-index="index">
<nz-select [(ngModel)]="item.carId" style="width: 280px"> <nz-select [(ngModel)]="item.carId" style="width: 280px;">
<nz-option [nzValue]="''" nzLabel="不限"></nz-option> <nz-option [nzValue]="''" nzLabel="不限"></nz-option>
<nz-option <nz-option [nzValue]="car.carId" [nzLabel]="car.carNo"
[nzValue]="car.carId" *ngFor="let car of item.userCarLicenseDesensitizationVOList" [nzCustomContent]="true">
[nzLabel]="car.carNo"
*ngFor="let car of item.userCarLicenseDesensitizationVOList"
[nzCustomContent]="true"
>
<span>{{car.carNo}} -</span> <span>{{car.carNo}} -</span>
<span>{{car.carLength}}米,{{car.carLoad}}吨 -</span> <span>{{car.carLength}}米,{{car.carLoad}}吨 -</span>
<span *ngIf="car?.approvalStatus === 20 && !car.carStatus " class="text-success-dark">空闲</span> <span *ngIf="car?.approvalStatus === 20 && !car.carStatus " class="text-success-dark">空闲</span>
<span *ngIf="car?.approvalStatus === 20 && car.carStatus" class="text-warning-dark">已被指派</span> <span *ngIf="car?.approvalStatus === 20 && car.carStatus " class="text-warning-dark">在途</span>
<span *ngIf="car?.approvalStatus !== 20" class="text-red-dark">未认证</span> <span *ngIf="car?.approvalStatus !== 20" class="text-red-dark">未认证</span>
<!-- <span [ngClass]="cardBADGE[car.carStatus]?.color">{{cardBADGE[car.carStatus]?.text}}</span> --> <!-- <span [ngClass]="cardBADGE[car.carStatus]?.color">{{cardBADGE[car.carStatus]?.text}}</span> -->
</nz-option> </nz-option>
@ -48,19 +32,18 @@
</ng-template> </ng-template>
<ng-template st-row="carCaptain" let-item let-index> <ng-template st-row="carCaptain" let-item let-index>
<span>{{item.captainName}} {{item.captainPhone}}</span> <span>{{item.captainName}} {{item.captainPhone}}</span>
<a (click)="setCarCaptain(item)">设置</a> <a (click)="verifyCanSetCarCaptain(item)">设置</a>
</ng-template> </ng-template>
<ng-template st-row="driverStatus" let-item let-index> <ng-template st-row="driverStatus" let-item let-index>
<span *ngIf="item?.certificationStatus === 1 && item.driverStatus === 0" class="text-success-dark">空闲</span> <span *ngIf="item?.certificationStatus === 1 && item.driverStatus === 0" class="text-success-dark">空闲</span>
<span *ngIf="item?.certificationStatus === 1 && item.driverStatus === 1" class="text-warning-dark">已被指派</span> <span *ngIf="item?.certificationStatus === 1 && item.driverStatus === 1" class="text-warning-dark">在途</span>
<span *ngIf="item?.certificationStatus !== 1" class="text-red-dark">未认证</span> <span *ngIf="item?.certificationStatus !== 1" class="text-red-dark">未认证</span>
</ng-template> </ng-template>
</st> </st>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button nz-button type="button" (click)="close()">关闭</button> <button nz-button type="button" (click)="close()">关闭</button>
<button nz-button type="submit" nzType="primary" (click)="save()" [disabled]="!selectedRows" [nzLoading]="service.http.loading" <button nz-button type="submit" nzType="primary" (click)="verifyVechicleStatus(params)" [disabled]="!selectedRows"
>发布并指派给司机</button [nzLoading]="service.http.loading">发布并指派给司机</button>
>
</div> </div>
</div> </div>

View File

@ -2,8 +2,9 @@ import { Component, OnInit, ViewChild } from '@angular/core';
import { STChange, STColumn, STColumnBadge, STComponent, STData } from '@delon/abc/st'; import { STChange, STColumn, STColumnBadge, STComponent, STData } from '@delon/abc/st';
import { SFComponent, SFSchema, SFUISchema } from '@delon/form'; import { SFComponent, SFSchema, SFUISchema } from '@delon/form';
import { ModalHelper, _HttpClient } from '@delon/theme'; import { ModalHelper, _HttpClient } from '@delon/theme';
import { EAEnvironmentService } from '@shared';
import { NzMessageService } from 'ng-zorro-antd/message'; import { NzMessageService } from 'ng-zorro-antd/message';
import { NzModalRef } from 'ng-zorro-antd/modal'; import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal';
import { SupplyManagementService } from '../../services/supply-management.service'; import { SupplyManagementService } from '../../services/supply-management.service';
import { SupplyManagementAddDriversComponent } from '../add-drivers/add-drivers.component'; import { SupplyManagementAddDriversComponent } from '../add-drivers/add-drivers.component';
import { CarAddmodalComponent } from '../addmodal/addmodal.component'; import { CarAddmodalComponent } from '../addmodal/addmodal.component';
@ -29,7 +30,6 @@ export class SupplyManagementVehicleAssignedCarComponent implements OnInit {
@ViewChild('st') st!: STComponent; @ViewChild('st') st!: STComponent;
@ViewChild('sf', { static: false }) sf!: SFComponent; @ViewChild('sf', { static: false }) sf!: SFComponent;
status: string = 'anew'; status: string = 'anew';
type: any;
url = ''; // 请求的api地址 url = ''; // 请求的api地址
params: any = {}; // 传进来的参数 params: any = {}; // 传进来的参数
cardBADGE: STColumnBadge | any = { cardBADGE: STColumnBadge | any = {
@ -43,6 +43,8 @@ export class SupplyManagementVehicleAssignedCarComponent implements OnInit {
private msgSrv: NzMessageService, private msgSrv: NzMessageService,
public service: SupplyManagementService, public service: SupplyManagementService,
private modalHelper: ModalHelper, private modalHelper: ModalHelper,
private envSrv: EAEnvironmentService,
private modalSrv: NzModalService
) { ) {
this.initSF(); this.initSF();
this.initSt(); this.initSt();
@ -54,10 +56,14 @@ export class SupplyManagementVehicleAssignedCarComponent implements OnInit {
get reqParams() { get reqParams() {
return { return {
...this.sf?.value, ...this.sf?.value,
loadingTime: this.params?.loadingTime,
unloadingTime: this.params?.unloadingTime
}; };
} }
/** /**
* 初始化查询表单 * 初始化查询表单
*/ */
@ -67,14 +73,15 @@ export class SupplyManagementVehicleAssignedCarComponent implements OnInit {
_$expand: { type: 'boolean', ui: { hidden: true } }, _$expand: { type: 'boolean', ui: { hidden: true } },
nameOrPhone: { nameOrPhone: {
type: 'string', type: 'string',
title: '', title: '承运司机',
ui: { ui: {
placeholder: '请输入司机姓名/手机号' placeholder: '请输入司机姓名/手机号'
} }
}, },
carNo: { carNo: {
type: 'string', type: 'string',
title: '', title: '车牌号',
maxLength: 9,
ui: { ui: {
placeholder: '请输入车牌号' placeholder: '请输入车牌号'
} }
@ -100,13 +107,12 @@ export class SupplyManagementVehicleAssignedCarComponent implements OnInit {
} }
ngOnInit(): void { ngOnInit(): void {
console.log(this.type)
} }
dataProcess(data: STData[]): STData[] { dataProcess(data: STData[]): STData[] {
return data.map((i, index) => { return data.map((i, index) => {
i.carId = ''; i.carId = '';
i.disabled = i.carStatus === '1'; i.disabled = (i?.certificationStatus === 1 && i.driverStatus === 1);
const defaultCar = i?.userCarLicenseDesensitizationVOList?.find((item: any) => item.isDefault); const defaultCar = i?.userCarLicenseDesensitizationVOList?.find((item: any) => item.isDefault);
if (defaultCar) { if (defaultCar) {
i.carId = defaultCar?.carId; i.carId = defaultCar?.carId;
@ -116,17 +122,16 @@ export class SupplyManagementVehicleAssignedCarComponent implements OnInit {
} }
save(): void { save(): void {
if (this.selectedRows) {
const { carId, appUserId: driverId, captainAppUserId: carCaptainId } = this.selectedRows; const { carId, appUserId: driverId, captainAppUserId: carCaptainId } = this.selectedRows;
const params: any = { carId, driverId, carCaptainId }; const params: any = { carId, driverId, carCaptainId };
this.service.request(this.url, { ...params, ...this.params }).subscribe((res: any) => { this.service.request(this.url, { ...params, ...this.params }).subscribe((res: any) => {
if (res) { if (res) {
this.service.msgSrv.success('指派成功!');
this.modal.close(res); this.modal.close(res);
} }
}) })
} }
}
changeSt(e: STChange): void { changeSt(e: STChange): void {
if (e?.type === 'loaded') this.selectedRows = null; if (e?.type === 'loaded') this.selectedRows = null;
@ -143,10 +148,28 @@ export class SupplyManagementVehicleAssignedCarComponent implements OnInit {
}); });
} }
/**
* 校验司机是否能设置车队长
* @param item 当前对象
*/
verifyCanSetCarCaptain(item: any) {
this.service.request(this.service.$api_get_sys_config, [{ itemKey: 'sys.config.shipper.setCarCaptain', businessId: this.envSrv.env.enterpriseId }]).subscribe(res => {
if (res && res.length > 0) {
const { itemValue } = res[0];
if (itemValue !== '1') {
this.service.msgSrv.error('不可设置车队长!');
return;
}
this.setCarCaptain(item);
}
})
}
/** /**
* 设置车队长 * 设置车队长
*/ */
setCarCaptain(item: any) { setCarCaptain(item: any) {
this.modalHelper.create(SupplyManagementAddDriversComponent, { dirvierInfo: item }, { this.modalHelper.create(SupplyManagementAddDriversComponent, { dirvierInfo: item }, {
size: 900, size: 900,
modalOptions: { nzMaskClosable: false, nzTitle: '设置' } modalOptions: { nzMaskClosable: false, nzTitle: '设置' }
@ -168,4 +191,57 @@ export class SupplyManagementVehicleAssignedCarComponent implements OnInit {
this.sf.reset(); this.sf.reset();
this.st.load(1); this.st.load(1);
} }
/**
* 验证车辆的状态
*/
verifyVechicleStatus(params: any) {
if (this.selectedRows) {
const obj = this.status === 'anew' ? { resourceId: params.id } : { ...params };
const { carId, appUserId: driverId, captainAppUserId: carCaptainId } = this.selectedRows;
const carInfo: any = { carId, driverId, carCaptainId };
this.service.request(this.service.$api_verify_vehicle_status, { ...obj, ...carInfo }).subscribe(res => {
if (res) {
const { title, alert, subContent, content } = res;
switch (alert) {
case 'Error':
// if (code === '3' || code === '4' || code === '8') {
// this.error(title, subContent, '#CF3834');
// } else {
this.error(title, content, subContent);
break;
case 'Warn':
this.showConfirm(title, content, subContent);
break;
case 'Success':
this.save();
break;
}
}
})
}
}
error(title: string, content: string, subContent: string): void {
this.modalSrv.error({
nzTitle: title,
nzContent: `<span class="text-error-dark">${content ? content : ''}</span><span class="text-grey-dark">${subContent ? subContent : ''}</span>`,
nzOkText: '知道了'
});
}
showConfirm(title: string, content: string, subContent: string): void {
this.modalSrv.confirm({
nzTitle: title,
nzContent: `<span class="text-error-dark">${content ? content : ''}</span><span class="text-grey-dark">${subContent ? subContent : ''}</span>`,
nzOkText: '继续',
nzCancelText: '取消',
nzOnOk: () => {
this.save();
}
});
}
} }

View File

@ -13,16 +13,17 @@
<div nz-row> <div nz-row>
<div nz-col nzSpan="14" class="text-grey-darker">网络货运人:{{ i?.shipperAppUserName }}</div> <div nz-col nzSpan="14" class="text-grey-darker">网络货运人:{{ i?.shipperAppUserName }}</div>
<div nz-col nzSpan="10"> <div nz-col nzSpan="10">
<button nz-button (click)="cancleGoodsSource()" *ngIf="i?.resourceStatus === '1'" acl [acl-ability]="['SUPPLY-BULK-DETAIL-cancelSupply']">取消货源</button> <button nz-button (click)="cancleGoodsSource()" *ngIf="i?.resourceStatus === '1'" acl
<button nz-button (click)="updatePrice(i)" *ngIf="i?.resourceStatus === '1'" acl [acl-ability]="['SUPPLY-BULK-DETAIL-updatePrice']">修改单价</button> [acl-ability]="['SUPPLY-BULK-DETAIL-cancelSupply']">取消货源</button>
<button nz-button nzType="primary" nzGhost (click)="placeOrder(i)" acl [acl-ability]="['SUPPLY-BULK-DETAIL-bulkAnotherOrder']">再下一单</button> <button nz-button (click)="updatePrice(i)" *ngIf="i?.resourceStatus === '1'" acl
[acl-ability]="['SUPPLY-BULK-DETAIL-updatePrice']">修改单价</button>
<button nz-button nzType="primary" nzGhost (click)="placeOrder(i)" acl
[acl-ability]="['SUPPLY-BULK-DETAIL-bulkAnotherOrder']">再下一单</button>
</div> </div>
</div> </div>
<div class="mt-sm mb-sm" nz-row> <div class="mt-sm mb-sm" nz-row>
<div> <div>
<b <b>总费用:<span class="text-red-light text-md">{{ i?.totalAmount | currency: '¥' }}</span></b>
>总费用:<span class="text-red-light text-md">{{ i?.totalAmount | currency: '¥' }}</span></b
>
</div> </div>
</div> </div>
<nz-divider></nz-divider> <nz-divider></nz-divider>
@ -39,19 +40,14 @@
<div class="approval-status"> <div class="approval-status">
<div style="width: 60%; margin: 0 auto"> <div style="width: 60%; margin: 0 auto">
<nz-steps style="width: 70%; margin: 0 auto" [nzLabelPlacement]="'vertical'"> <nz-steps style="width: 70%; margin: 0 auto" [nzLabelPlacement]="'vertical'">
<nz-step <nz-step [nzStatus]="i?.resourceStatus !== '1' ? 'finish' : 'process'" nzIcon="solution"
[nzStatus]="i?.resourceStatus !== '1' ? 'finish' : 'process'" [nzDescription]="i?.createAt" nzTitle="下单" [nzSubtitle]="i?.createTime"></nz-step>
nzIcon="solution" <nz-step *ngIf="i?.resourceStatus === '1' || i?.resourceStatus === '2'"
[nzDescription]="i?.createAt" [nzStatus]="i?.resourceStatus === '1' ? 'wait' : 'finish'" nzIcon="file-done"
nzTitle="下单" [nzTitle]="i?.resourceStatus === '2' ? '已完结' : '完结'" [nzSubtitle]="i?.endTime"></nz-step>
></nz-step>
<nz-step <nz-step nzStatus="finish" nzIcon="close-circle" nzTitle="取消货源" *ngIf="i?.resourceStatus === '3'"
*ngIf="i?.resourceStatus === '1' || i?.resourceStatus === '2'" [nzSubtitle]="i?.endTime"></nz-step>
[nzStatus]="i?.resourceStatus === '1' ? 'wait' : 'finish'"
nzIcon="file-done"
[nzTitle]="i?.resourceStatus === '2' ? '已完结' : '完结'"
></nz-step>
<nz-step nzStatus="finish" nzIcon="close-circle" nzTitle="取消货源" *ngIf="i?.resourceStatus === '3'"></nz-step>
</nz-steps> </nz-steps>
</div> </div>
</div> </div>
@ -77,10 +73,8 @@
</ng-container> </ng-container>
</sv-container> </sv-container>
<div class="mt-md"> <div class="mt-md">
<h4 class="text-md" <h4 class="text-md">装货卸货信息
>装货卸货信息 <span class="ml-sm text-sm">(
<span class="ml-sm text-sm"
>(
<label>{{ i?.loadingCount || '一' }}装</label> <label>{{ i?.loadingCount || '一' }}装</label>
<label>{{ i?.unloadingCount || '一' }}卸</label> <label>{{ i?.unloadingCount || '一' }}卸</label>
) )
@ -130,7 +124,8 @@
<nz-divider class="mb-xs mt-xs"></nz-divider> <nz-divider class="mb-xs mt-xs"></nz-divider>
<div class="text-right"> <div class="text-right">
<label>单价:</label> <label>单价:</label>
<span class="text-error-dark text-xxl">{{ item?.freightPrice | currency: '¥' }} {{ freightType[item?.freightType] }}</span> <span class="text-error-dark text-xxl">{{ item?.freightPrice | currency: '¥' }} {{
freightType[item?.freightType] }}</span>
</div> </div>
</div> </div>
</div> </div>
@ -139,8 +134,7 @@
<nz-card nzTitle="关联运单"> <nz-card nzTitle="关联运单">
<sv-container col="5"> <sv-container col="5">
<sv [label]="item?.wayBillStatusLabel" *ngFor="let item of i?.wayBillClassifiedStatisticsVOList"> <sv [label]="item?.wayBillStatusLabel" *ngFor="let item of i?.wayBillClassifiedStatisticsVOList">
(<span [ngClass]="{ 'text-primary': item?.count > 0 }">{{ item?.count }}</span (<span [ngClass]="{ 'text-primary': item?.count > 0 }">{{ item?.count }}</span>)
>)
</sv> </sv>
<!-- <sv label="运输中"> <!-- <sv label="运输中">
(<span [ngClass]="{ 'text-primary': i?.id > 0 }">{{ i?.id }}</span>) (<span [ngClass]="{ 'text-primary': i?.id > 0 }">{{ i?.id }}</span>)
@ -176,14 +170,10 @@
</sv-container> </sv-container>
</nz-card> </nz-card>
<nz-card nzTitle="操作日志"> <nz-card nzTitle="操作日志">
<st <st #st [data]="service.$api_getOperationLogRecordsList" [columns]="logColumns"
#st
[data]="service.$api_getOperationLogRecordsList"
[columns]="logColumns"
[page]="{ show: false, showSize: false }" [page]="{ show: false, showSize: false }"
[req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, params: reqParams }" [req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, params: reqParams }"
[res]="{ reName: { list: 'data.records', total: 'data.total' } }" [res]="{ reName: { list: 'data.records', total: 'data.total' } }">
>
</st> </st>
</nz-card> </nz-card>
</div> </div>

View File

@ -20,7 +20,7 @@
<div nz-col [nzSpan]="10"> <div nz-col [nzSpan]="10">
<div *ngFor="let data1 of startInfo; let idx = index"> <div *ngFor="let data1 of startInfo; let idx = index">
<nz-form-item> <nz-form-item>
<nz-form-label [nzSpan]="3" nzRequired>装货地</nz-form-label> <nz-form-label nzRequired>装货地</nz-form-label>
<nz-form-control [nzErrorTip]="'请输入装货地'"> <nz-form-control [nzErrorTip]="'请输入装货地'">
<div class="align-center"> <div class="align-center">
<nz-input-group [nzSuffix]="endInconTemp1"> <nz-input-group [nzSuffix]="endInconTemp1">
@ -30,13 +30,14 @@
(click)="openMap('start', idx)" (click)="openMap('start', idx)"
formControlName="loadAddress{{ idx }}" formControlName="loadAddress{{ idx }}"
placeholder="请输入装货地" placeholder="请输入装货地"
readonly="true"
/> />
</nz-input-group> </nz-input-group>
</div> </div>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
<nz-form-item> <nz-form-item>
<nz-form-label [nzSpan]="3" nzRequired>联系人</nz-form-label> <nz-form-label nzRequired>联系人</nz-form-label>
<div style="display: flex ;width: 86%"> <div style="display: flex ;width: 86%">
<nz-form-control [nzErrorTip]="'请输入联系人姓名'"> <nz-form-control [nzErrorTip]="'请输入联系人姓名'">
<input <input
@ -70,7 +71,7 @@
<div nz-col [nzSpan]="10"> <div nz-col [nzSpan]="10">
<div *ngFor="let data2 of endInfo; let idx = index"> <div *ngFor="let data2 of endInfo; let idx = index">
<nz-form-item> <nz-form-item>
<nz-form-label [nzSpan]="3" nzRequired>卸货地</nz-form-label> <nz-form-label nzRequired>卸货地</nz-form-label>
<nz-form-control [nzErrorTip]="'请输入卸货地'"> <nz-form-control [nzErrorTip]="'请输入卸货地'">
<div class="align-center"> <div class="align-center">
<nz-input-group [nzSuffix]="endInconTemp1"> <nz-input-group [nzSuffix]="endInconTemp1">
@ -80,13 +81,14 @@
(click)="openMap('end', idx)" (click)="openMap('end', idx)"
formControlName="unloadAddress{{ idx }}" formControlName="unloadAddress{{ idx }}"
placeholder="请输入卸货地" placeholder="请输入卸货地"
readonly="true"
/> />
</nz-input-group> </nz-input-group>
</div> </div>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
<nz-form-item> <nz-form-item>
<nz-form-label [nzSpan]="3" nzRequired>联系人</nz-form-label> <nz-form-label nzRequired>联系人</nz-form-label>
<div style="display: flex;width: 86%"> <div style="display: flex;width: 86%">
<nz-form-control [nzErrorTip]="'请输入联系人姓名'"> <nz-form-control [nzErrorTip]="'请输入联系人姓名'">
<input <input
@ -124,7 +126,6 @@
<sf #sf4 [schema]="schema4" [formData]="sf4data" [button]="'none'" [ui]="ui4"> <sf #sf4 [schema]="schema4" [formData]="sf4data" [button]="'none'" [ui]="ui4">
<ng-template sf-template="freightPrice" let-i let-ui="ui"> <ng-template sf-template="freightPrice" let-i let-ui="ui">
<nz-input-group [nzAddOnAfter]="addOnAfterTemplate"> <nz-input-group [nzAddOnAfter]="addOnAfterTemplate">
<!-- <input nz-input [ngModel]="i.value" (ngModelChange)="i.setValue($event)" placeholder="请输入" /> -->
<nz-input-number [ngModel]="i.value" (ngModelChange)="i.setValue($event)" [nzMin]="1" style="width: 100%"></nz-input-number> <nz-input-number [ngModel]="i.value" (ngModelChange)="i.setValue($event)" [nzMin]="1" style="width: 100%"></nz-input-number>
</nz-input-group> </nz-input-group>
<ng-template #addOnAfterTemplate> <ng-template #addOnAfterTemplate>
@ -199,7 +200,7 @@
<ng-template sf-template="paymentDays" let-i let-ui="ui"> <ng-template sf-template="paymentDays" let-i let-ui="ui">
<div nz-row> <div nz-row>
<div class="align-center" > <div class="align-center" >
<div nz-col nzSpan="16"> <div nz-col nzSpan="12">
<nz-input-number <nz-input-number
[(ngModel)]="i.value" [(ngModel)]="i.value"
(ngModelChange)="i.setValue($event)" (ngModelChange)="i.setValue($event)"
@ -208,7 +209,7 @@
[nzStep]="1" [nzStep]="1"
></nz-input-number> ></nz-input-number>
</div> </div>
<div nz-col nzSpan="8"> <div nz-col nzSpan="12">
<span>&nbsp;天内支付运费</span> <span>&nbsp;天内支付运费</span>
</div> </div>
</div> </div>

View File

@ -46,6 +46,13 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
startInfo: any = []; startInfo: any = [];
endInfo: any = []; endInfo: any = [];
PageStatus = ''; PageStatus = '';
limitValues = {
maxMonth: 99,
maxWeight: 99999,
maxVolume: 99999,
maxTrainNumber: 99999,
maxFreight: 9999999
}
constructor( constructor(
private http: _HttpClient, private http: _HttpClient,
fb: FormBuilder, fb: FormBuilder,
@ -96,6 +103,7 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
this.initSF4(); this.initSF4();
this.initSF6(); this.initSF6();
this.initdata(); this.initdata();
this.getLimitvalue();
} }
initSF1() { initSF1() {
this.schema1 = { this.schema1 = {
@ -110,9 +118,10 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
searchDebounceTime: 300, searchDebounceTime: 300,
searchLoadingText: '搜索中...', searchLoadingText: '搜索中...',
onSearch: (q: any) => { onSearch: (q: any) => {
if (!!q) { let str =q.replace(/^\s+|\s+$/g,"");
if (str) {
return this.service return this.service
.request(this.service.$api_enterpriceList, { enterpriseName: q }) .request(this.service.$api_enterpriceList, { enterpriseName: str })
.pipe(map(res => (res as any[]).map(i => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum)))) .pipe(map(res => (res as any[]).map(i => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum))))
.toPromise(); .toPromise();
} else { } else {
@ -120,7 +129,10 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
} }
}, },
change: (q: any) => { change: (q: any) => {
this.getRegionCode(q); let str =q.replace(/^\s+|\s+$/g,"");
if (str) {
this.getRegionCode(str);
}
}, },
} as SFSelectWidgetSchema } as SFSelectWidgetSchema
}, },
@ -146,18 +158,18 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
ui: { ui: {
placeholder: '请输入', placeholder: '请输入',
format: 'yyyy-MM-dd HH:mm:ss', format: 'yyyy-MM-dd HH:mm:ss',
disabledDate: (current: Date): boolean => { validator: (val) => {
let d = new Date(); let d = new Date();
let year = d.getFullYear(); let year = d.getFullYear();
let month = d.getMonth(); let month = d.getMonth();
let date = d.getDate(); let date = d.getDate();
let mydate = new Date(year, month + 3, date); let mydate = new Date(year, month + this.limitValues.maxMonth, date);
return differenceInCalendarDays(current, new Date()) < 0 || differenceInCalendarDays(current, mydate) > 0;
},
validator: (val) => {
if (new Date(val) < new Date()) { if (new Date(val) < new Date()) {
return [{ keyword: 'validTime', message: '有效期时间需大于当前时间' }]; return [{ keyword: 'validTime', message: '有效期时间需大于当前时间' }];
} }
if (new Date(val) > mydate) {
return [{ keyword: 'validTime2', message: `有效期最长为${this.limitValues.maxMonth}个月` }];
}
return []; return [];
}, },
} }
@ -412,6 +424,7 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
grid: { lg: 8, md: 12, sm: 12, xs: 24 } grid: { lg: 8, md: 12, sm: 12, xs: 24 }
}, },
$carModel: { $carModel: {
spanLabelFixed: 120,
grid: { span: 8 } grid: { span: 8 }
}, },
$carLength: { $carLength: {
@ -522,7 +535,7 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
} as SFTextareaWidgetSchema } as SFTextareaWidgetSchema
} }
}, },
required: ['stateReceipt', 'receiptType', 'receiptUserName','receiptUserPhone','receiptAddressArea','receiptAddress'] required: ['stateReceipt', 'receiptType', 'receiptUserName','receiptUserPhone','receiptAddressArea','receiptAddress','paymentDays']
}; };
this.ui7 = { this.ui7 = {
'*': { '*': {
@ -644,7 +657,6 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
} }
// 提交前确认,委托运输协议弹窗 // 提交前确认,委托运输协议弹窗
submitConfirm(submitType?: any) { submitConfirm(submitType?: any) {
// 校验规则
Object.keys(this.validateForm1.controls).forEach(key => { Object.keys(this.validateForm1.controls).forEach(key => {
this.validateForm1.controls[key].markAsDirty(); this.validateForm1.controls[key].markAsDirty();
this.validateForm1.controls[key].updateValueAndValidity(); this.validateForm1.controls[key].updateValueAndValidity();
@ -652,8 +664,18 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
this.sf1.validator({ emitError: true }); this.sf1.validator({ emitError: true });
this.sf3.validator({ emitError: true }); this.sf3.validator({ emitError: true });
this.sf4.validator({ emitError: true }); this.sf4.validator({ emitError: true });
this.sf7.validator({ emitError: true }); if (this.validateForm1.invalid || !this.sf1.valid || !this.sf3.valid || !this.sf4.valid ) {
if (this.validateForm1.invalid || !this.sf3.valid || !this.sf1.valid || !this.sf4.valid || !this.sf7.valid) { this.service.msgSrv.warning('请完善必填项!');
return;
}
// 校验各个输入限定值
if (this.sf4.value.weight > this.limitValues.maxWeight || this.sf4.value.volume > this.limitValues.maxVolume || this.sf4.value.number > this.limitValues.maxTrainNumber) {
this.service.msgSrv.error(`当前货物核载信息已超出限定值【${this.limitValues.maxWeight}吨、${this.limitValues.maxVolume}方、${this.limitValues.maxTrainNumber}车】`);
return;
}
if (this.sf4.value.freightPrice > this.limitValues.maxFreight) {
this.service.msgSrv.error(`当前运费单价已超出限定值【${this.limitValues.maxFreight}元】`);
return; return;
} }
@ -671,15 +693,20 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
} }
// 确认提交 // 确认提交
submit(submitType?: string): void { submit(submitType?: string): void {
if (typeof this.validateForm1.value.modifyTime !== 'string') { // //装卸货信息
var c = new Date(this.validateForm1.value.modifyTime); const LoadingList = this.startInfo.concat(this.endInfo);
this.validateForm1.value.modifyTime =
c.getFullYear() + '-' + (c.getMonth() + 1) + '-' + c.getDate() + ' ' + c.getHours() + ':' + c.getMinutes() + ':' + c.getSeconds(); // 货物信息
const sf3Values = { ...this.sf3.value };
if (sf3Values.goodsTypeName === '其它') {
sf3Values.goodsName = sf3Values.goodsName1;
delete sf3Values.goodsName1;
} }
if (typeof this.validateForm1.value.createTime !== 'string') { if (this.sf4.value.carModel.includes('999')) {
var c = new Date(this.validateForm1.value.createTime); this.sf4.value.carModel = ['999']
this.validateForm1.value.createTime = }
c.getFullYear() + '-' + (c.getMonth() + 1) + '-' + c.getDate() + ' ' + c.getHours() + ':' + c.getMinutes() + ':' + c.getSeconds(); if (this.sf4.value.carLength.includes('999')) {
this.sf4.value.carLength = ['999']
} }
const params: any = { const params: any = {
@ -1051,4 +1078,27 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
}); });
} }
} }
getLimitvalue() {
const getlimitvaluesParms = [
this.service.limitKeys2.month,
this.service.limitKeys2.weight,
this.service.limitKeys2.volume,
this.service.limitKeys2.trainNumber,
this.service.limitKeys2.freight,
];
this.service.request(this.service.$api_findItemValueByItemKeys, getlimitvaluesParms).subscribe((res) => {
const maxMonth = res.filter((item: any) => item.itemKey === this.service.limitKeys2.month)[0].itemValue;
const maxWeight = res.filter((item: any) => item.itemKey === this.service.limitKeys2.weight)[0].itemValue;
const maxVolume = res.filter((item: any) => item.itemKey === this.service.limitKeys2.volume)[0].itemValue;
const maxTrainNumber = res.filter((item: any) => item.itemKey === this.service.limitKeys2.trainNumber)[0].itemValue;
const maxFreight = res.filter((item: any) => item.itemKey === this.service.limitKeys2.freight)[0].itemValue;
this.limitValues = {
maxMonth: Number(maxMonth),
maxWeight: Number(maxWeight),
maxVolume: Number(maxVolume),
maxTrainNumber: Number(maxTrainNumber),
maxFreight: Number(maxFreight)
}
})
}
} }

View File

@ -17,7 +17,7 @@
</nz-card> </nz-card>
<nz-card> <nz-card>
<div class="card-title" <div class="card-title"x
>装卸货信息<span class="tip-font">预计公里数:{{ totalDistance }}km预计行程耗时{{ totalTime }}小时</span></div >装卸货信息<span class="tip-font">预计公里数:{{ totalDistance }}km预计行程耗时{{ totalTime }}小时</span></div
> >
@ -26,7 +26,7 @@
<div nz-col [nzSpan]="10"> <div nz-col [nzSpan]="10">
<div *ngFor="let data1 of startInfo; let idx = index"> <div *ngFor="let data1 of startInfo; let idx = index">
<nz-form-item> <nz-form-item>
<nz-form-label [nzSpan]="3" nzRequired>装货地</nz-form-label> <nz-form-label nzRequired>装货地</nz-form-label>
<nz-form-control [nzErrorTip]="'请输入装货地'"> <nz-form-control [nzErrorTip]="'请输入装货地'">
<div class="align-center"> <div class="align-center">
<nz-input-group [nzSuffix]="endInconTemp1"> <nz-input-group [nzSuffix]="endInconTemp1">
@ -37,13 +37,14 @@
name="startDetailedAddress{{ idx }}" name="startDetailedAddress{{ idx }}"
placeholder="请输入装货地" placeholder="请输入装货地"
required required
readonly="true"
/> />
</nz-input-group> </nz-input-group>
</div> </div>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
<nz-form-item > <nz-form-item >
<nz-form-label [nzSpan]="3" nzRequired>联系人</nz-form-label> <nz-form-label nzRequired>联系人</nz-form-label>
<div style="display: flex;width: 86%"> <div style="display: flex;width: 86%">
<nz-form-control [nzErrorTip]="'请输入联系人姓名'"> <nz-form-control [nzErrorTip]="'请输入联系人姓名'">
<input <input
@ -79,7 +80,7 @@
<div nz-col [nzSpan]="10"> <div nz-col [nzSpan]="10">
<div *ngFor="let data2 of endInfo; let idx = index"> <div *ngFor="let data2 of endInfo; let idx = index">
<nz-form-item> <nz-form-item>
<nz-form-label [nzSpan]="3" nzRequired>卸货地</nz-form-label> <nz-form-label nzRequired>卸货地</nz-form-label>
<nz-form-control [nzErrorTip]="'请输入卸货地'"> <nz-form-control [nzErrorTip]="'请输入卸货地'">
<div class="align-center"> <div class="align-center">
<nz-input-group [nzSuffix]="endInconTemp1"> <nz-input-group [nzSuffix]="endInconTemp1">
@ -90,13 +91,14 @@
name="endDetailedAddress{{ idx }}" name="endDetailedAddress{{ idx }}"
placeholder="请输入卸货地" placeholder="请输入卸货地"
required required
readonly="true"
/> />
</nz-input-group> </nz-input-group>
</div> </div>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
<nz-form-item> <nz-form-item>
<nz-form-label [nzSpan]="3" nzRequired>联系人</nz-form-label> <nz-form-label nzRequired>联系人</nz-form-label>
<div style="display: flex;width: 86%"> <div style="display: flex;width: 86%">
<nz-form-control [nzErrorTip]="'请输入联系人姓名'"> <nz-form-control [nzErrorTip]="'请输入联系人姓名'">
<input <input
@ -217,7 +219,7 @@
<ng-template sf-template="paymentDays" let-i let-ui="ui"> <ng-template sf-template="paymentDays" let-i let-ui="ui">
<div nz-row> <div nz-row>
<div class="align-center" > <div class="align-center" >
<div nz-col nzSpan="16"> <div nz-col nzSpan="12">
<nz-input-number <nz-input-number
[ngModel]="i.value" [ngModel]="i.value"
[nzMin]="1" [nzMin]="1"
@ -227,7 +229,7 @@
nzPlaceHolder="请输入1-30" nzPlaceHolder="请输入1-30"
></nz-input-number> ></nz-input-number>
</div> </div>
<div nz-col nzSpan="8"> <div nz-col nzSpan="12">
<span>&nbsp;天内支付运费</span> <span>&nbsp;天内支付运费</span>
</div> </div>
</div> </div>

View File

@ -4,7 +4,7 @@
width: 100%; width: 100%;
} }
nz-date-picker { nz-date-picker {
width: 100%; width: 94.3%;
} }
} }
i { i {
@ -37,10 +37,6 @@
:hover{color: #52acff;} :hover{color: #52acff;}
} }
#container {
width: 300px;
height: 180px;
}
input[type='number'] { input[type='number'] {
-moz-appearance: textfield; -moz-appearance: textfield;

View File

@ -41,6 +41,13 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
totalFees: any; // 总数信息 totalFees: any; // 总数信息
id = ''; id = '';
type = 'add'; type = 'add';
limitValues = {
maxMonth: 99,
maxWeight: 99999,
maxVolume: 99999,
maxTrainNumber: 99999,
maxFreight: 9999999
}
// // 单位 // // 单位
startInfo: any[] = []; startInfo: any[] = [];
endInfo: any[] = []; endInfo: any[] = [];
@ -80,6 +87,7 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
this.initSF3(); this.initSF3();
this.initSF4(); this.initSF4();
this.initSF6(); this.initSF6();
this.getLimitvalue();
this.startInfo = [ this.startInfo = [
{ {
detailedAddress: '', detailedAddress: '',
@ -121,9 +129,10 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
searchLoadingText: '搜索中...', searchLoadingText: '搜索中...',
allowClear: true, allowClear: true,
onSearch: (q: any) => { onSearch: (q: any) => {
if (!!q) { let str =q.replace(/^\s+|\s+$/g,"");
if (str) {
return this.service return this.service
.request(this.service.$api_enterpriceList, { enterpriseName: q }) .request(this.service.$api_enterpriceList, { enterpriseName: str })
.pipe(map((res: any[]) => (res as any[]).map(i => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum)))) .pipe(map((res: any[]) => (res as any[]).map(i => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum))))
.toPromise(); .toPromise();
} else { } else {
@ -131,7 +140,10 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
} }
}, },
change: (q: any) => { change: (q: any) => {
this.getRegionCode(q); let str =q.replace(/^\s+|\s+$/g,"");
if (str) {
this.getRegionCode(str);
}
} }
} as SFSelectWidgetSchema } as SFSelectWidgetSchema
}, },
@ -169,18 +181,18 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
ui: { ui: {
placeholder: '请输入', placeholder: '请输入',
format: 'yyyy-MM-dd HH:mm:ss', format: 'yyyy-MM-dd HH:mm:ss',
disabledDate: (current: Date): boolean => { validator: (val) => {
let d = new Date(); let d = new Date();
let year = d.getFullYear(); let year = d.getFullYear();
let month = d.getMonth(); let month = d.getMonth();
let date = d.getDate(); let date = d.getDate();
let mydate = new Date(year, month + 3, date); let mydate = new Date(year, month + this.limitValues.maxMonth, date);
return differenceInCalendarDays(current, new Date()) < 0 || differenceInCalendarDays(current, mydate) > 0;
},
validator: (val) => {
if (new Date(val) < new Date()) { if (new Date(val) < new Date()) {
return [{ keyword: 'validTime', message: '有效期时间需大于当前时间' }]; return [{ keyword: 'validTime', message: '有效期时间需大于当前时间' }];
} }
if (new Date(val) > mydate) {
return [{ keyword: 'validTime2', message: `有效期最长为${this.limitValues.maxMonth}个月` }];
}
return []; return [];
}, },
} }
@ -435,6 +447,7 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
grid: { lg: 8, md: 12, sm: 12, xs: 24 } grid: { lg: 8, md: 12, sm: 12, xs: 24 }
}, },
$carModel: { $carModel: {
spanLabelFixed: 120,
grid: { span: 8 } grid: { span: 8 }
}, },
$carLength: { $carLength: {
@ -532,7 +545,7 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
} as SFTextareaWidgetSchema } as SFTextareaWidgetSchema
} }
}, },
required: ['stateReceipt', 'paymentDays', 'receiptType', 'receiptUserName','receiptUserPhone','receiptAddressArea','receiptAddress'] required: ['stateReceipt', 'paymentDays', 'receiptType', 'receiptUserName','receiptUserPhone','receiptAddressArea','receiptAddress','paymentDays']
}; };
this.ui6 = { this.ui6 = {
'*': { '*': {
@ -580,9 +593,19 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
this.sf4.validator({ emitError: true }); this.sf4.validator({ emitError: true });
this.sf6.validator({ emitError: true }); this.sf6.validator({ emitError: true });
if (this.ngForm.form.invalid || !this.sf1.valid || !this.sf3.valid || !this.sf4.valid || !this.sf6.valid) { if (this.ngForm.form.invalid || !this.sf1.valid || !this.sf3.valid || !this.sf4.valid || !this.sf6.valid) {
this.service.msgSrv.warning('请完善必填项!');
return;
}
// 校验各个输入限定值
if (this.sf4.value.weight > this.limitValues.maxWeight || this.sf4.value.volume > this.limitValues.maxVolume || this.sf4.value.number > this.limitValues.maxTrainNumber) {
this.service.msgSrv.error(`当前货物核载信息已超出限定值【${this.limitValues.maxWeight}吨、${this.limitValues.maxVolume}方、${this.limitValues.maxTrainNumber}车】`);
return; return;
} }
if (this.sf4.value.freightPrice > this.limitValues.maxFreight) {
this.service.msgSrv.error(`当前运费单价已超出限定值【${this.limitValues.maxFreight}元】`);
return;
}
const modalRef = this.modalService.create({ const modalRef = this.modalService.create({
nzTitle: '运输协议', nzTitle: '运输协议',
nzContent: TranAgreementComponent, nzContent: TranAgreementComponent,
@ -599,12 +622,20 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
submit(submitType: string): void { submit(submitType: string): void {
// //装卸货信息 // //装卸货信息
const LoadingList = this.startInfo.concat(this.endInfo); const LoadingList = this.startInfo.concat(this.endInfo);
// 货物信息 // 货物信息
const sf3Values = { ...this.sf3.value }; const sf3Values = { ...this.sf3.value };
if (sf3Values.goodsTypeName === '其它') { if (sf3Values.goodsTypeName === '其它') {
sf3Values.goodsName = sf3Values.goodsName1; sf3Values.goodsName = sf3Values.goodsName1;
delete sf3Values.goodsName1; delete sf3Values.goodsName1;
} }
if (this.sf4.value.carModel.includes('999')) {
this.sf4.value.carModel = ['999']
}
if (this.sf4.value.carLength.includes('999')) {
this.sf4.value.carLength = ['999']
}
const goodsInfoList = [ const goodsInfoList = [
{ {
...sf3Values, ...sf3Values,
@ -816,4 +847,27 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
}); });
} }
} }
getLimitvalue() {
const getlimitvaluesParms = [
this.service.limitKeys2.month,
this.service.limitKeys2.weight,
this.service.limitKeys2.volume,
this.service.limitKeys2.trainNumber,
this.service.limitKeys2.freight,
];
this.service.request(this.service.$api_findItemValueByItemKeys, getlimitvaluesParms).subscribe((res) => {
const maxMonth = res.filter((item: any) => item.itemKey === this.service.limitKeys2.month)[0].itemValue;
const maxWeight = res.filter((item: any) => item.itemKey === this.service.limitKeys2.weight)[0].itemValue;
const maxVolume = res.filter((item: any) => item.itemKey === this.service.limitKeys2.volume)[0].itemValue;
const maxTrainNumber = res.filter((item: any) => item.itemKey === this.service.limitKeys2.trainNumber)[0].itemValue;
const maxFreight = res.filter((item: any) => item.itemKey === this.service.limitKeys2.freight)[0].itemValue;
this.limitValues = {
maxMonth: Number(maxMonth),
maxWeight: Number(maxWeight),
maxVolume: Number(maxVolume),
maxTrainNumber: Number(maxTrainNumber),
maxFreight: Number(maxFreight)
}
})
}
} }

View File

@ -4,7 +4,7 @@
* @Author : Shiming * @Author : Shiming
* @Date : 2022-01-12 10:52:50 * @Date : 2022-01-12 10:52:50
* @LastEditors : Shiming * @LastEditors : Shiming
* @LastEditTime : 2022-02-25 15:22:19 * @LastEditTime : 2022-03-02 18:09:01
* @FilePath : \\tms-obc-web\\src\\app\\routes\\supply-management\\components\\bulk\\bulk.component.html * @FilePath : \\tms-obc-web\\src\\app\\routes\\supply-management\\components\\bulk\\bulk.component.html
* Copyright (C) 2022 huzhenhong. All rights reserved. * Copyright (C) 2022 huzhenhong. All rights reserved.
--> -->
@ -32,8 +32,8 @@
</div> </div>
<div nz-col [nzSpan]="_$expand ? 24 : 6" class="text-right"> <div nz-col [nzSpan]="_$expand ? 24 : 6" class="text-right">
<button nz-button nzType="primary" [nzLoading]="loading" (click)="search()" acl [acl-ability]="['SUPPLY-INDEX-bulkSearch']">查询</button> <button nz-button nzType="primary" [nzLoading]="loading" (click)="search()" acl [acl-ability]="['SUPPLY-INDEX-bulkSearch']">查询</button>
<button nz-button nzType="primary" [nzLoading]="loading">导入</button> <button nz-button nzType="primary" [disabled]="loading">导入</button>
<button nz-button [nzLoading]="loading" (click)="resetSF()">重置</button> <button nz-button [disabled]="loading" (click)="resetSF()">重置</button>
<button nz-button nzType="link" (click)="expandToggle()"> <button nz-button nzType="link" (click)="expandToggle()">
{{ !_$expand ? '展开' : '收起' }} {{ !_$expand ? '展开' : '收起' }}
<i nz-icon [nzType]="!_$expand ? 'down' : 'up'"></i> <i nz-icon [nzType]="!_$expand ? 'down' : 'up'"></i>
@ -52,7 +52,7 @@
<nz-tabset (nzSelectedIndexChange)="selectChange($event)" [nzTabBarExtraContent]="extraTemplate"> <nz-tabset (nzSelectedIndexChange)="selectChange($event)" [nzTabBarExtraContent]="extraTemplate">
<nz-tab [nzTitle]="'全部(' + tabs?.totalQuantity + ')'"></nz-tab> <nz-tab [nzTitle]="'全部(' + tabs?.totalQuantity + ')'"></nz-tab>
<nz-tab [nzTitle]="'进行中(' + tabs?.stayQuantity + ')'"></nz-tab> <nz-tab [nzTitle]="'进行中(' + tabs?.stayQuantity + ')'"></nz-tab>
<nz-tab [nzTitle]="'已完结(' + tabs?.receivedQuantity + ')'"></nz-tab> <nz-tab [nzTitle]="'已完结(' + tabs?.completedQuantity + ')'"></nz-tab>
<nz-tab [nzTitle]="'已取消(' + tabs?.cancelQuantity + ')'"></nz-tab> <nz-tab [nzTitle]="'已取消(' + tabs?.cancelQuantity + ')'"></nz-tab>
</nz-tabset> </nz-tabset>
<div style="position: relative"> <div style="position: relative">
@ -75,6 +75,9 @@
[page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100, 200, 300, 500, 1000] }" [page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100, 200, 300, 500, 1000] }"
[loading]="loading" [loading]="loading"
> >
<ng-template st-row="createUserName" let-item let-index="index">
<div> {{ item?.createUserName }}/{{ item?.createUserPhone }} </div>
</ng-template>
<!--运费单价 --> <!--运费单价 -->
<ng-template st-row="freightPrice" let-item let-index="index"> <ng-template st-row="freightPrice" let-item let-index="index">
<div class="mr-xs">{{ item?.freightPrice | currency }} </div> <div class="mr-xs">{{ item?.freightPrice | currency }} </div>

View File

@ -36,7 +36,7 @@ export class SupplyManagementBulkComponent implements OnInit {
tabs = { tabs = {
totalQuantity: 0, totalQuantity: 0,
cancelQuantity: 0, cancelQuantity: 0,
receivedQuantity: 0, completedQuantity: 0,
stayQuantity: 0 stayQuantity: 0
}; };
constructor( constructor(
@ -209,10 +209,10 @@ export class SupplyManagementBulkComponent implements OnInit {
}, },
allowClear: true, allowClear: true,
onSearch: (q: any) => { onSearch: (q: any) => {
console.log(q) let str =q.replace(/^\s+|\s+$/g,"");
if (!!q) { if (str) {
return this.service return this.service
.request(this.service.$api_enterpriceList, { enterpriseName: q}) .request(this.service.$api_enterpriceList, { enterpriseName: str})
.pipe(map((res: any) => (res as any[]).map((i) => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum)))) .pipe(map((res: any) => (res as any[]).map((i) => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum))))
.toPromise(); .toPromise();
} else { } else {
@ -255,6 +255,7 @@ export class SupplyManagementBulkComponent implements OnInit {
className: 'text-left', className: 'text-left',
render: 'resourceCode' render: 'resourceCode'
}, },
{ title: '录单员', render: 'createUserName', width: '200px', className: 'text-left' },
{ title: '货主', index: 'shipperAppUserName', width: '220px', className: 'text-left' }, { title: '货主', index: 'shipperAppUserName', width: '220px', className: 'text-left' },
{ title: '项目名称', index: 'enterpriseProjectName', width: '220px', className: 'text-left' }, { title: '项目名称', index: 'enterpriseProjectName', width: '220px', className: 'text-left' },
{ title: '关联订单', render: 'orderSn', width: '200px', className: 'text-left' }, { title: '关联订单', render: 'orderSn', width: '200px', className: 'text-left' },
@ -392,7 +393,11 @@ export class SupplyManagementBulkComponent implements OnInit {
selectChange(e: number) { selectChange(e: number) {
console.log(e); console.log(e);
if(e == 2) {
this.resourceStatus = 4;
} else {
this.resourceStatus = e; this.resourceStatus = e;
}
this.initST(); this.initST();
setTimeout(() => { setTimeout(() => {
this.st.load(1); this.st.load(1);
@ -406,7 +411,7 @@ export class SupplyManagementBulkComponent implements OnInit {
assignedQrcode(item: any) { assignedQrcode(item: any) {
const modalRef = this.modal.create({ const modalRef = this.modal.create({
nzTitle: '二维码', nzTitle: '二维码',
nzWidth: '600px', nzWidth: '468px',
nzContent: SupplyManagementQrcodePageComponent, nzContent: SupplyManagementQrcodePageComponent,
nzComponentParams: { nzComponentParams: {
i: item, i: item,
@ -458,7 +463,7 @@ export class SupplyManagementBulkComponent implements OnInit {
* 审核通过按钮 * 审核通过按钮
*/ */
handleOK(value: any) { handleOK(value: any) {
if(this.selectedRows.length <= 0) { if(this.auditMany === false) {
const params: any = { const params: any = {
id: this.auditID, id: this.auditID,
remarks: this.sfFre.value.remarks, remarks: this.sfFre.value.remarks,
@ -552,7 +557,7 @@ export class SupplyManagementBulkComponent implements OnInit {
this.tabs = { this.tabs = {
totalQuantity: 0, totalQuantity: 0,
cancelQuantity: 0, cancelQuantity: 0,
receivedQuantity: 0, completedQuantity: 0,
stayQuantity: 0 stayQuantity: 0
}; };
const params: any = Object.assign({}, this.reqParams || {}); const params: any = Object.assign({}, this.reqParams || {});

View File

@ -4,15 +4,12 @@
* @Author : Shiming * @Author : Shiming
* @Date : 2022-01-12 10:52:50 * @Date : 2022-01-12 10:52:50
* @LastEditors : Shiming * @LastEditors : Shiming
* @LastEditTime : 2022-01-18 17:27:53 * @LastEditTime : 2022-03-02 14:27:20
* @FilePath : \\tms-obc-web\\src\\app\\routes\\supply-management\\components\\choose-famifiar\\choose-famifiar.component.html * @FilePath : \\tms-obc-web\\src\\app\\routes\\supply-management\\components\\choose-famifiar\\choose-famifiar.component.html
* Copyright (C) 2022 huzhenhong. All rights reserved. * Copyright (C) 2022 huzhenhong. All rights reserved.
--> -->
<!-- <button nz-button nzType="primary" style="margin-bottom: 24px" (click)="add()"><i nz-icon nzType="plus"></i>添加司机</button> -->
<button nz-button nzType="primary" style="margin-bottom: 24px" (click)="add()"><i nz-icon nzType="plus"></i>添加司机</button>
<!-- 搜索区 --> <!-- 搜索区 -->
<div nz-row nzGutter="8">
<div nz-col [nzSpan]="12">
<div nz-row nzGutter="8"> <div nz-row nzGutter="8">
<div nz-col [nzSpan]="18"> <div nz-col [nzSpan]="18">
<sf #sf [ui]="ui" [schema]="schema" [button]="'none'"></sf> <sf #sf [ui]="ui" [schema]="schema" [button]="'none'"></sf>
@ -22,30 +19,20 @@
<button nz-button (click)="resetSF()">重置</button> <button nz-button (click)="resetSF()">重置</button>
</div> </div>
</div> </div>
</div>
</div>
<div nz-row nzGutter="8"> <div nz-row nzGutter="8">
<div nz-col [nzSpan]="12"> <div nz-col [nzSpan]="12">
<!-- 数据列表 --> <!-- 数据列表 -->
<st <st #st [bordered]="true" [data]="service.$api_getListCars" [columns]="columns" size="small"
#st
*ngIf="columns"
[bordered]="true"
[data]="service.$api_getList_card"
[columns]="columns"
size="small"
[req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, params: reqParams }" [req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, params: reqParams }"
[res]="{ reName: { list: 'data.records', total: 'data.total' }, process: reqProcess }" [res]="{ reName: { list: 'data.records', total: 'data.total' }, process: reqProcess }"
[page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100, 200, 300, 500, 1000] }" [page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100, 200, 300, 500, 1000] }"
[loading]="service.http.loading" [loadingDelay]="500" [loading]="service.http.loading" [widthMode]="{ type: 'strict' }" [scroll]="{ x: '600px' }"
[widthMode]="{ type: 'strict' }" style="margin-top: 22px">
[scroll]="{ x: '600px' }"
style="margin-top: 22px; width: 100%"
>
<ng-template st-row="userCarLicenseDesensitizationVOList" let-item let-index="index"> <ng-template st-row="userCarLicenseDesensitizationVOList" let-item let-index="index">
<nz-select [(ngModel)]="item.default" (ngModelChange)="carChange($event, item)" style="width: 100%"> <nz-select [(ngModel)]="item.default" (ngModelChange)="carChange($event, item)" style="width: 100%">
<nz-option nzValue="" nzLabel="不限"></nz-option> <nz-option nzValue="" nzLabel="不限"></nz-option>
<nz-option [nzValue]="cart" [nzLabel]="cart.carNo" *ngFor="let cart of item.userCarLicenseDesensitizationVOList"> </nz-option> <nz-option [nzValue]="cart" [nzLabel]="cart.carNo"
*ngFor="let cart of item.userCarLicenseDesensitizationVOList"> </nz-option>
</nz-select> </nz-select>
</ng-template> </ng-template>
</st> </st>
@ -53,21 +40,18 @@
<div nz-col [nzSpan]="12"> <div nz-col [nzSpan]="12">
<!-- 选中列表 --> <!-- 选中列表 -->
<div>已选择{{ st2Data.length }}位司机</div> <div>已选择{{ st2Data.length }}位司机</div>
<st <st #st2 [bordered]="true" [data]="st2Data" [columns]="columns2" size="small"
#st2 [req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, params: reqParams }"
*ngIf="columns2" [res]="{ reName: { list: 'data.records', total: 'data.total' } }"
[bordered]="true" [page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100, 200, 300, 500, 1000] }"
[data]="st2Data" [loadingDelay]="500" [loading]="service.http.loading" [widthMode]="{ type: 'strict' }" [scroll]="{ x: '600px' }">
[columns]="columns2"
size="small"
[page]="{ show: false }"
[scroll]="{ x: '600px', y: '300px' }"
style="width: 100%"
>
<ng-template st-row="captain" let-item let-index="index"> <ng-template st-row="captain" let-item let-index="index">
<span>{{ item.captainName }}&nbsp;{{ item.captainPhone }}</span> &nbsp; <span>{{ item.captainName }}&nbsp;{{ item.captainPhone }}</span> &nbsp;
<a (click)="setCaptain(item, index)">设置</a> <a (click)="setCaptain(item, index)">设置</a>
</ng-template> </ng-template>
<ng-template st-row="defaultCar" let-item let-index="index">
{{item.default?.carNo}}
</ng-template>
</st> </st>
</div> </div>
</div> </div>

View File

@ -3,7 +3,7 @@ import { ActivatedRoute, Router } from '@angular/router';
import { STChange, STColumn, STComponent, STData, STRequestOptions } from '@delon/abc/st'; import { STChange, STColumn, STComponent, STData, STRequestOptions } from '@delon/abc/st';
import { SFComponent, SFSchema, SFSelectWidgetSchema, SFUISchema } from '@delon/form'; import { SFComponent, SFSchema, SFSelectWidgetSchema, SFUISchema } from '@delon/form';
import { ModalHelper } from '@delon/theme'; import { ModalHelper } from '@delon/theme';
import { processSingleSort } from '@shared'; import { EAEnvironmentService, processSingleSort } from '@shared';
import { NzDrawerRef, NzDrawerService } from 'ng-zorro-antd/drawer'; import { NzDrawerRef, NzDrawerService } from 'ng-zorro-antd/drawer';
import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal'; import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal';
import { SupplyManagementAddDriversComponent } from 'src/app/routes/supply-management/components/add-drivers/add-drivers.component'; import { SupplyManagementAddDriversComponent } from 'src/app/routes/supply-management/components/add-drivers/add-drivers.component';
@ -37,7 +37,7 @@ export class PublishGoodsChooseFamifiarComponent implements OnInit {
submitUrl = ''; submitUrl = '';
@Input() @Input()
submitParams = {}; submitParams:any;
constructor( constructor(
private modal: NzModalRef, private modal: NzModalRef,
@ -47,7 +47,7 @@ export class PublishGoodsChooseFamifiarComponent implements OnInit {
public service: SupplyManagementService, public service: SupplyManagementService,
private modalService: NzModalService, private modalService: NzModalService,
private modalHelper: ModalHelper, private modalHelper: ModalHelper,
private cdr: ChangeDetectorRef private envSrv: EAEnvironmentService
) { } ) { }
/** /**
@ -61,26 +61,23 @@ export class PublishGoodsChooseFamifiarComponent implements OnInit {
} }
ngOnInit() { ngOnInit() {
this.initSF(); this.initSF();
setTimeout(() => {
this.initST(); this.initST();
this.initST2(); this.initST2();
}, 200);
} }
initSF() { initSF() {
this.schema = { this.schema = {
properties: { properties: {
name: { nameOrPhone: {
type: 'string', type: 'string',
title: '', title: '承运司机',
ui: { ui: {
placeholder: '请输入司机姓名/手机号' placeholder: '请输入司机姓名/手机号'
} }
}, },
name2: { carNo: {
type: 'string', type: 'string',
title: '', title: '车牌号',
ui: { ui: {
placeholder: '请输入车牌号' placeholder: '请输入车牌号'
} }
@ -98,13 +95,11 @@ export class PublishGoodsChooseFamifiarComponent implements OnInit {
this.columns = [ this.columns = [
{ {
title: '司机姓名', title: '司机姓名',
index: 'name', index: 'name'
width: 120
}, },
{ {
title: '手机号', title: '手机号',
index: 'telephone', index: 'telephone'
width: 120
}, },
{ {
title: '指定车辆', title: '指定车辆',
@ -115,7 +110,6 @@ export class PublishGoodsChooseFamifiarComponent implements OnInit {
title: '状态', title: '状态',
className: 'text-center', className: 'text-center',
index: 'certificationStatus', index: 'certificationStatus',
width: 120,
type: 'badge', type: 'badge',
badge: { badge: {
'-1': { text: '未提交', color: 'default' }, '-1': { text: '未提交', color: 'default' },
@ -127,12 +121,11 @@ export class PublishGoodsChooseFamifiarComponent implements OnInit {
{ {
title: '操作', title: '操作',
className: 'text-center', className: 'text-center',
width: 80,
buttons: [ buttons: [
{ {
text: '选择', text: '选择',
iif: item => item.showChoose != false, iif: item => item.showChoose != false,
click: (_record, _modal, _instance) => this.choose(_record), click: (_record, _modal, _instance) => this.verifyVechicleStatus(_record),
iifBehavior: 'disabled' iifBehavior: 'disabled'
} }
] ]
@ -145,7 +138,7 @@ export class PublishGoodsChooseFamifiarComponent implements OnInit {
{ {
title: '司机姓名', title: '司机姓名',
index: 'name', index: 'name',
width: 120 width: '90px'
}, },
{ {
title: '手机号', title: '手机号',
@ -155,17 +148,17 @@ export class PublishGoodsChooseFamifiarComponent implements OnInit {
{ {
title: '车队长', title: '车队长',
render: 'captain', render: 'captain',
width: '100px' width: '200px'
}, },
{ {
title: '指定车辆', title: '指定车辆',
index: 'carNo', render: 'defaultCar',
width: '130px' width: '130px'
}, },
{ {
title: '操作', title: '操作',
className: 'text-center', className: 'text-center',
width: 80, width: '90px',
buttons: [ buttons: [
{ {
text: '移除', text: '移除',
@ -198,6 +191,23 @@ export class PublishGoodsChooseFamifiarComponent implements OnInit {
}); });
} }
/**
* 校验司机是否能设置车队长
* @param item 当前对象
*/
verifyCanSetCarCaptain(item: any, index: any) {
this.service.request(this.service.$api_get_sys_config, [{ itemKey: 'sys.config.shipper.setCarCaptain', businessId: this.envSrv.env.enterpriseId }]).subscribe(res => {
if (res && res.length > 0) {
const { itemValue } = res[0];
if (itemValue !== '1') {
this.service.msgSrv.error('不可设置车队长!');
return;
}
this.setCaptain(item, index);
}
})
}
//设置车队长 //设置车队长
setCaptain(record: STData, index: any) { setCaptain(record: STData, index: any) {
this.modalHelper this.modalHelper
@ -260,5 +270,53 @@ export class PublishGoodsChooseFamifiarComponent implements OnInit {
}); });
} }
carChange(event: any, item: STData) {} carChange(event: any, item: STData) {
}
/**
* 验证车辆的状态
*/
verifyVechicleStatus(_record: STData) {
const { carId, appUserId: driverId, captainAppUserId: carCaptainId } = _record;
const carInfo: any = { carId, driverId, carCaptainId };
const goodsInfoList = this.submitParams?.goodsInfoList;
this.service.request(this.service.$api_verify_vehicle_status, { ...carInfo, goodsInfoList }).subscribe((res: any) => {
if (res) {
const { title, alert, subContent, content } = res;
switch (alert) {
case 'Error':
this.error(title, content, subContent);
break;
case 'Warn':
this.showConfirm(_record, title, content, subContent);
break;
case 'Success':
this.choose(_record);
break;
}
}
});
}
error(title: string, content: string, subContent: string): void {
this.modalService.error({
nzTitle: title,
nzContent: `<span class="text-error-dark">${content ? content : ''}</span><span class="text-grey-dark">${subContent ? subContent : ''}</span>`,
nzOkText: '知道了'
});
}
showConfirm(_record: STData, title: string, content: string, subContent: string): void {
this.modalService.confirm({
nzTitle: title,
nzContent: `<span class="text-error-dark">${content ? content : ''}</span><span class="text-grey-dark">${subContent ? subContent : ''}</span>`,
nzOkText: '继续',
nzCancelText: '取消',
nzOnOk: () => {
this.choose(_record);
}
});
}
} }

View File

@ -1,3 +1,13 @@
/*
* @Description :
* @Version : 1.0
* @Author : Shiming
* @Date : 2021-12-06 15:17:52
* @LastEditors : Shiming
* @LastEditTime : 2022-03-02 14:29:12
* @FilePath : \\tms-obc-web\\src\\app\\routes\\supply-management\\components\\choose-famifiar\\set-captain\\set-captain.component.ts
* Copyright (C) 2022 huzhenhong. All rights reserved.
*/
import { AfterViewInit, ChangeDetectorRef, Component, OnChanges, OnInit, ViewChild } from '@angular/core'; import { AfterViewInit, ChangeDetectorRef, Component, OnChanges, OnInit, ViewChild } from '@angular/core';
import { ActivatedRoute } from '@angular/router'; import { ActivatedRoute } from '@angular/router';
import { SFComponent, SFSchema, SFSchemaEnumType, SFUISchema } from '@delon/form'; import { SFComponent, SFSchema, SFSchemaEnumType, SFUISchema } from '@delon/form';
@ -16,7 +26,7 @@ export class PublishchooseFamifiarSetCaptainComponent implements OnInit {
i: any; i: any;
constructor(public http: _HttpClient, private cdr: ChangeDetectorRef, private route: ActivatedRoute) {} constructor(public http: _HttpClient, private cdr: ChangeDetectorRef, private route: ActivatedRoute, private modal: NzModalRef,) {}
ngOnInit(): void { ngOnInit(): void {
this.initSF(); this.initSF();
@ -24,12 +34,11 @@ export class PublishchooseFamifiarSetCaptainComponent implements OnInit {
initSF() { initSF() {
this.schema = { this.schema = {
properties: { properties: {
name: { captainPhone: {
type: 'string', type: 'string',
title: '车队长手机号' title: '车队长手机号'
} }
}, },
required: ['name']
}; };
this.ui = { this.ui = {
'*': { '*': {
@ -39,6 +48,6 @@ export class PublishchooseFamifiarSetCaptainComponent implements OnInit {
}; };
} }
close() {} close() {this.modal.close()}
save() {} save() {this.modal.close(this.sf.value.captainPhone)}
} }

View File

@ -14,40 +14,41 @@
<div class="card-title" <div class="card-title"
>装卸货信息<span class="tip-font">预计公里数:{{ totalDistance }}km预计行程耗时{{ totalTime }}小时</span></div >装卸货信息<span class="tip-font">预计公里数:{{ totalDistance }}km预计行程耗时{{ totalTime }}小时</span></div
> >
<form nz-form [formGroup]="validateForm1" role="form"> <form nz-form [formGroup]="validateForm1" role="form">
<div nz-row [nzGutter]="24"> <div nz-row [nzGutter]="24">
<div nz-col [nzSpan]="10"> <div nz-col [nzSpan]="10">
<div *ngFor="let data of startInfo; let idx = index"> <div *ngFor="let data1 of startInfo; let idx = index">
<nz-form-item> <nz-form-item>
<nz-form-label [nzSpan]="3" nzRequired>装货地</nz-form-label> <nz-form-label nzRequired>装货地</nz-form-label>
<nz-form-control [nzErrorTip]="'请输入装货地'"> <nz-form-control [nzErrorTip]="'请输入装货地'">
<div class="align-center"> <div class="align-center">
<nz-input-group [nzSuffix]="endInconTemp1"> <nz-input-group [nzSuffix]="endInconTemp1">
<input <input
nz-input nz-input
[(ngModel)]="data.detailedAddress" [(ngModel)]="data1.detailedAddress"
(click)="openMap('start', idx)" (click)="openMap('start', idx)"
formControlName="loadAddress{{ idx }}" formControlName="loadAddress{{ idx }}"
placeholder="请输入装货地" placeholder="请输入装货地"
readonly="true"
/> />
</nz-input-group> </nz-input-group>
<span *ngIf="idx !== 0" style="padding: 0 10px"
<span *ngIf="idx !== 0" [ngClass]="idx == 0 ? 'hides' : ''" style="padding: 0 10px" ><i nz-icon nzType="minus-circle" nzTheme="outline" style="color: #d9001b" (click)="subStartInfo($event, idx)"></i
><i nz-icon nzType="minus-circle" nzTheme="outline" style="color: #d9001b" (click)="subStartInfo($event, idx, data.id)"></i
></span> ></span>
<span *ngIf="idx == 0" style="visibility:hidden;padding: 0 10px" <span *ngIf="idx == 0" style="visibility:hidden;padding: 0 10px"
><i nz-icon nzType="minus-circle" nzTheme="outline" style="color: #d9001b" (click)="subStartInfo($event, idx, data.id)"></i ><i nz-icon nzType="minus-circle" nzTheme="outline" style="color: #d9001b" (click)="subStartInfo($event, idx)"></i
></span> ></span>
</div> </div>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
<nz-form-item> <nz-form-item>
<nz-form-label [nzSpan]="3" nzRequired>联系人</nz-form-label> <nz-form-label nzRequired>联系人</nz-form-label>
<div style="display: flex; width: 80.7%"> <div style="display: flex; width: 80.7%">
<nz-form-control [nzErrorTip]="'请输入联系人姓名'"> <nz-form-control [nzErrorTip]="'请输入联系人姓名'">
<input <input
nz-input nz-input
[(ngModel)]="data.appUserName" [(ngModel)]="data1.appUserName"
formControlName="loadName{{ idx }}" formControlName="loadName{{ idx }}"
name="loadName{{ idx }}" name="loadName{{ idx }}"
maxlength="30" maxlength="30"
@ -58,7 +59,7 @@
<input <input
style="margin-left: 12px" style="margin-left: 12px"
nz-input nz-input
[(ngModel)]="data.contractTelephone" [(ngModel)]="data1.contractTelephone"
maxlength="11" maxlength="11"
formControlName="loadPhone{{ idx }}" formControlName="loadPhone{{ idx }}"
name="loadPhone{{ idx }}" name="loadPhone{{ idx }}"
@ -68,13 +69,16 @@
</div> </div>
</nz-form-item> </nz-form-item>
</div> </div>
<div nz-row>
<div nz-col [nzSpan]="4"></div>
<div style="display: flex; justify-content: center"> <div style="display: flex; justify-content: center">
<button nz-button nzType="primary" (click)="addStartInfo($event)"> <button nz-button nzType="primary" (click)="addStartInfo()">
<i nz-icon nzType="plus"></i> <i nz-icon nzType="plus"></i>
添加装货地 添加装货地
</button> </button>
</div> </div>
</div> </div>
</div>
<div nz-col [nzSpan]="4"> <div nz-col [nzSpan]="4">
<div style="display: flex; justify-content: center"> <div style="display: flex; justify-content: center">
<span class="swap-icon" (click)="swapAddress()"><i nz-icon nzType="swap" <span class="swap-icon" (click)="swapAddress()"><i nz-icon nzType="swap"
@ -82,34 +86,38 @@
</div> </div>
</div> </div>
<div nz-col [nzSpan]="10"> <div nz-col [nzSpan]="10">
<div *ngFor="let data of endInfo; let idx = index"> <div *ngFor="let data2 of endInfo; let idx = index">
<nz-form-item> <nz-form-item>
<nz-form-label [nzSpan]="3" nzRequired>卸货地</nz-form-label> <nz-form-label nzRequired>卸货地</nz-form-label>
<nz-form-control [nzErrorTip]="'请输入卸货地'"> <nz-form-control [nzErrorTip]="'请输入卸货地'">
<div class="align-center"> <div class="align-center">
<nz-input-group [nzSuffix]="endInconTemp1"> <nz-input-group [nzSuffix]="endInconTemp1">
<input <input
nz-input nz-input
[(ngModel)]="data.detailedAddress" [(ngModel)]="data2.detailedAddress"
(click)="openMap('end', idx)" (click)="openMap('end', idx)"
formControlName="unloadAddress{{ idx }}" formControlName="unloadAddress{{ idx }}"
placeholder="请输入卸货地" placeholder="请输入卸货地"
name="unloadAddress{{ idx }}"
readonly="true"
/> />
</nz-input-group> </nz-input-group>
<span *ngIf="idx !== 0" style="padding: 0 10px"><i nz-icon nzType="minus-circle" nzTheme="outline" style="color: #d9001b" (click)="subEndInfo($event, idx)"></i></span> <span *ngIf="idx !== 0" style="padding: 0 10px"
><i nz-icon nzType="minus-circle" nzTheme="outline" style="color: #d9001b" (click)="subEndInfo($event, idx)"></i
></span>
<span *ngIf="idx == 0" style="visibility:hidden;padding: 0 10px" <span *ngIf="idx == 0" style="visibility:hidden;padding: 0 10px"
><i nz-icon nzType="minus-circle" nzTheme="outline" style="color: #d9001b" (click)="subStartInfo($event, idx, data.id)"></i ><i nz-icon nzType="minus-circle" nzTheme="outline" style="color: #d9001b" (click)="subStartInfo($event, idx)"></i
></span> ></span>
</div> </div>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
<nz-form-item> <nz-form-item>
<nz-form-label [nzSpan]="3" nzRequired>联系人</nz-form-label> <nz-form-label nzRequired>联系人</nz-form-label>
<div style="display: flex; width: 80.7%"> <div style="display: flex; width: 80.7%">
<nz-form-control [nzErrorTip]="'请输入联系人姓名'"> <nz-form-control [nzErrorTip]="'请输入联系人姓名'">
<input <input
nz-input nz-input
[(ngModel)]="data.appUserName" [(ngModel)]="data2.appUserName"
maxlength="30" maxlength="30"
formControlName="unloadName{{ idx }}" formControlName="unloadName{{ idx }}"
name="unloadAddress{{ idx }}" name="unloadAddress{{ idx }}"
@ -120,7 +128,7 @@
<input <input
style="margin-left: 12px" style="margin-left: 12px"
nz-input nz-input
[(ngModel)]="data.contractTelephone" [(ngModel)]="data2.contractTelephone"
formControlName="unloadPhone{{ idx }}" formControlName="unloadPhone{{ idx }}"
name="unloadAddress{{ idx }}" name="unloadAddress{{ idx }}"
maxlength="11" maxlength="11"
@ -130,55 +138,53 @@
</div> </div>
</nz-form-item> </nz-form-item>
</div> </div>
<div nz-row>
<div nz-col [nzSpan]="4"></div>
<div style="display: flex; justify-content: center"> <div style="display: flex; justify-content: center">
<button nz-button nzType="primary" (click)="addEndInfo($event)"> <button nz-button nzType="primary" (click)="addEndInfo()">
<i nz-icon nzType="plus"></i> <i nz-icon nzType="plus"></i>
添加卸货地 添加卸货地
</button> </button>
</div> </div>
</div> </div>
</div> </div>
</div>
<div nz-row [nzGutter]="24" style="margin-top: 24px"> <div nz-row [nzGutter]="24" style="margin-top: 24px">
<div nz-col [nzSpan]="10"> <div nz-col nzXs="2" nzSm="4" nzMd="8" nzLg="8" nzXl="10">
<nz-form-item> <nz-form-item>
<nz-form-label [nzSpan]="5" nzRequired>装货时间</nz-form-label> <nz-form-label nzRequired>装货时间</nz-form-label>
<nz-form-control [nzErrorTip]="'请输入装货时间'"> <nz-form-control [nzErrorTip]="'请输入装货时间'">
<nz-date-picker <nz-date-picker
nzShowTime [nzShowTime]="{ nzFormat: 'HH' }"
nzFormat="yyyy-MM-dd HH:mm:ss" nzFormat="yyyy-MM-dd HH:00前"
[ngModel]="loadingTime" formControlName="loadingTime"
(ngModelChange)="changeLO($event)" [nzDisabledDate]="disabledDateStart"
[ngModelOptions]="{ standalone: true }"
></nz-date-picker> ></nz-date-picker>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
</div> </div>
<div nz-col [nzSpan]="4"></div> <div nz-col nzXs="20" nzSm="16" nzMd="12" nzLg="8" nzXl="4"></div>
<div nz-col [nzSpan]="10"> <div nz-col nzXs="2" nzSm="4" nzMd="8" nzLg="8" nzXl="10">
<nz-form-item> <nz-form-item>
<nz-form-label [nzSpan]="5" nzRequired>卸货时间</nz-form-label> <nz-form-label nzRequired>卸货时间</nz-form-label>
<nz-form-control [nzErrorTip]="'请输入卸货时间'"> <nz-form-control [nzErrorTip]="'请输入卸货时间'">
<nz-date-picker <nz-date-picker [nzShowTime]="{ nzFormat: 'HH' }"
nzShowTime nzFormat="yyyy-MM-dd HH:00前" formControlName="unloadingTime"></nz-date-picker>
nzFormat="yyyy-MM-dd HH:mm:ss"
[ngModel]="unloadingTime"
(ngModelChange)="changeUn($event)"
[ngModelOptions]="{ standalone: true }"
></nz-date-picker>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
</div> </div>
</div> </div>
<ng-template #endInconTemp1><i nz-icon nzType="global"></i></ng-template> <ng-template #endInconTemp1><i nz-icon nzType="environment" nzTheme="outline"></i></ng-template>
</form> </form>
</nz-card> </nz-card>
<nz-card> <nz-card>
<div class="card-title">货物信息</div> <div class="card-title">货物信息</div>
<div nz-row> <div nz-row>
<div nz-col nzSpan="24"> <div nz-col nzSpan="16">
<sf #sf3 [schema]="schema3" [formData]="sf3data" [button]="'none'" [ui]="ui3"></sf> <sf #sf3 [schema]="schema3" [button]="'none'" [ui]="ui3" [formData]="sf3data"></sf>
<sf #sf4 [schema]="schema4" [formData]="sf4data" [button]="'none'" [ui]="ui4"> </div>
</div>
<sf #sf4 [schema]="schema4" [button]="'none'" [ui]="ui4" [formData]="sf4data">
<ng-template sf-template="weight" let-i let-ui="ui"> <ng-template sf-template="weight" let-i let-ui="ui">
<nz-input-group [nzAddOnAfter]="''"> <nz-input-group [nzAddOnAfter]="''">
<input <input
@ -189,6 +195,7 @@
step="0.01" step="0.01"
(ngModelChange)="i.setValue($event)" (ngModelChange)="i.setValue($event)"
placeholder="总重量,必填" placeholder="总重量,必填"
oninput="if(value>99999)value=99999;if(value<0)value=0"
/> />
</nz-input-group> </nz-input-group>
</ng-template> </ng-template>
@ -201,26 +208,25 @@
min="0" min="0"
step="0.01" step="0.01"
(ngModelChange)="i.setValue($event)" (ngModelChange)="i.setValue($event)"
placeholder="体积" placeholder="体积"
oninput="if(value>99999)value=99999;if(value<0)value=0"
/> />
</nz-input-group> </nz-input-group>
</ng-template> </ng-template>
<ng-template sf-template="number" let-i let-ui="ui"> <ng-template sf-template="number" let-i let-ui="ui">
<nz-input-group [nzAddOnAfter]="''"> <nz-input-group [nzAddOnAfter]="''">
<input <input
nz-input nz-input
type="number" type="number"
[ngModel]="i.value" [ngModel]="i.value"
min="0" min="0"
step="0.01"
(ngModelChange)="i.setValue($event)" (ngModelChange)="i.setValue($event)"
placeholder="车次" placeholder="车次"
oninput="if(value>99999)value=99999;if(value<0)value=0"
/> />
</nz-input-group> </nz-input-group>
</ng-template> </ng-template>
</sf> </sf>
</div>
</div>
</nz-card> </nz-card>
<nz-card> <nz-card>
@ -239,7 +245,7 @@
[nzMin]="50000" [nzMin]="50000"
[nzMax]="3000000" [nzMax]="3000000"
[nzStep]="0.01" [nzStep]="0.01"
(ngModelChange)="i.setValue($event);getInsurersPrice($event)" (ngModelChange)="i.setValue($event);getInsurersPrice()"
nzPlaceHolder="请输入50000-3000000之间数值" nzPlaceHolder="请输入50000-3000000之间数值"
></nz-input-number> ></nz-input-number>
</div> </div>
@ -324,7 +330,7 @@
<ng-template sf-template="paymentDays" let-i let-ui="ui"> <ng-template sf-template="paymentDays" let-i let-ui="ui">
<div nz-row> <div nz-row>
<div class="align-center"> <div class="align-center">
<div nz-col nzSpan="16"> <div nz-col nzSpan="12">
<nz-input-number <nz-input-number
[ngModel]="i.value" [ngModel]="i.value"
[nzMin]="1" [nzMin]="1"
@ -336,7 +342,7 @@
[nzPrecisionMode]="'cut'" [nzPrecisionMode]="'cut'"
></nz-input-number> ></nz-input-number>
</div> </div>
<div nz-col nzSpan="8"> <div nz-col nzSpan="12">
<span>&nbsp;天内支付运费</span> <span>&nbsp;天内支付运费</span>
</div> </div>
</div> </div>
@ -353,7 +359,7 @@
acl [acl-ability]="['SUPPLY-VEHICLE-AMEND-submitChange']">提交修改</button acl [acl-ability]="['SUPPLY-VEHICLE-AMEND-submitChange']">提交修改</button
> >
<button nz-button nzType="primary" *ngIf="this.PageStatus == '整车下一单'" (click)="submitConfirm('assign')" acl [acl-ability]="['SUPPLY-BULK-PLACEORDER-vehicleDesignate']">指派熟车</button> <button nz-button nzType="primary" *ngIf="this.PageStatus == '整车下一单'" (click)="submitConfirm('assign')" acl [acl-ability]="['SUPPLY-BULK-PLACEORDER-vehicleDesignate']">指派熟车</button>
<button *ngIf="this.PageStatus == '整车下一单'" nz-button nzType="primary" style="margin-left: 48px" (click)="submitConfirm()" <button *ngIf="this.PageStatus == '整车下一单'" nz-button nzType="primary" style="margin-left: 48px" (click)="submitConfirm('publish')"
acl [acl-ability]="['SUPPLY-BULK-PLACEORDER-vehicleAnotherOrder']">司机抢单</button acl [acl-ability]="['SUPPLY-BULK-PLACEORDER-vehicleAnotherOrder']">司机抢单</button
> >
</div> </div>

View File

@ -50,7 +50,3 @@ input[type='number']::-webkit-outer-spin-button {
margin: 0; margin: 0;
-webkit-appearance: none; -webkit-appearance: none;
} }
.hides {
margin-left: 10px;
color: aqua;
}

View File

@ -1,6 +1,7 @@
import { Component, OnInit, ViewChild } from '@angular/core'; import { Component, OnInit, ViewChild } from '@angular/core';
import { debounceTime } from 'rxjs/operators';
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import differenceInCalendarDays from 'date-fns/differenceInCalendarDays';
import format from 'date-fns/format';
import { Subject } from 'rxjs'; import { Subject } from 'rxjs';
import { ActivatedRoute, Router } from '@angular/router'; import { ActivatedRoute, Router } from '@angular/router';
import { import {
@ -14,9 +15,8 @@ import {
SFUISchema SFUISchema
} from '@delon/form'; } from '@delon/form';
import { _HttpClient } from '@delon/theme'; import { _HttpClient } from '@delon/theme';
import { AmapPoiPickerComponent, AmapService, ShipperBaseService } from '@shared'; import { AmapPoiPickerComponent, AmapService, EACacheService, ShipperBaseService } from '@shared';
import { NzModalService } from 'ng-zorro-antd/modal'; import { NzModalService } from 'ng-zorro-antd/modal';
import { type } from 'os';
import { of } from 'rxjs'; import { of } from 'rxjs';
import { map } from 'rxjs/operators'; import { map } from 'rxjs/operators';
import { SupplyManagementService } from '../../services/supply-management.service'; import { SupplyManagementService } from '../../services/supply-management.service';
@ -24,13 +24,25 @@ import { SupplyManagementVehicleAssignedCarComponent } from '../assigned-car/ass
import { TranAgreementComponent } from '../tran-agreement/tran-agreement.component'; import { TranAgreementComponent } from '../tran-agreement/tran-agreement.component';
import { PublishAddressListComponent } from './address-list/address-list.component'; import { PublishAddressListComponent } from './address-list/address-list.component';
import { PublishSuccessComponent } from './publish-success/publish-success.component'; import { PublishSuccessComponent } from './publish-success/publish-success.component';
import { cacheConf } from '@conf/cache.conf';
@Component({ @Component({
selector: 'app-publish-goods-onecar-publish', selector: 'app-publish-goods-onecar-publish',
templateUrl: './onecar-publish.component.html', templateUrl: './onecar-publish.component.html',
styleUrls: ['./onecar-publish.component.less'] styleUrls: ['./onecar-publish.component.less']
}) })
export class SupplyManagementOnecarPublishComponent implements OnInit { export class SupplyManagementOnecarPublishComponent implements OnInit {
// 环境信息 appId、tenantId
envInfo = this.eaCacheSrv.get(cacheConf.env);
validateForm1: FormGroup; validateForm1: FormGroup;
limitValues = {
maxWeight: 99999,
maxVolume: 99999,
maxPiece: 99999,
maxDays: 999,
intervalDays: 999,
maxTimes: 999
};
sf1data: any; // 货源单设置回显 sf1data: any; // 货源单设置回显
sf3data: any; // 货源单设置回显 sf3data: any; // 货源单设置回显
sf4data: any; // 货源单设置回显 sf4data: any; // 货源单设置回显
@ -61,18 +73,14 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
private modalService: NzModalService, private modalService: NzModalService,
public service: SupplyManagementService, public service: SupplyManagementService,
private amapService: AmapService, private amapService: AmapService,
public shipperSrv: ShipperBaseService public shipperSrv: ShipperBaseService,
private eaCacheSrv: EACacheService
) { ) {
this.validateForm1 = fb.group({ this.validateForm1 = fb.group({
loadAddress0: [null, [Validators.required]], loadingTime: [null, [Validators.required]],
loadName0: [null, [Validators.required]], unloadingTime: [null, [Validators.required]]
loadPhone0: [null, [Validators.required, Validators.pattern('^[0-9]*$')]],
unloadAddress0: [null, [Validators.required]],
unloadName0: [null, [Validators.required]],
unloadPhone0: [null, [Validators.required, Validators.pattern('^[0-9]*$')]],
loadingTime: [null, []],
unloadingTime: [null, []]
}); });
this.envCache = this.eaCacheSrv.get(cacheConf.env);
} }
@ViewChild('sf1', { static: false }) sf1!: SFComponent; @ViewChild('sf1', { static: false }) sf1!: SFComponent;
schema1: SFSchema = {}; schema1: SFSchema = {};
@ -105,15 +113,17 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
@ViewChild('sf7', { static: false }) sf7!: SFComponent; @ViewChild('sf7', { static: false }) sf7!: SFComponent;
schema7: SFSchema = {}; schema7: SFSchema = {};
ui7!: SFUISchema; ui7!: SFUISchema;
formatterRmb = (value: number): string => { formatterRmb = (value: number): string => {
if(value){ if (value === null || value === undefined) {
let value2 = Number(value).toLocaleString(undefined,{'minimumFractionDigits':2,'maximumFractionDigits':2}); return '';
} else {
let value2 = Number(value).toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 });
return `${value2}`; return `${value2}`;
} }
return `¥ 0.00`
}; };
parserRmb = (value: string): string => value.replace('¥', '').replace(',', ''); parserRmb = (value: string): string => value.replace('¥', '').replace(',', '');
// 页面初始化 // 页面初始化
ngOnInit(): void { ngOnInit(): void {
if (this.route.snapshot?.queryParams?.sta === '1') { if (this.route.snapshot?.queryParams?.sta === '1') {
@ -127,8 +137,8 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
this.initSF5(); this.initSF5();
this.initSF6(); this.initSF6();
this.initSF7(); this.initSF7();
this.getLimitvalue();
this.initdata(); this.initdata();
this.getInsurers()
} }
initSF1() { initSF1() {
this.schema1 = { this.schema1 = {
@ -143,9 +153,10 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
searchDebounceTime: 300, searchDebounceTime: 300,
searchLoadingText: '搜索中...', searchLoadingText: '搜索中...',
onSearch: (q: any) => { onSearch: (q: any) => {
if (!!q) { let str = q.replace(/^\s+|\s+$/g, '');
if (str) {
return this.service return this.service
.request(this.service.$api_enterpriceList, { enterpriseName: q }) .request(this.service.$api_enterpriceList, { enterpriseName: str })
.pipe(map(res => (res as any[]).map(i => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum)))) .pipe(map(res => (res as any[]).map(i => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum))))
.toPromise(); .toPromise();
} else { } else {
@ -153,7 +164,11 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
} }
}, },
change: (q: any) => { change: (q: any) => {
this.getRegionCode(q); let str = q.replace(/^\s+|\s+$/g, '');
if (str) {
this.getRegionCode(str);
this.payChange();
}
} }
} as SFSelectWidgetSchema } as SFSelectWidgetSchema
}, },
@ -341,8 +356,8 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
errors: { required: '请选择车型' }, errors: { required: '请选择车型' },
asyncData: () => this.service.getDictOptions({ dictKey: 'car:model' }), asyncData: () => this.service.getDictOptions({ dictKey: 'car:model' }),
change: (tag: any, org: any) => { change: (tag: any, org: any) => {
if(tag.includes("999")){ if (tag.includes('999')) {
this.sf4.setValue('/carModel',["999"]); this.sf4.setValue('/carModel', ['999']);
} }
} }
} }
@ -358,12 +373,12 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
errors: { required: '请选择车长' }, errors: { required: '请选择车长' },
asyncData: () => this.service.getDictOptions({ dictKey: 'car:length' }), asyncData: () => this.service.getDictOptions({ dictKey: 'car:length' }),
change: (tag: any, org: any) => { change: (tag: any, org: any) => {
if(tag.includes("999")){ if (tag.includes('999')) {
this.sf4.setValue('/carModel',["999"]); this.sf4.setValue('/carModel', ['999']);
}
} }
} }
} }
},
}, },
required: ['weight', 'carModel', 'carLength'] required: ['weight', 'carModel', 'carLength']
}; };
@ -397,8 +412,17 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
type: 'string', type: 'string',
title: '增值服务套餐', title: '增值服务套餐',
ui: { ui: {
widget: 'dict-select', widget: 'select',
params: { dictKey: 'bill:insurance:type' }, asyncData: () => {
return this.service.request(this.service.$api_getDictValue, { dictKey: 'bill:insurance:type' }).pipe(
map((res: any) => {
return [...res];
})
);
},
change: (tag: any, org: any) => {
this.getInsurersPrice(tag);
}
}, },
default: '3' default: '3'
}, },
@ -409,7 +433,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
readOnly: true, readOnly: true,
ui: { ui: {
widget: 'checkbox', widget: 'checkbox',
visibleIf: { insuranceType: (value: string) => value === '0' } visibleIf: { insuranceType: (value: string) => value === '1' }
} as SFCheckboxWidgetSchema, } as SFCheckboxWidgetSchema,
default: ['车辆实时定位', '轨迹查询', '数据保护', '赠送基本险'] default: ['车辆实时定位', '轨迹查询', '数据保护', '赠送基本险']
}, },
@ -420,7 +444,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
readOnly: true, readOnly: true,
ui: { ui: {
widget: 'checkbox', widget: 'checkbox',
visibleIf: { insuranceType: (value: string) => value === '1' } visibleIf: { insuranceType: (value: string) => value === '2' }
} as SFCheckboxWidgetSchema, } as SFCheckboxWidgetSchema,
default: ['车辆实时定位', '轨迹查询', '数据保护', '专属技术服务', '赠送综合险'] default: ['车辆实时定位', '轨迹查询', '数据保护', '专属技术服务', '赠送综合险']
}, },
@ -438,6 +462,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
ui: { ui: {
widget: 'dict-select', widget: 'dict-select',
params: { dictKey: 'insure:packaged:goods' }, params: { dictKey: 'insure:packaged:goods' },
containsAllLabel: false,
visibleIf: { insuranceType: (value: string) => value !== '3' } visibleIf: { insuranceType: (value: string) => value !== '3' }
} as SFSelectWidgetSchema } as SFSelectWidgetSchema
}, },
@ -463,6 +488,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
title: '', title: '',
ui: { ui: {
widget: 'custom', widget: 'custom',
validator: val => this.customValidator(val),
visibleIf: { insuranceType: (value: string) => value !== '3' } visibleIf: { insuranceType: (value: string) => value !== '3' }
} }
}, },
@ -472,9 +498,9 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
ui: { ui: {
hidden: true hidden: true
} }
}
}, },
}, required: ['insurancePackagedGoods', 'insurancePremium']
required: ['insurancePackagedGoods']
}; };
this.ui5 = { this.ui5 = {
'*': { '*': {
@ -489,9 +515,26 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
}, },
$freeInsurance: { $freeInsurance: {
grid: { span: 24 } grid: { span: 24 }
}, }
}; };
} }
/**
* 自定义校验数据
* @param val
*/
customValidator(val: number) {
if (this.isEmpty(val)) {
return [{ keyword: 'required', message: '不能为空' }];
} else {
if (val <= 0) {
return [{ keyword: 'required', message: '数值需大于0' }];
}
return [];
}
}
isEmpty(val: any) {
return val === undefined || val === null || val.toString().trim() === '';
}
initSF6() { initSF6() {
this.schema6 = { this.schema6 = {
properties: { properties: {
@ -522,45 +565,65 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
} }
} }
}, },
receiptAddress: {
type: 'string',
title: '回单收件人信息',
ui: {
widget: 'custom',
placeholder: '请点击选择回单收件人信息',
// validator: val => (this.sf6?.value?.receiptType === '2' ? [{ keyword: 'required', message: '请点击选择收回单地址' }] : []),
visibleIf: {
receiptType: value => value === '2'
}
},
default: ''
},
receiptAddressId: {
type: 'string',
title: '',
ui: {
hidden: true
}
},
receiptUserName: { receiptUserName: {
type: 'string', type: 'string',
title: '联系人', title: '联系人',
maxLength: 15,
ui: { ui: {
visibleIf: { visibleIf: {
receiptType: value => value === '2' receiptType: value => value === '2'
} }
}
}, },
receiptUserPhone: { readOnly: true
},
phon: {
type: 'string', type: 'string',
title: '联系电话', title: '联系电话',
maxLength: 11,
ui: { ui: {
visibleIf: { visibleIf: {
receiptType: value => value === '2' receiptType: value => value === '2'
} }
}
}, },
receiptAddressArea: { readOnly: true
},
area: {
type: 'string', type: 'string',
title: '所在地区', title: '所在地区',
maxLength: 30,
ui: { ui: {
visibleIf: { visibleIf: {
receiptType: value => value === '2' receiptType: value => value === '2'
} }
}
}, },
receiptAddress: { readOnly: true
},
address: {
type: 'string', type: 'string',
title: '详细地址', title: '详细地址',
maxLength: 30,
ui: { ui: {
visibleIf: { visibleIf: {
receiptType: value => value === '2' receiptType: value => value === '2'
} }
} },
readOnly: true
}, },
remarks: { remarks: {
type: 'string', type: 'string',
@ -573,11 +636,11 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
} as SFTextareaWidgetSchema } as SFTextareaWidgetSchema
} }
}, },
required: ['stateReceipt', 'receiptType', 'receiptUserName', 'receiptUserPhone', 'receiptAddressArea', 'receiptAddress'] required: ['stateReceipt', 'receiptType', 'receiptAddress']
}; };
this.ui6 = { this.ui6 = {
'*': { '*': {
spanLabelFixed: 90, spanLabelFixed: 115,
grid: { span: 24 } grid: { span: 24 }
} }
}; };
@ -625,9 +688,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
} }
}; };
} }
// 获取城市列表
getRegionCode(regionCode: any) { getRegionCode(regionCode: any) {
console.log(regionCode);
return this.service return this.service
.request(this.service.$api_get_enterprise_project, { id: regionCode }) .request(this.service.$api_get_enterprise_project, { id: regionCode })
.pipe( .pipe(
@ -646,41 +707,33 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
} }
}); });
} }
changeValue() {
this.totalFees =
Number(this.sf7?.value?.appendFee) +
Number(this.sf7?.value?.prePay) +
Number(this.sf7?.value?.receiptPay) +
Number(this.sf7?.value?.toPay);
console.log(this.totalFees);
}
payChange() { payChange() {
const prePay = this.sf7.value.prePay || 0; const prePay = this.sf7.value.prePay || 0;
const toPay = this.sf7.value.toPay || 0 const toPay = this.sf7.value.toPay || 0;
const receiptPay = this.sf7.value.receiptPay || 0; const receiptPay = this.sf7.value.receiptPay || 0;
// const oilCardPay = 0; const oilCardPay = 0;
const subtotal = prePay + toPay + receiptPay; const subtotal = prePay + toPay + receiptPay;
const params = { const params = {
shipperId: this.envCache?.enterpriseId, shipperId: this?.sf1?.value?.shipperAppUserId,
enterpriseInfoId: this.envCache?.networkTransporterId, enterpriseInfoId: this?.sf1data?.enterpriseInfoId || '',
totalFreight: subtotal, totalFreight: subtotal,
// fuelCardAmount:oilCardPay, fuelCardAmount: oilCardPay,
resourcetype: '1' resourcetype: '1'
} };
this.service this.service.request(this.service.$api_getCalculatedSurcharge, params).subscribe(res => {
.request(this.service.$api_getCalculatedSurcharge,params)
.subscribe(res => {
if (res) { if (res) {
this.sf7.setValue('/appendFee', res.surcharge); this.sf7.setValue('/appendFee', res.surcharge);
this.sf7.setValue('/subtotal', subtotal); this.sf7.setValue('/subtotal', subtotal);
this.sf7.setValue('/total', subtotal + res.surcharge); this.sf7.setValue('/total', subtotal + res.surcharge);
let items = this?.sf1data?.enterpriseInfoId || '';
this.service this.service
.request(this.service.$api_getcalculatedServiceRate + `?invoiceAmount=${subtotal + res.surcharge}&totalFreight=${subtotal}`) .request(
this.service.$api_getAdditionalRate +
`?shipperId=${this?.sf1?.value?.shipperAppUserId || ''}&enterpriseInfoId=${items}&resourcetype='1'`
)
.subscribe(res => { .subscribe(res => {
if (res) { if (res) {
this.currentRate = res.rate * 100; this.currentRate = res.rate * 100;
} else {
this.service.msgSrv.error(res.msg);
} }
}); });
} else { } else {
@ -688,8 +741,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
} }
}); });
} }
// 添加 删除发货卸货地址 addStartInfo() {
addStartInfo(_event: any) {
if (this.startInfo.length < 5) { if (this.startInfo.length < 5) {
const controlId = this.startInfo.length; const controlId = this.startInfo.length;
this.startInfo.push({ this.startInfo.push({
@ -701,29 +753,50 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
province: '', province: '',
city: '', city: '',
area: '', area: '',
type: 1 type: '1'
}); });
this.validateForm1.addControl(`loadAddress${controlId}`, new FormControl(null, Validators.required)); this.validateForm1.addControl(`loadAddress${controlId}`, new FormControl(null, Validators.required));
this.validateForm1.addControl(`loadName${controlId}`, new FormControl(null, Validators.required)); this.validateForm1.addControl(`loadName${controlId}`, new FormControl(null, Validators.required));
this.validateForm1.addControl(`loadPhone${controlId}`, new FormControl(null, Validators.required)); this.validateForm1.addControl(`loadPhone${controlId}`, new FormControl(null, [Validators.required, Validators.pattern('^[0-9]*$')]));
} }
} }
// 添加 删除发货卸货地址
subStartInfo(event: any, index: number, id?: any) { getLimitvalue() {
console.log(event, index, id); // 货物核载信息最大值
if (id) { // 货物运输费(小计)最大值
this.service.request(this.service.$api_delete_Wholedeletebatch, [id]).subscribe(res => { const getlimitvaluesParms = [
console.log(res); this.service.limitKeys.weight,
this.service.limitKeys.volume,
this.service.limitKeys.piece,
this.service.limitKeys.maxDays,
this.service.limitKeys.intervalDays,
this.service.limitKeys.maxTimes
];
this.service.request(this.service.$api_findItemValueByItemKeys, getlimitvaluesParms).subscribe(res => {
const maxWeight = res.filter((item: any) => item.itemKey === this.service.limitKeys.weight)[0].itemValue;
const maxVolume = res.filter((item: any) => item.itemKey === this.service.limitKeys.volume)[0].itemValue;
const maxPiece = res.filter((item: any) => item.itemKey === this.service.limitKeys.piece)[0].itemValue;
const maxDays = res.filter((item: any) => item.itemKey === this.service.limitKeys.maxDays)[0].itemValue;
const intervalDays = res.filter((item: any) => item.itemKey === this.service.limitKeys.intervalDays)[0].itemValue;
const maxTimes = res.filter((item: any) => item.itemKey === this.service.limitKeys.maxTimes)[0].itemValue;
this.limitValues = {
maxWeight: Number(maxWeight),
maxVolume: Number(maxVolume),
maxPiece: Number(maxPiece),
maxDays: Number(maxDays),
intervalDays: Number(intervalDays),
maxTimes: Number(maxTimes)
};
}); });
} }
subStartInfo(event: any, index: number) {
this.startInfo.splice(index, 1); this.startInfo.splice(index, 1);
this.validateForm1.removeControl(`loadAddress${index}`); this.validateForm1.removeControl(`loadAddress${index}`);
this.validateForm1.removeControl(`loadName${index}`); this.validateForm1.removeControl(`loadName${index}`);
this.validateForm1.removeControl(`loadPhone${index}`); this.validateForm1.removeControl(`loadPhone${index}`);
} }
// 添加 删除发货卸货地址 addEndInfo() {
addEndInfo(_event: any) { if (this.endInfo.length < 5) {
if (this.addEndInfo.length < 5) {
const controlId = this.endInfo.length; const controlId = this.endInfo.length;
this.endInfo.push({ this.endInfo.push({
detailedAddress: '', detailedAddress: '',
@ -734,21 +807,17 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
province: '', province: '',
city: '', city: '',
area: '', area: '',
type: 2 type: '2'
}); });
this.validateForm1.addControl(`unloadAddress${controlId}`, new FormControl(null, Validators.required)); this.validateForm1.addControl(`unloadAddress${controlId}`, new FormControl(null, Validators.required));
this.validateForm1.addControl(`unloadName${controlId}`, new FormControl(null, Validators.required)); this.validateForm1.addControl(`unloadName${controlId}`, new FormControl(null, Validators.required));
this.validateForm1.addControl(`unloadPhone${controlId}`, new FormControl(null, Validators.required)); this.validateForm1.addControl(
`unloadPhone${controlId}`,
new FormControl(null, [Validators.required, Validators.pattern('^[0-9]*$')])
);
} }
} }
// 添加 删除发货卸货地址 subEndInfo(event: any, index: number) {
subEndInfo(event: any, index: number, id?: any) {
if (id) {
this.service.request(this.service.$api_delete_Wholedeletebatch, [id]).subscribe(res => {
console.log(res);
});
}
console.log(event, index, id);
this.endInfo.splice(index, 1); this.endInfo.splice(index, 1);
this.validateForm1.removeControl(`unloadAddress${index}`); this.validateForm1.removeControl(`unloadAddress${index}`);
this.validateForm1.removeControl(`unloadName${index}`); this.validateForm1.removeControl(`unloadName${index}`);
@ -773,16 +842,17 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
.subscribe(res => { .subscribe(res => {
if (res) { if (res) {
this.sf3.getProperty('/goodsNameId')!.schema.enum = res; this.sf3.getProperty('/goodsNameId')!.schema.enum = res;
this.sf3.getProperty('/goodsNameId')!.widget?.reset(res); this.sf3.getProperty('/goodsNameId')!.widget.reset(res);
if (this.sf3data.goodsNameId) { if (this.sf3data.goodsNameId) {
this.sf3.setValue('/goodsNameId', this.sf3data.goodsNameId); this.sf3.setValue('/goodsNameId', this.sf3data.goodsNameId);
} }
} else {
this.service.msgSrv.error(res.msg);
} }
}); });
} }
//指派熟车 //指派熟车
chooseFamifiar(item: any) { chooseFamifiar(item: any) {
console.log('999');
const modalRef = this.modalService.create({ const modalRef = this.modalService.create({
nzTitle: '指派熟车', nzTitle: '指派熟车',
nzContent: SupplyManagementVehicleAssignedCarComponent, nzContent: SupplyManagementVehicleAssignedCarComponent,
@ -791,7 +861,6 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
status: 'new', status: 'new',
url: this.service.$api_save_assign_whole, url: this.service.$api_save_assign_whole,
params: item, params: item,
type: 'next'
}, },
nzFooter: null nzFooter: null
}); });
@ -812,103 +881,138 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
}); });
} }
// 提交前确认,委托运输协议弹窗 // 提交前确认,委托运输协议弹窗
submitConfirm(submitType?: any) { submitConfirm(submitType?: string) {
Object.keys(this.validateForm1.controls).forEach(key => { Object.keys(this.validateForm1.controls).forEach(key => {
this.validateForm1.controls[key].markAsDirty(); this.validateForm1.controls[key].markAsDirty();
this.validateForm1.controls[key].updateValueAndValidity(); this.validateForm1.controls[key].updateValueAndValidity();
}); });
this.sf1.validator({ emitError: true });
this.sf3.validator({ emitError: true }); this.sf3.validator({ emitError: true });
this.sf4.validator({ emitError: true }); this.sf4.validator({ emitError: true });
this.sf5.validator({ emitError: true });
this.sf6.validator({ emitError: true }); this.sf6.validator({ emitError: true });
this.sf7.validator({ emitError: true }); this.sf7.validator({ emitError: true });
console.log(this.sf1.valid); if (this.validateForm1.invalid || !this.sf3.valid || !this.sf4.valid || !this.sf5.valid || !this.sf6.valid || !this.sf7.valid) {
if (this.validateForm1.invalid || !this.sf3.valid || !this.sf1.valid || !this.sf4.valid || !this.sf6.valid || !this.sf7.valid) { this.service.msgSrv.warning('请完善必填项!');
return;
}
if (this.validateForm1.value.loadingTime < new Date()) {
this.service.msgSrv.warning('装货时间必须大于当前时间!');
return;
}
if (this.validateForm1.value.loadingTime > this.validateForm1.value.unloadingTime) {
this.service.msgSrv.warning('装货时间不能大于卸货时间!');
return;
}
if (this.sf7.value.total <= 0) {
this.service.msgSrv.warning('总费用不能为0');
return;
}
const num = (Number(this.validateForm1.value.unloadingTime) - Number(this.validateForm1.value.loadingTime)) / (24 * 60 * 60 * 1000);
if (num > this.limitValues.maxDays) {
this.service.msgSrv.error(`当前计划装卸货时间间隔已超出限定值【${this.limitValues.maxDays}天】`);
return;
}
if (
this.sf4.value.weight > this.limitValues.maxWeight ||
this.sf4.value.volume > this.limitValues.maxVolume ||
this.sf4.value.number > this.limitValues.maxPiece
) {
this.service.msgSrv.error(
`当前货物核载信息已超出限定值【${this.limitValues.maxWeight}吨、${this.limitValues.maxVolume}方、${this.limitValues.maxPiece}件】`
);
return; return;
} }
const getFreightParms = { carLengthKeys: this.sf4.value.carLength, km: this.totalDistance };
this.service.request(this.service.$api_getFreight, getFreightParms).subscribe(res => {
if (this.sf7.value.subtotal > res.maxPrice) {
this.service.msgSrv.error(`运费过高,请调整录入`);
return;
} else if (this.sf7.value.subtotal > res.ewPrice) {
this.modalService.confirm({
nzTitle: '',
nzContent: `您的录入的运费过高,可能会影响支付,请仔细确认`,
nzOkText: '继续',
nzCancelText: '取消',
nzOnOk: () => {
this.agreementConfirm(submitType);
}
});
} else {
this.agreementConfirm(submitType);
}
});
}
// 提交前协议弹窗
agreementConfirm(submitType?: string) {
//装卸货信息
const LoadingList = this.startInfo.concat(this.endInfo);
// 货物信息
const sf3Values = { ...this.sf3.value };
if (sf3Values.goodsTypeName === '其它') {
sf3Values.goodsName = sf3Values.goodsName1;
delete sf3Values.goodsName1;
}
if (this.sf4.value.carModel.includes('999')) {
this.sf4.value.carModel = ['999'];
}
if (this.sf4.value.carLength.includes('999')) {
this.sf4.value.carLength = ['999'];
}
const goodsInfoVOList = [
{
...sf3Values,
...this.sf4.value,
carModel: this.sf4.value.carModel.join(','),
carLength: this.sf4.value.carLength.join(',')
}
];
// 运费信息
const expenseList = [
{ expenseCode: 'PRE', expenseName: '预付', price: this.sf7.value.prePay || 0, id: this.sf7data?.prePayId || '' },
{ expenseCode: 'RECE', expenseName: '到付', price: this.sf7.value.toPay || 0, id: this.sf7data?.toPayId || '' },
{ expenseCode: 'BACK', expenseName: '回单付', price: this.sf7.value.receiptPay || 0, id: this.sf7data?.receiptPayId || '' }
];
// 从“再下一单”过来将所有的子参数内的id都删除
if ((this.PageStatus === '整车下一单')) {
LoadingList.forEach((ele: any) => {
delete ele.id;
});
goodsInfoVOList.forEach((ele: any) => {
delete ele.id;
});
expenseList.forEach((ele: any) => {
delete ele.id;
});
}
const params = {
id: '',
...this.sf1.value,
unLoadingPlaceDTOList: LoadingList,
unloadingTime: format(this.validateForm1.value.unloadingTime, 'yyyy-MM-dd HH:mm:ss'),
loadingTime: format(this.validateForm1.value.loadingTime, 'yyyy-MM-dd HH:mm:ss'),
goodsInfoDTOList: goodsInfoVOList,
...this.sf5.value,
...this.sf6.value,
expenseDTOList: expenseList,
paymentDays: this.sf7.value.paymentDays
};
const modalRef = this.modalService.create({ const modalRef = this.modalService.create({
nzTitle: '运输协议', nzTitle: '运输协议',
nzContent: TranAgreementComponent, nzContent: TranAgreementComponent,
nzWidth: 900, nzWidth: 900,
nzFooter: null, nzFooter: null,
nzComponentParams: { Object: params }
}); });
modalRef.afterClose.subscribe(result => { modalRef.afterClose.subscribe(result => {
if (result) { if (result) {
this.submit(submitType); this.submit(submitType, params);
} }
}); });
} }
// 提交 // 提交
submit(submitType?: string): void { submit(submitType?: string, params?: any): void {
Object.keys(this.validateForm1.controls).forEach(key => {
this.validateForm1.controls[key].markAsDirty();
this.validateForm1.controls[key].updateValueAndValidity();
});
this.sf1.validator({ emitError: true });
this.sf3.validator({ emitError: true });
this.sf4.validator({ emitError: true });
this.sf6.validator({ emitError: true });
this.sf7.validator({ emitError: true });
console.log(this.sf1.valid);
if (this.validateForm1.invalid || !this.sf3.valid || !this.sf1.valid || !this.sf4.valid || !this.sf6.valid || !this.sf7.valid) {
return;
}
console.log(this?.loadingTime);
console.log(this?.unloadingTime);
if (typeof this.unloadingTime !== 'string') {
var c = new Date(this.unloadingTime);
this.unloadingTime =
c.getFullYear() +
'-' +
this.addPreZero(c.getMonth() + 1) +
'-' +
this.addPreZero(c.getDate()) +
' ' +
this.addPreZero(c.getHours()) +
':' +
this.addPreZero(c.getMinutes()) +
':' +
this.addPreZero(c.getSeconds());
}
if (typeof this.loadingTime !== 'string') {
var c = new Date(this.loadingTime);
this.loadingTime =
c.getFullYear() +
'-' +
this.addPreZero(c.getMonth() + 1) +
'-' +
this.addPreZero(c.getDate()) +
' ' +
this.addPreZero(c.getHours()) +
':' +
this.addPreZero(c.getMinutes()) +
':' +
this.addPreZero(c.getSeconds());
}
console.log(this.loadingTime)
const params: any = {
...this.sf1.value,
...this.sf5.value,
...this.sf6.value,
paymentDays: this.sf7.value.paymentDays,
loadingTime: this.loadingTime,
unloadingTime: this.unloadingTime,
unLoadingPlaceDTOList: [...this.startInfo, ...this.endInfo],
goodsInfoDTOList: [
{
...this.sf4.value,
...this.sf3.value,
carModel: this.sf4.value.carModel.join(','),
carLength: this.sf4.value.carLength.join(',')
}
]
};
params.shippingInformationDTO = {
...this.sf7.value,
totalFees: this.totalFees
};
console.log(params);
if (submitType) { if (submitType) {
if (submitType == 'assign') { if (submitType == 'assign') {
this.chooseFamifiar(params); this.chooseFamifiar(params);
@ -979,6 +1083,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
this.amapService.drivingCompute([...this.startInfo], [...this.endInfo]).subscribe((res: any) => { this.amapService.drivingCompute([...this.startInfo], [...this.endInfo]).subscribe((res: any) => {
this.totalDistance = res.distance; this.totalDistance = res.distance;
this.totalTime = res.time; this.totalTime = res.time;
this.getInsurersPrice(); // 计算保费金额
}); });
} }
} }
@ -1015,6 +1120,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
} }
this.sf1data = { this.sf1data = {
enterpriseInfoName: res?.enterpriseInfoName, enterpriseInfoName: res?.enterpriseInfoName,
enterpriseInfoId: res?.enterpriseInfoId,
dispatchPhone: res?.dispatchPhone, dispatchPhone: res?.dispatchPhone,
dispatchName: res?.dispatchName, dispatchName: res?.dispatchName,
externalResourceCode: res?.externalResourceCode, externalResourceCode: res?.externalResourceCode,
@ -1108,26 +1214,27 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
this.sf3data.goodsName1 = res?.goodsInfoVOList[0]?.goodsName || ''; this.sf3data.goodsName1 = res?.goodsInfoVOList[0]?.goodsName || '';
} }
this.changeGoodsType(this.sf3data.goodsTypeId, { label: this.sf3data.goodsTypeName, value: this.sf3data.goodsTypeId }); this.changeGoodsType(this.sf3data.goodsTypeId, { label: this.sf3data.goodsTypeName, value: this.sf3data.goodsTypeId });
this.sf4data = {
weight: res?.goodsInfoVOList[0]?.weight,
volume: res?.goodsInfoVOList[0]?.volume,
vehicleDemand: res?.goodsInfoVOList[0]?.vehicleDemand,
carLength: res?.goodsInfoVOList[0]?.carLength?.split(','),
carModel: res?.goodsInfoVOList[0]?.carModel?.split(',') || '',
number: res?.goodsInfoVOList[0]?.number,
goodsTypeName: res?.goodsInfoVOList[0]?.goodsTypeName,
modifyUserId: res?.goodsInfoVOList[0]?.modifyUserId,
resourceId: res?.goodsInfoVOList[0]?.resourceId,
rule: res?.goodsInfoVOList[0]?.rule,
settlementBasis: res?.goodsInfoVOList[0]?.settlementBasis
};
if (res?.loadingTime) { if (res?.loadingTime) {
this.loadingTime = res?.loadingTime; this.loadingTime = res?.loadingTime;
} }
if (res?.unloadingTime) { if (res?.unloadingTime) {
this.unloadingTime = res?.unloadingTime; this.unloadingTime = res?.unloadingTime;
} }
this.validateForm1.patchValue(
{
loadingTime: new Date(Date.parse(res.loadingTime.replace(/-/g, '/'))),
unloadingTime: new Date(Date.parse(res.unloadingTime.replace(/-/g, '/')))
},
{ onlySelf: true }
);
this.sf4data = {
weight: res?.goodsInfoVOList[0]?.weight || '',
volume: res?.goodsInfoVOList[0]?.volume || '',
number: res?.goodsInfoVOList[0]?.number || '',
carModel: res?.goodsInfoVOList[0]?.carModel?.split(',') || [],
carLength: res?.goodsInfoVOList[0]?.carLength?.split(',') || []
};
if (this.PageStatus === '整车修改') { if (this.PageStatus === '整车修改') {
this.sf4data.id = res?.goodsInfoVOList[0]?.id; this.sf4data.id = res?.goodsInfoVOList[0]?.id;
} }
@ -1137,7 +1244,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
goodsValue: res?.goodsValue || '', goodsValue: res?.goodsValue || '',
insurancePremium: res?.insurancePremium || '', insurancePremium: res?.insurancePremium || '',
insuranceRate: res?.insuranceRate || '', insuranceRate: res?.insuranceRate || '',
insurancePackagedGoods: res?.insurancePackagedGoods || '', insurancePackagedGoods: res?.insurancePackagedGoods || ''
}; };
this.sf6data = { this.sf6data = {
stateReceipt: res?.stateReceipt, stateReceipt: res?.stateReceipt,
@ -1203,40 +1310,27 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
default: default:
break; break;
} }
// 计算里程,时间
if (this.startInfo[0]?.area && this.endInfo[0]?.area) {
this.amapService.drivingCompute([...this.startInfo], [...this.endInfo]).subscribe(res => {
this.totalDistance = res.distance;
this.totalTime = res.time;
this.getInsurersPrice(); //计算保费金额
});
}
} }
}); });
} }
changeUn(event: Date) { // 不可选择的时间
console.log(event) disabledDateStart = (current: Date): boolean => {
this.unloadingTime = event; let d = new Date();
if(typeof this.loadingTime === 'string') { let year = d.getFullYear();
var a = new Date(this.loadingTime) let month = d.getMonth();
if ( a > this.unloadingTime?.getTime() ) { let date = d.getDate();
this.service.msgSrv.error('卸货时间不能小于装货时间!'); let hours = d.getHours();
this.unloadingTime = ''; let mydate = new Date(year, month, date + this.limitValues.maxDays, hours + 1);
} return differenceInCalendarDays(new Date(), current) > 0 || new Date(current) > mydate;
} else { };
if ( this.loadingTime?.getTime() > this.unloadingTime?.getTime() ) {
this.service.msgSrv.error('卸货时间不能小于装货时间!');
this.unloadingTime = '';
}
}
}
changeLO(event: Date) {
this.loadingTime = event;
if(typeof this.unloadingTime === 'string') {
var a = new Date(this.unloadingTime)
if ( a.getTime()< this.loadingTime?.getTime()) {
this.service.msgSrv.error('装货时间不能大于卸货时间!');
this.loadingTime = '';
}
} else {
if ( this.unloadingTime?.getTime()< this.loadingTime?.getTime()) {
this.service.msgSrv.error('装货时间不能大于卸货时间!');
this.loadingTime = '';
}
}
}
// 装卸货地址互换 // 装卸货地址互换
swapAddress() { swapAddress() {
this.startInfo.forEach((element: any, index: any) => { this.startInfo.forEach((element: any, index: any) => {
@ -1271,63 +1365,16 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
this.amapService.drivingCompute([...this.startInfo], [...this.endInfo]).subscribe(res => { this.amapService.drivingCompute([...this.startInfo], [...this.endInfo]).subscribe(res => {
this.totalDistance = res.distance; this.totalDistance = res.distance;
this.totalTime = res.time; this.totalTime = res.time;
this.getInsurersPrice(); //计算保费金额
}); });
} }
} }
goodsValuesChange(value: any) { // 计算保价费金额
console.log(value); getInsurersPrice(insuranceType = this.sf5.value.insuranceType) {
console.log(this.totalDistance); if (this.sf5.value.goodsValue >= 50000 && this.totalDistance > 0) {
if(value >= 50000 && this.totalDistance > 0){
const params = {
goodsValue: value,
insuranceType: this.sf55.value.insuranceType,
km: this.totalDistance
};
this.service
.request(this.service.$api_getWholeInsuranceInfo, params)
.subscribe(res => {
if (res) {
this.sf5.setValue('/insurancePremium',res.insurancePremium);
}else{
this.sf5.setValue('/insurancePremium',null);
}
});
}
}
getInsurersPrice($event?: any) {
console.log($event);
this.changeSub.next(`${$event}`);
}
getInsurers($event?: any) {
this.changeSub.pipe(debounceTime(500)).subscribe((res: any) => {
console.log(res)
if (res) {
console.log(res)
if(res > 3000000 ) {
console.log('1111')
this.sf5.getProperty('/goodsValue')!.widget.reset(3000000);
this.sf5.setValue('/goodsValue', 3000000);
this.service.msgSrv.error('请输入50000-3000000之间数值!')
}
if(res < 50000) {
// this.sf5.setValue('/goodsValue', 50000);
this.sf5.getProperty('/goodsValue')!.widget.reset(50000);
this.sf5.setValue('/goodsValue', 50000);
console.log('2222')
this.service.msgSrv.error('请输入50000-3000000之间数值!')
}
if (this.sf5.value.goodsValue >= 50000) {
if(this.totalDistance <=0){
this.service.msgSrv.warning('当前装卸货距离为0无法计算保价费金额');
return;
}
const params = { const params = {
insuranceType,
goodsValue: this.sf5.value.goodsValue, goodsValue: this.sf5.value.goodsValue,
insuranceType: this.sf5.value.insuranceType,
km: this.totalDistance km: this.totalDistance
}; };
this.service.request(this.service.$api_getWholeInsuranceInfo, params).subscribe(res => { this.service.request(this.service.$api_getWholeInsuranceInfo, params).subscribe(res => {
@ -1341,8 +1388,4 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
}); });
} }
} }
});
}
} }

View File

@ -1,25 +1,18 @@
<!--
* @Description :
* @Version : 1.0
* @Author : Shiming
* @Date : 2021-12-03 11:10:14
* @LastEditors : Shiming
* @LastEditTime : 2022-01-18 17:28:37
* @FilePath : \\tms-obc-web\\src\\app\\routes\\supply-management\\components\\qrcode-page\\qrcode-page.component.html
* Copyright (C) 2022 huzhenhong. All rights reserved.
-->
<nz-spin *ngIf="!i" class="modal-spin"></nz-spin> <nz-spin *ngIf="!i" class="modal-spin"></nz-spin>
<div style="width: 50%; margin: 0 auto"> <div>
<div class=""> <nz-alert nzType="warning" nzMessage="二维码用于司机扫码抢单" nzShowIcon></nz-alert>
<h2>公司名称 : {{ i?.enterpriseInfoName }}</h2> <div style="width: 80%;margin: 0 auto;" id="qr_page">
<qr [value]="i.id" #qr></qr> <div style="text-align: center;">
<h2> {{i?.shipperAppUserName}}</h2>
<qr [value]="qrCodeValue" #qr></qr>
<div class="mb-sm" *ngFor="let address of i?.loadingAddressArr">卸货地 : {{address}}</div> <div class="mb-sm" *ngFor="let address of i?.loadingAddressArr">卸货地 : {{address}}</div>
<div class="mb-sm" *ngFor="let address of i?.unloadingAddressArr">装货地 : {{address}}</div> <div class="mb-sm" *ngFor="let address of i?.unloadingAddressArr">装货地 : {{address}}</div>
<div class="mb-sm">截止时间 : {{i?.deadlineTime}}</div> <div class="mb-sm">截止时间 : {{i?.deadlineTime}}</div>
<div>Tips : 二维码用于司机扫码抢单</div>
</div> </div>
</div> </div>
<div class="modal-footer text-center"> <div class="modal-footer text-center">
<button nz-button type="submit" nzType="primary" (click)="downLoadQrcode('二维码')">下载二维码</button> <button nz-button type="submit" nzType="primary" (click)="toCanvasPhoto()">下载二维码</button>
</div>
</div> </div>

View File

@ -1,3 +1,13 @@
/*
* @Description :
* @Version : 1.0
* @Author : Shiming
* @Date : 2021-12-03 11:10:14
* @LastEditors : Shiming
* @LastEditTime : 2022-02-28 20:00:20
* @FilePath : \\tms-obc-web\\src\\app\\routes\\supply-management\\components\\qrcode-page\\qrcode-page.component.spec.ts
* Copyright (C) 2022 huzhenhong. All rights reserved.
*/
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
import { SupplyManagementQrcodePageComponent } from './qrcode-page.component'; import { SupplyManagementQrcodePageComponent } from './qrcode-page.component';

View File

@ -4,7 +4,7 @@
* @Author : Shiming * @Author : Shiming
* @Date : 2021-12-03 11:10:14 * @Date : 2021-12-03 11:10:14
* @LastEditors : Shiming * @LastEditors : Shiming
* @LastEditTime : 2022-01-18 17:28:46 * @LastEditTime : 2022-03-01 14:19:47
* @FilePath : \\tms-obc-web\\src\\app\\routes\\supply-management\\components\\qrcode-page\\qrcode-page.component.ts * @FilePath : \\tms-obc-web\\src\\app\\routes\\supply-management\\components\\qrcode-page\\qrcode-page.component.ts
* Copyright (C) 2022 huzhenhong. All rights reserved. * Copyright (C) 2022 huzhenhong. All rights reserved.
*/ */
@ -13,6 +13,7 @@ import { Component, OnInit, ViewChild } from '@angular/core';
import { QRComponent } from '@delon/abc/qr'; import { QRComponent } from '@delon/abc/qr';
import { SFSchema, SFUISchema } from '@delon/form'; import { SFSchema, SFUISchema } from '@delon/form';
import { NzModalRef } from 'ng-zorro-antd/modal'; import { NzModalRef } from 'ng-zorro-antd/modal';
import html2canvas from 'html2canvas';
@Component({ @Component({
selector: 'app-supply-management-qrcode-page', selector: 'app-supply-management-qrcode-page',
@ -23,39 +24,50 @@ export class SupplyManagementQrcodePageComponent implements OnInit {
record: any = {}; record: any = {};
i: any; i: any;
schema: SFSchema = {}; schema: SFSchema = {};
qrCodeValue = '';
ui: SFUISchema = { ui: SFUISchema = {
'*': { '*': {
spanLabelFixed: 100, spanLabelFixed: 100,
grid: { span: 12 } grid: { span: 12 },
}, },
$no: { $no: {
widget: 'text' widget: 'text'
}, },
$href: { $href: {
widget: 'string' widget: 'string',
}, },
$description: { $description: {
widget: 'textarea', widget: 'textarea',
grid: { span: 24 } grid: { span: 24 },
} },
}; };
constructor(private modal: NzModalRef) {} constructor(
private modal: NzModalRef,
) { }
ngOnInit(): void { ngOnInit(): void {
console.log(this.i); this.qrCodeValue = `rid:${this.i?.id}`;
} }
downLoadQrcode(downloadName: any): void {
/**
* 下载二维码
* @param downloadName 文件名
* @param contents 内容
*/
downLoadQrcode(downloadName: any, contents: any): void {
let aLink = document.createElement('a'); let aLink = document.createElement('a');
const content = this.qr.dataURL; const content = contents;
let blob = this.base64ToBlob(content); //new Blob([content]); let blob = this.base64ToBlob(content); //new Blob([content]);
let evt = document.createEvent('HTMLEvents'); let evt = document.createEvent("HTMLEvents");
evt.initEvent('click', true, true); //initEvent 不加后两个参数在IE下会报错 事件类型,是否冒泡,是否阻止浏览器的默认行为 evt.initEvent("click", true, true);//initEvent 不加后两个参数在IE下会报错 事件类型,是否冒泡,是否阻止浏览器的默认行为
aLink.download = downloadName; aLink.download = downloadName;
aLink.href = URL.createObjectURL(blob); aLink.href = URL.createObjectURL(blob);
// aLink.dispatchEvent(evt); // aLink.dispatchEvent(evt);
aLink.click(); aLink.click();
} }
//base64转blob //base64转blob
@ -74,4 +86,18 @@ export class SupplyManagementQrcodePageComponent implements OnInit {
close(): void { close(): void {
this.modal.destroy(); this.modal.destroy();
} }
/**
* 把页面装成canvas
*/
toCanvasPhoto() {
let aLink = document.createElement('a');
html2canvas(document.getElementById('qr_page')!, { height: 340 }).then((canvas:any) => {
let url = canvas.toDataURL("image/jpeg");
this.downLoadQrcode('二维码', url);
})
}
} }

View File

@ -26,7 +26,7 @@
<div nz-col [nzSpan]="10"> <div nz-col [nzSpan]="10">
<div *ngFor="let data1 of startInfo; let idx = index"> <div *ngFor="let data1 of startInfo; let idx = index">
<nz-form-item> <nz-form-item>
<nz-form-label [nzSpan]="3" nzRequired>装货地</nz-form-label> <nz-form-label nzRequired>装货地</nz-form-label>
<nz-form-control [nzErrorTip]="'请输入装货地'"> <nz-form-control [nzErrorTip]="'请输入装货地'">
<div class="align-center"> <div class="align-center">
<nz-input-group [nzSuffix]="endInconTemp1"> <nz-input-group [nzSuffix]="endInconTemp1">
@ -36,6 +36,7 @@
(click)="openMap('start', idx)" (click)="openMap('start', idx)"
formControlName="loadAddress{{ idx }}" formControlName="loadAddress{{ idx }}"
placeholder="请输入装货地" placeholder="请输入装货地"
readonly="true"
/> />
</nz-input-group> </nz-input-group>
<span *ngIf="idx !== 0" style="padding: 0 10px" <span *ngIf="idx !== 0" style="padding: 0 10px"
@ -48,7 +49,7 @@
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
<nz-form-item> <nz-form-item>
<nz-form-label [nzSpan]="3" nzRequired>联系人</nz-form-label> <nz-form-label nzRequired>联系人</nz-form-label>
<div style="display: flex; width: 80.7%"> <div style="display: flex; width: 80.7%">
<nz-form-control [nzErrorTip]="'请输入联系人姓名'"> <nz-form-control [nzErrorTip]="'请输入联系人姓名'">
<input <input
@ -93,7 +94,7 @@
<div nz-col [nzSpan]="10"> <div nz-col [nzSpan]="10">
<div *ngFor="let data2 of endInfo; let idx = index"> <div *ngFor="let data2 of endInfo; let idx = index">
<nz-form-item> <nz-form-item>
<nz-form-label [nzSpan]="4" nzRequired>卸货地</nz-form-label> <nz-form-label nzRequired>卸货地</nz-form-label>
<nz-form-control [nzErrorTip]="'请输入卸货地'"> <nz-form-control [nzErrorTip]="'请输入卸货地'">
<div class="align-center"> <div class="align-center">
<nz-input-group [nzSuffix]="endInconTemp1"> <nz-input-group [nzSuffix]="endInconTemp1">
@ -104,6 +105,7 @@
formControlName="unloadAddress{{ idx }}" formControlName="unloadAddress{{ idx }}"
placeholder="请输入卸货地" placeholder="请输入卸货地"
name="unloadAddress{{ idx }}" name="unloadAddress{{ idx }}"
readonly="true"
/> />
</nz-input-group> </nz-input-group>
<span *ngIf="idx !== 0" style="padding: 0 10px" <span *ngIf="idx !== 0" style="padding: 0 10px"
@ -116,7 +118,7 @@
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
<nz-form-item> <nz-form-item>
<nz-form-label [nzSpan]="3" nzRequired>联系人</nz-form-label> <nz-form-label nzRequired>联系人</nz-form-label>
<div style="display: flex; width: 80.7%"> <div style="display: flex; width: 80.7%">
<nz-form-control [nzErrorTip]="'请输入联系人姓名'"> <nz-form-control [nzErrorTip]="'请输入联系人姓名'">
<input <input
@ -156,18 +158,24 @@
<div nz-row [nzGutter]="24" style="margin-top: 24px"> <div nz-row [nzGutter]="24" style="margin-top: 24px">
<div nz-col [nzSpan]="10"> <div nz-col [nzSpan]="10">
<nz-form-item> <nz-form-item>
<nz-form-label [nzSpan]="3" nzRequired>装货时间</nz-form-label> <nz-form-label nzRequired>装货时间</nz-form-label>
<nz-form-control [nzErrorTip]="'请输入装货时间'"> <nz-form-control [nzErrorTip]="'请输入装货时间'">
<nz-date-picker nzShowTime nzFormat="yyyy-MM-dd HH:mm:ss" formControlName="loadingTime" name="loadingTime"></nz-date-picker> <nz-date-picker
[nzShowTime]="{ nzFormat: 'HH' }"
nzFormat="yyyy-MM-dd HH:00前"
formControlName="loadingTime"
[nzDisabledDate]="disabledDateStart"
></nz-date-picker>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
</div> </div>
<div nz-col [nzSpan]="4"></div> <div nz-col [nzSpan]="4"></div>
<div nz-col [nzSpan]="10"> <div nz-col [nzSpan]="10">
<nz-form-item> <nz-form-item>
<nz-form-label [nzSpan]="3" nzRequired>卸货时间</nz-form-label> <nz-form-label nzRequired>卸货时间</nz-form-label>
<nz-form-control [nzErrorTip]="'请输入卸货时间'"> <nz-form-control [nzErrorTip]="'请输入卸货时间'">
<nz-date-picker nzShowTime nzFormat="yyyy-MM-dd HH:mm:ss" formControlName="unloadingTime" name="unloadingTime"></nz-date-picker> <nz-date-picker [nzShowTime]="{ nzFormat: 'HH' }"
nzFormat="yyyy-MM-dd HH:00前" formControlName="unloadingTime"></nz-date-picker>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
</div> </div>
@ -335,7 +343,7 @@
<ng-template sf-template="paymentDays" let-i let-ui="ui"> <ng-template sf-template="paymentDays" let-i let-ui="ui">
<div nz-row> <div nz-row>
<div class="align-center"> <div class="align-center">
<div nz-col nzSpan="16"> <div nz-col nzSpan="12">
<nz-input-number <nz-input-number
[ngModel]="i.value" [ngModel]="i.value"
[nzMin]="1" [nzMin]="1"
@ -347,7 +355,7 @@
[nzPrecisionMode]="'cut'" [nzPrecisionMode]="'cut'"
></nz-input-number> ></nz-input-number>
</div> </div>
<div nz-col nzSpan="8"> <div nz-col nzSpan="12">
<span>&nbsp;天内支付运费</span> <span>&nbsp;天内支付运费</span>
</div> </div>
</div> </div>

View File

@ -2,6 +2,7 @@ import { Component, OnInit, ViewChild } from '@angular/core';
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router'; import { ActivatedRoute, Router } from '@angular/router';
import { cacheConf } from '@conf/cache.conf'; import { cacheConf } from '@conf/cache.conf';
import differenceInCalendarDays from 'date-fns/differenceInCalendarDays';
import { import {
SFCheckboxWidgetSchema, SFCheckboxWidgetSchema,
SFComponent, SFComponent,
@ -101,13 +102,22 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
@ViewChild('sf7', { static: false }) sf7!: SFComponent; @ViewChild('sf7', { static: false }) sf7!: SFComponent;
schema7: SFSchema = {}; schema7: SFSchema = {};
ui7!: SFUISchema; ui7!: SFUISchema;
limitValues = {
maxWeight: 99999,
maxVolume: 99999,
maxPiece: 99999,
maxDays: 999,
intervalDays: 999,
maxTimes: 999
};
formatterRmb = (value: number): string => { formatterRmb = (value: number): string => {
if(value){ if (value === null || value === undefined) {
let value2 = Number(value).toLocaleString(undefined,{'minimumFractionDigits':2,'maximumFractionDigits':2}); return '';
} else {
let value2 = Number(value).toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 });
return `${value2}`; return `${value2}`;
} }
return `¥ 0.00`
}; };
parserRmb = (value: string): string => value.replace('¥', '').replace(',', ''); parserRmb = (value: string): string => value.replace('¥', '').replace(',', '');
// 页面初始化 // 页面初始化
@ -120,6 +130,7 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
this.initSF7(); this.initSF7();
this.addStartInfo(); this.addStartInfo();
this.addEndInfo(); this.addEndInfo();
this.getLimitvalue();
} }
initSF1() { initSF1() {
this.schema1 = { this.schema1 = {
@ -134,9 +145,11 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
searchDebounceTime: 300, searchDebounceTime: 300,
searchLoadingText: '搜索中...', searchLoadingText: '搜索中...',
onSearch: (q: any) => { onSearch: (q: any) => {
if (!!q) { console.log(q === ' ');
let str = q.replace(/^\s+|\s+$/g, '');
if (str) {
return this.service return this.service
.request(this.service.$api_enterpriceList, { enterpriseName: q }) .request(this.service.$api_enterpriceList, { enterpriseName: str })
.pipe(map(res => (res as any[]).map(i => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum)))) .pipe(map(res => (res as any[]).map(i => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum))))
.toPromise(); .toPromise();
} else { } else {
@ -144,8 +157,12 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
} }
}, },
change: (q: any) => { change: (q: any) => {
this.getRegionCode(q); let str = q.replace(/^\s+|\s+$/g, '');
}, if (str) {
this.getRegionCode(str);
this.payChange();
}
}
} as SFSelectWidgetSchema } as SFSelectWidgetSchema
}, },
enterpriseProjectId: { enterpriseProjectId: {
@ -172,7 +189,8 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
widget: 'select', widget: 'select',
placeholder: '请选择', placeholder: '请选择',
allowClear: true, allowClear: true,
asyncData: () => this.shipperSrv.getNetworkFreightForwarder() asyncData: () => this.shipperSrv.getNetworkFreightForwarder(),
change: () => this.payChange()
} }
}, },
externalResourceCode: { externalResourceCode: {
@ -220,7 +238,7 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
} as SFSelectWidgetSchema } as SFSelectWidgetSchema
} }
}, },
required: ['shipperAppUserId', 'enterpriseProjectId', 'enterpriseInfoName', ] required: ['shipperAppUserId', 'enterpriseProjectId', 'enterpriseInfoName']
}; };
this.ui1 = { this.ui1 = {
'*': { '*': {
@ -241,7 +259,7 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
ui: { ui: {
widget: 'select', widget: 'select',
placeholder: '请选择', placeholder: '请选择',
errors: { required: '请选择货物类型' }, errors: { required: '请选择货物名称' },
asyncData: () => asyncData: () =>
this.shipperSrv.loadConfigByKey('goods.name.config.type').pipe( this.shipperSrv.loadConfigByKey('goods.name.config.type').pipe(
map((data: any) => { map((data: any) => {
@ -270,7 +288,7 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
widget: 'select', widget: 'select',
placeholder: '请选择', placeholder: '请选择',
errors: { required: '请填写货物名称' }, errors: { required: '请填写货物名称' },
change: (_value: any, data: any) => { change: (value: any, data: any) => {
this.sf3.setValue('/goodsName', data.label); this.sf3.setValue('/goodsName', data.label);
}, },
visibleIf: { visibleIf: {
@ -299,11 +317,11 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
} }
} }
}, },
required: ['goodsTypeId', 'goodsName', 'goodsNameId'] required: ['goodsTypeId', 'goodsName', 'goodsNameId', 'goodsName1']
}; };
this.ui3 = { this.ui3 = {
'*': { '*': {
spanLabelFixed: 90, spanLabelFixed: 115,
grid: { span: 12 } grid: { span: 12 }
} }
}; };
@ -317,7 +335,8 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
ui: { ui: {
widget: 'custom', widget: 'custom',
placeholder: '请输入', placeholder: '请输入',
errors: { required: '必填项' } errors: { required: '必填项' },
validator: val => this.customValidator(val)
} }
}, },
volume: { volume: {
@ -347,8 +366,8 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
errors: { required: '请选择车型' }, errors: { required: '请选择车型' },
asyncData: () => this.service.getDictOptions({ dictKey: 'car:model' }), asyncData: () => this.service.getDictOptions({ dictKey: 'car:model' }),
change: (tag: any, org: any) => { change: (tag: any, org: any) => {
if(tag.includes("999")){ if (tag.includes('999')) {
this.sf4.setValue('/carModel',["999"]); this.sf4.setValue('/carModel', ['999']);
} }
} }
} }
@ -364,38 +383,27 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
errors: { required: '请选择车长' }, errors: { required: '请选择车长' },
asyncData: () => this.service.getDictOptions({ dictKey: 'car:length' }), asyncData: () => this.service.getDictOptions({ dictKey: 'car:length' }),
change: (tag: any, org: any) => { change: (tag: any, org: any) => {
if(tag.includes("999")){ if (tag.includes('999')) {
this.sf4.setValue('/carModel',["999"]); this.sf4.setValue('/carLength', ['999']);
}
} }
} }
} }
},
}, },
required: ['weight', 'carModel', 'carLength'] required: ['weight', 'carModel', 'carLength']
}; };
this.ui4 = { this.ui4 = {
'*': { '*': {
spanLabelFixed: 90, spanLabelFixed: 115,
grid: { span: 24 } grid: { span: 8 }
},
$weight: {
grid: { lg: 8, md: 12, sm: 12, xs: 24 }
},
$volume: {
grid: { lg: 8, md: 12, sm: 12, xs: 24 }
},
$number: {
grid: { lg: 8, md: 12, sm: 12, xs: 24 }
}, },
$carModel: { $carModel: {
spanLabelFixed: 100, spanLabelFixed: 100,
grid: { span: 8 } grid: { span: 8 }
},
$carLength: {
grid: { span: 8 }
} }
}; };
} }
initSF5() { initSF5() {
this.schema5 = { this.schema5 = {
properties: { properties: {
@ -403,8 +411,17 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
type: 'string', type: 'string',
title: '增值服务套餐', title: '增值服务套餐',
ui: { ui: {
widget: 'dict-select', widget: 'select',
params: { dictKey: 'bill:insurance:type' }, asyncData: () => {
return this.service.request(this.service.$api_getDictValue, { dictKey: 'bill:insurance:type' }).pipe(
map((res: any) => {
return [...res];
})
);
},
change: (tag: any, org: any) => {
this.getInsurersPrice(tag);
}
}, },
default: '3' default: '3'
}, },
@ -415,7 +432,7 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
readOnly: true, readOnly: true,
ui: { ui: {
widget: 'checkbox', widget: 'checkbox',
visibleIf: { insuranceType: (value: string) => value === '0' } visibleIf: { insuranceType: (value: string) => value === '1' }
} as SFCheckboxWidgetSchema, } as SFCheckboxWidgetSchema,
default: ['车辆实时定位', '轨迹查询', '数据保护', '赠送基本险'] default: ['车辆实时定位', '轨迹查询', '数据保护', '赠送基本险']
}, },
@ -426,7 +443,7 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
readOnly: true, readOnly: true,
ui: { ui: {
widget: 'checkbox', widget: 'checkbox',
visibleIf: { insuranceType: (value: string) => value === '1' } visibleIf: { insuranceType: (value: string) => value === '2' }
} as SFCheckboxWidgetSchema, } as SFCheckboxWidgetSchema,
default: ['车辆实时定位', '轨迹查询', '数据保护', '专属技术服务', '赠送综合险'] default: ['车辆实时定位', '轨迹查询', '数据保护', '专属技术服务', '赠送综合险']
}, },
@ -444,6 +461,7 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
ui: { ui: {
widget: 'dict-select', widget: 'dict-select',
params: { dictKey: 'insure:packaged:goods' }, params: { dictKey: 'insure:packaged:goods' },
containsAllLabel: false,
visibleIf: { insuranceType: (value: string) => value !== '3' } visibleIf: { insuranceType: (value: string) => value !== '3' }
} as SFSelectWidgetSchema } as SFSelectWidgetSchema
}, },
@ -469,6 +487,7 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
title: '', title: '',
ui: { ui: {
widget: 'custom', widget: 'custom',
validator: val => this.customValidator(val),
visibleIf: { insuranceType: (value: string) => value !== '3' } visibleIf: { insuranceType: (value: string) => value !== '3' }
} }
}, },
@ -478,9 +497,9 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
ui: { ui: {
hidden: true hidden: true
} }
}
}, },
}, required: ['insurancePackagedGoods', 'insurancePremium']
required: ['insurancePackagedGoods']
}; };
this.ui5 = { this.ui5 = {
'*': { '*': {
@ -495,9 +514,10 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
}, },
$freeInsurance: { $freeInsurance: {
grid: { span: 24 } grid: { span: 24 }
}, }
}; };
} }
initSF6() { initSF6() {
this.schema6 = { this.schema6 = {
properties: { properties: {
@ -520,7 +540,7 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
ui: { ui: {
widget: 'dict-select', widget: 'dict-select',
params: { dictKey: 'receipt:type' }, params: { dictKey: 'receipt:type' },
containsAllLable: false, containsAllLabel: false,
placeholder: '请选择', placeholder: '请选择',
errors: { required: '请选择' }, errors: { required: '请选择' },
visibleIf: { visibleIf: {
@ -528,58 +548,65 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
} }
} }
}, },
// receiptAddressId: { receiptAddress: {
// type: 'string', type: 'string',
// title: '选择地址', title: '回单收件人信息',
// ui: { ui: {
// widget: 'custom', widget: 'custom',
// placeholder: '请点击选择回单地址', placeholder: '请点击选择回单收件人信息',
// // validator: val => (this.sf6?.value?.receiptType === '2' ? [{ keyword: 'required', message: '请点击选择收回单地址' }] : []), // validator: val => (this.sf6?.value?.receiptType === '2' ? [{ keyword: 'required', message: '请点击选择收回单地址' }] : []),
// visibleIf: { visibleIf: {
// receiptType: value => value === '2' receiptType: value => value === '2'
// } }
// }, },
// default: '' default: ''
// }, },
receiptAddressId: {
type: 'string',
title: '',
ui: {
hidden: true
}
},
receiptUserName: { receiptUserName: {
type: 'string', type: 'string',
title: '联系人', title: '联系人',
maxLength: 15,
ui: { ui: {
visibleIf: { visibleIf: {
receiptType: value => value === '2' receiptType: value => value === '2'
} }
}, },
readOnly: true
}, },
receiptUserPhone: { phon: {
type: 'string', type: 'string',
title: '联系电话', title: '联系电话',
maxLength: 11,
ui: { ui: {
visibleIf: { visibleIf: {
receiptType: value => value === '2' receiptType: value => value === '2'
} }
}, },
readOnly: true
}, },
receiptAddressArea: { area: {
type: 'string', type: 'string',
title: '所在地区', title: '所在地区',
maxLength: 30,
ui: { ui: {
visibleIf: { visibleIf: {
receiptType: value => value === '2' receiptType: value => value === '2'
} }
}, },
readOnly: true
}, },
receiptAddress: { address: {
type: 'string', type: 'string',
title: '详细地址', title: '详细地址',
maxLength: 50,
ui: { ui: {
visibleIf: { visibleIf: {
receiptType: value => value === '2' receiptType: value => value === '2'
} }
}, },
readOnly: true
}, },
remarks: { remarks: {
type: 'string', type: 'string',
@ -592,15 +619,16 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
} as SFTextareaWidgetSchema } as SFTextareaWidgetSchema
} }
}, },
required: ['stateReceipt', 'receiptType', 'receiptUserName','receiptUserPhone','receiptAddressArea','receiptAddress'] required: ['stateReceipt', 'receiptType', 'receiptAddress']
}; };
this.ui6 = { this.ui6 = {
'*': { '*': {
spanLabelFixed: 90, spanLabelFixed: 115,
grid: { span: 24 } grid: { span: 24 }
} }
}; };
} }
initSF7() { initSF7() {
this.schema7 = { this.schema7 = {
properties: { properties: {
@ -643,6 +671,57 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
} }
}; };
} }
getLimitvalue() {
// 货物核载信息最大值
// 货物运输费(小计)最大值
const getlimitvaluesParms = [
this.service.limitKeys.weight,
this.service.limitKeys.volume,
this.service.limitKeys.piece,
this.service.limitKeys.maxDays,
this.service.limitKeys.intervalDays,
this.service.limitKeys.maxTimes
];
this.service.request(this.service.$api_findItemValueByItemKeys, getlimitvaluesParms).subscribe(res => {
const maxWeight = res.filter((item: any) => item.itemKey === this.service.limitKeys.weight)[0].itemValue;
const maxVolume = res.filter((item: any) => item.itemKey === this.service.limitKeys.volume)[0].itemValue;
const maxPiece = res.filter((item: any) => item.itemKey === this.service.limitKeys.piece)[0].itemValue;
const maxDays = res.filter((item: any) => item.itemKey === this.service.limitKeys.maxDays)[0].itemValue;
const intervalDays = res.filter((item: any) => item.itemKey === this.service.limitKeys.intervalDays)[0].itemValue;
const maxTimes = res.filter((item: any) => item.itemKey === this.service.limitKeys.maxTimes)[0].itemValue;
this.limitValues = {
maxWeight: Number(maxWeight),
maxVolume: Number(maxVolume),
maxPiece: Number(maxPiece),
maxDays: Number(maxDays),
intervalDays: Number(intervalDays),
maxTimes: Number(maxTimes)
};
});
}
// 不可选择的时间
disabledDateStart = (current: Date): boolean => {
return differenceInCalendarDays(new Date(), current) > 0;
};
/**
* 自定义校验数据
* @param val
*/
customValidator(val: number) {
if (this.isEmpty(val)) {
return [{ keyword: 'required', message: '不能为空' }];
} else {
if (val <= 0) {
return [{ keyword: 'required', message: '数值需大于0' }];
}
return [];
}
}
isEmpty(val: any) {
return val === undefined || val === null || val.toString().trim() === '';
}
// 获取城市列表 // 获取城市列表
getRegionCode(regionCode: any) { getRegionCode(regionCode: any) {
console.log(regionCode); console.log(regionCode);
@ -663,31 +742,34 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
} }
payChange() { payChange() {
const prePay = this.sf7.value.prePay || 0; const prePay = this.sf7.value.prePay || 0;
const toPay = this.sf7.value.toPay || 0 const toPay = this.sf7.value.toPay || 0;
const receiptPay = this.sf7.value.receiptPay || 0; const receiptPay = this.sf7.value.receiptPay || 0;
// const oilCardPay = 0; const oilCardPay = 0;
const subtotal = prePay + toPay + receiptPay; const subtotal = prePay + toPay + receiptPay;
const params = { const params = {
shipperId: this.envCache?.enterpriseId, shipperId: this?.sf1.value?.shipperAppUserId,
enterpriseInfoId: this.envCache?.networkTransporterId, enterpriseInfoId: this?.sf1.value?.enterpriseInfoName || '',
totalFreight: subtotal, totalFreight: subtotal,
// fuelCardAmount:oilCardPay, fuelCardAmount: oilCardPay,
resourcetype: '1' resourcetype: '1'
} };
this.service this.service.request(this.service.$api_getCalculatedSurcharge, params).subscribe(res => {
.request(this.service.$api_getCalculatedSurcharge,params) console.log('999');
.subscribe(res => { console.log(this?.sf1.value);
if (res) { if (res) {
this.sf7.setValue('/appendFee', res.surcharge); this.sf7.setValue('/appendFee', res.surcharge);
this.sf7.setValue('/subtotal', subtotal); this.sf7.setValue('/subtotal', subtotal);
this.sf7.setValue('/total', subtotal + res.surcharge); this.sf7.setValue('/total', subtotal + res.surcharge);
this.service this.service
.request(this.service.$api_getcalculatedServiceRate + `?invoiceAmount=${subtotal + res.surcharge}&totalFreight=${subtotal}`) .request(
this.service.$api_getAdditionalRate +
`?shipperId=${this?.sf1.value?.shipperAppUserId || ''}&enterpriseInfoId=${
this?.sf1.value?.enterpriseInfoName || ''
}&resourcetype='1'`
)
.subscribe(res => { .subscribe(res => {
if (res) { if (res) {
this.currentRate = res.rate * 100; this.currentRate = res.rate * 100;
} else {
this.service.msgSrv.error(res.msg);
} }
}); });
} else { } else {
@ -775,65 +857,136 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
this.validateForm1.controls[key].markAsDirty(); this.validateForm1.controls[key].markAsDirty();
this.validateForm1.controls[key].updateValueAndValidity(); this.validateForm1.controls[key].updateValueAndValidity();
}); });
this.sf1.validator({ emitError: true });
this.sf3.validator({ emitError: true }); this.sf3.validator({ emitError: true });
this.sf4.validator({ emitError: true }); this.sf4.validator({ emitError: true });
this.sf5.validator({ emitError: true });
this.sf6.validator({ emitError: true }); this.sf6.validator({ emitError: true });
this.sf7.validator({ emitError: true }); this.sf7.validator({ emitError: true });
if (this.validateForm1.invalid || !this.sf1.valid || !this.sf3.valid || !this.sf4.valid || !this.sf6.valid || !this.sf7.valid) { if (this.validateForm1.invalid || !this.sf3.valid || !this.sf4.valid || !this.sf5.valid || !this.sf6.valid || !this.sf7.valid) {
this.service.msgSrv.warning('请完善必填项!');
return;
}
if (this.validateForm1.value.loadingTime < new Date()) {
this.service.msgSrv.warning('装货时间必须大于当前时间!');
return;
}
if (this.validateForm1.value.loadingTime > this.validateForm1.value.unloadingTime) {
this.service.msgSrv.warning('装货时间不能大于卸货时间!');
return;
}
if (this.sf7.value.total <= 0) {
this.service.msgSrv.warning('总费用不能为0');
return;
}
const num = (Number(this.validateForm1.value.unloadingTime) - Number(this.validateForm1.value.loadingTime)) / (24 * 60 * 60 * 1000);
if (num > this.limitValues.maxDays) {
this.service.msgSrv.error(`当前计划装卸货时间间隔已超出限定值【${this.limitValues.maxDays}天】`);
return;
}
if (
this.sf4.value.weight > this.limitValues.maxWeight ||
this.sf4.value.volume > this.limitValues.maxVolume ||
this.sf4.value.number > this.limitValues.maxPiece
) {
this.service.msgSrv.error(
`当前货物核载信息已超出限定值【${this.limitValues.maxWeight}吨、${this.limitValues.maxVolume}方、${this.limitValues.maxPiece}件】`
);
return; return;
} }
const modalRef = this.modalService.create({ const getFreightParms = { carLengthKeys: this.sf4.value.carLength, km: this.totalDistance };
nzTitle: '运输协议', this.service.request(this.service.$api_getFreight, getFreightParms).subscribe(res => {
nzContent: TranAgreementComponent, if (this.sf7.value.subtotal > res.maxPrice) {
nzWidth: 900, this.service.msgSrv.error(`运费过高,请调整录入`);
nzFooter: null return;
} else if (this.sf7.value.subtotal > res.ewPrice) {
this.modalService.confirm({
nzTitle: '',
nzContent: `您的录入的运费过高,可能会影响支付,请仔细确认`,
nzOkText: '继续',
nzCancelText: '取消',
nzOnOk: () => {
this.agreementConfirm(submitType);
}
}); });
modalRef.afterClose.subscribe(result => { } else {
if (result) { this.agreementConfirm(submitType);
this.submit(submitType);
} }
}); });
} }
// 提交 // 提交前协议弹窗
submit(submitType: string): void { agreementConfirm(submitType?: string) {
//装卸货信息 //装卸货信息
const LoadingList = this.startInfo.concat(this.endInfo); const LoadingList = this.startInfo.concat(this.endInfo);
// 货物信息 // 货物信息
const goodsInfoList = [ const sf3Values = { ...this.sf3.value };
if (sf3Values.goodsTypeName === '其它') {
sf3Values.goodsName = sf3Values.goodsName1;
delete sf3Values.goodsName1;
}
if (this.sf4.value.carModel.includes('999')) {
this.sf4.value.carModel = ['999'];
}
if (this.sf4.value.carLength.includes('999')) {
this.sf4.value.carLength = ['999'];
}
const goodsInfoVOList = [
{ {
...sf3Values,
...this.sf4.value, ...this.sf4.value,
...this.sf3.value,
carModel: this.sf4.value.carModel.join(','), carModel: this.sf4.value.carModel.join(','),
carLength: this.sf4.value.carLength.join(',') carLength: this.sf4.value.carLength.join(',')
} }
]; ];
// 运费信息 // 运费信息
const expenseList = [ const expenseList = [
{ expenseCode: 'PRE', expenseName: '预付', price: this.sf7.value.prePay, id: this.sf7data?.prePayId ? this.sf7data?.prePayId : '' }, { expenseCode: 'PRE', expenseName: '预付', price: this.sf7.value.prePay || 0, id: this.sf7data?.prePayId || '' },
{ expenseCode: 'RECE', expenseName: '到付', price: this.sf7.value.toPay, id: this.sf7data?.toPayId ? this.sf7data?.toPayId : '' }, { expenseCode: 'RECE', expenseName: '到付', price: this.sf7.value.toPay || 0, id: this.sf7data?.toPayId || '' },
{ { expenseCode: 'BACK', expenseName: '回单付', price: this.sf7.value.receiptPay || 0, id: this.sf7data?.receiptPayId || '' }
expenseCode: 'BACK',
expenseName: '回单付',
price: this.sf7.value.receiptPay,
id: this.sf7data?.receiptPayId ? this.sf7data?.receiptPayId : ''
}
]; ];
console.log(this.sf55?.value);
// const params = {
// id: '',
// ...this.sf1.value,
// unLoadingPlaceDTOList: LoadingList,
// unloadingTime: format(this.validateForm1.value?.unloadingTime, 'yyyy-MM-dd HH:mm:ss'),
// loadingTime: format(this.validateForm1.value?.loadingTime, 'yyyy-MM-dd HH:mm:ss'),
// goodsInfoDTOList: goodsInfoList,
// ...this.sf5.value,
// ...this.sf6.value,
// expenseDTOList: expenseList,
// paymentDays: this.sf7.value?.paymentDays,
// insuranceType:this.sf55?.value?.insuranceType,
// };
const params = { const params = {
id: '', id: '',
...this.sf1.value, ...this.sf1.value,
unLoadingPlaceDTOList: LoadingList, unLoadingPlaceDTOList: LoadingList,
unloadingTime: format(this.validateForm1.value.unloadingTime, 'yyyy-MM-dd HH:mm:ss'), unloadingTime: format(this.validateForm1.value.unloadingTime, 'yyyy-MM-dd HH:mm:ss'),
loadingTime: format(this.validateForm1.value.loadingTime, 'yyyy-MM-dd HH:mm:ss'), loadingTime: format(this.validateForm1.value.loadingTime, 'yyyy-MM-dd HH:mm:ss'),
goodsInfoDTOList: goodsInfoList, goodsInfoDTOList: goodsInfoVOList,
...this.sf5.value, ...this.sf5.value,
...this.sf6.value, ...this.sf6.value,
expenseDTOList: expenseList, expenseDTOList: expenseList,
paymentDays: this.sf7.value.paymentDays, paymentDays: this.sf7.value.paymentDays
insuranceType:this.sf55.value.insuranceType,
}; };
console.log(params);
const modalRef = this.modalService.create({
nzTitle: '运输协议',
nzContent: TranAgreementComponent,
nzWidth: 900,
nzFooter: null,
nzComponentParams: { Object: params }
});
modalRef.afterClose.subscribe(result => {
if (result) {
this.submit(submitType, params);
}
});
}
// 提交
submit(submitType?: string, params?: any): void {
let reqUrl = this.service.$api_consignWhole; let reqUrl = this.service.$api_consignWhole;
if (submitType) { if (submitType) {
if (submitType == 'assign') { if (submitType == 'assign') {
@ -983,6 +1136,8 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
if (this.sf3data.goodsNameId) { if (this.sf3data.goodsNameId) {
this.sf3.setValue('/goodsNameId', this.sf3data.goodsNameId); this.sf3.setValue('/goodsNameId', this.sf3data.goodsNameId);
} }
} else {
this.service.msgSrv.error(res.msg);
} }
}); });
} }
@ -1019,47 +1174,21 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
this.validateForm1.addControl(`unloadName${index}`, new FormControl(null, Validators.required)); this.validateForm1.addControl(`unloadName${index}`, new FormControl(null, Validators.required));
this.validateForm1.addControl(`unloadPhone${index}`, new FormControl(null, [Validators.required, Validators.pattern('^[0-9]*$')])); this.validateForm1.addControl(`unloadPhone${index}`, new FormControl(null, [Validators.required, Validators.pattern('^[0-9]*$')]));
}); });
// 计算里程,时间 // 计算里程,时间
if (this.startInfo[0]?.area && this.endInfo[0]?.area) { if (this.startInfo[0]?.area && this.endInfo[0]?.area) {
this.amapService.drivingCompute([...this.startInfo], [...this.endInfo]).subscribe(res => { this.amapService.drivingCompute([...this.startInfo], [...this.endInfo]).subscribe(res => {
this.totalDistance = res.distance; this.totalDistance = res.distance;
this.totalTime = res.time; this.totalTime = res.time;
this.getInsurersPrice(); //计算保费金额
}); });
} }
} }
goodsValuesChange(value: any) { // 计算保价费金额
console.log(value); getInsurersPrice(insuranceType = this.sf5.value.insuranceType) {
console.log(this.totalDistance); if (this.sf5.value.goodsValue >= 50000 && this.totalDistance > 0) {
if(value >= 50000 && this.totalDistance > 0){
const params = {
goodsValue: value,
insuranceType: this.sf55.value.insuranceType,
km: this.totalDistance
};
this.service
.request(this.service.$api_getWholeInsuranceInfo, params)
.subscribe(res => {
if (res) {
this.sf5.setValue('/insurancePremium',res.insurancePremium);
}else{
this.sf5.setValue('/insurancePremium',null);
}
});
}
}
getInsurersPrice() {
console.log(this.sf5.value.goodsValue)
console.log(this.sf5.value.insuranceType)
if (this.sf5.value.goodsValue >= 50000) {
if(this.totalDistance <=0){
this.service.msgSrv.warning('当前装卸货距离为0无法计算保价费金额');
return;
}
const params = { const params = {
insuranceType,
goodsValue: this.sf5.value.goodsValue, goodsValue: this.sf5.value.goodsValue,
insuranceType: this.sf5.value.insuranceType,
km: this.totalDistance km: this.totalDistance
}; };
this.service.request(this.service.$api_getWholeInsuranceInfo, params).subscribe(res => { this.service.request(this.service.$api_getWholeInsuranceInfo, params).subscribe(res => {

View File

@ -1,5 +1,5 @@
<h2 style="text-align: center;"> <h2 style="text-align: center;">
{{ agreement?.agreementName }} <div [innerHTML]="agreement | safehtml"></div>
</h2> </h2>
<div *nzModalFooter> <div *nzModalFooter>
<button nz-button nzType="primary" (click)="handleOk()" >我已阅读并同意签署</button> <button nz-button nzType="primary" (click)="handleOk()" >我已阅读并同意签署</button>

View File

@ -1,10 +1,20 @@
/*
* @Description :
* @Version : 1.0
* @Author : Shiming
* @Date : 2022-02-24 20:19:51
* @LastEditors : Shiming
* @LastEditTime : 2022-02-28 20:55:59
* @FilePath : \\tms-obc-web\\src\\app\\routes\\supply-management\\components\\tran-agreement\\tran-agreement.component.ts
* Copyright (C) 2022 huzhenhong. All rights reserved.
*/
/* /*
* @Description : * @Description :
* @Version : 1.0 * @Version : 1.0
* @Author : Shiming * @Author : Shiming
* @Date : 2022-01-06 15:01:40 * @Date : 2022-01-06 15:01:40
* @LastEditors : Shiming * @LastEditors : Shiming
* @LastEditTime : 2022-02-24 16:24:32 * @LastEditTime : 2022-02-28 20:55:07
* @FilePath : \\tms-obc-web\\src\\app\\routes\\supply-management\\components\\tran-agreement\\tran-agreement.component.ts * @FilePath : \\tms-obc-web\\src\\app\\routes\\supply-management\\components\\tran-agreement\\tran-agreement.component.ts
* Copyright (C) 2022 huzhenhong. All rights reserved. * Copyright (C) 2022 huzhenhong. All rights reserved.
*/ */
@ -18,16 +28,37 @@ import { SupplyManagementService } from '../../services/supply-management.servic
styleUrls: ['./tran-agreement.component.less'] styleUrls: ['./tran-agreement.component.less']
}) })
export class TranAgreementComponent { export class TranAgreementComponent {
Object: any;
agreement:any; agreement:any;
constructor(private modal: NzModalRef,public service: SupplyManagementService,) { constructor(private modal: NzModalRef,public service: SupplyManagementService,) {
} }
ngOnInit() { ngOnInit() {
this.service.request(this.service.$api_getAgreementInfoByType,{type:'6'}).subscribe((res) => { console.log(Object)
const params = {
contractType:'1',
parametersDTO: {
// 回单付
back: 'dsfgffdsg',
// 发货地址
consignorAddress: 'gfdgdfdg',
// 发货时间
consignorDate: 'dsggdsgsfgds',
// 发货时间
// consignorDate: '',
},
resourceType: '1',
signingObject: '1',
templateType: 'MX',
}
console.log(params)
this.service.request(this.service.$api_getContractContent,params).subscribe((res) => {
if (res) { if (res) {
this.agreement = res;
this.agreement = res.contractContent;
} }
}); });
} }

View File

@ -79,6 +79,10 @@ export class SupplyManagementUpdatePriceComponent implements OnInit {
spanLabelFixed: 100, spanLabelFixed: 100,
grid: { span: 16 }, grid: { span: 16 },
}, },
'$rule': {
spanLabelFixed: 120,
grid: { span: 16 },
},
}; };
} }

View File

@ -13,16 +13,40 @@
<div nz-row> <div nz-row>
<div nz-col nzSpan="14" class="text-grey-darker">网络货运人:{{ i?.enterpriseInfoName }}</div> <div nz-col nzSpan="14" class="text-grey-darker">网络货运人:{{ i?.enterpriseInfoName }}</div>
<div nz-col nzSpan="10"> <div nz-col nzSpan="10">
<button nz-button (click)="cancleGoodsSource()" *ngIf="i?.resourceStatus === '1'" acl [acl-ability]="['SUPPLY-VEHICLE-DETAIL-cancelSupply']">取消货源</button> <button
<button nz-button (click)="assignedCar(i)" nz-button
*ngIf="i?.resourceStatus === '1' && i?.serviceType === '2'" acl [acl-ability]="['SUPPLY-VEHICLE-DETAIL-vehicleAnew']">重新指派</button> (click)="cancleGoodsSource()"
<button nz-button (click)="updateGoodsSource(i)" *ngIf="i?.resourceStatus === '1'" acl [acl-ability]="['SUPPLY-VEHICLE-DETAIL-changeSupply']">修改货源</button> *ngIf="i?.resourceStatus === '1'"
<button nz-button nzType="primary" nzGhost (click)="nextOrder(i)" acl [acl-ability]="['SUPPLY-VEHICLE-DETAIL-vehiclePlaceOrder']">再下一单</button> acl
[acl-ability]="['SUPPLY-VEHICLE-DETAIL-cancelSupply']"
>取消货源</button
>
<button
nz-button
(click)="assignedCar(i)"
*ngIf="i?.resourceStatus === '1' && i?.serviceType === '2'"
acl
[acl-ability]="['SUPPLY-VEHICLE-DETAIL-vehicleAnew']"
>重新指派</button
>
<button
nz-button
(click)="updateGoodsSource(i)"
*ngIf="i?.resourceStatus === '1'"
acl
[acl-ability]="['SUPPLY-VEHICLE-DETAIL-changeSupply']"
>修改货源</button
>
<button nz-button nzType="primary" nzGhost (click)="nextOrder(i)" acl [acl-ability]="['SUPPLY-VEHICLE-DETAIL-vehiclePlaceOrder']"
>再下一单</button
>
</div> </div>
</div> </div>
<div class="mt-sm mb-sm" nz-row> <div class="mt-sm mb-sm" nz-row>
<div> <div>
<b>总费用:<span class="text-red-light text-md">{{i?.totalAmount | currency: '¥'}}</span></b> <b
>总费用:<span class="text-red-light text-md">{{ i?.totalAmount | currency: '¥' }}</span></b
>
</div> </div>
</div> </div>
<nz-divider></nz-divider> <nz-divider></nz-divider>
@ -39,17 +63,32 @@
<div class="approval-status"> <div class="approval-status">
<div style="width: 60%; margin: 0 auto"> <div style="width: 60%; margin: 0 auto">
<nz-steps [nzLabelPlacement]="'vertical'"> <nz-steps [nzLabelPlacement]="'vertical'">
<nz-step [nzStatus]="i?.resourceStatus !== '1'?'finish':'process'" nzIcon="solution" <nz-step
[nzDescription]="i?.createAt" nzTitle="下单"></nz-step> [nzStatus]="i?.resourceStatus !== '1' ? 'finish' : 'process'"
<nz-step *ngIf="i?.resourceStatus === '1' || i?.resourceStatus === '2' " nzIcon="solution"
[nzStatus]="i?.resourceStatus=== '1'? 'wait':'finish'" nzIcon="file-done" [nzTitle]="'接单'"></nz-step> [nzDescription]="i?.createAt"
<nz-step nzStatus="finish" nzIcon="close-circle" nzTitle="取消货源" *ngIf="i?.resourceStatus === '3'"></nz-step> nzTitle="下单"
[nzSubtitle]="i?.createTime"
></nz-step>
<nz-step
*ngIf="i?.resourceStatus === '1' || i?.resourceStatus === '2'"
[nzStatus]="i?.resourceStatus === '1' ? 'wait' : 'finish'"
nzIcon="file-done"
[nzTitle]="'接单'"
[nzSubtitle]="i?.orderReceivingTime"
></nz-step>
<nz-step
nzStatus="finish"
nzIcon="close-circle"
nzTitle="取消货源"
*ngIf="i?.resourceStatus === '3'"
[nzSubtitle]="i?.endTime"
></nz-step>
</nz-steps> </nz-steps>
</div> </div>
</div> </div>
</nz-card> </nz-card>
<nz-card nzTitle="基本信息"> <nz-card nzTitle="基本信息">
<sv-container col="2"> <sv-container col="2">
<sv-title>货物信息</sv-title> <sv-title>货物信息</sv-title>
@ -57,9 +96,7 @@
<sv label="货物名称"> <sv label="货物名称">
{{ item.goodsName }} {{ item.goodsName }}
</sv> </sv>
<sv label="货物数量"> <sv label="货物数量"> {{ item.weight }}吨,{{ item.volume }}方,{{ item.number }}件 </sv>
{{item.weight}}吨,{{item.volume}}方,{{item.number}}件
</sv>
</ng-container> </ng-container>
</sv-container> </sv-container>
<sv-container class="mt-md"> <sv-container class="mt-md">
@ -75,8 +112,10 @@
</sv> </sv>
</sv-container> </sv-container>
<div class="mt-md"> <div class="mt-md">
<h4 class="text-md">装货卸货信息 <h4 class="text-md"
<span class="ml-sm text-sm">( >装货卸货信息
<span class="ml-sm text-sm"
>(
<label>{{ i?.loadingCount }}装</label> <label>{{ i?.loadingCount }}装</label>
<label>{{ i?.unloadingCount }}卸</label> <label>{{ i?.unloadingCount }}卸</label>
) )
@ -123,9 +162,7 @@
<sv label="货物价值"> <sv label="货物价值">
{{ i?.goodsValue | currency }} {{ i?.goodsValue | currency }}
</sv> </sv>
<sv label="保价费金额"> <sv label="保价费金额"> {{ i?.insurancePremium | currency }} 元 </sv>
{{i?.insurancePremium |currency}} 元
</sv>
</sv-container> </sv-container>
</nz-card> </nz-card>
<nz-card [nzTitle]="'运费信息到货后' + i?.paymentDays + '天内支付运费'"> <nz-card [nzTitle]="'运费信息到货后' + i?.paymentDays + '天内支付运费'">
@ -147,7 +184,7 @@
<h3> <h3>
<label>总计 :</label> <label>总计 :</label>
<span class="text-error-dark text-xl"> <span class="text-error-dark text-xl">
{{(i?.totalAmount) | currency}} {{ i?.totalAmount | currency }}
</span> </span>
<span>(运费{{ i?.totalFreight | currency }}含附加运费 {{ i?.totalSurcharge | currency }}</span> <span>(运费{{ i?.totalFreight | currency }}含附加运费 {{ i?.totalSurcharge | currency }}</span>
</h3> </h3>
@ -175,7 +212,10 @@
</sv-container> </sv-container>
</nz-card> </nz-card>
<nz-card nzTitle="操作日志"> <nz-card nzTitle="操作日志">
<st #st [data]="i?.auditRecordList" [columns]="logColumns" [ps]="0" [page]="{ show: false, showSize: false }"> <st #st [data]="service.$api_getOperationLogRecordsList" [columns]="logColumns"
[page]="{ show: false, showSize: false }"
[req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, params: reqParams }"
[res]="{ reName: { list: 'data.records', total: 'data.total' } }">
</st> </st>
</nz-card> </nz-card>
</div> </div>

View File

@ -17,15 +17,15 @@ export class SupplyManagementVehicleDetailComponent implements OnInit {
id = this.route.snapshot.params.id; id = this.route.snapshot.params.id;
i: any; i: any;
logColumns: STColumn[] = [
{ title: '内容', index: 'theme' },
{ title: '操作人', index: 'operationUserPhone' },
{ title: '操作时间', index: ' createTime' },
];
serviceType: any = { serviceType: any = {
1: '抢单', 1: '抢单',
2: '指派' 2: '指派'
} }
logColumns: STColumn[] = [
{ title: '内容', index: 'operationContent' },
{ title: '操作人', index: 'operator' },
{ title: '操作时间', index: 'operatorTimestamp' },
];
totalObj: any; totalObj: any;
attObj: any; attObj: any;
status: any = { 1: '待接单', 2: '已接单', 3: '已取消' }; status: any = { 1: '待接单', 2: '已接单', 3: '已取消' };
@ -50,11 +50,16 @@ export class SupplyManagementVehicleDetailComponent implements OnInit {
render: 'price' render: 'price'
}, },
]; ];
get reqParams() {
return {
operateObject: this.i?.resourceCode,
operateType: 4,
};
}
constructor( constructor(
private route: ActivatedRoute, private route: ActivatedRoute,
private msgSrv: NzMessageService, private msgSrv: NzMessageService,
private service: SupplyManagementService, public service: SupplyManagementService,
public modal: NzModalService, public modal: NzModalService,
public router: Router public router: Router
) { ) {

View File

@ -4,7 +4,7 @@
* @Author : Shiming * @Author : Shiming
* @Date : 2022-01-12 10:52:50 * @Date : 2022-01-12 10:52:50
* @LastEditors : Shiming * @LastEditors : Shiming
* @LastEditTime : 2022-02-25 15:22:22 * @LastEditTime : 2022-03-01 13:12:12
* @FilePath : \\tms-obc-web\\src\\app\\routes\\supply-management\\components\\vehicle\\vehicle.component.html * @FilePath : \\tms-obc-web\\src\\app\\routes\\supply-management\\components\\vehicle\\vehicle.component.html
* Copyright (C) 2022 huzhenhong. All rights reserved. * Copyright (C) 2022 huzhenhong. All rights reserved.
--> -->
@ -31,8 +31,8 @@
[acl-ability]="['SUPPLY-INDEX-vehicleSearch']" [acl-ability]="['SUPPLY-INDEX-vehicleSearch']"
>查询</button >查询</button
> >
<button nz-button nzType="primary" [nzLoading]="loading">导出</button> <button nz-button nzType="primary" [disabled]="loading">导出</button>
<button nz-button [nzLoading]="loading" (click)="resetSF()">重置</button> <button nz-button [disabled]="loading" (click)="resetSF()">重置</button>
<button nz-button nzType="link" (click)="expandToggle()"> <button nz-button nzType="link" (click)="expandToggle()">
{{ !_$expand ? '展开' : '收起' }} {{ !_$expand ? '展开' : '收起' }}
<i nz-icon [nzType]="!_$expand ? 'down' : 'up'"></i> <i nz-icon [nzType]="!_$expand ? 'down' : 'up'"></i>
@ -71,6 +71,9 @@
[loading]="loading" [loading]="loading"
[scroll]="{ x: '1200px', y: '500px' }" [scroll]="{ x: '1200px', y: '500px' }"
> >
<ng-template st-row="createUserName" let-item let-index="index">
<div> {{ item?.createUserName }}/{{ item?.createUserPhone }} </div>
</ng-template>
<ng-template st-row="resourceCode" let-item let-index="index"> <ng-template st-row="resourceCode" let-item let-index="index">
<a [routerLink]="'vehicle-detail/' + item?.id">{{ item?.resourceCode }}</a> <a [routerLink]="'vehicle-detail/' + item?.id">{{ item?.resourceCode }}</a>
<p>{{ item?.resourceTypeLabel }}{{ item?.serviceTypeLabel }}</p> <p>{{ item?.resourceTypeLabel }}{{ item?.serviceTypeLabel }}</p>

View File

@ -8,9 +8,9 @@ import { map } from 'rxjs/operators';
import { SupplyManagementService } from '../../services/supply-management.service'; import { SupplyManagementService } from '../../services/supply-management.service';
import { SupplyManagementVehicleAssignedCarComponent } from '../assigned-car/assigned-car.component'; import { SupplyManagementVehicleAssignedCarComponent } from '../assigned-car/assigned-car.component';
import { SupplyManagementUpdateExternalSnComponent } from '../update-external-sn/update-external-sn.component'; import { SupplyManagementUpdateExternalSnComponent } from '../update-external-sn/update-external-sn.component';
import { SupplyManagementUpdateFreightComponent } from '../update-freight/update-freight.component';
import { of } from 'rxjs'; import { of } from 'rxjs';
import { ShipperBaseService } from '@shared'; import { ShipperBaseService } from '@shared';
import { SupplyManagementImportSupplyComponent } from '../../model/import-supply/import-supply.component';
@Component({ @Component({
selector: 'app-supply-management-vehicle', selector: 'app-supply-management-vehicle',
@ -58,7 +58,7 @@ export class SupplyManagementVehicleComponent implements OnInit {
if (this.resourceStatus) { if (this.resourceStatus) {
a.resourceStatus = this.resourceStatus; a.resourceStatus = this.resourceStatus;
} }
this.loading = true this.loading = true;
return { return {
...a ...a
}; };
@ -81,10 +81,10 @@ export class SupplyManagementVehicleComponent implements OnInit {
return requestOptions; return requestOptions;
}; };
afterRes = (data: any[], rawData?: any) => { afterRes = (data: any[], rawData?: any) => {
this.loading = false this.loading = false;
return data.map(item => ({ return data.map(item => ({
...item, ...item,
disabled: item.auditStatus !== '1', disabled: item.auditStatus !== '1'
})); }));
}; };
@ -148,40 +148,24 @@ export class SupplyManagementVehicleComponent implements OnInit {
}, 500); }, 500);
} }
/**
* 编辑外部货源号
* @param item st当前行对象
*/
editEnternalSn(item: any) {
const modalRef = this.modal.create({
nzWidth: '400px',
nzContent: SupplyManagementUpdateExternalSnComponent,
nzComponentParams: {
orderObject: item
},
nzFooter: null,
nzClosable: false
});
}
/** /**
* 导入货源 * 导入货源
*/ */
importGoodsSource() {} importGoodsSource() {
/**
* 修改运费
*/
updateFreight(item: any) {
const modalRef = this.modal.create({ const modalRef = this.modal.create({
nzTitle: '修改运费', nzTitle: '货源导入',
nzWidth: '40%', nzWidth: 600,
nzContent: SupplyManagementUpdateFreightComponent, nzContent: SupplyManagementImportSupplyComponent,
nzComponentParams: { nzComponentParams: {
i: item // i: item
}, },
nzFooter: null nzFooter: null
}); });
modalRef.afterClose.subscribe(result => {
if (result) {
this.st.reload();
}
});
} }
/** /**
@ -243,9 +227,7 @@ export class SupplyManagementVehicleComponent implements OnInit {
* 审核通过按钮 * 审核通过按钮
*/ */
handleOK(value: any) { handleOK(value: any) {
console.log(this.sfFre.valid); if (this.auditMany === false) {
console.log(this.sfFre.value);
if (this.selectedRows.length <= 0) {
const params: any = { const params: any = {
id: this.auditID, id: this.auditID,
remarks: this.sfFre.value.remarks remarks: this.sfFre.value.remarks
@ -255,6 +237,7 @@ export class SupplyManagementVehicleComponent implements OnInit {
} else { } else {
params.auditStatus = 3; params.auditStatus = 3;
} }
console.log('999');
console.log(params); console.log(params);
this.service.request(this.service.$api_goodsResourceAudit, params).subscribe(res => { this.service.request(this.service.$api_goodsResourceAudit, params).subscribe(res => {
if (res === true) { if (res === true) {
@ -378,10 +361,10 @@ export class SupplyManagementVehicleComponent implements OnInit {
}, },
allowClear: true, allowClear: true,
onSearch: (q: any) => { onSearch: (q: any) => {
console.log(q); let str = q.replace(/^\s+|\s+$/g, '');
if (!!q) { if (str) {
return this.service return this.service
.request(this.service.$api_enterpriceList, { enterpriseName: q }) .request(this.service.$api_enterpriceList, { enterpriseName: str })
.pipe(map((res: any) => (res as any[]).map(i => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum)))) .pipe(map((res: any) => (res as any[]).map(i => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum))))
.toPromise(); .toPromise();
} else { } else {
@ -493,12 +476,14 @@ export class SupplyManagementVehicleComponent implements OnInit {
className: 'text-left', className: 'text-left',
render: 'resourceCode' render: 'resourceCode'
}, },
{ title: '录单员', render: 'createUserName', width: '200px', className: 'text-left' },
{ {
title: '货主', title: '货主',
index: 'shipperAppUserName', index: 'shipperAppUserName',
width: '180px', width: '180px',
className: 'text-left' className: 'text-left'
}, },
{ {
title: '项目名称', title: '项目名称',
index: 'enterpriseProjectName', index: 'enterpriseProjectName',
@ -616,13 +601,13 @@ export class SupplyManagementVehicleComponent implements OnInit {
click: _record => this.nextOrder(_record), click: _record => this.nextOrder(_record),
acl: { ability: ['SUPPLY-INDEX-vehiclePlaceOrder'] } acl: { ability: ['SUPPLY-INDEX-vehiclePlaceOrder'] }
}, },
{type: 'divider'},
{ {
text: '重新指派 ', text: '重新指派 ',
click: _record => this.assignedCar(_record), click: _record => this.assignedCar(_record),
iif: item => item.resourceStatus === '1' && item.serviceType === '2', iif: item => item.resourceStatus === '1' && item.serviceType === '2',
acl: { ability: ['SUPPLY-INDEX-vehicleReassign'] } acl: { ability: ['SUPPLY-INDEX-vehicleReassign'] }
} },
{ type: 'divider' }
] ]
} }
]; ];

View File

@ -0,0 +1,55 @@
<!--
* @Description :
* @Version : 1.0
* @Author : Shiming
* @Date : 2021-12-03 11:10:14
* @LastEditors : Shiming
* @LastEditTime : 2022-03-02 20:29:46
* @FilePath : \\tms-obc-web\\src\\app\\routes\\supply-management\\model\\import-supply\\import-supply.component.html
* Copyright (C) 2022 huzhenhong. All rights reserved.
-->
<div *ngIf="status">
<sf #sf mode="edit" [schema]="schema" [ui]="ui" button="none">
<ng-template sf-template="fileName" let-me let-ui="ui" let-schema="schema">
<nz-input-group [nzSuffix]="inputClearTpl">
<input type="text" readonly nz-input [(ngModel)]="me.formProperty.value" placeholder="请上传文件" />
</nz-input-group>
<ng-template #inputClearTpl>
<i nz-icon class="ant-input-clear-icon" nzTheme="fill" nzType="close-circle" *ngIf="me.formProperty.value"
(click)="clearFile()"></i>
</ng-template>
</ng-template>
<ng-template sf-template="file" let-me let-ui="ui" let-schema="schema">
<nz-upload [nzAction]="uploadUrl" [nzName]="'multipartFile'" [nzHeaders]="{ authorization: 'authorization-text' }"
[(nzFileList)]="files"
[nzAccept]="'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel'"
(nzChange)="handleChange($event)" [nzShowUploadList]="false" [nzBeforeUpload]="beforeUpload" [nzLimit]="1">
<div>
<button nzType="primary" nz-button>
<i nz-icon nzType="upload"></i>
上传文件
</button>
</div>
</nz-upload>
<span style="color: #ff4d4f; font-size: 12px;margin-left: 10px; cursor: pointer;"
(click)="downFile()">下载导入模板</span>
<div style="color: #ff4d4f; font-size: 12px; margin-top: 5px; width: 400px">仅支持XLS / XLSX文件格式最多不能超过100行数据</div>
</ng-template>
</sf>
<div>
<p class="mb-xs">注意:</p>
<p class="mb-xs">1、第一次上传请点击下载模板</p>
<p class="mb-xs">2、请不要调整模板顺序</p>
<p class="mb-xs">3、必填字段请务必填写</p>
<p class="mb-xs">4、如果不清楚字段值请参考货源发布功能</p>
<p class="mb-xs">5、发布成功后可在货源列表-待接单查看</p>
<div>
</div>
<div *ngIf="!status">
文件上传成功成功xx条失败xx条
</div>
<div class="modal-footer text-right">
<button nz-button type="button" (click)="close()">取消</button>
<button nz-button type="submit" nzType="primary" (click)="save()">确定</button>
</div>

View File

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

View File

@ -0,0 +1,211 @@
/*
* @Description :
* @Version : 1.0
* @Author : Shiming
* @Date : 2022-03-01 15:13:03
* @LastEditors : Shiming
* @LastEditTime : 2022-03-02 20:57:36
* @FilePath : \\tms-obc-web\\src\\app\\routes\\supply-management\\model\\import-supply\\import-supply.component.ts
* Copyright (C) 2022 huzhenhong. All rights reserved.
*/
import { Component, OnInit, ViewChild } from '@angular/core';
import { STColumn } from '@delon/abc/st';
import { SFComponent, SFSchema, SFSchemaEnum, SFSelectWidgetSchema, SFUISchema } from '@delon/form';
import { _HttpClient } from '@delon/theme';
import { NzMessageService } from 'ng-zorro-antd/message';
import { NzModalRef } from 'ng-zorro-antd/modal';
import { NzUploadChangeParam, NzUploadFile } from 'ng-zorro-antd/upload';
import { Observable, Observer, of } from 'rxjs';
import { map } from 'rxjs/operators';
import { SupplyManagementService } from '../../services/supply-management.service';
import { apiConf } from '@conf/api.conf';
@Component({
selector: 'app-supply-management-import-supply',
templateUrl: './import-supply.component.html',
})
export class SupplyManagementImportSupplyComponent implements OnInit {
record: any = {};
files: any;
status: boolean = true
files2: any;
schema: SFSchema = {};
ui: SFUISchema = {};
fileName: any;
uploadUrl = apiConf.file_upload_url;
@ViewChild('sf', { static: false }) sf!: SFComponent;
constructor(
private modal: NzModalRef,
private msgSrv: NzMessageService,
public service: SupplyManagementService
) { }
ngOnInit(): void {
this.initSF();
console.log(this.record)
}
initSF() {
this.schema = {
properties: {
shipperAppUserId: {
title: '货主',
type: 'string',
maxLength: 30,
ui: {
widget: 'select',
// serverSearch: true,
searchDebounceTime: 300,
searchLoadingText: '搜索中...',
onSearch: (q: any) => {
console.log(q === ' ')
let str =q.replace(/^\s+|\s+$/g,"");
if (str) {
return this.service
.request(this.service.$api_enterpriceList, { enterpriseName: str })
.pipe(map(res => (res as any[]).map(i => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum))))
.toPromise();
} else {
return of([]);
}
},
change: (q: any) => {
let str =q.replace(/^\s+|\s+$/g,"");
if (str) {
this.getRegionCode(str);
this.getRegionCode2(str);
}
}
} as SFSelectWidgetSchema
},
netTranName: {
type: 'string',
title: '网络货运人',
ui: {
widget: 'text',
},
default: '确认货主后带出'
},
enterpriseProjectId: {
type: 'string',
title: '项目',
ui: {
widget: 'select',
placeholder: '请选择'
} as SFSelectWidgetSchema
},
fileName: {
type: 'string',
title: '导入货源信息',
ui: {
widget: 'custom'
}
},
file: {
type: 'string',
title: '',
ui: {
widget: 'custom'
}
},
},
required: ['shipperAppUserId', 'enterpriseProjectId','netTranName','fileName'],
};
this.ui = {
'*': {
spanLabelFixed: 130,
grid: { span: 20 },
},
'$fileName': {
spanLabelFixed: 130,
grid: { span: 20 },
},
'$resourceCode': {
spanLabelFixed: 130,
grid: { span: 20 },
},
};
}
getRegionCode(regionCode: any) {
console.log(regionCode);
return this.service
.request(this.service.$api_get_enterprise_project, { id: regionCode })
.pipe(
map(res =>
res.map((item: any) => ({
label: item.projectName,
value: item.id
}))
)
)
.subscribe(res => {
this.sf.getProperty('/enterpriseProjectId')!.schema.enum = res;
this.sf.getProperty('/enterpriseProjectId')!.widget.reset(res);
});
}
getRegionCode2(regionCode: any) {
console.log(regionCode);
return this.service
.request(this.service.$api_getNetworkTransporter, { id: regionCode }).subscribe((res: any) => {
console.log(res?.netTranName)
console.log(res?.networkTransporter)
this.sf.getProperty('/netTranName')!.widget.reset(res?.netTranName);
this.sf.setValue('/netTranName', res?.netTranName)
});
}
save(): void {
console.log(this.sf.value)
// this.service.request(this.service.$api_update_price, { id, freightType, freightPrice, resourceCode, rule, resourceId }).subscribe(res => {
// if (res) {
// this.msgSrv.success('保存成功');
// this.modal.close(true);
// }
// });
}
close(): void {
this.modal.destroy();
}
handleChange(info: NzUploadChangeParam): void {
switch (info?.file?.status) {
case 'uploading':
break;
case 'done':
let file = info?.file;
let fileName = file?.response.name;
this.sf?.setValue('/fileName', fileName);
this.sf?.setValue('/file', file?.response?.url);
break;
case 'error':
this.service.msgSrv.error('出错误了');
break;
}
}
beforeUpload = (file: NzUploadFile, _fileList: NzUploadFile[]) => {
return new Observable((observer: Observer<boolean>) => {
// const isJpgOrPng = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
// if (!isJpgOrPng) {
// this.service.msgSrv.error('仅支持XLX / XLSX文件格式');
// observer.complete();
// return;
// }
// tslint:disable-next-line: no-non-null-assertion
const isLt2M = file.size! / 1024 / 1024 < 3;
if (!isLt2M) {
this.service.msgSrv.warning('图片大小超过3兆!');
observer.complete();
return;
}
observer.next(isLt2M);
observer.complete();
});
};
clearFile() {
this.fileName = null;
this.sf?.setValue('/fileName', null);
this.sf?.setValue('/file', null);
}
downFile() {
this.service.downloadFile(this.service.$api_exportGoodsResourceOperateTemplate);
}
}

View File

@ -4,7 +4,7 @@
* @Author : Shiming * @Author : Shiming
* @Date : 2021-12-03 11:10:14 * @Date : 2021-12-03 11:10:14
* @LastEditors : Shiming * @LastEditors : Shiming
* @LastEditTime : 2022-02-28 11:31:44 * @LastEditTime : 2022-03-02 14:27:18
* @FilePath : \\tms-obc-web\\src\\app\\routes\\supply-management\\services\\supply-management.service.ts * @FilePath : \\tms-obc-web\\src\\app\\routes\\supply-management\\services\\supply-management.service.ts
* Copyright (C) 2022 huzhenhong. All rights reserved. * Copyright (C) 2022 huzhenhong. All rights reserved.
*/ */
@ -54,6 +54,8 @@ export class SupplyManagementService extends BaseService {
$api_getCalculatedSurcharge = `/api/sdc/expense/getCalculatedSurcharge`; $api_getCalculatedSurcharge = `/api/sdc/expense/getCalculatedSurcharge`;
// 整车计算附加费率 // 整车计算附加费率
$api_getcalculatedServiceRate = `/api/sdc/expense/getAdditionalRate`; $api_getcalculatedServiceRate = `/api/sdc/expense/getAdditionalRate`;
// 整车计算附加费率
$api_getAdditionalRate = `/api/sdc/expense/getAdditionalRate`;
// 代发整车货源 // 代发整车货源
$api_consignWhole = `/api/sdc/goodsResourceOperate/consignWhole`; $api_consignWhole = `/api/sdc/goodsResourceOperate/consignWhole`;
// 代发大宗货源 // 代发大宗货源
@ -113,6 +115,10 @@ export class SupplyManagementService extends BaseService {
$api_getDictValue = `/api/mdc/pbc/dictItems/getDictValue`; $api_getDictValue = `/api/mdc/pbc/dictItems/getDictValue`;
// 获取协议信息 // 获取协议信息
public $api_getAgreementInfoByType = '/api/mdc/pbc/agreementInfo/getAgreementInfoByType'; public $api_getAgreementInfoByType = '/api/mdc/pbc/agreementInfo/getAgreementInfoByType';
// 获取协议信息
public $api_getContractContent = '/api/sdc/contractTemplate/getContractContent';
// 获取运价
public $api_getFreight = '/api/mdc/cuc/freightConfig/getFreight';
/** /**
* 获取车型、车长字典数据 * 获取车型、车长字典数据
* @returns * @returns
@ -132,6 +138,33 @@ export class SupplyManagementService extends BaseService {
constructor(public injector: Injector) { constructor(public injector: Injector) {
super(injector); super(injector);
} }
public limitKeys = {
weight:'sys.config.goods.approvalCarMaxWeight', //整车-核载重量上限
volume:'sys.config.goods.approvalCarMaxVolume', //整车-核载体积上限
piece:'sys.config.goods.approvalCarMaxPiece', //整车-核载件数上限
maxDays:'sys.config.goods.wholeLoadingMaxDays', //整车-计划装货时间上限
intervalDays:'sys.config.goods.wholeUnloadingIntervalDays', //计划装、卸货时间间隔
maxTimes:'sys.config.goods.wholeLoadingMaxTimes', //整车-多装多卸地点上限
}
public limitKeys2 = {
month:'sys.config.goods.bulkEndMaxMonth', //大宗-截止时间上限
weight:'sys.config.goods.bulkMaxWeight', //大宗-重量上限
volume:'sys.config.goods.bulkMaxVolume', //大宗-体积上限
trainNumber:'sys.config.goods.bulkMaxTrainNumber', //大宗-车次上限
freight:'sys.config.goods.bulkMaxUnitFreight', //大宗-运费单价上限
}
// 根据ItemKey获取项值
public $api_findItemValueByItemKeys = '/api/mdc/pbc/sysConfigItem/findItemValueByItemKeys';
// 获取保价费信息 // 获取保价费信息
public $api_getWholeInsuranceInfo = '/api/sdc/goodsResourceShipper/getWholeInsuranceInfo'; public $api_getWholeInsuranceInfo = '/api/sdc/goodsResourceShipper/getWholeInsuranceInfo';
// 下载导入货源模板-运营后台
public $api_exportGoodsResourceOperateTemplate = '/api/sdc/uploadGoodsResource/exportGoodsResourceOperateTemplate';
// 导入货源-运营后台
public $api_goodsResourceOperateImport = '/api/sdc/uploadGoodsResource/goodsResourceOperateImport';
// 根据货主ID查询网络货运人信息
public $api_getNetworkTransporter = '/api/mdc/cuc/enterpriseInfo/operate/getNetworkTransporter';
$api_verify_vehicle_status = `/api/sdc/goodsResourceShipper/saveVerify`;// 发布货源校验司机/车队长的状态
$api_get_sys_config = `/api/mdc/pbc/sysConfigItem/findConfigValues`; // 根据项key、业务id获取配置信息
// 获取指派熟车列表
$api_getListCars = '/api/mdc/cuc/enterpriseVehicle/getPracticeCarList';
} }

View File

@ -4,7 +4,7 @@
* @Author : Shiming * @Author : Shiming
* @Date : 2021-12-20 10:13:02 * @Date : 2021-12-20 10:13:02
* @LastEditors : Shiming * @LastEditors : Shiming
* @LastEditTime : 2022-01-18 17:26:40 * @LastEditTime : 2022-03-01 15:38:17
* @FilePath : \\tms-obc-web\\src\\app\\routes\\supply-management\\supply-management.module.ts * @FilePath : \\tms-obc-web\\src\\app\\routes\\supply-management\\supply-management.module.ts
* Copyright (C) 2022 huzhenhong. All rights reserved. * Copyright (C) 2022 huzhenhong. All rights reserved.
*/ */
@ -35,6 +35,7 @@ import { SupplyManagementUpdateFreightComponent } from './components/update-frei
import { SupplyManagementUpdatePriceComponent } from './components/update-price/update-price.component'; import { SupplyManagementUpdatePriceComponent } from './components/update-price/update-price.component';
import { SupplyManagementVehicleDetailComponent } from './components/vehicle-detail/vehicle-detail.component'; import { SupplyManagementVehicleDetailComponent } from './components/vehicle-detail/vehicle-detail.component';
import { SupplyManagementVehicleComponent } from './components/vehicle/vehicle.component'; import { SupplyManagementVehicleComponent } from './components/vehicle/vehicle.component';
import { SupplyManagementImportSupplyComponent } from './model/import-supply/import-supply.component';
import { SupplyManagementRoutingModule } from './supply-management-routing.module'; import { SupplyManagementRoutingModule } from './supply-management-routing.module';
const COMPONENTS: Type<void>[] = [ const COMPONENTS: Type<void>[] = [
@ -61,7 +62,8 @@ const COMPONENTS: Type<void>[] = [
SupplyManagementReleasePublishComponent, SupplyManagementReleasePublishComponent,
SupplyManagementBulkReleasePublishComponent, SupplyManagementBulkReleasePublishComponent,
TranAgreementComponent, TranAgreementComponent,
SupplyManagementBulkAssignedCarComponent SupplyManagementBulkAssignedCarComponent,
SupplyManagementImportSupplyComponent
]; ];
@NgModule({ @NgModule({

View File

@ -159,10 +159,10 @@ export class CloseAccountComponent implements OnInit {
searchDebounceTime: 300, searchDebounceTime: 300,
searchLoadingText: '搜索中...', searchLoadingText: '搜索中...',
onSearch: (q: any) => { onSearch: (q: any) => {
console.log(q) let str =q.replace(/^\s+|\s+$/g,"");
if (!!q) { if (str) {
return this.service return this.service
.request(this.service.$api_enterpriceList, { enterpriseName: q}) .request(this.service.$api_enterpriceList, { enterpriseName: str})
.pipe(map((res: any) => (res as any[]).map((i) => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum)))) .pipe(map((res: any) => (res as any[]).map((i) => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum))))
.toPromise(); .toPromise();
} else { } else {

View File

@ -244,12 +244,12 @@ export class NetworkFreightComponent implements OnInit {
ui: { placeholder: '请输入' } ui: { placeholder: '请输入' }
}, },
invoiceTaxRate: { invoiceTaxRate: {
type: 'string', type: 'number',
title: '发票税率', title: '发票税率',
ui: { placeholder: '请输入' } ui: { placeholder: '请输入' }
}, },
invoiceMaxAmount: { invoiceMaxAmount: {
type: 'string', type: 'number',
title: '发票面额上限', title: '发票面额上限',
ui: { placeholder: '请输入' } ui: { placeholder: '请输入' }
}, },
@ -326,7 +326,10 @@ export class NetworkFreightComponent implements OnInit {
'drawer' 'drawer'
] ]
}; };
this.ui3 = { '*': { spanLabelFixed: 120, grid: { span: 24 } } }; this.ui3 = {
'*': { spanLabelFixed: 120, grid: { span: 24 } },
'$taxClassificationVersion': { spanLabelFixed: 150, grid: { span: 24 } },
};
} }
initSFTax() { initSFTax() {
this.TaxSchema = { this.TaxSchema = {
@ -363,7 +366,7 @@ export class NetworkFreightComponent implements OnInit {
ui: { placeholder: '请输入' } ui: { placeholder: '请输入' }
}, },
invoiceTaxRate: { invoiceTaxRate: {
type: 'string', type: 'number',
title: '发票税率', title: '发票税率',
ui: { placeholder: '请输入' } ui: { placeholder: '请输入' }
}, },
@ -574,7 +577,7 @@ export class NetworkFreightComponent implements OnInit {
} }
// 新增 // 新增
creat(value?: any) { creat(value?: any) {
console.log(value) console.log(value);
this.router.navigate(['./new/' + value?.id], { relativeTo: this.ar }); this.router.navigate(['./new/' + value?.id], { relativeTo: this.ar });
} }
} }

View File

@ -148,12 +148,12 @@ export class NetworkFreightNewComponent implements OnInit {
}); });
} }
submitForm() { submitForm() {
// if (!this.sf1.valid || !this.sf.valid) { if (!this.sf1.valid || !this.sf.valid) {
// this.sf.validator({ emitError: true }); this.sf.validator({ emitError: true });
// this.sf1.validator({ emitError: true }); this.sf1.validator({ emitError: true });
// this.service.msgSrv.warning('请修改填写错误信息'); this.service.msgSrv.warning('请填写必填项!');
// return; return;
// } }
const enterpriseRegistrationTime = new Date(this.sf1.value.enterpriseRegistrationTime); const enterpriseRegistrationTime = new Date(this.sf1.value.enterpriseRegistrationTime);
const operatingStartTime = new Date(this.sf1.value.operatingStartTime); const operatingStartTime = new Date(this.sf1.value.operatingStartTime);
if (enterpriseRegistrationTime.getTime() > operatingStartTime.getTime()) { if (enterpriseRegistrationTime.getTime() > operatingStartTime.getTime()) {
@ -584,7 +584,7 @@ export class NetworkFreightNewComponent implements OnInit {
} }
} }
}, },
required: ['certificatePhotoFront', 'certificatePhotoBack', 'name', 'certificateType', 'certificateNumber',] required: ['certificatePhotoFront', 'certificatePhotoBack', 'name', 'certificateType', 'certificateNumber','certificatePhotoFrontWatermark','certificatePhotoBackWatermark']
} }
}, },
required: [ required: [

View File

@ -83,14 +83,11 @@ export class SettingRoleEditComponent implements OnInit {
this.service.msgSrv.warning('校验错误'); this.service.msgSrv.warning('校验错误');
return; return;
} }
// this.menu.washTree();
// if (this.authorityAssistId.length === 0) {
// this.service.msgSrv.warning('请选择权限!');
// return;
// }
console.log(this.params);
const auths = this.menu?.washTree(); const auths = this.menu?.washTree();
if (auths.authorityAssistId.length === 0) {
this.service.msgSrv.warning('请选择权限!');
return;
}
const params: any = { const params: any = {
id: this.params.id, id: this.params.id,
...this.sf.value, ...this.sf.value,

View File

@ -6,45 +6,14 @@
</div> </div>
<div class="rightBox"> <div class="rightBox">
<nz-tabset [nzSize]="'small'"> <nz-tabset [nzSize]="'small'">
<!-- <nz-tab nzTitle="操作权限">
<div *ngFor="let item of origin?.buttonInfoList">
<label nz-checkbox [(ngModel)]="item.checked" (ngModelChange)="addAuthority(origin, node, item)">{{ item.title
}}</label>
</div>
<nz-empty nzNotFoundImage="simple" *ngIf="origin?.buttonInfoList?.length === 0">
</nz-empty>
</nz-tab> -->
<nz-tab nzTitle="操作权限"> <nz-tab nzTitle="操作权限">
<div *ngIf="origin.buttonInfoList && origin.buttonInfoList.length"> <div *ngIf="origin.buttonInfoList && origin.buttonInfoList.length">
<label style="width: 100%" <label style="width: 100%" nz-checkbox [(ngModel)]="item.checked" *ngFor="let item of origin.buttonInfoList"
nz-checkbox (ngModelChange)="addAuthority(origin, node, item)" [disabled]="source === 'onlyAuth'">{{
[(ngModel)]="item.checked" item.permissionsName }}</label>
*ngFor="let item of origin.buttonInfoList"
(ngModelChange)="addAuthority(origin, node, item)"
[disabled]="source === 'onlyAuth'"
>{{ item.permissionsName }}</label
>
</div> </div>
<nz-empty nzNotFoundImage="simple" *ngIf="origin.buttonInfoList && origin.buttonInfoList.length === 0"> </nz-empty> <nz-empty nzNotFoundImage="simple" *ngIf="origin.buttonInfoList && origin.buttonInfoList.length === 0">
</nz-tab> </nz-empty>
<nz-tab nzTitle="数据权限">
<div *ngIf="origin.dictList?.length>0" se-container [labelWidth]="100">
<se [col]="1" label="用户范围" style="margin-bottom: 8px;" required>
<nz-select>
<nz-option nzValue="仅可见自己创建的数据" nzLabel="仅可见自己创建的数据"></nz-option>
<nz-option nzValue="可见全部人创建的数据" nzLabel="可见全部人创建的数据"></nz-option>
</nz-select>
</se>
<se [col]="1" label="运营主体" style="margin-bottom: 8px;" required>
<nz-select nzMode="multiple" nzShowSearch>
<nz-option nzValue="全部" nzLabel="全部"></nz-option>
<nz-option nzValue="天津" nzLabel="天津"></nz-option>
<nz-option nzValue="山西" nzLabel="山西"></nz-option>
<nz-option nzValue="北京" nzLabel="北京"></nz-option>
</nz-select>
</se>
</div>
<p *ngIf="origin?.dictList?.length === 0">此应用功能模块无数据权限限制,如需添加,请联系系统管理员。</p>
</nz-tab> </nz-tab>
</nz-tabset> </nz-tabset>
</div> </div>

View File

@ -18,6 +18,8 @@ export class SettingMenuComponent implements OnInit, OnChanges {
defaultExpandedKeys: any[] = []; defaultExpandedKeys: any[] = [];
defaultCheckedKeys: any[] = []; defaultCheckedKeys: any[] = [];
functionList: any[] = []; functionList: any[] = [];
allChecked = false;
indeterminate = true;
@Input() type = 'edit'; @Input() type = 'edit';
@Input() source = ''; @Input() source = '';
@Input() appId = this.envSrv.env.appId; @Input() appId = this.envSrv.env.appId;
@ -51,13 +53,14 @@ export class SettingMenuComponent implements OnInit, OnChanges {
// } // }
this.functionList = res; this.functionList = res;
this.defaultCheckedKeys = this.authorityAssistId; this.defaultCheckedKeys = this.authorityAssistId;
this.cdr.detectChanges();
}); });
} }
addAuthority(origin: { id: any; all: any }, node: { buttonInfoList: any[] }, item?: { checked: any; functionButtonId: any }) { addAuthority(origin: { id: any; all: any }, node: { buttonInfoList: any[] }, item?: { checked: any; functionButtonId: any }) {
if (this.authority.length && this.authority.filter(authItem => authItem.authorityId === origin.id).length) { if (this.authority?.length && this.authority.filter(authItem => authItem.authorityId === origin.id).length) {
// 判断此菜单权限是否已经存在权限列表中 // 判断此菜单权限是否已经存在权限列表中
// 当前操作菜单id存在权限列表里 // 当前操作菜单id存在权限列表里
this.authority.forEach((menuItem, menuIndex) => { this.authority.forEach(menuItem => {
if (menuItem.authorityId === origin.id) { if (menuItem.authorityId === origin.id) {
menuItem.buttonAuthorityIds = menuItem.buttonAuthorityIds || []; // 防止属性不存在,给属性指定数据类型 menuItem.buttonAuthorityIds = menuItem.buttonAuthorityIds || []; // 防止属性不存在,给属性指定数据类型
if (item) { if (item) {
@ -103,7 +106,7 @@ export class SettingMenuComponent implements OnInit, OnChanges {
// 全选 // 全选
buttonAuthorityIds.push(item.functionButtonId); buttonAuthorityIds.push(item.functionButtonId);
} else { } else {
node.buttonInfoList.forEach((nodeItem: { id: any; checked: boolean }) => { node.buttonInfoList.forEach((nodeItem: { id: any; checked: boolean; _isHalfChecked: boolean }) => {
if (origin.all) { if (origin.all) {
buttonAuthorityIds.push(nodeItem.id); buttonAuthorityIds.push(nodeItem.id);
nodeItem.checked = true; nodeItem.checked = true;
@ -112,13 +115,13 @@ export class SettingMenuComponent implements OnInit, OnChanges {
} }
const obj: any = { const obj: any = {
authorityId: origin.id, authorityId: origin.id,
buttonAuthorityIds, buttonAuthorityIds
dataAuthority: []
}; };
this.authority.push(obj); this.authority.push(obj);
} }
this.checkTreeNode(node, origin); this.checkTreeNode(node, origin);
} }
addDict(item: { checked: any; itemId: any; itemKey: any }, dictItem: { dictId: any }, origin: { id: any }, node: any) { addDict(item: { checked: any; itemId: any; itemKey: any }, dictItem: { dictId: any }, origin: { id: any }, node: any) {
if (this.authority.length) { if (this.authority.length) {
// 判断此菜单权限是否已经存在权限列表中 // 判断此菜单权限是否已经存在权限列表中
@ -271,7 +274,7 @@ export class SettingMenuComponent implements OnInit, OnChanges {
children.forEach((item: any) => { children.forEach((item: any) => {
this.authorityAssistId.push(item.key); this.authorityAssistId.push(item.key);
tempAuthorityIdDTOListMenu.push(item.key); tempAuthorityIdDTOListMenu.push(item.key);
authorityMenu.push({ authorityId: item.key }); authorityMenu.push({ authorityId: item.key, isUpdateAuthority: 1 });
if (item.isLeaf) { if (item.isLeaf) {
return; return;
} }
@ -282,6 +285,26 @@ export class SettingMenuComponent implements OnInit, OnChanges {
} }
initButtonList(id: any, origin: any) { initButtonList(id: any, origin: any) {
if (origin.expanded) {
origin.children.forEach((item: any, index: number) => {
if (item.selected) {
if (origin.checked) {
this.authority.splice(index, 1);
const buttonAuthorityIds: any = [];
item.buttonInfoList.forEach((btnItem: any) => {
btnItem.checked = true;
buttonAuthorityIds.push(btnItem.functionButtonId);
});
this.authority.push({ authorityId: origin.key, buttonAuthorityIds, isUpdateAuthority: 1 });
} else {
this.authority.splice(index, 1);
item.buttonInfoList.forEach((btnItem: any) => {
btnItem.checked = false;
});
}
}
});
}
const params = { const params = {
id id
}; };
@ -296,12 +319,22 @@ export class SettingMenuComponent implements OnInit, OnChanges {
} }
// 再次请求,需要判断暂存权限数组是否已有此权限 // 再次请求,需要判断暂存权限数组是否已有此权限
againGetBtn(id: any, origin: any) { againGetBtn(id: any, origin: any) {
if (this.authority.length === 0) { if (this.authority && this.authority.length === 0) {
return; const buttonAuthorityIds: any = [];
if (origin.checked) {
origin.buttonInfoList.forEach((btnItem: { functionButtonId: any; checked: boolean }) => {
btnItem.checked = true;
buttonAuthorityIds.push(btnItem.functionButtonId);
});
this.authority.push({ authorityId: origin.key, buttonAuthorityIds, isUpdateAuthority: 1 });
} }
} else {
if (origin.checked) {
//菜单勾选情况下
if (this.authority.some(item => item.authorityId === id)) {
this.authority.forEach(item => { this.authority.forEach(item => {
if (item.authorityId === id) { if (item.authorityId === id) {
// 如果当前菜单Id等于暂存权限数组的Id // 如果当前菜单Id存在权限列表里,并且等于暂存权限数组的Id
if (item.buttonAuthorityIds && item.buttonAuthorityIds.length) { if (item.buttonAuthorityIds && item.buttonAuthorityIds.length) {
// 如果当前菜单Id权限数组不为空 // 如果当前菜单Id权限数组不为空
origin.buttonInfoList.forEach((btnItem: { functionButtonId: any; checked: boolean }) => { origin.buttonInfoList.forEach((btnItem: { functionButtonId: any; checked: boolean }) => {
@ -315,6 +348,28 @@ export class SettingMenuComponent implements OnInit, OnChanges {
} }
} }
}); });
} else {
this.authority.push({ authorityId: origin.key, buttonAuthorityIds: [], isUpdateAuthority: 1 });
this.authority.forEach(item => {
origin.buttonInfoList.forEach((btnItem: { functionButtonId: any; checked: boolean }) => {
btnItem.checked = true;
item.buttonAuthorityIds.push(btnItem.functionButtonId);
});
});
}
} else {
// 菜单未勾选,要删除权限
this.authority.forEach((item, index) => {
if (item.authorityId === id) {
// 如果当前菜单Id存在权限列表里并且等于暂存权限数组的Id
this.authority.splice(index, 1);
origin.buttonInfoList.forEach((btnItem: { functionButtonId: any; checked: boolean }) => {
btnItem.checked = false;
});
}
});
}
}
} }
initDictList(id: any, origin: any) { initDictList(id: any, origin: any) {

Some files were not shown because too many files have changed in this diff Show More