行内黑名单

V0.1
yujialong 1 year ago
parent 07a30dec64
commit f256826bc3
  1. 30
      src/views/product/bank/Add.vue
  2. 3
      src/views/product/strategy/150.vue
  3. 3
      src/views/product/strategy/151.vue
  4. 15
      src/views/product/strategy/152.vue
  5. 256
      src/views/product/strategy/153.vue
  6. 2
      src/views/product/strategy/CardList.vue

@ -187,16 +187,6 @@
prop="minimumLoan"
:rules="[
{ required: true, message: '请输入贷款额度', trigger: 'blur' },
{
asyncValidator: async (rule, value, callback) => {
const max = form.loanCeiling
if (isNaN(value) || value < 0 || max === '' || isNaN(max) || max < 0 || value > max) {
callback('请输入合理的贷款额度')
} else {
callback()
}
},
},
]">
<div class="flex-1">
<div class="num-inputs">
@ -213,16 +203,6 @@
prop="minimumAprOnLoan"
:rules="[
{ required: true, message: '请输入贷款利率', trigger: 'blur' },
{
asyncValidator: async (rule, value, callback) => {
const max = form.maximumAnnualInterestRate
if (isNaN(value) || value < 0 || max === '' || isNaN(max) || max < 0 || value > max) {
callback('请输入合理的贷款利率')
} else {
callback()
}
},
},
]">
<div class="flex-1">
<div class="num-inputs">
@ -241,16 +221,6 @@
prop="minimumTermOfLoan"
:rules="[
{ required: true, message: '请输入贷款期限', trigger: 'blur' },
{
asyncValidator: async (rule, value, callback) => {
const max = form.maximumTermOfLoan
if (isNaN(value) || value < 0 || max === '' || isNaN(max) || max < 0 || value > max) {
callback('请输入合理的贷款期限')
} else {
callback()
}
},
},
]">
<div class="flex-1">
<div class="num-inputs">

@ -1,4 +1,5 @@
<template>
<!-- 政务 -->
<el-table class="c-table"
:data="form"
:max-height="height"
@ -129,7 +130,7 @@ const levelId = +Cookies.get('sand-level');
const form = ref<Record<string, any>[]>([]);
const info = ref<Record<string, any>[]>([]);
const height = window.innerHeight - 270;
const symbols = <Record<string, any>[]>[
const symbols: Array<Record<string, any>> = [
{
name: '>=',
},

@ -1,4 +1,5 @@
<template>
<!-- 征信 -->
<el-table class="c-table"
:data="form"
:max-height="height"
@ -107,7 +108,7 @@ const levelId = +Cookies.get('sand-level');
const form = ref<Record<string, any>[]>([]);
const info = ref<Record<string, any>[]>([]);
const height = window.innerHeight - 270;
const symbols = <Record<string, any>[]>[
const symbols: Array<Record<string, any>> = [
{
name: '>=',
},

@ -1,4 +1,5 @@
<template>
<!-- 商采 -->
<el-table class="c-table"
:data="form"
:max-height="height"
@ -163,7 +164,7 @@ const form = ref<Record<string, any>[]>([]);
const info = ref<Record<string, any>[]>([]);
const height = window.innerHeight - 270;
const spanRows = [1, 2, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 17, 19, 20, 21, 22, 23, 24, 25, 26, 27];
const symbols = <Record<string, any>[]>[
const symbols: Array<Record<string, any>> = [
{
name: '>=',
},
@ -180,7 +181,7 @@ const symbols = <Record<string, any>[]>[
name: '<=',
},
];
const house = <Record<string, any>[]>[
const house: Array<Record<string, any>> = [
{
// id: 353,
name: '有商品房',
@ -190,7 +191,7 @@ const house = <Record<string, any>[]>[
name: '无商品房',
},
];
const units = <Record<string, any>[]>[
const units: Array<Record<string, any>> = [
{
name: '年',
},
@ -201,7 +202,7 @@ const units = <Record<string, any>[]>[
name: '天',
},
];
const tdNames = <Record<string, any>>{
const tdNames: Record<string, any> = {
344: '内身份证关联多个申请信息。',
345: '内申请信息关联多个身份证。',
346: '内申请人身份证作为联系人身份证出现的次数过多。',
@ -230,7 +231,7 @@ const getConfig = async () => {
stRecordId: e.id,
ruleId: e?.recordChildren[0].id,
rule: e?.recordChildren[0].name,
symbol: (e.id === 318 || e.id === 320) && cur ? symbol : !i || i === 2 ? '>=' : e.id === 322 ? '' : '年',
symbol: e.id === 322 && cur ? cur?.ruleOne : (e.id === 318 || e.id === 320) && cur ? symbol : !i || i === 2 ? '>=' : e.id === 322 ? '' : '年',
symbol1: '>=',
num,
num1: '',
@ -271,7 +272,9 @@ const getConfig = async () => {
}
if (e.id === 322) temp.symbol = '年';
//
if (n.id === 344) {
if (n.id === 342) {
temp.symbol = cur?.ruleOne;
} else if (n.id === 344) {
temp.num = getNum(cur?.ruleTwo);
temp.symbol = getChinese(cur?.ruleTwo);
} else if (n.id === 345) {

@ -0,0 +1,256 @@
<template>
<!-- 行内 -->
<el-table class="c-table"
:data="form"
:max-height="height"
:span-method="span"
border>
<el-table-column prop="name"
label="五级分类"
min-width="150"
align="center">
</el-table-column>
<el-table-column label="未结清是否进黑名单"
min-width="150"
align="center">
<template #default="{ row, $index }">
<span v-if="$index == 4">不存在未结清情况</span>
<el-checkbox v-else
v-model="row.enterBlacklist"></el-checkbox>
</template>
</el-table-column>
<el-table-column label="进入黑名单规则"
min-width="250"
align="center">
<template #default="{ row }">
<div class="flex items-center">
<span class="whitespace-nowrap">{{ row?.recordChildren[1]?.recordChildren[0]?.name }}认定{{row.name}}</span>
<div class="w-[90px] ">
<el-select class="mx-2"
v-model="row.enterRuleOne">
<el-option v-for="item in nums"
:key="item"
:label="item"
:value="item" />
</el-select>
</div>
<span class="whitespace-nowrap">天以上进入黑名单</span>
</div>
<div class="flex items-center mt-2">
<span class="whitespace-nowrap">{{ row?.recordChildren[1]?.recordChildren[1]?.name }}认定{{row.name}}</span>
<div class="w-[90px] ">
<el-select class="mx-2"
v-model="row.enterRuleTwo">
<el-option v-for="item in nums"
:key="item"
:label="item"
:value="item" />
</el-select>
</div>
<span class="whitespace-nowrap">天以上进入黑名单</span>
</div>
</template>
</el-table-column>
<el-table-column label="结清是否能出黑名单"
min-width="150"
align="center">
<template #default="{ row }">
<el-checkbox v-model="row.outBlacklist"></el-checkbox>
</template>
</el-table-column>
<el-table-column label="结清出黑名单规则"
min-width="300"
align="center">
<template #default="{ row }">
<div class="flex items-center">
<span class="whitespace-nowrap">{{ row?.recordChildren[1]?.recordChildren[0]?.name }}结清后</span>
<div class="w-[90px] ">
<el-select class="mx-2"
v-model="row.num">
<el-option v-for="item in nums"
:key="item"
:label="item"
:value="item" />
</el-select>
</div>
<div class="w-[90px] ">
<el-select class="mr-2"
v-model="row.symbol">
<el-option v-for="item in units"
:key="item"
:label="item"
:value="item" />
</el-select>
</div>
<span class="whitespace-nowrap">后出黑名单</span>
</div>
<div class="flex items-center mt-2">
<span class="whitespace-nowrap">{{ row?.recordChildren[1]?.recordChildren[1]?.name }}结清后</span>
<div class="w-[90px] ">
<el-select class="mx-2"
v-model="row.num1">
<el-option v-for="item in nums"
:key="item"
:label="item"
:value="item" />
</el-select>
</div>
<div class="w-[90px] ">
<el-select class="mr-2"
v-model="row.symbol1">
<el-option v-for="item in units"
:key="item"
:label="item"
:value="item" />
</el-select>
</div>
<span class="whitespace-nowrap">后出黑名单</span>
</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, computed, watch, onMounted } from 'vue';
import { ElMessage } from 'element-plus';
import { accessStrategyInlineBlacklistFind, accessStrategyInlineBlacklistSave } from '@/api/model';
import { getProcessInformationBasedOnRoles, addOperation } from '@/api/judgment';
import type { TableColumnCtx } from 'element-plus';
import { useRouter, useRoute } from 'vue-router';
import { handleId, getNum, getChinese } from '@/utils/common';
import Cookies from 'js-cookie';
const router = useRouter();
const route = useRoute();
const projectId = +Cookies.get('sand-projectId');
const levelId = +Cookies.get('sand-level');
const form = ref<Record<string, any>[]>([]);
const info = ref<Record<string, any>[]>([]);
const height = window.innerHeight - 270;
const nums: Array<number> = [1, 3, 5, 10, 20, 30, 40];
const units: Array<string> = ['年', '个月', '天'];
//
const getConfig = async () => {
const { process } = await getProcessInformationBasedOnRoles(153);
const result = [];
process.map((e) => {
const cur = info.value.find((n) => n.stRecordId === e.id);
let temp = {
checkpointId: levelId,
projectId,
name: e.name,
recordChildren: e.recordChildren,
enterBlacklist: !!cur?.enterBlacklist,
outBlacklist: !!cur?.outBlacklist,
enterRuleOne: cur?.enterRuleOne || 1,
enterRuleTwo: cur?.enterRuleTwo || 1,
num: getNum(cur?.outRuleOne) || 1,
num1: getNum(cur?.outRuleTwo) || 1,
symbol: getChinese(cur?.outRuleOne) || '年',
symbol1: getChinese(cur?.outRuleTwo) || '年',
stRecordId: e.id,
};
result.push(temp);
});
form.value = result;
console.log('🚀 ~ file: 153.vue:163 ~ getConfig ~ form.value:', form.value);
};
//
const getDetail = async () => {
try {
const { data } = await accessStrategyInlineBlacklistFind(levelId, projectId);
info.value = data;
getConfig();
} finally {
}
};
watch(
() => route.query,
() => {
getDetail();
},
{
immediate: true,
},
);
// 3
const isRule = (rule: number): boolean => {
return rule === 161 || rule === 164 || rule === 167;
};
interface SpanMethodProps {
row: Record<string, any>;
column: TableColumnCtx<Record<string, any>>;
rowIndex: number;
columnIndex: number;
}
//
const span = ({ row, column, rowIndex, columnIndex }: SpanMethodProps) => {
if (rowIndex === 4) {
if (columnIndex === 1) {
return {
rowspan: 1,
colspan: 4,
};
} else if (columnIndex > 1) {
return {
rowspan: 0,
colspan: 0,
};
}
}
};
//
const submit = async () => {
let param = JSON.parse(JSON.stringify(form.value));
param.map((e, i) => {
if (info.value.length) e.id = info.value.find((n) => n.stRecordId === e.stRecordId)?.id;
e.enterBlacklist = +e.enterBlacklist;
e.outBlacklist = +e.outBlacklist;
e.outRuleOne = e.num + e.symbol;
e.outRuleTwo = e.num1 + e.symbol1;
});
param.map((e) => {
delete e.recordChildren;
});
await accessStrategyInlineBlacklistSave({ inlineBlacklistList: param });
addRecord(param);
getDetail();
ElMessage.success('提交成功!');
};
//
const addRecord = async (data: Record<string, any>) => {
const preIds = `1,${Cookies.get('sand-level')},42,67,147,153`; // 1id
const rule = <Record<string, any>[]>[];
data.map((e) => {
e.enterBlacklist && rule.push(handleId(363, '', '', preIds + ',' + e.stRecordId + ',363', ''));
rule.push(handleId(367, 166, e.enterRuleOne, preIds + ',' + e.stRecordId + ',367', 5), handleId(368, 167, e.enterRuleTwo, preIds + ',' + e.stRecordId + ',368', 5));
e.outBlacklist && rule.push(handleId(365, '', '', preIds + ',' + e.stRecordId + ',365', ''));
rule.push(handleId(367, 166, e.outRuleOne, preIds + ',' + e.stRecordId + ',367', 5), handleId(368, 167, e.outRuleTwo, preIds + ',' + e.stRecordId + ',368', 5));
});
await addOperation({
checkpointId: levelId,
parentId: preIds,
lcJudgmentRuleReq: rule,
projectId,
});
};
</script>
<style lang="scss" scoped>
@import url(../../../styles/form.scss);
.c-table {
:deep(.el-input__inner) {
@apply px-2;
}
}
</style>

@ -21,6 +21,7 @@
<Com1 v-if="id == 150" />
<Com2 v-else-if="id == 151" />
<Com3 v-else-if="id == 152" />
<Com4 v-else-if="id == 153" />
</div>
</div>
</el-tab-pane>
@ -40,6 +41,7 @@ import { useRouter, useRoute } from 'vue-router';
import Com1 from './150.vue';
import Com2 from './151.vue';
import Com3 from './152.vue';
import Com4 from './153.vue';
const router = useRouter();
const route = useRoute();

Loading…
Cancel
Save