当前位置: 首页> 教育> 高考 > 电话销售系统_长沙一日游最佳方案_网络推广seo是什么_百度搜索排名怎么靠前

电话销售系统_长沙一日游最佳方案_网络推广seo是什么_百度搜索排名怎么靠前

时间:2025/7/12 15:33:20来源:https://blog.csdn.net/Roy__Jason/article/details/147590232 浏览次数:0次
电话销售系统_长沙一日游最佳方案_网络推广seo是什么_百度搜索排名怎么靠前

文号验证-同时对两个输入框验证

效果:

在这里插入图片描述
在这里插入图片描述

一、如果有多个文号:

<div v-for="(item, index) in approvalForm.productApprovalTypeEvents" :key="index">
<el-form-itemlabel="文号":prop="'productApprovalTypeEvents.' + index":rules="rules.combinedRule"
>证监许可〔<el-input v-model="item.noOne" style="width: 30%" clearable @input="handleInputNum($event, 'noOne', index)"></el-input><el-input v-model="item.noTwo" style="width: 30%" clearable @input="handleInputNum($event, 'noTwo', index)"></el-input></el-form-item>
</div>
rules: {combinedRule: [{ required: true, message: '无效证监许可号', trigger: 'blur' },{ validator: combinedRuleValidator, trigger: 'blur' },],
}function combinedRuleValidator(rule: any, value: any, callback: any) {// 获取当前表单项对应的对象// console.log(value, 'valueeee');const noOne = value.noOne;const noTwo = value.noTwo;if (!noOne || !noTwo) {callback(new Error('无效证监许可号'));} else {callback();}
}
// 证监许可号
function handleInputNum(val: string, field: string, fIndex: number) {state.approvalForm.productApprovalTypeEvents[fIndex][field] = val.replace(/\D/g, '');
}

二、单个文号:

<el-form-itemv-if="sendInfoForm.apvlFileType == '1' || sendInfoForm.apvlFileType == '2'":label="sendInfoForm.apvlFileType == '1' ? '批复文号' : sendInfoForm.apvlFileType == '2' ? '变更批复文号' : '文号'"prop="noOne":rules="rules.combinedRule"
>证监许可〔<el-inputv-model="sendInfoForm.noOne"style="width: 35% !important"clearable@input="handleInputNum($event, 'noOne')"></el-input><el-input v-model="sendInfoForm.noTwo" style="width: 34% !important" clearable @input="handleInputNum($event, 'noTwo')"></el-input></el-form-item>
rules:{combinedRule: [{ required: true, message: '无效证监许可号', trigger: ['blur', 'change'] },{ validator: combinedRuleValidator, trigger: 'blur' },],
}
function combinedRuleValidator(rule: any, value: any, callback: any) {if (!state.sendInfoForm.noOne && !state.sendInfoForm.noTwo) {callback(new Error('无效证监许可号'));} else if (!state.sendInfoForm.noOne) {callback(new Error('无效证监许可号'));} else if (!state.sendInfoForm.noTwo) {callback(new Error('无效证监许可号'));} else {callback();}
}
// 证监许可号
function handleInputNum(val: string, field: string) {state.sendInfoForm[field] = val.replace(/\D/g, '');
}
关键字:电话销售系统_长沙一日游最佳方案_网络推广seo是什么_百度搜索排名怎么靠前

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: