Browse Source

新增托盘详情导出

dev
qb 3 weeks ago
parent
commit
510e8855e6
  1. 12
      src/api/basicdata/basicdataTray.js
  2. 42
      src/views/basicdata/warehouse/tray/basicdataTrayedt.vue

12
src/api/basicdata/basicdataTray.js

@ -179,3 +179,15 @@ export const getWarehouseListqx = () => {
method: 'get',
});
};
/**
* 托盘详情导出
*/
export const getExportTrayData = params => {
return request({
url: '/api/logpm-basicdata/tray/exportTrayData',
method: 'get',
params,
responseType: 'blob',
});
};

42
src/views/basicdata/warehouse/tray/basicdataTrayedt.vue

@ -31,7 +31,11 @@
</el-col>
</el-row>
<el-divider> </el-divider>
<div class="flex export_row">
<el-divider class="flex1"> </el-divider>
<el-button icon="Download" type="primary" @click="handleExport">导出</el-button>
</div>
<el-tabs type="border-card" v-model="activeTab" @tab-click="handleTabClick">
<el-tab-pane label="包 件 列 表" name="tab1">
<!-- 列表模块 -->
@ -163,13 +167,14 @@ import {
getpackList,
getinventoryList,
getlclList,
getExportTrayData,
} from '@/api/basicdata/basicdataTray';
import option from '@/option/basic/basicPdarecords';
import { mapGetters } from 'vuex';
import { getDictionaryBiz } from '@/api/system/dict';
import dayjs from 'dayjs';
import { handleTranslationDataSeclect } from '@/utils/util';
import { handleTranslationDataSeclect, downloadXls } from '@/utils/util';
export default {
data() {
@ -827,7 +832,7 @@ export default {
// head: false,
// },
{
prop: 'positionCode',
prop: 'goodsAllocation',
label: '所在库位',
type: 30,
values: '',
@ -1482,6 +1487,37 @@ export default {
this.handleInventory(this.inventorypage);
this.loading = false;
},
/** 导出 */
async handleExport() {
console.log('this.traydata :>> ', this.traydata);
try {
this.loading = true;
const res = await getExportTrayData({ id: this.traydata.id });
const { status, data } = res;
if (status !== 200) return;
downloadXls(data, `${this.traydata.palletName} - 在托详情 - ${new Date().getTime()}.xlsx`);
} catch (error) {
console.log('error :>> ', error);
} finally {
this.loading = false;
}
},
},
};
</script>
<style lang="scss" scoped>
.export_row {
position: relative;
:deep(.el-button) {
position: absolute;
right: 0;
top: 50%;
transform: translateY(-50%);
}
}
</style>

Loading…
Cancel
Save