From f512b0475560ed449f936e0b7a27ba197e6bafe5 Mon Sep 17 00:00:00 2001
From: IPC-610 <IPC-610@DESKTOP-6LEOOS3>
Date: 星期四, 26 九月 2024 15:16:08 +0800
Subject: [PATCH] Merge branch 'master' of https://gitee.com/liudongl/jc24-wms
---
HTML/views/ASNSetting/ArrivalNoticeDetail.html | 295 ++++++++++++++++++++++++++++++++++++++++------------------
1 files changed, 202 insertions(+), 93 deletions(-)
diff --git a/HTML/views/ASNSetting/ArrivalNoticeDetail.html b/HTML/views/ASNSetting/ArrivalNoticeDetail.html
index 11938fc..3b3f5ec 100644
--- a/HTML/views/ASNSetting/ArrivalNoticeDetail.html
+++ b/HTML/views/ASNSetting/ArrivalNoticeDetail.html
@@ -21,17 +21,18 @@
margin-left: -15px;
margin-right: -15px;
}
- .layui-table-mend{
+
+ .layui-table-mend {
position: relative;
}
</style>
<script>
// 杩欓噷鏄渶瑕佸湪椤甸潰娓叉煋涔嬪墠鎵ц鐨勪唬鐮�
- document.addEventListener("DOMContentLoaded", function() {
+ document.addEventListener("DOMContentLoaded", function () {
//鍒ゆ柇鏄惁寮�鍚痶able鍒楄〃鍒楀璋冩暣鍔熻兘銆�
GetIsSetColW();
});
- </script>
+ </script>
</head>
<body>
@@ -49,12 +50,13 @@
<!-- <option value=""></option> -->
<!-- JC24 -->
<option value="0" selected>鎴愬搧鍏ュ簱</option>
- <option value="1">閲囪喘鍏ュ簱</option>
+ <option value="1">閲囪喘鍏ュ簱</option>
<option value="2">涓棿鍝佸叆搴�</option>
<option value="3">閫�璐у叆搴�</option>
<option value="4">杞﹂棿浣欐枡閫�鍥炲叆搴�</option>
<option value="5">鍏跺畠鍏ュ簱</option>
<option value="6">浠e偍鍏ュ簱</option>
+ <option value="7">瀵勫瓨鍏ュ簱</option>
<!-- JC08 -->
<!-- <option value="0">鎴愬搧鍏ュ簱</option>
<option value="1">鍘熸枡鍏ュ簱</option>
@@ -62,7 +64,9 @@
</select>
</div>
- <label class="layui-form-label">瀹㈡埛鍚嶇О</label>
+ <label class="layui-form-label" style="width: 70px;">
+ <p id="CustomerNamep">瀹㈡埛</p>
+ </label>
<div class="layui-input-inline">
<select name="CustomerName" id="CustomerName" lay-verify="" lay-search>
<option value=""></option>
@@ -79,8 +83,10 @@
<div class="layui-form-item" style="margin-bottom: 0;">
<div class="layui-card">
<div class="layui-card-body">
- <div class="position-relative" style="width: 100%;right: 0;"><!-- class="position-relative" --><!-- 鑷畾涔夎〃澶村姞涓� -->
- <table id="LAY-app-content-list" name="LAY-app-content-list" lay-filter="LAY-app-content-list"></table>
+ <div class="position-relative" style="width: 100%;right: 0;">
+ <!-- class="position-relative" --><!-- 鑷畾涔夎〃澶村姞涓� -->
+ <table id="LAY-app-content-list" name="LAY-app-content-list" lay-filter="LAY-app-content-list">
+ </table>
<!-- #region 鑷畾涔夎〃澶� -->
<div class="headerSetIcon">
<button class="layui-btn layui-btn-primary layui-btn-sm" data-type="customCols">
@@ -90,7 +96,7 @@
<!-- #endregion -->
<!-- #region 鑷畾涔夎〃澶�-->
- <script type="text/html" id="templetUDF5">
+ <script type="text/html" id="templetUDF5">
{{# function GetBtn(d){
var html = '';
html+= '<select name="UDF5" lay-filter="SelctUDF5" data-value="'+d.UDF5+'">'+
@@ -106,7 +112,7 @@
</script>
<!-- #endregion -->
- </div>
+ </div>
<script type="text/html" id="switchTpl">
<input type="checkbox" name="IsBale" value="{{d.SkuNo}}" lay-skin="switch" lay-text="鏄瘄鍚�" lay-filter="IsBaleDemo" {{ d.IsBale == "1" ? 'checked' : '' }}>
</script>
@@ -115,7 +121,15 @@
</script>
<script type="text/html" id="table-content-list">
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"> <i class="layui-icon layui-icon-delete"></i>鍒犻櫎</a>
- </script>
+ </script>
+ <script type="text/html" id="table-content-Packlist">
+ {{#
+ function GetPack(d){
+ return d.PackagNo + '-' + d.PackagName;
+ }
+ }}
+ {{ GetPack(d) }}
+ </script>
</div>
</div>
</div>
@@ -142,35 +156,35 @@
, format: 'yyyy-MM-dd' //鍙换鎰忕粍鍚�
});
var arr = [];
- var TypeValue=$("#Type").val();
+ var TypeValue = $("#Type").val();
// 鍔犺浇涓嬫媺淇℃伅
getCustomerList();
// table 鍩烘湰璁剧疆
//#region 鑷畾涔夎〃澶�
- var TotalColsArr = [[
- {field: '',title: '搴忓彿',type:'numbers',width: 50,align: 'center',fixed: 'left', "disabled": true},
- {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', "disabled": true},
- {field: 'SupplierLot',title: '渚涜揣鎵规',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'},
- {field: 'LotText',title: '鎵规鎻忚堪',align: 'center',edit: 'text',width: 160},
- {field: 'PackagNo',title: '鍖呰鍚嶇О',width: 160},
- {field: 'Price',title: '鍗曚环',align: 'center',width: 80},
- {field: 'Money',title: '閲戦',align: 'center',width: 100},
- {field: 'UDF1',title: '鑷畾涔夊垪1',align: 'center',edit: 'text',width: 140},
- {field: 'UDF2',title: '鑷畾涔夊垪2',align: 'center',edit: 'text',width: 140},
- {field: 'UDF3',title: '鑷畾涔夊垪3',align: 'center',edit: 'text',width: 140},
- {field: 'UDF4',title: '鑷畾涔夊垪4',align: 'center',edit: 'text',width: 140},
- {field: 'UDF5',title: '鑷畾涔夊垪5',align: 'center',width: 140,templet:'#templetUDF5'},
- {field: 'caozuo',title: '鎿嶄綔',fixed: 'right',width: 100,align: 'center',templet: '#table-content-list', "disabled": true}
- ]];
- var TotalColsSysArr=encodeURIComponent(encodeURIComponent(JSON.stringify(TotalColsArr)))//灏嗚〃澶存暟鎹繘琛寀rl缂栫爜
+ var TotalColsArr = [[
+ { field: '', title: '搴忓彿', type: 'numbers', width: 50, align: 'center', fixed: 'left', "disabled": true },
+ { 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', "disabled": true },
+ { field: 'SupplierLot', title: '渚涜揣鎵规', 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' },
+ { field: 'LotText', title: '鎵规鎻忚堪', align: 'center', edit: 'text', width: 160 },
+ { field: 'PackagNo', title: '鍖呰鍚嶇О', width: 160, templet: "#table-content-Packlist" },
+ { field: 'Price', title: '鍗曚环', align: 'center', width: 80 },
+ { field: 'Money', title: '閲戦', align: 'center', width: 100 },
+ { field: 'UDF1', title: '鑷畾涔夊垪1', align: 'center', edit: 'text', width: 140 },
+ { field: 'UDF2', title: '鑷畾涔夊垪2', align: 'center', edit: 'text', width: 140 },
+ { field: 'UDF3', title: '鑷畾涔夊垪3', align: 'center', edit: 'text', width: 140 },
+ { field: 'UDF4', title: '鑷畾涔夊垪4', align: 'center', edit: 'text', width: 140 },
+ { field: 'UDF5', title: '鑷畾涔夊垪5', align: 'center', width: 140, templet: '#templetUDF5' },
+ { field: 'caozuo', title: '鎿嶄綔', fixed: 'right', width: 100, align: 'center', templet: '#table-content-list', "disabled": true }
+ ]];
+ var TotalColsSysArr = encodeURIComponent(encodeURIComponent(JSON.stringify(TotalColsArr)))//灏嗚〃澶存暟鎹繘琛寀rl缂栫爜
//#endregion
//#region 鍘熷闈炶嚜瀹氫箟鍒�
@@ -328,20 +342,20 @@
//#region 鑷畾涔夎〃澶�
var infoOptions;
var colsJson;
- var param1={
- Href:'BllAsn/GetArrivalNoticeDetailList2'
+ var param1 = {
+ Href: 'BllAsn/GetArrivalNoticeDetailList2'
};
- sendData(IP + "/Sys/GetTableColsByUserId", param1, 'post', function(res) {
- if (res.code == 0){
- if(res.data=='' || res.data==undefined || res.data==null){
- colsJson=TotalColsArr
- }else{
- colsJson= eval(res.data);
+ sendData(IP + "/Sys/GetTableColsByUserId", param1, 'post', function (res) {
+ if (res.code == 0) {
+ if (res.data == '' || res.data == undefined || res.data == null) {
+ colsJson = TotalColsArr
+ } else {
+ colsJson = eval(res.data);
}
- }else{
- colsJson=TotalColsArr
+ } else {
+ colsJson = TotalColsArr
}
- infoOptions={
+ infoOptions = {
elem: '#LAY-app-content-list',
height: 'full-110',
id: 'LAY-app-content-list',
@@ -349,26 +363,26 @@
limit: pageCnt,
limits: pageLimits,
cellMinWidth: 60, //鍏ㄥ眬瀹氫箟甯歌鍗曞厓鏍肩殑鏈�灏忓搴︼紝layui 2.2.1 鏂板
- done: function(){
+ done: function () {
//閫変腑涓嬫媺妗嗙殑鍊�
layui.each($('select'), function (index, item) {
var elem = $(item);
- if(elem.data('value')!='' && elem.data('value')!=undefined){
+ if (elem.data('value') != '' && elem.data('value') != undefined) {
elem.val(elem.data('value')).parents('table.layui-table-cell').css('overflow', 'visible');
- }
+ }
});
- form.render();
+ form.render();
//鑷畾涔夊垪瀹�
- SetTableColW('LAY-app-content-list','BllAsn/GetArrivalNoticeDetailList2',TotalColsSysArr);
- },
- cols:colsJson
+ SetTableColW('LAY-app-content-list', 'BllAsn/GetArrivalNoticeDetailList2', TotalColsSysArr);
+ },
+ cols: colsJson
};
// 娓叉煋Table
refreshTable(null);
});
//#endregion
-
+
// 娣诲姞缂栬緫鏄庣粏
var id = getQueryString('id');
@@ -383,8 +397,8 @@
console.log(res)
$("input[name='ASNNo']").val(res.data[0].ASNNo);
$("#Type option[value = '" + res.data[0].Type + "']").prop("selected", true);
- $("#CustomerName option[value = '" + res.data[0].CustomerNo + "']").prop("selected", true);
$("#Type").attr("disabled", "disabled");
+ getCustomerList(res.data[0].CustomerNo); // 鏍规嵁鍗曟嵁绫诲瀷鍔犺浇瀹㈡埛淇℃伅
var paramDetail = {
ASNNo: id,
@@ -404,7 +418,9 @@
curr: 1
}
table.render(infoOptions);
- form.render('select');
+
+
+
} else { //涓嶆垚鍔�
layer.msg(res.msg, {
icon: 2,
@@ -430,6 +446,7 @@
active = {
add: function () {
var typeValue = $("#Type").val();
+ console.log(typeValue)
layer.open({
type: 2,
title: '娣诲姞鏄庣粏',
@@ -439,11 +456,11 @@
fixed: false,
});
},
- customCols: function(){
+ customCols: function () {
layer.open({
type: 2,
title: '鑷畾涔夊垪',
- content: '../SystemSettings/HeaderSetting.html?Href=BllAsn/GetArrivalNoticeDetailList2&ColsSysArr='+TotalColsSysArr,
+ content: '../SystemSettings/HeaderSetting.html?Href=BllAsn/GetArrivalNoticeDetailList2&ColsSysArr=' + TotalColsSysArr,
maxmin: false,
resize: false,
area: ['970px', '650px']
@@ -459,15 +476,16 @@
};
//鍗曟嵁绫诲瀷鍙樻洿鏃舵竻绌簍able鍒楄〃淇℃伅
- form.on('select(Type)',function(data){
+ form.on('select(Type)', function (data) {
var value = data.value;
- if(value!=TypeValue){
+ if (value != TypeValue) {
console.log(value);
+ getCustomerList();
arr = [];
// 娓叉煋Table
refreshTable(null);
- TypeValue=value;
- }
+ TypeValue = value;
+ }
});
//鐩戝惉淇敼UDF5涓嬫媺妗唘pdate鍒拌〃鏍间腑
@@ -480,21 +498,21 @@
});
//鐩戝惉鏁伴噺鍊煎彉鍖栬嚜鍔ㄨ绠楅噾棰�
- table.on('edit(LAY-app-content-list)', function(obj){
- if(obj.field=='Qty'){
- var data=obj.data;
- if(data.Qty!=undefined && data.Qty !=''){
- data.Money=data.Qty*data.Price
-
+ table.on('edit(LAY-app-content-list)', function (obj) {
+ if (obj.field == 'Qty') {
+ var data = obj.data;
+ if (data.Qty != undefined && data.Qty != '') {
+ data.Money = data.Qty * data.Price
+
var menu = layui.table.cache["LAY-app-content-list"];
- for(var i =0;i<menu.length;i++){
- if(menu[i].Id==data.Id){
- menu[i].Money=data.Money
+ for (var i = 0; i < menu.length; i++) {
+ if (menu[i].Id == data.Id) {
+ menu[i].Money = data.Money
break;
}
}
$.extend(infoOptions, {
- data: menu,
+ data: menu,
});
table.render(infoOptions);
}
@@ -556,6 +574,19 @@
});
return;
}
+ var type = $("#Type").val();
+ if (type == '6') {
+ var customerName = $("#CustomerName").val();
+ if (customerName == '') {
+ layer.msg("浠e偍鍗曟嵁璇烽�夋嫨璐т富锛�", {
+ icon: 2,
+ time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+ }, function () {
+
+ });
+ return;
+ }
+ }
SetArrivalNotice();
});
@@ -583,15 +614,72 @@
}
// 缁戝畾涓嬫媺淇℃伅
- function getCustomerList() {
+ function getCustomerList(CustomerNo) {
+ /*
+ 0锛氬鎴�
+ 閫�璐у叆搴�
+ 3
+ 1锛氫緵搴斿晢
+ 閲囪喘鍏ュ簱銆佸叾瀹冨叆搴�
+ 1銆�5
+ 2锛氳揣涓�
+ 鎴愬搧鍏ュ簱銆佷腑闂村搧鍏ュ簱銆佽溅闂翠綑鏂欏叆搴撱�佷唬鍌ㄥ叆搴�
+ 0銆�2銆�4銆�6
+ */
sendData(IP + "/Basis/GetCustomerSelect", {}, 'get', function (res) {
if (res.code == 0) { //鎴愬姛
$("#CustomerName").empty();
$("#CustomerName").append('<option value =""></option>');
- for (var i = 0; i < res.data.length; i++) {
- $("#CustomerName").append('<option value =' + res.data[i].CustomerNo + '>' +
- res.data[i].CustomerName + '</option>');
+
+ // 鏍规嵁鍗曟嵁绫诲瀷纭鍔犺浇鏄鎴穙r渚涘簲鍟唎r璐т富涓嬫媺淇℃伅
+ var TypeNum = 0;
+ switch ($("#Type").val()) {
+ case "3": //閫�璐у叆搴�
+ TypeNum = 0;
+ console.log(TypeNum)
+ break;
+ case "1": //閲囪喘鍏ュ簱
+ case "5": //鍏跺畠鍏ュ簱
+ TypeNum = 1;
+ console.log(TypeNum)
+ break;
+ case "0": //鎴愬搧鍏ュ簱
+ case "2": //涓棿鍝佸叆搴�
+ case "4": //杞﹂棿浣欐枡鍏ュ簱
+ case "6": //浠e偍鍏ュ簱
+ case "7": //瀵勫瓨鍏ュ簱
+ TypeNum = 2;
+ console.log(TypeNum)
+ break;
}
+
+ for (var i = 0; i < res.data.length; i++) {
+
+ //鍒ゆ柇鍗曟嵁绫诲瀷
+ if (TypeNum == 0) {
+ if (res.data[i].Type == 0) {
+ $("#CustomerNamep").html("瀹㈡埛");
+ $("#CustomerName").append('<option value =' + res.data[i].CustomerNo + '>' +
+ res.data[i].CustomerName + '</option>');
+ }
+ }
+ else if (TypeNum == 1) {
+ if (res.data[i].Type == 1) {
+ $("#CustomerNamep").html("渚涘簲鍟�");
+ $("#CustomerName").append('<option value =' + res.data[i].CustomerNo + '>' +
+ res.data[i].CustomerName + '</option>');
+ }
+ }
+ else if (TypeNum == 2) {
+ if (res.data[i].Type == 2) {
+ $("#CustomerNamep").html("璐т富");
+ $("#CustomerName").append('<option value =' + res.data[i].CustomerNo + '>' +
+ res.data[i].CustomerName + '</option>');
+ }
+ }
+ }
+ // 鏍规嵁瀹㈡埛鍚嶇О鍔犺浇閫変腑鍊�
+ $("#CustomerName option[value = '" + CustomerNo + "']").prop("selected", true);
form.render('select');
} else { //涓嶆垚鍔�
layer.msg(res.msg, {
@@ -620,21 +708,23 @@
}
arr.push(data[i]); //灞炴��
}
+
$.extend(infoOptions, {
data: arr
});
infoOptions.page = {
curr: 1
}
+ console.log(infoOptions)
table.render(infoOptions);
}
-
+
// 娣诲姞鍏ュ簱鍗�
function SetArrivalNotice(data) {
var item2 = getAsnOrderInfo();
- if (item2 !=-1) {
-
-
+ if (item2 != -1) {
+
+
if (doing) {
doing = false;
if (id == null) {
@@ -686,7 +776,7 @@
time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
}, function () { doing = true });
}
- }
+ }
}
// 鎻愪氦鑾峰彇鍏ュ簱鍗曚俊鎭�
@@ -697,21 +787,40 @@
for (var i in arr) {
console.log(arr[i].LotNo);
console.log(arr[i].Qty);
- if (arr[i].Qty == "" || arr[i].Qty ==undefined) {
+ if (arr[i].Qty == "" || arr[i].Qty == undefined) {
layer.msg("璇疯緭鍏ュ叆搴撴暟閲忥紒", {
icon: 2,
time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
});
return -1;
}
- if (arr[i].LotNo == "" || arr[i].LotNo ==undefined) {
- layer.msg("璇疯緭鍏ユ壒娆★紒", {
- icon: 2,
- time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
- });
- return -1;
+ if (arr[i].LotNo == "" || arr[i].LotNo == undefined) {
+ //鍒ゆ柇鏄惁涓哄搴斾笉闇�瑕佹壒娆$殑鍗曟嵁
+ var TypeNum = 0;
+
+ switch ($("#Type").val()) {
+ //1锛氶噰璐叆搴� 2锛氫腑闂村搧鍏ュ簱 5锛氬叾瀹冨叆搴� 6锛氫唬鍌ㄥ叆搴� 7锛氬瘎瀛樺叆搴�
+ case "1":
+ case "2":
+ case "5":
+ case "6":
+ case "7":
+ console.log($("#Type").val())
+ TypeNum = 1;
+ break;
+ }
+ console.log(TypeNum)
+
+ if (TypeNum == 0) {
+ layer.msg("璇疯緭鍏ユ壒娆★紒1", {
+ icon: 2,
+ time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級
+ });
+ return -1;
+ }
+
}
-
+
if (!reg.test(arr[i].Qty)) {
layer.msg("鍏ュ簱鏁伴噺蹇呴』鏄ぇ浜�0鐨勬暣鏁�", {
icon: 2,
@@ -733,16 +842,16 @@
IsBale: arr[i].IsBale,
IsBelt: arr[i].IsBelt,
SupplierLot: arr[i].SupplierLot,
- UDF1:arr[i].UDF1,
- UDF2:arr[i].UDF2,
- UDF3:arr[i].UDF3,
- UDF4:arr[i].UDF4,
- UDF5:arr[i].UDF5,
+ UDF1: arr[i].UDF1,
+ UDF2: arr[i].UDF2,
+ UDF3: arr[i].UDF3,
+ UDF4: arr[i].UDF4,
+ UDF5: arr[i].UDF5,
};
DataList.push(item); //灞炴��
}
console.log($("#CustomerName").find('option:selected').text());
-
+
var item2 = {
ASNNo: $("#ASNNo").val(),
Type: $("#Type").val(),
--
Gitblit v1.8.0