2023-11-26 12:02:08 +00:00
|
|
|
|
<template>
|
|
|
|
|
<div v-loading="loading">
|
|
|
|
|
<div class="flex items-start justify-between">
|
|
|
|
|
<div>
|
|
|
|
|
<!-- 左上:客户基本信息 -->
|
2023-11-30 13:42:49 +08:00
|
|
|
|
<el-col>
|
|
|
|
|
<el-row>
|
|
|
|
|
<span class="text-xl font-bold">{{ customer.name }}</span>
|
|
|
|
|
</el-row>
|
|
|
|
|
</el-col>
|
2023-11-26 12:02:08 +00:00
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<!-- 右上:按钮 -->
|
2024-01-03 19:38:55 +08:00
|
|
|
|
<el-button
|
|
|
|
|
type="primary"
|
|
|
|
|
v-hasPermi="['crm:customer:update']"
|
|
|
|
|
@click="openForm(customer.id)"
|
|
|
|
|
>
|
2023-11-26 12:02:08 +00:00
|
|
|
|
编辑
|
|
|
|
|
</el-button>
|
2024-01-03 19:38:55 +08:00
|
|
|
|
<!-- TODO @puhui999:转移的操作接入 -->
|
|
|
|
|
<el-button type="primary" @click="transfer">转移</el-button>
|
|
|
|
|
<!-- TODO @puhui999:修改成交状态的接入 -->
|
2023-11-26 12:02:08 +00:00
|
|
|
|
<el-button>更改成交状态</el-button>
|
2024-01-03 19:38:55 +08:00
|
|
|
|
<el-button v-if="customer.lockStatus" @click="handleUnlock(customer.id!)">解锁</el-button>
|
|
|
|
|
<el-button v-else @click="handleLock(customer.id!)">锁定</el-button>
|
2023-11-26 12:02:08 +00:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<ContentWrap class="mt-10px">
|
|
|
|
|
<el-descriptions :column="5" direction="vertical">
|
|
|
|
|
<el-descriptions-item label="客户级别">
|
|
|
|
|
<dict-tag :type="DICT_TYPE.CRM_CUSTOMER_LEVEL" :value="customer.level" />
|
|
|
|
|
</el-descriptions-item>
|
|
|
|
|
<el-descriptions-item label="成交状态">
|
|
|
|
|
{{ customer.dealStatus ? '已成交' : '未成交' }}
|
|
|
|
|
</el-descriptions-item>
|
2023-12-14 18:19:34 +08:00
|
|
|
|
<el-descriptions-item label="负责人">{{ customer.ownerUserName }}</el-descriptions-item>
|
2023-11-26 12:02:08 +00:00
|
|
|
|
<!-- TODO wanwan 首要联系人? -->
|
|
|
|
|
<el-descriptions-item label="首要联系人" />
|
|
|
|
|
<!-- TODO wanwan 首要联系人电话? -->
|
2023-12-14 18:19:34 +08:00
|
|
|
|
<el-descriptions-item label="首要联系人电话">{{ customer.mobile }}</el-descriptions-item>
|
2023-11-26 12:02:08 +00:00
|
|
|
|
</el-descriptions>
|
|
|
|
|
</ContentWrap>
|
|
|
|
|
|
|
|
|
|
<!-- 表单弹窗:添加/修改 -->
|
|
|
|
|
<CustomerForm ref="formRef" @success="emit('refresh')" />
|
|
|
|
|
</template>
|
2023-12-14 18:19:34 +08:00
|
|
|
|
<script lang="ts" setup>
|
2023-11-26 12:02:08 +00:00
|
|
|
|
import { DICT_TYPE } from '@/utils/dict'
|
2023-11-30 13:42:49 +08:00
|
|
|
|
import * as CustomerApi from '@/api/crm/customer'
|
|
|
|
|
import CustomerForm from '../CustomerForm.vue'
|
2023-11-26 12:02:08 +00:00
|
|
|
|
|
2023-12-14 18:19:34 +08:00
|
|
|
|
defineOptions({ name: 'CustomerDetailsHeader' })
|
|
|
|
|
|
2023-11-26 20:18:33 +08:00
|
|
|
|
const { customer, loading } = defineProps<{
|
2023-11-30 13:42:49 +08:00
|
|
|
|
customer: CustomerApi.CustomerVO // 客户信息
|
|
|
|
|
loading: boolean // 加载中
|
2023-11-26 20:18:33 +08:00
|
|
|
|
}>()
|
2024-01-03 19:38:55 +08:00
|
|
|
|
const message = useMessage() // 消息弹窗
|
2023-11-26 12:02:08 +00:00
|
|
|
|
|
2023-11-26 20:18:33 +08:00
|
|
|
|
/** 修改操作 */
|
2023-11-26 12:02:08 +00:00
|
|
|
|
const formRef = ref()
|
2023-11-26 20:18:33 +08:00
|
|
|
|
const openForm = (id?: number) => {
|
|
|
|
|
formRef.value.open('update', id)
|
|
|
|
|
}
|
2023-11-26 12:02:08 +00:00
|
|
|
|
|
2024-01-03 19:38:55 +08:00
|
|
|
|
/** 锁定操作 */
|
|
|
|
|
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')
|
|
|
|
|
}
|
|
|
|
|
|
2023-11-26 12:02:08 +00:00
|
|
|
|
const emit = defineEmits(['refresh']) // 定义 success 事件,用于操作成功后的回调
|
|
|
|
|
</script>
|