|
@@ -350,28 +350,35 @@ if (info && Object.keys(info).length && info.status === '2') {
|
|
const contactSubmit = () => {
|
|
const contactSubmit = () => {
|
|
let falseValueIndex = null
|
|
let falseValueIndex = null
|
|
let falseKey = null
|
|
let falseKey = null
|
|
|
|
+ let phoneList = []
|
|
let emailList = []
|
|
let emailList = []
|
|
contactCopy.value.forEach((e, index) => {
|
|
contactCopy.value.forEach((e, index) => {
|
|
if (falseValueIndex !== null) return
|
|
if (falseValueIndex !== null) return
|
|
if (e && Object.keys(e).length) {
|
|
if (e && Object.keys(e).length) {
|
|
Object.keys(e).forEach(key => {
|
|
Object.keys(e).forEach(key => {
|
|
if (falseValueIndex !== null) return
|
|
if (falseValueIndex !== null) return
|
|
- if (!e[key]) {
|
|
|
|
|
|
+ if (!e[key] ) {
|
|
falseValueIndex = index
|
|
falseValueIndex = index
|
|
falseKey = key
|
|
falseKey = key
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
+ if (e.email && !checkCompanyEmail(e.email)) {
|
|
|
|
+ falseValueIndex = index
|
|
|
|
+ falseKey = 'emailCheck'
|
|
|
|
+ }
|
|
if (e.password && e.passwordConfirm && e.password !== e.passwordConfirm) {
|
|
if (e.password && e.passwordConfirm && e.password !== e.passwordConfirm) {
|
|
falseValueIndex = index
|
|
falseValueIndex = index
|
|
falseKey = 'compareFalse'
|
|
falseKey = 'compareFalse'
|
|
}
|
|
}
|
|
|
|
+ if (e.phone) phoneList.push(e.phone)
|
|
if (e.email) emailList.push(e.email)
|
|
if (e.email) emailList.push(e.email)
|
|
})
|
|
})
|
|
const textList = {
|
|
const textList = {
|
|
contactName: '姓名',
|
|
contactName: '姓名',
|
|
phone: '联系电话',
|
|
phone: '联系电话',
|
|
email: '企业邮箱',
|
|
email: '企业邮箱',
|
|
|
|
+ emailCheck: '企业邮箱格式',
|
|
password: '登录密码',
|
|
password: '登录密码',
|
|
passwordConfirm: '登录密码',
|
|
passwordConfirm: '登录密码',
|
|
}
|
|
}
|
|
@@ -386,10 +393,17 @@ const contactSubmit = () => {
|
|
Confirm(t('common.confirmTitle'), text, { hideCancelBtn: true })
|
|
Confirm(t('common.confirmTitle'), text, { hideCancelBtn: true })
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
+ // 联系电话不能相同
|
|
|
|
+ const phone_duplicates = findFirstDuplicateWithIndices(phoneList)
|
|
|
|
+ if (phone_duplicates) {
|
|
|
|
+ let text = phone_duplicates.firstIndex ? `联系人${phone_duplicates.firstIndex}的联系电话和联系人${phone_duplicates.secondIndex} 的联系电话重复,请修改!` : `管理员的联系电话和联系人${phone_duplicates.secondIndex} 的联系电话重复,请修改!`
|
|
|
|
+ Confirm(t('common.confirmTitle'), text, { hideCancelBtn: true })
|
|
|
|
+ return
|
|
|
|
+ }
|
|
// 邮箱不能相同
|
|
// 邮箱不能相同
|
|
const duplicates = findFirstDuplicateWithIndices(emailList)
|
|
const duplicates = findFirstDuplicateWithIndices(emailList)
|
|
if (duplicates) {
|
|
if (duplicates) {
|
|
- let text = duplicates.firstIndex ? `联系人${duplicates.firstIndex}的企业邮箱和联系人${duplicates.secondIndex}的企业邮箱重复,请修改!` : `管理员的企业邮箱和联系人${duplicates.secondIndex}的企业邮箱重复,请修改!`
|
|
|
|
|
|
+ let text = duplicates.firstIndex ? `联系人${duplicates.firstIndex}的企业邮箱和联系人${duplicates.secondIndex} 的企业邮箱重复,请修改!` : `管理员的企业邮箱和联系人${duplicates.secondIndex} 的企业邮箱重复,请修改!`
|
|
Confirm(t('common.confirmTitle'), text, { hideCancelBtn: true })
|
|
Confirm(t('common.confirmTitle'), text, { hideCancelBtn: true })
|
|
return
|
|
return
|
|
}
|
|
}
|