Bladeren bron

修改bug

chenrui 2 jaren geleden
bovenliggende
commit
ec49e5dc21

+ 2 - 20
src/views/purchasingManagement/purchaseOutOfStock/detailModal.vue

@@ -10,13 +10,6 @@
     :width="960">
     <a-spin :spinning="spinning" tip="Loading...">
       <!-- 基础信息 -->
-      <div style="text-align:right;margin-bottom:10px;"><a-button
-        type="primary"
-        style="margin-left: 5px"
-        @click="handleExport"
-        :disabled="disabled"
-        :loading="exportLoading"
-        id="inventoryWarningList-export-btn">导出</a-button></div>
       <a-card size="small" :bordered="false" class="purchaseReturnDetail-cont">
         <a-collapse :activeKey="['1']">
           <a-collapse-panel key="1" header="基础信息">
@@ -57,8 +50,7 @@
 <script>
 import { commonMixin } from '@/utils/mixin'
 import { STable } from '@/components'
-import { outOfStockExportDetail, outOfStockDetailList } from '@/api/oos'
-import { downloadExcel } from '@/libs/JGPrint.js'
+import { outOfStockDetailList } from '@/api/oos'
 export default {
   name: 'DetailModal',
   components: { STable },
@@ -116,21 +108,11 @@ export default {
           return data
         })
       },
-      exportLoading: false, // 导出loading
       disabled: false //  查询、重置按钮是否可操作
     }
   },
   methods: {
-    // 导出
-    handleExport () {
-      const _this = this
-      _this.exportLoading = true
-      outOfStockExportDetail({ purchaseBillSn: this.objItem && this.objItem.purchaseBillSn || '' }).then(res => {
-        downloadExcel(res, '采购缺货列表')
-        _this.exportLoading = false
-      })
-    },
-    // 合计
+    // 获取表格数据
     pageInit () {
       this.$refs.table.refresh(true)
     }

+ 19 - 1
src/views/purchasingManagement/purchaseOutOfStock/list.vue

@@ -18,6 +18,13 @@
             <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
               <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="purchaseOutOfStock-refresh">查询</a-button>
               <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="purchaseOutOfStock-reset">重置</a-button>
+              <a-button
+                type="primary"
+                style="margin-left: 5px"
+                @click="handleExport"
+                :disabled="disabled"
+                :loading="exportLoading"
+                id="inventoryWarningList-export-btn">导出</a-button>
             </a-col>
           </a-row>
         </a-form>
@@ -54,9 +61,10 @@
 import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
-import { outOfStockList } from '@/api/oos'
+import { outOfStockList, outOfStockExportDetail } from '@/api/oos'
 import custList from '@/views/common/custList.vue'
 import detailModal from './detailModal.vue'
+import { downloadExcel } from '@/libs/JGPrint.js'
 export default {
   name: 'PurchaseOutOfStock',
   components: { STable, VSelect, rangeDate, custList, detailModal },
@@ -74,6 +82,7 @@ export default {
       disabled: false, //  查询、重置按钮是否可操作
       tableHeight: 0,
       time: [],
+      exportLoading: false, // 导出loading
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -111,6 +120,15 @@ export default {
     }
   },
   methods: {
+    // 导出
+    handleExport () {
+      const _this = this
+      _this.exportLoading = true
+      outOfStockExportDetail(_this.queryParam).then(res => {
+        downloadExcel(res, '采购缺货列表')
+        _this.exportLoading = false
+      })
+    },
     // 关闭详情弹窗
     closeModal () {
       this.openModal = false