浏览代码

调拨 导出

chenrui 3 年之前
父节点
当前提交
f16bd55677
共有 1 个文件被更改,包括 8 次插入19 次删除
  1. 8 19
      src/views/allocationManagement/transferOut/list.vue

+ 8 - 19
src/views/allocationManagement/transferOut/list.vue

@@ -42,14 +42,14 @@
             <a-col :md="6" :sm="24">
               <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="allocateBillList-refresh">查询</a-button>
               <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="allocateBillList-reset">重置</a-button>
-              <!-- <a-button
-                style="margin: 0 0 18px 5px"
+              <a-button
+                style="margin-left: 5px"
                 type="primary"
                 class="button-warning"
                 @click="handleExport"
                 :disabled="disabled"
                 :loading="exportLoading"
-                id="allocateBillList-export">导出</a-button> -->
+                id="allocateBillList-export">导出</a-button>
               <a @click="advanced=!advanced" style="margin-left: 5px">
                 {{ advanced ? '收起' : '展开' }}
                 <a-icon :type="advanced ? 'up' : 'down'"/>
@@ -121,6 +121,7 @@ import rangeDate from '@/views/common/rangeDate.vue'
 import auditModal from '@/views/common/auditModal.vue'
 import { allocateBillList, allocateBillDel, allocateBillAudit, allocateBillExport } from '@/api/allocateBill'
 import AllocateType from '@/views/common/allocateType.js'
+import { hdExportExcel } from '@/libs/exportExcel'
 export default {
   components: { STable, VSelect, basicInfoModal, rangeDate, auditModal, AllocateType },
   data () {
@@ -261,27 +262,15 @@ export default {
     },
     //  导出
     handleExport () {
+      const _this = this
       const params = this.queryParam
       this.exportLoading = true
       this.spinning = true
-      allocateBillExport(params).then(res => {
-        this.exportLoading = false
-        this.download(res)
-        this.spinning = false
+      hdExportExcel(allocateBillExport, params, '调拨列表', function () {
+        _this.exportLoading = false
+        _this.spinning = false
       })
     },
-    download (data) {
-      if (!data) { return }
-      const url = window.URL.createObjectURL(new Blob([data]))
-      const link = document.createElement('a')
-      link.style.display = 'none'
-      link.href = url
-      const a = moment().format('YYYYMMDDHHmmss')
-      const fname = '调拨列表' + a
-      link.setAttribute('download', fname + '.xlsx')
-      document.body.appendChild(link)
-      link.click()
-    },
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调