From e9e4941bf985fc70744156a95769b417da3103a1 Mon Sep 17 00:00:00 2001 From: wangshiming Date: Fri, 25 Feb 2022 16:32:47 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../onecar-publish.component.html | 2 +- .../onecar-publish.component.ts | 45 ++++++++----------- 2 files changed, 20 insertions(+), 27 deletions(-) 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 cb99aee4..4b2384b3 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 @@ -239,7 +239,7 @@ [nzMin]="50000" [nzMax]="3000000" [nzStep]="0.01" - (ngModelChange)="i.setValue($event);getInsurersPrice()" + (ngModelChange)="i.setValue($event);getInsurersPrice($event)" nzPlaceHolder="请输入50000-3000000之间数值" > 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 2e9481dc..64abc0a9 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 @@ -849,10 +849,11 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { if (this.validateForm1.invalid || !this.sf3.valid || !this.sf1.valid || !this.sf4.valid || !this.sf6.valid || !this.sf7.valid) { return; } - console.log(this.validateForm1.value?.unloadingTime); - if (typeof this.validateForm1.value.unloadingTime !== 'string') { - var c = new Date(this.validateForm1.value.unloadingTime); - this.validateForm1.value.unloadingTime = + 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) + @@ -865,9 +866,9 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { ':' + this.addPreZero(c.getSeconds()); } - if (typeof this.validateForm1.value.loadingTime !== 'string') { - var c = new Date(this.validateForm1.value.loadingTime); - this.validateForm1.value.loadingTime = + if (typeof this.loadingTime !== 'string') { + var c = new Date(this.loadingTime); + this.loadingTime = c.getFullYear() + '-' + this.addPreZero(c.getMonth() + 1) + @@ -880,13 +881,14 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { ':' + 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.validateForm1?.value?.loadingTime, - unloadingTime: this.validateForm1?.value?.unloadingTime, + loadingTime: this.loadingTime, + unloadingTime: this.unloadingTime, unLoadingPlaceDTOList: [...this.startInfo, ...this.endInfo], goodsInfoDTOList: [ { @@ -1084,8 +1086,6 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { // 计算里程,时间 if (this.startInfo?.[0]?.area && this.endInfo?.[0]?.area) { - console.log(this.startInfo[0]?.area); - console.log(this.endInfo[0]?.area); this.amapService.drivingCompute([...this.startInfo], [...this.endInfo]).subscribe(res => { this.totalDistance = res.distance; this.totalTime = res.time; @@ -1166,8 +1166,6 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { nzWidth: 900, nzComponentParams: { spuStatus: '1' }, nzOnOk: item => { - console.log(item); - console.log(type); const data = item.seleteData; if (JSON.stringify(data) === '{}') return; switch (type) { @@ -1204,18 +1202,16 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { }); } changeUn(event: Date) { + console.log(event) this.unloadingTime = event; - console.log(this.unloadingTime ); - console.log(this.unloadingTime.getTime() ); if(typeof this.loadingTime === 'string') { var a = new Date(this.loadingTime) - if ( a > this.unloadingTime.getTime() ) { + if ( a > this.unloadingTime?.getTime() ) { this.service.msgSrv.error('卸货时间不能小于装货时间!'); this.unloadingTime = ''; - console.log(this.unloadingTime) } } else { - if ( this.loadingTime.getTime() > this.unloadingTime.getTime() ) { + if ( this.loadingTime?.getTime() > this.unloadingTime?.getTime() ) { this.service.msgSrv.error('卸货时间不能小于装货时间!'); this.unloadingTime = ''; } @@ -1223,19 +1219,14 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { } changeLO(event: Date) { this.loadingTime = event; - console.log(this.loadingTime.getTime() ); - console.log(this.unloadingTime) - console.log( typeof this.unloadingTime) if(typeof this.unloadingTime === 'string') { var a = new Date(this.unloadingTime) - if ( a.getTime()< this.loadingTime.getTime()) { - console.log('错误'); + if ( a.getTime()< this.loadingTime?.getTime()) { this.service.msgSrv.error('装货时间不能大于卸货时间!'); this.loadingTime = ''; } } else { - if ( this.unloadingTime.getTime()< this.loadingTime.getTime()) { - console.log('错误'); + if ( this.unloadingTime?.getTime()< this.loadingTime?.getTime()) { this.service.msgSrv.error('装货时间不能大于卸货时间!'); this.loadingTime = ''; } @@ -1299,7 +1290,9 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { }); } } - getInsurersPrice() { + getInsurersPrice($event: any) { + console.log($event); + console.log(this.sf5.value.goodsValue) console.log(this.sf5.value.insuranceType) if (this.sf5.value.goodsValue >= 50000) {