|
@@ -9,17 +9,7 @@
|
|
:inline="true"
|
|
:inline="true"
|
|
label-width="68px"
|
|
label-width="68px"
|
|
>
|
|
>
|
|
- <el-form-item label="间隔类型" prop="intervalType">
|
|
|
|
- <el-select v-model="queryParams.intervalType" class="!w-240px" placeholder="间隔类型">
|
|
|
|
- <el-option
|
|
|
|
- v-for="(intervalType, index) in DATE_INTERVAL_OPTIONS"
|
|
|
|
- :label="intervalType.name"
|
|
|
|
- :value="intervalType.value"
|
|
|
|
- :key="index"
|
|
|
|
- />
|
|
|
|
- </el-select>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="时间范围" prop="orderDate" v-show="queryParams.intervalType === CUSTOMER_INTERVAL">
|
|
|
|
|
|
+ <el-form-item label="时间范围" prop="orderDate">
|
|
<el-date-picker
|
|
<el-date-picker
|
|
v-model="queryParams.times"
|
|
v-model="queryParams.times"
|
|
:shortcuts="defaultShortcuts"
|
|
:shortcuts="defaultShortcuts"
|
|
@@ -31,6 +21,16 @@
|
|
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
|
|
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
|
|
/>
|
|
/>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
+ <el-form-item label="时间间隔" prop="interval">
|
|
|
|
+ <el-select v-model="queryParams.interval" class="!w-240px" placeholder="间隔类型">
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="dict in getIntDictOptions(DICT_TYPE.DATE_INTERVAL)"
|
|
|
|
+ :key="dict.value"
|
|
|
|
+ :label="dict.label"
|
|
|
|
+ :value="dict.value"
|
|
|
|
+ />
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
<el-form-item label="归属部门" prop="deptId">
|
|
<el-form-item label="归属部门" prop="deptId">
|
|
<el-tree-select
|
|
<el-tree-select
|
|
v-model="queryParams.deptId"
|
|
v-model="queryParams.deptId"
|
|
@@ -68,12 +68,12 @@
|
|
<CustomerSummary :query-params="queryParams" ref="customerSummaryRef" />
|
|
<CustomerSummary :query-params="queryParams" ref="customerSummaryRef" />
|
|
</el-tab-pane>
|
|
</el-tab-pane>
|
|
<!-- 客户跟进次数分析 -->
|
|
<!-- 客户跟进次数分析 -->
|
|
- <el-tab-pane label="客户跟进次数分析" name="followupSummary" lazy>
|
|
|
|
- <CustomerFollowupSummary :query-params="queryParams" ref="followupSummaryRef" />
|
|
|
|
|
|
+ <el-tab-pane label="客户跟进次数分析" name="followUpSummary" lazy>
|
|
|
|
+ <CustomerFollowUpSummary :query-params="queryParams" ref="followUpSummaryRef" />
|
|
</el-tab-pane>
|
|
</el-tab-pane>
|
|
<!-- 客户跟进方式分析 -->
|
|
<!-- 客户跟进方式分析 -->
|
|
- <el-tab-pane label="客户跟进方式分析" name="followupType" lazy>
|
|
|
|
- <CustomerFollowupType :query-params="queryParams" ref="followupTypeRef" />
|
|
|
|
|
|
+ <el-tab-pane label="客户跟进方式分析" name="followUpType" lazy>
|
|
|
|
+ <CustomerFollowUpType :query-params="queryParams" ref="followUpTypeRef" />
|
|
</el-tab-pane>
|
|
</el-tab-pane>
|
|
<!-- 客户转化率分析 -->
|
|
<!-- 客户转化率分析 -->
|
|
<el-tab-pane label="客户转化率分析" name="conversionStat" lazy>
|
|
<el-tab-pane label="客户转化率分析" name="conversionStat" lazy>
|
|
@@ -94,16 +94,16 @@ import { useUserStore } from '@/store/modules/user'
|
|
import { beginOfDay, defaultShortcuts, endOfDay, formatDate } from '@/utils/formatTime'
|
|
import { beginOfDay, defaultShortcuts, endOfDay, formatDate } from '@/utils/formatTime'
|
|
import { defaultProps, handleTree } from '@/utils/tree'
|
|
import { defaultProps, handleTree } from '@/utils/tree'
|
|
import CustomerSummary from './components/CustomerSummary.vue'
|
|
import CustomerSummary from './components/CustomerSummary.vue'
|
|
-import CustomerFollowupSummary from './components/CustomerFollowupSummary.vue'
|
|
|
|
-import CustomerFollowupType from './components/CustomerFollowupType.vue'
|
|
|
|
|
|
+import CustomerFollowUpSummary from './components/CustomerFollowUpSummary.vue'
|
|
|
|
+import CustomerFollowUpType from './components/CustomerFollowUpType.vue'
|
|
import CustomerConversionStat from './components/CustomerConversionStat.vue'
|
|
import CustomerConversionStat from './components/CustomerConversionStat.vue'
|
|
import CustomerDealCycle from './components/CustomerDealCycle.vue'
|
|
import CustomerDealCycle from './components/CustomerDealCycle.vue'
|
|
-import { DATE_INTERVAL_OPTIONS, CUSTOMER_INTERVAL } from '@/api/crm/statistics/customer'
|
|
|
|
|
|
+import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
|
|
|
|
|
defineOptions({ name: 'CrmStatisticsCustomer' })
|
|
defineOptions({ name: 'CrmStatisticsCustomer' })
|
|
|
|
|
|
const queryParams = reactive({
|
|
const queryParams = reactive({
|
|
- intervalType: CUSTOMER_INTERVAL,
|
|
|
|
|
|
+ interval: 1,
|
|
deptId: useUserStore().getUser.deptId,
|
|
deptId: useUserStore().getUser.deptId,
|
|
userId: undefined,
|
|
userId: undefined,
|
|
times: [
|
|
times: [
|
|
@@ -116,27 +116,23 @@ const queryParams = reactive({
|
|
const queryFormRef = ref() // 搜索的表单
|
|
const queryFormRef = ref() // 搜索的表单
|
|
const deptList = ref<Tree[]>([]) // 部门树形结构
|
|
const deptList = ref<Tree[]>([]) // 部门树形结构
|
|
const userList = ref<UserApi.UserVO[]>([]) // 全量用户清单
|
|
const userList = ref<UserApi.UserVO[]>([]) // 全量用户清单
|
|
-// 根据选择的部门筛选员工清单
|
|
|
|
|
|
+
|
|
|
|
+/** 根据选择的部门筛选员工清单 */
|
|
const userListByDeptId = computed(() =>
|
|
const userListByDeptId = computed(() =>
|
|
queryParams.deptId
|
|
queryParams.deptId
|
|
? userList.value.filter((u: UserApi.UserVO) => u.deptId === queryParams.deptId)
|
|
? userList.value.filter((u: UserApi.UserVO) => u.deptId === queryParams.deptId)
|
|
: []
|
|
: []
|
|
)
|
|
)
|
|
|
|
|
|
-// 活跃标签
|
|
|
|
-const activeTab = ref('customerSummary')
|
|
|
|
-// 1.客户总量分析
|
|
|
|
-const customerSummaryRef = ref()
|
|
|
|
-// 2.客户跟进次数分析
|
|
|
|
-const followupSummaryRef = ref()
|
|
|
|
-// 3.客户跟进方式分析
|
|
|
|
-const followupTypeRef = ref()
|
|
|
|
-// 4.客户转化率分析
|
|
|
|
-const conversionStatRef = ref()
|
|
|
|
-// 5.公海客户分析
|
|
|
|
|
|
+//
|
|
|
|
+const activeTab = ref('customerSummary') // 活跃标签
|
|
|
|
+const customerSummaryRef = ref() // 1. 客户总量分析
|
|
|
|
+const followUpSummaryRef = ref() // 2. 客户跟进次数分析
|
|
|
|
+const followUpTypeRef = ref() // 3. 客户跟进方式分析
|
|
|
|
+const conversionStatRef = ref() // 4. 客户转化率分析
|
|
|
|
+// 5. TODO 公海客户分析
|
|
// 缺 crm_owner_record 表
|
|
// 缺 crm_owner_record 表
|
|
-// 6.成交周期分析
|
|
|
|
-const dealCycleRef = ref()
|
|
|
|
|
|
+const dealCycleRef = ref() // 6. 成交周期分析
|
|
|
|
|
|
/** 搜索按钮操作 */
|
|
/** 搜索按钮操作 */
|
|
const handleQuery = () => {
|
|
const handleQuery = () => {
|
|
@@ -144,11 +140,11 @@ const handleQuery = () => {
|
|
case 'customerSummary':
|
|
case 'customerSummary':
|
|
customerSummaryRef.value?.loadData?.()
|
|
customerSummaryRef.value?.loadData?.()
|
|
break
|
|
break
|
|
- case 'followupSummary':
|
|
|
|
- followupSummaryRef.value?.loadData?.()
|
|
|
|
|
|
+ case 'followUpSummary':
|
|
|
|
+ followUpSummaryRef.value?.loadData?.()
|
|
break
|
|
break
|
|
- case 'followupType':
|
|
|
|
- followupTypeRef.value?.loadData?.()
|
|
|
|
|
|
+ case 'followUpType':
|
|
|
|
+ followUpTypeRef.value?.loadData?.()
|
|
break
|
|
break
|
|
case 'conversionStat':
|
|
case 'conversionStat':
|
|
conversionStatRef.value?.loadData?.()
|
|
conversionStatRef.value?.loadData?.()
|
|
@@ -159,7 +155,7 @@ const handleQuery = () => {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-// 当 activeTab 改变时,刷新当前活动的 tab
|
|
|
|
|
|
+/** 当 activeTab 改变时,刷新当前活动的 tab */
|
|
watch(activeTab, () => {
|
|
watch(activeTab, () => {
|
|
handleQuery()
|
|
handleQuery()
|
|
})
|
|
})
|
|
@@ -170,7 +166,7 @@ const resetQuery = () => {
|
|
handleQuery()
|
|
handleQuery()
|
|
}
|
|
}
|
|
|
|
|
|
-// 加载部门树
|
|
|
|
|
|
+/** 初始化 */
|
|
onMounted(async () => {
|
|
onMounted(async () => {
|
|
deptList.value = handleTree(await DeptApi.getSimpleDeptList())
|
|
deptList.value = handleTree(await DeptApi.getSimpleDeptList())
|
|
userList.value = handleTree(await UserApi.getSimpleUserList())
|
|
userList.value = handleTree(await UserApi.getSimpleUserList())
|