feat: CRM/backlog 提醒数量

This commit is contained in:
dhb52 2024-02-18 00:04:43 +08:00
parent 42b8df4767
commit e067d5073d
2 changed files with 66 additions and 27 deletions

View File

@ -1,17 +1,41 @@
import request from '@/config/axios' import request from '@/config/axios'
import { type CustomerVO } from '../customer' // 1. 获得今日需联系客户数量
import { type ClueVO } from '../clue' export const getTodayCustomerCount = async () => {
return await request.get({ url: '/crm/customer/today-customer-count' })
// 查询客户列表
// TODO @芋艿:看看是不是后续融合到 getCustomerPage 里;
export const getTodayCustomerPage = async (params) => {
return await request.get({ url: `/crm/backlog/today-customer-page`, params })
} }
// 查询线索列表 // 2. 获得分配给我的线索数量
export const getFollowLeadsPage = async (params) => { export const getFollowLeadsCount = async () => {
return await request.get({ url: `/crm/backlog/page`, params }) return await request.get({ url: '/crm/clue/follow-leads-count' })
} }
export { type CustomerVO, type ClueVO } // 3. 获得分配给我的客户数量
export const getFollowCustomerCount = async () => {
return await request.get({ url: '/crm/customer/follow-customer-count' })
}
// 4. 获得待进入公海的客户数量
export const getPutInPoolCustomerRemindCount = async () => {
return await request.get({ url: '/crm/customer/put-in-pool-remind-count' })
}
// 5. 获得待审核合同数量
export const getCheckContractCount = async () => {
return await request.get({ url: '/crm/contract/check-contract-count' })
}
// 6. 获得待审核回款数量
export const getCheckReceivablesCount = async () => {
return await request.get({ url: '/crm/receivable/check-receivables-count' })
}
// 7. 获得待回款提醒数量
export const getRemindReceivablePlanCount = async () => {
return await request.get({ url: '/crm/receivable-plan/remind-receivable-plan-count' })
}
// 8. 获得即将到期的合同数量
export const getEndContractCount = async () => {
return await request.get({ url: '/crm/contract/end-contract-count' })
}

View File

@ -29,6 +29,7 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import * as BacklogApi from '@/api/crm/backlog'
import CheckContract from './tables/CheckContract.vue' import CheckContract from './tables/CheckContract.vue'
import CheckReceivables from './tables/CheckReceivables.vue' import CheckReceivables from './tables/CheckReceivables.vue'
import EndContract from './tables/EndContract.vue' import EndContract from './tables/EndContract.vue'
@ -39,54 +40,56 @@ import RemindReceivables from './tables/RemindReceivables.vue'
import TodayCustomer from './tables/TodayCustomer.vue' import TodayCustomer from './tables/TodayCustomer.vue'
const leftType = ref('todayCustomer') const leftType = ref('todayCustomer')
const todayCustomerCountRef = ref(0)
const followLeadsCountRef = ref(0)
const followCustomerCountRef = ref(0)
const putInPoolCustomerRemindCountRef = ref(0)
const checkContractCountRef = ref(0)
const checkReceivablesCountRef = ref(0)
const remindReceivablesCountRef = ref(0)
const endContractCountRef = ref(0)
const leftSides = ref([ const leftSides = ref([
{ {
name: '今日需联系客户', name: '今日需联系客户',
infoType: 'todayCustomer', infoType: 'todayCustomer',
msgCount: 1, msgCount: todayCustomerCountRef
tips: '下次跟进时间为今日的客户'
}, },
{ {
name: '分配给我的线索', name: '分配给我的线索',
infoType: 'followLeads', infoType: 'followLeads',
msgCount: 0, msgCount: followLeadsCountRef
tips: '转移之后未跟进的线索'
}, },
{ {
name: '分配给我的客户', name: '分配给我的客户',
infoType: 'followCustomer', infoType: 'followCustomer',
msgCount: 0, msgCount: followCustomerCountRef
tips: '转移、领取、分配之后未跟进的客户,默认显示自己负责的客户'
}, },
{ {
name: '待进入公海的客户', name: '待进入公海的客户',
infoType: 'putInPoolRemind', infoType: 'putInPoolRemind',
msgCount: 0, msgCount: putInPoolCustomerRemindCountRef
tips: ''
}, },
{ {
name: '待审核合同', name: '待审核合同',
infoType: 'checkContract', infoType: 'checkContract',
msgCount: 0, msgCount: checkContractCountRef
tips: ''
}, },
{ {
name: '待审核回款', name: '待审核回款',
infoType: 'checkReceivables', infoType: 'checkReceivables',
msgCount: 0, msgCount: checkReceivablesCountRef
tips: ''
}, },
{ {
name: '待回款提醒', name: '待回款提醒',
infoType: 'remindReceivables', infoType: 'remindReceivables',
msgCount: 4, msgCount: remindReceivablesCountRef
tips: ''
}, },
{ {
name: '即将到期的合同', name: '即将到期的合同',
infoType: 'endContract', infoType: 'endContract',
msgCount: 20, msgCount: endContractCountRef
tips: '根据“合同到期时间”及设置的“提前提醒天数”提醒'
} }
]) ])
@ -96,6 +99,18 @@ const leftSides = ref([
const sideClick = (item) => { const sideClick = (item) => {
leftType.value = item.infoType leftType.value = item.infoType
} }
/** 加载时读取待办数量 */
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)
})
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>