📖 CRM:【客户】微调客户列表界面

This commit is contained in:
YunaiV 2024-01-03 19:38:55 +08:00
parent 7448f6e08c
commit 4fbb3b88e6
5 changed files with 36 additions and 5 deletions

View File

@ -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 } })
}

View File

@ -75,7 +75,7 @@ defineOptions({ name: 'CrmBusinessList' })
const props = defineProps<{
bizType: number //
bizId: number //
customerId: number // customerId
customerId?: number // customerId
}>()
const loading = ref(true) //

View File

@ -11,11 +11,19 @@
</div>
<div>
<!-- 右上按钮 -->
<el-button v-hasPermi="['crm:customer:update']" @click="openForm(customer.id)">
<el-button
type="primary"
v-hasPermi="['crm:customer:update']"
@click="openForm(customer.id)"
>
编辑
</el-button>
<el-button @click="transfer">转移</el-button>
<!-- TODO @puhui999转移的操作接入 -->
<el-button type="primary" @click="transfer">转移</el-button>
<!-- TODO @puhui999修改成交状态的接入 -->
<el-button>更改成交状态</el-button>
<el-button v-if="customer.lockStatus" @click="handleUnlock(customer.id!)">解锁</el-button>
<el-button v-else @click="handleLock(customer.id!)">锁定</el-button>
</div>
</div>
</div>
@ -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
</script>

View File

@ -17,6 +17,7 @@
/>
</el-select>
</el-form-item>
<!-- TODO @puhui999编辑时level 没带过来 -->
<el-form-item label="权限级别" prop="level">
<el-radio-group v-model="formData.level">
<template

View File

@ -24,6 +24,7 @@
:stripe="true"
@selection-change="handleSelectionChange"
>
<!-- TODO @puhui999负责人不允许选中 -->
<el-table-column type="selection" width="55" />
<el-table-column align="center" label="姓名" prop="nickname" />
<el-table-column align="center" label="部门" prop="deptName" />