Skip to content

Commit 4fbb3b8

Browse files
committed
📖 CRM:【客户】微调客户列表界面
1 parent 7448f6e commit 4fbb3b8

File tree

5 files changed

+36
-5
lines changed

5 files changed

+36
-5
lines changed

src/api/crm/customer/index.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export const deleteCustomer = async (id: number) => {
5959
}
6060

6161
// 导出客户 Excel
62-
export const exportCustomer = async (params) => {
62+
export const exportCustomer = async (params: any) => {
6363
return await request.download({ url: `/crm/customer/export-excel`, params })
6464
}
6565

@@ -69,6 +69,11 @@ export const queryAllList = async () => {
6969
}
7070

7171
// 查询客户操作日志
72-
export const getOperateLogPage = async (params) => {
72+
export const getOperateLogPage = async (params: any) => {
7373
return await request.get({ url: '/crm/customer/operate-log-page', params })
7474
}
75+
76+
// 锁定/解锁客户
77+
export const lockCustomer = async (id: number, lockStatus: boolean) => {
78+
return await request.put({ url: `/crm/customer/lock`, data: { id, lockStatus } })
79+
}

src/views/crm/business/components/BusinessList.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ defineOptions({ name: 'CrmBusinessList' })
7575
const props = defineProps<{
7676
bizType: number // 业务类型
7777
bizId: number // 业务编号
78-
customerId: number // 关联联系人与商机时,需要传入 customerId 进行筛选
78+
customerId?: number // 关联联系人与商机时,需要传入 customerId 进行筛选
7979
}>()
8080
8181
const loading = ref(true) // 列表的加载中

src/views/crm/customer/detail/CustomerDetailsHeader.vue

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,19 @@
1111
</div>
1212
<div>
1313
<!-- 右上:按钮 -->
14-
<el-button v-hasPermi="['crm:customer:update']" @click="openForm(customer.id)">
14+
<el-button
15+
type="primary"
16+
v-hasPermi="['crm:customer:update']"
17+
@click="openForm(customer.id)"
18+
>
1519
编辑
1620
</el-button>
17-
<el-button @click="transfer">转移</el-button>
21+
<!-- TODO @puhui999:转移的操作接入 -->
22+
<el-button type="primary" @click="transfer">转移</el-button>
23+
<!-- TODO @puhui999:修改成交状态的接入 -->
1824
<el-button>更改成交状态</el-button>
25+
<el-button v-if="customer.lockStatus" @click="handleUnlock(customer.id!)">解锁</el-button>
26+
<el-button v-else @click="handleLock(customer.id!)">锁定</el-button>
1927
</div>
2028
</div>
2129
</div>
@@ -49,12 +57,28 @@ const { customer, loading } = defineProps<{
4957
customer: CustomerApi.CustomerVO // 客户信息
5058
loading: boolean // 加载中
5159
}>()
60+
const message = useMessage() // 消息弹窗
5261
5362
/** 修改操作 */
5463
const formRef = ref()
5564
const openForm = (id?: number) => {
5665
formRef.value.open('update', id)
5766
}
5867
68+
/** 锁定操作 */
69+
const handleLock = async (id: number) => {
70+
await CustomerApi.lockCustomer(id, true)
71+
message.success('锁定成功')
72+
emit('refresh')
73+
}
74+
75+
/** 解锁操作 */
76+
const handleUnlock = async (id: number) => {
77+
console.log(customer, '=======')
78+
await CustomerApi.lockCustomer(id, false)
79+
message.success('解锁成功')
80+
emit('refresh')
81+
}
82+
5983
const emit = defineEmits(['refresh']) // 定义 success 事件,用于操作成功后的回调
6084
</script>

src/views/crm/permission/components/PermissionForm.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
/>
1818
</el-select>
1919
</el-form-item>
20+
<!-- TODO @puhui999:编辑时,level 没带过来 -->
2021
<el-form-item label="权限级别" prop="level">
2122
<el-radio-group v-model="formData.level">
2223
<template

src/views/crm/permission/components/PermissionList.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
:stripe="true"
2525
@selection-change="handleSelectionChange"
2626
>
27+
<!-- TODO @puhui999:负责人不允许选中 -->
2728
<el-table-column type="selection" width="55" />
2829
<el-table-column align="center" label="姓名" prop="nickname" />
2930
<el-table-column align="center" label="部门" prop="deptName" />

0 commit comments

Comments
 (0)