From e701bbb0b83037cb945cdd66d7f943b68c88f004 Mon Sep 17 00:00:00 2001
From: yuyou_x <2336760928@qq.com>
Date: 星期四, 07 三月 2024 12:56:37 +0800
Subject: [PATCH] Merge branch 'yyk'
---
Pda/View/SoSetting/productOut.html | 199 +++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 180 insertions(+), 19 deletions(-)
diff --git a/Pda/View/SoSetting/productOut.html b/Pda/View/SoSetting/productOut.html
index dbc2b7b..0e49687 100644
--- a/Pda/View/SoSetting/productOut.html
+++ b/Pda/View/SoSetting/productOut.html
@@ -295,6 +295,17 @@
</div>
</div>
</td>
+ </tr>
+ <tr class="divPickQty1">
+ <td>
+ <div class="layui-form-item layout-input" style="margin-top: 6px;">
+ <label class="layui-form-label lableWidth">鎷h揣鏁伴噺锛�</label>
+ <div class="layui-input-block">
+ <input id="pickQty1" type="number" placeholder="璇疯緭鍏ユ嫞璐ф暟閲�"autocomplete="off"
+ class="layui-input" oninput="value=value.replace(/^(0+)|[^\d]+/g,'')">
+ </div>
+ </div>
+ </td>
</tr>
</table>
</div>
@@ -471,14 +482,14 @@
</div>
</div>
<div class="layui-form-item layout-input" style="display: flex; justify-content: space-between;">
- <div style="width: 48%;">
+ <div style="width: 49%;">
<label class="layui-form-label" style="width: 34%;">鍑哄簱鍙o細</label>
- <div class="layui-input-block" style="width: 66%;margin-left:34%;">
+ <div class="layui-input-block" style="width: 62%;margin-left:34%;">
<input id="outModel2" type="text" lay-verify="" disabled placeholder=""
class="layui-input" > <!-- style="border: 0px;" -->
</div>
</div>
- <div style="width: 48%;">
+ <div style="width: 49%;">
<label class="layui-form-label" style="width: 70px;">宸叉嫞鏁伴噺锛�</label>
<div class="layui-input-block" style="width: 120px; margin-left:70px;">
<input id="pickedQty2" type="text" lay-verify="" disabled
@@ -519,8 +530,8 @@
</div>
<div class="layout-tbl-paging" id="">
- <table id="tableBoxList" class="tbl-box-list" border="" cellspacing="" cellpadding="">
- <tr id="tableHead">
+ <table id="tableBoxList2" class="tbl-box-list" border="" cellspacing="" cellpadding="">
+ <tr id="tableHead2">
<th style="width: 54%;">鐗╂枡缂栫爜</th>
<th style="width: 20%;">鎵樺唴<br>鏁伴噺</th>
<th style="width: 20%;">宸叉嫞<br>鏁伴噺</th>
@@ -528,9 +539,9 @@
<!-- <th style="width: 8%;">鎷h揣</th> -->
</tr>
<tr id="boxCell2" style="display: none;">
- <td name="SkuNo2">AG000001</td>
- <td name="qty2">30</td>
- <td name="pickedQty2">30</td>
+ <td name="SkuNo">AG000001</td>
+ <td name="Qty">30</td>
+ <td name="pickedQty">30</td>
</tr>
</table>
@@ -600,6 +611,7 @@
//鏄惁鏁存墭鎷h揣
var isContinue = "0";
var tableData = null
+ var tableData2 = null
var canPickBox = true
$("#palletNo").focus();//鍏夋爣榛樿閫変腑
@@ -942,6 +954,20 @@
});
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())
@@ -975,6 +1001,7 @@
"PalletNo": $('#palletNo').val(),
"BoxNo": $('#boxNo').val(),
"BoxNo3": $('#boxNo3').val(),
+ "PickQty":$('#pickQty1').val()
}
sendData(IP + "/PdaSo/SoSetPick", param, 'post', function (res) {
//console.log(res);
@@ -1191,14 +1218,17 @@
synData(IP + "/PdaSo/IsEnableOkPalletNo", param, 'post', function (res) {
if (res.code == 0) { //鎴愬姛
updateBillList2();
- if ($('#bar').val() == "") {
+ console.log($('#bar2').val())
+ if ($('#bar2').val() == "") {
+ console.log(1)
clear21();
return;
} else {
+ console.log(2)
updateSkuLotNoList2();
updateQtyList2();
getBar2();
- GetBoxInfo();
+ GetDataInfo();
}
} else { //涓嶆垚鍔�
@@ -1250,10 +1280,20 @@
if (res.code == 0) { //鎴愬姛
for (var i = 0; i < res.data.length; i++) {
if (i == 0) {
- $("#skuLotNo2").append('<option value =' + res.data[i].SoDetailId + ' selected>' + res.data[i].SkuName + " - " + res.data[i].LotNo + '</option>');
+ $("#skuLotNo2").append('<option value =' + res.data[i].SoDetailId + ' selected>' + res.data[i].SkuName);
+ if(res.data[i].LotNo == null)
+ {
+ $("#skuLotNo2").append(" - " + res.data[i].LotNo);
+ }
+ $("#skuLotNo2").append('</option>');
} else {
- $("#skuLotNo2").append('<option value =' + res.data[i].SoDetailId + '>' + res.data[i].SkuName + " - " + res.data[i].LotNo + '</option>');
+ $("#skuLotNo2").append('<option value =' + res.data[i].SoDetailId + '>' + res.data[i].SkuName);
+ if(res.data[i].LotNo == null)
+ {
+ $("#skuLotNo2").append(" - " + res.data[i].LotNo);
+ }
+ $("#skuLotNo2").append('</option>');
}
}
form.render('select');
@@ -1302,7 +1342,7 @@
$('#outModel2').val(res.data.OutModel);
$('#standard2').val(res.data.Standard);
- $('#pickQty2').val(res.data.PickQty);
+ $('#pickQty2').val(res.data.PickQty - res.data.PickedQty);
$('#pickedQty2').val(res.data.PickedQty);
} else { //涓嶆垚鍔�
layer.msg(res.msg, {
@@ -1315,18 +1355,17 @@
}
//鑾峰彇鎵樼洏鐗╂枡鍚嶇粏
- function GetBoxInfo() {
+ function GetDataInfo() {
let param2 = {
"SoDetailId": $("#skuLotNo2").val(),
"PalletNo": $("#palletNo2").val(),
- "BoxNo": $("#boxNo").val(),
- "BoxNo3": $("#boxNo3").val(),
}
- synData(IP + "/PdaSo/GetDataComBoxInfo", param2, 'post', function (res) {
+ console.log(param2);
+ synData(IP + "/PdaSo/GetAllotPlnInfo", param2, 'post', function (res) {
if (res.code == 0) {
- tableData = deepCopy(res.data)
+ tableData2 = deepCopy(res.data)
- refreshTable(tableData)
+ refreshTable2(tableData2)
} else {
layer.msg(res.msg, {
icon: 2,
@@ -1336,6 +1375,128 @@
});
}
+ //娓叉煋琛ㄦ牸鏁版嵁
+ function refreshTable2(list) {
+ //鍏堟竻绌轰竴涓嬩俊鎭垪琛�
+ let trs = $("#tableBoxList2 tr")
+ let len = trs.length
+ //console.log("tr 鏁伴噺 + " + trs.length)
+ for (i = len - 1; i >= 2; i--) {
+ trs[i].remove();
+ }
+
+ console.log(list != null);
+ console.log(list);
+ if (list != null && list.length > 0) { //鎴愬姛
+
+ var arrTrs = new Array()
+ let idx = 0
+ for (var i in list) {
+ // list[i].BoxCode
+ var tr = $("#boxCell2").eq(0).clone();
+ tr.appendTo("#tableBoxList2");
+ // tr.attr('id', list[i].BoxCode)
+ idx++;
+ tr.attr('index', idx)
+ // tr.find("td[name='skuNo']").attr('style', 'max-width:90px;');
+ // tr.find("td[name='skuName']").attr('style', 'max-width:120px;');
+ tr.find("td[name='SkuNo']").html(list[i].BoxNo);
+ tr.find("td[name='Qty']").html(list[i].Qty);
+ tr.find("td[name='pickedQty']").html(list[i].PickedQty);
+
+ tr.show();
+ arrTrs[i] = tr
+ }
+ setPages(1, list.length)
+ canPickBox = true
+
+ } else { //涓嶆垚鍔�
+ layer.msg("鏃犳暟鎹�", {
+ icon: 2,
+ time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+ }, function () { });
+ // $("#boxNum").val(0)
+ setPages(1, 0)
+ }
+ }
+
+ //鍗曟嫞璐э紙纭鎸夐挳锛�
+ form.on('submit(formPickScatter2)', function (data) {
+
+ 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 (canPickBox == false) {
+
+ layer.msg("璇锋眰鏈畬鎴愶紝涓嶈閲嶅璇锋眰", {
+ icon: 2,
+ time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+ });
+ return;
+ }
+
+ reqPickScatter2()
+
+ return false; //闃绘琛ㄥ崟璺宠浆銆傚鏋滈渶瑕佽〃鍗曡烦杞紝鍘绘帀杩欐鍗冲彲銆�
+ });
+
+ //纭鎷h揣
+ function reqPickScatter2() {
+ var param = {
+ "SoNo": $("#bar2").val(),
+ "SoDetailId": $("#skuLotNo2").val(),
+ "PalletNo": $('#palletNo2').val(),
+ "PickQty": $('#pickQty2').val(),
+ }
+ sendData(IP + "/PdaSo/SoSetQtyPick", 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();
+ });
+ } else { //涓嶆垚鍔�
+ layer.msg(res.msg, {
+ icon: 2,
+ time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+ }, function () {
+ canPickBox = true;//鍥炶皟
+ });
+ }
+ });
+ }
+
})
</script>
--
Gitblit v1.8.0