parent
331cf3e493
commit
4d2374a38d
15 changed files with 1157 additions and 479 deletions
@ -0,0 +1,297 @@ |
||||
<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" |
||||
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="100" |
||||
align="center"> |
||||
<template #default="{ row, $index }"> |
||||
<span v-if="$index == 4">不存在未结清情况</span> |
||||
<el-radio-group v-else |
||||
v-model="row.enterBlacklist"> |
||||
<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="进黑名单条件" |
||||
width="330" |
||||
align="center"> |
||||
<template #default="{ row }"> |
||||
<div class="flex items-center"> |
||||
<span v-if="row.recordChildren" |
||||
class="whitespace-nowrap">{{ row?.recordChildren[1]?.recordChildren[0]?.name }}:认定{{row.name}}</span> |
||||
<div class="min-w-[95px] "> |
||||
<el-select class="mx-2" |
||||
clearable |
||||
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 v-if="row.recordChildren" |
||||
class="whitespace-nowrap">{{ row?.recordChildren[1]?.recordChildren[1]?.name }}:认定{{row.name}}</span> |
||||
<div class="min-w-[95px] "> |
||||
<el-select class="mx-2" |
||||
clearable |
||||
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="120" |
||||
align="center"> |
||||
<template #default="{ row }"> |
||||
<el-radio-group v-model="row.outBlacklist"> |
||||
<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="出黑名单条件" |
||||
width="380" |
||||
align="center"> |
||||
<template #default="{ row }"> |
||||
<div class="flex items-center"> |
||||
<span v-if="row.recordChildren" |
||||
class="whitespace-nowrap">{{ row?.recordChildren[1]?.recordChildren[0]?.name }}:结清后,</span> |
||||
<div class="min-w-[95px] "> |
||||
<el-select class="mx-2" |
||||
clearable |
||||
v-model="row.num"> |
||||
<el-option v-for="item in nums" |
||||
:key="item" |
||||
:label="item" |
||||
:value="item" /> |
||||
</el-select> |
||||
</div> |
||||
<div class="min-w-[95px] "> |
||||
<el-select class="mr-2" |
||||
clearable |
||||
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 v-if="row.recordChildren" |
||||
class="whitespace-nowrap">{{ row?.recordChildren[1]?.recordChildren[1]?.name }}:结清后,</span> |
||||
<div class="min-w-[95px] "> |
||||
<el-select class="mx-2" |
||||
clearable |
||||
v-model="row.num1"> |
||||
<el-option v-for="item in nums" |
||||
:key="item" |
||||
:label="item" |
||||
:value="item" /> |
||||
</el-select> |
||||
</div> |
||||
<div class="min-w-[95px] "> |
||||
<el-select class="mr-2" |
||||
clearable |
||||
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> |
||||
</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, watch } 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 { useRoute } from 'vue-router'; |
||||
import { handleId, getNum, getChinese, getIds } from '@/utils/common'; |
||||
import Cookies from 'js-cookie'; |
||||
|
||||
const route = useRoute(); |
||||
const form = ref<Record<string, any>[]>([]); |
||||
const info = ref<Record<string, any>[]>([]); |
||||
const nums: Array<number> = [1, 3, 5, 10, 20, 30, 40]; |
||||
const units: Array<string> = ['年', '个月', '天']; |
||||
const whethers: Record<string, any>[] = [ |
||||
{ |
||||
id: 345, |
||||
name: '是', |
||||
}, |
||||
{ |
||||
id: 346, |
||||
name: '否', |
||||
}, |
||||
]; |
||||
// 配置项 |
||||
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 = { |
||||
...getIds(), |
||||
name: e.name, |
||||
recordChildren: e.recordChildren, |
||||
enterBlacklist: cur?.enterBlacklist, |
||||
outBlacklist: cur?.outBlacklist, |
||||
enterRuleOne: cur?.enterRuleOne || '', |
||||
enterRuleTwo: cur?.enterRuleTwo || '', |
||||
num: getNum(cur?.outRuleOne) || '', |
||||
num1: getNum(cur?.outRuleTwo) || '', |
||||
symbol: getChinese(cur?.outRuleOne) || '', |
||||
symbol1: getChinese(cur?.outRuleTwo) || '', |
||||
stRecordId: e.id, |
||||
}; |
||||
result.push(temp); |
||||
}); |
||||
result.push({ |
||||
name: '正常', |
||||
remark: '不存在未结清情况', |
||||
}); |
||||
form.value = result; |
||||
}; |
||||
// 详情 |
||||
const getDetail = async () => { |
||||
try { |
||||
const { data } = await accessStrategyInlineBlacklistFind(); |
||||
info.value = data; |
||||
getConfig(); |
||||
} finally { |
||||
} |
||||
}; |
||||
|
||||
watch( |
||||
() => route.query, |
||||
() => { |
||||
route.query.id === '153' && getDetail(); |
||||
}, |
||||
{ |
||||
immediate: true, |
||||
}, |
||||
); |
||||
|
||||
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.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`; // 1,关卡id,角色(这个页面是风控经理策略) |
||||
const rule: Array<Record<string, any>> = []; |
||||
|
||||
data.map((e) => { |
||||
e.enterBlacklist && rule.push(handleId(363, 140, e.enterBlacklist, preIds + ',' + e.stRecordId + ',363', 1)); |
||||
e.enterRuleOne && rule.push(handleId(367, 166, e.enterRuleOne, preIds + ',' + e.stRecordId + ',364,367', 5)); |
||||
e.enterRuleTwo && rule.push(handleId(368, 167, e.enterRuleTwo, preIds + ',' + e.stRecordId + ',364,368', 5)); |
||||
e.outBlacklist && rule.push(handleId(365, 140, e.outBlacklist, preIds + ',' + e.stRecordId + ',365', 1)); |
||||
e.outRuleOne && rule.push(handleId(367, 166, e.outRuleOne, preIds + ',' + e.stRecordId + ',366,367', 5)); |
||||
e.outRuleTwo && rule.push(handleId(368, 167, e.outRuleTwo, preIds + ',' + e.stRecordId + ',366,368', 5)); |
||||
}); |
||||
|
||||
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,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> |
@ -1,408 +0,0 @@ |
||||
<template> |
||||
<!-- 企业 --> |
||||
<el-table class="c-table" |
||||
:data="form" |
||||
max-height="calc(100vh - 230px)" |
||||
:cell-style="{background:'#fff'}" |
||||
border> |
||||
<el-table-column prop="name" |
||||
label="企业黑名单指标" |
||||
min-width="180" |
||||
align="center"> |
||||
</el-table-column> |
||||
<el-table-column label="进黑名单条件" |
||||
min-width="250"> |
||||
<template #default="{ row,$index }"> |
||||
<div class="flex items-center"> |
||||
<template v-if="!$index"> |
||||
<span class="whitespace-nowrap">跨行业经营,行业门类数</span> |
||||
<div class="w-[95px] mx-2"> |
||||
<el-select v-model="row.symbol" |
||||
clearable> |
||||
<el-option v-for="item in symbols" |
||||
:key="item" |
||||
:label="item" |
||||
:value="item" /> |
||||
</el-select> |
||||
</div> |
||||
<div class="w-[95px]"> |
||||
<el-select v-model="row.num" |
||||
clearable> |
||||
<el-option v-for="item in nums" |
||||
:key="item" |
||||
:label="item" |
||||
:value="item" /> |
||||
</el-select> |
||||
</div> |
||||
<span class="whitespace-nowrap ml-2">。</span> |
||||
</template> |
||||
<template v-else-if="$index === 1"> |
||||
<span class="whitespace-nowrap">名下企业</span> |
||||
<div class="w-[95px] mx-2"> |
||||
<el-select v-model="row.had" |
||||
clearable> |
||||
<el-option v-for="item in have" |
||||
:key="item" |
||||
:label="item" |
||||
:value="item" /> |
||||
</el-select> |
||||
</div> |
||||
<span class="whitespace-nowrap ml-2">房产查封。</span> |
||||
</template> |
||||
<template v-else-if="$index === 2"> |
||||
<span class="whitespace-nowrap">名下企业</span> |
||||
<div class="w-[95px] mx-2"> |
||||
<el-select v-model="row.had" |
||||
clearable> |
||||
<el-option v-for="item in have" |
||||
:key="item" |
||||
:label="item" |
||||
:value="item" /> |
||||
</el-select> |
||||
</div> |
||||
<span class="whitespace-nowrap ml-2">股权冻结。</span> |
||||
</template> |
||||
<template v-else-if="$index === 3"> |
||||
<span class="whitespace-nowrap">行内企业</span> |
||||
<div class="w-[95px] mx-2"> |
||||
<el-select v-model="row.had" |
||||
clearable> |
||||
<el-option v-for="item in have" |
||||
:key="item" |
||||
:label="item" |
||||
:value="item" /> |
||||
</el-select> |
||||
</div> |
||||
<span class="whitespace-nowrap ml-2">不良贷款客户。</span> |
||||
</template> |
||||
<template v-else-if="$index === 4"> |
||||
<el-checkbox-group v-if="row.subject" |
||||
v-model="row.check"> |
||||
<el-checkbox v-for="item in row?.subject?.itemList" |
||||
:key="item" |
||||
:label="item.options" /> |
||||
</el-checkbox-group> |
||||
</template> |
||||
<template v-else-if="$index === 5"> |
||||
<div class="w-[95px]"> |
||||
<el-select v-model="row.had" |
||||
clearable> |
||||
<el-option value="不是" /> |
||||
<el-option value="是" /> |
||||
</el-select> |
||||
</div> |
||||
<span class="whitespace-nowrap ml-2">被列为非正常户或注销户。</span> |
||||
</template> |
||||
<template v-else-if="$index === 6"> |
||||
<div class="w-[95px]"> |
||||
<el-select v-model="row.had" |
||||
clearable> |
||||
<el-option value="不是" /> |
||||
<el-option value="是" /> |
||||
</el-select> |
||||
</div> |
||||
<span class="whitespace-nowrap ml-2">非正常户或注销户。</span> |
||||
</template> |
||||
<template v-else-if="$index === 7"> |
||||
<span class="whitespace-nowrap">经营年限</span> |
||||
<div class="w-[95px] ml-2"> |
||||
<el-select v-model="row.symbol" |
||||
clearable> |
||||
<el-option v-for="item in symbols" |
||||
:key="item" |
||||
:label="item" |
||||
:value="item" /> |
||||
</el-select> |
||||
</div> |
||||
<div class="w-[95px] mx-2"> |
||||
<el-select v-model="row.num" |
||||
clearable> |
||||
<el-option v-for="item in nums" |
||||
:key="item" |
||||
:label="item" |
||||
:value="item" /> |
||||
</el-select> |
||||
</div> |
||||
<div class="w-[95px]"> |
||||
<el-select v-model="row.unit" |
||||
clearable> |
||||
<el-option v-for="item in units" |
||||
:key="item" |
||||
:label="item" |
||||
:value="item" /> |
||||
</el-select> |
||||
</div> |
||||
<span class="whitespace-nowrap ml-2">。</span> |
||||
</template> |
||||
<template v-else-if="$index === 8"> |
||||
<span class="whitespace-nowrap mr-2">企业性质涉及</span> |
||||
<el-checkbox-group v-if="row.subject" |
||||
v-model="row.check"> |
||||
<el-checkbox v-for="item in row?.subject?.itemList" |
||||
:key="item" |
||||
:label="item.options" /> |
||||
</el-checkbox-group> |
||||
</template> |
||||
<template v-else-if="$index === 9"> |
||||
<div class="w-[95px]"> |
||||
<el-select v-model="row.symbol" |
||||
clearable> |
||||
<el-option v-for="item in symbols" |
||||
:key="item" |
||||
:label="item" |
||||
:value="item" /> |
||||
</el-select> |
||||
</div> |
||||
<div class="w-[95px] mx-2"> |
||||
<el-select v-model="row.num" |
||||
clearable> |
||||
<el-option v-for="item in nums" |
||||
:key="item" |
||||
:label="item" |
||||
:value="item" /> |
||||
</el-select> |
||||
</div> |
||||
<div class="w-[95px]"> |
||||
<el-select v-model="row.unit" |
||||
clearable> |
||||
<el-option v-for="item in units" |
||||
:key="item" |
||||
:label="item" |
||||
:value="item" /> |
||||
</el-select> |
||||
</div> |
||||
<span class="whitespace-nowrap ml-2">注册资本减少。</span> |
||||
</template> |
||||
<template v-else-if="$index === 10"> |
||||
<div class="w-[95px]"> |
||||
<el-select v-model="row.symbol" |
||||
clearable> |
||||
<el-option v-for="item in symbols" |
||||
:key="item" |
||||
:label="item" |
||||
:value="item" /> |
||||
</el-select> |
||||
</div> |
||||
<div class="w-[95px] mx-2"> |
||||
<el-select v-model="row.num" |
||||
clearable> |
||||
<el-option v-for="item in nums" |
||||
:key="item" |
||||
:label="item" |
||||
:value="item" /> |
||||
</el-select> |
||||
</div> |
||||
<div class="w-[95px]"> |
||||
<el-select v-model="row.unit" |
||||
clearable> |
||||
<el-option v-for="item in units" |
||||
:key="item" |
||||
:label="item" |
||||
:value="item" /> |
||||
</el-select> |
||||
</div> |
||||
<span class="whitespace-nowrap ml-2">内法定代表人变更。</span> |
||||
</template> |
||||
<template v-else-if="$index === 11"> |
||||
<div class="w-[95px]"> |
||||
<el-select v-model="row.symbol" |
||||
clearable> |
||||
<el-option v-for="item in symbols" |
||||
:key="item" |
||||
:label="item" |
||||
:value="item" /> |
||||
</el-select> |
||||
</div> |
||||
<div class="w-[95px] mx-2"> |
||||
<el-select v-model="row.num" |
||||
clearable> |
||||
<el-option v-for="item in nums" |
||||
:key="item" |
||||
:label="item" |
||||
:value="item" /> |
||||
</el-select> |
||||
</div> |
||||
<div class="w-[95px]"> |
||||
<el-select v-model="row.unit" |
||||
clearable> |
||||
<el-option v-for="item in units" |
||||
:key="item" |
||||
:label="item" |
||||
:value="item" /> |
||||
</el-select> |
||||
</div> |
||||
<span class="whitespace-nowrap ml-2">内大股东(股权占比>=50%)变更。</span> |
||||
</template> |
||||
<template v-else-if="$index === 12"> |
||||
命中禁入行业名单中企业拒绝规则 |
||||
</template> |
||||
<template v-else-if="$index === 13"> |
||||
<span class="whitespace-nowrap">申请人在该企业的股权占比</span> |
||||
<div class="w-[95px] mx-2"> |
||||
<el-select v-model="row.symbol" |
||||
clearable> |
||||
<el-option v-for="item in symbols" |
||||
:key="item" |
||||
:label="item" |
||||
:value="item" /> |
||||
</el-select> |
||||
</div> |
||||
<div class="w-[95px] "> |
||||
<el-select v-model="row.num" |
||||
clearable> |
||||
<el-option v-for="item in nums" |
||||
:key="item" |
||||
:label="item" |
||||
:value="item" /> |
||||
</el-select> |
||||
</div> |
||||
<span class="whitespace-nowrap ml-2">%。</span> |
||||
</template> |
||||
<template v-else-if="$index === 14"> |
||||
<div class="w-[95px] mx-2"> |
||||
<el-select v-model="row.had" |
||||
clearable> |
||||
<el-option value="不在" /> |
||||
<el-option value="在" /> |
||||
</el-select> |
||||
</div> |
||||
<span class="whitespace-nowrap ml-2">工商局或农专经营异常目录。</span> |
||||
</template> |
||||
</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, watch } from 'vue'; |
||||
import { ElMessage } from 'element-plus'; |
||||
import { accessStrategyEnterpriseBlacklistFind, accessStrategyEnterpriseBlacklistSave } from '@/api/model'; |
||||
import { getProcessInformationBasedOnRoles, addOperation } from '@/api/judgment'; |
||||
import { useRouter, useRoute } from 'vue-router'; |
||||
import { handleId, getNum, getSymbol, getChinese, 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 symbols: Array<string> = ['>=', '<', '>', '==', '<=']; |
||||
const nums: Array<number> = [1, 3, 5, 6, 16, 33, 40]; |
||||
const units: Array<string> = ['年', '月', '天']; |
||||
const have: Array<string> = ['无', '有']; |
||||
// 配置项 |
||||
const getConfig = async () => { |
||||
const { process } = await getProcessInformationBasedOnRoles(154); |
||||
const result = []; |
||||
process.map((e, i) => { |
||||
const cur = info.value.find((n) => n.stRecordId === e.id); |
||||
let num = getNum(cur?.rule); |
||||
let symbol = getSymbol(cur?.rule); |
||||
let had = getChinese(cur?.rule); |
||||
let temp = { |
||||
name: e.name, |
||||
subject: e.subject, |
||||
stRecordId: e.id, |
||||
symbol: symbol || '', |
||||
unit: had || '', |
||||
num: num || '', |
||||
had: (((i > 0 && i < 4) || i === 5 || i === 6 || i === 14) && cur?.rule) || '', |
||||
check: (i === 4 || i === 8) && cur ? cur?.rule.split(',') : [], |
||||
}; |
||||
|
||||
result.push(temp); |
||||
}); |
||||
form.value = result; |
||||
}; |
||||
// 详情 |
||||
const getDetail = async () => { |
||||
try { |
||||
const { data } = await accessStrategyEnterpriseBlacklistFind(); |
||||
info.value = data; |
||||
getConfig(); |
||||
} finally { |
||||
} |
||||
}; |
||||
|
||||
watch( |
||||
() => route.query, |
||||
() => { |
||||
route.query.id === '154' && getDetail(); |
||||
}, |
||||
{ |
||||
immediate: true, |
||||
}, |
||||
); |
||||
|
||||
// 提交 |
||||
const submit = async () => { |
||||
let param = []; |
||||
form.value.map((e, i) => { |
||||
const temp = { |
||||
id: info.value.find((n) => n.stRecordId === e.stRecordId)?.id ?? '', |
||||
stRecordId: e.stRecordId, |
||||
...getIds(), |
||||
}; |
||||
let rule; |
||||
if (!i || i === 13) { |
||||
rule = e.symbol + e.num; |
||||
} else if ((i > 0 && i < 4) || i === 5 || i === 6 || i === 14) { |
||||
rule = e.had; |
||||
} else if (i === 4 || i === 8) { |
||||
rule = e.check.join(); |
||||
} else if (i === 7 || i === 9 || i === 10 || i === 11) { |
||||
rule = e.symbol + e.num + e.unit; |
||||
} |
||||
temp.rule = rule; |
||||
param.push(temp); |
||||
}); |
||||
await accessStrategyEnterpriseBlacklistSave({ enterpriseBlacklistList: param }); |
||||
addRecord(param); |
||||
getDetail(); |
||||
ElMessage.success('提交成功!'); |
||||
}; |
||||
// 新增判分记录 |
||||
const addRecord = async (data: Record<string, any>) => { |
||||
const preIds = `1,${Cookies.get('sand-level')},42,67,147,154`; // 1,关卡id,角色(这个页面是风控经理策略) |
||||
const rule: Array<Record<string, any>> = []; |
||||
data[0].rule && rule.push(handleId(369, 168, data[0].rule, preIds + ',369', 5)); |
||||
data[13].rule && rule.push(handleId(382, 179, data[13].rule, preIds + ',382', 5)); |
||||
data[7].rule && rule.push(handleId(376, 174, data[7].rule, preIds + ',376', 5)); |
||||
data[9].rule && rule.push(handleId(378, 176, data[9].rule, preIds + ',378', 5)); |
||||
data[10].rule && rule.push(handleId(379, 177, data[10].rule, preIds + ',379', 5)); |
||||
data[11].rule && rule.push(handleId(380, 178, data[11].rule, preIds + ',380', 5)); |
||||
|
||||
form.value.map((e, i) => { |
||||
if (((i > 0 && i < 4) || i === 5 || i === 6 || i === 14) && e.had) { |
||||
rule.push(handleId(e.stRecordId, e?.subject?.subjectId, e?.subject?.itemList?.find((n) => n.options === e.had)?.itemId, preIds + ',' + e.stRecordId, 1)); |
||||
} else if ((i === 4 || i === 8) && e.check.length) { |
||||
const ids = []; |
||||
e.check.map((n) => { |
||||
const cur = e.subject?.itemList?.find((e) => e.options === n); |
||||
cur && ids.push(cur.itemId); |
||||
}); |
||||
ids.length && rule.push(handleId(e.stRecordId, e?.subject?.subjectId, ids.join(), preIds + ',' + e.stRecordId, 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,432 @@ |
||||
<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" |
||||
max-height="calc(100vh - 230px)" |
||||
:cell-style="{background:'#fff'}" |
||||
border> |
||||
<el-table-column prop="name" |
||||
label="企业黑名单指标" |
||||
min-width="180" |
||||
align="center"> |
||||
</el-table-column> |
||||
<el-table-column label="进黑名单条件" |
||||
min-width="250"> |
||||
<template #default="{ row,$index }"> |
||||
<div class="flex items-center"> |
||||
<template v-if="!$index"> |
||||
<span class="whitespace-nowrap">跨行业经营,行业门类数</span> |
||||
<div class="w-[95px] mx-2"> |
||||
<el-select v-model="row.symbol" |
||||
clearable> |
||||
<el-option v-for="item in symbols" |
||||
:key="item" |
||||
:label="item" |
||||
:value="item" /> |
||||
</el-select> |
||||
</div> |
||||
<div class="w-[95px]"> |
||||
<el-select v-model="row.num" |
||||
clearable> |
||||
<el-option v-for="item in nums" |
||||
:key="item" |
||||
:label="item" |
||||
:value="item" /> |
||||
</el-select> |
||||
</div> |
||||
<span class="whitespace-nowrap ml-2">。</span> |
||||
</template> |
||||
<template v-else-if="$index === 1"> |
||||
<span class="whitespace-nowrap">名下企业</span> |
||||
<div class="w-[95px] mx-2"> |
||||
<el-select v-model="row.had" |
||||
clearable> |
||||
<el-option v-for="item in have" |
||||
:key="item" |
||||
:label="item" |
||||
:value="item" /> |
||||
</el-select> |
||||
</div> |
||||
<span class="whitespace-nowrap ml-2">房产查封。</span> |
||||
</template> |
||||
<template v-else-if="$index === 2"> |
||||
<span class="whitespace-nowrap">名下企业</span> |
||||
<div class="w-[95px] mx-2"> |
||||
<el-select v-model="row.had" |
||||
clearable> |
||||
<el-option v-for="item in have" |
||||
:key="item" |
||||
:label="item" |
||||
:value="item" /> |
||||
</el-select> |
||||
</div> |
||||
<span class="whitespace-nowrap ml-2">股权冻结。</span> |
||||
</template> |
||||
<template v-else-if="$index === 3"> |
||||
<span class="whitespace-nowrap">行内企业</span> |
||||
<div class="w-[95px] mx-2"> |
||||
<el-select v-model="row.had" |
||||
clearable> |
||||
<el-option v-for="item in have" |
||||
:key="item" |
||||
:label="item" |
||||
:value="item" /> |
||||
</el-select> |
||||
</div> |
||||
<span class="whitespace-nowrap ml-2">不良贷款客户。</span> |
||||
</template> |
||||
<template v-else-if="$index === 4"> |
||||
<el-checkbox-group v-if="row.subject" |
||||
v-model="row.check"> |
||||
<el-checkbox v-for="item in row?.subject?.itemList" |
||||
:key="item" |
||||
:label="item.options" /> |
||||
</el-checkbox-group> |
||||
</template> |
||||
<template v-else-if="$index === 5"> |
||||
<div class="w-[95px]"> |
||||
<el-select v-model="row.had" |
||||
clearable> |
||||
<el-option value="不是" /> |
||||
<el-option value="是" /> |
||||
</el-select> |
||||
</div> |
||||
<span class="whitespace-nowrap ml-2">被列为非正常户或注销户。</span> |
||||
</template> |
||||
<template v-else-if="$index === 6"> |
||||
<div class="w-[95px]"> |
||||
<el-select v-model="row.had" |
||||
clearable> |
||||
<el-option value="不是" /> |
||||
<el-option value="是" /> |
||||
</el-select> |
||||
</div> |
||||
<span class="whitespace-nowrap ml-2">非正常户或注销户。</span> |
||||
</template> |
||||
<template v-else-if="$index === 7"> |
||||
<span class="whitespace-nowrap">经营年限</span> |
||||
<div class="w-[95px] ml-2"> |
||||
<el-select v-model="row.symbol" |
||||
clearable> |
||||
<el-option v-for="item in symbols" |
||||
:key="item" |
||||
:label="item" |
||||
:value="item" /> |
||||
</el-select> |
||||
</div> |
||||
<div class="w-[95px] mx-2"> |
||||
<el-select v-model="row.num" |
||||
clearable> |
||||
<el-option v-for="item in nums" |
||||
:key="item" |
||||
:label="item" |
||||
:value="item" /> |
||||
</el-select> |
||||
</div> |
||||
<div class="w-[95px]"> |
||||
<el-select v-model="row.unit" |
||||
clearable> |
||||
<el-option v-for="item in units" |
||||
:key="item" |
||||
:label="item" |
||||
:value="item" /> |
||||
</el-select> |
||||
</div> |
||||
<span class="whitespace-nowrap ml-2">。</span> |
||||
</template> |
||||
<template v-else-if="$index === 8"> |
||||
<span class="whitespace-nowrap mr-2">企业性质涉及</span> |
||||
<el-checkbox-group v-if="row.subject" |
||||
v-model="row.check"> |
||||
<el-checkbox v-for="item in row?.subject?.itemList" |
||||
:key="item" |
||||
:label="item.options" /> |
||||
</el-checkbox-group> |
||||
</template> |
||||
<template v-else-if="$index === 9"> |
||||
<div class="w-[95px]"> |
||||
<el-select v-model="row.symbol" |
||||
clearable> |
||||
<el-option v-for="item in symbols" |
||||
:key="item" |
||||
:label="item" |
||||
:value="item" /> |
||||
</el-select> |
||||
</div> |
||||
<div class="w-[95px] mx-2"> |
||||
<el-select v-model="row.num" |
||||
clearable> |
||||
<el-option v-for="item in nums" |
||||
:key="item" |
||||
:label="item" |
||||
:value="item" /> |
||||
</el-select> |
||||
</div> |
||||
<div class="w-[95px]"> |
||||
<el-select v-model="row.unit" |
||||
clearable> |
||||
<el-option v-for="item in units" |
||||
:key="item" |
||||
:label="item" |
||||
:value="item" /> |
||||
</el-select> |
||||
</div> |
||||
<span class="whitespace-nowrap ml-2">注册资本减少。</span> |
||||
</template> |
||||
<template v-else-if="$index === 10"> |
||||
<div class="w-[95px]"> |
||||
<el-select v-model="row.symbol" |
||||
clearable> |
||||
<el-option v-for="item in symbols" |
||||
:key="item" |
||||
:label="item" |
||||
:value="item" /> |
||||
</el-select> |
||||
</div> |
||||
<div class="w-[95px] mx-2"> |
||||
<el-select v-model="row.num" |
||||
clearable> |
||||
<el-option v-for="item in nums" |
||||
:key="item" |
||||
:label="item" |
||||
:value="item" /> |
||||
</el-select> |
||||
</div> |
||||
<div class="w-[95px]"> |
||||
<el-select v-model="row.unit" |
||||
clearable> |
||||
<el-option v-for="item in units" |
||||
:key="item" |
||||
:label="item" |
||||
:value="item" /> |
||||
</el-select> |
||||
</div> |
||||
<span class="whitespace-nowrap ml-2">内法定代表人变更。</span> |
||||
</template> |
||||
<template v-else-if="$index === 11"> |
||||
<div class="w-[95px]"> |
||||
<el-select v-model="row.symbol" |
||||
clearable> |
||||
<el-option v-for="item in symbols" |
||||
:key="item" |
||||
:label="item" |
||||
:value="item" /> |
||||
</el-select> |
||||
</div> |
||||
<div class="w-[95px] mx-2"> |
||||
<el-select v-model="row.num" |
||||
clearable> |
||||
<el-option v-for="item in nums" |
||||
:key="item" |
||||
:label="item" |
||||
:value="item" /> |
||||
</el-select> |
||||
</div> |
||||
<div class="w-[95px]"> |
||||
<el-select v-model="row.unit" |
||||
clearable> |
||||
<el-option v-for="item in units" |
||||
:key="item" |
||||
:label="item" |
||||
:value="item" /> |
||||
</el-select> |
||||
</div> |
||||
<span class="whitespace-nowrap ml-2">内大股东(股权占比>=50%)变更。</span> |
||||
</template> |
||||
<template v-else-if="$index === 12"> |
||||
命中禁入行业名单中企业拒绝规则 |
||||
</template> |
||||
<template v-else-if="$index === 13"> |
||||
<span class="whitespace-nowrap">申请人在该企业的股权占比</span> |
||||
<div class="w-[95px] mx-2"> |
||||
<el-select v-model="row.symbol" |
||||
clearable> |
||||
<el-option v-for="item in symbols" |
||||
:key="item" |
||||
:label="item" |
||||
:value="item" /> |
||||
</el-select> |
||||
</div> |
||||
<div class="w-[95px] "> |
||||
<el-select v-model="row.num" |
||||
clearable> |
||||
<el-option v-for="item in nums" |
||||
:key="item" |
||||
:label="item" |
||||
:value="item" /> |
||||
</el-select> |
||||
</div> |
||||
<span class="whitespace-nowrap ml-2">%。</span> |
||||
</template> |
||||
<template v-else-if="$index === 14"> |
||||
<div class="w-[95px] mx-2"> |
||||
<el-select v-model="row.had" |
||||
clearable> |
||||
<el-option value="不在" /> |
||||
<el-option value="在" /> |
||||
</el-select> |
||||
</div> |
||||
<span class="whitespace-nowrap ml-2">工商局或农专经营异常目录。</span> |
||||
</template> |
||||
</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="syncVisible = true">确定</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 { accessStrategyEnterpriseBlacklistFind, accessStrategyEnterpriseBlacklistSave } from '@/api/model'; |
||||
import { getProcessInformationBasedOnRoles, addOperation } from '@/api/judgment'; |
||||
import { useRouter, useRoute } from 'vue-router'; |
||||
import { handleId, getNum, getSymbol, getChinese, 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 { strategyId, strategyName } = toRefs(props.row); |
||||
const info = ref<Record<string, any>[]>([]); |
||||
const symbols: Array<string> = ['>=', '<', '>', '==', '<=']; |
||||
const nums: Array<number> = [1, 3, 5, 6, 16, 33, 40]; |
||||
const units: Array<string> = ['年', '月', '天']; |
||||
const have: Array<string> = ['无', '有']; |
||||
const syncVisible = ref<boolean>(false); |
||||
// 配置项 |
||||
const getConfig = async () => { |
||||
const { process } = await getProcessInformationBasedOnRoles(154); |
||||
const result = []; |
||||
process.map((e, i) => { |
||||
const cur = info.value.find((n) => n.stRecordId === e.id); |
||||
let num = getNum(cur?.rule); |
||||
let symbol = getSymbol(cur?.rule); |
||||
let had = getChinese(cur?.rule); |
||||
let temp = { |
||||
name: e.name, |
||||
subject: e.subject, |
||||
stRecordId: e.id, |
||||
symbol: symbol || '', |
||||
unit: had || '', |
||||
num: num || '', |
||||
had: (((i > 0 && i < 4) || i === 5 || i === 6 || i === 14) && cur?.rule) || '', |
||||
check: (i === 4 || i === 8) && cur ? cur?.rule.split(',') : [], |
||||
}; |
||||
|
||||
result.push(temp); |
||||
}); |
||||
form.value = result; |
||||
}; |
||||
// 详情 |
||||
const getDetail = async () => { |
||||
try { |
||||
if (strategyId.value) { |
||||
const { data } = await accessStrategyEnterpriseBlacklistFind({ |
||||
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,67,147,154`; // 1,关卡id,角色(这个页面是风控经理策略) |
||||
const rule: Array<Record<string, any>> = []; |
||||
data[0].rule && rule.push(handleId(369, 168, data[0].rule, preIds + ',369', 5)); |
||||
data[13].rule && rule.push(handleId(382, 179, data[13].rule, preIds + ',382', 5)); |
||||
data[7].rule && rule.push(handleId(376, 174, data[7].rule, preIds + ',376', 5)); |
||||
data[9].rule && rule.push(handleId(378, 176, data[9].rule, preIds + ',378', 5)); |
||||
data[10].rule && rule.push(handleId(379, 177, data[10].rule, preIds + ',379', 5)); |
||||
data[11].rule && rule.push(handleId(380, 178, data[11].rule, preIds + ',380', 5)); |
||||
|
||||
form.value.map((e, i) => { |
||||
if (((i > 0 && i < 4) || i === 5 || i === 6 || i === 14) && e.had) { |
||||
rule.push(handleId(e.stRecordId, e?.subject?.subjectId, e?.subject?.itemList?.find((n) => n.options === e.had)?.itemId, preIds + ',' + e.stRecordId, 1)); |
||||
} else if ((i === 4 || i === 8) && e.check.length) { |
||||
const ids = []; |
||||
e.check.map((n) => { |
||||
const cur = e.subject?.itemList?.find((e) => e.options === n); |
||||
cur && ids.push(cur.itemId); |
||||
}); |
||||
ids.length && rule.push(handleId(e.stRecordId, e?.subject?.subjectId, ids.join(), preIds + ',' + e.stRecordId, 1)); |
||||
} |
||||
}); |
||||
await addOperation({ |
||||
...getIds(), |
||||
parentId: preIds, |
||||
lcJudgmentRuleReq: rule, |
||||
}); |
||||
ElMessage.success('提交成功!'); |
||||
syncVisible.value = false; |
||||
emit('close', 1); |
||||
}; |
||||
// 提交 |
||||
const submit = async () => { |
||||
let param = []; |
||||
form.value.map((e, i) => { |
||||
const temp = { |
||||
id: info.value.find((n) => n.stRecordId === e.stRecordId)?.id ?? '', |
||||
stRecordId: e.stRecordId, |
||||
...getIds(), |
||||
}; |
||||
let rule; |
||||
if (!i || i === 13) { |
||||
rule = e.symbol + e.num; |
||||
} else if ((i > 0 && i < 4) || i === 5 || i === 6 || i === 14) { |
||||
rule = e.had; |
||||
} else if (i === 4 || i === 8) { |
||||
rule = e.check.join(); |
||||
} else if (i === 7 || i === 9 || i === 10 || i === 11) { |
||||
rule = e.symbol + e.num + e.unit; |
||||
} |
||||
temp.rule = rule; |
||||
param.push(temp); |
||||
}); |
||||
await accessStrategyEnterpriseBlacklistSave({ enterpriseBlacklistList: param }); |
||||
addRecord(param); |
||||
}; |
||||
</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.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 { accessStrategyEnterpriseBlacklist, accessStrategyEnterpriseBlacklistDel } 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 accessStrategyEnterpriseBlacklist({ 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 accessStrategyEnterpriseBlacklistDel({ ids }); |
||||
getList(); |
||||
ElMessage.success('删除成功!'); |
||||
}; |
||||
</script> |
Loading…
Reference in new issue