From 50a5452471c411fd3ee2810a269a59c6fcc4cfce Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Mon, 25 Mar 2024 18:38:51 +0800 Subject: [PATCH] =?UTF-8?q?=E9=93=B6=E8=A1=8C=E8=A6=81=E7=B4=A0=E5=9B=9E?= =?UTF-8?q?=E6=98=BE=E7=AD=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env | 4 +- src/api/bank.ts | 1 + src/layout/components/AppHeader.vue | 8 - src/store/useProduct.ts | 1 - src/utils/common.ts | 9 + src/views/product/bank/Add.vue | 168 +++++++------- src/views/product/bank/Approve.vue | 7 +- src/views/product/bank/Config.vue | 288 ++++++++++++++---------- src/views/product/bank/Detail.vue | 9 +- src/views/product/bank/Info.vue | 92 +++++--- src/views/product/fund/Add.vue | 20 +- src/views/product/strategy/CardList.vue | 2 - src/views/product/strategy/Credit.vue | 3 +- 13 files changed, 343 insertions(+), 269 deletions(-) diff --git a/.env b/.env index e2a3828..104e2c6 100644 --- a/.env +++ b/.env @@ -2,8 +2,8 @@ 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://121.37.12.51 +VITE_BASE_API=http://192.168.31.217:9000 +# VITE_BASE_API=http://121.37.12.51 # VITE_BASE_API=https://www.occupationlab.com VITE_I18N_LOCALE=zh-cn VITE_I18N_FALLBACK_LOCALE=zh-cn diff --git a/src/api/bank.ts b/src/api/bank.ts index b686e39..8c4292e 100644 --- a/src/api/bank.ts +++ b/src/api/bank.ts @@ -11,6 +11,7 @@ export const personalRiskControlConfigurationField = async (): Promise => (await axios.post('/product/riskControlConfigurationField/personalRiskControlConfigurationField')).data; export const productElement = async (id: number): Promise => (await axios.post(`/product/product/bank/products/productElement?id=${id}`)).data; export const findById = async (id: number): Promise => (await axios.post(`/product/product/bank/products/findById?id=${id}`)).data; +export const elementDetail = async (id: number): Promise => (await axios.post(`/product/product/bank/products/elementDetail?id=${id}`)).data; export const save = async (data: Record): Promise => (await axios.post(`/product/product/bank/products/save`, data)).data; export const riskSave = async (data: Record): Promise => (await axios.post(`/product/managerOfRiskControl/bankRiskControlAllocation/save`, data)).data; export const riskUpdate = async (data: Record): Promise => (await axios.post(`/product/managerOfRiskControl/bankRiskControlAllocation/update`, data)).data; diff --git a/src/layout/components/AppHeader.vue b/src/layout/components/AppHeader.vue index 4f1ea0e..f418260 100644 --- a/src/layout/components/AppHeader.vue +++ b/src/layout/components/AppHeader.vue @@ -11,14 +11,6 @@ alt="" @click="logout" /> - - - diff --git a/src/store/useProduct.ts b/src/store/useProduct.ts index d76d979..2c2509f 100644 --- a/src/store/useProduct.ts +++ b/src/store/useProduct.ts @@ -1,5 +1,4 @@ import { reactive, readonly } from 'vue'; -import Cookies from 'js-cookie'; export interface Product { status?: Record; diff --git a/src/utils/common.ts b/src/utils/common.ts index ded001c..cd76577 100644 --- a/src/utils/common.ts +++ b/src/utils/common.ts @@ -1,5 +1,6 @@ import Cookies from 'js-cookie'; import { getCurrentTime } from '@/api/system'; +import { getTheCurrentUserName } from '@/api/config'; const UJCMS_LOCALE = 'ujcms-locale'; const UJCMS_SITE_ID = 'ujcms-site-id'; @@ -254,6 +255,14 @@ export const getNow = (): Promise => { }); }; +/** + * 获取当前用户名 + */ +export const getUsername = async (): string => { + const res = await getTheCurrentUserName(); + return res.userName; +}; + export const whethers = [ { id: 795, diff --git a/src/views/product/bank/Add.vue b/src/views/product/bank/Add.vue index afd2447..56987da 100644 --- a/src/views/product/bank/Add.vue +++ b/src/views/product/bank/Add.vue @@ -80,14 +80,14 @@
1、年龄 是否启用 - + {{ item.name }}
-
@@ -100,14 +100,14 @@
2、学历要求 是否启用 - + {{ item.name }}
- 3、工作年限 是否启用 - + {{ item.name }}
- 选择本产品的担保种类。

信用贷 - + {{ item.name }} @@ -211,7 +211,7 @@
保证贷 - + {{ item.name }} @@ -220,13 +220,13 @@
抵押贷 - + {{ item.name }}
- 质押贷 - + {{ item.name }}
- - +
@@ -337,11 +337,10 @@ import { ref, reactive, computed, watch, onMounted, defineEmits } from 'vue'; import { ElMessage } from 'element-plus'; import type { TabsPaneContext, FormInstance, FormRules } from 'element-plus'; -import { findById, save, update } from '@/api/bank'; +import { findById, save, update, elementDetail } from '@/api/bank'; import { getProcessInformationBasedOnRoles, addOperation } from '@/api/judgment'; -import { getTheCurrentUserName } from '@/api/config'; import { useRouter, useRoute } from 'vue-router'; -import { handleId, isIllegalNum, getIds, whethers } from '@/utils/common'; +import { handleId, isIllegalNum, getIds, whethers, getUsername } from '@/utils/common'; import { getStatus } from '@/store/useProduct'; import Info from './Info.vue'; import Cookies from 'js-cookie'; @@ -352,30 +351,30 @@ interface RuleForm { productName: string; productCurrency: number; bankGuaranteeTypeIds: number[]; - currentWorkingLife?: any; - edu: number | string; - educationalRequirements?: any; - loanCeiling: any; + currentWorkingLife?: number[]; + degreeSelectedStatus?: number; + educationalRequirements?: number[]; + loanCeiling?: string; loanPurpose?: number; - maximumAge: any; - maximumAnnualInterestRate: any; - maximumTermOfLoan: any; - age: number | string; - curWL: number | string; - minimumAge: any; - minimumAprOnLoan: any; - minimumLoan: any; - minimumTermOfLoan: any; - modeRepayment?: any; + maximumAge?: number; + maximumAnnualInterestRate?: string; + maximumTermOfLoan?: string; + ageSelectedState?: number; + workingLifeSelectedState?: number; + minimumAge?: number; + minimumAprOnLoan?: string; + minimumLoan?: string; + minimumTermOfLoan?: string; + modeRepayment?: number[]; otherPurposesOfLoan: string; - productObject: any; + productObject?: number; productType: number; providentFundAndSocialSecurity: number | string; - whetherToSupportEarlyRepayment?: any; - bankGuarantee1?: number; - bankGuarantee2?: number; - bankGuarantee3?: number; - bankGuarantee4?: number; + whetherToSupportEarlyRepayment: boolean; + creditSelectedStatus?: number; + guaranteeLoanSelectedStatus?: number; + mortgageSelectedStatus?: number; + hypothecatedSelectedStatus?: number; } const router = useRouter(); @@ -387,22 +386,22 @@ const info = ref>(null); const formRef = ref(); const userName = ref(); -const form = reactive({ +let form = reactive({ ...getIds(), productDefinition: '', productName: '', productCurrency: 1, bankGuaranteeTypeIds: [], currentWorkingLife: [], - edu: '', + degreeSelectedStatus: '', educationalRequirements: [], loanCeiling: '', loanPurpose: '', maximumAge: '', maximumAnnualInterestRate: '', maximumTermOfLoan: '', - age: '', - curWL: '', + ageSelectedState: '', + workingLifeSelectedState: '', minimumAge: '', minimumAprOnLoan: '', minimumLoan: '', @@ -413,10 +412,10 @@ const form = reactive({ productType: computed(() => +route.query.type), providentFundAndSocialSecurity: '', whetherToSupportEarlyRepayment: false, - bankGuarantee1: '', - bankGuarantee2: '', - bankGuarantee3: '', - bankGuarantee4: '', + creditSelectedStatus: '', + guaranteeLoanSelectedStatus: '', + mortgageSelectedStatus: '', + hypothecatedSelectedStatus: '', }); const rules = reactive>({ productDefinition: [{ required: true, message: '请输入产品定义', trigger: 'blur' }], @@ -436,25 +435,39 @@ const getConfig = async () => { }; // 详情 const getDetail = async () => { + userName.value = await getUsername(); + info.value = null; if (id.value) { try { + // 只返回name的详情 const { data } = await findById(id.value); info.value = data; + + // 只返回id的详情 + const res = await elementDetail(id.value); + if (res) { + const e = res.data.bankProducts; + e.currentWorkingLife = e.currentWorkingLife.split(',').map((n) => +n); + e.educationalRequirements = e.educationalRequirements.split(',').map((n) => +n); + e.modeRepayment = e.modeRepayment.split(',').map((n) => +n); + e.whetherToSupportEarlyRepayment = !!e.whetherToSupportEarlyRepayment; + e.bankGuaranteeTypeIds = []; + if (e.bankGuaranteeAllocationList) { + e.bankGuaranteeAllocationList.map((n) => { + n.guaranteeTypeId && e.bankGuaranteeTypeIds.push(n.guaranteeTypeId); + }); + } + form = Object.assign(form, e); + } } finally { } } }; -// 获取审查员姓名 -const getName = async () => { - const res = await getTheCurrentUserName(); - userName.value = res.userName; -}; watch( () => route.query, () => { getDetail(); - getName(); }, { immediate: true, @@ -472,7 +485,7 @@ const submit = async (formEl: FormInstance | undefined) => { if (param.productType) { if (!param.productObject) return ElMessage.error('请选择企业类型'); } - if ((!param.productType && param.age === 795) || param.productType) { + if ((!param.productType && param.ageSelectedState === 795) || param.productType) { if (!param.minimumAge) return ElMessage.error('请输入最小年龄'); if (!param.maximumAge) return ElMessage.error('请输入最大年龄'); if (isIllegalNum(param.minimumAge) || isIllegalNum(param.maximumAge)) return ElMessage.error('请输入合理的年龄'); @@ -481,8 +494,8 @@ const submit = async (formEl: FormInstance | undefined) => { // 个人 if (!param.productType) { - if (param.edu === 795 && !param.educationalRequirements.length) return ElMessage.error('请选择学历要求'); - if (param.curWL === 795 && !param.currentWorkingLife.length) return ElMessage.error('请选择工作年限'); + if (param.degreeSelectedStatus === 795 && !param.educationalRequirements.length) return ElMessage.error('请选择学历要求'); + if (param.workingLifeSelectedState === 795 && !param.currentWorkingLife.length) return ElMessage.error('请选择工作年限'); } if (isIllegalNum(param.minimumLoan) || isIllegalNum(param.loanCeiling) || +param.minimumLoan > +param.loanCeiling) return ElMessage.error('请输入合理的贷款额度'); if (isIllegalNum(param.minimumAprOnLoan) || isIllegalNum(param.maximumAnnualInterestRate) || +param.minimumAprOnLoan > +param.maximumAnnualInterestRate) @@ -492,43 +505,30 @@ const submit = async (formEl: FormInstance | undefined) => { param.currentWorkingLife = param.currentWorkingLife.join(); param.educationalRequirements = param.educationalRequirements.join(); param.modeRepayment = param.modeRepayment.join(); - // param.providentFundAndSocialSecurity = param.providentFundAndSocialSecurity === 795 ? 1 : ''; param.whetherToSupportEarlyRepayment = param.whetherToSupportEarlyRepayment ? 58 : ''; // 担保方式 const graIds = []; // 信用贷 - param.bankGuarantee1 === 795 && + param.creditSelectedStatus === 795 && graIds.push({ bankGuaranteeTypeId: '', pid: 108, }); // 保证贷 - param.bankGuarantee2 === 795 && + param.guaranteeLoanSelectedStatus === 795 && graIds.push({ bankGuaranteeTypeId: '', pid: 109, }); - // 抵押贷 - param.bankGuarantee3 === 795 && - graIds.push({ - bankGuaranteeTypeId: 110, - pid: '', - }); - // 质押贷 - param.bankGuarantee4 === 795 && - graIds.push({ - bankGuaranteeTypeId: 111, - pid: '', - }); param.bankGuaranteeTypeIds.forEach((e: number) => { // 抵押贷 - if (param.bankGuarantee3 === 795 && e > 22 && e < 33) { + if (param.mortgageSelectedStatus === 795 && e > 22 && e < 33) { graIds.push({ bankGuaranteeTypeId: e, pid: 110, }); - } else if (param.bankGuarantee4 === 795 && e > 32 && e < 38) { + } else if (param.hypothecatedSelectedStatus === 795 && e > 32 && e < 38) { // 质押贷 graIds.push({ bankGuaranteeTypeId: e, @@ -578,14 +578,14 @@ const addRecord = async (data: Record) => { ); } else { // 个人 - data.age && lcRule.push(handleId(1235, 324, data.age, preIds + ',51,1234,1235', 1)); - data.age === 795 && lcRule.push(handleId(1236, 41, data.minimumAge + '~' + data.maximumAge, preIds + ',51,1234,1236', 5)); + data.ageSelectedState && lcRule.push(handleId(1235, 324, data.ageSelectedState, preIds + ',51,1234,1235', 1)); + data.ageSelectedState === 795 && lcRule.push(handleId(1236, 41, data.minimumAge + '~' + data.maximumAge, preIds + ',51,1234,1236', 5)); - data.edu && lcRule.push(handleId(1238, 324, data.edu, preIds + ',51,1237,1238', 1)); - data.edu === 795 && lcRule.push(handleId(1239, 42, data.educationalRequirements, preIds + ',51,1237,1239', 1)); + data.degreeSelectedStatus && lcRule.push(handleId(1238, 324, data.degreeSelectedStatus, preIds + ',51,1237,1238', 1)); + data.degreeSelectedStatus === 795 && lcRule.push(handleId(1239, 42, data.educationalRequirements, preIds + ',51,1237,1239', 1)); - data.curWL && lcRule.push(handleId(1241, 324, data.curWL, preIds + ',51,1240,1241', 1)); - data.curWL === 795 && lcRule.push(handleId(1242, 43, data.currentWorkingLife, preIds + ',51,1240,1242', 1)); + data.workingLifeSelectedState && lcRule.push(handleId(1241, 324, data.workingLifeSelectedState, preIds + ',51,1240,1241', 1)); + data.workingLifeSelectedState === 795 && lcRule.push(handleId(1242, 43, data.currentWorkingLife, preIds + ',51,1240,1242', 1)); data.providentFundAndSocialSecurity && lcRule.push(handleId(1244, 324, data.providentFundAndSocialSecurity, preIds + ',51,1243,1244', 1)); // 公积金社保 lcRule.push(handleId(1316, 328, data.loanPurpose, preIds + ',52,1316', 1)); @@ -593,12 +593,12 @@ const addRecord = async (data: Record) => { } // 担保方式 - data.bankGuarantee1 && lcRule.push(handleId(108, 324, data.bankGuarantee1, preIds + ',53,108', 1)); - data.bankGuarantee2 && lcRule.push(handleId(109, 324, data.bankGuarantee2, preIds + ',53,109', 1)); - data.bankGuarantee3 && lcRule.push(handleId(1277, 324, data.bankGuarantee3, preIds + ',53,110,1277', 1)); - data.bankGuarantee4 && lcRule.push(handleId(1277, 324, data.bankGuarantee4, preIds + ',53,111,1277', 1)); - data.bankGuarantee3 === 795 && lcRule.push(handleId(1275, 13, data.bankGuaranteeTypeIds.filter((e: number) => e > 22 && e < 33).join(), preIds + ',53,110,1275', 1)); - data.bankGuarantee4 === 795 && lcRule.push(handleId(1276, 14, data.bankGuaranteeTypeIds.filter((e: number) => e > 32 && e < 38).join(), preIds + ',53,111,1276', 1)); + data.creditSelectedStatus && lcRule.push(handleId(108, 324, data.creditSelectedStatus, preIds + ',53,108', 1)); + data.guaranteeLoanSelectedStatus && lcRule.push(handleId(109, 324, data.guaranteeLoanSelectedStatus, preIds + ',53,109', 1)); + data.mortgageSelectedStatus && lcRule.push(handleId(1277, 324, data.mortgageSelectedStatus, preIds + ',53,110,1277', 1)); + data.hypothecatedSelectedStatus && lcRule.push(handleId(1277, 324, data.hypothecatedSelectedStatus, preIds + ',53,111,1277', 1)); + data.mortgageSelectedStatus === 795 && lcRule.push(handleId(1275, 13, data.bankGuaranteeTypeIds.filter((e: number) => e > 22 && e < 33).join(), preIds + ',53,110,1275', 1)); + data.hypothecatedSelectedStatus === 795 && lcRule.push(handleId(1276, 14, data.bankGuaranteeTypeIds.filter((e: number) => e > 32 && e < 38).join(), preIds + ',53,111,1276', 1)); lcRule.push( handleId(54, 15, data.minimumLoan + '~' + data.loanCeiling, preIds + ',54', 5), diff --git a/src/views/product/bank/Approve.vue b/src/views/product/bank/Approve.vue index cff70cf..70f9b4a 100644 --- a/src/views/product/bank/Approve.vue +++ b/src/views/product/bank/Approve.vue @@ -58,9 +58,9 @@ import { ElMessage } from 'element-plus'; import type { TabsPaneContext, FormInstance, FormRules } from 'element-plus'; import { useRouter, useRoute } from 'vue-router'; import Info from './Info.vue'; -import { handleId, getIds, getNow } from '@/utils/common'; +import { handleId, getIds, getNow, getUsername } from '@/utils/common'; import { examineAndApprove } from '@/api/bank'; -import { getTheCurrentUserName, getOperationTime } from '@/api/config'; +import { getOperationTime } from '@/api/config'; import { getProcessInformationBasedOnRoles, addOperation } from '@/api/judgment'; import dayjs from 'dayjs'; import Cookies from 'js-cookie'; @@ -107,8 +107,7 @@ const getDate = async () => { }; // 签章 const sign = async () => { - const res = await getTheCurrentUserName(); - signed.value = res.userName; + signed.value = await getUsername(); }; // 新增判分记录 const addRecord = async (data: Record) => { diff --git a/src/views/product/bank/Config.vue b/src/views/product/bank/Config.vue index 4c8bda2..c400d88 100644 --- a/src/views/product/bank/Config.vue +++ b/src/views/product/bank/Config.vue @@ -4,6 +4,20 @@ @tab-click="tabChange"> +
+
+ 审批意见: + 审批打回 +
+
+ 意见描述: + {{ info.opinionDescription }} +
+

审查日期:{{ info.approvalTime }}

+

审查员:{{ userName }}

+
+