diff --git a/src/api/crm/contact/index.ts b/src/api/crm/contact/index.ts index 8bf0b1fe..e16646cc 100644 --- a/src/api/crm/contact/index.ts +++ b/src/api/crm/contact/index.ts @@ -82,11 +82,6 @@ export const getSimpleContactList = async () => { return await request.get({ url: `/crm/contact/simple-all-list` }) } -// 获得 CRM 联系人列表 -export const getContactListByIds = async (val: number[]) => { - return await request.get({ url: '/crm/contact/list-by-ids', params: { ids: val.join(',') } }) -} - // 批量新增联系人商机关联 export const createContactBusinessList = async (data: ContactBusinessReqVO) => { return await request.post({ url: `/crm/contact/create-business-list`, data }) diff --git a/src/views/crm/business/components/BusinessListModal.vue b/src/views/crm/business/components/BusinessListModal.vue index 2832b6ee..3c21f061 100644 --- a/src/views/crm/business/components/BusinessListModal.vue +++ b/src/views/crm/business/components/BusinessListModal.vue @@ -148,7 +148,7 @@ const submitForm = async () => { emit('success', businessIds, businessRef.value.getSelectionRows()) } -/** 打开联系人详情 */ +/** 打开商机详情 */ const { push } = useRouter() const openDetail = (id: number) => { push({ name: 'CrmBusinessDetail', params: { id } }) diff --git a/src/views/crm/contact/components/ContactList.vue b/src/views/crm/contact/components/ContactList.vue index b5974e3d..7de9a3cd 100644 --- a/src/views/crm/contact/components/ContactList.vue +++ b/src/views/crm/contact/components/ContactList.vue @@ -20,7 +20,7 @@ - + diff --git a/src/views/crm/contact/components/ContactListModal.vue b/src/views/crm/contact/components/ContactListModal.vue new file mode 100644 index 00000000..82071896 --- /dev/null +++ b/src/views/crm/contact/components/ContactListModal.vue @@ -0,0 +1,154 @@ + + diff --git a/src/views/crm/followup/FollowUpRecordForm.vue b/src/views/crm/followup/FollowUpRecordForm.vue index 34b7ef8d..eb626f01 100644 --- a/src/views/crm/followup/FollowUpRecordForm.vue +++ b/src/views/crm/followup/FollowUpRecordForm.vue @@ -48,11 +48,11 @@ - + 添加联系人 - + @@ -73,7 +73,11 @@ - + import { DICT_TYPE, getIntDictOptions } from '@/utils/dict' import { FollowUpRecordApi, FollowUpRecordVO } from '@/api/crm/followup' -import { ContactList, ContactTableSelect } from './components' import { BizTypeEnum } from '@/api/crm/permission' import FollowUpRecordBusinessForm from './components/FollowUpRecordBusinessForm.vue' +import FollowUpRecordContactForm from './components/FollowUpRecordContactForm.vue' import BusinessListModal from '@/views/crm/business/components/BusinessListModal.vue' import * as BusinessApi from '@/api/crm/business' +import ContactListModal from '@/views/crm/contact/components/ContactListModal.vue' +import * as ContactApi from '@/api/crm/contact' defineOptions({ name: 'FollowUpRecordForm' }) @@ -128,7 +134,11 @@ const submitForm = async () => { // 提交请求 formLoading.value = true try { - const data = formData.value as unknown as FollowUpRecordVO + const data = { + ...formData.value, + contactIds: formData.value.contacts.map((item) => item.id), + businessIds: formData.value.businesses.map((item) => item.id) + } as unknown as FollowUpRecordVO await FollowUpRecordApi.createFollowUpRecord(data) message.success(t('common.createSuccess')) dialogVisible.value = false @@ -140,10 +150,17 @@ const submitForm = async () => { } /** 关联联系人 */ -const contactTableSelectRef = ref>() -const handleAddContact = () => { +const contactTableSelectRef = ref>() +const handleOpenContact = () => { contactTableSelectRef.value?.open() } +const handleAddContact = (contactId: [], newContacts: ContactApi.ContactVO[]) => { + newContacts.forEach((contact) => { + if (!formData.value.contacts.some((item) => item.id === contact.id)) { + formData.value.contacts.push(contact) + } + }) +} /** 关联商机 */ const businessTableSelectRef = ref>() diff --git a/src/views/crm/followup/components/ContactList.vue b/src/views/crm/followup/components/ContactList.vue deleted file mode 100644 index 5e31718a..00000000 --- a/src/views/crm/followup/components/ContactList.vue +++ /dev/null @@ -1,97 +0,0 @@ - - - diff --git a/src/views/crm/followup/components/ContactTableSelect.vue b/src/views/crm/followup/components/ContactTableSelect.vue deleted file mode 100644 index ded9a6d4..00000000 --- a/src/views/crm/followup/components/ContactTableSelect.vue +++ /dev/null @@ -1,87 +0,0 @@ - - - - diff --git a/src/views/crm/followup/components/FollowUpRecordContactForm.vue b/src/views/crm/followup/components/FollowUpRecordContactForm.vue new file mode 100644 index 00000000..b3b5d3a2 --- /dev/null +++ b/src/views/crm/followup/components/FollowUpRecordContactForm.vue @@ -0,0 +1,47 @@ + + + diff --git a/src/views/crm/followup/components/index.ts b/src/views/crm/followup/components/index.ts deleted file mode 100644 index 6c669fc3..00000000 --- a/src/views/crm/followup/components/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -import ContactList from './ContactList.vue' -import ContactTableSelect from './ContactTableSelect.vue' - -export { ContactList, ContactTableSelect } diff --git a/src/views/crm/followup/index.vue b/src/views/crm/followup/index.vue index f4372627..d0b22716 100644 --- a/src/views/crm/followup/index.vue +++ b/src/views/crm/followup/index.vue @@ -71,14 +71,7 @@