This commit is contained in:
liuye
2022-04-07 19:47:59 +08:00
parent 478b4025a7
commit dc27ac30e9
6 changed files with 122 additions and 16 deletions

View File

@@ -1,6 +1,21 @@
<template>
<section class="AppFinancingNeeds">
<component :is="currentComponent" :instance="instance" :dict="dict" :permissions="permissions"/>
<ai-list v-if="showList">
<template slot="title">
<ai-title title="融资需求" :isShowBottomBorder="false"></ai-title>
</template>
<template slot="tabs">
<el-tabs class="tabs-page" v-model="currIndex">
<el-tab-pane v-for="(tab,i) in tabs" :key="i" :label="tab.label" :name="String(i)">
<component :is="tab.comp" v-if="currIndex==i" :ref="currIndex" :instance="instance" :dict="dict"
:permissions="permissions" :listType="tab.value" @goPage="goPage"/>
</el-tab-pane>
</el-tabs>
</template>
</ai-list>
<component v-if="!showList" :is="currentPage" :instance="instance" :dict="dict"
:permissions="permissions" :row="detail" @goBack="goBack"></component>
<!-- <component :is="currentComponent" :instance="instance" :dict="dict" :permissions="permissions"/> -->
</section>
</template>
@@ -8,6 +23,7 @@
import NeedsDetail from "./needsDetail";
import NeedsList from "./needsList";
import NeedsStatistics from "./needsStatistics";
export default {
name: "AppFinancingNeeds",
@@ -18,13 +34,51 @@ export default {
dict: Object,
permissions: Function
},
provide() {
return {
need: this
}
},
data() {
return {
currIndex: '0',
showList: true,
currentPage: "",
detail: {},
}
},
computed: {
currentComponent() {
return !!this.$route.query.id ? NeedsDetail : NeedsList
tabs() {
return [
{
label: "融资需求", name: "NeedsList", value: "0", comp: NeedsList, detail: NeedsDetail,
permission: ""
},
{
label: "融资统计", name: "NeedsStatistics", value: "1", comp: NeedsStatistics,
permission: ""
}
]
},
currentTab() {
return this.tabs[this.currIndex] || {}
}
},
created() {
this.dict.load("productRepaymentTimeline", "financialFundPurpose","financingDemandApplyType")
},
methods: {
goPage(obj) {
this.currentPage = this.tabs[Number(this.currIndex)][obj.key];
obj.row && (this.detail = obj.row)
this.showList = false;
},
goBack() {
this.showList = true;
this.$nextTick(() => {
this.$refs[this.currIndex][0].getTableData();
})
},
}
}
</script>