信用评分策略(企业)

V0.1
yujialong 1 year ago
parent f0a1145939
commit 3e8ccd8529
  1. 1
      src/components/Panel/index.vue
  2. 10
      src/views/product/bank/Add.vue
  3. 4
      src/views/product/bank/Config.vue
  4. 4
      src/views/product/strategy/CardList.vue
  5. 470
      src/views/product/strategy/Credit.vue

@ -443,6 +443,7 @@ const submit = async () => {
timeSum,
checkpointId: Cookies.get('sand-level') ?? '',
projectId: param.projectId,
projectName: projectList.value.find((e) => e.projectId == param.projectId)?.projectName,
lcId: curReq.value,
assessmentId: param.assessmentId,
systemId: curSystemId.value,

@ -448,12 +448,12 @@ const addRecord = async (data: Record<string, any>) => {
//
lcRule.push(
handleId(62, 7, data.productObject, preIds + ',61,62', 1),
handleId(63, 8, '[' + data.minimumAge + ',' + data.maximumAge + ']' + '', preIds + ',61,63', 5),
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.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', '')); //
@ -470,9 +470,9 @@ const addRecord = async (data: Record<string, any>) => {
data.bankGuaranteeTypeIds.includes(111) && lcRule.push(handleId(111, 14, data.bankGuaranteeTypeIds.filter((e: number) => e > 32 && e < 38).join(), preIds + ',53,111', 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(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),
);

@ -602,7 +602,9 @@ const addRecord = async (data: Record<string, any>) => {
handleId(82, 27, data.runBatchObject, preIds + ',74,82', 1),
handleId(83, 28, data.accessStrategy, preIds + ',74,83', 1),
);
data.personalCreditScoringStrategiesCheck && lcRule.push(handleId(84, 29, '94,' + data.personalCreditScoringStrategies, preIds + ',74,84', 1));
lcRule.push(handleId(1044, 282, data.personalCreditScoringStrategiesCheck ? 683 : 684, preIds + ',74,1046,1044', 1));
// data.personalCreditScoringStrategiesCheck && lcRule.push(handleId(1045, 283, data.personalCreditScoringStrategies, preIds + ',74,1046,1045', 1));
data.corporateCreditScoringStrategiesCheck && lcRule.push(handleId(84, 29, '95,' + data.corporateCreditScoringStrategies, preIds + ',74,84', 1));
lcRule.push(handleId(85, 30, data.riskDegreeStrategy, preIds + ',74,85', 1));

@ -44,7 +44,7 @@
<ul class="products">
<li v-for="(item, i) in list1"
:key="i"
:class="{ active: item.id === id }"
:class="{ active: item.id === creditId }"
@click="switchProductCredit(item.id)">
<el-popconfirm title="您确定删除吗?"
@confirm="handleDelete(item.id)">
@ -92,7 +92,7 @@ const router = useRouter();
const route = useRoute();
const projectId = +Cookies.get('sand-projectId');
const levelId = +Cookies.get('sand-level');
const curTab = ref<string>('tab2');
const curTab = ref<string>('tab1');
const list = ref<Array<Record<string, any>>>([]);
const list1 = ref<Array<Record<string, any>>>([]);
const id = computed(() => +route.query.id);

@ -24,7 +24,7 @@
border>
<el-table-column prop="name"
label="选用"
min-width="50">
width="100">
<template #default="{ row }">
<div class="items-center">
<el-checkbox class="mr-2"
@ -35,10 +35,9 @@
</el-table-column>
<el-table-column prop="sub"
label="维度"
min-width="110"></el-table-column>
width="150"></el-table-column>
<el-table-column prop="remark"
label="计算公式"
min-width="150">
label="计算公式">
<template #default="{ row }">
<span v-if="isSelect(row.answerId1)">{{ row.remark }}</span>
<el-select v-else
@ -51,19 +50,18 @@
</el-table-column>
<el-table-column prop="index"
label="指标"
min-width="60"
width="110"
align="center">
<template #default="{ row }">
<span>{{ isSelect(row.answerId1) ? row.index : row?.recordChildren[2]?.recordChildren[0]?.name }}</span>
</template>
</el-table-column>
<el-table-column label="分值"
min-width="150"
align="center">
<template #default="{ row }">
<el-select v-if="isSelect(row.answerId1)"
v-model="row.score">
<el-option v-for="item in row?.recordChildren[1]?.subject?.itemList"
<el-option v-for="item in row?.subject?.itemList"
:key="item"
:value="item.options" />
</el-select>
@ -88,7 +86,7 @@
</el-select>
</div>
<span></span>
<span v-if="row.answerId2 !== 627"
<span v-if="row.answerId2 !== 627 && row.answerId2 !== 646"
class="mx-2 whitespace-nowrap">
{{
row.answerId2 === 607 || row.answerId2 === 609 ?
@ -98,11 +96,11 @@
',小于等于'
}}
</span>
<template v-if="row.answerId2 !== 627 && row.answerId2 !== 667 && row.answerId2 !== 668 && row.answerId2 !== 670 && row.answerId2 !== 694 && row.answerId2 !== 695">
<template v-if="row.answerId2 !== 627 && row.answerId2 !== 646 && row.answerId2 !== 667 && row.answerId2 !== 668 && row.answerId2 !== 670 && row.answerId2 !== 694 && row.answerId2 !== 695">
<div class="w-[120px] mx-2">
<el-select placeholder=""
v-model="row.percentage">
<el-option v-for="item in row?.recordChildren[2]?.recordChildren[0]?.recordChildren[1]?.subject?.itemList"
<el-option v-for="item in row.answerId2 === 669 || row.answerId2 === 671 ? row?.recordChildren[2]?.recordChildren[0]?.recordChildren[0]?.subject?.itemList : row?.recordChildren[2]?.recordChildren[0]?.recordChildren[1]?.subject?.itemList"
:key="item"
:value="item.options" />
</el-select>
@ -195,7 +193,7 @@ const form = reactive({
projectId,
description: '',
scoreCardName: '',
scoringObject: 1,
scoringObject: 0,
id: computed(() => route.query.creditId || ''),
});
@ -231,8 +229,10 @@ const getConfig = async () => {
//
const result1 = [];
process[1]?.recordChildren.slice(3).forEach((e, j) => {
const cur = form.scoringObject && detail.value[j];
result1.push({
id: e.id,
answerId1: e.id,
dimensionId: '',
name: e.name,
isChoose: false,
top: 1,
@ -242,19 +242,19 @@ const getConfig = async () => {
let temp = {
answerId1: e.id,
answerId2: n.id,
subjectId: n.subjectId,
id: '',
dimensionId: '',
strategyId: '',
name: e.name,
sub: n.name,
index: n?.recordChildren[1]?.name,
subject: n?.recordChildren[1]?.subject,
remark: n.remark,
isChoose: false,
calculationFormula: '',
score: '',
percentage: '',
span: i === 1 ? 1 : 0,
middle: 1, //
parent: i === 1 ? '' : j,
recordChildren: n?.recordChildren,
};
result1.push(temp);
@ -262,7 +262,9 @@ const getConfig = async () => {
n?.recordChildren.forEach((m, o) => {
if (o > 1) {
temp = JSON.parse(JSON.stringify(temp));
temp.parent = i;
temp.index = m.name;
temp.subject = m.subject;
delete temp.middle;
result1.push(temp);
}
@ -271,8 +273,334 @@ const getConfig = async () => {
}
});
});
if (form.scoringObject && detail.value.length) {
result1[0].dimensionId = detail.value[0]?.dimensionId;
result1[0].isChoose = !!detail.value[0]?.isChoose;
// 4
result1[1].dimensionId = detail.value[1]?.dimensionId;
result1[1].isChoose = !!detail.value[1]?.isChoose;
result1[1].id = detail.value[1].dimensionIndexList[0]?.id;
result1[1].dimensionId = detail.value[1].dimensionIndexList[0]?.dimensionId;
result1[1].score = detail.value[1].dimensionIndexList[0]?.score;
result1[2].id = detail.value[1].dimensionIndexList[1]?.id;
result1[2].dimensionId = detail.value[1].dimensionIndexList[1]?.dimensionId;
result1[2].score = detail.value[1].dimensionIndexList[1]?.score;
result1[3].id = detail.value[1].dimensionIndexList[2]?.id;
result1[3].dimensionId = detail.value[1].dimensionIndexList[2]?.dimensionId;
result1[3].score = detail.value[1].dimensionIndexList[2]?.score;
result1[4].dimensionId = detail.value[2]?.dimensionId;
result1[4].isChoose = !!detail.value[2]?.isChoose;
result1[4].id = detail.value[2].dimensionIndexList[0]?.id;
result1[4].dimensionId = detail.value[2].dimensionIndexList[0]?.dimensionId;
result1[4].score = detail.value[2].dimensionIndexList[0]?.score;
result1[5].id = detail.value[2].dimensionIndexList[1]?.id;
result1[5].dimensionId = detail.value[2].dimensionIndexList[1]?.dimensionId;
result1[5].score = detail.value[2].dimensionIndexList[1]?.score;
result1[6].id = detail.value[2].dimensionIndexList[2]?.id;
result1[6].dimensionId = detail.value[2].dimensionIndexList[2]?.dimensionId;
result1[6].score = detail.value[2].dimensionIndexList[2]?.score;
result1[7].dimensionId = detail.value[3]?.dimensionId;
result1[7].isChoose = !!detail.value[3]?.isChoose;
result1[7].id = detail.value[3].dimensionIndexList[0]?.id;
result1[7].dimensionId = detail.value[3].dimensionIndexList[0]?.dimensionId;
result1[7].score = detail.value[3].dimensionIndexList[0]?.score;
result1[8].id = detail.value[3].dimensionIndexList[1]?.id;
result1[8].dimensionId = detail.value[3].dimensionIndexList[1]?.dimensionId;
result1[8].score = detail.value[3].dimensionIndexList[1]?.score;
result1[9].id = detail.value[3].dimensionIndexList[2]?.id;
result1[9].dimensionId = detail.value[3].dimensionIndexList[2]?.dimensionId;
result1[9].score = detail.value[3].dimensionIndexList[2]?.score;
result1[10].dimensionId = detail.value[4]?.dimensionId;
result1[10].isChoose = !!detail.value[4]?.isChoose;
result1[10].id = detail.value[4].dimensionIndexList[0]?.id;
result1[10].dimensionId = detail.value[4].dimensionIndexList[0]?.dimensionId;
result1[10].score = detail.value[4].dimensionIndexList[0]?.score;
result1[11].id = detail.value[4].dimensionIndexList[1]?.id;
result1[11].dimensionId = detail.value[4].dimensionIndexList[1]?.dimensionId;
result1[11].score = detail.value[4].dimensionIndexList[1]?.score;
result1[12].id = detail.value[4].dimensionIndexList[2]?.id;
result1[12].dimensionId = detail.value[4].dimensionIndexList[2]?.dimensionId;
result1[12].score = detail.value[4].dimensionIndexList[2]?.score;
// <>4
result1[13].dimensionId = detail.value[5]?.dimensionId;
result1[13].isChoose = !!detail.value[5]?.isChoose;
result1[14].dimensionId = detail.value[6]?.dimensionId;
result1[14].isChoose = !!detail.value[6]?.isChoose;
result1[14].calculationFormula = detail.value[6]?.calculationFormula;
result1[14].dimensionId = detail.value[6]?.dimensionIndexList[0]?.dimensionId;
result1[14].id = detail.value[6]?.dimensionIndexList[0]?.id;
result1[14].percentage = detail.value[6]?.dimensionIndexList[0]?.percentage;
result1[14].score = detail.value[6]?.dimensionIndexList[0]?.score;
result1[15].dimensionId = detail.value[7]?.dimensionId;
result1[15].isChoose = !!detail.value[7]?.isChoose;
result1[15].calculationFormula = detail.value[7]?.calculationFormula;
result1[15].dimensionId = detail.value[7]?.dimensionIndexList[0]?.dimensionId;
result1[15].id = detail.value[7]?.dimensionIndexList[0]?.id;
result1[15].percentage = detail.value[7]?.dimensionIndexList[0]?.percentage;
result1[15].score = detail.value[7]?.dimensionIndexList[0]?.score;
result1[16].dimensionId = detail.value[8]?.dimensionId;
result1[16].isChoose = !!detail.value[8]?.isChoose;
result1[16].calculationFormula = detail.value[8]?.calculationFormula;
result1[16].dimensionId = detail.value[8]?.dimensionIndexList[0]?.dimensionId;
result1[16].id = detail.value[8]?.dimensionIndexList[0]?.id;
result1[16].percentage = detail.value[8]?.dimensionIndexList[0]?.percentage;
result1[16].score = detail.value[8]?.dimensionIndexList[0]?.score;
result1[17].dimensionId = detail.value[9]?.dimensionId;
result1[17].isChoose = !!detail.value[9]?.isChoose;
result1[17].calculationFormula = detail.value[9]?.calculationFormula;
result1[17].dimensionId = detail.value[9]?.dimensionIndexList[0]?.dimensionId;
result1[17].id = detail.value[9]?.dimensionIndexList[0]?.id;
result1[17].percentage = detail.value[9]?.dimensionIndexList[0]?.percentage;
result1[17].score = detail.value[9]?.dimensionIndexList[0]?.score;
// <>7
result1[18].dimensionId = detail.value[10]?.dimensionId;
result1[18].isChoose = !!detail.value[10]?.isChoose;
result1[19].dimensionId = detail.value[11]?.dimensionId;
result1[19].isChoose = !!detail.value[11]?.isChoose;
result1[19].calculationFormula = detail.value[11]?.calculationFormula;
result1[19].dimensionId = detail.value[11]?.dimensionIndexList[0]?.dimensionId;
result1[19].id = detail.value[11]?.dimensionIndexList[0]?.id;
result1[19].percentage = detail.value[11]?.dimensionIndexList[0]?.percentage;
result1[19].score = detail.value[11]?.dimensionIndexList[0]?.score;
result1[20].dimensionId = detail.value[12]?.dimensionId;
result1[20].isChoose = !!detail.value[12]?.isChoose;
result1[20].calculationFormula = detail.value[12]?.calculationFormula;
result1[20].dimensionId = detail.value[12]?.dimensionIndexList[0]?.dimensionId;
result1[20].id = detail.value[12]?.dimensionIndexList[0]?.id;
result1[20].percentage = detail.value[12]?.dimensionIndexList[0]?.percentage;
result1[20].score = detail.value[12]?.dimensionIndexList[0]?.score;
result1[21].dimensionId = detail.value[13]?.dimensionId;
result1[21].isChoose = !!detail.value[13]?.isChoose;
result1[21].calculationFormula = detail.value[13]?.calculationFormula;
result1[21].dimensionId = detail.value[13]?.dimensionIndexList[0]?.dimensionId;
result1[21].id = detail.value[13]?.dimensionIndexList[0]?.id;
result1[21].percentage = detail.value[13]?.dimensionIndexList[0]?.percentage;
result1[21].score = detail.value[13]?.dimensionIndexList[0]?.score;
result1[22].dimensionId = detail.value[14]?.dimensionId;
result1[22].isChoose = !!detail.value[14]?.isChoose;
result1[22].calculationFormula = detail.value[14]?.calculationFormula;
result1[22].dimensionId = detail.value[14]?.dimensionIndexList[0]?.dimensionId;
result1[22].id = detail.value[14]?.dimensionIndexList[0]?.id;
result1[22].percentage = detail.value[14]?.dimensionIndexList[0]?.percentage;
result1[22].score = detail.value[14]?.dimensionIndexList[0]?.score;
result1[23].dimensionId = detail.value[15]?.dimensionId;
result1[23].isChoose = !!detail.value[15]?.isChoose;
result1[23].calculationFormula = detail.value[15]?.calculationFormula;
result1[23].dimensionId = detail.value[15]?.dimensionIndexList[0]?.dimensionId;
result1[23].id = detail.value[15]?.dimensionIndexList[0]?.id;
result1[23].percentage = detail.value[15]?.dimensionIndexList[0]?.percentage;
result1[23].score = detail.value[15]?.dimensionIndexList[0]?.score;
result1[24].dimensionId = detail.value[16]?.dimensionId;
result1[24].isChoose = detail.value[16]?.isChoose;
result1[24].calculationFormula = detail.value[16]?.calculationFormula;
result1[24].dimensionId = detail.value[16]?.dimensionIndexList[0]?.dimensionId;
result1[24].id = detail.value[16]?.dimensionIndexList[0]?.id;
result1[24].percentage = detail.value[16]?.dimensionIndexList[0]?.percentage;
result1[24].score = detail.value[16]?.dimensionIndexList[0]?.score;
result1[25].dimensionId = detail.value[17]?.dimensionId;
result1[25].isChoose = !!detail.value[17]?.isChoose;
result1[25].calculationFormula = detail.value[17]?.calculationFormula;
result1[25].dimensionId = detail.value[17]?.dimensionIndexList[0]?.dimensionId;
result1[25].id = detail.value[17]?.dimensionIndexList[0]?.id;
result1[25].percentage = detail.value[17]?.dimensionIndexList[0]?.percentage;
result1[25].score = detail.value[17]?.dimensionIndexList[0]?.score;
// <>6
result1[26].dimensionId = detail.value[18]?.dimensionId;
result1[26].isChoose = !!detail.value[18]?.isChoose;
result1[27].dimensionId = detail.value[19]?.dimensionId;
result1[27].isChoose = !!detail.value[19]?.isChoose;
result1[27].calculationFormula = detail.value[19]?.calculationFormula;
result1[27].dimensionId = detail.value[19]?.dimensionIndexList[0]?.dimensionId;
result1[27].id = detail.value[19]?.dimensionIndexList[0]?.id;
result1[27].percentage = detail.value[19]?.dimensionIndexList[0]?.percentage;
result1[27].score = detail.value[19]?.dimensionIndexList[0]?.score;
result1[28].dimensionId = detail.value[20]?.dimensionId;
result1[28].isChoose = !!detail.value[20]?.isChoose;
result1[28].calculationFormula = detail.value[20]?.calculationFormula;
result1[28].dimensionId = detail.value[20]?.dimensionIndexList[0]?.dimensionId;
result1[28].id = detail.value[20]?.dimensionIndexList[0]?.id;
result1[28].percentage = detail.value[20]?.dimensionIndexList[0]?.percentage;
result1[28].score = detail.value[20]?.dimensionIndexList[0]?.score;
result1[29].dimensionId = detail.value[21]?.dimensionId;
result1[29].isChoose = !!detail.value[21]?.isChoose;
result1[29].calculationFormula = detail.value[21]?.calculationFormula;
result1[29].dimensionId = detail.value[21]?.dimensionIndexList[0]?.dimensionId;
result1[29].id = detail.value[21]?.dimensionIndexList[0]?.id;
result1[29].percentage = detail.value[21]?.dimensionIndexList[0]?.percentage;
result1[29].score = detail.value[21]?.dimensionIndexList[0]?.score;
result1[30].dimensionId = detail.value[22]?.dimensionId;
result1[30].isChoose = !!detail.value[22]?.isChoose;
result1[30].calculationFormula = detail.value[22]?.calculationFormula;
result1[30].dimensionId = detail.value[22]?.dimensionIndexList[0]?.dimensionId;
result1[30].id = detail.value[22]?.dimensionIndexList[0]?.id;
result1[30].percentage = detail.value[22]?.dimensionIndexList[0]?.percentage;
result1[30].score = detail.value[22]?.dimensionIndexList[0]?.score;
result1[31].dimensionId = detail.value[23]?.dimensionId;
result1[31].isChoose = !!detail.value[23]?.isChoose;
result1[31].calculationFormula = detail.value[23]?.calculationFormula;
result1[31].dimensionId = detail.value[23]?.dimensionIndexList[0]?.dimensionId;
result1[31].id = detail.value[23]?.dimensionIndexList[0]?.id;
result1[31].percentage = detail.value[23]?.dimensionIndexList[0]?.percentage;
result1[31].score = detail.value[23]?.dimensionIndexList[0]?.score;
result1[32].dimensionId = detail.value[24]?.dimensionId;
result1[32].isChoose = !!detail.value[24]?.isChoose;
result1[32].calculationFormula = detail.value[24]?.calculationFormula;
result1[32].dimensionId = detail.value[24]?.dimensionIndexList[0]?.dimensionId;
result1[32].id = detail.value[24]?.dimensionIndexList[0]?.id;
result1[32].percentage = detail.value[24]?.dimensionIndexList[0]?.percentage;
result1[32].score = detail.value[24]?.dimensionIndexList[0]?.score;
// <>5
result1[33].dimensionId = detail.value[25]?.dimensionId;
result1[33].isChoose = !!detail.value[25]?.isChoose;
result1[34].dimensionId = detail.value[26]?.dimensionId;
result1[34].isChoose = !!detail.value[26]?.isChoose;
result1[34].calculationFormula = detail.value[26]?.calculationFormula;
result1[34].dimensionId = detail.value[26]?.dimensionIndexList[0]?.dimensionId;
result1[34].id = detail.value[26]?.dimensionIndexList[0]?.id;
result1[34].percentage = detail.value[26]?.dimensionIndexList[0]?.percentage;
result1[34].score = detail.value[26]?.dimensionIndexList[0]?.score;
result1[35].dimensionId = detail.value[27]?.dimensionId;
result1[35].isChoose = !!detail.value[27]?.isChoose;
result1[35].calculationFormula = detail.value[27]?.calculationFormula;
result1[35].dimensionId = detail.value[27]?.dimensionIndexList[0]?.dimensionId;
result1[35].id = detail.value[27]?.dimensionIndexList[0]?.id;
result1[35].percentage = detail.value[27]?.dimensionIndexList[0]?.percentage;
result1[35].score = detail.value[27]?.dimensionIndexList[0]?.score;
result1[36].dimensionId = detail.value[28]?.dimensionId;
result1[36].isChoose = !!detail.value[28]?.isChoose;
result1[36].calculationFormula = detail.value[28]?.calculationFormula;
result1[36].dimensionId = detail.value[28]?.dimensionIndexList[0]?.dimensionId;
result1[36].id = detail.value[28]?.dimensionIndexList[0]?.id;
result1[36].percentage = detail.value[28]?.dimensionIndexList[0]?.percentage;
result1[36].score = detail.value[28]?.dimensionIndexList[0]?.score;
result1[37].dimensionId = detail.value[29]?.dimensionId;
result1[37].isChoose = !!detail.value[29]?.isChoose;
result1[37].calculationFormula = detail.value[29]?.calculationFormula;
result1[37].dimensionId = detail.value[29]?.dimensionIndexList[0]?.dimensionId;
result1[37].id = detail.value[29]?.dimensionIndexList[0]?.id;
result1[37].percentage = detail.value[29]?.dimensionIndexList[0]?.percentage;
result1[37].score = detail.value[29]?.dimensionIndexList[0]?.score;
result1[38].dimensionId = detail.value[30]?.dimensionId;
result1[38].isChoose = !!detail.value[30]?.isChoose;
result1[38].calculationFormula = detail.value[30]?.calculationFormula;
result1[38].dimensionId = detail.value[30]?.dimensionIndexList[0]?.dimensionId;
result1[38].id = detail.value[30]?.dimensionIndexList[0]?.id;
result1[38].percentage = detail.value[30]?.dimensionIndexList[0]?.percentage;
result1[38].score = detail.value[30]?.dimensionIndexList[0]?.score;
// <>3
result1[39].dimensionId = detail.value[31]?.dimensionId;
result1[39].isChoose = !!detail.value[31]?.isChoose;
result1[40].dimensionId = detail.value[32]?.dimensionId;
result1[40].isChoose = !!detail.value[32]?.isChoose;
result1[40].id = detail.value[32].dimensionIndexList[0]?.id;
result1[40].dimensionId = detail.value[32].dimensionIndexList[0]?.dimensionId;
result1[40].score = detail.value[32].dimensionIndexList[0]?.score;
result1[41].id = detail.value[32].dimensionIndexList[1]?.id;
result1[41].dimensionId = detail.value[32].dimensionIndexList[1]?.dimensionId;
result1[41].score = detail.value[32].dimensionIndexList[1]?.score;
result1[42].id = detail.value[32].dimensionIndexList[2]?.id;
result1[42].dimensionId = detail.value[32].dimensionIndexList[2]?.dimensionId;
result1[42].score = detail.value[32].dimensionIndexList[2]?.score;
result1[43].dimensionId = detail.value[33]?.dimensionId;
result1[43].isChoose = !!detail.value[33]?.isChoose;
result1[43].id = detail.value[33].dimensionIndexList[0]?.id;
result1[43].dimensionId = detail.value[33].dimensionIndexList[0]?.dimensionId;
result1[43].score = detail.value[33].dimensionIndexList[0]?.score;
result1[44].id = detail.value[33].dimensionIndexList[1]?.id;
result1[44].dimensionId = detail.value[33].dimensionIndexList[1]?.dimensionId;
result1[44].score = detail.value[33].dimensionIndexList[1]?.score;
result1[45].id = detail.value[33].dimensionIndexList[2]?.id;
result1[45].dimensionId = detail.value[33].dimensionIndexList[2]?.dimensionId;
result1[45].score = detail.value[33].dimensionIndexList[2]?.score;
result1[46].dimensionId = detail.value[34]?.dimensionId;
result1[46].isChoose = !!detail.value[34]?.isChoose;
result1[46].id = detail.value[34].dimensionIndexList[0]?.id;
result1[46].dimensionId = detail.value[34].dimensionIndexList[0]?.dimensionId;
result1[46].score = detail.value[34].dimensionIndexList[0]?.score;
result1[47].id = detail.value[34].dimensionIndexList[1]?.id;
result1[47].dimensionId = detail.value[34].dimensionIndexList[1]?.dimensionId;
result1[47].score = detail.value[34].dimensionIndexList[1]?.score;
result1[48].id = detail.value[34].dimensionIndexList[2]?.id;
result1[48].dimensionId = detail.value[34].dimensionIndexList[2]?.dimensionId;
result1[48].score = detail.value[34].dimensionIndexList[2]?.score;
// <>2
result1[49].dimensionId = detail.value[35]?.dimensionId;
result1[49].isChoose = !!detail.value[35]?.isChoose;
result1[50].dimensionId = detail.value[36]?.dimensionId;
result1[50].isChoose = !!detail.value[36]?.isChoose;
result1[50].calculationFormula = detail.value[36]?.calculationFormula;
result1[50].dimensionId = detail.value[36]?.dimensionIndexList[0]?.dimensionId;
result1[50].id = detail.value[36]?.dimensionIndexList[0]?.id;
result1[50].percentage = detail.value[36]?.dimensionIndexList[0]?.percentage;
result1[50].score = detail.value[36]?.dimensionIndexList[0]?.score;
result1[51].dimensionId = detail.value[37]?.dimensionId;
result1[51].isChoose = !!detail.value[37]?.isChoose;
result1[51].calculationFormula = detail.value[37]?.calculationFormula;
result1[51].dimensionId = detail.value[37]?.dimensionIndexList[0]?.dimensionId;
result1[51].id = detail.value[37]?.dimensionIndexList[0]?.id;
result1[51].percentage = detail.value[37]?.dimensionIndexList[0]?.percentage;
result1[51].score = detail.value[37]?.dimensionIndexList[0]?.score;
}
list1.value = result1;
console.log('🚀 ~ file: Credit.vue:202 ~ getConfig ~ result1:', result1);
loading.close();
};
//
@ -300,7 +628,7 @@ const getDetail = async () => {
form.description = '';
form.projectId = projectId;
form.scoreCardName = '';
form.scoringObject = 1;
form.scoringObject = 0;
}
};
watch(
@ -390,30 +718,81 @@ const submit = async () => {
if (!form.scoreCardName) return ElMessage.error('请输入评分卡名称');
loading = ElLoading.service();
const param = [];
const isEnterprise = form.scoringObject;
//
if (form.scoringObject) {
list1.value.forEach((e, i) => {
const child = {
id: e?.id || '',
dimensionId: e.dimensionId ?? '',
recordName: e.index ?? '',
score: e.score,
percentage: e.percentage,
};
const temp = {
calculationFormula: e.calculationFormula ?? '',
dimensionId: e.dimensionId ?? '',
strategyId: id.value || '',
recordName: e.name,
isChoose: +e.isChoose,
};
if (e.middle) {
temp.dimensionIndexList = [child];
if ((e.answerId2 > 595 && e.answerId2 < 600) || (e.answerId2 > 687 && e.answerId2 < 691))
temp.dimensionIndexList.push(
{
id: list1.value[i + 1].id ?? '',
dimensionId: list1.value[i + 1].dimensionId ?? '',
recordName: list1.value[i + 1].index ?? '',
score: list1.value[i + 1].score,
percentage: list1.value[i + 1].percentage,
},
{
id: list1.value[i + 2].id ?? '',
dimensionId: list1.value[i + 2].dimensionId ?? '',
recordName: list1.value[i + 2].index ?? '',
score: list1.value[i + 2].score,
percentage: list1.value[i + 2].percentage,
},
);
temp.recordName = e.sub;
param.push(temp);
} else if (e.top) {
param.push(temp);
}
});
} else {
//
list.value.forEach((e) => {
const child = {
id: e.id,
dimensionId: e.dimensionId,
recordName: e.sub,
score: e.score,
recordName: e.index,
percentage: e.percentage,
};
if (e.span) {
param.push({
const temp = {
dimensionId: e.dimensionId,
strategyId: e.strategyId,
recordName: e.name,
isChoose: +e.isChoose,
dimensionIndexList: [child],
});
};
if (e.span) {
param.push(temp);
} else {
param[e.parent].dimensionIndexList.push(child);
}
});
}
// debugger;
await saveCredit({
...form,
dimensionOfTheRatingTableList: param,
});
// addRecord();
addRecord();
ElMessage.success('提交成功!');
emit('getList', 1);
@ -428,12 +807,54 @@ const addRecord = async () => {
//
if (isEnterprise) {
list.value.forEach((e) => {
//
list1.value.forEach((e) => {
//
if (e.isChoose) {
e.middle ? lcRule.push(handleId(518, '', '', `${preIds},${e.answerId1},${e.answerId2},518`, '')) : lcRule.push(handleId(518, '', '', `${preIds},${e.answerId1},518`, ''));
}
lcRule.push(handleId(e.answerId2, e.subjectId, e?.itemList?.find((n) => n.options == e.score)?.itemId || '', `${preIds},${e.answerId1},${e.answerId2}`, 1));
//
if (isSelect(e.answerId1)) {
e.score &&
lcRule.push(
handleId(e.answerId2, e?.subject?.subjectId, e?.subject?.itemList?.find((n) => n.options == e.score)?.itemId || '', `${preIds},${e.answerId1},${e.answerId2}`, 1),
);
} else if (e.recordChildren) {
//
e.calculationFormula &&
lcRule.push(
handleId(
e?.recordChildren[1]?.id,
e?.subject?.subjectId,
e?.subject?.itemList?.find((n) => n.options === e.calculationFormula)?.itemId || '',
`${preIds},${e.answerId1},${e.answerId2},${e?.recordChildren[1]?.id}`,
1,
),
);
//
e.score &&
lcRule.push(
handleId(
e?.recordChildren[2]?.recordChildren[0]?.recordChildren[0]?.id,
e?.recordChildren[2]?.recordChildren[0]?.recordChildren[0]?.subject?.subjectId,
e?.recordChildren[2]?.recordChildren[0]?.recordChildren[0]?.subject?.itemList?.find((n) => n.options === e.score)?.itemId || '',
`${preIds},${e.answerId1},${e.answerId2},${e?.recordChildren[2]?.id},${e?.recordChildren[2]?.recordChildren[0]?.id},${e?.recordChildren[2]?.recordChildren[0]?.recordChildren[0]?.id}`,
1,
),
);
//
e.percentage &&
lcRule.push(
handleId(
e?.recordChildren[2]?.recordChildren[0]?.recordChildren[1]?.id,
e?.recordChildren[2]?.recordChildren[0]?.recordChildren[1]?.subject?.subjectId,
e?.recordChildren[2]?.recordChildren[0]?.recordChildren[1]?.subject?.itemList?.find((n) => n.options === e.percentage)?.itemId || '',
`${preIds},${e.answerId1},${e.answerId2},${e?.recordChildren[2]?.id},${e?.recordChildren[2]?.recordChildren[0]?.id},${e?.recordChildren[2]?.recordChildren[0]?.recordChildren[1]?.id}`,
1,
),
);
}
});
} else {
//
@ -442,7 +863,6 @@ const addRecord = async () => {
lcRule.push(handleId(e.answerId2, e.subjectId, e?.itemList?.find((n) => n.options == e.score)?.itemId || '', preIds + ',' + e.answerId1 + ',' + e.answerId2, 1));
});
}
await addOperation({
checkpointId: levelId,
parentId: preIds,

Loading…
Cancel
Save