Bladeren bron

调拨明细导出

chenrui 3 jaren geleden
bovenliggende
commit
987ee34b23

+ 9 - 0
src/api/allocateBill.js

@@ -158,3 +158,12 @@ export const allocateBillFailExcel = (params) => {
     responseType: 'blob'
   })
 }
+//  调拨 详情  导出
+export const allocateBillDetailExcel = (params) => {
+  return axios({
+    url: '/allocateBill/detail/exportExcel',
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}

+ 21 - 2
src/views/allocationManagement/transferOut/detail.vue

@@ -14,11 +14,20 @@
             @click.stop="handleEdit">编辑</a-button>
         </template>
         <!-- 操作区,位于 title 行的行尾 -->
-        <template v-if="$hasPermissions('B_transferOut_print')" slot="extra">
+        <template slot="extra">
+          <a-button
+            key="3"
+            type="primary"
+            class="button-warning"
+            v-if="$hasPermissions('B_transferOut_detail_export')"
+            id="allocateBillDetail-export-btn"
+            :disabled="localDataSource.length==0"
+            @click="handleExcel">导出Excel</a-button>
           <a-button
             key="2"
             type="primary"
             class="button-error"
+            v-if="$hasPermissions('B_transferOut_print')"
             id="allocateBillDetail-db-print-btn"
             :disabled="localDataSource.length==0"
             @click="handlePrint('dbPrint')">调拨打印</a-button>
@@ -26,6 +35,7 @@
             key="1"
             type="primary"
             class="button-info"
+            v-if="$hasPermissions('B_transferOut_print')"
             id="allocateBillDetail-dbfl-print-btn"
             :disabled="localDataSource.length==0"
             @click="handlePrint('dbflPrint')">调拨分类打印</a-button>
@@ -80,7 +90,8 @@
 <script>
 import { STable, VSelect } from '@/components'
 import printModal from './printModal.vue'
-import { allocateBillDetailList, allocateBillDetail, allocateBillDetailCount, allocateBillDetailPrint } from '@/api/allocateBill'
+import { hdExportExcel } from '@/libs/exportExcel'
+import { allocateBillDetailList, allocateBillDetail, allocateBillDetailCount, allocateBillDetailPrint, allocateBillDetailExcel } from '@/api/allocateBill'
 export default {
   components: { STable, VSelect, printModal },
   props: {
@@ -164,6 +175,14 @@ export default {
     handleEdit () {
       this.$router.push({ path: `/allocationManagement/transferOut/edit/${this.basicInfoData.allocateSn}/${this.basicInfoData.dealerLevel}` })
     },
+    // 导出
+    handleExcel () {
+      const _this = this
+      this.spinning = true
+      hdExportExcel(allocateBillDetailExcel, { allocateSn: this.outBizSn || this.$route.params.sn }, '调拨明细', function () {
+        _this.spinning = false
+      })
+    },
     // 打印预览/快捷打印
     handlePrint (type) {
       this.nowType = type

+ 21 - 2
src/views/allocationManagement/transferOut/edit.vue

@@ -8,11 +8,20 @@
           <a id="allocateBillEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
         </template>
         <!-- 操作区,位于 title 行的行尾 -->
-        <template v-if="$hasPermissions('B_transferOut_print')" slot="extra">
+        <template slot="extra">
+          <a-button
+            key="3"
+            type="primary"
+            class="button-warning"
+            v-if="$hasPermissions('B_transferOut_detail_export')"
+            id="allocateBillEdit-export-btn"
+            :disabled="localDataSource.length==0"
+            @click="handleExcel">导出Excel</a-button>
           <a-button
             key="2"
             type="primary"
             class="button-error"
+            v-if="$hasPermissions('B_transferOut_print')"
             id="allocateBillEdit-db-print-btn"
             :disabled="localDataSource.length==0"
             @click="handlePrint('dbPrint')">调拨打印</a-button>
@@ -20,6 +29,7 @@
             key="1"
             type="primary"
             class="button-info"
+            v-if="$hasPermissions('B_transferOut_print')"
             id="allocateBillEdit-dbfl-print-btn"
             :disabled="localDataSource.length==0"
             @click="handlePrint('dbflPrint')">调拨分类打印</a-button>
@@ -217,10 +227,11 @@
 import { STable, VSelect } from '@/components'
 import ImportGuideModal from './importGuideModal.vue'
 import printModal from './printModal.vue'
+import { hdExportExcel } from '@/libs/exportExcel'
 import { queryStockProductPage } from '@/api/stock'
 import { productPriceInfo } from '@/api/product'
 import AllocateType from '@/views/common/allocateType.js'
-import { allocateBillSave, allocateBillDetailList, allocateBillDetailCount, allocateBillDetail, allocateBillDetailSave, allocateBillSubmit, allocateBillDetailDel, allocateBillDetailDelAll, allocateBillDetailPrint, allocateBillBatchInsert } from '@/api/allocateBill'
+import { allocateBillSave, allocateBillDetailList, allocateBillDetailCount, allocateBillDetail, allocateBillDetailSave, allocateBillSubmit, allocateBillDetailDel, allocateBillDetailDelAll, allocateBillDetailPrint, allocateBillBatchInsert, allocateBillDetailExcel } from '@/api/allocateBill'
 
 export default {
   components: { STable, VSelect, ImportGuideModal, AllocateType, printModal },
@@ -510,6 +521,14 @@ export default {
         })
       }
     },
+    // 导出
+    handleExcel () {
+      const _this = this
+      this.spinning = true
+      hdExportExcel(allocateBillDetailExcel, { allocateSn: this.$route.params.sn }, '调拨明细', function () {
+        _this.spinning = false
+      })
+    },
     // 打印预览/快捷打印
     handlePrint (type) {
       this.nowType = type