zhouwx
2024-06-06 003d931e17089fe493ff75e290b3d20ad21f46e3
src/views/safetyReview/projectManage/components/rateConclusion.vue
@@ -23,18 +23,20 @@
      <el-row :gutter="30">
        <el-col :span="18">
          <el-form-item>
            <el-upload accept="image/*,.pdf,.doc,.docx,.xlsx,.xls"
                       :action="state.uploadUrl"
                       :disabled="state.disabled"
                       :headers="state.header"
                       method="post"
                       :on-success="handleAvatarSuccess"
                       :on-exceed="showTip"
                       v-model:file-list="state.fileList"
                       :on-remove="handleRemove"
                       :data="state.uploadData"
                       :on-preview="handlePreview"
                       :limit='1'
            <el-upload
                v-if="state.formData.isReviseManual === 1"
                accept="image/*,.pdf,.doc,.docx,.xlsx,.xls"
                 :action="state.uploadUrl"
                :disabled="projectType === 'view' || isEnd"
                 :headers="state.header"
                 method="post"
                 :on-success="handleAvatarSuccess"
                 :on-exceed="showTip"
                 v-model:file-list="state.fileList"
                 :on-remove="handleRemove"
                 :data="state.uploadData"
                 :on-preview="handlePreview"
                 :limit='1'
            >
              <el-button type="primary">附件上传</el-button>
              <template #tip>
@@ -59,6 +61,8 @@
import {delAccessoryFile, getAccessoryFile} from "@/api/projectManage/project";
import axios from "axios";
import {delFile, getFiles} from "@/api/projectManage/siteCheckRcd";
import { useRoute } from 'vue-router'
const route = useRoute()
const emit = defineEmits(["getNextStatus"]);
const prop = defineProps(['projectId'])
const state = reactive({
@@ -96,10 +100,16 @@
    state.uploadData.projectId = val;
    getProcessFiles(val);
  }
  isEnd.value = Cookies.get('end')
  projectType.value = route.query.type;
})
const projectType = ref('');
const isEnd = ref('')
const riskOpen = async (type,val) => {
  state.uploadData.projectId = val;
  projectType.value = route.query.type;
  isEnd.value = Cookies.get('end')
  if(type === 'detail' || type === 'edit' ){
    if(type === 'detail'){
      state.disabled = true
@@ -175,17 +185,18 @@
const handleAvatarSuccess = (res) => {
  if(res.code === 200){
    getProcessFiles()
    console.log("if",state.fileList)
    // ElMessage({
    //   type: 'success',
    //   message: '文件上传成功'
    // })
    ElMessage({
      type: 'success',
      message: '文件上传成功'
    })
  }else {
    state.fileList.splice(state.fileList.indexOf(uploadFile),1)
    ElMessage({
      type: 'warning',
      message: '文件上传失败'
      message: res.message
    })
  }
}
const handlePreview = (file) => {
  let path = "";