parent
7e291e6722
commit
7e7c233b6b
12 changed files with 470 additions and 49 deletions
@ -0,0 +1,174 @@ |
||||
<template> |
||||
<!-- 五级分类 --> |
||||
<el-table class="c-table" |
||||
:data="form" |
||||
:span-method="span" |
||||
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 class="" |
||||
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 class="" |
||||
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 class="" |
||||
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 class="" |
||||
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 class="" |
||||
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 class="" |
||||
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 } 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({ |
||||
checkpointId: levelId, |
||||
projectId, |
||||
recordName: e.name, |
||||
recordChildren: e.recordChildren, |
||||
ninetyDays: +(cur.ninetyDays || 676), |
||||
notOverdue: +(cur.notOverdue || 676), |
||||
oneHundredAndEightyDays: +(cur.oneHundredAndEightyDays || 676), |
||||
thirtyDays: +(cur.thirtyDays || 676), |
||||
threeHundredAndSixtyDays: +(cur.threeHundredAndSixtyDays || 676), |
||||
threeHundredAndSixtyDaysAbove: +(cur.threeHundredAndSixtyDaysAbove || 676), |
||||
id: cur.id || '', |
||||
stRecordId: e.id, |
||||
}); |
||||
}); |
||||
form.value = result; |
||||
}; |
||||
// 详情 |
||||
const getDetail = async () => { |
||||
try { |
||||
const { data } = await fiveLevelClassificationDetails(levelId, projectId); |
||||
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) => { |
||||
rule.push(handleId(n.id, n.subjectId, e[fieldKeys[i]], `${preIds},${e.stRecordId},${n.id}`, 1)); |
||||
}); |
||||
}); |
||||
|
||||
await addOperation({ |
||||
checkpointId: levelId, |
||||
parentId: preIds, |
||||
lcJudgmentRuleReq: rule, |
||||
projectId, |
||||
}); |
||||
}; |
||||
// 提交 |
||||
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,190 @@ |
||||
<template> |
||||
<!-- 贷后检查 --> |
||||
<el-table class="c-table" |
||||
:data="form" |
||||
:span-method="span" |
||||
border> |
||||
<el-table-column prop="name" |
||||
label="选用" |
||||
width="150" |
||||
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="250" |
||||
align="center"> |
||||
<template #default="{ row }"> |
||||
<el-select 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="200" |
||||
align="center"> |
||||
<template #default="{ row, $index }"> |
||||
<span v-if="$index === 4">点击后触发。</span> |
||||
<div v-else |
||||
class="flex items-center"> |
||||
<el-select 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="200" |
||||
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 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 } 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(1030); |
||||
const result = []; |
||||
process.map((e, i) => { |
||||
const cur = info.value.find((n) => n.stRecordId === e.id); |
||||
let temp = { |
||||
checkpointId: levelId, |
||||
projectId, |
||||
recordName: e.name, |
||||
recordChildren: e.recordChildren, |
||||
checkObject: 683, |
||||
checkTimeType: 689, |
||||
creditData: false, |
||||
governmentData: false, |
||||
isChoose: false, |
||||
timeDays: '', |
||||
stRecordId: e.id, |
||||
}; |
||||
result.push(temp); |
||||
i === 1 && result.push(JSON.parse(JSON.stringify(temp))); |
||||
}); |
||||
if (info.value.length) { |
||||
result.forEach((e, i) => { |
||||
result[i].checkObject = +info.value[i].checkObject; |
||||
result[i].checkTimeType = +info.value[i].checkTimeType; |
||||
result[i].creditData = !!info.value[i].creditData; |
||||
result[i].governmentData = !!info.value[i].governmentData; |
||||
result[i].isChoose = !!info.value[i].isChoose; |
||||
result[i].timeDays = info.value[i].timeDays; |
||||
result[i].id = info.value[i].id; |
||||
}); |
||||
} |
||||
form.value = result; |
||||
}; |
||||
// 详情 |
||||
const getDetail = async () => { |
||||
try { |
||||
const { data } = await postLoanInspectionDetails(levelId, projectId); |
||||
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>) => { |
||||
const preIds = `1,${Cookies.get('sand-level')},42,69,1030`; // 1,关卡id,角色(这个页面是风控经理策略) |
||||
const rule = []; |
||||
|
||||
data.forEach((e, i) => { |
||||
rule.push(handleId(1052, '', '', preIds + ',' + e.stRecordId + ',1052', ''), handleId(1053, 282, e.checkObject, preIds + ',' + e.stRecordId + ',1053', 1)); |
||||
i !== 4 && 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)); |
||||
e.governmentData && rule.push(handleId(1058, '', '', preIds + ',' + e.stRecordId + ',1055,1058', '')); |
||||
e.creditData && rule.push(handleId(1058, '', '', preIds + ',' + e.stRecordId + ',1055,1058', '')); |
||||
}); |
||||
|
||||
await addOperation({ |
||||
checkpointId: levelId, |
||||
parentId: preIds, |
||||
lcJudgmentRuleReq: rule, |
||||
projectId, |
||||
}); |
||||
}; |
||||
// 提交 |
||||
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,83 @@ |
||||
<template> |
||||
<div class="block" |
||||
style="padding-top: 0"> |
||||
<div class="flex"> |
||||
<div class="left w-[241px] min-w-[241px] pr-5 py-4"> |
||||
<ul class="products"> |
||||
<li v-for="(item, i) in list" |
||||
:key="i" |
||||
:class="{ active: item.id === id }" |
||||
@click="switchProduct(item.id)"> |
||||
<h6>{{ item.name }}</h6> |
||||
<p class="type">{{ item.remark }}</p> |
||||
</li> |
||||
</ul> |
||||
</div> |
||||
<div class="right flex-1 px-5 pt-4"> |
||||
<Com1 v-if="id == 1029" /> |
||||
<Com2 v-else-if="id == 1030" /> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</template> |
||||
|
||||
<script setup lang="ts"> |
||||
import { computed, onMounted, ref } from 'vue'; |
||||
import type { TabsPaneContext } from 'element-plus'; |
||||
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 './935.vue'; |
||||
import Com4 from './936.vue'; |
||||
|
||||
const router = useRouter(); |
||||
const route = useRoute(); |
||||
const projectId = +Cookies.get('sand-projectId'); |
||||
const levelId = +Cookies.get('sand-level'); |
||||
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 getList = async (refresh?: number) => { |
||||
const { process } = await getProcessInformationBasedOnRoles(69); |
||||
// eslint-disable-next-line no-unused-expressions |
||||
!id.value && switchProduct(process[0].id); |
||||
list.value = process; |
||||
}; |
||||
onMounted(() => { |
||||
getList(); |
||||
}); |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
.left { |
||||
border-right: 1px solid #e9eff2; |
||||
} |
||||
.products { |
||||
@apply max-h-[calc(100vh-205px)] pr-1 overflow-auto; |
||||
li { |
||||
@apply relative p-5 pt-7 mb-5 rounded-[10px] cursor-pointer border border-solid border-[transparent] bg-[url('@/assets/images/10.png')] bg-[length:100%_100%] bg-no-repeat; |
||||
&.active { |
||||
@apply border-[#CAE0FF]; |
||||
} |
||||
} |
||||
.del { |
||||
@apply absolute top-0 right-0; |
||||
} |
||||
h6 { |
||||
@apply text-[#14436b]; |
||||
} |
||||
.type { |
||||
@apply my-3 text-sm text-[#333]; |
||||
} |
||||
.des { |
||||
@apply text-sm text-[#8798a9]; |
||||
} |
||||
} |
||||
</style> |
Loading…
Reference in new issue