贷后管理模型联调

master
yujialong 7 months ago
parent 53913f3f19
commit 1369206c2e
  1. 51
      src/api/model.ts
  2. 173
      src/views/product/afterLoan/1029.vue
  3. 213
      src/views/product/afterLoan/1029/Detail.vue
  4. 166
      src/views/product/afterLoan/1029/Index.vue
  5. 186
      src/views/product/afterLoan/1030.vue
  6. 225
      src/views/product/afterLoan/1030/Detail.vue
  7. 166
      src/views/product/afterLoan/1030/Index.vue
  8. 355
      src/views/product/afterLoan/1031.vue
  9. 396
      src/views/product/afterLoan/1031/Detail.vue
  10. 166
      src/views/product/afterLoan/1031/Index.vue
  11. 130
      src/views/product/afterLoan/1032.vue
  12. 170
      src/views/product/afterLoan/1032/Detail.vue
  13. 166
      src/views/product/afterLoan/1032/Index.vue
  14. 74
      src/views/product/afterLoan/1033/Detail.vue
  15. 166
      src/views/product/afterLoan/1033/Index.vue
  16. 76
      src/views/product/afterLoan/CardList.vue
  17. 375
      src/views/product/interestRate/936.vue
  18. 2
      src/views/product/strategy/513/Detail.vue

@ -157,17 +157,58 @@ export const personalCreditModelDetails = async (params: Record<string, any>): P
export const personalCreditModelSaveOrUpdate = async (data: Record<string, any>): Promise<any> =>
(await axios.post(`/product/quotaModel/personalCreditModelSaveOrUpdate`, data)).data;
export const fiveLevelClassificationDetails = async (): Promise<any> => (await axios.post(`/product/fiveLevelClassification/details`, getIds())).data;
export const fiveLevelClassification = async (data: Record<string, any>): Promise<any> =>
(
await axios.post(`/product/fiveLevelClassification/list`, {
...getIds(),
...data,
})
).data;
export const fiveLevelClassificationDetails = async (params: Record<string, any>): Promise<any> =>
(await axios.post(`/product/fiveLevelClassification/details`, {}, { params })).data;
export const fiveLevelClassificationSave = async (data: Record<string, any>): Promise<any> => (await axios.post(`/product/fiveLevelClassification/saveOrUpdate`, data)).data;
export const fiveLevelClassificationDel = async (data: Record<string, any>): Promise<any> => (await axios.post(`${host}/product/fiveLevelClassification/delete`, data)).data;
export const postLoanInspectionDetails = async (): Promise<any> => (await axios.post(`/product/postLoanInspection/details`, getIds())).data;
export const postLoanInspection = async (data: Record<string, any>): Promise<any> =>
(
await axios.post(`/product/postLoanInspection/list`, {
...getIds(),
...data,
})
).data;
export const postLoanInspectionDetails = async (params: Record<string, any>): Promise<any> => (await axios.post(`/product/postLoanInspection/details`, {}, { params })).data;
export const postLoanInspectionSave = async (data: Record<string, any>): Promise<any> => (await axios.post(`/product/postLoanInspection/saveOrUpdate`, data)).data;
export const postLoanInspectionDel = async (data: Record<string, any>): Promise<any> => (await axios.post(`${host}/product/postLoanInspection/delete`, data)).data;
export const postCreditScoreDetails = async (): Promise<any> => (await axios.post(`/product/postCreditScore/details`, getIds())).data;
export const postCreditScore = async (data: Record<string, any>): Promise<any> =>
(
await axios.post(`/product/postCreditScore/list`, {
...getIds(),
...data,
})
).data;
export const postCreditScoreDetails = async (params: Record<string, any>): Promise<any> => (await axios.post(`/product/postCreditScore/details`, {}, { params })).data;
export const postCreditScoreSave = async (data: Record<string, any>): Promise<any> => (await axios.post(`/product/postCreditScore/saveOrUpdate`, data)).data;
export const postCreditScoreDel = async (data: Record<string, any>): Promise<any> => (await axios.post(`${host}/product/postCreditScore/delete`, data)).data;
export const postLoanWarningDetails = async (): Promise<any> => (await axios.post(`/product/postLoanWarning/details`, getIds())).data;
export const postLoanWarning = async (data: Record<string, any>): Promise<any> =>
(
await axios.post(`/product/postLoanWarning/list`, {
...getIds(),
...data,
})
).data;
export const postLoanWarningDetails = async (params: Record<string, any>): Promise<any> => (await axios.post(`/product/postLoanWarning/details`, {}, { params })).data;
export const postLoanWarningSave = async (data: Record<string, any>): Promise<any> => (await axios.post(`/product/postLoanWarning/saveOrUpdate`, data)).data;
export const postLoanWarningDel = async (data: Record<string, any>): Promise<any> => (await axios.post(`${host}/product/postLoanWarning/delete`, data)).data;
export const collectionAfterLoanDetails = async (): Promise<any> => (await axios.post(`/product/collectionAfterLoan/details`, getIds())).data;
export const collectionAfterLoan = async (data: Record<string, any>): Promise<any> =>
(
await axios.post(`/product/collectionAfterLoan/list`, {
...getIds(),
...data,
})
).data;
export const collectionAfterLoanDetails = async (params: Record<string, any>): Promise<any> => (await axios.post(`/product/collectionAfterLoan/details`, {}, { params })).data;
export const collectionAfterLoanSave = async (data: Record<string, any>): Promise<any> => (await axios.post(`/product/collectionAfterLoan/saveOrUpdate`, data)).data;
export const collectionAfterLoanDel = async (data: Record<string, any>): Promise<any> => (await axios.post(`${host}/product/collectionAfterLoan/delete`, data)).data;

@ -1,173 +0,0 @@
<template>
<!-- 五级分类 -->
<el-table class="c-table"
:data="form"
:span-method="span"
:cell-style="{background:'#fff'}"
border>
<el-table-column prop="recordName"
label="产品类别"
min-width="150"
align="center">
</el-table-column>
<el-table-column label="逾期时间"
align="center">
<el-table-column label="未逾期"
align="center">
<template #default="{ row }">
<el-select clearable
v-model="row.notOverdue">
<el-option v-for="item in row.recordChildren[0].subject.itemList"
:key="item"
:label="item.options"
:value="item.itemId" />
</el-select>
</template>
</el-table-column>
<el-table-column label="1~30天"
align="center">
<template #default="{ row }">
<el-select clearable
v-model="row.thirtyDays">
<el-option v-for="item in row.recordChildren[0].subject.itemList"
:key="item"
:label="item.options"
:value="item.itemId" />
</el-select>
</template></el-table-column>
<el-table-column label="31~90天"
align="center">
<template #default="{ row }">
<el-select clearable
v-model="row.ninetyDays">
<el-option v-for="item in row.recordChildren[0].subject.itemList"
:key="item"
:label="item.options"
:value="item.itemId" />
</el-select>
</template></el-table-column>
<el-table-column label="91~180天"
align="center">
<template #default="{ row }">
<el-select clearable
v-model="row.oneHundredAndEightyDays">
<el-option v-for="item in row.recordChildren[0].subject.itemList"
:key="item"
:label="item.options"
:value="item.itemId" />
</el-select>
</template></el-table-column>
<el-table-column label="181~360天"
align="center">
<template #default="{ row }">
<el-select clearable
v-model="row.threeHundredAndSixtyDays">
<el-option v-for="item in row.recordChildren[0].subject.itemList"
:key="item"
:label="item.options"
:value="item.itemId" />
</el-select>
</template></el-table-column>
<el-table-column label="360天以上"
align="center">
<template #default="{ row }">
<el-select clearable
v-model="row.threeHundredAndSixtyDaysAbove">
<el-option v-for="item in row.recordChildren[0].subject.itemList"
:key="item"
:label="item.options"
:value="item.itemId" />
</el-select>
</template></el-table-column>
</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 { fiveLevelClassificationDetails, fiveLevelClassificationSave } from '@/api/model';
import { getProcessInformationBasedOnRoles, addOperation } from '@/api/judgment';
import { handleId, getIds } from '@/utils/common';
import Cookies from 'js-cookie';
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(1029);
const result = [];
process.map((e, i) => {
const cur = info.value.length ? info.value[i] : {};
result.push({
...getIds(),
recordName: e.name,
recordChildren: e.recordChildren,
ninetyDays: +cur.ninetyDays || '',
notOverdue: +cur.notOverdue || '',
oneHundredAndEightyDays: +cur.oneHundredAndEightyDays || '',
thirtyDays: +cur.thirtyDays || '',
threeHundredAndSixtyDays: +cur.threeHundredAndSixtyDays || '',
threeHundredAndSixtyDaysAbove: +cur.threeHundredAndSixtyDaysAbove || '',
id: cur.id || '',
stRecordId: e.id,
});
});
form.value = result;
};
//
const getDetail = async () => {
try {
const { data } = await fiveLevelClassificationDetails();
info.value = data;
getConfig();
} finally {
}
};
const fieldKeys = ['notOverdue', 'thirtyDays', 'ninetyDays', 'oneHundredAndEightyDays', 'threeHundredAndSixtyDays', 'threeHundredAndSixtyDaysAbove'];
//
const addRecord = async (data: Record<string, any>) => {
const preIds = `1,${levelId},42,69,1029`; // 1id
const rule = [];
data.map((e) => {
e.recordChildren.forEach((n, i) => {
e[fieldKeys[i]] && rule.push(handleId(n.id, n.subjectId, e[fieldKeys[i]], `${preIds},${e.stRecordId},${n.id}`, 1));
});
});
await addOperation({
...getIds(),
parentId: preIds,
lcJudgmentRuleReq: rule,
});
};
//
const submit = async () => {
let param = JSON.parse(JSON.stringify(form.value));
const recordParam = JSON.parse(JSON.stringify(param));
param.map((e) => {
delete e.recordChildren;
});
await fiveLevelClassificationSave({ fiveLevelClassificationList: param });
addRecord(recordParam);
getDetail();
ElMessage.success('提交成功!');
};
onMounted(() => {
getDetail();
});
</script>
<style lang="scss" scoped>
@import url(../../../styles/form.scss);
</style>

@ -0,0 +1,213 @@
<template>
<!-- 五级分类 -->
<el-form label-width="90px"
label-suffix=":"
class="form"
:disabled="disabled">
<el-form-item label="策略名称">
<el-input class="w-[320px]"
placeholder="请输入20以内字符"
maxlength="20"
clearable
v-model="strategyName"></el-input>
</el-form-item>
<el-form-item label="策略规则">
<el-table class="c-table"
:data="form"
:span-method="span"
:cell-style="{background:'#fff'}"
border>
<el-table-column prop="recordName"
label="产品类别"
min-width="150"
align="center">
</el-table-column>
<el-table-column label="逾期时间"
align="center">
<el-table-column label="未逾期"
align="center">
<template #default="{ row }">
<el-select clearable
v-model="row.notOverdue">
<el-option v-for="item in row.recordChildren[0].subject.itemList"
:key="item"
:label="item.options"
:value="item.itemId" />
</el-select>
</template>
</el-table-column>
<el-table-column label="1~30天"
align="center">
<template #default="{ row }">
<el-select clearable
v-model="row.thirtyDays">
<el-option v-for="item in row.recordChildren[0].subject.itemList"
:key="item"
:label="item.options"
:value="item.itemId" />
</el-select>
</template></el-table-column>
<el-table-column label="31~90天"
align="center">
<template #default="{ row }">
<el-select clearable
v-model="row.ninetyDays">
<el-option v-for="item in row.recordChildren[0].subject.itemList"
:key="item"
:label="item.options"
:value="item.itemId" />
</el-select>
</template></el-table-column>
<el-table-column label="91~180天"
align="center">
<template #default="{ row }">
<el-select clearable
v-model="row.oneHundredAndEightyDays">
<el-option v-for="item in row.recordChildren[0].subject.itemList"
:key="item"
:label="item.options"
:value="item.itemId" />
</el-select>
</template></el-table-column>
<el-table-column label="181~360天"
align="center">
<template #default="{ row }">
<el-select clearable
v-model="row.threeHundredAndSixtyDays">
<el-option v-for="item in row.recordChildren[0].subject.itemList"
:key="item"
:label="item.options"
:value="item.itemId" />
</el-select>
</template></el-table-column>
<el-table-column label="360天以上"
align="center">
<template #default="{ row }">
<el-select clearable
v-model="row.threeHundredAndSixtyDaysAbove">
<el-option v-for="item in row.recordChildren[0].subject.itemList"
:key="item"
:label="item.options"
:value="item.itemId" />
</el-select>
</template></el-table-column>
</el-table-column>
</el-table>
</el-form-item>
</el-form>
<div v-if="!disabled"
class="flex justify-end mt-3">
<div class="dia-btn cancel"
@click="emit('close')">取消</div>
<div class="dia-btn"
@click="confirmSubmit">确定</div>
</div>
<Confirm v-model="syncVisible"
@submit="submit" />
</template>
<script setup lang="ts">
import { ref, defineAsyncComponent, onMounted, toRefs } from 'vue';
import { ElMessage } from 'element-plus';
import { fiveLevelClassificationDetails, fiveLevelClassificationSave } from '@/api/model';
import { getProcessInformationBasedOnRoles, addOperation } from '@/api/judgment';
import { handleId, getIds } from '@/utils/common';
import Cookies from 'js-cookie';
const Confirm = defineAsyncComponent(() => import('@/components/StrategyConfirm.vue'));
const props = defineProps({
disabled: { type: Boolean, default: false },
row: { type: Object },
});
const emit = defineEmits(['clsoe']);
const { strategyId, strategyName } = toRefs(props.row);
const form = ref<Record<string, any>[]>([]);
const info = ref<Record<string, any>[]>([]);
//
const getConfig = async () => {
const { process } = await getProcessInformationBasedOnRoles(1029);
const result = [];
process.map((e, i) => {
const cur = info.value.length ? info.value[i] : {};
result.push({
...getIds(),
recordName: e.name,
recordChildren: e.recordChildren,
ninetyDays: +cur.ninetyDays || '',
notOverdue: +cur.notOverdue || '',
oneHundredAndEightyDays: +cur.oneHundredAndEightyDays || '',
thirtyDays: +cur.thirtyDays || '',
threeHundredAndSixtyDays: +cur.threeHundredAndSixtyDays || '',
threeHundredAndSixtyDaysAbove: +cur.threeHundredAndSixtyDaysAbove || '',
id: cur.id || '',
stRecordId: e.id,
});
});
form.value = result;
};
const syncVisible = ref<boolean>(false);
//
const getDetail = async () => {
try {
if (strategyId.value) {
const { data } = await fiveLevelClassificationDetails({
strategyId: strategyId.value,
});
info.value = data;
}
getConfig();
} finally {
}
};
onMounted(getDetail);
const fieldKeys = ['notOverdue', 'thirtyDays', 'ninetyDays', 'oneHundredAndEightyDays', 'threeHundredAndSixtyDays', 'threeHundredAndSixtyDaysAbove'];
//
const addRecord = async (data: Record<string, any>) => {
const preIds = `1,${Cookies.get('sand-level')},42,69,1029`; // 1id
const rule = [];
data.map((e) => {
e.recordChildren.forEach((n, i) => {
e[fieldKeys[i]] && rule.push(handleId(n.id, n.subjectId, e[fieldKeys[i]], `${preIds},${e.stRecordId},${n.id}`, 1));
});
});
await addOperation({
...getIds(),
parentId: preIds,
lcJudgmentRuleReq: rule,
});
ElMessage.success('提交成功!');
syncVisible.value = false;
emit('close', 1);
};
//
const submit = async (synchronizeUpdate?: number) => {
let param = JSON.parse(JSON.stringify(form.value));
const recordParam = JSON.parse(JSON.stringify(param));
param.map((e) => {
delete e.recordChildren;
});
await fiveLevelClassificationSave({
...getIds(),
strategyId: strategyId.value,
strategyName: strategyName.value,
synchronizeUpdate,
fiveLevelClassificationList: param,
});
addRecord(recordParam);
};
const confirmSubmit = () => {
if (!strategyName.value) return ElMessage.error('请输入策略名称!');
syncVisible.value = true;
};
</script>
<style lang="scss" scoped>
@import url(../../../../styles/form.scss);
</style>

@ -0,0 +1,166 @@
<template>
<div class="block">
<div class="flex justify-between items-center mb-5">
<search v-model="keyWord"
@change="initList"></search>
<div class="filter">
<el-popconfirm title="确定要删除吗?"
:disabled="!multipleSelection.length"
@confirm.stop="delAll">
<template #reference>
<div :class="['add-btn mr-2', {'cursor-not-allowed': !multipleSelection.length}]">
<el-icon :size="24"
color="#fff">
<Delete />
</el-icon>
批量删除
</div>
</template>
</el-popconfirm>
<div class="add-btn"
@click="toAdd">
<img src="@/assets/images/plus.png"
alt=""
class="icon" />
新增
</div>
</div>
</div>
<el-table ref="table"
v-loading="loading"
:data="list"
@selection-change="handleSelectionChange">
<el-table-column type="selection"
width="55" />
<el-table-column label="序号"
type="index"
width="60"
align="center" />
<el-table-column prop="strategyName"
label="五级分类策略名称"
min-width="180" />
<el-table-column prop="createTime"
label="新增日期"
min-width="140" />
<el-table-column label="操作"
width="140">
<template #default="{ row }">
<el-button type="text"
@click="toDetail(row, true)"
size="small">查看</el-button>
<el-button type="text"
@click="toDetail(row)"
size="small">编辑</el-button>
<el-popconfirm title="您确定删除吗?"
@confirm.stop="handleDelete([row.strategyId])">
<template #reference>
<el-button type="text"
size="small">删除</el-button>
</template>
</el-popconfirm>
</template></el-table-column>
</el-table>
<el-pagination v-model:currentPage="currentPage"
v-model:pageSize="pageSize"
:total="total"
:page-sizes="pageSizes"
:layout="pageLayout"
@size-change="getList()"
@current-change="getList()"
small
background
class="px-3 py-2 justify-end"></el-pagination>
<el-drawer v-model="visible"
:title="(isDetail ? '查看' : curRow.strategyId ? '编辑' : '新增') + '五级分类策略'"
size="100%"
custom-class="model-drawer">
<Detail v-model:row="curRow"
:disabled="isDetail"
:key="i"
@close="closeDrawer" />
</el-drawer>
</div>
</template>
<script setup lang="ts">
import { onMounted, ref, watch, defineAsyncComponent } from 'vue';
import { ElMessage } from 'element-plus';
import { Delete } from '@element-plus/icons-vue';
import { pageSizes, pageLayout } from '@/utils/common';
import { fiveLevelClassification, fiveLevelClassificationDel } from '@/api/model';
import Search from '@/components/Search.vue';
const Detail = defineAsyncComponent(() => import('./Detail.vue'));
const keyWord = ref<string>();
const currentPage = ref<number>(1);
const pageSize = ref<number>(10);
const total = ref<number>(0);
const table = ref<any>();
const multipleSelection = ref<Record<string, any>[]>([]);
const list = ref<Record<string, any>[]>([]);
const loading = ref<boolean>(false);
const visible = ref<boolean>(false);
const curRow = ref<Record<string, any>>({
strategyId: '',
strategyName: '',
});
const isDetail = ref<boolean>(false);
const i = ref<number>(0);
//
const getList = async () => {
loading.value = true;
try {
const { page } = await fiveLevelClassification({ pageNum: currentPage.value, pageSize: pageSize.value, keyWord: keyWord.value });
list.value = page.records;
total.value = page.total;
} finally {
loading.value = false;
}
};
//
const initList = async () => {
currentPage.value = 1;
getList();
};
watch(keyWord, initList);
onMounted(getList);
//
const handleSelectionChange = (val: Record<string, any>[]) => {
multipleSelection.value = val;
};
//
const delAll = async () => {
handleDelete(multipleSelection.value.map((e) => e.strategyId));
};
//
const toAdd = () => {
i.value++;
isDetail.value = false;
curRow.value = {
strategyId: '',
strategyName: '',
};
visible.value = true;
};
//
const toDetail = async (row: Record<string, any>, detail: boolean = false) => {
i.value++;
isDetail.value = detail;
curRow.value = row;
visible.value = true;
};
//
const closeDrawer = (refresh?: number) => {
visible.value = false;
refresh && initList();
};
const handleDelete = async (ids: number[]) => {
await fiveLevelClassificationDel({ ids });
getList();
ElMessage.success('删除成功!');
};
</script>

@ -1,186 +0,0 @@
<template>
<!-- 贷后检查 -->
<div class="c-auto">
<el-table class="c-table"
:data="form"
:cell-style="{background:'#fff'}"
border>
<el-table-column prop="name"
label="选用"
width="100"
align="center">
<template #default="{ row }">
<el-checkbox v-model="row.isChoose"></el-checkbox>
</template>
</el-table-column>
<el-table-column prop="recordName"
label="检查方式"
min-width="150"
align="center"></el-table-column>
<el-table-column label="检查对象"
min-width="200"
align="center">
<template #default="{ row }">
<el-select v-if="row.recordChildren"
clearable
v-model="row.checkObject">
<el-option v-for="item in row?.recordChildren[1].subject.itemList"
:key="item"
:label="item.options"
:value="item.itemId" />
</el-select>
</template>
</el-table-column>
<el-table-column label="检查时间"
min-width="270"
align="center">
<template #default="{ row, $index }">
<span v-if="$index === 4">点击后触发</span>
<div v-else
class="flex items-center">
<el-select v-if="row.recordChildren"
clearable
v-model="row.checkTimeType">
<el-option v-for="item in row?.recordChildren[2].recordChildren[0].subject.itemList"
:key="item"
:label="item.options"
:value="item.itemId" />
</el-select>
<el-input class="w-[100px] mx-2"
placeholder="请输入"
v-model="row.timeDays"></el-input>
</div>
</template>
</el-table-column>
<el-table-column label="检查内容"
min-width="230"
align="center">
<template #default="{ row }">
<el-checkbox v-model="row.governmentData">政务数据</el-checkbox>
<el-checkbox v-model="row.creditData">征信数据</el-checkbox>
</template>
</el-table-column>
</el-table>
</div>
<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 { postLoanInspectionDetails, postLoanInspectionSave } from '@/api/model';
import { getProcessInformationBasedOnRoles, addOperation } from '@/api/judgment';
import type { TableColumnCtx } from 'element-plus';
import { handleId, getIds } from '@/utils/common';
import Cookies from 'js-cookie';
const form = ref<Record<string, any>[]>([]);
const info = ref<Record<string, any>[]>([]);
//
const getConfig = async () => {
const { process } = await getProcessInformationBasedOnRoles(1030);
const result = [];
process.map((e, i) => {
const cur = info.value.length ? info.value[i] : {};
let temp = {
...getIds(),
recordName: e.name,
recordChildren: e.recordChildren,
checkObject: +cur.checkObject || '',
checkTimeType: +cur.checkTimeType || '',
creditData: info.value.length ? !!cur.creditData : false,
governmentData: info.value.length ? !!cur.governmentData : false,
isChoose: info.value.length ? !!cur.isChoose : false,
timeDays: cur.timeDays || '',
id: cur.id || '',
stRecordId: e.id,
};
result.push(temp);
});
form.value = result;
};
//
const getDetail = async () => {
try {
const { data } = await postLoanInspectionDetails();
info.value = data;
getConfig();
} finally {
}
};
interface SpanMethodProps {
row: Record<string, any>;
column: TableColumnCtx<Record<string, any>>;
rowIndex: number;
columnIndex: number;
}
//
const span = ({ row, column, rowIndex, columnIndex }: SpanMethodProps) => {
if (columnIndex < 2) {
if (rowIndex === 1) {
return {
rowspan: 2,
colspan: 1,
};
} else if (rowIndex === 2) {
return {
rowspan: 0,
colspan: 0,
};
}
}
};
//
const addRecord = async (data: Record<string, any>) => {
console.log('🚀 ~ addRecord ~ data:', data);
const preIds = `1,${Cookies.get('sand-level')},42,69,1030`; // 1id
const rule = [];
data.forEach((e, i) => {
e.isChoose && rule.push(handleId(1052, '', '', preIds + ',' + e.stRecordId + ',1052', ''));
e.checkObject && rule.push(handleId(1053, 282, e.checkObject, preIds + ',' + e.stRecordId + ',1053', 1));
i !== 4 && e.checkTimeType && rule.push(handleId(1054, 283, e.checkTimeType, preIds + ',' + e.stRecordId + ',1054,1056', 1));
e.timeDays && rule.push(handleId(1057, 284, e.timeDays, preIds + ',' + e.stRecordId + ',1054,1057', 3));
const ids = [];
e.governmentData && ids.push(778);
e.creditData && ids.push(793);
e.governmentData && rule.push(handleId(1055, 323, ids.join(), preIds + ',' + e.stRecordId + ',1055', 1));
});
await addOperation({
...getIds(),
parentId: preIds,
lcJudgmentRuleReq: rule,
});
};
//
const submit = async () => {
let param = JSON.parse(JSON.stringify(form.value));
param.map((e, i) => {
e.creditData = +e.creditData;
e.governmentData = +e.governmentData;
e.isChoose = +e.isChoose;
});
const recordParam = JSON.parse(JSON.stringify(param));
param.map((e) => {
delete e.recordChildren;
});
await postLoanInspectionSave({ postLoanInspectionList: param });
addRecord(recordParam);
getDetail();
ElMessage.success('提交成功!');
};
onMounted(() => {
getDetail();
});
</script>
<style lang="scss" scoped>
@import url(../../../styles/form.scss);
</style>

@ -0,0 +1,225 @@
<template>
<!-- 贷后检查 -->
<el-form label-width="90px"
label-suffix=":"
class="form"
:disabled="disabled">
<el-form-item label="策略名称">
<el-input class="w-[320px]"
placeholder="请输入20以内字符"
maxlength="20"
clearable
v-model="strategyName"></el-input>
</el-form-item>
<el-form-item label="策略规则">
<el-table class="c-table"
:data="form"
:cell-style="{background:'#fff'}"
border>
<el-table-column prop="name"
label="选用"
width="100"
align="center">
<template #default="{ row }">
<el-checkbox v-model="row.isChoose"></el-checkbox>
</template>
</el-table-column>
<el-table-column prop="recordName"
label="检查方式"
min-width="150"
align="center"></el-table-column>
<el-table-column label="检查对象"
min-width="200"
align="center">
<template #default="{ row }">
<el-select v-if="row.recordChildren"
clearable
v-model="row.checkObject">
<el-option v-for="item in row?.recordChildren[1].subject.itemList"
:key="item"
:label="item.options"
:value="item.itemId" />
</el-select>
</template>
</el-table-column>
<el-table-column label="检查时间"
min-width="270"
align="center">
<template #default="{ row, $index }">
<span v-if="$index === 4">点击后触发</span>
<div v-else
class="flex items-center">
<el-select v-if="row.recordChildren"
clearable
v-model="row.checkTimeType">
<el-option v-for="item in row?.recordChildren[2].recordChildren[0].subject.itemList"
:key="item"
:label="item.options"
:value="item.itemId" />
</el-select>
<el-input class="w-[100px] mx-2"
placeholder="请输入"
v-model="row.timeDays"></el-input>
</div>
</template>
</el-table-column>
<el-table-column label="检查内容"
min-width="230"
align="center">
<template #default="{ row }">
<el-checkbox v-model="row.governmentData">政务数据</el-checkbox>
<el-checkbox v-model="row.creditData">征信数据</el-checkbox>
</template>
</el-table-column>
</el-table>
</el-form-item>
</el-form>
<div v-if="!disabled"
class="flex justify-end mt-3">
<div class="dia-btn cancel"
@click="emit('close')">取消</div>
<div class="dia-btn"
@click="confirmSubmit">确定</div>
</div>
<Confirm v-model="syncVisible"
@submit="submit" />
</template>
<script setup lang="ts">
import { ref, defineAsyncComponent, onMounted, toRefs } from 'vue';
import { ElMessage } from 'element-plus';
import { postLoanInspectionDetails, postLoanInspectionSave } from '@/api/model';
import { getProcessInformationBasedOnRoles, addOperation } from '@/api/judgment';
import type { TableColumnCtx } from 'element-plus';
import { handleId, getIds } from '@/utils/common';
import Cookies from 'js-cookie';
const Confirm = defineAsyncComponent(() => import('@/components/StrategyConfirm.vue'));
const props = defineProps({
disabled: { type: Boolean, default: false },
row: { type: Object },
});
const emit = defineEmits(['clsoe']);
const { strategyId, strategyName } = toRefs(props.row);
const form = ref<Record<string, any>[]>([]);
const info = ref<Record<string, any>[]>([]);
const syncVisible = ref<boolean>(false);
//
const getConfig = async () => {
const { process } = await getProcessInformationBasedOnRoles(1030);
const result = [];
process.map((e, i) => {
const cur = info.value.length ? info.value[i] : {};
let temp = {
...getIds(),
recordName: e.name,
recordChildren: e.recordChildren,
checkObject: +cur.checkObject || '',
checkTimeType: +cur.checkTimeType || '',
creditData: info.value.length ? !!cur.creditData : false,
governmentData: info.value.length ? !!cur.governmentData : false,
isChoose: info.value.length ? !!cur.isChoose : false,
timeDays: cur.timeDays || '',
id: cur.id || '',
stRecordId: e.id,
};
result.push(temp);
});
form.value = result;
};
//
const getDetail = async () => {
try {
if (strategyId.value) {
const { data } = await postLoanInspectionDetails({
strategyId: strategyId.value,
});
info.value = data;
}
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 < 2) {
if (rowIndex === 1) {
return {
rowspan: 2,
colspan: 1,
};
} else if (rowIndex === 2) {
return {
rowspan: 0,
colspan: 0,
};
}
}
};
//
const addRecord = async (data: Record<string, any>) => {
const preIds = `1,${Cookies.get('sand-level')},42,69,1030`; // 1id
const rule = [];
data.forEach((e, i) => {
e.isChoose && rule.push(handleId(1052, '', '', preIds + ',' + e.stRecordId + ',1052', ''));
e.checkObject && rule.push(handleId(1053, 282, e.checkObject, preIds + ',' + e.stRecordId + ',1053', 1));
i !== 4 && e.checkTimeType && rule.push(handleId(1054, 283, e.checkTimeType, preIds + ',' + e.stRecordId + ',1054,1056', 1));
e.timeDays && rule.push(handleId(1057, 284, e.timeDays, preIds + ',' + e.stRecordId + ',1054,1057', 3));
const ids = [];
e.governmentData && ids.push(778);
e.creditData && ids.push(793);
e.governmentData && rule.push(handleId(1055, 323, ids.join(), preIds + ',' + e.stRecordId + ',1055', 1));
});
await addOperation({
...getIds(),
parentId: preIds,
lcJudgmentRuleReq: rule,
});
ElMessage.success('提交成功!');
syncVisible.value = false;
emit('close', 1);
};
//
const submit = async (synchronizeUpdate?: number) => {
let param = JSON.parse(JSON.stringify(form.value));
param.map((e, i) => {
e.creditData = +e.creditData;
e.governmentData = +e.governmentData;
e.isChoose = +e.isChoose;
});
const recordParam = JSON.parse(JSON.stringify(param));
param.map((e) => {
delete e.recordChildren;
});
await postLoanInspectionSave({
...getIds(),
strategyId: strategyId.value,
strategyName: strategyName.value,
synchronizeUpdate,
postLoanInspectionList: param,
});
addRecord(recordParam);
};
const confirmSubmit = () => {
if (!strategyName.value) return ElMessage.error('请输入策略名称!');
syncVisible.value = true;
};
</script>
<style lang="scss" scoped>
@import url(../../../../styles/form.scss);
</style>

@ -0,0 +1,166 @@
<template>
<div class="block">
<div class="flex justify-between items-center mb-5">
<search v-model="keyWord"
@change="initList"></search>
<div class="filter">
<el-popconfirm title="确定要删除吗?"
:disabled="!multipleSelection.length"
@confirm.stop="delAll">
<template #reference>
<div :class="['add-btn mr-2', {'cursor-not-allowed': !multipleSelection.length}]">
<el-icon :size="24"
color="#fff">
<Delete />
</el-icon>
批量删除
</div>
</template>
</el-popconfirm>
<div class="add-btn"
@click="toAdd">
<img src="@/assets/images/plus.png"
alt=""
class="icon" />
新增
</div>
</div>
</div>
<el-table ref="table"
v-loading="loading"
:data="list"
@selection-change="handleSelectionChange">
<el-table-column type="selection"
width="55" />
<el-table-column label="序号"
type="index"
width="60"
align="center" />
<el-table-column prop="strategyName"
label="贷后检查策略名称"
min-width="180" />
<el-table-column prop="createTime"
label="新增日期"
min-width="140" />
<el-table-column label="操作"
width="140">
<template #default="{ row }">
<el-button type="text"
@click="toDetail(row, true)"
size="small">查看</el-button>
<el-button type="text"
@click="toDetail(row)"
size="small">编辑</el-button>
<el-popconfirm title="您确定删除吗?"
@confirm.stop="handleDelete([row.strategyId])">
<template #reference>
<el-button type="text"
size="small">删除</el-button>
</template>
</el-popconfirm>
</template></el-table-column>
</el-table>
<el-pagination v-model:currentPage="currentPage"
v-model:pageSize="pageSize"
:total="total"
:page-sizes="pageSizes"
:layout="pageLayout"
@size-change="getList()"
@current-change="getList()"
small
background
class="px-3 py-2 justify-end"></el-pagination>
<el-drawer v-model="visible"
:title="(isDetail ? '查看' : curRow.strategyId ? '编辑' : '新增') + '贷后检查策略'"
size="100%"
custom-class="model-drawer">
<Detail v-model:row="curRow"
:disabled="isDetail"
:key="i"
@close="closeDrawer" />
</el-drawer>
</div>
</template>
<script setup lang="ts">
import { onMounted, ref, watch, defineAsyncComponent } from 'vue';
import { ElMessage } from 'element-plus';
import { Delete } from '@element-plus/icons-vue';
import { pageSizes, pageLayout } from '@/utils/common';
import { postLoanInspection, postLoanInspectionDel } from '@/api/model';
import Search from '@/components/Search.vue';
const Detail = defineAsyncComponent(() => import('./Detail.vue'));
const keyWord = ref<string>();
const currentPage = ref<number>(1);
const pageSize = ref<number>(10);
const total = ref<number>(0);
const table = ref<any>();
const multipleSelection = ref<Record<string, any>[]>([]);
const list = ref<Record<string, any>[]>([]);
const loading = ref<boolean>(false);
const visible = ref<boolean>(false);
const curRow = ref<Record<string, any>>({
strategyId: '',
strategyName: '',
});
const isDetail = ref<boolean>(false);
const i = ref<number>(0);
//
const getList = async () => {
loading.value = true;
try {
const { page } = await postLoanInspection({ pageNum: currentPage.value, pageSize: pageSize.value, keyWord: keyWord.value });
list.value = page.records;
total.value = page.total;
} finally {
loading.value = false;
}
};
//
const initList = async () => {
currentPage.value = 1;
getList();
};
watch(keyWord, initList);
onMounted(getList);
//
const handleSelectionChange = (val: Record<string, any>[]) => {
multipleSelection.value = val;
};
//
const delAll = async () => {
handleDelete(multipleSelection.value.map((e) => e.strategyId));
};
//
const toAdd = () => {
i.value++;
isDetail.value = false;
curRow.value = {
strategyId: '',
strategyName: '',
};
visible.value = true;
};
//
const toDetail = async (row: Record<string, any>, detail: boolean = false) => {
i.value++;
isDetail.value = detail;
curRow.value = row;
visible.value = true;
};
//
const closeDrawer = (refresh?: number) => {
visible.value = false;
refresh && initList();
};
const handleDelete = async (ids: number[]) => {
await postLoanInspectionDel({ ids });
getList();
ElMessage.success('删除成功!');
};
</script>

@ -1,355 +0,0 @@
<template>
<!-- 贷后评分 -->
<el-table class="c-table"
:data="form"
:span-method="span"
:cell-style="{background:'#fff'}"
border>
<el-table-column prop="recordName"
label="指标"
min-width="80"
align="center"></el-table-column>
<el-table-column prop="recordName"
label="公式/取值"
min-width="200"
align="center">
<template #default="{ row, $index }">
<div class="flex items-center">
<template v-if="$index === 1">
存贷比 =
<div class="inline-flex flex-col justify-center mx-2">
<el-select v-if="row.recordChildren"
class="w-[140px]"
clearable
v-model="row.formulaOne"
disabled>
<el-option v-for="item in row?.recordChildren[0].subject.itemList"
:key="item"
:label="item.options"
:value="item.itemId" />
</el-select>
<p class="h-[1px] my-2 bg-[#cdcdcd]"></p>
<el-select v-if="row.recordChildren"
class="w-[140px]"
clearable
v-model="row.formulaTwo"
disabled>
<el-option v-for="item in row?.recordChildren[1].subject.itemList"
:key="item"
:label="item.options"
:value="item.itemId" />
</el-select>
</div>
x 100%
</template>
<template v-if="$index === 6">
房屋净值 =
<el-select v-if="row.recordChildren"
class="w-[140px] mx-2"
clearable
v-model="row.formulaOne"
disabled>
<el-option v-for="item in row?.recordChildren[0].subject.itemList"
:key="item"
:label="item.options"
:value="item.itemId" />
</el-select>
-
<el-select v-if="row.recordChildren"
class="w-[140px] ml-2"
clearable
v-model="row.formulaTwo"
disabled>
<el-option v-for="item in row?.recordChildren[1].subject.itemList"
:key="item"
:label="item.options"
:value="item.itemId" />
</el-select>
</template>
<template v-if="$index === 9">
<el-input class="w-[80px] mx-2"
placeholder="请输入"
v-model="row.formulaOne"
disabled></el-input>
<el-select v-if="row.recordChildren"
class="w-[140px] mr-2"
clearable
v-model="row.formulaTwo"
disabled>
<el-option v-for="item in row?.recordChildren[1].subject.itemList"
:key="item"
:label="item.options"
:value="item.itemId" />
</el-select>
内逾期次数
</template>
<template v-if="$index === 12">
<el-select v-if="row.recordChildren"
class="w-[140px] mx-2"
clearable
v-model="row.formulaOne"
disabled>
<el-option v-for="item in row?.recordChildren[0].subject.itemList"
:key="item"
:label="item.options"
:value="item.itemId" />
</el-select>
开始算还款当天不计算利息
</template>
<template v-if="$index === 15">当前尚未偿还的贷款总额</template>
<template v-if="$index === 18">
平均额度使用率 =
<div class="inline-flex flex-col justify-center mx-2">
<el-select v-if="row.recordChildren"
class="w-[140px]"
clearable
v-model="row.formulaOne"
disabled>
<el-option v-for="item in row?.recordChildren[0].subject.itemList"
:key="item"
:label="item.options"
:value="item.itemId" />
</el-select>
<p class="h-[1px] my-2 bg-[#cdcdcd]"></p>
<el-select v-if="row.recordChildren"
class="w-[140px]"
clearable
v-model="row.formulaTwo"
disabled>
<el-option v-for="item in row?.recordChildren[1].subject.itemList"
:key="item"
:label="item.options"
:value="item.itemId" />
</el-select>
</div>
x 100%
</template>
<template v-if="$index === 22">
最大用信率 =
<div class="inline-flex flex-col justify-center mx-2">
<el-select v-if="row.recordChildren"
class="w-[140px]"
clearable
v-model="row.formulaOne"
disabled>
<el-option v-for="item in row?.recordChildren[0].subject.itemList"
:key="item"
:label="item.options"
:value="item.itemId" />
</el-select>
<p class="h-[1px] my-2 bg-[#cdcdcd]"></p>
<el-select v-if="row.recordChildren"
class="w-[140px]"
clearable
v-model="row.formulaTwo"
disabled>
<el-option v-for="item in row?.recordChildren[1].subject.itemList"
:key="item"
:label="item.options"
:value="item.itemId" />
</el-select>
</div>
x 100%
</template>
<template v-if="$index === 26">到目前为止使用额度的次数</template>
<template v-if="$index === 30">到目前为止客户可以使用的最大额度</template>
<template v-if="$index === 35">客户贷记卡已经逾期的总月数</template>
<template v-if="$index === 37">客户在行所有贷款已经逾期的总月数</template>
</div>
</template>
</el-table-column>
<el-table-column prop="ruleName"
label="取值"
min-width="100"
align="center"></el-table-column>
<el-table-column label="分数"
min-width="80"
align="center">
<template #default="{ row }">
<el-select v-if="row.subject"
clearable
v-model="row.score">
<el-option v-for="item in row.subject.itemList.sort((a, b) => +a.options - +b.options)"
:key="item"
:label="item.options"
:value="item.itemId" />
</el-select>
<span v-else>600</span>
</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 { postCreditScoreDetails, postCreditScoreSave } from '@/api/model';
import { getProcessInformationBasedOnRoles, addOperation } from '@/api/judgment';
import type { TableColumnCtx } from 'element-plus';
import { handleId, getIds } from '@/utils/common';
import Cookies from 'js-cookie';
const form = ref<Record<string, any>[]>([]);
const info = ref<Record<string, any>[]>([]);
//
const answer = [[697, 693], [698, 691], [1, 707], [716], [], [695, 696], [696, 694]];
//
const getConfig = async () => {
const { process } = await getProcessInformationBasedOnRoles(1031);
console.log('🚀 ~ getConfig ~ process:', process);
const result = [
{
recordName: '基准分',
},
];
process.map((e, i) => {
let temp = {
...getIds(),
recordName: e.name,
recordChildren: e.recordChildren,
formulaOne: i < 7 ? answer[i][0] || '' : '',
formulaTwo: i < 7 ? answer[i][1] || '' : '',
score: '',
id: '',
stRecordId: e.id,
middleId: e.recordChildren[e.recordChildren.length - 1]?.id,
};
//
e.recordChildren[e.recordChildren.length - 1]?.recordChildren?.map((n, j) => {
temp = JSON.parse(JSON.stringify(temp));
temp.index = j;
temp.ruleName = n.name;
temp.subject = n.subject;
temp.ruleId = n.id;
result.push(temp);
});
});
if (info.value.length) {
result.forEach((e, i) => {
if (i) {
e.indexId = info.value[i - 1].indexId;
e.score = info.value[i - 1].score ? +info.value[i - 1].score : '';
}
});
}
form.value = result;
};
//
const getDetail = async () => {
try {
const { data } = await postCreditScoreDetails();
info.value = data;
getConfig();
} finally {
}
};
interface SpanMethodProps {
row: Record<string, any>;
column: TableColumnCtx<Record<string, any>>;
rowIndex: number;
columnIndex: number;
}
const rowMerge1 = [1, 30];
const rowMerge2 = [6, 9, 12, 15];
const rowMerge3 = [9, 18, 22, 26];
const rowMerge4 = [35, 37];
//
const span = ({ row, column, rowIndex, columnIndex }: SpanMethodProps) => {
if (!rowIndex) {
if (!columnIndex) {
return {
rowspan: 1,
colspan: 3,
};
} else if (columnIndex === 3) {
return {
rowspan: 1,
colspan: 1,
};
} else {
return {
rowspan: 0,
colspan: 0,
};
}
}
if (columnIndex < 2) {
if (rowMerge1.includes(rowIndex)) {
return {
rowspan: 5,
colspan: 1,
};
} else if (rowMerge2.includes(rowIndex)) {
return {
rowspan: 3,
colspan: 1,
};
} else if (rowMerge3.includes(rowIndex)) {
return {
rowspan: 4,
colspan: 1,
};
} else if (rowMerge4.includes(rowIndex)) {
return {
rowspan: 2,
colspan: 1,
};
} else {
return {
rowspan: 0,
colspan: 0,
};
}
}
};
//
const addRecord = async (data: Record<string, any>) => {
const preIds = `1,${Cookies.get('sand-level')},42,69,1031`; // 1id
const rule = [];
data.forEach((e, i) => {
e.score && rule.push(handleId(e.ruleId, e.subject.subjectId, e.score, `${preIds},${e.stRecordId},${e.middleId},${e.ruleId}`, 1));
if (i === 1 || i === 6 || i === 18 || i === 22) {
e.formulaOne && rule.push(handleId(1061, 285, e.formulaOne, `${preIds},${e.stRecordId},1061`, 1));
e.formulaTwo && rule.push(handleId(1062, 285, e.formulaTwo, `${preIds},${e.stRecordId},1062`, 1));
}
});
data[9].formulaOne && rule.push(handleId(1075, 288, data[9].formulaOne, `${preIds},1074,1075`, 3));
data[9].formulaTwo && rule.push(handleId(1076, 289, data[9].formulaTwo, `${preIds},1074,1076`, 1));
data[12].formulaOne && rule.push(handleId(1083, 291, data[12].formulaOne, `${preIds},1082,1083`, 1));
await addOperation({
...getIds(),
parentId: preIds,
lcJudgmentRuleReq: rule,
});
};
//
const submit = async () => {
let param = JSON.parse(JSON.stringify(form.value));
const recordParam = JSON.parse(JSON.stringify(param));
param.map((e) => {
delete e.recordChildren;
});
await postCreditScoreSave({ postCreditScoreList: param });
addRecord(recordParam);
getDetail();
ElMessage.success('提交成功!');
};
onMounted(() => {
getDetail();
});
</script>
<style lang="scss" scoped>
@import url(../../../styles/form.scss);
</style>

@ -0,0 +1,396 @@
<template>
<!-- 贷后评分 -->
<el-form label-width="90px"
label-suffix=":"
class="form"
:disabled="disabled">
<el-form-item label="策略名称">
<el-input class="w-[320px]"
placeholder="请输入20以内字符"
maxlength="20"
clearable
v-model="strategyName"></el-input>
</el-form-item>
<el-form-item label="策略规则">
<el-table class="c-table"
:data="form"
:span-method="span"
:cell-style="{background:'#fff'}"
border>
<el-table-column prop="recordName"
label="指标"
min-width="80"
align="center"></el-table-column>
<el-table-column prop="recordName"
label="公式/取值"
min-width="200"
align="center">
<template #default="{ row, $index }">
<div class="flex items-center">
<template v-if="$index === 1">
存贷比 =
<div class="inline-flex flex-col justify-center mx-2">
<el-select v-if="row.recordChildren"
class="w-[140px]"
clearable
v-model="row.formulaOne"
disabled>
<el-option v-for="item in row?.recordChildren[0].subject.itemList"
:key="item"
:label="item.options"
:value="item.itemId" />
</el-select>
<p class="h-[1px] my-2 bg-[#cdcdcd]"></p>
<el-select v-if="row.recordChildren"
class="w-[140px]"
clearable
v-model="row.formulaTwo"
disabled>
<el-option v-for="item in row?.recordChildren[1].subject.itemList"
:key="item"
:label="item.options"
:value="item.itemId" />
</el-select>
</div>
x 100%
</template>
<template v-if="$index === 6">
房屋净值 =
<el-select v-if="row.recordChildren"
class="w-[140px] mx-2"
clearable
v-model="row.formulaOne"
disabled>
<el-option v-for="item in row?.recordChildren[0].subject.itemList"
:key="item"
:label="item.options"
:value="item.itemId" />
</el-select>
-
<el-select v-if="row.recordChildren"
class="w-[140px] ml-2"
clearable
v-model="row.formulaTwo"
disabled>
<el-option v-for="item in row?.recordChildren[1].subject.itemList"
:key="item"
:label="item.options"
:value="item.itemId" />
</el-select>
</template>
<template v-if="$index === 9">
<el-input class="w-[80px] mx-2"
placeholder="请输入"
v-model="row.formulaOne"
disabled></el-input>
<el-select v-if="row.recordChildren"
class="w-[140px] mr-2"
clearable
v-model="row.formulaTwo"
disabled>
<el-option v-for="item in row?.recordChildren[1].subject.itemList"
:key="item"
:label="item.options"
:value="item.itemId" />
</el-select>
内逾期次数
</template>
<template v-if="$index === 12">
<el-select v-if="row.recordChildren"
class="w-[140px] mx-2"
clearable
v-model="row.formulaOne"
disabled>
<el-option v-for="item in row?.recordChildren[0].subject.itemList"
:key="item"
:label="item.options"
:value="item.itemId" />
</el-select>
开始算还款当天不计算利息
</template>
<template v-if="$index === 15">当前尚未偿还的贷款总额</template>
<template v-if="$index === 18">
平均额度使用率 =
<div class="inline-flex flex-col justify-center mx-2">
<el-select v-if="row.recordChildren"
class="w-[140px]"
clearable
v-model="row.formulaOne"
disabled>
<el-option v-for="item in row?.recordChildren[0].subject.itemList"
:key="item"
:label="item.options"
:value="item.itemId" />
</el-select>
<p class="h-[1px] my-2 bg-[#cdcdcd]"></p>
<el-select v-if="row.recordChildren"
class="w-[140px]"
clearable
v-model="row.formulaTwo"
disabled>
<el-option v-for="item in row?.recordChildren[1].subject.itemList"
:key="item"
:label="item.options"
:value="item.itemId" />
</el-select>
</div>
x 100%
</template>
<template v-if="$index === 22">
最大用信率 =
<div class="inline-flex flex-col justify-center mx-2">
<el-select v-if="row.recordChildren"
class="w-[140px]"
clearable
v-model="row.formulaOne"
disabled>
<el-option v-for="item in row?.recordChildren[0].subject.itemList"
:key="item"
:label="item.options"
:value="item.itemId" />
</el-select>
<p class="h-[1px] my-2 bg-[#cdcdcd]"></p>
<el-select v-if="row.recordChildren"
class="w-[140px]"
clearable
v-model="row.formulaTwo"
disabled>
<el-option v-for="item in row?.recordChildren[1].subject.itemList"
:key="item"
:label="item.options"
:value="item.itemId" />
</el-select>
</div>
x 100%
</template>
<template v-if="$index === 26">到目前为止使用额度的次数</template>
<template v-if="$index === 30">到目前为止客户可以使用的最大额度</template>
<template v-if="$index === 35">客户贷记卡已经逾期的总月数</template>
<template v-if="$index === 37">客户在行所有贷款已经逾期的总月数</template>
</div>
</template>
</el-table-column>
<el-table-column prop="ruleName"
label="取值"
min-width="100"
align="center"></el-table-column>
<el-table-column label="分数"
min-width="80"
align="center">
<template #default="{ row }">
<el-select v-if="row.subject"
clearable
v-model="row.score">
<el-option v-for="item in row.subject.itemList.sort((a, b) => +a.options - +b.options)"
:key="item"
:label="item.options"
:value="item.itemId" />
</el-select>
<span v-else>600</span>
</template>
</el-table-column>
</el-table>
</el-form-item>
</el-form>
<div v-if="!disabled"
class="flex justify-end mt-3">
<div class="dia-btn cancel"
@click="emit('close')">取消</div>
<div class="dia-btn"
@click="confirmSubmit">确定</div>
</div>
<Confirm v-model="syncVisible"
@submit="submit" />
</template>
<script setup lang="ts">
import { ref, defineAsyncComponent, onMounted, toRefs } from 'vue';
import { ElMessage } from 'element-plus';
import { postCreditScoreDetails, postCreditScoreSave } from '@/api/model';
import { getProcessInformationBasedOnRoles, addOperation } from '@/api/judgment';
import type { TableColumnCtx } from 'element-plus';
import { handleId, getIds } from '@/utils/common';
import Cookies from 'js-cookie';
const Confirm = defineAsyncComponent(() => import('@/components/StrategyConfirm.vue'));
const props = defineProps({
disabled: { type: Boolean, default: false },
row: { type: Object },
});
const emit = defineEmits(['clsoe']);
const { strategyId, strategyName } = toRefs(props.row);
const form = ref<Record<string, any>[]>([]);
const info = ref<Record<string, any>[]>([]);
//
const answer = [[697, 693], [698, 691], [1, 707], [716], [], [695, 696], [696, 694]];
const syncVisible = ref<boolean>(false);
//
const getConfig = async () => {
const { process } = await getProcessInformationBasedOnRoles(1031);
const result = [
{
recordName: '基准分',
},
];
process.map((e, i) => {
let temp = {
...getIds(),
recordName: e.name,
recordChildren: e.recordChildren,
formulaOne: i < 7 ? answer[i][0] || '' : '',
formulaTwo: i < 7 ? answer[i][1] || '' : '',
score: '',
id: '',
stRecordId: e.id,
middleId: e.recordChildren[e.recordChildren.length - 1]?.id,
};
//
e.recordChildren[e.recordChildren.length - 1]?.recordChildren?.map((n, j) => {
temp = JSON.parse(JSON.stringify(temp));
temp.index = j;
temp.ruleName = n.name;
temp.subject = n.subject;
temp.ruleId = n.id;
result.push(temp);
});
});
if (info.value.length) {
result.forEach((e, i) => {
if (i) {
e.indexId = info.value[i - 1].indexId;
e.score = info.value[i - 1].score ? +info.value[i - 1].score : '';
}
});
}
form.value = result;
};
//
const getDetail = async () => {
try {
if (strategyId.value) {
const { data } = await postCreditScoreDetails({
strategyId: strategyId.value,
});
info.value = data;
}
getConfig();
} finally {
}
};
onMounted(getDetail);
interface SpanMethodProps {
row: Record<string, any>;
column: TableColumnCtx<Record<string, any>>;
rowIndex: number;
columnIndex: number;
}
const rowMerge1 = [1, 30];
const rowMerge2 = [6, 9, 12, 15];
const rowMerge3 = [9, 18, 22, 26];
const rowMerge4 = [35, 37];
//
const span = ({ row, column, rowIndex, columnIndex }: SpanMethodProps) => {
if (!rowIndex) {
if (!columnIndex) {
return {
rowspan: 1,
colspan: 3,
};
} else if (columnIndex === 3) {
return {
rowspan: 1,
colspan: 1,
};
} else {
return {
rowspan: 0,
colspan: 0,
};
}
}
if (columnIndex < 2) {
if (rowMerge1.includes(rowIndex)) {
return {
rowspan: 5,
colspan: 1,
};
} else if (rowMerge2.includes(rowIndex)) {
return {
rowspan: 3,
colspan: 1,
};
} else if (rowMerge3.includes(rowIndex)) {
return {
rowspan: 4,
colspan: 1,
};
} else if (rowMerge4.includes(rowIndex)) {
return {
rowspan: 2,
colspan: 1,
};
} else {
return {
rowspan: 0,
colspan: 0,
};
}
}
};
//
const addRecord = async (data: Record<string, any>) => {
const preIds = `1,${Cookies.get('sand-level')},42,69,1031`; // 1id
const rule = [];
data.forEach((e, i) => {
e.score && rule.push(handleId(e.ruleId, e.subject.subjectId, e.score, `${preIds},${e.stRecordId},${e.middleId},${e.ruleId}`, 1));
if (i === 1 || i === 6 || i === 18 || i === 22) {
e.formulaOne && rule.push(handleId(1061, 285, e.formulaOne, `${preIds},${e.stRecordId},1061`, 1));
e.formulaTwo && rule.push(handleId(1062, 285, e.formulaTwo, `${preIds},${e.stRecordId},1062`, 1));
}
});
data[9].formulaOne && rule.push(handleId(1075, 288, data[9].formulaOne, `${preIds},1074,1075`, 3));
data[9].formulaTwo && rule.push(handleId(1076, 289, data[9].formulaTwo, `${preIds},1074,1076`, 1));
data[12].formulaOne && rule.push(handleId(1083, 291, data[12].formulaOne, `${preIds},1082,1083`, 1));
await addOperation({
...getIds(),
parentId: preIds,
lcJudgmentRuleReq: rule,
});
ElMessage.success('提交成功!');
syncVisible.value = false;
emit('close', 1);
};
//
const submit = async (synchronizeUpdate?: number) => {
let param = JSON.parse(JSON.stringify(form.value));
const recordParam = JSON.parse(JSON.stringify(param));
param.map((e) => {
delete e.recordChildren;
});
await postCreditScoreSave({
...getIds(),
strategyId: strategyId.value,
strategyName: strategyName.value,
synchronizeUpdate,
postCreditScoreList: param,
});
addRecord(recordParam);
};
const confirmSubmit = () => {
if (!strategyName.value) return ElMessage.error('请输入策略名称!');
syncVisible.value = true;
};
</script>
<style lang="scss" scoped>
@import url(../../../../styles/form.scss);
</style>

@ -0,0 +1,166 @@
<template>
<div class="block">
<div class="flex justify-between items-center mb-5">
<search v-model="keyWord"
@change="initList"></search>
<div class="filter">
<el-popconfirm title="确定要删除吗?"
:disabled="!multipleSelection.length"
@confirm.stop="delAll">
<template #reference>
<div :class="['add-btn mr-2', {'cursor-not-allowed': !multipleSelection.length}]">
<el-icon :size="24"
color="#fff">
<Delete />
</el-icon>
批量删除
</div>
</template>
</el-popconfirm>
<div class="add-btn"
@click="toAdd">
<img src="@/assets/images/plus.png"
alt=""
class="icon" />
新增
</div>
</div>
</div>
<el-table ref="table"
v-loading="loading"
:data="list"
@selection-change="handleSelectionChange">
<el-table-column type="selection"
width="55" />
<el-table-column label="序号"
type="index"
width="60"
align="center" />
<el-table-column prop="strategyName"
label="贷后评分策略名称"
min-width="180" />
<el-table-column prop="createTime"
label="新增日期"
min-width="140" />
<el-table-column label="操作"
width="140">
<template #default="{ row }">
<el-button type="text"
@click="toDetail(row, true)"
size="small">查看</el-button>
<el-button type="text"
@click="toDetail(row)"
size="small">编辑</el-button>
<el-popconfirm title="您确定删除吗?"
@confirm.stop="handleDelete([row.strategyId])">
<template #reference>
<el-button type="text"
size="small">删除</el-button>
</template>
</el-popconfirm>
</template></el-table-column>
</el-table>
<el-pagination v-model:currentPage="currentPage"
v-model:pageSize="pageSize"
:total="total"
:page-sizes="pageSizes"
:layout="pageLayout"
@size-change="getList()"
@current-change="getList()"
small
background
class="px-3 py-2 justify-end"></el-pagination>
<el-drawer v-model="visible"
:title="(isDetail ? '查看' : curRow.strategyId ? '编辑' : '新增') + '贷后评分策略'"
size="100%"
custom-class="model-drawer">
<Detail v-model:row="curRow"
:disabled="isDetail"
:key="i"
@close="closeDrawer" />
</el-drawer>
</div>
</template>
<script setup lang="ts">
import { onMounted, ref, watch, defineAsyncComponent } from 'vue';
import { ElMessage } from 'element-plus';
import { Delete } from '@element-plus/icons-vue';
import { pageSizes, pageLayout } from '@/utils/common';
import { postCreditScore, postCreditScoreDel } from '@/api/model';
import Search from '@/components/Search.vue';
const Detail = defineAsyncComponent(() => import('./Detail.vue'));
const keyWord = ref<string>();
const currentPage = ref<number>(1);
const pageSize = ref<number>(10);
const total = ref<number>(0);
const table = ref<any>();
const multipleSelection = ref<Record<string, any>[]>([]);
const list = ref<Record<string, any>[]>([]);
const loading = ref<boolean>(false);
const visible = ref<boolean>(false);
const curRow = ref<Record<string, any>>({
strategyId: '',
strategyName: '',
});
const isDetail = ref<boolean>(false);
const i = ref<number>(0);
//
const getList = async () => {
loading.value = true;
try {
const { page } = await postCreditScore({ pageNum: currentPage.value, pageSize: pageSize.value, keyWord: keyWord.value });
list.value = page.records;
total.value = page.total;
} finally {
loading.value = false;
}
};
//
const initList = async () => {
currentPage.value = 1;
getList();
};
watch(keyWord, initList);
onMounted(getList);
//
const handleSelectionChange = (val: Record<string, any>[]) => {
multipleSelection.value = val;
};
//
const delAll = async () => {
handleDelete(multipleSelection.value.map((e) => e.strategyId));
};
//
const toAdd = () => {
i.value++;
isDetail.value = false;
curRow.value = {
strategyId: '',
strategyName: '',
};
visible.value = true;
};
//
const toDetail = async (row: Record<string, any>, detail: boolean = false) => {
i.value++;
isDetail.value = detail;
curRow.value = row;
visible.value = true;
};
//
const closeDrawer = (refresh?: number) => {
visible.value = false;
refresh && initList();
};
const handleDelete = async (ids: number[]) => {
await postCreditScoreDel({ ids });
getList();
ElMessage.success('删除成功!');
};
</script>

@ -1,130 +0,0 @@
<template>
<!-- 贷后预警 -->
<el-table class="c-table"
:data="form"
:cell-style="{background:'#fff'}"
border>
<el-table-column label="选用"
width="80"
align="center">
<template #default="{ row }">
<el-checkbox v-model="row.isChoose"></el-checkbox>
</template>
</el-table-column>
<el-table-column prop="recordName"
label="风险类型"
align="center"></el-table-column>
<el-table-column label="风险等级"
align="center">
<template #default="{ row }">
<div class="flex">
<el-select v-if="row.recordChildren"
class="mr-2"
clearable
v-model="row.riskGradeType">
<el-option v-for="item in row?.recordChildren[1].recordChildren[0].subject.itemList"
:key="item"
:label="item.options"
:value="item.itemId" />
</el-select>
<el-select v-if="row.recordChildren"
clearable
v-model="row.riskGrade">
<el-option v-for="item in row?.recordChildren[1].recordChildren[1].subject.itemList"
:key="item"
:label="item.options"
:value="item.itemId" />
</el-select>
</div>
</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 { postLoanWarningDetails, postLoanWarningSave } from '@/api/model';
import { getProcessInformationBasedOnRoles, addOperation } from '@/api/judgment';
import { handleId, getIds } from '@/utils/common';
import Cookies from 'js-cookie';
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(1032);
const result = [];
process.map((e, i) => {
const cur = info.value.length ? info.value[i] : {};
result.push({
...getIds(),
recordName: e.name,
recordChildren: e.recordChildren,
riskGrade: +cur.riskGrade || '',
riskGradeType: +cur.riskGradeType || '',
isChoose: info.value.length ? !!cur.isChoose : false,
id: cur.id || '',
stRecordId: e.id,
});
});
form.value = result;
};
//
const getDetail = async () => {
try {
const { data } = await postLoanWarningDetails();
info.value = data;
getConfig();
} finally {
}
};
//
const addRecord = async (data: Record<string, any>) => {
const preIds = `1,${levelId},42,69,1032`; // 1id
const rule = [];
data.map((e) => {
e.isChoose && rule.push(handleId(1052, '', '', `${preIds},${e.stRecordId},1052`, ''));
e.riskGradeType && rule.push(handleId(1147, 299, e.riskGradeType, `${preIds},${e.stRecordId},1146,1147`, 1));
e.riskGrade && rule.push(handleId(1148, 300, e.riskGrade, `${preIds},${e.stRecordId},1146,1148`, 1));
});
await addOperation({
...getIds(),
parentId: preIds,
lcJudgmentRuleReq: rule,
});
};
//
const submit = async () => {
let param = JSON.parse(JSON.stringify(form.value));
param.forEach((e) => {
e.isChoose = +e.isChoose;
});
const recordParam = JSON.parse(JSON.stringify(param));
param.forEach((e) => {
delete e.recordChildren;
});
await postLoanWarningSave({ postLoanWarningList: param });
addRecord(recordParam);
getDetail();
ElMessage.success('提交成功!');
};
onMounted(() => {
getDetail();
});
</script>
<style lang="scss" scoped>
@import url(../../../styles/form.scss);
</style>

@ -0,0 +1,170 @@
<template>
<!-- 贷后预警 -->
<el-form label-width="90px"
label-suffix=":"
class="form"
:disabled="disabled">
<el-form-item label="策略名称">
<el-input class="w-[320px]"
placeholder="请输入20以内字符"
maxlength="20"
clearable
v-model="strategyName"></el-input>
</el-form-item>
<el-form-item label="策略规则">
<el-table class="c-table"
:data="form"
:cell-style="{background:'#fff'}"
border>
<el-table-column label="选用"
width="80"
align="center">
<template #default="{ row }">
<el-checkbox v-model="row.isChoose"></el-checkbox>
</template>
</el-table-column>
<el-table-column prop="recordName"
label="风险类型"
align="center"></el-table-column>
<el-table-column label="风险等级"
align="center">
<template #default="{ row }">
<div class="flex">
<el-select v-if="row.recordChildren"
class="mr-2"
clearable
v-model="row.riskGradeType">
<el-option v-for="item in row?.recordChildren[1].recordChildren[0].subject.itemList"
:key="item"
:label="item.options"
:value="item.itemId" />
</el-select>
<el-select v-if="row.recordChildren"
clearable
v-model="row.riskGrade">
<el-option v-for="item in row?.recordChildren[1].recordChildren[1].subject.itemList"
:key="item"
:label="item.options"
:value="item.itemId" />
</el-select>
</div>
</template></el-table-column>
</el-table>
</el-form-item>
</el-form>
<div v-if="!disabled"
class="flex justify-end mt-3">
<div class="dia-btn cancel"
@click="emit('close')">取消</div>
<div class="dia-btn"
@click="confirmSubmit">确定</div>
</div>
<Confirm v-model="syncVisible"
@submit="submit" />
</template>
<script setup lang="ts">
import { ref, defineAsyncComponent, onMounted, toRefs } from 'vue';
import { ElMessage } from 'element-plus';
import { postLoanWarningDetails, postLoanWarningSave } from '@/api/model';
import { getProcessInformationBasedOnRoles, addOperation } from '@/api/judgment';
import { handleId, getIds } from '@/utils/common';
import Cookies from 'js-cookie';
const Confirm = defineAsyncComponent(() => import('@/components/StrategyConfirm.vue'));
const props = defineProps({
disabled: { type: Boolean, default: false },
row: { type: Object },
});
const emit = defineEmits(['clsoe']);
const { strategyId, strategyName } = toRefs(props.row);
const form = ref<Record<string, any>[]>([]);
const info = ref<Record<string, any>[]>([]);
const syncVisible = ref<boolean>(false);
//
const getConfig = async () => {
const { process } = await getProcessInformationBasedOnRoles(1032);
const result = [];
process.map((e, i) => {
const cur = info.value.length ? info.value[i] : {};
result.push({
...getIds(),
recordName: e.name,
recordChildren: e.recordChildren,
riskGrade: +cur.riskGrade || '',
riskGradeType: +cur.riskGradeType || '',
isChoose: info.value.length ? !!cur.isChoose : false,
id: cur.id || '',
stRecordId: e.id,
});
});
form.value = result;
};
//
const getDetail = async () => {
try {
if (strategyId.value) {
const { data } = await postLoanWarningDetails({
strategyId: strategyId.value,
});
info.value = data;
}
getConfig();
} finally {
}
};
onMounted(getDetail);
//
const addRecord = async (data: Record<string, any>) => {
const preIds = `1,${Cookies.get('sand-level')},42,69,1032`; // 1id
const rule = [];
data.map((e) => {
e.isChoose && rule.push(handleId(1052, '', '', `${preIds},${e.stRecordId},1052`, ''));
e.riskGradeType && rule.push(handleId(1147, 299, e.riskGradeType, `${preIds},${e.stRecordId},1146,1147`, 1));
e.riskGrade && rule.push(handleId(1148, 300, e.riskGrade, `${preIds},${e.stRecordId},1146,1148`, 1));
});
await addOperation({
...getIds(),
parentId: preIds,
lcJudgmentRuleReq: rule,
});
ElMessage.success('提交成功!');
syncVisible.value = false;
emit('close', 1);
};
//
const submit = async (synchronizeUpdate?: number) => {
let param = JSON.parse(JSON.stringify(form.value));
param.forEach((e) => {
e.isChoose = +e.isChoose;
});
const recordParam = JSON.parse(JSON.stringify(param));
param.forEach((e) => {
delete e.recordChildren;
});
await postLoanWarningSave({
...getIds(),
strategyId: strategyId.value,
strategyName: strategyName.value,
synchronizeUpdate,
postLoanWarningList: param,
});
addRecord(recordParam);
};
const confirmSubmit = () => {
if (!strategyName.value) return ElMessage.error('请输入策略名称!');
syncVisible.value = true;
};
</script>
<style lang="scss" scoped>
@import url(../../../../styles/form.scss);
</style>

@ -0,0 +1,166 @@
<template>
<div class="block">
<div class="flex justify-between items-center mb-5">
<search v-model="keyWord"
@change="initList"></search>
<div class="filter">
<el-popconfirm title="确定要删除吗?"
:disabled="!multipleSelection.length"
@confirm.stop="delAll">
<template #reference>
<div :class="['add-btn mr-2', {'cursor-not-allowed': !multipleSelection.length}]">
<el-icon :size="24"
color="#fff">
<Delete />
</el-icon>
批量删除
</div>
</template>
</el-popconfirm>
<div class="add-btn"
@click="toAdd">
<img src="@/assets/images/plus.png"
alt=""
class="icon" />
新增
</div>
</div>
</div>
<el-table ref="table"
v-loading="loading"
:data="list"
@selection-change="handleSelectionChange">
<el-table-column type="selection"
width="55" />
<el-table-column label="序号"
type="index"
width="60"
align="center" />
<el-table-column prop="strategyName"
label="贷后预警策略名称"
min-width="180" />
<el-table-column prop="createTime"
label="新增日期"
min-width="140" />
<el-table-column label="操作"
width="140">
<template #default="{ row }">
<el-button type="text"
@click="toDetail(row, true)"
size="small">查看</el-button>
<el-button type="text"
@click="toDetail(row)"
size="small">编辑</el-button>
<el-popconfirm title="您确定删除吗?"
@confirm.stop="handleDelete([row.strategyId])">
<template #reference>
<el-button type="text"
size="small">删除</el-button>
</template>
</el-popconfirm>
</template></el-table-column>
</el-table>
<el-pagination v-model:currentPage="currentPage"
v-model:pageSize="pageSize"
:total="total"
:page-sizes="pageSizes"
:layout="pageLayout"
@size-change="getList()"
@current-change="getList()"
small
background
class="px-3 py-2 justify-end"></el-pagination>
<el-drawer v-model="visible"
:title="(isDetail ? '查看' : curRow.strategyId ? '编辑' : '新增') + '贷后预警策略'"
size="100%"
custom-class="model-drawer">
<Detail v-model:row="curRow"
:disabled="isDetail"
:key="i"
@close="closeDrawer" />
</el-drawer>
</div>
</template>
<script setup lang="ts">
import { onMounted, ref, watch, defineAsyncComponent } from 'vue';
import { ElMessage } from 'element-plus';
import { Delete } from '@element-plus/icons-vue';
import { pageSizes, pageLayout } from '@/utils/common';
import { postLoanWarning, postLoanWarningDel } from '@/api/model';
import Search from '@/components/Search.vue';
const Detail = defineAsyncComponent(() => import('./Detail.vue'));
const keyWord = ref<string>();
const currentPage = ref<number>(1);
const pageSize = ref<number>(10);
const total = ref<number>(0);
const table = ref<any>();
const multipleSelection = ref<Record<string, any>[]>([]);
const list = ref<Record<string, any>[]>([]);
const loading = ref<boolean>(false);
const visible = ref<boolean>(false);
const curRow = ref<Record<string, any>>({
strategyId: '',
strategyName: '',
});
const isDetail = ref<boolean>(false);
const i = ref<number>(0);
//
const getList = async () => {
loading.value = true;
try {
const { page } = await postLoanWarning({ pageNum: currentPage.value, pageSize: pageSize.value, keyWord: keyWord.value });
list.value = page.records;
total.value = page.total;
} finally {
loading.value = false;
}
};
//
const initList = async () => {
currentPage.value = 1;
getList();
};
watch(keyWord, initList);
onMounted(getList);
//
const handleSelectionChange = (val: Record<string, any>[]) => {
multipleSelection.value = val;
};
//
const delAll = async () => {
handleDelete(multipleSelection.value.map((e) => e.strategyId));
};
//
const toAdd = () => {
i.value++;
isDetail.value = false;
curRow.value = {
strategyId: '',
strategyName: '',
};
visible.value = true;
};
//
const toDetail = async (row: Record<string, any>, detail: boolean = false) => {
i.value++;
isDetail.value = detail;
curRow.value = row;
visible.value = true;
};
//
const closeDrawer = (refresh?: number) => {
visible.value = false;
refresh && initList();
};
const handleDelete = async (ids: number[]) => {
await postLoanWarningDel({ ids });
getList();
ElMessage.success('删除成功!');
};
</script>

@ -1,5 +1,17 @@
<template>
<!-- 贷后催收 -->
<el-form label-width="90px"
label-suffix=":"
class="form"
:disabled="disabled">
<el-form-item label="策略名称">
<el-input class="w-[320px]"
placeholder="请输入20以内字符"
maxlength="20"
clearable
v-model="strategyName"></el-input>
</el-form-item>
<el-form-item label="策略规则">
<el-table class="c-table"
:data="form"
:span-method="span"
@ -41,12 +53,19 @@
</el-select> -->
</template></el-table-column>
</el-table>
<div class="flex justify-end">
<div class="submit"
@click="submit">确认完成配置</div>
</el-form-item>
</el-form>
<div v-if="!disabled"
class="flex justify-end mt-3">
<div class="dia-btn cancel"
@click="emit('close')">取消</div>
<div class="dia-btn"
@click="confirmSubmit">确定</div>
</div>
<Confirm v-model="syncVisible"
@submit="submit" />
<el-dialog v-model="selectDia"
custom-class="select-dia">
<div class="selects"
@ -71,7 +90,7 @@
</template>
<script setup lang="ts">
import { ref, onMounted } from 'vue';
import { ref, defineAsyncComponent, onMounted, toRefs } from 'vue';
import { Plus } from '@element-plus/icons-vue';
import { ElMessage } from 'element-plus';
import { collectionAfterLoanDetails, collectionAfterLoanSave } from '@/api/model';
@ -79,12 +98,20 @@ import { getProcessInformationBasedOnRoles, addOperation } from '@/api/judgment'
import { handleId, getIds } from '@/utils/common';
import Cookies from 'js-cookie';
const projectId = +Cookies.get('sand-projectId');
const levelId = +Cookies.get('sand-level');
const Confirm = defineAsyncComponent(() => import('@/components/StrategyConfirm.vue'));
const props = defineProps({
disabled: { type: Boolean, default: false },
row: { type: Object },
});
const emit = defineEmits(['clsoe']);
const { strategyId, strategyName } = toRefs(props.row);
const form = ref<Record<string, any>[]>([]);
const info = ref<Record<string, any>[]>([]);
const curRow = ref<Record<string, any>>({});
const selectDia = ref<boolean>(false);
const syncVisible = ref<boolean>(false);
//
const getConfig = async () => {
const { process } = await getProcessInformationBasedOnRoles(1033);
@ -110,12 +137,17 @@ const getConfig = async () => {
//
const getDetail = async () => {
try {
const { data } = await collectionAfterLoanDetails();
if (strategyId.value) {
const { data } = await collectionAfterLoanDetails({
strategyId: strategyId.value,
});
info.value = data;
}
getConfig();
} finally {
}
};
onMounted(getDetail);
//
const showDia = (row: Record<string, any>) => {
selectDia.value = true;
@ -123,7 +155,7 @@ const showDia = (row: Record<string, any>) => {
};
//
const addRecord = async (data: Record<string, any>) => {
const preIds = `1,${levelId},42,69,1033,1149`; // 1id
const preIds = `1,${Cookies.get('sand-level')},42,69,1033,1149`; // 1id
const rule = [];
data.map((e) => {
@ -146,9 +178,12 @@ const addRecord = async (data: Record<string, any>) => {
parentId: preIds,
lcJudgmentRuleReq: rule,
});
ElMessage.success('提交成功!');
syncVisible.value = false;
emit('close', 1);
};
//
const submit = async () => {
const submit = async (synchronizeUpdate?: number) => {
let param = JSON.parse(JSON.stringify(form.value));
param.map((e) => {
e.appCollection = +e.appCollection;
@ -161,18 +196,23 @@ const submit = async () => {
param.map((e) => {
delete e.recordChildren;
});
await collectionAfterLoanSave({ collectionAfterLoanList: param });
await collectionAfterLoanSave({
...getIds(),
strategyId: strategyId.value,
strategyName: strategyName.value,
synchronizeUpdate,
collectionAfterLoanList: param,
});
addRecord(recordParam);
getDetail();
ElMessage.success('提交成功!');
};
onMounted(() => {
getDetail();
});
const confirmSubmit = () => {
if (!strategyName.value) return ElMessage.error('请输入策略名称!');
syncVisible.value = true;
};
</script>
<style lang="scss" scoped>
@import url(../../../styles/form.scss);
@import url(../../../../styles/form.scss);
.select-dia {
.selects {
margin-top: 20px;

@ -0,0 +1,166 @@
<template>
<div class="block">
<div class="flex justify-between items-center mb-5">
<search v-model="keyWord"
@change="initList"></search>
<div class="filter">
<el-popconfirm title="确定要删除吗?"
:disabled="!multipleSelection.length"
@confirm.stop="delAll">
<template #reference>
<div :class="['add-btn mr-2', {'cursor-not-allowed': !multipleSelection.length}]">
<el-icon :size="24"
color="#fff">
<Delete />
</el-icon>
批量删除
</div>
</template>
</el-popconfirm>
<div class="add-btn"
@click="toAdd">
<img src="@/assets/images/plus.png"
alt=""
class="icon" />
新增
</div>
</div>
</div>
<el-table ref="table"
v-loading="loading"
:data="list"
@selection-change="handleSelectionChange">
<el-table-column type="selection"
width="55" />
<el-table-column label="序号"
type="index"
width="60"
align="center" />
<el-table-column prop="strategyName"
label="贷后催收策略名称"
min-width="180" />
<el-table-column prop="createTime"
label="新增日期"
min-width="140" />
<el-table-column label="操作"
width="140">
<template #default="{ row }">
<el-button type="text"
@click="toDetail(row, true)"
size="small">查看</el-button>
<el-button type="text"
@click="toDetail(row)"
size="small">编辑</el-button>
<el-popconfirm title="您确定删除吗?"
@confirm.stop="handleDelete([row.strategyId])">
<template #reference>
<el-button type="text"
size="small">删除</el-button>
</template>
</el-popconfirm>
</template></el-table-column>
</el-table>
<el-pagination v-model:currentPage="currentPage"
v-model:pageSize="pageSize"
:total="total"
:page-sizes="pageSizes"
:layout="pageLayout"
@size-change="getList()"
@current-change="getList()"
small
background
class="px-3 py-2 justify-end"></el-pagination>
<el-drawer v-model="visible"
:title="(isDetail ? '查看' : curRow.strategyId ? '编辑' : '新增') + '贷后催收策略'"
size="100%"
custom-class="model-drawer">
<Detail v-model:row="curRow"
:disabled="isDetail"
:key="i"
@close="closeDrawer" />
</el-drawer>
</div>
</template>
<script setup lang="ts">
import { onMounted, ref, watch, defineAsyncComponent } from 'vue';
import { ElMessage } from 'element-plus';
import { Delete } from '@element-plus/icons-vue';
import { pageSizes, pageLayout } from '@/utils/common';
import { collectionAfterLoan, collectionAfterLoanDel } from '@/api/model';
import Search from '@/components/Search.vue';
const Detail = defineAsyncComponent(() => import('./Detail.vue'));
const keyWord = ref<string>();
const currentPage = ref<number>(1);
const pageSize = ref<number>(10);
const total = ref<number>(0);
const table = ref<any>();
const multipleSelection = ref<Record<string, any>[]>([]);
const list = ref<Record<string, any>[]>([]);
const loading = ref<boolean>(false);
const visible = ref<boolean>(false);
const curRow = ref<Record<string, any>>({
strategyId: '',
strategyName: '',
});
const isDetail = ref<boolean>(false);
const i = ref<number>(0);
//
const getList = async () => {
loading.value = true;
try {
const { page } = await collectionAfterLoan({ pageNum: currentPage.value, pageSize: pageSize.value, keyWord: keyWord.value });
list.value = page.records;
total.value = page.total;
} finally {
loading.value = false;
}
};
//
const initList = async () => {
currentPage.value = 1;
getList();
};
watch(keyWord, initList);
onMounted(getList);
//
const handleSelectionChange = (val: Record<string, any>[]) => {
multipleSelection.value = val;
};
//
const delAll = async () => {
handleDelete(multipleSelection.value.map((e) => e.strategyId));
};
//
const toAdd = () => {
i.value++;
isDetail.value = false;
curRow.value = {
strategyId: '',
strategyName: '',
};
visible.value = true;
};
//
const toDetail = async (row: Record<string, any>, detail: boolean = false) => {
i.value++;
isDetail.value = detail;
curRow.value = row;
visible.value = true;
};
//
const closeDrawer = (refresh?: number) => {
visible.value = false;
refresh && initList();
};
const handleDelete = async (ids: number[]) => {
await collectionAfterLoanDel({ ids });
getList();
ElMessage.success('删除成功!');
};
</script>

@ -1,64 +1,62 @@
<template>
<div class="block card-list flex py-0">
<div class="left">
<ul class="products">
<li v-for="(item, i) in list"
<div v-if="list.length">
<div class="menu-card">
<el-menu class="left"
:default-active="curMenu"
@select="handleSelect">
<el-menu-item v-for="(item, i) in list"
:key="i"
:class="{ active: item.id === id }"
@click="switchProduct(item.id)">
<h6>{{ item.name }}</h6>
<p class="meta">{{ item.remark }}</p>
</li>
</ul>
</div>
:index="String(item.id)">{{ item.name }}</el-menu-item>
</el-menu>
<div class="right">
<Com1 v-if="id == 1029" />
<Com2 v-else-if="id == 1030" />
<Com3 v-else-if="id == 1031" />
<Com4 v-else-if="id == 1032" />
<Com5 v-else-if="id == 1033" />
<component :is="curMenu" />
</div>
</div>
</div>
</template>
<script setup lang="ts">
import { computed, onMounted, ref } from 'vue';
import { computed, onBeforeUnmount, onMounted, ref, defineAsyncComponent, getCurrentInstance } from 'vue';
import { getProcessInformationBasedOnRoles } from '@/api/judgment';
import { useRouter, useRoute } from 'vue-router';
import Cookies from 'js-cookie';
import Com1 from './1029.vue';
import Com2 from './1030.vue';
import Com3 from './1031.vue';
import Com4 from './1032.vue';
import Com5 from './1033.vue';
const router = useRouter();
const route = useRoute();
const projectId = +Cookies.get('sand-projectId');
const levelId = +Cookies.get('sand-level');
const curMenu = ref<string>(route.query.id);
const list = ref<Array<Record<string, any>>>([]);
const id = computed(() => +route.query.id);
//
const switchProduct = (productId: number | string) => {
router.push(`/product/afterLoan?i=4&role=42&id=${productId}`);
const dynamicComponentMap = {
'1029': defineAsyncComponent(() => import('./1029/Index.vue')),
'1030': defineAsyncComponent(() => import('./1030/Index.vue')),
'1031': defineAsyncComponent(() => import('./1031/Index.vue')),
'1032': defineAsyncComponent(() => import('./1032/Index.vue')),
'1033': defineAsyncComponent(() => import('./1033/Index.vue')),
};
const app = getCurrentInstance().appContext.app;
for (const [name, asyncComponent] of Object.entries(dynamicComponentMap)) {
app.component(name, asyncComponent);
}
//
const getList = async (refresh?: number) => {
const getList = async () => {
const { process } = await getProcessInformationBasedOnRoles(69);
// eslint-disable-next-line no-unused-expressions
!id.value && switchProduct(process[0].id);
!curMenu.value && handleSelect(process[0].recordChildren[0].id);
list.value = process;
};
onMounted(() => {
getList();
});
onMounted(getList);
// onBeforeUnmount(() => {
// console.log('🚀 ~ onBeforeUnmount ~ app:', app);
// app.component('148', null);
// app.component('150', null);
// });
const handleSelect = (key: string) => {
curMenu.value = key;
router.push(`/product/afterLoan?i=${route.query.i}&role=${route.query.role}&id=${key}`);
};
</script>
<style lang="scss" scoped>
.card-list {
.left {
@apply max-h-[calc(100vh-120px)];
}
.left {
@apply w-[200px];
}
</style>

@ -1,375 +0,0 @@
<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"
:cell-style="{background:'#fff'}"
border>
<el-table-column prop="indexName"
label="指标名称"
min-width="100"
align="center"></el-table-column>
<el-table-column label="计算公式"
min-width="100"
align="center">
<template #default="{ row, $index }">
<el-select v-if="row.recordChildren && 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-if="$index === 50"> =起始浮动比例+增减分值 不超过最高浮动比例</span>
<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, $index }">
<span v-if="$index === 50">以上分值合计</span>
<el-input v-else-if="$index === 51 || $index === 52"
placeholder="请输入"
v-model="row.floatingCoefficient"></el-input>
<el-select v-else-if="row.subject"
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, ElLoading } 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, getIds } from '@/utils/common';
import Cookies from 'js-cookie';
const router = useRouter();
const route = useRoute();
let loading = null;
const form = ref<Record<string, any>>({
...getIds(),
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) => {
if (e.recordChildren) {
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);
}
});
} else {
result.push({
stRecordId: e.id,
subject: e.subject,
indexId: info.value[i]?.indexId || '',
modelId: info.value[i]?.modelId || '',
indexName: e.name,
floatingCoefficient: '',
id: info.value[i]?.corporateInterestRateModels[info.value[i]?.corporateInterestRateModels?.length - 1]?.id || '',
floatingCoefficient: info.value[i]?.corporateInterestRateModels[info.value[i]?.corporateInterestRateModels?.length - 1]?.floatingCoefficient ?? '',
});
}
});
// result.push(
// {
// indexId: info.value[10]?.indexId || '',
// modelId: info.value[10]?.modelId || '',
// indexName: '',
// formula: ' =+ ',
// floatingCoefficient: '',
// },
// {
// indexId: info.value[11]?.indexId || '',
// modelId: info.value[11]?.modelId || '',
// indexName: '',
// formula: '--',
// id: info.value[11]?.corporateInterestRateModels[info.value[11]?.corporateInterestRateModels?.length - 1]?.id || '',
// floatingCoefficient: info.value[11]?.corporateInterestRateModels[info.value[11]?.corporateInterestRateModels?.length - 1]?.floatingCoefficient ?? '',
// },
// {
// indexId: info.value[12]?.indexId || '',
// modelId: info.value[12]?.modelId || '',
// indexName: '',
// formula: '--',
// id: info.value[12]?.corporateInterestRateModels[info.value[12]?.corporateInterestRateModels?.length - 1]?.id || '',
// floatingCoefficient: info.value[12]?.corporateInterestRateModels[info.value[12]?.corporateInterestRateModels?.length - 1]?.floatingCoefficient ?? '',
// },
// );
form.value.corporateInterestRateModelIndicators = result;
console.log('🚀 ~ getConfig ~ result:', result);
loading.close();
};
//
const getDetail = async (load?: number) => {
if (load) loading = ElLoading.service();
try {
const { data } = await businessInterestRateDetails();
if (data) {
form.value = data;
info.value = data.corporateInterestRateModelIndicators;
}
getConfig();
} finally {
}
};
onMounted(() => {
getDetail(1);
});
interface SpanMethodProps {
row: Record<string, any>;
column: TableColumnCtx<Record<string, any>>;
rowIndex: number;
columnIndex: number;
}
const rowMerge1 = [0, 15];
const rowMerge2 = [10, 19, 24, 29, 34, 39];
const rowMerge3 = [50, 51, 52];
//
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 (rowMerge3.includes(rowIndex)) {
if (columnIndex === 1) {
return {
rowspan: 1,
colspan: 2,
};
} else if (columnIndex !== 2) {
return {
rowspan: 1,
colspan: 1,
};
}
} else if (rowIndex === 4) {
return {
rowspan: 6,
colspan: 1,
};
} else if (rowIndex === 44) {
return {
rowspan: 6,
colspan: 1,
};
} else {
return {
rowspan: 0,
colspan: 0,
};
}
} else if (rowMerge3.includes(rowIndex) && columnIndex === 2) {
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 &&
e?.recordChildren?.length &&
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,
),
);
//
if (i === 51 || i === 52) {
e.floatingCoefficient && rule.push(handleId(e.stRecordId, e.subject.subjectId, e.floatingCoefficient, `${listIds},${e.stRecordId}`, 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({
...getIds(),
parentId: preIds,
lcJudgmentRuleReq: rule,
});
};
//
const submit = async () => {
loading = ElLoading.service();
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>

@ -562,7 +562,7 @@ const getDetail = async () => {
detail.value = [];
form.description = '';
form.scoreCardName = '';
form.scoringObject = 0;
form.scoringObject = 1;
}
};
onMounted(getDetail);

Loading…
Cancel
Save