|
|
|
@ -77,10 +77,17 @@ |
|
|
|
|
<template v-else> |
|
|
|
|
<p class="field-name">选择本产品的贷款对象。</p> |
|
|
|
|
<div class="flex items-center mb-2"> |
|
|
|
|
<el-checkbox class="mt-1" |
|
|
|
|
v-model="form.age" |
|
|
|
|
label="年龄" /> |
|
|
|
|
<div v-if="form.age" |
|
|
|
|
<div class="radio-wrap"> |
|
|
|
|
<span class="label">1、年龄</span> |
|
|
|
|
<span class="whether">是否启用</span> |
|
|
|
|
<el-radio-group v-model="form.age"> |
|
|
|
|
<el-radio v-for="(item, i) in whethers" |
|
|
|
|
:key="i" |
|
|
|
|
:label="item.id">{{ item.name }}</el-radio> |
|
|
|
|
</el-radio-group> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<div v-if="form.age === 795" |
|
|
|
|
class="num-inputs ml-7"> |
|
|
|
|
<el-input placeholder="最小年龄" |
|
|
|
|
v-model.number="form.minimumAge"></el-input> |
|
|
|
@ -89,31 +96,55 @@ |
|
|
|
|
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" |
|
|
|
|
<div class="flex items-center h-[47px] mb-2"> |
|
|
|
|
<div class="radio-wrap"> |
|
|
|
|
<span class="label">2、学历要求</span> |
|
|
|
|
<span class="whether">是否启用</span> |
|
|
|
|
<el-radio-group v-model="form.edu"> |
|
|
|
|
<el-radio v-for="(item, i) in whethers" |
|
|
|
|
:key="i" |
|
|
|
|
:label="item.id">{{ item.name }}</el-radio> |
|
|
|
|
</el-radio-group> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<el-checkbox-group v-if="form.edu === 795" |
|
|
|
|
class="mt-2 ml-5" |
|
|
|
|
v-model="form.educationalRequirements"> |
|
|
|
|
<el-checkbox v-for="(item, i) in config.find((e) => e.name === '个人产品-贷款对象')?.recordChildren[1]?.subject?.itemList" |
|
|
|
|
<el-checkbox v-for="(item, i) in config.find((e) => e.name === '个人产品-贷款对象')?.recordChildren[1]?.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" |
|
|
|
|
<div class="flex items-center h-[47px] mb-2"> |
|
|
|
|
<div class="radio-wrap"> |
|
|
|
|
<span class="label">3、工作年限</span> |
|
|
|
|
<span class="whether">是否启用</span> |
|
|
|
|
<el-radio-group v-model="form.curWL"> |
|
|
|
|
<el-radio v-for="(item, i) in whethers" |
|
|
|
|
:key="i" |
|
|
|
|
:label="item.id">{{ item.name }}</el-radio> |
|
|
|
|
</el-radio-group> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<el-checkbox-group v-if="form.curWL === 795" |
|
|
|
|
class="mt-2 ml-5" |
|
|
|
|
v-model="form.currentWorkingLife"> |
|
|
|
|
<el-checkbox v-for="(item, i) in config.find((e) => e.name === '个人产品-贷款对象')?.recordChildren[2]?.subject?.itemList" |
|
|
|
|
<el-checkbox v-for="(item, i) in config.find((e) => e.name === '个人产品-贷款对象')?.recordChildren[2]?.recordChildren[1]?.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="radio-wrap"> |
|
|
|
|
<span class="label">4、公积金/社保</span> |
|
|
|
|
<span class="whether">是否启用</span> |
|
|
|
|
<el-radio-group v-model="form.providentFundAndSocialSecurity"> |
|
|
|
|
<el-radio v-for="(item, i) in whethers" |
|
|
|
|
:key="i" |
|
|
|
|
:label="item.id">{{ item.name }}</el-radio> |
|
|
|
|
</el-radio-group> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
</div> |
|
|
|
|
</el-form-item> |
|
|
|
@ -289,6 +320,7 @@ interface RuleForm { |
|
|
|
|
productCurrency: number; |
|
|
|
|
bankGuaranteeTypeIds: any[]; |
|
|
|
|
currentWorkingLife?: any; |
|
|
|
|
edu: number | string; |
|
|
|
|
educationalRequirements?: any; |
|
|
|
|
loanCeiling: any; |
|
|
|
|
loanPurpose: any; |
|
|
|
@ -296,7 +328,8 @@ interface RuleForm { |
|
|
|
|
maximumAge: any; |
|
|
|
|
maximumAnnualInterestRate: any; |
|
|
|
|
maximumTermOfLoan: any; |
|
|
|
|
age: boolean; |
|
|
|
|
age: number | string; |
|
|
|
|
curWL: number | string; |
|
|
|
|
minimumAge: any; |
|
|
|
|
minimumAprOnLoan: any; |
|
|
|
|
minimumLoan: any; |
|
|
|
@ -305,7 +338,7 @@ interface RuleForm { |
|
|
|
|
otherPurposesOfLoan: string; |
|
|
|
|
productObject: any; |
|
|
|
|
productType: number; |
|
|
|
|
providentFundAndSocialSecurity: any; |
|
|
|
|
providentFundAndSocialSecurity: number | string; |
|
|
|
|
whetherToSupportEarlyRepayment?: any; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -317,6 +350,16 @@ const levelId = +Cookies.get('sand-level'); |
|
|
|
|
const curTab = ref<string>('tab1'); |
|
|
|
|
const config = ref<any[]>([]); |
|
|
|
|
const info = ref<Record<string, any>>(null); |
|
|
|
|
const whethers = ref<Record<string, any>>([ |
|
|
|
|
{ |
|
|
|
|
id: 795, |
|
|
|
|
name: '是', |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: 796, |
|
|
|
|
name: '否', |
|
|
|
|
}, |
|
|
|
|
]); |
|
|
|
|
const formRef = ref<FormInstance>(); |
|
|
|
|
const userName = ref<string>(); |
|
|
|
|
const form = reactive<RuleForm>({ |
|
|
|
@ -327,6 +370,7 @@ const form = reactive<RuleForm>({ |
|
|
|
|
productCurrency: 1, |
|
|
|
|
bankGuaranteeTypeIds: [], |
|
|
|
|
currentWorkingLife: [], |
|
|
|
|
edu: '', |
|
|
|
|
educationalRequirements: [], |
|
|
|
|
loanCeiling: '', |
|
|
|
|
loanPurpose: '', |
|
|
|
@ -334,7 +378,8 @@ const form = reactive<RuleForm>({ |
|
|
|
|
maximumAge: '', |
|
|
|
|
maximumAnnualInterestRate: '', |
|
|
|
|
maximumTermOfLoan: '', |
|
|
|
|
age: false, |
|
|
|
|
age: '', |
|
|
|
|
curWL: '', |
|
|
|
|
minimumAge: '', |
|
|
|
|
minimumAprOnLoan: '', |
|
|
|
|
minimumLoan: '', |
|
|
|
@ -343,7 +388,7 @@ const form = reactive<RuleForm>({ |
|
|
|
|
otherPurposesOfLoan: '', |
|
|
|
|
productObject: '', |
|
|
|
|
productType: computed(() => +route.query.type), |
|
|
|
|
providentFundAndSocialSecurity: false, |
|
|
|
|
providentFundAndSocialSecurity: '', |
|
|
|
|
whetherToSupportEarlyRepayment: false, |
|
|
|
|
}); |
|
|
|
|
const rules = reactive<FormRules<RuleForm>>({ |
|
|
|
@ -400,7 +445,7 @@ const submit = async (formEl: FormInstance | undefined) => { |
|
|
|
|
if (param.productType) { |
|
|
|
|
if (!param.productObject) return ElMessage.error('请选择企业类型'); |
|
|
|
|
} |
|
|
|
|
if ((!param.productType && param.age) || param.productType) { |
|
|
|
|
if ((!param.productType && param.age === 795) || param.productType) { |
|
|
|
|
if (!param.minimumAge) return ElMessage.error('请输入最小年龄'); |
|
|
|
|
if (!param.maximumAge) return ElMessage.error('请输入最大年龄'); |
|
|
|
|
if (isIllegalNum(param.minimumAge) || isIllegalNum(param.maximumAge)) return ElMessage.error('请输入合理的年龄'); |
|
|
|
@ -409,9 +454,9 @@ const submit = async (formEl: FormInstance | undefined) => { |
|
|
|
|
|
|
|
|
|
// 个人 |
|
|
|
|
if (!param.productType) { |
|
|
|
|
if (param.edu && !param.educationalRequirements.length) return ElMessage.error('请选择学历要求'); |
|
|
|
|
if (param.curWL && !param.currentWorkingLife.length) return ElMessage.error('请选择工作年限'); |
|
|
|
|
if (param.curWL && !param.currentWorkingLife.length) return ElMessage.error('请选择工作年限'); |
|
|
|
|
if (param.edu === 795 && !param.educationalRequirements.length) return ElMessage.error('请选择学历要求'); |
|
|
|
|
if (param.curWL === 795 && !param.currentWorkingLife.length) return ElMessage.error('请选择工作年限'); |
|
|
|
|
if (param.curWL === 795 && !param.currentWorkingLife.length) return ElMessage.error('请选择工作年限'); |
|
|
|
|
} |
|
|
|
|
if (isIllegalNum(param.minimumLoan) || isIllegalNum(param.loanCeiling) || +param.minimumLoan > +param.loanCeiling) return ElMessage.error('请输入合理的贷款额度'); |
|
|
|
|
if (isIllegalNum(param.minimumAprOnLoan) || isIllegalNum(param.maximumAnnualInterestRate) || +param.minimumAprOnLoan > +param.maximumAnnualInterestRate) |
|
|
|
@ -421,7 +466,7 @@ const submit = async (formEl: FormInstance | undefined) => { |
|
|
|
|
param.currentWorkingLife = param.currentWorkingLife.join(); |
|
|
|
|
param.educationalRequirements = param.educationalRequirements.join(); |
|
|
|
|
param.modeRepayment = param.modeRepayment.join(); |
|
|
|
|
param.providentFundAndSocialSecurity = param.providentFundAndSocialSecurity ? 1 : ''; |
|
|
|
|
param.providentFundAndSocialSecurity = param.providentFundAndSocialSecurity === 795 ? 1 : ''; |
|
|
|
|
param.whetherToSupportEarlyRepayment = param.whetherToSupportEarlyRepayment ? 58 : ''; |
|
|
|
|
// 担保方式 |
|
|
|
|
param.addBankProductsGuarantyStyleReqList = []; |
|
|
|
@ -472,10 +517,10 @@ const addRecord = async (data: Record<string, any>) => { |
|
|
|
|
); |
|
|
|
|
} 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', '')); // 公积金社保 |
|
|
|
|
data.age === 795 && lcRule.push(handleId(100, 41, data.minimumAge + '~' + data.maximumAge + '', preIds + ',51,100', 5)); |
|
|
|
|
data.edu === 795 && lcRule.push(handleId(101, 42, data.educationalRequirements, preIds + ',51,101', 1)); |
|
|
|
|
data.curWL === 795 && lcRule.push(handleId(102, 43, data.currentWorkingLife, preIds + ',51,102', 1)); |
|
|
|
|
data.providentFundAndSocialSecurity === 795 && 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, ''), |
|
|
|
|