From cfdbd0eadeb5dbe4ff8872bb67f43ae8f323a799 Mon Sep 17 00:00:00 2001
From: wxw <Administrator@DESKTOP-5BIMHQ3>
Date: 星期一, 13 十月 2025 09:35:13 +0800
Subject: [PATCH] 优化入库单导入功能
---
HTML/views/ASNSetting/ArrivalNoticeDetail.html | 87 ++++++++++++++++++++-----------------------
1 files changed, 41 insertions(+), 46 deletions(-)
diff --git a/HTML/views/ASNSetting/ArrivalNoticeDetail.html b/HTML/views/ASNSetting/ArrivalNoticeDetail.html
index d0e3685..ccbd5b2 100644
--- a/HTML/views/ASNSetting/ArrivalNoticeDetail.html
+++ b/HTML/views/ASNSetting/ArrivalNoticeDetail.html
@@ -69,9 +69,9 @@
<select name="Type" id="Type" lay-filter="Type" lay-search>
<option value="0">鎴愬搧鍏ュ簱</option>
<option value="1">閲囪喘鍏ュ簱</option>
- <option value="2">涓棿鍝佸叆搴�</option>
<option value="3">閫�璐у叆搴�</option>
<option value="4">浣欐枡閫�鍥炲叆搴�</option>
+ <option value="8">鐢熶骇閫�鏂欏叆搴�</option>
</select>
</div>
@@ -122,28 +122,7 @@
{{ GetBtn(d) }}
</script>
- <script type="text/html" id="templetLotNo">
- {{# function GetBtn1(d){
- var html = '';
- var TypeValue = $("#Type").val();
- if(TypeValue=='1' || TypeValue=='5' || TypeValue=='6' || TypeValue=='7'){
- if(d.LotNo==null || d.LotNo==undefined || d.LotNo==''){
- html+= '<input type="text" class="input-dis" value="" disabled>';
- }else{
- html+= '<input type="text" class="input-dis" value="'+d.LotNo+'" disabled>';
- }
- return html;
- }else{
- if(d.LotNo!=null && d.LotNo!=undefined && d.LotNo!=''){
- return d.LotNo;
- }else{
- return '';
- }
- }
- }
- }}
- {{ GetBtn1(d) }}
- </script>
+
<!-- #endregion -->
</div>
@@ -202,8 +181,8 @@
{ field: 'Id', title: '鍏ュ簱鍗曟槑缁咺D', width: 120, align: 'center', fixed: 'left', hide: true, "disabled": true },
{ field: 'SkuNo', title: '鐗╂枡缂栫爜', minWidth: 100, align: 'center', fixed: 'left', "disabled": true },
{ field: 'SkuName', title: '鐗╂枡鍚嶇О', minWidth: 180, align: 'center', fixed: 'left', "disabled": true },
- { field: 'LotNo', title: '鎵规鍙�', align: 'center', edit: 'text', minWidth: 130, fixed: 'left', templet: '#templetLotNo', "disabled": true },
- { field: 'SupplierLot', title: '渚涜揣鎵规', width: 130, edit: 'text', event: 'setSign', fixed: 'left', "disabled": true },
+ { field: 'LotNo', title: '鎵规鍙�', align: 'center', edit: 'text', event: 'setlot', width: 130, fixed: 'left', "disabled": true },
+ { field: 'SupplierLot', title: '渚涜揣鎵规', align: 'center', width: 130, edit: 'text', event: 'setSign', fixed: 'left', "disabled": true },
{ field: 'Qty', title: '鏁伴噺', align: 'center', width: 80, edit: 'number', event: 'dataNumber', fixed: 'left', "disabled": true },
{ field: 'UnitName', title: '璁¢噺鍗曚綅', align: 'center', width: 70 },
{ field: 'Standard', title: '瑙勬牸', width: 160, align: 'center' },
@@ -240,6 +219,8 @@
} else {
colsJson = TotalColsArr
}
+ console.log(colsJson);
+
infoOptions = {
elem: '#LAY-app-content-list',
height: 'full-110',
@@ -323,8 +304,8 @@
}
else {
// 娣诲姞鐨勬椂鍊欑Щ闄も�橀噰璐叆搴撯�欓」
- $('select[lay-filter="Type"]').find('option[value="1"]').remove();
- form.render('select'); // 鏇存柊layui鐨剆elect娓叉煋
+ // $('select[lay-filter="Type"]').find('option[value="1"]').remove();
+ // form.render('select'); // 鏇存柊layui鐨剆elect娓叉煋
}
@@ -487,8 +468,8 @@
閲囪喘鍏ュ簱銆佸叾瀹冨叆搴�
1銆�5
2锛氳揣涓�
- 鎴愬搧鍏ュ簱銆佷腑闂村搧鍏ュ簱銆佽溅闂翠綑鏂欏叆搴撱�佷唬鍌ㄥ叆搴�
- 0銆�2銆�4銆�6
+ 鎴愬搧鍏ュ簱銆佷腑闂村搧鍏ュ簱銆佽溅闂翠綑鏂欏叆搴撱�佷唬鍌ㄥ叆搴� 鐢熶骇閫�鏂欏叆搴�
+ 0銆�2銆�4銆�6 8
*/
sendData(IP + "/Basis/GetCustomerSelect", {}, 'get', function (res) {
if (res.code == 0) { //鎴愬姛
@@ -514,6 +495,8 @@
case "7": //瀵勫瓨鍏ュ簱
TypeNum = 2;
console.log(TypeNum)
+ case "8": //鐢熶骇閫�鏂欏叆搴�
+ TypeNum = 2;
break;
}
@@ -559,10 +542,10 @@
for (var i in data) {
var isHave = false;
for (var j in arr) {
- if (arr[j].SkuNo == data[i].SkuNo
- // 娉ㄩ噴 liudl 鑻ュ瓨鍦ㄥ悓涓�鐗╂枡涓嶅悓鎵规鐗╂枡 鏀惧紑姝ゆ敞閲婏紝鍚庣宸查獙璇佹槸鍚﹂噸澶�
- //&& arr[j].LotNo == data[i].LotNo
- ) {
+ if (arr[j].SkuNo == data[i].SkuNo)
+ // 娉ㄩ噴 liudl 鑻ュ瓨鍦ㄥ悓涓�鐗╂枡涓嶅悓鎵规鐗╂枡 鏀惧紑姝ゆ敞閲婏紝鍚庣宸查獙璇佹槸鍚﹂噸澶�
+ //&& arr[j].LotNo == data[i].LotNo
+ {
isHave = true;
break;
}
@@ -597,7 +580,7 @@
if (res.code == 0) { //鎴愬姛
layer.msg(res.msg, {
icon: 1,
- time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+ time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
}, function () {
parent.location.reload();
parent.layer.close(layer.index);
@@ -664,7 +647,7 @@
switch ($("#Type").val()) {
//1锛氶噰璐叆搴� 2锛氫腑闂村搧鍏ュ簱 5锛氬叾瀹冨叆搴� 6锛氫唬鍌ㄥ叆搴� 7锛氬瘎瀛樺叆搴�
- case "1":
+
case "2":
case "5":
case "6":
@@ -675,23 +658,35 @@
}
console.log(TypeNum)
- if (TypeNum == 0) {
- layer.msg("璇疯緭鍏ユ壒娆★紒", {
- icon: 2,
- time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
- });
- return -1;
- }
+ // if (TypeNum == 0) {
+ // layer.msg("璇疯緭鍏ユ壒娆★紒", {
+ // icon: 2,
+ // time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+ // });
+ // return -1;
+ // }
}
- if (!reg.test(arr[i].Qty)) {
- layer.msg("鍏ュ簱鏁伴噺蹇呴』鏄ぇ浜�0鐨勬暣鏁�", {
+ var qtyValue = arr[i].Qty;
+ // 灏濊瘯灏嗗�艰浆鎹负鏁板瓧
+ var num = Number(qtyValue);
+
+ // 楠岃瘉瑙勫垯锛氬繀椤绘槸鏈夋晥鏁板瓧銆佸ぇ浜�0銆佸皬鏁颁綅鏁颁笉瓒呰繃4浣�
+ if (
+ isNaN(num) || // 涓嶆槸鏈夋晥鏁板瓧 T2500009 鍦扮爜 B010109
+ num <= 0 || // 灏忎簬绛変簬0
+ // 妫�鏌ュ皬鏁颁綅鏁帮紙鍏堣浆涓哄瓧绗︿覆澶勭悊锛�
+ (qtyValue.toString().indexOf('.') !== -1 &&
+ qtyValue.toString().split('.')[1].length > 4)
+ ) {
+ layer.msg("鍏ュ簱鏁伴噺蹇呴』鏄ぇ浜�0鐨勬暟", {
icon: 2,
- time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+ time: 2000
});
return -1;
}
+
var item = {
Id: arr[i].Id,
@@ -700,7 +695,7 @@
Standard: arr[i].Standard,
LotNo: arr[i].LotNo,
LotText: arr[i].LotText,
- Qty: parseInt(arr[i].Qty),
+ Qty: Number(qtyValue),////decimal
PackagNo: arr[i].PackagNo,
Price: arr[i].Price,
IsBale: arr[i].IsBale,
--
Gitblit v1.8.0