风险度策略

V0.1
yujialong 1 year ago
parent 3e8ccd8529
commit ecec0c7dd6
  1. 37
      src/views/product/strategy/CardList.vue
  2. 1
      src/views/product/strategy/Credit.vue
  3. 140
      src/views/product/strategy/Risk1.vue
  4. 162
      src/views/product/strategy/Risk2.vue
  5. 137
      src/views/product/strategy/Risk3.vue

@ -66,7 +66,26 @@
</div>
</el-tab-pane>
<el-tab-pane label="风险度策略"
name="tab3"> </el-tab-pane>
name="tab3">
<div class="flex">
<div class="left w-[241px] min-w-[241px] pr-5 py-4">
<ul class="products">
<li v-for="(item, i) in list2"
:key="i"
:class="{ active: item.id === riskId }"
@click="switchProductRisk(item.id)">
<h6>{{ item.name }}</h6>
<p class="mt-2 des">{{ item.remark }}</p>
</li>
</ul>
</div>
<div class="right flex-1 px-5 pt-2">
<Risk1 v-if="riskId === 702" />
<Risk2 v-else-if="riskId === 703" />
<Risk3 v-else-if="riskId === 704" />
</div>
</div>
</el-tab-pane>
</el-tabs>
</div>
</template>
@ -87,16 +106,21 @@ import Com5 from './154.vue';
import Com6 from './155.vue';
import Com7 from './156.vue';
import Credit from './Credit.vue';
import Risk1 from './Risk1.vue';
import Risk2 from './Risk2.vue';
import Risk3 from './Risk3.vue';
const router = useRouter();
const route = useRoute();
const projectId = +Cookies.get('sand-projectId');
const levelId = +Cookies.get('sand-level');
const curTab = ref<string>('tab1');
const curTab = ref<string>('tab3');
const list = ref<Array<Record<string, any>>>([]);
const list1 = ref<Array<Record<string, any>>>([]);
const list2 = ref<Array<Record<string, any>>>([]);
const id = computed(() => +route.query.id);
const creditId = computed(() => +route.query.creditId);
const riskId = ref<number>(702);
//
const switchProduct = (id: number) => {
@ -106,6 +130,10 @@ const switchProduct = (id: number) => {
const switchProductCredit = (id: number) => {
router.push(`/product/strategy?type=${route.query.type}&i=${route.query.i}&role=${route.query.role}&creditId=${id}`);
};
//
const switchProductRisk = (id: number) => {
riskId.value = id;
};
//
const getList = async (refresh?: number) => {
if (curTab.value === 'tab1') {
@ -113,7 +141,7 @@ const getList = async (refresh?: number) => {
// eslint-disable-next-line no-unused-expressions
!id.value && switchProduct(process[0].recordChildren[0].id);
list.value = process;
} else {
} else if (curTab.value === 'tab2') {
const res = await listCredit({
checkpointId: levelId,
projectId,
@ -123,6 +151,9 @@ const getList = async (refresh?: number) => {
// eslint-disable-next-line no-unused-expressions
((!route.query.add && !creditId.value && res.data.length) || refresh) && switchProductCredit(res.data[0].id);
list1.value = res.data;
} else {
const { process } = await getProcessInformationBasedOnRoles(149);
list2.value = process;
}
};
onMounted(() => {

@ -1,4 +1,5 @@
<template>
<!-- 信用评分策略 -->
<div id="wrap">
<div class="flex items-center">
<span class="mr-2 text-sm font-semibold text-[#333] whitespace-nowrap">评级卡名称</span>

@ -0,0 +1,140 @@
<template>
<!-- 风险度策略-信用评分基础系数 -->
<div class="mb-3 text-sm font-semibold">
单笔贷款风险度公式
<span class="text-[#0034ad]">单笔贷款风险度=</span>
<span class="text-[#8f24ff]">信用评分基础系数</span>
<span class="text-[#0034ad]"> * </span>
<span class="text-[#5cc12b]">担保方式基础系数</span>
<span class="text-[#0034ad]"> * </span>
<span class="text-[#ed8269]">贷款期限基础系数</span>
</div>
<h6 class="mb-3 text-sm text-[#006BFF] font-semibold">个人评分系数配置</h6>
<el-table class="c-table"
:data="form.slice(0,10)"
border>
<el-table-column prop="recordName"
label="信用等级"
min-width="150"
align="center">
</el-table-column>
<el-table-column label="系数"
min-width="150"
align="center">
<template #default="{ row }">
<el-input v-model="row.coefficient"></el-input>
</template>
</el-table-column>
</el-table>
<h6 class="mt-5 mb-3 text-sm text-[#006BFF] font-semibold">企业评分系数配置</h6>
<el-table class="c-table"
:data="form.slice(10)"
border>
<el-table-column prop="recordName"
label="信用等级"
min-width="150"
align="center">
</el-table-column>
<el-table-column label="系数"
min-width="150"
align="center">
<template #default="{ row }">
<el-input placeholder="输入系数"
v-model="row.coefficient"></el-input>
</template>
</el-table-column>
</el-table>
<div class="flex justify-end">
<div class="submit"
@click="submit">完成配置</div>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted } from 'vue';
import { ElMessage } from 'element-plus';
import { detailRick, saveRick } from '@/api/model';
import { getProcessInformationBasedOnRoles, addOperation } from '@/api/judgment';
import { useRouter, useRoute } from 'vue-router';
import { handleId } from '@/utils/common';
import Cookies from 'js-cookie';
const router = useRouter();
const route = useRoute();
const projectId = +Cookies.get('sand-projectId');
const levelId = +Cookies.get('sand-level');
const form = ref<Record<string, any>[]>([]);
const info = ref<Record<string, any>[]>([]);
//
const getConfig = async () => {
const { process } = await getProcessInformationBasedOnRoles(702);
const result = [];
process.forEach((e, i) => {
e.recordChildren[0]?.recordChildren?.forEach((n, j) => {
const cur = info.value.length ? info.value[i ? 10 + j : j] : {};
result.push({
checkpointId: levelId,
projectId,
coefficient: cur?.coefficient || '',
id: cur?.id || '',
answerId: n.id,
subjectId: n.subjectId,
recordName: n.name,
type: 1,
});
});
});
form.value = result;
};
//
const getDetail = async () => {
try {
const { data } = await detailRick({
checkpointId: levelId,
projectId,
type: 1,
});
info.value = data;
getConfig();
} finally {
}
};
onMounted(() => {
getDetail();
});
//
const submit = async () => {
await saveRick({ riskDegreeStrategyList: form.value });
addRecord();
getDetail();
ElMessage.success('配置成功!');
};
//
const addRecord = async () => {
const preIds = `1,${Cookies.get('sand-level')},42,149,702`; // 1id
const rule: Array<Record<string, any>> = [];
form.value.forEach((e, i) => {
e.coefficient && rule.push(handleId(e.answerId, e.subjectId, e.coefficient, `${preIds},${i > 9 ? '706,707' : '705,707'},${e.answerId}`, 3));
});
await addOperation({
checkpointId: levelId,
parentId: preIds,
lcJudgmentRuleReq: rule,
projectId,
});
};
</script>
<style lang="scss" scoped>
@import url(../../../styles/form.scss);
.c-table {
:deep(.el-input__inner) {
@apply px-2;
}
}
</style>

@ -0,0 +1,162 @@
<template>
<!-- 风险度策略-担保方式基础系数 -->
<div class="mb-3 text-sm font-semibold">
单笔贷款风险度公式
<span class="text-[#0034ad]">单笔贷款风险度=</span>
<span class="text-[#8f24ff]">信用等级基础系数</span>
<span class="text-[#0034ad]"> * </span>
<span class="text-[#5cc12b]">担保方式基础系数</span>
<span class="text-[#0034ad]"> * </span>
<span class="text-[#ed8269]">贷款期限基础系数</span>
</div>
<el-table class="c-table"
:data="form"
border>
<el-table-column prop="recordName"
label="信用等级"
min-width="150">
<template #default="{ row, $index }">
<p :class="$index === 5 || $index === 6 || $index === 7 ? 'pl-20' : !$index || $index === 1 || $index === 10 || $index === 23 ? '' : 'pl-10'">{{ row.recordName }}</p>
</template>
</el-table-column>
<el-table-column label="系数"
min-width="150"
align="center">
<template #default="{ row, $index }">
<p v-if="$index === 1 || $index === 4 || $index === 10 || $index === 23">--</p>
<el-input v-else
placeholder="输入系数"
v-model="row.coefficient"></el-input>
</template>
</el-table-column>
</el-table>
<div class="flex justify-end">
<div class="submit"
@click="submit">完成配置</div>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted } from 'vue';
import { ElMessage } from 'element-plus';
import { detailRick, saveRick } from '@/api/model';
import { getProcessInformationBasedOnRoles, addOperation } from '@/api/judgment';
import { useRouter, useRoute } from 'vue-router';
import { handleId } from '@/utils/common';
import Cookies from 'js-cookie';
const router = useRouter();
const route = useRoute();
const projectId = +Cookies.get('sand-projectId');
const levelId = +Cookies.get('sand-level');
const form = ref<Record<string, any>[]>([]);
const info = ref<Record<string, any>[]>([]);
//
const getConfig = async () => {
const { process } = await getProcessInformationBasedOnRoles(703);
const result = [];
process[0]?.recordChildren?.forEach((e, i) => {
const cur = {};
let temp = {
checkpointId: levelId,
projectId,
coefficient: cur?.coefficient || '',
id: cur?.id || '',
recordName: e.name,
type: 2,
};
result.push(temp);
e?.recordChildren?.forEach((n, j) => {
temp = JSON.parse(JSON.stringify(temp));
temp.recordName = n.name;
temp.coefficient = n.coefficient || '';
result.push(temp);
n?.recordChildren?.forEach((m, o) => {
temp = JSON.parse(JSON.stringify(temp));
temp.recordName = m.name;
temp.coefficient = m.coefficient || '';
result.push(temp);
});
});
});
form.value = result;
};
//
const getDetail = async () => {
try {
const { data } = await detailRick({
checkpointId: levelId,
projectId,
type: 2,
});
info.value = data;
if (data.length) {
form.value = data;
} else {
getConfig();
}
} finally {
}
};
onMounted(() => {
getDetail();
});
//
const submit = async () => {
await saveRick({ riskDegreeStrategyList: form.value });
addRecord();
getDetail();
ElMessage.success('配置成功!');
};
//
const addRecord = async () => {
const preIds = `1,${Cookies.get('sand-level')},42,149,703,718`; // 1id
const rule: Array<Record<string, any>> = [
handleId(719, 232, form.value[0].coefficient, `${preIds},719`, 3),
handleId(723, 232, form.value[2].coefficient, `${preIds},720,723`, 3),
handleId(724, 232, form.value[3].coefficient, `${preIds},720,724`, 3),
handleId(728, 232, form.value[5].coefficient, `${preIds},720,725,728`, 3),
handleId(729, 232, form.value[6].coefficient, `${preIds},720,725,729`, 3),
handleId(730, 232, form.value[7].coefficient, `${preIds},720,725,730`, 3),
handleId(726, 232, form.value[8].coefficient, `${preIds},720,726`, 3),
handleId(727, 232, form.value[9].coefficient, `${preIds},720,727`, 3),
handleId(731, 232, form.value[11].coefficient, `${preIds},721,731`, 3),
handleId(732, 232, form.value[12].coefficient, `${preIds},721,732`, 3),
handleId(733, 232, form.value[13].coefficient, `${preIds},721,733`, 3),
handleId(734, 232, form.value[14].coefficient, `${preIds},721,734`, 3),
handleId(735, 232, form.value[15].coefficient, `${preIds},721,735`, 3),
handleId(736, 232, form.value[16].coefficient, `${preIds},721,736`, 3),
handleId(737, 232, form.value[17].coefficient, `${preIds},721,737`, 3),
handleId(738, 232, form.value[18].coefficient, `${preIds},721,738`, 3),
handleId(739, 232, form.value[19].coefficient, `${preIds},721,739`, 3),
handleId(740, 232, form.value[20].coefficient, `${preIds},721,740`, 3),
handleId(741, 232, form.value[21].coefficient, `${preIds},721,741`, 3),
handleId(742, 232, form.value[22].coefficient, `${preIds},721,742`, 3),
handleId(743, 232, form.value[24].coefficient, `${preIds},722,743`, 3),
handleId(744, 232, form.value[25].coefficient, `${preIds},722,744`, 3),
handleId(745, 232, form.value[26].coefficient, `${preIds},722,745`, 3),
handleId(746, 232, form.value[27].coefficient, `${preIds},722,746`, 3),
];
await addOperation({
checkpointId: levelId,
parentId: preIds,
lcJudgmentRuleReq: rule,
projectId,
});
};
</script>
<style lang="scss" scoped>
@import url(../../../styles/form.scss);
.c-table {
:deep(.el-input__inner) {
@apply px-2;
}
}
</style>

@ -0,0 +1,137 @@
<template>
<!-- 风险度策略-担保方式基础系数 -->
<div class="mb-3 text-sm font-semibold">
单笔贷款风险度公式
<span class="text-[#0034ad]">单笔贷款风险度=</span>
<span class="text-[#8f24ff]">信用等级基础系数</span>
<span class="text-[#0034ad]"> * </span>
<span class="text-[#5cc12b]">担保方式基础系数</span>
<span class="text-[#0034ad]"> * </span>
<span class="text-[#ed8269]">贷款期限基础系数</span>
</div>
<el-table class="c-table"
:data="form"
border>
<el-table-column prop="recordName"
label="贷款期限"
min-width="150">
<template #default="{ row, $index }">
<p :class="!$index || $index === 3 ? '' : 'pl-10'">{{ row.recordName }}</p>
</template>
</el-table-column>
<el-table-column label="系数"
min-width="150"
align="center">
<template #default="{ row, $index }">
<p v-if="!$index || $index === 3">--</p>
<el-input v-else
placeholder="输入系数"
v-model="row.coefficient"></el-input>
</template>
</el-table-column>
</el-table>
<div class="flex justify-end">
<div class="submit"
@click="submit">完成配置</div>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted } from 'vue';
import { ElMessage } from 'element-plus';
import { detailRick, saveRick } from '@/api/model';
import { getProcessInformationBasedOnRoles, addOperation } from '@/api/judgment';
import { useRouter, useRoute } from 'vue-router';
import { handleId } from '@/utils/common';
import Cookies from 'js-cookie';
const router = useRouter();
const route = useRoute();
const projectId = +Cookies.get('sand-projectId');
const levelId = +Cookies.get('sand-level');
const form = ref<Record<string, any>[]>([]);
const info = ref<Record<string, any>[]>([]);
//
const getConfig = async () => {
const { process } = await getProcessInformationBasedOnRoles(704);
const result = [];
process[0]?.recordChildren?.forEach((e, i) => {
const cur = {};
let temp = {
checkpointId: levelId,
projectId,
coefficient: cur?.coefficient || '',
id: cur?.id || '',
recordName: e.name,
type: 3,
};
result.push(temp);
e?.recordChildren?.forEach((n, j) => {
temp = JSON.parse(JSON.stringify(temp));
temp.recordName = n.name;
temp.coefficient = n.coefficient || '';
result.push(temp);
});
});
form.value = result;
};
//
const getDetail = async () => {
try {
const { data } = await detailRick({
checkpointId: levelId,
projectId,
type: 3,
});
info.value = data;
if (data.length) {
form.value = data;
} else {
getConfig();
}
} finally {
}
};
onMounted(() => {
getDetail();
});
//
const submit = async () => {
await saveRick({ riskDegreeStrategyList: form.value });
addRecord();
getDetail();
ElMessage.success('配置成功!');
};
//
const addRecord = async () => {
const preIds = `1,${Cookies.get('sand-level')},42,149,704,747`; // 1id
const rule: Array<Record<string, any>> = [
handleId(750, 232, form.value[1].coefficient, `${preIds},748,750`, 3),
handleId(751, 232, form.value[2].coefficient, `${preIds},748,751`, 3),
handleId(752, 232, form.value[4].coefficient, `${preIds},749,752`, 3),
handleId(753, 232, form.value[5].coefficient, `${preIds},749,753`, 3),
handleId(754, 232, form.value[6].coefficient, `${preIds},749,754`, 3),
handleId(755, 232, form.value[7].coefficient, `${preIds},749,755`, 3),
];
await addOperation({
checkpointId: levelId,
parentId: preIds,
lcJudgmentRuleReq: rule,
projectId,
});
};
</script>
<style lang="scss" scoped>
@import url(../../../styles/form.scss);
.c-table {
:deep(.el-input__inner) {
@apply px-2;
}
}
</style>
Loading…
Cancel
Save