From b734f50f0a1594b215bd8ceee0406947ed85b4b9 Mon Sep 17 00:00:00 2001 From: HongxuanG <1359774872@qq.com> Date: Tue, 6 Oct 2026 14:56:29 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=89=8B=E5=8A=A8=E8=BF=9B=E4=BB=93?= =?UTF-8?q?=E9=87=8D=E9=87=8F=E4=B8=BA=E7=A9=BA=E6=97=B6=E4=B8=8D=E5=86=8D?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E6=98=BE=E7=A4=BA0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/storefabric/storeFabricManualIn.vue | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/pages/storefabric/storeFabricManualIn.vue b/src/pages/storefabric/storeFabricManualIn.vue index 2e84820..c888d84 100644 --- a/src/pages/storefabric/storeFabricManualIn.vue +++ b/src/pages/storefabric/storeFabricManualIn.vue @@ -152,11 +152,20 @@ function emptyDetail() { } function toWeightInt(kg) { - const n = Number(kg); - if (!Number.isFinite(n) || n < 0) return null; + const raw = String(kg == null ? '' : kg).trim(); + if (!raw) return null; + const n = Number(raw); + if (!Number.isFinite(n) || n <= 0) return null; return Math.round(n * WEIGHT_SCALE); } +function formatDisplayWeightKg(value) { + if (value == null || value === '') return ''; + const n = Number(value); + if (!Number.isFinite(n) || n <= 0) return ''; + return String(formatWeightKg(n)); +} + function normalizeLevelIds(value) { if (Array.isArray(value)) { return value.map((item) => Number(item)).filter((item) => Number.isFinite(item)); @@ -344,15 +353,13 @@ export default { machine_number: data.machine_number || '', grey_fabric_name: data.grey_fabric_name || '', grey_fabric_code: data.grey_fabric_code || '', - inspection_weight: data.inspection_weight != null ? data.inspection_weight : null, + inspection_weight: formatDisplayWeightKg(data.inspection_weight) ? data.inspection_weight : null, grey_fabric_level_id: levelIds, grey_fabric_level_name: data.grey_fabric_level_name || '', inspector_id: data.inspector_id != null ? data.inspector_id : null, inspector_name: data.inspector_name || '', }; - this.weightKg = data.inspection_weight != null - ? String(formatWeightKg(data.inspection_weight)) - : ''; + this.weightKg = formatDisplayWeightKg(data.inspection_weight); this.scanCode = this.detail.fabric_piece_code; }, async submitInWarehouse() {