From 04d6024553ac73e67148ce578cb01b541eebd02a Mon Sep 17 00:00:00 2001
From: yyb <995253665@qq.com>
Date: 星期一, 18 五月 2026 16:37:56 +0800
Subject: [PATCH] Merge branch 'dev_NEW_pro' into dev-new_pro_OA

---
 src/views/equipmentManagement/measurementEquipment/index.vue |   48 +++++++++++++++++++++++++++++++++++-------------
 1 files changed, 35 insertions(+), 13 deletions(-)

diff --git a/src/views/equipmentManagement/measurementEquipment/index.vue b/src/views/equipmentManagement/measurementEquipment/index.vue
index c1d5379..d2ec2d7 100644
--- a/src/views/equipmentManagement/measurementEquipment/index.vue
+++ b/src/views/equipmentManagement/measurementEquipment/index.vue
@@ -42,6 +42,7 @@
 				:tableLoading="tableLoading"
 				@pagination="pagination"
         :dbRowClick="dbRowClick"
+        :rowClassName="rowClassName"
 			></PIMTable>
 		</div>
 		<form-dia ref="formDia" @close="handleQuery"></form-dia>
@@ -89,12 +90,6 @@
     align: "center",
   },
 	{
-		label: "瀹夎浣嶇疆",
-		prop: "instationLocation",
-		width: 150,
-    align:"center"
-	},
-	{
 		label: "妫�瀹氬崟浣�",
 		prop: "unit",
 		width: 200,
@@ -130,12 +125,6 @@
 		width: 130,
     align:"center"
 	},
-  {
-    label: "妫�瀹氬懆鏈�(澶�)",
-    prop: "cycle",
-    width: 130,
-    align:"center"
-  },
   {
     label: "鐘舵��",
     prop: "status",
@@ -193,6 +182,31 @@
 
 const dbRowClick = (row)=>{
   rowClickData.value?.openDialog(row)
+}
+
+// 琛屾牱寮忥細蹇埌鏈燂紙7澶╁唴锛夋垨閫炬湡鏍囩孩
+const rowClassName = ({ row }) => {
+  console.log('rowClassName called:', row);
+  // valid 鏄湁鏁堝ぉ鏁帮紝mostDate 鏄渶鏂版瀹氭棩鏈�
+  if (row.valid && row.mostDate) {
+    const mostDate = new Date(row.mostDate);
+    // 璁$畻鍒版湡鏃ユ湡 = 妫�瀹氭棩鏈� + 鏈夋晥澶╂暟
+    const validDays = parseInt(row.valid) || 0;
+    const expireDate = new Date(mostDate);
+    expireDate.setDate(expireDate.getDate() + validDays);
+    
+    const now = new Date();
+    const diffDays = Math.ceil((expireDate - now) / (1000 * 60 * 60 * 24));
+    console.log('row:', row.code, 'validDays:', validDays, 'expireDate:', expireDate, 'diffDays:', diffDays);
+    // 7澶╁唴鍒版湡鎴栧凡閫炬湡閮芥爣绾�
+    if (diffDays <= 7) {
+      console.log('return warning-row');
+      return 'warning-row';
+    }
+  } else {
+    console.log('row missing valid or mostDate:', row.valid, row.mostDate);
+  }
+  return '';
 }
 
 // 琛ㄦ牸閫夋嫨鏁版嵁
@@ -294,5 +308,13 @@
 </script>
 
 <style scoped>
-
+:deep(.el-table .warning-row) {
+  background-color: #fef0f0 !important;
+}
+:deep(.el-table .warning-row:hover > td) {
+  background-color: #f9d5d5 !important;
+}
+:deep(.el-table .el-table__body tr.warning-row td) {
+  background-color: #fef0f0 !important;
+}
 </style>
\ No newline at end of file

--
Gitblit v1.9.3