From 8a282a4bfc09889024a78d478ee0754397bdb695 Mon Sep 17 00:00:00 2001 From: Taric Xin Date: Mon, 16 May 2022 16:16:55 +0800 Subject: [PATCH] edit --- .../audit/detail/detail.component.html | 6 ++-- .../audit/detail/detail.component.ts | 27 +++++++++++++++-- .../list/detail/detail.component.html | 6 ++-- .../list/detail/detail.component.ts | 29 ++++++++++++++++--- 4 files changed, 56 insertions(+), 12 deletions(-) diff --git a/src/app/routes/vehicle/components/audit/detail/detail.component.html b/src/app/routes/vehicle/components/audit/detail/detail.component.html index 1087a637..aaa5c951 100644 --- a/src/app/routes/vehicle/components/audit/detail/detail.component.html +++ b/src/app/routes/vehicle/components/audit/detail/detail.component.html @@ -233,11 +233,11 @@ - + - + @@ -246,7 +246,7 @@ [nzBorderless]="!isEdit" [nzSuffixIcon]="isEdit ? 'calendar' : ''"> - + diff --git a/src/app/routes/vehicle/components/audit/detail/detail.component.ts b/src/app/routes/vehicle/components/audit/detail/detail.component.ts index 520e64ae..cafffa17 100644 --- a/src/app/routes/vehicle/components/audit/detail/detail.component.ts +++ b/src/app/routes/vehicle/components/audit/detail/detail.component.ts @@ -101,6 +101,15 @@ export class VehicleComponentsAuditDetailComponent implements OnInit, OnDestroy id: this.route.snapshot?.params?.id }; this.service.request(`${this.service.$api_get_operate_getaudit}`, params).subscribe(res => { + if (res.curbWeight) { + res.curbWeight = res.curbWeight * 1000; + } + if (res.carTotalLoad) { + res.carTotalLoad = res.carTotalLoad * 1000; + } + if (res.carLoad) { + res.carLoad = res.carLoad * 1000; + } this.detailData = res; this.tempalateData = res; }); @@ -157,7 +166,9 @@ export class VehicleComponentsAuditDetailComponent implements OnInit, OnDestroy this.detailData.driverLicenseEndTime = EADateUtil.yearToDate(this.detailData?.driverLicenseEndTime); this.detailData.driverLicenseGetTime = EADateUtil.yearToDateTime(this.detailData?.driverLicenseGetTime); - this.detailData.scrapTime = this.dateTimePickerUtil.format(this.detailData?.scrapTime, 'yyyy-MM-dd HH:mm:ss'); + if (this.detailData.scrapTime) { + this.detailData.scrapTime = this.dateTimePickerUtil.format(this.detailData?.scrapTime, 'yyyy-MM-dd HH:mm:ss'); + } this.detailData.roadTransportStartTime = EADateUtil.yearToDate(this.detailData?.roadTransportStartTime); @@ -170,7 +181,19 @@ export class VehicleComponentsAuditDetailComponent implements OnInit, OnDestroy this.service.msgSrv.error('发证日期起始不能大于结束日期!'); return; } - this.service.request(this.service.$api_get_update_audit, this.detailData).subscribe(res => { + + const params = { ...this.detailData }; + if (params.curbWeight) { + params.curbWeight = params.curbWeight / 1000; + } + if (params.carTotalLoad) { + params.carTotalLoad = params.carTotalLoad / 1000; + } + if (params.carLoad) { + params.carLoad = params.carLoad / 1000; + } + + this.service.request(this.service.$api_get_update_audit, params).subscribe(res => { if (res) { this.getDetailList(); this.isEdit = false; diff --git a/src/app/routes/vehicle/components/list/detail/detail.component.html b/src/app/routes/vehicle/components/list/detail/detail.component.html index eb675607..81e42abd 100644 --- a/src/app/routes/vehicle/components/list/detail/detail.component.html +++ b/src/app/routes/vehicle/components/list/detail/detail.component.html @@ -274,11 +274,11 @@ - + - + @@ -287,7 +287,7 @@ [nzBorderless]="!isEdit" [nzSuffixIcon]="isEdit ? 'calendar' : ''"> - + diff --git a/src/app/routes/vehicle/components/list/detail/detail.component.ts b/src/app/routes/vehicle/components/list/detail/detail.component.ts index 52d66e59..1aa69b19 100644 --- a/src/app/routes/vehicle/components/list/detail/detail.component.ts +++ b/src/app/routes/vehicle/components/list/detail/detail.component.ts @@ -185,6 +185,15 @@ export class VehicleComponentsListDetailComponent implements OnInit { id: this.route.snapshot?.params?.id }; this.service.request(`${this.service.$api_get_operate_get}`, params).subscribe(res => { + if (res.curbWeight) { + res.curbWeight = res.curbWeight * 1000; + } + if (res.carTotalLoad) { + res.carTotalLoad = res.carTotalLoad * 1000; + } + if (res.carLoad) { + res.carLoad = res.carLoad * 1000; + } this.detailData = res; this.tempalateData = res; }); @@ -267,8 +276,9 @@ export class VehicleComponentsListDetailComponent implements OnInit { this.detailData.driverLicenseEndTime = EADateUtil.yearToDate(this.detailData?.driverLicenseEndTime); this.detailData.driverLicenseGetTime = EADateUtil.yearToDate(this.detailData?.driverLicenseGetTime); - - this.detailData.scrapTime = this.dateTimePickerUtil.format(this.detailData?.scrapTime, 'yyyy-MM-dd HH:mm:ss'); + if (this.detailData.scrapTime) { + this.detailData.scrapTime = this.dateTimePickerUtil.format(this.detailData?.scrapTime, 'yyyy-MM-dd HH:mm:ss'); + } this.detailData.roadTransportStartTime = EADateUtil.yearToDate(this.detailData?.roadTransportStartTime); @@ -280,8 +290,19 @@ export class VehicleComponentsListDetailComponent implements OnInit { this.service.msgSrv.error('发证日期起始不能大于结束日期!'); return; } - this.service.request(this.service.$api_get_update, this.detailData).subscribe(res => { - console.log(res); + + const params = { ...this.detailData }; + if (params.curbWeight) { + params.curbWeight = params.curbWeight / 1000; + } + if (params.carTotalLoad) { + params.carTotalLoad = params.carTotalLoad / 1000; + } + if (params.carLoad) { + params.carLoad = params.carLoad / 1000; + } + + this.service.request(this.service.$api_get_update, params).subscribe(res => { if (res) { this.getDetailList(); this.isEdit = false;