Explorar o código

成本分配表-多发少发-导出

jbb %!s(int64=2) %!d(string=hai) anos
pai
achega
2ca84b0245

+ 33 - 23
src/views/cost-allocation-total/modal/pilosityFewerModal.vue

@@ -69,8 +69,8 @@
                 <a-row style="marginTop:20px;">
                   <a-col :md="24" :sm="12">
                     <span style="float: right;" class="table-operator">
-                      <!-- <a-button type="primary" icon="download" @click="handleExportXls('采购数量')">导出</a-button>
-                      <a-button type="primary" @click="print" icon="printer" style="margin:0 10px;">打印</a-button> -->
+                      <a-button type="primary" icon="download" @click="handleExportXls('多发少发')">导出</a-button>
+                      <!-- <a-button type="primary" @click="print" icon="printer" style="margin:0 10px;">打印</a-button> -->
                       <a-button type="primary" @click="backFabricLossTable" icon="rollback">返回</a-button>
                     </span>
                   </a-col>
@@ -84,6 +84,7 @@
 </template>
 
 <script>
+import { downFile,downFile1 } from '@/api/manage'
 export default {
   name: 'pilosityFewerListModal', // 事故单 弹框
   components: {},
@@ -92,6 +93,7 @@ export default {
       loading: false,
       confirmLoading: false,
       pilosityFewerModVis: false,
+       planNum:'',
       pilosityFewerList: [],
       pilosityFewerColumns:[
         {
@@ -140,6 +142,10 @@ export default {
     father: {
       type: Function,
       default: null
+    },
+    planNum:{
+      type: String,
+      default: null
     }
   },
   created() {},
@@ -147,28 +153,32 @@ export default {
     //  导出
     handleExportXls(fileName) {
       console.log('需导出的fileName:', fileName)
-      const params = this.dyeLossRateData
+      const params = {
+        planNum:this.planNum,
+        sytransferIngreDeent :this.data,
+        sheetName:'多发少发'
+      }
       console.log('导出参数', params)
-      // downFile('/scas/dyeLoss/excel', params).then(data => {
-      //   console.log('888')
-      //   if (!data) {
-      //     this.$message.warning('文件下载失败')
-      //     return
-      //   }
-      //   if (typeof window.navigator.msSaveBlob !== 'undefined') {
-      //     window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }), fileName + '.xls')
-      //   } else {
-      //     let url = window.URL.createObjectURL(new Blob([data], { type: 'application/vnd.ms-excel' }))
-      //     let link = document.createElement('a')
-      //     link.style.display = 'none'
-      //     link.href = url
-      //     link.setAttribute('download', fileName + '.xls')
-      //     document.body.appendChild(link)
-      //     link.click()
-      //     document.body.removeChild(link) // 下载完成移除元素
-      //     window.URL.revokeObjectURL(url) // 释放掉blob对象
-      //   }
-      // })
+      downFile1('/cost/syCostAllocation/exportXlsSyCostAllocation', params).then(data => {
+        console.log('888')
+        if (!data) {
+          this.$message.warning('文件下载失败')
+          return
+        }
+        if (typeof window.navigator.msSaveBlob !== 'undefined') {
+          window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }), this.planNum+'-'+fileName + '.xlsx')
+        } else {
+          let url = window.URL.createObjectURL(new Blob([data], { type: 'application/vnd.ms-excel' }))
+          let link = document.createElement('a')
+          link.style.display = 'none'
+          link.href = url
+          link.setAttribute('download', fileName + '.xlsx')
+          document.body.appendChild(link)
+          link.click()
+          document.body.removeChild(link) // 下载完成移除元素
+          window.URL.revokeObjectURL(url) // 释放掉blob对象
+        }
+      })
     },
     // 打印
     print() {},

+ 1 - 1
src/views/reportForms/cost-allocation-table/tabs.vue

@@ -187,7 +187,7 @@
       <ingInQua-modal ref="ingInQuaModal" :father="cc" :planNum="this.planNum"></ingInQua-modal>
       <!-- 余下数量 -->
       <ingRemQua-modal ref="ingRemQuaModal" :father="bb" :planNum="this.planNum"></ingRemQua-modal>
-      <pilosity-fewer-list-modal ref="pilosityFewerListModal"></pilosity-fewer-list-modal>
+      <pilosity-fewer-list-modal ref="pilosityFewerListModal" :planNum="this.planNum"></pilosity-fewer-list-modal>
       <submit-information  ref="submitInformation" @close="closeRemark" :showAll="showAll=='yes'?'yes':'no'"></submit-information>
     </div>
   </div>