From 6c2a0e8132eb77429e26518c0f4dbec50036d018 Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期五, 30 一月 2026 11:45:56 +0800
Subject: [PATCH] fix: 扫码接口变更
---
src/pages/production/twist/receive/monofil.vue | 55 +++++++++++++++++++++++++++++++++----------------------
1 files changed, 33 insertions(+), 22 deletions(-)
diff --git a/src/pages/production/twist/receive/monofil.vue b/src/pages/production/twist/receive/monofil.vue
index de0bfc2..9592c45 100644
--- a/src/pages/production/twist/receive/monofil.vue
+++ b/src/pages/production/twist/receive/monofil.vue
@@ -129,33 +129,44 @@
return;
}
- // 瑙f瀽鎵爜鏁版嵁锛岀幇鍦ㄤ簩缁寸爜鍙寘鍚玦d
+ // 瑙f瀽鎵爜鏁版嵁锛氬彲鑳藉寘鍚� id(outPutId) 鎴� monofilamentNumber
const scanData = JSON.parse(code.code);
const outPutId = scanData.id;
+ const monofilamentNumber = scanData.monofilamentNumber;
- if (!outPutId) {
- toast.error("浜岀淮鐮佹牸寮忛敊璇紝缂哄皯id淇℃伅");
+ let data: any;
+
+ if (outPutId) {
+ // 鏈� outPutId锛氬厛鏌ュ眰绾э紝鍐嶈皟 scarn
+ const { data: tagData } = await TwistApi.getTagByIdLs({
+ outPutId: outPutId,
+ });
+ if (tagData.layer && tagData.layer !== currentLayer.twistedLayer) {
+ toast.error(
+ `棰嗙敤灞傜骇涓嶅锛屽綋鍓嶅眰鏄細${currentLayer.twistedLayer}锛岄鐢ㄥ崟涓濆眰鏄細${tagData.layer}`
+ );
+ }
+ const res = await TwistApi.getScarn({
+ outPutId: outPutId,
+ twistId: currentLayer.twistId,
+ });
+ data = res.data;
+ } else if (monofilamentNumber) {
+ // 鏃� outPutId 鏈� monofilamentNumber锛氬彧璋� scarnTag锛岃繑鍥炲惈 layer 鐢ㄤ簬鎻愮ず
+ const res = await TwistApi.getScarnTag({
+ monofilamentNumber,
+ twistId: currentLayer.twistId,
+ });
+ data = res.data;
+ if (data.layer && data.layer !== currentLayer.twistedLayer) {
+ toast.error(
+ `棰嗙敤灞傜骇涓嶅锛屽綋鍓嶅眰鏄細${currentLayer.twistedLayer}锛岄鐢ㄥ崟涓濆眰鏄細${data.layer}`
+ );
+ }
+ } else {
+ toast.error("浜岀淮鐮佹牸寮忛敊璇紝缂哄皯id鎴栧崟涓濈紪鍙蜂俊鎭�");
return;
}
-
- // 璋冪敤鎺ュ彛鑾峰彇鎷変笣璇︾粏淇℃伅
- const { data: tagData } = await TwistApi.getTagByIdLs({
- outPutId: outPutId,
- });
-
- // 鍒ゆ柇灞傜骇鏄惁鍖归厤锛堝鏋滄帴鍙h繑鍥炵殑鏁版嵁涓湁layer瀛楁锛�
- if (tagData.layer && tagData.layer !== currentLayer.twistedLayer) {
- toast.error(
- `棰嗙敤灞傜骇涓嶅锛屽綋鍓嶅眰鏄細${currentLayer.twistedLayer}锛岄鐢ㄥ崟涓濆眰鏄細${tagData.layer}`
- );
- // return;
- }
-
- // 璋冪敤鍗曚笣棰嗙敤鎵爜鎺ュ彛
- const { data } = await TwistApi.getScarn({
- outPutId: outPutId,
- twistId: currentLayer.twistId,
- });
// 妫�鏌ュ綋鍓嶅眰鏄惁宸插瓨鍦ㄨ鍗曚笣
const exists = currentLayer.strandedWireDish?.some(
--
Gitblit v1.9.3