From 265fa2b9f6816f62fffac3db611fcb1fc9dfe1a6 Mon Sep 17 00:00:00 2001
From: bklLiudl <673013083@qq.com>
Date: 星期四, 17 十月 2024 18:47:53 +0800
Subject: [PATCH] 修改问题
---
Pda/View/SoSetting/SampleOut.html | 341 +++++++++++++++++++++++++++++++++++---------------------
1 files changed, 212 insertions(+), 129 deletions(-)
diff --git a/Pda/View/SoSetting/SampleOut.html b/Pda/View/SoSetting/SampleOut.html
index e54a94e..8ed7e48 100644
--- a/Pda/View/SoSetting/SampleOut.html
+++ b/Pda/View/SoSetting/SampleOut.html
@@ -549,8 +549,9 @@
var form = layui.form;
/* 鏍囩鍒囨崲浠g爜 */
-
var xianshiyemian = 0;
+ /* 鏍囩鍒囨崲浠g爜 */
+ var sampleType = ""; //0 搴撳唴鍙栨牱锛� 1 搴撳墠鍙栨牱
$('#kuneilabel').hide();
$('#kuqianlabel').hide();
@@ -655,6 +656,17 @@
$('#kuneilabel').show();
$('#kuneiQty').show();
$('#kuqianlabel').hide();
+ updateBillList();
+ if ($('#bar').val() == "") {
+ clear1();
+ return;
+ } else {
+ updateSkuLotNoList();
+ updateQtyList();
+ getBar();
+ GetBoxInfo();
+ }
+ sampleType = "0";
}
if (res.data == "1") {//搴撳墠鍙栨牱
$('#kuqianlabel').show();
@@ -662,17 +674,10 @@
$('#kuneiQty').hide();
updateAsnBillList();
+ GetBoxInfo();
+ sampleType = "1";
}
- // updateBillList();
- // if ($('#bar').val() == "") {
- // clear1();
- // return;
- // } else {
- // updateSkuLotNoList();
- // updateQtyList();
- // getBar();
- // GetBoxInfo();
- // }
+
}else { //涓嶆垚鍔�
layer.msg(res.msg, {
icon: 2,
@@ -941,101 +946,137 @@
//鍗曟嫞璐э紙纭鎸夐挳锛�
form.on('submit(formPickScatter)', function (data) {
- if ($('#bar').val() == "") {
- layer.msg("璇烽�夋嫨鍑哄簱鍗�", {
- icon: 2,
- time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
- }); return;
- }
- if ($('#bar').val() == "") {
- layer.msg("璇烽�夋嫨鐗╂枡-鎵规", {
- icon: 2,
- time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
- }); return;
- }
- if ($('#palletNo').val() == "") {
- layer.msg("璇疯緭鍏ユ墭鐩樼爜", {
- icon: 2,
- time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
- }); return;
- }
- if(isContinue=="0"){
- if ($('#boxNo').val() == "") {
- layer.msg("璇疯緭鍏ョ鐮�", {
- icon: 2,
- time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
- }); return;
- }
- if ($('#boxQty').val() == "") {
- layer.msg("绠卞唴鏁伴噺涓虹┖锛屼笉鑳芥嫞璐�", {
- icon: 2,
- time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
- });
- return;
- }
- if(($('#boxNo3').val() != "" && ($('#pickQty1').val() != "" || $('#pickQty1').val() != 0))){
- layer.msg("杩芥函鏉$爜鍜屾嫞璐ф暟閲忎笉鑳藉悓鏃惰緭鍏ワ紒", {
- icon: 2,
- time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
- });
- return;
- }
- if($('#pickQty1').val() != "" && $('#pickQty1').val()>parseInt($('#pickQty').val())){
- layer.msg("鎷h揣鏁伴噺涓嶈兘澶т簬寰呮嫞鏁伴噺锛�", {
- icon: 2,
- time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
- });
- return;
- }
- }
- // let boxQty = parseInt($('#boxQty').val())
- // let qty = parseInt($('#qty').val())
- // if (qty <= 0 || qty > boxQty) {
- // layer.msg("鎷h揣鏁伴噺闇�澶т簬0锛屽苟涓斾笉鑳借秴杩囧緟鎷g鍐呮暟閲�", {
- // icon: 2,
- // time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
- // });
- // return;
- // }
+ if (sampleType == "0") {
+ if ($('#bar').val() == "") {
+ layer.msg("璇烽�夋嫨鍑哄簱鍗�", {
+ icon: 2,
+ time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+ }); return;
+ }
+ if ($('#bar').val() == "") {
+ layer.msg("璇烽�夋嫨鐗╂枡-鎵规", {
+ icon: 2,
+ time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+ }); return;
+ }
+ if ($('#palletNo').val() == "") {
+ layer.msg("璇疯緭鍏ユ墭鐩樼爜", {
+ icon: 2,
+ time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+ }); return;
+ }
+ if(isContinue=="0"){
+ if ($('#boxNo').val() == "") {
+ layer.msg("璇疯緭鍏ョ鐮�", {
+ icon: 2,
+ time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+ }); return;
+ }
+ if ($('#boxQty').val() == "") {
+ layer.msg("绠卞唴鏁伴噺涓虹┖锛屼笉鑳芥嫞璐�", {
+ icon: 2,
+ time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+ });
+ return;
+ }
+ if(($('#boxNo3').val() != "" && ($('#pickQty1').val() != "" || $('#pickQty1').val() != 0))){
+ layer.msg("杩芥函鏉$爜鍜屾嫞璐ф暟閲忎笉鑳藉悓鏃惰緭鍏ワ紒", {
+ icon: 2,
+ time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+ });
+ return;
+ }
+ if($('#pickQty1').val() != "" && $('#pickQty1').val()>parseInt($('#pickQty').val())){
+ layer.msg("鎷h揣鏁伴噺涓嶈兘澶т簬寰呮嫞鏁伴噺锛�", {
+ icon: 2,
+ time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+ });
+ return;
+ }
+ }
+
+
+ }
+ else if (sampleType == "1") {
+ if ($('#AsnBar').val() == "") {
+ layer.msg("璇烽�夋嫨鍏ュ簱鍗�", {
+ icon: 2,
+ time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+ }); return;
+ }
+ if ($('#boxNo').val() == "") {
+ layer.msg("璇疯緭鍏ョ鐮�", {
+ icon: 2,
+ time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+ }); return;
+ }
+ if(($('#boxNo3').val() != "" && ($('#pickQty1').val() != "" || $('#pickQty1').val() != 0))){
+ layer.msg("杩芥函鏉$爜鍜屾嫞璐ф暟閲忎笉鑳藉悓鏃惰緭鍏ワ紒", {
+ icon: 2,
+ time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+ });
+ return;
+ }
+ }
+ else {
+ layer.msg("绫诲瀷閿欒锛岃鍒锋柊椤甸潰閲嶈瘯", {
+ icon: 2,
+ time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+ });
+ return;
+ }
+
+ if (canPickBox == false) {
- if (canPickBox == false) {
+ layer.msg("璇锋眰鏈畬鎴愶紝涓嶈閲嶅璇锋眰", {
+ icon: 2,
+ time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+ });
+ return;
+ }
- layer.msg("璇锋眰鏈畬鎴愶紝涓嶈閲嶅璇锋眰", {
- icon: 2,
- time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
- });
- return;
- }
-
- reqPickScatter()
+ reqPickScatter()
return false; //闃绘琛ㄥ崟璺宠浆銆傚鏋滈渶瑕佽〃鍗曡烦杞紝鍘绘帀杩欐鍗冲彲銆�
});
//纭鎷h揣
function reqPickScatter() {
+ canPickBox = false//鍥炶皟
var param = {
"SoNo": $("#bar").val(),
"SoDetailId": $("#skuLotNo").val(),
"PalletNo": $('#palletNo').val(),
"BoxNo": $('#boxNo').val(),
"BoxNo3": $('#boxNo3').val(),
- "PickQty":$('#pickQty1').val()
+ "PickQty":$('#pickQty1').val(),
+ "AsnNo":$('#AsnBar').val(),
+ "Type":sampleType
}
- sendData(IP + "/PdaSo/SoSetPick", param, 'post', function (res) {
- //console.log(res);
+
+ sendData(IP + "/PdaSo/SampleSoSetPick", param, 'post', function (res) {
if (res.code == 0) { //鎴愬姛
layer.msg(res.msg, {
icon: 1,
time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
}, function () {
- canPickBox = true//鍥炶皟
- $("#boxNo").val('');
- $("#boxNo3").val('');
- updateQtyList();
- getBar();
- GetBoxInfo();
+ if (sampleType == "0") {
+ canPickBox = true//鍥炶皟
+ $("#boxNo").val('');
+ $("#boxNo3").val('');
+ updateQtyList();
+ getBar();
+ GetBoxInfo();
+ }
+ if (sampleType == "1") {
+ canPickBox = true//鍥炶皟
+ $("#boxNo").val('');
+ $("#boxNo3").val('');
+ $("#pickQty1").val('');
+ GetBoxInfo();
+ }
+
});
} else { //涓嶆垚鍔�
layer.msg(res.msg, {
@@ -1273,25 +1314,29 @@
if (res.data == "0") {//搴撳唴鍙栨牱
$('#kuneilabel2').show();
$('#kuqianlabel2').hide();
+ updateBillList2();
+ console.log($('#bar2').val())
+ if ($('#bar2').val() == "") {
+ console.log(1)
+ clear21();
+ return;
+ } else {
+ console.log(2)
+ updateSkuLotNoList2();
+ updateQtyList2();
+ getBar2();
+ GetDataInfo();
+ }
+ sampleType = "0";
}
if (res.data == "1") {//搴撳墠鍙栨牱
$('#kuqianlabel2').show();
$('#kuneilabel2').hide();
updateAsnBillList2();
+ GetDataInfo();
+ sampleType = "1";
}
- // updateBillList2();
- // console.log($('#bar2').val())
- // if ($('#bar2').val() == "") {
- // console.log(1)
- // clear21();
- // return;
- // } else {
- // console.log(2)
- // updateSkuLotNoList2();
- // updateQtyList2();
- // getBar2();
- // GetDataInfo();
- // }
+
}else { //涓嶆垚鍔�
layer.msg(res.msg, {
icon: 2,
@@ -1491,33 +1536,60 @@
//鍗曟嫞璐э紙纭鎸夐挳锛�
form.on('submit(formPickScatter2)', function (data) {
- if ($('#bar2').val() == "") {
- layer.msg("璇烽�夋嫨鍑哄簱鍗�", {
- icon: 2,
- time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
- }); return;
+ if (sampleType == "0") {
+ if ($('#bar2').val() == "") {
+ layer.msg("璇烽�夋嫨鍑哄簱鍗�", {
+ icon: 2,
+ time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+ }); return;
+ }
+ if ($('#skuLotNo2').val() == "") {
+ layer.msg("璇烽�夋嫨鐗╂枡-鎵规", {
+ icon: 2,
+ time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+ }); return;
+ }
+ if ($('#palletNo2').val() == "") {
+ layer.msg("璇疯緭鍏ユ墭鐩樼爜", {
+ icon: 2,
+ time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+ }); return;
+ }
+ let pickedQty = parseInt($('#pickedQty2').val()) //宸叉嫞鏁伴噺
+ let pickQty = parseInt($('#pickQty2').val()) //鎷h揣鏁伴噺
+ if (pickQty <= 0) {
+ layer.msg("鎷h揣鏁伴噺闇�澶т簬0", {
+ icon: 2,
+ time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+ });
+ return;
+ }
}
- if ($('#skuLotNo2').val() == "") {
- layer.msg("璇烽�夋嫨鐗╂枡-鎵规", {
- icon: 2,
- time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
- }); return;
- }
- if ($('#palletNo2').val() == "") {
- layer.msg("璇疯緭鍏ユ墭鐩樼爜", {
- icon: 2,
- time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
- }); return;
- }
- let pickedQty = parseInt($('#pickedQty2').val()) //宸叉嫞鏁伴噺
- let pickQty = parseInt($('#pickQty2').val()) //鎷h揣鏁伴噺
- if (pickQty <= 0) {
- layer.msg("鎷h揣鏁伴噺闇�澶т簬0", {
- icon: 2,
- time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
- });
- return;
- }
+ else if (sampleType == "1") {
+ if ($('#AsnBar').val() == "") {
+ layer.msg("璇烽�夋嫨鍏ュ簱鍗�", {
+ icon: 2,
+ time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+ }); return;
+ }
+ let pickedQty = parseInt($('#pickedQty2').val()) //宸叉嫞鏁伴噺
+ let pickQty = parseInt($('#pickQty2').val()) //鎷h揣鏁伴噺
+ if (pickQty <= 0) {
+ layer.msg("鎷h揣鏁伴噺闇�澶т簬0", {
+ icon: 2,
+ time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+ });
+ return;
+ }
+ }
+ else {
+ layer.msg("绫诲瀷閿欒锛岃鍒锋柊椤甸潰閲嶈瘯", {
+ icon: 2,
+ time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+ });
+ return;
+ }
+
if (canPickBox == false) {
@@ -1535,24 +1607,35 @@
//纭鎷h揣
function reqPickScatter2() {
+ canPickBox = false//鍥炶皟
var param = {
"SoNo": $("#bar2").val(),
"SoDetailId": $("#skuLotNo2").val(),
"PalletNo": $('#palletNo2').val(),
"PickQty": $('#pickQty2').val(),
+ "AsnNo":$('#AsnBar').val(),
+ "Type":sampleType
}
- sendData(IP + "/PdaSo/SoSetQtyPick", param, 'post', function (res) {
+ sendData(IP + "/PdaSo/SampleSoSetQtyPick", param, 'post', function (res) {
//console.log(res);
if (res.code == 0) { //鎴愬姛
+
layer.msg(res.msg, {
icon: 1,
time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
}, function () {
- canPickBox = true//鍥炶皟
- updateQtyList2();
- getBar2();
- GetDataInfo();
+
+ if (sampleType == "0") {
+ canPickBox = true//鍥炶皟
+ updateQtyList2();
+ getBar2();
+ GetDataInfo();
+ }
+ if (sampleType == "1") {
+ canPickBox = true//鍥炶皟
+ GetDataInfo();
+ }
});
} else { //涓嶆垚鍔�
layer.msg(res.msg, {
--
Gitblit v1.8.0