From 4fbb3b88e6f091040f83c55062032073b3187a9b Mon Sep 17 00:00:00 2001 From: YunaiV Date: Wed, 3 Jan 2024 19:38:55 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=96=20CRM=EF=BC=9A=E3=80=90=E5=AE=A2?= =?UTF-8?q?=E6=88=B7=E3=80=91=E5=BE=AE=E8=B0=83=E5=AE=A2=E6=88=B7=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/crm/customer/index.ts | 9 ++++-- .../crm/business/components/BusinessList.vue | 2 +- .../customer/detail/CustomerDetailsHeader.vue | 28 +++++++++++++++++-- .../permission/components/PermissionForm.vue | 1 + .../permission/components/PermissionList.vue | 1 + 5 files changed, 36 insertions(+), 5 deletions(-) diff --git a/src/api/crm/customer/index.ts b/src/api/crm/customer/index.ts index 50eebd64..a025e346 100644 --- a/src/api/crm/customer/index.ts +++ b/src/api/crm/customer/index.ts @@ -59,7 +59,7 @@ export const deleteCustomer = async (id: number) => { } // 导出客户 Excel -export const exportCustomer = async (params) => { +export const exportCustomer = async (params: any) => { return await request.download({ url: `/crm/customer/export-excel`, params }) } @@ -69,6 +69,11 @@ export const queryAllList = async () => { } // 查询客户操作日志 -export const getOperateLogPage = async (params) => { +export const getOperateLogPage = async (params: any) => { return await request.get({ url: '/crm/customer/operate-log-page', params }) } + +// 锁定/解锁客户 +export const lockCustomer = async (id: number, lockStatus: boolean) => { + return await request.put({ url: `/crm/customer/lock`, data: { id, lockStatus } }) +} diff --git a/src/views/crm/business/components/BusinessList.vue b/src/views/crm/business/components/BusinessList.vue index ca7d02c6..65398480 100644 --- a/src/views/crm/business/components/BusinessList.vue +++ b/src/views/crm/business/components/BusinessList.vue @@ -75,7 +75,7 @@ defineOptions({ name: 'CrmBusinessList' }) const props = defineProps<{ bizType: number // 业务类型 bizId: number // 业务编号 - customerId: number // 关联联系人与商机时,需要传入 customerId 进行筛选 + customerId?: number // 关联联系人与商机时,需要传入 customerId 进行筛选 }>() const loading = ref(true) // 列表的加载中 diff --git a/src/views/crm/customer/detail/CustomerDetailsHeader.vue b/src/views/crm/customer/detail/CustomerDetailsHeader.vue index 78f2d652..b8efbe96 100644 --- a/src/views/crm/customer/detail/CustomerDetailsHeader.vue +++ b/src/views/crm/customer/detail/CustomerDetailsHeader.vue @@ -11,11 +11,19 @@
- + 编辑 - 转移 + + 转移 + 更改成交状态 + 解锁 + 锁定
@@ -49,6 +57,7 @@ const { customer, loading } = defineProps<{ customer: CustomerApi.CustomerVO // 客户信息 loading: boolean // 加载中 }>() +const message = useMessage() // 消息弹窗 /** 修改操作 */ const formRef = ref() @@ -56,5 +65,20 @@ const openForm = (id?: number) => { formRef.value.open('update', id) } +/** 锁定操作 */ +const handleLock = async (id: number) => { + await CustomerApi.lockCustomer(id, true) + message.success('锁定成功') + emit('refresh') +} + +/** 解锁操作 */ +const handleUnlock = async (id: number) => { + console.log(customer, '=======') + await CustomerApi.lockCustomer(id, false) + message.success('解锁成功') + emit('refresh') +} + const emit = defineEmits(['refresh']) // 定义 success 事件,用于操作成功后的回调 diff --git a/src/views/crm/permission/components/PermissionForm.vue b/src/views/crm/permission/components/PermissionForm.vue index 5af376cf..fa73b22a 100644 --- a/src/views/crm/permission/components/PermissionForm.vue +++ b/src/views/crm/permission/components/PermissionForm.vue @@ -17,6 +17,7 @@ /> +