|
|
@ -86,19 +86,19 @@ |
|
|
|
<script setup lang="ts"> |
|
|
|
<script setup lang="ts"> |
|
|
|
import { ref, computed, watch, onMounted } from 'vue'; |
|
|
|
import { ref, computed, watch, onMounted } from 'vue'; |
|
|
|
import { ElMessage } from 'element-plus'; |
|
|
|
import { ElMessage } from 'element-plus'; |
|
|
|
import { accessStrategyGovernmentBlacklistFind, accessStrategyGovernmentBlacklistSave } from '@/api/model'; |
|
|
|
import { accessStrategyGovernmentBlacklistFind, accessStrategyCreditBlacklistSave } from '@/api/model'; |
|
|
|
import { getProcessInformationBasedOnRoles, addOperation } from '@/api/judgment'; |
|
|
|
import { getProcessInformationBasedOnRoles, addOperation } from '@/api/judgment'; |
|
|
|
import type { TableColumnCtx } from 'element-plus'; |
|
|
|
import type { TableColumnCtx } from 'element-plus'; |
|
|
|
import { useRouter, useRoute } from 'vue-router'; |
|
|
|
import { useRouter, useRoute } from 'vue-router'; |
|
|
|
import { handleId } from '@/utils/common'; |
|
|
|
import { handleId } from '@/utils/common'; |
|
|
|
import Cookies from 'js-cookie'; |
|
|
|
import Cookies from 'js-cookie'; |
|
|
|
|
|
|
|
|
|
|
|
const emit = defineEmits(['getList']); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const router = useRouter(); |
|
|
|
const router = useRouter(); |
|
|
|
const route = useRoute(); |
|
|
|
const route = useRoute(); |
|
|
|
const id = computed(() => +route.query.id); |
|
|
|
const projectId = +Cookies.get('sand-projectId'); |
|
|
|
|
|
|
|
const levelId = +Cookies.get('sand-level'); |
|
|
|
const form = ref<Record<string, any>[]>([]); |
|
|
|
const form = ref<Record<string, any>[]>([]); |
|
|
|
|
|
|
|
const info = ref<Record<string, any>[]>([]); |
|
|
|
const height = window.innerHeight - 270; |
|
|
|
const height = window.innerHeight - 270; |
|
|
|
const symbols = <Record<string, any>[]>[ |
|
|
|
const symbols = <Record<string, any>[]>[ |
|
|
|
{ |
|
|
|
{ |
|
|
@ -119,31 +119,38 @@ const symbols = <Record<string, any>[]>[ |
|
|
|
]; |
|
|
|
]; |
|
|
|
// 配置项 |
|
|
|
// 配置项 |
|
|
|
const getConfig = async () => { |
|
|
|
const getConfig = async () => { |
|
|
|
const { process } = await getProcessInformationBasedOnRoles(150); |
|
|
|
const { process } = await getProcessInformationBasedOnRoles(151); |
|
|
|
const result = []; |
|
|
|
const result = []; |
|
|
|
process.map((e) => { |
|
|
|
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 = { |
|
|
|
let temp = { |
|
|
|
checkpointId: 1, |
|
|
|
checkpointId: Cookies.get('sand-level'), |
|
|
|
projectId: 1, |
|
|
|
projectId: Cookies.get('sand-projectId'), |
|
|
|
name: e.name, |
|
|
|
name: e.name, |
|
|
|
recordChildren: e.recordChildren, |
|
|
|
recordChildren: e.recordChildren, |
|
|
|
isRule: isRule(e.id) ? 1 : 0, |
|
|
|
isRule: isRule(e.id) ? 1 : 0, |
|
|
|
corporateMajorityHitRejected: false, |
|
|
|
mateRejectedStandardIdentity: !!cur?.mateRejectedStandardIdentity, |
|
|
|
mateHitRejected: false, |
|
|
|
symbol: isRule(e.id) ? symbol[0] : '>=', |
|
|
|
otherFamilyMembersHitRejected: false, |
|
|
|
had: e.id === 167 && had.length ? had[0] : '', |
|
|
|
parentsHitRejected: false, |
|
|
|
num: isRule(e.id) && num?.length ? num[0] : '', |
|
|
|
personalHitBlacklist: false, |
|
|
|
|
|
|
|
symbol: '>=', |
|
|
|
|
|
|
|
had: '', |
|
|
|
|
|
|
|
num: '', |
|
|
|
|
|
|
|
ruleOne: '', |
|
|
|
ruleOne: '', |
|
|
|
ruleTwo: '', |
|
|
|
ruleTwo: '', |
|
|
|
|
|
|
|
subjectId: e.subjectId, |
|
|
|
stRecordId: e.id, |
|
|
|
stRecordId: e.id, |
|
|
|
}; |
|
|
|
}; |
|
|
|
result.push(temp); |
|
|
|
result.push(temp); |
|
|
|
if (isRule(e.id)) { |
|
|
|
if (isRule(e.id)) { |
|
|
|
temp = JSON.parse(JSON.stringify(temp)); |
|
|
|
temp = JSON.parse(JSON.stringify(temp)); |
|
|
|
temp.span = 1; |
|
|
|
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); |
|
|
|
result.push(temp); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
@ -153,18 +160,18 @@ const getConfig = async () => { |
|
|
|
const getDetail = async () => { |
|
|
|
const getDetail = async () => { |
|
|
|
if (id.value) { |
|
|
|
if (id.value) { |
|
|
|
try { |
|
|
|
try { |
|
|
|
const { data } = await accessStrategyGovernmentBlacklistFind(1, 1); |
|
|
|
const { data } = await accessStrategyGovernmentBlacklistFind(levelId, projectId); |
|
|
|
// info.value = data; |
|
|
|
info.value = data; |
|
|
|
getConfig(); |
|
|
|
getConfig(); |
|
|
|
} finally { |
|
|
|
} finally { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
watch( |
|
|
|
watch( |
|
|
|
() => route.query, |
|
|
|
() => route.query, |
|
|
|
() => { |
|
|
|
() => { |
|
|
|
// getDetail(); |
|
|
|
getDetail(); |
|
|
|
getConfig(); |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
immediate: true, |
|
|
|
immediate: true, |
|
|
@ -181,16 +188,12 @@ interface SpanMethodProps { |
|
|
|
rowIndex: number; |
|
|
|
rowIndex: number; |
|
|
|
columnIndex: number; |
|
|
|
columnIndex: number; |
|
|
|
} |
|
|
|
} |
|
|
|
onMounted(() => {}); |
|
|
|
|
|
|
|
// 提交 |
|
|
|
// 提交 |
|
|
|
const submit = async () => { |
|
|
|
const submit = async () => { |
|
|
|
let param = JSON.parse(JSON.stringify(form.value)); |
|
|
|
let param = JSON.parse(JSON.stringify(form.value)); |
|
|
|
param.map((e, i) => { |
|
|
|
param.map((e, i) => { |
|
|
|
e.corporateMajorityHitRejected = +e.corporateMajorityHitRejected; |
|
|
|
if (info.value.length) e.id = info.value.find((n) => n.stRecordId === e.stRecordId)?.id; |
|
|
|
e.mateHitRejected = +e.mateHitRejected; |
|
|
|
e.mateRejectedStandardIdentity = +e.mateRejectedStandardIdentity; |
|
|
|
e.otherFamilyMembersHitRejected = +e.otherFamilyMembersHitRejected; |
|
|
|
|
|
|
|
e.parentsHitRejected = +e.parentsHitRejected; |
|
|
|
|
|
|
|
e.personalHitBlacklist = +e.personalHitBlacklist; |
|
|
|
|
|
|
|
if (e.stRecordId == 161 || e.stRecordId == 164) { |
|
|
|
if (e.stRecordId == 161 || e.stRecordId == 164) { |
|
|
|
if (e.span) { |
|
|
|
if (e.span) { |
|
|
|
// 这里是合并表格,详情那里多加了一行,这里数据要放到一行去 |
|
|
|
// 这里是合并表格,详情那里多加了一行,这里数据要放到一行去 |
|
|
@ -211,38 +214,37 @@ const submit = async () => { |
|
|
|
const recordParam = JSON.parse(JSON.stringify(param)); |
|
|
|
const recordParam = JSON.parse(JSON.stringify(param)); |
|
|
|
param.map((e) => { |
|
|
|
param.map((e) => { |
|
|
|
delete e.recordChildren; |
|
|
|
delete e.recordChildren; |
|
|
|
|
|
|
|
delete e.had; |
|
|
|
|
|
|
|
delete e.name; |
|
|
|
|
|
|
|
delete e.symbol; |
|
|
|
|
|
|
|
delete e.num; |
|
|
|
}); |
|
|
|
}); |
|
|
|
const { message } = await accessStrategyGovernmentBlacklistSave(recordParam); |
|
|
|
await accessStrategyCreditBlacklistSave({ creditBlacklistList: param }); |
|
|
|
// addRecord(param, message); |
|
|
|
addRecord(recordParam); |
|
|
|
|
|
|
|
getDetail(); |
|
|
|
ElMessage.success('提交成功!'); |
|
|
|
ElMessage.success('提交成功!'); |
|
|
|
emit('getList', 1); |
|
|
|
|
|
|
|
}; |
|
|
|
}; |
|
|
|
// 新增判分记录 |
|
|
|
// 新增判分记录 |
|
|
|
const addRecord = async (data: Record<string, any>, newId: number) => { |
|
|
|
const addRecord = async (data: Record<string, any>) => { |
|
|
|
const preIds = `1,${Cookies.get('sand-level')},42,${newId}`; // 1,关卡id,角色(这个页面是风控经理策略) |
|
|
|
const preIds = `1,${Cookies.get('sand-level')},42,67,147,151`; // 1,关卡id,角色(这个页面是风控经理策略) |
|
|
|
const rule = <Record<string, any>[]>[]; |
|
|
|
const rule = <Record<string, any>[]>[]; |
|
|
|
|
|
|
|
|
|
|
|
data.map((e, i) => { |
|
|
|
data.map((e, i) => { |
|
|
|
if (e.stRecordId == 161 || e.stRecordId == 164) { |
|
|
|
if (isRule(e.stRecordId)) { |
|
|
|
e.recordChildren.map((n, j) => { |
|
|
|
e?.recordChildren.map((n, j) => { |
|
|
|
rule.push(handleId(n.id, e.subjectId, j ? e.ruleTwo : e.ruleOne, preIds + ',' + e.id + ',' + n.id, 5)); |
|
|
|
rule.push(handleId(n.id, e.subjectId, j ? e.ruleTwo : e.ruleOne, preIds + ',' + e.stRecordId + ',' + n.id, 5)); |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const temp = []; |
|
|
|
const temp = []; |
|
|
|
e.personalHitBlacklist && temp.push(300); |
|
|
|
e.personalHitBlacklist && temp.push(300); |
|
|
|
e.mateHitRejected && temp.push(301); |
|
|
|
rule.push(handleId(e.stRecordId, e.subjectId, temp.join(), preIds + ',' + e.stRecordId, 1)); |
|
|
|
e.parentsHitRejected && temp.push(302); |
|
|
|
|
|
|
|
e.otherFamilyMembersHitRejected && temp.push(303); |
|
|
|
|
|
|
|
e.corporateMajorityHitRejected && temp.push(304); |
|
|
|
|
|
|
|
rule.push(handleId(e.id, e.subjectId, temp.join(), preIds + ',' + e.id, 1)); |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
await addOperation({ |
|
|
|
await addOperation({ |
|
|
|
parentId: preIds, |
|
|
|
parentId: preIds, |
|
|
|
lcJudgmentRuleReq: rule, |
|
|
|
lcJudgmentRuleReq: rule, |
|
|
|
projectId: 1, |
|
|
|
projectId, |
|
|
|
}); |
|
|
|
}); |
|
|
|
}; |
|
|
|
}; |
|
|
|
</script> |
|
|
|
</script> |
|
|
|