From 3744d6506d976bb5f14504e12465df40e5b5a6da Mon Sep 17 00:00:00 2001 From: 王 垚 <1402714037@qq.com> Date: 星期二, 13 九月 2022 17:34:00 +0800 Subject: [PATCH] 到货确认 --- WebTM/views/领料发货/收料入库/Kf_ReciveBill_Fast.html | 70 ++++++++++++++++++++-------------- 1 files changed, 41 insertions(+), 29 deletions(-) diff --git "a/WebTM/views/\351\242\206\346\226\231\345\217\221\350\264\247/\346\224\266\346\226\231\345\205\245\345\272\223/Kf_ReciveBill_Fast.html" "b/WebTM/views/\351\242\206\346\226\231\345\217\221\350\264\247/\346\224\266\346\226\231\345\205\245\345\272\223/Kf_ReciveBill_Fast.html" index b95fcbd..7e53866 100644 --- "a/WebTM/views/\351\242\206\346\226\231\345\217\221\350\264\247/\346\224\266\346\226\231\345\205\245\345\272\223/Kf_ReciveBill_Fast.html" +++ "b/WebTM/views/\351\242\206\346\226\231\345\217\221\350\264\247/\346\224\266\346\226\231\345\205\245\345\272\223/Kf_ReciveBill_Fast.html" @@ -14,7 +14,6 @@ <script src="../../../layuiadmin/Scripts/json2.js"></script> <script src="../../../layuiadmin/Scripts/jquery-1.4.1.js"></script> <script src="../../../layuiadmin/Scripts/webConfig.js"></script> - <script src="../../../layuiadmin/zgqCustom/zgqCustom.js"></script> <!--鑷畾涔夋牱寮�--> <style> .maintitle { @@ -84,8 +83,8 @@ <div class="layui-row"> <label class="layui-form-label" style="width: 85px;"><span style="color:red;">*</span>鏉$爜</label> <div class="layui-input-block" style="margin-left: 100px;width:46%;"> - <input type="text" name="HBarCode" id="HBarCode" lay-verify="required" placeholder="璇烽敭鍏ュ悗鍥炶溅" autocomplete="off" class="layui-input"> - <button type="button" lay-submit="" class="layui-btn layui-btn-primary" lay-filter="QueDin" name="QueDin" id="QueDin" style="width: 70px; background-color: #1492ff;color:white">纭畾</button> + <input type="text" name="HBarCode" id="HBarCode" placeholder="璇烽敭鍏ュ悗鍥炶溅" autocomplete="off" class="layui-input"><!--lay-verify="required"--> + <button type="button" lay-submit="" class="layui-btn" lay-filter="QueDin" name="QueDin" id="QueDin" style="width: 70px; background-color: #1492ff;color:white">纭畾</button> </div> </div> </div> @@ -184,7 +183,7 @@ GetMeesageByBarCode(); }); //鎵弿鏉″舰鐮佹柟娉� - function GetMeesageByBarCode() { + function GetMeesageByBarCode() { var HBarCode = $('#HBarCode').val(); if (!HBarCode) { layer.msg("鏉″舰鐮佷笉鑳戒负绌猴紒") @@ -197,23 +196,24 @@ } var index = layer.load(); $.ajax({ - url: GetWEBURL() + "/POStockInBillList/Get_ReciveBillCheckDate", + url: GetWEBURL() + "/POStockInBillList/Get_ReciveBillByBarcode", type: "GET", - data: { "HBillno": HBarCode }, + data: { "HBarCode": HBarCode, "HInterID": HInterID }, success: function (result) { if (result.code == "1") { - var data = result.data[0]; - $("#HSupName").val(data.渚涘簲鍟�); - $("#HDeptName").val(data.閮ㄩ棬); - $("#HBillNo").val(data.鍗曟嵁鍙�); - $("#HInterID").val(data.hmainid); - option.data = result.data; - table.render(option); + var sSubStr = table.cache['mainTable']; + for (var i = 0; i < sSubStr.length; i++) { + if (sSubStr[i].HMaterID == HBarCode.split("#")[0]) { + sSubStr[i].HSQty += parseInt(HBarCode.split("#")[1]); + table.render(option); + break; + } + } layer.close(index); } else { layer.close(index); - layer.msg("鏈煡鎵惧埌鏁版嵁", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" }); + layer.msg(result.Message, { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" }); } }, error: function (err) { @@ -231,13 +231,21 @@ }) //瀹℃牳 form.on('submit(btn_Check)', function (data) {//瀹℃牳 + var sSubStr = table.cache['mainTable']; + for (var i = 0; i < sSubStr.length; i++) { + if (parseInt(sSubStr[i].HSQty) > parseInt(sSubStr[i].HQty)) { + layer.msg("鏄庣粏璁板綍绗�" + (i + 1) + "琛�,鎵爜鏁伴噺涓嶈兘瓒呭嚭璁㈠崟鏁伴噺!", { icon: 5, btn: ['纭'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" }); + return; + } + } + var index = layer.load(); var HInterID = $('#HInterID').val(); var HBillNo = $('#HBillNo').val(); $.ajax({ - url: GetWEBURL() + "/POStockInBillList/AuditPOInStockBill", - type: "Get", - data: { "HInterID": HInterID, "CurUserName": sessionStorage["HUserName"], "HBillNo": HBillNo }, + url: GetWEBURL() + "/POStockInBillList/AuditPOInStockBillPost", + type: "Post", + data: { "msg": JSON.stringify(sSubStr) }, success: function (result) { if (result.code == "1") { layer.msg("瀹℃牳鎴愬姛", { icon: 1, btn: ['纭'], time: 1000000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" }); @@ -260,11 +268,15 @@ //琛ㄥご columns = [ { type: 'checkbox', fixed: 'left' } - , { templet: '#xuhao', title: '搴忓彿', sort: true, fixed: 'left', event: "qwe" } - , { field: '鏁伴噺', title: '鍒拌揣鏁伴噺', edit: 'text', hide: true } - , { field: '鐗╂枡浠g爜', title: '鐗╂枡浠g爜', edit: 'text', event: "" } - , { field: '鐗╂枡鍚嶇О', title: '鐗╂枡鍚嶇О', edit: 'text' } - , { field: '瑙勬牸鍨嬪彿', title: '瑙勬牸鍨嬪彿', edit: 'text' } + , { templet: '#xuhao', title: '搴忓彿', sort: true, fixed: 'left' } + , { field: 'HSQty', title: '鏁伴噺', edit: 'text' } + , { field: 'HQty', title: '璁㈠崟鏁伴噺' } + , { field: 'HMaterID', title: 'HMaterID' } + , { field: 'HMaterNum', title: '鐗╂枡浠g爜' } + , { field: 'HMaterName', title: '鐗╂枡鍚嶇О' } + , { field: 'HModel', title: '瑙勬牸鍨嬪彿' } + , { field: 'HInterID', title: '涓诲唴鐮�', sort: true, width: 200 } + , { field: 'HEntryID', title: '瀛愬唴鐮�', sort: true, width: 200 } , { fixed: 'right', title: '鎿嶄綔', toolbar: '#barDemo', width: 150 } ]; option = { @@ -277,7 +289,7 @@ , done: function (res, curr, count) { } }; - option.data = [{ "鏁伴噺": 0, "鐗╂枡浠g爜": 0, "鐗╂枡鍚嶇О": "", "瑙勬牸鍨嬪彿": "" }]; + //option.data = [{ "鏁伴噺": 0, "鐗╂枡浠g爜": 0, "鐗╂枡鍚嶇О": "", "瑙勬牸鍨嬪彿": "" }]; table.render(option); } // 琛ㄦ牸琛屽唴浜嬩欢鍒犻櫎 @@ -302,7 +314,7 @@ } } //婧愬崟鍥炶溅鏂规硶 - $('#HSourceBillNo').on('keydown', function (event) { + $('#HBillNo').on('keydown', function (event) { if (event.keyCode == 13) { GetMeesageBySourceBillNo(); } @@ -326,17 +338,17 @@ success: function (result) { if (result.code == "1") { var data = result.data[0]; - $("#HSupName").val(data.渚涘簲鍟�); - $("#HDeptName").val(data.閮ㄩ棬); - $("#HBillNo").val(data.鍗曟嵁鍙�); - $("#HInterID").val(data.hmainid); + $("#HSupName").val(data.HSupName); + $("#HDeptName").val(data.HDeptName); + $("#HBillNo").val(data.HBillNo); + $("#HInterID").val(data.HInterID); option.data = result.data; table.render(option); layer.close(index); } else { layer.close(index); - layer.msg("鏈煡鎵惧埌鏁版嵁", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" }); + layer.msg(result.Message, { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" }); } }, error: function (err) { -- Gitblit v1.9.1