From 45792b3776cda2e1ada31755ffc226a663f90b48 Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期三, 19 三月 2025 15:32:23 +0800
Subject: [PATCH] 锁屏功能

---
 src/views/CNAS/personnel/personnelInfo/Department/components/rewardPunishmentRecord/index.vue |   45 +++++++--------------------------------------
 1 files changed, 7 insertions(+), 38 deletions(-)

diff --git a/src/views/CNAS/personnel/personnelInfo/Department/components/rewardPunishmentRecord/index.vue b/src/views/CNAS/personnel/personnelInfo/Department/components/rewardPunishmentRecord/index.vue
index a9e1122..47c8291 100644
--- a/src/views/CNAS/personnel/personnelInfo/Department/components/rewardPunishmentRecord/index.vue
+++ b/src/views/CNAS/personnel/personnelInfo/Department/components/rewardPunishmentRecord/index.vue
@@ -108,7 +108,9 @@
 import {
   deleteRewardPunishment,
   addOrUpdateRewardPunishment,
-  rewardPunishmentPage
+  rewardPunishmentPage,
+  selectUserList,
+  rewardPunishmentExport
 } from '@/api/cnas/personnel/personnelInfo.js'
 export default {
   props: {
@@ -212,56 +214,23 @@
     },
     handleDown() {
       this.outLoading = true
-      this.$axios.post(this.$api.deviceCheck.rewardPunishmentExport, {
+      rewardPunishmentExport({
         userId: this.isDepartment ? '' : this.departId,
         departmentId: this.isDepartment ? this.departId : '',
         userName: this.search.userName,
         startTime: this.search.searchTimeList && this.search.searchTimeList[0],
         endTime: this.search.searchTimeList && this.search.searchTimeList[1]
-      }, { responseType: 'blob' }).then(res => {
+      }).then(res => {
         this.outLoading = false
         const blob = new Blob([res], {
           type: 'application/force-download'
         })
-        //灏咮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 elink = document.createElement('a')
-              elink.download = decodeURI('濂栨儵璁板綍' + '.xlsx')
-              elink.style.display = 'none'
-              elink.href = URL.createObjectURL(blob)
-              document.body.appendChild(elink)
-              elink.click();
-              URL.revokeObjectURL(elink.href) // 閲婃斁URL 瀵硅薄
-              document.body.removeChild(elink)
-              this.$message.success('瀵煎嚭鎴愬姛')
-            }
-          } catch (err) {
-            console.log(err);
-            // 鍒涘缓涓�涓秴閾炬帴锛屽皢鏂囦欢娴佽祴杩涘幓锛岀劧鍚庡疄鐜拌繖涓秴閾炬帴鐨勫崟鍑讳簨浠�
-            const elink = document.createElement('a')
-            elink.download = decodeURI('濂栨儵璁板綍' + '.xlsx')
-            elink.style.display = 'none'
-            elink.href = URL.createObjectURL(blob)
-            document.body.appendChild(elink)
-            elink.click();
-            URL.revokeObjectURL(elink.href) // 閲婃斁URL 瀵硅薄
-            document.body.removeChild(elink)
-            this.$message.success('瀵煎嚭鎴愬姛')
-          }
-        }
+        this.$download.saveAs(blob, '濂栨儵璁板綍' + '.xlsx')
       })
     },
     // 鑾峰彇璐熻矗浜轰俊鎭帴鍙�
     getUserList() {
-      this.$axios.get(this.$api.deviceScope.selectUserList).then(res => {
+      selectUserList().then(res => {
         if (res.code == 200) {
           this.responsibleOptions = res.data
         }

--
Gitblit v1.9.3