|
|
|
@ -7,7 +7,6 @@ |
|
|
|
|
|
|
|
|
|
<el-form ref="formRef" |
|
|
|
|
:model="form" |
|
|
|
|
:rules="rules" |
|
|
|
|
label-width="120px" |
|
|
|
|
label-suffix=":" |
|
|
|
|
class="form" |
|
|
|
@ -46,7 +45,7 @@ |
|
|
|
|
<el-checkbox-group v-model="form.borrowerMaterial"> |
|
|
|
|
<el-checkbox :label="config[1]?.recordChildren[1]?.subject?.itemList[0].itemId">{{ config[1]?.recordChildren[1]?.subject?.itemList[0].options }}</el-checkbox> |
|
|
|
|
</el-checkbox-group> |
|
|
|
|
<el-select v-show="(detail.productType && form.borrowerMaterial?.includes(165)) || (!detail.productType && form.borrowerMaterial?.includes(49))" |
|
|
|
|
<el-select v-show="(info.productType && form.borrowerMaterial?.includes(165)) || (!info.productType && form.borrowerMaterial?.includes(49))" |
|
|
|
|
class="ml-5" |
|
|
|
|
v-model="form.borrowerMaterialSelect" |
|
|
|
|
placeholder="请选择"> |
|
|
|
@ -63,7 +62,7 @@ |
|
|
|
|
</el-checkbox-group> |
|
|
|
|
|
|
|
|
|
<!-- 企业 --> |
|
|
|
|
<template v-if="detail.productType"> |
|
|
|
|
<template v-if="info.productType"> |
|
|
|
|
<p class="field-name mt-5">企业材料</p> |
|
|
|
|
<div> |
|
|
|
|
<el-checkbox-group v-model="form.enterpriseMaterial"> |
|
|
|
@ -172,11 +171,23 @@ |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="利率定价模型" |
|
|
|
|
label-width="130px" |
|
|
|
|
prop="interestRatePricingModelCheck"> |
|
|
|
|
prop="interestRatePricingModelCheck" |
|
|
|
|
:rules="[ |
|
|
|
|
{ required: true, message: '请选择利率定价模型', trigger: 'change' }, |
|
|
|
|
{ |
|
|
|
|
asyncValidator: async (rule, value, callback) => { |
|
|
|
|
if (value && !form.interestRatePricingModel) { |
|
|
|
|
callback(`请选择${info.productType ? '企业' : '个人'}额度模型`) |
|
|
|
|
} else { |
|
|
|
|
callback() |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
]"> |
|
|
|
|
<div class="flex-1"> |
|
|
|
|
<div class="flex items-center mb-3"> |
|
|
|
|
<el-checkbox v-model="form.interestRatePricingModelCheck" |
|
|
|
|
:label="(detail.productType ? '企业' : '个人') + '额度模型'" /> |
|
|
|
|
:label="(info.productType ? '企业' : '个人') + '额度模型'" /> |
|
|
|
|
<el-select v-show="form.interestRatePricingModelCheck" |
|
|
|
|
class="ml-5" |
|
|
|
|
v-model="form.interestRatePricingModel" |
|
|
|
@ -188,7 +199,7 @@ |
|
|
|
|
</el-select> |
|
|
|
|
</div> |
|
|
|
|
<el-checkbox v-model="form.individualInterestRateModel" |
|
|
|
|
:label="103">{{ detail.productType ? '企业' : '个人' }}利率模型</el-checkbox> |
|
|
|
|
:label="103">{{ info.productType ? '企业' : '个人' }}利率模型</el-checkbox> |
|
|
|
|
</div> |
|
|
|
|
</el-form-item> |
|
|
|
|
</div> |
|
|
|
@ -244,8 +255,7 @@ |
|
|
|
|
<el-radio v-model="form.contractMaterials" |
|
|
|
|
:label="117">抵押物所有权证明</el-radio> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="合同模板" |
|
|
|
|
prop="loanContractCheck"> |
|
|
|
|
<el-form-item label="合同模板"> |
|
|
|
|
<div class="flex-1"> |
|
|
|
|
<div class="flex items-center mb-3"> |
|
|
|
|
<el-checkbox v-model="form.loanContractCheck" |
|
|
|
@ -307,7 +317,7 @@ |
|
|
|
|
<el-form-item label="选择策略" |
|
|
|
|
prop="selectionStrategy"> |
|
|
|
|
<el-checkbox-group v-model="form.selectionStrategy"> |
|
|
|
|
<el-checkbox v-for="(item, i) in detail.productType ? config[7]?.recordChildren[0]?.subject?.itemList : config[7]?.subject?.itemList" |
|
|
|
|
<el-checkbox v-for="(item, i) in info.productType ? config[7]?.recordChildren[0]?.subject?.itemList : config[7]?.subject?.itemList" |
|
|
|
|
:key="i" |
|
|
|
|
:label="item.itemId">{{ item.options }}</el-checkbox> |
|
|
|
|
</el-checkbox-group> |
|
|
|
@ -332,8 +342,8 @@ |
|
|
|
|
<script setup lang="ts"> |
|
|
|
|
import { ref, reactive, computed, watch, onMounted } from 'vue'; |
|
|
|
|
import { ElMessage } from 'element-plus'; |
|
|
|
|
import type { TabsPaneContext, FormInstance, FormRules } from 'element-plus'; |
|
|
|
|
import { findById, riskSave } from '@/api/bank'; |
|
|
|
|
import type { TabsPaneContext, FormInstance } from 'element-plus'; |
|
|
|
|
import { findById, riskSave, riskUpdate } from '@/api/bank'; |
|
|
|
|
import { getProcessInformationBasedOnRoles, addOperation } from '@/api/judgment'; |
|
|
|
|
import { useRouter, useRoute } from 'vue-router'; |
|
|
|
|
import { handleId } from '@/utils/common'; |
|
|
|
@ -385,7 +395,7 @@ const route = useRoute(); |
|
|
|
|
const id = computed(() => +route.query.id); |
|
|
|
|
const curTab = ref<string>('tab1'); |
|
|
|
|
const config = ref<any[]>([]); |
|
|
|
|
const detail = ref<Record<string, any>>({}); |
|
|
|
|
const info = ref<Record<string, any>>({}); |
|
|
|
|
const formRef = ref<FormInstance>(); |
|
|
|
|
const form = reactive<RuleForm>({ |
|
|
|
|
accessStrategy: [], |
|
|
|
@ -426,29 +436,6 @@ const form = reactive<RuleForm>({ |
|
|
|
|
sendingAccount: '', |
|
|
|
|
supplementaryMaterials: [], |
|
|
|
|
}); |
|
|
|
|
const rules = reactive<FormRules<RuleForm>>({ |
|
|
|
|
accountMaterials: [{ required: true, message: '请选择提供材料', trigger: 'change' }], |
|
|
|
|
sendingAccount: [{ required: true, message: '请选择发放账户', trigger: 'change' }], |
|
|
|
|
loanApplicationMethod: [{ required: true, message: '请选择申请方式', trigger: 'change' }], |
|
|
|
|
borrowerMaterial: [{ required: true, message: '请选择借款人材料', trigger: 'change' }], |
|
|
|
|
mateMaterial: [{ required: true, message: '请选择配偶材料', trigger: 'change' }], |
|
|
|
|
businessMaterials: [{ required: true, message: '请选择经营类材料', trigger: 'change' }], |
|
|
|
|
supplementaryMaterials: [{ required: true, message: '请选择补充材料', trigger: 'change' }], |
|
|
|
|
runBatchObject: [{ required: true, message: '请选择跑批对象', trigger: 'change' }], |
|
|
|
|
accessStrategy: [{ required: true, message: '请选择准入策略', trigger: 'change' }], |
|
|
|
|
personalCreditScoringStrategiesCheck: [{ required: true, message: '请选择信用评分策略', trigger: 'change' }], |
|
|
|
|
riskDegreeStrategy: [{ required: true, message: '请选择风险度策略', trigger: 'change' }], |
|
|
|
|
interestRatePricingModelCheck: [{ required: true, message: '请选择利率定价模型', trigger: 'change' }], |
|
|
|
|
dueDiligenceMode: [{ required: true, message: '请选择尽调方式', trigger: 'change' }], |
|
|
|
|
dueDiligenceContent: [{ required: true, message: '请选择尽调内容', trigger: 'change' }], |
|
|
|
|
reviewContent: [{ required: true, message: '请选择审查内容', trigger: 'change' }], |
|
|
|
|
reviewSignature: [{ required: true, message: '请选择审查签字', trigger: 'change' }], |
|
|
|
|
reviewApproveContent: [{ required: true, message: '请选择审批内容', trigger: 'change' }], |
|
|
|
|
approvalSignature: [{ required: true, message: '请选择审批签字', trigger: 'change' }], |
|
|
|
|
contractMaterials: [{ required: true, message: '请选择提供的材料', trigger: 'change' }], |
|
|
|
|
loanContractCheck: [{ required: true, message: '请选择合同模板', trigger: 'change' }], |
|
|
|
|
selectionStrategy: [{ required: true, message: '请选择选择策略', trigger: 'change' }], |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
// tab切换回调 |
|
|
|
|
const tabChange = (tab: TabsPaneContext, event: Event) => { |
|
|
|
@ -456,7 +443,7 @@ const tabChange = (tab: TabsPaneContext, event: Event) => { |
|
|
|
|
}; |
|
|
|
|
// 配置项 |
|
|
|
|
const getConfig = async () => { |
|
|
|
|
const { process } = await getProcessInformationBasedOnRoles(detail.value.productType ? 71 : 70); // 个人70,企业71 |
|
|
|
|
const { process } = await getProcessInformationBasedOnRoles(info.value.productType ? 71 : 70); // 个人70,企业71 |
|
|
|
|
config.value = process; |
|
|
|
|
}; |
|
|
|
|
// 详情 |
|
|
|
@ -464,7 +451,7 @@ const getDetail = async () => { |
|
|
|
|
if (id.value) { |
|
|
|
|
try { |
|
|
|
|
const { data } = await findById(id.value); |
|
|
|
|
detail.value = data; |
|
|
|
|
info.value = data; |
|
|
|
|
getConfig(); |
|
|
|
|
} finally { |
|
|
|
|
} |
|
|
|
@ -486,21 +473,33 @@ const submit = async (formEl: FormInstance | undefined) => { |
|
|
|
|
await formEl.validate(async (valid, fields) => { |
|
|
|
|
if (valid) { |
|
|
|
|
try { |
|
|
|
|
const isEnterprise = detail.value.productType === 1; |
|
|
|
|
const isEnterprise = info.value.productType === 1; |
|
|
|
|
const param = JSON.parse(JSON.stringify(form)); |
|
|
|
|
|
|
|
|
|
if (((isEnterprise && param.borrowerMaterial?.includes(165)) || (!isEnterprise && param.borrowerMaterial?.includes(49))) && !param.borrowerMaterialSelect) |
|
|
|
|
return ElMessage.error('请选择借款申请表'); |
|
|
|
|
if ( |
|
|
|
|
(param.personalCreditScoringStrategiesCheck && !param.personalCreditScoringStrategies) || |
|
|
|
|
(param.corporateCreditScoringStrategiesCheck && !param.corporateCreditScoringStrategies) |
|
|
|
|
) |
|
|
|
|
return ElMessage.error('请选择信用评分策略'); |
|
|
|
|
if (param.loanContractCheck && !param.loanContract) return ElMessage.error('请选择借贷合同'); |
|
|
|
|
if (param.mortgageContractCheck && !param.mortgageContract) return ElMessage.error('请选择抵押合同'); |
|
|
|
|
if (param.pledgeContractCheck && !param.pledgeContract) return ElMessage.error('请选择质押合同'); |
|
|
|
|
if (param.guaranteeContractCheck && !param.guaranteeContract) return ElMessage.error('请选择担保合同'); |
|
|
|
|
|
|
|
|
|
param.accessStrategy = param.accessStrategy.join(); |
|
|
|
|
if ((isEnterprise && param.borrowerMaterial?.includes(165)) || (!isEnterprise && param.borrowerMaterial?.includes(49))) |
|
|
|
|
param.borrowerMaterial.splice(1, 0, param.borrowerMaterialSelect); |
|
|
|
|
param.borrowerMaterial = param.borrowerMaterial.join(); |
|
|
|
|
param.accountMaterials = param.accountMaterials.join(); |
|
|
|
|
if (param.approvalSignature.length) param.approvalSignature = param.approvalSignature[0]; |
|
|
|
|
param.approvalSignature = param.approvalSignature[0]; |
|
|
|
|
// 企业 |
|
|
|
|
// if (isEnterprise) { |
|
|
|
|
param.collateral = param.collateral.join(); |
|
|
|
|
param.enterpriseMaterial = param.enterpriseMaterial.join(); |
|
|
|
|
param.corporateInterestRateModel = param.corporateInterestRateModel.join(); |
|
|
|
|
param.materialsForLoanApproval = param.materialsForLoanApproval.join(); |
|
|
|
|
// corporateInterestRateModel,materialsForLoanApproval |
|
|
|
|
// } else { |
|
|
|
|
// 个人 |
|
|
|
|
param.businessMaterials = param.businessMaterials.join(); |
|
|
|
@ -516,19 +515,26 @@ const submit = async (formEl: FormInstance | undefined) => { |
|
|
|
|
if (!param.pledgeContractCheck) param.pledgeContract = ''; |
|
|
|
|
if (!param.guaranteeContractCheck) param.guaranteeContract = ''; |
|
|
|
|
|
|
|
|
|
if (param.contractMaterials.length) param.contractMaterials = param.contractMaterials[0]; |
|
|
|
|
param.contractMaterials = param.contractMaterials[0]; |
|
|
|
|
param.dueDiligenceContent = param.dueDiligenceContent.join(); |
|
|
|
|
param.loanApplicationMethod = param.loanApplicationMethod.join(); |
|
|
|
|
if (param.reviewApproveContent.length) param.reviewApproveContent = param.reviewApproveContent[0]; |
|
|
|
|
param.reviewApproveContent = param.reviewApproveContent[0]; |
|
|
|
|
// if (param.reviewContent) param.reviewContent = 114; |
|
|
|
|
if (param.reviewSignature.length) param.reviewSignature = param.reviewSignature[0]; |
|
|
|
|
param.reviewSignature = param.reviewSignature[0] || ''; |
|
|
|
|
param.riskDegreeStrategy = param.riskDegreeStrategy.join(); |
|
|
|
|
param.runBatchObject = param.runBatchObject.join(); |
|
|
|
|
param.selectionStrategy = param.selectionStrategy.join(); |
|
|
|
|
param.supplementaryMaterials = param.supplementaryMaterials.join(); |
|
|
|
|
|
|
|
|
|
const { message } = await riskSave(param); |
|
|
|
|
addRecord(param, message); |
|
|
|
|
if (info.value.riskControlDetails) { |
|
|
|
|
param.id = info.value.riskControlDetails.id; |
|
|
|
|
await riskUpdate(param); |
|
|
|
|
addRecord(param, id.value); |
|
|
|
|
} else { |
|
|
|
|
const { message } = await riskSave(param); |
|
|
|
|
addRecord(param, message); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
ElMessage.success('提交成功!'); |
|
|
|
|
emit('getList', 1); |
|
|
|
|
} finally { |
|
|
|
@ -540,7 +546,7 @@ const submit = async (formEl: FormInstance | undefined) => { |
|
|
|
|
}; |
|
|
|
|
// 新增判分记录 |
|
|
|
|
const addRecord = async (data: Record<string, any>, newId: number) => { |
|
|
|
|
const isEnterprise = detail.value.productType === 1; |
|
|
|
|
const isEnterprise = info.value.productType === 1; |
|
|
|
|
const preIds = `1,2,42,${data.productType ? 71 : 70},${newId}`; // 1,关卡id,角色(这个页面是风控经理配置风控),个人/企业(70/71) |
|
|
|
|
const lcRule = <Record<string, any>[]>[]; |
|
|
|
|
|
|
|
|
|