录入界面规则完善

This commit is contained in:
SGK\17962 2025-08-25 18:47:19 +08:00
parent 67069b58a9
commit ec0ec7a376
6 changed files with 101 additions and 82 deletions

View File

@ -473,28 +473,6 @@ async function handleDelete(dataId: CommonType.IdType) {
}
function edit(dataId: CommonType.IdType) {
// //
// const rowData = data.value.find(item => item.dataId === dataId);
//
// //
// if (!rowData) {
// window.$message?.error('');
// return;
// }
//
// //
// const recordDate = new Date(rowData.date);
// const now = new Date();
// const lastMonth = new Date(now.getFullYear(), now.getMonth() - 1, 1);
// const lastMonthStart = new Date(lastMonth.getFullYear(), lastMonth.getMonth(), 1);
// const lastMonthEnd = new Date(lastMonth.getFullYear(), lastMonth.getMonth() + 1, 0);
//
// //
// if (recordDate >= lastMonthStart && recordDate <= lastMonthEnd) {
// handleEdit('dataId', dataId);
// } else {
// window.$message?.warning('');
// }
handleEdit('dataId', dataId);
}

View File

@ -87,7 +87,7 @@ function createDefaultModel(): Model {
};
}
type RuleKey = Extract<keyof Model, 'subcategoryId' | 'jbName' | 'jbId' | 'subcategoryName' | 'date' | 'custPhoneNo' | 'custId' | 'custAcctNo' | 'custType'| 'acquiringId' | 'heatingNo' >;//
type RuleKey = Extract<keyof Model, 'subcategoryId' | 'jbName' | 'jbId' | 'yxName' | 'yxId' | 'subcategoryName' | 'date' | 'custPhoneNo' | 'custId' | 'custAcctNo' | 'custType'|'custName' | 'acquiringId' | 'heatingNo' >;//
const phonePatternRule = {
pattern: /^1[3-9]\d{9}$/,
message: '请输入正确的手机号',
@ -111,37 +111,42 @@ const accountPatternRule = {
//
const acquiringIdPatternRule = {
pattern: /^[a-zA-Z0-9]+$/,
message: '综合收单商户号只能包含数字',
message: '综合收单商户号只能包含数字和字母',
trigger: 'change'
};
const custTypeRule = computed(() => {
// ""
if (model.subcategoryName !== '公积金缴纳账户') {
return createRequiredRule('客户类型不能为空');
}
return [];
});
// const custTypeRule = computed(() => {
// // ""
// if (model.subcategoryName !== '') {
// return createRequiredRule('');
// }
// return [];
// });
const rules: Record<RuleKey, App.Global.FormRule | App.Global.FormRule[]> = {
subcategoryId: createRequiredRule('业务类型id不能为空'),
jbName: createRequiredRule('经办人员名称不能为空'),
jbId: createRequiredRule('经办人员营销号不能为空'),
yxName: createRequiredRule('营销人员名称不能为空'),
yxId: createRequiredRule('营销人员营销号不能为空'),
subcategoryName: createRequiredRule('业务类型名称不能为空'),
date: createRequiredRule('数据日期不能为空'),
custPhoneNo: phonePatternRule,
custId: idCardPatternRule,
custAcctNo: accountPatternRule,
custType: custTypeRule.value,
custName: createRequiredRule('客户名称不能为空'),
custPhoneNo: [phonePatternRule,createRequiredRule('客户手机号不能为空')],
custId: [idCardPatternRule,createRequiredRule('客户手机号不能为空')],
custAcctNo: [accountPatternRule,createRequiredRule('账户号不能为空')],
custType: createRequiredRule('客户类型不能为空'),
acquiringId: acquiringIdPatternRule
};
const showMarketingFields = ref(false);
// const showMarketingFields = ref(false);
function handleUpdateModelWhenEdit() {
if (props.operateType === 'add') {
Object.assign(model, createDefaultModel());
model.jbId = userInfo.user?.userId;
model.jbId = userInfo.user?.mktNo;
model.jbName = userInfo.user?.nickName;
model.yxId = userInfo.user?.mktNo;
model.yxName = userInfo.user?.nickName;
model.deptId = userInfo.user?.deptId;
model.deptName = userInfo.user?.deptName;
return;
@ -165,11 +170,11 @@ function handleUpdateModelWhenEdit() {
}
Object.assign(model, createDefaultModel(), props.rowData);
//
if (model.yxName || model.yxId) {
showMarketingFields.value = true;
} else {
showMarketingFields.value = false;
}
// if (model.yxName || model.yxId) {
// showMarketingFields.value = true;
// } else {
// showMarketingFields.value = false;
// }
}
}
@ -340,13 +345,13 @@ function handleSubcategoryNameUpdate(value: string, option: CommonType.Option<Co
}
// showMarketingFieldsfalse
watch(showMarketingFields, newValue => {
if (!newValue) {
//
model.yxName = '';
model.yxId = '';
}
});
// watch(showMarketingFields, newValue => {
// if (!newValue) {
// //
// model.yxName = '';
// model.yxId = '';
// }
// });
//
watch(
@ -366,6 +371,7 @@ watch(
//
const isdisplaycustinfo = ref(false);
const isdisplaycustTypeinfo = ref(false);
const isdisplaymagneticCardList = ref(false);
const isdisplayacquiringName = ref(false);
const isdisplayacquiringId = ref(false);
@ -378,6 +384,16 @@ const isdisplayheatingNo = ref(false);
watch(
() => model.subcategoryName,
newVal => {
//
if(newVal === '新增综合收单商户(首月)'){
isdisplaycustTypeinfo.value = true;
}else if(newVal === '智e通企业版'){
model.custType = '2';
isdisplaycustTypeinfo.value = false;
}else{
model.custType = '1';
isdisplaycustTypeinfo.value = false;
}
switch (newVal) {
case '公积金缴纳账户':
isdisplaycustinfo.value = false;
@ -398,6 +414,7 @@ watch(
break;
case '磁条卡更换金融IC卡':
isdisplaycustinfo.value = true;
model.custType = '1';
isdisplaymagneticCardList.value = true;
isdisplayacquiringName.value = false;
isdisplayacquiringId.value = false;
@ -478,7 +495,7 @@ watch(
model.magneticCardList = [];
model.acquiringName = '';
model.acquiringId = '';
model.internetChannel = '';
model.internetChannel = [];
model.trafficList = [];
model.workplace = '';
model.surplusAccountName = '';
@ -558,13 +575,14 @@ watch(visible, () => {
filterable
placeholder="选择经办人员"
:options="operatorIdOptions"
:disabled="true"
@update:value="handleJbNameUpdate"
/>
</NFormItem>
</NGridItem>
<NGridItem :span="12">
<NFormItem label="经办人员营销号:" path="jbId">
<NInput v-model:value="model.jbId" placeholder="请输入经办人员营销号" clearable />
<NInput v-model:value="model.jbId" :disabled="true" placeholder="请输入经办人员营销号" clearable />
</NFormItem>
</NGridItem>
<NGridItem v-if="false" :span="12">
@ -572,25 +590,26 @@ watch(visible, () => {
<NInput v-model:value="model.deptId" placeholder="请输入部门id" clearable />
</NFormItem>
</NGridItem>
<NGridItem :span="24">
<NFormItem label="是否有营销人员分成" path="ifshowMarketingFields">
<NCheckbox v-model:checked="showMarketingFields">勾选以填写营销人员信息</NCheckbox>
</NFormItem>
</NGridItem>
<NGridItem v-if="showMarketingFields" :span="12">
<!-- <NGridItem :span="24">-->
<!-- <NFormItem label="是否有营销人员分成" path="ifshowMarketingFields">-->
<!-- <NCheckbox v-model:checked="showMarketingFields">勾选以填写营销人员信息</NCheckbox>-->
<!-- </NFormItem>-->
<!-- </NGridItem>-->
<NGridItem :span="12">
<NFormItem label="营销人员名称" path="yxName">
<NSelect
v-model:value="model.yxName"
filterable
placeholder="选择营销人员"
:options="operatorIdOptions"
clearable
@update:value="handleYxNameUpdate"
/>
</NFormItem>
</NGridItem>
<NGridItem v-if="showMarketingFields" :span="12">
<NGridItem :span="12">
<NFormItem label="营销人员营销号:" path="yxId">
<NInput v-model:value="model.yxId" placeholder="请输入营销人员营销号" clearable />
<NInput v-model:value="model.yxId" :disabled="true" placeholder="请输入营销人员营销号" clearable />
</NFormItem>
</NGridItem>
</NGrid>
@ -607,6 +626,7 @@ watch(visible, () => {
placeholder="选择业务类型"
:options="subcategoryIdOptions"
:disabled="operateType === 'edit'"
clearable
@update:value="handleSubcategoryNameUpdate"
/>
</NFormItem>
@ -634,7 +654,7 @@ watch(visible, () => {
<div v-if="isdisplaycustinfo" class="form-section">
<NDivider class="section-divider">客户信息</NDivider>
<NGrid :cols="24" :x-gap="24" responsive="screen">
<NGridItem :span="24">
<NGridItem v-if="isdisplaycustTypeinfo" :span="24">
<NFormItem label="客户类型" path="custType">
<NRadioGroup v-model:value="model.custType">
<NSpace>
@ -787,4 +807,9 @@ watch(visible, () => {
</NDrawer>
</template>
<style scoped></style>
<style scoped>.section-divider {
:deep(.n-divider__line) {
border-color: #333 !important;
}
}
</style>

View File

@ -80,7 +80,7 @@ public class MpsMarket extends TenantEntity {
/**
* 部门id
*/
private Integer deptId;
private Long deptId;
/**
* 客户类型1-个人2-对公

View File

@ -46,6 +46,7 @@ public class MpsMarketBo extends BaseEntity {
/**
* 营销人员名称
*/
@NotBlank(message = "营销人员名称不能为空", groups = { AddGroup.class, EditGroup.class })
private String yxName;
/**
@ -57,6 +58,7 @@ public class MpsMarketBo extends BaseEntity {
/**
* 营销人员营销号
*/
@NotBlank(message = "营销人员营销号不能为空", groups = { AddGroup.class, EditGroup.class })
private String yxId;
/**
@ -80,7 +82,7 @@ public class MpsMarketBo extends BaseEntity {
/**
* 部门id
*/
private Integer deptId;
private Long deptId;
/**
* 客户类型1-个人2-对公
@ -130,8 +132,9 @@ public class MpsMarketBo extends BaseEntity {
/**
* 网上支付开通渠道
*/
@AutoMapping(target = "internetChannel", expression = "java(java.lang.String.join(\",\", source.getInternetChannel()))")
@AutoMapping(target = "internetChannel", expression = "java(source.getInternetChannel()==null ? null : java.lang.String.join(\",\", source.getInternetChannel()))")
private List<String> internetChannel;
// private String internetChannel;
/**
* 交警处罚决定书

View File

@ -92,7 +92,7 @@ public class MpsMarketVo implements Serializable {
* 部门id
*/
@ExcelProperty(value = "部门id")
private Integer deptId;
private Long deptId;
/**
* 客户类型1-个人2-对公

View File

@ -101,8 +101,21 @@ public class MpsMarketServiceImpl implements IMpsMarketService {
LambdaQueryWrapper<MpsMarket> lqw = buildQueryWrapper(bo);
// PageDTO<MpsMarketVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
Page<MpsMarketVo> result = baseMapper.selectPageMpsMarketList(pageQuery.build(), lqw);
result.getRecords().forEach(r -> r.setMagneticCardList(magneticcardMapper.selectVoList(new LambdaQueryWrapper<MpsMagneticcard>().eq(MpsMagneticcard::getMagneticCardId, r.getMagneticCardId()))));
result.getRecords().forEach(r -> r.setTrafficList(TrafficMapper.selectVoList(new LambdaQueryWrapper<MpsTraffic>().eq(MpsTraffic::getTrafficId, r.getTrafficId()))));
result.getRecords().forEach(r -> {
if (r.getMagneticCardId() != null) {
r.setMagneticCardList(magneticcardMapper.selectVoList(
new LambdaQueryWrapper<MpsMagneticcard>()
.eq(MpsMagneticcard::getMagneticCardId, r.getMagneticCardId())
));
}
if (r.getTrafficId() != null) {
r.setTrafficList(TrafficMapper.selectVoList(
new LambdaQueryWrapper<MpsTraffic>()
.eq(MpsTraffic::getTrafficId, r.getTrafficId())
));
}
});
// result.getRecords().forEach(r -> r.setTrafficList(TrafficMapper.selectVoList(new LambdaQueryWrapper<MpsTraffic>().eq(MpsTraffic::getTrafficId, r.getTrafficId()))));
return TableDataInfo.build(result);
}
@ -192,21 +205,21 @@ public class MpsMarketServiceImpl implements IMpsMarketService {
*/
private void validEntityBeforeAdd(MpsMarket entity){
//TODO 做一些数据校验,如唯一约束,非空校验
if (StringUtils.isEmpty(entity.getSubcategoryName())) {
throw new ServiceException("请填写业务子类名称");
}
if (null == entity.getSubcategoryId()) {
throw new ServiceException("请填写业务子类ID");
}
if (StringUtils.isEmpty(entity.getJbName())) {
throw new ServiceException("请填写经办人员名称");
}
if (StringUtils.isEmpty(entity.getJbId())) {
throw new ServiceException("请填写经办人员ID");
}
if (entity.getDate() == null) {
throw new ServiceException("请填写日期");
}
// if (StringUtils.isEmpty(entity.getSubcategoryName())) {
// throw new ServiceException("请填写业务子类名称");
// }
// if (null == entity.getSubcategoryId()) {
// throw new ServiceException("请填写业务子类ID");
// }
// if (StringUtils.isEmpty(entity.getJbName())) {
// throw new ServiceException("请填写经办人员名称");
// }
// if (StringUtils.isEmpty(entity.getJbId())) {
// throw new ServiceException("请填写经办人员ID");
// }
// if (entity.getDate() == null) {
// throw new ServiceException("请填写日期");
// }
//判重
//客户类型1-个人2-对公
//个人判断身份证号对公判断账户号