|
|
|
@ -35,45 +35,72 @@ |
|
|
|
|
<el-form-item label="贷款对象" |
|
|
|
|
required> |
|
|
|
|
<div class="flex-1"> |
|
|
|
|
<p class="field-name">选择本产品的贷款对象。</p> |
|
|
|
|
<div class="flex items-center mb-2"> |
|
|
|
|
<el-checkbox-group class="mt-1" |
|
|
|
|
v-model="form.age"> |
|
|
|
|
<el-checkbox label="年龄" /> |
|
|
|
|
</el-checkbox-group> |
|
|
|
|
<div class="num-inputs ml-7"> |
|
|
|
|
<el-input placeholder="最小年龄" |
|
|
|
|
v-model.number="form.minimumAge"></el-input> |
|
|
|
|
<span class="split">-</span> |
|
|
|
|
<el-input placeholder="最大年龄" |
|
|
|
|
v-model.number="form.maximumAge"></el-input> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<div class="flex items-center mb-2"> |
|
|
|
|
<el-checkbox v-model="form.edu" |
|
|
|
|
label="学历要求"></el-checkbox> |
|
|
|
|
<el-checkbox-group v-if="form.edu" |
|
|
|
|
class="mt-2 ml-5" |
|
|
|
|
v-model="form.educationalRequirements"> |
|
|
|
|
<el-checkbox v-for="(item, i) in config[3]?.recordChildren[1]?.subject?.itemList" |
|
|
|
|
<!-- 企业 --> |
|
|
|
|
<template v-if="form.productType"> |
|
|
|
|
<div class="flex items-center"> |
|
|
|
|
<span class="mr-3 text-[#333] text-sm">企业类型</span> |
|
|
|
|
<el-select v-model="form.productObject" |
|
|
|
|
placeholder="请选择"> |
|
|
|
|
<el-option v-for="(item, i) in config.find((e: any) => e.name === '企业产品-贷款对象')?.recordChildren[0]?.subject?.itemList" |
|
|
|
|
:key="i" |
|
|
|
|
:label="item.itemId">{{ item.options }}</el-checkbox> |
|
|
|
|
</el-checkbox-group> |
|
|
|
|
</div> |
|
|
|
|
:label="item.options" |
|
|
|
|
:value="item.itemId" /> |
|
|
|
|
</el-select> |
|
|
|
|
</div> |
|
|
|
|
<div class="flex items-center mt-4"> |
|
|
|
|
<span class="mr-3 text-[#333] text-sm">借款人年龄</span> |
|
|
|
|
<div class="num-inputs ml-7"> |
|
|
|
|
<el-input placeholder="最小年龄" |
|
|
|
|
v-model.number="form.minimumAge"></el-input> |
|
|
|
|
<span class="split">-</span> |
|
|
|
|
<el-input placeholder="最大年龄" |
|
|
|
|
v-model.number="form.maximumAge"></el-input> |
|
|
|
|
<span class="unit">周岁</span> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
<!-- 个人 --> |
|
|
|
|
<template v-else> |
|
|
|
|
<p class="field-name">选择本产品的贷款对象。</p> |
|
|
|
|
<div class="flex items-center mb-2"> |
|
|
|
|
<el-checkbox-group class="mt-1" |
|
|
|
|
v-model="form.age"> |
|
|
|
|
<el-checkbox label="年龄" /> |
|
|
|
|
</el-checkbox-group> |
|
|
|
|
<div class="num-inputs ml-7"> |
|
|
|
|
<el-input placeholder="最小年龄" |
|
|
|
|
v-model.number="form.minimumAge"></el-input> |
|
|
|
|
<span class="split">-</span> |
|
|
|
|
<el-input placeholder="最大年龄" |
|
|
|
|
v-model.number="form.maximumAge"></el-input> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<div class="flex items-center mb-2"> |
|
|
|
|
<el-checkbox v-model="form.edu" |
|
|
|
|
label="学历要求"></el-checkbox> |
|
|
|
|
<el-checkbox-group v-if="form.edu" |
|
|
|
|
class="mt-2 ml-5" |
|
|
|
|
v-model="form.educationalRequirements"> |
|
|
|
|
<el-checkbox v-for="(item, i) in config.find((e: any) => e.name === '个人产品-贷款对象')?.recordChildren[1]?.subject?.itemList" |
|
|
|
|
:key="i" |
|
|
|
|
:label="item.itemId">{{ item.options }}</el-checkbox> |
|
|
|
|
</el-checkbox-group> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<div class="flex items-center mb-2"> |
|
|
|
|
<el-checkbox v-model="form.curWL" |
|
|
|
|
label="工作年限"></el-checkbox> |
|
|
|
|
<el-checkbox-group v-if="form.curWL" |
|
|
|
|
class="mt-2 ml-5" |
|
|
|
|
v-model="form.currentWorkingLife"> |
|
|
|
|
<el-checkbox v-for="(item, i) in config[3]?.recordChildren[2]?.subject?.itemList" |
|
|
|
|
:key="i" |
|
|
|
|
:label="item.itemId">{{ item.options }}</el-checkbox> |
|
|
|
|
</el-checkbox-group> |
|
|
|
|
</div> |
|
|
|
|
<el-checkbox v-model="form.providentFundAndSocialSecurity" |
|
|
|
|
label="公积金/社保"></el-checkbox> |
|
|
|
|
<div class="flex items-center mb-2"> |
|
|
|
|
<el-checkbox v-model="form.curWL" |
|
|
|
|
label="工作年限"></el-checkbox> |
|
|
|
|
<el-checkbox-group v-if="form.curWL" |
|
|
|
|
class="mt-2 ml-5" |
|
|
|
|
v-model="form.currentWorkingLife"> |
|
|
|
|
<el-checkbox v-for="(item, i) in config.find((e: any) => e.name === '个人产品-贷款对象')?.recordChildren[2]?.subject?.itemList" |
|
|
|
|
:key="i" |
|
|
|
|
:label="item.itemId">{{ item.options }}</el-checkbox> |
|
|
|
|
</el-checkbox-group> |
|
|
|
|
</div> |
|
|
|
|
<el-checkbox v-model="form.providentFundAndSocialSecurity" |
|
|
|
|
label="公积金/社保"></el-checkbox> |
|
|
|
|
</template> |
|
|
|
|
</div> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="贷款用途" |
|
|
|
@ -81,9 +108,16 @@ |
|
|
|
|
<div class="flex-1"> |
|
|
|
|
<p class="field-name">选择本产品贷款资金的用途。</p> |
|
|
|
|
<el-radio-group v-model="form.loanPurpose"> |
|
|
|
|
<el-radio v-for="(item, i) in config[4]?.recordChildren" |
|
|
|
|
:key="i" |
|
|
|
|
:label="item.id">{{ item.name }}</el-radio> |
|
|
|
|
<template v-if="form.productType"> |
|
|
|
|
<el-radio v-for="(item, i) in config.find((e: any) => e.name === '企业产品-贷款用途')?.subject?.itemList" |
|
|
|
|
:key="i" |
|
|
|
|
:label="item.itemId">{{ item.options }}</el-radio> |
|
|
|
|
</template> |
|
|
|
|
<template v-else> |
|
|
|
|
<el-radio v-for="(item, i) in config.find((e: any) => e.name === '个人产品-贷款用途')?.recordChildren" |
|
|
|
|
:key="i" |
|
|
|
|
:label="item.id">{{ item.name }}</el-radio> |
|
|
|
|
</template> |
|
|
|
|
</el-radio-group> |
|
|
|
|
<el-input v-if="form?.loanPurpose === 107" |
|
|
|
|
class="w-[250px] ml-5" |
|
|
|
@ -96,7 +130,7 @@ |
|
|
|
|
prop="bankGuaranteeTypeIds"> |
|
|
|
|
<div class="flex-1"> |
|
|
|
|
<p class="field-name">选择本产品的担保种类。</p> |
|
|
|
|
<div v-for="(item, i) in config[5]?.recordChildren" |
|
|
|
|
<div v-for="(item, i) in config.find((e: any) => e.name === '担保方式')?.recordChildren" |
|
|
|
|
:key="i" |
|
|
|
|
class="mb-2"> |
|
|
|
|
<el-checkbox-group v-model="form.bankGuaranteeTypeIds"> |
|
|
|
@ -159,7 +193,7 @@ |
|
|
|
|
<div class="flex-1"> |
|
|
|
|
<p class="field-name">选择本产品可以选择的还款方式。</p> |
|
|
|
|
<el-checkbox-group v-model="form.modeRepayment"> |
|
|
|
|
<el-checkbox v-for="(item, i) in config[9]?.subject?.itemList" |
|
|
|
|
<el-checkbox v-for="(item, i) in config.find((e: any) => e.name === '还款方式')?.subject?.itemList" |
|
|
|
|
:key="i" |
|
|
|
|
:label="item.itemId">{{ item.options }}</el-checkbox> |
|
|
|
|
</el-checkbox-group> |
|
|
|
@ -199,18 +233,19 @@ interface RuleForm { |
|
|
|
|
bankGuaranteeTypeIds: any[]; |
|
|
|
|
currentWorkingLife?: any; |
|
|
|
|
educationalRequirements?: any; |
|
|
|
|
loanCeiling?: number; |
|
|
|
|
loanPurpose?: number; |
|
|
|
|
maximumAge?: number; |
|
|
|
|
maximumAnnualInterestRate?: number; |
|
|
|
|
maximumTermOfLoan?: number; |
|
|
|
|
minimumAge?: number; |
|
|
|
|
minimumAprOnLoan?: number; |
|
|
|
|
minimumLoan?: number; |
|
|
|
|
minimumTermOfLoan?: number; |
|
|
|
|
loanCeiling: any; |
|
|
|
|
loanPurpose: any; |
|
|
|
|
productObject: any; |
|
|
|
|
maximumAge: any; |
|
|
|
|
maximumAnnualInterestRate: any; |
|
|
|
|
maximumTermOfLoan: any; |
|
|
|
|
minimumAge: any; |
|
|
|
|
minimumAprOnLoan: any; |
|
|
|
|
minimumLoan: any; |
|
|
|
|
minimumTermOfLoan: any; |
|
|
|
|
modeRepayment?: any; |
|
|
|
|
otherPurposesOfLoan: string; |
|
|
|
|
productObject?: number; |
|
|
|
|
productObject: any; |
|
|
|
|
productType: number; |
|
|
|
|
providentFundAndSocialSecurity: any; |
|
|
|
|
whetherToSupportEarlyRepayment?: any; |
|
|
|
@ -219,7 +254,7 @@ interface RuleForm { |
|
|
|
|
const router = useRouter(); |
|
|
|
|
const route = useRoute(); |
|
|
|
|
const curTab = ref<string>('tab1'); |
|
|
|
|
const config = ref<any>({}); |
|
|
|
|
const config = ref<any>([]); |
|
|
|
|
const formRef = ref<FormInstance>(); |
|
|
|
|
const form = reactive<RuleForm>({ |
|
|
|
|
productDefinition: '', |
|
|
|
@ -230,6 +265,7 @@ const form = reactive<RuleForm>({ |
|
|
|
|
educationalRequirements: [], |
|
|
|
|
loanCeiling: '', |
|
|
|
|
loanPurpose: '', |
|
|
|
|
productObject: '', |
|
|
|
|
maximumAge: '', |
|
|
|
|
maximumAnnualInterestRate: '', |
|
|
|
|
maximumTermOfLoan: '', |
|
|
|
@ -262,7 +298,7 @@ const tabChange = (tab: TabsPaneContext, event: Event) => { |
|
|
|
|
}; |
|
|
|
|
// 配置项 |
|
|
|
|
const getConfig = async () => { |
|
|
|
|
const { process } = await getProcessInformationBasedOnRoles(41); |
|
|
|
|
const { process } = await getProcessInformationBasedOnRoles(form.productType === 1 ? 45 : 44); |
|
|
|
|
config.value = process; |
|
|
|
|
}; |
|
|
|
|
// 提交 |
|
|
|
@ -277,14 +313,18 @@ const submit = async (formEl: FormInstance | undefined) => { |
|
|
|
|
param.modeRepayment = param.modeRepayment.join(); |
|
|
|
|
param.providentFundAndSocialSecurity = param.providentFundAndSocialSecurity ? 13 : ''; |
|
|
|
|
param.whetherToSupportEarlyRepayment = param.whetherToSupportEarlyRepayment ? 58 : ''; |
|
|
|
|
console.log(33, form, param); |
|
|
|
|
await save(param); |
|
|
|
|
addRecord(param); |
|
|
|
|
// 担保方式 |
|
|
|
|
param.addBankProductsGuarantyStyleReqList = []; |
|
|
|
|
param.bankGuaranteeTypeIds.forEach((e: number) => { |
|
|
|
|
param.addBankProductsGuarantyStyleReqList.push({ |
|
|
|
|
bankGuaranteeTypeId: (e > 22 && e < 33) || (e > 32 && e < 38) ? e : '', |
|
|
|
|
pid: e > 22 && e < 33 ? 110 : e > 32 && e < 38 ? 111 : e, |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
const { message } = await save(param); |
|
|
|
|
addRecord(param, message); |
|
|
|
|
ElMessage.success('提交成功!'); |
|
|
|
|
emit('getList', 1); |
|
|
|
|
// setTimeout(() => { |
|
|
|
|
// router.push(``) |
|
|
|
|
// }, 1500); |
|
|
|
|
} finally { |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
@ -293,22 +333,34 @@ const submit = async (formEl: FormInstance | undefined) => { |
|
|
|
|
}); |
|
|
|
|
}; |
|
|
|
|
// 新增判分记录 |
|
|
|
|
const addRecord = async (data: any) => { |
|
|
|
|
const preIds = `1,2,41,${data.productType ? 45 : 44}`; // 1,关卡id,角色(这个页面是产品经理新增产品),个人/企业(44/45) |
|
|
|
|
const addRecord = async (data: Record<string, any>, newId: number) => { |
|
|
|
|
const isEnterprise = data.productType === 1; |
|
|
|
|
const preIds = `1,2,41,${data.productType ? 45 : 44},${newId}`; // 1,关卡id,角色(这个页面是产品经理新增产品),个人/企业(44/45) |
|
|
|
|
const lcRule = <Record<string, any>[]>[ |
|
|
|
|
handleId(48, 1, data.productDefinition, preIds + ',48', 3), |
|
|
|
|
handleId(49, 2, data.productName, preIds + ',49', 3), |
|
|
|
|
handleId(50, 3, 1, preIds + ',50', 1), |
|
|
|
|
]; |
|
|
|
|
data.age && lcRule.push(handleId(100, 41, '[' + data.minimumAge + ',' + data.maximumAge + ']' + '', preIds + ',51,100', 5)); |
|
|
|
|
data.edu && lcRule.push(handleId(101, 42, data.educationalRequirements, preIds + ',51,101', 1)); |
|
|
|
|
data.curWL && lcRule.push(handleId(102, 43, data.currentWorkingLife, preIds + ',51,102', 1)); |
|
|
|
|
data.providentFundAndSocialSecurity && lcRule.push(handleId(103, '', '', preIds + ',51,103', '')); // 公积金社保 |
|
|
|
|
|
|
|
|
|
// 贷款用途 |
|
|
|
|
lcRule.push( |
|
|
|
|
data.loanPurpose === 107 ? handleId(107, 11, data.otherPurposesOfLoan, preIds + ',52,107', 3) : handleId(data.loanPurpose, '', '', preIds + ',52,' + data.loanPurpose, 1), |
|
|
|
|
); |
|
|
|
|
if (isEnterprise) { |
|
|
|
|
// 企业 |
|
|
|
|
lcRule.push( |
|
|
|
|
handleId(62, 7, data.productObject, preIds + ',61,62', 1), |
|
|
|
|
handleId(63, 8, '[' + data.minimumAge + ',' + data.maximumAge + ']' + '', preIds + ',61,63', 5), |
|
|
|
|
handleId(65, 19, data.loanPurpose, preIds + ',65', 1), |
|
|
|
|
); |
|
|
|
|
} else { |
|
|
|
|
// 个人 |
|
|
|
|
data.age && lcRule.push(handleId(100, 41, '[' + data.minimumAge + ',' + data.maximumAge + ']' + '', preIds + ',51,100', 5)); |
|
|
|
|
data.edu && lcRule.push(handleId(101, 42, data.educationalRequirements, preIds + ',51,101', 1)); |
|
|
|
|
data.curWL && lcRule.push(handleId(102, 43, data.currentWorkingLife, preIds + ',51,102', 1)); |
|
|
|
|
data.providentFundAndSocialSecurity && lcRule.push(handleId(103, '', '', preIds + ',51,103', '')); // 公积金社保 |
|
|
|
|
|
|
|
|
|
lcRule.push( |
|
|
|
|
data.loanPurpose === 107 ? handleId(107, 11, data.otherPurposesOfLoan, preIds + ',52,107', 3) : handleId(data.loanPurpose, '', '', preIds + ',52,' + data.loanPurpose, 1), |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 担保方式 |
|
|
|
|
data.bankGuaranteeTypeIds.includes(108) && lcRule.push(handleId(108, '', '', preIds + ',53,108', '')); |
|
|
|
|