<!-- 风控报告存量资产产品汇总表 -->
|
<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> -->
|
<KeysTable
|
:list="records"
|
:header="tableHeader"
|
:isShowPages="false"
|
title="存量资产产品汇总表"
|
v-loading="loading"
|
></KeysTable>
|
</div>
|
</div>
|
</template>
|
|
<script>
|
import FormList from "./components/FormList";
|
import TableList from "./components/TableList";
|
import KeysTable from "./components/KeysTable";
|
import { riskReportExistAssetsDepartmentAssetSearch } from "@comprehensive/utils/formItems";
|
import { riskReportExistAssetsProductHeader } from "@comprehensive/utils/tableHeaders";
|
import {
|
queryAssetsProdStaticsAll,
|
createExportAssetsProdStaticsAll,
|
qryCodeListByCode
|
} from "@comprehensive/serve/public";
|
|
// 逾期入池
|
export default {
|
name: "riskReportExistAssetsProduct",
|
components: {
|
FormList,
|
TableList,
|
KeysTable,
|
},
|
computed: {},
|
data() {
|
return {
|
formInfo: [],
|
formInfoFilter: [
|
"dataSource",
|
"deadline",
|
"applyserialno",
|
"customerName",
|
"putOutDate",
|
"expectlenddate",
|
"loanStatus",
|
"overDueDays",
|
"departName",
|
"bussDept",
|
"managerName",
|
"namCustMgr",
|
],
|
// 是否显示所有表单项
|
isShowDetail: false,
|
// 表单结果数据
|
valueInfo: {},
|
//批量委外loading
|
excelLoading: false,
|
//表单数据
|
records: [],
|
//页码
|
pageInfo: {
|
currentPage: 1,
|
pageSize: 10,
|
total: 0,
|
},
|
tableHeader: [...riskReportExistAssetsProductHeader],
|
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 = riskReportExistAssetsDepartmentAssetSearch.filter(
|
({ name }) => !formInfoFilter.includes(name)
|
);
|
this.tableHeader = riskReportExistAssetsProductHeader.filter(
|
({ prop }) => !tableHeaderFilter.includes(prop)
|
);
|
this.getQueryAssetsProdStaticsAll();
|
this.getQryCodeListByCode();
|
},
|
//存量资产产品汇总表数据
|
async getQueryAssetsProdStaticsAll() {
|
this.loading = true;
|
let { valueInfo } = this;
|
const res = await queryAssetsProdStaticsAll({
|
...valueInfo,
|
});
|
const { assetsProdInfoList } = res.result;
|
this.loading = false;
|
this.records = assetsProdInfoList.reduce((pre, curr) => {
|
const { overNormalBalancePercent, overSumPercent } = curr;
|
const formatPercent = (value) => {
|
// 处理 null/undefined 情况
|
if (value == null) return "0.00%";
|
return (value * 100).toFixed(2) + "%";
|
};
|
pre.push({
|
...curr,
|
overNormalBalancePercent: formatPercent(overNormalBalancePercent),
|
overSumPercent: formatPercent(overSumPercent),
|
});
|
return pre;
|
}, []);
|
},
|
// 更新表单数据或查找某项数据
|
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 = riskReportExistAssetsDepartmentAssetSearch.filter(
|
({ name }) => !this.formInfoFilter.includes(name)
|
);
|
this.valueInfo = {};
|
this.getQryCodeListByCode();
|
}
|
this.getQueryAssetsProdStaticsAll();
|
},
|
// 设置表单结果数据
|
setValueInfo(info = {}) {
|
this.valueInfo = info;
|
},
|
// 重置表单
|
resetValue() {
|
// this.pageInfo.currentPage = 1;
|
},
|
//导出excel
|
async batchEntrustExternal() {
|
this.loading = true;
|
let { valueInfo } = this;
|
const resp = await createExportAssetsProdStaticsAll({
|
...valueInfo,
|
});
|
this.loading = false;
|
if (resp.code == "00") {
|
this.$message({
|
type: "success",
|
message: resp.msg,
|
});
|
}
|
},
|
// 产品名称下拉列表
|
async getQryCodeListByCode() {
|
const productRes = await qryCodeListByCode({
|
codeNos: ["ProductCodeType", "BussDepartName", "FundUnit"],
|
});
|
const { BussDepartName, FundUnit, ProductCodeType } = productRes.result.codeMap;
|
|
this.setOrGetFormInfo("fundUnitInfo", { options: FundUnit });
|
this.setOrGetFormInfo("prodName", { options: ProductCodeType });
|
this.setOrGetFormInfo("bussDept", { 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>
|