From e561870f9644a5e80925346485fe623da678177f Mon Sep 17 00:00:00 2001
From: wxw <Administrator@DESKTOP-5BIMHQ3>
Date: 星期二, 14 十月 2025 10:20:57 +0800
Subject: [PATCH] 调整WMS出库逻辑,原辅料可选择成品库出库;
---
Pda/View/AsnSetting/productEnterQuantity.html | 1184 +++++++++++++++++++++++-----------------------------------
1 files changed, 467 insertions(+), 717 deletions(-)
diff --git a/Pda/View/AsnSetting/productEnterQuantity.html b/Pda/View/AsnSetting/productEnterQuantity.html
index f72aa08..df0fe21 100644
--- a/Pda/View/AsnSetting/productEnterQuantity.html
+++ b/Pda/View/AsnSetting/productEnterQuantity.html
@@ -265,7 +265,7 @@
</div>
<!-- 鏃犵爜 -->
<div id="content2">
- <div id="zongDiv" class="layout-bill-info" style="height: 255px;">
+ <div id="zongDiv2" class="layout-bill-info" style="height: 255px;">
<form class="layui-form" id="form2" action="">
<div id="" class="layui-form-item layout-dropdownlist">
<label class="layui-form-label" lang>鍏ュ簱鍗曪細</label>
@@ -295,11 +295,25 @@
</div>
<div id="" class="layui-form-item layout-input">
- <label class="layui-form-label" lang>鐗╂枡鏁伴噺锛�</label>
+ <!-- <label class="layui-form-label" lang>鐗╂枡鏁伴噺锛�</label>
<div class="layui-input-block">
<input id="SkuQty" type="number" lay-verify="stock" lang langholder
placeholder="璇疯緭鍏ョ墿鏂欐暟閲�" autocomplete="off" class="layui-input"
oninput="value=value.replace(/^(0+)|[^\d]+/g,'')">
+ </div> -->
+
+ <!-- <div class="layui-input-block">
+ <input id="SkuQty" type="number" lay-verify="stock" lay-affix="number" lang langholder
+ placeholder="璇疯緭鍏ョ墿鏂欐暟閲�" step="0.0001"
+ autocomplete="off" class="layui-input"
+ oninput="value=value.replace(/^(0+)|[^\d]+/g,'')">
+ </div> -->
+ <label class="layui-form-label" lang>鐗╂枡鏁伴噺锛�</label>
+ <div class="layui-input-block">
+ <!-- 鍏佽鏁板瓧銆佸皬鏁扮偣鍙婃渶澶�4浣嶅皬鏁� -->
+ <input id="SkuQty" type="number" lay-verify="stock" placeholder="璇疯緭鍏ョ墿鏂欐暟閲�"
+ autocomplete="off" class="layui-input"
+ oninput="value=value.replace(/^(0+)(?=\d)|[^\d.]/g,'').replace(/(\.\d{4})\d+/g, '$1')">
</div>
</div>
@@ -358,7 +372,7 @@
<label class="layui-form-label" lang>瀵勫瓨澶囨敞锛�</label>
<div class="layui-input-block">
<textarea placeholder="璇疯緭鍏ュ唴瀹�" id="Demo" name="Demo" class="layui-textarea" ></textarea>
-
+
</div>
</div> -->
<!-- 缁存姢澶囨敞寮规 -->
@@ -418,7 +432,7 @@
</td>
</tr>
</table>
-
+
<table id="tableBoxPages1" class="tbl-box-pages" border="" cellspacing="" cellpadding="">
<tr>
<td class="page-prev">涓婁竴椤�</td>
@@ -477,38 +491,12 @@
});
});
- //娓呮鏂囨湰妗嗕腑鏁版嵁
- // function clear() {
- // if (xianshiyemian == "0")
- // {
- // $("#BOXCODE").val("");
- // $("#BOXCODE2").val("");
-
- // $("#ImportQuantity").val("");
- // $("#Standard").val("");
- // $("#ImportFactQuantity").val("");
- // $("#BoxQty").val("");
- // }
- // else if (xianshiyemian == "1")
- // {
- // $("#BOXCODE").val("");
- // $("#BOXCODE2").val("");
-
- // $("#ImportQuantity").val("");
- // $("#Standard").val("");
- // $("#ImportFactQuantity").val("");
- // $("#BoxQty").val("");
- // }
-
- // }
-
/*鈥斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺��*/
initLanguage()
setLanguage()
- //褰撳墠鍒嗛〉
- var curPageIndex = 1;
+
//鏄惁杩炵画缁勬墭
isContinue = "0";
@@ -536,6 +524,50 @@
checkPalletStat()
})
+ // 鍒ゆ柇鎵樼洏鐮佹槸鍚﹀彲鐢�
+ function checkPalletStat() {
+ if (xianshiyemian == 0) {
+ var param = {
+ "PalletNo": $("#STOCKCODE").val()
+ }
+ sendData(IP + "/PdaAsn/IsEnablePalletNo", param, 'post', function (res) {
+ if (res.code == 0) {
+
+ $.cookie('stockCode', $("#STOCKCODE").val());
+ //refreshTable()
+ $("#BOXCODE").focus();
+
+ } else {
+ layer.msg(res.msg, {
+ icon: 2,
+ time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+ }, function () { });
+ }
+ });
+ }
+ else if (xianshiyemian == 1) {
+ var param = {
+ "PalletNo": $("#STOCKCODE1").val()
+ }
+ sendData(IP + "/PdaAsn/IsEnablePalletNo", param, 'post', function (res) {
+ if (res.code == 0) {
+
+ $.cookie('stockCode1', $("#STOCKCODE1").val());
+ //refreshTable()
+ $("#SkuQty").focus();
+
+ } else {
+ layer.msg(res.msg, {
+ icon: 2,
+ time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+ }, function () { });
+ }
+ });
+ }
+
+ }
+
+
//绠辩爜鍥炶溅浜嬩欢
$("#BOXCODE").keydown(function (e) {
if (e.keyCode === 13) {
@@ -547,20 +579,23 @@
return
}
- // if ($("#STOCKCODE").val() == "") {
- // layer.msg('璇峰厛鎵弿鎵樼洏鐮�', {
- // icon: 2,
- // time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
- // });
- // $("#BOXCODE").val("");
- // $("#STOCKCODE").focus();
- // return;
- // }
checkBoxInfo()
}
});
+ //绠辩爜澶卞幓鐒︾偣浜嬩欢
+ $("#BOXCODE").blur(function(){
+ if ($("#BOXCODE").val() == "") {
+ layer.msg('璇峰厛鎵弿绠辩爜', {
+ icon: 2,
+ time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+ });
+ return
+ }
- /* 鍏ュ簱鍗曟嵁涓嬫媺妗� */
+ checkBoxInfo()
+ })
+
+
//鐐瑰嚮鍏ュ簱鍗曟嵁涓嬫媺妗嗕簨浠�
$("#selectDiv").click(function () {
if (xianshiyemian == 0) {
@@ -586,11 +621,7 @@
}
})
- /*鈥斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺��*/
-
-
- /* 缁戝畾鍏ュ簱鍗曚俊鎭� */
-
+ /* 鑾峰彇鍏ュ簱鍗曚俊鎭� */
function updateBillList(callback) {
if (xianshiyemian == 0) {
var input = $('select[id="bar"]').next().find('.layui-select-title input')
@@ -600,14 +631,12 @@
form.render('select');
var param = {
- Type: "0,3"
+ //Type: "0,3"
};
- sendData(IP + "/PdaAsn/GetArrivalNotices", param, 'post', function (res) {
+ sendData(IP + "/PdaAsn/GetPasteAsnNoStrList", param, 'post', function (res) {
if (res.code == 0) { //鎴愬姛
for (var i = 0; i < res.data.length; i++) {
- $("#bar").append('<option value =' + res.data[i].ASNNo + '>' + res.data[i]
- .ASNNo +
- '</option>');
+ $("#bar").append('<option value =' + res.data[i] + '>' + res.data[i] + '</option>');
}
form.render('select');
@@ -635,14 +664,12 @@
form.render('select');
var param = {
- Type: "1,2,4"
+ //Type: "1,2,4"
};
- sendData(IP + "/PdaAsn/GetArrivalNotices", param, 'post', function (res) {
+ sendData(IP + "/PdaAsn/GetNoPasteAsnNoStrList", param, 'post', function (res) {
if (res.code == 0) { //鎴愬姛
for (var i = 0; i < res.data.length; i++) {
- $("#bar1").append('<option value =' + res.data[i].ASNNo + '>' + res.data[i]
- .ASNNo +
- '</option>');
+ $("#bar1").append('<option value =' + res.data[i] + '>' + res.data[i] + '</option>');
}
form.render('select');
@@ -665,8 +692,6 @@
}
- /*鈥斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺��*/
-
//鐐瑰嚮鐗╂枡涓嬫媺妗嗕簨浠�
$("#goodDiv").click(function () {
if ($("#bar").val() == null || $("#bar").val() == "" || $("#bar").val() == undefined) {
@@ -685,6 +710,7 @@
}, function () { });
}
})
+
//閫変腑鍏ュ簱鍗曚簨浠�
form.on('select(getbar)', function (data) {
updateGoodList()
@@ -692,7 +718,7 @@
});
//閫変腑鍏ュ簱鍗曚簨浠�-鏁伴噺
form.on('select(getbar1)', function (data) {
- updateDemoDiv();
+ //updateDemoDiv();
updateGoodList()
setOrderGoods();
});
@@ -705,160 +731,142 @@
form.on('select(goodSelect1)', function (data) {
setOrderGoods();
});
-
- //缁戝畾鍒版墭鐩樹簨浠�
- form.on('submit(formBind)', function (data) {
+ var asnDetails = "";
+ /* 缁戝畾鍏ュ簱鍗曠墿鏂欏強鎵规 */
+ function updateGoodList(skuNo) {
if (xianshiyemian == 0) {
- console.log($("#goodSelect").val());
- if ($("#bar").val() == "") {
- layer.msg('璇烽�夋嫨鍏ュ簱鍗�', {
- icon: 2,
- time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
- });
- return;
- }
- if ($("#goodSelect").val() == "") {
- layer.msg('璇烽�夋嫨鐗╂枡鍙婃槑缁�', {
- icon: 2,
- time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
- });
- return;
- }
- if ($("#STOCKCODE").val() == "") {
- layer.msg('璇锋壂鎻忔墭鐩樻潯鐮�', {
- icon: 2,
- time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
- });
- return;
- }
- if ($("#BOXCODE").val() == "") {
- layer.msg('璇锋壂鎻忓绠辨潯鐮�', {
- icon: 2,
- time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
- });
- return;
- }
+ var input = $('select[id="goodSelect"]').next().find('.layui-select-title input')
+ var val = input.val()
+
+ $("#goodSelect").empty()
+ $("#goodSelect").append('<option value =>' + '</option>');
+
var param = {
AsnNo: $("#bar").val(),
- PalletNo: $("#STOCKCODE").val(),
- AsnDetailId: parseInt($("#goodSelect").val()),
- LotNo: $("#goodSelect").find("option:selected").text(),
- BoxNo: $("#BOXCODE").val(),
- IsContinue: isContinue,
- TailBoxNo: $("#BOXCODE2").val(),
- Origin: "PDA",
- TableType: xianshiyemian,
- }
- console.log(param)
- //缁勭洏
- sendData(IP + "/PdaAsn/BindPallet", param, 'post', function (res) {
- if (res.code == 0) { //鎴愬姛
- layer.msg(res.msg, {
- icon: 1,
- time: 1000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
- }, function () {
- setOrderGoods();
- refreshTable();
- $("#BOXCODE").val("");
- $("#BOXCODE2").val("");
- $("#QTY").val("");
- });
- } else { //涓嶆垚鍔�
- layer.msg(res.msg, {
- icon: 2,
- time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
- }, function () {
- //鍥炶皟
- });
+ };
+ synData(IP + "/PdaAsn/GetBindArrivalNoticeDetails", param, 'post', function (res) {
+ console.log("鍑哄簱鍙o細" + JSON.stringify(res))
+ if (res.code == 0) { //鎴愬姛
+ asnDetails = res.data;
+ if (asnDetails.length <= 0) {
+ layer.msg('褰撳墠鍗曟嵁涓嬩笉瀛樺湪璐存爣鐗╂枡', {
+ icon: 2,
+ time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+ });
+ return;
+ }
+ for (var i = 0; i < res.data.length; i++) {
+ if (skuNo != '' && skuNo == res.data[i].SkuNo) {
+ if (res.data[i].LotNo == '' || res.data[i].LotNo == null) {
+ $("#goodSelect").append('<option value =' + res.data[i].Id + '-' + i + ' selected>' + res.data[i]
+ .SkuName +
+ '</option>');
+ } else {
+ $("#goodSelect").append('<option value =' + res.data[i].Id + '-' + i + ' selected>' + res.data[i]
+ .SkuName + "=>" + res.data[i].LotNo +
+ '</option>');
+ }
+ } else {
+ if (i == 0) {
+ if (res.data[i].LotNo == '' || res.data[i].LotNo == null) {
+ $("#goodSelect").append('<option value =' + res.data[i].Id + '-' + i + ' selected>' + res.data[i]
+ .SkuName +
+ '</option>');
+ } else {
+ $("#goodSelect").append('<option value =' + res.data[i].Id + '-' + i + ' selected>' + res.data[i]
+ .SkuName + "=>" + res.data[i].LotNo +
+ '</option>');
+ }
+
+ } else {
+ if (res.data[i].LotNo == '' || res.data[i].LotNo == null) {
+ $("#goodSelect").append('<option value =' + res.data[i].Id + '-' + i + '>' + res.data[i]
+ .SkuName +
+ '</option>');
+ } else {
+ $("#goodSelect").append('<option value =' + res.data[i].Id + '-' + i + '>' + res.data[i]
+ .SkuName + "=>" + res.data[i].LotNo +
+ '</option>');
+ }
+ }
+ }
+ }
+ form.render('select');
+
+ if (!val) {
+ $('#goodSelect').siblings("div.layui-form-select").find('dl').find('.layui-select-tips').addClass('layui-this')
+ } else {
+ var sel = 'dd[lay-value=' + val + ']';
+ //$('#goodSelect').siblings("div.layui-form-select").find('dl').find(sel).addClass('layui-this')
+ }
+ } else {
}
});
}
else if (xianshiyemian == 1) {
- if ($("#bar1").val() == "") {
- layer.msg('璇烽�夋嫨鍏ュ簱鍗�', {
- icon: 2,
- time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
- });
- return;
- }
- if ($("#goodSelect1").val() == "") {
- layer.msg('璇烽�夋嫨鐗╂枡鍙婃槑缁�', {
- icon: 2,
- time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
- });
- return;
- }
- if ($("#STOCKCODE1").val() == "") {
- layer.msg('璇锋壂鎻忔墭鐩樻潯鐮�', {
- icon: 2,
- time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
- });
- return;
- }
- var param = {
- AsnNo: $("#bar1").val(), //鍑哄簱鍗曟嵁
- PalletNo: $("#STOCKCODE1").val(), //鎵樼洏鏉$爜
- AsnDetailId: parseInt($("#goodSelect1").val()), //鍏ュ簱鍗曟槑缁咺D
- LotNo: $("#goodSelect1").find("option:selected").text(), //鐗╂枡鎵规
- SkuQty: parseInt($("#SkuQty").val()), //鐗╂枡鏁伴噺
- Demo: $("#NoticeDemo").val(), //鐗╂枡鏁伴噺
- Origin: "PDA",
- TableType: xianshiyemian,
- }
+ console.log("bbbb");
+ var input = $('select[id="goodSelect1"]').next().find('.layui-select-title input')
+ var val = input.val()
- console.log(param)
- //缁勭洏
- sendData(IP + "/PdaAsn/BindPallet", param, 'post', function (res) {
- if (res.code == 0) { //鎴愬姛
- layer.msg(res.msg, {
- icon: 1,
- time: 1000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
- }, function () {
- setOrderGoods();
- refreshTable();
- $("#STOCKCODE").val("");
- $("#SkuQty").val("");
- });
- } else { //涓嶆垚鍔�
- layer.msg(res.msg, {
- icon: 2,
- time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
- }, function () {
- //鍥炶皟
- });
+ $("#goodSelect1").empty()
+ $("#goodSelect1").append('<option value =>' + '</option>');
+
+ var param = {
+ AsnNo: $("#bar1").val(),
+ };
+ synData(IP + "/PdaAsn/GetArrivalNoticeDetails", param, 'post', function (res) {
+ console.log("鍑哄簱鍙o細" + JSON.stringify(res))
+ if (res.code == 0) { //鎴愬姛
+ asnDetails = res.data;
+ // console.log(asnDetails.length)
+ if (asnDetails.length <= 0) {
+ layer.msg('褰撳墠鍗曟嵁涓嬩笉瀛樺湪涓嶈创鏍囩墿鏂�', {
+ icon: 2,
+ time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+ });
+ return;
+ }
+ for (var i = 0; i < res.data.length; i++) {
+ if (skuNo != '' && skuNo == res.data[i].SkuNo) {
+
+ if (i == 0) {
+ $("#goodSelect1").append('<option value =' + res.data[i].Id + ' selected>' + res.data[i]
+ .SkuName);
+ } else {
+ $("#goodSelect1").append('<option value =' + res.data[i].Id + '>' + res.data[i]
+ .SkuName);
+ }
+ if (res.data[i].LotNo != null) {
+ $("#goodSelect1").append("=>" + res.data[i].LotNo +
+ '</option>');
+ }
+ } else {
+ if (res.data[i].LotNo == '' || res.data[i].LotNo == null) {
+ $("#goodSelect1").append('<option value =' + res.data[i].Id + ' selected>' + res.data[i]
+ .SkuName +
+ '</option>');
+ } else {
+ $("#goodSelect1").append('<option value =' + res.data[i].Id + ' selected>' + res.data[i]
+ .SkuName + "=>" + res.data[i].LotNo +
+ '</option>');
+ }
+ }
+
+ }
+ form.render('select');
+
+ if (!val) {
+ $('#goodSelect1').siblings("div.layui-form-select").find('dl').find('.layui-select-tips').addClass('layui-this')
+ } else {
+ var sel = 'dd[lay-value=' + val + ']';
+ $('#goodSelect1').siblings("div.layui-form-select").find('dl').find(sel).addClass('layui-this')
+ }
+ } else {
+
}
});
}
- return false; //闃绘琛ㄥ崟璺宠浆銆傚鏋滈渶瑕佽〃鍗曡烦杞紝鍘绘帀杩欐鍗冲彲銆�
- });
-
-
- // 鏍规嵁鍏ュ簱鍗曞彿 鑾峰彇澶囨敞鏄惁鏄剧ず鍙婂娉ㄤ俊鎭�
- function updateDemoDiv() {
- var param = {
- AsnNo: $("#bar1").val(),
- };
- synData(IP + "/PdaAsn/GetArrivalNotice", param, 'post', function (res) {
- console.log(res)
- if (res.code == 0 && res.data != null) { //鎴愬姛
-
- //鍒ゆ柇榛樿閫変腑鏄惁涓哄瘎瀛樼墿鏂�
- if (res.data[0].Type == "7") {
- $("textarea[name='NoticeDemo']").val(res.data[0].Demo); //澶囨敞
- $('#demodiv').show();
- $('#demodiv1').show();
- }
- else {
- $('#demodiv').hide();
- $('#demodiv1').hide();
- }
- }
- else {
- $('#demodiv').hide();
- $('#demodiv1').hide();
- }
- });
}
// 鏍规嵁鍏ュ簱鏄庣粏ID 鑾峰彇璇︾粏淇℃伅
@@ -909,431 +917,265 @@
}
- var asnDetails = "";
+ var isChongFu = true;
+ //缁戝畾鍒版墭鐩樹簨浠�
+ form.on('submit(formBind)', function (data) {
+ if (isChongFu == true) {
+ isChongFu = false;
- /* 缁戝畾鍏ュ簱鍗曠墿鏂欏強鎵规 */
- function updateGoodList(skuNo) {
- if (xianshiyemian == 0) {
- var input = $('select[id="goodSelect"]').next().find('.layui-select-title input')
- var val = input.val()
+ if (xianshiyemian == 0) {
+ if ($("#bar").val() == "") {
+ layer.msg('璇烽�夋嫨鍏ュ簱鍗�', {
+ icon: 2,
+ time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+ });
+ return;
+ }
+ if ($("#goodSelect").val() == "") {
+ layer.msg('璇烽�夋嫨鐗╂枡鍙婃槑缁�', {
+ icon: 2,
+ time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+ });
+ return;
+ }
+ if ($("#STOCKCODE").val() == "") {
+ layer.msg('璇锋壂鎻忔墭鐩樻潯鐮�', {
+ icon: 2,
+ time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+ });
+ return;
+ }
+ if ($("#BOXCODE").val() == "") {
+ layer.msg('璇锋壂鎻忓绠辨潯鐮�', {
+ icon: 2,
+ time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+ });
+ return;
+ }
+ var param = {
+ AsnNo: $("#bar").val(),
+ PalletNo: $("#STOCKCODE").val(),
+ AsnDetailId: parseInt($("#goodSelect").val()),
+ LotNo: $("#goodSelect").find("option:selected").text(),
+ BoxNo: $("#BOXCODE").val(),
+ IsContinue: isContinue,
+ TailBoxNo: $("#BOXCODE2").val(),
+ Origin: "PDA",
+ TableType: xianshiyemian,
+ }
+ layer.msg('鏁版嵁鎻愪氦涓紝姝e湪缁勬墭...');
+ setTimeout(function() {
+ //缁勭洏
+ sendData(IP + "/PdaAsn/BindPallet", param, 'post', function (res) {
+ if (res.code == 0) { //鎴愬姛
+ layer.msg(res.msg, {
+ icon: 1,
+ time: 1000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+ }, function () {
+ setOrderGoods();
+ //refreshTable();
+ $("#BOXCODE").val("");
+ $("#BOXCODE2").val("");
+ $("#QTY").val("");
- $("#goodSelect").empty()
- $("#goodSelect").append('<option value =>' + '</option>');
+ isChongFu = true;
+ });
+ } else { //涓嶆垚鍔�
+ layer.msg(res.msg, {
+ icon: 2,
+ time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+ }, function () {
+ //鍥炶皟
+ isChongFu = true;
+ });
+ }
+ });
+ }, 2000); // 寤惰繜 1.5 绉�
+
+ }
+ else if (xianshiyemian == 1) {
+ if ($("#bar1").val() == "") {
+ layer.msg('璇烽�夋嫨鍏ュ簱鍗�', {
+ icon: 2,
+ time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+ });
+ return;
+ }
+ if ($("#goodSelect1").val() == "") {
+ layer.msg('璇烽�夋嫨鐗╂枡鍙婃槑缁�', {
+ icon: 2,
+ time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+ });
+ return;
+ }
+ if ($("#STOCKCODE1").val() == "") {
+ layer.msg('璇锋壂鎻忔墭鐩樻潯鐮�', {
+ icon: 2,
+ time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+ });
+ return;
+ }
+ // 鑾峰彇杈撳叆鐨勫�煎苟澶勭悊
+ var skuQty = parseFloat($("#SkuQty").val()) || 0;
+ // 纭繚鏄剧ず鏃朵繚鐣�4浣嶅皬鏁�
+ var formattedQty = skuQty.toFixed(4);
- var param = {
- AsnNo: $("#bar").val(),
- };
- synData(IP + "/PdaAsn/GetBindArrivalNoticeDetails", param, 'post', function (res) {
- console.log("鍑哄簱鍙o細" + JSON.stringify(res))
- if (res.code == 0) { //鎴愬姛
- asnDetails = res.data;
- if (asnDetails.length <= 0) {
- layer.msg('褰撳墠鍗曟嵁涓嬩笉瀛樺湪璐存爣鐗╂枡', {
+ var param = {
+ AsnNo: $("#bar1").val(), //鍑哄簱鍗曟嵁
+ PalletNo: $("#STOCKCODE1").val(), //鎵樼洏鏉$爜
+ AsnDetailId: parseInt($("#goodSelect1").val()), //鍏ュ簱鍗曟槑缁咺D
+ LotNo: $("#goodSelect1").find("option:selected").text(), //鐗╂枡鎵规
+ SkuQty: Number(skuQty), //鐗╂枡鏁伴噺
+ Demo: $("#NoticeDemo").val(), //鐗╂枡鏁伴噺
+ Origin: "PDA",
+ TableType: xianshiyemian,
+ }
+
+ console.log(param)
+ //缁勭洏
+ sendData(IP + "/PdaAsn/BindPallet", param, 'post', function (res) {
+ if (res.code == 0) { //鎴愬姛
+ layer.msg(res.msg, {
+ icon: 1,
+ time: 1000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+ }, function () {
+ setOrderGoods();
+ //refreshTable();
+ $("#STOCKCODE").val("");
+ $("#SkuQty").val("");
+
+ isChongFu = true;
+ });
+ } else { //涓嶆垚鍔�
+ layer.msg(res.msg, {
icon: 2,
time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+ }, function () {
+ //鍥炶皟
+ isChongFu = true;
});
- return;
}
- for (var i = 0; i < res.data.length; i++) {
- if (skuNo != '' && skuNo == res.data[i].SkuNo) {
- if (res.data[i].LotNo == '' || res.data[i].LotNo == null) {
- $("#goodSelect").append('<option value =' + res.data[i].Id + '-' + i + ' selected>' + res.data[i]
- .SkuName +
- '</option>');
- } else {
- $("#goodSelect").append('<option value =' + res.data[i].Id + '-' + i + ' selected>' + res.data[i]
- .SkuName + "-" + res.data[i].LotNo +
- '</option>');
- }
- } else {
- if (i == 0) {
- if (res.data[i].LotNo == '' || res.data[i].LotNo == null) {
- $("#goodSelect").append('<option value =' + res.data[i].Id + '-' + i + ' selected>' + res.data[i]
- .SkuName +
- '</option>');
- } else {
- $("#goodSelect").append('<option value =' + res.data[i].Id + '-' + i + ' selected>' + res.data[i]
- .SkuName + "-" + res.data[i].LotNo +
- '</option>');
- }
-
- } else {
- if (res.data[i].LotNo == '' || res.data[i].LotNo == null) {
- $("#goodSelect").append('<option value =' + res.data[i].Id + '-' + i + '>' + res.data[i]
- .SkuName +
- '</option>');
- } else {
- $("#goodSelect").append('<option value =' + res.data[i].Id + '-' + i + '>' + res.data[i]
- .SkuName + "-" + res.data[i].LotNo +
- '</option>');
- }
- }
- }
- }
- form.render('select');
-
- if (!val) {
- $('#goodSelect').siblings("div.layui-form-select").find('dl').find('.layui-select-tips').addClass('layui-this')
- } else {
- var sel = 'dd[lay-value=' + val + ']';
- $('#goodSelect').siblings("div.layui-form-select").find('dl').find(sel).addClass('layui-this')
- }
- } else {
- }
+ });
+ }
+ }else{
+ layer.msg("璇峰嬁閲嶅鐐瑰嚮", {
+ icon: 2,
+ time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
});
}
- else if (xianshiyemian == 1) {
- console.log("bbbb");
- var input = $('select[id="goodSelect1"]').next().find('.layui-select-title input')
- var val = input.val()
+
- $("#goodSelect1").empty()
- $("#goodSelect1").append('<option value =>' + '</option>');
+ return false; //闃绘琛ㄥ崟璺宠浆銆傚鏋滈渶瑕佽〃鍗曡烦杞紝鍘绘帀杩欐鍗冲彲銆�
+ });
- var param = {
- AsnNo: $("#bar1").val(),
- };
- synData(IP + "/PdaAsn/GetArrivalNoticeDetails", param, 'post', function (res) {
- console.log("鍑哄簱鍙o細" + JSON.stringify(res))
- if (res.code == 0) { //鎴愬姛
- asnDetails = res.data;
- // console.log(asnDetails.length)
- if (asnDetails.length <= 0) {
- layer.msg('褰撳墠鍗曟嵁涓嬩笉瀛樺湪涓嶈创鏍囩墿鏂�', {
- icon: 2,
- time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
- });
- return;
- }
- for (var i = 0; i < res.data.length; i++) {
- if (skuNo != '' && skuNo == res.data[i].SkuNo) {
- if (i == 0) {
- $("#goodSelect1").append('<option value =' + res.data[i].Id + ' selected>' + res.data[i]
- .SkuName);
- } else {
- $("#goodSelect1").append('<option value =' + res.data[i].Id + '>' + res.data[i]
- .SkuName);
- }
- if (res.data[i].LotNo != null) {
- $("#goodSelect1").append("-" + res.data[i].LotNo +
- '</option>');
- }
- } else {
- if (res.data[i].LotNo == '' || res.data[i].LotNo == null) {
- $("#goodSelect1").append('<option value =' + res.data[i].Id + ' selected>' + res.data[i]
- .SkuName +
- '</option>');
- } else {
- $("#goodSelect1").append('<option value =' + res.data[i].Id + ' selected>' + res.data[i]
- .SkuName + "-" + res.data[i].LotNo +
- '</option>');
- }
- }
+ // 鏍规嵁鍏ュ簱鍗曞彿 鑾峰彇澶囨敞鏄惁鏄剧ず鍙婂娉ㄤ俊鎭�
+ function updateDemoDiv() {
+ var param = {
+ AsnNo: $("#bar1").val(),
+ };
+ synData(IP + "/PdaAsn/GetArrivalNotice", param, 'post', function (res) {
+ console.log(res)
+ if (res.code == 0 && res.data != null) { //鎴愬姛
- }
- form.render('select');
-
- if (!val) {
- $('#goodSelect1').siblings("div.layui-form-select").find('dl').find('.layui-select-tips').addClass('layui-this')
- } else {
- var sel = 'dd[lay-value=' + val + ']';
- $('#goodSelect1').siblings("div.layui-form-select").find('dl').find(sel).addClass('layui-this')
- }
- } else {
-
+ //鍒ゆ柇榛樿閫変腑鏄惁涓哄瘎瀛樼墿鏂�
+ if (res.data[0].Type == "7") {
+ $("textarea[name='NoticeDemo']").val(res.data[0].Demo); //澶囨敞
+ $('#demodiv').show();
+ $('#demodiv1').show();
}
- });
- }
-
+ else {
+ $('#demodiv').hide();
+ $('#demodiv1').hide();
+ }
+ }
+ else {
+ $('#demodiv').hide();
+ $('#demodiv1').hide();
+ }
+ });
}
- // 娓叉煋绠辩爜淇℃伅
- function refreshTable() {
- if (xianshiyemian == 0) {
- //鍏堟竻绌轰竴涓嬬瀛愬垪琛�
- let trs = $("#tableBoxList tr")
- let len = trs.length
-
- for (i = len - 1; i >= 2; i--) {
- trs[i].remove();
- }
-
- //璁剧疆鎵樼洏鍙�
- $("#palletCode").val($.cookie('stockCode'))
-
- var param = {
- PalletNo: $.cookie('stockCode')
- };
- // 鏍规嵁鎵樼洏鍙疯幏鍙栫鐮佷俊鎭�
- sendData(IP + "/PdaAsn/GetBoxInfos", param, 'post', function (res) {
- if (res.code == 0) { //鎴愬姛
- var list = res
- var arrTrs = new Array()
- let idx = 0
- for (var i in res.data) {
- var tr = $("#boxCell").eq(0).clone();
- tr.appendTo("#tableBoxList");
- tr.attr('id', res.data[i].Id)
- tr.attr('boxno', res.data[i].BoxNo)
- tr.attr('BindNo', res.data[i].BindNo)
- idx++;
- tr.attr('index', idx)
- tr.find("td[name='code']").html(res.data[i].BoxNo);
- tr.find("td[name='name']").html(res.data[i].SkuName);
- tr.find("td[name='lotNo']").html(res.data[i].LotNo);
- tr.find("td[name='num']").html(res.data[i].Qty);
- tr.find("td[name='del']").click(function () {
- var elem = $(this).parent()
- var boxno = elem.attr('boxno')
- var BindNo = elem.attr('BindNo')
- var Id = elem.attr('id')
- layer.alert("纭畾瑕佷粠鎵樼洏涓婂垹闄よ繖涓鐗╂枡鍚楋紵<br>" + boxno, {
- icon: 2,
- time: 0, //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
- btn: ['鍒犻櫎', '鍙栨秷'],
- yes: function () {
-
- var param = {
- boxNo: boxno,
- };
- sendData(IP + "/BllAsn/DelBindBoxInfo", param, 'get', function (res) {
- if (res.code == 0) { //鎴愬姛
- layer.msg(res.msg, {
- icon: 1,
- time: 1000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
- });
- elem.remove()
- setOrderGoods();
- refreshTable();
- } else { //涓嶆垚鍔�
- layer.msg(res.msg, {
- icon: 2,
- time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
- }, function () { });
- }
- });
- }
- })
- })
- tr.show();
- arrTrs[i] = tr
- }
- //璁剧疆鍒嗛〉
- setPages(1, res.data.length)
-
- } else { //涓嶆垚鍔�
- layer.msg("鏃犳暟鎹�", {
- icon: 2,
- time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
- }, function () { });
- $("#boxNum").val(0)
- setPages(1, 0)
- }
- });
- }
- else if (xianshiyemian == 1) {
- //鍏堟竻绌轰竴涓嬬瀛愬垪琛�
- let trs = $("#tableBoxList1 tr")
- let len = trs.length
-
- for (i = len - 1; i >= 2; i--) {
- trs[i].remove();
- }
-
- //璁剧疆鎵樼洏鍙�
- $("#palletCode").val($.cookie('stockCode1'))
-
- var param = {
- PalletNo: $.cookie('stockCode1')
- };
- // 鏍规嵁鎵樼洏鍙疯幏鍙栫鐮佷俊鎭�
- sendData(IP + "/PdaAsn/GetPalletBindInfo", param, 'post', function (res) {
- if (res.code == 0) { //鎴愬姛
- var list = res
- var arrTrs = new Array()
- let idx = 0
- for (var i in res.data) {
- var tr = $("#boxCell").eq(0).clone();
- tr.appendTo("#tableBoxList1");
- tr.attr('id', res.data[i].Id)
- tr.attr('boxno', res.data[i].BoxNo)
- tr.attr('BindNo', res.data[i].BindNo)
- idx++;
- tr.attr('index', idx)
- tr.find("td[name='code']").html(res.data[i].SkuNo);
- tr.find("td[name='name']").html(res.data[i].SkuName);
- tr.find("td[name='lotNo']").html(res.data[i].LotNo);
- tr.find("td[name='num']").html(res.data[i].Qty);
- tr.find("td[name='del']").click(function () {
- var elem = $(this).parent()
- // var boxno = elem.attr('boxno')
- var BindNo = elem.attr('BindNo')
- console.log(res)
- var Id = elem.attr('id')
- layer.alert("纭畾瑕佷粠鎵樼洏涓婂垹闄よ繖鎵樼墿鏂欏悧锛�<br>" + res.data[0].PalletNo, {
- icon: 2,
- time: 0, //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
- btn: ['鍒犻櫎', '鍙栨秷'],
- yes: function () {
-
- var param = {
- Id: parseInt(Id),
- PalletNo: res.data[0].PalletNo,
- };
- console.log(Id)
- console.log(param)
- sendData(IP + "/PdaAsn/DelPalletBind", param, 'post', function (res) {
- if (res.code == 0) { //鎴愬姛
- layer.msg(res.msg, {
- icon: 1,
- time: 1000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
- });
- elem.remove()
- setOrderGoods();
- refreshTable();
- } else { //涓嶆垚鍔�
- layer.msg(res.msg, {
- icon: 2,
- time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
- }, function () { });
- }
- });
- }
- })
- })
- tr.show();
- arrTrs[i] = tr
- }
-
- //璁剧疆鍒嗛〉
- setPages(1, res.data.length)
-
- } else { //涓嶆垚鍔�
- layer.msg("鏃犳暟鎹�", {
- icon: 2,
- time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
- }, function () { });
- $("#boxNum").val(0)
- setPages(1, 0)
- }
- });
- }
-
- }
-
- // 鍒ゆ柇鎵樼洏鐮佹槸鍚﹀彲鐢�
- function checkPalletStat() {
- if (xianshiyemian == 0) {
- var param = {
- "PalletNo": $("#STOCKCODE").val()
- }
- sendData(IP + "/PdaAsn/IsEnablePalletNo", param, 'post', function (res) {
- if (res.code == 0) {
-
- $.cookie('stockCode', $("#STOCKCODE").val());
- refreshTable()
- $("#BOXCODE").focus();
-
- } else {
- layer.msg(res.msg, {
- icon: 2,
- time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
- }, function () { });
- }
- });
- }
- else if (xianshiyemian == 1) {
- var param = {
- "PalletNo": $("#STOCKCODE1").val()
- }
- sendData(IP + "/PdaAsn/IsEnablePalletNo", param, 'post', function (res) {
- if (res.code == 0) {
-
- $.cookie('stockCode1', $("#STOCKCODE1").val());
- refreshTable()
- $("#SkuQty").focus();
-
- } else {
- layer.msg(res.msg, {
- icon: 2,
- time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
- }, function () { });
- }
- });
- }
-
- }
-
-
+ //绠卞洖杞︿簨浠�
function checkBoxInfo() {
var param = {
"BoxNo": $("#BOXCODE").val(),
+ "ASNNo": $("#bar").val()
}
sendData(IP + "/PdaAsn/GetBindBoxInfos", param, 'post', function (res) {
- BoxLevelVal = "0";
+
+
if (res.code == 0) { //鎴愬姛
- //鍒ゆ柇鏄惁涓洪浂绠盉itBoxMark
- if (res.data[0].BitBoxMark == '1') {
- getFMBoxinfo();
+
+ var bl = false;
+ if (res.data.length == 0) {
+ layer.msg("鏈煡璇㈠埌姝ょ鐗╂枡淇℃伅锛岃鏍稿疄!", {
+ icon: 2,
+ time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+ });
+ return;
+ }
+
+ if (res.data[0].ASNNo != '' && res.data[0].ASNNo != null) {
+ $("#bar").empty()
+ $("#bar").append('<option value =>' + '</option>');
+ form.render('select');
+
+ $("#bar").append('<option value =' + res.data[0].ASNNo + ' selected>' + res.data[0].ASNNo + '</option>');
+
+ updateGoodList(res.data[0].SkuNo)
+ setOrderGoods();
} else {
- var bl = false;
- if (res.data.length == 0) {
- layer.msg("鏈煡璇㈠埌姝ょ鐗╂枡淇℃伅锛岃鏍稿疄!", {
+ if (asnDetails == '') {
+ layer.msg("璇峰厛閫夋嫨鍏ュ簱鍗曟嵁!", {
icon: 2,
time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
});
return;
}
-
- if (res.data[0].ASNNo != '' && res.data[0].ASNNo != null) {
- $("#bar").empty()
- $("#bar").append('<option value =>' + '</option>');
- form.render('select');
-
- $("#bar").append('<option value =' + res.data[0].ASNNo + ' selected>' + res.data[0].ASNNo + '</option>');
-
- updateGoodList(res.data[0].SkuNo)
- setOrderGoods();
- } else {
- if (asnDetails == '') {
- layer.msg("璇峰厛閫夋嫨鍏ュ簱鍗曟嵁!", {
- icon: 2,
- time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
- });
- return;
- }
- }
- asnDetails.forEach(element => {
- console.log(element);
-
- if (element.SkuNo == res.data[0].SkuNo && element.LotNo == res.data[0].LotNo) {
- var sel = 'dd[lay-value=' + element.id + ']';
- $('#goodSelect').siblings("div.layui-form-select").find('dl').find(sel).addClass('layui-this');
- bl = true;
- }
- });
- if (!bl) {
- layer.msg("姝ょ鐗╂枡涓嶇鍚堣鍏ュ簱鍗曪紝璇锋牳瀹�!", {
- icon: 2,
- time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
- });
- } else {
- $("#BoxQty").val(res.data[0].Qty);
- }
}
+ asnDetails.forEach(element => {
+ console.log(element.SkuNo);
+ console.log(res.data[0].SkuNo);
+ console.log(element.SkuNo == res.data[0].SkuNo);
+ console.log(element.LotNo == res.data[0].LotNo);
+
+ if (element.SkuNo == res.data[0].SkuNo && element.LotNo == res.data[0].LotNo) {
+ console.log("asdfasdfsadf");
+
+ var sel = 'dd[lay-value=' + element.id + ']';
+ $('#goodSelect').siblings("div.layui-form-select").find('dl').find(sel).addClass('layui-this');
+ bl = true;
+ }
+ });
+ console.log(bl);
+
+ if (!bl) {
+ layer.msg("姝ょ鐗╂枡涓嶇鍚堣鍏ュ簱鍗曪紝璇锋牳瀹�!", {
+ icon: 2,
+ time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+ });
+ } else {
+ $("#BoxQty").val(res.data[0].Qty);
+ }
+
} else { //涓嶆垚鍔�
+ layer.msg(res.msg, {
+ icon: 2,
+ time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+ });
//绠辩爜涓嶅瓨鍦紝璋冪敤璧嬬爜鎺ュ彛鑾峰彇绠变俊鎭�
- getFMBoxinfo();
+ //getFMBoxinfo();
}
});
}
- function getFMBoxinfo(){
+ function getFMBoxinfo() {
var param = {
"BoxNo": $("#BOXCODE").val(),
}
sendData(IP + "/UpApi/GetFMBindBoxInfos", param, 'post', function (res) {
+ console.log(res);
if (res.code == 0) { //鎴愬姛//鏍规嵁瀵规帴鎺ュ彛瀹氫箟鍚勫瓧娈靛垽鏂潯浠�
var bl = false;
if (res.data.length == 0) {
@@ -1389,140 +1231,48 @@
}
- /* 鍒嗛〉 */
- //璁剧疆鍒嗛〉
- function setPages(pageIndex, boxNum) {
- if (boxNum <= 0) {
- //鍒楄〃涓虹┖锛岄殣钘忓垎椤甸〉鐮�
- $("#tableBoxPages").hide()
- return
- }
-
- let pageNum = Math.floor(boxNum / 10);
- if (boxNum % 10 > 0) {
- pageNum += 1;
- }
- //console.log("pageNum is " + pageNum)
-
- $("#tableBoxPages").find("tr").remove()
- let table = $("#tableBoxPages")
- $("<tr></tr>").appendTo("#tableBoxPages")
-
- // let newTr = table.append("<tr></tr>")
- // newTr.append("<td class='page-prev'>涓婁竴椤�</td>")
- $("<td id='prevPage' class='page-prev'>涓婁竴椤�</td>").appendTo("#tableBoxPages tr")
- $("#tableBoxPages tr").eq(0).find("td[id^='prevPage']").click(function () {
- onClickPrevPage()
- })
- for (i = 1; i < pageNum + 1; i++) {
- // newTr.append("<td class='page-num'>"+ i +"</td>")
- $("<td class='page-num'>" + i + "</td>").appendTo("#tableBoxPages tr")
- }
- // newTr.append("<td class='page-next'>涓嬩竴椤�</td>")
- $("<td id='nextPage' class='page-next'>涓嬩竴椤�</td>").appendTo("#tableBoxPages tr")
- $("#tableBoxPages tr").eq(0).find("td[id^='nextPage']").click(function () {
- onClickNextPage()
- })
- // pages.show()
- $("#tableBoxPages").show()
-
- setCurPage(1)
- }
-
- //璁剧疆褰撳墠鍒嗛〉
- function setCurPage(pageIndex) {
- let totalTrNum = $("#tableBoxList tr").length
- if (totalTrNum <= 2) {
- //console.log("tableBoxList 涓虹┖ totalTrNum: " + totalTrNum)
- //curPageIndex = 1
- return
- }
-
- let pageNum = getBoxPageNum()
- if (pageIndex > pageNum) {
- //console.log("璁剧疆鐨勯〉鐮佽秴鍑洪〉鏁�, pageIndex : " + pageIndex)
- //curPageIndex = 1
- return
- }
-
- let startIndex = (pageIndex - 1) * 10 + 1
- let n = totalTrNum - startIndex
- let endIndex = 0
- if (n > 9) {
- endIndex = startIndex + 9
- } else {
- endIndex = startIndex + n
- }
- //console.log("startIndex is "+startIndex)
- //console.log("endIndex is "+endIndex)
- //startIndex =2
- //endIndex = 2
- let trs = $("#tableBoxList tr")
- //console.log("琛屾暟 "+trs.length)
- let d = 0
- for (let i = 2; i < trs.length; i++) {
- //console.log("琛岀储寮� " + trs.eq(i).attr('index'))
- let t = trs.eq(i)
- d = t.attr('index')
- if (d >= startIndex && d <= endIndex) {
- //console.log("闇�瑕佹樉绀�")
- //鏄剧ず琛�
- t.show()
- } else {
- //闅愯棌琛�
- t.hide()
- }
- }
-
- curPageIndex = pageIndex
-
- let ptr = $("#tableBoxPages tr")
- for (let i = 1; i < pageNum + 1; i++) {
- ptr.eq(0).find("td").eq(i).removeClass("page-num-select")
- if (i == curPageIndex) {
- ptr.eq(0).find("td").eq(i).addClass("page-num-select")
- }
- }
- //console.log("totalTrNum is " + totalTrNum)
- }
-
- function onClickPrevPage() {
- //console.log("涓婁竴椤垫寜閽鐐瑰嚮")
- if (curPageIndex == 1) {
- return
- }
- setCurPage(curPageIndex - 1)
- }
-
- function onClickNextPage() {
- //console.log("涓嬩竴椤垫寜閽鐐瑰嚮")
- let n = getBoxPageNum()
- if (curPageIndex == n - 1) {
- return
- }
- setCurPage(curPageIndex + 1)
- }
- function getBoxPageNum() {
- let num = $("#tableBoxList tr").length
- if (num <= 2) {
- return 0
- }
-
- let pageNum = Math.floor(num / 10);
- if (num % 10 > 0) {
- pageNum += 1;
- }
-
- return pageNum
- }
-
/*鈥斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺��*/
form.on('switch(IsLianXu)', function (obj) {
if (obj.elem.checked) {
- $('#BOX2').attr("style", "display:block")
- $('#zongDiv').attr("style", "height: 315px;")
- isContinue = "1";
+ if ($("#bar").val() == "") {
+ $('#IsLianXu').prop('checked',false);
+ layui.form.render();
+ layer.msg('璇烽�夋嫨鍏ュ簱鍗�', {
+ icon: 2,
+ time: 1000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+ });
+ return;
+ }
+ var param = {
+ ASNNo: $("#bar").val()
+ };
+ sendData(IP + "/PdaAsn/GetArrivalNotice", param, 'post', function (res) {
+ if (res.code == 0) { //鎴愬姛
+ if(res.data[0].Type=="0"){
+ $('#IsLianXu').prop('checked',false);
+ layui.form.render();
+ layer.msg('鎴愬搧鍏ュ簱鍗曚笉鑳藉紑鍚繛缁勶紒', {
+ icon: 2,
+ time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+ });
+ return;
+ }else{
+ $('#BOX2').attr("style", "display:block")
+ $('#zongDiv').attr("style", "height: 315px;")
+ isContinue = "1";
+ }
+ } else { //涓嶆垚鍔�
+ layer.msg('鍏ュ簱鍗曚俊鎭笉瀛樺湪', {
+ icon: 2,
+ time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+ }, function() {
+ $('#IsLianXu').prop('checked',false);
+ layui.form.render();
+ });
+ }
+ });
+
} else {
$('#BOX2').attr("style", "display:none")
$('#zongDiv').attr("style", "height: 285px;")
--
Gitblit v1.8.0