From 18aff5cd709785bb357ec8c22b4074680cadf0d0 Mon Sep 17 00:00:00 2001 From: zhouwenxuan <1175765986@qq.com> Date: 星期一, 19 二月 2024 09:12:42 +0800 Subject: [PATCH] bug修改 --- src/views/safetyReview/projectManage/components/siteCheckRcd.vue | 95 ++++++++++++++++++++++++++--------------------- 1 files changed, 52 insertions(+), 43 deletions(-) diff --git a/src/views/safetyReview/projectManage/components/siteCheckRcd.vue b/src/views/safetyReview/projectManage/components/siteCheckRcd.vue index 255819d..4dbb3c4 100644 --- a/src/views/safetyReview/projectManage/components/siteCheckRcd.vue +++ b/src/views/safetyReview/projectManage/components/siteCheckRcd.vue @@ -194,54 +194,63 @@ if(userInfo.identity === 0){ isAmin.value = true; } + if(props.projectId){ + getDetail(props.projectId) + } + }); + +const getDetail = async (val) => { + const res = await getSiteCheckDetail({projectId: val}); + if(res.code == 200){ + state.formData = res.data; + state.beforeDeviceList = res.data.deviceImages.map(i=>{ + return { + name: i.fileName, + url: import.meta.env.VITE_APP_BASE_API + '/' + i.path, + id: i.id, + projectId: i.projectId, + moduleType: i.moduleType + } + }) + state.siteCheckList = res.data.investingationImages.map(i=>{ + return { + name: i.fileName, + url: import.meta.env.VITE_APP_BASE_API + '/' + i.path, + id: i.id, + projectId: i.projectId, + moduleType: i.moduleType + } + }) + state.companyList = res.data.ccompanyImages.map(i=>{ + return { + name: i.fileName, + url: import.meta.env.VITE_APP_BASE_API + '/' + i.path, + id: i.id, + projectId: i.projectId, + moduleType: i.moduleType + } + }) + state.safetyList = res.data.assAccessoryFiles.map(i=>{ + return { + name: i.fileName, + url: import.meta.env.VITE_APP_BASE_API + '/' + i.path, + id: i.id, + projectId: i.projectId, + moduleType: i.moduleType + } + }) + }else { + ElMessage.warning(res.message) + } +} + const riskOpen = async (type,val) => { state.formData.projectId = val state.projectId = val if(type === 'detail' || type === 'edit' ){ - const res = await getSiteCheckDetail({projectId: val}); - if(res.code == 200){ - state.formData = res.data; - state.beforeDeviceList = res.data.deviceImages.map(i=>{ - return { - name: i.fileName, - url: import.meta.env.VITE_APP_BASE_API + '/' + i.path, - id: i.id, - projectId: i.projectId, - moduleType: i.moduleType - } - }) - state.siteCheckList = res.data.investingationImages.map(i=>{ - return { - name: i.fileName, - url: import.meta.env.VITE_APP_BASE_API + '/' + i.path, - id: i.id, - projectId: i.projectId, - moduleType: i.moduleType - } - }) - state.companyList = res.data.ccompanyImages.map(i=>{ - return { - name: i.fileName, - url: import.meta.env.VITE_APP_BASE_API + '/' + i.path, - id: i.id, - projectId: i.projectId, - moduleType: i.moduleType - } - }) - state.safetyList = res.data.assAccessoryFiles.map(i=>{ - return { - name: i.fileName, - url: import.meta.env.VITE_APP_BASE_API + '/' + i.path, - id: i.id, - projectId: i.projectId, - moduleType: i.moduleType - } - }) - }else { - ElMessage.warning(res.message) - } + // await getDetail(val) } if(type === 'add' || type === 'clickEdit') { const valid = await formRef.value.validate(); @@ -271,7 +280,7 @@ } } formRef.value.clearValidate(); - emit('getNextStatus', res.data); + emit('getNextStatus', state.projectId); } else { ElMessage.warning(res.message) } -- Gitblit v1.9.2