|
|
@ -1,7 +1,6 @@ |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<div> |
|
|
|
<div> |
|
|
|
<el-tabs v-model="curTab" |
|
|
|
<el-tabs v-model="curTab"> |
|
|
|
@tab-click="tabChange"> |
|
|
|
|
|
|
|
<el-tab-pane :label="id ? '配置要素' : '新增产品'" |
|
|
|
<el-tab-pane :label="id ? '配置要素' : '新增产品'" |
|
|
|
name="tab1"> |
|
|
|
name="tab1"> |
|
|
|
<el-form ref="formRef" |
|
|
|
<el-form ref="formRef" |
|
|
@ -326,13 +325,14 @@ |
|
|
|
<script setup lang="ts"> |
|
|
|
<script setup lang="ts"> |
|
|
|
import { ref, reactive, computed, watch, onMounted, defineEmits } from 'vue'; |
|
|
|
import { ref, reactive, computed, watch, onMounted, defineEmits } from 'vue'; |
|
|
|
import { ElMessage } from 'element-plus'; |
|
|
|
import { ElMessage } from 'element-plus'; |
|
|
|
import type { TabsPaneContext, FormInstance, FormRules } from 'element-plus'; |
|
|
|
import type { FormInstance, FormRules } from 'element-plus'; |
|
|
|
import { findById, save, update, elementDetail } from '@/api/bank'; |
|
|
|
import { findById, save, update, elementDetail } from '@/api/bank'; |
|
|
|
import { getProcessInformationBasedOnRoles, addOperation } from '@/api/judgment'; |
|
|
|
import { getProcessInformationBasedOnRoles, addOperation } from '@/api/judgment'; |
|
|
|
import { useRouter, useRoute } from 'vue-router'; |
|
|
|
import { useRouter, useRoute } from 'vue-router'; |
|
|
|
import { handleId, isIllegalNum, getIds, whethers, getUsername } from '@/utils/common'; |
|
|
|
import { handleId, isIllegalNum, getIds, whethers, getUsername } from '@/utils/common'; |
|
|
|
import Info from './Info.vue'; |
|
|
|
import Info from './Info.vue'; |
|
|
|
import Cookies from 'js-cookie'; |
|
|
|
import Cookies from 'js-cookie'; |
|
|
|
|
|
|
|
import { getStat } from '@/store/useProduct'; |
|
|
|
|
|
|
|
|
|
|
|
const emit = defineEmits(['getList']); |
|
|
|
const emit = defineEmits(['getList']); |
|
|
|
interface RuleForm { |
|
|
|
interface RuleForm { |
|
|
@ -413,10 +413,6 @@ const rules = reactive<FormRules<RuleForm>>({ |
|
|
|
modeRepayment: [{ required: true, message: '请选择还款方式', trigger: 'change' }], |
|
|
|
modeRepayment: [{ required: true, message: '请选择还款方式', trigger: 'change' }], |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
// tab切换回调 |
|
|
|
|
|
|
|
const tabChange = (tab: TabsPaneContext, event: Event) => { |
|
|
|
|
|
|
|
console.log(tab, event); |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
// 配置项 |
|
|
|
// 配置项 |
|
|
|
const getConfig = async () => { |
|
|
|
const getConfig = async () => { |
|
|
|
const { process } = await getProcessInformationBasedOnRoles(form.productType === 1 ? 45 : 44); |
|
|
|
const { process } = await getProcessInformationBasedOnRoles(form.productType === 1 ? 45 : 44); |
|
|
@ -463,6 +459,65 @@ watch( |
|
|
|
immediate: true, |
|
|
|
immediate: true, |
|
|
|
}, |
|
|
|
}, |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 新增判分记录 |
|
|
|
|
|
|
|
const addRecord = async (data: Record<string, any>) => { |
|
|
|
|
|
|
|
getStat(299); |
|
|
|
|
|
|
|
const isEnterprise = data.productType === 1; |
|
|
|
|
|
|
|
const preIds = `1,${Cookies.get('sand-level')},41,${data.productType ? 45 : 44}`; // 1,关卡id,角色(这个页面是产品经理新增产品),个人/企业(44/45) |
|
|
|
|
|
|
|
const lcRule: Array<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), |
|
|
|
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 贷款用途 |
|
|
|
|
|
|
|
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.ageSelectedState && lcRule.push(handleId(1235, 324, data.ageSelectedState, preIds + ',51,1234,1235', 1)); |
|
|
|
|
|
|
|
data.ageSelectedState === 795 && lcRule.push(handleId(1236, 41, data.minimumAge + '~' + data.maximumAge, preIds + ',51,1234,1236', 5)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
data.degreeSelectedStatus && lcRule.push(handleId(1238, 324, data.degreeSelectedStatus, preIds + ',51,1237,1238', 1)); |
|
|
|
|
|
|
|
data.degreeSelectedStatus === 795 && lcRule.push(handleId(1239, 42, data.educationalRequirements, preIds + ',51,1237,1239', 1)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
data.workingLifeSelectedState && lcRule.push(handleId(1241, 324, data.workingLifeSelectedState, preIds + ',51,1240,1241', 1)); |
|
|
|
|
|
|
|
data.workingLifeSelectedState === 795 && lcRule.push(handleId(1242, 43, data.currentWorkingLife, preIds + ',51,1240,1242', 1)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
data.providentFundAndSocialSecurity && lcRule.push(handleId(1244, 324, data.providentFundAndSocialSecurity, preIds + ',51,1243,1244', 1)); // 公积金社保 |
|
|
|
|
|
|
|
lcRule.push(handleId(1316, 328, data.loanPurpose, preIds + ',52,1316', 1)); |
|
|
|
|
|
|
|
data.loanPurpose === 822 && lcRule.push(handleId(1317, 11, data.otherPurposesOfLoan, preIds + ',52,1317', 3)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 担保方式 |
|
|
|
|
|
|
|
data.creditSelectedStatus && lcRule.push(handleId(108, 324, data.creditSelectedStatus, preIds + ',53,108', 1)); |
|
|
|
|
|
|
|
data.guaranteeLoanSelectedStatus && lcRule.push(handleId(109, 324, data.guaranteeLoanSelectedStatus, preIds + ',53,109', 1)); |
|
|
|
|
|
|
|
data.mortgageSelectedStatus && lcRule.push(handleId(1277, 324, data.mortgageSelectedStatus, preIds + ',53,110,1277', 1)); |
|
|
|
|
|
|
|
data.hypothecatedSelectedStatus && lcRule.push(handleId(1278, 324, data.hypothecatedSelectedStatus, preIds + ',53,111,1278', 1)); |
|
|
|
|
|
|
|
data.mortgageSelectedStatus === 795 && lcRule.push(handleId(1275, 13, data.bankGuaranteeTypeIds.filter((e: number) => e > 22 && e < 33).join(), preIds + ',53,110,1275', 1)); |
|
|
|
|
|
|
|
data.hypothecatedSelectedStatus === 795 && lcRule.push(handleId(1276, 14, data.bankGuaranteeTypeIds.filter((e: number) => e > 32 && e < 38).join(), preIds + ',53,111,1276', 1)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lcRule.push( |
|
|
|
|
|
|
|
handleId(54, 15, data.minimumLoan + '~' + data.loanCeiling, preIds + ',54', 5), |
|
|
|
|
|
|
|
handleId(55, 16, data.minimumAprOnLoan + '~' + data.maximumAnnualInterestRate, preIds + ',55', 5), |
|
|
|
|
|
|
|
handleId(56, 17, data.minimumTermOfLoan + '~' + data.maximumTermOfLoan, preIds + ',56', 5), |
|
|
|
|
|
|
|
handleId(57, 18, data.modeRepayment, preIds + ',57', 1), |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lcRule.push(handleId(58, 140, data.whetherToSupportEarlyRepayment ? 345 : 346, preIds + ',58', 1)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await addOperation({ |
|
|
|
|
|
|
|
...getIds(), |
|
|
|
|
|
|
|
parentId: preIds, |
|
|
|
|
|
|
|
lcJudgmentRuleReq: lcRule, |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}; |
|
|
|
// 提交 |
|
|
|
// 提交 |
|
|
|
const submit = async (formEl: FormInstance | undefined) => { |
|
|
|
const submit = async (formEl: FormInstance | undefined) => { |
|
|
|
if (!formEl) return; |
|
|
|
if (!formEl) return; |
|
|
@ -557,63 +612,6 @@ const submit = async (formEl: FormInstance | undefined) => { |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
}; |
|
|
|
}; |
|
|
|
// 新增判分记录 |
|
|
|
|
|
|
|
const addRecord = async (data: Record<string, any>) => { |
|
|
|
|
|
|
|
const isEnterprise = data.productType === 1; |
|
|
|
|
|
|
|
const preIds = `1,${Cookies.get('sand-level')},41,${data.productType ? 45 : 44}`; // 1,关卡id,角色(这个页面是产品经理新增产品),个人/企业(44/45) |
|
|
|
|
|
|
|
const lcRule: Array<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), |
|
|
|
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 贷款用途 |
|
|
|
|
|
|
|
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.ageSelectedState && lcRule.push(handleId(1235, 324, data.ageSelectedState, preIds + ',51,1234,1235', 1)); |
|
|
|
|
|
|
|
data.ageSelectedState === 795 && lcRule.push(handleId(1236, 41, data.minimumAge + '~' + data.maximumAge, preIds + ',51,1234,1236', 5)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
data.degreeSelectedStatus && lcRule.push(handleId(1238, 324, data.degreeSelectedStatus, preIds + ',51,1237,1238', 1)); |
|
|
|
|
|
|
|
data.degreeSelectedStatus === 795 && lcRule.push(handleId(1239, 42, data.educationalRequirements, preIds + ',51,1237,1239', 1)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
data.workingLifeSelectedState && lcRule.push(handleId(1241, 324, data.workingLifeSelectedState, preIds + ',51,1240,1241', 1)); |
|
|
|
|
|
|
|
data.workingLifeSelectedState === 795 && lcRule.push(handleId(1242, 43, data.currentWorkingLife, preIds + ',51,1240,1242', 1)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
data.providentFundAndSocialSecurity && lcRule.push(handleId(1244, 324, data.providentFundAndSocialSecurity, preIds + ',51,1243,1244', 1)); // 公积金社保 |
|
|
|
|
|
|
|
lcRule.push(handleId(1316, 328, data.loanPurpose, preIds + ',52,1316', 1)); |
|
|
|
|
|
|
|
data.loanPurpose === 822 && lcRule.push(handleId(1317, 11, data.otherPurposesOfLoan, preIds + ',52,1317', 3)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 担保方式 |
|
|
|
|
|
|
|
data.creditSelectedStatus && lcRule.push(handleId(108, 324, data.creditSelectedStatus, preIds + ',53,108', 1)); |
|
|
|
|
|
|
|
data.guaranteeLoanSelectedStatus && lcRule.push(handleId(109, 324, data.guaranteeLoanSelectedStatus, preIds + ',53,109', 1)); |
|
|
|
|
|
|
|
data.mortgageSelectedStatus && lcRule.push(handleId(1277, 324, data.mortgageSelectedStatus, preIds + ',53,110,1277', 1)); |
|
|
|
|
|
|
|
data.hypothecatedSelectedStatus && lcRule.push(handleId(1278, 324, data.hypothecatedSelectedStatus, preIds + ',53,111,1278', 1)); |
|
|
|
|
|
|
|
data.mortgageSelectedStatus === 795 && lcRule.push(handleId(1275, 13, data.bankGuaranteeTypeIds.filter((e: number) => e > 22 && e < 33).join(), preIds + ',53,110,1275', 1)); |
|
|
|
|
|
|
|
data.hypothecatedSelectedStatus === 795 && lcRule.push(handleId(1276, 14, data.bankGuaranteeTypeIds.filter((e: number) => e > 32 && e < 38).join(), preIds + ',53,111,1276', 1)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lcRule.push( |
|
|
|
|
|
|
|
handleId(54, 15, data.minimumLoan + '~' + data.loanCeiling, preIds + ',54', 5), |
|
|
|
|
|
|
|
handleId(55, 16, data.minimumAprOnLoan + '~' + data.maximumAnnualInterestRate, preIds + ',55', 5), |
|
|
|
|
|
|
|
handleId(56, 17, data.minimumTermOfLoan + '~' + data.maximumTermOfLoan, preIds + ',56', 5), |
|
|
|
|
|
|
|
handleId(57, 18, data.modeRepayment, preIds + ',57', 1), |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lcRule.push(handleId(58, 140, data.whetherToSupportEarlyRepayment ? 345 : 346, preIds + ',58', 1)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await addOperation({ |
|
|
|
|
|
|
|
...getIds(), |
|
|
|
|
|
|
|
parentId: preIds, |
|
|
|
|
|
|
|
lcJudgmentRuleReq: lcRule, |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
onMounted(() => { |
|
|
|
onMounted(() => { |
|
|
|
getConfig(); |
|
|
|
getConfig(); |
|
|
|
}); |
|
|
|
}); |
|
|
|