【开发】 国际研讨会邀请码的非必填
This commit is contained in:
@@ -402,7 +402,7 @@ export default {
|
||||
validateInviteCode: {
|
||||
invitationCode: {
|
||||
rules: [
|
||||
{required: true, validator: this.validateCode}
|
||||
{required: false, validator: this.validateCode}
|
||||
],
|
||||
validateTrigger: ['blur']
|
||||
},
|
||||
@@ -791,19 +791,15 @@ export default {
|
||||
* 校验邀请码
|
||||
* */
|
||||
validateCode(rule, value, callback) {
|
||||
if (value === null || value === '' || value === undefined) {
|
||||
callback(new Error('请输入邀请码'))
|
||||
let codeObj = this.form.getFieldsValue(['cooperativeInvitationCode', 'vipInvitationCode', 'speakerInvitationCode', 'guestInvitationCode'])
|
||||
let codeArr = Object.values(codeObj)
|
||||
codeArr = codeArr.filter(item => item !== undefined)
|
||||
console.log('codearr', codeArr)
|
||||
// 校验是否重复
|
||||
if (value && isRepeat(codeArr)) {
|
||||
callback('请填写不同的邀请码!')
|
||||
} else {
|
||||
let codeObj = this.form.getFieldsValue(['cooperativeInvitationCode', 'vipInvitationCode', 'speakerInvitationCode', 'guestInvitationCode'])
|
||||
let codeArr = Object.values(codeObj)
|
||||
codeArr = codeArr.filter(item => item !== undefined)
|
||||
console.log('codearr', codeArr)
|
||||
// 校验是否重复
|
||||
if (isRepeat(codeArr)) {
|
||||
callback('请填写不同的邀请码!')
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
callback()
|
||||
}
|
||||
},
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user