From 210e6ea4eab68b1c607b48870b5e3553930853fb Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期五, 05 一月 2024 14:53:51 +0800
Subject: [PATCH] 销售订单-下载按钮修改4

---
 src/views/plan/customerorder/index.vue |   22 +++++++++++++++++++---
 1 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/src/views/plan/customerorder/index.vue b/src/views/plan/customerorder/index.vue
index 8602ff0..fe3aa84 100644
--- a/src/views/plan/customerorder/index.vue
+++ b/src/views/plan/customerorder/index.vue
@@ -867,7 +867,7 @@
         text: '涓嬭浇Word',
         disabled: false,
         type: 'primary',
-        fun: this.downloadWordFile,
+        fun: this.downloadWord,
         permitArr: ['03plan','04planed'],
     })
   },
@@ -879,7 +879,9 @@
             this.$message.error("璇烽�夋嫨涓�鏉℃暟鎹�")
             return
         }
-        downloadWordFile(ids).then().catch(error=>{
+        downloadWordFile(ids).then(res=>{
+            transform(res)
+        }).catch(error=>{
             console.error(error);
         })
     },
@@ -1185,7 +1187,6 @@
           uniqueStateArr.push(stateArr[i])
         }
       }
-      console.log(uniqueStateArr);
       // 寰幆鑷畾涔夋寜閽紝鍒ゆ柇姣忎釜鎸夐挳鐨刾ermitArr鏄惁瀹屽叏鍖呭惈閫変腑鐘舵�侊紝鑻ュ畬鍏ㄥ寘鍚紝鍒欐寜閽寒锛屽惁鍒欐寜閽伆
       for (var i = 0; i < this.stateTagArr.length; i++) {
         if (
@@ -1200,6 +1201,21 @@
           this.stateTagArr[i].disabled = true
         }
       }
+      // 寰幆琛ㄥご鎸夐挳锛屽垽鏂瘡涓寜閽殑permitArr鏄惁瀹屽叏鍖呭惈閫変腑鐘舵�侊紝鑻ュ畬鍏ㄥ寘鍚紝鍒欐寜閽寒锛屽惁鍒欐寜閽伆
+      var toolbar = this.table.toolbar
+      for (var j = 0; j < toolbar.length; j++) {
+        if (
+          uniqueStateArr.every((val) =>
+            toolbar[j].permitArr.length <= 0
+              ? true
+              : toolbar[j].permitArr.includes(val)
+          )
+        ) {
+          toolbar[j].disabled = false
+        } else {
+          toolbar[j].disabled = true
+        }
+      }
       this.multipleSelection = val
     },
     getCustomerCoState(row, column, cellValue) {

--
Gitblit v1.9.3