From e1e6a650f5ece9af7ff0810161edb38d31d540a6 Mon Sep 17 00:00:00 2001
From: 快乐的昕的电脑 <快乐的昕的电脑@DESKTOP-C2BQPQU>
Date: 星期二, 16 九月 2025 08:58:59 +0800
Subject: [PATCH] Merge branch 'master' of http://git.gs-mes.com:8080/r/~tjx/QXPDA

---
 H5/Js/Cpbdsj.js |   29 ++++++++++++++++++++++++++---
 1 files changed, 26 insertions(+), 3 deletions(-)

diff --git a/H5/Js/Cpbdsj.js b/H5/Js/Cpbdsj.js
index 7763b71..329bdf8 100644
--- a/H5/Js/Cpbdsj.js
+++ b/H5/Js/Cpbdsj.js
@@ -48,6 +48,10 @@
     methods: {
         handleAgvPositions(positionStr) {
             if (!positionStr) return [];
+
+            // 妫�鏌ユ槸鍚﹀瓨鍦ㄩ�楀彿锛屽鏋滀笉瀛樺湪鍒欒繑鍥炵┖鏁扮粍
+            if (!positionStr.includes(',')) return [];
+
             // 灏嗗瓧绗︿覆鎸夐�楀彿鍒嗗壊骞惰浆鎹负閫夐」鏁扮粍
             return positionStr.split(',').map(pos => ({
                 name: pos.trim() // 鍘婚櫎鍙兘鐨勭┖鏍�
@@ -71,9 +75,22 @@
                         that.$refs.XBar.focus();
                         that.XbarInfo = [];
                         that.XBar = "";
-                        that.AgvDw = json.data.tbBillList.kbBarInfo[0].agvPostion.split(',')[0];
-                        
-                        that.actionsAgvDw = that.handleAgvPositions(json.data.tbBillList.kbBarInfo[0].agvPostion);
+
+                        // 妫�鏌ユ槸鍚﹀瓨鍦ㄩ�楀彿
+                        //const agvPosition = json.data.tbBillList.kbBarInfo[0].agvPostion;
+                        //that.AgvDw = agvPosition.includes(',') ? agvPosition.split(',')[0] : '';
+                        const agvPostion = json.data && json.data.tbBillList && json.data.tbBillList.kbBarInfo &&
+                            json.data.tbBillList.kbBarInfo[0] && json.data.tbBillList.kbBarInfo[0].agvPostion;
+
+                        if (agvPostion != null) {
+                            const agvPostionStr = String(agvPostion);
+                            that.AgvDw = agvPostionStr.split(',')[0];
+                            that.actionsAgvDw = that.handleAgvPositions(agvPostionStr);
+                        } else {
+                            that.AgvDw = null;
+                            that.actionsAgvDw = null;
+                        }
+
                     }
                     else {
                         that.$playSound('error');
@@ -460,6 +477,12 @@
                 that.$toast.fail("璇峰厛鎵弿鍗℃澘鏉$爜");
                 return;
             }
+
+            if (!that.AgvDw) {
+                that.$playSound('error');
+                that.$toast.fail("璇峰厛閫夋嫨AGV鐐逛綅");
+                return;
+            }
     
             // 璁$畻鍙鏁板拰宸茶鏁�
             const oldqty = +(that.KbBarInfo.quantity || 0);

--
Gitblit v1.9.3