<!-- 风控报告存量资产逾期明细 -->
|
<template>
|
<div>
|
<div class="form-content">
|
<FormList
|
:info="formInfo"
|
:isShowDetail="isShowDetail"
|
@handleClick="isShowDetail = !isShowDetail"
|
@updateValue="updateValue"
|
@onSubmit="onSubmit"
|
@setValueInfo="setValueInfo"
|
:isChangeArray="false"
|
@resetValue="resetValue"
|
></FormList>
|
</div>
|
<p class="export-excle">
|
<span>
|
<el-button
|
size="small"
|
type="primary"
|
:loading="excelLoading"
|
@click="batchEntrustExternal"
|
>导出excel</el-button
|
>
|
</span>
|
</p>
|
<div class="list-content">
|
<TableList
|
:pageInfo="pageInfo"
|
@doAction="doAction"
|
@handleCurrentChange="handleCurrentChange"
|
@handleSizeChange="handleSizeChange"
|
@handleSelectionChange="handleSelectionChange"
|
:isMultipleSelect="false"
|
:activeIndex="activeIndex"
|
:isAutoIndex="true"
|
:isPaddingRight="false"
|
ref="tableRef"
|
:list="records"
|
:header="tableHeader"
|
:height="tableHeight"
|
:loading="loading"
|
></TableList>
|
</div>
|
</div>
|
</template>
|
|
<script>
|
import FormList from "./components/FormList";
|
import TableList from "./components/TableList";
|
import { riskReportExistAssetsDepartmentOverdueSearch } from "@comprehensive/utils/formItems";
|
import {
|
riskReportOverdueAssetDetailsHeader,
|
} from "@comprehensive/utils/tableHeaders";
|
import {
|
queryOverdueLoanList,
|
createExportOverdueLoan,
|
qryCodeListByCode,
|
} from "@comprehensive/serve/public";
|
|
// 逾期入池
|
export default {
|
name: "riskReportOverdueAssetDetails",
|
components: {
|
FormList,
|
TableList,
|
},
|
computed: {
|
activeIndex() {
|
const arr = [];
|
this.records.forEach((item, i) => {
|
this.checkInfoList.forEach((val) => {
|
if (item.applySerialNo == val.applySerialNo) {
|
arr.push(i);
|
}
|
});
|
});
|
return arr;
|
},
|
},
|
data() {
|
return {
|
formInfo: [],
|
formInfoFilter: ["deadline", "applySerialNo","customerName","expectlenddate","loanStatusDesc","overduedays",""],
|
// 是否显示所有表单项
|
isShowDetail: false,
|
// 表单结果数据
|
valueInfo: {},
|
//批量委外loading
|
excelLoading: false,
|
//表单数据
|
records: [],
|
//页码
|
pageInfo: {
|
currentPage: 1,
|
pageSize: 10,
|
total: 0,
|
},
|
tableHeader: [...riskReportOverdueAssetDetailsHeader],
|
tableHeaderFilter: [
|
"orgName",
|
"indictCourtName",
|
"conciliateStatusDesc",
|
"filingTime",
|
"judgmentTime",
|
],
|
tableHeight: "560px",
|
//数据列表loading
|
loading: false,
|
checkInfoList: [],
|
};
|
},
|
created() {
|
this.init();
|
},
|
destroyed() {
|
// window.removeEventListener("message")
|
},
|
methods: {
|
init() {
|
const { formInfoFilter, tableHeaderFilter } = this;
|
this.formInfo = riskReportExistAssetsDepartmentOverdueSearch.filter(
|
({ name }) => !formInfoFilter.includes(name)
|
);
|
this.tableHeader = riskReportOverdueAssetDetailsHeader.filter(
|
({ prop }) => !tableHeaderFilter.includes(prop)
|
);
|
this.getQueryOverdueLoanList();
|
this.getQryCodeListByCode();
|
},
|
async getQueryOverdueLoanList() {
|
this.loading = true;
|
let { valueInfo, pageInfo } = this;
|
const res = await queryOverdueLoanList({
|
...valueInfo,
|
...pageInfo,
|
});
|
this.loading = false;
|
const { list = [], total } = res.result;
|
//逻辑处理
|
this.records = list.reduce((pre, curr) => {
|
const {
|
termUnit,
|
repaymentTypeDesc,
|
businessTermMonth,
|
businessTermDay,
|
} = curr;
|
pre.push({
|
...curr,
|
repaymentType: repaymentTypeDesc,
|
businessTermDay:
|
termUnit == "M"
|
? `${businessTermMonth}个月`
|
: `${businessTermDay}天`,
|
});
|
return pre;
|
}, []);
|
|
this.pageInfo = {
|
...pageInfo,
|
total: total,
|
};
|
},
|
// 更新表单数据或查找某项数据
|
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;
|
}
|
},
|
// 更新数据
|
updateValue(value, item) {
|
let { name } = item;
|
this.setOrGetFormInfo(name, { value });
|
},
|
// 查询操作
|
onSubmit(val) {
|
this.pageInfo.currentPage = 1;
|
if (val == "reset") {
|
this.formInfo = loanMarginManagementSearch.filter(
|
({ name }) => !this.formInfoFilter.includes(name)
|
);
|
this.valueInfo = {};
|
}
|
this.getQueryOverdueLoanList();
|
// this.getQryCodeListByCode();
|
},
|
// 设置表单结果数据
|
setValueInfo(info = {}) {
|
this.valueInfo = info;
|
},
|
// 重置表单
|
resetValue() {
|
// this.pageInfo.currentPage = 1;
|
},
|
//导出excel
|
async batchEntrustExternal() {
|
this.loading = true;
|
let { valueInfo } = this;
|
const resp = await createExportOverdueLoan({
|
...valueInfo,
|
});
|
this.loading = false;
|
if (resp.code == "00") {
|
this.$message({
|
type: "success",
|
message: resp.msg,
|
});
|
}
|
},
|
// 表单事件回调
|
async doAction(name, item, { label }) {
|
console.log("name", name, "item", item, "label", label);
|
const { applySerialNo, phaseNo, serialNo, ftSerialNo } = item;
|
// this.isShowList = false;
|
//当点击订单号时触发
|
if (label === "详情") {
|
this.$router.push({
|
path: `/comprehensiveTransaction/overdueProductDetail/${applySerialNo}`,
|
query: {
|
enterType: phaseNo,
|
type: "detail",
|
serialNo: serialNo,
|
ftSerialNo: ftSerialNo,
|
},
|
});
|
} else {
|
this.$router.push({
|
path: `/comprehensiveTransaction/overdueProductDetail/${applySerialNo}`,
|
query: {
|
enterType: phaseNo,
|
type: "edit",
|
serialNo: serialNo,
|
ftSerialNo: ftSerialNo,
|
},
|
});
|
}
|
},
|
//选中
|
handleSelectionChange(array) {
|
this.checkInfoList = array;
|
},
|
// 修改翻页数
|
handleCurrentChange(val) {
|
this.pageInfo.currentPage = val;
|
this.getQueryOverdueLoanList();
|
},
|
// 修改翻页条数
|
handleSizeChange(val) {
|
this.pageInfo.pageSize = val;
|
this.getQueryOverdueLoanList();
|
},
|
// 产品名称下拉列表
|
async getQryCodeListByCode() {
|
const productRes = await qryCodeListByCode({
|
codeNos: ["ProductCodeType", "BussDepartName", "FundUnit"],
|
});
|
const { BussDepartName, FundUnit, ProductCodeType } = productRes.result.codeMap;
|
|
this.setOrGetFormInfo("loanMains", { options: FundUnit });
|
this.setOrGetFormInfo("productIds", { options: ProductCodeType });
|
this.setOrGetFormInfo("businessTeams", { options: BussDepartName });
|
},
|
},
|
watch: {},
|
};
|
</script>
|
|
<style lang="postcss" scoped>
|
.list-content {
|
font-size: 14px;
|
}
|
.export-excle {
|
margin: 0 0 20px 0;
|
}
|
.message {
|
font-size: 12px;
|
color: #666666;
|
padding: 10px 20px;
|
background-color: #fafafa;
|
}
|
>>> .el-table__header {
|
width: 100% !important;
|
}
|
>>> .el-table__body {
|
width: 100% !important;
|
}
|
</style>
|