<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 v-if="!hideButton">
|
<el-button
|
size="small"
|
plain
|
style="margin-left: 20px"
|
@click="doButtonAction(1)"
|
class="el-button-primary"
|
>保证金认领</el-button
|
>
|
<el-button
|
size="small"
|
plain
|
style="margin-left: 20px"
|
@click="doButtonAction(2)"
|
class="el-button-primary"
|
>保证金抵扣</el-button
|
>
|
<el-button
|
size="small"
|
plain
|
style="margin-left: 20px"
|
@click="doButtonAction(3)"
|
class="el-button-primary"
|
>保证金退款</el-button
|
>
|
</span>
|
</p>
|
<div class="list-content">
|
<TableList
|
: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>
|
</div>
|
</template>
|
|
<script>
|
import FormList from "./components/FormList";
|
import TableList from "./components/TableList";
|
import {
|
newdebitSearch,
|
loanMarginManagementSearch,
|
} from "@comprehensive/utils/formItems";
|
import {
|
newloanListHeader,
|
loanMarginManagementHeader,
|
} from "@comprehensive/utils/tableHeaders";
|
import {
|
qryProdList,
|
qryDimensionList,
|
qryFlowPhaseList,
|
getAllCityAreaList,
|
qryCustomRepayList,
|
queryDepositList,
|
getDictionaryList,
|
qryFirstInternalOrgInfo,
|
createExportAcctLoan,
|
applyTransaction,
|
malTrial,
|
} from "@comprehensive/serve/public";
|
|
export default {
|
name: "loanMarginManagement",
|
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: [],
|
// 是否显示所有表单项
|
isShowDetail: false,
|
// 表单结果数据
|
valueInfo: {},
|
//表单数据
|
records: [],
|
//页码
|
pageInfo: {
|
currentPage: 1,
|
pageSize: 10,
|
total: 0,
|
},
|
//使用隐藏按钮
|
hideButton: false,
|
//选中的list
|
checkInfoList: [],
|
tableHeader: [...loanMarginManagementHeader],
|
tableHeight: "560px",
|
loading: false,
|
};
|
},
|
created() {
|
this.init();
|
},
|
methods: {
|
// 页面初始化处理
|
init() {
|
const { formInfoFilter } = this;
|
this.formInfo = loanMarginManagementSearch.filter(
|
({ name }) => !formInfoFilter.includes(name)
|
);
|
this.qryProdList();
|
this.getDictionaryList();
|
this.loanList();
|
},
|
|
// 更新表单数据或查找某项数据
|
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.loanList();
|
this.qryProdList();
|
this.getDictionaryList();
|
},
|
// 设置表单结果数据
|
setValueInfo(info = {}) {
|
this.valueInfo = info;
|
},
|
// 重置表单
|
resetValue() {
|
this.pageInfo.currentPage = 1;
|
this.loanList();
|
},
|
|
// 获取当前数据列表
|
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 });
|
},
|
// 借据状态
|
async getDictionaryList() {
|
const res = await getDictionaryList({ codeNo: 'LoanStatus' })
|
const { result } = res
|
this.setOrGetFormInfo('loanStatuses', { options: result })
|
},
|
//tool按钮触发
|
async doButtonAction(val) {
|
if (val == "1") {
|
this.$router.push(
|
`/comprehensiveTransaction/loanMarginManagementClaim`
|
);
|
return;
|
}
|
if (!this.checkInfoList.length) {
|
this.$message.warning("请选择需要处理的数据");
|
return;
|
}
|
if (this.checkInfoList.length !== 1) {
|
this.$message.warning("只可选择一条数据");
|
return;
|
}
|
const { applySerialNo } = this.checkInfoList[0];
|
if (val == "2") {
|
this.$router.push(
|
`/comprehensiveTransaction/loanMarginManagementDeduction/${applySerialNo}`
|
);
|
} else if (val == "3") {
|
this.$router.push(
|
`/comprehensiveTransaction/loanMarginManagementRefund/${applySerialNo}`
|
);
|
}
|
},
|
// 表单事件回调
|
doAction(name, item, index) {
|
const { applySerialNo } = item;
|
// this.isShowList = false;
|
//当点击订单号时触发
|
if (name === "applySerialNo") {
|
this.$router.push(
|
`/comprehensiveTransaction/loanMarginManagementDetail/${applySerialNo}`
|
);
|
}
|
},
|
// 修改翻页数
|
handleCurrentChange(val) {
|
this.pageInfo.currentPage = val;
|
this.loanList();
|
},
|
// 修改翻页条数
|
handleSizeChange(val) {
|
this.pageInfo.pageSize = val;
|
this.loanList();
|
},
|
// 选中的数据
|
handleSelectionChange(array) {
|
this.checkInfoList = array;
|
},
|
},
|
};
|
</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;
|
}
|
</style>
|