Browse Source

添加导出

mxx 3 năm trước cách đây
mục cha
commit
e2a290f2a5
1 tập tin đã thay đổi với 45 bổ sung1 xóa
  1. 45 1
      src/views/houseSelfCollect/paymentManagement.vue

+ 45 - 1
src/views/houseSelfCollect/paymentManagement.vue

@@ -36,6 +36,8 @@
         <ws-button type="primary" @click="adopt" v-if="isShowAdopt">通过</ws-button>
         <ws-button type="primary" @click="invoicingClick" v-if="isShowAdopt"
           v-hasPermission="`acquisitionManagement.acquisitionPay.finace`">开票</ws-button>
+           <ws-button type="primary" @click="exportlist" v-if="isShowAdopt"
+          v-hasPermission="`acquisitionManagement.acquisitionPay.finace`">导出</ws-button>
         <!-- <ws-button type="primary" @click="handlepass" v-if="isShowAdopt">审核</ws-button> -->
         <ws-button type="primary" @click="payment" v-hasPermission="`acquisitionManagement.acquisitionPay.pay`">付款
         </ws-button>
@@ -244,6 +246,16 @@
   </div>
 </template>
 <script>
+import {
+    dayjs,
+    EventBus
+  } from 'base-core-lib'
+  import {
+    downloadFile
+  } from '@/utils/batchDown'
+  import {
+    export1,
+  } from '@/model/contarct/index'
   import {
     getpayment,
     selectWarehouseSelf,
@@ -328,7 +340,11 @@
         //上传截图路径
         imageUrl: '',
         payImg: [],
-        rowData: {}
+        rowData: {},
+        date: {
+          year: dayjs().format('YYYY'),
+          month: dayjs().format('MM'),
+        },
       }
     },
     activated() {
@@ -337,6 +353,34 @@
       // this.getList()
     },
     methods: {
+       async exportlist() {
+        console.log('导出数据', this.modification)
+        for (let i = 0; i < this.modification.length; i++) {
+          let {
+            data
+          } = await export1({
+            compId: sessionStorage.getItem('ws-pf_compId'),
+            contractType: this.contractType,
+            goodsType: this.goodsType,
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            searchType: this.searchType,
+            searchKeyWord: this.searchKeyWord,
+            startDate: this.startDate,
+            endDate: this.endDate,
+          }, {}, {
+            responseType: 'blob'
+          }).toPromise()
+          downloadFile({
+            res: data,
+            fileName: `${
+          this.date.year + (this.date.month ? `-${this.date.month}` : '')
+        }结算凭证`,
+            type: 'xls',
+          })
+        }
+
+      },
       invoicingClick() {
         // let data = JSON.stringify({
         //   paymentManagementList : this.modification