From 0c4429a719f5c95a7690fae51efaaa799ef4e77d Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期一, 25 五月 2026 10:02:48 +0800
Subject: [PATCH] fix: 投入重量改成投入重量/数量
---
src/views/productionManagement/workOrder/components/ProductionRecordForm.vue | 36 ++++++++++++++++++++++++++----------
1 files changed, 26 insertions(+), 10 deletions(-)
diff --git a/src/views/productionManagement/workOrder/components/ProductionRecordForm.vue b/src/views/productionManagement/workOrder/components/ProductionRecordForm.vue
index 10bfc44..444e470 100644
--- a/src/views/productionManagement/workOrder/components/ProductionRecordForm.vue
+++ b/src/views/productionManagement/workOrder/components/ProductionRecordForm.vue
@@ -17,7 +17,7 @@
type: Number,
default: 120
},
- /** 鏈鐢熶骇鏁伴噺锛堟垚鍨嬪伐搴忕敤浜庤绠楁姇鍏ラ噸閲忥級 */
+ /** 鏈鐢熶骇鏁伴噺锛堟垚鍨嬪伐搴忕敤浜庤绠楁姇鍏ラ噸閲�/鏁伴噺锛� */
quantity: {
type: Number,
default: null
@@ -27,7 +27,7 @@
type: Boolean,
default: false
},
- /** 宸ュ崟 BOM 鎶曞叆閲嶉噺锛岄潪鎴愬瀷宸ュ簭鍥炴樉鍒般�屾姇鍏ラ噸閲忋�� */
+ /** 宸ュ崟 BOM 鎶曞叆閲嶉噺锛岄潪鎴愬瀷宸ュ簭鍥炴樉鍒般�屾姇鍏ラ噸閲�/鏁伴噺銆� */
bomInputQty: {
type: Number,
default: null
@@ -39,11 +39,21 @@
list: [] as any[],
});
+const INPUT_WEIGHT_PARAM_ITEM = "鎶曞叆閲嶉噺/鏁伴噺";
+
+/** 鍙傛暟椤瑰睍绀哄悕锛堝吋瀹瑰簱鍐呮棫鍚嶃�屾姇鍏ラ噸閲忋�嶏級 */
+const displayParameterItem = (name) => {
+ const trimmed = String(name ?? "").trim();
+ if (trimmed === "鎶曞叆閲嶉噺") return INPUT_WEIGHT_PARAM_ITEM;
+ return trimmed;
+};
+
const fieldLabel = (item: any) => {
+ const parameterItem = displayParameterItem(item.parameterItem);
if (!item.unit || item.unit === "/") {
- return item.parameterItem;
+ return parameterItem;
}
- return `${item.parameterItem}锛�${item.unit}锛塦;
+ return `${parameterItem}锛�${item.unit}锛塦;
};
const getType = (item: any) => item.type || "鏂囨湰鏍煎紡";
@@ -52,7 +62,11 @@
const result: Record<string, any[]> = {};
formData.list.forEach((item, index) => {
if (String(item.isRequired) === "1") {
- result[`list.${index}.value`] = [{required: true, message: `璇疯緭鍏�${item.parameterItem}`, trigger: "blur"}];
+ result[`list.${index}.value`] = [{
+ required: true,
+ message: `璇疯緭鍏�${displayParameterItem(item.parameterItem)}`,
+ trigger: "blur"
+ }];
}
});
return result;
@@ -66,15 +80,17 @@
const normalizeUnit = (unit) => String(unit ?? "").trim().toLowerCase();
-const isInputWeightItem = (item) =>
- String(item?.parameterItem ?? "").includes("鎶曞叆閲嶉噺") &&
- normalizeUnit(item?.unit) === "kg";
+const isInputWeightItem = (item) => {
+ const name = String(item?.parameterItem ?? "").trim();
+ return (name === "鎶曞叆閲嶉噺" || name.includes(INPUT_WEIGHT_PARAM_ITEM)) &&
+ normalizeUnit(item?.unit) === "kg";
+};
const isBlankCoeffItem = (item) =>
String(item?.parameterItem ?? "").includes("鐢熷澂绯绘暟") &&
normalizeUnit(item?.unit) === "g";
-/** 鎶曞叆閲嶉噺(KG) = 鏈鐢熶骇鏁伴噺 脳 鐢熷澂绯绘暟(g) / 1000 */
+/** 鎶曞叆閲嶉噺/鏁伴噺(KG) = 鏈鐢熶骇鏁伴噺 脳 鐢熷澂绯绘暟(g) / 1000 */
const syncFormingInputWeight = () => {
if (!props.isFormingProcess) return;
const weightItem = formData.list.find(isInputWeightItem);
@@ -93,7 +109,7 @@
weightItem.value = Number(((qty * coeff) / 1000).toFixed(4));
};
-/** 闈炴垚鍨嬶細鎶曞叆閲嶉噺鍙栧伐鍗� bomInputQty锛堜粎鍥炴樉锛屼笉瑕嗙洊鐢ㄦ埛宸茬紪杈戠殑鍊硷級 */
+/** 闈炴垚鍨嬶細鎶曞叆閲嶉噺/鏁伴噺鍙栧伐鍗� bomInputQty锛堜粎鍥炴樉锛屼笉瑕嗙洊鐢ㄦ埛宸茬紪杈戠殑鍊硷級 */
const syncBomInputWeight = (force = false) => {
if (props.isFormingProcess) return;
const weightItem = formData.list.find(isInputWeightItem);
--
Gitblit v1.9.3