From 1ef08126ca554a8cd4b9ba47d19dc3b790e2c018 Mon Sep 17 00:00:00 2001
From: yyb <995253665@qq.com>
Date: 星期二, 19 五月 2026 17:21:19 +0800
Subject: [PATCH] Merge branch 'dev-new_pro_OA' of http://114.132.189.42:9002/r/product-inventory-management into dev-new_pro_OA
---
src/views/equipmentManagement/measurementEquipment/index.vue | 74 ++++++++++++++++++++++++++----------
1 files changed, 53 insertions(+), 21 deletions(-)
diff --git a/src/views/equipmentManagement/measurementEquipment/index.vue b/src/views/equipmentManagement/measurementEquipment/index.vue
index 129f23b..d2ec2d7 100644
--- a/src/views/equipmentManagement/measurementEquipment/index.vue
+++ b/src/views/equipmentManagement/measurementEquipment/index.vue
@@ -1,6 +1,6 @@
<template>
<div class="app-container">
- <div class="search_form">
+ <div class="search_form mb20">
<div>
<span class="search_title">褰曞叆鏃ユ湡锛�</span>
<el-date-picker
@@ -23,6 +23,7 @@
<el-button type="primary" @click="handleQuery" style="margin-left: 10px"
>鎼滅储</el-button
>
+ <el-button @click="handleReset" style="margin-left: 10px">閲嶇疆</el-button>
</div>
<div>
<el-button type="primary" @click="openForm('add')">鏂板璁¢噺鍣ㄥ叿</el-button>
@@ -41,6 +42,7 @@
:tableLoading="tableLoading"
@pagination="pagination"
:dbRowClick="dbRowClick"
+ :rowClassName="rowClassName"
></PIMTable>
</div>
<form-dia ref="formDia" @close="handleQuery"></form-dia>
@@ -51,7 +53,7 @@
</template>
<script setup>
-import {onMounted, ref} from "vue";
+import {onMounted, ref, reactive, toRefs, getCurrentInstance, nextTick} from "vue";
import FormDia from "@/views/equipmentManagement/measurementEquipment/components/formDia.vue";
import {ElMessageBox} from "element-plus";
import useUserStore from "@/store/modules/user.js";
@@ -81,18 +83,12 @@
minWidth:150,
align:"center"
},
- {
- label: "閮ㄩ棬",
- prop: "deptName",
- width: 130,
- align:"center"
- },
- {
- label: "瀹夎浣嶇疆",
- prop: "installationLocation",
- width: 150,
- align:"center"
- },
+ {
+ label: "璁¢噺鍣ㄥ叿鍚嶇О",
+ prop: "name",
+ width: '160px',
+ align: "center",
+ },
{
label: "妫�瀹氬崟浣�",
prop: "unit",
@@ -129,12 +125,6 @@
width: 130,
align:"center"
},
- {
- label: "妫�瀹氬懆鏈�(澶�)",
- prop: "cycle",
- width: 130,
- align:"center"
- },
{
label: "鐘舵��",
prop: "status",
@@ -194,6 +184,31 @@
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 '';
+}
+
// 琛ㄦ牸閫夋嫨鏁版嵁
const handleSelectionChange = (selection) => {
selectedRows.value = selection;
@@ -204,6 +219,15 @@
// 鏌ヨ鍒楄〃
/** 鎼滅储鎸夐挳鎿嶄綔 */
const handleQuery = () => {
+ page.current = 1;
+ getList();
+};
+
+// 閲嶇疆鎼滅储鏉′欢
+const handleReset = () => {
+ searchForm.value.recordDate = "";
+ searchForm.value.code = "";
+ searchForm.value.status = "";
page.current = 1;
getList();
};
@@ -284,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