diff --git a/src/views/workbench/components/rank-list-dialog.vue b/src/views/workbench/components/rank-list-dialog.vue
index d7cb2a5..cee79c4 100644
--- a/src/views/workbench/components/rank-list-dialog.vue
+++ b/src/views/workbench/components/rank-list-dialog.vue
@@ -38,7 +38,7 @@
-
+
@@ -50,6 +50,7 @@ import ProDialog, { type IParams } from '@/components/ProDialog/index.vue'
import { usePositionData, useWorkbench } from '@/hooks/useCommon'
import { rankMoreListApi } from '@/api/workbench'
import { getCurDate, shortcuts } from '@/utils/util'
+import { templateTypeEum } from '@/enums'
const { positionOptions, postId, fetchPostionData } = usePositionData()
@@ -62,33 +63,33 @@ const proDialogRef = ref>()
const loading = ref(false)
const proTableRef = ref()
const tableData = ref([])
-const columns = reactive([
- { prop: 'rank', label: '排名' },
- { prop: 'username', label: '账号名称' },
- { prop: 'clueCount', label: '总数' }
-])
+const parseLabel = computed(() => (postId.value === templateTypeEum.TELE ? '意向客户数' : '成交客户数'))
+const columns = ref([])
const queryParams = ref()
const initialVal = ref()
const { defaultProps, CascaderProps, organizationList, userList, fetchOrganizationList, fetchAllUserList } = useWorkbench(id => {
initialVal.value = id
})
const selectedUserId = ref([])
-
+const isRrefresh = ref(true) // 解决columns不更新
const openDialog = async (params: IParams) => {
queryParams.value = params.data
await fetchPostionData()
fetchOrganizationList()
fetchAllUserList()
+ columns.value = generateColumns()
fetchData()
proDialogRef.value?.openDialog(params)
}
const fetchData = async () => {
loading.value = true
+ isRrefresh.value = false
try {
const newParams = {
...queryParams.value,
post: postId.value ?? queryParams.value.post
}
+ columns.value = generateColumns()
const result = await rankMoreListApi(newParams)
tableData.value = result.lists ?? []
pager.value = {
@@ -98,13 +99,21 @@ const fetchData = async () => {
}
} catch (error) {}
loading.value = false
+ isRrefresh.value = true
}
const handleCancel = (callback: () => void) => {
callback()
}
+const generateColumns = () => {
+ return [
+ { prop: 'rank', label: '排名' },
+ { prop: 'username', label: '账号名称' },
+ { prop: 'clueCount', label: parseLabel.value }
+ ]
+}
watch(
() => postId.value,
- (newVal, oldVal) => {
+ async (newVal, oldVal) => {
if (newVal !== oldVal) {
fetchData()
}
diff --git a/src/views/workbench/components/rank.vue b/src/views/workbench/components/rank.vue
index c2a9fea..691eda8 100644
--- a/src/views/workbench/components/rank.vue
+++ b/src/views/workbench/components/rank.vue
@@ -28,7 +28,7 @@
-
+
@@ -45,6 +45,7 @@ import card from './card.vue'
import rankListDialog from './rank-list-dialog.vue'
import type { IForm } from '../index.vue'
import { usePositionData } from '@/hooks/useCommon'
+import { templateTypeEum } from '@/enums'
const { positionOptions, postId, fetchPostionData } = usePositionData()
@@ -54,6 +55,7 @@ const rankListDialogRef = ref>()
const tableData = ref([])
const loading = ref(false)
const queryParams = ref()
+const parseLabel = computed(() => (postId.value == templateTypeEum.TELE ? '意向客户数' : '成交客户数'))
const fetchData = async (payload: IForm) => {
if (!positionOptions.value.length) await fetchPostionData()
if (tableData.value.length > 0) tableData.value = []