From 587d9d9cec49585729d8f141dd3b0df2ffb637dc Mon Sep 17 00:00:00 2001 From: test <15284381150@163.com> Date: 星期五, 08 八月 2025 16:50:13 +0800 Subject: [PATCH] 前端精确到小数点后四位,后端质检状态 --- HTML/js/public.js | 3 HTML/views/ASNSetting/ArrivalNoticeDetail.html | 36 + HTML/views/SOSetting/ExportNoticeAddFrom.html | 1032 ++++++++++++++++++++++++------------------------ Wms/WMS.BLL/BllQualityServer/QualityInspectServer.cs | 120 +++++ Pda/View/AsnSetting/productEnterQuantity.html | 59 + HTML/views/ASNSetting/ArrivalNotice.html | 4 Pda/js/public.js | 3 7 files changed, 700 insertions(+), 557 deletions(-) diff --git a/HTML/js/public.js b/HTML/js/public.js index 59bbbe0..8cca1df 100644 --- a/HTML/js/public.js +++ b/HTML/js/public.js @@ -1,7 +1,8 @@ //var IP = "http://47.104.149.73:1991";//鎺ュ彛IP // var IP = "http://172.16.71.101:8082/";//鎺ュ彛IP //var IP = "http://localhost:13243/api"; -var IP = "http://localhost:50515/api"; //鏈湴 +//var IP = "http://localhost:50515/api"; //鏈湴 +var IP="https://localhost:5001/api"; // var IP = "http://localhost:44318/api"; //var IP = "http://192.168.1.6:8017"; //var IP = "http://192.168.1.226:8086"; diff --git a/HTML/views/ASNSetting/ArrivalNotice.html b/HTML/views/ASNSetting/ArrivalNotice.html index fb683ad..51e5c5a 100644 --- a/HTML/views/ASNSetting/ArrivalNotice.html +++ b/HTML/views/ASNSetting/ArrivalNotice.html @@ -604,7 +604,7 @@ $(".clossClass").hide(); $(".editDemoClass").hide();//澶囨敞 $(".checkClass").hide(); //澶嶆牳 - $(".addLabelClass").hide(); //鐢熸垚鏍囩 + $(".addLabelClass").hide(); //鐢熸垚鏍囩 }); sendData(IP + "/Basis/GetRoleRightList", {}, 'get', function (res) { @@ -886,7 +886,7 @@ } else { //涓嶆垚鍔� layer.msg(res.msg, { icon: 2, - time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 B2025080501000035 tuopan T2500037 }, function () { doing = true }); } }); diff --git a/HTML/views/ASNSetting/ArrivalNoticeDetail.html b/HTML/views/ASNSetting/ArrivalNoticeDetail.html index 7c9a7ee..ccbd5b2 100644 --- a/HTML/views/ASNSetting/ArrivalNoticeDetail.html +++ b/HTML/views/ASNSetting/ArrivalNoticeDetail.html @@ -122,7 +122,7 @@ {{ GetBtn(d) }} </script> - + <!-- #endregion --> </div> @@ -181,7 +181,7 @@ { 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',event: 'setlot', width: 130, 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 }, @@ -220,7 +220,7 @@ colsJson = TotalColsArr } console.log(colsJson); - + infoOptions = { elem: '#LAY-app-content-list', height: 'full-110', @@ -542,9 +542,9 @@ 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; @@ -580,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); @@ -647,7 +647,7 @@ switch ($("#Type").val()) { //1锛氶噰璐叆搴� 2锛氫腑闂村搧鍏ュ簱 5锛氬叾瀹冨叆搴� 6锛氫唬鍌ㄥ叆搴� 7锛氬瘎瀛樺叆搴� - + case "2": case "5": case "6": @@ -668,13 +668,25 @@ } - 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, @@ -683,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, diff --git a/HTML/views/SOSetting/ExportNoticeAddFrom.html b/HTML/views/SOSetting/ExportNoticeAddFrom.html index a77c389..08c9298 100644 --- a/HTML/views/SOSetting/ExportNoticeAddFrom.html +++ b/HTML/views/SOSetting/ExportNoticeAddFrom.html @@ -1,346 +1,274 @@ <!DOCTYPE html> <html> - <head> - <meta charset="utf-8"> - <title>娣诲姞鍑哄簱鍗�</title> - <meta name="renderer" content="webkit"> - <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> - <meta name="viewport" - content="width=device-width, initial-scale=1.0, minExum-scale=1.0, maxExum-scale=1.0, user-scalable=0"> - <link rel="stylesheet" href="../../layuiadmin/layui/css/layui.css" media="all"> - <style> +<head> + <meta charset="utf-8"> + <title>娣诲姞鍑哄簱鍗�</title> + <meta name="renderer" content="webkit"> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> + <meta name="viewport" + content="width=device-width, initial-scale=1.0, minExum-scale=1.0, maxExum-scale=1.0, user-scalable=0"> + <link rel="stylesheet" href="../../layuiadmin/layui/css/layui.css" media="all"> + <style> .isShow{ - display: block; - } + display: block; + } .isNoShow{ - display: none; - } - </style> - </head> - <body> - <div class="layui-form" lay-filter="layuiadmin-app-form-list" style="padding: 20px 0 0 0;"> - <div class="layui-form-item" style="margin-bottom: 0px;"> - - <div class="layui-inline"> - <label class="layui-form-label">鍗曟嵁绫诲瀷</label> - <div class="layui-input-inline"> - <select name="Type" id="Type" lay-filter="Type" lay-verify="required" lay-search> - <!-- <option value=""></option> --> - <!--JC26--> - <option value="0">鎴愬搧鍑哄簱</option> - <option value="1">棰嗘枡鍑哄簱</option> - <option value="2">鎶芥鍑哄簱</option> - <option value="4">涓嶅悎鏍煎搧鍑哄簱</option> - <option value="7">鍏朵粬鍑哄簱</option> - <option value="9">鐢熶骇棰嗘枡鍑哄簱</option> - </select> - </div> - </div> - <div class="layui-inline"> - <label class="layui-form-label">鍑哄簱浠撳簱</label> - <div class="layui-input-inline"> - <select name="WarehouseId" id="WarehouseId" lay-filter="WarehouseId" lay-verify="required" lay-search> - <option value=""></option> - </select> - </div> - </div> - <div class="layui-inline"> - <label class="layui-form-label" id="CustomerNamep">瀹㈡埛鍚嶇О</label> - <div class="layui-input-inline"> - <select name="CustomerNo" id="CustomerNo" lay-search> - <option value=""></option> - </select> - </div> - </div> - <div class="layui-inline " id="chengyunshang"> - <label class="layui-form-label">鎵胯繍鍟�</label> - <div class="layui-input-inline"> - <select name="LogisticsId" id="LogisticsId" lay-search> - <option value=""></option> - </select> - </div> - </div> - <div class="layui-inline"> - <div style="padding-bottom: 2px;margin-left: 15px;"> - <button class="layui-btn layui-btn-sm layuiadmin-btn-list" data-type="add">娣诲姞鏄庣粏</button> - <button type="submit" class="layui-btn layui-btn-sm layuiadmin-btn-list" lay-submit="" - lay-filter="form1">绔嬪嵆鎻愪氦</button> - </div> + display: none; + } + </style> +</head> +<body> + <div class="layui-form" lay-filter="layuiadmin-app-form-list" style="padding: 20px 0 0 0;"> + <div class="layui-form-item" style="margin-bottom: 0px;"> + + <div class="layui-inline"> + <label class="layui-form-label">鍗曟嵁绫诲瀷</label> + <div class="layui-input-inline"> + <select name="Type" id="Type" lay-filter="Type" lay-verify="required" lay-search> + <!-- <option value=""></option> --> + <!--JC26--> + <option value="0">鎴愬搧鍑哄簱</option> + <option value="1">棰嗘枡鍑哄簱</option> + <option value="2">鎶芥鍑哄簱</option> + <option value="4">涓嶅悎鏍煎搧鍑哄簱</option> + <option value="7">鍏朵粬鍑哄簱</option> + <option value="9">鐢熶骇棰嗘枡鍑哄簱</option> + </select> </div> </div> - - <div class="layui-card"> - <div class="layui-card-body"> - - <table id="LAY-app-content-list" name="LAY-app-content-list" lay-filter="LAY-app-content-list"></table> - - <!-- <script type="text/html" id="switchTpl"> + <div class="layui-inline"> + <label class="layui-form-label">鍑哄簱浠撳簱</label> + <div class="layui-input-inline"> + <select name="WarehouseId" id="WarehouseId" lay-filter="WarehouseId" lay-verify="required" + lay-search> + <option value=""></option> + </select> + </div> + </div> + <div class="layui-inline"> + <label class="layui-form-label" id="CustomerNamep">瀹㈡埛鍚嶇О</label> + <div class="layui-input-inline"> + <select name="CustomerNo" id="CustomerNo" lay-search> + <option value=""></option> + </select> + </div> + </div> + <div class="layui-inline " id="chengyunshang"> + <label class="layui-form-label">鎵胯繍鍟�</label> + <div class="layui-input-inline"> + <select name="LogisticsId" id="LogisticsId" lay-search> + <option value=""></option> + </select> + </div> + </div> + <div class="layui-inline"> + <div style="padding-bottom: 2px;margin-left: 15px;"> + <button class="layui-btn layui-btn-sm layuiadmin-btn-list" data-type="add">娣诲姞鏄庣粏</button> + <button type="submit" class="layui-btn layui-btn-sm layuiadmin-btn-list" lay-submit="" + lay-filter="form1">绔嬪嵆鎻愪氦</button> + </div> + </div> + </div> + + <div class="layui-card"> + <div class="layui-card-body"> + + <table id="LAY-app-content-list" name="LAY-app-content-list" lay-filter="LAY-app-content-list"></table> + + <!-- <script type="text/html" id="switchTpl"> <input type="checkbox" name="IsBale" value="{{d.LAY_TABLE_INDEX}}" lay-skin="switch" lay-text="鏄瘄鍚�" lay-filter="IsBaleDemo" {{ d.IsBale == "1" ? 'checked' : '' }}> </script> <script type="text/html" id="checkboxTpl"> <input type="checkbox" name="IsBelt" value="{{d.LAY_TABLE_INDEX}}" lay-skin="switch" lay-text="鏄瘄鍚�" lay-filter="IsBeltDemo" {{ d.IsBelt == "1" ? 'checked' : '' }}> </script> --> - <script type="text/html" id="table-content-list"> + <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> - - </div> + </div> </div> + </div> - <script src="../../layuiadmin/layui/layui.js"></script> - <script src="../../js/public.js"></script> - <script src="../../js/jquery-3.5.1.min.js"></script> - <script src="../../js/jquery.cookie.js"></script> - <script> - layui.config({ - base: '../../layuiadmin/' //闈欐�佽祫婧愭墍鍦ㄨ矾寰� - }).extend({ - index: 'lib/index' //涓诲叆鍙fā鍧� - }).use(['index', 'form', 'layer', 'laydate', 'table','jquery'], function() { - var $ = layui.$, - form = layui.form, - table = layui.table, - layer = layui.layer; - - getWareHouseList(); - getCustomerList(); - getLogisticsInfoList(); - - window.success = function(data) { - console.log(data); - refreshTable(data); - }; + <script src="../../layuiadmin/layui/layui.js"></script> + <script src="../../js/public.js"></script> + <script src="../../js/jquery-3.5.1.min.js"></script> + <script src="../../js/jquery.cookie.js"></script> + <script> + layui.config({ + base: '../../layuiadmin/' //闈欐�佽祫婧愭墍鍦ㄨ矾寰� + }).extend({ + index: 'lib/index' //涓诲叆鍙fā鍧� + }).use(['index', 'form', 'layer', 'laydate', 'table', 'jquery'], function () { + var $ = layui.$, + form = layui.form, + table = layui.table, + layer = layui.layer; - var arr = []; - var TypeValue=$("#Type").val(); - function refreshTable(data) { - //table.clear(); - - for (var i in data) { - var isHave = false; - data[i].ExQty = 0; - data[i].IsBale="0"; - data[i].IsBelt="0"; - - for(var j in arr){ - if(arr[j].SkuNo == data[i].SkuNo && arr[j].LotNo == data[i].LotNo){ - isHave = true; - break; - } + getWareHouseList(); + getCustomerList(); + getLogisticsInfoList(); + + window.success = function (data) { + console.log(data); + refreshTable(data); + }; + + var arr = []; + var TypeValue = $("#Type").val(); + function refreshTable(data) { + //table.clear(); + + for (var i in data) { + var isHave = false; + data[i].ExQty = 0; + data[i].IsBale = "0"; + data[i].IsBelt = "0"; + + for (var j in arr) { + if (arr[j].SkuNo == data[i].SkuNo && arr[j].LotNo == data[i].LotNo) { + isHave = true; + break; } - if(isHave){ - continue; - } - arr.push(data[i]); //灞炴�� } - $.extend(infoOptions, { - data: arr - }); - infoOptions.page = { - curr: 1 + if (isHave) { + continue; } - table.render(infoOptions); - + arr.push(data[i]); //灞炴�� } - var infoOptions = { - elem: '#LAY-app-content-list', - height: 'full-160', - id: 'LAY-app-content-list', - page: true, - limit: pageCnt, - limits: pageLimits, - cellMinWidth: 60, //鍏ㄥ眬瀹氫箟甯歌鍗曞厓鏍肩殑鏈�灏忓搴︼紝layui 2.2.1 鏂板 - cols: [ - [{ - field: 'SkuNo', - title: '鐗╁搧缂栫爜', - align: 'center', - fixed: 'left', - width:140, - }, { - field: 'SkuName', - title: '鐗╁搧鍚嶇О', - align: 'center', - fixed: 'left', - }, { - field: 'LotNo', - title: '鎵规', - align: 'center', - minWidth:140, - }, { - field: 'Standard', - title: '鐗╁搧瑙勬牸', - align: 'center', - }, { - field: 'Qty', - title: '搴撳瓨鏁伴噺', - align: 'center', - width:100, - }, { - field: 'ExQty', - title: '鍑哄簱鏁伴噺', - align: 'center', - width:100, - edit: 'number', - event: 'dataNumber' - }, - // { - // field:'IsBale', - // title:'鏄惁瑁瑰寘', - // width:90, - // templet: '#switchTpl', - // unresize: true //鏄惁绂佺敤鎷栨嫿鍒楀 - // }, { - // field:'IsBelt', - // title:'鏄惁鎵撳甫', - // width:90, - // templet: '#checkboxTpl', - // unresize: true //鏄惁绂佺敤鎷栨嫿鍒楀 - // }, - { - title: '鎿嶄綔', - align: 'center', - width:90, - templet: '#table-content-list', - fixed: 'right', - }] - ], - }; - // //鐩戝惉瑁瑰寘鎿嶄綔 - // form.on('switch(IsBaleDemo)', function(obj){ - // if (obj.elem.checked) { - // for (var k in arr) { - // if (arr[k].LAY_TABLE_INDEX == obj.value) { - // arr[k].IsBale = "1"; - // } - // } - - // }else{ - // for (var k in arr) { - // if (arr[k].LAY_TABLE_INDEX == obj.value) { - // arr[k].IsBale = "0"; - // } - // } - // } - // }); - - // //鐩戝惉鎵撳甫鎿嶄綔 - // form.on('switch(IsBeltDemo)', function(obj){ - // if (obj.elem.checked) { - // for (var k in arr) { - // if (arr[k].LAY_TABLE_INDEX == obj.value) { - // arr[k].IsBelt = "1"; - // } - // } - - // }else{ - // for (var k in arr) { - // if (arr[k].LAY_TABLE_INDEX == obj.value) { - // arr[k].IsBelt = "0"; - // } - // } - // } - // }); - //鍒濆娓叉煋 - refreshTable(null); - var $ = layui.$; - var active = { - add: function() { - if ($("#WarehouseId").val()== "") { - layer.msg("璇烽�夋嫨浠撳簱锛�", { - icon: 2, - time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - },function() {}); - return; - } - if ($("#Type").val()== "") { - layer.msg("璇烽�夋嫨鍗曟嵁绫诲瀷锛�", { - icon: 2, - time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - },function() {}); - return; - } - if($("#Type").val()=='6'){ - if($("#CustomerNo").val()==''){ - layer.msg("浠e偍鍗曟嵁璇烽�夋嫨璐т富锛�", { - icon: 2, - time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - }, function () { - - }); - return; - } - } - console.log($("#WarehouseId").val()); - - layer.open({ - type: 2, - title: '閫夋嫨鐗╁搧淇℃伅', - content: 'ExportSelectSkuFrom.html?houseId='+$("#WarehouseId").val()+'&Type='+$("#Type").val()+'&OwnerNo='+$("#CustomerNo").val(), - maxmin: true, - area: ['950px', '90%'], - fixed: false, - }); - } - }; - $('.layui-btn.layuiadmin-btn-list').on('click', function() { - var type = $(this).data('type'); - active[type] ? active[type].call(this) : ''; + $.extend(infoOptions, { + data: arr }); + infoOptions.page = { + curr: 1 + } + table.render(infoOptions); - table.on('tool(LAY-app-content-list)', function(obj) { - var data = obj.data; - if (obj.event === 'del') { - var ii = -1; - for (var j in arr) { - if (obj.data.SkuNo == arr[j].SkuNo && arr[j].LotNo == obj.data.LotNo) { - ii = j; - break; - } + } + var infoOptions = { + elem: '#LAY-app-content-list', + height: 'full-160', + id: 'LAY-app-content-list', + page: true, + limit: pageCnt, + limits: pageLimits, + cellMinWidth: 60, + cols: [ + [{ + field: 'SkuNo', + title: '鐗╁搧缂栫爜', + align: 'center', + fixed: 'left', + width: 140, + }, { + field: 'SkuName', + title: '鐗╁搧鍚嶇О', + align: 'center', + fixed: 'left', + }, { + field: 'LotNo', + title: '鎵规', + align: 'center', + minWidth: 140, + }, { + field: 'Standard', + title: '鐗╁搧瑙勬牸', + align: 'center', + }, { + field: 'Qty', + title: '搴撳瓨鏁伴噺', + align: 'center', + width: 100, + // 鏍煎紡鍖栧簱瀛樻暟閲忔樉绀轰负4浣嶅皬鏁� + templet: function (d) { + return parseFloat(d.Qty).toFixed(4); } - if (ii > -1) { - arr.splice(ii, 1); - obj.del(); - } - } else if (obj.event === 'dataNumber') { - $(".layui-input.layui-table-edit").attr("type", "number"); - } - }); + }, { + field: 'ExQty', + title: '鍑哄簱鏁伴噺', + align: 'center', + width: 100, + edit: 'text', // 鏀逛负text鏀寔灏忔暟杈撳叆 + event: 'dataNumber' + }, { + title: '鎿嶄綔', + align: 'center', + width: 90, + templet: '#table-content-list', + fixed: 'right', + }] + ], + }; + // { + // field:'IsBale', + // title:'鏄惁瑁瑰寘', + // width:90, + // templet: '#switchTpl', + // unresize: true //鏄惁绂佺敤鎷栨嫿鍒楀 + // }, { + // field:'IsBelt', + // title:'鏄惁鎵撳甫', + // width:90, + // templet: '#checkboxTpl', + // unresize: true //鏄惁绂佺敤鎷栨嫿鍒楀 + // }, + // //鐩戝惉瑁瑰寘鎿嶄綔 + // form.on('switch(IsBaleDemo)', function(obj){ + // if (obj.elem.checked) { + // for (var k in arr) { + // if (arr[k].LAY_TABLE_INDEX == obj.value) { + // arr[k].IsBale = "1"; + // } + // } - form.verify({ - emptyNo: function(value) { - if (value == '') { - return ''; - } else { - var ver = /^[0-9]+$/; - if (!ver.test(value)) { - return '鍙兘杈撳叆姝f暣鏁�'; - } - } - } - }); - var isrun = 0; - form.on('submit(form1)', function(data) { - if(isrun == 1){ - return; - } - isrun = 1; - if (infoOptions.data == 0) { - layer.msg("璇锋坊鍔犳槑缁嗭紒", { + // }else{ + // for (var k in arr) { + // if (arr[k].LAY_TABLE_INDEX == obj.value) { + // arr[k].IsBale = "0"; + // } + // } + // } + // }); + + // //鐩戝惉鎵撳甫鎿嶄綔 + // form.on('switch(IsBeltDemo)', function(obj){ + // if (obj.elem.checked) { + // for (var k in arr) { + // if (arr[k].LAY_TABLE_INDEX == obj.value) { + // arr[k].IsBelt = "1"; + // } + // } + + // }else{ + // for (var k in arr) { + // if (arr[k].LAY_TABLE_INDEX == obj.value) { + // arr[k].IsBelt = "0"; + // } + // } + // } + // }); + + //鍒濆娓叉煋 + refreshTable(null); + var $ = layui.$; + var active = { + add: function () { + if ($("#WarehouseId").val() == "") { + layer.msg("璇烽�夋嫨浠撳簱锛�", { icon: 2, time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - }, function() { - - }); - isrun = 0; + }, function () { }); return; } - var type= $("#Type").val(); - if(type=='6'){ - var CustomerNo=$("#CustomerNo").val(); - if(CustomerNo==''){ + if ($("#Type").val() == "") { + layer.msg("璇烽�夋嫨鍗曟嵁绫诲瀷锛�", { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }, function () { }); + return; + } + if ($("#Type").val() == '6') { + if ($("#CustomerNo").val() == '') { layer.msg("浠e偍鍗曟嵁璇烽�夋嫨璐т富锛�", { icon: 2, time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 @@ -350,217 +278,281 @@ return; } } - var DataList = []; - - for (var i in infoOptions.data) { - console.log(infoOptions.data[i].ExQty); - if (infoOptions.data[i].ExQty == "") { - layer.msg("璇疯緭鍏ュ嚭搴撴暟閲忥紒", { - icon: 2, - time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - }, function() {}); - isrun = 0; - return; - } - - if(infoOptions.data[i].ExQty.indexOf('.')>=0){ - layer.msg("鍑哄簱鏁伴噺蹇呴』鏄ぇ浜�0鐨勬暣鏁�", { - icon: 2, - time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - }, function() {}); - isrun = 0; - return; - } - if(infoOptions.data[i].ExQty.indexOf('-')>=0){ - layer.msg("鍑哄簱鏁伴噺蹇呴』鏄ぇ浜�0鐨勬暣鏁�", { - icon: 2, - time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - }, function() {}); - isrun = 0; - return; - } - if(infoOptions.data[i].ExQty.charAt(0)=='0'){ - layer.msg("鍑哄簱鏁伴噺蹇呴』鏄ぇ浜�0鐨勬暣鏁�", { - icon: 2, - time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - }, function() {}); - isrun = 0; - return; - } - - if (infoOptions.data[i].ExQty <= 0) { - layer.msg("鍑哄簱鏁伴噺蹇呴』澶т簬0锛�", { - icon: 2, - time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - }, function() {}); - isrun = 0; - return; - } - if (infoOptions.data[i].ExQty > infoOptions.data[i].Qty) { - layer.msg("鍑哄簱鏁伴噺涓嶈兘澶т簬搴撳瓨鏁伴噺锛�", { - icon: 2, - time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - }, function() {}); - isrun = 0; - return; - } - var item = { - SkuNo: infoOptions.data[i].SkuNo, - LotNo: infoOptions.data[i].LotNo, - Qty: parseInt(infoOptions.data[i].ExQty), - IsBale:infoOptions.data[i].IsBale, - IsBelt:infoOptions.data[i].IsBelt, - }; - DataList.push(item); //灞炴�� - } - - var param = { - Type: data.field.Type, - CustomerNo: data.field.CustomerNo, - WareHouseNo:data.field.WarehouseId, - LogisticsId: parseInt(data.field.LogisticsId), - Detail: DataList - } - sendData(IP + "/BllSo/AddExportNotice", param, 'post', function(res) { - console.log(res); - if (res.code == 0) { //鎴愬姛 - layer.msg(res.msg, { - icon: 1, - time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - }, function() { - parent.location.reload(); - parent.layer.close(layer.index); - }); - isrun = 0; - } else if(res.code == 1) { //涓嶆垚鍔� - layer.msg(res.msg, { - icon: 2, - time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - }, function() {}); - isrun = 0; - } - }); - return false; - }); - - - //涓嬫媺鍗曟嵁绫诲瀷閫変腑鍚庝簨浠� - form.on('select(Type)', function(data) { - var value = data.value; - if(value!=TypeValue){ - getCustomerList(); - arr = []; - // 娓叉煋Table - refreshTable(null); - TypeValue=value; - } - }); - //鑾峰彇浠撳簱淇℃伅 - function getWareHouseList(){ - sendData(IP + "/Sys/GetWarehouseDic", {}, 'get', function(res) { - - if (res.code == 0) { //鎴愬姛 - $("#WarehouseId").empty(); - $("#WarehouseId").append('<option value =""></option>'); - for (var i = 0; i < res.data.length; i++) { - $("#WarehouseId").append('<option value =' + res.data[i].WareHouseNo + '>' + - res.data[i].WareHouseName + '</option>'); - } - //$("#WarehouseId option[value='W01']").attr("selected", "selected") - form.render('select'); - } else { //涓嶆垚鍔� - layer.msg(res.msg, { - icon: 2, - time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - }, function() {}); - } + console.log($("#WarehouseId").val()); + + layer.open({ + type: 2, + title: '閫夋嫨鐗╁搧淇℃伅', + content: 'ExportSelectSkuFrom.html?houseId=' + $("#WarehouseId").val() + '&Type=' + $("#Type").val() + '&OwnerNo=' + $("#CustomerNo").val(), + maxmin: true, + area: ['950px', '90%'], + fixed: false, }); } - //鑾峰彇瀹㈡埛涓嬫媺妗嗕俊鎭� - function getCustomerList() { - sendData(IP + "/Basis/GetCustomerSelect", {}, 'get', function(res) { - if (res.code == 0) { //鎴愬姛 - $("#CustomerNo").empty(); - $("#CustomerNo").append('<option value =""></option>'); - for (var i = 0; i < res.data.length; i++) { - var TypeNum = 0; - - switch($("#Type").val()) - { - case "0": //鎴愬搧鍑哄簱 - TypeNum = 0; - console.log(TypeNum) - break; - case "1": //棰嗘枡鍑哄簱 - case "2": //鎶芥鍑哄簱 - case "3": //鐗╂枡鍙栨牱鍑哄簱 - case "4": //涓嶅悎鏍煎搧鍑哄簱 - case "5": //涓棿鍝佸嚭搴� - case "6": //浠e偍鍑哄簱 - case "7": //鍏朵粬鍑哄簱 - case "8": //瀵勫瓨鍑哄簱 - TypeNum = 2; - console.log(TypeNum) - break; - } - //鍒ゆ柇鍗曟嵁绫诲瀷 - if (TypeNum == 0) - { - if (res.data[i].Type == 0) - { - $("#CustomerNamep").html("瀹㈡埛"); - $("#CustomerNo").append('<option value =' + res.data[i].CustomerNo + '>' + + }; + $('.layui-btn.layuiadmin-btn-list').on('click', function () { + var type = $(this).data('type'); + active[type] ? active[type].call(this) : ''; + }); + + table.on('tool(LAY-app-content-list)', function (obj) { + var data = obj.data; + if (obj.event === 'del') { + var ii = -1; + for (var j in arr) { + if (obj.data.SkuNo == arr[j].SkuNo && arr[j].LotNo == obj.data.LotNo) { + ii = j; + break; + } + } + if (ii > -1) { + arr.splice(ii, 1); + obj.del(); + } + } else if (obj.event === 'dataNumber') { + $(".layui-input.layui-table-edit").attr("type", "number"); + } + }); + + form.verify({ + emptyNo: function (value) { + if (value == '') { + return ''; + } else { + var ver = /^[0-9]+$/; + if (!ver.test(value)) { + return '鍙兘杈撳叆姝f暣鏁�'; + } + } + } + }); + var isrun = 0; + form.on('submit(form1)', function (data) { + if (isrun == 1) { + return; + } + isrun = 1; + if (infoOptions.data == 0) { + layer.msg("璇锋坊鍔犳槑缁嗭紒", { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }, function () { + + }); + isrun = 0; + return; + } + var type = $("#Type").val(); + if (type == '6') { + var CustomerNo = $("#CustomerNo").val(); + if (CustomerNo == '') { + layer.msg("浠e偍鍗曟嵁璇烽�夋嫨璐т富锛�", { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }, function () { + + }); + return; + } + } + var DataList = []; + + // 鍙繚鐣欎竴涓獙璇佸惊鐜紝绉婚櫎閲嶅浠g爜 + for (var i in infoOptions.data) { + const exqtyStr = (infoOptions.data[i].ExQty || '').trim(); + const stockQty = parseFloat(infoOptions.data[i].Qty) || 0; + + // 楠岃瘉鏄惁涓虹┖ + if (exqtyStr === "") { + layer.msg("璇疯緭鍏ュ嚭搴撴暟閲忥紒", { icon: 2, time: 2000 }); + isrun = 0; + return; + } + + // 楠岃瘉鏁板瓧鏍煎紡锛堟敮鎸佹鏁板拰鏈�澶�4浣嶅皬鏁帮級 + const decimalRegex = /^(0|[1-9]\d*)(\.\d{1,4})?$/; + if (!decimalRegex.test(exqtyStr)) { + layer.msg("鍑哄簱鏁伴噺蹇呴』鏄ぇ浜�0鐨勬暟瀛楋紝涓旀渶澶氫繚鐣�4浣嶅皬鏁帮紒", { icon: 2, time: 2000 }); + isrun = 0; + return; + } + + // 杞崲涓烘诞鐐规暟骞跺鐞嗙簿搴� + const precision = 10000; + const exqty = Math.round(parseFloat(exqtyStr) * precision) / precision; + + // 楠岃瘉鏄惁澶т簬0 + if (exqty < 0) { + layer.msg("鍑哄簱鏁伴噺蹇呴』澶т簬0锛�", { icon: 2, time: 2000 }); + isrun = 0; + return; + } + + // 楠岃瘉涓嶈秴杩囧簱瀛樻暟閲� + if (exqty > stockQty) { + layer.msg("鍑哄簱鏁伴噺涓嶈兘澶т簬搴撳瓨鏁伴噺锛�", { icon: 2, time: 2000 }); + isrun = 0; + return; + } + + // 鏍煎紡鍖栧嚭搴撴暟閲忎负4浣嶅皬鏁� + const formattedExQty = exqty.toFixed(4); + infoOptions.data[i].ExQty = formattedExQty; + + // 鏋勫缓鏁版嵁瀵硅薄 + var item = { + SkuNo: infoOptions.data[i].SkuNo, + LotNo: infoOptions.data[i].LotNo, + Qty: parseFloat(infoOptions.data[i].Qty), // 淇濈暀4浣嶅皬鏁扮簿搴� + IsBale: infoOptions.data[i].IsBale, + IsBelt: infoOptions.data[i].IsBelt, + ExQty: parseFloat(formattedExQty), + + }; + DataList.push(item); + } + + var param = { + Type: data.field.Type, + CustomerNo: data.field.CustomerNo, + WareHouseNo: data.field.WarehouseId, + LogisticsId: parseInt(data.field.LogisticsId), + Detail: DataList + } + sendData(IP + "/BllSo/AddExportNotice", param, 'post', function (res) { + console.log(res); + if (res.code == 0) { //鎴愬姛 + layer.msg(res.msg, { + icon: 1, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }, function () { + parent.location.reload(); + parent.layer.close(layer.index); + }); + isrun = 0; + } else if (res.code == 1) { //涓嶆垚鍔� + layer.msg(res.msg, { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }, function () { }); + isrun = 0; + } + }); + return false; + }); + + + //涓嬫媺鍗曟嵁绫诲瀷閫変腑鍚庝簨浠� + form.on('select(Type)', function (data) { + var value = data.value; + if (value != TypeValue) { + getCustomerList(); + arr = []; + // 娓叉煋Table + refreshTable(null); + TypeValue = value; + } + }); + //鑾峰彇浠撳簱淇℃伅 + function getWareHouseList() { + sendData(IP + "/Sys/GetWarehouseDic", {}, 'get', function (res) { + + if (res.code == 0) { //鎴愬姛 + $("#WarehouseId").empty(); + $("#WarehouseId").append('<option value =""></option>'); + for (var i = 0; i < res.data.length; i++) { + $("#WarehouseId").append('<option value =' + res.data[i].WareHouseNo + '>' + + res.data[i].WareHouseName + '</option>'); + } + //$("#WarehouseId option[value='W01']").attr("selected", "selected") + form.render('select'); + } else { //涓嶆垚鍔� + layer.msg(res.msg, { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }, function () { }); + } + }); + } + //鑾峰彇瀹㈡埛涓嬫媺妗嗕俊鎭� + function getCustomerList() { + sendData(IP + "/Basis/GetCustomerSelect", {}, 'get', function (res) { + if (res.code == 0) { //鎴愬姛 + $("#CustomerNo").empty(); + $("#CustomerNo").append('<option value =""></option>'); + for (var i = 0; i < res.data.length; i++) { + var TypeNum = 0; + + switch ($("#Type").val()) { + case "0": //鎴愬搧鍑哄簱 + TypeNum = 0; + console.log(TypeNum) + break; + case "1": //棰嗘枡鍑哄簱 + case "2": //鎶芥鍑哄簱 + case "3": //鐗╂枡鍙栨牱鍑哄簱 + case "4": //涓嶅悎鏍煎搧鍑哄簱 + case "5": //涓棿鍝佸嚭搴� + case "6": //浠e偍鍑哄簱 + case "7": //鍏朵粬鍑哄簱 + case "8": //瀵勫瓨鍑哄簱 + TypeNum = 2; + console.log(TypeNum) + break; + } + //鍒ゆ柇鍗曟嵁绫诲瀷 + if (TypeNum == 0) { + if (res.data[i].Type == 0) { + $("#CustomerNamep").html("瀹㈡埛"); + $("#CustomerNo").append('<option value =' + res.data[i].CustomerNo + '>' + res.data[i].CustomerName + '</option>'); - } - } - else if (TypeNum == 1) - { - if (res.data[i].Type == 1) - { - $("#CustomerNamep").html("渚涘簲鍟�"); - $("#CustomerNo").append('<option value =' + res.data[i].CustomerNo + '>' + - res.data[i].CustomerName + '</option>'); - } - } - else if (TypeNum == 2) - { - if (res.data[i].Type == 2) - { - $("#CustomerNamep").html("璐т富"); - $("#CustomerNo").append('<option value =' + res.data[i].CustomerNo + '>' + - res.data[i].CustomerName + '</option>'); - } } } - form.render('select'); - } else { //涓嶆垚鍔� - layer.msg(res.msg, { - icon: 2, - time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - }, function() {}); + else if (TypeNum == 1) { + if (res.data[i].Type == 1) { + $("#CustomerNamep").html("渚涘簲鍟�"); + $("#CustomerNo").append('<option value =' + res.data[i].CustomerNo + '>' + + res.data[i].CustomerName + '</option>'); + } + } + else if (TypeNum == 2) { + if (res.data[i].Type == 2) { + $("#CustomerNamep").html("璐т富"); + $("#CustomerNo").append('<option value =' + res.data[i].CustomerNo + '>' + + res.data[i].CustomerName + '</option>'); + } + } } - }); - } - //鑾峰彇鐗╂祦鎵胯繍鍟嗕笅鎷夋淇℃伅 - function getLogisticsInfoList() { - sendData(IP + "/Basis/GetLogisticsInfoSelect", {}, 'get', function(res) { - if (res.code == 0) { //鎴愬姛 - $("#LogisticsId").empty(); - $("#LogisticsId").append('<option value =""></option>'); - for (var i = 0; i < res.data.length; i++) { - $("#LogisticsId").append('<option value =' + res.data[i].Id + '>' + - res.data[i].CarrierName + '</option>'); - } - form.render('select'); - } else { //涓嶆垚鍔� - layer.msg(res.msg, { - icon: 2, - time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - }, function() {}); + form.render('select'); + } else { //涓嶆垚鍔� + layer.msg(res.msg, { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }, function () { }); + } + }); + } + //鑾峰彇鐗╂祦鎵胯繍鍟嗕笅鎷夋淇℃伅 + function getLogisticsInfoList() { + sendData(IP + "/Basis/GetLogisticsInfoSelect", {}, 'get', function (res) { + if (res.code == 0) { //鎴愬姛 + $("#LogisticsId").empty(); + $("#LogisticsId").append('<option value =""></option>'); + for (var i = 0; i < res.data.length; i++) { + $("#LogisticsId").append('<option value =' + res.data[i].Id + '>' + + res.data[i].CarrierName + '</option>'); } - }); - } - }) - </script> - </body> -</html> + form.render('select'); + } else { //涓嶆垚鍔� + layer.msg(res.msg, { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }, function () { }); + } + }); + } + }) + </script> +</body> + +</html> \ No newline at end of file diff --git a/Pda/View/AsnSetting/productEnterQuantity.html b/Pda/View/AsnSetting/productEnterQuantity.html index 75e05b7..2824b47 100644 --- a/Pda/View/AsnSetting/productEnterQuantity.html +++ b/Pda/View/AsnSetting/productEnterQuantity.html @@ -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> @@ -482,7 +496,7 @@ initLanguage() setLanguage() - + //鏄惁杩炵画缁勬墭 isContinue = "0"; @@ -569,7 +583,7 @@ } }); - + //鐐瑰嚮鍏ュ簱鍗曟嵁涓嬫媺妗嗕簨浠� $("#selectDiv").click(function () { if (xianshiyemian == 0) { @@ -610,7 +624,7 @@ 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] + '>' + res.data[i] +'</option>'); + $("#bar").append('<option value =' + res.data[i] + '>' + res.data[i] + '</option>'); } form.render('select'); @@ -684,7 +698,7 @@ }, function () { }); } }) - + //閫変腑鍏ュ簱鍗曚簨浠� form.on('select(getbar)', function (data) { updateGoodList() @@ -981,12 +995,17 @@ }); return; } + // 鑾峰彇杈撳叆鐨勫�煎苟澶勭悊 + var skuQty = parseFloat($("#SkuQty").val()) || 0; + // 纭繚鏄剧ず鏃朵繚鐣�4浣嶅皬鏁� + var formattedQty = skuQty.toFixed(4); + var param = { AsnNo: $("#bar1").val(), //鍑哄簱鍗曟嵁 PalletNo: $("#STOCKCODE1").val(), //鎵樼洏鏉$爜 AsnDetailId: parseInt($("#goodSelect1").val()), //鍏ュ簱鍗曟槑缁咺D LotNo: $("#goodSelect1").find("option:selected").text(), //鐗╂枡鎵规 - SkuQty: parseInt($("#SkuQty").val()), //鐗╂枡鏁伴噺 + SkuQty: Number(skuQty), //鐗╂枡鏁伴噺 Demo: $("#NoticeDemo").val(), //鐗╂枡鏁伴噺 Origin: "PDA", TableType: xianshiyemian, @@ -1051,13 +1070,13 @@ function checkBoxInfo() { var param = { "BoxNo": $("#BOXCODE").val(), - "ASNNo":$("#bar").val() + "ASNNo": $("#bar").val() } sendData(IP + "/PdaAsn/GetBindBoxInfos", param, 'post', function (res) { - - + + if (res.code == 0) { //鎴愬姛 - + var bl = false; if (res.data.length == 0) { layer.msg("鏈煡璇㈠埌姝ょ鐗╂枡淇℃伅锛岃鏍稿疄!", { @@ -1086,21 +1105,21 @@ } } asnDetails.forEach(element => { - console.log(element.SkuNo ); - console.log( res.data[0].SkuNo); + 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); + 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, @@ -1109,19 +1128,19 @@ } else { $("#BoxQty").val(res.data[0].Qty); } - + } else { //涓嶆垚鍔� layer.msg(res.msg, { - icon: 2, - time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - }); + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }); //绠辩爜涓嶅瓨鍦紝璋冪敤璧嬬爜鎺ュ彛鑾峰彇绠变俊鎭� //getFMBoxinfo(); } }); } - function getFMBoxinfo(){ + function getFMBoxinfo() { var param = { "BoxNo": $("#BOXCODE").val(), } diff --git a/Pda/js/public.js b/Pda/js/public.js index f523964..7083b6a 100644 --- a/Pda/js/public.js +++ b/Pda/js/public.js @@ -1,7 +1,8 @@ // var IP = "http://47.104.149.73:1991";//鎺ュ彛IP // var IP = "https://localhost:44368"; //var IP = "http://localhost:13243/api"; -var IP = "http://localhost:50515/api"; +//var IP = "http://localhost:50515/api"; +var IP = "https://localhost:5001/api"; //var IP = "http://192.168.1.2:8017/"; // var IP = "http://192.168.10.112/WmsService/"; // var IP = "http://192.168.1.226:8086"; diff --git a/Wms/WMS.BLL/BllQualityServer/QualityInspectServer.cs b/Wms/WMS.BLL/BllQualityServer/QualityInspectServer.cs index 0cc581b..cb18376 100644 --- a/Wms/WMS.BLL/BllQualityServer/QualityInspectServer.cs +++ b/Wms/WMS.BLL/BllQualityServer/QualityInspectServer.cs @@ -226,7 +226,7 @@ /// <param name="model"></param> /// <returns></returns> /// <exception cref="Exception"></exception> - public string InsertQualitySap(SendQualityVm model) + /*public string InsertQualitySap(SendQualityVm model) { try { @@ -341,6 +341,124 @@ //鎶涘嚭寮傚父 throw new Exception("鎺ユ敹SAP涓嬪彂搴撳瓨璋冩暣鍗曞紓甯�:", ex); } + }*/ + + public string InsertQualitySap(SendQualityVm model) + { + try + { + if (string.IsNullOrEmpty(model.orderNo) || model.adjustmentDList.Count <= 0) + { + throw new Exception("鍙傛暟閿欒"); + } + //var asnInfo = Db.Queryable<BllArrivalNotice>().First(w => w.IsDel == "0" && w.OrderCode == model.orderNo); + //if (asnInfo == null) + //{ + // throw new Exception($"鏈煡璇㈠埌{model.orderNo}瀵瑰簲鐨勫叆搴撳崟淇℃伅"); + //} + //寮�鍚簨鍔� + Db.BeginTran(); + + foreach (var item in model.adjustmentDList) + { + //var asnDetail = Db.Queryable<BllArrivalNoticeDetail>().First(w => w.IsDel == "0" && w.ASNNo == asnInfo.ASNNo && w.OrderDetailCode == item.lineNo && w.SkuNo == item.skuNo && w.LotNo == item.lotNo); + //if (asnDetail == null) + //{ + // throw new Exception($"鏈煡璇㈠埌{item.lineNo}瀵瑰簲鐨勫叆搴撳崟鏄庣粏淇℃伅"); + //} + //asnDetail.InspectStatus = item.IsQualified; + ////鏇存柊鍏ュ簱鍗曟槑缁嗚川妫�鐘舵�� + //Db.Updateable(asnDetail).ExecuteCommand(); + + //鑾峰彇鐗╂枡淇℃伅 + var sku = Db.Queryable<SysMaterials>().First(a => a.IsDel == "0" && a.SkuNo == item.skuNo); + if (sku == null) + { + throw new Exception($"鐗╂枡缂栫爜涓簕item.skuNo}鐨勭墿鏂欎俊鎭笉瀛樺湪锛岃鏍告煡锛�"); + } + + string toDayTime = DateTime.Now.ToString("yyyyMMdd"); + var maxInspectNo = model.orderNo; + //var maxInspectNo = Db.Queryable<BllQualityInspect>().Where(m => m.IsDel == "0" && m.InspectNo.Contains("SAP")).Max(m => m.InspectNo); + //if (string.IsNullOrWhiteSpace(maxInspectNo)) + //{ + // maxInspectNo = "SAP" + toDayTime + "0001"; + //} + //else + //{ + // var lotStr = maxInspectNo.Substring(3, 8); + // if (lotStr == toDayTime) + // { + // maxInspectNo = "SAP" + toDayTime + (int.Parse(maxInspectNo.Replace("SAP", "").Substring(8, 4)) + 1).ToString().PadLeft(4, '0'); + // } + // else + // { + // maxInspectNo = "SAP" + toDayTime + "0001"; + // } + //} + var qualityModel = new BllQualityInspect + { + ASNNo = "", + InspectNo = maxInspectNo, + SkuNo = item.skuNo, + SkuName = item.skuName, + Standard = sku.Standard, + LotNo = item.lotNo, + IsQualified = item.IsQualified, + Origin = "SAP", + FailQty = 0, + PassQty = 0 + }; + + //鏌ユ壘搴撳瓨淇℃伅 + var stockDetailList = Db.Queryable<DataStockDetail>().Where(w => w.IsDel == "0" && w.SkuNo == item.skuNo && w.LotNo == item.lotNo).ToList(); + foreach (var datailItem in stockDetailList) + { + List<DataBoxInfo> boxList = Db.Queryable<DataBoxInfo>().Where(a => a.IsDel == "0" && a.SkuNo == item.skuNo && a.LotNo == item.lotNo && a.PalletNo == datailItem.PalletNo).ToList(); + foreach (var boxItem in boxList) + { + if (item.IsQualified == "0")//涓嶅悎鏍� + { + boxItem.InspectStatus = "2"; + } + else//鍚堟牸 + { + boxItem.InspectStatus = "1"; + } + } + //鏇存柊绠辩爜鏄庣粏璐ㄦ鐘舵�� + Db.Updateable(boxList).ExecuteCommand(); + + if (item.IsQualified == "0")//涓嶅悎鏍� + { + datailItem.InspectStatus = "2"; + //涓嶅悎鏍兼暟閲� + qualityModel.FailQty += datailItem.Qty; + } + else//鍚堟牸 + { + datailItem.InspectStatus = "1"; + //鍚堟牸鏁伴噺 + qualityModel.PassQty += datailItem.Qty; + } + //鏇存柊搴撳瓨鏄庣粏璐ㄦ鐘舵�� + Db.Updateable(datailItem).ExecuteCommand(); + } + //娣诲姞璐ㄦ鍙樻洿璁板綍 + Db.Insertable(qualityModel).ExecuteCommand(); + } + //鎻愪氦浜嬪姟 + Db.CommitTran(); + + return "0"; + } + catch (Exception ex) + { + //鍥炴粴浜嬪姟 + Db.RollbackTran(); + //鎶涘嚭寮傚父 + throw new Exception("鎺ユ敹SAP涓嬪彂搴撳瓨璋冩暣鍗曞紓甯�:", ex); + } } #endregion -- Gitblit v1.8.0