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/inspectionOfEquipment.vue |   59 +++++++++++++++--------------------------------------------
 1 files changed, 15 insertions(+), 44 deletions(-)

diff --git a/src/views/CNAS/resourceDemand/device/component/inspectionOfEquipment.vue b/src/views/CNAS/resourceDemand/device/component/inspectionOfEquipment.vue
index 78709ed..924e81d 100644
--- a/src/views/CNAS/resourceDemand/device/component/inspectionOfEquipment.vue
+++ b/src/views/CNAS/resourceDemand/device/component/inspectionOfEquipment.vue
@@ -7,6 +7,7 @@
       </div>
       <div>
         <el-table ref="yearTable" v-loading="yearTableDetailDataLoading" :data="yearTableDetailData"
+                  :header-cell-style="{ background: '#f8f8f9', color: '#515a6e' }" border
           height="calc(100vh - 18em)" style="width: 100% ;">
           <!-- 琛ㄦ牸鍒� -->
           <el-table-column align="center" header-align="center" label="搴忓彿" prop="prop" type="index"
@@ -37,7 +38,7 @@
           </el-table-column>
         </el-table>
         <el-pagination :current-page="1" :page-size="pagination1.size" :page-sizes="[10, 20, 30, 50, 100]"
-          :total="pagination1.total" layout="->,total, sizes, prev, pager, next, jumper"
+          :total="pagination1.total" layout="->,total, sizes, prev, pager, next, jumper" background
           @size-change="handleSizeChange1" @current-change="handleCurrentChange1">
         </el-pagination>
       </div>
@@ -48,7 +49,11 @@
 
 <script>
 import InspectionForm from "./inspectionForm.vue";
-
+import {
+  getDeviceInspectionRecordByPage,
+  exportDeviceInspectionRecord,
+  deleteDeviceInspectionRecord,
+} from '@/api/cnas/resourceDemand/device.js'
 export default {
   name: "inspection-of-equipment",
   // import 寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢�
@@ -81,19 +86,10 @@
     // 鏌ヨ
     getYearTableDetailData(deviceId) {
       this.yearTableDetailDataLoading = true
-      this.$axios.post(this.$api.deviceInspectionRecord.getDeviceInspectionRecordByPage, {
-        page: {
-          current: this.pagination1.current,
-          size: this.pagination1.size,
-        },
-        entity: {
-          deviceId: deviceId,
-        }
-      }, {
-        headers: {
-          'Content-Type': 'application/json'
-        },
-        noQs: true
+      getDeviceInspectionRecordByPage({
+        current: this.pagination1.current,
+        size: this.pagination1.size,
+        deviceId: deviceId,
       }).then(res => {
         if (res.code == 200) {
           this.yearTableDetailData = res.data.records
@@ -127,37 +123,12 @@
     // 瀵煎嚭
     handleDownOne(id) {
       this.outLoading = true
-      this.$axios.get(this.$api.deviceInspectionRecord.exportDeviceInspectionRecord + '?inspectionRecordId=' + id, {
-        responseType: "blob"
+      exportDeviceInspectionRecord({
+        inspectionRecordId: id
       }).then(res => {
         this.outLoading = false
         const blob = new Blob([res], { type: 'application/octet-stream' });
-        //灏咮lob 瀵硅薄杞崲鎴愬瓧绗︿覆
-        let reader = new FileReader();
-        reader.readAsText(blob, 'utf-8');
-        reader.onload = () => {
-          try {
-            let result = JSON.parse(reader.result);
-            if (result.message) {
-              this.$message.error(result.message);
-            } else {
-              const url = URL.createObjectURL(blob);
-              const link = document.createElement('a');
-              link.href = url;
-              link.download = '璁惧鐐规璁板綍琛�.doc';
-              link.click();
-              this.$message.success('瀵煎嚭鎴愬姛')
-            }
-          } catch (err) {
-            console.log(err);
-            const url = URL.createObjectURL(blob);
-            const link = document.createElement('a');
-            link.href = url;
-            link.download = '璁惧鐐规璁板綍琛�.doc';
-            link.click();
-            this.$message.success('瀵煎嚭鎴愬姛')
-          }
-        }
+        this.$download.saveAs(blob, '璁惧鐐规璁板綍琛�.doc')
       })
     },
     // 鍒犻櫎
@@ -167,7 +138,7 @@
         cancelButtonText: '鍙栨秷',
         type: 'warning'
       }).then(() => {
-        this.$axios.get(this.$api.deviceInspectionRecord.deleteDeviceInspectionRecord + '?inspectionRecordId=' + id).then(res => {
+        deleteDeviceInspectionRecord({ inspectionRecordId: id }).then(res => {
           this.$message.success('鍒犻櫎鎴愬姛锛�');
           this.getYearTableDetailData(this.clickNodeVal.value);
         });

--
Gitblit v1.9.3