|
|
|
@ -93,15 +93,15 @@ export class UpdateCategoryComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
//查看文件
|
|
|
|
|
lookFile(item) { |
|
|
|
|
if (!item.imageUrl) { |
|
|
|
|
if (!item) { |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
if (this.getFileType(item.imageUrl) == 'word') { |
|
|
|
|
let arr = item.imageUrl.split('.') |
|
|
|
|
if (this.getFileType(item) == 'word') { |
|
|
|
|
let arr = item.split('.') |
|
|
|
|
arr[arr.length - 1] = 'pdf' |
|
|
|
|
window.open(arr.join('.')) |
|
|
|
|
} else if (this.getFileType(item.imageUrl) == 'pdf') { |
|
|
|
|
window.open(item.imageUrl) |
|
|
|
|
} else if (this.getFileType(item) == 'pdf') { |
|
|
|
|
window.open(item) |
|
|
|
|
} else { |
|
|
|
|
this.message.create('warning', '暂不支持查看!'); |
|
|
|
|
} |
|
|
|
@ -133,33 +133,41 @@ export class UpdateCategoryComponent implements OnInit {
|
|
|
|
|
nzFooter: null, |
|
|
|
|
nzClosable: false, |
|
|
|
|
nzOnOk: async () => { |
|
|
|
|
if (!instance.data2.imageUrl) { |
|
|
|
|
this.message.create('warning', '请上传附件!'); |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
if (instance.data2.hasAttachmentDefault && !instance.data2.attachment) { |
|
|
|
|
this.message.create('warning', '请上传附件副本!'); |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
if (instance.validateForm.valid) { |
|
|
|
|
await new Promise(resolve => { |
|
|
|
|
let body = instance.data2 |
|
|
|
|
// 日期
|
|
|
|
|
if (body.isLongTerm) { |
|
|
|
|
body.validityStartTime = instance.isLongTermTime || new Date() |
|
|
|
|
} else { |
|
|
|
|
body.validityStartTime = instance.isNoLongTermTime[0] || new Date() |
|
|
|
|
body.validityEndTime = instance.isNoLongTermTime[1] || new Date() |
|
|
|
|
} |
|
|
|
|
let body = instance.data2 |
|
|
|
|
if (body.isLongTerm) { |
|
|
|
|
body.validityStartTime = instance.isLongTermTime || new Date() |
|
|
|
|
} else { |
|
|
|
|
body.validityStartTime = instance.isNoLongTermTime[0] || new Date() |
|
|
|
|
body.validityEndTime = instance.isNoLongTermTime[1] || new Date() |
|
|
|
|
} |
|
|
|
|
if (!instance.isSubmit) { |
|
|
|
|
this.http.post('/api/services/app/StationValidityLicense/Create', body).subscribe((data:any) => { |
|
|
|
|
if (!instance.isSubmit) { |
|
|
|
|
resolve(data); |
|
|
|
|
this.getStationList(); |
|
|
|
|
this.message.create('success', '修改成功!'); |
|
|
|
|
return true; |
|
|
|
|
} else { //提交审核
|
|
|
|
|
this.getStationList(); |
|
|
|
|
this.message.create('success', '修改成功!'); |
|
|
|
|
}) |
|
|
|
|
return false; |
|
|
|
|
} else { |
|
|
|
|
await new Promise(resolve => { |
|
|
|
|
this.http.post('/api/services/app/StationValidityLicense/Create', body).subscribe((data:any) => { |
|
|
|
|
this.submitReview(data.result).then(res=>{ |
|
|
|
|
resolve(data); |
|
|
|
|
return true; |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
} //else
|
|
|
|
|
} else { |
|
|
|
|
this.message.create('warning', '请填写完整!'); |
|
|
|
|
return false |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|