Browse Source

[完善]油站信息开业时间

beijing
邵佳豪 3 years ago
parent
commit
1372eba4b6
  1. 59
      src/app/pages/oil-station-info/oil-station-info.component.ts

59
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

Loading…
Cancel
Save