<template>
|
<div class="product">
|
<div class="borrower">
|
<p class="title">
|
<span></span>
|
放款明细
|
</p>
|
<FormList
|
:info="claimedFormInfo"
|
:isShowDetail="claimedIsShowDetail"
|
@handleClick="claimedIsShowDetail = !claimedIsShowDetail"
|
@updateValue="claimedUpdateValue"
|
@onSubmit="claimedOnSubmit"
|
@setValueInfo="claimedSetValueInfo"
|
:isChangeArray="false"
|
@resetValue="claimedResetValue"
|
></FormList>
|
<p class="export-excle" style="margin: 0 0 20px 0">
|
<el-button
|
size="small"
|
type="primary"
|
icon="el-icon-download"
|
@click="download()"
|
:loading="downloadLoading"
|
>导出Excel</el-button
|
>
|
</p>
|
<TableList
|
:pageInfo="claimedPageInfo"
|
@doAction="doAction"
|
@handleCurrentChange="claimedHandleCurrentChange"
|
@handleSizeChange="claimedHandleSizeChange"
|
:activeIndex="claimedActiveIndex"
|
:isAutoIndex="false"
|
:isPaddingRight="false"
|
ref="claimedTableRef"
|
:list="claimedRecords"
|
:header="claimedTableHeader"
|
:height="tableHeight"
|
:loading="claimedLoading"
|
:isReserve="true"
|
:rowKey="'trxnBr'"
|
></TableList>
|
</div>
|
</div>
|
</template>
|
<script>
|
import FormList from "../FormList.vue";
|
import TableList from "../TableList.vue";
|
import { alert } from '@comprehensive/utils/comm'
|
import {
|
loanMarginManagementToBeClaimedSearch,
|
projectDisbursementDetailListSearch,
|
} from "@comprehensive/utils/formItems";
|
import {
|
loanMarginManagementToBeClaimHeader,
|
projectDisbursementDetailListHeader,
|
} from "@comprehensive/utils/tableHeaders";
|
import {
|
getDictionaryList,
|
exportProjWorkerLoanList,
|
} from "@comprehensive/serve/public";
|
import { qryProjWorkerLoanList } from "@/api/product";
|
export default {
|
props: {
|
// 申请编号
|
serialNo: {
|
type: String,
|
required: true,
|
},
|
objectType: {
|
type: String,
|
default: "",
|
},
|
customerID: {
|
type: String,
|
default: "",
|
},
|
flowno: {
|
type: String,
|
|
// 默认为案场
|
default: "CreditFlowCase",
|
},
|
},
|
components: {
|
FormList,
|
TableList,
|
},
|
data() {
|
return {
|
//form查询字段
|
claimedFormInfo: [...projectDisbursementDetailListSearch],
|
claimedIsShowDetail: false,
|
// 表单结果数据
|
claimedValueInfo: {},
|
//表单数据
|
claimedRecords: [],
|
//选中的list
|
claimedCheckInfoList: [],
|
claimedTableHeader: [...projectDisbursementDetailListHeader],
|
tableHeight: "560px",
|
claimedLoading: false,
|
downloadLoading: false,
|
//页码
|
claimedPageInfo: {
|
currentPage: 1,
|
pageSize: 10,
|
total: 0,
|
},
|
// 查询过滤字段
|
formInfoFilter: [],
|
mainSubmitLoading: false,
|
};
|
},
|
computed: {
|
claimedActiveIndex() {
|
const arr = [];
|
this.claimedRecords.forEach((item, i) => {
|
this.claimedCheckInfoList.forEach((val) => {
|
if (item.trxnBr == val.trxnBr) {
|
arr.push(i);
|
}
|
});
|
});
|
return arr;
|
},
|
},
|
async created() {
|
this.init();
|
},
|
methods: {
|
init() {
|
const { formInfoFilter } = this;
|
//待认领资金data
|
// this.claimedFormInfo = projectDisbursementDetailListSearch.filter(
|
// ({ name }) => !formInfoFilter.includes(name)
|
// );
|
this.claimedLoanList();
|
this.getDictionaryList();
|
},
|
async download() {
|
this.downloadLoading = true
|
const resp = await exportProjWorkerLoanList({
|
...this.claimedPageInfo,
|
...this.claimedValueInfo,
|
projectSerialNo: this.serialNo,
|
});
|
this.downloadLoading = false
|
},
|
//请求列表数据
|
async claimedLoanList() {
|
this.claimedLoading = true;
|
let { claimedValueInfo, claimedPageInfo, serialNo } = this;
|
const resp = await qryProjWorkerLoanList({
|
projectSerialNo: serialNo,
|
...claimedPageInfo,
|
...claimedValueInfo,
|
});
|
this.claimedLoading = false;
|
const { records = [], total, pages } = resp.result;
|
this.claimedRecords = records.reduce((pre, curr) => {
|
const { status, statusDesc } = curr;
|
pre.push({
|
...curr,
|
});
|
return pre;
|
}, []);
|
this.claimedPageInfo = {
|
...claimedPageInfo,
|
total: parseInt(total),
|
};
|
},
|
// 借据状态
|
async getDictionaryList() {
|
const res = await getDictionaryList({ codeNo: "LoanStatus" });
|
const { result } = res;
|
this.claimedSetOrGetFormInfo("loanStatuses", { options: result });
|
},
|
// 设置表单结果数据
|
claimedSetValueInfo(info = {}) {
|
this.claimedValueInfo = info;
|
},
|
// 重置表单
|
claimedResetValue() {
|
this.claimedPageInfo.currentPage = 1;
|
this.claimedLoanList();
|
},
|
//更新放款明细查询字段
|
claimedUpdateValue(value, item) {
|
let { name } = item;
|
this.claimedSetOrGetFormInfo(name, { value });
|
},
|
//2- 待认领资金data
|
claimedSetOrGetFormInfo(nameKey, newInfo) {
|
let { claimedFormInfo } = this;
|
let index = claimedFormInfo.findIndex(({ name }) => name === nameKey);
|
let result = {};
|
if (!isNaN(index)) {
|
this.$set(this.claimedFormInfo, index, {
|
...claimedFormInfo[index],
|
...newInfo,
|
});
|
result = this.claimedFormInfo[index];
|
}
|
if (typeof newInfo === "undefined") {
|
return result;
|
}
|
},
|
//点击搜索
|
claimedOnSubmit(val) {
|
this.claimedPageInfo.currentPage = 1;
|
if (val == "reset") {
|
this.claimedFormInfo = projectDisbursementDetailListSearch.filter(
|
({ name }) => !this.formInfoFilter.includes(name)
|
);
|
this.claimedValueInfo = {};
|
}
|
this.getDictionaryList();
|
this.claimedLoanList();
|
},
|
|
doAction(name, item, index) {},
|
// 修改翻页数
|
claimedHandleCurrentChange(val) {
|
this.claimedPageInfo.currentPage = val;
|
this.claimedLoanList();
|
},
|
// 修改翻页条数
|
claimedHandleSizeChange(val) {
|
this.claimedPageInfo.pageSize = val;
|
this.claimedLoanList();
|
},
|
},
|
};
|
</script>
|
<style lang="postcss" scoped>
|
>>> .el-table__header {
|
width: 100% !important;
|
}
|
>>> .el-table__body {
|
width: 100% !important;
|
}
|
>>> .el-table__empty-block {
|
width: 100% !important;
|
}
|
|
.title {
|
margin: 30px 0 20px 0;
|
padding: 0 0 0 10px;
|
border-left: solid 2px #0081f0;
|
line-height: 16px;
|
font-size: 14px;
|
color: #222222;
|
}
|
</style>
|