From 6e1a9e0ce90a0218763312f4aff68de9cc020bca Mon Sep 17 00:00:00 2001
From: kaeery <3491123437@qq.com>
Date: Thu, 6 Mar 2025 21:27:45 +0800
Subject: [PATCH] =?UTF-8?q?=E3=80=90=E6=8B=9B=E7=94=9F=E7=94=A8=E6=88=B7?=
=?UTF-8?q?=E7=AB=AF=E3=80=91=20=E4=BF=AE=E5=A4=8D#=20=E5=B7=A5=E4=BD=9C?=
=?UTF-8?q?=E5=8F=B0-=E6=8E=92=E5=90=8D=E6=A6=9C=EF=BC=9A=E7=82=B9?=
=?UTF-8?q?=E5=87=BB=E6=9F=A5=E7=9C=8B=E6=9B=B4=E5=A4=9A=E5=90=8E=EF=BC=8C?=
=?UTF-8?q?=E5=88=87=E6=8D=A2=E5=B2=97=E4=BD=8D=E5=90=8E=E5=BC=BA=E5=88=B6?=
=?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=A1=A8=E5=A4=B4=E5=90=8D=E7=A7=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../workbench/components/rank-list-dialog.vue | 25 +++++++++++++------
src/views/workbench/components/rank.vue | 4 ++-
2 files changed, 20 insertions(+), 9 deletions(-)
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 = []