<template>
|
<el-container>
|
<el-main :style="{ padding: 0 }">
|
<div class="detail-header" v-if="flowno != 'ZBDEntInfoAlterFlow'">
|
<div class="header-right">
|
<div class="header-right-inner">
|
<div class="header-steps">
|
<HeaderSteps :serialNo="serialNo" :objectType="objectType"></HeaderSteps>
|
</div>
|
<div class="detail-header-control" v-if="moreIndex > -1">
|
<el-button size="small" @click="changeTab(moreIndex, true)">
|
更多详情
|
<i class="el-icon-arrow-right el-icon--right"></i>
|
</el-button>
|
</div>
|
</div>
|
</div>
|
</div>
|
<ScrollToTab
|
:tabId="`#${tabScroll}`"
|
:contentId="`#${contentScroll}`"
|
:tabIndex="tabIndex"
|
@changeTab="changeTab"
|
ref="scrollTab"
|
>
|
<div class="scroll-content">
|
<ul class="tab-scroll" :id="tabScroll" :style="{height: flowno != 'ZBDEntInfoAlterFlow'?`${clientHeight-102}px`:`${clientHeight}px`}">
|
<li class="back-section">
|
<el-button
|
v-if="from !== 'newCts' && !noBackBtn"
|
size="small"
|
icon="el-icon-back"
|
round
|
@click="goBack"
|
>返回列表</el-button>
|
</li>
|
<li
|
v-for="(item, index) in treeList"
|
:key="index"
|
@click="changeTab(index, true)"
|
class="tab-list"
|
:class="{active: tabIndex === index}"
|
>
|
<a>{{item.tabname}}</a>
|
</li>
|
</ul>
|
|
<ul
|
class="content-scroll"
|
:id="contentScroll"
|
:style="{height: flowno != 'ZBDEntInfoAlterFlow'?`${clientHeight-102}px`:`${clientHeight}px`}"
|
>
|
<li v-for="(item, index) in treeList" :key="index" class="content-list">
|
<div
|
class="scroll-inner"
|
:style="{minHeight: index === treeList.length - 1 ? `${clientHeight - 90}px` : 'auto'}"
|
>
|
<p class="scroll-title">{{item.tabname}}</p>
|
<div class="inner-content">
|
<TabContent
|
:info="item"
|
:serialNo="serialNo"
|
:objectType="objectType"
|
:customerID="customerID"
|
:flowno="flowno"
|
:occurType="occurType"
|
:alterobjectno="alterobjectno"
|
:canEdit="true"
|
></TabContent>
|
</div>
|
</div>
|
</li>
|
</ul>
|
</div>
|
</ScrollToTab>
|
</el-main>
|
</el-container>
|
</template>
|
<script>
|
/**
|
* 贷款申请查询详情页
|
*/
|
import {
|
queryTabTree,
|
queryZBDEntAlterTabTree
|
} from "@comprehensive/serve/public";
|
import TabContent from "./components/TabContent";
|
import HeaderSteps from "./components/HeaderSteps";
|
import ScrollToTab from "./components/ScrollToTab";
|
// 资方可查看菜单
|
const capitalTabTree = ['借款人信息', '物业信息', '贷款申请信息', '主/共借人征信信息', '影像资料信息', '还款计划', '还款入账记录', '电子合同信息']
|
|
export default {
|
components: {
|
TabContent,
|
HeaderSteps,
|
ScrollToTab
|
},
|
data() {
|
return {
|
from: "",
|
noBackBtn: "",
|
serialNo: "",
|
objectType: "",
|
customerID: "",
|
flowno: "",
|
alterobjectno: "",
|
treeList: [],
|
loading: false,
|
tabIndex: 0,
|
moreIndex: -1,
|
clientHeight: 600,
|
tabScroll: "tab_scroll",
|
contentScroll: "content_scroll"
|
};
|
},
|
created() {
|
this.init();
|
},
|
mounted() {
|
this.setEleHeight();
|
window.addEventListener("resize", this.setEleHeight);
|
},
|
methods: {
|
init() {
|
const {
|
menuId,
|
from,
|
flowno,
|
objectType,
|
customerID,
|
customerId,
|
occurType,
|
alterobjectno,
|
noBackBtn,
|
} = this.$route.query;
|
if (!parent.g_menu_id && menuId) {
|
parent.g_menu_id = menuId;
|
}
|
this.serialNo = this.$route.params.id;
|
|
this.noBackBtn = noBackBtn;
|
this.from = from;
|
this.objectType = objectType;
|
this.occurType = occurType;
|
this.alterobjectno = alterobjectno
|
// 命名兼容处理
|
this.customerID = customerID || customerId;
|
|
// 默认案场
|
this.flowno = flowno;
|
this.tabIndex = 0;
|
this.moreIndex = -1;
|
this.queryTabTree();
|
},
|
|
setEleHeight() {
|
const clientHeight = document.documentElement.clientHeight;
|
this.clientHeight = clientHeight || 600;
|
},
|
|
// 查询流程详情
|
async queryTabTree() {
|
let { serialNo, objectType, tabIndex, $route } = this;
|
const { tabName: queryTabName, flowno, alterobjecttype, source } = $route.query;
|
this.loading = true;
|
const obj = {
|
objectno: serialNo,
|
objecttype: objectType
|
};
|
const res =
|
flowno == "ZBDEntInfoAlterFlow"
|
? await queryZBDEntAlterTabTree({ alterobjecttype : flowno, ...obj })
|
: await queryTabTree(obj);
|
this.loading = false;
|
let { result } = res;
|
// 资方查询限制查看权限
|
if(source === 'capital') {
|
result = result.filter(item =>{
|
return capitalTabTree.includes(item.tabname)
|
});
|
}
|
this.treeList = result;
|
this.moreIndex =
|
result.findIndex(({ tabname }) => tabname === "流程流转记录") || 0;
|
|
if (queryTabName) {
|
tabIndex =
|
result.findIndex(({ tabname }) => tabname === queryTabName) || 0;
|
}
|
this.$nextTick(() => this.changeTab(tabIndex));
|
},
|
|
// 切换tab的处理
|
changeTab(index, flg = false) {
|
this.tabIndex = index;
|
this.$refs.scrollTab.setScrollTop(index, flg);
|
this.$nextTick(() => this.$refs.scrollTab.setTabScrollTop());
|
},
|
|
// 返回列表
|
goBack() {
|
const { from } = this;
|
if (from === "mal") {
|
window.history.go(-1);
|
} else {
|
this.$router.replace({
|
path: this.$store.state.product.detailBackRoute
|
});
|
}
|
}
|
},
|
computed: {
|
currTabItem() {
|
let { tabIndex, treeList } = this;
|
return treeList[tabIndex] || {};
|
}
|
},
|
watch: {
|
$route() {
|
this.init();
|
}
|
},
|
beforeRouteEnter(to, from, next) {
|
console.log('beforeRouteEnter',to,from,next)
|
next(vm => {
|
vm.$store.commit("SET_detailBackRoute", from.path);
|
});
|
},
|
beforeDestroy() {
|
window.removeEventListener("resize", this.setEleHeight);
|
}
|
};
|
</script>
|
|
<style lang="postcss" scoped>
|
.detail-header {
|
display: flex;
|
& .header-right {
|
flex: 1;
|
}
|
& .header-right-inner {
|
display: flex;
|
background: #f9f9f9;
|
align-items: center;
|
margin: 0 0 10px;
|
background: #fff;
|
padding: 20px 20px 20px 10px;
|
box-shadow: 0px 0px 10px 4px rgba(0, 0, 0, 0.03);
|
& .header-steps {
|
flex: 1;
|
}
|
& .detail-header-control {
|
margin-left: 30px;
|
& >>> .el-button {
|
padding: 4px 5px;
|
border-radius: 2px;
|
border: 1px solid rgba(238, 238, 238, 1);
|
font-size: 12px;
|
color: rgba(119, 119, 119, 1);
|
}
|
}
|
|
& >>> .el-button--text {
|
padding-top: 20px;
|
}
|
}
|
}
|
|
.el-container .el-main {
|
padding: 16px 0;
|
}
|
.el-container .el-header {
|
padding: 0;
|
}
|
.main-tab {
|
padding: 20px;
|
}
|
.main-buttons {
|
display: flex;
|
width: 100%;
|
justify-content: center;
|
padding-top: 80px;
|
& >>> .el-button {
|
padding: 8px 41px;
|
}
|
& >>> .el-button--default {
|
margin-right: 33px;
|
}
|
}
|
.empty-tab {
|
width: 100%;
|
min-height: 550px;
|
}
|
|
.scroll-content {
|
display: flex;
|
& .tab-scroll {
|
width: 128px;
|
padding: 0 16px;
|
overflow-y: auto;
|
list-style: none;
|
font-size: 14px;
|
background: #fff;
|
&::-webkit-scrollbar {
|
width: 0px;
|
height: 10px;
|
}
|
& .tab-list {
|
padding: 0 10px 34px 0;
|
& a {
|
cursor: pointer;
|
font-weight: 400;
|
color: #222222;
|
&:hover {
|
color: #409eff;
|
}
|
}
|
|
&.active {
|
& a {
|
color: #0081f0;
|
}
|
}
|
}
|
& .back-section {
|
background: #fff;
|
border-radius: 0px 4px 0px 0px;
|
padding: 16px 16px 30px 0;
|
& >>> .el-button {
|
padding: 5px 9.5px;
|
border: none;
|
background: rgba(238, 238, 238, 1);
|
border-radius: 12px;
|
font-weight: 400;
|
color: #333333;
|
}
|
& >>> .el-button span {
|
margin-left: 2px;
|
font-size: 12px;
|
}
|
& >>> .el-button i {
|
font-weight: bold;
|
}
|
}
|
}
|
& .content-scroll {
|
flex: 1;
|
overflow-y: auto;
|
position: relative;
|
margin: 0 0 0 20px;
|
& .scroll-inner {
|
background: #fff;
|
box-shadow: 0px 0px 10px 4px rgba(0, 0, 0, 0.03);
|
margin-bottom: 20px;
|
& .scroll-title {
|
font-size: 16px;
|
border-bottom: solid 2px #eeeeee;
|
color: #000;
|
padding: 16px 20px;
|
margin-bottom: 10px;
|
font-weight: 500;
|
}
|
& .inner-content {
|
padding: 0 0 20px 20px;
|
& >>> .el-tabs__header {
|
margin: 0;
|
}
|
}
|
}
|
&::-webkit-scrollbar {
|
width: 0;
|
height: 10px;
|
}
|
& .last-scroll-inner {
|
min-height: 620px;
|
}
|
}
|
}
|
</style>
|