利率模型

V0.1
yujialong 1 year ago
parent 1e031b35c1
commit 8e63fe4b83
  1. 4
      .env
  2. 8
      src/api/model.ts
  3. 4
      src/styles/index.scss
  4. 22
      src/views/config/level/Index.vue
  5. 25
      src/views/product/interestRate/772.vue
  6. 15
      src/views/product/interestRate/773.vue
  7. 258
      src/views/product/interestRate/935.vue
  8. 306
      src/views/product/interestRate/936.vue
  9. 30
      src/views/product/interestRate/CardList.vue

@ -2,7 +2,7 @@ VITE_APP_TITLE=金融产品设计及数字化营销沙盘
VITE_PORT=9520 VITE_PORT=9520
VITE_PROXY=http://192.168.31.125:8080 VITE_PROXY=http://192.168.31.125:8080
VITE_PUBLIC_PATH=./ VITE_PUBLIC_PATH=./
# VITE_BASE_API=http://192.168.31.217:9000 VITE_BASE_API=http://192.168.31.51:9000
VITE_BASE_API=http://121.37.12.51 # VITE_BASE_API=http://121.37.12.51
VITE_I18N_LOCALE=zh-cn VITE_I18N_LOCALE=zh-cn
VITE_I18N_FALLBACK_LOCALE=zh-cn VITE_I18N_FALLBACK_LOCALE=zh-cn

@ -45,12 +45,12 @@ export const detailRick = async (data: Record<string, any>): Promise<any> =>
(await axios.post(`/product/riskDegreeStrategy/details?checkpointId=${data.checkpointId}&projectId=${data.projectId}&type=${data.type}`)).data; (await axios.post(`/product/riskDegreeStrategy/details?checkpointId=${data.checkpointId}&projectId=${data.projectId}&type=${data.type}`)).data;
export const saveRick = async (data: Record<string, any>): Promise<any> => (await axios.post(`/product/riskDegreeStrategy/saveOrUpdate`, data)).data; export const saveRick = async (data: Record<string, any>): Promise<any> => (await axios.post(`/product/riskDegreeStrategy/saveOrUpdate`, data)).data;
export const businessInterestRateDetails = async (data: Record<string, any>): Promise<any> => export const businessInterestRateDetails = async (checkpointId: number, projectId: number): Promise<any> =>
(await axios.post(`/product/interestRateModel/businessInterestRateDetails?checkpointId=${data.checkpointId}&projectId=${data.projectId}`)).data; (await axios.post(`/product/interestRateModel/businessInterestRateDetails?checkpointId=${checkpointId}&projectId=${projectId}`)).data;
export const businessInterestRateSaveOrUpdate = async (data: Record<string, any>): Promise<any> => export const businessInterestRateSaveOrUpdate = async (data: Record<string, any>): Promise<any> =>
(await axios.post(`/product/interestRateModel/businessInterestRateSaveOrUpdate`, data)).data; (await axios.post(`/product/interestRateModel/businessInterestRateSaveOrUpdate`, data)).data;
export const personalInterestRateDetails = async (data: Record<string, any>): Promise<any> => export const personalInterestRateDetails = async (checkpointId: number, projectId: number): Promise<any> =>
(await axios.post(`/product/interestRateModel/personalInterestRateDetails?checkpointId=${data.checkpointId}&projectId=${data.projectId}`)).data; (await axios.post(`/product/interestRateModel/personalInterestRateDetails?checkpointId=${checkpointId}&projectId=${projectId}`)).data;
export const personalInterestRateSaveOrUpdate = async (data: Record<string, any>): Promise<any> => export const personalInterestRateSaveOrUpdate = async (data: Record<string, any>): Promise<any> =>
(await axios.post(`/product/interestRateModel/personalInterestRateSaveOrUpdate`, data)).data; (await axios.post(`/product/interestRateModel/personalInterestRateSaveOrUpdate`, data)).data;

@ -101,5 +101,9 @@ body {
.icon { .icon {
@apply mr-[8px]; @apply mr-[8px];
} }
&.not-allow {
background: none;
@apply cursor-not-allowed bg-[#b1b1b1];
}
} }
} }

@ -19,9 +19,10 @@
class="icon" /> class="icon" />
</div> </div>
<el-popconfirm :title="delTitle" <el-popconfirm :title="delTitle"
:disabled="!multipleSelection.length"
@confirm.stop="delAll"> @confirm.stop="delAll">
<template #reference> <template #reference>
<div class="add-btn mr-2"> <div :class="['add-btn mr-2', {'cursor-not-allowed': !multipleSelection.length}]">
<el-icon :size="24" <el-icon :size="24"
color="#fff"> color="#fff">
<Delete /> <Delete />
@ -93,15 +94,15 @@
placeholder="请输入关卡名称" placeholder="请输入关卡名称"
v-model="row.customsPassName"></el-input> v-model="row.customsPassName"></el-input>
<span v-else>{{ row.customsPassName }}</span> <span v-else>{{ row.customsPassName }}</span>
<el-icon class="mx-2 cursor-pointer" <el-icon v-if="!row.editing"
class="mx-2 cursor-pointer"
:size="16" :size="16"
color="#877c7c" color="#877c7c"
@click="edit(row)"> @click="edit(row)">
<Check v-if="row.editing" /> <Edit />
<Edit v-else />
</el-icon> </el-icon>
<el-icon v-if="row.editing" <el-icon v-if="row.editing"
class="cursor-pointer" class="ml-2 cursor-pointer"
:size="16" :size="16"
color="#877c7c" color="#877c7c"
@click="cancel(row)"> @click="cancel(row)">
@ -122,7 +123,8 @@
<el-switch v-if="row.checkpointId" <el-switch v-if="row.checkpointId"
v-model="row.isEnable" v-model="row.isEnable"
:active-value="1" :active-value="1"
:inactive-value="0" /> :inactive-value="0"
@change="hadChange = 1;" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" <el-table-column label="操作"
@ -141,7 +143,7 @@
</el-table> </el-table>
</div> </div>
<div class="filter flex justify-end mt-3"> <div class="filter flex justify-end mt-3">
<div class="add-btn" <div :class="['add-btn', {'not-allow': !hadChange}]"
@click="save" @click="save"
v-loading="saveLoading"> v-loading="saveLoading">
保存 保存
@ -163,7 +165,7 @@ const router = useRouter();
const route = useRoute(); const route = useRoute();
const projectId = +Cookies.get('sand-projectId'); const projectId = +Cookies.get('sand-projectId');
const levelId = +Cookies.get('sand-level'); const levelId = +Cookies.get('sand-level');
const height = window.innerHeight - 270; const hadChange = ref<number>(0);
const delTitle: string = '删除关卡后,这个关卡的数据将被删除,确定删除吗?'; const delTitle: string = '删除关卡后,这个关卡的数据将被删除,确定删除吗?';
const params = reactive({ const params = reactive({
platformId: 3, platformId: 3,
@ -221,11 +223,12 @@ const save = async () => {
}); });
await updatePass(param); await updatePass(param);
// //
const addList = list.value.filter((e) => !e.checkpointId); const addList = list.value.filter((e) => !e.checkpointId && e.customsPassName);
await savePass(addList); await savePass(addList);
getList(); getList();
ElMessage.success('保存成功!'); ElMessage.success('保存成功!');
saveLoading.value = false; saveLoading.value = false;
hadChange.value = 0;
}; };
// //
const submitSerial = (row: Record<string, any>, oldIndex: number, newIndex: number) => { const submitSerial = (row: Record<string, any>, oldIndex: number, newIndex: number) => {
@ -233,6 +236,7 @@ const submitSerial = (row: Record<string, any>, oldIndex: number, newIndex: numb
const temp = list.value.splice(oldIndex, 1); const temp = list.value.splice(oldIndex, 1);
row.serialNumber = newIndex; row.serialNumber = newIndex;
list.value.splice(newIndex - 1, 0, temp[0]); list.value.splice(newIndex - 1, 0, temp[0]);
hadChange.value = 1;
} }
}; };
// //

@ -240,18 +240,7 @@ const span = ({ row, column, rowIndex, columnIndex }: SpanMethodProps) => {
} }
} }
}; };
//
const submit = async () => {
let param = JSON.parse(JSON.stringify(form.value));
param?.individualCreditModels.forEach((e, i) => {
delete e.recordChildren;
delete e.subject;
});
await personalCreditModelSaveOrUpdate(param);
addRecord(param);
getDetail();
ElMessage.success('提交成功!');
};
const getItemId = (name: string): number | string => { const getItemId = (name: string): number | string => {
if (!name) return ''; if (!name) return '';
return formProcess.value[0]?.recordChildren[0]?.subject?.itemList.find((e) => e.options === name)?.itemId; return formProcess.value[0]?.recordChildren[0]?.subject?.itemList.find((e) => e.options === name)?.itemId;
@ -289,6 +278,18 @@ const addRecord = async (data: Record<string, any>) => {
projectId, projectId,
}); });
}; };
//
const submit = async () => {
const param = JSON.parse(JSON.stringify(form.value));
param?.individualCreditModels.forEach((e, i) => {
delete e.recordChildren;
delete e.subject;
});
await personalCreditModelSaveOrUpdate(param);
addRecord(param);
getDetail();
ElMessage.success('提交成功!');
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

@ -132,14 +132,6 @@ onMounted(() => {
getDetail(); getDetail();
}); });
//
const submit = async () => {
let param = JSON.parse(JSON.stringify(form.value));
await businessQuotaModelSaveOrUpdate(param);
addRecord(param);
getDetail();
ElMessage.success('提交成功!');
};
const getItemId = (name: string): number | string => { const getItemId = (name: string): number | string => {
if (!name) return ''; if (!name) return '';
return info.value[0]?.recordChildren[0]?.subject?.itemList.find((e) => e.options === name)?.itemId; return info.value[0]?.recordChildren[0]?.subject?.itemList.find((e) => e.options === name)?.itemId;
@ -164,6 +156,13 @@ const addRecord = async (data: Record<string, any>) => {
projectId, projectId,
}); });
}; };
//
const submit = async () => {
await businessQuotaModelSaveOrUpdate(form.value);
addRecord(form.value);
getDetail();
ElMessage.success('提交成功!');
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

@ -0,0 +1,258 @@
<template>
<!-- 个人利率模型 -->
<el-form label-width="100px"
class="form"
status-icon>
<el-form-item label="利率模型">
<el-table class="c-table"
:data="form.individualInterestRateModels"
:span-method="span"
border>
<el-table-column prop="indexName"
label="指标名称"
min-width="100"
align="center">
<template #default="{ row, $index }">
<span :class="{'text-[#006bff]': !$index}">{{ row?.indexName }}</span>
</template>
</el-table-column>
<el-table-column label="描述"
min-width="150">
<template #default="{ row, $index }">
<span :class="{'text-[#006bff]': !$index}">{{ row?.description }}</span>
</template>
</el-table-column>
<el-table-column label="分值"
min-width="150">
<template #default="{ row, $index }">
<el-select v-if="$index !== 12 && $index !== 13"
class="w-full"
v-model="row.score">
<el-option v-for="item in row?.subject?.itemList"
:key="item"
:value="item.options" />
</el-select>
<el-input v-else
placeholder="请输入"
v-model="row.score"></el-input>
</template>
</el-table-column>
</el-table>
</el-form-item>
<el-form-item :label="formProcess[0]?.name">
<div class="flex-1">
<p class="mb-1">{{ formProcess[0]?.recordChildren[0]?.name }}</p>
<el-select v-model="form.finalFloatingRatioEqual"
clearable>
<el-option v-for="item in formProcess[0]?.recordChildren[0]?.subject?.itemList"
:key="item"
:value="item.options" />
</el-select>
<p class="mt-3 mb-1">{{ formProcess[0]?.recordChildren[1]?.name }}</p>
<el-select v-model="form.finalFloatingRatioLess"
clearable>
<el-option v-for="item in formProcess[0]?.recordChildren[1]?.subject?.itemList"
:key="item"
:value="item.options" />
</el-select>
<p class="mt-3 mb-1">{{ formProcess[0]?.recordChildren[2]?.name }}</p>
<el-select v-model="form.finalFloatingRatioGreater"
clearable>
<el-option v-for="item in formProcess[0]?.recordChildren[2]?.subject?.itemList"
:key="item"
:value="item.options" />
</el-select>
</div>
</el-form-item>
<el-form-item :label="formProcess[1]?.name">
<div class="flex-1">
<p class="mb-1">{{ formProcess[1]?.recordChildren[0]?.name }}</p>
<el-select v-model="form.finalInterestRateEqual">
<el-option v-for="item in formProcess[1]?.recordChildren[0]?.subject?.itemList"
:key="item"
:value="item.options" />
</el-select>
</div>
</el-form-item>
</el-form>
<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 { personalInterestRateDetails, personalInterestRateSaveOrUpdate } from '@/api/model';
import { getProcessInformationBasedOnRoles, addOperation } from '@/api/judgment';
import type { TableColumnCtx } from 'element-plus';
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>>({
projectId,
checkpointId: levelId,
finalFloatingRatioEqual: '',
finalFloatingRatioGreater: '',
finalFloatingRatioLess: '',
finalInterestRateEqual: '',
type: 1,
individualInterestRateModels: [],
});
const formProcess = ref<Record<string, any>[]>([]);
const info = ref<Record<string, any>[]>([]);
const len = ref<number>(0);
//
const getConfig = async () => {
const { process } = await getProcessInformationBasedOnRoles(935);
formProcess.value = process.slice(1);
const list = process[0]?.recordChildren;
const result = [];
list?.forEach((e, i) => {
let temp = {
indexName: e.name,
recordChildren: e.recordChildren || [],
stRecordId: e.id,
ruleId: e.recordChildren ? e?.recordChildren[0]?.id : '',
description: e.recordChildren ? e?.recordChildren[0]?.name : e.remark || '--',
subject: e.recordChildren ? e?.recordChildren[0]?.subject : e.subject || [],
score: '',
};
result.push(temp);
e?.recordChildren?.forEach((n, j) => {
if (j) {
temp = JSON.parse(JSON.stringify(temp));
temp.description = n.name;
temp.subject = n.subject;
temp.ruleId = n.id;
result.push(temp);
}
});
});
len.value = result.length - 1;
if (info.value.length) {
result.forEach((e, i) => {
result[i].score = info.value[i].score;
result[i].id = info.value[i].id;
result[i].modelId = info.value[i].modelId;
});
}
form.value.individualInterestRateModels = result;
console.log('🚀 ~ file: 935.vue:173 ~ getConfig ~ result:', result);
};
//
const getDetail = async () => {
try {
const { data } = await personalInterestRateDetails(levelId, projectId);
if (data) {
form.value = data;
info.value = data.individualInterestRateModels;
}
getConfig();
} finally {
}
};
onMounted(() => {
getDetail();
});
interface SpanMethodProps {
row: Record<string, any>;
column: TableColumnCtx<Record<string, any>>;
rowIndex: number;
columnIndex: number;
}
//
const span = ({ row, column, rowIndex, columnIndex }: SpanMethodProps) => {
if (columnIndex === 0) {
if (rowIndex === 1) {
return {
rowspan: 5,
colspan: 1,
};
} else if (rowIndex === 6 || rowIndex === 9) {
return {
rowspan: 3,
colspan: 1,
};
} else if (!rowIndex || rowIndex === 12 || rowIndex === 13) {
return {
rowspan: 1,
colspan: 1,
};
} else {
return {
rowspan: 0,
colspan: 0,
};
}
}
};
const getItemId = (name: string): number | string => {
if (!name) return '';
return formProcess.value[0]?.recordChildren[0]?.subject?.itemList.find((e) => e.options === name)?.itemId;
};
//
const addRecord = async (data: Record<string, any>) => {
const preIds = `1,${Cookies.get('sand-level')},42,68,757,935`; // 1id
const rule: Array<Record<string, any>> = [];
const listIds = preIds + ',937';
form.value.individualInterestRateModels[0].score && rule.push(handleId(939, 273, 647, listIds + ',939', 1));
form.value.individualInterestRateModels.forEach((e, i) => {
if (i && i !== 12 && i !== 13 && e.subject) {
e.score && rule.push(handleId(e.ruleId, e.subject.subjectId, e?.subject?.itemList?.find((n) => n.options === e.score)?.itemId, `${listIds},${e.stRecordId},${e.ruleId}`, 1));
}
});
form.value.individualInterestRateModels[12].score && rule.push(handleId(954, 306, form.value.individualInterestRateModels[12].score, listIds + ',954', 3));
form.value.individualInterestRateModels[13].score && rule.push(handleId(955, 307, form.value.individualInterestRateModels[13].score, listIds + ',955', 3));
data.finalFloatingRatioEqual && rule.push(handleId(1024, 279, getItemId(data.finalFloatingRatioEqual), preIds + ',1023,1024', 1));
data.finalFloatingRatioLess && rule.push(handleId(1025, 279, getItemId(data.finalFloatingRatioLess), preIds + ',1023,1025', 1));
data.finalFloatingRatioGreater && rule.push(handleId(1026, 279, getItemId(data.finalFloatingRatioGreater), preIds + ',1023,1026', 1));
data.finalInterestRateEqual &&
rule.push(
handleId(1028, 280, formProcess.value[1]?.recordChildren[0]?.subject?.itemList.find((e) => e.options === data.finalInterestRateEqual)?.itemId, preIds + ',1027,1028', 1),
);
await addOperation({
checkpointId: levelId,
parentId: preIds,
lcJudgmentRuleReq: rule,
projectId,
});
};
//
const submit = async () => {
const param = JSON.parse(JSON.stringify(form.value));
param?.individualInterestRateModels.forEach((e, i) => {
delete e.recordChildren;
delete e.subject;
});
await personalInterestRateSaveOrUpdate(param);
addRecord(param);
getDetail();
ElMessage.success('提交成功!');
};
</script>
<style lang="scss" scoped>
@import url(../../../styles/form.scss);
.c-table {
:deep(.el-input__inner) {
@apply px-2;
}
}
</style>

@ -0,0 +1,306 @@
<template>
<!-- 企业利率模型 -->
<el-form label-width="100px"
class="form"
status-icon>
<el-form-item label="利率模型">
<el-table class="c-table"
:data="form.corporateInterestRateModelIndicators"
:span-method="span"
border>
<el-table-column prop="indexName"
label="指标名称"
min-width="100"
align="center"></el-table-column>
<el-table-column prop="indexName"
label="计算公式"
min-width="100"
align="center">
<template #default="{ row }">
<el-select v-if="row?.recordChildren?.length < 3"
class="w-full"
v-model="row.computationalFormula">
<el-option v-for="item in row.recordChildren[0]?.subject?.itemList"
:key="item"
:value="item.options" />
</el-select>
<span v-else>--</span>
</template>
</el-table-column>
<el-table-column prop="standard"
label="标准"
min-width="150"
align="center"></el-table-column>
<el-table-column label="浮动系数"
min-width="150">
<template #default="{ row }">
<el-select class="w-full"
v-model="row.floatingCoefficient">
<el-option v-for="item in row?.subject?.itemList"
:key="item"
:value="item.options" />
</el-select>
</template>
</el-table-column>
</el-table>
</el-form-item>
<el-form-item :label="formProcess[0]?.name">
<div class="flex-1">
<p class="mb-1">{{ formProcess[0]?.recordChildren[0]?.name }}</p>
<el-select v-model="form.finalFloatingRatioEqual"
clearable>
<el-option v-for="item in formProcess[0]?.recordChildren[0]?.subject?.itemList"
:key="item"
:value="item.options" />
</el-select>
<p class="mt-3 mb-1">{{ formProcess[0]?.recordChildren[1]?.name }}</p>
<el-select v-model="form.finalFloatingRatioLess"
clearable>
<el-option v-for="item in formProcess[0]?.recordChildren[1]?.subject?.itemList"
:key="item"
:value="item.options" />
</el-select>
<p class="mt-3 mb-1">{{ formProcess[0]?.recordChildren[2]?.name }}</p>
<el-select v-model="form.finalFloatingRatioGreater"
clearable>
<el-option v-for="item in formProcess[0]?.recordChildren[2]?.subject?.itemList"
:key="item"
:value="item.options" />
</el-select>
</div>
</el-form-item>
<el-form-item :label="formProcess[1]?.name">
<div class="flex-1">
<p class="mb-1">{{ formProcess[1]?.recordChildren[0]?.name }}</p>
<el-select v-model="form.finalInterestRateEqual">
<el-option v-for="item in formProcess[1]?.recordChildren[0]?.subject?.itemList"
:key="item"
:value="item.options" />
</el-select>
</div>
</el-form-item>
</el-form>
<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 { businessInterestRateDetails, businessInterestRateSaveOrUpdate } from '@/api/model';
import { getProcessInformationBasedOnRoles, addOperation } from '@/api/judgment';
import type { TableColumnCtx } from 'element-plus';
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>>({
projectId,
checkpointId: levelId,
finalFloatingRatioEqual: '',
finalFloatingRatioGreater: '',
finalFloatingRatioLess: '',
finalInterestRateEqual: '',
type: 2,
corporateInterestRateModelIndicators: [],
});
const formProcess = ref<Record<string, any>[]>([]);
const info = ref<Record<string, any>[]>([]);
//
const getConfig = async () => {
const { process } = await getProcessInformationBasedOnRoles(936);
formProcess.value = process.slice(1);
const list = process[0]?.recordChildren;
const result = [];
list?.forEach((e, i) => {
const children = e.recordChildren.length > 2 ? e.recordChildren : e.recordChildren[1]?.recordChildren;
let cur = info.value.length ? info.value[i] : {};
let temp = {
indexId: cur?.indexId || '',
modelId: cur?.modelId || '',
computationalFormula: cur?.computationalFormula || '',
indexName: e.name,
recordChildren: e.recordChildren || [],
stRecordId: e.id,
ruleId: children[0]?.id,
standard: children[0]?.name,
subject: children[0]?.subject,
floatingCoefficient: cur?.corporateInterestRateModels ? (cur?.corporateInterestRateModels[0].floatingCoefficient ?? '') + '' : '',
id: cur?.corporateInterestRateModels ? cur?.corporateInterestRateModels[0].id : '',
};
result.push(temp);
children.forEach((n, j) => {
if (j) {
cur = info.value.length ? info.value[i].corporateInterestRateModels[j] : {};
temp = JSON.parse(JSON.stringify(temp));
temp.standard = n.name;
temp.subject = n.subject;
temp.ruleId = n.id;
temp.floatingCoefficient = (cur?.floatingCoefficient ?? '') + '';
temp.id = cur?.id ?? '';
temp.rule = 1;
result.push(temp);
}
});
});
form.value.corporateInterestRateModelIndicators = result;
};
//
const getDetail = async () => {
try {
const { data } = await businessInterestRateDetails(levelId, projectId);
if (data) {
form.value = data;
info.value = data.corporateInterestRateModelIndicators;
}
getConfig();
} finally {
}
};
onMounted(() => {
getDetail();
});
interface SpanMethodProps {
row: Record<string, any>;
column: TableColumnCtx<Record<string, any>>;
rowIndex: number;
columnIndex: number;
}
const rowMerge1 = [0, 16];
const rowMerge2 = [11, 20, 25, 30, 35, 40];
//
const span = ({ row, column, rowIndex, columnIndex }: SpanMethodProps) => {
if (!columnIndex || columnIndex === 1) {
if (rowMerge1.includes(rowIndex)) {
return {
rowspan: 4,
colspan: 1,
};
} else if (rowMerge2.includes(rowIndex)) {
return {
rowspan: 5,
colspan: 1,
};
} else if (rowIndex === 4) {
return {
rowspan: 7,
colspan: 1,
};
} else if (rowIndex === 45) {
return {
rowspan: 6,
colspan: 1,
};
} else {
return {
rowspan: 0,
colspan: 0,
};
}
}
};
const getItemId = (name: string): number | string => {
if (!name) return '';
return formProcess.value[0]?.recordChildren[0]?.subject?.itemList.find((e) => e.options === name)?.itemId;
};
//
const addRecord = async (data: Record<string, any>) => {
const preIds = `1,${Cookies.get('sand-level')},42,68,757,936`; // 1id
const rule: Array<Record<string, any>> = [];
const listIds = preIds + ',938';
form.value.corporateInterestRateModelIndicators.forEach((e, i) => {
//
e.floatingCoefficient &&
rule.push(
handleId(
e.ruleId,
e.subject.subjectId,
e?.subject?.itemList?.find((n) => n.options === e.floatingCoefficient)?.itemId,
`${listIds},${e.stRecordId}${e.recordChildren.length > 2 ? '' : ',' + e.recordChildren[1].id},${e.ruleId}`,
1,
),
);
//
e.computationalFormula &&
!e.rule &&
rule.push(
handleId(
e.recordChildren[0].id,
e.recordChildren[0].subjectId,
e.recordChildren[0]?.subject?.itemList?.find((n) => n.options === e.computationalFormula)?.itemId,
`${listIds},${e.stRecordId},${e.recordChildren[0].id}`,
1,
),
);
});
data.finalFloatingRatioEqual && rule.push(handleId(1024, 279, getItemId(data.finalFloatingRatioEqual), preIds + ',1023,1024', 1));
data.finalFloatingRatioLess && rule.push(handleId(1025, 279, getItemId(data.finalFloatingRatioLess), preIds + ',1023,1025', 1));
data.finalFloatingRatioGreater && rule.push(handleId(1026, 279, getItemId(data.finalFloatingRatioGreater), preIds + ',1023,1026', 1));
data.finalInterestRateEqual &&
rule.push(
handleId(1028, 280, formProcess.value[1]?.recordChildren[0]?.subject?.itemList.find((e) => e.options === data.finalInterestRateEqual)?.itemId, preIds + ',1027,1028', 1),
);
await addOperation({
checkpointId: levelId,
parentId: preIds,
lcJudgmentRuleReq: rule,
projectId,
});
};
//
const submit = async () => {
const param = JSON.parse(JSON.stringify(form.value));
const list = [];
param.corporateInterestRateModelIndicators.forEach((e, i) => {
const temp = {
floatingCoefficient: e.floatingCoefficient,
standard: e.standard,
id: e.id,
indexId: e.indexId,
};
if (e.rule) {
list.find((n) => n.indexName === e.indexName).corporateInterestRateModels.push(temp);
} else {
list.push({
indexId: e.indexId,
modelId: e.modelId,
computationalFormula: e.computationalFormula,
indexName: e.indexName,
corporateInterestRateModels: [temp],
});
}
});
param.corporateInterestRateModelIndicators = list;
param.type = 2;
await businessInterestRateSaveOrUpdate(param);
addRecord(param);
getDetail();
ElMessage.success('提交成功!');
};
</script>
<style lang="scss" scoped>
@import url(../../../styles/form.scss);
.c-table {
:deep(.el-input__inner) {
@apply px-2;
}
}
</style>

@ -25,24 +25,23 @@
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="利率模型" <el-tab-pane label="利率模型"
name="tab2"> name="tab2">
<!-- <div class="flex"> <div class="flex">
<div class="left w-[241px] min-w-[241px] pr-5 py-4"> <div class="left w-[241px] min-w-[241px] pr-5 py-4">
<ul class="products"> <ul class="products">
<li v-for="(item, i) in list2" <li v-for="(item, i) in list[1]?.recordChildren"
:key="i" :key="i"
:class="{ active: item.id === riskId }" :class="{ active: item.id === id }"
@click="switchProductRisk(item.id)"> @click="switchProduct(item.id)">
<h6>{{ item.name }}</h6> <h6>{{ item.name }}</h6>
<p class="mt-2 des">{{ item.remark }}</p> <p class="type">{{ item.remark }}</p>
</li> </li>
</ul> </ul>
</div> </div>
<div class="right flex-1 px-5 pt-2"> <div class="right flex-1 px-5 pt-2">
<Risk1 v-if="riskId === 702" /> <Com3 v-if="id == 935" />
<Risk2 v-else-if="riskId === 703" /> <Com4 v-else-if="id == 936" />
<Risk3 v-else-if="riskId === 704" /> </div>
</div> </div>
</div> -->
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</div> </div>
@ -52,26 +51,24 @@
import { computed, onMounted, ref } from 'vue'; import { computed, onMounted, ref } from 'vue';
import type { TabsPaneContext } from 'element-plus'; import type { TabsPaneContext } from 'element-plus';
import { getProcessInformationBasedOnRoles } from '@/api/judgment'; import { getProcessInformationBasedOnRoles } from '@/api/judgment';
import { delCredit, listCredit } from '@/api/model';
import { useRouter, useRoute } from 'vue-router'; import { useRouter, useRoute } from 'vue-router';
import { ElMessage } from 'element-plus';
import Cookies from 'js-cookie'; import Cookies from 'js-cookie';
import Com1 from './772.vue'; import Com1 from './772.vue';
import Com2 from './773.vue'; import Com2 from './773.vue';
import Com3 from './935.vue';
import Com4 from './936.vue';
const router = useRouter(); const router = useRouter();
const route = useRoute(); const route = useRoute();
const projectId = +Cookies.get('sand-projectId'); const projectId = +Cookies.get('sand-projectId');
const levelId = +Cookies.get('sand-level'); const levelId = +Cookies.get('sand-level');
const curTab = computed(() => route.params.action); const curTab = ref<string>(route.params.action);
const list = ref<Array<Record<string, any>>>([]); const list = ref<Array<Record<string, any>>>([]);
const list1 = ref<Array<Record<string, any>>>([]);
const id = computed(() => +route.query.id); const id = computed(() => +route.query.id);
const creditId = computed(() => +route.query.creditId);
// //
const switchProduct = (id: number) => { const switchProduct = (productId: number | string) => {
router.push(`/product/interestRate/${route.params.action}?&i=3&role=42&id=${id}`); router.push(`/product/interestRate/${route.params.action}?i=3&role=42&id=${productId}`);
}; };
// //
const getList = async (refresh?: number) => { const getList = async (refresh?: number) => {
@ -86,6 +83,7 @@ onMounted(() => {
// tab // tab
const tabChange = (tab: TabsPaneContext, event: Event) => { const tabChange = (tab: TabsPaneContext, event: Event) => {
router.push(`/product/interestRate/${curTab.value}?i=3&role=42`);
getList(); getList();
}; };
</script> </script>

Loading…
Cancel
Save