From d4dd453308fcdf19d388d38fc8630b96f90b28a3 Mon Sep 17 00:00:00 2001 From: wangshiming Date: Fri, 4 Mar 2022 15:21:52 +0800 Subject: [PATCH] fix bug --- .../sure-arrive/sure-arrive.component.ts | 18 ++++-------- .../sure-depart/sure-depart.component.ts | 28 ++++++++----------- 2 files changed, 18 insertions(+), 28 deletions(-) diff --git a/src/app/routes/order-management/modal/vehicle/sure-arrive/sure-arrive.component.ts b/src/app/routes/order-management/modal/vehicle/sure-arrive/sure-arrive.component.ts index eee67218..b99aa290 100644 --- a/src/app/routes/order-management/modal/vehicle/sure-arrive/sure-arrive.component.ts +++ b/src/app/routes/order-management/modal/vehicle/sure-arrive/sure-arrive.component.ts @@ -44,7 +44,7 @@ export class VehicleSureArriveComponent implements OnInit { ngOnInit(): void { console.log(this.i) this.initData() - this.i.time = this.i.loadingTime; + this.i.time = this.i?.loadingTime; this.initSF(); } initSF() { @@ -407,7 +407,7 @@ export class VehicleSureArriveComponent implements OnInit { } as SFUploadWidgetSchema, } }, - required: ['time', 'weight' ] + required: ['time' ] }; } this.ui = { @@ -422,19 +422,16 @@ export class VehicleSureArriveComponent implements OnInit { }; } save(value: any): void { - console.log('444'); if(this.Status === 1) { - console.log('555'); - if(!value.time) { this.service.msgSrv.warning('必填项为空!') return; } const params = { id: this.i.id, - imgUrl1: value.imgUrl1.data.fullFilePath, - imgUrl2: value.imgUrl2.data.fullFilePath, - time: value.time, + imgUrl1: value?.imgUrl1?.data?.fullFilePath, + imgUrl2: value?.imgUrl2?.data?.fullFilePath, + time: value?.time, } params.time = this.datePipe.transform(value.time, 'yyyy-MM-dd HH:mm:ss ') this.service.request(this.service.$api_get_insertWholeUnloadCarInfo, params).subscribe((res) => { @@ -444,12 +441,10 @@ export class VehicleSureArriveComponent implements OnInit { } }) } else { - if(!value.time || !this.data.weight) { + if(!value.time ) { this.service.msgSrv.warning('必填项为空!') return; } - console.log(value) - console.log(this.i) const params = { id: this.i?.id, imgUrl1: value?.imgUrl1?.data?.fullFilePath, @@ -459,7 +454,6 @@ export class VehicleSureArriveComponent implements OnInit { weight: this.data?.weight } params.time = this.datePipe.transform(value.time, 'yyyy-MM-dd HH:mm:ss ') - console.log(params) this.service.request(this.service.$api_get_insertBulkUnloadCarInfo, params).subscribe((res) => { if(res) { this.service.msgSrv.success('确认到车成功!') diff --git a/src/app/routes/order-management/modal/vehicle/sure-depart/sure-depart.component.ts b/src/app/routes/order-management/modal/vehicle/sure-depart/sure-depart.component.ts index 31f94dd1..975f559d 100644 --- a/src/app/routes/order-management/modal/vehicle/sure-depart/sure-depart.component.ts +++ b/src/app/routes/order-management/modal/vehicle/sure-depart/sure-depart.component.ts @@ -99,7 +99,6 @@ export class VehicleSureDepartComponent implements OnInit { }, multiple: false, listType: 'picture-card', - showRequired: true, } as SFUploadWidgetSchema, }, imgUrl2: { @@ -138,11 +137,10 @@ export class VehicleSureDepartComponent implements OnInit { }, multiple: false, listType: 'picture-card', - showRequired: true, } as SFUploadWidgetSchema, } }, - required: ['reason'] + required: ['time'] }; } else { this.schema = { @@ -210,7 +208,6 @@ export class VehicleSureDepartComponent implements OnInit { }, multiple: false, listType: 'picture-card', - showRequired: true, } as SFUploadWidgetSchema, }, imgUrl2: { @@ -249,11 +246,10 @@ export class VehicleSureDepartComponent implements OnInit { }, multiple: false, listType: 'picture-card', - showRequired: true, } as SFUploadWidgetSchema, } }, - required: ['time', 'weight'] + required: ['time'] }; } @@ -268,15 +264,15 @@ export class VehicleSureDepartComponent implements OnInit { } save(value: any): void { if(this.Status === 1) { - if(!value.time) { + if(!value?.time) { this.service.msgSrv.warning('必填项为空!') return; } const params = { id: this.i.id, - imgUrl1: value.imgUrl1.data.fullFilePath, - imgUrl2: value.imgUrl2.data.fullFilePath, - time: value.time, + imgUrl1: value?.imgUrl1?.data?.fullFilePath, + imgUrl2: value?.imgUrl2?.data?.fullFilePath, + time: value?.time, } params.time = this.datePipe.transform(value.time, 'yyyy-MM-dd HH:mm:ss ') this.service.request(this.service.$api_get_insertWholeStartCarInfo, params).subscribe((res) => { @@ -286,18 +282,18 @@ export class VehicleSureDepartComponent implements OnInit { } }) } else { - if(!value.time || !this.data.weight) { + if(!value?.time) { this.service.msgSrv.warning('必填项为空!') return; } console.log(value) const params = { id: this.i.id, - imgUrl1: value.imgUrl1.data.fullFilePath, - imgUrl2: value.imgUrl2.data.fullFilePath, - time: value.time, - volume: this.data.volume, - weight: this.data.weight + imgUrl1: value?.imgUrl1?.data?.fullFilePath, + imgUrl2: value?.imgUrl2?.data?.fullFilePath, + time: value?.time, + volume: this.data?.volume, + weight: this.data?.weight } params.time = this.datePipe.transform(value.time, 'yyyy-MM-dd HH:mm:ss ') this.service.request(this.service.$api_get_insertBulkStartCarInfo, params).subscribe((res) => {