parent
2e35e8f5ca
commit
7b2e382dd4
|
@ -5,7 +5,7 @@
|
|||
<!-- 动态生成表单项 -->
|
||||
<el-row v-for="(item, index) in uploadConfig" :key="index">
|
||||
<el-col :span="12">
|
||||
<el-form-item v-if="dialogType !== 'savePhoto'" :label="`已上传${item.label}`">
|
||||
<el-form-item v-if="dialogType !== 'savePhoto' && form[item.prop]" :label="`已上传${item.label}`">
|
||||
<div>
|
||||
<img :src="config.fileUrl + form[item.prop]" width="100" height="100">
|
||||
</div>
|
||||
|
@ -16,7 +16,7 @@
|
|||
:file-list="form[item.prop]"
|
||||
:multiple="false"
|
||||
:limit="1"
|
||||
:class="{hide: item.hideUpload}"
|
||||
:class="{hide: form[item.prop] && form[item.prop].length > 0}"
|
||||
:auto-upload="false"
|
||||
:on-remove="(file, fileList) => handleRemove(file, fileList, item.prop)"
|
||||
:on-change="(file, fileList) => handleChange(file, fileList, item.prop)"
|
||||
|
@ -87,7 +87,8 @@ export default {
|
|||
{label: '营业执照', prop: 'LICENSE_FILE', hideUpload: false},
|
||||
{label: '道路运输经营许可证', prop: 'TRANSPORT_PERMIT_FILE', hideUpload: false},
|
||||
{label: '危险化学品经营许可证', prop: 'HAZARDOUS_CHEMICALS_FILE', hideUpload: false}
|
||||
]
|
||||
],
|
||||
urlfromdsfe:{}
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
|
@ -157,25 +158,34 @@ export default {
|
|||
},
|
||||
getUploadedFiles() {
|
||||
try {
|
||||
const response = requestFN('/mkmj/management/getUploadedFiles', {
|
||||
MOTORCADE_ID: this.form.MOTORCADE_ID
|
||||
});
|
||||
this.listLoading = true
|
||||
requestFN(
|
||||
'/mkmj/management/getUploadedFiles',{
|
||||
MOTORCADE_ID :this.form.MOTORCADE_ID
|
||||
}
|
||||
).then((data) => {
|
||||
console.log(data)
|
||||
console.info(data)
|
||||
this.urlfromdsfe = data.corpFilingApplicationEntity
|
||||
console.info(this.urlfromdsfe)
|
||||
if (this.urlfromdsfe) {
|
||||
this.uploadConfig.forEach(item => {
|
||||
if (this.urlfromdsfe[item.prop]) {
|
||||
this.form[item.prop] = [{
|
||||
url: this.config.fileUrl + this.urlfromdsfe[item.prop],
|
||||
name: this.urlfromdsfe[item.prop].split('/').pop()
|
||||
}];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this.listLoading = false;
|
||||
}).catch((e) => {
|
||||
this.listLoading = false
|
||||
})
|
||||
|
||||
|
||||
// 检查响应是否成功
|
||||
if (response && response.result === "success" && response.corpFilingApplicationEntity) {
|
||||
const uploadedFiles = response.corpFilingApplicationEntity;
|
||||
|
||||
// 遍历 uploadConfig 配置
|
||||
this.uploadConfig.forEach(item => {
|
||||
if (uploadedFiles[item.prop]) {
|
||||
// 将已上传的文件信息填充到 form 对象中
|
||||
this.form[item.prop] = [{
|
||||
url: this.config.fileUrl + uploadedFiles[item.prop], // 拼接完整的文件 URL
|
||||
name: uploadedFiles[item.prop] // 文件名
|
||||
}];
|
||||
}
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取已上传文件失败', error);
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="操作" align="left" width="300">
|
||||
<template slot-scope="{row}">
|
||||
<el-button type="primary" icon="el-icon-edit" size="mini" @click="apply(row)">申请</el-button>
|
||||
<el-button v-if="getButton(row)" type="primary" icon="el-icon-edit" size="mini" @click="apply(row)">申请</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
@ -206,6 +206,15 @@ export default{
|
|||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
getButton(row){
|
||||
if (row.IS_DANGEROUS_CAR === '0' && row.IS_AUDIT === '1'){
|
||||
return true
|
||||
}else if (row.IS_DANGEROUS_CAR === '1' && row.IS_AUDIT === '0'){
|
||||
return true
|
||||
}else {
|
||||
return false
|
||||
}
|
||||
},
|
||||
// 搜索
|
||||
getQuery() {
|
||||
this.$refs.multipleTable.clearSelection()
|
||||
|
|
Loading…
Reference in New Issue