mirror of
https://gitee.com/hhyykk/ipms-sjy-ui.git
synced 2025-07-17 12:25:07 +08:00
新增客户跟进
This commit is contained in:
@ -1,7 +1,5 @@
|
||||
<template>
|
||||
<CustomerDetailsHeader :customer="customer" :loading="loading">
|
||||
<!-- @puhui999:返回是不是可以去掉哈,貌似用途可能不大 -->
|
||||
<el-button @click="close">返回</el-button>
|
||||
<!-- TODO puhui999: 按钮数据权限收尾统一完善,需要按权限分级和客户状态来动态显示匹配的按钮 -->
|
||||
<el-button v-hasPermi="['crm:customer:update']" type="primary" @click="openForm">
|
||||
编辑
|
||||
@ -12,8 +10,10 @@
|
||||
<el-button>更改成交状态</el-button>
|
||||
<el-button v-if="customer.lockStatus" @click="handleUnlock">解锁</el-button>
|
||||
<el-button v-if="!customer.lockStatus" @click="handleLock">锁定</el-button>
|
||||
<el-button v-if="!customer.ownerUserId" type="primary" @click="receive">领取客户</el-button>
|
||||
<el-button v-if="customer.ownerUserId" @click="putPool">客户放入公海</el-button>
|
||||
<el-button v-if="!customer.ownerUserId" type="primary" @click="handleReceive">
|
||||
领取客户
|
||||
</el-button>
|
||||
<el-button v-if="customer.ownerUserId" @click="handlePutPool">客户放入公海</el-button>
|
||||
</CustomerDetailsHeader>
|
||||
<el-col>
|
||||
<el-tabs>
|
||||
@ -23,6 +23,9 @@
|
||||
<el-tab-pane label="操作日志">
|
||||
<OperateLogV2 :log-list="logList" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="跟进">
|
||||
<FollowUpList :biz-id="customerId" :biz-type="BizTypeEnum.CRM_CUSTOMER" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="联系人" lazy>
|
||||
<ContactList :biz-id="customer.id!" :biz-type="BizTypeEnum.CRM_CUSTOMER" />
|
||||
</el-tab-pane>
|
||||
@ -58,6 +61,7 @@ import BusinessList from '@/views/crm/business/components/BusinessList.vue' //
|
||||
import ReceivableList from '@/views/crm/receivable/components/ReceivableList.vue' // 回款列表
|
||||
import ReceivablePlanList from '@/views/crm/receivable/plan/components/ReceivablePlanList.vue' // 回款计划列表
|
||||
import PermissionList from '@/views/crm/permission/components/PermissionList.vue' // 团队成员列表(权限)
|
||||
import FollowUpList from '@/views/crm/followup/index.vue'
|
||||
import { BizTypeEnum } from '@/api/crm/permission'
|
||||
import type { OperateLogV2VO } from '@/api/system/operatelog'
|
||||
|
||||
@ -67,7 +71,7 @@ const customerId = ref(0) // 客户编号
|
||||
const loading = ref(true) // 加载中
|
||||
const message = useMessage() // 消息弹窗
|
||||
const { delView } = useTagsViewStore() // 视图操作
|
||||
const { currentRoute, push } = useRouter() // 路由
|
||||
const { currentRoute } = useRouter() // 路由
|
||||
|
||||
/** 获取详情 */
|
||||
const customer = ref<CustomerApi.CustomerVO>({} as CustomerApi.CustomerVO) // 客户详情
|
||||
@ -106,9 +110,8 @@ const handleUnlock = async () => {
|
||||
await getCustomer()
|
||||
}
|
||||
|
||||
// TODO @puhui999:下面两个方法的命名,也用 handleXXX 风格哈
|
||||
/** 领取客户 */
|
||||
const receive = async () => {
|
||||
const handleReceive = async () => {
|
||||
await message.confirm(`确定领取客户【${customer.value.name}】 吗?`)
|
||||
await CustomerApi.receive([unref(customerId.value)])
|
||||
message.success(`领取客户【${customer.value.name}】成功`)
|
||||
@ -116,7 +119,7 @@ const receive = async () => {
|
||||
}
|
||||
|
||||
/** 客户放入公海 */
|
||||
const putPool = async () => {
|
||||
const handlePutPool = async () => {
|
||||
await message.confirm(`确定将客户【${customer.value.name}】放入公海吗?`)
|
||||
await CustomerApi.putPool(unref(customerId.value))
|
||||
message.success(`客户【${customer.value.name}】放入公海成功`)
|
||||
@ -135,15 +138,13 @@ const getOperateLog = async () => {
|
||||
|
||||
const close = () => {
|
||||
delView(unref(currentRoute))
|
||||
// TODO 先返回到客户列表
|
||||
push({ name: 'CrmCustomer' })
|
||||
}
|
||||
|
||||
/** 初始化 */
|
||||
const { params } = useRoute()
|
||||
onMounted(() => {
|
||||
if (!params.id) {
|
||||
ElMessage.warning('参数错误,客户不能为空!')
|
||||
message.warning('参数错误,客户不能为空!')
|
||||
close()
|
||||
return
|
||||
}
|
||||
|
@ -100,14 +100,10 @@
|
||||
|
||||
<!-- 列表 -->
|
||||
<ContentWrap>
|
||||
<!-- TODO @puhui999:是不是就 3 重呀,我负责的,我参与的,我下属的 -->
|
||||
<el-tabs v-model="activeName" @tab-click="handleClick">
|
||||
<el-tab-pane label="客户列表" name="1" />
|
||||
<el-tab-pane label="我负责的" name="2" />
|
||||
<el-tab-pane label="我关注的" name="3" />
|
||||
<el-tab-pane label="我参与的" name="4" />
|
||||
<el-tab-pane label="下属负责的" name="5" />
|
||||
<el-tab-pane label="客户公海" name="6" />
|
||||
<el-tab-pane label="我负责的" name="1" />
|
||||
<el-tab-pane label="我参与的" name="2" />
|
||||
<el-tab-pane label="下属负责的" name="3" />
|
||||
</el-tabs>
|
||||
<el-table v-loading="loading" :data="list" :show-overflow-tooltip="true" :stripe="true">
|
||||
<el-table-column align="center" label="编号" prop="id" />
|
||||
@ -149,7 +145,9 @@
|
||||
<dict-tag :type="DICT_TYPE.INFRA_BOOLEAN_STRING" :value="scope.row.dealStatus" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- TODO @puhui999:距进入公海天数 -->
|
||||
<el-table-column align="center" label="距离进入公海" prop="poolDay">
|
||||
<template #default="scope"> {{ scope.row.poolDay }}天</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
:formatter="dateFormatter"
|
||||
align="center"
|
||||
@ -251,43 +249,27 @@ const activeName = ref('1') // 列表 tab
|
||||
|
||||
enum CrmSceneTypeEnum {
|
||||
OWNER = 1,
|
||||
FOLLOW = 2,
|
||||
INVOLVED = 3,
|
||||
SUBORDINATE = 4
|
||||
INVOLVED = 2,
|
||||
SUBORDINATE = 3
|
||||
}
|
||||
|
||||
const handleClick = (tab: TabsPaneContext) => {
|
||||
switch (tab.paneName) {
|
||||
case '1':
|
||||
resetQuery()
|
||||
break
|
||||
case '2':
|
||||
resetQuery(() => {
|
||||
queryParams.value.sceneType = CrmSceneTypeEnum.OWNER
|
||||
})
|
||||
break
|
||||
case '3':
|
||||
resetQuery(() => {
|
||||
queryParams.value.sceneType = CrmSceneTypeEnum.FOLLOW
|
||||
})
|
||||
break
|
||||
// TODO @puhui999:这个貌似报错?
|
||||
case '4':
|
||||
case '2':
|
||||
resetQuery(() => {
|
||||
queryParams.value.sceneType = CrmSceneTypeEnum.INVOLVED
|
||||
})
|
||||
break
|
||||
case '5':
|
||||
case '3':
|
||||
resetQuery(() => {
|
||||
queryParams.value.sceneType = CrmSceneTypeEnum.SUBORDINATE
|
||||
})
|
||||
break
|
||||
// TODO @puhui999:公海单独一个菜单哈。
|
||||
case '6':
|
||||
resetQuery(() => {
|
||||
queryParams.value.pool = true
|
||||
})
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user