From 201f052fabe30fa77ed97ad0736f88cbd5860c1a Mon Sep 17 00:00:00 2001 From: xingyu4j Date: Thu, 26 Jun 2025 17:57:18 +0800 Subject: [PATCH 1/7] fix: bugs --- apps/web-antd/src/views/crm/receivable/data.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web-antd/src/views/crm/receivable/data.ts b/apps/web-antd/src/views/crm/receivable/data.ts index 1cfe422c5..648b24393 100644 --- a/apps/web-antd/src/views/crm/receivable/data.ts +++ b/apps/web-antd/src/views/crm/receivable/data.ts @@ -78,7 +78,7 @@ export function useFormSchema(): VbenFormSchema[] { options: contracts.map((item) => ({ label: item.name, value: item.id, - disabled: item.auditStatus === 20, + disabled: item.auditStatus !== 20, })), placeholder: '请选择合同', } as any; From 07f87dfe22589ca2ee767a11f3f8b37c3c4f1b00 Mon Sep 17 00:00:00 2001 From: xingyu4j Date: Thu, 26 Jun 2025 18:10:47 +0800 Subject: [PATCH 2/7] fix: customer --- .../src/views/crm/customer/modules/detail.vue | 77 +++++++++++++++---- 1 file changed, 63 insertions(+), 14 deletions(-) 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 9a3452ae9..74d7081f9 100644 --- a/apps/web-antd/src/views/crm/customer/modules/detail.vue +++ b/apps/web-antd/src/views/crm/customer/modules/detail.vue @@ -10,7 +10,13 @@ import { useTabs } from '@vben/hooks'; import { Button, Card, message, Tabs } from 'ant-design-vue'; -import { getCustomer, updateCustomerDealStatus } from '#/api/crm/customer'; +import { + getCustomer, + lockCustomer, + putCustomerPool, + receiveCustomer, + updateCustomerDealStatus, +} from '#/api/crm/customer'; import { getOperateLogPage } from '#/api/crm/operateLog'; import { BizTypeEnum } from '#/api/crm/permission'; import { useDescription } from '#/components/description'; @@ -99,18 +105,45 @@ function handleTransfer() { } /** 锁定客户 */ -function handleLock() { - transferModalApi.setData({ id: customerId.value }).open(); -} - -/** 解锁客户 */ -function handleUnlock() { - transferModalApi.setData({ id: customerId.value }).open(); +function handleLock(lockStatus: boolean): Promise { + return new Promise((resolve, reject) => { + confirm({ + content: `确定锁定客户【${customer.value.name}】吗?`, + }) + .then(async () => { + const res = await lockCustomer(customerId.value, lockStatus); + if (res) { + message.success(lockStatus ? '锁定客户成功' : '解锁客户成功'); + resolve(true); + } else { + reject(new Error(lockStatus ? '锁定客户失败' : '解锁客户失败')); + } + }) + .catch(() => { + reject(new Error('取消操作')); + }); + }); } /** 领取客户 */ -function handleReceive() { - transferModalApi.setData({ id: customerId.value }).open(); +function handleReceive(): Promise { + return new Promise((resolve, reject) => { + confirm({ + content: `确定领取客户【${customer.value.name}】吗?`, + }) + .then(async () => { + const res = await receiveCustomer([customerId.value]); + if (res) { + message.success('领取客户成功'); + resolve(true); + } else { + reject(new Error('领取客户失败')); + } + }) + .catch(() => { + reject(new Error('取消操作')); + }); + }); } /** 分配客户 */ @@ -119,8 +152,24 @@ function handleDistributeForm() { } /** 客户放入公海 */ -function handlePutPool() { - transferModalApi.setData({ id: customerId.value }).open(); +function handlePutPool(): Promise { + return new Promise((resolve, reject) => { + confirm({ + content: `确定将客户【${customer.value.name}】放入公海吗?`, + }) + .then(async () => { + const res = await putCustomerPool(customerId.value); + if (res) { + message.success('放入公海成功'); + resolve(true); + } else { + reject(new Error('放入公海失败')); + } + }) + .catch(() => { + reject(new Error('取消操作')); + }); + }); } /** 更新成交状态操作 */ @@ -185,13 +234,13 @@ onMounted(() => { From 6299128a1e3f77e9eaff9459478cb33220d6449e Mon Sep 17 00:00:00 2001 From: xingyu4j Date: Thu, 26 Jun 2025 18:21:07 +0800 Subject: [PATCH 3/7] fix: customer detail button --- .../src/views/crm/customer/modules/detail.vue | 114 +++++++++--------- 1 file changed, 58 insertions(+), 56 deletions(-) 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 74d7081f9..b06177b1c 100644 --- a/apps/web-antd/src/views/crm/customer/modules/detail.vue +++ b/apps/web-antd/src/views/crm/customer/modules/detail.vue @@ -8,7 +8,7 @@ import { useRoute, useRouter } from 'vue-router'; import { confirm, Page, useVbenModal } from '@vben/common-ui'; import { useTabs } from '@vben/hooks'; -import { Button, Card, message, Tabs } from 'ant-design-vue'; +import { Card, message, Tabs } from 'ant-design-vue'; import { getCustomer, @@ -21,6 +21,7 @@ import { getOperateLogPage } from '#/api/crm/operateLog'; import { BizTypeEnum } from '#/api/crm/permission'; import { useDescription } from '#/components/description'; import { AsyncOperateLog } from '#/components/operate-log'; +import { ACTION_ICON, TableAction } from '#/components/table-action'; import { BusinessDetailsList } from '#/views/crm/business'; import { ContactDetailsList } from '#/views/crm/contact'; import { ContractDetailsList } from '#/views/crm/contract'; @@ -210,61 +211,62 @@ onMounted(() => { From 3dc4f425457334653ed31c5474e7d32c7f21d1f8 Mon Sep 17 00:00:00 2001 From: xingyu4j Date: Thu, 26 Jun 2025 18:34:10 +0800 Subject: [PATCH 4/7] feat: ai chat style --- .../index/components/conversation/ConversationList.vue | 6 ++++-- apps/web-antd/src/views/ai/chat/index/index.vue | 9 +++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/apps/web-antd/src/views/ai/chat/index/components/conversation/ConversationList.vue b/apps/web-antd/src/views/ai/chat/index/components/conversation/ConversationList.vue index 54c766749..3596bdc87 100644 --- a/apps/web-antd/src/views/ai/chat/index/components/conversation/ConversationList.vue +++ b/apps/web-antd/src/views/ai/chat/index/components/conversation/ConversationList.vue @@ -358,7 +358,9 @@ onMounted(async () => {
@@ -418,7 +420,7 @@ onMounted(async () => {
{ { /> - +
{{ activeConversation?.title ? activeConversation?.title : '对话' }} @@ -565,9 +566,9 @@ onMounted(async () => {
- +