From 8d4473d1b502ca5183981e04d3b2686b4f045ec6 Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期一, 12 一月 2026 09:27:35 +0800
Subject: [PATCH] fix: 在PDA上文字不转码

---
 src/pages/outbound/materialOutbound.vue |   21 ++++++++++++++++-----
 1 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/src/pages/outbound/materialOutbound.vue b/src/pages/outbound/materialOutbound.vue
index 0c7bbcf..5404ec1 100644
--- a/src/pages/outbound/materialOutbound.vue
+++ b/src/pages/outbound/materialOutbound.vue
@@ -364,15 +364,26 @@
   uni.$on("scanMaterial", getScanCode);
 };
 
+// 瀹夊叏瑙g爜锛堝吋瀹瑰凡瑙g爜鎴栨湭缂栫爜鐨勬儏鍐碉級
+const safeDecode = (val: any) => {
+  if (typeof val !== "string") return val || "";
+  try {
+    // 濡傛灉鏄紪鐮佽繃鐨勶紙鍖呭惈 %锛夛紝decode 涓�娆★紱鍚﹀垯鐩存帴杩斿洖
+    return val.includes("%") ? decodeURIComponent(val) : val;
+  } catch (e) {
+    return val;
+  }
+};
+
 onLoad((options: any) => {
   // 浠庤矾鐢卞弬鏁颁腑鑾峰彇鐗╂枡鍩烘湰淇℃伅銆佸嚭搴撳崟淇℃伅鍜� vsrccode
   currentMaterial.value = {
-    materialname: options.materialname || "-",
-    materialspec: options.materialspec || "-",
+    materialname: safeDecode(options.materialname || "-"),
+    materialspec: safeDecode(options.materialspec || "-"),
     shippedQuantity: Number(options.shippedQuantity || 0),
-    cdeliveryid: options.cdeliveryid || "",
-    cdeliverybid: options.cdeliverybid || "",
-    materialcode: options.materialcode || "",
+    cdeliveryid: safeDecode(options.cdeliveryid || ""),
+    cdeliverybid: safeDecode(options.cdeliverybid || ""),
+    materialcode: safeDecode(options.materialcode || ""),
   };
   vsrccode.value = options.vsrccode || "";
 });

--
Gitblit v1.9.3