录入界面规则完善

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

View File

@ -46,6 +46,7 @@ public class MpsMarketBo extends BaseEntity {
/** /**
* 营销人员名称 * 营销人员名称
*/ */
@NotBlank(message = "营销人员名称不能为空", groups = { AddGroup.class, EditGroup.class })
private String yxName; private String yxName;
/** /**
@ -57,6 +58,7 @@ public class MpsMarketBo extends BaseEntity {
/** /**
* 营销人员营销号 * 营销人员营销号
*/ */
@NotBlank(message = "营销人员营销号不能为空", groups = { AddGroup.class, EditGroup.class })
private String yxId; private String yxId;
/** /**
@ -80,7 +82,7 @@ public class MpsMarketBo extends BaseEntity {
/** /**
* 部门id * 部门id
*/ */
private Integer deptId; private Long deptId;
/** /**
* 客户类型1-个人2-对公 * 客户类型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 List<String> internetChannel;
// private String internetChannel;
/** /**
* 交警处罚决定书 * 交警处罚决定书

View File

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

View File

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