From 53507e9d94f9229a2dbad799df7e52aa1468740c Mon Sep 17 00:00:00 2001
From: gongchunyi <deslre0381@gmail.com>
Date: 星期三, 29 七月 2026 17:55:34 +0800
Subject: [PATCH] chore: 宏腾新型环保测试环境配置文件

---
 src/views/personnelManagement/attendanceCheckin/checkinRules/index.vue |   93 ++++++++++++++++++++++++++++++++++------------
 1 files changed, 69 insertions(+), 24 deletions(-)

diff --git a/src/views/personnelManagement/attendanceCheckin/checkinRules/index.vue b/src/views/personnelManagement/attendanceCheckin/checkinRules/index.vue
index c47dd2e..9658b1f 100644
--- a/src/views/personnelManagement/attendanceCheckin/checkinRules/index.vue
+++ b/src/views/personnelManagement/attendanceCheckin/checkinRules/index.vue
@@ -13,30 +13,37 @@
         </el-button>
       </div>
     </div>
-    <!-- 鏌ヨ鏉′欢 -->
-    <!-- <el-form :model="searchForm"
+    <el-form :model="searchForm"
              :inline="true"
              class="search-form mb16">
       <el-form-item label="閮ㄩ棬锛�"
-                    prop="countId">
-        <el-tree-select v-model="searchForm.countId"
+                    prop="sysDeptId">
+        <el-tree-select v-model="searchForm.sysDeptId"
                         :data="deptOptions"
                         :props="{ value: 'id', label: 'label', children: 'children' }"
                         value-key="id"
                         placeholder="璇烽�夋嫨閮ㄩ棬"
                         check-strictly
+                        clearable
                         style="width: 200px" />
       </el-form-item>
-      <el-form-item label="鍦扮偣锛�"
-                    prop="locationName">
-        <el-input v-model="searchForm.locationName"
-                  placeholder="璇疯緭鍏ュ湴鐐瑰悕绉�"
-                  clearable
-                  style="width: 200px" />
+      <el-form-item label="鐝锛�"
+                    prop="shift">
+        <el-select v-model="searchForm.shift"
+                   placeholder="璇烽�夋嫨鐝"
+                   clearable
+                   style="width: 200px">
+          <el-option
+              v-for="item in shifts_list"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+          />
+        </el-select>
       </el-form-item>
       <el-form-item>
         <el-button type="primary"
-                   @click="fetchData">
+                   @click="handleSearch">
           <el-icon>
             <Search />
           </el-icon>
@@ -49,7 +56,7 @@
           閲嶇疆
         </el-button>
       </el-form-item>
-    </el-form> -->
+    </el-form>
     <!-- 鐝鍒楄〃 -->
     <el-card shadow="never"
              class="mb16">
@@ -74,23 +81,39 @@
           </template>
         </el-table-column>
         <el-table-column prop="locationName"
-                         label="鍦扮偣鍚嶇О" />
+                         label="鍦扮偣鍚嶇О">
+          <template #default="scope">
+            {{ scope.row.locationName || "-" }}
+          </template>
+        </el-table-column>
         <el-table-column prop="longitude"
-                         label="缁忓害" />
+                         label="缁忓害">
+          <template #default="scope">
+            {{ scope.row.longitude ?? "-" }}
+          </template>
+        </el-table-column>
         <el-table-column prop="latitude"
-                         label="绾害" />
+                         label="绾害">
+          <template #default="scope">
+            {{ scope.row.latitude ?? "-" }}
+          </template>
+        </el-table-column>
         <el-table-column prop="radius"
-                         label="鎵撳崱鑼冨洿(m)" />
+                         label="鎵撳崱鑼冨洿(m)">
+          <template #default="scope">
+            {{ scope.row.radius ?? "-" }}
+          </template>
+        </el-table-column>
         <el-table-column prop="startAt"
                          label="涓婄彮鏃堕棿">
           <template #default="scope">
-            {{ scope.row.startAt }}
+            {{ scope.row.startAt || "-" }}
           </template>
         </el-table-column>
         <el-table-column prop="endAt"
                          label="涓嬬彮鏃堕棿">
           <template #default="scope">
-            {{ scope.row.endAt }}
+            {{ scope.row.endAt || "-" }}
           </template>
         </el-table-column>
         <el-table-column label="鎿嶄綔"
@@ -100,9 +123,11 @@
           <template #default="scope">
             <el-button type="primary"
                        link
+                       :disabled="isRuleLocked(scope.row)"
                        @click="openForm('edit', scope.row)">缂栬緫</el-button>
             <el-button type="danger"
                        link
+                       :disabled="isRuleLocked(scope.row)"
                        @click="handleDelete(scope.row.id)">鍒犻櫎</el-button>
           </template>
         </el-table-column>
@@ -124,7 +149,7 @@
 </template>
 
 <script setup>
-  import { ref, reactive, onMounted } from "vue";
+  import { ref, reactive, onMounted, getCurrentInstance } from "vue";
   import { ElMessage, ElMessageBox } from "element-plus";
   import {
     Plus,
@@ -158,8 +183,8 @@
 
   // 鏌ヨ琛ㄥ崟
   const searchForm = reactive({
-    countId: "",
-    locationName: "",
+    sysDeptId: "",
+    shift: "",
   });
 
   // 閮ㄩ棬閫夐」
@@ -187,6 +212,10 @@
     if (!value) return "";
     const shift = shifts_list.value.find(item => item.value === value);
     return shift ? shift.label : value;
+  };
+
+  const isRuleLocked = row => {
+    return Boolean(row?.usageLocked || row?.canEdit === false || row?.canDelete === false);
   };
 
   // 鑾峰彇閮ㄩ棬鍒楄〃
@@ -232,12 +261,18 @@
     tableLoading.value = true;
     getAttendanceRules({ ...page, ...searchForm })
       .then(res => {
-        tableData.value = res.data.records;
+        const records = Array.isArray(res?.data?.records) ? res.data.records : [];
+        tableData.value = records.filter(r => String(r?.id) !== "999");
         page.total = res.data.total;
       })
       .finally(() => {
         tableLoading.value = false;
       });
+  };
+
+  const handleSearch = () => {
+    page.current = 1;
+    fetchData();
   };
 
   // 鍒嗛〉鍙樻洿
@@ -249,13 +284,18 @@
 
   // 閲嶇疆鎼滅储
   const resetSearch = () => {
-    searchForm.countId = "";
-    searchForm.locationName = "";
+    searchForm.sysDeptId = "";
+    searchForm.shift = "";
+    page.current = 1;
     fetchData();
   };
 
   // 鎵撳紑琛ㄥ崟
   const openForm = (type, row = {}) => {
+    if (type === "edit" && isRuleLocked(row)) {
+      ElMessage.warning("璇ョ彮娆¢厤缃凡琚帓鐝苟浜х敓鎵撳崱璁板綍锛屼笉鑳界紪杈�");
+      return;
+    }
     operationType.value = type;
     currentRow.value = row;
     dialogVisible.value = true;
@@ -263,6 +303,11 @@
 
   // 鍒犻櫎鐝
   const handleDelete = id => {
+    const row = tableData.value.find(item => String(item.id) === String(id));
+    if (isRuleLocked(row)) {
+      ElMessage.warning("瀛樺湪宸叉帓鐝笖宸叉湁鎵撳崱璁板綍鐨勭彮娆¢厤缃紝涓嶈兘鍒犻櫎");
+      return;
+    }
     ElMessageBox.confirm("纭畾瑕佸垹闄よ繖鏉$彮娆″悧锛�", "鍒犻櫎纭", {
       confirmButtonText: "纭畾",
       cancelButtonText: "鍙栨秷",

--
Gitblit v1.9.3