From 3f6bf89b1985b6668f02ffcc9af577b412e92e45 Mon Sep 17 00:00:00 2001
From: zhouwx <1175765986@qq.com>
Date: 星期一, 24 三月 2025 17:17:45 +0800
Subject: [PATCH] bug修改

---
 src/views/safetyReview/projectManage/components/processCtrlReview.vue |   80 ++++++++++++++++++++++++----------------
 1 files changed, 48 insertions(+), 32 deletions(-)

diff --git a/src/views/safetyReview/projectManage/components/processCtrlReview.vue b/src/views/safetyReview/projectManage/components/processCtrlReview.vue
index 60bf3cc..85ec8b9 100644
--- a/src/views/safetyReview/projectManage/components/processCtrlReview.vue
+++ b/src/views/safetyReview/projectManage/components/processCtrlReview.vue
@@ -17,7 +17,7 @@
         <el-col :span="6">
           <el-form-item prop="processLeader.name" label="过程控制负责人">
             <el-input
-                v-model="state.formData.processLeader.name"
+                v-model.trim="state.formData.processLeader.name"
                 size="large"
                 placeholder="请选择过程控制负责人"
                 @focus="openExperts('过程控制负责人')"
@@ -42,7 +42,7 @@
         <el-table-column label="过程控制关键点" prop="content" header-align="center" :show-overflow-tooltip="true"/>
         <el-table-column label="审核结果" header-align="center" class-name="small-padding fixed-width" width="175">
           <template #default="scope">
-            <el-radio-group v-model="scope.row.status" >
+            <el-radio-group v-model="scope.row.status" @change="changeStatus(scope.row)">
               <el-radio :label="1">符合</el-radio>
               <el-radio :label="0">不符合</el-radio>
             </el-radio-group>
@@ -51,7 +51,7 @@
         <el-table-column label="不符合描述" header-align="center" class-name="small-padding fixed-width" width="700">
           <template #default="scope">
             <el-input
-                v-model="scope.row.reason"
+                v-model.trim="scope.row.reason"
                 size="large"
                 :disabled="scope.row.status == 1"
                 placeholder="如不符合,请填写不符合描述"
@@ -61,7 +61,7 @@
       </el-table>
       <el-form-item prop="suggestions" label="存在问题及建议">
         <el-input
-            v-model="state.formData.suggestions"
+            v-model.trim="state.formData.suggestions"
             :autosize="{ minRows: 6 }"
             maxlength="500"
             show-word-limit
@@ -71,7 +71,7 @@
       <el-row :gutter="30">
         <el-col :span="18">
           <el-form-item label="附件上传" prop="assAccessoryFiles">
-            <el-upload accept="image/*,.pdf,.doc,.docx,.xlsx,.xls" :action="state.uploadUrl" :data="{moduleType: 8,projectId: props.projectId}" :headers="state.header" method="post" :on-success="handleAvatarSuccess" :on-exceed="showTip" :on-preview="handlePictureCardPreview" :limit='1' v-model:file-list="state.fileList" :before-upload="picSize" :disabled="state.disabled" :on-remove="handleRemove" >
+            <el-upload accept="image/*,.pdf,.doc,.docx,.xlsx,.xls" :action="state.uploadUrl" :data="{moduleType: 8,projectId: props.projectId}" :headers="state.header" method="post" :on-success="handleAvatarSuccess" :on-exceed="showTip" :on-preview="handlePictureCardPreview" :limit='1' v-model:file-list="state.fileList" :before-upload="picSize" :disabled="projectType === 'view' || isEnd" :on-remove="handleRemove" >
               <el-button type="primary">附件上传</el-button>
               <template #tip>
                 <div class="el-upload__tip">上传文件尺寸小于5M,最多可上传1份</div>
@@ -99,6 +99,8 @@
 import Cookies from "js-cookie"
 import ExpertsList from "./expertsList";
 import axios from "axios";
+import { useRoute } from 'vue-router'
+const route = useRoute()
 const props = defineProps(['projectId'])
 const emit = defineEmits(["getNextStatus"]);
 
@@ -129,7 +131,7 @@
     {id: 9, content: '技术负责人审核', status: 1, key:'isTechnolgyAudit', reasonKey: 'technolgyAuditDes', reason: ''},
     {id: 6, content: '评价报告外审意见', status: 1, key:'isExteriorAudit', reasonKey: 'exteriorAuditDes', reason: ''},
     {id: 7, content: '评价项目网上信息公开', status: 1, key:'isOpenInformation', reasonKey: 'openInformationDes', reason: ''},
-    {id: 8, content: '二维码的使用', status: 1, key:'isUseQrcode', reasonKey: 'useQrcodeDes', reason: ''},
+    // {id: 8, content: '二维码的使用', status: 1, key:'isUseQrcode', reasonKey: 'useQrcodeDes', reason: ''},
     {id: 9, content: '报告归档材料完整性', status: 1, key:'isFullMaterials', reasonKey: 'fullMaterialsDes', reason: ''}
   ],
   uploadUrl: import.meta.env.VITE_APP_BASE_API + '/manage/accessory-file/uploadFile',
@@ -148,10 +150,16 @@
     isAmin.value = true;
   }
   getProcessFiles(props.projectId)
+  isEnd.value = Cookies.get('end')
+  projectType.value = route.query.type;
 })
 
+const projectType = ref('');
+const isEnd = ref('')
 const riskOpen = async (type,val) => {
   state.formData.projectId = val
+  isEnd.value = Cookies.get('end')
+  projectType.value = route.query.type;
   if(type === 'detail' || type === 'edit' ){
     if(type === 'detail'){
       state.disabled = true
@@ -223,6 +231,12 @@
         }
       }
     }
+  }
+}
+const changeStatus = (val) => {
+  if(val.status == 1 && val.reason != "") {
+    const index = state.tableData.findIndex(item => item.id == val.id)
+    state.tableData[index].reason = ""
   }
 }
 
@@ -304,32 +318,34 @@
 }
 
 const handleRemove = async (file, uploadFile) => {
-  ElMessageBox.confirm(
-      '确定删除该附件?',
-      '提示',
-      {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning',
-      })
-      .then( async() => {
-        const res = await delFile(file.id)
-        if(res.code == 200){
-          ElMessage({
-            type: 'success',
-            message: '文件已删除'
-          })
-          await getProcessFiles()
-        }else{
-          ElMessage({
-            type: 'warning',
-            message: res.message
-          })
-        }
-      })
-      .catch(()=>{
-        getProcessFiles()
-      })
+  if(file && file.status == 'success') {
+    ElMessageBox.confirm(
+        '确定删除该附件?',
+        '提示',
+        {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning',
+        })
+        .then(async () => {
+          const res = await delFile(file.id)
+          if (res.code == 200) {
+            ElMessage({
+              type: 'success',
+              message: '文件已删除'
+            })
+            await getProcessFiles()
+          } else {
+            ElMessage({
+              type: 'warning',
+              message: res.message
+            })
+          }
+        })
+        .catch(() => {
+          getProcessFiles()
+        })
+  }
 }
 
 defineExpose({

--
Gitblit v1.9.2