From e5454b769d44a34af423bf87ac8a740bf8c20341 Mon Sep 17 00:00:00 2001
From: Crunchy <3114200645@qq.com>
Date: 星期二, 29 四月 2025 13:25:29 +0800
Subject: [PATCH] Merge branch 'dev' into dev_tides

---
 src/views/CNAS/process/ensureResults/qualityControlPlan/components/processingSheet.vue |   63 +++++++++++++------------------
 1 files changed, 26 insertions(+), 37 deletions(-)

diff --git a/src/views/CNAS/process/ensureResults/qualityControlPlan/components/processingSheet.vue b/src/views/CNAS/process/ensureResults/qualityControlPlan/components/processingSheet.vue
index a337f53..c96c0bb 100644
--- a/src/views/CNAS/process/ensureResults/qualityControlPlan/components/processingSheet.vue
+++ b/src/views/CNAS/process/ensureResults/qualityControlPlan/components/processingSheet.vue
@@ -82,12 +82,6 @@
               <p><span class="required-span">* </span>琚洃鐫d汉锛�</p>
             </td>
             <td class="td-info">
-<!--              <el-select v-if="currentStep === 0" v-model="form.supervisedUserId" clearable-->
-<!--                         filterable-->
-<!--                         placeholder="璇烽�夋嫨" size="small">-->
-<!--                <el-option v-for="(item,i) in supervisedUserList" :key="i" :label="item.label" :value="item.value">-->
-<!--                </el-option>-->
-<!--              </el-select>-->
               <span class="td-info1"> {{ form.supervisedUserName }}</span>
             </td>
             <td class="td-title">
@@ -303,7 +297,10 @@
       </div>
       <span slot="footer" class="dialog-footer">
         <el-button @click="closeProcessingDia">鍙� 娑�</el-button>
-        <el-button v-if="currentStep !== 2" :loading="editLoad" type="primary" @click="handleEdit">鎻� 浜�</el-button>
+        <el-button v-if="currentStep === 0 && userId == supervisedUserId" :loading="editLoad" type="primary" @click="handleEdit">鎻� 浜�</el-button>
+        <el-button v-if="currentStep === 1 && userId == approverUserId" :loading="editLoad" @click="handleEdit(0)">涓嶉�氳繃</el-button>
+        <el-button v-if="currentStep === 1 && userId == approverUserId" :loading="editLoad" type="primary" @click="handleEdit(1)">閫�
+          杩�</el-button>
       </span>
     </el-dialog>
   </div>
@@ -315,6 +312,7 @@
   getSuperviseDetailAccording
 } from "@/api/cnas/process/ensureResults/qualitySupervise";
 import {selectUserCondition} from "@/api/business/inspectionTask";
+import {mapGetters} from "vuex";
 
 export default {
   name: 'processingSheet',
@@ -359,42 +357,48 @@
       editLoad: false,
       personList: [],
       supervisedUserList: [],
+      supervisedUserId: '',
+      approverUserId: ''
     };
+  },
+  computed: {
+    ...mapGetters(["userId"]),
   },
   // 鏂规硶闆嗗悎
   methods: {
     openDia (row) {
       this.formDia = true
-      this.searchInfo(row)
       this.form.superviseDetailsId = row.superviseDetailsId
+      this.supervisedUserId = row.supervisedUserId
+      this.searchInfo(row)
       this.form.approveId = row.approveId
       this.getAuthorizedPerson() // 鑾峰彇浜哄憳鍒楄〃
       // this.getSupervisedUserList() // 鑾峰彇褰撳墠閮ㄩ棬浜哄憳
     },
     // 鏌ヨ鐩戞帶璁″垝璇︽儏瀹炴柦淇℃伅
     searchInfo (row) {
-      this.form.qualityMonitorDetailsId = row.qualityMonitorDetailsId
-      getSuperviseDetailAccording({superviseDetailsId: row.superviseDetailsId}).then(res => {
+      getSuperviseDetailAccording({superviseDetailsId: this.form.superviseDetailsId}).then(res => {
         this.form.supervisedUserId = res.data.supervisedUserId
         this.form.supervisedUserName = res.data.supervisedUserName
-        if (res.data.superviseDetailsAccordingId === null) {
-          this.currentStep = 0
-        } else {
-          this.form = res.data
-          if (res.data.isFinish === 0) {
-            if (res.data.approverUserId) {
-              this.currentStep = 1
-            }
-          } else {
+        if (res.data.approverUserId) {
+          // 鏄惁缁撴潫0:鏈粨鏉�, 1:宸茬粨鏉�
+          if (res.data.isFinish != 1) {
+            this.currentStep = 1
+          } else if (res.data.isFinish == 1) {
             this.currentStep = 2
           }
+        } else {
+          this.currentStep = 0
         }
+        this.form = res.data
+        this.form.superviseDetailsId = row.superviseDetailsId
+        this.approverUserId = res.data.approverUserId
       }).catch(err => {
         console.log('err---', err);
       })
     },
     // 鎻愪氦
-    handleEdit () {
+    handleEdit (isFinish) {
       if (this.currentStep === 0) {
         if (this.form.findWay === null) {
           this.$message.warning('璇烽�夋嫨涓嶇鍚堝伐浣滃彂鐜伴�斿緞')
@@ -416,10 +420,6 @@
           this.$message.warning('璇烽�夋嫨鏄惁闇�瑕侀噰鍙栫籂姝f帾鏂�')
           return
         }
-        if (!this.form.approverUserId) {
-          this.$message.warning('璇烽�夋嫨鎵瑰噯浜�')
-          return
-        }
       }
       this.editLoad = true
       this.form.flowType = this.currentStep
@@ -433,6 +433,7 @@
           this.editLoad = false
         })
       } else {
+        this.form.isFinish = isFinish
         approverEquipSuperviseDetailAccording(this.form).then(res => {
           this.editLoad = false
           this.$message.success('鎵瑰噯鎴愬姛')
@@ -449,7 +450,7 @@
       this.$emit('closeProcessingDia')
     },
     getAuthorizedPerson() {
-      selectUserCondition({ type: 1 }).then((res) => {
+      selectUserCondition({ type: 2 }).then((res) => {
         let data = [];
         res.data.forEach((a) => {
           data.push({
@@ -460,18 +461,6 @@
         this.personList = data;
       });
     },
-    // getSupervisedUserList () {
-    //   this.$axios.get(this.$api.user.selectDepartmentLimsUserList).then(res => {
-    //     let data = []
-    //     res.data.forEach(a => {
-    //       data.push({
-    //         label: a.name,
-    //         value: a.id
-    //       })
-    //     })
-    //     this.supervisedUserList = data
-    //   })
-    // },
   }
 };
 </script>

--
Gitblit v1.9.3