Przeglądaj źródła

Merge branch 'dev' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend-wms into dev

yusheng 6 miesięcy temu
rodzic
commit
f8d57890ba

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

@@ -49,6 +49,14 @@ export async function sendReceiveExcel(params) {
   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) {
   const queryString = new URLSearchParams(params).toString();

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

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