diff --git a/apps/web-antd/src/views/crm/business/modules/detail-form.vue b/apps/web-antd/src/views/crm/business/modules/detail-list-modal.vue similarity index 81% rename from apps/web-antd/src/views/crm/business/modules/detail-form.vue rename to apps/web-antd/src/views/crm/business/modules/detail-list-modal.vue index 4fc7fdf72..61f21b893 100644 --- a/apps/web-antd/src/views/crm/business/modules/detail-form.vue +++ b/apps/web-antd/src/views/crm/business/modules/detail-list-modal.vue @@ -2,11 +2,12 @@ import type { VxeTableGridOptions } from '#/adapter/vxe-table'; import type { CrmBusinessApi } from '#/api/crm/business'; +import { ref } from 'vue'; import { useRouter } from 'vue-router'; import { useVbenModal } from '@vben/common-ui'; -import { Button } from 'ant-design-vue'; +import { Button, message } from 'ant-design-vue'; import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; import { getBusinessPageByCustomer } from '#/api/crm/business'; @@ -28,6 +29,11 @@ const [FormModal, formModalApi] = useVbenModal({ destroyOnClose: true, }); +const checkedRows = ref([]); +function setCheckedRows({ records }: { records: CrmBusinessApi.Business[] }) { + checkedRows.value = records; +} + /** 刷新表格 */ function onRefresh() { gridApi.query(); @@ -50,22 +56,20 @@ function handleCustomerDetail(row: CrmBusinessApi.Business) { const [Modal, modalApi] = useVbenModal({ async onConfirm() { - // const { valid } = await formApi.validate(); - // if (!valid) { - // return; - // } - // modalApi.lock(); - // // 提交表单 - // const data = (await formApi.getValues()) as CrmBusinessApi.Business; - // try { - // await (formData.value?.id ? updateBusiness(data) : createBusiness(data)); - // // 关闭并提示 - // await modalApi.close(); - emit('success'); - // message.success($t('ui.actionMessage.operationSuccess')); - // } finally { - // modalApi.unlock(); - // } + if (checkedRows.value.length === 0) { + message.error('请先选择商机后操作!'); + return; + } + modalApi.lock(); + // 提交表单 + try { + const businessIds = checkedRows.value.map((item) => item.id); + // 关闭并提示 + await modalApi.close(); + emit('success', businessIds, checkedRows.value); + } finally { + modalApi.unlock(); + } }, async onOpenChange(isOpen: boolean) { if (!isOpen) { @@ -120,6 +124,10 @@ const [Grid, gridApi] = useVbenVxeGrid({ search: true, }, } as VxeTableGridOptions, + gridEvents: { + checkboxAll: setCheckedRows, + checkboxChange: setCheckedRows, + }, }); diff --git a/apps/web-antd/src/views/crm/business/modules/detail-list.vue b/apps/web-antd/src/views/crm/business/modules/detail-list.vue index e63eb3abd..c4f41745d 100644 --- a/apps/web-antd/src/views/crm/business/modules/detail-list.vue +++ b/apps/web-antd/src/views/crm/business/modules/detail-list.vue @@ -1,6 +1,7 @@ + + diff --git a/apps/web-antd/src/views/crm/contact/modules/detail-list-modal.vue b/apps/web-antd/src/views/crm/contact/modules/detail-list-modal.vue new file mode 100644 index 000000000..f816d64a4 --- /dev/null +++ b/apps/web-antd/src/views/crm/contact/modules/detail-list-modal.vue @@ -0,0 +1,163 @@ + + + diff --git a/apps/web-antd/src/views/crm/contact/modules/detail-list.vue b/apps/web-antd/src/views/crm/contact/modules/detail-list.vue index 1f5fe358f..a68a7129d 100644 --- a/apps/web-antd/src/views/crm/contact/modules/detail-list.vue +++ b/apps/web-antd/src/views/crm/contact/modules/detail-list.vue @@ -1,4 +1,205 @@ - + + diff --git a/apps/web-antd/src/views/crm/contact/modules/detail.vue b/apps/web-antd/src/views/crm/contact/modules/detail.vue index 99ad6b6f9..1822f6e7e 100644 --- a/apps/web-antd/src/views/crm/contact/modules/detail.vue +++ b/apps/web-antd/src/views/crm/contact/modules/detail.vue @@ -1,7 +1,172 @@ - + diff --git a/apps/web-antd/src/views/crm/customer/modules/detail.vue b/apps/web-antd/src/views/crm/customer/modules/detail.vue index 8dd608ed6..6537f2447 100644 --- a/apps/web-antd/src/views/crm/customer/modules/detail.vue +++ b/apps/web-antd/src/views/crm/customer/modules/detail.vue @@ -21,6 +21,10 @@ const CustomerDetailsInfo = defineAsyncComponent( () => import('./detail-info.vue'), ); +const ContactDetailsList = defineAsyncComponent( + () => import('#/views/crm/contact/modules/detail-list.vue'), +); + const CustomerForm = defineAsyncComponent( () => import('#/views/crm/customer/modules/form.vue'), ); @@ -221,14 +225,18 @@ onMounted(async () => { - + -
联系人
+