From e4bb381c896015c4b87faa002ba6875c06a2fd16 Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期四, 26 十二月 2024 14:33:10 +0800
Subject: [PATCH] 同步检测中心cnas修改

---
 src/components/do/a6-facilities-environment/Personnel-management.vue |   32 ++++++++++++++++++++++++++------
 1 files changed, 26 insertions(+), 6 deletions(-)

diff --git a/src/components/do/a6-facilities-environment/Personnel-management.vue b/src/components/do/a6-facilities-environment/Personnel-management.vue
index 43c74ff..ea5e5d0 100644
--- a/src/components/do/a6-facilities-environment/Personnel-management.vue
+++ b/src/components/do/a6-facilities-environment/Personnel-management.vue
@@ -194,13 +194,33 @@
         },
         noQs: true}).then(res => {
         this.outLoading = false
-        this.$message.success('瀵煎嚭鎴愬姛')
         const blob = new Blob([res],{ type: 'application/msword' });
-        const url = URL.createObjectURL(blob);
-        const link = document.createElement('a');
-        link.href = url;
-        link.download = '澶栨潵浜哄憳鐧昏' + '.docx';
-        link.click();
+        //灏咮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 = '澶栨潵浜哄憳鐧昏' + '.docx';
+              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 = '澶栨潵浜哄憳鐧昏' + '.docx';
+            link.click();
+            this.$message.success('瀵煎嚭鎴愬姛')
+          }
+        }
       })
     },
     closeThreeWastesDia () {

--
Gitblit v1.9.3