From d4e17a37b2c13ab13123fc373d25ffbedfc5f0e7 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期一, 29 六月 2020 14:25:54 +0800
Subject: [PATCH] #

---
 src/main/webapp/views/pda/stockIn.html |   54 +++++++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 45 insertions(+), 9 deletions(-)

diff --git a/src/main/webapp/views/pda/stockIn.html b/src/main/webapp/views/pda/stockIn.html
index f29a00f..44169ee 100644
--- a/src/main/webapp/views/pda/stockIn.html
+++ b/src/main/webapp/views/pda/stockIn.html
@@ -21,9 +21,9 @@
             margin-bottom: 5px;
         }
         .site-list label {
-            padding: 0 0 0 15px;
+            padding-right: 15px;
         }
-        .site-list span {
+        .site-list label span {
             vertical-align: middle;
             font-size: 13px;
         }
@@ -90,9 +90,7 @@
 <footer>
     <!-- 鍏ュ簱鍙� -->
     <div class="site-list">
-        <label><input class="cool-checkbox" type="radio" name="site"><span>1</span></label>
-        <label><input class="cool-checkbox" type="radio" name="site"><span>2</span></label>
-        <label><input class="cool-checkbox" type="radio" name="site"><span>3</span></label>
+        <span style="display: inline-block; margin:0 0 0 10px; font-size: 12px">鍏ュ簱鍙o細</span>
     </div>
     <div class="layui-btn-container">
         <button type="button" class="layui-btn layui-btn-xs layui-btn-primary" onclick="reset()">閲嶇疆</button>
@@ -103,6 +101,11 @@
 </body>
 <script>
     var tableIns;
+    window.onload = function(){
+        document.getElementById("code").focus();
+        getInBound();
+    }
+
     layui.use(['table','laydate', 'form'], function() {
         var table = layui.table;
         var $ = layui.jquery;
@@ -125,8 +128,29 @@
 
     });
 
-    window.onload = function(){document.getElementById("code").focus();}
+    // 鑾峰彇鍏ュ簱鍙�
+    function getInBound(){
+        $.ajax({
+            url: baseUrl+"/available/put/site",
+            headers: {'token': localStorage.getItem('token')},
+            method: 'POST',
+            async: false,
+            success: function (res) {
+                if (res.code === 200){
+                    var tpl = $("#inSitesTemplate").html();
+                    var template = Handlebars.compile(tpl);
+                    var html = template(res);
+                    $('.site-list').append(html);
+                } else if (res.code === 403){
+                    top.location.href = baseUrl+"/pda";
+                }else {
+                    tips("鑾峰彇鍏ュ簱鍙eけ璐�", true)
+                }
+            }
+        })
+    }
 
+    // 鎻愬彇鐗╂枡
     var matCodeLayerIdx;
     function getMat() {
         matCodeLayerIdx = layer.open({
@@ -183,12 +207,19 @@
             tips("璇锋彁鍙栫墿鏂�", true);
             return;
         }
+        let site = $('input:radio[name="site"]:checked').next("span").html();
+        console.log(site);
+        if (null === site || undefined === site) {
+            tips("璇烽�夋嫨鍏ュ簱鍙�", true);
+            return;
+        }
         $.ajax({
-            url: baseUrl+"/mobile/comb/auth",
+            url: baseUrl+"/full/store/put/start",
             headers: {'token': localStorage.getItem('token')},
             data: JSON.stringify({
                 barcode: barcode,
-                combMats: matData
+                devpNo: site,
+                list: matData
             }),
             contentType:'application/json;charset=UTF-8',
             method: 'POST',
@@ -196,7 +227,7 @@
             success: function (res) {
                 if (res.code === 200) {
                     reset();
-                    tips("缁勬墭鎴愬姛")
+                    tips("鍚姩鍏ュ簱鎴愬姛")
                 } else if (res.code === 403) {
                     top.location.href = baseUrl + "/pda";
                 } else {
@@ -217,4 +248,9 @@
         tips.css("color", warn?"red":'#666');
     }
 </script>
+<script type="text/template" id="inSitesTemplate">
+    {{#each data}}
+    <label><input class="cool-checkbox" type="radio" name="site"><span>{{this}}</span></label>
+    {{/each}}
+</script>
 </html>
\ No newline at end of file

--
Gitblit v1.9.1