|
|
|
@ -94,10 +94,19 @@ export class OilStationInfoComponent implements OnInit {
|
|
|
|
|
} |
|
|
|
|
if (this.httpBody.licenses.length == 0) { |
|
|
|
|
this.httpBody.licenses = [ |
|
|
|
|
{ name: '营业执照', code: '', startTime: '', endTime: '', firstWarnTime: '', secondWarnTime: '', imageUrl: '', annualInspectionTime: '', annualInspectionWarnTime: '', annualInspectionOrganizationName: '', type: 1, hasAnnualInspection: true }, |
|
|
|
|
{ name: '危险化学品', code: '', startTime: '', endTime: '', firstWarnTime: '', secondWarnTime: '', imageUrl: '', annualInspectionTime: '', annualInspectionWarnTime: '', annualInspectionOrganizationName: '', type: 3, hasAnnualInspection: false }, |
|
|
|
|
{ name: '成品油零售', code: '', startTime: '', endTime: '', firstWarnTime: '', secondWarnTime: '', imageUrl: '', annualInspectionTime: '', annualInspectionWarnTime: '', annualInspectionOrganizationName: '', type: 2, hasAnnualInspection: true } |
|
|
|
|
{ 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 |
|
|
|
|
setTimeout(() => { |
|
|
|
@ -179,6 +188,13 @@ export class OilStationInfoComponent implements OnInit {
|
|
|
|
|
licenses: [ |
|
|
|
|
] |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
perpetualChange(item, $event) { |
|
|
|
|
if ($event) { |
|
|
|
|
item.endTime = '9999-01-01' |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
onChange($event) { |
|
|
|
|
|
|
|
|
|
} |
|
|
|
@ -204,7 +220,7 @@ export class OilStationInfoComponent implements OnInit {
|
|
|
|
|
} |
|
|
|
|
addTr() { |
|
|
|
|
this.httpBody.licenses.push( |
|
|
|
|
{ name: this.addName, code: '', startTime: '', endTime: '', firstWarnTime: '', secondWarnTime: '', imageUrl: '', annualInspectionTime: '', annualInspectionWarnTime: '', annualInspectionOrganizationName: '', type: -1, hasAnnualInspection: false }, |
|
|
|
|
{ name: this.addName, code: '', isPerpetual: false, startTime: '', endTime: '', firstWarnTime: '', secondWarnTime: '', imageUrl: '', annualInspectionTime: '', annualInspectionWarnTime: '', annualInspectionOrganizationName: '', type: -1, hasAnnualInspection: false }, |
|
|
|
|
) |
|
|
|
|
} |
|
|
|
|
deleteTrConfirm(key) { |
|
|
|
@ -247,10 +263,15 @@ export class OilStationInfoComponent implements OnInit {
|
|
|
|
|
body.stationType |
|
|
|
|
body.govUnitDetail = JSON.stringify(this.httpBody.govUnitDetail) |
|
|
|
|
console.log(body) |
|
|
|
|
|
|
|
|
|
body.licenses.forEach(item => { |
|
|
|
|
delete item.isPerpetual |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
this.http.put('/api/services/app/GasStation/Update', body).subscribe((data: any) => { |
|
|
|
|
this.isLoadingSave = false |
|
|
|
|
this.message.create('success', '保存成功!'); |
|
|
|
|
this.httpBody.licenses = data.result.licenses |
|
|
|
|
// this.httpBody.licenses = data.result.licenses
|
|
|
|
|
}, err => { |
|
|
|
|
this.isLoadingSave = false |
|
|
|
|
this.message.create('error', '保存失败!'); |
|
|
|
|