From d3793edc9e3479f162c0cab6930d17c919ecacae Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期一, 10 三月 2025 17:12:37 +0800
Subject: [PATCH] 设备搬迁

---
 src/views/CNAS/resourceDemand/device/component/fault.vue |   52 +++++++++++++++++++++++++---------------------------
 1 files changed, 25 insertions(+), 27 deletions(-)

diff --git a/src/views/CNAS/resourceDemand/device/component/fault.vue b/src/views/CNAS/resourceDemand/device/component/fault.vue
index a229fa7..c509165 100644
--- a/src/views/CNAS/resourceDemand/device/component/fault.vue
+++ b/src/views/CNAS/resourceDemand/device/component/fault.vue
@@ -278,6 +278,13 @@
 <script>
 import { dateFormat } from '@/utils/date'
 import { mapGetters } from "vuex";
+import {
+  addOrUpdateDeviceFaultOne,
+  deleteCNASFile, deleteDeviceFaultOne,
+  deviceFaultOnePage, exportRewardAndPunishmentRecords,
+  selectDeviceByCode
+} from "@/api/cnas/resourceDemand/device";
+import {selectUserCondition} from "@/api/system/user";
 export default {
   props: {
     clickNodeVal: {
@@ -310,7 +317,7 @@
   computed: {
     ...mapGetters(["nickName"]),
     action() {
-      return this.javaApi + this.$api.personnel.saveCNASFile
+      return this.javaApi + '/personBasicInfo/saveCNASFile'
     }
   },
   mounted() {
@@ -399,11 +406,7 @@
           // 鑾峰彇褰撳墠鐘舵��
           this.form.currentState = currentStepAction === 5 ? '鍏抽棴' : this.steps[currentStepAction]
           this.form.deviceId = this.clickNodeVal.value
-          this.$axios.post(this.$api.deviceCheck.addOrUpdateDeviceFaultOne, this.form, {
-            headers: {
-              'Content-Type': 'application/json'
-            }
-          }).then(res => {
+          addOrUpdateDeviceFaultOne(this.form).then(res => {
             if (res.code == 200) {
               this.$message.success('鎻愪氦鎴愬姛')
               this.getTableList(this.clickNodeVal.value)
@@ -425,7 +428,7 @@
     },
     openRecordAcceptance() {
       // 鑾峰彇璁惧鍩虹淇℃伅
-      this.$axios.get(this.$api.deviceScope.selectDeviceByCode + '?id=' + this.clickNodeVal.value).then(res => {
+      selectDeviceByCode({id: this.clickNodeVal.value}).then(res => {
         this.form.deviceName = res.data.deviceName
         this.form.manufacturer = res.data.manufacturer
         this.form.specificationModel = res.data.specificationModel
@@ -436,11 +439,9 @@
     },
     // 鑾峰彇璐熻矗浜轰俊鎭帴鍙�
     getUserList() {
-      this.$axios.get(this.$api.deviceScope.selectUserList).then(res => {
-        if (res.code == 200) {
-          this.users = res.data
-        }
-      })
+      selectUserCondition().then((res) => {
+        this.users = res.data;
+      });
     },
     handleSizeChange(val) {
       this.search.size = val
@@ -456,7 +457,7 @@
         cancelButtonText: '鍙栨秷',
         type: 'warning'
       }).then(() => {
-        this.$axios.delete(this.$api.personnel.deleteCNASFile + "?fileName=" + this.form.systemFileName).then(res => {
+        deleteCNASFile({fileName: this.form.systemFileName}).then(res => {
           if (res.code == 200) {
             this.$message.success('鍒犻櫎鎴愬姛锛�')
           }
@@ -477,7 +478,7 @@
         this.form.fileName = response.data
         this.$message.success('涓婁紶鎴愬姛')
       } else {
-        this.$message.error(response.message)
+        this.$message.error(response.msg)
       }
     },
     onError(error, file, fileList) {
@@ -505,7 +506,13 @@
     },
     //鑾峰彇鎵�鏈変俊鎭�
     getTableList(deviceId) {
-      this.$axios.get(this.$api.deviceCheck.deviceFaultOnePage + '?deviceId=' + deviceId + "&size=" + this.search.size + "&current=" + this.search.current + "&processNumber=" + this.search.processNumber).then(res => {
+      const params = {
+        deviceId: deviceId,
+        size: this.search.size,
+        current: this.search.current,
+        processNumber: this.search.processNumber,
+      }
+      deviceFaultOnePage(params).then(res => {
         if (res.code == 200) {
           this.faultParam = res.data.records
           this.search.total = res.data.total
@@ -515,19 +522,10 @@
     //瀵煎嚭
     handleDown() {
       this.outLoading = true
-      this.$axios.post(this.$api.deviceCheck.exportRewardAndPunishmentRecords, {
-        deviceId: this.clickNodeVal.value
-      }, { responseType: "blob" }).then(res => {
+      exportRewardAndPunishmentRecords({deviceId: this.clickNodeVal.value}).then(res => {
         this.outLoading = false
-        this.$message.success('瀵煎嚭鎴愬姛')
         const blob = new Blob([res], { type: 'application/octet-stream' });
-        const url = URL.createObjectURL(blob);
-        const link = document.createElement('a');
-        link.href = url;
-        link.download = '璁惧鏁呴殰琛�.xlsx';
-        link.click();
-      }).finally(() => {
-        this.outLoading = false
+        this.$dowmload.saveAs(blob, '璁惧鏁呴殰琛�.xlsx')
       })
     },
     selectAllByOne(row) {
@@ -556,7 +554,7 @@
         cancelButtonText: '鍙栨秷',
         type: 'warning'
       }).then(() => {
-        this.$axios.delete(this.$api.deviceCheck.deleteDeviceFaultOne + '?id=' + row.id).then(res => {
+        deleteDeviceFaultOne({id: row.id}).then(res => {
           if (res.code == 200) {
             this.$message.success('鍒犻櫎鎴愬姛')
             this.getTableList(this.clickNodeVal.value)

--
Gitblit v1.9.3