| | |
| | | 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(); |
| | |
| | | } |
| | | } |
| | | formRef.value.clearValidate(); |
| | | emit('getNextStatus', res.data); |
| | | emit('getNextStatus', state.projectId); |
| | | } else { |
| | | ElMessage.warning(res.message) |
| | | } |