From e728c55c65d943ad90a6cf6e1c619003b4c9a077 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期六, 29 三月 2025 17:52:26 +0800
Subject: [PATCH] 质量监控、监督计划-流程修改

---
 src/views/CNAS/process/ensureResults/ensureResultsValidity/components/carryOutDialog.vue |   31 ++++++++++++++++++-------------
 1 files changed, 18 insertions(+), 13 deletions(-)

diff --git a/src/views/CNAS/process/ensureResults/ensureResultsValidity/components/carryOutDialog.vue b/src/views/CNAS/process/ensureResults/ensureResultsValidity/components/carryOutDialog.vue
index 051b17b..70a291d 100644
--- a/src/views/CNAS/process/ensureResults/ensureResultsValidity/components/carryOutDialog.vue
+++ b/src/views/CNAS/process/ensureResults/ensureResultsValidity/components/carryOutDialog.vue
@@ -1,4 +1,5 @@
 <template>
+<!--璐ㄩ噺鐩戞帶-瀹炴柦娴佺▼椤甸潰-->
   <div>
     <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :visible.sync="formDia" title="瀹炴柦"
       width="60%" @close="closeCarryOutDia">
@@ -144,7 +145,10 @@
       </div>
       <span slot="footer" class="dialog-footer">
         <el-button @click="closeCarryOutDia">鍙� 娑�</el-button>
-        <el-button v-if="currentStep !== 2" :loading="editLoad" type="primary" @click="handleEdit">鎻� 浜�</el-button>
+        <el-button v-if="currentStep === 0" :loading="editLoad" type="primary" @click="handleEdit">鎻� 浜�</el-button>
+        <el-button v-if="currentStep === 1 && userId == ratifyUserId" :loading="editLoad" @click="handleEdit(0)">涓嶉�氳繃</el-button>
+        <el-button v-if="currentStep === 1 && userId == ratifyUserId" :loading="editLoad" type="primary" @click="handleEdit(1)">閫�
+          杩�</el-button>
       </span>
     </el-dialog>
   </div>
@@ -157,6 +161,7 @@
   getQualityMonitorRatify
 } from "@/api/cnas/process/ensureResults/qualityMonitor";
 import { selectUserCondition } from "@/api/business/inspectionTask";
+import {mapGetters} from "vuex";
 
 export default {
   name: 'carryOutDialog',
@@ -185,7 +190,11 @@
       personList: [],
       editLoad: false,
       isCarryOut: false, // 鏄惁涓哄疄鏂�
+      ratifyUserId: ''
     };
+  },
+  computed: {
+    ...mapGetters(["userId"]),
   },
   // 鏂规硶闆嗗悎
   methods: {
@@ -198,9 +207,9 @@
     searchInfo(row) {
       getQualityMonitorRatify({ qualityMonitorDetailsId: row.qualityMonitorDetailsId }).then(res => {
         // 鏈塪etailsRatifyId鍒欒鏄庢彁浜よ繃瀹炴柦淇℃伅
-        if (res.data.detailsRatifyId) {
+        if (res.data.ratifyUserId) {
           // 鏄惁缁撴潫0:鏈粨鏉�, 1:宸茬粨鏉�
-          if (res.data.isFinish == 0) {
+          if (res.data.isFinish != 1) {
             this.currentStep = 1
           } else if (res.data.isFinish == 1) {
             this.currentStep = 2
@@ -209,28 +218,24 @@
           this.currentStep = 0
         }
         this.form = res.data
+        this.ratifyUserId = res.data.ratifyUserId
       }).catch(err => {
         console.log('err---', err);
       })
     },
     // 鎻愪氦
-    handleEdit() {
-      if (!this.form.ratifyUserId) {
-        this.$message.warning('璇烽�夋嫨鎵瑰噯浜�')
-        return
-      }
+    handleEdit(isFinish) {
       this.editLoad = true
       if (this.currentStep == 0) {
         this.addInfo()
       } else {
-        this.editInfo()
+        this.editInfo(isFinish)
       }
     },
     // 鎻愪氦瀹炴柦
     addInfo() {
       addQualityMonitorRatify(this.form).then(res => {
         this.editLoad = false
-        if (res.code === 201) return
         this.$message.success('鎿嶄綔鎴愬姛')
         this.closeCarryOutDia()
       }).catch(err => {
@@ -239,10 +244,10 @@
       })
     },
     // 鎻愪氦鎵瑰噯
-    editInfo() {
+    editInfo(isFinish) {
+      this.form.isFinish = isFinish
       addQualityMonitorRatifyOpinion(this.form).then(res => {
         this.editLoad = false
-        if (res.code === 201) return
         this.$message.success('鎿嶄綔鎴愬姛')
         this.closeCarryOutDia()
       }).catch(err => {
@@ -256,7 +261,7 @@
       this.$emit('closeCarryOutDia')
     },
     getAuthorizedPerson() {
-      selectUserCondition({ type: 1 }).then((res) => {
+      selectUserCondition({ type: 2 }).then((res) => {
         let data = [];
         res.data.forEach((a) => {
           data.push({

--
Gitblit v1.9.3