From e705ef7b15c04307d6f37b388564dedfaeef4a55 Mon Sep 17 00:00:00 2001
From: 张诺 <zhang_12370@163.com>
Date: 星期二, 21 四月 2026 15:27:09 +0800
Subject: [PATCH] 阳光彩印web 生产报工的机台展示

---
 src/views/personnelManagement/employeeRecord/index.vue |   48 +++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 47 insertions(+), 1 deletions(-)

diff --git a/src/views/personnelManagement/employeeRecord/index.vue b/src/views/personnelManagement/employeeRecord/index.vue
index d0c97b4..c88336a 100644
--- a/src/views/personnelManagement/employeeRecord/index.vue
+++ b/src/views/personnelManagement/employeeRecord/index.vue
@@ -35,6 +35,7 @@
           :tableLoading="tableLoading"
           @pagination="pagination"
           :total="page.total"
+          :rowClassName="rowClassName"
       ></PIMTable>
     </div>
     <show-form-dia ref="formDia" @close="handleQuery"></show-form-dia>
@@ -138,6 +139,16 @@
     width: 100,
   },
   {
+    label: "鍛樺伐閫氳鍦板潃",
+    prop: "contactAddress",
+    minWidth: 180,
+  },
+  {
+    label:"鍚堝悓鍒版湡鏃堕棿",
+    prop: "contractExpireTime",
+    minWidth: 120,
+  },
+  {
     dataType: "action",
     label: "鎿嶄綔",
     align: "center",
@@ -191,6 +202,33 @@
   }
   getList();
 };
+
+const rowClassName = ({ row }) => {
+  const dateStr = row.contractExpireTime;
+
+  if (!dateStr) return '';
+
+  const now = new Date();
+  const target = new Date(dateStr.replace(/-/g, '/')); // 鍏煎 Safari
+
+  // 褰掗浂鏃堕棿锛堝叧閿紒锛�
+  now.setHours(0, 0, 0, 0);
+  target.setHours(0, 0, 0, 0);
+
+  const days = Math.ceil((target - now) / (1000 * 60 * 60 * 24));
+
+  console.log('鍓╀綑澶╂暟:', days);
+
+  //  瓒呰繃45澶╋細姝e父
+  if (days > 45) return '';
+
+  //  0~45澶╋細棰勮锛堜綘鍙互鎹㈤鑹诧級
+  if (days >= 0) return 'bg-warning';
+
+  //  宸茶繃鏈�
+  return 'bg-danger';
+};
+
 // 鏌ヨ鍒楄〃
 /** 鎼滅储鎸夐挳鎿嶄綔 */
 const handleQuery = () => {
@@ -275,4 +313,12 @@
 });
 </script>
 
-<style scoped></style>
+<style scoped>
+:deep(.el-table .bg-warning > td.el-table__cell) {
+  background-color: #fdf2e3;
+}
+
+:deep(.el-table .bg-danger > td.el-table__cell) {
+  background-color: #ffe5e5;
+}
+</style>

--
Gitblit v1.9.3