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.销售出库待发区增加库位
---
js/CangKuManage_js/QTCK.js | 162 ++++++++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 150 insertions(+), 12 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);
}
--
Gitblit v1.9.3