emis-frontend/src/views/emis/emisWarehouseIn/WarehouseInList.vue
2026-03-20 14:21:26 +08:00

145 lines
3.9 KiB
Vue

<template>
<div class="app-container">
<div class="tab-container">
<el-tabs v-model="activeTab" class="center-tabs" @tab-click="handleTabsClick" @tab-remove="removeTab">
<el-tab-pane label="进仓单" name="billList" >
<WarehouseInPanel ref="billPanel" @onSelect="onSelectBill" @onStockIn="onStockIn" @onBatchStockIn="onBatchStockIn"> </WarehouseInPanel>
</el-tab-pane>
<el-tab-pane label="收货入仓" name="wsInPanel" v-if="showWsInPanel" closable>
<WarehouseStockIn :key="selectInNo" :inNo="selectInNo"></WarehouseStockIn>
</el-tab-pane>
<!-- <el-tab-pane v-for="(item, index) in billTabs" :key="index" :name="item.inNo" :label="'进仓单:'+item.inNo" closable >
<WarehouseInBatchPanel :inNo="item.inNo"></WarehouseInBatchPanel>
</el-tab-pane> -->
<el-tab-pane label="合并进仓" name="wsInBatchPanel" v-if="showWsInBatchPanel" closable>
<WarehouseStockInBatch :key="selectInNo" :inNos="selectInNos" @on-changed="onBatchStockInChanged"></WarehouseStockInBatch>
</el-tab-pane>
<el-tab-pane label="查看进仓详情" name="wsInView" v-if="openViewForm" closable >
<WarehouseInBatchPanel :key="'batchView_'+selectInNo" :inNo="selectInNo"></WarehouseInBatchPanel>
</el-tab-pane>
</el-tabs>
</div>
</div>
</template>
<script>
import WarehouseInPanel from '@/views/emis/emisWarehouseIn/panel/WarehouseInPanel.vue';
import WarehouseInBatchPanel from '@/views/emis/emisWarehouseInBatch/WarehouseInBatchPanel.vue';
import WarehouseStockIn from '@/views/emis/emisWarehouseInBatch/WarehouseStockIn.vue';
import WarehouseStockInBatch from '@/views/emis/emisWarehouseInBatch/WarehouseStockInBatch.vue';
export default {
name: "WarehouseInList",
components: {
WarehouseInPanel,
WarehouseInBatchPanel,
WarehouseStockIn,
WarehouseStockInBatch,
},
dicts: [
],
data() {
return {
activeTab:'billList',
billTabs:[],
showWsInPanel:false,
showWsInBatchPanel:false,
selectInNo:null,
selectInNos:[],
openViewForm:false,
};
},
created() {
},
methods: {
handleTabsClick(){
},
onStockIn(inNo){
this.selectInNo=inNo;
this.showWsInPanel=true;
this.activeTab='wsInPanel';
},
onBatchStockIn(list){
this.selectInNos=list.map(item=>item.inNo);
this.showWsInBatchPanel=true;
this.activeTab='wsInBatchPanel';
},
onSelectBill(item) {
// let old=this.billTabs.find(mItem=>mItem.inNo==item.inNo);
// if(old){
// this.activeTab=item.inNo;
// }else{
// this.billTabs.push(item);
// this.activeTab=item.inNo;
// }
this.selectInNo=item.inNo;
this.openViewForm=true;
this.activeTab='wsInView';
},
removeTab(targetName) {
if(targetName=='wsInPanel'){
this.showWsInPanel=false;
this.activeTab="billList";
}
else if(targetName=='wsInView'){
this.openViewForm=false;
this.activeTab="billList";
}
else if(targetName=='wsInBatchPanel'){
this.showWsInBatchPanel=false;
this.activeTab="billList";
}
else{
var self=this;
let tabs = self.billTabs;
self.billTabs = tabs.filter(tab => tab.inNo !== targetName);
if(self.billTabs.length>0){
this.activeTab=self.billTabs[self.billTabs.length-1].inNo;
}else{
this.activeTab="billList";
}
}
},
onBatchStockInChanged(){
//刷新进仓单列表
this.removeTab('wsInBatchPanel');
this.$refs.billPanel.getList();
},
}
};
</script>
<style>
.el-descriptions-item__label {
width: 80px;
}
.el-descriptions-item__cell {
font-weight: 500!important;
color: black;
}
.tab-container {
width: 100%;
}
.el-tabs__nav{
display: flex !important;
flex-wrap: wrap !important;
}
</style>