|
|
|
@ -1,25 +1,31 @@
|
|
|
|
|
import { HttpClient } from '@angular/common/http'; |
|
|
|
|
import { Component, OnInit } from '@angular/core'; |
|
|
|
|
import { FormBuilder, FormGroup, Validators } from '@angular/forms'; |
|
|
|
|
import { ObjectsSimpleService } from 'src/app/service/objectsSimple.service'; |
|
|
|
|
import { NzMessageService } from 'ng-zorro-antd/message'; |
|
|
|
|
import * as moment from 'moment'; |
|
|
|
|
import Viewer from 'viewerjs'; |
|
|
|
|
import { Router, ActivatedRoute } from '@angular/router' |
|
|
|
|
import { HttpClient } from "@angular/common/http"; |
|
|
|
|
import { Component, OnInit } from "@angular/core"; |
|
|
|
|
import { FormBuilder, FormGroup, Validators } from "@angular/forms"; |
|
|
|
|
import { ObjectsSimpleService } from "src/app/service/objectsSimple.service"; |
|
|
|
|
import { NzMessageService } from "ng-zorro-antd/message"; |
|
|
|
|
import * as moment from "moment"; |
|
|
|
|
import Viewer from "viewerjs"; |
|
|
|
|
import { Router, ActivatedRoute } from "@angular/router"; |
|
|
|
|
@Component({ |
|
|
|
|
selector: 'app-oil-station-info', |
|
|
|
|
templateUrl: './oil-station-info.component.html', |
|
|
|
|
styleUrls: ['./oil-station-info.component.scss'] |
|
|
|
|
selector: "app-oil-station-info", |
|
|
|
|
templateUrl: "./oil-station-info.component.html", |
|
|
|
|
styleUrls: ["./oil-station-info.component.scss"], |
|
|
|
|
}) |
|
|
|
|
export class OilStationInfoComponent implements OnInit { |
|
|
|
|
validateForm!: FormGroup; |
|
|
|
|
constructor(private router: Router, private fb: FormBuilder, private objectsSrv: ObjectsSimpleService, private http: HttpClient, private message: NzMessageService, public route: ActivatedRoute) { } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
userdata: any |
|
|
|
|
dateFormat = 'yyyy-MM-dd'; |
|
|
|
|
constructor( |
|
|
|
|
private router: Router, |
|
|
|
|
private fb: FormBuilder, |
|
|
|
|
private objectsSrv: ObjectsSimpleService, |
|
|
|
|
private http: HttpClient, |
|
|
|
|
private message: NzMessageService, |
|
|
|
|
public route: ActivatedRoute |
|
|
|
|
) {} |
|
|
|
|
|
|
|
|
|
userdata: any; |
|
|
|
|
dateFormat = "yyyy-MM-dd"; |
|
|
|
|
ngOnInit(): void { |
|
|
|
|
this.userdata = JSON.parse(sessionStorage.getItem('userdata')) |
|
|
|
|
this.userdata = JSON.parse(sessionStorage.getItem("userdata")); |
|
|
|
|
this.validateForm = this.fb.group({ |
|
|
|
|
oilStation: this.fb.group({ |
|
|
|
|
organization: [], |
|
|
|
@ -40,243 +46,306 @@ export class OilStationInfoComponent implements OnInit {
|
|
|
|
|
name: [null], |
|
|
|
|
address: [null], |
|
|
|
|
distance: [null], |
|
|
|
|
contactInformation: [null] |
|
|
|
|
contactInformation: [null], |
|
|
|
|
}), |
|
|
|
|
hospital: this.fb.group({ |
|
|
|
|
name: [null], |
|
|
|
|
address: [null], |
|
|
|
|
distance: [null], |
|
|
|
|
contactInformation: [null] |
|
|
|
|
contactInformation: [null], |
|
|
|
|
}), |
|
|
|
|
fireBrigade: this.fb.group({ |
|
|
|
|
name: [null], |
|
|
|
|
address: [null], |
|
|
|
|
distance: [null], |
|
|
|
|
contactInformation: [null] |
|
|
|
|
}) |
|
|
|
|
contactInformation: [null], |
|
|
|
|
}), |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
this.getInfo() |
|
|
|
|
|
|
|
|
|
this.getInfo(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//获取油站信息
|
|
|
|
|
// gallery
|
|
|
|
|
getInfo() { |
|
|
|
|
this.http.get('/api/services/app/GasStation/Get', { |
|
|
|
|
params: { |
|
|
|
|
organizationUnitId: this.route.snapshot.queryParams.id |
|
|
|
|
} |
|
|
|
|
}).subscribe((data: any) => { |
|
|
|
|
|
|
|
|
|
this.httpBody.locationName ? null : this.httpBody.locationName = this.httpBody.proposalAreaName |
|
|
|
|
this.httpBody.companyName ? null : this.httpBody.companyName = this.httpBody.proposalCompanyName |
|
|
|
|
|
|
|
|
|
if (new Date(data.result.openTime).getTime() == -62135625943000) { |
|
|
|
|
data.result.openTime = null |
|
|
|
|
} |
|
|
|
|
this.httpBody = data.result |
|
|
|
|
if (!this.httpBody.govUnitDetail) { |
|
|
|
|
this.httpBody.govUnitDetail = { |
|
|
|
|
policeStation: {}, |
|
|
|
|
hospital: {}, |
|
|
|
|
fireBrigade: {} |
|
|
|
|
this.http |
|
|
|
|
.get("/api/services/app/GasStation/Get", { |
|
|
|
|
params: { |
|
|
|
|
organizationUnitId: this.route.snapshot.queryParams.id, |
|
|
|
|
}, |
|
|
|
|
}) |
|
|
|
|
.subscribe( |
|
|
|
|
(data: any) => { |
|
|
|
|
|
|
|
|
|
this.httpBody.locationName |
|
|
|
|
? null |
|
|
|
|
: (this.httpBody.locationName = this.httpBody.proposalAreaName); |
|
|
|
|
this.httpBody.companyName |
|
|
|
|
? null |
|
|
|
|
: (this.httpBody.companyName = this.httpBody.proposalCompanyName); |
|
|
|
|
|
|
|
|
|
if (new Date(data.result.openTime).getTime() == -62135625943000) { |
|
|
|
|
data.result.openTime = null; |
|
|
|
|
} |
|
|
|
|
this.httpBody = data.result; |
|
|
|
|
if (!this.httpBody.govUnitDetail) { |
|
|
|
|
this.httpBody.govUnitDetail = { |
|
|
|
|
policeStation: {}, |
|
|
|
|
hospital: {}, |
|
|
|
|
fireBrigade: {}, |
|
|
|
|
}; |
|
|
|
|
} else { |
|
|
|
|
this.httpBody.govUnitDetail = JSON.parse(data.result.govUnitDetail); |
|
|
|
|
this.policeStation = data.result.govUnitDetail.policeStation; |
|
|
|
|
this.hospital = data.result.govUnitDetail.hospital; |
|
|
|
|
this.fireBrigade = data.result.govUnitDetail.fireBrigade; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (this.httpBody.otherData) { |
|
|
|
|
this.otherInfoData = JSON.parse(this.httpBody.otherData); |
|
|
|
|
} |
|
|
|
|
console.log("油站信息", this.httpBody); |
|
|
|
|
}, |
|
|
|
|
(err) => { |
|
|
|
|
console.log("油站错误信息", err.error.error.message); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
this.httpBody.govUnitDetail = JSON.parse(data.result.govUnitDetail) |
|
|
|
|
this.policeStation = data.result.govUnitDetail.policeStation |
|
|
|
|
this.hospital = data.result.govUnitDetail.hospital |
|
|
|
|
this.fireBrigade = data.result.govUnitDetail.fireBrigade |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (this.httpBody.otherData) { |
|
|
|
|
this.otherInfoData = JSON.parse(this.httpBody.otherData) |
|
|
|
|
} |
|
|
|
|
console.log('油站信息', this.httpBody) |
|
|
|
|
|
|
|
|
|
}, err => { |
|
|
|
|
console.log('油站错误信息', err.error.error.message) |
|
|
|
|
}) |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
exportExcel() { |
|
|
|
|
const httpOptions = { |
|
|
|
|
responseType: 'blob' as 'json' |
|
|
|
|
responseType: "blob" as "json", |
|
|
|
|
}; |
|
|
|
|
this.http.get(`/api/services/app/GasStation/ExportExcelFile?gasStationId=${this.httpBody.id}`, httpOptions).subscribe((data: any) => { |
|
|
|
|
// console.log('导出成功')
|
|
|
|
|
// 文件名中有中文 则对文件名进行转码
|
|
|
|
|
const link = document.createElement('a'); |
|
|
|
|
const blob = new Blob([data], { type: 'application/vnd.ms-excel' }); |
|
|
|
|
link.setAttribute('href', window.URL.createObjectURL(blob)); |
|
|
|
|
link.setAttribute('download', this.httpBody.stationName + '基本信息' + '.xls'); |
|
|
|
|
link.style.visibility = 'hidden'; |
|
|
|
|
document.body.appendChild(link); |
|
|
|
|
link.click(); |
|
|
|
|
document.body.removeChild(link); |
|
|
|
|
this.message.create('success', '导出成功!'); |
|
|
|
|
}, err => { |
|
|
|
|
this.message.create('error', '导出失败!'); |
|
|
|
|
}) |
|
|
|
|
this.http |
|
|
|
|
.get( |
|
|
|
|
`/api/services/app/GasStation/ExportExcelFile?gasStationId=${this.httpBody.id}`, |
|
|
|
|
httpOptions |
|
|
|
|
) |
|
|
|
|
.subscribe( |
|
|
|
|
(data: any) => { |
|
|
|
|
// console.log('导出成功')
|
|
|
|
|
// 文件名中有中文 则对文件名进行转码
|
|
|
|
|
const link = document.createElement("a"); |
|
|
|
|
const blob = new Blob([data], { type: "application/vnd.ms-excel" }); |
|
|
|
|
link.setAttribute("href", window.URL.createObjectURL(blob)); |
|
|
|
|
link.setAttribute( |
|
|
|
|
"download", |
|
|
|
|
this.httpBody.stationName + "基本信息" + ".xls" |
|
|
|
|
); |
|
|
|
|
link.style.visibility = "hidden"; |
|
|
|
|
document.body.appendChild(link); |
|
|
|
|
link.click(); |
|
|
|
|
document.body.removeChild(link); |
|
|
|
|
this.message.create("success", "导出成功!"); |
|
|
|
|
}, |
|
|
|
|
(err) => { |
|
|
|
|
this.message.create("error", "导出失败!"); |
|
|
|
|
} |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
policeStation = { |
|
|
|
|
name: '', |
|
|
|
|
address: '', |
|
|
|
|
distance: '', |
|
|
|
|
contactInformation: '' |
|
|
|
|
} |
|
|
|
|
name: "", |
|
|
|
|
address: "", |
|
|
|
|
distance: "", |
|
|
|
|
contactInformation: "", |
|
|
|
|
}; |
|
|
|
|
hospital = { |
|
|
|
|
name: '', |
|
|
|
|
address: '', |
|
|
|
|
distance: '', |
|
|
|
|
contactInformation: '' |
|
|
|
|
} |
|
|
|
|
name: "", |
|
|
|
|
address: "", |
|
|
|
|
distance: "", |
|
|
|
|
contactInformation: "", |
|
|
|
|
}; |
|
|
|
|
fireBrigade = { |
|
|
|
|
name: '', |
|
|
|
|
address: '', |
|
|
|
|
distance: '', |
|
|
|
|
contactInformation: '' |
|
|
|
|
} |
|
|
|
|
name: "", |
|
|
|
|
address: "", |
|
|
|
|
distance: "", |
|
|
|
|
contactInformation: "", |
|
|
|
|
}; |
|
|
|
|
httpBody = { |
|
|
|
|
id: null, |
|
|
|
|
stationName: JSON.parse(sessionStorage.getItem('userdata')).organization.displayName, |
|
|
|
|
organizationUnitId: JSON.parse(sessionStorage.getItem('userdata')).organization.id, |
|
|
|
|
stationName: JSON.parse(sessionStorage.getItem("userdata")).organization |
|
|
|
|
.displayName, |
|
|
|
|
organizationUnitId: JSON.parse(sessionStorage.getItem("userdata")) |
|
|
|
|
.organization.id, |
|
|
|
|
auditLog: { |
|
|
|
|
auditStatusDesc: null, |
|
|
|
|
rejectReason: null |
|
|
|
|
rejectReason: null, |
|
|
|
|
}, |
|
|
|
|
auditStatus: null, |
|
|
|
|
openTime: '', |
|
|
|
|
stationType: '', |
|
|
|
|
laneCount: '', |
|
|
|
|
address: '', |
|
|
|
|
locationName: '', |
|
|
|
|
companyName: '', |
|
|
|
|
leaderName: '', |
|
|
|
|
proposalAreaName: '', |
|
|
|
|
proposalCompanyName: '', |
|
|
|
|
leaderContact: '', |
|
|
|
|
stationLevel: '', |
|
|
|
|
sellVariety: '', |
|
|
|
|
gasStationCount: '', |
|
|
|
|
tankVolume: '', |
|
|
|
|
openTime: "", |
|
|
|
|
stationType: "", |
|
|
|
|
laneCount: "", |
|
|
|
|
address: "", |
|
|
|
|
locationName: "", |
|
|
|
|
companyName: "", |
|
|
|
|
leaderName: "", |
|
|
|
|
proposalAreaName: "", |
|
|
|
|
proposalCompanyName: "", |
|
|
|
|
leaderContact: "", |
|
|
|
|
stationLevel: "", |
|
|
|
|
sellVariety: "", |
|
|
|
|
gasStationCount: "", |
|
|
|
|
tankVolume: "", |
|
|
|
|
govUnitDetail: { |
|
|
|
|
policeStation: {}, |
|
|
|
|
hospital: {}, |
|
|
|
|
fireBrigade: {} |
|
|
|
|
fireBrigade: {}, |
|
|
|
|
}, |
|
|
|
|
hasBuildingInfo: true, |
|
|
|
|
businessLicenseImage: '', |
|
|
|
|
dangerousChemicalLicenseImage: '', |
|
|
|
|
gasSellLicenseImage: '', |
|
|
|
|
licenses: [ |
|
|
|
|
], |
|
|
|
|
otherData: null |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
businessLicenseImage: "", |
|
|
|
|
dangerousChemicalLicenseImage: "", |
|
|
|
|
gasSellLicenseImage: "", |
|
|
|
|
licenses: [], |
|
|
|
|
otherData: null, |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
otherInfoData = { |
|
|
|
|
oilingMachine: [ |
|
|
|
|
{ name: '', brand: '', oilGunNum: '', oilsArticleNum: '', oilGunSerialNum: '' } |
|
|
|
|
{ |
|
|
|
|
name: "", |
|
|
|
|
brand: "", |
|
|
|
|
oilGunNum: "", |
|
|
|
|
oilsArticleNum: "", |
|
|
|
|
oilGunSerialNum: "", |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
tankEquipment: [ |
|
|
|
|
{ name: '', oilsArticleNum: '', oilGunSerialNum: '', oilOmeterVolume: '', safetyVolume: '', oilOmeterType: 0, oilPumpType: 0 } |
|
|
|
|
{ |
|
|
|
|
name: "", |
|
|
|
|
oilsArticleNum: "", |
|
|
|
|
oilGunSerialNum: "", |
|
|
|
|
oilOmeterVolume: "", |
|
|
|
|
safetyVolume: "", |
|
|
|
|
oilOmeterType: 0, |
|
|
|
|
oilPumpType: 0, |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
oilDeliveryPipe: [ |
|
|
|
|
{ name: '', connectTanker: '', connectOilTank: '', designPaper: '' } |
|
|
|
|
{ name: "", connectTanker: "", connectOilTank: "", designPaper: "" }, |
|
|
|
|
], |
|
|
|
|
oilVaporRecovery: [ |
|
|
|
|
{ name: '油气回收管线', onceSystemType: '将卸油时产生的油气进行回收', twiceSystemType: 1, twicePumpType: 'mini9000', thriceProcessingUnit: '冷凝+吸附', monitoringDevice: '监测气液比、密闭性,出现异常可及时预警', designPaper: '' } |
|
|
|
|
{ |
|
|
|
|
name: "油气回收管线", |
|
|
|
|
onceSystemType: "将卸油时产生的油气进行回收", |
|
|
|
|
twiceSystemType: 1, |
|
|
|
|
twicePumpType: "mini9000", |
|
|
|
|
thriceProcessingUnit: "冷凝+吸附", |
|
|
|
|
monitoringDevice: "监测气液比、密闭性,出现异常可及时预警", |
|
|
|
|
designPaper: "", |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
valve: [ |
|
|
|
|
{ name: 'P/V阀(机械呼吸阀)', description: '阀内设计双向开启功能,阀门处于常闭状态,当油罐压力/真空达到阀门预设压力/真空值时,阀门自行打开进行排气/吸气,以维持油罐内压力与大气压保持平衡。' } |
|
|
|
|
] |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
name: "P/V阀(机械呼吸阀)", |
|
|
|
|
description: |
|
|
|
|
"阀内设计双向开启功能,阀门处于常闭状态,当油罐压力/真空达到阀门预设压力/真空值时,阀门自行打开进行排气/吸气,以维持油罐内压力与大气压保持平衡。", |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
addTable(tableData, type) { |
|
|
|
|
if (type == 'oilingMachine') { |
|
|
|
|
tableData.push({ name: '', brand: '', oilGunNum: '', oilsArticleNum: '', oilGunSerialNum: '' }) |
|
|
|
|
if (type == "oilingMachine") { |
|
|
|
|
tableData.push({ |
|
|
|
|
name: "", |
|
|
|
|
brand: "", |
|
|
|
|
oilGunNum: "", |
|
|
|
|
oilsArticleNum: "", |
|
|
|
|
oilGunSerialNum: "", |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
if (type == 'tankEquipment') { |
|
|
|
|
tableData.push({ name: '', oilsArticleNum: '', oilGunSerialNum: '', oilOmeterVolume: '', safetyVolume: '', oilOmeterType: 0, oilPumpType: 0 }) |
|
|
|
|
if (type == "tankEquipment") { |
|
|
|
|
tableData.push({ |
|
|
|
|
name: "", |
|
|
|
|
oilsArticleNum: "", |
|
|
|
|
oilGunSerialNum: "", |
|
|
|
|
oilOmeterVolume: "", |
|
|
|
|
safetyVolume: "", |
|
|
|
|
oilOmeterType: 0, |
|
|
|
|
oilPumpType: 0, |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
if (type == 'oilDeliveryPipe') { |
|
|
|
|
tableData.push({ name: '', connectTanker: '', connectOilTank: '', designPaper: '' }) |
|
|
|
|
if (type == "oilDeliveryPipe") { |
|
|
|
|
tableData.push({ |
|
|
|
|
name: "", |
|
|
|
|
connectTanker: "", |
|
|
|
|
connectOilTank: "", |
|
|
|
|
designPaper: "", |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
deleteTable(tableData, key) { |
|
|
|
|
tableData.splice(key, 1) |
|
|
|
|
tableData.splice(key, 1); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
uploadType: string |
|
|
|
|
isUploadLoading = false |
|
|
|
|
uploadType: string; |
|
|
|
|
isUploadLoading = false; |
|
|
|
|
filechange(e, type, item) { |
|
|
|
|
this.isUploadLoading = true |
|
|
|
|
let file = e.target.files[0] || null //获取上传的文件
|
|
|
|
|
this.uploadType = type |
|
|
|
|
this.openFileSelect(file, `stationPhotos/${this.route.snapshot.queryParams.id}/`, item) |
|
|
|
|
this.isUploadLoading = true; |
|
|
|
|
let file = e.target.files[0] || null; //获取上传的文件
|
|
|
|
|
this.uploadType = type; |
|
|
|
|
this.openFileSelect( |
|
|
|
|
file, |
|
|
|
|
`stationPhotos/${this.route.snapshot.queryParams.id}/`, |
|
|
|
|
item |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
//设置文件路径并上传
|
|
|
|
|
postFilePath |
|
|
|
|
postFilePath; |
|
|
|
|
async openFileSelect(file: File, extensionPath: string, item) { |
|
|
|
|
this.postFilePath = extensionPath; |
|
|
|
|
let fileSize = file.size || null //上传文件的总大小
|
|
|
|
|
let shardSize = 5 * 1024 * 1024 //5MB 超过5MB要分块上传
|
|
|
|
|
if (fileSize >= shardSize) // 超过5MB要分块上传
|
|
|
|
|
{ |
|
|
|
|
let fileSize = file.size || null; //上传文件的总大小
|
|
|
|
|
let shardSize = 5 * 1024 * 1024; //5MB 超过5MB要分块上传
|
|
|
|
|
if (fileSize >= shardSize) { |
|
|
|
|
// 超过5MB要分块上传
|
|
|
|
|
await this.postFileByMul(file, item); |
|
|
|
|
} |
|
|
|
|
else //普通上传
|
|
|
|
|
{ |
|
|
|
|
} //普通上传
|
|
|
|
|
else { |
|
|
|
|
await this.postFile(file, item); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
//上传文件
|
|
|
|
|
async postFile(file: File, item) { |
|
|
|
|
await new Promise((resolve, reject) => { |
|
|
|
|
this.objectsSrv.postFile(this.postFilePath, file).subscribe(data => { |
|
|
|
|
this.objectsSrv.postFile(this.postFilePath, file).subscribe((data) => { |
|
|
|
|
let dataObj = data as any; |
|
|
|
|
let filePath: string = ObjectsSimpleService.baseUrl + dataObj.objectName; |
|
|
|
|
item.designPaper = filePath |
|
|
|
|
this.isUploadLoading = false |
|
|
|
|
resolve('success') |
|
|
|
|
let filePath: string = |
|
|
|
|
ObjectsSimpleService.baseUrl + dataObj.objectName; |
|
|
|
|
item.designPaper = filePath; |
|
|
|
|
this.isUploadLoading = false; |
|
|
|
|
resolve("success"); |
|
|
|
|
}); |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
/** |
|
|
|
|
* 分块上传 |
|
|
|
|
* @param file
|
|
|
|
|
* @param file |
|
|
|
|
*/ |
|
|
|
|
postFileByMul(file: File, item) { |
|
|
|
|
this.objectsSrv.postFile_MultipartUpload(this.postFilePath, file).then((value) => { |
|
|
|
|
let dataObj = value as any; |
|
|
|
|
item.designPaper = dataObj.filePath |
|
|
|
|
this.isUploadLoading = false |
|
|
|
|
}); |
|
|
|
|
this.objectsSrv |
|
|
|
|
.postFile_MultipartUpload(this.postFilePath, file) |
|
|
|
|
.then((value) => { |
|
|
|
|
let dataObj = value as any; |
|
|
|
|
item.designPaper = dataObj.filePath; |
|
|
|
|
this.isUploadLoading = false; |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//查看图片
|
|
|
|
|
viewImg(url) { |
|
|
|
|
let dom = document.getElementById(`viewerjs`) |
|
|
|
|
let dom = document.getElementById(`viewerjs`); |
|
|
|
|
let pObjs = dom.childNodes; |
|
|
|
|
let node = document.createElement("img") |
|
|
|
|
let node = document.createElement("img"); |
|
|
|
|
node.style.display = "none"; |
|
|
|
|
node.src = url; |
|
|
|
|
node.id = 'img' |
|
|
|
|
dom.appendChild(node) |
|
|
|
|
node.id = "img"; |
|
|
|
|
dom.appendChild(node); |
|
|
|
|
setTimeout(() => { |
|
|
|
|
let viewer = new Viewer(document.getElementById(`viewerjs`), { |
|
|
|
|
hidden: () => { |
|
|
|
|
dom.removeChild(pObjs[0]); |
|
|
|
|
viewer.destroy(); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
}); |
|
|
|
|
node.click(); |
|
|
|
|
}, 0); |
|
|
|
@ -286,78 +355,92 @@ export class OilStationInfoComponent implements OnInit {
|
|
|
|
|
history.go(-1); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
isLoadingSave: boolean = false |
|
|
|
|
isLoadingSave: boolean = false; |
|
|
|
|
async submitForm() { |
|
|
|
|
if (this.validateForm.valid) { |
|
|
|
|
this.isLoadingSave = true |
|
|
|
|
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 |
|
|
|
|
|
|
|
|
|
let body = JSON.parse(JSON.stringify(this.httpBody)) |
|
|
|
|
body.stationType |
|
|
|
|
body.govUnitDetail = JSON.stringify(this.httpBody.govUnitDetail) |
|
|
|
|
this.isLoadingSave = true; |
|
|
|
|
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; |
|
|
|
|
|
|
|
|
|
let body = JSON.parse(JSON.stringify(this.httpBody)); |
|
|
|
|
body.stationType; |
|
|
|
|
body.govUnitDetail = JSON.stringify(this.httpBody.govUnitDetail); |
|
|
|
|
|
|
|
|
|
if (!body.hasBuildingInfo) { |
|
|
|
|
body.otherData = JSON.stringify(this.otherInfoData) |
|
|
|
|
body.otherData = JSON.stringify(this.otherInfoData); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
body.licenses.forEach(item => { |
|
|
|
|
delete item.isPerpetual |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
body.licenses.forEach((item) => { |
|
|
|
|
delete item.isPerpetual; |
|
|
|
|
}); |
|
|
|
|
// body.stationName = "太原东服务区东区加油站";
|
|
|
|
|
await new Promise<void>((resolve, reject) => { |
|
|
|
|
this.http.put('/api/services/app/GasStation/Update', body).subscribe((data: any) => { |
|
|
|
|
resolve(data) |
|
|
|
|
this.isLoadingSave = false |
|
|
|
|
this.message.create('success', '保存成功!'); |
|
|
|
|
}, err => { |
|
|
|
|
reject(err) |
|
|
|
|
this.isLoadingSave = false |
|
|
|
|
this.message.create('error', '保存失败!'); |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
this.http.put("/api/services/app/GasStation/Update", body).subscribe( |
|
|
|
|
(data: any) => { |
|
|
|
|
resolve(data); |
|
|
|
|
this.isLoadingSave = false; |
|
|
|
|
this.message.create("success", "保存成功!"); |
|
|
|
|
}, |
|
|
|
|
(err) => { |
|
|
|
|
reject(err); |
|
|
|
|
this.isLoadingSave = false; |
|
|
|
|
this.message.create("error", "保存失败!"); |
|
|
|
|
} |
|
|
|
|
); |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|
this.message.create('warning', '请填写完整!'); |
|
|
|
|
return false |
|
|
|
|
this.message.create("warning", "请填写完整!"); |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
isSubmitAuditLoading: boolean = false |
|
|
|
|
isSubmitAuditLoading: boolean = false; |
|
|
|
|
async submitAudit() { |
|
|
|
|
|
|
|
|
|
await this.submitForm() |
|
|
|
|
await this.submitForm(); |
|
|
|
|
|
|
|
|
|
if (this.validateForm.valid) { |
|
|
|
|
let params = { |
|
|
|
|
id: this.httpBody.id |
|
|
|
|
} |
|
|
|
|
this.http.post('/api/services/app/GasStation/Commit', null, { params: params }).subscribe((data: any) => { |
|
|
|
|
this.isSubmitAuditLoading = false |
|
|
|
|
this.getInfo() |
|
|
|
|
this.message.create('success', '提交审核成功!'); |
|
|
|
|
}, err => { |
|
|
|
|
this.isSubmitAuditLoading = false |
|
|
|
|
this.message.create('error', '提交审核失败!'); |
|
|
|
|
}) |
|
|
|
|
id: this.httpBody.id, |
|
|
|
|
}; |
|
|
|
|
this.http |
|
|
|
|
.post("/api/services/app/GasStation/Commit", null, { params: params }) |
|
|
|
|
.subscribe( |
|
|
|
|
(data: any) => { |
|
|
|
|
this.isSubmitAuditLoading = false; |
|
|
|
|
this.getInfo(); |
|
|
|
|
this.message.create("success", "提交审核成功!"); |
|
|
|
|
}, |
|
|
|
|
(err) => { |
|
|
|
|
this.isSubmitAuditLoading = false; |
|
|
|
|
this.message.create("error", "提交审核失败!"); |
|
|
|
|
} |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
isRevocationAuditLoading: boolean = false |
|
|
|
|
isRevocationAuditLoading: boolean = false; |
|
|
|
|
revocationAudit() { |
|
|
|
|
let params = { |
|
|
|
|
id: this.httpBody.id |
|
|
|
|
} |
|
|
|
|
this.http.post('/api/services/app/GasStation/Uncommit', null, { params: params }).subscribe((data: any) => { |
|
|
|
|
this.isRevocationAuditLoading = false |
|
|
|
|
this.getInfo() |
|
|
|
|
this.message.create('success', '撤销审核成功!'); |
|
|
|
|
}, err => { |
|
|
|
|
this.isRevocationAuditLoading = false |
|
|
|
|
this.message.create('error', '撤销审核失败!'); |
|
|
|
|
}) |
|
|
|
|
id: this.httpBody.id, |
|
|
|
|
}; |
|
|
|
|
this.http |
|
|
|
|
.post("/api/services/app/GasStation/Uncommit", null, { params: params }) |
|
|
|
|
.subscribe( |
|
|
|
|
(data: any) => { |
|
|
|
|
this.isRevocationAuditLoading = false; |
|
|
|
|
this.getInfo(); |
|
|
|
|
this.message.create("success", "撤销审核成功!"); |
|
|
|
|
}, |
|
|
|
|
(err) => { |
|
|
|
|
this.isRevocationAuditLoading = false; |
|
|
|
|
this.message.create("error", "撤销审核失败!"); |
|
|
|
|
} |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|