const actualPhones = contactAdd?.contact_phone?.filter(item => !!item);
const uniquePhones = Array.from(new Set(actualPhones));
if (actualPhones?.length !== uniquePhones?.length) {
message.error('您填写了重复的联系电话');
return;
}
let existing = [];
const contactList = log?.contact;
if (contact?.length > 0) {
contactList.map(item => {
if (item?.contact_phone?.length > 0) {
const data = item?.contact_phone?.filter(el => !!el);
existing = [...existing, ...data];
}
return item;
});
}
const existingPhones = new Set(existing);
if (uniquePhones?.some(item => existingPhones?.has(item))) {
message.error('联系电话与其他联系人的电话重复');
return;
}