From fa3e5abe7417e8b7ecf38296a0132a73ae9b0348 Mon Sep 17 00:00:00 2001 From: wangshiming Date: Thu, 21 Apr 2022 13:58:50 +0800 Subject: [PATCH 01/21] fix bug --- package-lock.json | 2 +- .../components/invoice-detail/invoice-detail.component.ts | 2 +- .../invoice-requested-detail.component.ts | 2 +- .../requested-invoice-modal.component.ts | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 93e9c26a..a65bf493 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "tms-obc-web", - "version": "0.0.0", + "version": "1.0.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/src/app/routes/ticket-management/components/invoice-detail/invoice-detail.component.ts b/src/app/routes/ticket-management/components/invoice-detail/invoice-detail.component.ts index f5115ec0..766fe66f 100644 --- a/src/app/routes/ticket-management/components/invoice-detail/invoice-detail.component.ts +++ b/src/app/routes/ticket-management/components/invoice-detail/invoice-detail.component.ts @@ -185,7 +185,7 @@ export class InvoiceDetailComponent implements OnInit { private initOrderST(): STColumn[] { return [ { title: '订单号', index: 'billHCode', width: 180 }, - { title: '订单完成日期', index: 'billTime', type: 'date', width: 150 }, + { title: '订单完成日期', index: 'billfinTime', type: 'date', width: 150 }, { title: '所属项目', index: 'projectIdName', width: 180 }, { title: '订单类型', index: 'billTypeLabel', width: 120 }, { title: '装货地', index: 'loadingfrom', width: 200 }, 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 b02371b5..f8f08999 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 @@ -298,7 +298,7 @@ export class InvoiceRequestedDetailComponent implements OnInit { return [ { title: '', index: 'key', type: 'checkbox' }, { title: '订单号', render: 'billHCode', width: 170 }, - { title: '订单完成日期', index: 'billTime', type: 'date', width: 150 }, + { title: '订单完成日期', index: 'billfinTime', type: 'date', width: 150 }, { title: '开票状态', index: 'vatappStsLabel', width: 100 }, { title: '所属项目', index: 'projectIdName', width: 140 }, { title: '订单类型', index: 'billType', width: 100, type: 'enum', enum: { 1: '整车', 2: '大宗' } }, diff --git a/src/app/routes/ticket-management/components/invoice-requested/requested-invoice-modal/requested-invoice-modal.component.ts b/src/app/routes/ticket-management/components/invoice-requested/requested-invoice-modal/requested-invoice-modal.component.ts index a46d003c..9ea837e3 100644 --- a/src/app/routes/ticket-management/components/invoice-requested/requested-invoice-modal/requested-invoice-modal.component.ts +++ b/src/app/routes/ticket-management/components/invoice-requested/requested-invoice-modal/requested-invoice-modal.component.ts @@ -1,7 +1,7 @@ /* * @Author: your name * @Date: 2021-12-23 16:50:17 - * @LastEditTime : 2022-01-26 10:36:10 + * @LastEditTime : 2022-04-21 13:57:43 * @LastEditors : Shiming * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @FilePath : \\tms-obc-web\\src\\app\\routes\\ticket-management\\components\\invoice-requested\\requested-invoice-modal\\requested-invoice-modal.component.ts @@ -86,7 +86,7 @@ export class RequestedInvoiceModalComponent { return [ { title: '', index: 'key', type: 'checkbox' }, { title: '订单号', index: 'billHCode', width: 150 }, - { title: '订单完成日期', index: 'billTime', type: 'date', width: 150 }, + { title: '订单完成日期', index: 'billfinTime', type: 'date', width: 150 }, { title: '所属项目', index: 'projectIdName', width: 250 }, { title: '订单类型', index: 'billTypeName', width: 90 }, { title: '装货地', index: 'loadingfrom', width: 250 }, From 33c6fc64e820d0ace1420cad0bf1a1858ea71efe Mon Sep 17 00:00:00 2001 From: wangshiming Date: Thu, 21 Apr 2022 14:39:31 +0800 Subject: [PATCH 02/21] fix bug --- .../receipts-audit.component.ts | 8 +- .../voucher-view/voucher-view.component.ts | 242 +++++++++++------- .../services/order-management.service.ts | 5 + 3 files changed, 159 insertions(+), 96 deletions(-) diff --git a/src/app/routes/order-management/components/receipts-audit/receipts-audit.component.ts b/src/app/routes/order-management/components/receipts-audit/receipts-audit.component.ts index 5588a7b0..c3ddd93f 100644 --- a/src/app/routes/order-management/components/receipts-audit/receipts-audit.component.ts +++ b/src/app/routes/order-management/components/receipts-audit/receipts-audit.component.ts @@ -397,25 +397,25 @@ export class OrderManagementReceiptsAuditComponent implements OnInit { { text: '生成电子单据', click: _record => this.generate(_record, 2), - iif: item => !item?.loadingElectronicsLadingBillFilePath, + iif: item => !item?.loadingElectronicsLadingBillFilePath || !item?.unloadingElectronicsLadingBillFilePath, acl: { ability: ['ORDER-RECEIPTS-electronicBillingOne'] }, }, { text: '通过', click: _record => this.sign(_record), - iif: item => !item?.loadingElectronicsLadingBillFilePath, + iif: item => !item?.loadingElectronicsLadingBillFilePath || !item?.unloadingElectronicsLadingBillFilePath, acl: { ability: ['ORDER-RECEIPTS-billAuditPassBatch'] }, }, { text: '修改', click: _record => this.modification(_record), - iif: item => !item?.loadingElectronicsLadingBillFilePath, + iif: item => !item?.loadingElectronicsLadingBillFilePath || !item?.unloadingElectronicsLadingBillFilePath, acl: { ability: ['ORDER-RECEIPTS-updateBillExamine'] }, }, { text: '查看凭证', click: _record => this.generate(_record, 3), - iif: item => item?.loadingElectronicsLadingBillFilePath, + iif: item => item?.loadingElectronicsLadingBillFilePath && item?.unloadingElectronicsLadingBillFilePath, acl: { ability: ['ORDER-RECEIPTS-view'] }, }, ] diff --git a/src/app/routes/order-management/modal/audit/voucher-view/voucher-view.component.ts b/src/app/routes/order-management/modal/audit/voucher-view/voucher-view.component.ts index 4594edb6..5b8fa7ba 100644 --- a/src/app/routes/order-management/modal/audit/voucher-view/voucher-view.component.ts +++ b/src/app/routes/order-management/modal/audit/voucher-view/voucher-view.component.ts @@ -1,4 +1,3 @@ - import { Component, OnInit, ViewChild } from '@angular/core'; import { DatePipe } from '@angular/common'; import { @@ -41,20 +40,25 @@ export class orderManagementVoucherViewComponent implements OnInit { @ViewChild('sf', { static: false }) sf!: SFComponent; schema: SFSchema = {}; ui: SFUISchema = {}; - constructor(private modal: NzModalRef, private msgSrv: NzMessageService, public http: _HttpClient, public service: OrderManagementService, private datePipe: DatePipe, private envSrv: EAEnvironmentService,) { } + constructor( + private modal: NzModalRef, + private msgSrv: NzMessageService, + public http: _HttpClient, + public service: OrderManagementService, + private datePipe: DatePipe, + private envSrv: EAEnvironmentService + ) {} ngOnInit(): void { - console.log(this.i) - this.initData() + console.log(this.i); + this.initData(); this.i.time = this.i.loadingTime; this.initSF(); } initSF() { - console.log(this.Status) + console.log(this.Status); if (this.Status == 1) { - this.schema = { - properties: { loadingLadingBillFilePath: { type: 'string', @@ -73,7 +77,7 @@ export class orderManagementVoucherViewComponent implements OnInit { content: [ `上传用户:${this.i?.driverName}(${this.i?.driverTelephone})`, `上传位置:${this.i?.loadingAddressArr[0]}`, - `上传时间:${format(new Date(), 'yyyy-MM-dd HH:mm:ss')}`, + `上传时间:${format(new Date(), 'yyyy-MM-dd HH:mm:ss')}` ], position: '2', fontSize: '100' @@ -98,8 +102,8 @@ export class orderManagementVoucherViewComponent implements OnInit { }); }, multiple: false, - listType: 'picture-card', - } as SFUploadWidgetSchema, + listType: 'picture-card' + } as SFUploadWidgetSchema }, loadingPeopleVehiclesGoodsFilePath: { type: 'string', @@ -118,7 +122,7 @@ export class orderManagementVoucherViewComponent implements OnInit { content: [ `上传用户:${this.i?.driverName}(${this.i?.driverTelephone})`, `上传位置:${this.i?.loadingAddressArr[0]}`, - `上传时间:${format(new Date(), 'yyyy-MM-dd HH:mm:ss')}`, + `上传时间:${format(new Date(), 'yyyy-MM-dd HH:mm:ss')}` ], position: '2', fontSize: '100' @@ -143,16 +147,16 @@ export class orderManagementVoucherViewComponent implements OnInit { }); }, multiple: false, - listType: 'picture-card', - } as SFUploadWidgetSchema, + listType: 'picture-card' + } as SFUploadWidgetSchema }, no4: { type: 'string', title: '', ui: { - widget: 'text', + widget: 'text' }, - default: '单张大小不超过5M,支持.jpg、.jpeg和 .png格式', + default: '单张大小不超过5M,支持.jpg、.jpeg和 .png格式' }, unloadingLadingBillFilePath: { type: 'string', @@ -171,7 +175,7 @@ export class orderManagementVoucherViewComponent implements OnInit { content: [ `上传用户:${this.i?.driverName}(${this.i?.driverTelephone})`, `上传位置:${this.i?.unloadingAddressArr[0]}`, - `上传时间:${format(new Date(), 'yyyy-MM-dd HH:mm:ss')}`, + `上传时间:${format(new Date(), 'yyyy-MM-dd HH:mm:ss')}` ], position: '2', fontSize: '100' @@ -196,8 +200,8 @@ export class orderManagementVoucherViewComponent implements OnInit { }); }, multiple: false, - listType: 'picture-card', - } as SFUploadWidgetSchema, + listType: 'picture-card' + } as SFUploadWidgetSchema }, unloadingPeopleVehiclesGoodsFilePath: { type: 'string', @@ -216,7 +220,7 @@ export class orderManagementVoucherViewComponent implements OnInit { content: [ `上传用户:${this.i?.driverName}(${this.i?.driverTelephone})`, `上传位置:${this.i?.unloadingAddressArr[0]}`, - `上传时间:${format(new Date(), 'yyyy-MM-dd HH:mm:ss')}`, + `上传时间:${format(new Date(), 'yyyy-MM-dd HH:mm:ss')}` ], position: '2', fontSize: '100' @@ -241,11 +245,16 @@ export class orderManagementVoucherViewComponent implements OnInit { }); }, multiple: false, - listType: 'picture-card', - } as SFUploadWidgetSchema, + listType: 'picture-card' + } as SFUploadWidgetSchema } }, - required: ['loadingLadingBillFilePath', 'loadingPeopleVehiclesGoodsFilePath', 'unloadingLadingBillFilePath', 'unloadingPeopleVehiclesGoodsFilePath'] + required: [ + 'loadingLadingBillFilePath', + 'loadingPeopleVehiclesGoodsFilePath', + 'unloadingLadingBillFilePath', + 'unloadingPeopleVehiclesGoodsFilePath' + ] }; } else { this.schema = { @@ -254,8 +263,8 @@ export class orderManagementVoucherViewComponent implements OnInit { type: 'string', title: '', ui: { - widget: 'custom', - }, + widget: 'custom' + } }, loadingLadingBillFilePath: { type: 'string', @@ -275,7 +284,7 @@ export class orderManagementVoucherViewComponent implements OnInit { content: [ `上传用户:${this.i?.driverName}(${this.i?.driverTelephone})`, `上传位置:${this.i?.loadingAddressArr[0]}`, - `上传时间:${format(new Date(), 'yyyy-MM-dd HH:mm:ss')}`, + `上传时间:${format(new Date(), 'yyyy-MM-dd HH:mm:ss')}` ], position: '2', fontSize: '100' @@ -300,8 +309,8 @@ export class orderManagementVoucherViewComponent implements OnInit { }); }, multiple: false, - listType: 'picture-card', - } as SFUploadWidgetSchema, + listType: 'picture-card' + } as SFUploadWidgetSchema }, loadingPeopleVehiclesGoodsFilePath: { type: 'string', @@ -321,7 +330,7 @@ export class orderManagementVoucherViewComponent implements OnInit { content: [ `上传用户:${this.i?.driverName}(${this.i?.driverTelephone})`, `上传位置:${this.i?.loadingAddressArr[0]}`, - `上传时间:${format(new Date(), 'yyyy-MM-dd HH:mm:ss')}`, + `上传时间:${format(new Date(), 'yyyy-MM-dd HH:mm:ss')}` ], position: '2', fontSize: '100' @@ -346,24 +355,24 @@ export class orderManagementVoucherViewComponent implements OnInit { }); }, multiple: false, - listType: 'picture-card', - } as SFUploadWidgetSchema, + listType: 'picture-card' + } as SFUploadWidgetSchema }, no4: { type: 'string', title: '', ui: { - widget: 'text', + widget: 'text' }, - default: '单张大小不超过5M,支持.jpg、.jpeg和 .png格式', + default: '单张大小不超过5M,支持.jpg、.jpeg和 .png格式' }, no6: { type: 'string', title: '', ui: { - widget: 'custom', - }, + widget: 'custom' + } }, unloadingLadingBillFilePath: { type: 'string', @@ -383,7 +392,7 @@ export class orderManagementVoucherViewComponent implements OnInit { content: [ `上传用户:${this.i?.driverName}(${this.i?.driverTelephone})`, `上传位置:${this.i?.unloadingAddressArr[0]}`, - `上传时间:${format(new Date(), 'yyyy-MM-dd HH:mm:ss')}`, + `上传时间:${format(new Date(), 'yyyy-MM-dd HH:mm:ss')}` ], position: '2', fontSize: '100' @@ -408,8 +417,8 @@ export class orderManagementVoucherViewComponent implements OnInit { }); }, multiple: false, - listType: 'picture-card', - } as SFUploadWidgetSchema, + listType: 'picture-card' + } as SFUploadWidgetSchema }, unloadingPeopleVehiclesGoodsFilePath: { type: 'string', @@ -429,7 +438,7 @@ export class orderManagementVoucherViewComponent implements OnInit { content: [ `上传用户:${this.i?.driverName}(${this.i?.driverTelephone})`, `上传位置:${this.i?.unloadingAddressArr[0]}`, - `上传时间:${format(new Date(), 'yyyy-MM-dd HH:mm:ss')}`, + `上传时间:${format(new Date(), 'yyyy-MM-dd HH:mm:ss')}` ], position: '2', fontSize: '100' @@ -454,11 +463,16 @@ export class orderManagementVoucherViewComponent implements OnInit { }); }, multiple: false, - listType: 'picture-card', - } as SFUploadWidgetSchema, + listType: 'picture-card' + } as SFUploadWidgetSchema } }, - required: ['loadingLadingBillFilePath', 'loadingPeopleVehiclesGoodsFilePath', 'unloadingLadingBillFilePath', 'unloadingPeopleVehiclesGoodsFilePath'] + required: [ + 'loadingLadingBillFilePath', + 'loadingPeopleVehiclesGoodsFilePath', + 'unloadingLadingBillFilePath', + 'unloadingPeopleVehiclesGoodsFilePath' + ] }; } this.ui = { @@ -469,42 +483,42 @@ export class orderManagementVoucherViewComponent implements OnInit { $unloadingLadingBillFilePath: { grid: { span: 12 } }, $unloadingPeopleVehiclesGoodsFilePath: { grid: { span: 12 } }, $loadingLadingBillFilePath: { grid: { span: 12 } }, - $loadingPeopleVehiclesGoodsFilePath: { grid: { span: 12 } }, + $loadingPeopleVehiclesGoodsFilePath: { grid: { span: 12 } } }; } save(value: any): void { if (!this.sf.valid) { - this.service.msgSrv.warning('必填项为空!') + this.service.msgSrv.warning('必填项为空!'); return; } - console.log(value) + console.log(value); const params = { id: this.i?.id, loadingLadingBillFilePath: value?.loadingLadingBillFilePath?.data?.fullFilePath, loadingPeopleVehiclesGoodsFilePath: value?.loadingPeopleVehiclesGoodsFilePath?.data?.fullFilePath, unloadingLadingBillFilePath: value?.unloadingLadingBillFilePath?.data?.fullFilePath, - unloadingPeopleVehiclesGoodsFilePath: value?.unloadingPeopleVehiclesGoodsFilePath?.data?.fullFilePath, - } - console.log(params) - this.service.request(this.service.$api_get_updateBillExamine, params).subscribe((res) => { + unloadingPeopleVehiclesGoodsFilePath: value?.unloadingPeopleVehiclesGoodsFilePath?.data?.fullFilePath + }; + console.log(params); + this.service.request(this.service.$api_get_updateBillExamine, params).subscribe(res => { if (res) { - this.service.msgSrv.success('修改成功!') + this.service.msgSrv.success('修改成功!'); this.modal.destroy(true); } - }) + }); } sure() { const params = [this.i?.id]; - this.service.downloadFile(this.service.$api_createBillTakeGoods, params) - this.service.downloadFile(this.service.$api_createBillDischargeGoods, params) - this.service.msgSrv.success('生成电子单据成功!') + this.service.downloadFile(this.service.$api_createBillTakeGoods, params); + this.service.downloadFile(this.service.$api_createBillDischargeGoods, params); + this.service.msgSrv.success('生成电子单据成功!'); this.modal.destroy(true); } // 确认到车界面信息(两个只能看的图片) initData() { - this.service.request(this.service.$api_get_getCredentials, { id: this.i?.id }).subscribe((res) => { - console.log(res) - this.datas = res + this.service.request(this.service.$api_get_getCredentials, { id: this.i?.id }).subscribe(res => { + console.log(res); + this.datas = res; if (res.unloadingLadingBillFilePath) { this.formData = { loadingLadingBillFilePath: [ @@ -514,9 +528,9 @@ export class orderManagementVoucherViewComponent implements OnInit { status: 'done', url: res.loadingLadingBillFilePath, response: { - url: res.loadingLadingBillFilePath, - }, - }, + url: res.loadingLadingBillFilePath + } + } ], loadingPeopleVehiclesGoodsFilePath: [ { @@ -525,9 +539,9 @@ export class orderManagementVoucherViewComponent implements OnInit { status: 'done', url: res.loadingPeopleVehiclesGoodsFilePath, response: { - url: res.loadingPeopleVehiclesGoodsFilePath, - }, - }, + url: res.loadingPeopleVehiclesGoodsFilePath + } + } ], unloadingLadingBillFilePath: [ { @@ -536,9 +550,9 @@ export class orderManagementVoucherViewComponent implements OnInit { status: 'done', url: res.unloadingLadingBillFilePath, response: { - url: res.unloadingLadingBillFilePath, - }, - }, + url: res.unloadingLadingBillFilePath + } + } ], unloadingPeopleVehiclesGoodsFilePath: [ { @@ -547,44 +561,88 @@ export class orderManagementVoucherViewComponent implements OnInit { status: 'done', url: res.unloadingPeopleVehiclesGoodsFilePath, response: { - url: res.unloadingPeopleVehiclesGoodsFilePath, - }, - }, - ], + url: res.unloadingPeopleVehiclesGoodsFilePath + } + } + ] }; } - }) + }); } close(): void { this.modal.destroy(true); } openlaod(value: any) { - if (value === 1) { - if(this.datas?.esignFlowStatus == '1') { - this.service.request(this.service.$api_getBillTakeEsignFile, [this.datas?.id]).subscribe((res) => { + if (!this.datas?.loadingElectronicsLadingBillFilePath) { + this.service.request(this.service.$api_createBillTakeGoods, [this.datas?.id]).subscribe(res => { console.log(res); - }) + if (res) { + console.log(res[0].esignFlowStatus); + + switch (res[0]?.esignFlowStatus) { + case 1: + case '1': + console.log(res[0]?.esignFlowStatus); + + this.service.msgSrv.success('电子装货单签署中!') + this.service.request(this.service.$api_getBillTakeEsignFile, [this.datas?.id]).subscribe(res => { + console.log(res); + if(res[0]?.esignFlowStatus == '2') { + this.service.msgSrv.success('电子装货单已生效!') + this.modal.destroy(true); + } + }); + return ; + case 2: + + return; + } + } + }); + } else { + const a = document.createElement('a'); + a.href = this.datas?.loadingElectronicsLadingBillFilePath; + document.body.appendChild(a); + console.log(document.body.contains(a)); + a.click(); //点击下载 + document.body.removeChild(a); //下载完成移除元素 } - const a = document.createElement('a'); - a.href = this.datas?.loadingElectronicsLadingBillFilePath; - document.body.appendChild(a); - console.log(document.body.contains(a)) - a.click(); //点击下载 - document.body.removeChild(a); //下载完成移除元素 } else { - if(this.datas?.esignFlowStatus == '1') { - this.service.request(this.service.$api_getBillTakeEsignFile, [this.datas?.id]).subscribe((res) => { - console.log(res); - }) - } - const a = document.createElement('a'); - a.href = this.datas?.unloadingElectronicsLadingBillFilePath; - document.body.appendChild(a); - console.log(document.body.contains(a)) - a.click(); //点击下载 - document.body.removeChild(a); //下载完成移除元素 - } + if (!this.datas?.unloadingElectronicsLadingBillFilePath) { + this.service.request(this.service.$api_createBillDischargeGoods, [this.datas?.id]).subscribe(res => { + console.log(res); + if (res) { + console.log(res[0].esignFlowStatus); + + switch (res[0]?.esignFlowStatus) { + case 1: + case '1': + console.log(res[0]?.esignFlowStatus); + + this.service.msgSrv.success('电子卸货单签署中!') + this.service.request(this.service.$api_getBillDischargeEsignFile, [this.datas?.id]).subscribe(res => { + console.log(res); + if(res[0]?.esignFlowStatus == '2') { + this.service.msgSrv.success('电子卸货单已生效!') + this.modal.destroy(true); + } + }); + return ; + case 2: + return; + } + } + }); + } else { + const a = document.createElement('a'); + a.href = this.datas?.unloadingElectronicsLadingBillFilePath; + document.body.appendChild(a); + console.log(document.body.contains(a)); + a.click(); //点击下载 + document.body.removeChild(a); //下载完成移除元素 + } + } } } 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 12584bca..2c7f4a05 100644 --- a/src/app/routes/order-management/services/order-management.service.ts +++ b/src/app/routes/order-management/services/order-management.service.ts @@ -214,6 +214,11 @@ export class OrderManagementService extends ShipperBaseService { public $api_getBillTakeEsignFile = `/api/sdc/billOperate/getBillTakeEsignFile`; // 获取电子卸货单签章附件 public $api_getBillDischargeEsignFile = `/api/sdc/billOperate/getBillDischargeEsignFile`; + + // // 生成卸货单 + // public $api_createBillDischargeGoods = `/api/sdc/billOperate/createBillDischargeGoods`; + // // 生成提货单 + // public $api_createBillTakeGoods = `/api/sdc/billOperate/createBillTakeGoods`; /** * 根据企业ID,获取企业历史网络货运人 * @returns From 837d9de547673a0858e4839fb4da88f63caf5c90 Mon Sep 17 00:00:00 2001 From: wangshiming Date: Thu, 21 Apr 2022 14:42:52 +0800 Subject: [PATCH 03/21] fix bug --- .../modal/audit/voucher-view/voucher-view.component.html | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/app/routes/order-management/modal/audit/voucher-view/voucher-view.component.html b/src/app/routes/order-management/modal/audit/voucher-view/voucher-view.component.html index 5d82c78c..9133fdfa 100644 --- a/src/app/routes/order-management/modal/audit/voucher-view/voucher-view.component.html +++ b/src/app/routes/order-management/modal/audit/voucher-view/voucher-view.component.html @@ -4,7 +4,7 @@ * @Author : Shiming * @Date : 2021-12-15 13:17:42 * @LastEditors : Shiming - * @LastEditTime : 2022-04-21 13:29:36 + * @LastEditTime : 2022-04-21 14:41:44 * @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\modal\\audit\\voucher-view\\voucher-view.component.html * Copyright (C) 2022 huzhenhong. All rights reserved. --> @@ -12,11 +12,13 @@
-
电子装货单
+
电子装货单 + {{datas?.loadingElectronicsLadingBillFilePath ? '已签署' :'未签署'}} +
-
电子卸货单
+
电子卸货单 {{datas?.unloadingElectronicsLadingBillFilePath ? '已签署' :'未签署'}}
From b064621c2a14d241aa77329e9a62af2d596d32c7 Mon Sep 17 00:00:00 2001 From: wangshiming Date: Thu, 21 Apr 2022 14:46:51 +0800 Subject: [PATCH 04/21] fix bug --- .../voucher-view/voucher-view.component.ts | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/src/app/routes/order-management/modal/audit/voucher-view/voucher-view.component.ts b/src/app/routes/order-management/modal/audit/voucher-view/voucher-view.component.ts index 5b8fa7ba..efcaeeaf 100644 --- a/src/app/routes/order-management/modal/audit/voucher-view/voucher-view.component.ts +++ b/src/app/routes/order-management/modal/audit/voucher-view/voucher-view.component.ts @@ -574,20 +574,15 @@ export class orderManagementVoucherViewComponent implements OnInit { } openlaod(value: any) { if (value === 1) { + // 逻辑: 先判断电子提货单是否已生成,文件为空则触发签署文件,再查询是否签署成功,成功则退出,刷新页面,再次点击为预览 if (!this.datas?.loadingElectronicsLadingBillFilePath) { this.service.request(this.service.$api_createBillTakeGoods, [this.datas?.id]).subscribe(res => { - console.log(res); if (res) { - console.log(res[0].esignFlowStatus); - switch (res[0]?.esignFlowStatus) { case 1: case '1': - console.log(res[0]?.esignFlowStatus); - this.service.msgSrv.success('电子装货单签署中!') this.service.request(this.service.$api_getBillTakeEsignFile, [this.datas?.id]).subscribe(res => { - console.log(res); if(res[0]?.esignFlowStatus == '2') { this.service.msgSrv.success('电子装货单已生效!') this.modal.destroy(true); @@ -604,26 +599,19 @@ export class orderManagementVoucherViewComponent implements OnInit { const a = document.createElement('a'); a.href = this.datas?.loadingElectronicsLadingBillFilePath; document.body.appendChild(a); - console.log(document.body.contains(a)); a.click(); //点击下载 document.body.removeChild(a); //下载完成移除元素 } } else { - + // 逻辑: 先判断电子提货单是否已生成,文件为空则触发签署文件,再查询是否签署成功,成功则退出,刷新页面,再次点击为预览 if (!this.datas?.unloadingElectronicsLadingBillFilePath) { this.service.request(this.service.$api_createBillDischargeGoods, [this.datas?.id]).subscribe(res => { - console.log(res); if (res) { - console.log(res[0].esignFlowStatus); - switch (res[0]?.esignFlowStatus) { case 1: case '1': - console.log(res[0]?.esignFlowStatus); - this.service.msgSrv.success('电子卸货单签署中!') this.service.request(this.service.$api_getBillDischargeEsignFile, [this.datas?.id]).subscribe(res => { - console.log(res); if(res[0]?.esignFlowStatus == '2') { this.service.msgSrv.success('电子卸货单已生效!') this.modal.destroy(true); @@ -639,7 +627,6 @@ export class orderManagementVoucherViewComponent implements OnInit { const a = document.createElement('a'); a.href = this.datas?.unloadingElectronicsLadingBillFilePath; document.body.appendChild(a); - console.log(document.body.contains(a)); a.click(); //点击下载 document.body.removeChild(a); //下载完成移除元素 } From 5c3556ccf4ce6b2eb9be11044c03aa22433432ce Mon Sep 17 00:00:00 2001 From: wangshiming Date: Thu, 21 Apr 2022 15:01:56 +0800 Subject: [PATCH 05/21] fix bug --- .../voucher-view/voucher-view.component.ts | 44 +++++++++++++++---- .../freight-config.component.ts | 22 ---------- 2 files changed, 35 insertions(+), 31 deletions(-) diff --git a/src/app/routes/order-management/modal/audit/voucher-view/voucher-view.component.ts b/src/app/routes/order-management/modal/audit/voucher-view/voucher-view.component.ts index efcaeeaf..ad50160e 100644 --- a/src/app/routes/order-management/modal/audit/voucher-view/voucher-view.component.ts +++ b/src/app/routes/order-management/modal/audit/voucher-view/voucher-view.component.ts @@ -15,7 +15,7 @@ import { import { apiConf } from '@conf/api.conf'; import { _HttpClient } from '@delon/theme'; import { NzMessageService } from 'ng-zorro-antd/message'; -import { NzModalRef } from 'ng-zorro-antd/modal'; +import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal'; import { Observable, Observer } from 'rxjs'; import { EAEnvironmentService } from '@shared'; import { OrderManagementService } from '../../../services/order-management.service'; @@ -46,7 +46,8 @@ export class orderManagementVoucherViewComponent implements OnInit { public http: _HttpClient, public service: OrderManagementService, private datePipe: DatePipe, - private envSrv: EAEnvironmentService + private envSrv: EAEnvironmentService, + private modalService: NzModalService ) {} ngOnInit(): void { @@ -581,13 +582,25 @@ export class orderManagementVoucherViewComponent implements OnInit { switch (res[0]?.esignFlowStatus) { case 1: case '1': - this.service.msgSrv.success('电子装货单签署中!') + let time = 0 + setInterval (function () { + time+=1 + }, 1000); //反复执行函数本身 + const modal = this.modalService.success({ + nzTitle: '电子装货单签署中!', + nzContent: ` + 请等待${time}秒后自动关闭 + ` + }); + setTimeout(() => { this.service.request(this.service.$api_getBillTakeEsignFile, [this.datas?.id]).subscribe(res => { if(res[0]?.esignFlowStatus == '2') { this.service.msgSrv.success('电子装货单已生效!') this.modal.destroy(true); } }); + modal.destroy() + }, 5000); return ; case 2: @@ -610,13 +623,26 @@ export class orderManagementVoucherViewComponent implements OnInit { switch (res[0]?.esignFlowStatus) { case 1: case '1': - this.service.msgSrv.success('电子卸货单签署中!') - this.service.request(this.service.$api_getBillDischargeEsignFile, [this.datas?.id]).subscribe(res => { - if(res[0]?.esignFlowStatus == '2') { - this.service.msgSrv.success('电子卸货单已生效!') - this.modal.destroy(true); - } + let time = 0 + setInterval (function () { + time+=1 + }, 1000); //反复执行函数本身 + const modal = this.modalService.success({ + nzTitle: '电子卸货单签署中!', + nzContent: ` + 请等待${time}秒后自动关闭 + ` }); + setTimeout(() => { + this.service.request(this.service.$api_getBillDischargeEsignFile, [this.datas?.id]).subscribe(res => { + if(res[0]?.esignFlowStatus == '2') { + this.service.msgSrv.success('电子卸货单已生效!') + this.modal.destroy(true); + } + }); + modal.destroy() + }, 5000); + return ; case 2: return; diff --git a/src/app/routes/usercenter/components/freight/freight-config/freight-config.component.ts b/src/app/routes/usercenter/components/freight/freight-config/freight-config.component.ts index 1f605413..7cf9162b 100644 --- a/src/app/routes/usercenter/components/freight/freight-config/freight-config.component.ts +++ b/src/app/routes/usercenter/components/freight/freight-config/freight-config.component.ts @@ -228,25 +228,6 @@ export class FreightConfigComponent implements OnInit { asyncData: () => this.shipperservice.getNetworkFreightForwarder() } }, - goodsSurchargeRatio: { - title: '货源单费率', - type: 'string', - ui: { - placeholder: '请输入', - showRequired: false - } - }, - contractSurchargeRatio: { - title: '合同单费率', - type: 'string', - ui: { - placeholder: '请输入', - showRequired: false, - visibleIf: { - _$expand: (value: boolean) => value - } - } - }, createTime: { title: '注册时间', type: 'string', @@ -255,9 +236,6 @@ export class FreightConfigComponent implements OnInit { format: 'yyyy-MM-dd', placeholder: '请选择', nzShowTime: true, - visibleIf: { - _$expand: (value: boolean) => value - } } as SFDateWidgetSchema } } From 548ab19ae28ead8763cfd04413c7d183b2e89a03 Mon Sep 17 00:00:00 2001 From: wangshiming Date: Thu, 21 Apr 2022 15:28:24 +0800 Subject: [PATCH 06/21] fix bug --- .../modal/audit/voucher-view/voucher-view.component.ts | 8 ++++---- .../freight/freight-config/freight-config.component.html | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/app/routes/order-management/modal/audit/voucher-view/voucher-view.component.ts b/src/app/routes/order-management/modal/audit/voucher-view/voucher-view.component.ts index ad50160e..da013143 100644 --- a/src/app/routes/order-management/modal/audit/voucher-view/voucher-view.component.ts +++ b/src/app/routes/order-management/modal/audit/voucher-view/voucher-view.component.ts @@ -582,9 +582,9 @@ export class orderManagementVoucherViewComponent implements OnInit { switch (res[0]?.esignFlowStatus) { case 1: case '1': - let time = 0 + let time = 5 setInterval (function () { - time+=1 + time-=1 }, 1000); //反复执行函数本身 const modal = this.modalService.success({ nzTitle: '电子装货单签署中!', @@ -623,9 +623,9 @@ export class orderManagementVoucherViewComponent implements OnInit { switch (res[0]?.esignFlowStatus) { case 1: case '1': - let time = 0 + let time = 5 setInterval (function () { - time+=1 + time-=1 }, 1000); //反复执行函数本身 const modal = this.modalService.success({ nzTitle: '电子卸货单签署中!', diff --git a/src/app/routes/usercenter/components/freight/freight-config/freight-config.component.html b/src/app/routes/usercenter/components/freight/freight-config/freight-config.component.html index 05a199c9..e590f998 100644 --- a/src/app/routes/usercenter/components/freight/freight-config/freight-config.component.html +++ b/src/app/routes/usercenter/components/freight/freight-config/freight-config.component.html @@ -4,7 +4,7 @@ * @Author : Shiming * @Date : 2022-02-17 20:24:17 * @LastEditors : Shiming - * @LastEditTime : 2022-02-24 17:04:41 + * @LastEditTime : 2022-04-21 15:28:21 * @FilePath : \\tms-obc-web\\src\\app\\routes\\usercenter\\components\\freight\\freight-config\\freight-config.component.html * Copyright (C) 2022 huzhenhong. All rights reserved. --> @@ -24,10 +24,10 @@ - + (click)="st?.load(1);">查询