parent
ae5899a977
commit
331cf3e493
18 changed files with 1393 additions and 1096 deletions
After Width: | Height: | Size: 1.5 KiB |
@ -1,364 +0,0 @@ |
||||
<template> |
||||
<!-- 政务 --> |
||||
<div class="c-auto"> |
||||
<el-table class="c-table" |
||||
:data="form" |
||||
max-height="calc(100vh - 230px)" |
||||
:cell-style="{background:'#fff'}" |
||||
:span-method="span" |
||||
border> |
||||
<el-table-column prop="name" |
||||
label="政务黑名单指标" |
||||
min-width="100" |
||||
align="center"> |
||||
</el-table-column> |
||||
<el-table-column label="进黑名单条件" |
||||
min-width="350" |
||||
align="center"> |
||||
<template #default="{ row }"> |
||||
<!-- 大病报销 || 贫困户 --> |
||||
<div v-if="row.stRecordId == 161 || row.stRecordId == 164" |
||||
class="flex items-center"> |
||||
<span v-if="row.recordChildren" |
||||
class="whitespace-nowrap">{{ row?.recordChildren[row.span ? 1 : 0]?.name }}</span> |
||||
<div class="w-[95px] "> |
||||
<el-select class="mx-2" |
||||
clearable |
||||
v-model="row.symbol"> |
||||
<el-option v-for="item in symbols" |
||||
:key="item" |
||||
:label="item.name" |
||||
:value="item.name" /> |
||||
</el-select> |
||||
</div> |
||||
<el-input class="w-[80px]" |
||||
placeholder="请输入" |
||||
v-model="row.num"></el-input> |
||||
<span class="ml-2 whitespace-nowrap">万元</span> |
||||
</div> |
||||
<!-- 大龄未婚 --> |
||||
<div v-else-if="row.stRecordId == 167" |
||||
class="flex items-center"> |
||||
<template v-if="row.span"> |
||||
<span class="whitespace-nowrap">且近一年</span> |
||||
<div class="w-[90px] "> |
||||
<el-select class="mx-2" |
||||
v-model="row.had"> |
||||
<el-option value="有" /> |
||||
<el-option value="无" /> |
||||
</el-select> |
||||
</div> |
||||
<span class="ml-2 whitespace-nowrap">缴纳过社保或公积金</span> |
||||
</template> |
||||
<template v-else> |
||||
<span class="whitespace-nowrap">未婚,且年龄</span> |
||||
<div class="w-[90px] "> |
||||
<el-select class="mx-2" |
||||
v-model="row.symbol"> |
||||
<el-option v-for="item in symbols" |
||||
:key="item" |
||||
:label="item.name" |
||||
:value="item.name" /> |
||||
</el-select> |
||||
</div> |
||||
<el-input class="w-[80px]" |
||||
placeholder="请输入" |
||||
v-model="row.num"></el-input> |
||||
<span class="ml-2 whitespace-nowrap">,</span> |
||||
<el-select class="w-[80px] ml-2" |
||||
v-model="row.had"> |
||||
<el-option value="有" /> |
||||
<el-option value="无" /> |
||||
</el-select> |
||||
<span class="ml-2 whitespace-nowrap">固定资产</span> |
||||
</template> |
||||
</div> |
||||
<span v-else>{{ '命中' + row.name }}</span> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column label="本人命中进黑名单" |
||||
min-width="100" |
||||
align="center"> |
||||
<template #default="{ row }"> |
||||
<el-checkbox v-model="row.personalHitBlacklist" |
||||
@change="e => checkRow(e, row)"></el-checkbox> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column label="配偶命中拒入" |
||||
min-width="100" |
||||
align="center"> |
||||
<template #default="{ row }"> |
||||
<el-checkbox v-model="row.mateHitRejected" |
||||
@change="e => checkRow(e, row)"></el-checkbox> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column label="父母/子女命中拒入" |
||||
min-width="100" |
||||
align="center"> |
||||
<template #default="{ row }"> |
||||
<el-checkbox v-model="row.parentsHitRejected" |
||||
@change="e => checkRow(e, row)"></el-checkbox> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column label="其他家庭成员命中拒入" |
||||
min-width="100" |
||||
align="center"> |
||||
<template #default="{ row }"> |
||||
<el-checkbox v-model="row.otherFamilyMembersHitRejected" |
||||
@change="e => checkRow(e, row)"></el-checkbox> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column label="企业大股东命中拒入" |
||||
min-width="100" |
||||
align="center"> |
||||
<template #default="{ row }"> |
||||
<el-checkbox v-model="row.corporateMajorityHitRejected" |
||||
@change="e => checkRow(e, row)"></el-checkbox> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column label="本人及亲属企业命中准入" |
||||
min-width="120" |
||||
align="center"> |
||||
<template #default="{ row }"> |
||||
<el-checkbox v-model="row.hitAccess" |
||||
@change="checkNone(row)"></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, computed, watch, onMounted } from 'vue'; |
||||
import { ElMessage } from 'element-plus'; |
||||
import { accessStrategyGovernmentBlacklistFind, accessStrategyGovernmentBlacklistSave } from '@/api/model'; |
||||
import { getProcessInformationBasedOnRoles, addOperation, getOperation } 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(); |
||||
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 symbols: Array<Record<string, any>> = [ |
||||
{ |
||||
name: '>=', |
||||
}, |
||||
{ |
||||
name: '<', |
||||
}, |
||||
{ |
||||
name: '>', |
||||
}, |
||||
{ |
||||
name: '==', |
||||
}, |
||||
{ |
||||
name: '<=', |
||||
}, |
||||
]; |
||||
// 配置项 |
||||
const getConfig = async () => { |
||||
const { process } = await getProcessInformationBasedOnRoles(150); |
||||
const result = []; |
||||
process.map((e) => { |
||||
const cur = info.value.find((n) => n.stRecordId === e.id); |
||||
let num = cur?.ruleOne.match(/\d+/g); |
||||
let symbol = cur?.ruleOne.match(/[<>=]+/g); |
||||
let had = cur?.ruleOne.match(/[有无]+/g); |
||||
let temp = { |
||||
...getIds(), |
||||
name: e.name, |
||||
recordChildren: e.recordChildren, |
||||
isRule: isRule(e.id) ? 1 : 0, |
||||
corporateMajorityHitRejected: !!cur?.corporateMajorityHitRejected, |
||||
hitAccess: !!cur?.hitAccess, |
||||
mateHitRejected: !!cur?.mateHitRejected, |
||||
otherFamilyMembersHitRejected: !!cur?.otherFamilyMembersHitRejected, |
||||
parentsHitRejected: !!cur?.parentsHitRejected, |
||||
personalHitBlacklist: !!cur?.personalHitBlacklist, |
||||
symbol: isRule(e.id) && symbol?.length ? symbol[0] : '', |
||||
had: e.id === 167 && had?.length ? had[0] : '', |
||||
num: isRule(e.id) && num?.length ? num[0] : '', |
||||
ruleOne: '', |
||||
ruleTwo: '', |
||||
subjectId: e.subjectId, |
||||
stRecordId: e.id, |
||||
}; |
||||
result.push(temp); |
||||
if (isRule(e.id)) { |
||||
temp = JSON.parse(JSON.stringify(temp)); |
||||
temp.span = 1; |
||||
|
||||
num = cur?.ruleTwo?.match(/\d+/g); |
||||
if (num?.length) temp.num = num[0]; |
||||
symbol = cur?.ruleTwo?.match(/[<>=]+/g); |
||||
if (symbol?.length) temp.symbol = symbol[0]; |
||||
if (e.id === 167) temp.had = cur?.ruleTwo; |
||||
result.push(temp); |
||||
} |
||||
}); |
||||
form.value = result; |
||||
}; |
||||
// 详情 |
||||
const getDetail = async () => { |
||||
try { |
||||
// const res = await getOperation({ |
||||
// ...getIds(), |
||||
// checkpoint: levelId, |
||||
// parentId: '1,2,42,67,147,150', |
||||
// }); |
||||
// cache.value = !!res.judgmentRuleReqs; // 有缓存则说明还没提交,因为提交后清空缓存,这种情况则回显数据 |
||||
|
||||
const { data } = await accessStrategyGovernmentBlacklistFind(); |
||||
info.value = data; |
||||
getConfig(); |
||||
} finally { |
||||
} |
||||
}; |
||||
|
||||
watch( |
||||
() => route.query, |
||||
() => { |
||||
route.query.id === '150' && 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 (columnIndex === 0 || columnIndex === 2 || columnIndex === 3 || columnIndex === 4 || columnIndex === 5 || columnIndex === 6 || columnIndex === 7) { |
||||
if (rowIndex === 4 || rowIndex === 6 || rowIndex === 8) { |
||||
return { |
||||
rowspan: 2, |
||||
colspan: 1, |
||||
}; |
||||
} else if (rowIndex === 5 || rowIndex === 7 || rowIndex === 9) { |
||||
return { |
||||
rowspan: 0, |
||||
colspan: 0, |
||||
}; |
||||
} |
||||
} |
||||
}; |
||||
const checkRow = (e: boolean, row: Record<string, any>) => { |
||||
if (e) row.hitAccess = false; |
||||
}; |
||||
const checkNone = (row: Record<string, any>) => { |
||||
if (row.hitAccess) { |
||||
row.corporateMajorityHitRejected = false; |
||||
row.mateHitRejected = false; |
||||
row.otherFamilyMembersHitRejected = false; |
||||
row.parentsHitRejected = false; |
||||
row.personalHitBlacklist = false; |
||||
} |
||||
}; |
||||
// 提交 |
||||
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.corporateMajorityHitRejected = +e.corporateMajorityHitRejected; |
||||
e.hitAccess = +e.hitAccess; |
||||
e.mateHitRejected = +e.mateHitRejected; |
||||
e.otherFamilyMembersHitRejected = +e.otherFamilyMembersHitRejected; |
||||
e.parentsHitRejected = +e.parentsHitRejected; |
||||
e.personalHitBlacklist = +e.personalHitBlacklist; |
||||
if (e.stRecordId == 161 || e.stRecordId == 164) { |
||||
if (e.span) { |
||||
// 这里是合并表格,详情那里多加了一行,这里数据要放到一行去 |
||||
param[i - 1].ruleTwo = e.symbol + e.num; |
||||
} else { |
||||
e.ruleOne = e.symbol + e.num; |
||||
} |
||||
} else if (e.stRecordId == 167) { |
||||
if (e.span) { |
||||
// 这里是合并表格,详情那里多加了一行,这里数据要放到一行去 |
||||
param[i - 1].ruleTwo = e.had; |
||||
} else { |
||||
e.ruleOne = e.symbol + e.num + ',' + e.had; |
||||
} |
||||
} |
||||
}); |
||||
param = param.filter((e) => !e.span); |
||||
const recordParam = JSON.parse(JSON.stringify(param)); |
||||
param.map((e) => { |
||||
delete e.recordChildren; |
||||
delete e.had; |
||||
delete e.name; |
||||
delete e.symbol; |
||||
delete e.num; |
||||
}); |
||||
await accessStrategyGovernmentBlacklistSave({ governmentBlacklistList: param }); |
||||
addRecord(recordParam); |
||||
getDetail(); |
||||
ElMessage.success('提交成功!'); |
||||
}; |
||||
// 新增判分记录 |
||||
const addRecord = async (data: Record<string, any>) => { |
||||
const preIds = `1,${Cookies.get('sand-level')},42,67,147,150`; // 1,关卡id,角色(这个页面是风控经理策略) |
||||
const rule = []; |
||||
|
||||
data.map((e, i) => { |
||||
const temp = []; |
||||
e.personalHitBlacklist && temp.push(300); |
||||
e.mateHitRejected && temp.push(301); |
||||
e.parentsHitRejected && temp.push(302); |
||||
e.otherFamilyMembersHitRejected && temp.push(303); |
||||
e.corporateMajorityHitRejected && temp.push(304); |
||||
e.hitAccess && temp.push(757); |
||||
if (isRule(e.stRecordId)) { |
||||
const len = e?.recordChildren?.length - 1; |
||||
e?.recordChildren.map((n, j) => { |
||||
if (j !== len) { |
||||
if (n.id === 169 && e.had) { |
||||
rule.push(handleId(n.id, n.subjectId, e.had === '有' ? 387 : 388, preIds + ',' + e.stRecordId + ',' + n.id, 1)); |
||||
} else if (n.id === 168) { |
||||
const val = e.symbol + e.num; |
||||
val && rule.push(handleId(n.id, n.subjectId, val, preIds + ',' + e.stRecordId + ',' + n.id, 5)); |
||||
} else if (n.id === 170 && e.had) { |
||||
rule.push(handleId(n.id, n.subjectId, e.had === '有' ? 389 : 390, preIds + ',' + e.stRecordId + ',' + n.id, 1)); |
||||
} else { |
||||
const val = j ? (n.id === 168 ? e.symbol + e.num : e.ruleTwo) : e.ruleOne; |
||||
val && rule.push(handleId(n.id, n.subjectId, val, preIds + ',' + e.stRecordId + ',' + n.id, 5)); |
||||
} |
||||
} else if (temp.length) { |
||||
rule.push(handleId(n.id, 71, temp.join(), preIds + ',' + e.stRecordId + ',' + n.id, 1)); |
||||
} |
||||
}); |
||||
} else { |
||||
temp.length && rule.push(handleId(e.stRecordId, 71, temp.join(), preIds + ',' + e.stRecordId, 1)); |
||||
} |
||||
}); |
||||
|
||||
await addOperation({ |
||||
...getIds(), |
||||
parentId: preIds, |
||||
lcJudgmentRuleReq: rule, |
||||
}); |
||||
}; |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
@import url(../../../styles/form.scss); |
||||
</style> |
@ -1,271 +0,0 @@ |
||||
<template> |
||||
<!-- 征信 --> |
||||
<el-table class="c-table" |
||||
:data="form" |
||||
:cell-style="{background:'#fff'}" |
||||
max-height="calc(100vh - 230px)" |
||||
border> |
||||
<el-table-column prop="name" |
||||
label="征信黑名单指标" |
||||
min-width="220" |
||||
align="center"> |
||||
</el-table-column> |
||||
<el-table-column label="进黑名单条件" |
||||
width="700" |
||||
align="center"> |
||||
<template #default="{ row }"> |
||||
<!-- 贷记卡账户状态 --> |
||||
<div v-if="row.stRecordId == 204" |
||||
class="flex items-center"> |
||||
<span v-if="row.recordChildren" |
||||
class="whitespace-nowrap">{{ row?.recordChildren[0]?.name }}</span> |
||||
<el-input class="w-[150px] mx-2" |
||||
placeholder="请输入" |
||||
v-model="row.ruleOne"></el-input> |
||||
<span class="whitespace-nowrap">的信用卡</span> |
||||
</div> |
||||
<!-- 贷记卡审批通过率 --> |
||||
<div v-else-if="isRule(row.stRecordId)" |
||||
class="flex items-center"> |
||||
<span v-if="row.recordChildren" |
||||
class="whitespace-nowrap">{{ row?.recordChildren[0]?.name }}</span> |
||||
<div class="w-[95px] "> |
||||
<el-select class="mx-2" |
||||
clearable |
||||
v-model="row.symbol"> |
||||
<el-option v-for="item in symbols" |
||||
:key="item" |
||||
:label="item.name" |
||||
:value="item.name" /> |
||||
</el-select> |
||||
</div> |
||||
<el-input class="w-[80px]" |
||||
placeholder="请输入" |
||||
v-model="row.num"></el-input> |
||||
<span v-if="row.recordChildren" |
||||
class="ml-2 whitespace-nowrap">,{{ row?.recordChildren[1]?.name }}</span> |
||||
<div class="w-[95px] "> |
||||
<el-select class="mx-2" |
||||
clearable |
||||
v-model="row.symbol1"> |
||||
<el-option v-for="item in symbols" |
||||
:key="item" |
||||
:label="item.name" |
||||
:value="item.name" /> |
||||
</el-select> |
||||
</div> |
||||
<el-input class="w-[80px]" |
||||
placeholder="请输入" |
||||
v-model="row.num1"></el-input> |
||||
<span class="ml-2 whitespace-nowrap">。</span> |
||||
</div> |
||||
<div v-else-if="row.stRecordId == 230 || row.stRecordId == 231" |
||||
class="flex"> |
||||
<el-select class="w-[85px] ml-2" |
||||
clearable |
||||
v-model="row.ruleOne"> |
||||
<el-option value="有" /> |
||||
<el-option value="无" /> |
||||
</el-select> |
||||
</div> |
||||
<div v-else |
||||
class="flex items-center"> |
||||
<span v-if="row.recordChildren" |
||||
class="whitespace-nowrap">{{ row?.recordChildren[0]?.name }}</span> |
||||
<div class="w-[95px] "> |
||||
<el-select class="mx-2" |
||||
clearable |
||||
v-model="row.symbol"> |
||||
<el-option v-for="item in symbols" |
||||
:key="item" |
||||
:label="item.name" |
||||
:value="item.name" /> |
||||
</el-select> |
||||
</div> |
||||
<el-input class="w-[80px]" |
||||
placeholder="请输入" |
||||
v-model="row.num"></el-input> |
||||
<span class="ml-2 whitespace-nowrap">{{ row.stRecordId === 203 || row.stRecordId === 205 ? '元' : row.stRecordId === 207 || row.stRecordId === 229 ? '万元' : ' ' }}。</span> |
||||
</div> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column label="本人命中是否进黑名单" |
||||
min-width="160" |
||||
align="center"> |
||||
<template #default="{ row }"> |
||||
<el-radio-group v-model="row.hitTheBlacklist"> |
||||
<el-radio v-for="(item, i) in whethers" |
||||
:key="i" |
||||
:label="item.id">{{ item.name }}</el-radio> |
||||
</el-radio-group> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column label="配偶命中是否拒入" |
||||
min-width="160" |
||||
align="center"> |
||||
<template #default="{ row }"> |
||||
<el-radio-group v-model="row.mateRejectedStandardIdentity"> |
||||
<el-radio v-for="(item, i) in whethers" |
||||
:key="i" |
||||
:label="item.id">{{ item.name }}</el-radio> |
||||
</el-radio-group> |
||||
</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 { accessStrategyCreditBlacklistFind, accessStrategyCreditBlacklistSave } from '@/api/model'; |
||||
import { getProcessInformationBasedOnRoles, addOperation } from '@/api/judgment'; |
||||
import { useRouter, useRoute } from 'vue-router'; |
||||
import { handleId, getIds } from '@/utils/common'; |
||||
import Cookies from 'js-cookie'; |
||||
|
||||
const router = useRouter(); |
||||
const route = useRoute(); |
||||
const form = ref<Record<string, any>[]>([]); |
||||
const info = ref<Record<string, any>[]>([]); |
||||
const whethers: Record<string, any>[] = [ |
||||
{ |
||||
id: 345, |
||||
name: '是', |
||||
}, |
||||
{ |
||||
id: 346, |
||||
name: '否', |
||||
}, |
||||
]; |
||||
const symbols: Array<Record<string, any>> = [ |
||||
{ |
||||
name: '>=', |
||||
}, |
||||
{ |
||||
name: '<', |
||||
}, |
||||
{ |
||||
name: '>', |
||||
}, |
||||
{ |
||||
name: '==', |
||||
}, |
||||
{ |
||||
name: '<=', |
||||
}, |
||||
]; |
||||
// 配置项 |
||||
const getConfig = async () => { |
||||
const { process } = await getProcessInformationBasedOnRoles(151); |
||||
const result = []; |
||||
process.map((e) => { |
||||
const cur = info.value.find((n) => n.stRecordId === e.id); |
||||
let num = cur?.ruleOne?.match(/\d+/g); |
||||
let num1 = cur?.ruleTwo?.match(/\d+/g); |
||||
let symbol = cur?.ruleOne?.match(/[<>=]+/g); |
||||
let symbol1 = cur?.ruleTwo?.match(/[<>=]+/g); |
||||
let temp = { |
||||
...getIds(), |
||||
name: e.name, |
||||
recordChildren: e.recordChildren, |
||||
hitTheBlacklist: cur?.hitTheBlacklist, |
||||
mateRejectedStandardIdentity: cur?.mateRejectedStandardIdentity, |
||||
symbol: symbol?.length ? symbol[0] : '', |
||||
symbol1: symbol1?.length ? symbol1[0] : '', |
||||
num: num?.length ? num[0] : '', |
||||
num1: num1?.length ? num1[0] : '', |
||||
ruleOne: e.id === 204 || e.id === 230 || e.id === 231 ? cur?.ruleOne : '', |
||||
ruleTwo: '', |
||||
subjectId: e.subjectId, |
||||
stRecordId: e.id, |
||||
}; |
||||
result.push(temp); |
||||
}); |
||||
form.value = result; |
||||
}; |
||||
// 详情 |
||||
const getDetail = async () => { |
||||
try { |
||||
const { data } = await accessStrategyCreditBlacklistFind(); |
||||
info.value = data; |
||||
getConfig(); |
||||
} finally { |
||||
} |
||||
}; |
||||
|
||||
watch( |
||||
() => route.query, |
||||
() => { |
||||
route.query.id === '151' && getDetail(); |
||||
}, |
||||
{ |
||||
immediate: true, |
||||
}, |
||||
); |
||||
|
||||
const isRule = (rule: number): boolean => { |
||||
return rule === 208 || (rule > 215 && rule < 222) || rule === 226; |
||||
}; |
||||
// 提交 |
||||
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; |
||||
if (e.stRecordId != 204 && e.stRecordId != 230 && e.stRecordId != 231) { |
||||
e.ruleOne = e.symbol + e.num; |
||||
if (isRule(e.stRecordId)) { |
||||
e.ruleTwo = e.symbol1 + e.num1; |
||||
} |
||||
} |
||||
}); |
||||
const recordParam = JSON.parse(JSON.stringify(param)); |
||||
param.map((e) => { |
||||
delete e.recordChildren; |
||||
}); |
||||
await accessStrategyCreditBlacklistSave({ creditBlacklistList: param }); |
||||
addRecord(recordParam); |
||||
getDetail(); |
||||
ElMessage.success('提交成功!'); |
||||
}; |
||||
// 新增判分记录 |
||||
const addRecord = async (data: Record<string, any>) => { |
||||
const preIds = `1,${Cookies.get('sand-level')},42,67,147,151`; // 1,关卡id,角色(这个页面是风控经理策略) |
||||
const rule = []; |
||||
|
||||
data[1].ruleOne && rule.push(handleId(234, 81, data[1].ruleOne, preIds + ',204,234', 3)); |
||||
data[27].ruleOne && rule.push(handleId(267, 114, data[27].ruleOne === '有' ? 306 : 305, preIds + ',230,267', 1)); |
||||
data[28].ruleOne && rule.push(handleId(268, 115, data[28].ruleOne === '有' ? 308 : 307, preIds + ',231,268', 1)); |
||||
data.map((e, i) => { |
||||
if (e.stRecordId != 204 && e.stRecordId != 230 && e.stRecordId != 231) { |
||||
const len = e?.recordChildren?.length - 1; |
||||
e?.recordChildren.map((n, j) => { |
||||
const val = j ? e.ruleTwo : e.ruleOne; |
||||
j !== len && val && rule.push(handleId(n.id, n.subjectId, val, preIds + ',' + e.stRecordId + ',' + n.id, 5)); |
||||
}); |
||||
} |
||||
// 多选框 |
||||
e.hitTheBlacklist && rule.push(handleId(1245, 140, e.hitTheBlacklist, preIds + ',' + e.stRecordId + ',1245', 1)); |
||||
e.mateRejectedStandardIdentity && rule.push(handleId(274, 140, e.mateRejectedStandardIdentity, preIds + ',' + e.stRecordId + ',274', 1)); |
||||
}); |
||||
|
||||
await addOperation({ |
||||
...getIds(), |
||||
parentId: preIds, |
||||
lcJudgmentRuleReq: rule, |
||||
}); |
||||
}; |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
@import url(../../../styles/form.scss); |
||||
.c-table { |
||||
:deep(.el-input__inner) { |
||||
@apply px-2; |
||||
} |
||||
} |
||||
</style> |
@ -0,0 +1,300 @@ |
||||
<template> |
||||
<el-form label-width="90px" |
||||
label-suffix=":" |
||||
class="form" |
||||
:disabled="disabled"> |
||||
<el-form-item label="策略名称" |
||||
prop="fundName"> |
||||
<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'}" |
||||
max-height="calc(100vh - 230px)" |
||||
border> |
||||
<el-table-column prop="name" |
||||
label="征信黑名单指标" |
||||
min-width="220" |
||||
align="center"> |
||||
</el-table-column> |
||||
<el-table-column label="进黑名单条件" |
||||
width="700" |
||||
align="center"> |
||||
<template #default="{ row }"> |
||||
<!-- 贷记卡账户状态 --> |
||||
<div v-if="row.stRecordId == 204" |
||||
class="flex items-center"> |
||||
<span v-if="row.recordChildren" |
||||
class="whitespace-nowrap">{{ row?.recordChildren[0]?.name }}</span> |
||||
<el-input class="w-[150px] mx-2" |
||||
placeholder="请输入" |
||||
v-model="row.ruleOne"></el-input> |
||||
<span class="whitespace-nowrap">的信用卡</span> |
||||
</div> |
||||
<!-- 贷记卡审批通过率 --> |
||||
<div v-else-if="isRule(row.stRecordId)" |
||||
class="flex items-center"> |
||||
<span v-if="row.recordChildren" |
||||
class="whitespace-nowrap">{{ row?.recordChildren[0]?.name }}</span> |
||||
<div class="w-[95px] "> |
||||
<el-select class="mx-2" |
||||
clearable |
||||
v-model="row.symbol"> |
||||
<el-option v-for="item in symbols" |
||||
:key="item" |
||||
:label="item.name" |
||||
:value="item.name" /> |
||||
</el-select> |
||||
</div> |
||||
<el-input class="w-[80px]" |
||||
placeholder="请输入" |
||||
v-model="row.num"></el-input> |
||||
<span v-if="row.recordChildren" |
||||
class="ml-2 whitespace-nowrap">,{{ row?.recordChildren[1]?.name }}</span> |
||||
<div class="w-[95px] "> |
||||
<el-select class="mx-2" |
||||
clearable |
||||
v-model="row.symbol1"> |
||||
<el-option v-for="item in symbols" |
||||
:key="item" |
||||
:label="item.name" |
||||
:value="item.name" /> |
||||
</el-select> |
||||
</div> |
||||
<el-input class="w-[80px]" |
||||
placeholder="请输入" |
||||
v-model="row.num1"></el-input> |
||||
<span class="ml-2 whitespace-nowrap">。</span> |
||||
</div> |
||||
<div v-else-if="row.stRecordId == 230 || row.stRecordId == 231" |
||||
class="flex"> |
||||
<el-select class="w-[85px] ml-2" |
||||
clearable |
||||
v-model="row.ruleOne"> |
||||
<el-option value="有" /> |
||||
<el-option value="无" /> |
||||
</el-select> |
||||
</div> |
||||
<div v-else |
||||
class="flex items-center"> |
||||
<span v-if="row.recordChildren" |
||||
class="whitespace-nowrap">{{ row?.recordChildren[0]?.name }}</span> |
||||
<div class="w-[95px] "> |
||||
<el-select class="mx-2" |
||||
clearable |
||||
v-model="row.symbol"> |
||||
<el-option v-for="item in symbols" |
||||
:key="item" |
||||
:label="item.name" |
||||
:value="item.name" /> |
||||
</el-select> |
||||
</div> |
||||
<el-input class="w-[80px]" |
||||
placeholder="请输入" |
||||
v-model="row.num"></el-input> |
||||
<span class="ml-2 whitespace-nowrap">{{ row.stRecordId === 203 || row.stRecordId === 205 ? '元' : row.stRecordId === 207 || row.stRecordId === 229 ? '万元' : ' ' }}。</span> |
||||
</div> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column label="本人命中是否进黑名单" |
||||
min-width="160" |
||||
align="center"> |
||||
<template #default="{ row }"> |
||||
<el-radio-group v-model="row.hitTheBlacklist"> |
||||
<el-radio v-for="(item, i) in whethers" |
||||
:key="i" |
||||
:label="item.id">{{ item.name }}</el-radio> |
||||
</el-radio-group> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column label="配偶命中是否拒入" |
||||
min-width="160" |
||||
align="center"> |
||||
<template #default="{ row }"> |
||||
<el-radio-group v-model="row.mateRejectedStandardIdentity"> |
||||
<el-radio v-for="(item, i) in whethers" |
||||
:key="i" |
||||
:label="item.id">{{ item.name }}</el-radio> |
||||
</el-radio-group> |
||||
</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="syncVisible = true">确定</div> |
||||
</div> |
||||
|
||||
<Confirm v-model="syncVisible" |
||||
@submit="submit" /> |
||||
</template> |
||||
|
||||
<script setup lang="ts"> |
||||
import { ref, toRefs, onMounted, defineAsyncComponent } from 'vue'; |
||||
import { ElMessage } from 'element-plus'; |
||||
import { accessStrategyCreditBlacklistFind, accessStrategyCreditBlacklistSave } 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 form = ref<Record<string, any>[]>([]); |
||||
const { creditId, strategyName } = toRefs(props.row); |
||||
const info = ref<Record<string, any>[]>([]); |
||||
const whethers: Record<string, any>[] = [ |
||||
{ |
||||
id: 345, |
||||
name: '是', |
||||
}, |
||||
{ |
||||
id: 346, |
||||
name: '否', |
||||
}, |
||||
]; |
||||
const symbols: Array<Record<string, any>> = [ |
||||
{ |
||||
name: '>=', |
||||
}, |
||||
{ |
||||
name: '<', |
||||
}, |
||||
{ |
||||
name: '>', |
||||
}, |
||||
{ |
||||
name: '==', |
||||
}, |
||||
{ |
||||
name: '<=', |
||||
}, |
||||
]; |
||||
const syncVisible = ref<boolean>(false); |
||||
// 配置项 |
||||
const getConfig = async () => { |
||||
const { process } = await getProcessInformationBasedOnRoles(151); |
||||
const result = []; |
||||
process.map((e) => { |
||||
const cur = info.value.find((n) => n.stRecordId === e.id); |
||||
let num = cur?.ruleOne?.match(/\d+/g); |
||||
let num1 = cur?.ruleTwo?.match(/\d+/g); |
||||
let symbol = cur?.ruleOne?.match(/[<>=]+/g); |
||||
let symbol1 = cur?.ruleTwo?.match(/[<>=]+/g); |
||||
let temp = { |
||||
...getIds(), |
||||
name: e.name, |
||||
recordChildren: e.recordChildren, |
||||
hitTheBlacklist: cur?.hitTheBlacklist, |
||||
mateRejectedStandardIdentity: cur?.mateRejectedStandardIdentity, |
||||
symbol: symbol?.length ? symbol[0] : '', |
||||
symbol1: symbol1?.length ? symbol1[0] : '', |
||||
num: num?.length ? num[0] : '', |
||||
num1: num1?.length ? num1[0] : '', |
||||
ruleOne: e.id === 204 || e.id === 230 || e.id === 231 ? cur?.ruleOne : '', |
||||
ruleTwo: '', |
||||
subjectId: e.subjectId, |
||||
stRecordId: e.id, |
||||
}; |
||||
result.push(temp); |
||||
}); |
||||
form.value = result; |
||||
}; |
||||
// 详情 |
||||
const getDetail = async () => { |
||||
try { |
||||
if (creditId.value) { |
||||
const { data } = await accessStrategyCreditBlacklistFind({ |
||||
creditId: creditId.value, |
||||
}); |
||||
info.value = data; |
||||
} |
||||
getConfig(); |
||||
} finally { |
||||
} |
||||
}; |
||||
|
||||
onMounted(getDetail); |
||||
|
||||
const isRule = (rule: number): boolean => { |
||||
return rule === 208 || (rule > 215 && rule < 222) || rule === 226; |
||||
}; |
||||
// 新增判分记录 |
||||
const addRecord = async (data: Record<string, any>) => { |
||||
const preIds = `1,${Cookies.get('sand-level')},42,67,147,151`; // 1,关卡id,角色(这个页面是风控经理策略) |
||||
const rule = []; |
||||
|
||||
data[1].ruleOne && rule.push(handleId(234, 81, data[1].ruleOne, preIds + ',204,234', 3)); |
||||
data[27].ruleOne && rule.push(handleId(267, 114, data[27].ruleOne === '有' ? 306 : 305, preIds + ',230,267', 1)); |
||||
data[28].ruleOne && rule.push(handleId(268, 115, data[28].ruleOne === '有' ? 308 : 307, preIds + ',231,268', 1)); |
||||
data.map((e, i) => { |
||||
if (e.stRecordId != 204 && e.stRecordId != 230 && e.stRecordId != 231) { |
||||
const len = e?.recordChildren?.length - 1; |
||||
e?.recordChildren.map((n, j) => { |
||||
const val = j ? e.ruleTwo : e.ruleOne; |
||||
j !== len && val && rule.push(handleId(n.id, n.subjectId, val, preIds + ',' + e.stRecordId + ',' + n.id, 5)); |
||||
}); |
||||
} |
||||
// 多选框 |
||||
e.hitTheBlacklist && rule.push(handleId(1245, 140, e.hitTheBlacklist, preIds + ',' + e.stRecordId + ',1245', 1)); |
||||
e.mateRejectedStandardIdentity && rule.push(handleId(274, 140, e.mateRejectedStandardIdentity, preIds + ',' + e.stRecordId + ',274', 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) => { |
||||
if (info.value.length) e.id = info.value.find((n) => n.stRecordId === e.stRecordId)?.id; |
||||
if (e.stRecordId != 204 && e.stRecordId != 230 && e.stRecordId != 231) { |
||||
e.ruleOne = e.symbol + e.num; |
||||
if (isRule(e.stRecordId)) { |
||||
e.ruleTwo = e.symbol1 + e.num1; |
||||
} |
||||
} |
||||
}); |
||||
const recordParam = JSON.parse(JSON.stringify(param)); |
||||
param.map((e) => { |
||||
delete e.recordChildren; |
||||
}); |
||||
await accessStrategyCreditBlacklistSave({ |
||||
...getIds(), |
||||
creditId: creditId.value, |
||||
strategyName: strategyName.value, |
||||
synchronizeUpdate, |
||||
creditBlacklistList: param, |
||||
}); |
||||
addRecord(recordParam); |
||||
}; |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
@import url(../../../../styles/form.scss); |
||||
.c-table { |
||||
:deep(.el-input__inner) { |
||||
@apply px-2; |
||||
} |
||||
} |
||||
</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.creditId])"> |
||||
<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.governmentId ? '编辑' : '新增') + '征信黑名单策略'" |
||||
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 { accessStrategyCreditBlacklist, accessStrategyCreditBlacklistDel } 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>>({ |
||||
creditId: '', |
||||
strategyName: '', |
||||
}); |
||||
const isDetail = ref<boolean>(false); |
||||
const i = ref<number>(0); |
||||
// 列表 |
||||
const getList = async () => { |
||||
loading.value = true; |
||||
try { |
||||
const { page } = await accessStrategyCreditBlacklist({ 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.creditId)); |
||||
}; |
||||
// 新增 |
||||
const toAdd = () => { |
||||
i.value++; |
||||
isDetail.value = false; |
||||
curRow.value = { |
||||
creditId: '', |
||||
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 accessStrategyCreditBlacklistDel({ 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.businessId])"> |
||||
<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.businessId ? '编辑' : '新增') + '商采黑名单策略'" |
||||
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 { accessStrategyBusinessBlacklist, accessStrategyBusinessBlacklistDel } 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>>({ |
||||
businessId: '', |
||||
strategyName: '', |
||||
}); |
||||
const isDetail = ref<boolean>(false); |
||||
const i = ref<number>(0); |
||||
// 列表 |
||||
const getList = async () => { |
||||
loading.value = true; |
||||
try { |
||||
const { page } = await accessStrategyBusinessBlacklist({ 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.businessId)); |
||||
}; |
||||
// 新增 |
||||
const toAdd = () => { |
||||
i.value++; |
||||
isDetail.value = false; |
||||
curRow.value = { |
||||
businessId: '', |
||||
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 accessStrategyBusinessBlacklistDel({ ids }); |
||||
getList(); |
||||
ElMessage.success('删除成功!'); |
||||
}; |
||||
</script> |
Loading…
Reference in new issue