From fe6dbaaefef6dd9bb4a1ee26df8ad8b451500a10 Mon Sep 17 00:00:00 2001
From: 曹睿 <360930172@qq.com>
Date: 星期三, 21 五月 2025 09:48:36 +0800
Subject: [PATCH] fix: 修复扫码接口

---
 src/pages/production/twist/receive/monofil.vue |   26 ++++++++++++++++++++------
 1 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/src/pages/production/twist/receive/monofil.vue b/src/pages/production/twist/receive/monofil.vue
index 9c5d9d0..4abc5bc 100644
--- a/src/pages/production/twist/receive/monofil.vue
+++ b/src/pages/production/twist/receive/monofil.vue
@@ -47,16 +47,30 @@
 const toast = useToast();
 
 const getScanCode = async (code: any) => {
-  console.log("鑷畾涔夋壂鎻忕殑缁撴灉鍥炶皟鍑芥暟:", code);
+  // console.log("鑷畾涔夋壂鎻忕殑缁撴灉鍥炶皟鍑芥暟:", code);
   // let parseData = code.trim();
-  let codeArr = code.code.split(",");
-  console.log("sb:", codeArr);
+  console.log("code:===========", JSON.parse(code.code));
+  console.log("id:=============", JSON.parse(code.code).id);
   const { data } = await TwistApi.getScarn({
-    outPutId: codeArr[1],
+    outPutId: JSON.parse(code.code).id,
   });
-  const exists = cardList.value.some((item) => item.id === data.id);
+  const exists = cardList.value.some((item) => item.monofilamentNumber === data.monofilamentNumber);
   if (!exists) {
-    cardList.value.push(data);
+    const { id, outPutId, wireId, oneLength, ...rest } = data;
+    console.log("sb", {
+      wireId: paramsId.value,
+      outputId: id,
+      amount: oneLength,
+      ongLength: oneLength,
+      ...rest,
+    });
+    cardList.value.push({
+      wireId: paramsId.value,
+      outputId: id,
+      amount: oneLength,
+      ongLength: oneLength,
+      ...rest,
+    });
     pagingRef.value.complete(cardList.value);
   } else {
     toast.error("璇ュ崟涓濆凡棰嗙敤锛岃鍕块噸澶嶆壂鐮�");

--
Gitblit v1.9.3