zhouwx
2024-07-23 3173c73267ba584d72c7862ab159392c5d372216
src/views/safetyReview/userManage/expertUsers/components/expertDialog.vue
@@ -671,23 +671,24 @@
}
const handlePhotoRemove = async (file) => {
  if (file && file.status == 'success') {
  // state.form.idPhoto = ''
  let path = ""
  if(file.response && file.response.data){
  if (file.response && file.response.data) {
    path = file.response.data.path
  }else {
  } else {
    const base = import.meta.env.VITE_APP_BASE_API
    path = file.url.substring(base.length+1,file.url.length )
    path = file.url.substring(base.length + 1, file.url.length)
  }
  await delPic({path: path}).then(res => {
    if(res.code == 200){
    if (res.code == 200) {
      // ElMessage({
      //   type: 'success',
      //   message: '文件已删除'
      // })
      state.form.idPhoto = ''
    }else{
    } else {
      ElMessage({
        type: 'warning',
        message: res.message
@@ -696,6 +697,7 @@
  }).catch(() => {
    state.form.idPhoto = ''
  });
}
  // const res = await delPic({path: path})
@@ -716,43 +718,46 @@
const handleRemove = async (file, uploadFiles,type) => {
  if(file && file.status == 'success') {
    let path = ""
    if(state.title === '编辑') {
        const base = import.meta.env.VITE_APP_BASE_API
        path = file.url.substring(base.length+1,file.url.length )
    }else {
        path = file.response.data.path
    if (state.title === '编辑') {
      const base = import.meta.env.VITE_APP_BASE_API
      path = file.url.substring(base.length + 1, file.url.length)
    } else {
      path = file.response.data.path
    }
  await delPic({path: path}).then(res => {
    if(res.code == 200){
      // ElMessage({
      //   type: 'success',
      //   message: '文件已删除'
      // })
    }else{
      ElMessage({
        type: 'warning',
        message: res.message
      })
    }
    await delPic({path: path}).then(res => {
      if (res.code == 200) {
        // ElMessage({
        //   type: 'success',
        //   message: '文件已删除'
        // })
      } else {
        ElMessage({
          type: 'warning',
          message: res.message
        })
      }
    }).catch(() => {
    if(type === 1){
      state.form.socialAttach = state.form.socialAttach.filter(item => item.path !== path)
    }else if(type === 2){
      state.form.medicalAttach = state.form.medicalAttach.filter(item => item.path !== path)
    }else {
      state.form.salaryAttach = state.form.salaryAttach.filter(item => item.path !== path)
    }
      if (type === 1) {
        state.form.socialAttach = state.form.socialAttach.filter(item => item.path !== path)
      } else if (type === 2) {
        state.form.medicalAttach = state.form.medicalAttach.filter(item => item.path !== path)
      } else {
        state.form.salaryAttach = state.form.salaryAttach.filter(item => item.path !== path)
      }
    });
    if(type === 1){
        state.form.socialAttach = state.form.socialAttach.filter(item => item.path !== path)
    }else if(type === 2){
        state.form.medicalAttach = state.form.medicalAttach.filter(item => item.path !== path)
    }else {
        state.form.salaryAttach = state.form.salaryAttach.filter(item => item.path !== path)
    if (type === 1) {
      state.form.socialAttach = state.form.socialAttach.filter(item => item.path !== path)
    } else if (type === 2) {
      state.form.medicalAttach = state.form.medicalAttach.filter(item => item.path !== path)
    } else {
      state.form.salaryAttach = state.form.salaryAttach.filter(item => item.path !== path)
    }
  }
}
const finshed = ref(false)
const getAgency = async (type) => {