tjx
2025-11-04 8f845ec72eecdbaef3badcceda75d59b6efef416
样式调整
已修改1个文件
12 ■■■■■ 文件已修改
utils/equipmentInspection.js 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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: '已保存至本地缓存' };