From 01175f85df1e8402ada5a30aacfeb18fa621e95e Mon Sep 17 00:00:00 2001
From: chen.lin <1442464845@qq.com>
Date: 星期三, 28 一月 2026 16:15:11 +0800
Subject: [PATCH] 委外加工出库单同步+PDA出库功能

---
 src/main/webapp/views/pda/combProAgv.html |  124 +++++++++++++++++++++++------------------
 1 files changed, 70 insertions(+), 54 deletions(-)

diff --git a/src/main/webapp/views/pda/combProAgv.html b/src/main/webapp/views/pda/combProAgv.html
index e324cc2..e8c8eac 100644
--- a/src/main/webapp/views/pda/combProAgv.html
+++ b/src/main/webapp/views/pda/combProAgv.html
@@ -87,11 +87,10 @@
                oninput="if(value.length>8)value=value.slice(0,8)" placeholder="鎵爜 / 杈撳叆" autocomplete="off">
     </div>
     <div class="layui-form">
-        <div style="margin: 5px 1px 5px 5px; display: inline-block">
+        <div style="margin: 5px 1px 5px 5px; display: none">
             <button id="mat-btn" type="button" class="layui-btn layui-btn-normal" onclick="getMat()"><i class="layui-icon">+</i>鎻愬彇</button>
         </div>
         <div style="display: inline-block">
-            宸ヤ綔鍖�
             <!-- 宸ヤ綔鍖� -->
             <div class="layui-inline" style="width: 100px; margin-left: 10px">
                 <select id="devpSelect">
@@ -241,35 +240,51 @@
             }
         });
 
+        // 鑾峰彇宸ヤ綔鍖�
+        function getDevp(){
+            $.ajax({
+                url: baseUrl+"/agv/put/site",
+                headers: {'token': localStorage.getItem('token')},
+                method: 'POST',
+                async: false,
+                success: function (res) {
+                    if (res.code === 200){
+                        var tpl = $("#devpSelectTemplate").html();
+                        var template = Handlebars.compile(tpl);
+                        var html = template(res);
+                        $('#devpSelect').append(html);
+                        layui.form.render('select');
+                    } else if (res.code === 403){
+                        top.location.href = baseUrl+"/pda";
+                    }else {
+                        tips("鑾峰彇宸ヤ綔鍖哄け璐�", true)
+                    }
+                }
+            })
+        }
+        getDevp();
     });
 
-    // 鑾峰彇宸ヤ綔鍖�
-    function getDevp(){
-        $.ajax({
-            url: baseUrl+"/available/put/site",
-            headers: {'token': localStorage.getItem('token')},
-            method: 'POST',
-            async: false,
-            success: function (res) {
-                if (res.code === 200){
-                    var tpl = $("#devpSelectTemplate").html();
-                    var template = Handlebars.compile(tpl);
-                    var html = template(res);
-                    $('#devpSelect').append(html);
-                    layui.form.render('select');
-                } else if (res.code === 403){
-                    top.location.href = baseUrl+"/pda";
-                }else {
-                    tips("鑾峰彇宸ヤ綔鍖哄け璐�", true)
-                }
+    var matCodeLayerIdx;
+    function getMat() {
+        matCodeLayerIdx = layer.open({
+            type: 2,
+            title: '鎻愬彇鐗╂枡',
+            shade: [0.3,'#000'],
+            area: ['90%', '90%'],
+            content: 'matQuery.html',
+            success: function(layero, index){
+                $('.layui-layer-title').css('font-size', '16px');
+            },
+            end: function () {
+                $('#mat-btn').focus();
             }
-        })
+        });
     }
-    getDevp();
+
+
 
     // 娣诲姞琛ㄦ牸鏁版嵁
-    //    var matData = [];
-
     function addTableData(data) {
         for (var i = 0; i < data.length; i++) {
             var toPush = true;
@@ -288,9 +303,9 @@
                     mnemonic: data[i].mnemonic,
                 });
             }
+            tips("鎻愬彇鎴愬姛");
+            tableIns.reload({data: matData});
         }
-        tableIns.reload({data: matData});
-//        $("#comb-btn").focus();
     }
 
 
@@ -309,14 +324,15 @@
             return;
         }
         // 璧嬪�煎墠娓呯┖琛ㄦ牸
-//        matData = [];
+        matData = [];
         tableIns.reload({data: matData});
 
         $.ajax({
             url: baseUrl + "/mobile/bill/query/auth",
             headers: {'token': localStorage.getItem('token')},
             data: {
-                billNo: billNo
+                billNo: billNo,
+                mnemonic: '',
             },
             method: 'POST',
             success: function (res) {
@@ -324,9 +340,9 @@
                     if (res.data != null) {
                         addTableData(res.data);
                         // 寤惰繜1绉掑悗娓呯┖閫氱煡鍗曞彿
-                        setTimeout(function () {
-                            $('#billNo').val("");
-                        }, 500);
+                        // setTimeout(function () {
+                        //     $('#billNo').val("");
+                        // }, 500);
                     }
                 } else if (res.code === 403) {
                     top.location.href = baseUrl + "/pda";
@@ -420,28 +436,28 @@
             tips("璇烽�夋嫨宸ヤ綔鍖�", true);
             return;
         }
-        alert("灏忚溅鍏宠仈缁勬墭瀹屾垚锛堝姛鑳借繕鏈疄鐜帮級");
-//        $.ajax({
-//            url: baseUrl + "/mobile/comb/auth/batch",
-//            headers: {'token': localStorage.getItem('token')},
-//            data: JSON.stringify({
-//                barcode: barcode,
-//                combMats: matData,
-//            }),
-//            contentType: 'application/json;charset=UTF-8',
-//            method: 'POST',
-//            async: false,
-//            success: function (res) {
-//                if (res.code === 200) {
-//                    reset();
-//                    tips("缁勬墭鎴愬姛")
-//                } else if (res.code === 403) {
-//                    top.location.href = baseUrl + "/pda";
-//                } else {
-//                    tips(res.msg, true)
-//                }
-//            }
-//        })
+       $.ajax({
+           url: baseUrl + "/mobile/comb/auth/batch",
+           headers: {'token': localStorage.getItem('token')},
+           data: JSON.stringify({
+               barcode: barcode,
+               combMats: matData,
+               agvSite: devp
+           }),
+           contentType: 'application/json;charset=UTF-8',
+           method: 'POST',
+           async: false,
+           success: function (res) {
+               if (res.code === 200) {
+                   reset();
+                   tips("缁勬墭鎴愬姛")
+               } else if (res.code === 403) {
+                   top.location.href = baseUrl + "/pda";
+               } else {
+                   tips(res.msg, true)
+               }
+           }
+       })
     }
 
     /**

--
Gitblit v1.9.1