From 5ad02cdbb8b596683c45751f78aa82d015a85143 Mon Sep 17 00:00:00 2001
From: cdk <2441919651@qq.com>
Date: 星期二, 07 一月 2025 09:27:10 +0800
Subject: [PATCH] 1.其它出库增加发料数量字段,修改扫条码的逻辑 2.销售出库待发区增加库位
---
manifest.json | 2
pages/CangKuManage/CK_XSCK_DFQ.html | 162 ++++++++++++++------------
pages/CangKuManage/QTCK.html | 5
lib/base_js/js/app.js | 14 +
js/CangKuManage_js/QTCK.js | 162 +++++++++++++++++++++++++--
5 files changed, 251 insertions(+), 94 deletions(-)
diff --git a/js/CangKuManage_js/QTCK.js b/js/CangKuManage_js/QTCK.js
index ae2f364..9bc75e2 100644
--- a/js/CangKuManage_js/QTCK.js
+++ b/js/CangKuManage_js/QTCK.js
@@ -134,10 +134,10 @@
}
// var user_id = "admin";
$.ajax({
- url: app.API_URL_HEADER + "/XKYDHD/GetBarInfoQTBARCK",
+ url: app.API_URL_HEADER + "/XKYDHD/GetDBAInfoQTBARCK",
data: {
- DBNO:$("#QTNO").val(),
+ DBNO:$("#QTNO").val(),
DAB001: $("#DAB001").val(),
logID: user_id //user_id,//Admin //鍏堝啓姝伙紝渚夸簬璋冭瘯
@@ -156,16 +156,28 @@
});
return;
} else {
- matterTable = data.data.matterTable;
- $("#DAB001").val("");
- $("#DAB002").val(matterTable[0]["ITEMNO"].toString());
- $("#DAB003").val(matterTable[0]["QUANTITYB"].toString() === null ? 0 : matterTable[0]["QUANTITYB"].toString());
-mui.toast("鎵弿鎴愬姛!");
- mui("#DAB001")[0].focus();
- playerAudio("OK");
- GetInfoQTCK();
-
-
+ matterTable = data.data.matterTable;
+ $("#DAB002").val(matterTable[0]["ITEMNO"].toString());
+ $("#DAB003").val(matterTable[0]["DBA005"].toString() === null ? 0 : matterTable[0]["DBA005"].toString());
+ $("#FLSL").val(matterTable[0]["QUANTITY"].toString() === null ? 0 : matterTable[0]["QUANTITY"].toString());
+
+ var DAB003 = parseFloat($("#DAB003").val());
+ var FLSL = parseFloat($("#FLSL").val());
+ var ISEXIST = parseInt(matterTable[0]["ISEXIST"].toString() === null ? 0 : matterTable[0]["ISEXIST"].toString());
+ // 澶т簬0鐨勮〃绀哄湪琛℅S_QTWL涓紝涓嶅仛闄愬埗
+ if (DAB003 <= FLSL || ISEXIST > 0) {
+ // txtSL鐨勫�煎皬浜嶧LSL鐨勫��
+ //console.log("鐢熸垚棰嗘枡鍗�1");
+ CreateZJDBCK();
+ GetInfoQTCK();
+ mui("#DAB001")[0].focus();
+ $("#DAB001").val("");//鍏堟竻绌轰竴涓嬫暟鎹簮
+ $("#DAB002").val("");//鍏堟竻绌轰竴涓嬫暟鎹簮
+ $("#DAB003").val("");//鍏堟竻绌轰竴涓嬫暟鎹簮
+ $("#FLSL").val("");//鍏堟竻绌轰竴涓嬫暟鎹簮
+ } else{
+ mui("#FLSL")[0].focus();
+ }
}
},
error: function(xhr, type, errorThrown) {
@@ -174,6 +186,128 @@
});
}
};
+
+ function CreateZJDBCK() {
+ //鐢ㄦ埛ID
+ var currentSession = app.loadconfig(app.CONFIG_CURRENT_SESSION);
+ var user_id =currentSession.user_id; //currentSession.user_id;
+
+ $.ajax({
+ url: app.API_URL_HEADER + "/XKYDHD/GetBarInfoQTBARCK",
+
+ data: {
+ DBNO:$("#QTNO").val(),
+ DAB001: $("#DAB001").val(),
+ logID: user_id //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("");
+ $("#DAB003").val("");//鍏堟竻绌轰竴涓嬫暟鎹簮
+ });
+ return;
+ } else {
+ $("#DAB003").val("");//鍏堟竻绌轰竴涓嬫暟鎹簮
+ $("#FLSL").val("");//鍏堟竻绌轰竴涓嬫暟鎹簮
+
+ //mui("#FLSL")[0].focus();
+
+ playerAudio("OK");
+ mui.toast("鍑哄簱鎴愬姛");
+
+ }
+ },
+ error: function(xhr, type, errorThrown) {
+ alert("鑾峰彇鏁版嵁寮傚父锛�" + JSON.stringify(errorThrown));
+ }
+ });
+ };
+
+ // 鎵弿鏉$爜澶勭悊鏂规硶
+ function is_CreateSCLLD() {
+ if (event.keyCode == 13) {
+ var DAB003Value = parseFloat($("#DAB003").val());
+ var FLSLValue = parseFloat($("#FLSL").val());
+
+ // 姣旇緝鏁板�煎ぇ灏�
+ if (DAB003Value <= FLSLValue) {
+ // txtSL鐨勫�煎皬浜嶧LSL鐨勫��
+ console.log("鐢熸垚棰嗘枡鍗�");
+ // CreateSCLLD();
+ // GETGDINFO_SX();
+ } else if (DAB003Value > FLSLValue) {
+ // txtSL鐨勫�煎ぇ浜嶧LSL鐨勫��
+ //console.log("纭鏄惁鎷嗗垎棰嗘枡");
+ mui.confirm('鏄惁鎷嗗垎璇ユ潯鐮侊紵', '璇风‘璁�', ['纭', '鍙栨秷'], function(e) {
+ if (e.index === 0) {
+ PrintSplit();
+ GetInfoQTCK();
+ console.log("鍒锋柊鎴愬姛锛�");
+ mui("#DAB001")[0].focus();
+ $("#DAB001").val("");//鍏堟竻绌轰竴涓嬫暟鎹簮
+ } else {
+ // 鐢ㄦ埛鐐瑰嚮浜嗗彇娑堟寜閽�
+ mui("#FLSL")[0].focus();
+ }
+ });
+ }
+ }
+ };
+
+ function PrintSplit() {
+ //鐢ㄦ埛ID
+ var currentSession = app.loadconfig(app.CONFIG_CURRENT_SESSION);
+ var user_id =currentSession.user_id; //currentSession.user_id;
+
+ $.ajax({
+ url: app.API_URL_HEADER + "/XKYDHD/GetBarInfoQTBARCK_S",
+
+ data: {
+ DBNO:$("#QTNO").val(),
+ DAB001: $("#DAB001").val(),
+ logID: user_id, //user_id,//Admin //鍏堝啓姝伙紝渚夸簬璋冭瘯
+ SL:$("#FLSL").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("");
+ $("#DAB003").val("");//鍏堟竻绌轰竴涓嬫暟鎹簮
+ });
+ return;
+ } else {
+ $("#DAB003").val("");//鍏堟竻绌轰竴涓嬫暟鎹簮
+ $("#FLSL").val("");//鍏堟竻绌轰竴涓嬫暟鎹簮
+ mui("#FLSL")[0].focus();
+
+ playerAudio("OK");
+ mui.toast("鍑哄簱鎴愬姛");
+ //initBluetooth();
+
+ }
+ },
+ error: function(xhr, type, errorThrown) {
+ alert("鑾峰彇鏁版嵁寮傚父锛�" + JSON.stringify(errorThrown));
+ }
+ });
+ };
+
function populateTable(data) {
console.log(data);
@@ -202,6 +336,10 @@
let td4 = document.createElement("td");
td4.textContent = data[i]["宸叉壂鏁伴噺"];
tr.appendChild(td4);
+
+ let td5 = document.createElement("td");
+ td5.textContent = data[i]["瓒呴绠$悊"];
+ tr.appendChild(td5);
tbody.appendChild(tr);
}
diff --git a/lib/base_js/js/app.js b/lib/base_js/js/app.js
index 40f6ebf..87e14cc 100644
--- a/lib/base_js/js/app.js
+++ b/lib/base_js/js/app.js
@@ -50,6 +50,12 @@
// app.API_URL_HEADER = "http://localhost:27611/api";
// app.API_URL_HEADER_BACK = "http://localhost:27611/api";
+ //姝e紡鐜
+ app.API_URL = "http://192.168.1.198:8081/MESAPP";
+ app.API_URL_BACK = "http://211.140.38.18:8081/MESAPP";
+ app.API_URL_HEADER = "http://192.168.1.198:8081/MESAPP/api";
+ app.API_URL_HEADER_BACK = "http://211.140.38.18:8081/MESAPP/api";
+
// app.API_URL = "http://192.168.0.103:27611";
// app.API_URL_BACK = "http://192.168.0.103:27611";
// app.API_URL_HEADER = "http://192.168.0.103:27611/api";
@@ -60,10 +66,10 @@
// app.API_URL_HEADER = "http://192.168.1.198:8081/MESAPP/api";
// app.API_URL_HEADER_BACK = "http://192.168.1.198:8081/MESAPP/api";
- app.API_URL = "http://192.168.1.198:8081/MESAPP";
- app.API_URL_BACK = "http://211.140.38.18:8081/MESAPP";
- app.API_URL_HEADER = "http://192.168.1.198:8081/MESAPP/api";
- app.API_URL_HEADER_BACK = "http://211.140.38.18:8081/MESAPP/api";
+ // app.API_URL = "http://192.168.1.198:8081/MESAPP";
+ // app.API_URL_BACK = "http://211.140.38.18:8081/MESAPP";
+ // app.API_URL_HEADER = "http://192.168.1.198:8081/MESAPP/api";
+ // app.API_URL_HEADER_BACK = "http://211.140.38.18:8081/MESAPP/api";
// app.API_URL = "http://211.140.38.18:8081/MESAPP";
// app.API_URL_BACK = "http://211.140.38.18:8081/MESAPP";
diff --git a/manifest.json b/manifest.json
index e9d6552..5ad5d45 100644
--- a/manifest.json
+++ b/manifest.json
@@ -3,7 +3,7 @@
"id" : "H546D0BA6", /*搴旂敤鐨勬爣璇�*/
"name" : "YKD_MES", /*搴旂敤鍚嶇О锛岀▼搴忔闈㈠浘鏍囧悕绉�*/
"version" : {
- "name" : "3.65", /*搴旂敤鐗堟湰鍚嶇О*/
+ "name" : "3.85", /*搴旂敤鐗堟湰鍚嶇О*/
"code" : "100"
},
"description" : "", /*搴旂敤鎻忚堪淇℃伅*/
diff --git a/pages/CangKuManage/CK_XSCK_DFQ.html b/pages/CangKuManage/CK_XSCK_DFQ.html
index 0ac4bc6..9c484f6 100644
--- a/pages/CangKuManage/CK_XSCK_DFQ.html
+++ b/pages/CangKuManage/CK_XSCK_DFQ.html
@@ -38,12 +38,6 @@
<body>
<div class="mui-input-group mui-content" >
- <!-- <div class="mui-input-row ">
- <div style=" float: left; ">
- <label class="row-title">浜哄憳</label>
- <input class="row-content-split" type="text" name="txtBillNo" id="txtBillNo" placeholder="璇烽�夋嫨鎶ュ伐浜哄憳"readonly="readonly">
- </div>
- </div> -->
<div class="mui-input-row" id="row001">
<label>浜哄憳缂栫爜</label>
<input id="txtBillNoN" type="text" value="" class="mui-input-clear text-color" placeholder="璇锋壂鎻忎汉鍛樼爜" onkeypress="GetBarInfoT()" />
@@ -104,7 +98,7 @@
</div>
<div style="width: 40%;float: left;">
<input id="MBA001" type="text" value="" class="text-color" placeholder="璇锋壂鎻忓簱浣�"
- style="width: 100%;float: left;" onkeypress="GetStoreTAA()" />
+ style="width: 100%;float: left;" onkeypress="GetStore()" />
</div>
<div style="width: 29%;float: left;" class="mui-checkbox mui-left">
<label style="width: 100%;float: left;">榛樿</label>
@@ -165,23 +159,13 @@
<script>
mui.init(); // 鍒濆鍖� MUI
- //app.init();
- //鍒濆鍖�
-
+
mui.plusReady(function() {
app.init();
fetchData();
fetchCYSData();
- // console.log("1111");
- //app.init();
- //fetchData();
- //fetchCYSData();
});
- // window.onload = function(){
-
- // fetchData();
- // fetchCYSData();
- // }
+
var is_DY =false;
// 褰撶‘瀹氭寜閽鐐瑰嚮鏃讹紝鎵ц鐨勫洖璋冨嚱鏁�
@@ -231,11 +215,7 @@
var DFA001 = splitValues[0]; // 绗竴涓�煎瓨鍏� DFA001
var DFB002 = splitValues[1]; // 绗簩涓�煎瓨鍏� DFB002
}
- //鐢ㄦ埛ID
- // var currentSession = app.loadconfig(app.CONFIG_CURRENT_SESSION);
- // var user_id =currentSession.user_id; //currentSession.user_id;
- // var user_id = "admin";
- //console.log("4");
+
$.ajax({
url: app.API_URL_HEADER + "/WARBABChag/GetBarInfoXSCK",
@@ -273,9 +253,7 @@
//$("#FLSL").val(data.data.FLSL);//濉叆鍙戞枡鏁伴噺
//$("#DAB020").val(data.data.DAB020);//濉叆鐗╂枡缂栫爜
-
-
- if (parseFloat(txtSL.value) <= parseFloat(FLSL.value)) {
+ if (parseFloat(txtSL.value) <= parseFloat(FLSL.value) && $("#MBA001").val() != '') {
// txtSL鐨勫�煎皬浜嶧LSL鐨勫��
console.log("鐢熸垚鍑哄簱鍗�");
@@ -283,6 +261,10 @@
txtSL.value = "";
FLSL.value = "";
document.getElementById("DAB020").value = "";
+ if(!document.getElementById('checkdefault').checked)
+ {
+ $("#MBA001").val("");
+ }
}else
{
FLSL.focus();
@@ -326,31 +308,32 @@
var DFB002 = splitValues[1]; // 绗簩涓�煎瓨鍏� DFB002
}
- // 姣旇緝鏁板�煎ぇ灏�
-
-
if (txtSLValue <= FLSLValue) {
-
- // txtSL鐨勫�煎皬浜嶧LSL鐨勫��
- console.log("鐢熸垚鍑哄簱鍗�1");
- // CreateXSCKD();
- // txtSL.value = "";
- // FLSL.value = "";
- // document.getElementById("DAB020").value = "";
+ CreateXSCKD();
+ txtSL.value = "";
+ FLSL.value = "";
+ document.getElementById("DAB020").value = "";
+ if(!document.getElementById('checkdefault').checked)
+ {
+ $("#MBA001").val("");
+ }
} else if (txtSLValue > FLSLValue) {
- // txtSL鐨勫�煎ぇ浜嶧LSL鐨勫��
- //console.log("纭鏄惁鎷嗗垎棰嗘枡");
mui.confirm('鏄惁鎷嗗垎璇ユ潯鐮侊紵', '璇风‘璁�', ['纭', '鍙栨秷'], function(e) {
if (e.index === 0) {
//PrintSplit();
if(is_DY)
{
-
PrintSplit_XSCK();
SX_FHTZD();
+ txtSL.value = "";
+ FLSL.value = "";
+ document.getElementById("DAB020").value = "";
+ if(!document.getElementById('checkdefault').checked)
+ {
+ $("#MBA001").val("");
+ }
console.log("鍒锋柊鎴愬姛锛�");
is_DY = false;
-
}
} else {
@@ -363,6 +346,55 @@
}
}
};
+
+ function GetStore() {
+ //鐢ㄦ埛ID
+ if($("#txtSL").val() == "" || $("#FLSL").val() == ""){
+ return;
+ }
+
+ var txtSL = document.getElementById("txtSL");
+ var FLSL = document.getElementById("FLSL");
+ var txtSLValue = parseFloat(txtSL.value);
+ var FLSLValue = parseFloat(FLSL.value);
+
+ if (txtSLValue <= FLSLValue) {
+ CreateXSCKD();
+ txtSL.value = "";
+ FLSL.value = "";
+ document.getElementById("DAB020").value = "";
+ if(!document.getElementById('checkdefault').checked)
+ {
+ $("#MBA001").val("");
+ }
+ } else if (txtSLValue > FLSLValue) {
+ mui.confirm('鏄惁鎷嗗垎璇ユ潯鐮侊紵', '璇风‘璁�', ['纭', '鍙栨秷'], function(e) {
+ if (e.index === 0) {
+ //PrintSplit();
+ if(is_DY)
+ {
+ PrintSplit_XSCK();
+ SX_FHTZD();
+ txtSL.value = "";
+ FLSL.value = "";
+ document.getElementById("DAB020").value = "";
+ if(!document.getElementById('checkdefault').checked)
+ {
+ $("#MBA001").val("");
+ }
+ console.log("鍒锋柊鎴愬姛锛�");
+ is_DY = false;
+ }
+
+ } else {
+ // 鐢ㄦ埛鐐瑰嚮浜嗗彇娑堟寜閽�
+ console.log("鍙栨秷鎷嗗垎锛�");
+ FLSL.focus();
+ }
+ });
+
+ }
+ }
//鍒锋柊鎸夐挳
function confirmQuantity() {
@@ -476,20 +508,8 @@
//鑾峰彇杞︾墝鍙�,鏍¢獙銆�
var cpinfo = document.getElementById("cpinfo");
var cpinfoValue = cpinfo.value;
+ var CKB002 = $("#MBA001").val();
- // if (cpinfoValue === '') {
- // alert("璇疯緭鍏ヨ溅鐗屽彿锛侊紒锛�");
- // return;
- // }
-
- // var currentSession = app.loadconfig(app.CONFIG_CURRENT_SESSION);
- // var user_id = currentSession.user_id;
-
- // var user_id = app.userid
- // if(app.userid === undefined)
- // {
- // user_id = document.getElementById('txtBillNo').value;
- // }
var currentSession = app.loadconfig(app.CONFIG_CURRENT_SESSION);
//var user_id = currentSession.user_id;
if($("#txtBillNo").val() == ""){
@@ -500,7 +520,7 @@
console.log(user_id);
- $.ajax(app.API_URL_HEADER + "/WARBABChag/PrintSplit_XSCK", {
+ $.ajax(app.API_URL_HEADER + "/WARBABChag/PrintSplit_XSCK_DFQ", {
data: {
DAB001: barcodeValue,
user_id: user_id,
@@ -513,6 +533,7 @@
orderTypeBill: orderTypeBill,
orderTypeName: orderTypeName,
FLSL:document.getElementById("FLSL").value,
+ CKB002: CKB002,
},
dataType: "json",
type: "post",
@@ -544,9 +565,6 @@
SX_FHTZD();
playerAudio("OK");
//printByIds(str);
-
-
-
}
},
error: function(xhr, type, errorThrown) {
@@ -788,16 +806,17 @@
function CreateXSCKD() {
var barcodeInput = document.getElementById("DAB001");
var barcodeValue = barcodeInput.value;
-
-
-
-
// 濡傛灉鏈緭鍏ユ潯鐮侊紝璺冲嚭鏂规硶
if (barcodeValue === '') {
alert("璇锋壂鎻忔潯鐮侊紒锛侊紒");
return;
}
+
+ if ($("#MBA001").val() === '') {
+ alert("璇锋壂鎻忓簱浣嶏紒锛侊紒");
+ return;
+ }
//鑾峰彇鍙戣揣閫氱煡鍗曪紝鏍¢獙
var COMDFA = document.getElementById("order");
@@ -817,6 +836,7 @@
//鑾峰彇涓氬姟绫诲瀷,鏍¢獙銆�
var ywlx = document.getElementById("base");
var ywlxValue = ywlx.value;
+ var CKB002 = $("#MBA001").val();
if (ywlxValue === '') {
alert("璇烽�夋嫨涓氬姟绫诲瀷锛侊紒锛�");
@@ -856,20 +876,7 @@
//鑾峰彇杞︾墝鍙�,鏍¢獙銆�
var cpinfo = document.getElementById("cpinfo");
var cpinfoValue = cpinfo.value;
-
- // if (cpinfoValue === '') {
- // alert("璇疯緭鍏ヨ溅鐗屽彿锛侊紒锛�");
- // return;
- // }
-
- // var currentSession = app.loadconfig(app.CONFIG_CURRENT_SESSION);
- // var user_id = currentSession.user_id;
-
- // var user_id = app.userid
- // if(app.userid === undefined)
- // {
- // user_id = document.getElementById('txtBillNo').value;
- // }
+
var currentSession = app.loadconfig(app.CONFIG_CURRENT_SESSION);
//var user_id = currentSession.user_id;
@@ -881,7 +888,7 @@
console.log(user_id);
- $.ajax(app.API_URL_HEADER + "/WARBABChag/CreateXSCK", {
+ $.ajax(app.API_URL_HEADER + "/WARBABChag/CreateXSCK_DFQ", {
data: {
DAB001: barcodeValue,
user_id: user_id,
@@ -893,6 +900,7 @@
cpinfo: cpinfoValue,
orderTypeBill: orderTypeBill,
orderTypeName: orderTypeName,
+ CKB002: CKB002,
},
dataType: "json",
type: "post",
diff --git a/pages/CangKuManage/QTCK.html b/pages/CangKuManage/QTCK.html
index ec90ba8..b084f2b 100644
--- a/pages/CangKuManage/QTCK.html
+++ b/pages/CangKuManage/QTCK.html
@@ -64,6 +64,10 @@
<label>鏉$爜鏁伴噺</label>
<input id="DAB003" readonly="readonly" type="text" value="" class="mui-input-clear text-color" />
</div>
+ <div class="mui-input-row" id="row001">
+ <label>鍙戞枡鏁伴噺</label>
+ <input id="FLSL" type="text" value="" class="mui-input-clear text-color" placeholder="璇疯緭鍏ュ彂鏂欐暟閲�" onkeypress="is_CreateSCLLD()" />
+ </div>
<!-- <div class="mui-input-row" id="row001">
<label>鍑哄簱鏁伴噺</label>
<input id="DAB004" readonly="readonly" type="text" value="" class="mui-input-clear text-color" />
@@ -87,6 +91,7 @@
<th>鐗╂枡浠g爜</th>
<th>鐢宠鏁伴噺</th>
<th>宸叉壂鏁伴噺</th>
+ <th>瓒呴绠$悊</th>
</tr>
</thead>
--
Gitblit v1.9.3