zhouwenxuan
2024-02-19 18aff5cd709785bb357ec8c22b4074680cadf0d0
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)
        }