From 2d3530a7c11557a40807ad7c0b9e302ce6ce3a9f Mon Sep 17 00:00:00 2001
From: hsy <1029150275@qq.com>
Date: 星期五, 28 八月 2026 10:16:32 +0800
Subject: [PATCH] feat: 综合业务模块页面重构与交互完善

---
 src/views/equipmentManagement/calibration/index.vue |   67 +++++++++++++++++++++++++++++++--
 1 files changed, 63 insertions(+), 4 deletions(-)

diff --git a/src/views/equipmentManagement/calibration/index.vue b/src/views/equipmentManagement/calibration/index.vue
index b04da2e..0d5b9cf 100644
--- a/src/views/equipmentManagement/calibration/index.vue
+++ b/src/views/equipmentManagement/calibration/index.vue
@@ -50,7 +50,13 @@
 				@selection-change="handleSelectionChange"
 				:tableLoading="tableLoading"
 				@pagination="pagination"
-			></PIMTable>
+			>
+				<template #validUntilSlot="{ row }">
+					<span>{{ row.validUntil ? row.validUntil.split(' ')[0] : '' }}</span>
+					<el-tag v-if="isWarning(row.validUntil)" type="warning" class="ml10">鍗冲皢鍒版湡</el-tag>
+					<el-tag v-else-if="isOverdue(row.validUntil)" type="danger" class="ml10">宸查�炬湡</el-tag>
+				</template>
+			</PIMTable>
 		</div>
 		<calibration-dia ref="calibrationDia" @close="handleQuery"></calibration-dia>
 	</div>
@@ -59,6 +65,7 @@
 <script setup>
 import {onMounted, ref, reactive, toRefs, getCurrentInstance, nextTick} from "vue";
 import {ElMessageBox, ElMessage} from "element-plus";
+import dayjs from "dayjs";
 import useUserStore from "@/store/modules/user.js";
 import CalibrationDia from "@/views/equipmentManagement/measurementEquipment/components/calibrationDia.vue";
 import {ledgerRecordListPage, ledgerRecordDelete} from "@/api/equipmentManagement/calibration.js";
@@ -119,9 +126,46 @@
 		width:200
 	},
 	{
-		label: "鏈夋晥鏈�",
+		label: "鏈夋晥鏈�(澶�)",
 		prop: "valid",
 		width: 100,
+	},
+	{
+		label: "鏈夋晥鏈熻嚦",
+		prop: "validUntil",
+		dataType: "slot",
+		slot: "validUntilSlot",
+		width: 160,
+	},
+	{
+		label: "婧簮/鏍告煡绫诲瀷",
+		prop: "traceabilityType",
+		width: 150,
+	},
+	{
+		label: "瀹炴柦鏈烘瀯",
+		prop: "implementingAgency",
+		width: 150,
+	},
+	{
+		label: "璇佷功缂栧彿",
+		prop: "certificateNumber",
+		width: 150,
+	},
+	{
+		label: "鏍稿績缁撴灉",
+		prop: "coreResult",
+		width: 150,
+	},
+	{
+		label: "缁撴灉纭",
+		prop: "resultConfirmation",
+		width: 150,
+	},
+	{
+		label: "纭浜�",
+		prop: "confirmerName",
+		width: 120,
 	},
 	{
 		label: "褰曞叆浜�",
@@ -197,12 +241,27 @@
 const getList = () => {
 	tableLoading.value = true;
 	ledgerRecordListPage({ ...searchForm.value, ...page }).then((res) => {
-		tableLoading.value = false;
 		tableData.value = res.data.records;
 		page.total = res.data.total;
+		tableLoading.value = false;
 	}).catch((err) => {
 		tableLoading.value = false;
-	})
+	});
+};
+
+const isWarning = (validUntil) => {
+	if (!validUntil) return false;
+	const now = dayjs().startOf('day');
+	const until = dayjs(validUntil).startOf('day');
+	const diffDays = until.diff(now, 'day');
+	return diffDays >= 0 && diffDays <= 30;
+};
+
+const isOverdue = (validUntil) => {
+	if (!validUntil) return false;
+	const now = dayjs().startOf('day');
+	const until = dayjs(validUntil).startOf('day');
+	return until.isBefore(now);
 };
 
 // 鎵撳紑妫�瀹氭牎鍑嗗脊妗�

--
Gitblit v1.9.3