From 04a42bc6d4e247f11d35c03c8b2f32b9e9795b79 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Mon, 19 Feb 2024 22:47:35 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=96=20CRM=EF=BC=9A=E7=BA=BF=E7=B4=A2?= =?UTF-8?q?=E7=9A=84=E8=B7=9F=E8=BF=9B=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/crm/backlog/index.ts | 5 - src/api/crm/clue/index.ts | 9 +- .../ClueFollowList.vue} | 72 +++++++++----- src/views/crm/backlog/components/common.ts | 38 ++++++++ src/views/crm/backlog/index.vue | 95 +++++++++++-------- src/views/crm/clue/detail/index.vue | 4 +- 6 files changed, 153 insertions(+), 70 deletions(-) rename src/views/crm/backlog/{tables/FollowLeads.vue => components/ClueFollowList.vue} (58%) create mode 100644 src/views/crm/backlog/components/common.ts diff --git a/src/api/crm/backlog/index.ts b/src/api/crm/backlog/index.ts index 29f9c4fe..6a5fda3c 100644 --- a/src/api/crm/backlog/index.ts +++ b/src/api/crm/backlog/index.ts @@ -6,11 +6,6 @@ export const getTodayCustomerCount = async () => { return await request.get({ url: '/crm/customer/today-customer-count' }) } -// 2. 获得分配给我的线索数量 -export const getFollowLeadsCount = async () => { - return await request.get({ url: '/crm/clue/follow-leads-count' }) -} - // 3. 获得分配给我的客户数量 export const getFollowCustomerCount = async () => { return await request.get({ url: '/crm/customer/follow-customer-count' }) diff --git a/src/api/crm/clue/index.ts b/src/api/crm/clue/index.ts index 7414ccb0..170f244d 100644 --- a/src/api/crm/clue/index.ts +++ b/src/api/crm/clue/index.ts @@ -68,6 +68,11 @@ export const transferClue = async (data: TransferReqVO) => { } // 线索转化为客户 -export const transformClue = async (ids: number[]) => { - return await request.put({ url: '/crm/clue/transform?ids=' + ids.join(',') }) +export const transformClue = async (id: number) => { + return await request.put({ url: '/crm/clue/transform', params: { id } }) +} + +// 获得分配给我的、待跟进的线索数量 +export const getFollowClueCount = async () => { + return await request.get({ url: '/crm/clue/follow-count' }) } diff --git a/src/views/crm/backlog/tables/FollowLeads.vue b/src/views/crm/backlog/components/ClueFollowList.vue similarity index 58% rename from src/views/crm/backlog/tables/FollowLeads.vue rename to src/views/crm/backlog/components/ClueFollowList.vue index 1ad6f50f..a1d129b8 100644 --- a/src/views/crm/backlog/tables/FollowLeads.vue +++ b/src/views/crm/backlog/components/ClueFollowList.vue @@ -1,5 +1,3 @@ - - - - - - diff --git a/src/views/crm/backlog/components/common.ts b/src/views/crm/backlog/components/common.ts new file mode 100644 index 00000000..d18763aa --- /dev/null +++ b/src/views/crm/backlog/components/common.ts @@ -0,0 +1,38 @@ +/** 跟进状态 */ +export const FOLLOWUP_STATUS = [ + { label: '待跟进', value: false }, + { label: '已跟进', value: true } +] + +/** 归属范围 */ +export const SCENE_TYPES = [ + { label: '我负责的', value: 1 }, + { label: '我参与的', value: 2 }, + { label: '下属负责的', value: 3 } +] + +/** 联系状态 */ +export const CONTACT_STATUS = [ + { label: '今日需联系', value: 1 }, + { label: '已逾期', value: 2 }, + { label: '已联系', value: 3 } +] + +/** 审批状态 */ +export const AUDIT_STATUS = [ + { label: '已审批', value: 20 }, + { label: '待审批', value: 10 } +] + +/** 回款提醒类型 */ +export const RECEIVABLE_REMIND_TYPE = [ + { label: '待回款', value: 1 }, + { label: '已逾期', value: 2 }, + { label: '已回款', value: 3 } +] + +/** 合同过期状态 */ +export const CONTRACT_EXPIRY_TYPE = [ + { label: '即将过期', value: 1 }, + { label: '已过期', value: 2 } +] diff --git a/src/views/crm/backlog/index.vue b/src/views/crm/backlog/index.vue index b78b32c5..9cc88b2c 100644 --- a/src/views/crm/backlog/index.vue +++ b/src/views/crm/backlog/index.vue @@ -5,24 +5,24 @@
{{ item.name }} - +
- - - - - - - - + + + + + + + + @@ -33,15 +33,18 @@ import CheckContract from './tables/CheckContract.vue' import CheckReceivables from './tables/CheckReceivables.vue' import EndContract from './tables/EndContract.vue' import FollowCustomer from './tables/FollowCustomer.vue' -import FollowLeads from './tables/FollowLeads.vue' +import ClueFollowList from './components/ClueFollowList.vue' import PutInPoolRemind from './tables/PutInPoolRemind.vue' import RemindReceivables from './tables/RemindReceivables.vue' import TodayCustomer from './tables/TodayCustomer.vue' +import * as ClueApi from '@/api/crm/clue' -const leftType = ref('todayCustomer') +defineOptions({ name: 'CrmBacklog' }) + +const leftMenu = ref('todayCustomer') const todayCustomerCountRef = ref(0) -const followLeadsCountRef = ref(0) +const clueFollowCount = ref(0) const followCustomerCountRef = ref(0) const putInPoolCustomerRemindCountRef = ref(0) const checkContractCountRef = ref(0) @@ -52,61 +55,75 @@ const endContractCountRef = ref(0) const leftSides = ref([ { name: '今日需联系客户', - infoType: 'todayCustomer', - msgCount: todayCustomerCountRef + menu: 'todayCustomer', + count: todayCustomerCountRef }, { name: '分配给我的线索', - infoType: 'followLeads', - msgCount: followLeadsCountRef + menu: 'clueFollow', + count: clueFollowCount }, { name: '分配给我的客户', - infoType: 'followCustomer', - msgCount: followCustomerCountRef + menu: 'followCustomer', + count: followCustomerCountRef }, { name: '待进入公海的客户', - infoType: 'putInPoolRemind', - msgCount: putInPoolCustomerRemindCountRef + menu: 'putInPoolRemind', + count: putInPoolCustomerRemindCountRef }, { name: '待审核合同', - infoType: 'checkContract', - msgCount: checkContractCountRef + menu: 'checkContract', + count: checkContractCountRef }, { name: '待审核回款', - infoType: 'checkReceivables', - msgCount: checkReceivablesCountRef + menu: 'checkReceivables', + count: checkReceivablesCountRef }, { name: '待回款提醒', - infoType: 'remindReceivables', - msgCount: remindReceivablesCountRef + menu: 'remindReceivables', + count: remindReceivablesCountRef }, { name: '即将到期的合同', - infoType: 'endContract', - msgCount: endContractCountRef + menu: 'endContract', + count: endContractCountRef } ]) /** 侧边点击 */ const sideClick = (item: any) => { - leftType.value = item.infoType + leftMenu.value = item.menu } -/** 加载时读取待办数量 */ +const getCount = () => { + BacklogApi.getTodayCustomerCount().then((count) => (todayCustomerCountRef.value = count)) + ClueApi.getFollowClueCount().then((count) => (clueFollowCount.value = count)) + BacklogApi.getClueFollowListCount().then((count) => (clueFollowCount.value = count)) + BacklogApi.getFollowCustomerCount().then((count) => (followCustomerCountRef.value = count)) + BacklogApi.getPutInPoolCustomerRemindCount().then( + (count) => (putInPoolCustomerRemindCountRef.value = count) + ) + BacklogApi.getCheckContractCount().then((count) => (checkContractCountRef.value = count)) + BacklogApi.getCheckReceivablesCount().then((count) => (checkReceivablesCountRef.value = count)) + BacklogApi.getRemindReceivablePlanCount().then( + (count) => (remindReceivablesCountRef.value = count) + ) + BacklogApi.getEndContractCount().then((count) => (endContractCountRef.value = count)) +} + +/** 激活时 */ +onActivated(async () => { + getCount() +}) + +/** 初始化 */ onMounted(async () => { - BacklogApi.getTodayCustomerCount().then(count => todayCustomerCountRef.value = count) - BacklogApi.getFollowLeadsCount().then(count => followLeadsCountRef.value = count) - BacklogApi.getFollowCustomerCount().then(count => followCustomerCountRef.value = count) - BacklogApi.getPutInPoolCustomerRemindCount().then(count => putInPoolCustomerRemindCountRef.value = count) - BacklogApi.getCheckContractCount().then(count => checkContractCountRef.value = count) - BacklogApi.getCheckReceivablesCount().then(count => checkReceivablesCountRef.value = count) - BacklogApi.getRemindReceivablePlanCount().then(count => remindReceivablesCountRef.value = count) - BacklogApi.getEndContractCount().then(count => endContractCountRef.value = count) + getCount() }) diff --git a/src/views/crm/clue/detail/index.vue b/src/views/crm/clue/detail/index.vue index 142b23f8..ff83aeaf 100644 --- a/src/views/crm/clue/detail/index.vue +++ b/src/views/crm/clue/detail/index.vue @@ -18,7 +18,7 @@ > 转化为客户 - 已转化客户 + 已转化客户 @@ -97,7 +97,7 @@ const transfer = () => { /** 转化为客户 */ const handleTransform = async () => { await message.confirm(`确定将【${clue.value.name}】转化为客户吗?`) - await ClueApi.transformClue([clueId.value]) + await ClueApi.transformClue(clueId.value) message.success(`转化客户【${clue.value.name}】成功`) await getClue() }