From 68f8cfbf950f7a751be125af39897e2e42231764 Mon Sep 17 00:00:00 2001
From: zhuo <2089219845@qq.com>
Date: 星期五, 18 四月 2025 14:50:18 +0800
Subject: [PATCH] 1.设备使用授权导出 2.设备维护保养导出

---
 src/api/cnas/resourceDemand/device.js                                   |   10 ++++++++++
 src/views/CNAS/resourceDemand/device/component/equipmentMaintenance.vue |   10 +++++++++-
 src/views/CNAS/resourceDemand/device/component/usageAuthorization.vue   |   15 ++++++++++-----
 3 files changed, 29 insertions(+), 6 deletions(-)

diff --git a/src/api/cnas/resourceDemand/device.js b/src/api/cnas/resourceDemand/device.js
index 8df3302..b4055f7 100644
--- a/src/api/cnas/resourceDemand/device.js
+++ b/src/api/cnas/resourceDemand/device.js
@@ -1263,6 +1263,16 @@
     data: query,
   });
 }
+
+//浣跨敤璁板綍 瀵煎嚭
+export function exportDeviceMaintenance(query) {
+  return request({
+    url: "/deviceMaintain/exportDeviceMaintenance",
+    method: "get",
+    responseType: "blob",
+    params: query,
+  });
+}
 //璁惧浣跨敤鎺堟潈 鍒嗛〉鏌ヨ
 export function selectDeviceImpowerByPage(query) {
   return request({
diff --git a/src/views/CNAS/resourceDemand/device/component/equipmentMaintenance.vue b/src/views/CNAS/resourceDemand/device/component/equipmentMaintenance.vue
index ed7d0e6..add36e0 100644
--- a/src/views/CNAS/resourceDemand/device/component/equipmentMaintenance.vue
+++ b/src/views/CNAS/resourceDemand/device/component/equipmentMaintenance.vue
@@ -62,7 +62,7 @@
 <script>
 import {
   addDeviceMaintenance,
-  deleteDeviceMaintenance,
+  deleteDeviceMaintenance, exportDeviceMaintenance,
   selectDeviceMaintenancePage
 } from "@/api/cnas/resourceDemand/device";
 import limsTable from "@/components/Table/lims-table.vue";
@@ -215,6 +215,14 @@
       });
     },
     openHandleOut () {
+      this.outLoading = true
+      exportDeviceMaintenance({
+        deviceId: this.clickNodeVal.value
+      }).then(res => {
+        this.outLoading = false
+        const blob = new Blob([res], { type: 'application/octet-stream' });
+        this.$download.saveAs(blob, '璁惧缁存姢淇濆吇.doc')
+      })
 
     },
     handleDeleteClick(row) {
diff --git a/src/views/CNAS/resourceDemand/device/component/usageAuthorization.vue b/src/views/CNAS/resourceDemand/device/component/usageAuthorization.vue
index 8fbb501..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"
@@ -119,9 +118,8 @@
 import {
   addImpower,
   deleteImpower, deviceScopeSearch, getImpowerDetail, reviewImpowerStatus,
-  selectDeviceImpowerByPage, submitReviewImpowerStatus, 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";
 
@@ -209,6 +207,13 @@
               disabled: (row) => {
                 return row.status === 1 || this.userId !== row.auditId;
               },
+            },
+            {
+              name: '瀵煎嚭',
+              type: 'text',
+              clickFun: (row) => {
+                this.openHandleOut(row);
+              }
             },
             {
               name: '鍒犻櫎',
@@ -415,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) {

--
Gitblit v1.9.3