From a6d2cf654791065fe9ae41712c147f70380a13f0 Mon Sep 17 00:00:00 2001
From: zss <zss@example.com>
Date: 星期五, 05 一月 2024 17:17:27 +0800
Subject: [PATCH] 销售订单下载

---
 src/views/plan/customerorder/index.vue |   30 ++++++++++++++++++++++++++++--
 1 files changed, 28 insertions(+), 2 deletions(-)

diff --git a/src/views/plan/customerorder/index.vue b/src/views/plan/customerorder/index.vue
index e55a083..d376ddf 100644
--- a/src/views/plan/customerorder/index.vue
+++ b/src/views/plan/customerorder/index.vue
@@ -879,7 +879,19 @@
             this.$message.error("璇烽�夋嫨涓�鏉℃暟鎹�")
             return
         }
-        downloadWordFile(ids).then().catch(error=>{
+        downloadWordFile(ids).then(response=>{
+          // 澶勭悊杩斿洖鐨勬枃浠舵祦
+          const blob = response.data
+          const link = document.createElement('a')
+          link.href = URL.createObjectURL(blob)
+          link.download = '宸ヨ壓鏂囦欢.docx'
+          document.body.appendChild(link)
+          link.click()
+          window.setTimeout(function() {
+            URL.revokeObjectURL(blob)
+            document.body.removeChild(link)
+          }, 0)
+        }).catch(error=>{
             console.error(error);
         })
     },
@@ -1185,7 +1197,6 @@
           uniqueStateArr.push(stateArr[i])
         }
       }
-      console.log(uniqueStateArr);
       // 寰幆鑷畾涔夋寜閽紝鍒ゆ柇姣忎釜鎸夐挳鐨刾ermitArr鏄惁瀹屽叏鍖呭惈閫変腑鐘舵�侊紝鑻ュ畬鍏ㄥ寘鍚紝鍒欐寜閽寒锛屽惁鍒欐寜閽伆
       for (var i = 0; i < this.stateTagArr.length; i++) {
         if (
@@ -1200,6 +1211,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