From b7c22aa2b23357dee7a0ec78f4bc85c9c910fd76 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期一, 29 六月 2020 16:45:19 +0800
Subject: [PATCH] #

---
 src/main/webapp/views/pda/stockOut.html |   47 ++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 42 insertions(+), 5 deletions(-)

diff --git a/src/main/webapp/views/pda/stockOut.html b/src/main/webapp/views/pda/stockOut.html
index 14937cf..ed64cf7 100644
--- a/src/main/webapp/views/pda/stockOut.html
+++ b/src/main/webapp/views/pda/stockOut.html
@@ -110,11 +110,11 @@
 <header>
     <div class="layui-input-inline">
         <label class="layui-form-label">搴撲綅</label>
-        <input class="layui-input" type="text" id="locNo" onkeyup="findLocDetl(this)" autocomplete="off">
+        <input class="layui-input" type="text" id="locNo" onkeyup="findByLocNo(this)" autocomplete="off">
     </div>
     <div class="layui-input-inline">
         <label class="layui-form-label">鐗╂枡</label>
-        <input class="layui-input" type="text" id="matNo" autocomplete="off">
+        <input class="layui-input" type="text" id="matNo" onkeyup="findByMatNo(this)" autocomplete="off">
     </div>
 </header>
 <!-- 涓讳綋 -->
@@ -144,15 +144,31 @@
     /**
      * 鏍规嵁搴撲綅鍙锋煡鎵惧簱瀛樻槑缁�
      */
-    function findLocDetl(el){
+    function findByLocNo(el){
         if (isEmpty(el.value)) {
             return;
         }
+        $("#matNo").val("");
+        find(el.value, null);
+    }
+
+    /**
+     * 鏍规嵁鐗╂枡鍙锋煡鎵惧簱瀛樻槑缁�
+     */
+    function findByMatNo(el){
+        if (isEmpty(el.value)) {
+            return;
+        }
+        $("#locNo").val("");
+        find(null, el.value);
+    }
+    function find(locNo, matNo) {
         $.ajax({
             url: baseUrl + "/mobile/locDetl",
             headers: {'token': localStorage.getItem('token')},
             data: {
-                locNo: el.value
+                locNo: locNo,
+                matNo: matNo
             },
             method: 'POST',
             success: function (res) {
@@ -212,11 +228,32 @@
                 } else if (res.code === 403){
                     top.location.href = baseUrl+"/";
                 }else {
-                    layer.msg(res.msg)
+                    tips(res.msg, true)
                 }
             }
         })
     }
+
+    // 閲嶇疆
+    function reset() {
+        $("#matNo").val("");
+        $("#locNo").val("");
+        locDetlData = [];
+        tableIns.reload({data: locDetlData});
+        $('input:radio[name="site"]').prop('checked',false);
+        tips("");
+    }
+
+    /**
+     * 鎻愮ず淇℃伅
+     * @param msg 鎻愮ず鍐呭
+     * @param warn true锛氱孩鑹插瓧浣�
+     */
+    function tips(msg, warn) {
+        let tips = $('#tips');
+        tips.html(msg);
+        tips.css("color", warn?"red":'#666');
+    }
 </script>
 <script type="text/template" id="outSitesTemplate">
     {{#each data}}

--
Gitblit v1.9.1