From 5635bcd4be9358dc4011b7ccfbcc81b7f0238f9d Mon Sep 17 00:00:00 2001
From: lbw_9527443 <780139497@qq.com>
Date: Wed, 20 Aug 2025 21:02:49 +0800
Subject: [PATCH] =?UTF-8?q?feat(secondTop):=20=E6=B7=BB=E5=8A=A0=E8=90=A5?=
=?UTF-8?q?=E6=9C=9F=E9=98=B6=E6=AE=B5=E8=B0=83=E6=8E=A7=E5=8A=9F=E8=83=BD?=
=?UTF-8?q?=E5=B9=B6=E4=BC=98=E5=8C=96KPI=E6=98=BE=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 在secondTop页面添加营期阶段调控UI,支持修改"接数据"天数
- 计算并显示当前营期阶段及日期范围
- 优化PersonalDashboard中的KPI指标名称显示
- 隐藏topOne页面中不需要的CampManagement组件
---
my-vue-app/src/api/api.js | 1 -
.../person/components/PersonalDashboard.vue | 6 +-
my-vue-app/src/views/secondTop/secondTop.vue | 107 +++++++++++++++++-
my-vue-app/src/views/topOne/topone.vue | 4 +-
4 files changed, 110 insertions(+), 8 deletions(-)
diff --git a/my-vue-app/src/api/api.js b/my-vue-app/src/api/api.js
index 6e71259..78d8a03 100644
--- a/my-vue-app/src/api/api.js
+++ b/my-vue-app/src/api/api.js
@@ -58,7 +58,6 @@ export const getCustomerChatInfo = (params) => {
// 客户表单详情 /api/v1/sales/get_customer_form_info
export const getCustomerFormInfo = (params) => {
return https.post('/api/v1/sales_timeline/get_customer_form_info', params)
-
}
// 客户通话录音 /api/v1/sales/get_customer_call_info
diff --git a/my-vue-app/src/views/person/components/PersonalDashboard.vue b/my-vue-app/src/views/person/components/PersonalDashboard.vue
index 19092ca..b8bc4cf 100644
--- a/my-vue-app/src/views/person/components/PersonalDashboard.vue
+++ b/my-vue-app/src/views/person/components/PersonalDashboard.vue
@@ -17,15 +17,15 @@
{{ props.kpiData.successRate }}%
-
成功率
+
电话接通率
{{ props.kpiData.avgDuration }}min
-
平均时长
+
平均通话时长
{{ props.kpiData.conversionRate }}
-
转化率
+
成交转化率
{{ props.kpiData.assignedData }}
diff --git a/my-vue-app/src/views/secondTop/secondTop.vue b/my-vue-app/src/views/secondTop/secondTop.vue
index 99e30f7..fa32786 100644
--- a/my-vue-app/src/views/secondTop/secondTop.vue
+++ b/my-vue-app/src/views/secondTop/secondTop.vue
@@ -24,10 +24,20 @@
统筹多组运营,优化资源配置,驱动业绩增长,实现团队协同发展。
-
+
营期所属阶段:
-
接数据
+
{{ currentStage }}
+
+
+
+ 调整“接数据”天数:
+
+
+
+
+ {{ stage.name }}: {{ stage.startDate }} to {{ stage.endDate }}
+
@@ -174,6 +184,76 @@
} from '@/api/secondTop.js'
import { useRouter } from 'vue-router'
import { useUserStore } from '@/stores/user.js'
+
+ // 营期调控逻辑
+ // This would ideally come from a prop or API call based on the logged-in user
+const centerData = ref({
+ id: 1,
+ name: '一中心',
+ startDate: '2025-08-18',
+ stages: [
+ { name: '接数据', days: 3, color: '#ffc107', startDate: '', endDate: '' },
+ { name: '课一', days: 1, color: '#0dcaf0', startDate: '', endDate: '' },
+ { name: '课二', days: 1, color: '#0d6efd', startDate: '', endDate: '' },
+ { name: '课三', days: 1, color: '#6f42c1', startDate: '', endDate: '' },
+ { name: '课四', days: 1, color: '#d63384', startDate: '', endDate: '' }
+ ]
+});
+ const getCurrentStage = (center) => {
+ const today = new Date();
+ today.setHours(0, 0, 0, 0);
+ const startDate = new Date(center.startDate);
+ startDate.setHours(0, 0, 0, 0);
+
+ if (today < startDate) {
+ return '未开始';
+ }
+
+ const diffTime = Math.abs(today - startDate);
+ const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24)) + 1; // 当天算第一天
+
+ let cumulativeDays = 0;
+ for (let i = 0; i < center.stages.length; i++) {
+ const stage = center.stages[i];
+ cumulativeDays += stage.days;
+ if (diffDays <= cumulativeDays) {
+ return stage.name;
+ }
+ }
+
+ return '已结束';
+ };
+
+ const currentStage = computed(() => getCurrentStage(centerData.value));
+
+ const isDataReceivingStage = computed(() => currentStage.value === '接数据');
+
+ // The '接数据' stage object
+ const dataReceivingStage = computed(() => centerData.value.stages.find(s => s.name === '接数据'));
+
+ const recalculateStageDates = () => {
+ const startDate = new Date(centerData.value.startDate);
+ let cumulativeDays = 0;
+ centerData.value.stages.forEach(stage => {
+ const stageStartDate = new Date(startDate);
+ stageStartDate.setDate(startDate.getDate() + cumulativeDays);
+ stage.startDate = stageStartDate.toISOString().split('T')[0];
+
+ cumulativeDays += stage.days;
+
+ const stageEndDate = new Date(startDate);
+ stageEndDate.setDate(startDate.getDate() + cumulativeDays - 1);
+ stage.endDate = stageEndDate.toISOString().split('T')[0];
+ });
+ };
+
+ const saveCampSettings = () => {
+ recalculateStageDates();
+ console.log('Saving camp settings for', centerData.value.name);
+ console.log('Updated data:', JSON.parse(JSON.stringify(centerData.value)));
+ alert('营期设置已保存!');
+ };
+
// 组别数据
const groups = ref([])
// loading 状态
@@ -511,6 +591,7 @@ const conversionRateVsAverage = ref({})
return statusMap[status] || '未知'
}
onMounted(async () => {
+ recalculateStageDates();
try {
isLoading.value = true
await CenterOverallCenterPerformance()
@@ -1134,4 +1215,26 @@ const conversionRateVsAverage = ref({})
border: 1px solid rgba(0, 0, 0, 0.1);
}
}
+.stage-control {
+ margin-left: 20px;
+ display: flex;
+ align-items: center;
+}
+
+.control-label {
+ margin-right: 10px;
+ font-size: 14px;
+ color: #606266;
+}
+
+.days-input {
+ width: 60px;
+ text-align: center;
+ margin-right: 10px;
+}
+
+.save-button {
+ padding: 5px 10px;
+ font-size: 12px;
+}
\ No newline at end of file
diff --git a/my-vue-app/src/views/topOne/topone.vue b/my-vue-app/src/views/topOne/topone.vue
index bda4c57..1006c63 100644
--- a/my-vue-app/src/views/topOne/topone.vue
+++ b/my-vue-app/src/views/topOne/topone.vue
@@ -57,11 +57,11 @@
-