|
|
|
@ -16,7 +16,7 @@ export class EditUpdateCategoryComponent implements OnInit {
|
|
|
|
|
@Input() data?: any; |
|
|
|
|
|
|
|
|
|
validateForm!: FormGroup; |
|
|
|
|
constructor(private modal: NzModalRef, private fb: FormBuilder, private http: HttpClient, private objectsSrv: ObjectsSimpleService,private message: NzMessageService,) { } |
|
|
|
|
constructor(private modal: NzModalRef, private fb: FormBuilder, private http: HttpClient, private objectsSrv: ObjectsSimpleService, private message: NzMessageService,) { } |
|
|
|
|
|
|
|
|
|
handleTypeList: handleTypeList[] = new handleType().list; |
|
|
|
|
data2: any; //深拷贝data
|
|
|
|
@ -27,8 +27,10 @@ export class EditUpdateCategoryComponent implements OnInit {
|
|
|
|
|
this.validateForm = this.fb.group({ |
|
|
|
|
number: [null, [Validators.required]], |
|
|
|
|
isLongTerm: [null, [Validators.required]], |
|
|
|
|
isLongTermTime: [null,], |
|
|
|
|
isNoLongTermTime: [null,], |
|
|
|
|
isLongTermTime: [null], |
|
|
|
|
isNoLongTermTime: [null], |
|
|
|
|
radioTypeForm: [null], |
|
|
|
|
explain: [null] |
|
|
|
|
}); |
|
|
|
|
// 日期
|
|
|
|
|
this.data2 = JSON.parse(JSON.stringify(this.data)) |
|
|
|
@ -41,15 +43,22 @@ export class EditUpdateCategoryComponent implements OnInit {
|
|
|
|
|
this.isNoLongTermTime = [] |
|
|
|
|
this.isNoLongTermTime.push(new Date(this.data2.validityStartTime)) |
|
|
|
|
this.isNoLongTermTime.push(new Date(this.data2.validityEndTime)) |
|
|
|
|
if (this.isNoLongTermTime.length && this.isNoLongTermTime.find(item=>{ return item.getFullYear() < 1000 })) { |
|
|
|
|
if (this.isNoLongTermTime.length && this.isNoLongTermTime.find(item => { return item.getFullYear() < 1000 })) { |
|
|
|
|
this.isNoLongTermTime[0] = new Date() |
|
|
|
|
this.isNoLongTermTime[1] = new Date() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
console.log(this.data2) |
|
|
|
|
console.log(typeof(this.data2.lastLicenseAuditType)) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
radioChange($event) { |
|
|
|
|
this.data2.LastLicenseAuditType = $event |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
imageUrl = '/api/Objects/sinochemweb/stationPhotos/175/timg.jpg' |
|
|
|
|
|
|
|
|
|
destroyModal() { |
|
|
|
@ -63,7 +72,7 @@ export class EditUpdateCategoryComponent implements OnInit {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//提交审核
|
|
|
|
|
submitReview(){ |
|
|
|
|
submitReview() { |
|
|
|
|
this.isSubmit = true; |
|
|
|
|
this.modal.triggerOk(); |
|
|
|
|
} |
|
|
|
@ -79,7 +88,7 @@ export class EditUpdateCategoryComponent implements OnInit {
|
|
|
|
|
if (time <= 0) { |
|
|
|
|
this.data2.validityDays = 0 |
|
|
|
|
} else { |
|
|
|
|
this.data2.validityDays = Math.floor(time / (1000*3600*24)); |
|
|
|
|
this.data2.validityDays = Math.floor(time / (1000 * 3600 * 24)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -96,7 +105,7 @@ export class EditUpdateCategoryComponent implements OnInit {
|
|
|
|
|
if (time <= 0) { |
|
|
|
|
this.data2.validityDays = 0 |
|
|
|
|
} else { |
|
|
|
|
this.data2.validityDays = Math.floor(time / (1000*3600*24)); |
|
|
|
|
this.data2.validityDays = Math.floor(time / (1000 * 3600 * 24)); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
this.data2.validityDays = 999 |
|
|
|
@ -104,29 +113,29 @@ export class EditUpdateCategoryComponent implements OnInit {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//获取办理类型
|
|
|
|
|
getHandleTypes(handleTypes: any[]):string { |
|
|
|
|
getHandleTypes(handleTypes: any[]): string { |
|
|
|
|
if (!handleTypes || !handleTypes.length) { |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
let names: string[] = [] |
|
|
|
|
let handleTypeList = JSON.parse(JSON.stringify(handleTypes)); |
|
|
|
|
let list: handleTypeList[] = new handleType().list; |
|
|
|
|
handleTypeList.forEach(item=>{ |
|
|
|
|
list.find(element=>{ |
|
|
|
|
item == element.value? names.push(element.name) : null |
|
|
|
|
handleTypeList.forEach(item => { |
|
|
|
|
list.find(element => { |
|
|
|
|
item == element.value ? names.push(element.name) : null |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
return names.join(',') |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//获取文件格式
|
|
|
|
|
getFileType(name: string):string { |
|
|
|
|
getFileType(name: string): string { |
|
|
|
|
let suffix |
|
|
|
|
if (name.substring(name.length-4).includes('png') || name.substring(name.length-4).includes('jpg') || name.substring(name.length-4).includes('jpeg') || name.substring(name.length-4).includes('webp')) { |
|
|
|
|
if (name.substring(name.length - 4).includes('png') || name.substring(name.length - 4).includes('jpg') || name.substring(name.length - 4).includes('jpeg') || name.substring(name.length - 4).includes('webp')) { |
|
|
|
|
suffix = 'img' |
|
|
|
|
} else if (name.substring(name.length-4).includes('doc') || name.substring(name.length-4).includes('docx')) { |
|
|
|
|
} else if (name.substring(name.length - 4).includes('doc') || name.substring(name.length - 4).includes('docx')) { |
|
|
|
|
suffix = 'word' |
|
|
|
|
} else if (name.substring(name.length-4).includes('pdf')) { |
|
|
|
|
} else if (name.substring(name.length - 4).includes('pdf')) { |
|
|
|
|
suffix = 'pdf' |
|
|
|
|
} |
|
|
|
|
return suffix |
|
|
|
@ -141,7 +150,7 @@ export class EditUpdateCategoryComponent implements OnInit {
|
|
|
|
|
let arr = item.split('.') |
|
|
|
|
arr[arr.length - 1] = 'pdf' |
|
|
|
|
window.open(arr.join('.')) |
|
|
|
|
} else if (this.getFileType(item) == 'pdf') { |
|
|
|
|
} else if (this.getFileType(item) == 'pdf') { |
|
|
|
|
window.open(item) |
|
|
|
|
} else { |
|
|
|
|
this.message.create('warning', '暂不支持查看!'); |
|
|
|
@ -149,10 +158,10 @@ export class EditUpdateCategoryComponent implements OnInit {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
uploadType: boolean; //是否是上传副本
|
|
|
|
|
uploadType: number; //是否是上传副本
|
|
|
|
|
isLoadingSave: boolean = false |
|
|
|
|
uploadIndex: string |
|
|
|
|
filechange(e, type: boolean) { |
|
|
|
|
filechange(e, type: number) { |
|
|
|
|
this.uploadType = type |
|
|
|
|
this.isLoadingSave = true |
|
|
|
|
let oilStationId = JSON.parse(sessionStorage.getItem('userdataOfgasstation')).organization.id |
|
|
|
@ -180,10 +189,12 @@ export class EditUpdateCategoryComponent implements OnInit {
|
|
|
|
|
this.objectsSrv.postFile(this.postFilePath, file).subscribe(data => { |
|
|
|
|
let dataObj = data as any; |
|
|
|
|
let filePath: string = ObjectsSimpleService.baseUrl + dataObj.objectName; |
|
|
|
|
if (this.uploadType){ |
|
|
|
|
if (this.uploadType === 0) { |
|
|
|
|
this.data2.imageUrl = filePath |
|
|
|
|
} else { |
|
|
|
|
} else if (this.uploadType === 1) { |
|
|
|
|
this.data2.attachment = filePath |
|
|
|
|
} else if (this.uploadType === 2) { |
|
|
|
|
this.data2.yearlyCheckAttachment = filePath |
|
|
|
|
} |
|
|
|
|
this.isLoadingSave = false |
|
|
|
|
resolve('success') |
|
|
|
@ -199,10 +210,12 @@ export class EditUpdateCategoryComponent implements OnInit {
|
|
|
|
|
this.objectsSrv.postFile_MultipartUpload(this.postFilePath, file).then((value) => { |
|
|
|
|
let dataObj = value as any; |
|
|
|
|
let filePath = dataObj.filePath |
|
|
|
|
if (this.uploadType){ |
|
|
|
|
if (this.uploadType === 0) { |
|
|
|
|
this.data2.imageUrl = filePath |
|
|
|
|
} else { |
|
|
|
|
} else if (this.uploadType === 1) { |
|
|
|
|
this.data2.attachment = filePath |
|
|
|
|
} else if (this.uploadType === 2) { |
|
|
|
|
this.data2.yearlyCheckAttachment = filePath |
|
|
|
|
} |
|
|
|
|
this.isLoadingSave = false |
|
|
|
|
}); |
|
|
|
@ -233,7 +246,7 @@ export class EditUpdateCategoryComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
//办理类型
|
|
|
|
|
export class handleType { |
|
|
|
|
list: handleTypeList[] =[ |
|
|
|
|
list: handleTypeList[] = [ |
|
|
|
|
{ value: 0, name: "无" }, |
|
|
|
|
{ value: 1, name: "年度公示" }, |
|
|
|
|
{ value: 2, name: "年检" }, |
|
|
|
|