| | |
| | | // 全局变量 |
| | | var billNo = ''; |
| | | var i = 0; //计算扫描条码数量 |
| | | var WLBM = "";//物料编码 |
| | | var WLBM = ""; //物料编码 |
| | | var matterTable = null; |
| | | var PopPicker = new mui.PopPicker(); |
| | | |
| | | |
| | | |
| | | //初始化,默认焦点 |
| | | mui.plusReady(function(){ |
| | | mui.plusReady(function() { |
| | | app.init(); |
| | | mui("#txtGD")[0].focus(); |
| | | console.log("连接测试!"); |
| | | //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"); |
| | | |
| | | // 创建表格单元格,并将数据填入 |
| | | let td1 = document.createElement("td"); |
| | | td1.textContent = data["物料名称"][i]; |
| | | tr.appendChild(td1); |
| | | // 创建表格单元格,并将数据填入 |
| | | 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]; |
| | | if (data["待发数量"][i] === "0.0000") { |
| | | tr.style.color = "green"; |
| | | }else{ tr.style.color = "red";} |
| | | tr.appendChild(td3); |
| | | |
| | | let td4 = document.createElement("td"); |
| | | td4.textContent = data["已发数量"][i]; |
| | | tr.appendChild(td4); |
| | | let td3 = document.createElement("td"); |
| | | td3.textContent = data["待发数量"][i]; |
| | | if (data["待发数量"][i] === "0.0000") { |
| | | tr.style.color = "green"; |
| | | } else { |
| | | tr.style.color = "red"; |
| | | } |
| | | tr.appendChild(td3); |
| | | |
| | | let td5 = document.createElement("td"); |
| | | td5.textContent = data["推荐仓位"][i]; |
| | | tr.appendChild(td5); |
| | | 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); |
| | | |
| | | |
| | | |
| | | tbody.appendChild(tr); |
| | | } |
| | | tbody.appendChild(tr); |
| | | } |
| | | }; |
| | | //扫描指令工单处理方法 |
| | | |
| | | function GetBarInfoDGD(){ |
| | | console.log(2); |
| | | if(event.keyCode == 13) { |
| | | //如果未输入条码,跳出方法 |
| | | if($("#DGD").val() == "") { |
| | | $("#DGD").focus(); |
| | | playerAudio("NG"); |
| | | mui.toast("请先输入工单!"); |
| | | return; |
| | | } |
| | | function GetBarInfoDGD() { |
| | | console.log(2); |
| | | if (event.keyCode == 13) { |
| | | //如果未输入条码,跳出方法 |
| | | if ($("#DGD").val() == "") { |
| | | $("#DGD").focus(); |
| | | playerAudio("NG"); |
| | | mui.toast("请先输入工单!"); |
| | | return; |
| | | } |
| | | $.ajax({ |
| | | url: app.API_URL_HEADER + "/XKYDHD/GetGSDGD", |
| | | data: { |
| | | DGD: $("#DGD").val() |
| | | }, |
| | | DataType: "json", |
| | | type: "post", |
| | | async: false, |
| | | success: function(data){ |
| | | |
| | | if (data.status === 0) { |
| | | console.log(data); |
| | | /// console.log(JSON.stringify(response)); |
| | | var selectElement = document.getElementById('txtGD'); |
| | | selectElement.innerHTML = ""; |
| | | matterTable = data.data.matterTable; |
| | | |
| | | |
| | | for (var i = 0; i < matterTable.length; i++) { |
| | | var option = document.createElement("option"); |
| | | option.value = matterTable[i]["DAA001"]; |
| | | option.text = matterTable[i]["DAA001"]; |
| | | selectElement.appendChild(option); |
| | | } |
| | | selectElement.value = matterTable[0]["DAA001"]; |
| | | GETGDINFO_SX(); |
| | | } else { |
| | | playerAudio("NG"); |
| | | mui.toast("失败!"+data.message); |
| | | alert("获取数据异常:" + data.message); |
| | | } |
| | | |
| | | }, |
| | | error: function(xhr, type, errorThrown) { |
| | | |
| | | mui.toast("获取数据异常:" + JSON.stringify(errorThrown)); |
| | | alert("获取数据异常:"); |
| | | } |
| | | }); |
| | | //用户ID |
| | | // var currentSession = app.loadconfig(app.CONFIG_CURRENT_SESSION); |
| | | //var user_id =$("#txtBillNo").val(); //currentSession.user_id; |
| | | //var mun=$("#txtSL").val(); |
| | | //GETGDINFO_SX(); |
| | | // var user_id = "admin"; |
| | | |
| | | } |
| | | }; |
| | | url: app.API_URL_HEADER + "/XKYDHD/GetGSDGD", |
| | | data: { |
| | | DGD: $("#DGD").val() |
| | | }, |
| | | DataType: "json", |
| | | type: "post", |
| | | async: false, |
| | | success: function(data) { |
| | | |
| | | function GetBarInfoDGDSS(){ |
| | | console.log(2); |
| | | if(event.keyCode == 13) { |
| | | //如果未输入条码,跳出方法 |
| | | if($("#DGD").val() == "") { |
| | | $("#DGD").focus(); |
| | | if (data.status === 0) { |
| | | console.log(data); |
| | | /// console.log(JSON.stringify(response)); |
| | | var selectElement = document.getElementById('txtGD'); |
| | | selectElement.innerHTML = ""; |
| | | matterTable = data.data.matterTable; |
| | | |
| | | |
| | | for (var i = 0; i < matterTable.length; i++) { |
| | | var option = document.createElement("option"); |
| | | option.value = matterTable[i]["DAA001"]; |
| | | option.text = matterTable[i]["DAA001"]; |
| | | selectElement.appendChild(option); |
| | | } |
| | | selectElement.value = matterTable[0]["DAA001"]; |
| | | GETGDINFO_SX(); |
| | | } else { |
| | | playerAudio("NG"); |
| | | console.log(3); |
| | | mui.toast("请先输入工单!"); |
| | | return; |
| | | } } |
| | | $.ajax({ |
| | | url: app.API_URL_HEADER + "/XKYDHD/GetGSDGDSS", |
| | | data: { |
| | | DGD: $("#DGD").val(), |
| | | ITEM: $("#DAB020").val() |
| | | }, |
| | | DataType: "json", |
| | | type: "post", |
| | | async: false, |
| | | success: function(data){ |
| | | mui.toast("失败!" + data.message); |
| | | alert("获取数据异常:" + data.message); |
| | | } |
| | | |
| | | if (data.status === 0) { |
| | | console.log(data.data); |
| | | /// console.log(JSON.stringify(response)); |
| | | var selectElement = document.getElementById('txtGD'); |
| | | selectElement.innerHTML = ""; |
| | | matterTable = data.data.matterTable; |
| | | |
| | | if(matterTable.length>0){ |
| | | for (var i = 0; i < matterTable.length; i++) { |
| | | var option = document.createElement("option"); |
| | | option.value = matterTable[i]["DAA001"]; |
| | | option.text = matterTable[i]["DAA001"]; |
| | | selectElement.appendChild(option); |
| | | } |
| | | selectElement.value = matterTable[0]["DAA001"]; |
| | | //GETGDINFO_SX(); |
| | | }, |
| | | error: function(xhr, type, errorThrown) { |
| | | |
| | | mui.toast("获取数据异常:" + JSON.stringify(errorThrown)); |
| | | alert("获取数据异常:"); |
| | | } |
| | | } else { |
| | | playerAudio("NG"); |
| | | mui.toast("失败!"+data.message); |
| | | alert("获取数据异常:" + data.message); |
| | | } |
| | | GETGDINFO_SX(); |
| | | }, |
| | | error: function(xhr, type, errorThrown) { |
| | | console.log(4); |
| | | mui.toast("获取数据异常:" + JSON.stringify(errorThrown)); |
| | | alert("获取数据异常:"); |
| | | } |
| | | }); |
| | | //用户ID |
| | | // var currentSession = app.loadconfig(app.CONFIG_CURRENT_SESSION); |
| | | //var user_id =$("#txtBillNo").val(); //currentSession.user_id; |
| | | //var mun=$("#txtSL").val(); |
| | | //GETGDINFO_SX(); |
| | | }); |
| | | //用户ID |
| | | // var currentSession = app.loadconfig(app.CONFIG_CURRENT_SESSION); |
| | | //var user_id =$("#txtBillNo").val(); //currentSession.user_id; |
| | | //var mun=$("#txtSL").val(); |
| | | //GETGDINFO_SX(); |
| | | // var user_id = "admin"; |
| | | |
| | | |
| | | |
| | | } |
| | | }; |
| | | |
| | | function GetBarInfoDGDSS() { |
| | | console.log(2); |
| | | if (event.keyCode == 13) { |
| | | //如果未输入条码,跳出方法 |
| | | if ($("#DGD").val() == "") { |
| | | $("#DGD").focus(); |
| | | playerAudio("NG"); |
| | | console.log(3); |
| | | mui.toast("请先输入工单!"); |
| | | return; |
| | | } |
| | | } |
| | | $.ajax({ |
| | | url: app.API_URL_HEADER + "/XKYDHD/GetGSDGDSS", |
| | | data: { |
| | | DGD: $("#DGD").val(), |
| | | ITEM: $("#DAB020").val() |
| | | }, |
| | | DataType: "json", |
| | | type: "post", |
| | | async: false, |
| | | success: function(data) { |
| | | |
| | | if (data.status === 0) { |
| | | console.log(data.data); |
| | | /// console.log(JSON.stringify(response)); |
| | | var selectElement = document.getElementById('txtGD'); |
| | | selectElement.innerHTML = ""; |
| | | matterTable = data.data.matterTable; |
| | | |
| | | if (matterTable.length > 0) { |
| | | for (var i = 0; i < matterTable.length; i++) { |
| | | var option = document.createElement("option"); |
| | | option.value = matterTable[i]["DAA001"]; |
| | | option.text = matterTable[i]["DAA001"]; |
| | | selectElement.appendChild(option); |
| | | } |
| | | selectElement.value = matterTable[0]["DAA001"]; |
| | | //GETGDINFO_SX(); |
| | | } |
| | | } else { |
| | | playerAudio("NG"); |
| | | mui.toast("失败!" + data.message); |
| | | alert("获取数据异常:" + data.message); |
| | | } |
| | | GETGDINFO_SX(); |
| | | }, |
| | | error: function(xhr, type, errorThrown) { |
| | | console.log(4); |
| | | mui.toast("获取数据异常:" + JSON.stringify(errorThrown)); |
| | | alert("获取数据异常:"); |
| | | } |
| | | }); |
| | | //用户ID |
| | | // var currentSession = app.loadconfig(app.CONFIG_CURRENT_SESSION); |
| | | //var user_id =$("#txtBillNo").val(); //currentSession.user_id; |
| | | //var mun=$("#txtSL").val(); |
| | | //GETGDINFO_SX(); |
| | | // var user_id = "admin"; |
| | | |
| | | }; |
| | | |
| | | //扫描指令工单处理方法 |
| | | function GetBarInfoGD(){ |
| | | function GetBarInfoGD() { |
| | | GETGDINFO_SX(); |
| | | |
| | | }; |
| | | |
| | | function GETGDINFO_SX() |
| | | { |
| | | function GETGDINFO_SX() { |
| | | //console.log(234); |
| | | $.ajax({ |
| | | url: app.API_URL_HEADER + "/XKYDHD/GetBarInfoGD", |
| | | |
| | | |
| | | data: { |
| | | DAA001: $("#txtGD").val(), |
| | | }, |
| | |
| | | //timeout: 15000, |
| | | success: function(data) { |
| | | //console.log(JSON.stringify(data)); |
| | | if(data.status != 0) { |
| | | if (data.status != 0) { |
| | | playerAudio("NG"); |
| | | mui.alert(data.message,"","",function(){ |
| | | mui.alert(data.message, "", "", function() { |
| | | mui("#DAB001")[0].focus(); |
| | | $("#DAB001").val(""); |
| | | $("#txtSL").val("");//先清空一下数据源 |
| | | }); |
| | | $("#txtSL").val(""); //先清空一下数据源 |
| | | }); |
| | | return; |
| | | } else { |
| | | populateTable(data.data); |
| | | |
| | | |
| | | //$("#txtSL").val("");//先清空一下数据源 |
| | | |
| | | |
| | | $("#DEPOT").val(data.data.DEPOT); |
| | | $("#DEPOTSE").val(data.data.DEPOTSE); |
| | | //$("#txtSL").val(data.data.txtSL);//填入条码数量 |
| | | mui("#DAB001")[0].focus(); |
| | | |
| | | |
| | | } |
| | | }, |
| | | error: function(xhr, type, errorThrown) { |
| | |
| | | }); |
| | | } |
| | | |
| | | //扫描条码处理方法 |
| | | function GetBarInfoLL() { |
| | | if(event.keyCode == 13) { |
| | | //如果未输入条码,跳出方法 |
| | | if($("#DAB001").val() == "") { |
| | | //扫描条码处理方法 |
| | | function GetBarInfoLL() { |
| | | if (event.keyCode == 13) { |
| | | //如果未输入条码,跳出方法 |
| | | if ($("#DAB001").val() == "" ) { |
| | | $("#DAB001").focus(); |
| | | playerAudio("NG"); |
| | | mui.toast("请先扫描物料条码!"); |
| | | 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 + "/XKYDHD/GetBarInfoLL", |
| | | |
| | | data: { |
| | | DAB001: $("#DAB001").val(), |
| | | if ($("#DEPOTSE").val() == "" ) { |
| | | |
| | | 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 + "/XKYDHD/GetBarInfoLL", |
| | | |
| | | data: { |
| | | DAB001: $("#DAB001").val(), |
| | | DAA001: $("#txtGD").val(), |
| | | DEPOT: $("#DEPOT").val(), |
| | | DEPOTSE: $("#DEPOTSE").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("");//先清空一下数据源 |
| | | STYPE: $("#stype").val(), |
| | | logID: user_id, //Admin //先写死,便于调试 |
| | | |
| | | $("#txtSL").val(data.data.txtSL);//填入条码数量 |
| | | $("#SFSL").val(data.data.txtSL);//填入条码数量 |
| | | $("#DFSL").val(data.data.FLSL);//填入发料数量 |
| | | $("#JCSL").val(data.data.JCNUM);//填入发料数量 |
| | | $("#DAB020").val(data.data.DAB020);//填入物料编码 |
| | | $("#model").val(data.data.MSG);//填入物料编码 |
| | | }, |
| | | 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(""); //先清空一下数据源 |
| | | |
| | | |
| | | $("#txtSL").val(data.data.txtSL); //填入条码数量 |
| | | $("#SFSL").val(data.data.txtSL); //填入条码数量 |
| | | $("#DFSL").val(data.data.FLSL); //填入发料数量 |
| | | $("#JCSL").val(data.data.JCNUM); //填入发料数量 |
| | | $("#DAB020").val(data.data.DAB020); //填入物料编码 |
| | | $("#model").val(data.data.MSG); //填入物料编码 |
| | | //mui("#FLSL")[0].focus(); |
| | | |
| | | } |
| | | }, |
| | | error: function(xhr, type, errorThrown) { |
| | | alert("获取数据异常:" + JSON.stringify(errorThrown)); |
| | | } |
| | | }); |
| | | |
| | | }; |
| | | |
| | | |
| | | // 扫描条码处理方法 |
| | | $('#doSure').click(function is_CreateSCLLD() { |
| | | |
| | | // console.log(223); |
| | | // console.log(FLSLValue); |
| | | var re = /^(\-|\+)?\d+(\.\d+)?$/ ///^\d+(?=\.{0,1}\d+$|$)/ |
| | | //&&($("#FLSL").val()<$("#txtSL").val()) |
| | | if (re.test($("#SFSL").val())) |
| | | { |
| | | if((Number($("#SFSL").val())<=Number($("#txtSL").val())&&Number($("#SFSL").val())>0)){ |
| | | console.log(223); |
| | | } |
| | | else |
| | | { |
| | | document.getElementById("SFSL").value = ''; |
| | | |
| | | |
| | | mui.alert("实发数量需要大于0小于条码数量!") |
| | | return ; |
| | | } |
| | | // mui.alert("操作成功!") |
| | | } |
| | | else { |
| | | document.getElementById("SFSL").value = ''; |
| | | |
| | | |
| | | mui.alert("请输入正确的数字!") |
| | | return ; |
| | | } |
| | | // 比较数值大小 |
| | | if ($("#txtSL").val()<$("#SFSL").val()) |
| | | {mui.alert("实发数不能大于条码数"); |
| | | return; |
| | | }; |
| | | if ($("#txtSL").val()>$("#SFSL").val()) |
| | | {PrintSplit(); |
| | | }; |
| | | }, |
| | | error: function(xhr, type, errorThrown) { |
| | | alert("获取数据异常:" + JSON.stringify(errorThrown)); |
| | | } |
| | | }); |
| | | } |
| | | }; |
| | | |
| | | |
| | | // 扫描条码处理方法 |
| | | $('#doSure').click(function is_CreateSCLLD() { |
| | | |
| | | // console.log(223); |
| | | // console.log(FLSLValue); |
| | | var re = /^(\-|\+)?\d+(\.\d+)?$/ ///^\d+(?=\.{0,1}\d+$|$)/ |
| | | //&&($("#FLSL").val()<$("#txtSL").val()) |
| | | if (re.test($("#SFSL").val())) { |
| | | if ((Number($("#SFSL").val()) <= Number($("#txtSL").val()) && Number($("#SFSL").val()) > 0)) { |
| | | console.log(223); |
| | | } else { |
| | | document.getElementById("SFSL").value = ''; |
| | | |
| | | |
| | | mui.alert("实发数量需要大于0小于条码数量!") |
| | | return; |
| | | } |
| | | // mui.alert("操作成功!") |
| | | } else { |
| | | document.getElementById("SFSL").value = ''; |
| | | |
| | | |
| | | mui.alert("请输入正确的数字!") |
| | | return; |
| | | } |
| | | // 比较数值大小 |
| | | if ($("#txtSL").val() < $("#SFSL").val()) { |
| | | mui.alert("实发数不能大于条码数"); |
| | | return; |
| | | }; |
| | | if ($("#txtSL").val() > $("#SFSL").val()) { |
| | | PrintSplit(); |
| | | }; |
| | | |
| | | CreateSCLLD(); |
| | | GetBarInfoLL(); |
| | | GetBarInfoDGDSS(); |
| | | //GETGDINFO_SX(); |
| | | // if (txtSLValue <= FLSLValue) { |
| | | // // txtSL的值小于FLSL的值 |
| | | // // console.log("生成领料单"); |
| | | // CreateSCLLD(); |
| | | // GETGDINFO_SX(); |
| | | // } else if (txtSLValue > FLSLValue) { |
| | | // // txtSL的值大于FLSL的值 |
| | | // //console.log("确认是否拆分领料"); |
| | | // mui.confirm('是否拆分该条码?', '请确认', ['确认', '取消'], function(e) { |
| | | // if (e.index === 0) { |
| | | // PrintSplit(); |
| | | // GETGDINFO_SX(); |
| | | // console.log("刷新成功!"); |
| | | // } else { |
| | | // // 用户点击了取消按钮 |
| | | // mui("#FLSL")[0].focus(); |
| | | // } |
| | | // }); |
| | | // } |
| | | // if (txtSLValue <= FLSLValue) { |
| | | // // txtSL的值小于FLSL的值 |
| | | // // console.log("生成领料单"); |
| | | // CreateSCLLD(); |
| | | // GETGDINFO_SX(); |
| | | // } else if (txtSLValue > FLSLValue) { |
| | | // // txtSL的值大于FLSL的值 |
| | | // //console.log("确认是否拆分领料"); |
| | | // mui.confirm('是否拆分该条码?', '请确认', ['确认', '取消'], function(e) { |
| | | // if (e.index === 0) { |
| | | // PrintSplit(); |
| | | // GETGDINFO_SX(); |
| | | // console.log("刷新成功!"); |
| | | // } else { |
| | | // // 用户点击了取消按钮 |
| | | // mui("#FLSL")[0].focus(); |
| | | // } |
| | | // }); |
| | | // } |
| | | |
| | | }); |
| | | |
| | | |
| | | function CreateSCLLD() { |
| | | //用户ID |
| | | var currentSession = app.loadconfig(app.CONFIG_CURRENT_SESSION); |
| | | var user_id =currentSession.user_id; //currentSession.user_id; |
| | | // var user_id = "admin"; |
| | | //console.log(1); |
| | | $.ajax({ |
| | | url: app.API_URL_HEADER + "/XKYDHD/CreateSCLLD", |
| | | |
| | | data: { |
| | | DAB001: $("#DAB001").val(), |
| | | DAB020: $("#DAB020").val(), |
| | | DAA001: $("#txtGD").val(), |
| | | FLSL:$("#txtSL").val(), |
| | | DEPOT:$("#DEPOT").val(), |
| | | DEPOTSE:$("#DEPOTSE").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 { |
| | | $("#txtSL").val("");//先清空一下数据源 |
| | | $("#FLSL").val("");//先清空一下数据源 |
| | | $("#DFSL").val("");//先清空一下数据源 |
| | | $("#JCSL").val("");//先清空一下数据源 |
| | | $("#DAB001").val("");//先清空一下数据源 |
| | | // $("#txtSL").val(data.data.txtSL);//填入条码数量 |
| | | // $("#FLSL").val(data.data.FLSL);//填入条码数量 |
| | | mui("#FLSL")[0].focus(); |
| | | |
| | | playerAudio("OK"); |
| | | mui.toast("领料成功"); |
| | | |
| | | } |
| | | }, |
| | | error: function(xhr, type, errorThrown) { |
| | | console.log(2); |
| | | alert("获取数据异常:" + JSON.stringify(errorThrown)); |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | function PrintSplit() { |
| | | console.log(3); |
| | | function CreateSCLLD() { |
| | | //用户ID |
| | | var currentSession = app.loadconfig(app.CONFIG_CURRENT_SESSION); |
| | | var user_id =currentSession.user_id; //currentSession.user_id; |
| | | var user_id = currentSession.user_id; //currentSession.user_id; |
| | | // var user_id = "admin"; |
| | | $.ajax({ |
| | | url: app.API_URL_HEADER + "/XKYDHD/PrintSplit", |
| | | |
| | | data: { |
| | | DAB001: $("#DAB001").val(), |
| | | DAB020: $("#DAB020").val(), |
| | | DAA001: $("#txtGD").val(), |
| | | FLSL:$("#SFSL").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 { |
| | | |
| | | //console.log(1); |
| | | $.ajax({ |
| | | url: app.API_URL_HEADER + "/XKYDHD/CreateSCLLD", |
| | | |
| | | |
| | | //console.log(data.data.BARID); |
| | | console.log("开始打印!!"); |
| | | |
| | | var str = data.data.BARID.toString(); |
| | | console.log(str); // 将BARID转换为字符串并打印输出 |
| | | $("#DAB001").val($("#DAB001").val()+'-'+str); |
| | | printByIds(str); |
| | | console.log("打印成功!!"); |
| | | playerAudio("OK"); |
| | | mui.toast("拆分成功"); |
| | | //initBluetooth(); |
| | | |
| | | } |
| | | }, |
| | | error: function(xhr, type, errorThrown) { |
| | | alert("获取数据异常:" + JSON.stringify(errorThrown)); |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | |
| | | |
| | | function BarcodePutInStorageHint(){ |
| | | $.ajax({ |
| | | url: app.API_URL_HEADER + app.API_METHOD_ESP, |
| | | data: { |
| | | spname: "BarcodePutInStorageHint", |
| | | returnvalue: 1, |
| | | _sp_DAB001: $("#DAB001").val() |
| | | }, |
| | | type: "post", |
| | | success: function(data) { |
| | | console.log(JSON.stringify(data)); |
| | | if(data.status == 0) { |
| | | $("#hint")[0].innerHTML= |
| | | "个数/扫描数/送货数:"+ |
| | | data.data[0]["A1"]+"/"+ |
| | | data.data[0]["B1"]+"/"+ |
| | | data.data[0]["B"]; |
| | | |
| | | data: { |
| | | DAB001: $("#DAB001").val(), |
| | | DAB020: $("#DAB020").val(), |
| | | DAA001: $("#txtGD").val(), |
| | | FLSL: $("#txtSL").val(), |
| | | DEPOT: $("#DEPOT").val(), |
| | | DEPOTSE: $("#DEPOTSE").val(), |
| | | STYPE: $("#stype").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 { |
| | | $("#txtSL").val(""); //先清空一下数据源 |
| | | $("#SFSL").val(""); //先清空一下数据源 |
| | | $("#DFSL").val(""); //先清空一下数据源 |
| | | $("#JCSL").val(""); //先清空一下数据源 |
| | | $("#DAB001").val(""); //先清空一下数据源 |
| | | $("#DAB020").val(""); //先清空一下数据源 |
| | | $("#model").val(""); //先清空一下数据源 |
| | | // $("#txtSL").val(data.data.txtSL);//填入条码数量 |
| | | // $("#FLSL").val(data.data.FLSL);//填入条码数量 |
| | | //mui("#FLSL")[0].focus(); |
| | | |
| | | playerAudio("OK"); |
| | | mui.toast("领料成功"); |
| | | |
| | | } |
| | | }, |
| | | error: function(xhr, type, errorThrown) { |
| | | console.log(2); |
| | | alert("获取数据异常:" + JSON.stringify(errorThrown)); |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | function PrintSplit() { |
| | | console.log(3); |
| | | 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 + "/XKYDHD/PrintSplit", |
| | | |
| | | data: { |
| | | DAB001: $("#DAB001").val(), |
| | | DAB020: $("#DAB020").val(), |
| | | DAA001: $("#txtGD").val(), |
| | | FLSL: $("#SFSL").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 { |
| | | |
| | | |
| | | |
| | | //console.log(data.data.BARID); |
| | | console.log("开始打印!!"); |
| | | |
| | | var str = data.data.BARID.toString(); |
| | | console.log(str); // 将BARID转换为字符串并打印输出 |
| | | $("#DAB001").val($("#DAB001").val() + '-' + str); |
| | | printByIds(str); |
| | | console.log("打印成功!!"); |
| | | playerAudio("OK"); |
| | | mui.toast("拆分成功"); |
| | | //initBluetooth(); |
| | | |
| | | } |
| | | }, |
| | | error: function(xhr, type, errorThrown) { |
| | | alert("获取数据异常:" + JSON.stringify(errorThrown)); |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | |
| | | |
| | | function BarcodePutInStorageHint() { |
| | | $.ajax({ |
| | | url: app.API_URL_HEADER + app.API_METHOD_ESP, |
| | | data: { |
| | | spname: "BarcodePutInStorageHint", |
| | | returnvalue: 1, |
| | | _sp_DAB001: $("#DAB001").val() |
| | | }, |
| | | type: "post", |
| | | success: function(data) { |
| | | console.log(JSON.stringify(data)); |
| | | if (data.status == 0) { |
| | | $("#hint")[0].innerHTML = |
| | | "个数/扫描数/送货数:" + |
| | | data.data[0]["A1"] + "/" + |
| | | data.data[0]["B1"] + "/" + |
| | | data.data[0]["B"]; |
| | | |
| | | ; |
| | | } else { |
| | | $("#hint")[0].innerHTML=""; |
| | | } |
| | | }, |
| | | error: function(xhr, type, errorThrown) { |
| | | } |
| | | }); |
| | | } |
| | | |
| | | } else { |
| | | $("#hint")[0].innerHTML = ""; |
| | | } |
| | | }, |
| | | error: function(xhr, type, errorThrown) {} |
| | | }); |
| | | } |
| | | |
| | | |
| | | |
| | | /* 当页面的文本失去焦点时,让其再次获取焦点 */ |