<template>
|
<div class="comm-page">
|
<div class="form-content">
|
<FormList
|
:info="formInfo"
|
:isShowDetail="isShowDetail"
|
@handleClick="isShowDetail = !isShowDetail"
|
@updateValue="updateValue"
|
@onSubmit="onSubmit"
|
@setValueInfo="setValueInfo"
|
></FormList>
|
</div>
|
|
<div class="list-content">
|
<TableList
|
:pageInfo="pageInfo"
|
@doAction="doAction"
|
@handleCurrentChange="handleCurrentChange"
|
@handleSizeChange="handleSizeChange"
|
:isAutoIndex="true"
|
:list="records"
|
:header="tableHeader"
|
:loading="loading"
|
></TableList>
|
</div>
|
</div>
|
</template>
|
|
<script>
|
/**
|
* 贷款申请资料补传
|
*/
|
import TableList from "@comprehensive/components/TableList";
|
import FormList from "@comprehensive/components/FormList";
|
|
import { supplementLoanHeader } from '@comprehensive/utils/tableHeaders'
|
import { supplementLoanSearch } from '@comprehensive/utils/formItems'
|
|
import {
|
qryProdList,
|
qryDimensionList,
|
qryFlowPhaseList,
|
qryCredentialsUploadList
|
} from "@comprehensive/serve/public";
|
|
export default {
|
components: {
|
FormList,
|
TableList
|
},
|
data() {
|
return {
|
records:[],
|
valueInfo: {},
|
pageInfo: {
|
turnFlag:0,
|
currentPage: 1,
|
pageSize: 10,
|
},
|
isShowDetail:false,
|
loading:false,
|
formInfo: [...supplementLoanSearch],
|
tableHeader: [...supplementLoanHeader],
|
}
|
},
|
activated () {
|
this.init()
|
},
|
methods: {
|
// 页面初始化处理
|
init() {
|
const { formInfo } = this;
|
|
if (formInfo.some(({ name }) => name === "productId")) {
|
this.qryProdList();
|
}
|
|
if (formInfo.some(({ name }) => name === "productDimension")) {
|
this.qryDimensionList();
|
}
|
|
if (formInfo.some(({ name }) => name === "phaseNo")) {
|
this.qryFlowPhaseList();
|
}
|
|
this.qryCredentialsUploadList();
|
},
|
|
// 表单事件触发
|
async doAction(name, item, { label }){
|
if (name === "lastAction") {
|
const { objectType } = item;
|
const detailInfo = { ...item, objecttype: objectType };
|
|
if(label == '详情'){
|
this.toDetail(detailInfo)
|
}
|
|
if(label == '资料补传'){
|
this.supplement(detailInfo)
|
}
|
}
|
},
|
|
// 跳转到详情页
|
toDetail(result) {
|
const {
|
serialNo,
|
flowNo,
|
customerId,
|
objectType,
|
occurType,
|
productId
|
} = result;
|
|
this.$router.push(
|
`/comprehensiveTransaction/loanDetail/${serialNo}?occurType=${occurType}&flowno=${flowNo}&objectType=${objectType}&customerID=${customerId}&productID=${productId}&`
|
);
|
},
|
|
// 跳转到资料补传页面
|
supplement(detailInfo){
|
this.$store.commit("SET_applyInfo", detailInfo);
|
this.$router.push({ path: "/supplement" });
|
},
|
|
// 获取当前数据列表
|
async qryCredentialsUploadList() {
|
this.loading = true;
|
let { valueInfo, pageInfo } = this;
|
let type = this.$route.query.type || ''
|
if(type && type=='1'){
|
valueInfo.productId ='JMSJYD'
|
}
|
const res = await qryCredentialsUploadList({
|
...valueInfo,
|
...pageInfo
|
});
|
const { records = [], total } = res.result;
|
this.loading = false;
|
this.records = records.reduce((pre, curr) => {
|
let arr = [];
|
// 贷款期限处理
|
let {
|
detailFlag,
|
uploadlFlag
|
} = curr;
|
if(detailFlag == '1'){
|
arr.push({ label: "详情" });
|
}
|
if(uploadlFlag == '1'){
|
arr.push({ label: "资料补传" });
|
}
|
let sortButtons = [
|
"资料补传",
|
"详情"
|
];
|
arr = this.getSortButtons(sortButtons, arr);
|
pre.push({
|
...curr,
|
buttons: [...arr],
|
});
|
|
return pre;
|
}, []);
|
|
this.pageInfo = {
|
...pageInfo,
|
total
|
};
|
},
|
|
// 按钮顺序排序
|
getSortButtons(sortButtons, arr) {
|
return sortButtons.reduce((pre, curr) => {
|
const item = arr.find(({ label }) => label === curr);
|
if (item) {
|
pre.push({ ...item });
|
}
|
return pre;
|
}, []);
|
},
|
|
// 当前流程阶段下拉列表
|
async qryFlowPhaseList() {
|
const res = await qryFlowPhaseList({});
|
const { result } = res;
|
this.setOrGetFormInfo("phaseNo", { options: result });
|
},
|
|
// 产品名称下拉列表
|
async qryProdList() {
|
const res = await qryProdList({ productTypeNo: "" });
|
const { result } = res;
|
this.setOrGetFormInfo("productId", { options: result });
|
},
|
|
// 产品维度下拉列表
|
async qryDimensionList() {
|
const { valueInfo } = this;
|
let { productId = "" } = valueInfo;
|
const res = await qryDimensionList({ productid : productId });
|
const { result } = res;
|
this.setOrGetFormInfo("productDimension", { options: result });
|
},
|
|
// 设置表单结果数据
|
setValueInfo(info = {}) {
|
this.valueInfo = info;
|
},
|
|
// 更新数据
|
updateValue(value, item) {
|
let { name } = item;
|
this.setOrGetFormInfo(name, { value });
|
if (name === "productId") {
|
this.qryDimensionList();
|
}
|
},
|
|
// 查询
|
onSubmit(){
|
this.pageInfo.currentPage = 1;
|
this.qryCredentialsUploadList();
|
},
|
|
// 更新表单数据或查找某项数据
|
setOrGetFormInfo(nameKey, newInfo) {
|
let { formInfo } = this
|
let index = formInfo.findIndex(({ name }) => name === nameKey)
|
let result = {}
|
if (!isNaN(index)) {
|
this.$set(this.formInfo, index, { ...formInfo[index], ...newInfo })
|
result = this.formInfo[index]
|
}
|
if (typeof newInfo === 'undefined') {
|
return result
|
}
|
},
|
|
// 修改翻页条数
|
handleSizeChange(val) {
|
this.pageInfo.pageSize = val;
|
this.qryCredentialsUploadList();
|
},
|
|
// 修改翻页数
|
handleCurrentChange(val) {
|
this.pageInfo.currentPage = val;
|
this.qryCredentialsUploadList();
|
},
|
|
}
|
}
|
</script>
|