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/resourceDemand/device/component/usageAuthorization.vue |   82 +++++++++++++++++++++++++++++++++++++----
 1 files changed, 74 insertions(+), 8 deletions(-)

diff --git a/src/views/CNAS/resourceDemand/device/component/usageAuthorization.vue b/src/views/CNAS/resourceDemand/device/component/usageAuthorization.vue
index c6c5913..d316543 100644
--- a/src/views/CNAS/resourceDemand/device/component/usageAuthorization.vue
+++ b/src/views/CNAS/resourceDemand/device/component/usageAuthorization.vue
@@ -3,7 +3,6 @@
     <div class="search">
       <el-button size="small" type="primary" @click="refreshTableList">鍒� 鏂�</el-button>
       <el-button size="small" type="primary" @click="openDia('add')">鏂� 澧�</el-button>
-      <el-button :loading="outLoading" size="small" type="primary" @click="openHandleOut">瀵� 鍑�</el-button>
     </div>
     <div>
       <lims-table :tableData="tableData" :column="column"
@@ -98,6 +97,19 @@
         <el-button :loading="submitFormLoading" type="primary" @click="changeMachineName">纭</el-button>
       </span>
     </el-dialog>
+    <el-dialog :visible.sync="notificationDia" title="鎻愪氦瀹℃牳" width="30%" @close="closeNotificationDia">
+      <span style="margin-top: 10px;display: inline-block">
+        璇烽�夋嫨瀹℃牳浜猴細
+        <el-select v-model="auditId" clearable filterable size="small" style="width: 90%;">
+          <el-option v-for="item in responsibleOptions" :key="item.id" :label="item.name" :value="item.id">
+          </el-option>
+        </el-select>
+      </span>
+      <span slot="footer" class="dialog-footer">
+        <el-button :loading="notificationLoading" @click="closeNotificationDia">鍙� 娑�</el-button>
+        <el-button :loading="notificationLoading" type="primary" @click="notification">鎻� 浜�</el-button>
+      </span>
+    </el-dialog>
   </div>
 </template>
 
@@ -106,10 +118,10 @@
 import {
   addImpower,
   deleteImpower, deviceScopeSearch, getImpowerDetail, reviewImpowerStatus,
-  selectDeviceImpowerByPage, updateImpower
+  selectDeviceImpowerByPage, submitReviewImpowerStatus, updateImpower, exportDeviceImpower
 } from "@/api/cnas/resourceDemand/device";
-import {exportQualityMonitorDetail} from "@/api/cnas/process/ensureResults/qualityMonitor";
 import {selectUserCondition} from "@/api/system/user";
+import {mapGetters} from "vuex";
 
 export default {
   name: '',
@@ -177,14 +189,31 @@
               },
             },
             {
-              name: '鎺堟潈',
+              name: '瀹℃牳閫氱煡',
+              type: 'text',
+              clickFun: (row) => {
+                this.tellApprove(row.impowerId);
+              },
+              disabled: (row) => {
+                return row.status === 1;
+              },
+            },
+            {
+              name: '瀹℃牳',
               type: 'text',
               clickFun: (row) => {
                 this.openDia('check', row);
               },
               disabled: (row) => {
-                return row.status === 1;
+                return row.status === 1 || this.userId !== row.auditId;
               },
+            },
+            {
+              name: '瀵煎嚭',
+              type: 'text',
+              clickFun: (row) => {
+                this.openHandleOut(row);
+              }
             },
             {
               name: '鍒犻櫎',
@@ -211,7 +240,10 @@
         impowerYear: ''
       },
       delegatedUser: [],
-      impowerId: ''
+      impowerId: '',
+      notificationDia: false,
+      auditId: '',
+      notificationLoading: false,
     };
   },
   mounted() {
@@ -240,6 +272,37 @@
       }).catch(err => {
         this.tableLoading = false
       })
+    },
+    // 鎵撳紑鎻愪氦鎵瑰噯寮规
+    tellApprove(impowerId) {
+      this.getUserList()
+      this.notificationDia = true
+      this.impowerId = impowerId
+    },
+    // 鎻愪氦鎵瑰噯閫氱煡
+    notification() {
+      if (!this.auditId) {
+        this.$message.warning('璇烽�夋嫨瀹℃牳浜�')
+        return
+      }
+      this.notificationLoading = true
+      submitReviewImpowerStatus({
+        auditId: this.auditId,
+        impowerId: this.impowerId,
+      }).then(res => {
+        this.notificationLoading = false
+        if (res.code == 200) {
+          this.closeNotificationDia()
+          this.refreshTableList()
+        }
+      }).catch(err => {
+        this.notificationLoading = false
+      })
+    },
+    // 鍏抽棴鎻愪氦鎵瑰噯寮规
+    closeNotificationDia() {
+      this.notificationDia = false
+      this.auditId = ''
     },
     // 鎵撳紑鎿嶄綔寮规
     openDia (type, row) {
@@ -357,10 +420,10 @@
       })
     },
     openHandleOut (row) {
-      exportQualityMonitorDetail({ impowerId: row.impowerId }).then(res => {
+      exportDeviceImpower({ impowerId: row.impowerId }).then(res => {
         this.outLoading = false
         const blob = new Blob([res], { type: 'application/msword' });
-        this.$download.saveAs(blob, row.monitorName + '.docx')
+        this.$download.saveAs(blob, '璁惧浣跨敤鎺堟潈琛�' + '.docx')
       })
     },
     handleDeleteClick(row) {
@@ -400,6 +463,9 @@
       }
     },
   },
+  computed: {
+    ...mapGetters(["userId"]),
+  },
 };
 </script>
 

--
Gitblit v1.9.3