yujialong 12 months ago
parent 1f4cc6a74a
commit 696f04fc7e
  1. 4
      src/views/Home.vue
  2. 79
      src/views/config/param/Buyer.vue
  3. 27
      src/views/product/bank/Add.vue
  4. 16
      src/views/product/fund/Add.vue
  5. 3
      src/views/product/insurance/Add.vue

@ -14,7 +14,7 @@
</div>
<div class="relative h-[calc(100vh-64px)] pt-5 pl-5 bg-[url('@/assets/images/level/4.png')] bg-[length:100%_100%] bg-no-repeat bg-fixed overflow-auto"
id="wrap">
<div class="relative">
<div class="fixed z-10">
<div class="w-[354px] h-[68px] bg-[url('@/assets/images/level/5.png')] bg-[length:100%_100%] bg-no-repeat"></div>
<div class="absolute top-5 left-40 flex items-center cursor-pointer"
@click="getLevel(1)">
@ -27,7 +27,7 @@
<span class="ml-2 text-sm text-[#999]">仅显示已收藏的项目</span>
</div>
</div>
<div class="relative mt-5">
<div class="relative mt-20">
<div v-for="(item, i) in levels"
:key="i"
:class="['item', { active: curLevel === item.checkpointId }]"

@ -158,6 +158,7 @@
import { ref, onMounted } from 'vue';
import { ElMessage } from 'element-plus';
import type { TableColumnCtx } from 'element-plus';
import { isIllegalNum } from '@/utils/common';
import { saveOrUpdate, systemBuyerFind, ages, edu, accountType, buyerType } from '@/api/config';
import _ from 'lodash';
@ -237,123 +238,61 @@ const submit = async () => {
let invalid = 0;
//
if (param.ageAduRatioList[0].totalPopulation === '') return ElMessage.error('请输入城市总人口');
if (isIllegalNum(param.ageAduRatioList[0].totalPopulation)) return ElMessage.error('请输入合理的城市总人口');
param.ageAduRatioList.some((e) => {
if (e.ageRatio === '') {
ElMessage.error('请输入年龄占比');
invalid = 1;
return true;
}
if (isNaN(e.ageRatio)) {
if (isIllegalNum(e.ageRatio)) {
ElMessage.error('请输入合理的年龄占比');
invalid = 1;
return true;
}
if (e.ageRatio < 0) {
ElMessage.error('年龄占比不得小于0');
invalid = 1;
return true;
}
});
if (invalid) return false;
if (_.sum(param.ageAduRatioList.map((e) => +e.ageRatio)) > 100) return ElMessage.error('占比总和不得超过100%');
//
edus.value.some((e) => {
if (e.eduRatio === '') {
ElMessage.error('请输入学历占比');
invalid = 1;
return true;
}
if (isNaN(e.eduRatio)) {
if (isIllegalNum(e.eduRatio)) {
ElMessage.error('请输入合理的学历占比');
invalid = 1;
return true;
}
if (e.eduRatio < 0) {
ElMessage.error('学历占比不得小于0');
invalid = 1;
return true;
}
});
if (invalid) return false;
//
param.enterpriseNumList.some((e) => {
if (e.number === '') {
ElMessage.error('请输入企业数量');
invalid = 1;
return true;
}
if (isNaN(e.number)) {
if (isIllegalNum(e.number)) {
ElMessage.error('请输入合理的企业数量');
invalid = 1;
return true;
}
if (e.number < 0) {
ElMessage.error('企业数量不得小于0');
invalid = 1;
return true;
}
});
if (invalid) return false;
//
param.commodityDemandList.some((e) => {
if (e.buyerRatio === '') {
ElMessage.error('请输入买家总占比');
invalid = 1;
return true;
}
if (isNaN(e.buyerRatio) || e.buyerRatio < 0 || e.buyerRatio > 100) {
if (isIllegalNum(e.buyerRatio) || e.buyerRatio > 100) {
ElMessage.error('请输入合理的买家总占比');
invalid = 1;
return true;
}
if (e.peopleNumRatio === '') {
ElMessage.error('请输入每次需求人数占比');
invalid = 1;
return true;
}
if (isNaN(e.peopleNumRatio) || e.peopleNumRatio < 0 || e.peopleNumRatio > 100) {
if (isIllegalNum(e.peopleNumRatio) || e.peopleNumRatio > 100) {
ElMessage.error('请输入合理的每次需求人数占比');
invalid = 1;
return true;
}
if (e.typeId != 7 && e.typeId != 8 && (e.buyerSingleDemandMin === '' || e.buyerSingleDemandMax === '')) {
console.log('🚀 ~ file: Buyer.vue:323 ~ param.commodityDemandList.some ~ e:', e);
ElMessage.error('请输入单个买家单次需求1');
invalid = 1;
return true;
}
if (e.typeId != 7 && e.typeId != 8 && (isNaN(e.buyerSingleDemandMin) || isNaN(e.buyerSingleDemandMax))) {
if (e.typeId != 7 && e.typeId != 8 && (isIllegalNum(e.buyerSingleDemandMin) || isIllegalNum(e.buyerSingleDemandMax))) {
ElMessage.error('请输入合理的单个买家单次需求');
invalid = 1;
return true;
}
if (e.typeId != 7 && e.typeId != 8 && (e.buyerSingleDemandMin < 0 || e.buyerSingleDemandMax < 0)) {
ElMessage.error('单个买家单次需求不得小于0');
invalid = 1;
return true;
}
if ((e.typeId == 7 || e.typeId == 8) && e.buyerSingleDemand === '') {
ElMessage.error('请输入单个买家单次需求2');
invalid = 1;
return true;
}
if ((e.typeId == 7 || e.typeId == 8) && isNaN(e.buyerSingleDemand)) {
if ((e.typeId == 7 || e.typeId == 8) && isIllegalNum(e.buyerSingleDemand)) {
ElMessage.error('请输入合理的单个买家单次需求');
invalid = 1;
return true;
}
if ((e.typeId == 7 || e.typeId == 8) && e.buyerSingleDemand < 0) {
ElMessage.error('单个买家单次需求不得小于0');
invalid = 1;
return true;
}
});
if (invalid) return false;

@ -55,7 +55,7 @@
<span class="mr-3 text-[#333] text-sm">企业类型</span>
<el-select v-model="form.productObject"
placeholder="请选择">
<el-option v-for="(item, i) in config.find((e: any) => e.name === '企业产品-贷款对象')?.recordChildren[0]?.subject?.itemList"
<el-option v-for="(item, i) in config.find((e) => e.name === '企业产品-贷款对象')?.recordChildren[0]?.subject?.itemList"
:key="i"
:label="item.options"
:value="item.itemId" />
@ -95,7 +95,7 @@
<el-checkbox-group v-if="form.edu"
class="mt-2 ml-5"
v-model="form.educationalRequirements">
<el-checkbox v-for="(item, i) in config.find((e: any) => e.name === '个人产品-贷款对象')?.recordChildren[1]?.subject?.itemList"
<el-checkbox v-for="(item, i) in config.find((e) => e.name === '个人产品-贷款对象')?.recordChildren[1]?.subject?.itemList"
:key="i"
:label="item.itemId">{{ item.options }}</el-checkbox>
</el-checkbox-group>
@ -107,7 +107,7 @@
<el-checkbox-group v-if="form.curWL"
class="mt-2 ml-5"
v-model="form.currentWorkingLife">
<el-checkbox v-for="(item, i) in config.find((e: any) => e.name === '个人产品-贷款对象')?.recordChildren[2]?.subject?.itemList"
<el-checkbox v-for="(item, i) in config.find((e) => e.name === '个人产品-贷款对象')?.recordChildren[2]?.subject?.itemList"
:key="i"
:label="item.itemId">{{ item.options }}</el-checkbox>
</el-checkbox-group>
@ -158,9 +158,9 @@
{ required: true, message: '请选择担保方式', trigger: 'change' },
{
asyncValidator: async (rule, value, callback) => {
if (value.includes(110) && !value.find((e: any) => e > 22 && e < 33)) {
if (value.includes(110) && !value.find((e) => e > 22 && e < 33)) {
callback('请选择抵押物')
} else if (value.includes(111) && !value.find((e: any) => e > 32 && e < 38)) {
} else if (value.includes(111) && !value.find((e) => e > 32 && e < 38)) {
callback('请选择质押贷')
} else {
callback()
@ -170,11 +170,14 @@
]">
<div class="flex-1">
<p class="field-name">选择本产品的担保种类</p>
<div v-for="(item, i) in config.find((e: any) => e.name === '担保方式')?.recordChildren"
<div v-for="(item, i) in config.find((e) => e.name === '担保方式')?.recordChildren"
:key="i"
class="mb-2">
<el-checkbox-group v-model="form.bankGuaranteeTypeIds">
<el-checkbox :label="item.id">{{ item.name }}</el-checkbox>
</el-checkbox-group>
<el-checkbox-group class="mb-1"
v-model="form.bankGuaranteeTypeIds">
<el-checkbox v-show="(item.id === 110 && form.bankGuaranteeTypeIds.includes(110)) || (item.id === 111 && form.bankGuaranteeTypeIds.includes(111))"
v-for="(child, j) in item?.subject?.itemList"
:key="j"
@ -238,7 +241,7 @@
<div class="flex-1">
<p class="field-name">选择本产品可以选择的还款方式</p>
<el-checkbox-group v-model="form.modeRepayment">
<el-checkbox v-for="(item, i) in config.find((e: any) => e.name === '还款方式')?.subject?.itemList"
<el-checkbox v-for="(item, i) in config.find((e) => e.name === '还款方式')?.subject?.itemList"
:key="i"
:label="item.itemId">{{ item.options }}</el-checkbox>
</el-checkbox-group>
@ -273,7 +276,7 @@ import type { TabsPaneContext, FormInstance, FormRules } from 'element-plus';
import { findById, save, update } from '@/api/bank';
import { getProcessInformationBasedOnRoles, addOperation } from '@/api/judgment';
import { useRouter, useRoute } from 'vue-router';
import { handleId } from '@/utils/common';
import { handleId, isIllegalNum } from '@/utils/common';
import { getStatus } from '@/store/useProduct';
import Info from './Info.vue';
import Cookies from 'js-cookie';
@ -391,7 +394,7 @@ const submit = async (formEl: FormInstance | undefined) => {
if ((!param.productType && param.age) || param.productType) {
if (!param.minimumAge) return ElMessage.error('请输入最小年龄');
if (!param.maximumAge) return ElMessage.error('请输入最大年龄');
if (param.minimumAge < 0 || param.minimumAge > 999 || param.maximumAge < 0 || param.maximumAge > 999) return ElMessage.error('请输入合理的年龄');
if (isIllegalNum(param.minimumAge) || isIllegalNum(param.maximumAge)) return ElMessage.error('请输入合理的年龄');
if (param.minimumAge > param.maximumAge) return ElMessage.error('最小年龄不得大于最大年龄');
}
@ -401,7 +404,11 @@ const submit = async (formEl: FormInstance | undefined) => {
if (param.curWL && !param.currentWorkingLife.length) return ElMessage.error('请选择工作年限');
if (param.curWL && !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)
return ElMessage.error('请输入合理的贷款利率');
if (isIllegalNum(param.minimumTermOfLoan) || isIllegalNum(param.maximumTermOfLoan) || +param.minimumTermOfLoan > +param.maximumTermOfLoan)
return ElMessage.error('请输入合理的贷款期限');
param.currentWorkingLife = param.currentWorkingLife.join();
param.educationalRequirements = param.educationalRequirements.join();
param.modeRepayment = param.modeRepayment.join();

@ -317,7 +317,7 @@ import { Plus, Minus } from '@element-plus/icons-vue';
import { getAListOfAShares, saveFund } from '@/api/fund';
import { getProcessInformationBasedOnRoles, addOperation } from '@/api/judgment';
import { useRouter, useRoute } from 'vue-router';
import { handleId } from '@/utils/common';
import { handleId, isIllegalNum } from '@/utils/common';
import Cookies from 'js-cookie';
const emit = defineEmits(['getList']);
@ -517,22 +517,18 @@ const submit = async () => {
if (!param.fundName) return ElMessage.error('请输入保险名称');
if (!param.fundType) return ElMessage.error('请选择基金类型');
if (!param.fundraisingScale) return ElMessage.error('请输入募集规模');
if (isIllegalNum(param.fundraisingScale)) return ElMessage.error('请输入合理的募集规模');
if (!param.modeOfOperation) return ElMessage.error('请选择运作方式');
if (!param.shareholdingAllocationsList.length || !param.shareholdingAllocationsList.filter((e) => e.stockCode).length) return ElMessage.error('请配置持股');
// 100
// let sum = 0;
// param.shareholdingAllocationsList.forEach((e) => {
// if (e.stockCode && e.proportion) {
// sum += +e.proportion;
// }
// });
// if (sum !== 100) return ElMessage.error('100');
if (!param.buyingDuration || !param.sellingTime) return ElMessage.error('请输入份额时长');
if (isIllegalNum(param.buyingDuration) || isIllegalNum(param.sellingTime)) return ElMessage.error('请输入合理的份额时长');
if (!param.operationManagementRate) return ElMessage.error('请输入管理费');
if (isIllegalNum(param.operationManagementRate)) return ElMessage.error('请输入合理的管理费');
if (!param.operatingEscrowRate) return ElMessage.error('请输入托管费');
if (isIllegalNum(param.operatingEscrowRate)) return ElMessage.error('请输入合理的托管费');
if (!param.operatingSalesServiceRates) return ElMessage.error('请输入销售服务费');
if (isIllegalNum(param.operatingSalesServiceRates)) return ElMessage.error('请输入合理的销售服务费');
//
param.shareholdingAllocationsList.forEach((e) => {

@ -241,14 +241,13 @@ const submit = async () => {
param.premiumAmount = Number(param.premiumAmount).toFixed(2);
}
if (!param.formOfPayment) return ElMessage.error('请选择缴纳形式');
if (isIllegalNum(param.insuranceDeadline)) return ElMessage.error('请输入保险期限');
if (isIllegalNum(param.insuranceDeadline)) return ElMessage.error('请输入合理的保险期限');
if (!param.insuranceDeadlineUnit) return ElMessage.error('请选择保险期限');
param.insuranceDeadline = param.insuranceDeadline + param.insuranceDeadlineUnit;
if (!param.applicationMaterial.length) return ElMessage.error('请至少选择一项申请材料');
if (!param.exemptionFromLiability.length) return ElMessage.error('请至少选择一项责任免除');
param.applicationMaterial = param.applicationMaterial.join();
param.exemptionFromLiability = param.exemptionFromLiability.join();
debugger;
await addInsuranceProducts(param);
addRecord(param);
ElMessage.success('提交成功!');

Loading…
Cancel
Save