diff --git a/.env b/.env index 104e2c6..79153fd 100644 --- a/.env +++ b/.env @@ -2,7 +2,7 @@ VITE_APP_TITLE=金融产品设计及数字化营销沙盘 VITE_PORT=9520 # VITE_PROXY=http://192.168.31.125:8080 VITE_PUBLIC_PATH=./ -VITE_BASE_API=http://192.168.31.217:9000 +VITE_BASE_API=http://192.168.31.51:9000 # VITE_BASE_API=http://121.37.12.51 # VITE_BASE_API=https://www.occupationlab.com VITE_I18N_LOCALE=zh-cn diff --git a/src/api/model.ts b/src/api/model.ts index 1689de4..48618fe 100644 --- a/src/api/model.ts +++ b/src/api/model.ts @@ -17,9 +17,18 @@ export const accessStrategyGovernmentBlacklistSave = async (data: Record): Promise => (await axios.post(`${host}/product/accessStrategyGovernmentBlacklist/delete`, data)).data; +export const accessStrategyEnterpriseBlacklist = async (data: Record): Promise => + ( + await axios.post(`${host}/product/accessStrategyEnterpriseBlacklist/list`, { + ...getIds(), + ...data, + }) + ).data; export const accessStrategyEnterpriseBlacklistFind = async (): Promise => (await axios.post(`/product/accessStrategyEnterpriseBlacklist/details`, getIds())).data; export const accessStrategyEnterpriseBlacklistSave = async (data: Record): Promise => (await axios.post(`/product/accessStrategyEnterpriseBlacklist/saveOrUpdate`, data)).data; +export const accessStrategyEnterpriseBlacklistDel = async (data: Record): Promise => + (await axios.post(`${host}/product/accessStrategyEnterpriseBlacklist/delete`, data)).data; export const accessStrategyAntiFraudStrategyFind = async (): Promise => (await axios.post(`/product/accessStrategyAntiFraudStrategy/details`, getIds())).data; export const accessStrategyAntiFraudStrategySave = async (data: Record): PromiaccessStrategyGovernmentBlacklistse => diff --git a/src/views/product/bank/Config.vue b/src/views/product/bank/Config.vue index 2c86019..a18ed7a 100644 --- a/src/views/product/bank/Config.vue +++ b/src/views/product/bank/Config.vue @@ -214,7 +214,7 @@
- {{ item.options }} @@ -240,28 +240,29 @@
{{ item.name }} - + {{ option.options }}
- @@ -613,7 +615,7 @@ import { ElMessage } from 'element-plus'; import type { TabsPaneContext, FormInstance } from 'element-plus'; import { findById, riskSave, riskUpdate, riskControlDetailsAreDisplayed } from '@/api/bank'; import { getProcessInformationBasedOnRoles, addOperation } from '@/api/judgment'; -import { listCredit, accessStrategyGovernmentBlacklistList } from '@/api/model'; +import { listCredit, accessStrategyGovernmentBlacklistList, accessStrategyCreditBlacklist, accessStrategyBusinessBlacklist } from '@/api/model'; import { useRouter, useRoute } from 'vue-router'; import { handleId, getIds, getUsername } from '@/utils/common'; import Info from './Info.vue'; @@ -698,10 +700,9 @@ const whethers1 = ref>([ const formRef = ref(); const userName = ref(); const curPreview = ref('150'); -const curPreviewId = ref(); +const curRow = ref>(); +const strategyParams = { pageNum: 1, pageSize: 100, keyWord: '', ...getIds() }; const visible = ref(false); -const govList = ref[]>([]); - let form = reactive({ ...getIds(), provideMaterialSelectedStatus: '', @@ -754,10 +755,10 @@ let form = reactive({ const dynamicComponentMap = { '150': defineAsyncComponent(() => import('../strategy/150/Detail.vue')), - // '151': defineAsyncComponent(() => import('./151.vue')), - // '152': defineAsyncComponent(() => import('./152.vue')), - // '153': defineAsyncComponent(() => import('./153.vue')), - // '154': defineAsyncComponent(() => import('./154.vue')), + '151': defineAsyncComponent(() => import('../strategy/151/Detail.vue')), + '152': defineAsyncComponent(() => import('../strategy/152/Detail.vue')), + '153': defineAsyncComponent(() => import('../strategy/153/Detail.vue')), + '154': defineAsyncComponent(() => import('../strategy/154/Detail.vue')), // '155': defineAsyncComponent(() => import('./155.vue')), // '156': defineAsyncComponent(() => import('./156.vue')), // '148': defineAsyncComponent(() => import('./Credit.vue')), @@ -774,12 +775,18 @@ for (const [name, asyncComponent] of Object.entries(dynamicComponentMap)) { const tabChange = (tab: TabsPaneContext, event: Event) => { console.log(tab, event); }; -// 策略列表 -const getStrategy = async () => { - try { - const { page } = await accessStrategyGovernmentBlacklistList({ pageNum: 1, pageSize: 1000, keyWord: '', ...getIds() }); - govList.value = page.records; - } finally { +// 准入策略 +const getAccess = async (i: number) => { + const list = config.value[2].recordChildren[1].recordChildren; + if (!list[i].blackList) { + try { + let res; + if (!i) res = await accessStrategyGovernmentBlacklistList(strategyParams); // 政务 + if (i === 1) res = await accessStrategyCreditBlacklist(strategyParams); // 征信 + if (i === 2) res = await accessStrategyBusinessBlacklist(strategyParams); // 商采 + if (res) list[i].blackList = res.page.records; + } finally { + } } }; // 配置项 @@ -844,8 +851,13 @@ const getConfig = async () => { }); } - if (form.bankRiskControlAllocationTacticsList[0].tacticsSelectedStatus === 803) { - getStrategy(); + // 准入策略选择了需要跑批则查询对应策略列表 + const risk = form.bankRiskControlAllocationTacticsList; + if (risk) { + risk.map((e, i) => { + if (!e.tacticsId) e.tacticsId = ''; + e.tacticsSelectedStatus === 803 && getAccess(i); + }); } const { data } = await listCredit({ @@ -1022,7 +1034,7 @@ const submit = async (formEl: FormInstance | undefined) => { }); param.enterpriseQuotaModel = param.enterpriseQuotaModelSelectedStatus === 803 ? param.enterpriseQuotaModel.join() : ''; - debugger; + param.supplementaryMaterials = param.supplementMaterialSelectedStatus === 797 ? param.supplementaryMaterials.join() : ''; if (param.contractSupplyMaterialsSelectedStatus !== 797) param.contractMaterials = ''; if (info.value.riskControlDetails) { @@ -1145,25 +1157,25 @@ const addRecord = async (data: Record) => { // 准入策略 const list1 = data.bankRiskControlAllocationTacticsList; list1[0].tacticsSelectedStatus && lcRule.push(handleId(1325, 327, list1[0].tacticsSelectedStatus, `${preIds},74,83,1318,1325`, 1)); - list1[0].tacticsId && lcRule.push(handleId(1326, 331, govList.value.find((e) => e.governmentId === list1[0].tacticsId)?.strategyName, `${preIds},74,83,1318,1326`, 3)); + list1[0].tacticsId && lcRule.push(handleId(1326, 331, list1[0].blackList.find((e) => e.strategyId === list1[0].tacticsId)?.strategyName || '', `${preIds},74,83,1318,1326`, 3)); list1[1].tacticsSelectedStatus && lcRule.push(handleId(1327, 327, list1[1].tacticsSelectedStatus, `${preIds},74,83,1319,1327`, 1)); - list1[1].tacticsId && lcRule.push(handleId(1328, 332, govList.value.find((e) => e.governmentId === list1[1].tacticsId)?.strategyName, `${preIds},74,83,1319,1328`, 3)); + list1[1].tacticsId && lcRule.push(handleId(1328, 332, list1[1].blackList.find((e) => e.strategyId === list1[1].tacticsId)?.strategyName || '', `${preIds},74,83,1319,1328`, 3)); list1[2].tacticsSelectedStatus && lcRule.push(handleId(1329, 327, list1[2].tacticsSelectedStatus, `${preIds},74,83,1320,1329`, 1)); - list1[2].tacticsId && lcRule.push(handleId(1330, 333, govList.value.find((e) => e.governmentId === list1[2].tacticsId)?.strategyName, `${preIds},74,83,1320,1330`, 3)); + list1[2].tacticsId && lcRule.push(handleId(1330, 333, list1[2].blackList.find((e) => e.strategyId === list1[2].tacticsId)?.strategyName || '', `${preIds},74,83,1320,1330`, 3)); list1[3].tacticsSelectedStatus && lcRule.push(handleId(1331, 327, list1[3].tacticsSelectedStatus, `${preIds},74,83,1321,1331`, 1)); - list1[3].tacticsId && lcRule.push(handleId(1332, 334, govList.value.find((e) => e.governmentId === list1[3].tacticsId)?.strategyName, `${preIds},74,83,1321,1332`, 3)); + list1[3].tacticsId && lcRule.push(handleId(1332, 334, list1[3].blackList.find((e) => e.strategyId === list1[3].tacticsId)?.strategyName || '', `${preIds},74,83,1321,1332`, 3)); list1[4].tacticsSelectedStatus && lcRule.push(handleId(1333, 327, list1[4].tacticsSelectedStatus, `${preIds},74,83,1322,1333`, 1)); - list1[4].tacticsId && lcRule.push(handleId(1334, 335, govList.value.find((e) => e.governmentId === list1[4].tacticsId)?.strategyName, `${preIds},74,83,1322,1334`, 3)); + list1[4].tacticsId && lcRule.push(handleId(1334, 335, list1[4].blackList.find((e) => e.strategyId === list1[4].tacticsId)?.strategyName || '', `${preIds},74,83,1322,1334`, 3)); list1[5].tacticsSelectedStatus && lcRule.push(handleId(1335, 327, list1[5].tacticsSelectedStatus, `${preIds},74,83,1323,1335`, 1)); - list1[5].tacticsId && lcRule.push(handleId(1336, 336, govList.value.find((e) => e.governmentId === list1[5].tacticsId)?.strategyName, `${preIds},74,83,1323,1336`, 3)); + list1[5].tacticsId && lcRule.push(handleId(1336, 336, list1[5].blackList.find((e) => e.strategyId === list1[5].tacticsId)?.strategyName || '', `${preIds},74,83,1323,1336`, 3)); list1[6].tacticsSelectedStatus && lcRule.push(handleId(1337, 327, list1[6].tacticsSelectedStatus, `${preIds},74,83,1324,1337`, 1)); - list1[6].tacticsId && lcRule.push(handleId(1338, 337, govList.value.find((e) => e.governmentId === list1[6].tacticsId)?.strategyName, `${preIds},74,83,1324,1338`, 3)); + list1[6].tacticsId && lcRule.push(handleId(1338, 337, list1[6].blackList.find((e) => e.strategyId === list1[6].tacticsId)?.strategyName || '', `${preIds},74,83,1324,1338`, 3)); // 信用评分策略 const list2 = data.creditScoringStrategyList; @@ -1216,19 +1228,19 @@ const addRecord = async (data: Record) => { // 贷后管理 const list4 = data.bankRiskControlAllocationTacticsList; list4[0].tacticsSelectedStatus && lcRule.push(handleId(1350, 327, list4[0].tacticsSelectedStatus, `${preIds},99,1345,1350`, 1)); - list4[0].tacticsId && lcRule.push(handleId(1355, 339, govList.value.find((e) => e.governmentId === list4[0].tacticsId)?.strategyName, `${preIds},99,1345,1355`, 3)); + // list4[0].tacticsId && lcRule.push(handleId(1355, 339, govList.value.find((e) => e.strategyId === list4[0].tacticsId)?.strategyName, `${preIds},99,1345,1355`, 3)); list4[1].tacticsSelectedStatus && lcRule.push(handleId(1351, 327, list4[1].tacticsSelectedStatus, `${preIds},99,1346,1351`, 1)); - list4[1].tacticsId && lcRule.push(handleId(1356, 339, govList.value.find((e) => e.governmentId === list4[1].tacticsId)?.strategyName, `${preIds},99,1346,1356`, 3)); + // list4[1].tacticsId && lcRule.push(handleId(1356, 339, govList.value.find((e) => e.strategyId === list4[1].tacticsId)?.strategyName, `${preIds},99,1346,1356`, 3)); list4[2].tacticsSelectedStatus && lcRule.push(handleId(1352, 327, list4[2].tacticsSelectedStatus, `${preIds},99,1347,1352`, 1)); - list4[2].tacticsId && lcRule.push(handleId(1357, 339, govList.value.find((e) => e.governmentId === list4[2].tacticsId)?.strategyName, `${preIds},99,1347,1357`, 3)); + // list4[2].tacticsId && lcRule.push(handleId(1357, 339, govList.value.find((e) => e.strategyId === list4[2].tacticsId)?.strategyName, `${preIds},99,1347,1357`, 3)); list4[3].tacticsSelectedStatus && lcRule.push(handleId(1353, 327, list4[3].tacticsSelectedStatus, `${preIds},99,1348,1353`, 1)); - list4[3].tacticsId && lcRule.push(handleId(1358, 339, govList.value.find((e) => e.governmentId === list4[3].tacticsId)?.strategyName, `${preIds},99,1348,1358`, 3)); + // list4[3].tacticsId && lcRule.push(handleId(1358, 339, govList.value.find((e) => e.strategyId === list4[3].tacticsId)?.strategyName, `${preIds},99,1348,1358`, 3)); list4[4].tacticsSelectedStatus && lcRule.push(handleId(1354, 327, list4[4].tacticsSelectedStatus, `${preIds},99,1349,1354`, 1)); - list4[4].tacticsId && lcRule.push(handleId(1359, 339, govList.value.find((e) => e.governmentId === list4[4].tacticsId)?.strategyName, `${preIds},99,1349,1359`, 3)); + // list4[4].tacticsId && lcRule.push(handleId(1359, 339, govList.value.find((e) => e.strategyId === list4[4].tacticsId)?.strategyName, `${preIds},99,1349,1359`, 3)); } await addOperation({ @@ -1238,9 +1250,13 @@ const addRecord = async (data: Record) => { }); }; // 预览策略 -const preview = (strategyId: number, type: string) => { - curPreviewId.value = strategyId; - curPreview.value = type; +const preview = (row: Record, i: number) => { + const { tacticsId } = form.bankRiskControlAllocationTacticsList[i]; + curRow.value = { + strategyId: tacticsId, + strategyName: row.blackList.find((e) => e.strategyId === tacticsId)?.strategyName, + }; + curPreview.value = Object.keys(dynamicComponentMap)[i]; visible.value = true; }; diff --git a/src/views/product/strategy/150/Detail.vue b/src/views/product/strategy/150/Detail.vue index 2275ed7..e58def2 100644 --- a/src/views/product/strategy/150/Detail.vue +++ b/src/views/product/strategy/150/Detail.vue @@ -168,7 +168,7 @@ const props = defineProps({ const emit = defineEmits(['clsoe']); const form = ref[]>([]); -const { governmentId, strategyName } = toRefs(props.row); +const { strategyId, strategyName } = toRefs(props.row); const info = ref[]>([]); const symbols: Array> = [ { @@ -234,9 +234,9 @@ const getConfig = async () => { // 详情 const getDetail = async () => { try { - if (governmentId.value) { + if (strategyId.value) { const { data } = await accessStrategyGovernmentBlacklistFind({ - governmentId: governmentId.value, + strategyId: strategyId.value, }); info.value = data; } @@ -369,7 +369,7 @@ const submit = async (synchronizeUpdate?: number) => { }); await accessStrategyGovernmentBlacklistSave({ ...getIds(), - governmentId: governmentId.value, + strategyId: strategyId.value, strategyName: strategyName.value, synchronizeUpdate, governmentBlacklistList: param, diff --git a/src/views/product/strategy/150/Index.vue b/src/views/product/strategy/150/Index.vue index e3587d4..fb6bd8f 100644 --- a/src/views/product/strategy/150/Index.vue +++ b/src/views/product/strategy/150/Index.vue @@ -53,7 +53,7 @@ @click="toDetail(row)" size="small">编辑 + @confirm.stop="handleDelete([row.strategyId])">