From 0bb5181e9ec648a2aaf374570ed6ace99edc0520 Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期五, 05 一月 2024 12:22:59 +0800
Subject: [PATCH] 销售订单-下载

---
 src/views/quality/packageinspect/packageInspect-form.vue |    2 
 src/views/plan/customerorder/index.vue                   |   68 ++++++++-------------------------
 src/api/plan/customerorder.js                            |   23 +++++++++++
 3 files changed, 41 insertions(+), 52 deletions(-)

diff --git a/src/api/plan/customerorder.js b/src/api/plan/customerorder.js
index 21670b2..3c851b7 100644
--- a/src/api/plan/customerorder.js
+++ b/src/api/plan/customerorder.js
@@ -396,3 +396,26 @@
     params: contractNo
   })
 }
+
+export function downloadWordFile(data) {
+    return request({
+      url: '/mes/plan/customerOrder/package',
+      method: 'post',
+      params: data,
+      responseType: 'blob'
+    }).then((response) => {
+      // 澶勭悊杩斿洖鐨勬枃浠舵祦
+      const blob = response.data
+      const link = document.createElement('a')
+      link.href = URL.createObjectURL(blob)
+      link.download = data.originalFileName
+      document.body.appendChild(link)
+      link.click()
+      window.setTimeout(function() {
+        URL.revokeObjectURL(blob)
+        document.body.removeChild(link)
+      }, 0)
+    })
+  }
+
+
diff --git a/src/views/plan/customerorder/index.vue b/src/views/plan/customerorder/index.vue
index 061bfc5..990cd87 100644
--- a/src/views/plan/customerorder/index.vue
+++ b/src/views/plan/customerorder/index.vue
@@ -53,8 +53,12 @@
             style="margin-left:10px;"
             type="primary"
             @click="()=>exportDialogVisible=true"
-            >瀵煎嚭鍙拌处</el-button
-          >
+            >瀵煎嚭鍙拌处</el-button>
+          <el-button
+            style="margin-left:10px;"
+            type="primary"
+            @click="downloadWord"
+            >涓嬭浇</el-button>
         </template>
       </ttable>
       <!-- 寮圭獥, 鏃ユ湡閫夋嫨 -->
@@ -273,7 +277,8 @@
   exportCustomerOrder,
   exportCustomerOrderSplit,
   syncOrder,
-  dropByContractNo
+  dropByContractNo,
+  downloadWordFile
 } from '../../../api/plan/customerorder'
 import DocumentTable from '@/views/common/document.vue'
 import { remote } from '@/api/admin/dict'
@@ -819,36 +824,6 @@
   created() {
     // this.getManufactureAttrs()
     this.getTitles()
-    /**
-     * {
-            text: '鑾峰彇閿�鍞鍗�',
-            type: 'primary',
-            fun: this.pullCustomerOrder,
-            disabled: false,
-            permitArr: []
-          },
-          {
-            text: '鑾峰彇IFS琛屽彿',
-            type: 'primary',
-            fun: this.pullIfsLineNo,
-            disabled: false,
-            permitArr: [],
-            loading: false
-          },
-          {
-            text: '鎻愪氦瀹℃牳',
-            type: 'primary',
-            fun: this.auditCustomerOrder,
-            disabled: false,
-            permitArr: [],
-            loading: false
-          },
-          {
-            text: '涓荤敓浜ц鍒�',
-            disabled: false,
-            fun: this.masterPlanHandle
-          }
-     */
     this.table.toolbar.push({
       text: '鏂板閿�鍞鍗�',
       type: 'primary',
@@ -856,14 +831,6 @@
       disabled: false,
       permitArr: []
     })
-    // this.table.toolbar.push({
-    //   text: '鍚屾ERP',
-    //   type: 'primary',
-    //   fun: this.syncERP,
-    //   loading: false,
-    //   disabled: false,
-    //   permitArr: []
-    // })
     if (this.permissions.customerorder_from_otc) {
       this.table.toolbar.push({
         text: '鑾峰彇閿�鍞鍗�',
@@ -873,16 +840,6 @@
         permitArr: []
       })
     }
-    // if (this.permissions.customerorder_ifs_line) {
-    //   this.table.toolbar.push({
-    //     text: '鑾峰彇ERP琛屽彿',
-    //     type: 'primary',
-    //     fun: this.pullIfsLineNo,
-    //     disabled: false,
-    //     permitArr: [],
-    //     loading: false
-    //   })
-    // }
     if (this.permissions.customerorder_submit_oa) {
       this.table.toolbar.push({
         text: '鎻愪氦瀹℃牳',
@@ -910,6 +867,15 @@
     }
   },
   methods: {
+    //涓嬭浇word
+    downloadWord(){
+        let ids = this.multipleSelection.map(ele=>ele.id)
+        if(ids.length<1){
+            this.$message.error("璇烽�夋嫨涓�鏉℃暟鎹�")
+            return
+        }
+        downloadWordFile(ids)
+    },
     getOtcPartSyncOptionList() {
       return this.otcPartSyncOptionList
     },
diff --git a/src/views/quality/packageinspect/packageInspect-form.vue b/src/views/quality/packageinspect/packageInspect-form.vue
index 724f678..5e46efd 100644
--- a/src/views/quality/packageinspect/packageInspect-form.vue
+++ b/src/views/quality/packageinspect/packageInspect-form.vue
@@ -66,7 +66,7 @@
         <el-row :gutter="10" style="width:100%;z-index: 10;height:30px;">
             <el-col :span="12">妫�楠岄」鐩�</el-col>
             <el-col :span="12" style="text-align: right;">
-                <el-dropdown @command="handleCommand" v-if="!isShow">
+                <el-dropdown @command="handleCommand" v-if="!isShow && resultVal==null">
                     <el-button size="mini" style="margin-right: 10px;" type="primary" >
                         鍒囨崲榛樿妫�楠岄」<i class="el-icon-arrow-down el-icon--right"></i>
                     </el-button>

--
Gitblit v1.9.3