diff --git a/package-lock.json b/package-lock.json index ddf3948b..50a51aea 100644 --- a/package-lock.json +++ b/package-lock.json @@ -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": { "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", @@ -8113,6 +8121,15 @@ "integrity": "sha1-e15vfmZen7QfMAB+2eDUHpf7IUA=", "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": { "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", @@ -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": { "version": "0.2.0", "resolved": "https://registry.npm.taobao.org/text-table/download/text-table-0.2.0.tgz", @@ -23211,6 +23236,21 @@ "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=", "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": { "version": "3.4.0", "resolved": "https://registry.npmmirror.com/uuid/download/uuid-3.4.0.tgz", diff --git a/package.json b/package.json index 1d6e533e..2740f7e3 100644 --- a/package.json +++ b/package.json @@ -56,6 +56,7 @@ "@swimlane/ngx-charts": "^18.0.1", "ajv": "^8.6.2", "file-saver": "^2.0.5", + "html2canvas": "^1.4.1", "js-base64": "^3.6.1", "masonry-layout": "^4.2.2", "ng-gallery": "^5.0.0", diff --git a/proxy.conf.js b/proxy.conf.js index 562ad00b..2e5e2a0e 100644 --- a/proxy.conf.js +++ b/proxy.conf.js @@ -4,7 +4,7 @@ * @Author : Shiming * @Date : 2022-01-18 09:51:21 * @LastEditors : Shiming - * @LastEditTime : 2022-02-25 17:52:10 + * @LastEditTime : 2022-03-02 15:55:18 * @FilePath : \\tms-obc-web\\proxy.conf.js * Copyright (C) 2022 huzhenhong. All rights reserved. */ diff --git a/src/app/core/startup/startup.service.ts b/src/app/core/startup/startup.service.ts index 9b95436e..4b746335 100644 --- a/src/app/core/startup/startup.service.ts +++ b/src/app/core/startup/startup.service.ts @@ -34,6 +34,7 @@ export class StartupService { private coreSrv: CoreService ) { iconSrv.addIcon(...ICONS_AUTO, ...ICONS); + this.settingService.setLayout('fixSiderbar', true); } // TODO: 退出登录时需要清理用户信息 @@ -95,7 +96,7 @@ export class StartupService { // ACL:设置权限为全量 this.aclService.setFull(false); // 初始化菜单 - if(menuData){ + if (menuData) { this.menuService.add(menuData); } // 设置页面标题的后缀 diff --git a/src/app/layout/pro/components/menu/menu.component.ts b/src/app/layout/pro/components/menu/menu.component.ts index b9ae4ff6..a478429f 100644 --- a/src/app/layout/pro/components/menu/menu.component.ts +++ b/src/app/layout/pro/components/menu/menu.component.ts @@ -51,8 +51,6 @@ export class LayoutProMenuComponent implements OnInit, OnDestroy { } }); this.menus = res; - console.log(res); - this.openStatus(); } diff --git a/src/app/routes/commom/less/box.less b/src/app/routes/commom/less/box.less index 77c5fe87..59f98100 100644 --- a/src/app/routes/commom/less/box.less +++ b/src/app/routes/commom/less/box.less @@ -31,4 +31,12 @@ font-size : 16px; } } +} + +.total-footer { + position : absolute; + bottom : 30px; + height : 32px; + margin : 16px 0; + line-height: 32px; } \ No newline at end of file diff --git a/src/app/routes/contract-management/components/contract-frame/contract-frame.component.ts b/src/app/routes/contract-management/components/contract-frame/contract-frame.component.ts index 626112ec..86bee964 100644 --- a/src/app/routes/contract-management/components/contract-frame/contract-frame.component.ts +++ b/src/app/routes/contract-management/components/contract-frame/contract-frame.component.ts @@ -78,19 +78,19 @@ export class ContractManagementFrameComponent implements OnInit { title: '签约对象', width: '100px', className: 'text-center', - index: 'signingObject' + index: 'signingObjectLabel' }, { title: '合同类型', width: '100px', className: 'text-center', - index: 'contractType' + index: 'contractTypeLabel' }, { title: '合同名称', width: '100px', className: 'text-center', - index: 'contractName' + index: 'templateName' }, { title: '网络货运人', index: 'enterpriseInfoName', width: '120px', className: 'text-center' }, { title: '合同对象', index: 'contractObjectName', width: '120px', className: 'text-center' }, diff --git a/src/app/routes/contract-management/components/contract-template-detail/contract-template-detail.component.ts b/src/app/routes/contract-management/components/contract-template-detail/contract-template-detail.component.ts index e94ae430..f74c02e8 100644 --- a/src/app/routes/contract-management/components/contract-template-detail/contract-template-detail.component.ts +++ b/src/app/routes/contract-management/components/contract-template-detail/contract-template-detail.component.ts @@ -1,10 +1,11 @@ +import { OnChanges } from '@angular/core'; /* - * @Description : + * @Description : * @Version : 1.0 * @Author : Shiming * @Date : 2022-01-05 11:01:55 * @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 * Copyright (C) 2022 huzhenhong. All rights reserved. */ @@ -29,7 +30,7 @@ export class ContractManagementTemplateTextComponent implements OnInit { public route: ActivatedRoute, private datePipe: DatePipe, private router: Router, - public shipperservice: ShipperBaseService, + public shipperservice: ShipperBaseService ) {} textStatus = '新建模板'; @ViewChild('sf', { static: false }) sf!: SFComponent; @@ -40,6 +41,7 @@ export class ContractManagementTemplateTextComponent implements OnInit { sfdata: any; sfdata2: any; title: any; + Types: any; templateHTML: any; detailList: any = { templateName: '' @@ -76,30 +78,57 @@ export class ContractManagementTemplateTextComponent implements OnInit { templateType: { title: '模板类型', type: 'string', - default: '', + enum: [ + { label: '框架合同', value: 'KJ' }, + { label: '明细合同', value: 'MX' }, + { label: '合伙人合同', value: 'HHR' } + ], ui: { - widget: 'dict-select', - params: { dictKey: 'contract:template:type' }, - containAllLable: true, - visibleIf: { - _$expand: (value: boolean) => value + widget: 'select', + placeholder: '请选择', + change: (tag: any, org: any) => { + console.log(tag); + 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', title: '承包商对象', enum: [ @@ -114,13 +143,11 @@ export class ContractManagementTemplateTextComponent implements OnInit { contractType: { title: '合同类型', type: 'string', - default: '', + enum: this.Types, ui: { - widget: 'dict-select', - containsAllLable: true, - params: { dictKey: 'contract:type' }, - containAllLable: true, - } as SFSelectWidgetSchema + widget: 'select', + placeholder: '请选择' + } }, resourceType: { title: '货源类型', @@ -133,7 +160,7 @@ export class ContractManagementTemplateTextComponent implements OnInit { visibleIf: { templateType: value => value === 'MX' } - } as SFSelectWidgetSchema, + } as SFSelectWidgetSchema }, enterpriseInfoId: { type: 'string', @@ -147,7 +174,7 @@ export class ContractManagementTemplateTextComponent implements OnInit { }, asyncData: () => this.shipperservice.getNetworkFreightForwarder() } - }, + } }, required: ['templateName', 'templateType'] }; @@ -178,11 +205,11 @@ export class ContractManagementTemplateTextComponent implements OnInit { } initData(url: string) { console.log('编辑'); - + this.service.request(url, { id: this.route.snapshot.params.id }).subscribe(res => { if (res) { this.detailList = res; - this.title = this.detailList?.templateName + this.title = this.detailList?.templateName; this.sfdata = res; this.sfdata2 = res; } @@ -208,7 +235,7 @@ export class ContractManagementTemplateTextComponent implements OnInit { ...this.sf2.value, templateTitle: this.title || this.detailList.templateName }; - console.log(params) + console.log(params); this.service.request(this.service.$api_save_contractTemplate, params).subscribe((res: any) => { if (res) { this.service.msgSrv.success('保存成功!'); diff --git a/src/app/routes/contract-management/components/contract-template-frame/contract-template-frame.component.ts b/src/app/routes/contract-management/components/contract-template-frame/contract-template-frame.component.ts index 9ab02d99..002c28e1 100644 --- a/src/app/routes/contract-management/components/contract-template-frame/contract-template-frame.component.ts +++ b/src/app/routes/contract-management/components/contract-template-frame/contract-template-frame.component.ts @@ -131,19 +131,19 @@ export class ContractManagementTemplateFrameComponent implements OnInit { title: '签约对象', width: '100px', className: 'text-center', - render: 'signingObject' + render: 'signingObjectLabel' }, { title: '合同类型', width: '100px', className: 'text-center', - index: 'contractType' + index: 'contractTypeLabel' }, { title: '货源类型', width: '100px', className: 'text-center', - index: 'resourceType' + index: 'resourceTypeLabel' }, { title: '创建人', index: 'createUserId', width: '120px', className: 'text-center' }, { diff --git a/src/app/routes/contract-management/components/contract-template-partner/contract-template-partner.component.ts b/src/app/routes/contract-management/components/contract-template-partner/contract-template-partner.component.ts index d457c780..257a5832 100644 --- a/src/app/routes/contract-management/components/contract-template-partner/contract-template-partner.component.ts +++ b/src/app/routes/contract-management/components/contract-template-partner/contract-template-partner.component.ts @@ -131,19 +131,19 @@ export class ContractManagementTemplatePartnerComponent implements OnInit { title: '签约对象', width: '100px', className: 'text-center', - index: 'signingObject' + index: 'signingObjectLabel' }, { title: '合同类型', width: '100px', className: 'text-center', - index: 'contractType' + index: 'contractTypeLabel' }, { title: '货源类型', width: '100px', className: 'text-center', - index: 'resourceType' + index: 'resourceTypeLabel' }, { title: '创建人', index: 'createUserId', width: '120px', className: 'text-center' }, { diff --git a/src/app/routes/contract-management/components/contract-template/contract-template.component.ts b/src/app/routes/contract-management/components/contract-template/contract-template.component.ts index 751e3787..e9649bd1 100644 --- a/src/app/routes/contract-management/components/contract-template/contract-template.component.ts +++ b/src/app/routes/contract-management/components/contract-template/contract-template.component.ts @@ -131,19 +131,19 @@ export class ContractManagementTemplateDetailComponent implements OnInit { title: '签约对象', width: '100px', className: 'text-center', - index: 'signingObject' + index: 'signingObjectLabel' }, { title: '合同类型', width: '100px', className: 'text-center', - index: 'contractType' + index: 'contractTypeLabel' }, { title: '货源类型', width: '100px', className: 'text-center', - index: 'resourceType' + index: 'resourceTypeLabel' }, { title: '创建人', index: 'createUserId', width: '120px', className: 'text-center' }, { diff --git a/src/app/routes/financial-management/components/advance-collection/advance-collection.component.ts b/src/app/routes/financial-management/components/advance-collection/advance-collection.component.ts index b946c075..7806bb1b 100644 --- a/src/app/routes/financial-management/components/advance-collection/advance-collection.component.ts +++ b/src/app/routes/financial-management/components/advance-collection/advance-collection.component.ts @@ -49,7 +49,7 @@ export class AdvanceCollectionComponent implements OnInit { } 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 { diff --git a/src/app/routes/financial-management/components/cost-management/cost-management-detail/cost-management-detail.component.html b/src/app/routes/financial-management/components/cost-management/cost-management-detail/cost-management-detail.component.html index 8b315a1f..f1b614cb 100644 --- a/src/app/routes/financial-management/components/cost-management/cost-management-detail/cost-management-detail.component.html +++ b/src/app/routes/financial-management/components/cost-management/cost-management-detail/cost-management-detail.component.html @@ -30,13 +30,13 @@ {{ costInfo?.armoeny | currency }} - {{ costInfo?.arkpmoney | currency }} + {{ costInfo?.armoeny | currency }} {{ costInfo?.armoeny | currency }} - + 基本信息(应付费用) {{ costInfo?.ltdName }} @@ -44,7 +44,7 @@ {{ costInfo?.feetypeLabel }} - {{ costInfo?.hrmoney}} + {{ costInfo?.hrmoney | currency}} {{ costInfo?.hrremarks }} @@ -103,8 +103,8 @@ - - {{ item.vatnotax | currency}} + + {{ item.armoney | currency}} {{ item.vatmoney | currency}} @@ -114,7 +114,7 @@ - + @@ -139,6 +139,9 @@ {{ index + 1 }} + + {{ item.phxmoney | currency}} + diff --git a/src/app/routes/financial-management/components/cost-management/cost-management-detail/cost-management-detail.component.ts b/src/app/routes/financial-management/components/cost-management/cost-management-detail/cost-management-detail.component.ts index d541718c..981f1776 100644 --- a/src/app/routes/financial-management/components/cost-management/cost-management-detail/cost-management-detail.component.ts +++ b/src/app/routes/financial-management/components/cost-management/cost-management-detail/cost-management-detail.component.ts @@ -54,10 +54,10 @@ export class CostManagementDetailComponent implements OnInit { { title: '费用科目', index: 'feeSubName', className: 'text-left', width: 200 }, { title: '税率', - index: 'hrvatrate', + index: 'arvatrate', className: 'text-right', 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: 'armoney', className: 'text-right', width: 200 }, @@ -67,9 +67,9 @@ export class CostManagementDetailComponent implements OnInit { { title: '序号', render: 'no', width: 70, className: 'text-left' }, { title: '费用明细号', index: 'feeLId', className: 'text-left', width: 200 }, { title: '发票申请', index: 'vatinvcode', className: 'text-left', width: 200 }, - { title: '发票类型', index: 'vatapptype', className: 'text-left', width: 200 }, - { title: '发票号', index: 'vatappcode', className: 'text-left', width: 200 }, - { title: '发票日期', index: 'vatappdate', className: 'text-left', width: 200 }, + { title: '发票类型', index: 'invoicetypeLabel', className: 'text-left', width: 200 }, + { title: '发票号', index: 'invoiceno', className: 'text-left', width: 200 }, + { title: '发票日期', index: 'invoicedate', className: 'text-left', width: 200 }, { title: '发票状态', index: 'stsLabel', className: 'text-left', width: 200 }, { title: '应收金额', render: 'armoney', 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: 'billTime' }, { title: '确认日期', index: 'feedate' }, - { title: '付款状态', index: 'callNo' }, - { title: '应付金额', index: 'callNo' }, - { title: '付款金额', index: 'phxmoney' } + // { title: '付款状态', index: 'callNo' }, + { title: '应付金额', render: 'phxmoney' }, + { title: '付款金额', render: 'phxmoney' } ] }; } diff --git a/src/app/routes/financial-management/components/cost-management/cost-management.component.ts b/src/app/routes/financial-management/components/cost-management/cost-management.component.ts index 541d0dbe..33bacf25 100644 --- a/src/app/routes/financial-management/components/cost-management/cost-management.component.ts +++ b/src/app/routes/financial-management/components/cost-management/cost-management.component.ts @@ -90,7 +90,7 @@ export class CostManagementComponent implements OnInit { } 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) { @@ -188,9 +188,10 @@ export class CostManagementComponent implements OnInit { searchLoadingText: '搜索中...', allowClear: true, onSearch: (q: any) => { - if (!!q) { + let str = q.replace(/^\s+|\s+$/g, ''); + if (str) { 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)))) .toPromise(); } else { @@ -212,9 +213,10 @@ export class CostManagementComponent implements OnInit { searchLoadingText: '搜索中...', allowClear: true, onSearch: (q: any) => { - if (!!q) { + let str = q.replace(/^\s+|\s+$/g, ''); + if (str) { 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)))) .toPromise(); } else { @@ -300,13 +302,13 @@ export class CostManagementComponent implements OnInit { { text: '浏览', 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: '审核', click: item => this.auditAction(item), iif: item => item.sts === 2, - acl: { ability: ['FINANCIAL-COST-audit'] }, + acl: { ability: ['FINANCIAL-COST-audit'] } } // { // text: '修改', diff --git a/src/app/routes/financial-management/components/driver-account/driver-account-detail/driver-account-detail.component.html b/src/app/routes/financial-management/components/driver-account/driver-account-detail/driver-account-detail.component.html index 8c870a65..bb282f97 100644 --- a/src/app/routes/financial-management/components/driver-account/driver-account-detail/driver-account-detail.component.html +++ b/src/app/routes/financial-management/components/driver-account/driver-account-detail/driver-account-detail.component.html @@ -15,17 +15,17 @@ - - - diff --git a/src/app/routes/financial-management/components/driver-account/driver-account-detail/driver-account-detail.component.ts b/src/app/routes/financial-management/components/driver-account/driver-account-detail/driver-account-detail.component.ts index 4f230b3a..0a384b6c 100644 --- a/src/app/routes/financial-management/components/driver-account/driver-account-detail/driver-account-detail.component.ts +++ b/src/app/routes/financial-management/components/driver-account/driver-account-detail/driver-account-detail.component.ts @@ -74,7 +74,7 @@ export class DriverAccountDetailComponent implements OnInit { stChange(e: STChange): void {} 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() { diff --git a/src/app/routes/financial-management/components/driver-account/driver-account.component.ts b/src/app/routes/financial-management/components/driver-account/driver-account.component.ts index 536e154f..6ab9883f 100644 --- a/src/app/routes/financial-management/components/driver-account/driver-account.component.ts +++ b/src/app/routes/financial-management/components/driver-account/driver-account.component.ts @@ -74,7 +74,7 @@ export class DriverAccountComponent implements OnInit { } 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 { diff --git a/src/app/routes/financial-management/components/freight-account/freight-account-detail/freight-account-detail.component.html b/src/app/routes/financial-management/components/freight-account/freight-account-detail/freight-account-detail.component.html index 1e0e0cbc..9b55d1a7 100644 --- a/src/app/routes/financial-management/components/freight-account/freight-account-detail/freight-account-detail.component.html +++ b/src/app/routes/financial-management/components/freight-account/freight-account-detail/freight-account-detail.component.html @@ -31,7 +31,7 @@ - +
+ \ No newline at end of file diff --git a/src/app/routes/financial-management/components/freight-account/freight-account-detail/freight-account-detail.component.ts b/src/app/routes/financial-management/components/freight-account/freight-account-detail/freight-account-detail.component.ts index e2f04c50..d3d962dc 100644 --- a/src/app/routes/financial-management/components/freight-account/freight-account-detail/freight-account-detail.component.ts +++ b/src/app/routes/financial-management/components/freight-account/freight-account-detail/freight-account-detail.component.ts @@ -20,7 +20,7 @@ export class FreightAccountDetailComponent implements OnInit { info: any = {}; params: any = {}; - + static: any = {}; _$expand = false; constructor(public service: FreightAccountService, private nzModalService: NzModalService, private route: ActivatedRoute) { this.params = route.snapshot.queryParams; @@ -46,6 +46,7 @@ export class FreightAccountDetailComponent implements OnInit { } }); } + this.loadStatistics(requestOptions.body); 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 {} 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() { @@ -186,12 +195,15 @@ export class FreightAccountDetailComponent implements OnInit { private initST(): STColumn[] { return [ - { title: '交易时间', index: 'createTime', type: 'date' }, - { title: '流水号', index: 'transactionNumber' }, - { title: '交易类型', index: 'tradeTypeLabel', className: 'text-center' }, - { title: '关联单号', index: 'businessNumber' }, - { title: '所属项目', index: 'projectId' }, - { title: '收支类型', index: 'incomeTypeLabel', className: 'text-center' }, + { title: '交易时间', index: 'createTime', type: 'date', width: 170 }, + { title: '流水号', index: 'transactionNumber', width: 170 }, + { title: '交易类型', index: 'tradeTypeLabel', className: 'text-center', width: 140 }, + { title: '交易单号', index: 'businessNumber', width: 170 }, + { title: '订单号', index: 'orderSn', width: 170 }, + { title: '运单号', index: 'transportSn', width: 170 }, + { title: '货主', index: 'enterpriseName' , width: 170}, + { title: '所属项目', index: 'projectName' , width: 170}, + { title: '收支类型', index: 'incomeTypeLabel', className: 'text-center', width: 140 }, { title: '交易金额', index: 'amount', @@ -207,7 +219,10 @@ export class FreightAccountDetailComponent implements OnInit { type: 'widget', className: 'text-right', widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.accountBalance }) } - } + }, + { title: '付款方', index: 'payName' , width: 170}, + { title: '收款方', index: 'payeeName', width: 170 }, + { title: '备注', index: 'tradeContent', width: 170 } ]; } } diff --git a/src/app/routes/financial-management/components/freight-account/freight-account.component.ts b/src/app/routes/financial-management/components/freight-account/freight-account.component.ts index c86bbeb3..2309923a 100644 --- a/src/app/routes/financial-management/components/freight-account/freight-account.component.ts +++ b/src/app/routes/financial-management/components/freight-account/freight-account.component.ts @@ -80,7 +80,7 @@ export class FreightAccountComponent implements OnInit { } 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 { @@ -167,11 +167,11 @@ export class FreightAccountComponent implements OnInit { private initST(): STColumn[] { return [ - { title: '企业名称', width: 140, index: 'tenantName' }, + { title: '企业名称', width: 170, index: 'tenantName' }, { title: '联系人', width: 120, index: 'name' }, { title: '联系人电话', width: 140, index: 'phone' }, - { title: '网络货运人', width: 140, index: 'ltdName' }, - { title: '银行类型',width: 120, index: 'bankTypeLabel' }, + { title: '网络货运人', width: 170, index: 'ltdName' }, + { title: '银行类型', width: 120, index: 'bankTypeLabel' }, { title: '虚拟账户', width: 140, index: 'virtualAccount' }, { title: '可用余额', @@ -199,7 +199,7 @@ export class FreightAccountComponent implements OnInit { { title: '状态', index: 'stateDeletedLabel', - width: 80, + width: 80 }, { title: '操作', diff --git a/src/app/routes/financial-management/components/payment-order/payment-order-detail/payment-order-detail.component.html b/src/app/routes/financial-management/components/payment-order/payment-order-detail/payment-order-detail.component.html index deda8303..0b385a1e 100644 --- a/src/app/routes/financial-management/components/payment-order/payment-order-detail/payment-order-detail.component.html +++ b/src/app/routes/financial-management/components/payment-order/payment-order-detail/payment-order-detail.component.html @@ -29,7 +29,7 @@ {{headerInfo?.ltdAccountId}} - {{headerInfo?.payMoney}} + {{headerInfo?.payMoney | currency}}
@@ -37,7 +37,7 @@ {{headerInfo?.payDate}} - {{headerInfo?.ltdaccountId}} + {{headerInfo?.hrBankName}} - {{headerInfo?.hrBankNo}} {{headerInfo?.payDate}} @@ -51,7 +51,7 @@ {{headerInfo?.payModeLabel}} - {{headerInfo?.payType}} + {{headerInfo?.payTypeLabel}} {{headerInfo?.payMoney |currency}} diff --git a/src/app/routes/financial-management/components/payment-record/payment-record.component.html b/src/app/routes/financial-management/components/payment-record/payment-record.component.html index f8e57409..38aa1e2f 100644 --- a/src/app/routes/financial-management/components/payment-record/payment-record.component.html +++ b/src/app/routes/financial-management/components/payment-record/payment-record.component.html @@ -36,9 +36,9 @@ {{ item.orderPaymentCode }}
{{ item.paymentStatusLabel }} - 预付:¥{{ item.price }}
+ 预付:{{ item.price | currency }}
- 附加费:¥ {{ item.surcharge }} + 附加费: {{ item.surcharge| currency }}
diff --git a/src/app/routes/financial-management/components/payment-record/payment-record.component.ts b/src/app/routes/financial-management/components/payment-record/payment-record.component.ts index 500b02e0..a6383c75 100644 --- a/src/app/routes/financial-management/components/payment-record/payment-record.component.ts +++ b/src/app/routes/financial-management/components/payment-record/payment-record.component.ts @@ -242,7 +242,7 @@ export class PaymentRecordComponent implements OnInit { { title: '支付金额', render: 'payAmount', - width: 120, + width: 140, type: 'widget', className: 'text-right', widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.payAmount }) } @@ -256,7 +256,7 @@ export class PaymentRecordComponent implements OnInit { (item.amountDetails as Array).forEach(detail => { surcharge += detail.surcharge || 0; }); - item.surcharge = surcharge; + item.surcharge = surcharge.toFixed(2); item.price = item.amountDetails?.[0]?.price || 0; return ''; } diff --git a/src/app/routes/financial-management/components/platform-account/platform-account-detail/platform-account-detail.component.ts b/src/app/routes/financial-management/components/platform-account/platform-account-detail/platform-account-detail.component.ts index a10b0c5e..f8d865dd 100644 --- a/src/app/routes/financial-management/components/platform-account/platform-account-detail/platform-account-detail.component.ts +++ b/src/app/routes/financial-management/components/platform-account/platform-account-detail/platform-account-detail.component.ts @@ -65,7 +65,7 @@ export class PlatformAccountDetailComponent implements OnInit { stChange(e: STChange): void {} 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() { diff --git a/src/app/routes/financial-management/components/platform-account/platform-account.component.html b/src/app/routes/financial-management/components/platform-account/platform-account.component.html index c6357c07..0cda0ad8 100644 --- a/src/app/routes/financial-management/components/platform-account/platform-account.component.html +++ b/src/app/routes/financial-management/components/platform-account/platform-account.component.html @@ -52,7 +52,13 @@ - + + + \ No newline at end of file diff --git a/src/app/routes/financial-management/components/platform-account/platform-account.component.ts b/src/app/routes/financial-management/components/platform-account/platform-account.component.ts index 0a976ab6..d8c09e0d 100644 --- a/src/app/routes/financial-management/components/platform-account/platform-account.component.ts +++ b/src/app/routes/financial-management/components/platform-account/platform-account.component.ts @@ -19,6 +19,8 @@ export class PlatformAccountComponent implements OnInit { columns: STColumn[] = this.initST(); info: any = {}; + + static: any = {}; constructor(public service: FreightAccountService, private router: Router, private nzModalService: NzModalService) {} ngOnInit(): void { @@ -29,6 +31,7 @@ export class PlatformAccountComponent implements OnInit { if (this.sf) { Object.assign(requestOptions.body, { ...this.sf.value }); } + this.loadStatistics(requestOptions.body); 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; + } + }); + } + /** * 重置表单 */ diff --git a/src/app/routes/financial-management/components/receivable-order/receivable-order-detail/receivable-order-detail.component.ts b/src/app/routes/financial-management/components/receivable-order/receivable-order-detail/receivable-order-detail.component.ts index d33f8709..d630043c 100644 --- a/src/app/routes/financial-management/components/receivable-order/receivable-order-detail/receivable-order-detail.component.ts +++ b/src/app/routes/financial-management/components/receivable-order/receivable-order-detail/receivable-order-detail.component.ts @@ -42,16 +42,16 @@ export class ReceivableOrderDetailComponent implements OnInit { } beforeReq = (requestOptions: STRequestOptions) => { - Object.assign(requestOptions.body, { billHId: this.billHId }); + Object.assign(requestOptions.body, { ahxHId: this.id }); if (this.sf) { Object.assign(requestOptions.body, { - ...this.sf.value, + ...this.sf.value }); if (this.sf.value.feedate?.[0]) { Object.assign(requestOptions.body, { feedate: { - start: this.sf.value.feedate?.[0] || '', - end: this.sf.value.feedate?.[1] || '' + start: this.sf.value.feedate?.[0] || '', + end: this.sf.value.feedate?.[1] || '' } }); } @@ -108,7 +108,7 @@ export class ReceivableOrderDetailComponent implements OnInit { widget: 'select', placeholder: '请选择', allowClear: true, - asyncData: () => this.service.getCloseAccount(), + asyncData: () => this.service.getCloseAccount() }, default: '' }, @@ -122,7 +122,7 @@ export class ReceivableOrderDetailComponent implements OnInit { expand: (value: boolean) => value } } as SFDateWidgetSchema - }, + } // billTime: { // title: '订单日期', // type: 'string', @@ -146,8 +146,8 @@ export class ReceivableOrderDetailComponent implements OnInit { { title: '订单号', index: 'billHCode', width: 100 }, // { title: '订单日期', index: 'billTime', width: 150 }, // { title: '费用类型', index: 'cnoName', width: 90 }, - // { title: '订单费用科目', index: 'feeSubId', width: 100 }, - { title: '费用科目', index: 'feeSubId', width: 140 }, + { title: '订单费用科目', index: 'billLTypeLabel', width: 100 }, + { title: '费用科目', index: 'feeSubName', width: 140 }, { title: '结算客户', index: 'cnoName', width: 100 }, { title: '已收金额', diff --git a/src/app/routes/financial-management/components/recharge-record/recharge-record.component.ts b/src/app/routes/financial-management/components/recharge-record/recharge-record.component.ts index 576b5555..68d41919 100644 --- a/src/app/routes/financial-management/components/recharge-record/recharge-record.component.ts +++ b/src/app/routes/financial-management/components/recharge-record/recharge-record.component.ts @@ -49,7 +49,7 @@ export class RechargeRecordComponent implements OnInit { } 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 { @@ -162,9 +162,16 @@ export class RechargeRecordComponent implements OnInit { { title: '网络货运人', index: 'ltdName', width: 160 }, { title: '银行类型', index: 'bankTypeLabel', width: 100 }, { title: '账户类型', index: 'accountTypeLabel', width: 100 }, - { title: '账户名称', index: 'rechargeName', width: 140 }, + { title: '账户名称', index: 'rechargeName', width: 160 }, { 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: '充值方式', index: 'payChannelLabel', width: 100 }, { title: '充值状态', index: 'rechargeStatusLabel', width: 100 }, diff --git a/src/app/routes/financial-management/components/refund-record/refund-record.component.html b/src/app/routes/financial-management/components/refund-record/refund-record.component.html index 975f2433..a611a196 100644 --- a/src/app/routes/financial-management/components/refund-record/refund-record.component.html +++ b/src/app/routes/financial-management/components/refund-record/refund-record.component.html @@ -25,8 +25,8 @@ - - + + diff --git a/src/app/routes/financial-management/components/refund-record/refund-record.component.ts b/src/app/routes/financial-management/components/refund-record/refund-record.component.ts index 93ea2547..90ed9617 100644 --- a/src/app/routes/financial-management/components/refund-record/refund-record.component.ts +++ b/src/app/routes/financial-management/components/refund-record/refund-record.component.ts @@ -24,18 +24,20 @@ export class RefundRecordComponent implements OnInit { refundStatus: any = ''; msg = ''; + constructor(public service: FreightAccountService, private nzModalService: NzModalService, private router: Router) {} - ngOnInit(): void {} + ngOnInit(): void { + } beforeReq = (requestOptions: STRequestOptions) => { Object.assign(requestOptions.body, { refundStatus: this.refundStatus || null }); if (this.sf) { Object.assign(requestOptions.body, { ...this.sf.value, - createTime: { - start: this.sf.value.createTime?.[0] || '', - end: this.sf.value.createTime?.[1] || '' + refundExecuteTime: { + start: this.sf.value.refundExecuteTime?.[0] || '', + end: this.sf.value.refundExecuteTime?.[1] || '' } }); } @@ -58,7 +60,7 @@ export class RefundRecordComponent implements OnInit { type: 'default', onClick: () => { if (!this.msg) { - this.service.msgSrv.warning('请填写原因') + this.service.msgSrv.warning('请填写原因'); return false; } this.service @@ -250,10 +252,10 @@ export class RefundRecordComponent implements OnInit { private initST(): STColumn[] { return [ { title: '退款单号', render: 'orderRefundCode', width: 190 }, - { title: '退款类型', index: 'refundTypeLabel', width: 130 }, - { title: '退款金额', render: 'refundAmount', className: 'text-right', width: 160 }, - { title: '退款时间', index: 'applyTime', width: 170 }, - { title: '货主', index: 'shipperId', width: 150 }, + { title: '退款类型', index: 'refundTypeLabel', width: 140 }, + { title: '退款金额', render: 'refundAmount', className: 'text-right', width: 180 }, + { title: '退款时间', index: 'refundExecuteTime', width: 170 }, + { title: '企业名称', index: 'enterpriseInfoName', width: 150 }, { title: '所属项目', index: 'enterpriseProjectName', width: 140 }, { title: '支付单', render: 'billRefundPaymentVOS', width: 150 }, { title: '订单号', index: 'billCode', width: 150 }, diff --git a/src/app/routes/financial-management/components/voucher-management/voucher-detail/voucher-detail.component.html b/src/app/routes/financial-management/components/voucher-management/voucher-detail/voucher-detail.component.html index feb71a74..bdf26c72 100644 --- a/src/app/routes/financial-management/components/voucher-management/voucher-detail/voucher-detail.component.html +++ b/src/app/routes/financial-management/components/voucher-management/voucher-detail/voucher-detail.component.html @@ -22,7 +22,7 @@ - {{info?.ltdId}} + {{info?.vcltdcode}} - {{info?.vcltdname}} {{info?.vctype}} diff --git a/src/app/routes/financial-management/components/voucher-management/voucher-management.component.ts b/src/app/routes/financial-management/components/voucher-management/voucher-management.component.ts index 9923c87f..f6a790ad 100644 --- a/src/app/routes/financial-management/components/voucher-management/voucher-management.component.ts +++ b/src/app/routes/financial-management/components/voucher-management/voucher-management.component.ts @@ -13,9 +13,7 @@ import { Component, OnInit, ViewChild } from '@angular/core'; import { Router } from '@angular/router'; import { STComponent, STColumn, STRequestOptions, STChange } from '@delon/abc/st'; import { SFComponent, SFSchema, SFDateWidgetSchema } from '@delon/form'; -import { ShipperBaseService } from '@shared'; 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'; @Component({ @@ -294,7 +292,7 @@ export class VoucherManagementComponent implements OnInit { return [ { title: '', index: 'key', type: 'checkbox', width: 60, className: 'text-center', fixed: 'left' }, { 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: 'vctype', width: 200 }, { title: '序号', index: 'invmoney', width: 200, format: _ => '1' }, diff --git a/src/app/routes/financial-management/components/withdrawals-record/withdrawals-detail/withdrawals-detail.component.html b/src/app/routes/financial-management/components/withdrawals-record/withdrawals-detail/withdrawals-detail.component.html index 27916f8e..f9b29185 100644 --- a/src/app/routes/financial-management/components/withdrawals-record/withdrawals-detail/withdrawals-detail.component.html +++ b/src/app/routes/financial-management/components/withdrawals-record/withdrawals-detail/withdrawals-detail.component.html @@ -47,7 +47,7 @@ {{formData?.bankSerialNumber}} - {{formData?.bankId}} + {{formData?.bankCardNumber}} {{formData?.refundStatus==='3'?'下载回单':'暂无回单'}} diff --git a/src/app/routes/financial-management/services/freight-account.service.ts b/src/app/routes/financial-management/services/freight-account.service.ts index 428616c8..8003fe98 100644 --- a/src/app/routes/financial-management/services/freight-account.service.ts +++ b/src/app/routes/financial-management/services/freight-account.service.ts @@ -25,6 +25,8 @@ export class FreightAccountService extends ShipperBaseService { // 运营端获取平台余额 $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_detail_page = '/api/fcc/accountBalanceDetail/getAccountBalanceByPage'; diff --git a/src/app/routes/insurance-management/components/list/list.component.html b/src/app/routes/insurance-management/components/list/list.component.html index e4dbec7f..a4559f83 100644 --- a/src/app/routes/insurance-management/components/list/list.component.html +++ b/src/app/routes/insurance-management/components/list/list.component.html @@ -4,7 +4,7 @@ * @Author : Shiming * @Date : 2022-01-12 10:52:50 * @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 * Copyright (C) 2022 huzhenhong. All rights reserved. --> @@ -91,6 +91,11 @@
{{ item?.billCode }}
+
+ +
+ {{ item?.resourceCode }} +
{{ item?.resourceStatusLabel }}
diff --git a/src/app/routes/insurance-management/components/list/list.component.ts b/src/app/routes/insurance-management/components/list/list.component.ts index 6a51122c..4cecaf0d 100644 --- a/src/app/routes/insurance-management/components/list/list.component.ts +++ b/src/app/routes/insurance-management/components/list/list.component.ts @@ -213,9 +213,10 @@ export class insuranceManagementListComponent implements OnInit { _$expand: (value: boolean) => value }, onSearch: (q: any) => { - if (!!q) { + let str =q.replace(/^\s+|\s+$/g,""); + if (str) { 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)))) .toPromise(); } else { @@ -412,7 +413,7 @@ export class insuranceManagementListComponent implements OnInit { { title: '货源编号', className: 'text-right', - index: 'resourceCode', + render: 'resourceCode', width: '150px' }, { @@ -480,6 +481,7 @@ export class insuranceManagementListComponent implements OnInit { { text: '查看保单', click: _record => this.showImg(_record), + iif: item => item.insureStatus == '2' // acl: { ability: ['VEHICLE-LIST-view'] }, // iif: item => // 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: '退保费', click: _record => this.retreatPrice(_record), + iif: item => item.insureStatus == '2' // acl: { ability: ['VEHICLE-LIST-view'] }, } ] @@ -531,7 +534,7 @@ export class insuranceManagementListComponent implements OnInit { nzContent: '退还后不可撤销,请谨慎操作!', nzCancelText: '取消', 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) { this.service.msgSrv.success('删除菜单成功'); } diff --git a/src/app/routes/insurance-management/services/insurance-management.service.ts b/src/app/routes/insurance-management/services/insurance-management.service.ts index deaea9a6..4dece0b2 100644 --- a/src/app/routes/insurance-management/services/insurance-management.service.ts +++ b/src/app/routes/insurance-management/services/insurance-management.service.ts @@ -4,7 +4,7 @@ * @Author : Shiming * @Date : 2021-12-03 15:31:52 * @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 * 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_addINPBillRefundApplication = `/billRefundApplication/addINPBillRefundApplication`; constructor(public injector: Injector, public eaCacheSrv: EACacheService) { super(injector, eaCacheSrv); diff --git a/src/app/routes/order-management/components/bulk-detail-change/bulk-detail-change.component.html b/src/app/routes/order-management/components/bulk-detail-change/bulk-detail-change.component.html index 1ed70615..b7d92a6a 100644 --- a/src/app/routes/order-management/components/bulk-detail-change/bulk-detail-change.component.html +++ b/src/app/routes/order-management/components/bulk-detail-change/bulk-detail-change.component.html @@ -4,7 +4,7 @@ * @Author : Shiming * @Date : 2021-12-24 16:58:02 * @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 * Copyright (C) 2022 huzhenhong. All rights reserved. --> @@ -89,6 +89,7 @@ (click)="openMap('start', idx)" formControlName="loadAddress{{ idx }}" placeholder="请输入装货地" + readonly="true" />
@@ -141,6 +142,7 @@ formControlName="unloadAddress{{ idx }}" placeholder="请输入卸货地" name="unloadAddress{{ idx }}" + readonly="true" />
diff --git a/src/app/routes/order-management/components/bulk-detail/bulk-detail.component.html b/src/app/routes/order-management/components/bulk-detail/bulk-detail.component.html index 041f49e8..3fa12800 100644 --- a/src/app/routes/order-management/components/bulk-detail/bulk-detail.component.html +++ b/src/app/routes/order-management/components/bulk-detail/bulk-detail.component.html @@ -4,7 +4,7 @@ * @Author : Shiming * @Date : 2021-12-06 20:20:26 * @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 * Copyright (C) 2022 huzhenhong. All rights reserved. --> @@ -62,17 +62,13 @@
  -   -   - -   + > +
@@ -95,8 +91,8 @@ {{ i?.unloadPlanTime }} {{ i?.acceptWeight }}吨,{{ i?.acceptVolume }}方,{{ i?.acceptNumber }}件 - {{ i?.acceptWeight }}吨,{{ i?.acceptVolume }}方,{{ i?.acceptNumber }}件 - {{ i?.settlementWeight }}吨,{{ i?.settlementVolume }}方,{{ i?.acceptNumber }}件 + {{ i?.acceptWeight }}吨,{{ i?.acceptVolume }}方,{{ i?.acceptNumber }}件 + {{ i?.settlementWeight }}吨,{{ i?.settlementVolume }}方,{{ i?.acceptNumber }}件

{{i?.goodsInfoList?.[0]?.freightPrice}}{{i?.goodsInfoList?.[0]?.freightTypeLabel}}(以发货为准,保留小数)

- + + 到付 {{ item.price | currency }} @@ -205,11 +202,11 @@
- - + +
- +
diff --git a/src/app/routes/order-management/components/bulk-detail/bulk-detail.component.ts b/src/app/routes/order-management/components/bulk-detail/bulk-detail.component.ts index 01e93833..69355b52 100644 --- a/src/app/routes/order-management/components/bulk-detail/bulk-detail.component.ts +++ b/src/app/routes/order-management/components/bulk-detail/bulk-detail.component.ts @@ -4,7 +4,7 @@ * @Author : Shiming * @Date : 2021-12-06 20:20:26 * @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 * Copyright (C) 2022 huzhenhong. All rights reserved. */ @@ -25,18 +25,19 @@ import format from 'date-fns/format'; styleUrls: ['./bulk-detail.component.less'] }) export class OrderManagementBulkeDetailComponent implements OnInit { - MapList: any; + MapList: any[]=[]; id = this.route.snapshot.params.id; + billExpenses: any[] = []; //运费信息表格信息 i: any; imges: any; totalObj: any; attObj: any; isVisible = false; logColumns: STColumn[] = [ - { title: '款项', index: 'expenseName' }, + { title: '款项', index: 'costName', render: 'PriceType' }, { title: '运输费(元)', render: 'price' }, { title: '附加费(元)', render: 'surcharge' }, - { title: '支付时间', index: ' paymentTime' }, + { title: '支付时间', index: 'paymentTime' }, { title: '支付状态', className: 'text-center', @@ -70,8 +71,10 @@ export class OrderManagementBulkeDetailComponent implements OnInit { this.service.request(this.service.$api_getBulkBillDetail, { id: this.id }).subscribe(res => { if (res) { this.i = res; - this.attObj = this.i?.billExpenseDetails?.filter((data: any) => data.expenseCode === 'ATT')[0]; - this.totalObj = this.i?.billExpenseDetails?.filter((data: any) => data.expenseCode === 'TOTAL')[0]; + console.log(this.i.billExpenseDetails ) + 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 => { if (res) { const points = res.trackArray; + let list :any[] = []; points?.forEach((item: any) => { - this.MapList.push({ + 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; - if (this.addressItems && this.addressItems.length > 0) { + if(this.addressItems && this.addressItems.length > 0){ this.addressItems.forEach(item => { - item.parkBte = this.getLocalTime(item.parkBte); - item.parkEte = this.getLocalTime(item.parkEte); + item.vinOutTime = this.getLocalTime(item.vinOutTime); }); } } diff --git a/src/app/routes/order-management/components/bulk/bulk.component.html b/src/app/routes/order-management/components/bulk/bulk.component.html index 74101efc..f8f92131 100644 --- a/src/app/routes/order-management/components/bulk/bulk.component.html +++ b/src/app/routes/order-management/components/bulk/bulk.component.html @@ -4,7 +4,7 @@ * @Author : Shiming * @Date : 2022-01-12 10:52:50 * @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 * Copyright (C) 2022 huzhenhong. All rights reserved. --> @@ -32,11 +32,11 @@

- - - + + - - + + +
+ +
{{ item?.createUserName }}/{{ item?.createUserPhone }}
+

diff --git a/src/app/routes/order-management/components/vehicle/vehicle.component.ts b/src/app/routes/order-management/components/vehicle/vehicle.component.ts index 5acae83a..69ef767a 100644 --- a/src/app/routes/order-management/components/vehicle/vehicle.component.ts +++ b/src/app/routes/order-management/components/vehicle/vehicle.component.ts @@ -1,6 +1,6 @@ import { Component, OnInit, ViewChild } from '@angular/core'; 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 { ShipperBaseService } from '@shared'; 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 { VehicleModifyRateComponent } from '../../modal/vehicle/modify-rate/modify-rate.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'; @@ -27,6 +28,7 @@ export class OrderManagementVehicleComponent implements OnInit { isVisibleView = false; isVisibleEvaluate = false; isVisible = false; + loading: boolean = true; changeId: any; // 主页面查看运费变更记录id - 用于运费变更记录 changeViewId: any; // 查看运费变更记录id - 用于查看 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() { return this.st?.list.filter((item) => item.checked) || []; } @@ -178,9 +207,10 @@ resourceStatus: any; searchLoadingText: '搜索中...', allowClear: true, onSearch: (q: any) => { - if (!!q) { + let str =q.replace(/^\s+|\s+$/g,""); + if (str) { 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)))) .toPromise(); } else { @@ -360,6 +390,7 @@ resourceStatus: any; className: 'text-right', render: 'mybidDetailInfo', }, + { title: '录单员', render: 'createUserName', width: '200px', className: 'text-left' }, { title: '网络货运人', index: 'enterpriseInfoName', width: '250px', className: 'text-left' }, { title: '货主', index: 'shipperAppUserName', width: '250px', className: 'text-left' }, { title: '关联运单号', index: 'wayBillCode', width: '170px', className: 'text-left' }, @@ -458,8 +489,8 @@ resourceStatus: any; }, { text: '查看轨迹 ', - click: (_record) => this.cancellation(_record), - iif: item => item.billStatus == '4' || item.billStatus == '5' || item.billStatus == '2' || item.billStatus == '3', + click: (_record) => this.viewTrack(_record), + iif: item => item.billStatus !== '1' && item.billStatus !== '6', // 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) { + } + }); + } } diff --git a/src/app/routes/order-management/modal/bulk/confir-receipt/confir-receipt.component.html b/src/app/routes/order-management/modal/bulk/confir-receipt/confir-receipt.component.html index 3b22ef68..b1289919 100644 --- a/src/app/routes/order-management/modal/bulk/confir-receipt/confir-receipt.component.html +++ b/src/app/routes/order-management/modal/bulk/confir-receipt/confir-receipt.component.html @@ -4,7 +4,7 @@ * @Author : Shiming * @Date : 2021-12-14 15:02:52 * @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 * Copyright (C) 2022 huzhenhong. All rights reserved. --> @@ -18,7 +18,7 @@ nzMessage="签收后不可再修改运费,请确保运费等信息准确无误 - {{detailList?.goodsInfoVO?.freightPrice}} {{detailList?.goodsInfoVO?.freightType}} + {{detailList?.goodsInfoVO?.freightPrice}} {{detailList?.goodsInfoVO?.freightTypeLabel}} @@ -37,7 +37,7 @@ nzMessage="签收后不可再修改运费,请确保运费等信息准确无误

{{detailList?.goodsInfoVO?.weight}}吨
-
{{detailList?.goodsInfoVO?.volume}}吨
+
{{detailList?.goodsInfoVO?.volume}}方
@@ -50,7 +50,7 @@ nzMessage="签收后不可再修改运费,请确保运费等信息准确无误 -
{{detailList?.price}} 元
+
{{detailList?.price | currency}} 元
{{detailList?.driverName}} / {{detailList?.driverPhone}}/ {{detailList?.carNo}}
@@ -69,7 +69,7 @@ nzMessage="签收后不可再修改运费,请确保运费等信息准确无误 [nzPreview]="handlePreview1" [nzBeforeUpload]="beforeUpload" (nzChange)="handleChange1($event)" - >beforeUpload + >
请上传图片
diff --git a/src/app/routes/order-management/modal/bulk/update-freight/update-freight.component.html b/src/app/routes/order-management/modal/bulk/update-freight/update-freight.component.html index 425e1621..b6803fd0 100644 --- a/src/app/routes/order-management/modal/bulk/update-freight/update-freight.component.html +++ b/src/app/routes/order-management/modal/bulk/update-freight/update-freight.component.html @@ -4,7 +4,7 @@ * @Author : Shiming * @Date : 2021-12-14 14:03:07 * @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 * Copyright (C) 2022 huzhenhong. All rights reserved. --> @@ -19,6 +19,7 @@ [ngModel]="i.value" (ngModelChange)="i.setValue($event)" placeholder="请输入" + (change)="changeNumVal()" oninput="if(value>99999)value=99999;if(value<0)value=0" /> diff --git a/src/app/routes/order-management/modal/bulk/update-freight/update-freight.component.ts b/src/app/routes/order-management/modal/bulk/update-freight/update-freight.component.ts index 8c89214c..9ee9df5e 100644 --- a/src/app/routes/order-management/modal/bulk/update-freight/update-freight.component.ts +++ b/src/app/routes/order-management/modal/bulk/update-freight/update-freight.component.ts @@ -4,7 +4,7 @@ * @Author : Shiming * @Date : 2021-12-14 14:03:07 * @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 * Copyright (C) 2022 huzhenhong. All rights reserved. */ @@ -50,7 +50,6 @@ export class UpdateFreightComponent implements OnInit { placeholder: '请输入', widget: 'custom', grid: { span: 12 }, - change: (val: any) => this.changeNumVal() } as SFStringWidgetSchema, default: data.freightPrice }, @@ -181,18 +180,19 @@ export class UpdateFreightComponent implements OnInit { } changeNumVal() { + console.log('444') if (this.calculateSub) { this.calculateSub.unsubscribe(); } const params = { billId: this.data.billId, changeCause: this.sf.value.changeCause, dto: {...this.sf.value} } this.calculateSub = this.service .request(this.service.$api_calculate_cost, params) - .subscribe((res: any) => { + .subscribe(res => { if (res) { Object.assign(this.data, { + totalAmount: res.totalAmount, totalFreight: res.totalFreight, - freight: res.freight, - surcharge: res.surcharge + totalSurcharge: res.totalSurcharge }); } }); diff --git a/src/app/routes/order-management/modal/vehicle/cancel-confirm/cancel-confirm.component.ts b/src/app/routes/order-management/modal/vehicle/cancel-confirm/cancel-confirm.component.ts index 56e734b3..dc868538 100644 --- a/src/app/routes/order-management/modal/vehicle/cancel-confirm/cancel-confirm.component.ts +++ b/src/app/routes/order-management/modal/vehicle/cancel-confirm/cancel-confirm.component.ts @@ -4,7 +4,7 @@ * @Author : Shiming * @Date : 2022-02-22 13:53:29 * @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 * Copyright (C) 2022 huzhenhong. All rights reserved. */ @@ -75,6 +75,7 @@ export class OneCarOrderCancelConfirmComponent implements OnInit { initData() { let indexId = 0 let index = 0 + let indexSurcharge = 0 this.i?.mybidDetailInfo.forEach((ele: any) => { if(this.sts == 1) { // 大宗 @@ -83,25 +84,21 @@ export class OneCarOrderCancelConfirmComponent implements OnInit { } if (ele?.paymentStatusLabel == '已支付') { indexId += 1; + indexSurcharge += ele?.surcharge; } } else { // 整车 if (ele?.paymentStatusLabel == '已支付') { indexId += 1; index += ele?.price; + indexSurcharge += ele?.surcharge; } 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.List = index + this.ATTPrice = indexSurcharge console.log(this.index) console.log(this.List) } diff --git a/src/app/routes/order-management/modal/vehicle/confir-receipt/confir-receipt.component.html b/src/app/routes/order-management/modal/vehicle/confir-receipt/confir-receipt.component.html index b94a1580..d4e298cb 100644 --- a/src/app/routes/order-management/modal/vehicle/confir-receipt/confir-receipt.component.html +++ b/src/app/routes/order-management/modal/vehicle/confir-receipt/confir-receipt.component.html @@ -4,7 +4,7 @@ * @Author : Shiming * @Date : 2021-12-15 13:17:42 * @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 * Copyright (C) 2022 huzhenhong. All rights reserved. --> @@ -17,7 +17,20 @@ - + + + {{item.PRE | currency}} + + + {{ item.RECE | currency }} + + + {{ item.BACK | currency }} + + + {{ item.traiPrice | currency }} + +
{{ dataInfo?.driverName }} / {{ dataInfo?.driverPhone }}/ {{ dataInfo?.carNo }}
diff --git a/src/app/routes/order-management/modal/vehicle/confir-receipt/confir-receipt.component.ts b/src/app/routes/order-management/modal/vehicle/confir-receipt/confir-receipt.component.ts index 86e57768..6d6170e4 100644 --- a/src/app/routes/order-management/modal/vehicle/confir-receipt/confir-receipt.component.ts +++ b/src/app/routes/order-management/modal/vehicle/confir-receipt/confir-receipt.component.ts @@ -4,7 +4,7 @@ * @Author : Shiming * @Date : 2021-12-15 13:17:42 * @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 * Copyright (C) 2022 huzhenhong. All rights reserved. */ @@ -143,23 +143,27 @@ export class VehicleConfirReceiptComponent implements OnInit { this.columns = [ { title: '预付', - index: 'PRE' + index: 'PRE', + render:'PRE' }, { title: '到付', - index: 'RECE' - }, - { - title: '油卡', - index: 'OIL' + index: 'RECE', + render:'RECE' }, + // { + // title: '油卡', + // index: 'OIL' + // }, { title: '回单付', - index: 'BACK' + index: 'BACK', + render:'BACK' }, { title: '总运费', - index: 'traiPrice' + index: 'traiPrice', + render:'traiPrice' } ]; } diff --git a/src/app/routes/order-management/modal/vehicle/view-track/view-track.component.html b/src/app/routes/order-management/modal/vehicle/view-track/view-track.component.html new file mode 100644 index 00000000..36828461 --- /dev/null +++ b/src/app/routes/order-management/modal/vehicle/view-track/view-track.component.html @@ -0,0 +1,34 @@ + +
+ +
+
+ + +
+
+ +
+
+
+ + + + + + +
+ + diff --git a/src/app/routes/order-management/modal/vehicle/view-track/view-track.component.less b/src/app/routes/order-management/modal/vehicle/view-track/view-track.component.less new file mode 100644 index 00000000..ae775710 --- /dev/null +++ b/src/app/routes/order-management/modal/vehicle/view-track/view-track.component.less @@ -0,0 +1,11 @@ +:host { + ::ng-deep { + // .mapBox { + // iframe, canvas { + // width: 400px !important; + // } + // } + + } + + } \ No newline at end of file diff --git a/src/app/routes/order-management/modal/vehicle/view-track/view-track.component.ts b/src/app/routes/order-management/modal/vehicle/view-track/view-track.component.ts new file mode 100644 index 00000000..5bb83e8a --- /dev/null +++ b/src/app/routes/order-management/modal/vehicle/view-track/view-track.component.ts @@ -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'); + } +} diff --git a/src/app/routes/order-management/order-management.module.ts b/src/app/routes/order-management/order-management.module.ts index 8d59ea15..b71b0fda 100644 --- a/src/app/routes/order-management/order-management.module.ts +++ b/src/app/routes/order-management/order-management.module.ts @@ -36,6 +36,7 @@ import { VehicleModifyRateComponent } from './modal/vehicle/modify-rate/modify-r import { VehicleSureArriveComponent } from './modal/vehicle/sure-arrive/sure-arrive.component'; import { VehicleSureDepartComponent } from './modal/vehicle/sure-depart/sure-depart.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'; const COMPONENTS: Type[] = [ @@ -62,7 +63,8 @@ const COMPONENTS: Type[] = [ OrderManagementReceiptsAuditComponent, orderManagementVoucherViewComponent, OrderManagementComplianceAuditComponent, - OneCarOrderCancelConfirmComponent + OneCarOrderCancelConfirmComponent, + OneCarOrderViewtrackComponent ]; @NgModule({ diff --git a/src/app/routes/order-management/services/order-management.service.ts b/src/app/routes/order-management/services/order-management.service.ts index d142db1c..b426ad03 100644 --- a/src/app/routes/order-management/services/order-management.service.ts +++ b/src/app/routes/order-management/services/order-management.service.ts @@ -4,7 +4,7 @@ * @Author : Shiming * @Date : 2021-12-03 15:31:52 * @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 * Copyright (C) 2022 huzhenhong. All rights reserved. */ diff --git a/src/app/routes/supply-management/components/assigned-car/assigned-car.component.html b/src/app/routes/supply-management/components/assigned-car/assigned-car.component.html index 65a2952a..22030b03 100644 --- a/src/app/routes/supply-management/components/assigned-car/assigned-car.component.html +++ b/src/app/routes/supply-management/components/assigned-car/assigned-car.component.html @@ -1,66 +1,49 @@ -
- -
-
- +
+
- + (change)="changeSt($event)"> - + - - {{ car.carNo }} - - {{ car.carLength }}米,{{ car.carLoad }}吨 - - 空闲 - 已被指派 + + {{car.carNo}} - + {{car.carLength}}米,{{car.carLoad}}吨 - + 空闲 + 在途 未认证 - {{ item.captainName }} {{ item.captainPhone }} - 设置 + {{item.captainName}} {{item.captainPhone}} + 设置 空闲 - 已被指派 + 在途 未认证
diff --git a/src/app/routes/supply-management/components/assigned-car/assigned-car.component.ts b/src/app/routes/supply-management/components/assigned-car/assigned-car.component.ts index 11a756c4..bcbd14e5 100644 --- a/src/app/routes/supply-management/components/assigned-car/assigned-car.component.ts +++ b/src/app/routes/supply-management/components/assigned-car/assigned-car.component.ts @@ -2,8 +2,9 @@ import { Component, OnInit, ViewChild } from '@angular/core'; import { STChange, STColumn, STColumnBadge, STComponent, STData } from '@delon/abc/st'; import { SFComponent, SFSchema, SFUISchema } from '@delon/form'; import { ModalHelper, _HttpClient } from '@delon/theme'; +import { EAEnvironmentService } from '@shared'; 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 { SupplyManagementAddDriversComponent } from '../add-drivers/add-drivers.component'; import { CarAddmodalComponent } from '../addmodal/addmodal.component'; @@ -29,7 +30,6 @@ export class SupplyManagementVehicleAssignedCarComponent implements OnInit { @ViewChild('st') st!: STComponent; @ViewChild('sf', { static: false }) sf!: SFComponent; status: string = 'anew'; - type: any; url = ''; // 请求的api地址 params: any = {}; // 传进来的参数 cardBADGE: STColumnBadge | any = { @@ -43,6 +43,8 @@ export class SupplyManagementVehicleAssignedCarComponent implements OnInit { private msgSrv: NzMessageService, public service: SupplyManagementService, private modalHelper: ModalHelper, + private envSrv: EAEnvironmentService, + private modalSrv: NzModalService ) { this.initSF(); this.initSt(); @@ -54,10 +56,14 @@ export class SupplyManagementVehicleAssignedCarComponent implements OnInit { get reqParams() { return { ...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 } }, nameOrPhone: { type: 'string', - title: '', + title: '承运司机', ui: { placeholder: '请输入司机姓名/手机号' } }, carNo: { type: 'string', - title: '', + title: '车牌号', + maxLength: 9, ui: { placeholder: '请输入车牌号' } @@ -100,13 +107,12 @@ export class SupplyManagementVehicleAssignedCarComponent implements OnInit { } ngOnInit(): void { - console.log(this.type) } dataProcess(data: STData[]): STData[] { return data.map((i, index) => { i.carId = ''; - i.disabled = i.carStatus === '1'; + i.disabled = (i?.certificationStatus === 1 && i.driverStatus === 1); const defaultCar = i?.userCarLicenseDesensitizationVOList?.find((item: any) => item.isDefault); if (defaultCar) { i.carId = defaultCar?.carId; @@ -116,16 +122,15 @@ export class SupplyManagementVehicleAssignedCarComponent implements OnInit { } save(): void { - if (this.selectedRows) { - const { carId, appUserId: driverId, captainAppUserId: carCaptainId } = this.selectedRows; - const params: any = { carId, driverId, carCaptainId }; - this.service.request(this.url, { ...params, ...this.params }).subscribe((res: any) => { - if (res) { - this.modal.close(res); - } - }) + const { carId, appUserId: driverId, captainAppUserId: carCaptainId } = this.selectedRows; + const params: any = { carId, driverId, carCaptainId }; + this.service.request(this.url, { ...params, ...this.params }).subscribe((res: any) => { + if (res) { + this.service.msgSrv.success('指派成功!'); + this.modal.close(res); + } + }) - } } changeSt(e: STChange): void { @@ -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) { + this.modalHelper.create(SupplyManagementAddDriversComponent, { dirvierInfo: item }, { size: 900, modalOptions: { nzMaskClosable: false, nzTitle: '设置' } @@ -168,4 +191,57 @@ export class SupplyManagementVehicleAssignedCarComponent implements OnInit { this.sf.reset(); 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: `${content ? content : ''}${subContent ? subContent : ''}`, + nzOkText: '知道了' + }); + } + + showConfirm(title: string, content: string, subContent: string): void { + this.modalSrv.confirm({ + nzTitle: title, + nzContent: `${content ? content : ''}${subContent ? subContent : ''}`, + nzOkText: '继续', + nzCancelText: '取消', + nzOnOk: () => { + this.save(); + } + }); + } + + } diff --git a/src/app/routes/supply-management/components/bulk-detail/bulk-detail.component.html b/src/app/routes/supply-management/components/bulk-detail/bulk-detail.component.html index fb4c2eb6..5d118b1f 100644 --- a/src/app/routes/supply-management/components/bulk-detail/bulk-detail.component.html +++ b/src/app/routes/supply-management/components/bulk-detail/bulk-detail.component.html @@ -13,16 +13,17 @@
网络货运人:{{ i?.shipperAppUserName }}
- - - + + +
- 总费用:{{ i?.totalAmount | currency: '¥' }} + 总费用:{{ i?.totalAmount | currency: '¥' }}
@@ -39,19 +40,14 @@
- - - + + + +
@@ -77,10 +73,8 @@
-

装货卸货信息 - ( +

装货卸货信息 + ( ) @@ -130,7 +124,8 @@
- {{ item?.freightPrice | currency: '¥' }} {{ freightType[item?.freightType] }} + {{ item?.freightPrice | currency: '¥' }} {{ + freightType[item?.freightType] }}

@@ -139,8 +134,7 @@ - ({{ item?.count }}) + ({{ item?.count }}) @@ -199,7 +200,7 @@
-
+
-
+
 天内支付运费
diff --git a/src/app/routes/supply-management/components/bulk-publish/bulk-publish.component.ts b/src/app/routes/supply-management/components/bulk-publish/bulk-publish.component.ts index 9e5c484b..727e0e7c 100644 --- a/src/app/routes/supply-management/components/bulk-publish/bulk-publish.component.ts +++ b/src/app/routes/supply-management/components/bulk-publish/bulk-publish.component.ts @@ -46,6 +46,13 @@ export class SupplyManagementBulkPublishComponent implements OnInit { startInfo: any = []; endInfo: any = []; PageStatus = ''; + limitValues = { + maxMonth: 99, + maxWeight: 99999, + maxVolume: 99999, + maxTrainNumber: 99999, + maxFreight: 9999999 + } constructor( private http: _HttpClient, fb: FormBuilder, @@ -96,6 +103,7 @@ export class SupplyManagementBulkPublishComponent implements OnInit { this.initSF4(); this.initSF6(); this.initdata(); + this.getLimitvalue(); } initSF1() { this.schema1 = { @@ -110,9 +118,10 @@ export class SupplyManagementBulkPublishComponent implements OnInit { searchDebounceTime: 300, searchLoadingText: '搜索中...', onSearch: (q: any) => { - if (!!q) { + let str =q.replace(/^\s+|\s+$/g,""); + if (str) { 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)))) .toPromise(); } else { @@ -120,7 +129,10 @@ export class SupplyManagementBulkPublishComponent implements OnInit { } }, change: (q: any) => { - this.getRegionCode(q); + let str =q.replace(/^\s+|\s+$/g,""); + if (str) { + this.getRegionCode(str); + } }, } as SFSelectWidgetSchema }, @@ -146,19 +158,19 @@ export class SupplyManagementBulkPublishComponent implements OnInit { ui: { placeholder: '请输入', format: 'yyyy-MM-dd HH:mm:ss', - disabledDate: (current: Date): boolean => { + validator: (val) => { let d = new Date(); let year = d.getFullYear(); let month = d.getMonth(); let date = d.getDate(); - let mydate = new Date(year, month + 3, date); - return differenceInCalendarDays(current, new Date()) < 0 || differenceInCalendarDays(current, mydate) > 0; - }, - validator: (val) => { - if( new Date(val) mydate) { + return [{ keyword: 'validTime2', message: `有效期最长为${this.limitValues.maxMonth}个月` }]; + } + return []; }, } }, @@ -412,6 +424,7 @@ export class SupplyManagementBulkPublishComponent implements OnInit { grid: { lg: 8, md: 12, sm: 12, xs: 24 } }, $carModel: { + spanLabelFixed: 120, grid: { span: 8 } }, $carLength: { @@ -522,7 +535,7 @@ export class SupplyManagementBulkPublishComponent implements OnInit { } as SFTextareaWidgetSchema } }, - required: ['stateReceipt', 'receiptType', 'receiptUserName','receiptUserPhone','receiptAddressArea','receiptAddress'] + required: ['stateReceipt', 'receiptType', 'receiptUserName','receiptUserPhone','receiptAddressArea','receiptAddress','paymentDays'] }; this.ui7 = { '*': { @@ -644,7 +657,6 @@ export class SupplyManagementBulkPublishComponent implements OnInit { } // 提交前确认,委托运输协议弹窗 submitConfirm(submitType?: any) { - // 校验规则 Object.keys(this.validateForm1.controls).forEach(key => { this.validateForm1.controls[key].markAsDirty(); this.validateForm1.controls[key].updateValueAndValidity(); @@ -652,8 +664,18 @@ export class SupplyManagementBulkPublishComponent implements OnInit { this.sf1.validator({ emitError: true }); this.sf3.validator({ emitError: true }); this.sf4.validator({ emitError: true }); - this.sf7.validator({ emitError: true }); - if (this.validateForm1.invalid || !this.sf3.valid || !this.sf1.valid || !this.sf4.valid || !this.sf7.valid) { + if (this.validateForm1.invalid || !this.sf1.valid || !this.sf3.valid || !this.sf4.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; } @@ -671,16 +693,21 @@ export class SupplyManagementBulkPublishComponent implements OnInit { } // 确认提交 submit(submitType?: string): void { - if (typeof this.validateForm1.value.modifyTime !== 'string') { - var c = new Date(this.validateForm1.value.modifyTime); - this.validateForm1.value.modifyTime = - c.getFullYear() + '-' + (c.getMonth() + 1) + '-' + c.getDate() + ' ' + c.getHours() + ':' + c.getMinutes() + ':' + c.getSeconds(); - } - if (typeof this.validateForm1.value.createTime !== 'string') { - var c = new Date(this.validateForm1.value.createTime); - this.validateForm1.value.createTime = - c.getFullYear() + '-' + (c.getMonth() + 1) + '-' + c.getDate() + ' ' + c.getHours() + ':' + c.getMinutes() + ':' + c.getSeconds(); - } + // //装卸货信息 + 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 params: any = { ...this.sf1.value, @@ -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) + } + }) + } } diff --git a/src/app/routes/supply-management/components/bulk-release-publish/bulk-release-publish.component.html b/src/app/routes/supply-management/components/bulk-release-publish/bulk-release-publish.component.html index 88cd31bb..29a70721 100644 --- a/src/app/routes/supply-management/components/bulk-release-publish/bulk-release-publish.component.html +++ b/src/app/routes/supply-management/components/bulk-release-publish/bulk-release-publish.component.html @@ -17,7 +17,7 @@ -
装卸货信息预计公里数:{{ totalDistance }}km,预计行程耗时:{{ totalTime }}小时
@@ -26,7 +26,7 @@
- 装货地 + 装货地
@@ -37,13 +37,14 @@ name="startDetailedAddress{{ idx }}" placeholder="请输入装货地" required + readonly="true" />
- - 联系人 + + 联系人
- 卸货地 + 卸货地
@@ -90,13 +91,14 @@ name="endDetailedAddress{{ idx }}" placeholder="请输入卸货地" required + readonly="true" />
- 联系人 + 联系人
-
+
-
+
 天内支付运费
diff --git a/src/app/routes/supply-management/components/bulk-release-publish/bulk-release-publish.component.less b/src/app/routes/supply-management/components/bulk-release-publish/bulk-release-publish.component.less index 193ba9aa..6abb9df7 100644 --- a/src/app/routes/supply-management/components/bulk-release-publish/bulk-release-publish.component.less +++ b/src/app/routes/supply-management/components/bulk-release-publish/bulk-release-publish.component.less @@ -4,7 +4,7 @@ width: 100%; } nz-date-picker { - width: 100%; + width: 94.3%; } } i { @@ -37,10 +37,6 @@ :hover{color: #52acff;} } -#container { - width: 300px; - height: 180px; -} input[type='number'] { -moz-appearance: textfield; diff --git a/src/app/routes/supply-management/components/bulk-release-publish/bulk-release-publish.component.ts b/src/app/routes/supply-management/components/bulk-release-publish/bulk-release-publish.component.ts index 94e45979..53858ad0 100644 --- a/src/app/routes/supply-management/components/bulk-release-publish/bulk-release-publish.component.ts +++ b/src/app/routes/supply-management/components/bulk-release-publish/bulk-release-publish.component.ts @@ -41,6 +41,13 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit { totalFees: any; // 总数信息 id = ''; type = 'add'; + limitValues = { + maxMonth: 99, + maxWeight: 99999, + maxVolume: 99999, + maxTrainNumber: 99999, + maxFreight: 9999999 + } // // 单位 startInfo: any[] = []; endInfo: any[] = []; @@ -80,6 +87,7 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit { this.initSF3(); this.initSF4(); this.initSF6(); + this.getLimitvalue(); this.startInfo = [ { detailedAddress: '', @@ -121,9 +129,10 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit { searchLoadingText: '搜索中...', allowClear: true, onSearch: (q: any) => { - if (!!q) { + let str =q.replace(/^\s+|\s+$/g,""); + if (str) { 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)))) .toPromise(); } else { @@ -131,7 +140,10 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit { } }, change: (q: any) => { - this.getRegionCode(q); + let str =q.replace(/^\s+|\s+$/g,""); + if (str) { + this.getRegionCode(str); + } } } as SFSelectWidgetSchema }, @@ -169,19 +181,19 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit { ui: { placeholder: '请输入', format: 'yyyy-MM-dd HH:mm:ss', - disabledDate: (current: Date): boolean => { + validator: (val) => { let d = new Date(); let year = d.getFullYear(); let month = d.getMonth(); let date = d.getDate(); - let mydate = new Date(year, month + 3, date); - return differenceInCalendarDays(current, new Date()) < 0 || differenceInCalendarDays(current, mydate) > 0; - }, - validator: (val) => { - if( new Date(val) mydate) { + return [{ keyword: 'validTime2', message: `有效期最长为${this.limitValues.maxMonth}个月` }]; + } + return []; }, } }, @@ -435,6 +447,7 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit { grid: { lg: 8, md: 12, sm: 12, xs: 24 } }, $carModel: { + spanLabelFixed: 120, grid: { span: 8 } }, $carLength: { @@ -532,7 +545,7 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit { } as SFTextareaWidgetSchema } }, - required: ['stateReceipt', 'paymentDays', 'receiptType', 'receiptUserName','receiptUserPhone','receiptAddressArea','receiptAddress'] + required: ['stateReceipt', 'paymentDays', 'receiptType', 'receiptUserName','receiptUserPhone','receiptAddressArea','receiptAddress','paymentDays'] }; this.ui6 = { '*': { @@ -580,9 +593,19 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit { this.sf4.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) { + 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; + } const modalRef = this.modalService.create({ nzTitle: '运输协议', nzContent: TranAgreementComponent, @@ -599,12 +622,20 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit { submit(submitType: string): void { // //装卸货信息 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 goodsInfoList = [ { ...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) + } + }) + } } diff --git a/src/app/routes/supply-management/components/bulk/bulk.component.html b/src/app/routes/supply-management/components/bulk/bulk.component.html index 6f5a8142..ad472530 100644 --- a/src/app/routes/supply-management/components/bulk/bulk.component.html +++ b/src/app/routes/supply-management/components/bulk/bulk.component.html @@ -4,7 +4,7 @@ * @Author : Shiming * @Date : 2022-01-12 10:52:50 * @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 * Copyright (C) 2022 huzhenhong. All rights reserved. --> @@ -32,8 +32,8 @@
- - + + +
-
-
-
- -
-
- - -
-
+
+ +
+
+ +
- + [loadingDelay]="500" [loading]="service.http.loading" [widthMode]="{ type: 'strict' }" [scroll]="{ x: '600px' }" + style="margin-top: 22px"> - + @@ -53,21 +40,18 @@
已选择{{ st2Data.length }}位司机
- + {{ item.captainName }} {{ item.captainPhone }}   设置 + + {{item.default?.carNo}} +
diff --git a/src/app/routes/supply-management/components/choose-famifiar/choose-famifiar.component.ts b/src/app/routes/supply-management/components/choose-famifiar/choose-famifiar.component.ts index f73d3461..d2f126d1 100644 --- a/src/app/routes/supply-management/components/choose-famifiar/choose-famifiar.component.ts +++ b/src/app/routes/supply-management/components/choose-famifiar/choose-famifiar.component.ts @@ -3,7 +3,7 @@ import { ActivatedRoute, Router } from '@angular/router'; import { STChange, STColumn, STComponent, STData, STRequestOptions } from '@delon/abc/st'; import { SFComponent, SFSchema, SFSelectWidgetSchema, SFUISchema } from '@delon/form'; import { ModalHelper } from '@delon/theme'; -import { processSingleSort } from '@shared'; +import { EAEnvironmentService, processSingleSort } from '@shared'; import { NzDrawerRef, NzDrawerService } from 'ng-zorro-antd/drawer'; import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal'; import { SupplyManagementAddDriversComponent } from 'src/app/routes/supply-management/components/add-drivers/add-drivers.component'; @@ -37,7 +37,7 @@ export class PublishGoodsChooseFamifiarComponent implements OnInit { submitUrl = ''; @Input() - submitParams = {}; + submitParams:any; constructor( private modal: NzModalRef, @@ -47,8 +47,8 @@ export class PublishGoodsChooseFamifiarComponent implements OnInit { public service: SupplyManagementService, private modalService: NzModalService, private modalHelper: ModalHelper, - private cdr: ChangeDetectorRef - ) {} + private envSrv: EAEnvironmentService + ) { } /** * 查询参数 @@ -61,26 +61,23 @@ export class PublishGoodsChooseFamifiarComponent implements OnInit { } ngOnInit() { this.initSF(); - - setTimeout(() => { - this.initST(); - this.initST2(); - }, 200); + this.initST(); + this.initST2(); } initSF() { this.schema = { properties: { - name: { + nameOrPhone: { type: 'string', - title: '', + title: '承运司机', ui: { placeholder: '请输入司机姓名/手机号' } }, - name2: { + carNo: { type: 'string', - title: '', + title: '车牌号', ui: { placeholder: '请输入车牌号' } @@ -98,13 +95,11 @@ export class PublishGoodsChooseFamifiarComponent implements OnInit { this.columns = [ { title: '司机姓名', - index: 'name', - width: 120 + index: 'name' }, { title: '手机号', - index: 'telephone', - width: 120 + index: 'telephone' }, { title: '指定车辆', @@ -115,7 +110,6 @@ export class PublishGoodsChooseFamifiarComponent implements OnInit { title: '状态', className: 'text-center', index: 'certificationStatus', - width: 120, type: 'badge', badge: { '-1': { text: '未提交', color: 'default' }, @@ -127,12 +121,11 @@ export class PublishGoodsChooseFamifiarComponent implements OnInit { { title: '操作', className: 'text-center', - width: 80, buttons: [ { text: '选择', iif: item => item.showChoose != false, - click: (_record, _modal, _instance) => this.choose(_record), + click: (_record, _modal, _instance) => this.verifyVechicleStatus(_record), iifBehavior: 'disabled' } ] @@ -145,7 +138,7 @@ export class PublishGoodsChooseFamifiarComponent implements OnInit { { title: '司机姓名', index: 'name', - width: 120 + width: '90px' }, { title: '手机号', @@ -155,17 +148,17 @@ export class PublishGoodsChooseFamifiarComponent implements OnInit { { title: '车队长', render: 'captain', - width: '100px' + width: '200px' }, { title: '指定车辆', - index: 'carNo', + render: 'defaultCar', width: '130px' }, { title: '操作', className: 'text-center', - width: 80, + width: '90px', buttons: [ { 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) { 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: `${content ? content : ''}${subContent ? subContent : ''}`, + nzOkText: '知道了' + }); + } + + showConfirm(_record: STData, title: string, content: string, subContent: string): void { + this.modalService.confirm({ + nzTitle: title, + nzContent: `${content ? content : ''}${subContent ? subContent : ''}`, + nzOkText: '继续', + nzCancelText: '取消', + nzOnOk: () => { + this.choose(_record); + } + }); + } } diff --git a/src/app/routes/supply-management/components/choose-famifiar/set-captain/set-captain.component.ts b/src/app/routes/supply-management/components/choose-famifiar/set-captain/set-captain.component.ts index cf3b2b56..395a7514 100644 --- a/src/app/routes/supply-management/components/choose-famifiar/set-captain/set-captain.component.ts +++ b/src/app/routes/supply-management/components/choose-famifiar/set-captain/set-captain.component.ts @@ -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 { ActivatedRoute } from '@angular/router'; import { SFComponent, SFSchema, SFSchemaEnumType, SFUISchema } from '@delon/form'; @@ -16,7 +26,7 @@ export class PublishchooseFamifiarSetCaptainComponent implements OnInit { 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 { this.initSF(); @@ -24,12 +34,11 @@ export class PublishchooseFamifiarSetCaptainComponent implements OnInit { initSF() { this.schema = { properties: { - name: { + captainPhone: { type: 'string', title: '车队长手机号' } }, - required: ['name'] }; this.ui = { '*': { @@ -39,6 +48,6 @@ export class PublishchooseFamifiarSetCaptainComponent implements OnInit { }; } - close() {} - save() {} + close() {this.modal.close()} + save() {this.modal.close(this.sf.value.captainPhone)} } diff --git a/src/app/routes/supply-management/components/onecar-publish/onecar-publish.component.html b/src/app/routes/supply-management/components/onecar-publish/onecar-publish.component.html index 4b2384b3..ee5b6177 100644 --- a/src/app/routes/supply-management/components/onecar-publish/onecar-publish.component.html +++ b/src/app/routes/supply-management/components/onecar-publish/onecar-publish.component.html @@ -14,40 +14,41 @@
装卸货信息预计公里数:{{ totalDistance }}km,预计行程耗时:{{ totalTime }}小时
+
-
+
- 装货地 + 装货地
- - + >
- 联系人 + 联系人
-
- +
+
+
+ +
@@ -82,34 +86,38 @@
-
+
- 卸货地 + 卸货地
- +
- 联系人 + 联系人
-
- +
+
+
+ +
-
+
- 装货时间 + 装货时间 + [nzShowTime]="{ nzFormat: 'HH' }" + nzFormat="yyyy-MM-dd HH:00前" + formControlName="loadingTime" + [nzDisabledDate]="disabledDateStart" + >
-
-
+
+
- 卸货时间 + 卸货时间 - +
- + -
货物信息
-
- - - - - - - - - - - - - - - - - - +
+
+ + + + + + + + + + + + + + + + + @@ -239,7 +245,7 @@ [nzMin]="50000" [nzMax]="3000000" [nzStep]="0.01" - (ngModelChange)="i.setValue($event);getInsurersPrice($event)" + (ngModelChange)="i.setValue($event);getInsurersPrice()" nzPlaceHolder="请输入50000-3000000之间数值" >
@@ -324,7 +330,7 @@
-
+
-
+
 天内支付运费
@@ -353,7 +359,7 @@ acl [acl-ability]="['SUPPLY-VEHICLE-AMEND-submitChange']">提交修改 -
diff --git a/src/app/routes/supply-management/components/onecar-publish/onecar-publish.component.less b/src/app/routes/supply-management/components/onecar-publish/onecar-publish.component.less index 35b08935..f6d4bb4f 100644 --- a/src/app/routes/supply-management/components/onecar-publish/onecar-publish.component.less +++ b/src/app/routes/supply-management/components/onecar-publish/onecar-publish.component.less @@ -50,7 +50,3 @@ input[type='number']::-webkit-outer-spin-button { margin: 0; -webkit-appearance: none; } -.hides { - margin-left: 10px; - color: aqua; -} diff --git a/src/app/routes/supply-management/components/onecar-publish/onecar-publish.component.ts b/src/app/routes/supply-management/components/onecar-publish/onecar-publish.component.ts index 66f3d209..9af7b78f 100644 --- a/src/app/routes/supply-management/components/onecar-publish/onecar-publish.component.ts +++ b/src/app/routes/supply-management/components/onecar-publish/onecar-publish.component.ts @@ -1,6 +1,7 @@ import { Component, OnInit, ViewChild } from '@angular/core'; -import { debounceTime } from 'rxjs/operators'; 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 { ActivatedRoute, Router } from '@angular/router'; import { @@ -14,9 +15,8 @@ import { SFUISchema } from '@delon/form'; 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 { type } from 'os'; import { of } from 'rxjs'; import { map } from 'rxjs/operators'; 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 { PublishAddressListComponent } from './address-list/address-list.component'; import { PublishSuccessComponent } from './publish-success/publish-success.component'; +import { cacheConf } from '@conf/cache.conf'; + @Component({ selector: 'app-publish-goods-onecar-publish', templateUrl: './onecar-publish.component.html', styleUrls: ['./onecar-publish.component.less'] }) export class SupplyManagementOnecarPublishComponent implements OnInit { + // 环境信息 appId、tenantId + envInfo = this.eaCacheSrv.get(cacheConf.env); validateForm1: FormGroup; + limitValues = { + maxWeight: 99999, + maxVolume: 99999, + maxPiece: 99999, + maxDays: 999, + intervalDays: 999, + maxTimes: 999 + }; sf1data: any; // 货源单设置回显 sf3data: any; // 货源单设置回显 sf4data: any; // 货源单设置回显 @@ -61,18 +73,14 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { private modalService: NzModalService, public service: SupplyManagementService, private amapService: AmapService, - public shipperSrv: ShipperBaseService + public shipperSrv: ShipperBaseService, + private eaCacheSrv: EACacheService ) { this.validateForm1 = fb.group({ - loadAddress0: [null, [Validators.required]], - loadName0: [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, []] + loadingTime: [null, [Validators.required]], + unloadingTime: [null, [Validators.required]] }); + this.envCache = this.eaCacheSrv.get(cacheConf.env); } @ViewChild('sf1', { static: false }) sf1!: SFComponent; schema1: SFSchema = {}; @@ -105,15 +113,17 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { @ViewChild('sf7', { static: false }) sf7!: SFComponent; schema7: SFSchema = {}; ui7!: SFUISchema; - formatterRmb = (value: number): string =>{ - if(value){ - let value2 = Number(value).toLocaleString(undefined,{'minimumFractionDigits':2,'maximumFractionDigits':2}); - return `¥ ${value2}`; + + formatterRmb = (value: number): string => { + if (value === null || value === undefined) { + return ''; + } else { + let value2 = Number(value).toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 }); + return `¥${value2}`; } - return `¥ 0.00` - - } ; - parserRmb = (value: string): string => value.replace('¥ ', '').replace(',',''); + }; + parserRmb = (value: string): string => value.replace('¥', '').replace(',', ''); + // 页面初始化 ngOnInit(): void { if (this.route.snapshot?.queryParams?.sta === '1') { @@ -127,8 +137,8 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { this.initSF5(); this.initSF6(); this.initSF7(); + this.getLimitvalue(); this.initdata(); - this.getInsurers() } initSF1() { this.schema1 = { @@ -143,9 +153,10 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { searchDebounceTime: 300, searchLoadingText: '搜索中...', onSearch: (q: any) => { - if (!!q) { + let str = q.replace(/^\s+|\s+$/g, ''); + if (str) { 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)))) .toPromise(); } else { @@ -153,7 +164,11 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { } }, change: (q: any) => { - this.getRegionCode(q); + let str = q.replace(/^\s+|\s+$/g, ''); + if (str) { + this.getRegionCode(str); + this.payChange(); + } } } as SFSelectWidgetSchema }, @@ -336,13 +351,13 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { ui: { widget: 'select', mode: 'multiple', - maxMultipleCount:3, + maxMultipleCount: 3, placeholder: '请选择车型', errors: { required: '请选择车型' }, asyncData: () => this.service.getDictOptions({ dictKey: 'car:model' }), - change:(tag:any , org:any)=>{ - if(tag.includes("999")){ - this.sf4.setValue('/carModel',["999"]); + change: (tag: any, org: any) => { + if (tag.includes('999')) { + this.sf4.setValue('/carModel', ['999']); } } } @@ -353,17 +368,17 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { ui: { widget: 'select', mode: 'multiple', - maxMultipleCount:3, + maxMultipleCount: 3, placeholder: '请选择车长', errors: { required: '请选择车长' }, asyncData: () => this.service.getDictOptions({ dictKey: 'car:length' }), - change:(tag:any , org:any)=>{ - if(tag.includes("999")){ - this.sf4.setValue('/carModel',["999"]); + change: (tag: any, org: any) => { + if (tag.includes('999')) { + this.sf4.setValue('/carModel', ['999']); } } } - }, + } }, required: ['weight', 'carModel', 'carLength'] }; @@ -397,8 +412,17 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { type: 'string', title: '增值服务套餐', ui: { - widget: 'dict-select', - params: { dictKey: 'bill:insurance:type' }, + widget: 'select', + 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' }, @@ -409,7 +433,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { readOnly: true, ui: { widget: 'checkbox', - visibleIf: { insuranceType: (value: string) => value === '0' } + visibleIf: { insuranceType: (value: string) => value === '1' } } as SFCheckboxWidgetSchema, default: ['车辆实时定位', '轨迹查询', '数据保护', '赠送基本险'] }, @@ -420,7 +444,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { readOnly: true, ui: { widget: 'checkbox', - visibleIf: { insuranceType: (value: string) => value === '1' } + visibleIf: { insuranceType: (value: string) => value === '2' } } as SFCheckboxWidgetSchema, default: ['车辆实时定位', '轨迹查询', '数据保护', '专属技术服务', '赠送综合险'] }, @@ -432,21 +456,22 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { visibleIf: { insuranceType: (value: string) => value !== '3' } } }, - insurancePackagedGoods:{ + insurancePackagedGoods: { type: 'string', title: '货物包装', ui: { widget: 'dict-select', params: { dictKey: 'insure:packaged:goods' }, + containsAllLabel: false, visibleIf: { insuranceType: (value: string) => value !== '3' } } as SFSelectWidgetSchema }, - hidenField:{ + hidenField: { type: 'string', title: '', - default:' ', + default: ' ', ui: { - widget:'text' + widget: 'text' } }, goodsValue: { @@ -463,6 +488,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { title: '', ui: { widget: 'custom', + validator: val => this.customValidator(val), visibleIf: { insuranceType: (value: string) => value !== '3' } } }, @@ -472,26 +498,43 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { ui: { hidden: true } - }, + } }, - required: ['insurancePackagedGoods'] + required: ['insurancePackagedGoods', 'insurancePremium'] }; this.ui5 = { '*': { spanLabelFixed: 115, grid: { span: 12 } }, - $type1:{ + $type1: { grid: { span: 24 } }, - $type2:{ + $type2: { grid: { span: 24 } }, - $freeInsurance:{ + $freeInsurance: { 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() { this.schema6 = { 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: { type: 'string', title: '联系人', - maxLength: 15, ui: { visibleIf: { receiptType: value => value === '2' } - } + }, + readOnly: true }, - receiptUserPhone: { + phon: { type: 'string', title: '联系电话', - maxLength: 11, ui: { visibleIf: { receiptType: value => value === '2' } - } + }, + readOnly: true }, - receiptAddressArea: { + area: { type: 'string', title: '所在地区', - maxLength: 30, ui: { visibleIf: { receiptType: value => value === '2' } - } + }, + readOnly: true }, - receiptAddress: { + address: { type: 'string', title: '详细地址', - maxLength: 30, ui: { visibleIf: { receiptType: value => value === '2' } - } + }, + readOnly: true }, remarks: { type: 'string', @@ -573,11 +636,11 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { } as SFTextareaWidgetSchema } }, - required: ['stateReceipt', 'receiptType', 'receiptUserName', 'receiptUserPhone', 'receiptAddressArea', 'receiptAddress'] + required: ['stateReceipt', 'receiptType', 'receiptAddress'] }; this.ui6 = { '*': { - spanLabelFixed: 90, + spanLabelFixed: 115, grid: { span: 24 } } }; @@ -590,19 +653,19 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { type: 'number', title: '预付', default: 0, - ui: {widget: 'custom'} + ui: { widget: 'custom' } }, toPay: { type: 'number', title: '到付', default: 0, - ui: { widget: 'custom'} + ui: { widget: 'custom' } }, receiptPay: { type: 'number', title: '回单付', default: 0, - ui: {widget: 'custom'} + ui: { widget: 'custom' } }, subtotal: { type: 'number', title: '小计', default: 0, ui: { widget: 'custom' } as SFNumberWidgetSchema }, appendFee: { type: 'number', title: '附加费', default: 0, ui: { widget: 'custom' } as SFNumberWidgetSchema }, @@ -625,9 +688,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { } }; } - // 获取城市列表 getRegionCode(regionCode: any) { - console.log(regionCode); return this.service .request(this.service.$api_get_enterprise_project, { id: regionCode }) .pipe( @@ -646,50 +707,41 @@ 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() { 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 oilCardPay = 0; + const oilCardPay = 0; const subtotal = prePay + toPay + receiptPay; const params = { - shipperId: this.envCache?.enterpriseId, - enterpriseInfoId: this.envCache?.networkTransporterId, - totalFreight:subtotal, - // fuelCardAmount:oilCardPay, - resourcetype:'1' - } - this.service - .request(this.service.$api_getCalculatedSurcharge,params) - .subscribe(res => { - if (res) { - this.sf7.setValue('/appendFee', res.surcharge); - this.sf7.setValue('/subtotal', subtotal); - this.sf7.setValue('/total', subtotal + res.surcharge); - this.service - .request(this.service.$api_getcalculatedServiceRate + `?invoiceAmount=${subtotal + res.surcharge}&totalFreight=${subtotal}`) - .subscribe(res => { - if (res) { - this.currentRate = res.rate * 100; - } else { - this.service.msgSrv.error(res.msg); - } - }); - } else { - this.service.msgSrv.error(res.msg); - } - }); + shipperId: this?.sf1?.value?.shipperAppUserId, + enterpriseInfoId: this?.sf1data?.enterpriseInfoId || '', + totalFreight: subtotal, + fuelCardAmount: oilCardPay, + resourcetype: '1' + }; + this.service.request(this.service.$api_getCalculatedSurcharge, params).subscribe(res => { + if (res) { + this.sf7.setValue('/appendFee', res.surcharge); + this.sf7.setValue('/subtotal', subtotal); + this.sf7.setValue('/total', subtotal + res.surcharge); + let items = this?.sf1data?.enterpriseInfoId || ''; + this.service + .request( + this.service.$api_getAdditionalRate + + `?shipperId=${this?.sf1?.value?.shipperAppUserId || ''}&enterpriseInfoId=${items}&resourcetype='1'` + ) + .subscribe(res => { + if (res) { + this.currentRate = res.rate * 100; + } + }); + } else { + this.service.msgSrv.error(res.msg); + } + }); } - // 添加 删除发货卸货地址 - addStartInfo(_event: any) { + addStartInfo() { if (this.startInfo.length < 5) { const controlId = this.startInfo.length; this.startInfo.push({ @@ -701,29 +753,50 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { province: '', city: '', area: '', - type: 1 + type: '1' }); this.validateForm1.addControl(`loadAddress${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) { - console.log(event, index, id); - if (id) { - this.service.request(this.service.$api_delete_Wholedeletebatch, [id]).subscribe(res => { - console.log(res); - }); - } + + 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) + }; + }); + } + subStartInfo(event: any, index: number) { this.startInfo.splice(index, 1); this.validateForm1.removeControl(`loadAddress${index}`); this.validateForm1.removeControl(`loadName${index}`); this.validateForm1.removeControl(`loadPhone${index}`); } - // 添加 删除发货卸货地址 - addEndInfo(_event: any) { - if (this.addEndInfo.length < 5) { + addEndInfo() { + if (this.endInfo.length < 5) { const controlId = this.endInfo.length; this.endInfo.push({ detailedAddress: '', @@ -734,21 +807,17 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { province: '', city: '', area: '', - type: 2 + type: '2' }); this.validateForm1.addControl(`unloadAddress${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, id?: any) { - if (id) { - this.service.request(this.service.$api_delete_Wholedeletebatch, [id]).subscribe(res => { - console.log(res); - }); - } - console.log(event, index, id); + subEndInfo(event: any, index: number) { this.endInfo.splice(index, 1); this.validateForm1.removeControl(`unloadAddress${index}`); this.validateForm1.removeControl(`unloadName${index}`); @@ -773,16 +842,17 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { .subscribe(res => { if (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) { this.sf3.setValue('/goodsNameId', this.sf3data.goodsNameId); } + } else { + this.service.msgSrv.error(res.msg); } }); } //指派熟车 chooseFamifiar(item: any) { - console.log('999'); const modalRef = this.modalService.create({ nzTitle: '指派熟车', nzContent: SupplyManagementVehicleAssignedCarComponent, @@ -791,7 +861,6 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { status: 'new', url: this.service.$api_save_assign_whole, params: item, - type: 'next' }, nzFooter: null }); @@ -812,103 +881,138 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { }); } // 提交前确认,委托运输协议弹窗 - submitConfirm(submitType?: any) { + submitConfirm(submitType?: string) { 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.sf5.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) { + 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; } + 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({ nzTitle: '运输协议', nzContent: TranAgreementComponent, nzWidth: 900, nzFooter: null, + nzComponentParams: { Object: params } }); modalRef.afterClose.subscribe(result => { if (result) { - this.submit(submitType); + this.submit(submitType, params); } }); } // 提交 - submit(submitType?: string): 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); + submit(submitType?: string, params?: any): void { if (submitType) { if (submitType == 'assign') { this.chooseFamifiar(params); @@ -979,6 +1083,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { this.amapService.drivingCompute([...this.startInfo], [...this.endInfo]).subscribe((res: any) => { this.totalDistance = res.distance; this.totalTime = res.time; + this.getInsurersPrice(); // 计算保费金额 }); } } @@ -1015,6 +1120,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { } this.sf1data = { enterpriseInfoName: res?.enterpriseInfoName, + enterpriseInfoId: res?.enterpriseInfoId, dispatchPhone: res?.dispatchPhone, dispatchName: res?.dispatchName, externalResourceCode: res?.externalResourceCode, @@ -1088,14 +1194,14 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { this.validateForm1.addControl(`unloadName${controlId}`, new FormControl(null, Validators.required)); this.validateForm1.addControl(`unloadPhone${controlId}`, new FormControl(null, Validators.required)); } - - // 计算里程,时间 - 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; - }); - } + + // 计算里程,时间 + 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.sf3data = { @@ -1108,26 +1214,27 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { this.sf3data.goodsName1 = res?.goodsInfoVOList[0]?.goodsName || ''; } 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) { this.loadingTime = res?.loadingTime; } if (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 === '整车修改') { this.sf4data.id = res?.goodsInfoVOList[0]?.id; } @@ -1137,7 +1244,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { goodsValue: res?.goodsValue || '', insurancePremium: res?.insurancePremium || '', insuranceRate: res?.insuranceRate || '', - insurancePackagedGoods: res?.insurancePackagedGoods || '', + insurancePackagedGoods: res?.insurancePackagedGoods || '' }; this.sf6data = { stateReceipt: res?.stateReceipt, @@ -1203,48 +1310,35 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { default: 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) - this.unloadingTime = event; - if(typeof this.loadingTime === 'string') { - var a = new Date(this.loadingTime) - if ( a > this.unloadingTime?.getTime() ) { - this.service.msgSrv.error('卸货时间不能小于装货时间!'); - this.unloadingTime = ''; - } - } 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 = ''; - } - } - } + // 不可选择的时间 + disabledDateStart = (current: Date): boolean => { + let d = new Date(); + let year = d.getFullYear(); + let month = d.getMonth(); + let date = d.getDate(); + let hours = d.getHours(); + let mydate = new Date(year, month, date + this.limitValues.maxDays, hours + 1); + return differenceInCalendarDays(new Date(), current) > 0 || new Date(current) > mydate; + }; // 装卸货地址互换 - swapAddress(){ - this.startInfo.forEach((element:any, index:any) => { + swapAddress() { + this.startInfo.forEach((element: any, index: any) => { this.validateForm1.removeControl(`loadAddress${index}`); this.validateForm1.removeControl(`loadName${index}`); this.validateForm1.removeControl(`loadPhone${index}`); }); - this.endInfo.forEach((element:any, index:any) => { + this.endInfo.forEach((element: any, index: any) => { this.validateForm1.removeControl(`unloadAddress${index}`); this.validateForm1.removeControl(`unloadName${index}`); this.validateForm1.removeControl(`unloadPhone${index}`); @@ -1254,13 +1348,13 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { this.startInfo = this.endInfo; this.endInfo = item; - this.startInfo.forEach((element:any,index:any) => { + this.startInfo.forEach((element: any, index: any) => { element.type = '1'; this.validateForm1.addControl(`loadAddress${index}`, new FormControl(null, Validators.required)); this.validateForm1.addControl(`loadName${index}`, new FormControl(null, Validators.required)); this.validateForm1.addControl(`loadPhone${index}`, new FormControl(null, [Validators.required, Validators.pattern('^[0-9]*$')])); }); - this.endInfo.forEach((element:any,index:any) => { + this.endInfo.forEach((element: any, index: any) => { element.type = '2'; this.validateForm1.addControl(`unloadAddress${index}`, new FormControl(null, Validators.required)); this.validateForm1.addControl(`unloadName${index}`, new FormControl(null, Validators.required)); @@ -1271,78 +1365,27 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { this.amapService.drivingCompute([...this.startInfo], [...this.endInfo]).subscribe(res => { this.totalDistance = res.distance; this.totalTime = res.time; + this.getInsurersPrice(); //计算保费金额 }); } } - goodsValuesChange(value: any) { - console.log(value); - console.log(this.totalDistance); - - if(value >= 50000 && this.totalDistance > 0){ + // 计算保价费金额 + getInsurersPrice(insuranceType = this.sf5.value.insuranceType) { + if (this.sf5.value.goodsValue >= 50000 && this.totalDistance > 0) { const params = { - goodsValue: value, - insuranceType: this.sf55.value.insuranceType, + insuranceType, + goodsValue: this.sf5.value.goodsValue, 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); - } + this.service.request(this.service.$api_getWholeInsuranceInfo, params).subscribe(res => { + if (res) { + this.sf5.setValue('/insurancePremium', res.insurancePremium); + this.sf5.setValue('/insuranceRate', res.insuranceRate); + } else { + this.sf5.setValue('/insurancePremium', null); + this.sf5.setValue('/insuranceRate', 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 = { - goodsValue: this.sf5.value.goodsValue, - insuranceType: this.sf5.value.insuranceType, - km: this.totalDistance - }; - this.service.request(this.service.$api_getWholeInsuranceInfo, params).subscribe(res => { - if (res) { - this.sf5.setValue('/insurancePremium', res.insurancePremium); - this.sf5.setValue('/insuranceRate', res.insuranceRate); - } else { - this.sf5.setValue('/insurancePremium', null); - this.sf5.setValue('/insuranceRate', null); - } - }); - } - } - - }); - } - } diff --git a/src/app/routes/supply-management/components/qrcode-page/qrcode-page.component.html b/src/app/routes/supply-management/components/qrcode-page/qrcode-page.component.html index 99ab2bbe..449b496a 100644 --- a/src/app/routes/supply-management/components/qrcode-page/qrcode-page.component.html +++ b/src/app/routes/supply-management/components/qrcode-page/qrcode-page.component.html @@ -1,25 +1,18 @@ - - -
-
-

公司名称 : {{ i?.enterpriseInfoName }}

- -
卸货地 : {{ address }}
-
装货地 : {{ address }}
-
截止时间 : {{ i?.deadlineTime }}
-
Tips : 二维码用于司机扫码抢单
+
+ +
+
+ +

{{i?.shipperAppUserName}}

+ +
卸货地 : {{address}}
+
装货地 : {{address}}
+
截止时间 : {{i?.deadlineTime}}
+
+ +
+
- diff --git a/src/app/routes/supply-management/components/qrcode-page/qrcode-page.component.spec.ts b/src/app/routes/supply-management/components/qrcode-page/qrcode-page.component.spec.ts index 3896c10c..fc268d02 100644 --- a/src/app/routes/supply-management/components/qrcode-page/qrcode-page.component.spec.ts +++ b/src/app/routes/supply-management/components/qrcode-page/qrcode-page.component.spec.ts @@ -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 { SupplyManagementQrcodePageComponent } from './qrcode-page.component'; diff --git a/src/app/routes/supply-management/components/qrcode-page/qrcode-page.component.ts b/src/app/routes/supply-management/components/qrcode-page/qrcode-page.component.ts index a9567d27..f1681253 100644 --- a/src/app/routes/supply-management/components/qrcode-page/qrcode-page.component.ts +++ b/src/app/routes/supply-management/components/qrcode-page/qrcode-page.component.ts @@ -4,7 +4,7 @@ * @Author : Shiming * @Date : 2021-12-03 11:10:14 * @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 * 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 { SFSchema, SFUISchema } from '@delon/form'; import { NzModalRef } from 'ng-zorro-antd/modal'; +import html2canvas from 'html2canvas'; @Component({ selector: 'app-supply-management-qrcode-page', @@ -23,39 +24,50 @@ export class SupplyManagementQrcodePageComponent implements OnInit { record: any = {}; i: any; schema: SFSchema = {}; + qrCodeValue = ''; ui: SFUISchema = { '*': { spanLabelFixed: 100, - grid: { span: 12 } + grid: { span: 12 }, }, $no: { widget: 'text' }, $href: { - widget: 'string' + widget: 'string', }, $description: { widget: 'textarea', - grid: { span: 24 } - } + grid: { span: 24 }, + }, }; - constructor(private modal: NzModalRef) {} + constructor( + private modal: NzModalRef, + ) { } 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'); - const content = this.qr.dataURL; + const content = contents; let blob = this.base64ToBlob(content); //new Blob([content]); - let evt = document.createEvent('HTMLEvents'); - evt.initEvent('click', true, true); //initEvent 不加后两个参数在IE下会报错 事件类型,是否冒泡,是否阻止浏览器的默认行为 + let evt = document.createEvent("HTMLEvents"); + evt.initEvent("click", true, true);//initEvent 不加后两个参数在IE下会报错 事件类型,是否冒泡,是否阻止浏览器的默认行为 aLink.download = downloadName; aLink.href = URL.createObjectURL(blob); // aLink.dispatchEvent(evt); aLink.click(); + + } //base64转blob @@ -74,4 +86,18 @@ export class SupplyManagementQrcodePageComponent implements OnInit { close(): void { 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); + + }) + } + + } diff --git a/src/app/routes/supply-management/components/release-publish/release-publish.component.html b/src/app/routes/supply-management/components/release-publish/release-publish.component.html index 90b3a193..0a0bbca3 100644 --- a/src/app/routes/supply-management/components/release-publish/release-publish.component.html +++ b/src/app/routes/supply-management/components/release-publish/release-publish.component.html @@ -26,7 +26,7 @@
- 装货地 + 装货地
@@ -36,6 +36,7 @@ (click)="openMap('start', idx)" formControlName="loadAddress{{ idx }}" placeholder="请输入装货地" + readonly="true" /> - 联系人 + 联系人
- 卸货地 + 卸货地
@@ -104,6 +105,7 @@ formControlName="unloadAddress{{ idx }}" placeholder="请输入卸货地" name="unloadAddress{{ idx }}" + readonly="true" /> - 联系人 + 联系人
- 装货时间 + 装货时间 - +
- 卸货时间 + 卸货时间 - +
@@ -335,7 +343,7 @@
-
+
-
+
 天内支付运费
diff --git a/src/app/routes/supply-management/components/release-publish/release-publish.component.ts b/src/app/routes/supply-management/components/release-publish/release-publish.component.ts index df1da26e..41616ab9 100644 --- a/src/app/routes/supply-management/components/release-publish/release-publish.component.ts +++ b/src/app/routes/supply-management/components/release-publish/release-publish.component.ts @@ -2,6 +2,7 @@ import { Component, OnInit, ViewChild } from '@angular/core'; import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; import { ActivatedRoute, Router } from '@angular/router'; import { cacheConf } from '@conf/cache.conf'; +import differenceInCalendarDays from 'date-fns/differenceInCalendarDays'; import { SFCheckboxWidgetSchema, SFComponent, @@ -65,10 +66,10 @@ export class SupplyManagementReleasePublishComponent implements OnInit { this.validateForm1 = fb.group({ loadAddress0: [null, [Validators.required]], loadName0: [null, [Validators.required]], - loadPhone0: [null, [Validators.required,Validators.pattern('^[0-9]*$')]], + loadPhone0: [null, [Validators.required, Validators.pattern('^[0-9]*$')]], unloadAddress0: [null, [Validators.required]], unloadName0: [null, [Validators.required]], - unloadPhone0: [null, [Validators.required,Validators.pattern('^[0-9]*$')]], + unloadPhone0: [null, [Validators.required, Validators.pattern('^[0-9]*$')]], loadingTime: [null, []], unloadingTime: [null, []] }); @@ -89,7 +90,7 @@ export class SupplyManagementReleasePublishComponent implements OnInit { @ViewChild('sf5', { static: false }) sf5!: SFComponent; schema5: SFSchema = {}; ui5!: SFUISchema; - + @ViewChild('sf55', { static: false }) sf55!: SFComponent; schema55: SFSchema = {}; ui55!: SFUISchema; @@ -101,15 +102,24 @@ export class SupplyManagementReleasePublishComponent implements OnInit { @ViewChild('sf7', { static: false }) sf7!: SFComponent; schema7: SFSchema = {}; ui7!: SFUISchema; - formatterRmb = (value: number): string =>{ - if(value){ - let value2 = Number(value).toLocaleString(undefined,{'minimumFractionDigits':2,'maximumFractionDigits':2}); - return `¥ ${value2}`; + limitValues = { + maxWeight: 99999, + maxVolume: 99999, + maxPiece: 99999, + maxDays: 999, + intervalDays: 999, + maxTimes: 999 + }; + + formatterRmb = (value: number): string => { + if (value === null || value === undefined) { + return ''; + } else { + let value2 = Number(value).toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 }); + return `¥${value2}`; } - return `¥ 0.00` - - } ; - parserRmb = (value: string): string => value.replace('¥ ', '').replace(',',''); + }; + parserRmb = (value: string): string => value.replace('¥', '').replace(',', ''); // 页面初始化 ngOnInit(): void { this.initSF1(); @@ -120,6 +130,7 @@ export class SupplyManagementReleasePublishComponent implements OnInit { this.initSF7(); this.addStartInfo(); this.addEndInfo(); + this.getLimitvalue(); } initSF1() { this.schema1 = { @@ -134,9 +145,11 @@ export class SupplyManagementReleasePublishComponent implements OnInit { searchDebounceTime: 300, searchLoadingText: '搜索中...', onSearch: (q: any) => { - if (!!q) { + console.log(q === ' '); + let str = q.replace(/^\s+|\s+$/g, ''); + if (str) { 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)))) .toPromise(); } else { @@ -144,8 +157,12 @@ export class SupplyManagementReleasePublishComponent implements OnInit { } }, change: (q: any) => { - this.getRegionCode(q); - }, + let str = q.replace(/^\s+|\s+$/g, ''); + if (str) { + this.getRegionCode(str); + this.payChange(); + } + } } as SFSelectWidgetSchema }, enterpriseProjectId: { @@ -172,7 +189,8 @@ export class SupplyManagementReleasePublishComponent implements OnInit { widget: 'select', placeholder: '请选择', allowClear: true, - asyncData: () => this.shipperSrv.getNetworkFreightForwarder() + asyncData: () => this.shipperSrv.getNetworkFreightForwarder(), + change: () => this.payChange() } }, externalResourceCode: { @@ -220,7 +238,7 @@ export class SupplyManagementReleasePublishComponent implements OnInit { } as SFSelectWidgetSchema } }, - required: ['shipperAppUserId', 'enterpriseProjectId', 'enterpriseInfoName', ] + required: ['shipperAppUserId', 'enterpriseProjectId', 'enterpriseInfoName'] }; this.ui1 = { '*': { @@ -241,7 +259,7 @@ export class SupplyManagementReleasePublishComponent implements OnInit { ui: { widget: 'select', placeholder: '请选择', - errors: { required: '请选择货物类型' }, + errors: { required: '请选择货物名称' }, asyncData: () => this.shipperSrv.loadConfigByKey('goods.name.config.type').pipe( map((data: any) => { @@ -270,7 +288,7 @@ export class SupplyManagementReleasePublishComponent implements OnInit { widget: 'select', placeholder: '请选择', errors: { required: '请填写货物名称' }, - change: (_value: any, data: any) => { + change: (value: any, data: any) => { this.sf3.setValue('/goodsName', data.label); }, visibleIf: { @@ -299,11 +317,11 @@ export class SupplyManagementReleasePublishComponent implements OnInit { } } }, - required: ['goodsTypeId', 'goodsName', 'goodsNameId'] + required: ['goodsTypeId', 'goodsName', 'goodsNameId', 'goodsName1'] }; this.ui3 = { '*': { - spanLabelFixed: 90, + spanLabelFixed: 115, grid: { span: 12 } } }; @@ -317,7 +335,8 @@ export class SupplyManagementReleasePublishComponent implements OnInit { ui: { widget: 'custom', placeholder: '请输入', - errors: { required: '必填项' } + errors: { required: '必填项' }, + validator: val => this.customValidator(val) } }, volume: { @@ -342,13 +361,13 @@ export class SupplyManagementReleasePublishComponent implements OnInit { ui: { widget: 'select', mode: 'multiple', - maxMultipleCount:3, + maxMultipleCount: 3, placeholder: '请选择车型', errors: { required: '请选择车型' }, asyncData: () => this.service.getDictOptions({ dictKey: 'car:model' }), - change:(tag:any , org:any)=>{ - if(tag.includes("999")){ - this.sf4.setValue('/carModel',["999"]); + change: (tag: any, org: any) => { + if (tag.includes('999')) { + this.sf4.setValue('/carModel', ['999']); } } } @@ -359,43 +378,32 @@ export class SupplyManagementReleasePublishComponent implements OnInit { ui: { widget: 'select', mode: 'multiple', - maxMultipleCount:3, + maxMultipleCount: 3, placeholder: '请选择车长', errors: { required: '请选择车长' }, asyncData: () => this.service.getDictOptions({ dictKey: 'car:length' }), - change:(tag:any , org:any)=>{ - if(tag.includes("999")){ - this.sf4.setValue('/carModel',["999"]); + change: (tag: any, org: any) => { + if (tag.includes('999')) { + this.sf4.setValue('/carLength', ['999']); } } } - }, + } }, required: ['weight', 'carModel', 'carLength'] }; this.ui4 = { '*': { - spanLabelFixed: 90, - grid: { span: 24 } - }, - $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 } + spanLabelFixed: 115, + grid: { span: 8 } }, $carModel: { spanLabelFixed: 100, grid: { span: 8 } - }, - $carLength: { - grid: { span: 8 } } }; } + initSF5() { this.schema5 = { properties: { @@ -403,8 +411,17 @@ export class SupplyManagementReleasePublishComponent implements OnInit { type: 'string', title: '增值服务套餐', ui: { - widget: 'dict-select', - params: { dictKey: 'bill:insurance:type' }, + widget: 'select', + 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' }, @@ -415,7 +432,7 @@ export class SupplyManagementReleasePublishComponent implements OnInit { readOnly: true, ui: { widget: 'checkbox', - visibleIf: { insuranceType: (value: string) => value === '0' } + visibleIf: { insuranceType: (value: string) => value === '1' } } as SFCheckboxWidgetSchema, default: ['车辆实时定位', '轨迹查询', '数据保护', '赠送基本险'] }, @@ -426,7 +443,7 @@ export class SupplyManagementReleasePublishComponent implements OnInit { readOnly: true, ui: { widget: 'checkbox', - visibleIf: { insuranceType: (value: string) => value === '1' } + visibleIf: { insuranceType: (value: string) => value === '2' } } as SFCheckboxWidgetSchema, default: ['车辆实时定位', '轨迹查询', '数据保护', '专属技术服务', '赠送综合险'] }, @@ -438,21 +455,22 @@ export class SupplyManagementReleasePublishComponent implements OnInit { visibleIf: { insuranceType: (value: string) => value !== '3' } } }, - insurancePackagedGoods:{ + insurancePackagedGoods: { type: 'string', title: '货物包装', ui: { widget: 'dict-select', params: { dictKey: 'insure:packaged:goods' }, + containsAllLabel: false, visibleIf: { insuranceType: (value: string) => value !== '3' } } as SFSelectWidgetSchema }, - hidenField:{ + hidenField: { type: 'string', title: '', - default:' ', + default: ' ', ui: { - widget:'text' + widget: 'text' } }, goodsValue: { @@ -469,6 +487,7 @@ export class SupplyManagementReleasePublishComponent implements OnInit { title: '', ui: { widget: 'custom', + validator: val => this.customValidator(val), visibleIf: { insuranceType: (value: string) => value !== '3' } } }, @@ -478,26 +497,27 @@ export class SupplyManagementReleasePublishComponent implements OnInit { ui: { hidden: true } - }, + } }, - required: ['insurancePackagedGoods'] + required: ['insurancePackagedGoods', 'insurancePremium'] }; this.ui5 = { '*': { spanLabelFixed: 115, grid: { span: 12 } }, - $type1:{ + $type1: { grid: { span: 24 } }, - $type2:{ + $type2: { grid: { span: 24 } }, - $freeInsurance:{ + $freeInsurance: { grid: { span: 24 } - }, + } }; } + initSF6() { this.schema6 = { properties: { @@ -520,7 +540,7 @@ export class SupplyManagementReleasePublishComponent implements OnInit { ui: { widget: 'dict-select', params: { dictKey: 'receipt:type' }, - containsAllLable: false, + containsAllLabel: false, placeholder: '请选择', errors: { required: '请选择' }, visibleIf: { @@ -528,58 +548,65 @@ export class SupplyManagementReleasePublishComponent implements OnInit { } } }, - // receiptAddressId: { - // type: 'string', - // title: '选择地址', - // ui: { - // widget: 'custom', - // placeholder: '请点击选择收回单地址', - // // validator: val => (this.sf6?.value?.receiptType === '2' ? [{ keyword: 'required', message: '请点击选择收回单地址' }] : []), - // visibleIf: { - // receiptType: value => value === '2' - // } - // }, - // default: '' - // }, + 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: { type: 'string', title: '联系人', - maxLength: 15, ui: { visibleIf: { receiptType: value => value === '2' } }, + readOnly: true }, - receiptUserPhone: { + phon: { type: 'string', title: '联系电话', - maxLength: 11, ui: { visibleIf: { receiptType: value => value === '2' } }, + readOnly: true }, - receiptAddressArea: { + area: { type: 'string', title: '所在地区', - maxLength: 30, ui: { visibleIf: { receiptType: value => value === '2' } }, + readOnly: true }, - receiptAddress: { + address: { type: 'string', title: '详细地址', - maxLength: 50, ui: { visibleIf: { receiptType: value => value === '2' } }, + readOnly: true }, remarks: { type: 'string', @@ -592,15 +619,16 @@ export class SupplyManagementReleasePublishComponent implements OnInit { } as SFTextareaWidgetSchema } }, - required: ['stateReceipt', 'receiptType', 'receiptUserName','receiptUserPhone','receiptAddressArea','receiptAddress'] + required: ['stateReceipt', 'receiptType', 'receiptAddress'] }; this.ui6 = { '*': { - spanLabelFixed: 90, + spanLabelFixed: 115, grid: { span: 24 } } }; } + initSF7() { this.schema7 = { properties: { @@ -608,19 +636,19 @@ export class SupplyManagementReleasePublishComponent implements OnInit { type: 'number', title: '预付', default: 0, - ui: {widget: 'custom'} + ui: { widget: 'custom' } }, toPay: { type: 'number', title: '到付', default: 0, - ui: { widget: 'custom'} + ui: { widget: 'custom' } }, receiptPay: { type: 'number', title: '回单付', default: 0, - ui: {widget: 'custom'} + ui: { widget: 'custom' } }, subtotal: { type: 'number', title: '小计', default: 0, ui: { widget: 'custom' } as SFNumberWidgetSchema }, appendFee: { type: 'number', title: '附加费', default: 0, ui: { widget: 'custom' } as SFNumberWidgetSchema }, @@ -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) { console.log(regionCode); @@ -663,37 +742,40 @@ export class SupplyManagementReleasePublishComponent implements OnInit { } payChange() { 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 oilCardPay = 0; + const oilCardPay = 0; const subtotal = prePay + toPay + receiptPay; const params = { - shipperId: this.envCache?.enterpriseId, - enterpriseInfoId: this.envCache?.networkTransporterId, - totalFreight:subtotal, - // fuelCardAmount:oilCardPay, - resourcetype:'1' - } - this.service - .request(this.service.$api_getCalculatedSurcharge,params) - .subscribe(res => { - if (res) { - this.sf7.setValue('/appendFee', res.surcharge); - this.sf7.setValue('/subtotal', subtotal); - this.sf7.setValue('/total', subtotal + res.surcharge); - this.service - .request(this.service.$api_getcalculatedServiceRate + `?invoiceAmount=${subtotal + res.surcharge}&totalFreight=${subtotal}`) - .subscribe(res => { - if (res) { - this.currentRate = res.rate * 100; - } else { - this.service.msgSrv.error(res.msg); - } - }); - } else { - this.service.msgSrv.error(res.msg); - } - }); + shipperId: this?.sf1.value?.shipperAppUserId, + enterpriseInfoId: this?.sf1.value?.enterpriseInfoName || '', + totalFreight: subtotal, + fuelCardAmount: oilCardPay, + resourcetype: '1' + }; + this.service.request(this.service.$api_getCalculatedSurcharge, params).subscribe(res => { + console.log('999'); + console.log(this?.sf1.value); + if (res) { + this.sf7.setValue('/appendFee', res.surcharge); + this.sf7.setValue('/subtotal', subtotal); + this.sf7.setValue('/total', subtotal + res.surcharge); + this.service + .request( + this.service.$api_getAdditionalRate + + `?shipperId=${this?.sf1.value?.shipperAppUserId || ''}&enterpriseInfoId=${ + this?.sf1.value?.enterpriseInfoName || '' + }&resourcetype='1'` + ) + .subscribe(res => { + if (res) { + this.currentRate = res.rate * 100; + } + }); + } else { + this.service.msgSrv.error(res.msg); + } + }); } // 添加 删除发货卸货地址 addStartInfo() { @@ -775,65 +857,136 @@ export class SupplyManagementReleasePublishComponent implements OnInit { 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.sf5.validator({ emitError: true }); this.sf6.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; } - const modalRef = this.modalService.create({ - nzTitle: '运输协议', - nzContent: TranAgreementComponent, - nzWidth: 900, - nzFooter: null - }); - modalRef.afterClose.subscribe(result => { - if (result) { - this.submit(submitType); + 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); } }); } - // 提交 - submit(submitType: string): void { + // 提交前协议弹窗 + agreementConfirm(submitType?: string) { //装卸货信息 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.sf3.value, carModel: this.sf4.value.carModel.join(','), carLength: this.sf4.value.carLength.join(',') } ]; // 运费信息 const expenseList = [ - { expenseCode: 'PRE', expenseName: '预付', price: this.sf7.value.prePay, id: this.sf7data?.prePayId ? this.sf7data?.prePayId : '' }, - { expenseCode: 'RECE', expenseName: '到付', price: this.sf7.value.toPay, id: this.sf7data?.toPayId ? this.sf7data?.toPayId : '' }, - { - expenseCode: 'BACK', - expenseName: '回单付', - price: this.sf7.value.receiptPay, - id: this.sf7data?.receiptPayId ? this.sf7data?.receiptPayId : '' - } + { 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 || '' } ]; + 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 = { 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, + goodsInfoDTOList: goodsInfoVOList, ...this.sf5.value, ...this.sf6.value, expenseDTOList: expenseList, - paymentDays: this.sf7.value.paymentDays, - insuranceType:this.sf55.value.insuranceType, + paymentDays: this.sf7.value.paymentDays }; - + 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; if (submitType) { if (submitType == 'assign') { @@ -983,6 +1136,8 @@ export class SupplyManagementReleasePublishComponent implements OnInit { if (this.sf3data.goodsNameId) { this.sf3.setValue('/goodsNameId', this.sf3data.goodsNameId); } + } else { + this.service.msgSrv.error(res.msg); } }); } @@ -990,87 +1145,61 @@ export class SupplyManagementReleasePublishComponent implements OnInit { goBack() { window.history.go(-1); } - // 装卸货地址互换 - swapAddress(){ - this.startInfo.forEach((element:any, index:any) => { - this.validateForm1.removeControl(`loadAddress${index}`); - this.validateForm1.removeControl(`loadName${index}`); - this.validateForm1.removeControl(`loadPhone${index}`); - }); - this.endInfo.forEach((element:any, index:any) => { - this.validateForm1.removeControl(`unloadAddress${index}`); - this.validateForm1.removeControl(`unloadName${index}`); - this.validateForm1.removeControl(`unloadPhone${index}`); - }); - - let item = this.startInfo; - this.startInfo = this.endInfo; - this.endInfo = item; - - this.startInfo.forEach((element:any,index:any) => { - element.type = '1'; - this.validateForm1.addControl(`loadAddress${index}`, new FormControl(null, Validators.required)); - this.validateForm1.addControl(`loadName${index}`, new FormControl(null, Validators.required)); - this.validateForm1.addControl(`loadPhone${index}`, new FormControl(null, [Validators.required, Validators.pattern('^[0-9]*$')])); - }); - this.endInfo.forEach((element:any,index:any) => { - element.type = '2'; - this.validateForm1.addControl(`unloadAddress${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]*$')])); - }); - - // 计算里程,时间 - if (this.startInfo[0]?.area && this.endInfo[0]?.area) { + // 装卸货地址互换 + swapAddress() { + this.startInfo.forEach((element: any, index: any) => { + this.validateForm1.removeControl(`loadAddress${index}`); + this.validateForm1.removeControl(`loadName${index}`); + this.validateForm1.removeControl(`loadPhone${index}`); + }); + this.endInfo.forEach((element: any, index: any) => { + this.validateForm1.removeControl(`unloadAddress${index}`); + this.validateForm1.removeControl(`unloadName${index}`); + this.validateForm1.removeControl(`unloadPhone${index}`); + }); + + let item = this.startInfo; + this.startInfo = this.endInfo; + this.endInfo = item; + + this.startInfo.forEach((element: any, index: any) => { + element.type = '1'; + this.validateForm1.addControl(`loadAddress${index}`, new FormControl(null, Validators.required)); + this.validateForm1.addControl(`loadName${index}`, new FormControl(null, Validators.required)); + this.validateForm1.addControl(`loadPhone${index}`, new FormControl(null, [Validators.required, Validators.pattern('^[0-9]*$')])); + }); + this.endInfo.forEach((element: any, index: any) => { + element.type = '2'; + this.validateForm1.addControl(`unloadAddress${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]*$')])); + }); + // 计算里程,时间 + 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(); //计算保费金额 }); } - } - goodsValuesChange(value: any) { - console.log(value); - console.log(this.totalDistance); - - 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; + } + // 计算保价费金额 + getInsurersPrice(insuranceType = this.sf5.value.insuranceType) { + if (this.sf5.value.goodsValue >= 50000 && this.totalDistance > 0) { + const params = { + insuranceType, + goodsValue: this.sf5.value.goodsValue, + km: this.totalDistance + }; + this.service.request(this.service.$api_getWholeInsuranceInfo, params).subscribe(res => { + if (res) { + this.sf5.setValue('/insurancePremium', res.insurancePremium); + this.sf5.setValue('/insuranceRate', res.insuranceRate); + } else { + this.sf5.setValue('/insurancePremium', null); + this.sf5.setValue('/insuranceRate', null); } - const params = { - goodsValue: this.sf5.value.goodsValue, - insuranceType: this.sf5.value.insuranceType, - km: this.totalDistance - }; - this.service.request(this.service.$api_getWholeInsuranceInfo, params).subscribe(res => { - if (res) { - this.sf5.setValue('/insurancePremium', res.insurancePremium); - this.sf5.setValue('/insuranceRate', res.insuranceRate); - } else { - this.sf5.setValue('/insurancePremium', null); - this.sf5.setValue('/insuranceRate', null); - } - }); - } + }); } + } } diff --git a/src/app/routes/supply-management/components/tran-agreement/tran-agreement.component.html b/src/app/routes/supply-management/components/tran-agreement/tran-agreement.component.html index 156e8383..025765ab 100644 --- a/src/app/routes/supply-management/components/tran-agreement/tran-agreement.component.html +++ b/src/app/routes/supply-management/components/tran-agreement/tran-agreement.component.html @@ -1,5 +1,5 @@

- {{ agreement?.agreementName }} +

diff --git a/src/app/routes/supply-management/components/tran-agreement/tran-agreement.component.ts b/src/app/routes/supply-management/components/tran-agreement/tran-agreement.component.ts index 12018aa6..05977ab4 100644 --- a/src/app/routes/supply-management/components/tran-agreement/tran-agreement.component.ts +++ b/src/app/routes/supply-management/components/tran-agreement/tran-agreement.component.ts @@ -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 : * @Version : 1.0 * @Author : Shiming * @Date : 2022-01-06 15:01:40 * @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 * Copyright (C) 2022 huzhenhong. All rights reserved. */ @@ -18,16 +28,37 @@ import { SupplyManagementService } from '../../services/supply-management.servic styleUrls: ['./tran-agreement.component.less'] }) export class TranAgreementComponent { - + Object: any; agreement:any; constructor(private modal: NzModalRef,public service: SupplyManagementService,) { } 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) { - this.agreement = res; + + this.agreement = res.contractContent; } }); } diff --git a/src/app/routes/supply-management/components/update-price/update-price.component.ts b/src/app/routes/supply-management/components/update-price/update-price.component.ts index 41494016..0c41962e 100644 --- a/src/app/routes/supply-management/components/update-price/update-price.component.ts +++ b/src/app/routes/supply-management/components/update-price/update-price.component.ts @@ -79,6 +79,10 @@ export class SupplyManagementUpdatePriceComponent implements OnInit { spanLabelFixed: 100, grid: { span: 16 }, }, + '$rule': { + spanLabelFixed: 120, + grid: { span: 16 }, + }, }; } diff --git a/src/app/routes/supply-management/components/vehicle-detail/vehicle-detail.component.html b/src/app/routes/supply-management/components/vehicle-detail/vehicle-detail.component.html index f03c553c..28c6636e 100644 --- a/src/app/routes/supply-management/components/vehicle-detail/vehicle-detail.component.html +++ b/src/app/routes/supply-management/components/vehicle-detail/vehicle-detail.component.html @@ -7,31 +7,55 @@
- +

货源编码 : {{ i?.resourceCode }}

-
网络货运人:{{i?.enterpriseInfoName}}
+
网络货运人:{{ i?.enterpriseInfoName }}
- - - - + + + +
- 总费用:{{i?.totalAmount | currency: '¥'}} + 总费用:{{ i?.totalAmount | currency: '¥' }}
{{ i?.externalResourceCode }} - {{i?.enterpriseProjectName}} - {{i?.createUserName}}/{{i?.createUserPhone}} - {{i?.dispatchName}}/{{i?.dispatchPhone}} - {{i?.serviceTypeLabel}} + {{ i?.enterpriseProjectName }} + {{ i?.createUserName }}/{{ i?.createUserPhone }} + {{ i?.dispatchName }}/{{ i?.dispatchPhone }} + {{ i?.serviceTypeLabel }}
@@ -39,46 +63,61 @@
- - - + + +
- 货物信息 - {{item.goodsName}} - - - {{item.weight}}吨,{{item.volume}}方,{{item.number}}件 + {{ item.goodsName }} + {{ item.weight }}吨,{{ item.volume }}方,{{ item.number }}件 承运信息 - {{i?.carrierInformationVO?.driverName}} + {{ i?.carrierInformationVO?.driverName }} - {{i?.carrierInformationVO?.driverTelephone}} + {{ i?.carrierInformationVO?.driverTelephone }} - {{i?.carrierInformationVO?.driverLicensePlate}} + {{ i?.carrierInformationVO?.driverLicensePlate }}
-

装货卸货信息 - ( - - +

装货卸货信息 + ( + + )

@@ -89,12 +128,12 @@
-

装货地:{{item?.province}}{{item?.city}}{{item?.area}}{{item?.detailedAddress}}

-

联系人:{{item?.appUserName}}/{{item?.contractTelephone}}

+

装货地:{{ item?.province }}{{ item?.city }}{{ item?.area }}{{ item?.detailedAddress }}

+

联系人:{{ item?.appUserName }}/{{ item?.contractTelephone }}

-

装货时间:{{i?.loadingTime}}

+

装货时间:{{ i?.loadingTime }}

@@ -103,12 +142,12 @@
-

卸货地:{{item?.province}}{{item?.city}}{{item?.area}}{{item?.detailedAddress}}

-

联系人:{{item?.appUserName}}/{{item?.contractTelephone}}

+

卸货地:{{ item?.province }}{{ item?.city }}{{ item?.area }}{{ item?.detailedAddress }}

+

联系人:{{ item?.appUserName }}/{{ item?.contractTelephone }}

-

卸货时间:{{i?.unloadingTime}}

+

卸货时间:{{ i?.unloadingTime }}

@@ -118,27 +157,25 @@ - {{i?.insuranceTypeLabel}} + {{ i?.insuranceTypeLabel }} - {{i?.goodsValue |currency}} - - - {{i?.insurancePremium |currency}} 元 + {{ i?.goodsValue | currency }} + {{ i?.insurancePremium | currency }} 元 - - + +
- {{item?.totalAmount | currency}} + {{ item?.totalAmount | currency }} (含附加费)
- {{item?.price | currency}} + {{ item?.price | currency }}
@@ -147,9 +184,9 @@

- {{(i?.totalAmount) | currency}} + {{ i?.totalAmount | currency }} - (运费{{i?.totalFreight | currency}}含附加运费 {{i?.totalSurcharge| currency}}) + (运费{{ i?.totalFreight | currency }}含附加运费 {{ i?.totalSurcharge | currency }})

收款人:{{ i?.payeeName }}/{{ i?.payeePhone }}/{{ i?.payeeCardNo }}
@@ -158,24 +195,27 @@ - {{i?.supplementaryInformationVO?.stateReceipt?'是':'否'}} + {{ i?.supplementaryInformationVO?.stateReceipt ? '是' : '否' }} {{ i?.supplementaryInformationVO?.receiptType === '1' ? '电子回单' : '纸质回单' }} - {{i?.supplementaryInformationVO?.area}} + {{ i?.supplementaryInformationVO?.area }} - {{i?.supplementaryInformationVO?.address}} + {{ i?.supplementaryInformationVO?.address }} - {{i?.supplementaryInformationVO?.remarks}} + {{ i?.supplementaryInformationVO?.remarks }} - - + +
diff --git a/src/app/routes/supply-management/components/vehicle-detail/vehicle-detail.component.ts b/src/app/routes/supply-management/components/vehicle-detail/vehicle-detail.component.ts index b70c8827..ce6a9c05 100644 --- a/src/app/routes/supply-management/components/vehicle-detail/vehicle-detail.component.ts +++ b/src/app/routes/supply-management/components/vehicle-detail/vehicle-detail.component.ts @@ -17,15 +17,15 @@ export class SupplyManagementVehicleDetailComponent implements OnInit { id = this.route.snapshot.params.id; i: any; - logColumns: STColumn[] = [ - { title: '内容', index: 'theme' }, - { title: '操作人', index: 'operationUserPhone' }, - { title: '操作时间', index: ' createTime' }, - ]; serviceType: any = { 1: '抢单', 2: '指派' } + logColumns: STColumn[] = [ + { title: '内容', index: 'operationContent' }, + { title: '操作人', index: 'operator' }, + { title: '操作时间', index: 'operatorTimestamp' }, + ]; totalObj: any; attObj: any; status: any = { 1: '待接单', 2: '已接单', 3: '已取消' }; @@ -50,11 +50,16 @@ export class SupplyManagementVehicleDetailComponent implements OnInit { render: 'price' }, ]; - + get reqParams() { + return { + operateObject: this.i?.resourceCode, + operateType: 4, + }; + } constructor( private route: ActivatedRoute, private msgSrv: NzMessageService, - private service: SupplyManagementService, + public service: SupplyManagementService, public modal: NzModalService, public router: Router ) { diff --git a/src/app/routes/supply-management/components/vehicle/vehicle.component.html b/src/app/routes/supply-management/components/vehicle/vehicle.component.html index 8b6ff33a..7baaf88d 100644 --- a/src/app/routes/supply-management/components/vehicle/vehicle.component.html +++ b/src/app/routes/supply-management/components/vehicle/vehicle.component.html @@ -4,7 +4,7 @@ * @Author : Shiming * @Date : 2022-01-12 10:52:50 * @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 * Copyright (C) 2022 huzhenhong. All rights reserved. --> @@ -31,8 +31,8 @@ [acl-ability]="['SUPPLY-INDEX-vehicleSearch']" >查询 - - + + +
+ + 下载导入模板 +
仅支持XLS / XLSX文件格式,最多不能超过100行数据
+ + +
+

注意:

+

1、第一次上传请点击下载模板

+

2、请不要调整模板顺序

+

3、必填字段请务必填写

+

4、如果不清楚字段值,请参考货源发布功能

+

5、发布成功后,可在货源列表-待接单查看

+
+
+
+ 文件上传成功!成功xx条,失败xx条! +
+ diff --git a/src/app/routes/supply-management/model/import-supply/import-supply.component.spec.ts b/src/app/routes/supply-management/model/import-supply/import-supply.component.spec.ts new file mode 100644 index 00000000..65a74b1c --- /dev/null +++ b/src/app/routes/supply-management/model/import-supply/import-supply.component.spec.ts @@ -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; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ SupplyManagementImportSupplyComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(SupplyManagementImportSupplyComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/supply-management/model/import-supply/import-supply.component.ts b/src/app/routes/supply-management/model/import-supply/import-supply.component.ts new file mode 100644 index 00000000..7b22de6e --- /dev/null +++ b/src/app/routes/supply-management/model/import-supply/import-supply.component.ts @@ -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) => { + // 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); + } +} diff --git a/src/app/routes/supply-management/services/supply-management.service.ts b/src/app/routes/supply-management/services/supply-management.service.ts index 04ff9de7..303b6a46 100644 --- a/src/app/routes/supply-management/services/supply-management.service.ts +++ b/src/app/routes/supply-management/services/supply-management.service.ts @@ -4,7 +4,7 @@ * @Author : Shiming * @Date : 2021-12-03 11:10:14 * @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 * Copyright (C) 2022 huzhenhong. All rights reserved. */ @@ -54,6 +54,8 @@ export class SupplyManagementService extends BaseService { $api_getCalculatedSurcharge = `/api/sdc/expense/getCalculatedSurcharge`; // 整车计算附加费率 $api_getcalculatedServiceRate = `/api/sdc/expense/getAdditionalRate`; + // 整车计算附加费率 + $api_getAdditionalRate = `/api/sdc/expense/getAdditionalRate`; // 代发整车货源 $api_consignWhole = `/api/sdc/goodsResourceOperate/consignWhole`; // 代发大宗货源 @@ -111,8 +113,12 @@ export class SupplyManagementService extends BaseService { public $api_getOperationLogRecordsList = '/api/mdc/pbc/operationLogRecords/getOperationLogRecordsList'; // 获取数据字典 $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 @@ -132,6 +138,33 @@ export class SupplyManagementService extends BaseService { constructor(public injector: 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_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'; } diff --git a/src/app/routes/supply-management/supply-management.module.ts b/src/app/routes/supply-management/supply-management.module.ts index 7ab115ec..54388605 100644 --- a/src/app/routes/supply-management/supply-management.module.ts +++ b/src/app/routes/supply-management/supply-management.module.ts @@ -4,7 +4,7 @@ * @Author : Shiming * @Date : 2021-12-20 10:13:02 * @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 * 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 { SupplyManagementVehicleDetailComponent } from './components/vehicle-detail/vehicle-detail.component'; import { SupplyManagementVehicleComponent } from './components/vehicle/vehicle.component'; +import { SupplyManagementImportSupplyComponent } from './model/import-supply/import-supply.component'; import { SupplyManagementRoutingModule } from './supply-management-routing.module'; const COMPONENTS: Type[] = [ @@ -61,7 +62,8 @@ const COMPONENTS: Type[] = [ SupplyManagementReleasePublishComponent, SupplyManagementBulkReleasePublishComponent, TranAgreementComponent, - SupplyManagementBulkAssignedCarComponent + SupplyManagementBulkAssignedCarComponent, + SupplyManagementImportSupplyComponent ]; @NgModule({ diff --git a/src/app/routes/sys-setting/components/close-account/close-account.component.ts b/src/app/routes/sys-setting/components/close-account/close-account.component.ts index 8a61d047..427b1bf5 100644 --- a/src/app/routes/sys-setting/components/close-account/close-account.component.ts +++ b/src/app/routes/sys-setting/components/close-account/close-account.component.ts @@ -159,10 +159,10 @@ export class CloseAccountComponent implements OnInit { searchDebounceTime: 300, searchLoadingText: '搜索中...', onSearch: (q: any) => { - console.log(q) - if (!!q) { + let str =q.replace(/^\s+|\s+$/g,""); + if (str) { 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)))) .toPromise(); } else { diff --git a/src/app/routes/sys-setting/components/network-freight/network-freight.component.ts b/src/app/routes/sys-setting/components/network-freight/network-freight.component.ts index 3d86fbce..ec676d98 100644 --- a/src/app/routes/sys-setting/components/network-freight/network-freight.component.ts +++ b/src/app/routes/sys-setting/components/network-freight/network-freight.component.ts @@ -244,12 +244,12 @@ export class NetworkFreightComponent implements OnInit { ui: { placeholder: '请输入' } }, invoiceTaxRate: { - type: 'string', + type: 'number', title: '发票税率', ui: { placeholder: '请输入' } }, invoiceMaxAmount: { - type: 'string', + type: 'number', title: '发票面额上限', ui: { placeholder: '请输入' } }, @@ -326,7 +326,10 @@ export class NetworkFreightComponent implements OnInit { 'drawer' ] }; - this.ui3 = { '*': { spanLabelFixed: 120, grid: { span: 24 } } }; + this.ui3 = { + '*': { spanLabelFixed: 120, grid: { span: 24 } }, + '$taxClassificationVersion': { spanLabelFixed: 150, grid: { span: 24 } }, + }; } initSFTax() { this.TaxSchema = { @@ -363,7 +366,7 @@ export class NetworkFreightComponent implements OnInit { ui: { placeholder: '请输入' } }, invoiceTaxRate: { - type: 'string', + type: 'number', title: '发票税率', ui: { placeholder: '请输入' } }, @@ -574,7 +577,7 @@ export class NetworkFreightComponent implements OnInit { } // 新增 creat(value?: any) { - console.log(value) - this.router.navigate(['./new/'+ value?.id], { relativeTo: this.ar }); + console.log(value); + this.router.navigate(['./new/' + value?.id], { relativeTo: this.ar }); } } diff --git a/src/app/routes/sys-setting/components/network-freight/new/new.component.ts b/src/app/routes/sys-setting/components/network-freight/new/new.component.ts index 63df1d8c..6ed3a65e 100644 --- a/src/app/routes/sys-setting/components/network-freight/new/new.component.ts +++ b/src/app/routes/sys-setting/components/network-freight/new/new.component.ts @@ -148,12 +148,12 @@ export class NetworkFreightNewComponent implements OnInit { }); } submitForm() { - // if (!this.sf1.valid || !this.sf.valid) { - // this.sf.validator({ emitError: true }); - // this.sf1.validator({ emitError: true }); - // this.service.msgSrv.warning('请修改填写错误信息'); - // return; - // } + if (!this.sf1.valid || !this.sf.valid) { + this.sf.validator({ emitError: true }); + this.sf1.validator({ emitError: true }); + this.service.msgSrv.warning('请填写必填项!'); + return; + } const enterpriseRegistrationTime = new Date(this.sf1.value.enterpriseRegistrationTime); const operatingStartTime = new Date(this.sf1.value.operatingStartTime); 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: [ diff --git a/src/app/routes/sys-setting/components/role-management/edit/edit.component.ts b/src/app/routes/sys-setting/components/role-management/edit/edit.component.ts index 29c5ec89..683be185 100644 --- a/src/app/routes/sys-setting/components/role-management/edit/edit.component.ts +++ b/src/app/routes/sys-setting/components/role-management/edit/edit.component.ts @@ -83,14 +83,11 @@ export class SettingRoleEditComponent implements OnInit { this.service.msgSrv.warning('校验错误'); return; } - // this.menu.washTree(); - // if (this.authorityAssistId.length === 0) { - // this.service.msgSrv.warning('请选择权限!'); - // return; - // } - console.log(this.params); - const auths = this.menu?.washTree(); + if (auths.authorityAssistId.length === 0) { + this.service.msgSrv.warning('请选择权限!'); + return; + } const params: any = { id: this.params.id, ...this.sf.value, diff --git a/src/app/routes/sys-setting/components/role-management/menu/menu.component.html b/src/app/routes/sys-setting/components/role-management/menu/menu.component.html index 05ab3b8e..9c6d6e48 100644 --- a/src/app/routes/sys-setting/components/role-management/menu/menu.component.html +++ b/src/app/routes/sys-setting/components/role-management/menu/menu.component.html @@ -6,45 +6,14 @@
-
- +
- -
- -
- - - - - - - - - - - - - - -
-

此应用功能模块无数据权限限制,如需添加,请联系系统管理员。

+ +
diff --git a/src/app/routes/sys-setting/components/role-management/menu/menu.component.ts b/src/app/routes/sys-setting/components/role-management/menu/menu.component.ts index 23dfd6f7..f867aee9 100644 --- a/src/app/routes/sys-setting/components/role-management/menu/menu.component.ts +++ b/src/app/routes/sys-setting/components/role-management/menu/menu.component.ts @@ -18,6 +18,8 @@ export class SettingMenuComponent implements OnInit, OnChanges { defaultExpandedKeys: any[] = []; defaultCheckedKeys: any[] = []; functionList: any[] = []; + allChecked = false; + indeterminate = true; @Input() type = 'edit'; @Input() source = ''; @Input() appId = this.envSrv.env.appId; @@ -51,13 +53,14 @@ export class SettingMenuComponent implements OnInit, OnChanges { // } this.functionList = res; this.defaultCheckedKeys = this.authorityAssistId; + this.cdr.detectChanges(); }); } 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存在权限列表里 - this.authority.forEach((menuItem, menuIndex) => { + this.authority.forEach(menuItem => { if (menuItem.authorityId === origin.id) { menuItem.buttonAuthorityIds = menuItem.buttonAuthorityIds || []; // 防止属性不存在,给属性指定数据类型 if (item) { @@ -103,7 +106,7 @@ export class SettingMenuComponent implements OnInit, OnChanges { // 全选 buttonAuthorityIds.push(item.functionButtonId); } else { - node.buttonInfoList.forEach((nodeItem: { id: any; checked: boolean }) => { + node.buttonInfoList.forEach((nodeItem: { id: any; checked: boolean; _isHalfChecked: boolean }) => { if (origin.all) { buttonAuthorityIds.push(nodeItem.id); nodeItem.checked = true; @@ -112,13 +115,13 @@ export class SettingMenuComponent implements OnInit, OnChanges { } const obj: any = { authorityId: origin.id, - buttonAuthorityIds, - dataAuthority: [] + buttonAuthorityIds }; this.authority.push(obj); } this.checkTreeNode(node, origin); } + addDict(item: { checked: any; itemId: any; itemKey: any }, dictItem: { dictId: any }, origin: { id: any }, node: any) { if (this.authority.length) { // 判断此菜单权限是否已经存在权限列表中 @@ -271,7 +274,7 @@ export class SettingMenuComponent implements OnInit, OnChanges { children.forEach((item: any) => { this.authorityAssistId.push(item.key); tempAuthorityIdDTOListMenu.push(item.key); - authorityMenu.push({ authorityId: item.key }); + authorityMenu.push({ authorityId: item.key, isUpdateAuthority: 1 }); if (item.isLeaf) { return; } @@ -282,6 +285,26 @@ export class SettingMenuComponent implements OnInit, OnChanges { } 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 = { id }; @@ -296,25 +319,57 @@ export class SettingMenuComponent implements OnInit, OnChanges { } // 再次请求,需要判断暂存权限数组是否已有此权限 againGetBtn(id: any, origin: any) { - if (this.authority.length === 0) { - return; - } - this.authority.forEach(item => { - if (item.authorityId === id) { - // 如果当前菜单Id等于暂存权限数组的Id - if (item.buttonAuthorityIds && item.buttonAuthorityIds.length) { - // 如果当前菜单Id权限数组不为空 - origin.buttonInfoList.forEach((btnItem: { functionButtonId: any; checked: boolean }) => { - // 判断已有权限id是否存在 - if (item.buttonAuthorityIds.indexOf(btnItem.functionButtonId) !== -1) { - btnItem.checked = true; - } else { - btnItem.checked = false; + if (this.authority && this.authority.length === 0) { + 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 => { + if (item.authorityId === id) { + // 如果当前菜单Id存在权限列表里,并且等于暂存权限数组的Id + if (item.buttonAuthorityIds && item.buttonAuthorityIds.length) { + // 如果当前菜单Id权限数组不为空 + origin.buttonInfoList.forEach((btnItem: { functionButtonId: any; checked: boolean }) => { + // 判断已有权限id是否存在 + if (item.buttonAuthorityIds.indexOf(btnItem.functionButtonId) !== -1) { + btnItem.checked = true; + } else { + btnItem.checked = false; + } + }); + } } }); + } 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) { diff --git a/src/app/routes/ticket-management/components/cancellation-invoice/cancellation-invoice.component.ts b/src/app/routes/ticket-management/components/cancellation-invoice/cancellation-invoice.component.ts index d425a8e1..d5ff6af0 100644 --- a/src/app/routes/ticket-management/components/cancellation-invoice/cancellation-invoice.component.ts +++ b/src/app/routes/ticket-management/components/cancellation-invoice/cancellation-invoice.component.ts @@ -115,7 +115,7 @@ export class CancellationInvoiceComponent implements OnInit { */ batchPush() { if (this.selectedRows?.length <= 0) { - this.service.msgSrv.warning('请选择开票申请'); + this.service.msgSrv.warning('请选择推送开票单'); return; } if (this.selectedRows.find(item => item.sts !== '1')) { @@ -204,7 +204,7 @@ export class CancellationInvoiceComponent implements OnInit { const modal = this.nzModalService.create({ nzTitle: '推送开票', nzContent: PushInvoiceComponent, - nzComponentParams: { id: item.id }, + nzComponentParams: { id: item.vatappHId }, nzWidth: 1200, nzOnOk: () => { this.service.request(this.service.$api_push_invoic, { id: item.id }).subscribe(res => { @@ -314,22 +314,22 @@ export class CancellationInvoiceComponent implements OnInit { private initST(): STColumn[] { return [ { title: '', index: 'key', type: 'checkbox', fixed: 'left', width: 50, className: 'text-center' }, - { title: '分票编号', render: 'vatinvcode', width: 160 }, + { title: '分票编号', render: 'vatinvcode', width: 200 }, { title: '申请编号', index: 'vatappHCode', - width: 120, + width: 150, type: 'link', click: item => this.router.navigate(['/ticket/invoice-requested/detail/' + item?.vatappHId]) }, { title: '申请时间', index: 'createTime', type: 'date', width: 150 }, - { title: '网络货运人', index: 'ltdName', width: 120 }, - { title: '购买人', index: 'artoname', width: 90 }, + { title: '网络货运人', index: 'ltdName', width: 160 }, + { title: '购买人', index: 'artoname', width: 160 }, { title: '订单数', index: 'ordlines', width: 90, className: 'text-right' }, { title: '价税合计', index: 'vatmoney', - width: 120, + width: 140, type: 'widget', className: 'text-right font-weight-bold', widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.vatmoney }) } @@ -337,7 +337,7 @@ export class CancellationInvoiceComponent implements OnInit { { title: '金额', index: 'vatnotax', - width: 100, + width: 140, type: 'widget', className: 'text-right', widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.vatnotax }) } @@ -345,27 +345,28 @@ export class CancellationInvoiceComponent implements OnInit { { title: '税率', index: 'billvatrate', - width: 90, + width: 120, className: 'text-right', format: item => `${item.billvatrate ? ((item.billvatrate as number) * 100).toFixed(2) : 0}%` }, { title: '税额', index: 'vattax', - width: 90, + width: 140, type: 'widget', className: 'text-right', widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.vattax }) } }, - { title: '服务名称', index: 'vatname', width: 100 }, - { title: '销货清单', index: 'isdetail', width: 90, type: 'enum', enum: { 1: '是', 0: '否' }, className: 'text-center' }, + { title: '服务名称', index: 'vatname', width: 120 }, + { title: '销货清单', index: 'isdetail', width: 120, type: 'enum', enum: { 1: '是', 0: '否' }, className: 'text-center' }, { title: '票面备注', index: 'remarks', width: 250 }, { title: '其他要求', index: 'otherremarks', width: 100 }, { title: '操作', - width: '100px', + width: '120px', fixed: 'right', buttons: [ + { type: 'divider' }, { text: '查看明细', click: item => diff --git a/src/app/routes/ticket-management/components/cancellation-invoice/push-invoice/push-invoice.component.html b/src/app/routes/ticket-management/components/cancellation-invoice/push-invoice/push-invoice.component.html index 86dbbfdd..f4ace5d8 100644 --- a/src/app/routes/ticket-management/components/cancellation-invoice/push-invoice/push-invoice.component.html +++ b/src/app/routes/ticket-management/components/cancellation-invoice/push-invoice/push-invoice.component.html @@ -4,42 +4,42 @@ {{info?.artoName}} - {{info?.artotaxno}} + {{info?.taxNumber}} - {{info?.artoadd}} + {{info?.registerAddr}} - {{info?.artotel}} + {{info?.registerPhone}} - {{info?.artobank}} + {{info?.bankName}} - {{info?.artoacc}} + {{info?.bankAccount}} - {{info?.remarks}} + {{info?.vatremarks}}
- {{info?.shipperId}} + {{info?.ltdidName}} - {{info?.vatinvcode}} + {{info?.vatappcode}} - {{info?.ordlines}}笔 + {{info?.vatinvBillNum}}笔 - {{info?.vatmoney}}元 + {{info?.vatinvHNumAmount | currency}}元 - {{info?.vatname}} + {{info?.vatnameLabel}} - {{info?.isdetail}} + {{info?.isdetail?'是':'否'}} {{info?.otherremarks}} diff --git a/src/app/routes/ticket-management/components/cancellation-invoice/push-invoice/push-invoice.component.ts b/src/app/routes/ticket-management/components/cancellation-invoice/push-invoice/push-invoice.component.ts index 6b164d08..dec8b28f 100644 --- a/src/app/routes/ticket-management/components/cancellation-invoice/push-invoice/push-invoice.component.ts +++ b/src/app/routes/ticket-management/components/cancellation-invoice/push-invoice/push-invoice.component.ts @@ -13,7 +13,7 @@ import { TicketService } from '../../../services/ticket.service'; export class PushInvoiceComponent implements OnInit { @ViewChild('st', { static: false }) st!: STComponent; - columns: STColumn[] = this.initST(); + columns!: STColumn[]; info: any = {}; id!: number; @@ -22,6 +22,9 @@ export class PushInvoiceComponent implements OnInit { ngOnInit(): void { this.loadHeader(this.id); + setTimeout(() => { + this.columns = this.initST(); + }, 100); } beforeReq = (requestOptions: STRequestOptions) => { diff --git a/src/app/routes/ticket-management/components/invoice-detail/invoice-detail.component.html b/src/app/routes/ticket-management/components/invoice-detail/invoice-detail.component.html index 542c9eb7..fdd1d5bf 100644 --- a/src/app/routes/ticket-management/components/invoice-detail/invoice-detail.component.html +++ b/src/app/routes/ticket-management/components/invoice-detail/invoice-detail.component.html @@ -25,10 +25,10 @@ {{ headerInfo?.invoicedate }} - {{ headerInfo?.vatmoney }} + {{ headerInfo?.vatmoney | currency }} - {{ headerInfo?.vattax }} + {{ headerInfo?.vattax | currency }}
diff --git a/src/app/routes/ticket-management/components/invoice-requested/invoice-requested-detail/invoice-requested-detail.component.html b/src/app/routes/ticket-management/components/invoice-requested/invoice-requested-detail/invoice-requested-detail.component.html index 82501843..04e52e6a 100644 --- a/src/app/routes/ticket-management/components/invoice-requested/invoice-requested-detail/invoice-requested-detail.component.html +++ b/src/app/routes/ticket-management/components/invoice-requested/invoice-requested-detail/invoice-requested-detail.component.html @@ -8,7 +8,7 @@
-
+
{{headerInfo?.ltdidName}} @@ -24,8 +24,14 @@ {{headerInfo?.vatinvHNum}} + + {{headerInfo?.reciname}} + + + {{headerInfo?.provinceName}}{{headerInfo?.cityName}}{{headerInfo?.areaName}}{{headerInfo?.reciaddr}} +
-
+
{{headerInfo?.artoName}} @@ -45,7 +51,7 @@ {{headerInfo?.bankAccount}}
-
+
{{headerInfo?.vatnameLabel}} @@ -87,7 +93,7 @@ -
+
@@ -100,7 +106,7 @@
- diff --git a/src/app/routes/ticket-management/components/invoice-requested/invoice-requested-detail/invoice-requested-detail.component.ts b/src/app/routes/ticket-management/components/invoice-requested/invoice-requested-detail/invoice-requested-detail.component.ts index 52a829cf..fc9c0897 100644 --- a/src/app/routes/ticket-management/components/invoice-requested/invoice-requested-detail/invoice-requested-detail.component.ts +++ b/src/app/routes/ticket-management/components/invoice-requested/invoice-requested-detail/invoice-requested-detail.component.ts @@ -26,6 +26,7 @@ export class InvoiceRequestedDetailComponent implements OnInit { _$expand = false; id = null; + sts = null; headerInfo: any = {}; constructor( public service: TicketService, @@ -34,6 +35,7 @@ export class InvoiceRequestedDetailComponent implements OnInit { private router: Router ) { this.id = route.snapshot.params.id; + this.sts = route.snapshot.queryParams.sts; this.loadHeadInfo(); } @@ -102,10 +104,10 @@ export class InvoiceRequestedDetailComponent implements OnInit { id: this.id }; this.service.request(this.service.$api_get_applyFicoVatinv, params).subscribe((res: any) => { - console.log(res); if (res) { this.loadHeadInfo(); this.st.load(1); + this.service.msgSrv.success('开票成功'); modal.destroy(); } }); @@ -120,10 +122,10 @@ export class InvoiceRequestedDetailComponent implements OnInit { id: this.id }; this.service.request(this.service.$api_get_applyFicoVatinv, params).subscribe((res: any) => { - console.log(res); if (res) { this.loadHeadInfo(); this.st.load(1); + this.service.msgSrv.success('开票成功'); modal.destroy(); } }); @@ -164,9 +166,9 @@ export class InvoiceRequestedDetailComponent implements OnInit { routeToOrder(item: any) { if (item.billType === 1) { - this.router.navigate(['/order-management/vehicle-detail/' + item.billHId]); + this.router.navigate(['/order-management/vehicle/vehicle-detail/' + item.billHId]); } else { - this.router.navigate(['/order-management/bulk-detail/' + item.billHId]); + this.router.navigate(['/order-management/bulk/bulk-detail/' + item.billHId]); } } @@ -245,7 +247,7 @@ export class InvoiceRequestedDetailComponent implements OnInit { }, driverinfo: { type: 'string', - title: '运司机', + title: '承运司机', ui: { placeholder: '请输入', visibleIf: { @@ -264,7 +266,7 @@ export class InvoiceRequestedDetailComponent implements OnInit { } }, projectId: { - title: '项目', + title: '所属项目', type: 'string', default: '', ui: { diff --git a/src/app/routes/ticket-management/components/invoice-requested/invoice-requested.component.ts b/src/app/routes/ticket-management/components/invoice-requested/invoice-requested.component.ts index fbe7accb..75e880d8 100644 --- a/src/app/routes/ticket-management/components/invoice-requested/invoice-requested.component.ts +++ b/src/app/routes/ticket-management/components/invoice-requested/invoice-requested.component.ts @@ -420,7 +420,7 @@ export class InvoiceRequestedComponent implements OnInit { // }, { text: '订单明细
', - click: item => this.router.navigate(['/ticket/invoice-requested/detail/' + item?.id]) + click: item => this.router.navigate(['/ticket/invoice-requested/detail/' + item?.id], { queryParams: { sts: item.sts } }) }, { text: '查看原因
', diff --git a/src/app/routes/ticket-management/components/invoiced-list/invoiced-list.component.html b/src/app/routes/ticket-management/components/invoiced-list/invoiced-list.component.html index 9f2b0031..a0b80dae 100644 --- a/src/app/routes/ticket-management/components/invoiced-list/invoiced-list.component.html +++ b/src/app/routes/ticket-management/components/invoiced-list/invoiced-list.component.html @@ -41,7 +41,7 @@
-->
- {{ item.no }} diff --git a/src/app/routes/ticket-management/components/invoiced-list/invoiced-list.component.ts b/src/app/routes/ticket-management/components/invoiced-list/invoiced-list.component.ts index c7dc4d0e..72b2c26b 100644 --- a/src/app/routes/ticket-management/components/invoiced-list/invoiced-list.component.ts +++ b/src/app/routes/ticket-management/components/invoiced-list/invoiced-list.component.ts @@ -212,10 +212,10 @@ export class InvoicedListComponent implements OnInit { }, { title: '税率', - index: 'vatrate', + index: 'billvatrate', className: 'text-right', width: 90, - format: item => `${item.vatrate ? ((item.vatrate as number) * 100).toFixed(2) : 0}%` + format: item => `${item.billvatrate ? ((item.billvatrate as number) * 100).toFixed(2) : 0}%` }, { title: '税额', diff --git a/src/app/routes/ticket-management/services/ticket.service.ts b/src/app/routes/ticket-management/services/ticket.service.ts index 231ad653..690eea09 100644 --- a/src/app/routes/ticket-management/services/ticket.service.ts +++ b/src/app/routes/ticket-management/services/ticket.service.ts @@ -26,8 +26,8 @@ export class TicketService extends ShipperBaseService { // 运营端销票处理-订单明细页面 $api_ficoVatinvHList = '/api/fcc/ficoVatinvH/ficoVatinvHList'; - // 获取销项发票抬头详情信息 - $api_ficoVatinv_header = '/api/fcc/ficoVatinvH/getDetail'; + // 获取开票申请订单明细头部信息 + $api_ficoVatinv_header = '/api/fcc/ficoVatappBill/getDetailHeadByVatappHId'; // 获取分票发票明细 $api_ficoVatinv_Detail = '/api/fcc/ficoVatinvL/getDetailByVatinvHId'; // 运营端订单明细开票处理 diff --git a/src/app/routes/usercenter/components/driver/captain/captain-detail/captain-detail.component.html b/src/app/routes/usercenter/components/driver/captain/captain-detail/captain-detail.component.html index c570f528..2e0189b6 100644 --- a/src/app/routes/usercenter/components/driver/captain/captain-detail/captain-detail.component.html +++ b/src/app/routes/usercenter/components/driver/captain/captain-detail/captain-detail.component.html @@ -11,34 +11,17 @@
-

{{ userDetail?.name }} +

{{ userDetail?.name }}

- -
@@ -56,13 +39,12 @@
- 个人信息 - @@ -205,17 +205,23 @@
- -
-
- -
-
- -
-
+ +
+
+ + +
+
+ +
+
+ + + + + +
diff --git a/src/app/routes/waybill-management/components/bulk-detail/bulk-detail.component.ts b/src/app/routes/waybill-management/components/bulk-detail/bulk-detail.component.ts index cc564ea8..572813c8 100644 --- a/src/app/routes/waybill-management/components/bulk-detail/bulk-detail.component.ts +++ b/src/app/routes/waybill-management/components/bulk-detail/bulk-detail.component.ts @@ -1,7 +1,7 @@ /* * @Author: your name * @Date: 2021-12-03 15:31:52 - * @LastEditTime : 2022-02-21 19:52:43 + * @LastEditTime : 2022-03-02 16:24:32 * @LastEditors : Shiming * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @FilePath : \\tms-obc-web\\src\\app\\routes\\waybill-management\\components\\bulk-detail\\bulk-detail.component.ts @@ -13,6 +13,7 @@ import { _HttpClient } from '@delon/theme'; import { NzCardComponent } from 'ng-zorro-antd/card'; import { NzMessageService } from 'ng-zorro-antd/message'; import { NzModalService } from 'ng-zorro-antd/modal'; +import format from 'date-fns/format'; import { VehicleSureArriveComponent } from 'src/app/routes/order-management/modal/vehicle/sure-arrive/sure-arrive.component'; import { VehicleSureDepartComponent } from 'src/app/routes/order-management/modal/vehicle/sure-depart/sure-depart.component'; import { WaybillManagementServe } from '../../services/waybill-management.service'; @@ -28,27 +29,15 @@ export class WaybillManagementBulkeDetailComponent implements OnInit { totalObj: any; attObj: any; isVisible = false; - logColumns: STColumn[] = [ - { title: '款项', index: 'costName' }, - { title: '运输费(元)', index: 'price',render: 'price' }, - { 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' }, - }, - }, - ]; + MapList: any[]=[]; imges: any; unLoadingPlaceVOList: any = []; - + logColumns: STColumn[] = [ + { title: '时间', index: 'vinOutTime' }, + { title: '地点', index: 'cityName' }, + ]; + trajectory = 'car'; + addressItems: any[] = []; //打点地址数据组 constructor( private route: ActivatedRoute, private msgSrv: NzMessageService, @@ -61,7 +50,7 @@ export class WaybillManagementBulkeDetailComponent implements OnInit { ngOnInit(): void { this.initData() - + this.MapInit() } initData() { const params = { @@ -148,4 +137,30 @@ sureArrive(item: any) { this.initData() }); } + // 获取轨迹 + MapInit() { + this.service.request(this.service.$api_get_getTrajectory, { id: this.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; + if(this.addressItems && this.addressItems.length > 0){ + this.addressItems.forEach(item => { + item.vinOutTime = this.getLocalTime(item.vinOutTime); + }); + } + } + }); + } + + getLocalTime(time: any) { + return format(new Date(parseInt(time)), 'yyyy-MM-dd HH:mm:ss'); + } } diff --git a/src/app/routes/waybill-management/components/bulk/bulk.component.html b/src/app/routes/waybill-management/components/bulk/bulk.component.html index 5bb5507e..16a60a9f 100644 --- a/src/app/routes/waybill-management/components/bulk/bulk.component.html +++ b/src/app/routes/waybill-management/components/bulk/bulk.component.html @@ -63,6 +63,12 @@ [page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100, 200, 300, 500, 1000] }" [loading]="service.http.loading" > + +
{{ item?.createUserName }}/{{ item?.createUserPhone }}
+
+ +
{{ item?.createUserName }}/{{ item?.createUserPhone }}
+
{{ item?.driverName }}/{{ item?.driverTelephone }}/{{ item?.driverLicenseCarNo }}
diff --git a/src/app/routes/waybill-management/components/bulk/bulk.component.ts b/src/app/routes/waybill-management/components/bulk/bulk.component.ts index 26890393..feacd841 100644 --- a/src/app/routes/waybill-management/components/bulk/bulk.component.ts +++ b/src/app/routes/waybill-management/components/bulk/bulk.component.ts @@ -96,9 +96,10 @@ tabs = { allowClear: true, onSearch: (q: any) => { console.log(q) - if (!!q) { + let str =q.replace(/^\s+|\s+$/g,""); + if (str) { 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)))) .toPromise(); } else { @@ -246,6 +247,7 @@ tabs = { className: 'text-right', render: 'billExpenseDetailVOList' }, + { title: '录单员', render: 'createUserName', width: '200px', className: 'text-left' }, { title: '网络货运人', index: 'enterpriseInfoName', width: '220px', className: 'text-left' }, { title: '货主', index: 'shipperAppUserName', width: '180px', className: 'text-left' }, { title: '关联订单号', index: 'billCode', width: '180px', className: 'text-left' }, diff --git a/src/app/routes/waybill-management/components/vehicle-detail/vehicle-detail.component.html b/src/app/routes/waybill-management/components/vehicle-detail/vehicle-detail.component.html index 3c51efaa..b18e685b 100644 --- a/src/app/routes/waybill-management/components/vehicle-detail/vehicle-detail.component.html +++ b/src/app/routes/waybill-management/components/vehicle-detail/vehicle-detail.component.html @@ -189,20 +189,25 @@ -
- -
-
- -
-
- -
-
+ +
+
+ + +
+
+ +
+
+ + + + + +
diff --git a/src/app/routes/waybill-management/components/vehicle-detail/vehicle-detail.component.ts b/src/app/routes/waybill-management/components/vehicle-detail/vehicle-detail.component.ts index a8ea44e8..421e6348 100644 --- a/src/app/routes/waybill-management/components/vehicle-detail/vehicle-detail.component.ts +++ b/src/app/routes/waybill-management/components/vehicle-detail/vehicle-detail.component.ts @@ -1,7 +1,7 @@ /* * @Author: your name * @Date: 2021-12-03 15:31:52 - * @LastEditTime : 2022-02-21 19:46:47 + * @LastEditTime : 2022-03-02 16:26:15 * @LastEditors : Shiming * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @FilePath : \\tms-obc-web\\src\\app\\routes\\waybill-management\\components\\vehicle-detail\\vehicle-detail.component.ts @@ -10,6 +10,7 @@ import { Component, OnInit } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { STColumn } from '@delon/abc/st'; import { _HttpClient } from '@delon/theme'; +import format from 'date-fns/format'; import { NzCardComponent } from 'ng-zorro-antd/card'; import { NzMessageService } from 'ng-zorro-antd/message'; import { NzModalService } from 'ng-zorro-antd/modal'; @@ -24,30 +25,19 @@ import { WaybillManagementServe } from '../../services/waybill-management.servic export class WaybillManagementVehicleDetailComponent implements OnInit { id = this.route.snapshot.params.id; + MapList: any[]=[]; i: any; totalObj: any; attObj: any; isVisible = false; - logColumns: STColumn[] = [ - { title: '款项', index: 'costName' }, - { title: '运输费(元)', index: 'price', render: 'price' }, - { title: '支付时间', render: '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' }, - }, - }, - ]; imges: any; unLoadingPlaceVOList: any = []; + logColumns: STColumn[] = [ + { title: '时间', index: 'vinOutTime' }, + { title: '地点', index: 'cityName' }, + ]; + trajectory = 'car'; + addressItems: any[] = []; //打点地址数据组 constructor( private route: ActivatedRoute, @@ -60,7 +50,7 @@ export class WaybillManagementVehicleDetailComponent implements OnInit { ngOnInit(): void { this.initData() - + this.MapInit() } initData() { const params = { @@ -140,4 +130,30 @@ goDistance(elf: NzCardComponent) { }); } + // 获取轨迹 + MapInit() { + this.service.request(this.service.$api_get_getTrajectory, { id: this.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; + if(this.addressItems && this.addressItems.length > 0){ + this.addressItems.forEach(item => { + item.vinOutTime = this.getLocalTime(item.vinOutTime); + }); + } + } + }); + } + + getLocalTime(time: any) { + return format(new Date(parseInt(time)), 'yyyy-MM-dd HH:mm:ss'); + } } diff --git a/src/app/routes/waybill-management/components/vehicle/vehicle.component.html b/src/app/routes/waybill-management/components/vehicle/vehicle.component.html index 6b1e452b..6d04ebdb 100644 --- a/src/app/routes/waybill-management/components/vehicle/vehicle.component.html +++ b/src/app/routes/waybill-management/components/vehicle/vehicle.component.html @@ -1,7 +1,7 @@ @@ -99,6 +99,13 @@ + + + + + + diff --git a/src/app/shared/components/imagelist/image-list.module.ts b/src/app/shared/components/imagelist/image-list.module.ts index 88665d93..1e59374b 100644 --- a/src/app/shared/components/imagelist/image-list.module.ts +++ b/src/app/shared/components/imagelist/image-list.module.ts @@ -2,12 +2,13 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; import { ImageListComponent } from './imagelist.component'; import { ImageViewComponent } from './imageview/imageview.component'; +import { NzImageModule } from 'ng-zorro-antd/image'; const COMPONENTS = [ImageListComponent, ImageViewComponent]; @NgModule({ declarations: COMPONENTS, - imports: [CommonModule], - exports: COMPONENTS, + imports: [CommonModule, NzImageModule], + exports: COMPONENTS }) export class ImageListModule {} diff --git a/src/app/shared/components/imagelist/imagelist.component.html b/src/app/shared/components/imagelist/imagelist.component.html index 8faf6fab..b3bddafd 100644 --- a/src/app/shared/components/imagelist/imagelist.component.html +++ b/src/app/shared/components/imagelist/imagelist.component.html @@ -1,3 +1,3 @@
- -
+ +
\ No newline at end of file diff --git a/src/app/shared/components/imagelist/imagelist.component.ts b/src/app/shared/components/imagelist/imagelist.component.ts index c019afd7..40bb7f37 100644 --- a/src/app/shared/components/imagelist/imagelist.component.ts +++ b/src/app/shared/components/imagelist/imagelist.component.ts @@ -8,25 +8,32 @@ */ import { Component, Input, OnInit } from '@angular/core'; import { ModalHelper, _HttpClient } from '@delon/theme'; +import { NzImageService } from 'ng-zorro-antd/image'; import { NzMessageService } from 'ng-zorro-antd/message'; import { ImageViewComponent } from './imageview/imageview.component'; @Component({ selector: 'app-imagelist', templateUrl: './imagelist.component.html', - styleUrls: ['./imagelist.less'], + styleUrls: ['./imagelist.less'] }) export class ImageListComponent implements OnInit { @Input() imgList: any = []; - constructor(private modal: ModalHelper, public msgSrv: NzMessageService, public http: _HttpClient) {} + constructor( + private modal: ModalHelper, + public msgSrv: NzMessageService, + public http: _HttpClient, + private nzImageService: NzImageService + ) {} - ngOnInit(): void { - } + ngOnInit(): void {} showImg(index: any) { const params = { imgList: this.imgList, - index, + index }; - this.modal.create(ImageViewComponent, { params }).subscribe((res) => {}); + const images = this.imgList.map((url: string) => ({ src: url })); + this.nzImageService.preview(images); + // this.modal.create(ImageViewComponent, { params }).subscribe(res => {}); } } diff --git a/src/app/shared/shared-zorro.module.ts b/src/app/shared/shared-zorro.module.ts index ab105080..2682add7 100644 --- a/src/app/shared/shared-zorro.module.ts +++ b/src/app/shared/shared-zorro.module.ts @@ -44,8 +44,9 @@ import { NzUploadModule } from 'ng-zorro-antd/upload'; import { NzCascaderModule } from 'ng-zorro-antd/cascader'; import { NzAnchorModule } from 'ng-zorro-antd/anchor'; import { NzAffixModule } from 'ng-zorro-antd/affix'; -import { NzTypographyModule } from 'ng-zorro-antd/typography'; +import { NzTypographyModule } from 'ng-zorro-antd/typography'; import { NzSwitchModule } from 'ng-zorro-antd/switch'; +import { NzImageModule } from 'ng-zorro-antd/image'; export const SHARED_ZORRO_MODULES = [ NzButtonModule, NzGridModule, @@ -85,5 +86,6 @@ export const SHARED_ZORRO_MODULES = [ NzAnchorModule, NzAffixModule, NzTypographyModule, - NzSwitchModule + NzSwitchModule, + NzImageModule ]; diff --git a/src/conf/api.conf.ts b/src/conf/api.conf.ts index a931ac41..eeea705c 100644 --- a/src/conf/api.conf.ts +++ b/src/conf/api.conf.ts @@ -9,5 +9,9 @@ export const apiConf = { /** * 文件上传路径(水印) */ - waterFileUpload: `/api/mdc/pbc/upload/multipartFile/watermarkFile` + waterFileUpload: `/api/mdc/pbc/upload/multipartFile/watermarkFile`, + /** + * 上传文件,返回fileModel + */ + file_upload_url: '/api/mdc/pbc/upload/multipartFile/fileModel' };