修改 冀北 现场问题
This commit is contained in:
@@ -1055,6 +1055,7 @@ const open = async (row: any) => {
|
||||
title.value = row.title
|
||||
dialogFormVisible.value = true
|
||||
let deptIds = adminInfo.$state.deptId
|
||||
addUploadRef.value?.reset()
|
||||
if (row.row) {
|
||||
resendId.value = row.row.id
|
||||
status.value = row.row.status
|
||||
@@ -1544,5 +1545,4 @@ defineExpose({ open, filterUsers })
|
||||
width: 250px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
@@ -1,14 +1,28 @@
|
||||
<template>
|
||||
<el-form-item label="信息安全检测报告:">
|
||||
<el-upload
|
||||
v-model:file-list="form.informationSecurityTestReport"
|
||||
action=""
|
||||
accept=".doc,.docx,.xlsx,.xls,.pdf"
|
||||
:limit="1"
|
||||
@change="choose($event, 'informationSecurityTestReport')"
|
||||
:auto-upload="false"
|
||||
:before-remove="beforeRemove('informationSecurityTestReport', '1')"
|
||||
>
|
||||
<template #trigger>
|
||||
<el-button type="primary">上传文件</el-button>
|
||||
</template>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
<el-form-item label="入网设计方案审查报告:">
|
||||
<el-upload
|
||||
v-model:file-list="form.NetReport"
|
||||
ref="NetReportRef"
|
||||
action=""
|
||||
accept=".doc,.docx,.xlsx,.xls,.pdf"
|
||||
:limit="1"
|
||||
@change="choose($event, 'NetReport')"
|
||||
:auto-upload="false"
|
||||
:before-remove="beforeRemove('NetReport', '1')"
|
||||
:before-remove="beforeRemove('NetReport', '1')"
|
||||
>
|
||||
<template #trigger>
|
||||
<el-button type="primary">上传文件</el-button>
|
||||
@@ -20,31 +34,16 @@
|
||||
v-model:file-list="form.governReport"
|
||||
action=""
|
||||
accept=".doc,.docx,.xlsx,.xls,.pdf"
|
||||
:limit="1"
|
||||
@change="choose($event, 'governReport')"
|
||||
:auto-upload="false"
|
||||
:before-remove="beforeRemove('governReport', '1')"
|
||||
>
|
||||
<template #trigger>
|
||||
<el-button type="primary">上传文件</el-button>
|
||||
</template>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
<el-form-item label="信息安全检测报告:">
|
||||
<el-upload
|
||||
v-model:file-list="form.informationSecurityTestReport"
|
||||
action=""
|
||||
accept=".doc,.docx,.xlsx,.xls,.pdf"
|
||||
:limit="1"
|
||||
@change="choose($event, 'informationSecurityTestReport')"
|
||||
:auto-upload="false"
|
||||
:before-remove="beforeRemove('informationSecurityTestReport', '1')"
|
||||
:before-remove="beforeRemove('governReport', '1')"
|
||||
>
|
||||
<template #trigger>
|
||||
<el-button type="primary">上传文件</el-button>
|
||||
</template>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="验收检验报告单:">
|
||||
<el-upload
|
||||
v-model:file-list="form.acceptanceInspectionReportSingle"
|
||||
@@ -53,7 +52,7 @@
|
||||
:limit="1"
|
||||
@change="choose($event, 'acceptanceInspectionReportSingle')"
|
||||
:auto-upload="false"
|
||||
:before-remove="beforeRemove('acceptanceInspectionReportSingle', '1')"
|
||||
:before-remove="beforeRemove('acceptanceInspectionReportSingle', '1')"
|
||||
>
|
||||
<template #trigger>
|
||||
<el-button type="primary">上传文件</el-button>
|
||||
@@ -68,7 +67,7 @@
|
||||
:limit="1"
|
||||
@change="choose($event, 'acceptanceInspectionReport')"
|
||||
:auto-upload="false"
|
||||
:before-remove="beforeRemove('acceptanceInspectionReport', '1')"
|
||||
:before-remove="beforeRemove('acceptanceInspectionReport', '1')"
|
||||
>
|
||||
<template #trigger>
|
||||
<el-button type="primary">上传文件</el-button>
|
||||
@@ -83,7 +82,7 @@
|
||||
:limit="1"
|
||||
@change="choose($event, 'typeExperimentReport')"
|
||||
:auto-upload="false"
|
||||
:before-remove="beforeRemove('typeExperimentReport', '1')"
|
||||
:before-remove="beforeRemove('typeExperimentReport', '1')"
|
||||
>
|
||||
<template #trigger>
|
||||
<el-button type="primary">上传文件</el-button>
|
||||
@@ -98,7 +97,7 @@
|
||||
:limit="1"
|
||||
@change="choose($event, 'factoryInspectionReport')"
|
||||
:auto-upload="false"
|
||||
:before-remove="beforeRemove('factoryInspectionReport', '1')"
|
||||
:before-remove="beforeRemove('factoryInspectionReport', '1')"
|
||||
>
|
||||
<template #trigger>
|
||||
<el-button type="primary">上传文件</el-button>
|
||||
@@ -113,7 +112,7 @@
|
||||
:limit="1"
|
||||
@change="choose($event, 'performanceTestReport')"
|
||||
:auto-upload="false"
|
||||
:before-remove="beforeRemove('performanceTestReport', '1')"
|
||||
:before-remove="beforeRemove('performanceTestReport', '1')"
|
||||
>
|
||||
<template #trigger>
|
||||
<el-button type="primary">上传文件</el-button>
|
||||
@@ -128,7 +127,7 @@
|
||||
:limit="1"
|
||||
@change="choose($event, 'mainWiringDiagram')"
|
||||
:auto-upload="false"
|
||||
:before-remove="beforeRemove('mainWiringDiagram', '1')"
|
||||
:before-remove="beforeRemove('mainWiringDiagram', '1')"
|
||||
>
|
||||
<template #trigger>
|
||||
<el-button type="primary">上传文件</el-button>
|
||||
@@ -185,10 +184,8 @@ const formName: any = ref({
|
||||
})
|
||||
|
||||
const beforeRemove = (name: any, flag?: string) => {
|
||||
console.log('🚀 ~ beforeRemove ~ flag:', flag)
|
||||
// console.log('🚀 ~ beforeRemove ~ flag:', flag)
|
||||
if (flag == '1') {
|
||||
console.log('🚀 ~ beforeRemove ~ name:', name)
|
||||
|
||||
formName.value[name] = ''
|
||||
}
|
||||
}
|
||||
@@ -203,14 +200,25 @@ const submitForm = async (id: string) => {
|
||||
// console.log(form.value)
|
||||
|
||||
let data = []
|
||||
for (let i in formName.value) {
|
||||
data.push({
|
||||
supervisionId: id,
|
||||
name: i,
|
||||
url: formName.value[i],
|
||||
state: 1
|
||||
})
|
||||
for (let i in form.value) {
|
||||
// form.value.map(item=>item.name)
|
||||
|
||||
if (form.value[i].map(item => item.name).join(',') != '')
|
||||
data.push({
|
||||
supervisionId: id,
|
||||
name: i,
|
||||
url: form.value[i].map(item => item.name).join(','), //formName.value[i],
|
||||
state: 1
|
||||
})
|
||||
}
|
||||
// for (let i in formName.value) {
|
||||
// data.push({
|
||||
// supervisionId: id,
|
||||
// name: i,
|
||||
// url: formName.value[i],
|
||||
// state: 1
|
||||
// })
|
||||
// }
|
||||
|
||||
await addOrUpdateFile(data)
|
||||
}
|
||||
@@ -223,17 +231,18 @@ const queryFiles = (id: string) => {
|
||||
})
|
||||
}
|
||||
const getFileNamePath = async (val: any, pathName: any) => {
|
||||
await getFileNameAndFilePath({ filePath: val }).then(res => {
|
||||
form.value[pathName] = [
|
||||
{
|
||||
name: res.data.fileName,
|
||||
url: res.data.url
|
||||
}
|
||||
]
|
||||
setTimeout(() => {
|
||||
formName.value[pathName] = res.data.fileName
|
||||
}, 100)
|
||||
})
|
||||
let data = val.split(',')
|
||||
for (let i = 0; i < data.length ; i++) {
|
||||
// console.log('🚀 ~ getFileNamePath ~ data:', data[i])
|
||||
|
||||
await getFileNameAndFilePath({ filePath: '/supervision/' + data[i] }).then(res => {
|
||||
res.data.name = res.data.fileName
|
||||
form.value[pathName].push(res.data)
|
||||
// setTimeout(() => {
|
||||
// formName.value[pathName] = res.data.fileName
|
||||
// }, 100)
|
||||
})
|
||||
}
|
||||
}
|
||||
const reset = () => {
|
||||
form.value = {
|
||||
@@ -262,7 +271,7 @@ const reset = () => {
|
||||
runTheReport: ''
|
||||
}
|
||||
}
|
||||
defineExpose({ submitForm, queryFiles })
|
||||
defineExpose({ submitForm, queryFiles ,reset})
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.el-form-item__content > div:first-child {
|
||||
|
||||
@@ -345,34 +345,37 @@
|
||||
</a>
|
||||
</div>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="入网设计方案审查报告" v-if="props.openType == 'sourcesOfInterference'">
|
||||
<el-icon class="elView" v-if="props.openType == 'sourcesOfInterference'">
|
||||
<View @click="openFile(form.NetReport[0]?.name)" />
|
||||
</el-icon>
|
||||
<a target="_blank" :href="form.NetReport[0]?.url">
|
||||
{{ form.NetReport[0]?.name }}
|
||||
</a>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="治理工程验收报告" v-if="props.openType == 'sourcesOfInterference'">
|
||||
<el-icon class="elView" v-if="props.openType == 'sourcesOfInterference'">
|
||||
<View @click="openFile(form.governReport[0]?.name)" />
|
||||
</el-icon>
|
||||
<a target="_blank" :href="form.governReport[0]?.url">
|
||||
{{ form.governReport[0]?.name }}
|
||||
</a>
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="信息安全检测报告" v-if="props.openType == 'sourcesOfInterference'">
|
||||
<el-icon class="elView" v-if="props.openType == 'sourcesOfInterference'">
|
||||
<el-icon class="elView" v-if="form.informationSecurityTestReport[0]?.name">
|
||||
<View @click="openFile(form.informationSecurityTestReport[0]?.name)" />
|
||||
</el-icon>
|
||||
<a target="_blank" :href="form.informationSecurityTestReport[0]?.url">
|
||||
{{ form.informationSecurityTestReport[0]?.name }}
|
||||
</a>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="入网设计方案审查报告" v-if="props.openType == 'sourcesOfInterference'">
|
||||
<div v-for="item in form.NetReport">
|
||||
<el-icon class="elView" v-if="item.name">
|
||||
<View @click="openFile(item.name)" />
|
||||
</el-icon>
|
||||
<a target="_blank" :href="item.url">
|
||||
{{ item.name }}
|
||||
</a>
|
||||
</div>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="治理工程验收报告" v-if="props.openType == 'sourcesOfInterference'">
|
||||
<div v-for="item in form.governReport">
|
||||
<el-icon class="elView" v-if="item.name">
|
||||
<View @click="openFile(item.name)" />
|
||||
</el-icon>
|
||||
<a target="_blank" :href="item.url">
|
||||
{{ item.name }}
|
||||
</a>
|
||||
</div>
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="验收检验报告单" v-if="props.openType == 'sourcesOfInterference'">
|
||||
<el-icon class="elView" v-if="props.openType == 'sourcesOfInterference'">
|
||||
<el-icon class="elView" v-if="form.acceptanceInspectionReportSingle[0]?.name">
|
||||
<View @click="openFile(form.acceptanceInspectionReportSingle[0]?.name)" />
|
||||
</el-icon>
|
||||
<a target="_blank" :href="form.acceptanceInspectionReportSingle[0]?.url">
|
||||
@@ -381,7 +384,7 @@
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="验收检验报告" v-if="props.openType == 'sourcesOfInterference'">
|
||||
<el-icon class="elView" v-if="props.openType == 'sourcesOfInterference'">
|
||||
<el-icon class="elView" v-if="form.acceptanceInspectionReport[0]?.name">
|
||||
<View @click="openFile(form.acceptanceInspectionReport[0]?.name)" />
|
||||
</el-icon>
|
||||
<a target="_blank" :href="form.acceptanceInspectionReport[0]?.url">
|
||||
@@ -389,7 +392,7 @@
|
||||
</a>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="型式实验报告" v-if="props.openType == 'sourcesOfInterference'">
|
||||
<el-icon class="elView" v-if="props.openType == 'sourcesOfInterference'">
|
||||
<el-icon class="elView" v-if="form.typeExperimentReport[0]?.name">
|
||||
<View @click="openFile(form.typeExperimentReport[0]?.name)" />
|
||||
</el-icon>
|
||||
<a target="_blank" :href="form.typeExperimentReport[0]?.url">
|
||||
@@ -397,9 +400,8 @@
|
||||
</a>
|
||||
</el-descriptions-item>
|
||||
|
||||
|
||||
<el-descriptions-item label="出厂检验报告" v-if="props.openType == 'sourcesOfInterference'">
|
||||
<el-icon class="elView" v-if="props.openType == 'sourcesOfInterference'">
|
||||
<el-icon class="elView" v-if="form.factoryInspectionReport[0]?.name">
|
||||
<View @click="openFile(form.factoryInspectionReport[0]?.name)" />
|
||||
</el-icon>
|
||||
<a target="_blank" :href="form.factoryInspectionReport[0]?.url">
|
||||
@@ -407,7 +409,7 @@
|
||||
</a>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="性能检测报告" v-if="props.openType == 'sourcesOfInterference'">
|
||||
<el-icon class="elView" v-if="props.openType == 'sourcesOfInterference'">
|
||||
<el-icon class="elView" v-if="form.performanceTestReport[0]?.name">
|
||||
<View @click="openFile(form.performanceTestReport[0]?.name)" />
|
||||
</el-icon>
|
||||
<a target="_blank" :href="form.performanceTestReport[0]?.url">
|
||||
@@ -415,7 +417,7 @@
|
||||
</a>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="主接线图" v-if="props.openType == 'sourcesOfInterference'">
|
||||
<el-icon class="elView" v-if="props.openType == 'sourcesOfInterference'">
|
||||
<el-icon class="elView" v-if="form.mainWiringDiagram[0]?.name">
|
||||
<View @click="openFile(form.mainWiringDiagram[0]?.name)" />
|
||||
</el-icon>
|
||||
<a target="_blank" :href="form.mainWiringDiagram[0]?.url">
|
||||
@@ -423,7 +425,7 @@
|
||||
</a>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="试运行报告" v-if="props.openType == 'sourcesOfInterference'">
|
||||
<el-icon class="elView" v-if="props.openType == 'sourcesOfInterference'">
|
||||
<el-icon class="elView" v-if="form.runTheReport[0]?.name">
|
||||
<View @click="openFile(form.runTheReport[0]?.name)" />
|
||||
</el-icon>
|
||||
<a target="_blank" :href="form.runTheReport[0]?.url">
|
||||
@@ -631,7 +633,7 @@ const preview = (val: any, url: any) => {
|
||||
})
|
||||
}
|
||||
|
||||
const queryFiles = (id: string) => {
|
||||
const queryFiles = () => {
|
||||
getFileById({ id: props.id }).then(res => {
|
||||
res.data.forEach((item: any) => {
|
||||
if (item.url.length > 0) getFileNamePaths(item.url, item.name)
|
||||
@@ -815,14 +817,13 @@ const getFileNamePath = async (val: any, pathName: any) => {
|
||||
})
|
||||
}
|
||||
const getFileNamePaths = async (val: any, pathName: any) => {
|
||||
await getFileNameAndFilePath({ filePath: val }).then(res => {
|
||||
form.value[pathName] = [
|
||||
{
|
||||
name: res.data.fileName,
|
||||
url: res.data.url
|
||||
}
|
||||
]
|
||||
})
|
||||
let data = val.split(',')
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
await getFileNameAndFilePath({ filePath: '/supervision/' + data[i] }).then(res => {
|
||||
res.data.name = res.data.fileName
|
||||
form.value[pathName].push(res.data)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
defineExpose({ open: getInfo }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
Reference in New Issue
Block a user