!387 feat: CRM/backlog 提醒数量

Merge pull request !387 from dhb52/crm-msg
This commit is contained in:
芋道源码 2024-02-18 13:49:08 +00:00 committed by Gitee
commit c804ec5e7a
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
4 changed files with 76 additions and 105 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

@ -28,6 +28,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'
@ -38,54 +39,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: '根据“合同到期时间”及设置的“提前提醒天数”提醒'
} }
]) ])
@ -93,8 +96,20 @@ const leftSides = ref([
const sideClick = (item: any) => { const sideClick = (item: any) => {
leftType.value = item.infoType leftType.value = item.infoType
} }
// TODO @dhb52:
/** 加载时读取待办数量 */
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>
.side-item-list { .side-item-list {
top: 0; top: 0;
@ -102,8 +117,8 @@ const sideClick = (item: any) => {
left: 0; left: 0;
z-index: 1; z-index: 1;
font-size: 14px; font-size: 14px;
background-color: white; background-color: var(--el-bg-color);
border: 1px solid #e6e6e6; border: 1px solid var(--el-border-color);
border-radius: 5px; border-radius: 5px;
.side-item { .side-item {
@ -112,21 +127,17 @@ const sideClick = (item: any) => {
padding: 0 20px; padding: 0 20px;
line-height: 50px; line-height: 50px;
cursor: pointer; cursor: pointer;
i {
color: #999;
}
} }
} }
.side-item-default { .side-item-default {
color: #333; color: var(--el-text-color-primary);
border-right: 2px solid transparent; border-right: 2px solid transparent;
} }
.side-item-select { .side-item-select {
color: #409eff; color: var(--el-color-primary);
background-color: #ecf5ff; background-color: var(--el-color-primary-light-9);
border-right: 2px solid var(--el-color-primary); border-right: 2px solid var(--el-color-primary);
} }

View File

@ -68,26 +68,6 @@
:formatter="dateFormatter" :formatter="dateFormatter"
width="180px" width="180px"
/> />
<el-table-column label="操作" align="center" width="130px">
<template #default="scope">
<el-button
link
type="primary"
@click="openForm('update', scope.row.id)"
v-hasPermi="['crm:receivable-plan:update']"
>
编辑
</el-button>
<el-button
link
type="danger"
@click="handleDelete(scope.row.id)"
v-hasPermi="['crm:receivable-plan:delete']"
>
删除
</el-button>
</template>
</el-table-column>
</el-table> </el-table>
<!-- 分页 --> <!-- 分页 -->
<Pagination <Pagination
@ -102,16 +82,12 @@
<script setup lang="ts" name="RemindReceivables"> <script setup lang="ts" name="RemindReceivables">
import { DICT_TYPE } from '@/utils/dict' import { DICT_TYPE } from '@/utils/dict'
import { dateFormatter, dateFormatter2 } from '@/utils/formatTime' import { dateFormatter, dateFormatter2 } from '@/utils/formatTime'
import download from '@/utils/download'
import * as ReceivablePlanApi from '@/api/crm/receivable/plan' import * as ReceivablePlanApi from '@/api/crm/receivable/plan'
import * as UserApi from '@/api/system/user' import * as UserApi from '@/api/system/user'
import { RECEIVABLE_REMIND_TYPE } from './common' import { RECEIVABLE_REMIND_TYPE } from './common'
defineOptions({ name: 'ReceivablePlan' }) defineOptions({ name: 'ReceivablePlan' })
const message = useMessage() //
const { t } = useI18n() //
const loading = ref(true) // const loading = ref(true) //
const total = ref(0) // const total = ref(0) //
const list = ref([]) // const list = ref([]) //
@ -122,7 +98,6 @@ const queryParams = reactive({
remindType: 1 remindType: 1
}) })
const queryFormRef = ref() // const queryFormRef = ref() //
const exportLoading = ref(false) //
/** 查询列表 */ /** 查询列表 */
const getList = async () => { const getList = async () => {
@ -142,46 +117,6 @@ const handleQuery = () => {
getList() getList()
} }
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value.resetFields()
handleQuery()
}
/** 添加/修改操作 */
const formRef = ref()
const openForm = (type: string, id?: number) => {
formRef.value.open(type, id)
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await ReceivablePlanApi.deleteReceivablePlan(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await ReceivablePlanApi.exportReceivablePlan(queryParams)
download.excel(data, '回款计划.xls')
} catch {
} finally {
exportLoading.value = false
}
}
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
await getList() await getList()

View File

@ -119,7 +119,7 @@
</template> </template>
<script lang="ts" setup name="TodayCustomer"> <script lang="ts" setup name="TodayCustomer">
import * as BacklogApi from '@/api/crm/backlog' import * as CustomerApi from '@/api/crm/customer'
import { DICT_TYPE } from '@/utils/dict' import { DICT_TYPE } from '@/utils/dict'
import { dateFormatter } from '@/utils/formatTime' import { dateFormatter } from '@/utils/formatTime'
import { CONTACT_STATUS, SCENE_TYPES } from './common' import { CONTACT_STATUS, SCENE_TYPES } from './common'
@ -135,7 +135,8 @@ const queryParams = ref({
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
contactStatus: 1, contactStatus: 1,
sceneType: 1 sceneType: 1,
pool: null //
}) })
const queryFormRef = ref() // const queryFormRef = ref() //
@ -143,7 +144,7 @@ const queryFormRef = ref() // 搜索的表单
const getList = async () => { const getList = async () => {
loading.value = true loading.value = true
try { try {
const data = await BacklogApi.getTodayCustomerPage(queryParams.value) const data = await CustomerApi.getCustomerPage(queryParams.value)
list.value = data.list list.value = data.list
total.value = data.total total.value = data.total
} finally { } finally {