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/rectifyDialogNew.vue |   63 +++++++++++--------------------
 1 files changed, 23 insertions(+), 40 deletions(-)

diff --git a/src/views/CNAS/process/ensureResults/qualityControlPlan/components/rectifyDialogNew.vue b/src/views/CNAS/process/ensureResults/qualityControlPlan/components/rectifyDialogNew.vue
index 2ee9c46..344497c 100644
--- a/src/views/CNAS/process/ensureResults/qualityControlPlan/components/rectifyDialogNew.vue
+++ b/src/views/CNAS/process/ensureResults/qualityControlPlan/components/rectifyDialogNew.vue
@@ -38,18 +38,6 @@
               <span v-if="currentStep !== 0" class="td-info1"> {{ form.raiseResult }}</span>
             </td>
           </tr>
-<!--          <tr v-if="showStep === 0">-->
-<!--            <td v-if="currentStep === 0" class="td-title">-->
-<!--              <p><span class="required-span">* </span>璇烽�夋嫨涓嬩竴姝ヨ礋璐d汉锛�</p>-->
-<!--            </td>-->
-<!--            <td v-if="currentStep === 0" class="td-info" colspan="3">-->
-<!--              <el-select v-model="form.causeUserId" clearable filterable-->
-<!--                         placeholder="璇烽�夋嫨" size="small">-->
-<!--                <el-option v-for="(item,i) in personList" :key="i" :label="item.label" :value="item.value">-->
-<!--                </el-option>-->
-<!--              </el-select>-->
-<!--            </td>-->
-<!--          </tr>-->
           <tr v-if="currentStep !== 0">
             <td class="td-title">
               <p>鎻愬嚭浜猴細</p>
@@ -130,18 +118,6 @@
               {{form.causeTime}}
             </td>
           </tr>
-<!--          <tr v-if="showStep === 0">-->
-<!--            <td v-if="currentStep === 0" class="td-title">-->
-<!--              <p><span class="required-span">* </span>璇烽�夋嫨涓嬩竴姝ヨ礋璐d汉锛�</p>-->
-<!--            </td>-->
-<!--            <td v-if="currentStep === 0" class="td-info" colspan="3">-->
-<!--              <el-select v-model="form.correctUserId" clearable filterable-->
-<!--                         placeholder="璇烽�夋嫨" size="small">-->
-<!--                <el-option v-for="(item,i) in personList" :key="i" :label="item.label" :value="item.value">-->
-<!--                </el-option>-->
-<!--              </el-select>-->
-<!--            </td>-->
-<!--          </tr>-->
           <tr>
             <td class="td-title">
               <p><span class="required-span">* </span>绾犳鎺柦锛�</p>
@@ -266,7 +242,10 @@
       </div>
       <span slot="footer" class="dialog-footer">
         <el-button @click="closeRectifyDia">鍙� 娑�</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>
@@ -279,6 +258,7 @@
 } from "@/api/cnas/process/ensureResults/qualitySupervise";
 import {selectUserCondition} from "@/api/business/inspectionTask";
 import {getThisYearTrainingDetailed} from "@/api/cnas/systemManagement/correctiveAction";
+import {mapGetters} from "vuex";
 
 export default {
   name: 'rectifyDialog',
@@ -289,7 +269,6 @@
     return {
       formDia: false,
       currentStep: 0,
-      showStep: 0,
       form: {
         superviseDetailsId: '',
         raiseResult: '',
@@ -320,7 +299,12 @@
       editLoad: false,
       personList: [],
       yearTrainingDetailed: [],
+      supervisedUserId: '',
+      approverUserId: ''
     };
+  },
+  computed: {
+    ...mapGetters(["userId"]),
   },
   // 鏂规硶闆嗗悎
   methods: {
@@ -329,6 +313,7 @@
       this.searchInfo(row)
       this.form.superviseDetailsId = row.superviseDetailsId
       this.form.approveId = row.approveId
+      this.supervisedUserId = row.supervisedUserId
       this.getAuthorizedPerson() // 鑾峰彇浜哄憳鍒楄〃
       this.getYearTrainingDetailed() // 鑾峰彇鍩硅璁″垝
     },
@@ -336,27 +321,24 @@
     searchInfo (row) {
       this.form.qualityMonitorDetailsId = row.qualityMonitorDetailsId
       getSuperviseDetailCorrect({superviseDetailsId: row.superviseDetailsId}).then(res => {
-        if (res.data.superviseDetailsCorrectId === null) {
-          this.showStep = 0
-          this.currentStep = 0
-        } else {
-          this.form = res.data
-          if (res.data.isFinish === 0) {
-            if (res.data.approverUserId) {
-              this.showStep = 1
-              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
-            this.showStep = 1
           }
+        } else {
+          this.currentStep = 0
         }
+        this.form = res.data
+        this.approverUserId = res.data.approverUserId
       }).catch(err => {
         console.log('err---', err);
       })
     },
     // 鎻愪氦
-    handleEdit () {
+    handleEdit (isFinish) {
       if (this.currentStep === 0) {
         if (!this.form.raiseResult) {
           this.$message.warning('璇峰~鍐欎笉鍚堟牸鎻忚堪')
@@ -387,6 +369,7 @@
           this.editLoad = false
         })
       } else {
+        this.form.isFinish = isFinish
         approveEquipSuperviseDetailCorrect(this.form).then(res => {
           this.editLoad = false
           this.$message.success('鎵瑰噯鎴愬姛')
@@ -406,7 +389,7 @@
       this.showStep = step
     },
     getAuthorizedPerson() {
-      selectUserCondition({ type: 1 }).then((res) => {
+      selectUserCondition({ type: 2 }).then((res) => {
         let data = [];
         res.data.forEach((a) => {
           data.push({

--
Gitblit v1.9.3