emis-frontend/src/views/emis/emisSettleBill/SiteInvoiceRecordApply.vue
2024-08-21 07:40:39 +08:00

114 lines
3.1 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="waitOpenBillList" >
<SiteWaitOpenBillPanel key="waitOpenBillList" confirmStatus="1" @onApply="onApply"> </SiteWaitOpenBillPanel>
</el-tab-pane>
<el-tab-pane label="开票申请记录" name="billList" >
<InvoiceRecordApplyListPanel key="billList" @onSelect="onSelectApply"> </InvoiceRecordApplyListPanel>
</el-tab-pane>
<el-tab-pane label="发票申请" name="applyPanel" v-if="selectBillList" >
<EmisSettleInvoiceRecordForm :billList="selectBillList" @on-changed="handleFormChanged" @on-cancel="cancelForm"></EmisSettleInvoiceRecordForm>
</el-tab-pane>
<el-tab-pane v-for="(item, index) in billTabs" :key="index" :name="item.applySeqNo" :label="'开票:'+item.applySeqNo" closable >
<InvoiceDetailPanel :id="item.id"></InvoiceDetailPanel>
</el-tab-pane>
</el-tabs>
</div>
</div>
</template>
<script>
import InvoiceRecordApplyListPanel from '@/views/emis/emisSettleInvoiceRecord/panel/InvoiceRecordApplyListPanel.vue';
import InvoiceDetailPanel from '@/views/emis/emisSettleInvoiceRecord/panel/InvoiceDetailPanel.vue';
import SiteWaitOpenBillPanel from '@/views/emis/emisSettleBill/panel/SiteWaitOpenBillPanel.vue';
import EmisSettleInvoiceRecordForm from '@/views/emis/emisSettleInvoiceRecord/emisSettleInvoiceRecordForm';
export default {
name: "SiteInvoiceRecordApply",
components: {
InvoiceRecordApplyListPanel,
InvoiceDetailPanel,
SiteWaitOpenBillPanel,
EmisSettleInvoiceRecordForm
},
dicts: [
],
data() {
return {
activeTab:'billList',
billTabs:[],
selectBillList:null,
};
},
created() {
},
methods: {
handleTabsClick(){
},
onSelectApply(item) {
let old=this.billTabs.find(mItem=>mItem.applySeqNo==item.applySeqNo);
if(old){
this.activeTab=item.applySeqNo;
}else{
this.billTabs.push(item);
this.activeTab=item.applySeqNo;
}
},
onApply(billList){
this.selectBillList=billList;
this.activeTab="applyPanel";
},
handleFormChanged(){
this.selectBillList=null;
this.activeTab="waitOpenBillList";
},
cancelForm(){
this.selectBillList=null;
this.activeTab="waitOpenBillList";
},
removeTab(targetName) {
var self=this;
let tabs = self.billTabs;
self.billTabs = tabs.filter(tab => tab.applySeqNo !== targetName);
if(self.billTabs.length>0){
this.activeTab=self.billTabs[self.billTabs.length-1].applySeqNo;
}else{
this.activeTab="billList";
}
},
}
};
</script>
<style lang="scss" scoped>
.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>