<template>
|
<el-container>
|
<el-main :style="{ padding: 0 }">
|
<ScrollToTab
|
:tabId="`#${tabScroll}`"
|
:contentId="`#${contentScroll}`"
|
:tabIndex="tabIndex"
|
@changeTab="changeTab"
|
ref="scrollTab"
|
>
|
<div class="scroll-content">
|
<ul
|
class="tab-scroll"
|
:id="tabScroll"
|
:style="{
|
height: `${clientHeight}px`,
|
}"
|
>
|
<li class="back-section">
|
<el-button 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: `${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 + 20}px`
|
: 'auto',
|
}"
|
>
|
<p class="scroll-title">{{ item.tabname }}</p>
|
<div class="inner-content">
|
<FormList
|
v-if="item.tabname == '借据信息'"
|
:info="formInfo"
|
:isShowDetail="isShowDetail"
|
@handleClick="isShowDetail = !isShowDetail"
|
@updateValue="updateValue"
|
@onSubmit="onSubmit"
|
@setValueInfo="setValueInfo"
|
:isChangeArray="false"
|
@resetValue="resetValue"
|
></FormList>
|
<TableList
|
v-if="item.tabname == '借据信息'"
|
:pageInfo="pageInfo"
|
@doAction="doAction"
|
@handleCurrentChange="handleCurrentChange"
|
@handleSizeChange="handleSizeChange"
|
@handleSelectionChange="handleSelectionChange"
|
:isMultipleSelect="true"
|
:activeIndex="activeIndex"
|
:isAutoIndex="true"
|
:isPaddingRight="false"
|
ref="tableRef"
|
:list="records"
|
:header="tableHeader"
|
:height="tableHeight"
|
:loading="loading"
|
></TableList>
|
<div v-if="item.tabname == '借据信息'" style="display: flex">
|
<div
|
v-for="(amtItem, index) in amtTotalInfo"
|
:key="index"
|
style="
|
display: flex;
|
flex-direction: row;
|
align-items: center;
|
"
|
>
|
<div
|
style="width: auto; margin: 0 10px 0 0; color: #888888"
|
>
|
{{ amtItem.key }}
|
</div>
|
<el-input
|
style="width: 200px; margin: 0 20px 0 0"
|
:value="amtItem.value"
|
disabled
|
></el-input>
|
</div>
|
</div>
|
<!-- 待认领资金模块 -->
|
<FormList
|
v-if="item.tabname == '待认领资金'"
|
:info="claimedFormInfo"
|
:isShowDetail="claimedIsShowDetail"
|
@handleClick="claimedIsShowDetail = !claimedIsShowDetail"
|
@updateValue="claimedUpdateValue"
|
@onSubmit="claimedOnSubmit"
|
@setValueInfo="claimedSetValueInfo"
|
:isChangeArray="false"
|
@resetValue="claimedResetValue"
|
></FormList>
|
<TableList
|
v-if="item.tabname == '待认领资金'"
|
:pageInfo="claimedPageInfo"
|
@doAction="doAction"
|
@handleCurrentChange="claimedHandleCurrentChange"
|
@handleSizeChange="claimedHandleSizeChange"
|
@handleSelectionChange="claimedHandleSelectionChange"
|
:isMultipleSelect="true"
|
:activeIndex="claimedActiveIndex"
|
:isAutoIndex="false"
|
:isPaddingRight="false"
|
ref="claimedTableRef"
|
:list="claimedRecords"
|
:header="claimedTableHeader"
|
:height="tableHeight"
|
:loading="claimedLoading"
|
:isReserve="true"
|
:rowKey="'trxnBr'"
|
></TableList>
|
</div>
|
<div
|
v-if="item.tabname == '待认领资金'"
|
class="tab-form-buttons"
|
style="
|
display: flex;
|
flex-direction: row;
|
justify-content: center;
|
"
|
>
|
<p style="margin: 0 40px 0 0">
|
<el-button class="comm-button" @click="goBack"
|
>返回</el-button
|
>
|
</p>
|
<p style="margin: 0 0 0 40px">
|
<el-button
|
class="comm-button"
|
type="primary"
|
@click="mainSubmit"
|
:loading="mainSubmitLoading"
|
>提交</el-button
|
>
|
</p>
|
</div>
|
</div>
|
</li>
|
<Dialog
|
v-model="isShowSubmit"
|
title="信息确认"
|
:buttons="[{ text: '取消' }, { text: '确定', type: 'primary' }]"
|
@handleClick="clickAgainEnter"
|
:contentText="`选中流水可能并非客户还款资金,请再次确认!`"
|
></Dialog>
|
<Dialog
|
v-model="isShowDialog"
|
icon="succ"
|
iconText="提交成功"
|
:buttons="[{ text: '确定', type: 'primary' }]"
|
@handleClick="goBack"
|
></Dialog>
|
</ul>
|
</div>
|
</ScrollToTab>
|
</el-main>
|
</el-container>
|
</template>
|
|
<script>
|
import ScrollToTab from "./components/ScrollToTab";
|
import FormList from "./components/FormList";
|
import TableList from "./components/TableList";
|
import Dialog from "./components/Dialog.vue";
|
import {
|
loanMarginManagementClaimSearch,
|
loanMarginManagementToBeClaimedSearch,
|
} from "@comprehensive/utils/formItems";
|
import {
|
loanMarginManagementClaimHeader,
|
loanMarginManagementToBeClaimHeader,
|
} from "@comprehensive/utils/tableHeaders";
|
import {
|
qryProdList,
|
queryDepositList,
|
queryBankWaterInfo,
|
depositClaim,
|
} from "@comprehensive/serve/public";
|
import { setMoneyToValue } from "@comprehensive/utils/comm";
|
|
export default {
|
components: {
|
ScrollToTab,
|
FormList,
|
TableList,
|
Dialog,
|
},
|
computed: {
|
activeIndex() {
|
const arr = [];
|
this.records.forEach((item, i) => {
|
this.checkInfoList.forEach((val) => {
|
if (item.applySerialNo == val.applySerialNo) {
|
arr.push(i);
|
}
|
});
|
});
|
return arr;
|
},
|
claimedActiveIndex() {
|
const arr = [];
|
this.claimedRecords.forEach((item, i) => {
|
this.claimedCheckInfoList.forEach((val) => {
|
if (item.trxnBr == val.trxnBr) {
|
arr.push(i);
|
}
|
});
|
});
|
return arr;
|
},
|
},
|
data() {
|
return {
|
serialNo: "",
|
tabScroll: "tab_scroll",
|
contentScroll: "content_scroll",
|
tabIndex: 0,
|
clientHeight: 800,
|
treeList: [],
|
formInfo: [],
|
// 借据查询过滤字段
|
formInfoFilter: [],
|
isShowDetail: false,
|
// 表单结果数据
|
valueInfo: {},
|
//表单数据
|
records: [],
|
//页码
|
pageInfo: {
|
currentPage: 1,
|
pageSize: 10,
|
total: 0,
|
},
|
//选中的list
|
checkInfoList: [],
|
//查询的字段
|
tableHeader: [...loanMarginManagementClaimHeader],
|
tableHeight: "560px",
|
loading: false,
|
amtTotalInfo: [
|
{ key: "保证金应入账总额", value: 0 },
|
{ key: "保证金已入账总额", value: 0 },
|
{ key: "保证金剩余待入账总额", value: 0 },
|
],
|
|
//待认领资金data
|
claimedFormInfo: [],
|
claimedIsShowDetail: false,
|
// 表单结果数据
|
claimedValueInfo: {},
|
//表单数据
|
claimedRecords: [],
|
//页码
|
claimedPageInfo: {
|
currentPage: 1,
|
pageSize: 10,
|
total: 0,
|
},
|
//选中的list
|
claimedCheckInfoList: [],
|
claimedTableHeader: [...loanMarginManagementToBeClaimHeader],
|
claimedLoading: false,
|
mainSubmitLoading: false,
|
isShowDialog: false,
|
isShowSubmit: false,
|
};
|
},
|
created() {
|
this.init();
|
},
|
mounted() {
|
this.setEleHeight();
|
window.addEventListener("resize", this.setEleHeight);
|
},
|
beforeDestroy() {
|
window.removeEventListener("resize", this.setEleHeight);
|
},
|
methods: {
|
init() {
|
this.serialNo = this.$route.params.id;
|
this.tabIndex = 0;
|
this.treeList = [
|
{
|
tabname: "借据信息",
|
exist: "Y",
|
gray: "",
|
visible: "",
|
open: "",
|
edit: "",
|
readonly: "N",
|
state: "LOAN_INFO",
|
},
|
{
|
tabname: "待认领资金",
|
exist: "Y",
|
gray: "",
|
visible: "",
|
open: "",
|
edit: "",
|
readonly: "N",
|
state: "LOAN_INFO",
|
},
|
];
|
const { formInfoFilter } = this;
|
this.formInfo = loanMarginManagementClaimSearch.filter(
|
({ name }) => !formInfoFilter.includes(name)
|
);
|
this.loanList();
|
this.qryProdList();
|
//待认领资金data
|
this.claimedFormInfo = loanMarginManagementToBeClaimedSearch.filter(
|
({ name }) => !formInfoFilter.includes(name)
|
);
|
this.claimedLoanList();
|
},
|
setEleHeight() {
|
const clientHeight = document.documentElement.clientHeight;
|
this.clientHeight = clientHeight || 800;
|
},
|
// 返回列表
|
goBack() {
|
this.isShowDialog = false;
|
window.history.go(-1);
|
},
|
// 切换tab的处理
|
changeTab(index, flg = false) {
|
this.tabIndex = index;
|
this.$refs.scrollTab.setScrollTop(index, flg);
|
this.$nextTick(() => this.$refs.scrollTab.setTabScrollTop());
|
},
|
// 重置表单
|
resetValue() {
|
this.pageInfo.currentPage = 1;
|
this.loanList();
|
},
|
// 设置表单结果数据
|
setValueInfo(info = {}) {
|
this.valueInfo = info;
|
},
|
// 更新表单数据或查找某项数据
|
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 = loanMarginManagementClaimSearch.filter(
|
({ name }) => !this.formInfoFilter.includes(name)
|
);
|
this.valueInfo = {};
|
}
|
|
this.loanList();
|
this.qryProdList();
|
},
|
// 获取当前数据列表
|
async loanList() {
|
this.loading = true;
|
let { valueInfo, pageInfo, serialNo } = this;
|
const res = await queryDepositList({
|
...valueInfo,
|
...pageInfo,
|
});
|
const { records = [], total, pages } = res.result;
|
this.loading = false;
|
this.records = records.reduce((pre, curr) => {
|
const { isRecDeposit, isRecDepositName } = curr;
|
// let tempdepositStatus = isRecDeposit == '1'?'已收取':'未收取'
|
pre.push({
|
...curr,
|
depositStatus: isRecDepositName,
|
});
|
return pre;
|
}, []);
|
this.pageInfo = {
|
...pageInfo,
|
total: parseInt(total),
|
};
|
},
|
// 产品名称下拉列表
|
async qryProdList() {
|
const res = await qryProdList({ productTypeNo: "" });
|
const { result } = res;
|
this.setOrGetFormInfo("productIdArray", { options: result });
|
},
|
// 表单事件回调
|
doAction(name, item, index) {
|
const { applySerialNo } = item;
|
},
|
// 修改翻页数
|
handleCurrentChange(val) {
|
this.pageInfo.currentPage = val;
|
this.loanList();
|
},
|
// 修改翻页条数
|
handleSizeChange(val) {
|
this.pageInfo.pageSize = val;
|
this.loanList();
|
},
|
// 选中的数据
|
handleSelectionChange(array) {
|
//计算应入账和已入账
|
let tempPayDepositAmt = 0;
|
let tempDepositAmount = 0;
|
let tempResidueAmountTotal = 0;
|
array.map((item) => {
|
tempPayDepositAmt =
|
tempPayDepositAmt + setMoneyToValue(item.payDepositAmt);
|
tempDepositAmount =
|
tempDepositAmount + setMoneyToValue(item.depositAmount);
|
});
|
tempResidueAmountTotal = tempPayDepositAmt - tempDepositAmount;
|
|
this.amtTotalInfo[0].value = tempPayDepositAmt.toFixed(2);
|
this.amtTotalInfo[1].value = tempDepositAmount.toFixed(2);
|
this.amtTotalInfo[2].value = tempResidueAmountTotal.toFixed(2);
|
this.checkInfoList = array;
|
},
|
|
//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;
|
}
|
},
|
//待认领资金更新
|
claimedUpdateValue(value, item) {
|
let { name } = item;
|
this.claimedSetOrGetFormInfo(name, { value });
|
},
|
|
claimedOnSubmit(val) {
|
this.claimedPageInfo.currentPage = 1;
|
if (val == "reset") {
|
this.claimedFormInfo = loanMarginManagementToBeClaimedSearch.filter(
|
({ name }) => !this.formInfoFilter.includes(name)
|
);
|
this.claimedValueInfo = {};
|
}
|
|
this.claimedLoanList();
|
},
|
// 设置表单结果数据
|
claimedSetValueInfo(info = {}) {
|
this.claimedValueInfo = info;
|
},
|
// 重置表单
|
claimedResetValue() {
|
this.claimedPageInfo.currentPage = 1;
|
this.claimedLoanList();
|
},
|
// 修改翻页数
|
claimedHandleCurrentChange(val) {
|
this.claimedPageInfo.currentPage = val;
|
this.claimedLoanList();
|
},
|
// 修改翻页条数
|
claimedHandleSizeChange(val) {
|
this.claimedPageInfo.pageSize = val;
|
this.claimedLoanList();
|
},
|
// 选中的数据
|
claimedHandleSelectionChange(array) {
|
// if (array.length > 1) {
|
// this.$message.error("银行流水只能选一条!");
|
// this.claimedCheckInfoList = [];
|
// this.$refs.claimedTableRef[0].clearTableSelection();
|
// } else {
|
// this.claimedCheckInfoList = array;
|
// }
|
this.claimedCheckInfoList = array;
|
},
|
// 获取当前数据列表
|
async claimedLoanList() {
|
this.claimedLoading = true;
|
let { claimedValueInfo, claimedPageInfo, serialNo } = this;
|
const res = await queryBankWaterInfo({
|
...claimedValueInfo,
|
...claimedPageInfo,
|
});
|
this.claimedLoading = false;
|
|
const { records = [], total, pages } = res.result;
|
this.claimedRecords = records.reduce((pre, curr) => {
|
const { status, statusDesc } = curr;
|
pre.push({
|
...curr,
|
});
|
return pre;
|
}, []);
|
this.claimedPageInfo = {
|
...claimedPageInfo,
|
total: parseInt(total),
|
};
|
},
|
//主页面提交
|
async mainSubmit() {
|
const { checkInfoList, claimedCheckInfoList } = this;
|
if (checkInfoList.length === 0) {
|
this.$message.error("借据信息不能为空!");
|
return false;
|
}
|
if (claimedCheckInfoList.length === 0) {
|
this.$message.error("银行流水不能为空!");
|
return false;
|
}
|
this.isShowSubmit = true;
|
},
|
async clickAgainEnter(index) {
|
this.isShowSubmit = false;
|
if (index === 1) {
|
this.mainSubmitLoading = true;
|
//借据编号数组
|
let tempCheckInfoList = this.checkInfoList;
|
tempCheckInfoList = tempCheckInfoList.reduce((pre, curr) => {
|
const { loanSerialNo } = curr;
|
pre.push(loanSerialNo);
|
return pre;
|
}, []);
|
|
//银行流水数组
|
let tempClaimedCheckInfoList = this.claimedCheckInfoList;
|
tempClaimedCheckInfoList = tempClaimedCheckInfoList.reduce(
|
(pre, curr) => {
|
const { trxnBr } = curr;
|
pre.push(trxnBr);
|
return pre;
|
},
|
[]
|
);
|
console.log(tempCheckInfoList, tempClaimedCheckInfoList);
|
try {
|
const resp = await depositClaim({
|
inputUserId: "",
|
loanList: tempCheckInfoList,
|
trxnbrArray: tempClaimedCheckInfoList,
|
username: "",
|
});
|
this.mainSubmitLoading = false;
|
//成功后,调弹窗
|
this.isShowDialog = true;
|
} catch (error) {
|
this.mainSubmitLoading = false;
|
}
|
}
|
},
|
},
|
};
|
</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;
|
}
|
}
|
& .tab-form-buttons {
|
display: flex;
|
justify-content: center;
|
padding: 60px 0 30px 0;
|
& p {
|
margin: 0 40px 0 0;
|
}
|
& p:last-child {
|
margin-right: 0;
|
}
|
}
|
}
|
&::-webkit-scrollbar {
|
width: 0;
|
height: 10px;
|
}
|
& .last-scroll-inner {
|
min-height: 620px;
|
}
|
}
|
}
|
.apply-top-button {
|
& >>> .el-button {
|
margin-left: 20px;
|
}
|
}
|
.apply-info {
|
& >>> .clearCheckAll {
|
.el-table__header-wrapper .el-checkbox {
|
display: none;
|
}
|
}
|
}
|
|
.qrcode-content {
|
text-align: center;
|
& .qrode-close {
|
margin: 0;
|
padding: 0;
|
margin-bottom: 10px;
|
& i {
|
cursor: pointer;
|
font-size: 18px;
|
}
|
/* text-align: right; */
|
}
|
}
|
</style>
|