<template>
|
<div class="comm-page">
|
<div class="form-content">
|
<FormList
|
:info="formInfo"
|
:isShowDetail="isShowDetail"
|
@handleClick="isShowDetail = !isShowDetail"
|
@updateValue="updateValue"
|
@onSubmit="onSubmit"
|
@setValueInfo="setValueInfo"
|
></FormList>
|
</div>
|
|
<div class="list-content">
|
<TableList
|
:pageInfo="pageInfo"
|
@doAction="doAction"
|
@handleCurrentChange="handleCurrentChange"
|
@handleSizeChange="handleSizeChange"
|
:isAutoIndex="true"
|
:list="records"
|
:header="tableHeader"
|
:loading="loading"
|
></TableList>
|
</div>
|
|
<el-dialog
|
width="850px"
|
title="重新提交确认"
|
:visible.sync="dialogTableVisible"
|
custom-class="comm-dialog"
|
:modal-append-to-body="false"
|
center
|
>
|
<el-form :model="form" label-width="120px" inline size="small">
|
<el-form-item label="申请编号">
|
<el-input v-model="form.serialno" disabled></el-input>
|
</el-form-item>
|
<el-form-item label="客户名称">
|
<el-input v-model="form.customername" disabled></el-input>
|
</el-form-item>
|
<el-form-item label="产品名称">
|
<el-input v-model="form.productname" disabled></el-input>
|
</el-form-item>
|
<el-form-item label="产品维度">
|
<el-input v-model="form.productdimensionname" disabled></el-input>
|
</el-form-item>
|
<el-form-item label="业务类型">
|
<el-input v-model="form.occurtypeDesc" disabled></el-input>
|
</el-form-item>
|
<el-form-item label="自动审批状态">
|
<el-input v-model="form.taskstateDesc" disabled></el-input>
|
</el-form-item>
|
</el-form>
|
<span slot="footer" class="dialog-footer">
|
<el-button plain @click="dialogTableVisible = false">取消</el-button>
|
<el-button type="primary" @click="handleComfirm(form)">确定</el-button>
|
</span>
|
</el-dialog>
|
</div>
|
</template>
|
<script>
|
/**
|
* 风控审批申请管理
|
*/
|
import TableList from "@comprehensive/components/TableList";
|
import FormList from "@comprehensive/components/FormList";
|
import { comfirm } from '@comprehensive/utils/comm'
|
import { riskApprovalApplyHeader } from '@comprehensive/utils/tableHeaders'
|
import { riskApprovalApplySearch } from '@comprehensive/utils/formItems'
|
import {
|
qryProdList,
|
qryDimensionList,
|
autoApproveFlowList,
|
getDictionaryList,
|
autoApproveSubmit
|
} from "@comprehensive/serve/public";
|
|
export default {
|
components: {
|
FormList,
|
TableList
|
},
|
data() {
|
return {
|
records:[],
|
valueInfo: {},
|
form: {},
|
isShowDetail:false,
|
dialogTableVisible:false,
|
loading:false,
|
pageInfo: {
|
currentPage: 1,
|
pageSize: 10,
|
},
|
formInfo: [...riskApprovalApplySearch],
|
tableHeader: [...riskApprovalApplyHeader],
|
};
|
},
|
activated () {
|
this.init();
|
},
|
methods: {
|
// 页面初始化处理
|
init() {
|
const { formInfo } = this;
|
|
if (formInfo.some(({ name }) => name === "productid")) {
|
this.qryProdList();
|
}
|
|
if (formInfo.some(({ name }) => name === "productdimension")) {
|
this.qryDimensionList();
|
}
|
|
if (formInfo.some(({ name }) => name === "taskstate")) {
|
this.getTaskState();
|
}
|
|
this.autoApproveFlowList();
|
},
|
|
// 表单事件触发
|
doAction(name, item, { label }){
|
if (name === "lastAction") {
|
|
if(label == '详情'){
|
this.toDetail(item)
|
}
|
|
if(label == '重新提交'){
|
this.dialogTableVisible = true
|
this.form = item
|
}
|
}
|
},
|
|
// 重新提交确认
|
async handleComfirm(form){
|
const res = await autoApproveSubmit({ objectNo:form.serialno })
|
if(res.code == '00'){
|
this.$message.success('提交成功')
|
this.dialogTableVisible = false
|
this.init()
|
}
|
},
|
|
// 跳转到详情页
|
toDetail(result) {
|
const {
|
serialno,
|
flowno,
|
customerid,
|
objecttype,
|
occurtype
|
} = result;
|
|
this.$router.push(
|
`/comprehensiveTransaction/loanDetail/${serialno}?occurType=${occurtype}&flowno=${flowno}&objectType=${objecttype}&customerID=${customerid}`
|
);
|
},
|
|
// 获取当前数据列表
|
async autoApproveFlowList() {
|
this.loading = true;
|
let { valueInfo, pageInfo } = this;
|
const res = await autoApproveFlowList({
|
...valueInfo,
|
...pageInfo
|
});
|
const { records = [], total } = res.result;
|
this.loading = false;
|
this.records = records.reduce((pre, curr) => {
|
let arr = [];
|
// 贷款期限处理
|
let {
|
detailFlag,
|
resubmitFlag
|
} = curr;
|
if(detailFlag == '1'){
|
arr.push({ label: "详情" });
|
}
|
if(resubmitFlag == '1'){
|
arr.push({ label: "重新提交" });
|
}
|
let sortButtons = [
|
"详情",
|
"重新提交"
|
];
|
arr = this.getSortButtons(sortButtons, arr);
|
pre.push({
|
...curr,
|
buttons: [...arr],
|
});
|
|
return pre;
|
}, []);
|
|
this.pageInfo = {
|
...pageInfo,
|
total
|
};
|
},
|
|
// 按钮顺序排序
|
getSortButtons(sortButtons, arr) {
|
return sortButtons.reduce((pre, curr) => {
|
const item = arr.find(({ label }) => label === curr);
|
if (item) {
|
pre.push({ ...item });
|
}
|
return pre;
|
}, []);
|
},
|
|
// 自动审批状态
|
async getTaskState() {
|
const res = await getDictionaryList({ codeNo: "TaskState" });
|
const { result } = res;
|
this.setOrGetFormInfo("taskstate", { options: result });
|
},
|
|
// 产品名称下拉列表
|
async qryProdList() {
|
const res = await qryProdList({ productTypeNo: "" });
|
const { result } = res;
|
this.setOrGetFormInfo("productid", { options: result });
|
},
|
|
// 产品维度下拉列表
|
async qryDimensionList() {
|
const { valueInfo } = this;
|
let { productid = "" } = valueInfo;
|
const res = await qryDimensionList({ productid });
|
const { result } = res;
|
this.setOrGetFormInfo("productdimension", { options: result });
|
},
|
|
// 设置表单结果数据
|
setValueInfo(info = {}) {
|
this.valueInfo = info;
|
},
|
|
// 更新数据
|
updateValue(value, item) {
|
let { name } = item;
|
this.setOrGetFormInfo(name, { value });
|
if (name === "productid") {
|
this.qryDimensionList();
|
}
|
},
|
|
// 查询
|
onSubmit(){
|
this.pageInfo.currentPage = 1;
|
this.autoApproveFlowList();
|
},
|
|
// 更新表单数据或查找某项数据
|
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
|
}
|
},
|
|
// 修改翻页条数
|
handleSizeChange(val) {
|
this.pageInfo.pageSize = val;
|
this.autoApproveFlowList();
|
},
|
|
// 修改翻页数
|
handleCurrentChange(val) {
|
this.pageInfo.currentPage = val;
|
this.autoApproveFlowList();
|
},
|
|
}
|
};
|
</script>
|
<style lang="postcss" scoped>
|
.comm-page {
|
& .list-content {
|
font-size: 14px;
|
}
|
& .export-excle {
|
margin: 2px 20px 30px 0;
|
& .el-button-primary {
|
font-size: 14px;
|
}
|
}
|
& .empty-section {
|
height: 50px;
|
}
|
& >>> .comm-dialog {
|
& .el-form{
|
display: flex;
|
justify-content: flex-start;
|
flex-wrap: wrap;
|
& .el-form-item{
|
display: flex;
|
width: 45%;
|
margin: 0 30px 20px 0;
|
& .el-form-item__content{
|
flex: 1;
|
}
|
}
|
}
|
}
|
}
|
</style>
|