parent
53913f3f19
commit
1369206c2e
18 changed files with 2009 additions and 1315 deletions
@ -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`; // 1,关卡id,角色(这个页面是风控经理策略) |
||||
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`; // 1,关卡id,角色(这个页面是风控经理策略) |
||||
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`; // 1,关卡id,角色(这个页面是风控经理策略) |
||||
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`; // 1,关卡id,角色(这个页面是风控经理策略) |
||||
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`; // 1,关卡id,角色(这个页面是风控经理策略) |
||||
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`; // 1,关卡id,角色(这个页面是风控经理策略) |
||||
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`; // 1,关卡id,角色(这个页面是风控经理策略) |
||||
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`; // 1,关卡id,角色(这个页面是风控经理策略) |
||||
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> |
@ -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`; // 1,关卡id,角色(这个页面是风控经理策略),其他看判分点接口 |
||||
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> |
Loading…
Reference in new issue