From 90c8680cbc67d4b2680b1e5af4ad1129a96efa0c Mon Sep 17 00:00:00 2001 From: gaoluyang <2820782392@qq.com> Date: 星期二, 06 五月 2025 14:39:09 +0800 Subject: [PATCH] 1.设备工具明细和树-过期标红 --- src/views/CNAS/resourceDemand/device/component/management.vue | 16 ++++++++++++++-- 1 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/views/CNAS/resourceDemand/device/component/management.vue b/src/views/CNAS/resourceDemand/device/component/management.vue index 8d74156..191a580 100644 --- a/src/views/CNAS/resourceDemand/device/component/management.vue +++ b/src/views/CNAS/resourceDemand/device/component/management.vue @@ -33,7 +33,7 @@ </div> <div class="table" v-show="!showData"> <lims-table :tableData="tableData" :column="column" :tableLoading="tableLoading" :height="'calc(100vh - 300px)'" - :page="page" @pagination="pagination"></lims-table> + :page="page" @pagination="pagination" :row-class-name="tableRowClassName"></lims-table> </div> <el-dialog :title="isUp ? '璁惧璇︽儏' : '妗f淇'" :visible.sync="dialogVisible" width="70%" top="5vh" :before-close="handleClose"> @@ -477,7 +477,7 @@ { label: "绠$悊缂栧彿", prop: "managementNumber" }, { label: "鎶�鏈寚鏍�", prop: "technicalIndicators" }, { label: "璐疆鏃ユ湡", prop: "acquisitionDate" }, - { label: "鍚敤鏃ユ湡", prop: "activationDate" }, + { label: "鏍″噯鏈夋晥鏈�", prop: "activationDate" }, { label: "绠$悊浜�", prop: "equipmentManagerUser" }, { label: "瀛樻斁鐐�", prop: "storagePoint" }, { label: "鎵�灞為儴闂�", prop: "laboratoryName" }, @@ -606,6 +606,18 @@ this.page.size = limit; this.getList(); }, + tableRowClassName({ row }) { + const today = new Date(); + const targetDate = new Date(row.activationDate); + const fiveDaysBeforeTarget = new Date(targetDate); + // 璁$畻鍓嶄簲澶╃殑鏃ユ湡 + fiveDaysBeforeTarget.setDate(targetDate.getDate() - 5); + // 姣旇緝鏃堕渶瑕佺‘淇濇瘮杈冪殑鏄畬鏁寸殑鏃ユ湡鏃堕棿锛屽寘鍚椂鍒嗙 + if (today > fiveDaysBeforeTarget) { + return 'red-row'; + } + return ''; + }, refresh() { this.queryParams = {}; this.page.current = 1; -- Gitblit v1.9.3