From 0e6db4c630d8db3eacb4aef7abd142be78f9028a Mon Sep 17 00:00:00 2001
From: gongchunyi <deslre0381@gmail.com>
Date: 星期二, 18 八月 2026 23:27:48 +0800
Subject: [PATCH] fix: 设备保养记录日期格式化
---
src/api/viewIndex.js | 44 +++++++++++++++++---------------------------
1 files changed, 17 insertions(+), 27 deletions(-)
diff --git a/src/api/viewIndex.js b/src/api/viewIndex.js
index dafe6e8..2bba3ad 100644
--- a/src/api/viewIndex.js
+++ b/src/api/viewIndex.js
@@ -202,20 +202,20 @@
};
// 渚涘簲鍟嗛噰璐帓鍚�
-export const supplierPurchaseRanking = (query) => {
+export const supplierPurchaseRanking = (params) => {
return request({
url: "/home/supplierPurchaseRanking",
method: "get",
- params: query,
+ params,
});
};
// 瀹㈡埛閲戦璐$尞鎺掑悕
-export const customerContributionRanking = (query) => {
+export const customerContributionRanking = (params) => {
return request({
url: "/home/customerContributionRanking",
method: "get",
- params: query,
+ params,
});
};
@@ -228,10 +228,11 @@
};
// 浜у搧閿�鍞噾棰濆垎鏋�
-export const productSalesAnalysis = () => {
+export const productSalesAnalysis = (params) => {
return request({
url: "/home/productSalesAnalysis",
method: "get",
+ params,
});
};
@@ -245,10 +246,11 @@
};
// 鍘熸潗鏂欓噰璐噾棰濆崰姣�
-export const rawMaterialPurchaseAmountRatio = () => {
+export const rawMaterialPurchaseAmountRatio = (params) => {
return request({
url: "/home/rawMaterialPurchaseAmountRatio",
method: "get",
+ params,
});
};
@@ -262,10 +264,11 @@
};
// 閿�鍞�/閲囪喘/鍌ㄥ瓨浜у搧鏁�
-export const salesPurchaseStorageProductCount = () => {
+export const salesPurchaseStorageProductCount = (startDate, endDate) => {
return request({
url: "/home/salesPurchaseStorageProductCount",
method: "get",
+ params: { startDate, endDate },
});
};
@@ -288,10 +291,11 @@
};
// 浜у搧鍛ㄨ浆澶╂暟
-export const productTurnoverDays = () => {
+export const productTurnoverDays = (params) => {
return request({
url: "/home/productTurnoverDays",
method: "get",
+ params,
});
};
@@ -347,32 +351,19 @@
});
};
-const HOME_PROGRESS_STATUS_LIST = ["all", "waiting", "inProgress", "completed", "paused", "1", "2", "3", "4"];
-const HOME_PROGRESS_TAB_LIST = ["all", "inProgress", "completed", "paused"];
-const HOME_DATE_PATTERN = /^\d{4}-\d{2}-\d{2}$/;
-
-const normalizeDateParam = (value) => {
- const dateText = typeof value === "string" ? value.trim() : "";
- return HOME_DATE_PATTERN.test(dateText) ? dateText : undefined;
-};
-
export const productionOrderProgress = (params = {}) => {
const safePageNum = Math.max(1, Number(params.pageNum || 1));
- const safePageSize = Math.min(50, Math.max(1, Number(params.pageSize || 10)));
- const rawStatus = String(params.status ?? "").trim();
- const safeStatus = HOME_PROGRESS_STATUS_LIST.includes(rawStatus) ? rawStatus : undefined;
- const safeTab = HOME_PROGRESS_TAB_LIST.includes(params.tab) ? params.tab : "all";
- const normalizedTab = safeStatus && HOME_PROGRESS_TAB_LIST.includes(safeStatus) ? safeStatus : safeTab;
+ const safeTab = ["all", "inProgress", "completed", "paused"].includes(params.tab)
+ ? params.tab
+ : "all";
return request({
url: "/home/productionOrderProgress",
method: "get",
params: {
...params,
- status: safeStatus,
- tab: normalizedTab,
- bizDate: normalizeDateParam(params.bizDate),
+ tab: safeTab,
pageNum: safePageNum,
- pageSize: safePageSize,
+ pageSize: params.pageSize,
},
headers: {
handleAuthError: false,
@@ -388,7 +379,6 @@
params: {
...params,
limit: safeLimit,
- planDate: normalizeDateParam(params.planDate),
},
headers: {
handleAuthError: false,
--
Gitblit v1.9.3