From 1372eba4b6b4b9ed1f9b034a55c47538d07bfc96 Mon Sep 17 00:00:00 2001 From: SHAOJIAHAO <55341701@qq.com> Date: Wed, 18 May 2022 09:00:48 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=AE=8C=E5=96=84]=E6=B2=B9=E7=AB=99=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E5=BC=80=E4=B8=9A=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../oil-station-info.component.ts | 59 ++----------------- 1 file changed, 5 insertions(+), 54 deletions(-) diff --git a/src/app/pages/oil-station-info/oil-station-info.component.ts b/src/app/pages/oil-station-info/oil-station-info.component.ts index 4c72aa5..b43f325 100644 --- a/src/app/pages/oil-station-info/oil-station-info.component.ts +++ b/src/app/pages/oil-station-info/oil-station-info.component.ts @@ -71,6 +71,9 @@ export class OilStationInfoComponent implements OnInit { } }).subscribe((data: any) => { + if (new Date(data.result.openTime).getTime() == -62135625943000) { + data.result.openTime = null + } this.httpBody = data.result if (!this.httpBody.govUnitDetail) { this.httpBody.govUnitDetail = { @@ -84,32 +87,8 @@ export class OilStationInfoComponent implements OnInit { this.hospital = data.result.govUnitDetail.hospital this.fireBrigade = data.result.govUnitDetail.fireBrigade } - // if (this.httpBody.licenses.length == 0) { - // this.httpBody.licenses = [ - // { name: '营业执照', code: '', isPerpetual: false, startTime: '', endTime: '', firstWarnTime: '', secondWarnTime: '', imageUrl: '', annualInspectionTime: '', annualInspectionWarnTime: '', annualInspectionOrganizationName: '', type: 1, hasAnnualInspection: true }, - // { name: '危险化学品', code: '', isPerpetual: false, startTime: '', endTime: '', firstWarnTime: '', secondWarnTime: '', imageUrl: '', annualInspectionTime: '', annualInspectionWarnTime: '', annualInspectionOrganizationName: '', type: 3, hasAnnualInspection: false }, - // { name: '成品油零售', code: '', isPerpetual: false, startTime: '', endTime: '', firstWarnTime: '', secondWarnTime: '', imageUrl: '', annualInspectionTime: '', annualInspectionWarnTime: '', annualInspectionOrganizationName: '', type: 2, hasAnnualInspection: true } - // ] - // } else { - // console.log('走这里了',this.httpBody.licenses) - // this.httpBody.licenses.forEach(item => { - // if (item.endTime == '9999-01-01T00:00:00') { - // item.isPerpetual = true - // } else { - // item.isPerpetual = false - // } - // }) - // } - // this.httpBody.stationType ? this.httpBody.stationType = String(this.httpBody.stationType) : null - console.log('油站信息', this.httpBody) - // setTimeout(() => { - // this.gallery = new Viewer(document.getElementById('images'), { - // show: () => { // 动态加载图片后,更新实例 - // this.gallery.update(); - // }, - // }); - // }, 0); + // console.log('油站信息', this.httpBody) }, err => { console.log('油站错误信息', err.error.error.message) @@ -190,34 +169,6 @@ export class OilStationInfoComponent implements OnInit { } } - - // addName = '' - // isVisible = false; - // showModal(): void { - // this.addName = '' - // this.isVisible = true; - // } - - // handleOk(): void { - // this.isVisible = false; - // if (this.addName) { - // this.addTr() - // } - // } - - // handleCancel(): void { - // console.log('Button cancel clicked!'); - // this.isVisible = false; - // } - // addTr() { - // this.httpBody.licenses.push( - // { name: this.addName, code: '', isPerpetual: false, startTime: '', endTime: '', firstWarnTime: '', secondWarnTime: '', imageUrl: '', annualInspectionTime: '', annualInspectionWarnTime: '', annualInspectionOrganizationName: '', type: -1, hasAnnualInspection: false }, - // ) - // } - // deleteTrConfirm(key) { - // console.log(key) - // this.httpBody.licenses.splice(key, 1); - // } goback() { this.router.navigate(['/todaywarning/petrolStation']) } @@ -226,7 +177,7 @@ export class OilStationInfoComponent implements OnInit { async submitForm() { if (this.validateForm.valid) { this.isLoadingSave = true - this.httpBody.openTime = moment(this.httpBody.openTime).format('YYYY-MM-MM')//开业时间格式化 + this.httpBody.openTime = moment(this.httpBody.openTime).format('YYYY-MM-DD')//开业时间格式化 this.httpBody.govUnitDetail.policeStation = this.validateForm.value.policeStation this.httpBody.govUnitDetail.hospital = this.validateForm.value.hospital this.httpBody.govUnitDetail.fireBrigade = this.validateForm.value.fireBrigade