소스 검색

feat(仓库管理): 添加收发明细表导出功能并区分统计和明细导出

liujt 6 달 전
부모
커밋
9273311603
2개의 변경된 파일14개의 추가작업 그리고 4개의 파일을 삭제
  1. 8 0
      src/api/warehouseManagement/statisticalReports.js
  2. 6 4
      src/views/warehouseManagement/statisticalReports/transceiverDetails/add.vue

+ 8 - 0
src/api/warehouseManagement/statisticalReports.js

@@ -49,6 +49,14 @@ export async function sendReceiveExcel(params) {
   return res.data;
   return res.data;
 }
 }
 
 
+// 收发明细表新
+export async function sendReceiveDetailListExcel(params) {
+  const res = await request.post(`/wms/statement/sendReceiveDetailListExcel`, params, {
+    responseType: 'blob'
+  });
+  return res.data;
+}
+
 // 收发汇总表
 // 收发汇总表
 export async function sendReceiveGatherExcel(params) {
 export async function sendReceiveGatherExcel(params) {
   const queryString = new URLSearchParams(params).toString();
   const queryString = new URLSearchParams(params).toString();

+ 6 - 4
src/views/warehouseManagement/statisticalReports/transceiverDetails/add.vue

@@ -114,7 +114,7 @@
       <el-button
       <el-button
         v-if="!isView"
         v-if="!isView"
         size="small"
         size="small"
-        @click="downLoad"
+        @click="downLoad('statistics')"
         :loading="loading"
         :loading="loading"
         type="primary"
         type="primary"
         >统计导出</el-button
         >统计导出</el-button
@@ -122,7 +122,7 @@
       <el-button
       <el-button
         v-if="!isView"
         v-if="!isView"
         size="small"
         size="small"
-        @click="downLoad"
+        @click="downLoad('detail')"
         :loading="loading"
         :loading="loading"
         type="primary"
         type="primary"
         >明细导出</el-button
         >明细导出</el-button
@@ -140,6 +140,7 @@
   import ItemSearch from './components/item-search.vue';
   import ItemSearch from './components/item-search.vue';
   import {
   import {
     sendReceiveExcel,
     sendReceiveExcel,
+    sendReceiveDetailListExcel,
     outintwoPage
     outintwoPage
   } from '@/api/warehouseManagement/statisticalReports';
   } from '@/api/warehouseManagement/statisticalReports';
   import storageApi from '@/api/warehouseManagement';
   import storageApi from '@/api/warehouseManagement';
@@ -511,7 +512,7 @@
         });
         });
         return `${obj.year}-${obj.month}-${obj.strDate}`;
         return `${obj.year}-${obj.month}-${obj.strDate}`;
       },
       },
-      downLoad() {
+      downLoad(type) {
         if (!this.formData.name) {
         if (!this.formData.name) {
           return this.$message.error('请输入名称');
           return this.$message.error('请输入名称');
         }
         }
@@ -525,7 +526,8 @@
           params.endTime = params.time[1];
           params.endTime = params.time[1];
         }
         }
         delete params.time;
         delete params.time;
-        sendReceiveExcel(params).then((data) => {
+        const requestApi = type == 'statistics' ? sendReceiveExcel : sendReceiveDetailListExcel;
+        requestApi(params).then((data) => {
           try {
           try {
             let objectUrl1 = window.URL.createObjectURL(new Blob([data]));
             let objectUrl1 = window.URL.createObjectURL(new Blob([data]));
             let elink = document.createElement('a');
             let elink = document.createElement('a');