|
@@ -80,7 +80,7 @@
|
|
<div v-for="(item, index) in contactCopy" :key="index" class="contactItemCard">
|
|
<div v-for="(item, index) in contactCopy" :key="index" class="contactItemCard">
|
|
<div class="d-flex justify-space-between pb-2">
|
|
<div class="d-flex justify-space-between pb-2">
|
|
<div class="mb-3 pl-3" style="font-size: 13px; color: 00897B; border-left: 5px solid #00897B;">{{ index ? '联系人' + index : '管理员' }}</div>
|
|
<div class="mb-3 pl-3" style="font-size: 13px; color: 00897B; border-left: 5px solid #00897B;">{{ index ? '联系人' + index : '管理员' }}</div>
|
|
- <v-btn v-if="index" color="error" density="compact" variant="text" @click="delContact(index)">删除</v-btn>
|
|
|
|
|
|
+ <v-btn v-if="index > 1" color="error" density="compact" variant="text" @click="delContact(index)">删除</v-btn>
|
|
<div v-else style="font-size: 12px; color: #999">不可删除</div>
|
|
<div v-else style="font-size: 12px; color: #999">不可删除</div>
|
|
</div>
|
|
</div>
|
|
<TextUI v-model="item.contactName" :item="{...contactNameObj}"></TextUI>
|
|
<TextUI v-model="item.contactName" :item="{...contactNameObj}"></TextUI>
|
|
@@ -111,6 +111,7 @@ import { checkCompanyEmail } from '@/utils/validate'
|
|
import { getBusinessLicenseOCR } from '@/api/common'
|
|
import { getBusinessLicenseOCR } from '@/api/common'
|
|
import Confirm from '@/plugins/confirm'
|
|
import Confirm from '@/plugins/confirm'
|
|
import TextUI from '@/components/FormUI/TextInput'
|
|
import TextUI from '@/components/FormUI/TextInput'
|
|
|
|
+import { findFirstDuplicateWithIndices } from '@/utils/dealData'
|
|
|
|
|
|
const { t } = useI18n()
|
|
const { t } = useI18n()
|
|
const CtFormRef = ref()
|
|
const CtFormRef = ref()
|
|
@@ -341,6 +342,7 @@ 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 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) {
|
|
@@ -356,6 +358,7 @@ const contactSubmit = () => {
|
|
falseValueIndex = index
|
|
falseValueIndex = index
|
|
falseKey = 'compareFalse'
|
|
falseKey = 'compareFalse'
|
|
}
|
|
}
|
|
|
|
+ if (e.email) emailList.push(e.email)
|
|
})
|
|
})
|
|
const textList = {
|
|
const textList = {
|
|
contactName: '姓名',
|
|
contactName: '姓名',
|
|
@@ -374,13 +377,21 @@ const contactSubmit = () => {
|
|
}
|
|
}
|
|
Confirm(t('common.confirmTitle'), text, { hideCancelBtn: true })
|
|
Confirm(t('common.confirmTitle'), text, { hideCancelBtn: true })
|
|
return
|
|
return
|
|
- }
|
|
|
|
|
|
+ }
|
|
|
|
+ // 邮箱不能相同
|
|
|
|
+ const duplicates = findFirstDuplicateWithIndices(emailList)
|
|
|
|
+ if (duplicates) {
|
|
|
|
+ let text = duplicates.firstIndex ? `联系人${duplicates.firstIndex}的企业邮箱和联系人${duplicates.secondIndex}的企业邮箱重复,请修改!` : `管理员的企业邮箱和联系人${duplicates.secondIndex}的企业邮箱重复,请修改!`
|
|
|
|
+ Confirm(t('common.confirmTitle'), text, { hideCancelBtn: true })
|
|
|
|
+ return
|
|
|
|
+ }
|
|
contactList = [...contactCopy.value]
|
|
contactList = [...contactCopy.value]
|
|
showContactList.value = false
|
|
showContactList.value = false
|
|
saveRegisterInfo()
|
|
saveRegisterInfo()
|
|
}
|
|
}
|
|
const handleAddContact = () => {
|
|
const handleAddContact = () => {
|
|
contactCopy.value = [...contactList]
|
|
contactCopy.value = [...contactList]
|
|
|
|
+ if (contactCopy.value?.length < 2) addMore() // 至少填写两个联系人
|
|
showContactList.value = true
|
|
showContactList.value = true
|
|
}
|
|
}
|
|
const addMore = () => {
|
|
const addMore = () => {
|