From 9ea5ff67655241271bdf04bb50ca3a8d60c4e22a Mon Sep 17 00:00:00 2001
From: yuan <123@>
Date: 星期二, 11 八月 2026 15:07:02 +0800
Subject: [PATCH] fix: 用河南鹤壁代码覆盖山西长治

---
 src/views/personnelManagement/classsSheduling/index.vue |  151 ++++----------------------------------------------
 1 files changed, 12 insertions(+), 139 deletions(-)

diff --git a/src/views/personnelManagement/classsSheduling/index.vue b/src/views/personnelManagement/classsSheduling/index.vue
index 8228be9..140ffba 100644
--- a/src/views/personnelManagement/classsSheduling/index.vue
+++ b/src/views/personnelManagement/classsSheduling/index.vue
@@ -149,12 +149,12 @@
                       'shift-box-early': m.shift === '鏃╃彮',
                       'shift-box-mid': m.shift === '涓彮',
                       'shift-box-night': m.shift === '澶滅彮',
-                      'shift-box-rest': !m.shift || m.shift === '浼戞伅',
+                      'shift-box-rest': m.shift === '浼戞伅',
                       'shift-box-leave': m.shift === '璇峰亣',
                       'shift-box-other': m.shift === '澶�11',
                       'shift-box-business': m.shift === '澶�12',
                     }">
-                      <span class="shift-text">{{ getShiftNameByValue(m.shift) || '浼戞伅' }}</span>
+                      <span class="shift-text">{{ getShiftNameByValue(m.shift) || '鈥�' }}</span>
                     </div>
                     <template #dropdown>
                       <el-dropdown-menu>
@@ -199,7 +199,7 @@
               </div> -->
               <div class="user-total">
                 <span class="total-label">鍚堣鍑哄嫟:</span>
-                <span class="total-value">{{ item.year.totalYearAttendance }}澶�</span>
+                <span class="total-value">{{ item.work_time }}澶�</span>
               </div>
             </div>
           </div>
@@ -271,23 +271,6 @@
       <div class="search_thing">
         <div class="search_label"
              style="width: 90px">
-          <span style="color: red; margin-right: 4px">*</span>閮ㄩ棬锛�
-        </div>
-        <div class="search_input">
-          <el-tree-select v-model="schedulingQuery.deptId"
-                          :data="deptOptions"
-                          :props="{ value: 'id', label: 'label', children: 'children' }"
-                          value-key="id"
-                          placeholder="璇烽�夋嫨閮ㄩ棬"
-                          check-strictly
-                          clearable
-                          @change="onSchedulingDeptChange"
-                          style="width: 100%" />
-        </div>
-      </div>
-      <div class="search_thing">
-        <div class="search_label"
-             style="width: 90px">
           <span style="color: red; margin-right: 4px">*</span>浜哄憳鍚嶇О锛�
         </div>
         <div class="search_input">
@@ -296,8 +279,7 @@
                      style="width: 100%"
                      multiple
                      clearable
-                     collapse-tags
-                     :disabled="!schedulingQuery.deptId">
+                     collapse-tags>
             <el-option v-for="item in personList"
                        :key="item.id"
                        :label="item.staffName"
@@ -314,9 +296,8 @@
         <div class="search_input">
           <el-select v-model="schedulingQuery.shift"
                      placeholder="璇烽�夋嫨"
-                     style="width: 100%"
-                     :disabled="!schedulingQuery.deptId">
-            <el-option v-for="item in schedulingClassType"
+                     style="width: 100%">
+            <el-option v-for="item in classType"
                        :key="item.id"
                        :label="getShiftNameByValue(item.shift)"
                        :value="item.id">
@@ -337,14 +318,7 @@
 </template>
 
 <script setup>
-  import {
-    ref,
-    reactive,
-    computed,
-    watch,
-    onMounted,
-    getCurrentInstance,
-  } from "vue";
+  import { ref, reactive, onMounted, getCurrentInstance } from "vue";
   import { useRouter } from "vue-router";
   import {
     page,
@@ -402,7 +376,6 @@
 
   // 浜哄憳鍒楄〃
   const personList = ref([]);
-  const personListAll = ref([]);
 
   // 鍔犺浇鐘舵��
   const loading = ref(false);
@@ -410,18 +383,8 @@
   // 鎺掔彮鏌ヨ鏉′欢
   const schedulingQuery = reactive({
     week: "",
-    deptId: "",
     userId: null,
     shift: "",
-  });
-
-  const schedulingClassType = computed(() => {
-    if (!schedulingQuery.deptId) return classType.value || [];
-    return (classType.value || []).filter(item => {
-      if (["998", "999"].includes(String(item?.id))) return true;
-      const itemDeptId = item.deptId ?? item.sysDeptId ?? item.dept_id;
-      return String(itemDeptId) === String(schedulingQuery.deptId);
-    });
   });
 
   // 鍒楄〃鏁版嵁
@@ -630,10 +593,6 @@
       proxy.$modal.msgError("璇烽�夋嫨鍛ㄦ");
       return;
     }
-    if (!schedulingQuery.deptId) {
-      proxy.$modal.msgError("璇烽�夋嫨閮ㄩ棬");
-      return;
-    }
     let time = schedulingQuery.week.getTime();
 
     // 鏍煎紡鍖栨棩鏈熶负 YYYY-MM-DD 鏍煎紡
@@ -669,10 +628,8 @@
         proxy.$modal.msgSuccess("鎿嶄綔鎴愬姛");
         schedulingVisible.value = false;
         schedulingQuery.week = "";
-        schedulingQuery.deptId = "";
         schedulingQuery.userId = null;
         schedulingQuery.shift = "";
-        personList.value = [];
         refresh();
       })
       .catch(err => {
@@ -726,7 +683,8 @@
         }
         proxy.$download.saveAs(blob, fileName + ".xlsx");
       })
-      .catch(err => {})
+      .catch(err => {
+      })
       .finally(() => {
         downLoading.value = false;
       });
@@ -751,18 +709,7 @@
   // 鏌ヨ瑙勫垯鍒楄〃
   const fetchData = () => {
     getAttendanceRules({ current: -1, size: -1 }).then(res => {
-      const records = Array.isArray(res?.data?.records) ? res.data.records : [];
-      const appendList = [
-        { id: 998, shift: "浼戞伅" },
-        { id: 999, shift: "璇峰亣" },
-      ];
-      const exists = new Set(records.map(r => String(r?.id)));
-      appendList.forEach(item => {
-        if (!exists.has(String(item.id))) {
-          records.push(item);
-        }
-      });
-      classType.value = records;
+      classType.value = res.data.records;
     });
   };
   // 鑾峰彇鐢ㄦ埛
@@ -777,61 +724,8 @@
       staffState: 1,
     }).then(res => {
       let arr = res.data.records;
-      personListAll.value = arr;
-      updatePersonListByDept();
+      personList.value = arr;
     });
-  };
-
-  const findDeptNodeById = (deptId, deptList = deptOptions.value) => {
-    const list = Array.isArray(deptList) ? deptList : [];
-    for (const node of list) {
-      if (String(node.id) === String(deptId)) return node;
-      if (node.children && node.children.length) {
-        const found = findDeptNodeById(deptId, node.children);
-        if (found) return found;
-      }
-    }
-    return null;
-  };
-
-  const collectDeptIds = node => {
-    const ids = [];
-    if (!node) return ids;
-    ids.push(String(node.id));
-    if (node.children && node.children.length) {
-      node.children.forEach(child => {
-        ids.push(...collectDeptIds(child));
-      });
-    }
-    return ids;
-  };
-
-  const updatePersonListByDept = () => {
-    if (!schedulingQuery.deptId) {
-      personList.value = [];
-      return;
-    }
-    const node = findDeptNodeById(schedulingQuery.deptId);
-    const deptIds = new Set(collectDeptIds(node));
-    personList.value = (personListAll.value || []).filter(item => {
-      const itemDeptId = item.deptId ?? item.sysDeptId ?? item.dept_id;
-      return deptIds.has(String(itemDeptId));
-    });
-  };
-
-  const setDefaultShiftByDept = () => {
-    if (!schedulingQuery.deptId) {
-      schedulingQuery.shift = "";
-      return;
-    }
-    const first = schedulingClassType.value?.[0];
-    schedulingQuery.shift = first ? first.id : "";
-  };
-
-  const onSchedulingDeptChange = () => {
-    schedulingQuery.userId = null;
-    updatePersonListByDept();
-    setDefaultShiftByDept();
   };
 
   // 鏍规嵁瀛楀吀鑾峰彇鏃ユ湡
@@ -867,27 +761,6 @@
     }
     monthList.value.reverse();
   });
-
-  watch(
-    () => classType.value,
-    () => {
-      if (schedulingVisible.value && schedulingQuery.deptId) {
-        setDefaultShiftByDept();
-      }
-    }
-  );
-
-  watch(
-    () => schedulingVisible.value,
-    val => {
-      if (!val) return;
-      schedulingQuery.week = "";
-      schedulingQuery.deptId = "";
-      schedulingQuery.userId = null;
-      schedulingQuery.shift = "";
-      personList.value = [];
-    }
-  );
 </script>
 
 <style scoped>
@@ -1100,7 +973,7 @@
   .user-stats {
     /* display: flex; */
     /* flex-wrap: wrap;
-                                                                                                                                                                                                                                                                                                      gap: 10px; */
+                                                                                                                                                                                                                                                                                        gap: 10px; */
     margin-bottom: 4px;
   }
 

--
Gitblit v1.9.3