From fdd6bb96d8aad1ab796ce10038d170b47a19f661 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期四, 13 十一月 2025 13:45:41 +0800
Subject: [PATCH] 1.排班管理-班次、加一个午休时间(h)、人员多选、人员从用户管理获取,加一条列表也只展示一条 2.薪资管理-只要,人员、薪资、月份三个字段

---
 src/views/index.vue |   54 +++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 51 insertions(+), 3 deletions(-)

diff --git a/src/views/index.vue b/src/views/index.vue
index 2888b16..e616dc9 100644
--- a/src/views/index.vue
+++ b/src/views/index.vue
@@ -13,9 +13,13 @@
 							<div class="company-meta">{{userStore.roleName}}</div>
 						</div>
 						<div style="display: flex;align-items: center;gap: 8px">
-							<el-icon color="#5053B5" size="22"><Clock /></el-icon>
-							<span>鐧婚檰鏃ユ湡锛歿{userStore.currentLoginTime}}</span>
-						</div>
+						<el-icon color="#5053B5" size="22"><Clock /></el-icon>
+						<span>鐧婚檰鏃ユ湡锛歿{userStore.currentLoginTime}}</span>
+					</div>
+					<div style="display: flex;align-items: center;gap: 8px">
+						<el-icon color="#5053B5" size="22"><Calendar /></el-icon>
+						<span>鎺掔彮鏃堕棿锛歿{scheduleTime}}</span>
+					</div>
 					</div>
 				</div>
 				<div class="data-cards">
@@ -169,6 +173,7 @@
 import Echarts from "@/components/Echarts/echarts.vue";
 import * as echarts from 'echarts';
 import useUserStore from "@/store/modules/user.js";
+import { Clock, Calendar } from '@element-plus/icons-vue'
 import {
 	analysisCustomerContractAmounts, getAmountHalfYear,
 	getBusiness,
@@ -176,6 +181,8 @@
 	qualityStatistics,
 	statisticsReceivablePayable
 } from "@/api/viewIndex.js";
+import { listPage } from "@/api/personnelManagement/scheduling.js";
+import dayjs from "dayjs";
 
 const userStore = useUserStore()
 
@@ -341,6 +348,10 @@
 const todoList = ref([])
 const radio1 = ref(1)
 
+// 鎺掔彮鏃堕棿
+const scheduleTime = ref('')
+const scheduleInfo = ref({})
+
 // 鍥捐〃寮曠敤
 const barChart = ref(null)
 const lineChart = ref(null)
@@ -358,6 +369,7 @@
 	statisticsReceivable()
 	qualityStatisticsInfo()
 	getAmountHalfYearNum()
+	getCurrentUserSchedule()
 })
 // 鏁版嵁缁熻
 const getBusinessData = () => {
@@ -409,6 +421,42 @@
 		qualityStatisticsObject.value.factoryNum = res.data.factoryNum
 	})
 }
+// 鑾峰彇褰撳墠鐢ㄦ埛鎺掔彮淇℃伅
+const getCurrentUserSchedule = async () => {
+  try {
+    const today = dayjs().format('YYYY-MM-DD')
+    const res = await listPage({
+      staffName: userStore.name,
+      startDate: today,
+      endDate: today,
+      current: 1,
+      size: 10
+    })
+    
+    if (res.data && res.data.records && res.data.records.length > 0) {
+      const currentSchedule = res.data.records[0]
+      scheduleInfo.value = currentSchedule
+      
+      // 鏍煎紡鍖栨帓鐝椂闂存樉绀�
+      if (currentSchedule.startTime && currentSchedule.endTime) {
+        scheduleTime.value = `${currentSchedule.startTime} - ${currentSchedule.endTime}`
+      } else if (currentSchedule.workStartTime && currentSchedule.workEndTime) {
+        const startTime = dayjs(currentSchedule.workStartTime).format('HH:mm')
+        const endTime = dayjs(currentSchedule.workEndTime).format('HH:mm')
+        scheduleTime.value = `${startTime} - ${endTime}`
+      } else {
+        scheduleTime.value = '浠婃棩鏃犳帓鐝�'
+      }
+    } else {
+      scheduleTime.value = '浠婃棩鏃犳帓鐝�'
+      scheduleInfo.value = {}
+    }
+  } catch (error) {
+    console.error('鑾峰彇鎺掔彮淇℃伅澶辫触:', error)
+    scheduleTime.value = '鑾峰彇鎺掔彮淇℃伅澶辫触'
+  }
+}
+
 const getAmountHalfYearNum = async () => {
 	const res = await getAmountHalfYear()
 	console.log(res)

--
Gitblit v1.9.3