| | |
| | | // 全局变量 |
| | | var billNo = ''; |
| | | var i = 0; //计算扫描条码数量 |
| | | var WLBM = "";//物料编码 |
| | | var WLBM = ""; //物料编码 |
| | | var matterTable = null; |
| | | var PopPicker = new mui.PopPicker(); |
| | | var pici = '1'; |
| | | |
| | | // mui.ready(function() { |
| | | // console.log("盘点单获取测试!"); |
| | | // app.init(); |
| | | // fetchData(); |
| | | |
| | | // }); |
| | | |
| | | // }); |
| | | // mui.ready(function() { |
| | | |
| | | // fetchData(); |
| | | // console.log("连接测试!"); |
| | | // }); |
| | | //初始化,默认焦点 |
| | | mui.plusReady(function(){ |
| | | |
| | | mui.plusReady(function() { |
| | | |
| | | app.init(); |
| | | fetchData(); |
| | | mui("#txtGD")[0].focus(); |
| | | |
| | | console.log("连接测试!"); |
| | | initBluetooth(); |
| | | // initBluetooth(); |
| | | //SetBillNo(); |
| | | $('#info').height($(window).height()- $("#row001").height() - $("#div001").height()- $("#div002").height() - 70); |
| | | }); |
| | | $('#info').height($(window).height() - $("#row001").height() - $("#div001").height() - $("#div002") |
| | | .height() - 70); |
| | | }); |
| | | // $(function(){ |
| | | // billNo= GetMaxBillNO("1201",GetSysDateTime());//调拨单号,只要不离开界面,单号不变 |
| | | // billNo= GetMaxBillNO("1201",GetSysDateTime());//调拨单号,只要不离开界面,单号不变 |
| | | // $('#info').height($(window).height()- $("#row001").height() - $("#div001").height()- $("#div002").height() - 70); |
| | | // }) |
| | | |
| | |
| | | // }); |
| | | |
| | | function SetBillNo() { |
| | | $("#txtBillNo").click(function() { |
| | | GetBillList(); |
| | | $("#txtBillNo").click(function() { |
| | | GetBillList(); |
| | | PopPicker.show(function(items) { |
| | | var billNo = items[0].text; |
| | | $("#txtBillNo").val(billNo); |
| | |
| | | //数字拖动之后调整数字小图标位置 |
| | | function onStopDrag(e) { |
| | | var d = e.data; |
| | | if(d.left < 0) { |
| | | if (d.left < 0) { |
| | | d.left = 0 |
| | | } |
| | | if(d.top < 0) { |
| | | if (d.top < 0) { |
| | | d.top = 0 |
| | | } |
| | | if(d.top + $(d.target).outerHeight() > $(d.parent).height()) { |
| | | if (d.top + $(d.target).outerHeight() > $(d.parent).height()) { |
| | | $("#dgWOMDAG-sum")[0].innerHTML = "0"; |
| | | $("#dgWOMDAG-sum").css("top", d.startTop + "px"); |
| | | $("#dgWOMDAG-sum").css("left", d.startLeft + "px"); |
| | |
| | | //更新表格数据 |
| | | // 将数据放到表格中 |
| | | function populateTable(data) { |
| | | |
| | | |
| | | //console.log('1'); |
| | | let tbody = document.querySelector("#myTable tbody"); |
| | | let tbody = document.querySelector("#myTable tbody"); |
| | | |
| | | // 清空表格内容 |
| | | tbody.innerHTML = ""; |
| | | // 清空表格内容 |
| | | tbody.innerHTML = ""; |
| | | |
| | | // 循环遍历数据,生成表格行 |
| | | for (let i = 0; i < data["条码编号"].length; i++) { |
| | | let tr = document.createElement("tr"); |
| | | // 循环遍历数据,生成表格行 |
| | | for (let i = 0; i < data["条码编号"].length; i++) { |
| | | let tr = document.createElement("tr"); |
| | | pici = data["批次"][0]; |
| | | |
| | | // 创建表格单元格,并将数据填入 |
| | | let td1 = document.createElement("td"); |
| | | td1.textContent = data["条码编号"][i]; |
| | | tr.appendChild(td1); |
| | | let td7 = document.createElement("td"); |
| | | td7.textContent = data["序号"][i]; |
| | | tr.appendChild(td7); |
| | | // 创建表格单元格,并将数据填入 |
| | | let td1 = document.createElement("td"); |
| | | td1.textContent = data["条码编号"][i]; |
| | | tr.appendChild(td1); |
| | | |
| | | // let td2 = document.createElement("td"); |
| | | // td2.textContent = data["物料代码"][i]; |
| | | // tr.appendChild(td2); |
| | | // let td2 = document.createElement("td"); |
| | | // td2.textContent = data["物料代码"][i]; |
| | | // tr.appendChild(td2); |
| | | |
| | | let td3 = document.createElement("td"); |
| | | td3.textContent = data["条码数量"][i]; |
| | | tr.appendChild(td3); |
| | | |
| | | let td4 = document.createElement("td"); |
| | | td4.textContent = data["仓位"][i]; |
| | | tr.appendChild(td4); |
| | | let td3 = document.createElement("td"); |
| | | td3.textContent = data["条码数量"][i]; |
| | | tr.appendChild(td3); |
| | | |
| | | let td5 = document.createElement("td"); |
| | | td5.textContent = data["实盘数量"][i]; |
| | | tr.appendChild(td5); |
| | | |
| | | let td6 = document.createElement("td"); |
| | | td6.textContent = data["实盘库位"][i]; |
| | | tr.appendChild(td6); |
| | | let td4 = document.createElement("td"); |
| | | td4.textContent = data["仓位"][i]; |
| | | tr.appendChild(td4); |
| | | |
| | | let td5 = document.createElement("td"); |
| | | td5.textContent = data["实盘数量"][i]; |
| | | tr.appendChild(td5); |
| | | |
| | | let td6 = document.createElement("td"); |
| | | td6.textContent = data["实盘库位"][i]; |
| | | tr.appendChild(td6); |
| | | |
| | | |
| | | // let td6 = document.createElement("td"); |
| | | // td6.textContent = data["图号"][i]; |
| | | // tr.appendChild(td6); |
| | | // let td6 = document.createElement("td"); |
| | | // td6.textContent = data["图号"][i]; |
| | | // tr.appendChild(td6); |
| | | |
| | | |
| | | |
| | | tbody.appendChild(tr); |
| | | |
| | | |
| | | $(function() { |
| | | // 将标题行的背景颜色设置为灰色 |
| | | $('tr:first-child th').css('background-color', 'gray'); |
| | | |
| | | // 遍历表格的每一行,除了标题行 |
| | | $('tr').each(function() { |
| | | // 获取实盘数量单元格的值 |
| | | var $cell = $(this).find('td:nth-child(4)'); |
| | | var quantity = parseInt($cell.text()); |
| | | |
| | | // 判断实盘数量是否为0 |
| | | if (quantity !== 0) { |
| | | // 设置行的背景颜色为黄色 |
| | | $(this).css('background-color', 'yellow'); |
| | | } |
| | | }); |
| | | }); |
| | | } |
| | | tbody.appendChild(tr); |
| | | |
| | | |
| | | $(function() { |
| | | // 将标题行的背景颜色设置为灰色 |
| | | $('tr:first-child th').css('background-color', 'gray'); |
| | | |
| | | // 遍历表格的每一行,除了标题行 |
| | | $('tr').each(function() { |
| | | // 获取实盘数量单元格的值 |
| | | var $cell = $(this).find('td:nth-child(4)'); |
| | | var quantity = parseInt($cell.text()); |
| | | |
| | | // 判断实盘数量是否为0 |
| | | if (quantity !== 0) { |
| | | // 设置行的背景颜色为黄色 |
| | | $(this).css('background-color', 'yellow'); |
| | | } |
| | | }); |
| | | }); |
| | | } |
| | | }; |
| | | |
| | | |
| | | |
| | | |
| | | //获取盘点单 |
| | | function fetchData() { |
| | | console.log("12"); |
| | | $.ajax({ |
| | | url: app.API_URL_HEADER + "/WARBABChag/GetGSTAA", |
| | | type: "GET", |
| | | dataType: "json", |
| | | success: function(response) { |
| | | if (response.status === 0) { |
| | | |
| | | var selectElement = document.getElementById('order'); |
| | | |
| | | selectElement.innerHTML = ""; |
| | | var options = response.data.TAA001; |
| | | |
| | | //获取盘点单 |
| | | function fetchData() { |
| | | console.log("12"); |
| | | $.ajax({ |
| | | url: app.API_URL_HEADER + "/WARBABChag/GetGSTAA", |
| | | type: "GET", |
| | | dataType: "json", |
| | | success: function(response) { |
| | | if (response.status === 0) { |
| | | |
| | | var selectElement = document.getElementById('order'); |
| | | |
| | | selectElement.innerHTML = ""; |
| | | var options = response.data.TAA001; |
| | | |
| | | var option = document.createElement("option"); |
| | | option.value = ""; |
| | | option.text = "请选择盘点单"; |
| | | selectElement.appendChild(option); |
| | | //console.log(options); |
| | | for (var i = 0; i < options.length; i++) { |
| | | |
| | | var option = document.createElement("option"); |
| | | option.value = ""; |
| | | option.text = "请选择盘点单"; |
| | | option.value = options[i]; |
| | | option.text = options[i]; |
| | | selectElement.appendChild(option); |
| | | //console.log(options); |
| | | for (var i = 0; i < options.length; i++) { |
| | | } |
| | | // for (var i = 0; i < options.length; i++) { |
| | | // var option = document.createElement("option"); |
| | | // option.value = options[i]+'--'+response.data.DFB002[i]; |
| | | // option.text = options[i]+'--'+response.data.DFB002[i]; |
| | | // selectElement.appendChild(option); |
| | | // } |
| | | |
| | | var option = document.createElement("option"); |
| | | option.value = options[i]; |
| | | option.text = options[i]; |
| | | selectElement.appendChild(option); |
| | | } |
| | | // for (var i = 0; i < options.length; i++) { |
| | | // var option = document.createElement("option"); |
| | | // option.value = options[i]+'--'+response.data.DFB002[i]; |
| | | // option.text = options[i]+'--'+response.data.DFB002[i]; |
| | | // selectElement.appendChild(option); |
| | | // } |
| | | |
| | | } else { |
| | | alert("获取数据异常:" + response.message); |
| | | } |
| | | }, |
| | | error: function(xhr, type, errorThrown) { |
| | | mui.toast("获取数据异常:" + JSON.stringify(errorThrown)); |
| | | alert("获取数据异常:"); |
| | | } |
| | | }); |
| | | } else { |
| | | alert("获取数据异常:" + response.message); |
| | | } |
| | | }, |
| | | error: function(xhr, type, errorThrown) { |
| | | mui.toast("获取数据异常:" + JSON.stringify(errorThrown)); |
| | | alert("获取数据异常:"); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | // 获取select元素和输入框元素 |
| | | var selectElement = document.getElementById('order'); |
| | | var inputElement = document.getElementById('input'); |
| | | |
| | | // 给输入框添加input事件监听 |
| | | inputElement.addEventListener('input', function() { |
| | | var keyword = inputElement.value.toLowerCase(); // 获取输入框的值并转换为小写 |
| | | |
| | | // 遍历select元素的选项 |
| | | for (var i = 0; i < selectElement.options.length; i++) { |
| | | var optionText = selectElement.options[i].text.toLowerCase(); // 获取选项的值并转换为小写 |
| | | |
| | | // 如果选项的值包含输入框的值,则显示该选项,否则隐藏该选项 |
| | | if (optionText.includes(keyword)) { |
| | | selectElement.options[i].style.display = 'block'; |
| | | } else { |
| | | selectElement.options[i].style.display = 'none'; |
| | | } |
| | | } |
| | | }); |
| | | |
| | | //选择盘点单时,获取盘点物料明细 |
| | | $(function() { |
| | | // 获取订单选择元素 |
| | | var $orderSelect = $('#order'); |
| | | |
| | | // 绑定订单选择变动事件 |
| | | $orderSelect.on('change', function() { |
| | | // 获取选中的订单号 |
| | | var orderNumber = $(this).val(); |
| | | //console.log(orderNumber); |
| | | // 获取select元素和输入框元素 |
| | | var selectElement = document.getElementById('order'); |
| | | var inputElement = document.getElementById('input'); |
| | | |
| | | // 发送 AJAX 请求 |
| | | $.ajax({ |
| | | url: app.API_URL_HEADER + "/WARBABChag/GetBarInfoTAC", |
| | | |
| | | data: { |
| | | TAA001: $("#order").val(), |
| | | }, |
| | | DataType: "json", |
| | | type: "post", |
| | | async: false, |
| | | //timeout: 15000, |
| | | success: function(data) { |
| | | //console.log(JSON.stringify(data)); |
| | | if(data.status != 0) { |
| | | playerAudio("NG"); |
| | | mui.alert(data.message,"","",function(){ |
| | | mui("#input")[0].focus(); |
| | | }); |
| | | return; |
| | | } else { |
| | | populateTable(data.data); |
| | | mui("#MBA001")[0].focus(); |
| | | |
| | | } |
| | | }, |
| | | error: function(xhr, type, errorThrown) { |
| | | alert("获取数据异常:" + JSON.stringify(errorThrown)); |
| | | } |
| | | }); |
| | | }); |
| | | }); |
| | | |
| | | //判断库位 |
| | | function GetStoreTAA() { |
| | | if(event.keyCode == 13) { |
| | | //如果未输入条码,跳出方法 |
| | | if($("#MBA001").val() == "") { |
| | | $("#MBA001").focus(); |
| | | playerAudio("NG"); |
| | | mui.toast("请先扫描库位!"); |
| | | return; |
| | | } |
| | | |
| | | //用户ID |
| | | var currentSession = app.loadconfig(app.CONFIG_CURRENT_SESSION); |
| | | var user_id =currentSession.user_id; //currentSession.user_id; |
| | | // var user_id = "admin"; |
| | | $.ajax({ |
| | | url: app.API_URL_HEADER + "/WARBABChag/GetStoreTAA", |
| | | |
| | | data: { |
| | | MBA001: $("#MBA001").val(), |
| | | TAA001: $("#order").val(), |
| | | logID: user_id,//Admin //先写死,便于调试 |
| | | |
| | | }, |
| | | DataType: "json", |
| | | type: "post", |
| | | async: false, |
| | | //timeout: 15000, |
| | | success: function(data) { |
| | | //console.log(JSON.stringify(data)); |
| | | if(data.status != 0) { |
| | | playerAudio("NG"); |
| | | mui.alert(data.message,"","",function(){ |
| | | mui("#MBA001")[0].focus(); |
| | | $("#MBA001").val(""); |
| | | |
| | | }); |
| | | return; |
| | | } else { |
| | | matterTable = data.data.matterTable; |
| | | // 给输入框添加input事件监听 |
| | | inputElement.addEventListener('input', function() { |
| | | var keyword = inputElement.value.toLowerCase(); // 获取输入框的值并转换为小写 |
| | | |
| | | |
| | | mui("#DAB001")[0].focus(); |
| | | |
| | | } |
| | | }, |
| | | error: function(xhr, type, errorThrown) { |
| | | alert("获取数据异常:" + JSON.stringify(errorThrown)); |
| | | } |
| | | }); |
| | | } |
| | | }; |
| | | |
| | | |
| | | //获取条码信息 |
| | | function GetBarInfoTAA() { |
| | | if(event.keyCode == 13) { |
| | | //如果未输入条码,跳出方法 |
| | | if($("#DAB001").val() == "") { |
| | | $("#DAB001").focus(); |
| | | playerAudio("NG"); |
| | | mui.toast("请先扫描物料条码!"); |
| | | return; |
| | | } |
| | | |
| | | if($("#MBA001").val() == "") { |
| | | $("#DAB001").focus(); |
| | | playerAudio("NG"); |
| | | mui.toast("请先扫描库位!"); |
| | | return; |
| | | } |
| | | |
| | | //用户ID |
| | | var currentSession = app.loadconfig(app.CONFIG_CURRENT_SESSION); |
| | | var user_id =currentSession.user_id; //currentSession.user_id; |
| | | // var user_id = "admin"; |
| | | $.ajax({ |
| | | url: app.API_URL_HEADER + "/WARBABChag/GetBarInfoTAA", |
| | | |
| | | data: { |
| | | DAB001: $("#DAB001").val(), |
| | | TAA001: $("#order").val(), |
| | | MBA001: $("#MBA001").val(), |
| | | logID: user_id,//Admin //先写死,便于调试 |
| | | |
| | | }, |
| | | DataType: "json", |
| | | type: "post", |
| | | async: false, |
| | | //timeout: 15000, |
| | | success: function(data) { |
| | | //console.log(JSON.stringify(data)); |
| | | if(data.status != 0) { |
| | | playerAudio("NG"); |
| | | mui.alert(data.message,"","",function(){ |
| | | mui("#DAB001")[0].focus(); |
| | | $("#DAB001").val(""); |
| | | $("#txtSL").val("");//先清空一下数据源 |
| | | }); |
| | | return; |
| | | } else { |
| | | matterTable = data.data.matterTable; |
| | | $("#txtSL").val("");//先清空一下数据源 |
| | | $("#FLSL").val("");//先清空一下数据源 |
| | | |
| | | $("#txtSL").val(data.data.txtSL);//填入条码数量 |
| | | $("#SPSL").val(data.data.txtSL);//填入发料数量 |
| | | $("#DAB020").val(data.data.DAB020);//填入物料编码 |
| | | // 遍历select元素的选项 |
| | | for (var i = 0; i < selectElement.options.length; i++) { |
| | | var optionText = selectElement.options[i].text.toLowerCase(); // 获取选项的值并转换为小写 |
| | | |
| | | mui("#SPSL")[0].focus(); |
| | | |
| | | } |
| | | }, |
| | | error: function(xhr, type, errorThrown) { |
| | | alert("获取数据异常:" + JSON.stringify(errorThrown)); |
| | | } |
| | | }); |
| | | |
| | | if(document.getElementById('barcheck').checked) |
| | | { |
| | | confirmQuantity(); |
| | | // 如果选项的值包含输入框的值,则显示该选项,否则隐藏该选项 |
| | | if (optionText.includes(keyword)) { |
| | | selectElement.options[i].style.display = 'block'; |
| | | } else { |
| | | selectElement.options[i].style.display = 'none'; |
| | | } |
| | | } |
| | | }); |
| | | |
| | | //选择盘点单时,获取盘点物料明细 |
| | | $(function() { |
| | | // 获取订单选择元素 |
| | | var $orderSelect = $('#order'); |
| | | |
| | | // 绑定订单选择变动事件 |
| | | $orderSelect.on('change', function() { |
| | | // 获取选中的订单号 |
| | | var orderNumber = $(this).val(); |
| | | //console.log(orderNumber); |
| | | |
| | | // 发送 AJAX 请求 |
| | | $.ajax({ |
| | | url: app.API_URL_HEADER + "/WARBABChag/GetBarInfoTAC", |
| | | |
| | | data: { |
| | | TAA001: $("#order").val(), |
| | | }, |
| | | DataType: "json", |
| | | type: "post", |
| | | async: false, |
| | | //timeout: 15000, |
| | | success: function(data) { |
| | | //console.log(JSON.stringify(data)); |
| | | if (data.status != 0) { |
| | | playerAudio("NG"); |
| | | mui.alert(data.message, "", "", function() { |
| | | mui("#input")[0].focus(); |
| | | }); |
| | | return; |
| | | } else { |
| | | populateTable(data.data); |
| | | var selectElement = document.getElementById("spici"); |
| | | console.log(pici); |
| | | // 清空 <select> 元素的现有选项 |
| | | selectElement.innerHTML = ""; |
| | | |
| | | // 从1开始到 pici 为止的数,添加到 <select> 元素中 |
| | | for (var i = 1; i <= parseInt(pici); i++) { |
| | | // 创建一个新的 <option> 元素 |
| | | var option = document.createElement("option"); |
| | | |
| | | // 设置 <option> 元素的 value 和 text 属性 |
| | | option.value = i; |
| | | option.text = i; |
| | | |
| | | // 将 <option> 元素添加到 <select> 元素中 |
| | | selectElement.appendChild(option); |
| | | } |
| | | |
| | | } |
| | | }; |
| | | selectElement.value = pici; |
| | | GetInfopici(); |
| | | mui("#MBA001")[0].focus(); |
| | | |
| | | } |
| | | }, |
| | | error: function(xhr, type, errorThrown) { |
| | | alert("获取数据异常:" + JSON.stringify(errorThrown)); |
| | | } |
| | | }); |
| | | }); |
| | | }); |
| | | |
| | | function refreshpdno() { |
| | | $.ajax({ |
| | | url: app.API_URL_HEADER + "/WARBABChag/GetBarInfoTAC", |
| | | |
| | | data: { |
| | | TAA001: $("#order").val(), |
| | | }, |
| | | DataType: "json", |
| | | type: "post", |
| | | async: false, |
| | | //timeout: 15000, |
| | | success: function(data) { |
| | | //console.log(JSON.stringify(data)); |
| | | if (data.status != 0) { |
| | | playerAudio("NG"); |
| | | mui.alert(data.message, "", "", function() { |
| | | mui("#input")[0].focus(); |
| | | }); |
| | | return; |
| | | } else { |
| | | populateTable(data.data); |
| | | var selectElement = document.getElementById("spici"); |
| | | console.log(pici); |
| | | // 清空 <select> 元素的现有选项 |
| | | selectElement.innerHTML = ""; |
| | | |
| | | // 从1开始到 pici 为止的数,添加到 <select> 元素中 |
| | | for (var i = 1; i <= parseInt(pici); i++) { |
| | | // 创建一个新的 <option> 元素 |
| | | var option = document.createElement("option"); |
| | | |
| | | // 设置 <option> 元素的 value 和 text 属性 |
| | | option.value = i; |
| | | option.text = i; |
| | | |
| | | // 将 <option> 元素添加到 <select> 元素中 |
| | | selectElement.appendChild(option); |
| | | } |
| | | selectElement.value = pici; |
| | | GetInfopici(); |
| | | mui("#MBA001")[0].focus(); |
| | | |
| | | } |
| | | }, |
| | | error: function(xhr, type, errorThrown) { |
| | | alert("获取数据异常:" + JSON.stringify(errorThrown)); |
| | | } |
| | | }); |
| | | } |
| | | //判断库位 |
| | | function GetStoreTAA() { |
| | | if (event.keyCode == 13) { |
| | | //如果未输入条码,跳出方法 |
| | | if ($("#MBA001").val() == "") { |
| | | $("#MBA001").focus(); |
| | | playerAudio("NG"); |
| | | mui.toast("请先扫描库位!"); |
| | | return; |
| | | } |
| | | |
| | | //用户ID |
| | | var currentSession = app.loadconfig(app.CONFIG_CURRENT_SESSION); |
| | | var user_id = currentSession.user_id; //currentSession.user_id; |
| | | // var user_id = "admin"; |
| | | $.ajax({ |
| | | url: app.API_URL_HEADER + "/WARBABChag/GetStoreTAA", |
| | | |
| | | data: { |
| | | MBA001: $("#MBA001").val(), |
| | | TAA001: $("#order").val(), |
| | | logID: user_id, //Admin //先写死,便于调试 |
| | | |
| | | }, |
| | | DataType: "json", |
| | | type: "post", |
| | | async: false, |
| | | //timeout: 15000, |
| | | success: function(data) { |
| | | //console.log(JSON.stringify(data)); |
| | | if (data.status != 0) { |
| | | playerAudio("NG"); |
| | | mui.alert(data.message, "", "", function() { |
| | | mui("#MBA001")[0].focus(); |
| | | $("#MBA001").val(""); |
| | | |
| | | }); |
| | | return; |
| | | } else { |
| | | matterTable = data.data.matterTable; |
| | | |
| | | |
| | | function confirmQuantity() { |
| | | |
| | | //如果未输入条码,跳出方法 |
| | | if($("#DAB001").val() == "") { |
| | | $("#DAB001").focus(); |
| | | playerAudio("NG"); |
| | | mui.toast("请先扫描物料条码!"); |
| | | return; |
| | | } |
| | | |
| | | if($("#SPSL").val() == "") { |
| | | $("#SPSL").focus(); |
| | | playerAudio("NG"); |
| | | mui.toast("请先扫输入实盘数量!"); |
| | | return; |
| | | } |
| | | //用户ID |
| | | var currentSession = app.loadconfig(app.CONFIG_CURRENT_SESSION); |
| | | var user_id =currentSession.user_id; //currentSession.user_id; |
| | | console.log('1'); |
| | | // var user_id = "admin"; |
| | | $.ajax({ |
| | | url: app.API_URL_HEADER + "/WARBABChag/UpdateTAC007", |
| | | |
| | | data: { |
| | | DAB001: $("#DAB001").val(), |
| | | TAA001: $("#order").val(), |
| | | TAC007: $("#SPSL").val(), |
| | | MBA001: $("#MBA001").val(), |
| | | logID: user_id,//Admin //先写死,便于调试 |
| | | |
| | | }, |
| | | DataType: "json", |
| | | type: "post", |
| | | async: false, |
| | | //timeout: 15000, |
| | | success: function(data) { |
| | | //console.log(JSON.stringify(data)); |
| | | if(data.status != 0) { |
| | | playerAudio("NG"); |
| | | mui.alert(data.message,"","",function(){ |
| | | mui("#DAB001")[0].focus(); |
| | | $("#DAB001").val(""); |
| | | $("#txtSL").val("");//先清空一下数据源 |
| | | $("#SPSL").val("");//先清空一下数据源 |
| | | $("#DAB020").val("");//先清空一下数据源 |
| | | }); |
| | | return; |
| | | } else { |
| | | matterTable = data.data.matterTable; |
| | | $("#txtSL").val("");//先清空一下数据源 |
| | | $("#SPSL").val("");//先清空一下数据源 |
| | | $("#DAB001").val("");//先清空一下数据源 |
| | | $("#DAB020").val("");//先清空一下数据源 |
| | | |
| | | mui("#DAB001")[0].focus(); |
| | | mui.toast(data.message); |
| | | |
| | | $.ajax({ |
| | | url: app.API_URL_HEADER + "/WARBABChag/GetBarInfoTAC", |
| | | |
| | | data: { |
| | | TAA001: $("#order").val(), |
| | | }, |
| | | DataType: "json", |
| | | type: "post", |
| | | async: false, |
| | | //timeout: 15000, |
| | | success: function(data) { |
| | | //console.log(JSON.stringify(data)); |
| | | if(data.status != 0) { |
| | | playerAudio("NG"); |
| | | mui.alert(data.message,"","",function(){ |
| | | mui("#input")[0].focus(); |
| | | }); |
| | | return; |
| | | } else { |
| | | populateTable(data.data); |
| | | mui("#DAB001")[0].focus(); |
| | | |
| | | } |
| | | }, |
| | | error: function(xhr, type, errorThrown) { |
| | | alert("获取数据异常:" + JSON.stringify(errorThrown)); |
| | | } |
| | | }); |
| | | |
| | | if(document.getElementById('checkdefault').checked) |
| | | { |
| | | return; |
| | | } |
| | | $("#MBA001").val("");//先清空一下数据源 |
| | | } |
| | | }, |
| | | error: function(xhr, type, errorThrown) { |
| | | alert("获取数据异常:" + JSON.stringify(errorThrown)); |
| | | } |
| | | }); |
| | | |
| | | }; |
| | | mui("#DAB001")[0].focus(); |
| | | |
| | | |
| | | } |
| | | }, |
| | | error: function(xhr, type, errorThrown) { |
| | | alert("获取数据异常:" + JSON.stringify(errorThrown)); |
| | | } |
| | | }); |
| | | } |
| | | }; |
| | | |
| | | |
| | | //获取条码信息 |
| | | function GetBarInfoTAA() { |
| | | if (event.keyCode == 13) { |
| | | //如果未输入条码,跳出方法 |
| | | if ($("#DAB001").val() == "") { |
| | | $("#DAB001").focus(); |
| | | playerAudio("NG"); |
| | | mui.toast("请先扫描物料条码!"); |
| | | return; |
| | | } |
| | | |
| | | if ($("#MBA001").val() == "") { |
| | | $("#DAB001").focus(); |
| | | playerAudio("NG"); |
| | | mui.toast("请先扫描库位!"); |
| | | return; |
| | | } |
| | | |
| | | //用户ID |
| | | var currentSession = app.loadconfig(app.CONFIG_CURRENT_SESSION); |
| | | var user_id = currentSession.user_id; //currentSession.user_id; |
| | | // var user_id = "admin"; |
| | | $.ajax({ |
| | | url: app.API_URL_HEADER + "/WARBABChag/GetBarInfoTAA", |
| | | |
| | | data: { |
| | | DAB001: $("#DAB001").val(), |
| | | TAA001: $("#order").val(), |
| | | MBA001: $("#MBA001").val(), |
| | | logID: user_id, //Admin //先写死,便于调试 |
| | | |
| | | }, |
| | | DataType: "json", |
| | | type: "post", |
| | | async: false, |
| | | //timeout: 15000, |
| | | success: function(data) { |
| | | //console.log(JSON.stringify(data)); |
| | | if (data.status != 0) { |
| | | playerAudio("NG"); |
| | | mui.alert(data.message, "", "", function() { |
| | | mui("#DAB001")[0].focus(); |
| | | $("#DAB001").val(""); |
| | | $("#txtSL").val(""); //先清空一下数据源 |
| | | }); |
| | | return; |
| | | } else { |
| | | matterTable = data.data.matterTable; |
| | | $("#txtSL").val(""); //先清空一下数据源 |
| | | $("#FLSL").val(""); //先清空一下数据源 |
| | | |
| | | $("#txtSL").val(data.data.txtSL); //填入条码数量 |
| | | $("#SPSL").val(data.data.txtSL); //填入发料数量 |
| | | $("#DAB020").val(data.data.DAB020); //填入物料编码 |
| | | |
| | | mui("#SPSL")[0].focus(); |
| | | |
| | | } |
| | | }, |
| | | error: function(xhr, type, errorThrown) { |
| | | alert("获取数据异常:" + JSON.stringify(errorThrown)); |
| | | } |
| | | }); |
| | | |
| | | if (document.getElementById('barcheck').checked) { |
| | | confirmQuantity(); |
| | | } |
| | | |
| | | } |
| | | }; |
| | | |
| | | |
| | | function GetInfopici() { |
| | | |
| | | |
| | | //用户ID |
| | | var currentSession = app.loadconfig(app.CONFIG_CURRENT_SESSION); |
| | | var user_id = currentSession.user_id; //currentSession.user_id; |
| | | // var user_id = "admin"; |
| | | $.ajax({ |
| | | url: app.API_URL_HEADER + "/WARBABChag/GetInfopici", |
| | | |
| | | data: { |
| | | DAB001: $("#order").val(), |
| | | PICI: $("#spici").val(), |
| | | |
| | | }, |
| | | DataType: "json", |
| | | type: "post", |
| | | async: false, |
| | | //timeout: 15000, |
| | | success: function(data) { |
| | | //console.log(JSON.stringify(data)); |
| | | if (data.status != 0) { |
| | | playerAudio("NG"); |
| | | mui.alert(data.message, "", "", function() { |
| | | |
| | | }); |
| | | return; |
| | | } else { |
| | | |
| | | $("#info").val(data.data.info); //填入汇总信息 |
| | | |
| | | |
| | | } |
| | | }, |
| | | error: function(xhr, type, errorThrown) { |
| | | alert("获取数据异常:" + JSON.stringify(errorThrown)); |
| | | } |
| | | }); |
| | | |
| | | if (document.getElementById('barcheck').checked) { |
| | | confirmQuantity(); |
| | | } |
| | | |
| | | } |
| | | |
| | | function huizong() { |
| | | |
| | | |
| | | //用户ID |
| | | var currentSession = app.loadconfig(app.CONFIG_CURRENT_SESSION); |
| | | var user_id = currentSession.user_id; //currentSession.user_id; |
| | | // var user_id = "admin"; |
| | | $.ajax({ |
| | | url: app.API_URL_HEADER + "/WARBABChag/huizong", |
| | | |
| | | data: { |
| | | DAB001: $("#order").val(), |
| | | }, |
| | | DataType: "json", |
| | | type: "post", |
| | | async: false, |
| | | //timeout: 15000, |
| | | success: function(data) { |
| | | //console.log(JSON.stringify(data)); |
| | | if (data.status != 0) { |
| | | playerAudio("NG"); |
| | | mui.alert(data.message, "", "", function() { |
| | | |
| | | }); |
| | | return; |
| | | } else { |
| | | refreshpdno(); |
| | | var selectElement = document.getElementById("spici"); |
| | | selectElement.value = parseInt(pici) - 1; |
| | | GetInfopici(); |
| | | mui.toast("汇总成功!"); |
| | | |
| | | |
| | | } |
| | | }, |
| | | error: function(xhr, type, errorThrown) { |
| | | alert("获取数据异常:" + JSON.stringify(errorThrown)); |
| | | } |
| | | }); |
| | | |
| | | if (document.getElementById('barcheck').checked) { |
| | | confirmQuantity(); |
| | | } |
| | | |
| | | } |
| | | |
| | | document.getElementById("huizongbt").addEventListener("click", function() { |
| | | console.log('133'); |
| | | var element = document.getElementById("divdetail"); |
| | | var element1 = document.getElementById("info"); |
| | | |
| | | |
| | | if (element.style.display === "none") { |
| | | element.style.display = ""; |
| | | } else { |
| | | element.style.display = "none"; |
| | | } |
| | | if (element1.style.display === "none") { |
| | | element1.style.display = ""; |
| | | } else { |
| | | element1.style.display = "none"; |
| | | } |
| | | }); |
| | | |
| | | function showdetail() { |
| | | console.log('133'); |
| | | var element = document.getElementById("divdetail"); |
| | | var element1 = document.getElementById("info"); |
| | | |
| | | |
| | | if (element.style.display === "none") { |
| | | element.style.display = ""; |
| | | } else { |
| | | element.style.display = "none"; |
| | | } |
| | | if (element1.style.display === "none") { |
| | | element1.style.display = ""; |
| | | } else { |
| | | element1.style.display = "none"; |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | function confirmQuantity() { |
| | | |
| | | //如果未输入条码,跳出方法 |
| | | if ($("#DAB001").val() == "") { |
| | | $("#DAB001").focus(); |
| | | playerAudio("NG"); |
| | | mui.toast("请先扫描物料条码!"); |
| | | return; |
| | | } |
| | | |
| | | if ($("#SPSL").val() == "") { |
| | | $("#SPSL").focus(); |
| | | playerAudio("NG"); |
| | | mui.toast("请先扫输入实盘数量!"); |
| | | return; |
| | | } |
| | | //用户ID |
| | | var currentSession = app.loadconfig(app.CONFIG_CURRENT_SESSION); |
| | | var user_id = currentSession.user_id; //currentSession.user_id; |
| | | console.log('1'); |
| | | // var user_id = "admin"; |
| | | $.ajax({ |
| | | url: app.API_URL_HEADER + "/WARBABChag/UpdateTAC007", |
| | | |
| | | data: { |
| | | DAB001: $("#DAB001").val(), |
| | | TAA001: $("#order").val(), |
| | | TAC007: $("#SPSL").val(), |
| | | MBA001: $("#MBA001").val(), |
| | | logID: user_id, //Admin //先写死,便于调试 |
| | | PICI: $("#spici").val(), |
| | | |
| | | }, |
| | | DataType: "json", |
| | | type: "post", |
| | | async: false, |
| | | //timeout: 15000, |
| | | success: function(data) { |
| | | //console.log(JSON.stringify(data)); |
| | | if (data.status != 0) { |
| | | playerAudio("NG"); |
| | | mui.alert(data.message, "", "", function() { |
| | | mui("#DAB001")[0].focus(); |
| | | $("#DAB001").val(""); |
| | | $("#txtSL").val(""); //先清空一下数据源 |
| | | $("#SPSL").val(""); //先清空一下数据源 |
| | | $("#DAB020").val(""); //先清空一下数据源 |
| | | }); |
| | | return; |
| | | } else { |
| | | matterTable = data.data.matterTable; |
| | | $("#txtSL").val(""); //先清空一下数据源 |
| | | $("#SPSL").val(""); //先清空一下数据源 |
| | | $("#DAB001").val(""); //先清空一下数据源 |
| | | $("#DAB020").val(""); //先清空一下数据源 |
| | | |
| | | mui("#DAB001")[0].focus(); |
| | | mui.toast(data.message); |
| | | |
| | | $.ajax({ |
| | | url: app.API_URL_HEADER + "/WARBABChag/GetBarInfoTAC", |
| | | |
| | | data: { |
| | | TAA001: $("#order").val(), |
| | | }, |
| | | DataType: "json", |
| | | type: "post", |
| | | async: false, |
| | | //timeout: 15000, |
| | | success: function(data) { |
| | | //console.log(JSON.stringify(data)); |
| | | if (data.status != 0) { |
| | | playerAudio("NG"); |
| | | mui.alert(data.message, "", "", function() { |
| | | mui("#input")[0].focus(); |
| | | }); |
| | | return; |
| | | } else { |
| | | populateTable(data.data); |
| | | mui("#DAB001")[0].focus(); |
| | | |
| | | } |
| | | }, |
| | | error: function(xhr, type, errorThrown) { |
| | | alert("获取数据异常:" + JSON.stringify(errorThrown)); |
| | | } |
| | | }); |
| | | |
| | | if (document.getElementById('checkdefault').checked) { |
| | | return; |
| | | } |
| | | $("#MBA001").val(""); //先清空一下数据源 |
| | | } |
| | | }, |
| | | error: function(xhr, type, errorThrown) { |
| | | alert("获取数据异常:" + JSON.stringify(errorThrown)); |
| | | } |
| | | }); |
| | | GetInfopici(); |
| | | }; |
| | | |
| | | |
| | | |
| | | /* 当页面的文本失去焦点时,让其再次获取焦点 */ |
| | | |