修改文件上传
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
:limit="1"
|
||||
@change="choose($event, 'NetReport')"
|
||||
:auto-upload="false"
|
||||
:before-remove="beforeRemove('NetReport', '1')"
|
||||
>
|
||||
<template #trigger>
|
||||
<el-button type="primary">上传文件</el-button>
|
||||
@@ -22,6 +23,7 @@
|
||||
:limit="1"
|
||||
@change="choose($event, 'governReport')"
|
||||
:auto-upload="false"
|
||||
:before-remove="beforeRemove('governReport', '1')"
|
||||
>
|
||||
<template #trigger>
|
||||
<el-button type="primary">上传文件</el-button>
|
||||
@@ -36,6 +38,7 @@
|
||||
:limit="1"
|
||||
@change="choose($event, 'informationSecurityTestReport')"
|
||||
:auto-upload="false"
|
||||
:before-remove="beforeRemove('informationSecurityTestReport', '1')"
|
||||
>
|
||||
<template #trigger>
|
||||
<el-button type="primary">上传文件</el-button>
|
||||
@@ -50,6 +53,7 @@
|
||||
:limit="1"
|
||||
@change="choose($event, 'acceptanceInspectionReportSingle')"
|
||||
:auto-upload="false"
|
||||
:before-remove="beforeRemove('acceptanceInspectionReportSingle', '1')"
|
||||
>
|
||||
<template #trigger>
|
||||
<el-button type="primary">上传文件</el-button>
|
||||
@@ -64,6 +68,7 @@
|
||||
:limit="1"
|
||||
@change="choose($event, 'acceptanceInspectionReport')"
|
||||
:auto-upload="false"
|
||||
:before-remove="beforeRemove('acceptanceInspectionReport', '1')"
|
||||
>
|
||||
<template #trigger>
|
||||
<el-button type="primary">上传文件</el-button>
|
||||
@@ -78,6 +83,7 @@
|
||||
:limit="1"
|
||||
@change="choose($event, 'typeExperimentReport')"
|
||||
:auto-upload="false"
|
||||
:before-remove="beforeRemove('typeExperimentReport', '1')"
|
||||
>
|
||||
<template #trigger>
|
||||
<el-button type="primary">上传文件</el-button>
|
||||
@@ -92,6 +98,7 @@
|
||||
:limit="1"
|
||||
@change="choose($event, 'factoryInspectionReport')"
|
||||
:auto-upload="false"
|
||||
:before-remove="beforeRemove('factoryInspectionReport', '1')"
|
||||
>
|
||||
<template #trigger>
|
||||
<el-button type="primary">上传文件</el-button>
|
||||
@@ -106,6 +113,7 @@
|
||||
:limit="1"
|
||||
@change="choose($event, 'performanceTestReport')"
|
||||
:auto-upload="false"
|
||||
:before-remove="beforeRemove('performanceTestReport', '1')"
|
||||
>
|
||||
<template #trigger>
|
||||
<el-button type="primary">上传文件</el-button>
|
||||
@@ -120,6 +128,7 @@
|
||||
:limit="1"
|
||||
@change="choose($event, 'mainWiringDiagram')"
|
||||
:auto-upload="false"
|
||||
:before-remove="beforeRemove('mainWiringDiagram', '1')"
|
||||
>
|
||||
<template #trigger>
|
||||
<el-button type="primary">上传文件</el-button>
|
||||
|
||||
@@ -345,6 +345,91 @@
|
||||
</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'">
|
||||
<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'">
|
||||
<el-icon class="elView" v-if="props.openType == 'sourcesOfInterference'">
|
||||
<View @click="openFile(form.acceptanceInspectionReportSingle[0]?.name)" />
|
||||
</el-icon>
|
||||
<a target="_blank" :href="form.acceptanceInspectionReportSingle[0]?.url">
|
||||
{{ form.acceptanceInspectionReportSingle[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.acceptanceInspectionReport[0]?.name)" />
|
||||
</el-icon>
|
||||
<a target="_blank" :href="form.acceptanceInspectionReport[0]?.url">
|
||||
{{ form.acceptanceInspectionReport[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.typeExperimentReport[0]?.name)" />
|
||||
</el-icon>
|
||||
<a target="_blank" :href="form.typeExperimentReport[0]?.url">
|
||||
{{ form.typeExperimentReport[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.factoryInspectionReport[0]?.name)" />
|
||||
</el-icon>
|
||||
<a target="_blank" :href="form.factoryInspectionReport[0]?.url">
|
||||
{{ form.factoryInspectionReport[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.performanceTestReport[0]?.name)" />
|
||||
</el-icon>
|
||||
<a target="_blank" :href="form.performanceTestReport[0]?.url">
|
||||
{{ form.performanceTestReport[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.mainWiringDiagram[0]?.name)" />
|
||||
</el-icon>
|
||||
<a target="_blank" :href="form.mainWiringDiagram[0]?.url">
|
||||
{{ form.mainWiringDiagram[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.runTheReport[0]?.name)" />
|
||||
</el-icon>
|
||||
<a target="_blank" :href="form.runTheReport[0]?.url">
|
||||
{{ form.runTheReport[0]?.name }}
|
||||
</a>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
</template>
|
||||
@@ -360,6 +445,7 @@ import { getFileNameAndFilePath } from '@/api/system-boot/file'
|
||||
import { Link, View } from '@element-plus/icons-vue'
|
||||
import PreviewFile from '@/components/PreviewFile/index.vue'
|
||||
import { getByDeptDevLine } from '@/api/supervision-boot/interfere/index'
|
||||
import { addOrUpdateFile, getFileById } from '@/api/supervision-boot/interfere/index'
|
||||
defineOptions({ name: 'BpmUserReportDetail' })
|
||||
|
||||
const { query } = useRoute() // 查询参数
|
||||
@@ -434,6 +520,18 @@ const userStateList = reactive([
|
||||
value: '3'
|
||||
}
|
||||
])
|
||||
const form: any = ref({
|
||||
NetReport: [], //入网设计方案审查报告:
|
||||
governReport: [], //治理工程验收报告
|
||||
informationSecurityTestReport: [], //信息安全检测报告
|
||||
acceptanceInspectionReportSingle: [], //信息安全检测报告
|
||||
acceptanceInspectionReport: [], //验收检验报告:
|
||||
typeExperimentReport: [], //型式实验报告
|
||||
factoryInspectionReport: [], //出厂检验报告:
|
||||
performanceTestReport: [], //性能检测报告
|
||||
mainWiringDiagram: [], //主接线图:
|
||||
runTheReport: [] //试运行报告
|
||||
})
|
||||
const dictData = useDictData()
|
||||
//字典获取所在地市
|
||||
const areaOptionList = dictData.getBasicData('jibei_area')
|
||||
@@ -467,6 +565,9 @@ const getInfo = async () => {
|
||||
} finally {
|
||||
detailLoading.value = false
|
||||
}
|
||||
if (props.openType == 'sourcesOfInterference') {
|
||||
queryFiles()
|
||||
}
|
||||
}
|
||||
const proviteData = ref()
|
||||
//可研报告
|
||||
@@ -529,6 +630,14 @@ const preview = (val: any, url: any) => {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const queryFiles = (id: string) => {
|
||||
getFileById({ id: props.id }).then(res => {
|
||||
res.data.forEach((item: any) => {
|
||||
if (item.url.length > 0) getFileNamePaths(item.url, item.name)
|
||||
})
|
||||
})
|
||||
}
|
||||
//判断userType选择取用的对象
|
||||
const getProviteData = async () => {
|
||||
if (detailData.value.userType == '0' || detailData.value.userType == '1') {
|
||||
@@ -705,6 +814,17 @@ 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
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
|
||||
defineExpose({ open: getInfo }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
watch(
|
||||
|
||||
@@ -127,7 +127,10 @@ const tableStore = new TableStore({
|
||||
icon: 'el-icon-Open',
|
||||
render: 'basicButton',
|
||||
showDisabled: row => {
|
||||
return row.city != adminInfo.$state.deptName || !(row.dataType == 1)
|
||||
return (
|
||||
(row.city != adminInfo.$state.deptName && row.createBy != adminInfo.$state.id) ||
|
||||
!(row.dataType == 1)
|
||||
)
|
||||
},
|
||||
|
||||
click: row => {
|
||||
|
||||
@@ -144,7 +144,10 @@ const tableStore = new TableStore({
|
||||
icon: 'el-icon-Open',
|
||||
render: 'basicButton',
|
||||
showDisabled: row => {
|
||||
return row.city != adminInfo.$state.deptName || !(row.dataType == 0 || row.dataType == 1)
|
||||
return (
|
||||
(row.city != adminInfo.$state.deptName && row.createBy != adminInfo.$state.id) ||
|
||||
!(row.dataType == 1)
|
||||
)
|
||||
},
|
||||
// disabled: row => {
|
||||
// return !(row.status == 0)
|
||||
|
||||
Reference in New Issue
Block a user