From df3902e7eae5dd38a2d47aa63e5f27131f701db9 Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期一, 20 四月 2026 13:49:14 +0800
Subject: [PATCH] 绩效管理模块调整

---
 src/views/performance/class/index.vue |  131 ++++++++++++++-----------------------------
 1 files changed, 43 insertions(+), 88 deletions(-)

diff --git a/src/views/performance/class/index.vue b/src/views/performance/class/index.vue
index 0210486..c48d607 100644
--- a/src/views/performance/class/index.vue
+++ b/src/views/performance/class/index.vue
@@ -41,8 +41,7 @@
             浜哄憳鍚嶇О
             <span style="color:#ff4949">(浜哄憳鏁伴噺:{{list.length}})</span>
           </div>
-          <div class="content-user" :class="{ hoverType: currentUserIndex == index }" v-for="(item, index) in list"
-            :key="'e' + index" v-on:mouseenter="onMouseEnter(index)" v-on:mouseleave="currentUserIndex = null">
+          <div class="content-user" v-for="(item, index) in list">
             <div class="user-pic">
               {{ item.userName ? item.userName.charAt(0) : "" }}
             </div>
@@ -55,13 +54,7 @@
                 ">
                 {{ item.userName }}
               </p>
-              <p style="color: #999999;font-size: 12px;transform: scale(0.8) translateX(-20px);white-space: nowrap;width: 150px;margin: 0;">
-                <span>鏃�:{{ item.monthlyAttendance.morningShift}},</span>
-                <span>涓�:{{ item.monthlyAttendance.swingShift}},</span>
-                <span>澶�:{{ item.monthlyAttendance.nightShift}},</span>
-                <span>浼�:{{ item.monthlyAttendance.holidayShift}},</span>
-                <span>鍋�:{{ item.monthlyAttendance.leaveShift}},</span>
-                <span>宸�:0</span>
+              <p style="color: #999999;font-size: 12px;transform: scale(0.8) translateX(-20px);white-space: nowrap;width: 150px;margin: 0;" v-text="item.monthlyAttendanceStr">
               </p>
               <p style="margin-top: 4px; margin: 0">
                 <span style="
@@ -69,7 +62,7 @@
                     font-size: 12px;
                     display: inline-block;
                     transform: scale(0.8) translateX(-10px);
-                  ">鍚堣鍑哄嫟: </span><span style="font-size: 16px; color: #ff4902">{{item.monthlyAttendance.morningShift+item.monthlyAttendance.swingShift+item.monthlyAttendance.nightShift}}澶�</span>
+                  ">鍚堣鍑哄嫟: </span><span style="font-size: 16px; color: #ff4902">{{item.monthlyAttendance.totalCount}}澶�</span>
               </p>
             </div>
           </div>
@@ -86,8 +79,7 @@
                 </p>
               </div>
             </div>
-            <div class="content-body" v-for="(item, index) in list" :key="'c' + index"
-              v-on:mouseenter="onMouseEnter(index)" v-on:mouseleave="currentUserIndex = null">
+            <div class="content-body" v-for="(item, index) in list" :key="'c' + index">
               <div class="content-body-item" v-for="(m, i) in item.list" :key="'d' + i"
                 :class="{ hoverType: currentUserIndex == index }">
                 <el-dropdown trigger="click" placement="bottom" @command="(e) => handleCommand(e, m)"
@@ -115,8 +107,8 @@
             浜哄憳鍚嶇О
             <span style="color:#ff4949">(浜哄憳鏁伴噺:{{yearList.length}})</span>
           </div>
-          <div class="content-user" :class="{ hoverType: currentUserIndex == index }" v-for="(item, index) in yearList"
-            :key="'e' + index" v-on:mouseenter="onMouseEnter(index)" v-on:mouseleave="currentUserIndex = null">
+          <div class="content-user" v-for="(item, index) in yearList"
+            :key="'e' + index">
             <div class="user-pic">
               {{ item.userName ? item.userName.charAt(0) : "" }}
             </div>
@@ -129,21 +121,14 @@
                 ">
                 {{ item.userName }}
               </p>
-              <p style="color: #999999;font-size: 12px;transform: scale(0.8) translateX(-20px);white-space: nowrap;width: 150px;margin: 0;">
-                <span>鏃�:{{ item.sidebarAnnualAttendance.morningShift}},</span>
-                <span>涓�:{{ item.sidebarAnnualAttendance.swingShift}},</span>
-                <span>澶�:{{ item.sidebarAnnualAttendance.nightShift}},</span>
-                <span>浼�:{{ item.sidebarAnnualAttendance.holidayShift}},</span>
-                <span>鍋�:{{ item.sidebarAnnualAttendance.leaveShift}},</span>
-                <span>宸�:0</span>
-              </p>
+              <p style="color: #999999;font-size: 12px;transform: scale(0.8) translateX(-20px);white-space: nowrap;width: 150px;margin: 0;" v-text="item.sidebarAnnualAttendanceStr"></p>
               <p style="margin-top: 4px; margin: 0">
                 <span style="
                     color: #999999;
                     font-size: 12px;
                     display: inline-block;
                     transform: scale(0.8) translateX(-10px);
-                  ">鍚堣鍑哄嫟: </span><span style="font-size: 16px; color: #ff4902">{{item.sidebarAnnualAttendance.morningShift+item.sidebarAnnualAttendance.swingShift+item.sidebarAnnualAttendance.nightShift}}澶�</span>
+                  ">鍚堣鍑哄嫟: </span><span style="font-size: 16px; color: #ff4902">{{item.sidebarAnnualAttendance.totalCount}}澶�</span>
               </p>
             </div>
           </div>
@@ -158,21 +143,15 @@
                   <span class="month">{{ item }}鏈�</span>
                 </div>
               </div>
-              <div class="content-body" v-for="(item, index) in yearList" :key="'c' + index"
-                v-on:mouseenter="onMouseEnter(index)" v-on:mouseleave="currentUserIndex = null" :style="`display: grid;
+              <div class="content-body" v-for="(item, index) in yearList" :key="'c' + index" :style="`display: grid;
               grid-template-columns: repeat(${monthList.length}, 1fr);`">
-                <div class="content-body-item" v-for="(m, i) in item.monthlyAttendance" :key="'d' + i"
+                <div class="content-body-item" v-for="(m, i) in item.monthlyAttendances" :key="'d' + i"
                   :class="{ hoverType: currentUserIndex == index }">
                   <p style="color: rgb(153, 153, 153); font-size: 12px">
-                    鍚堣鍑哄嫟锛�<span style="font-size: 14px; color: #000">{{m.morningShift+m.swingShift+m.nightShift}}</span>
+                    鍚堣鍑哄嫟锛�<span style="font-size: 14px; color: #000">{{m.monthlyAttendance.totalCount}}</span>
                   </p>
                   <p style="color: rgb(153, 153, 153); font-size: 12px">
-                    <span>鏃�:{{ m.morningShift}},</span>
-                    <span>涓�:{{ m.swingShift}},</span>
-                    <span>澶�:{{ m.nightShift}},</span>
-                    <span>浼�:{{ m.holidayShift}},</span>
-                    <span>鍋�:{{ m.leaveShift}},</span>
-                    <span>宸�:0</span>
+                    <span>{{m.monthlyAttendanceStr}}</span>
                   </p>
                 </div>
               </div>
@@ -265,9 +244,7 @@
           <span style="color: red; margin-right: 4px">*</span>浜哄憳鍚嶇О锛�
         </div>
         <div class="search_input" style="width: calc(100% - 90px)">
-          <el-select v-model="schedulingQuery.userId" popper-class="select-with-all" placeholder="璇烽�夋嫨" style="width: 100%" multiple collapse-tags clearable>
-<!--            <el-option v-for="item in personList" :key="item.id" :label="item.name" :value="item.id">-->
-<!--            </el-option>-->
+          <el-select v-model="schedulingQuery.userIdList" popper-class="select-with-all" placeholder="璇烽�夋嫨" style="width: 100%" multiple collapse-tags clearable>
             <template slot="prefix">
               <el-button
                 type="text"
@@ -284,7 +261,10 @@
               :key="item.id"
               :label="item.name"
               :value="item.id"
-            />
+            >
+              <span style="float: left">{{ item.name }}</span>
+              <span style="float: right; color: #8492a6; font-size: 13px">{{ item.account }}</span>
+            </el-option>
           </el-select>
         </div>
       </div>
@@ -320,11 +300,12 @@
   exportFile,
   obtainItemParameterList,
   update,
-  selectUserCondition,
   editAnnotationText,
   delAnnotationText
 } from "@/api/performance/class";
+import {selectUserListByPerformance} from '@/api/system/user'
 import {getWorkMonth} from "@/utils/date";
+import {transformExcel} from '@/utils/file'
 export default {
   name: 'Class',
   data() {
@@ -394,7 +375,7 @@
       loading: false,
       schedulingQuery: {
         week: "",
-        userId: [],
+        userIdList: [],
         shift: "",
       },
       list: [],
@@ -418,7 +399,7 @@
   },
   computed:{
     isAllSelected() {
-      return this.schedulingQuery.userId.length === this.personList.length && this.personList.length > 0;
+      return this.schedulingQuery.userIdList.length === this.personList.length && this.personList.length > 0;
     },
   },
   watch: {
@@ -446,10 +427,10 @@
   methods: {
     handleSelectAll() {
       if (this.isAllSelected) {
-        this.schedulingQuery.userId = [];
+        this.schedulingQuery.userIdList = [];
       } else {
         // 鍙�変腑鍙敤閫夐」鐨剉alue
-        this.schedulingQuery.userId = this.personList.map(item => item.id);
+        this.schedulingQuery.userIdList = this.personList.map(item => item.id);
       }
     },
     handleContextMenu(target,e) {
@@ -595,9 +576,6 @@
         this.yearList = res.data
       });
     },
-    onMouseEnter(index) {
-      this.currentUserIndex = index;
-    },
     confirmScheduling() {
       if (!this.schedulingQuery.week) {
         this.$message.error("璇烽�夋嫨鍛ㄦ");
@@ -611,8 +589,8 @@
         getYearAndMonthAndDays(new Date(time + 24 * 60 * 60 * 1000 * 5)) +
         " 00:00:00";
       if (
-        !this.schedulingQuery.userId ||
-        this.schedulingQuery.userId.length == 0
+        !this.schedulingQuery.userIdList ||
+        this.schedulingQuery.userIdList.length == 0
       ) {
         this.$message.error("璇烽�夋嫨浜哄憳");
         return;
@@ -625,7 +603,7 @@
       add({
         startWeek,
         endWeek,
-        userId: this.schedulingQuery.userId.join(","),
+        userIdList: this.schedulingQuery.userIdList,
         shift: this.schedulingQuery.shift,
       })
         .then((res) => {
@@ -634,7 +612,7 @@
           this.schedulingVisible = false;
           this.schedulingQuery = {
             week: "",
-            userId: [],
+            userIdList: [],
             shift: "",
           };
           this.refresh();
@@ -746,21 +724,18 @@
         time,
         userName: this.query.userName,
         laboratory: this.query.laboratory,
-        isMonth: this.query.month ? true : false,
+        isMonth: !!this.query.month,
       })
         .then((res) => {
-          this.$message.success("涓嬭浇鎴愬姛");
           this.downLoading = false;
-          const blob = new Blob([res], {
-            type: "application/force-download",
-          });
-          let fileName = "";
+          let fileName = "涓ぉ鑰愪笣璐ㄩ噺閮�";
           if (this.query.month) {
-            fileName = year + "-" + this.query.month + " 鐝淇℃伅";
+            fileName += this.query.month + "鏈堢彮娆′俊鎭�";
           } else {
-            fileName = year + " 鐝姹囨��";
+            fileName += year + "骞寸彮娆℃眹鎬�";
           }
-          this.$download.saveAs(blob, fileName + ".xlsx");
+          transformExcel(res, fileName + ".xlsx");
+          this.$message.success("瀵煎嚭鎴愬姛");
         })
         .catch((err) => {
           this.downLoading = false;
@@ -772,29 +747,16 @@
       });
     },
     obtainItemParameterList() {
-      if (this.PROJECT == "妫�娴嬩腑蹇�") {
-        this.laboratory = [
-          {
-            label: "閫氫俊浜у搧瀹為獙瀹�",
-            value: "閫氫俊浜у搧瀹為獙瀹�",
-          },
-          {
-            label: "鐢靛姏浜у搧瀹為獙瀹�",
-            value: "鐢靛姏浜у搧瀹為獙瀹�",
-          },
-        ];
-      } else {
-        obtainItemParameterList().then((res) => {
-          let data = [];
-          res.data.forEach((a) => {
-            data.push({
-              label: a.laboratoryName,
-              value: a.id,
-            });
+      obtainItemParameterList().then((res) => {
+        let data = [];
+        res.data.forEach((a) => {
+          data.push({
+            label: a.laboratoryName,
+            value: a.id,
           });
-          this.laboratory = data;
         });
-      }
+        this.laboratory = data;
+      });
     },
     handleCommand(e, m) {
       if (e != m.shift) {
@@ -808,16 +770,9 @@
       }
     },
     getUsers() {
-      selectUserCondition({ type: 1 }).then((res) => {
-        let arr = res.data;
-        this.personList = arr;
+      selectUserListByPerformance().then((res) => {
+        this.personList = res.data;
       });
-    },
-    getDayByDic(e) {
-      let obj = this.classType.find((m) => m.dictLabel == e);
-      if (obj) {
-        return obj.dictValue;
-      }
     },
     getShiftByDic(e) {
       let obj = this.classType.find((m) => m.dictValue == e);

--
Gitblit v1.9.3