From 8f845ec72eecdbaef3badcceda75d59b6efef416 Mon Sep 17 00:00:00 2001
From: tjx <t2856754968@163.com>
Date: 星期二, 04 十一月 2025 13:48:48 +0800
Subject: [PATCH] 样式调整

---
 utils/equipmentInspection.js |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/utils/equipmentInspection.js b/utils/equipmentInspection.js
index 68cac48..c665870 100644
--- a/utils/equipmentInspection.js
+++ b/utils/equipmentInspection.js
@@ -28,11 +28,11 @@
 	};
 }
 
-export async function queryEquipmentInspection(vueCtx, { machineNo, year }, options = {}) {
+export async function queryEquipmentInspection(vueCtx, { machineNo, date }, options = {}) {
 	const { mock = true, showLoading = false } = options;
 	const params = {
 		url: '/EquipmentInspection/Query',
-		data: { machineNo, year },
+		data: { machineNo, date },
 		showLoading
 	};
 
@@ -58,6 +58,8 @@
 	}
 
 	if (mock) {
+		// 浠� date (yyyy-MM) 鎻愬彇骞翠唤鐢ㄤ簬缂撳瓨key
+		const year = date ? date.split('-')[0] : new Date().getFullYear();
 		const cacheKey = buildStorageKey(machineNo, year);
 		const cache = uni.getStorageSync(cacheKey);
 		if (cache) {
@@ -73,11 +75,11 @@
 	return buildDefaultRecord();
 }
 
-export async function saveEquipmentInspection(vueCtx, { machineNo, year, dailyChecks, monthlyChecks }, options = {}) {
+export async function saveEquipmentInspection(vueCtx, { machineNo, date, dailyChecks, monthlyChecks }, options = {}) {
 	const { mock = true, showLoading = true } = options;
 	const payload = {
 		machineNo,
-		year,
+		date,
 		dailyChecks,
 		monthlyChecks
 	};
@@ -107,6 +109,8 @@
 
 	if (mock) {
 		// 鏈湴缂撳瓨妯℃嫙淇濆瓨锛屼究浜庡墠绔紨绀轰笌鑱旇皟
+		// 浠� date (yyyy-MM) 鎻愬彇骞翠唤鐢ㄤ簬缂撳瓨key
+		const year = date ? date.split('-')[0] : new Date().getFullYear();
 		const cacheKey = buildStorageKey(machineNo, year);
 		uni.setStorageSync(cacheKey, JSON.stringify(payload));
 		return { success: true, message: '宸蹭繚瀛樿嚦鏈湴缂撳瓨' };

--
Gitblit v1.9.3