From f35e9702ac807eb0d35f799912dbb8430cc43bc6 Mon Sep 17 00:00:00 2001
From: 南骏 池 <chiffly@163.com>
Date: 星期一, 15 九月 2025 15:45:58 +0800
Subject: [PATCH] 1.AGV送检VUE2兼容

---
 H5/Js/Cpbdsj.js |   29 ++++++++++++++++++++++++++---
 H5/Cpdbsj.aspx  |    5 +++--
 H5/Qtck.aspx    |    2 +-
 3 files changed, 30 insertions(+), 6 deletions(-)

diff --git a/H5/Cpdbsj.aspx b/H5/Cpdbsj.aspx
index 68b47f0..8f38866 100644
--- a/H5/Cpdbsj.aspx
+++ b/H5/Cpdbsj.aspx
@@ -166,7 +166,8 @@
                     label="鐐逛綅"
                     placeholder="璇烽�夋嫨鐐逛綅"
                     autofocus="true"
-                    @click.native="selectDW">
+                    @click.native="selectDW"
+                    readonly>
                 </van-field>
 
                 <van-field
@@ -265,5 +266,5 @@
 </asp:Content>
 
 <asp:Content ID="Content4" ContentPlaceHolderID="ContentPlaceHolder4" Runat="Server">
-    <script src="Js/Cpbdsj.js?<%=1212111421515 %>"></script>
+    <script src="Js/Cpbdsj.js?<%=1212111421525 %>"></script>
 </asp:Content>
\ No newline at end of file
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);
diff --git a/H5/Qtck.aspx b/H5/Qtck.aspx
index ccd6fe9..b450565 100644
--- a/H5/Qtck.aspx
+++ b/H5/Qtck.aspx
@@ -165,5 +165,5 @@
   <%--<comback ></comback>--%>
 </asp:Content>
 <asp:Content ID="Content4" ContentPlaceHolderID="ContentPlaceHolder4" Runat="Server">
- <script src="Js/Qtck.js?<%=111306 %>"></script>
+ <script src="Js/Qtck.js?<%=111307 %>"></script>
 </asp:Content>

--
Gitblit v1.9.3