| | |
| | | <li><a href="../login.html">重新登录</a></li> |
| | | </ul> |
| | | </div> |
| | | |
| | | <div> |
| | | <button id="click" class="layout-btn" type="button" |
| | | style="background-color: #999; width: 100%;text-align: center; margin-top: 2px;">连接蓝牙</button> |
| | | |
| | | </div> |
| | | <div id="" class="layout-bill-info"> |
| | | <form class="layui-form" action=""> |
| | | <div id="BOX" class="layui-form-item layout-input"> |
| | |
| | | <div id="layout-boxcode" class="layui-form-item layout-input"> |
| | | <label class="layui-form-label">拆箱数量:</label> |
| | | <div class="layui-input-block"> |
| | | <input id="devanQty" type="number" lang langholder |
| | | <input id="devanQty" type="text" |
| | | placeholder="请输入拆箱数量" autocomplete="off" class="layui-input" |
| | | oninput="value=value.replace(/^(0+)|[^\d]+/g,'')"> |
| | | > |
| | | </div> |
| | | </div> |
| | | <table class="layout-tbl-submit" border="" cellspacing="" cellpadding=""> |
| | | <tr> |
| | | <td style="width: 23%;"></td> |
| | | <td> |
| | | <button class="layout-btn layout-btn-red" lang type="button" lay-submit |
| | | <button id="click2" class="layout-btn layout-btn-red" lang type="button" lay-submit |
| | | lay-filter="formUnbind">拆箱</button> |
| | | </td> |
| | | <td style="width: 33%;"></td> |
| | |
| | | <script src="/layui/layui.js"></script> |
| | | <script src="/js/public.js"></script> |
| | | <script src="/js/jquery.cookie.js"></script> |
| | | |
| | | <script src="/js/uni.webview.1.5.2.js"></script> |
| | | <!-- <script type="text/javascript" src="https://js.cdn.aliyun.dcloud.net.cn/dev/uni-app/uni.webview.1.5.2.js"></script> --> |
| | | |
| | | <script> |
| | | |
| | | var dataLists; |
| | | |
| | | var isChongFu = true; |
| | | layui.use(['form', 'jquery'], function() { |
| | | var form = layui.form |
| | | |
| | |
| | | // //console.log("body") |
| | | $("#menuList").hide() |
| | | }) |
| | | |
| | | |
| | | var isChongFu = true; |
| | | form.on('submit(formUnbind)', function(data) { |
| | | }) |
| | | |
| | | document.addEventListener("UniAppJSBridgeReady", function () { |
| | | document.getElementById("click").addEventListener("click", function () { |
| | | let data = { |
| | | type: "search" |
| | | }; |
| | | console.log("给 uni-app 发送数据", data); |
| | | |
| | | uni.postMessage({ |
| | | data: data, |
| | | }); |
| | | }); |
| | | document.getElementById("click2").addEventListener("click", function () { |
| | | |
| | | if (!$("#devanQty").val()) { |
| | | layer.msg('请扫描托盘条码', { |
| | | layer.msg('请输入拆箱数量', { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }); |
| | | return; |
| | | } |
| | | if (!$("#BOXCODE").val()) { |
| | | var reg = /(^[1-9]([0-9]+)?(\.[0-9]{1,4})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/; |
| | | if (!reg.test($("#devanQty").val())) { |
| | | layer.msg("数量必须大于0(可保留4位小数)", { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }); |
| | | return; |
| | | } |
| | | if (!$("#BOXCODE").val()) { |
| | | layer.msg('请扫描外箱条码', { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | |
| | | return; |
| | | } |
| | | if (isChongFu == true) { |
| | | isChongFu = false; |
| | | var param = { |
| | | "DevanQty": $("#devanQty").val(), |
| | | "BoxNo": $("#BOXCODE").val(), |
| | | } |
| | | sendData(IP + "/PdaCr/AddLableByDevanning", param, 'post', function(res) { |
| | | if (res.code == 0) { //成功 |
| | | layer.msg("解绑成功", { |
| | | icon: 1, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }, function () { |
| | | tableData = null |
| | | $("#devanQty").val('') |
| | | $("#BOXCODE").val('') |
| | | isChongFu = false; |
| | | var param = { |
| | | "DevanQty":parseFloat($("#devanQty").val()), |
| | | "BoxNo": $("#BOXCODE").val(), |
| | | } |
| | | synData(IP + "/PdaCr/AddLableByDevanning", param, 'post', function(res) { |
| | | if (res.code == 0) { //成功 |
| | | layer.msg("成功", { |
| | | icon: 1, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }, function () { |
| | | $("#devanQty").val('') |
| | | $("#BOXCODE").val('') |
| | | dataLists = res.data; |
| | | console.log(dataLists); |
| | | |
| | | isChongFu = true; |
| | | let data = { |
| | | type: "print", |
| | | listData:dataLists |
| | | // { |
| | | // SkuNo:'541100554848', |
| | | // SkuName:'葡萄糖葡萄糖葡萄糖葡萄糖葡萄糖', |
| | | // LotNo:'120326', |
| | | // Date1:'2025-04-10', |
| | | // Date2:'2026-04-10', |
| | | // BoxNo:['T2300001','T2300002','T2300003'], |
| | | // } |
| | | // lstData: { |
| | | // name: "Iuhuy", |
| | | // avatar: |
| | | // "http://thirdwx.qlogo.cn/mmopen/vi_32/EURpungADj4vP3UczBVvD1DcEUt9q7WFqc6mZlSZoXoS9PyaPicnX8pjmic0rLbmwYCSa247gibINd1dWr0ic1QTvw/132", |
| | | // }, |
| | | }; |
| | | console.log("给 uni-app 发送数据", data); |
| | | |
| | | isChongFu = true; |
| | | }); |
| | | } else { //不成功 |
| | | layer.msg(res.msg, { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }, function() {isChongFu = true;}); |
| | | } |
| | | }); |
| | | return false; //阻止表单跳转。如果需要表单跳转,去掉这段即可。 |
| | | }else{ |
| | | uni.postMessage({ |
| | | data: data, |
| | | }); |
| | | }); |
| | | } else { //不成功 |
| | | layer.msg(res.msg, { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }, function() {isChongFu = true;}); |
| | | } |
| | | }); |
| | | |
| | | }else{ |
| | | layer.msg("请勿重复点击", { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }); |
| | | } |
| | | |
| | | |
| | | }); |
| | | |
| | | // form.verify({ |
| | | // stock: [/^[\S]{6}$/, '托盘条码必须为六位字符'] |
| | | // }); |
| | | }) |
| | | }); |
| | | |
| | | |
| | | </script> |
| | | </body> |
| | | </html> |