From ec258841a0f5249935578544ebed9121fbc71b2d Mon Sep 17 00:00:00 2001 From: Administrator <Administrator@DESKTOP-5BIMHQ3> Date: 星期五, 02 二月 2024 11:40:45 +0800 Subject: [PATCH] 合并代码 --- Pda/View/AsnSetting/productEnter1.html | 1298 ++++++++++++++++++++--------- Wms/WMS.Entity/BllAsnEntity/BllLabelBoxNo.cs | 21 Wms/WMS.IBLL/IBllAsnServer/IBllLabelBoxNoServer.cs | 43 Wms/Model/ModelVm/PdaVm/PdaAsnVm.cs | 5 Wms/Wms/Controllers/BllAsnController.cs | 15 HTML/views/ASNSetting/ArrivalNotice.html | 30 Wms/Model/ModelDto/BllAsnDto/LabelBoxDto.cs | 10 Wms/WMS.BLL/BllAsnServer/BllLabelBoxNoServer.cs | 625 ++++++++++++++ HTML/views/ASNSetting/LabelPrint.html | 116 +- Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs | 78 + HTML/views/ASNSetting/LabelBox.html | 196 ++-- HTML/views/ASNSetting/LabelPrintSelect.html | 148 ++- 12 files changed, 1,927 insertions(+), 658 deletions(-) diff --git a/HTML/views/ASNSetting/ArrivalNotice.html b/HTML/views/ASNSetting/ArrivalNotice.html index 825e782..f6fbcab 100644 --- a/HTML/views/ASNSetting/ArrivalNotice.html +++ b/HTML/views/ASNSetting/ArrivalNotice.html @@ -92,9 +92,17 @@ <div class="layui-input-inline"> <select name="Type" id="Type" lay-filter="Type" lay-search> <option value=""></option> + <!-- JC24 --> + <option value="0">鎴愬搧鍏ュ簱</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> <!-- JC09 --> - <option value="0">鏍囧噯浜у搧鍏ュ簱</option> - <option value="1">闈炴爣浜у搧鍏ュ簱</option> + <!-- <option value="0">鏍囧噯浜у搧鍏ュ簱</option> + <option value="1">闈炴爣浜у搧鍏ュ簱</option> --> <!-- JC08 --> <!-- <option value="0">鎴愬搧鍏ュ簱</option> <option value="1">鍘熸枡鍏ュ簱</option> @@ -1136,6 +1144,7 @@ //鏄庣粏琛ㄦ搷浣滄爮浜嬩欢 table.on('tool(LAY-app-content-list2)', function (obj) { var data = obj.data; + var id = data.Id; switch(obj.event) { case "del" : @@ -1171,7 +1180,7 @@ title: '鐢熸垚鏍囩', content: 'LabelPrintSelect.html', maxmin: true, - area: ['460px', '460px'], + area: ['480px', '615px'], btn: ['纭畾','鍙栨秷'], yes: function(index, layero){ var iframeWindow = window['layui-layer-iframe'+ index] @@ -1182,20 +1191,13 @@ var field = data.field; //鑾峰彇鎻愪氦鐨勫瓧娈� console.log(field); //鎻愪氦 Ajax 鎴愬姛鍚庯紝闈欐�佹洿鏂拌〃鏍间腑鐨勬暟鎹� - var param = { - Id: data.Id, - Reset: field.reset, //閲嶇疆鎵瑰彿 - Level: field.level, //鏍囩绾у埆 1/2绾� - Type:field.type, //鍏崇郴灞傜骇 鏈�/鏃犲眰绾� - ArriveQty:field.arriveQty, //鍒拌揣鏁伴噺 - BoxType:field.boxType ,// 绠辨敮绫诲瀷 绠�/鏀� - Qty:field.qty //绠�/鏀暟閲� - }; - console.log(param); + //"&Level="+field.level+"&Type="+field.type+"&BoxType="+field.boxType+"&Qty="+field.qty+ + var str = "Id="+id+"&Reset="+field.reset+"&ArriveQty="+field.arriveQty+"&ProductionTime="+field.productionTime+"&ExpirationTime="+field.expirationTime+"&StoreTime="+field.storeTime; + layer.open({ type: 2, title: '鐢熸垚鏍囩', - content: 'LabelPrint.html', + content: 'LabelPrint.html?'+str, maxmin: true, area: ['660px', '660px'], btn: ['鍙栨秷'], diff --git a/HTML/views/ASNSetting/LabelBox.html b/HTML/views/ASNSetting/LabelBox.html index 7986772..8f4ecf4 100644 --- a/HTML/views/ASNSetting/LabelBox.html +++ b/HTML/views/ASNSetting/LabelBox.html @@ -3,7 +3,7 @@ <head> <meta charset="utf-8"> - <title>鐗╂枡淇℃伅褰曞叆</title> + <title>鐗╂枡鏍囩</title> <meta name="renderer" content="webkit"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta name="viewport" @@ -36,14 +36,14 @@ </style> <script> // 杩欓噷鏄渶瑕佸湪椤甸潰娓叉煋涔嬪墠鎵ц鐨勪唬鐮� - document.addEventListener("DOMContentLoaded", function() { - + document.addEventListener("DOMContentLoaded", function () { + //鑾峰彇table榛樿鏄剧ず鏁� pageCntFirst(); //鍒ゆ柇鏄惁寮�鍚痶able鍒楄〃鍒楀璋冩暣鍔熻兘銆� GetIsSetColW(); }); - </script> + </script> </head> @@ -53,6 +53,13 @@ <div class="layui-card"> <div class="layui-form layui-card-header layuiadmin-card-header-auto"> <div class="layui-form-item"> + <div class="layui-inline" style="margin-right: 0;"> + <label class="layui-form-label" style="width: 60px;">鍏ュ簱鍗曞彿</label> + <div class="layui-input-inline" style="margin-right: 0;"> + <input type="text" id="ASNNo" name="ASNNo" placeholder="鍏ュ簱鍗曞彿" autocomplete="off" + class="layui-input"> + </div> + </div> <div class="layui-inline" style="margin-right: 0;"> <label class="layui-form-label" style="width: 60px;">绠� 鍙�</label> <div class="layui-input-inline" style="margin-right: 0;"> @@ -77,11 +84,25 @@ </div> </div> <div class="layui-inline" style="margin-right: 0;"> - <label class="layui-form-label" style="width: 60px;">鎵规鎻忚堪</label> + <label class="layui-form-label" style="width: 60px;">渚涜揣鎵规</label> <div class="layui-input-inline" style="margin-right: 0;"> <div class="layui-input-inline" style="margin-right: 0;"> - <input type="text" id="LotText" name="LotText" placeholder="鎵规鎻忚堪" autocomplete="off" - class="layui-input"> + <input type="text" id="SupplierLot" name="SupplierLot" placeholder="渚涜揣鎵规" + autocomplete="off" class="layui-input"> + </div> + </div> + </div> + + <div class="layui-inline" style="margin-right: 0;"> + <label class="layui-form-label">鏄惁浣跨敤</label> + <div class="layui-input-inline" style="margin-right: 0;"> + <div class="layui-input-inline" style="margin-right: 0;"> + <select name="IsUse" id="IsUse" lay-filter="IsUse" lay-search> + <option value=""></option> + <option value="0">鍚�</option> + <option value="1">鏄�</option> + + </select> </div> </div> </div> @@ -108,13 +129,13 @@ </button> --> <div class="position-relative"> <table id="Box-list" lay-filter="Box-list"></table> - + <div class="headerSetIcon"> <button class="layui-btn layui-btn-primary layui-btn-sm" data-type="customCols"> <i class="layui-icon"></i> </button> </div> - + <script type="text/html" id="templetProductionTime"> {{# function GetBtn3(d){ return formatDate2(d.ProductionTime); @@ -130,7 +151,7 @@ }} {{ GetBtn4(d) }} </script> - + <script type="text/html" id="templetInspectTime"> {{# function GetBtn5(d){ return formatDate2(d.InspectTime); @@ -138,7 +159,7 @@ }} {{ GetBtn5(d) }} </script> - + <script type="text/html" id="templetCompleteTime"> {{# function GetBtn6(d){ return formatDate(d.CompleteTime); @@ -159,7 +180,7 @@ {{ GetBtn7(d) }} </script> - + <script type="text/html" id="templetCreateTime"> {{# function GetBtn8(d){ @@ -168,9 +189,9 @@ }} {{ GetBtn8(d) }} </script> - </div> + </div> - <script type="text/html" id="toolbarDemo"> + <!-- <script type="text/html" id="toolbarDemo"> <button style="margin-right: 5px;" class="layui-btn layui-btn-sm layuiadmin-btn-list addClass" lay-event="add" > <i class="layui-icon"></i>娣诲姞 </button> @@ -178,7 +199,7 @@ <button style="margin-right: 5px;" id="daoru" class="layui-btn layui-btn-sm layuiadmin-btn-list DaoRuClass" lay-event="import" > <i class="layui-icon"></i>瀵煎叆 </button> - </script> + </script> --> <script type="text/html" id="toolbarDemoList"> {{# function GetBtn2(d){ @@ -226,36 +247,36 @@ // 鎼滅储鏂规硶 form.on('submit(LAY-app-contlist-search)', function (data) { - bindTable(); - - }); + bindTable(); + + }); // 椤甸潰鍔犺浇缁戝畾Table bindTable(); - + // 娣诲姞瀵煎叆鎸夐挳鍗曟満浜嬩欢 table.on('toolbar(Box-list)', function (obj) { switch (obj.event) { case 'add': // 娣诲姞绠辨敮鍏崇郴 - // layer.open({ - // type: 2, - // title: '鑷畾涔夊垪', - // content: '../SystemSettings/HeaderSetting.html', - // maxmin: false, - // resize: false, - // area: ['970px', '650px'] - // }); - layer.open({ - type: 2, - title: '鎵撳嵃', - content: 'LabelPrint.html?', - maxmin: true, - area: ['600px', '670px'], - btn: ['鍙栨秷'] - }); + // layer.open({ + // type: 2, + // title: '鑷畾涔夊垪', + // content: '../SystemSettings/HeaderSetting.html', + // maxmin: false, + // resize: false, + // area: ['970px', '650px'] + // }); + layer.open({ + type: 2, + title: '鎵撳嵃', + content: 'LabelPrint.html?', + maxmin: true, + area: ['600px', '670px'], + btn: ['鍙栨秷'] + }); break; - + default: break; } }); @@ -300,52 +321,51 @@ // 鏌ヨ褰曞叆鐨勭鏀叧绯� //#region 鑷畾涔夎〃澶� var TotalColsArr = [[ - - {field: 'BoxNo',title: '绠卞彿',align: 'center',fixed: 'left',width: 220, "disabled": true}, - {field: 'ParentBoxNo',title: '鐖剁骇绠卞彿',align: 'center',fixed: 'left',width: 220, "disabled": true}, - {field: 'SkuNo',title: '鐗╂枡缂栫爜',align: 'center',fixed: 'left',width: 140, "disabled": true }, - {field: 'SkuName',title: '鐗╂枡鍚嶇О',align: 'center',width: 240, }, - {field: 'Qty',title: '鏁伴噺',align: 'center',width: 100,}, - {field: 'LotNo',title: '鎵规鍙�',align: 'center',width: 155,}, - {field: 'LotText',title: '鎵规鎻忚堪',align: 'center',width: 165}, - {field: 'AsnNo',title: '鍗曟嵁鍙�',align: 'center',width: 155,}, - {field: 'IsUse',title: '鏄惁浣跨敤',align: 'center',templet: '#templetIsUse',width: 90}, - {field: 'Level',title: '绾у埆',align: 'center',width: 90}, - {field: 'ProductionTime',title: '鐢熶骇鏃ユ湡',align: 'center',width: 160,templet: '#templetProductionTime'}, - {field: 'ExpirationTime',title: '杩囨湡鏃ユ湡',align: 'center',width: 160,templet: '#templetExpirationTime'}, - {field: 'InspectTime',title: '澶嶉獙鏃ユ湡',align: 'center',width: 160,templet: '#templetInspectTime'}, - {field: 'CompleteTime',title: '瀹屾垚鏃ユ湡',align: 'center',width: 160,templet: '#templetCompleteTime'}, - {field: 'SupplierName',title: '渚涘簲鍟�',align: 'center',width: 155}, - {field: 'SupplierLot',title: '渚涜揣鎵规',align: 'center',width: 155}, - - {field: 'CreateUserName',title: '鍒涘缓浜�',align: 'center',width: 100}, - {field: 'CreateTime',title: '鍒涘缓鏃堕棿',align: 'center',width: 160,templet: '#templetCreateTime'}, - {field: 'caozuo',title: '鎿嶄綔',fixed: 'right',width: 100,align: 'center',toolbar: '#toolbarDemoList', "disabled": true} - ]]; - //url缂栫爜 - var TotalColsSysArr=encodeURIComponent(encodeURIComponent(JSON.stringify(TotalColsArr)))//灏嗚〃澶存暟鎹繘琛寀rl缂栫爜 + + { field: 'AsnNo', title: '鍏ュ簱鍗曞彿', align: 'center', width: 155, "disabled": true }, + { field: 'BoxNo', title: '绠卞彿', align: 'center', fixed: 'left', width: 220, "disabled": true }, + { field: 'ParentBoxNo', title: '鐖剁骇绠卞彿', align: 'center', fixed: 'left', width: 220, "disabled": true }, + { field: 'SkuNo', title: '鐗╂枡缂栫爜', align: 'center', fixed: 'left', width: 140, "disabled": true }, + { field: 'SkuName', title: '鐗╂枡鍚嶇О', align: 'center', width: 240, }, + { field: 'Qty', title: '鏁伴噺', align: 'center', width: 100, }, + { field: 'LotNo', title: '鎵规鍙�', align: 'center', width: 155, }, + { field: 'LotText', title: '鎵规鎻忚堪', align: 'center', width: 165 }, + { field: 'IsUse', title: '鏄惁浣跨敤', align: 'center', templet: '#templetIsUse', width: 90 }, + { field: 'Level', title: '绾у埆', align: 'center', width: 90 }, + { field: 'ProductionTime', title: '鐢熶骇鏃ユ湡', align: 'center', width: 160, templet: '#templetProductionTime' }, + { field: 'ExpirationTime', title: '杩囨湡鏃ユ湡', align: 'center', width: 160, templet: '#templetExpirationTime' }, + { field: 'InspectTime', title: '澶嶉獙鏃ユ湡', align: 'center', width: 160, templet: '#templetInspectTime' }, + { field: 'CompleteTime', title: '瀹屾垚鏃ユ湡', align: 'center', width: 160, templet: '#templetCompleteTime' }, + { field: 'SupplierName', title: '渚涘簲鍟�', align: 'center', width: 155 }, + { field: 'SupplierLot', title: '渚涜揣鎵规', align: 'center', width: 155 }, + + { field: 'CreateUserName', title: '鍒涘缓浜�', align: 'center', width: 100 }, + { field: 'CreateTime', title: '鍒涘缓鏃堕棿', align: 'center', width: 160, templet: '#templetCreateTime' }, + { field: 'caozuo', title: '鎿嶄綔', fixed: 'right', width: 100, align: 'center', toolbar: '#toolbarDemoList', "disabled": true } + ]]; + //url缂栫爜 + var TotalColsSysArr = encodeURIComponent(encodeURIComponent(JSON.stringify(TotalColsArr)))//灏嗚〃澶存暟鎹繘琛寀rl缂栫爜 //#endregion function bindTable() { - + //#region 鑷畾涔夎〃澶� var colsJson - var param1={ - Href:'BllAsn/GetLabelBoxList' + var param1 = { + Href: 'BllAsn/GetLabelBoxList' }; - 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 } var param = { BoxNo: $("#BoxNo").val(), - // BoxNo2: $("#BoxNo2").val(), BoxNo3: $("#BoxNo3").val(), SkuNo: $("#SkuNo").val(), LotNo: $("#LotNo").val(), @@ -353,7 +373,6 @@ ProductionTime: $("#ProductionTime").val(), InspectMark: $("#InspectMark").val(), BitBoxMark: $("#BitBoxMark").val(), - // Origin: "褰曞叆", }; table.render({ elem: '#Box-list', @@ -363,7 +382,6 @@ id: 'Box-list', where: param, contentType: 'application/json', - toolbar: '#toolbarDemo', defaultToolbar: [], //'filter','print', 'exports' headers: { ToKen: $.cookie('token') }, page: true, @@ -374,7 +392,7 @@ done: function (res) { setRight(); //鑷畾涔夊垪瀹� - SetTableColW('Box-list','BllAsn/GetLabelBoxList',TotalColsSysArr); + SetTableColW('Box-list', 'BllAsn/GetLabelBoxList', TotalColsSysArr); }, cols: colsJson }); @@ -420,7 +438,7 @@ $(function () { $(".addClass").hide(); $(".DaoRuClass").hide(); - $(".delClass").hide(); + $(".delClass").hide(); }); sendData(IP + "/Basis/GetRoleRightList", {}, 'get', function (res) { if (res.code == 0) { //鎴愬姛 @@ -437,7 +455,7 @@ } if (res.data[k].MenuName == "鍒犻櫎绠辨敮褰曞叆") { $(function () { - $(".delClass").show(); + $(".delClass").show(); }); } } @@ -460,13 +478,6 @@ }); return msg; } - // if ($("#BoxNo2").val() == "") { - // layer.msg("璇疯緭鍏ョ洅鐮侊紒", { - // icon: 2, - // time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - // }); - // return msg; - // } if ($("#BoxNo3").val() == "") { layer.msg("璇疯緭鍏ユ敮鐮侊紒", { icon: 2, @@ -498,7 +509,6 @@ var param = { BoxNo: $("#BoxNo").val(), - // BoxNo2: $("#BoxNo2").val(), BoxNo3: $("#BoxNo3").val(), SkuNo: $("#SkuNo").val(), LotNo: $("#LotNo").val(), @@ -586,17 +596,17 @@ doing = true }); } else { //涓嶆垚鍔� - if(res.msg==undefined){ + if (res.msg == undefined) { layer.msg("鍚庡彴姝e湪瀵煎叆涓紝璇风◢鍚庢煡鐪嬬粨鏋�", { icon: 2, time: 3000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - }, function () { bindTable();doing = true }); - }else{ + }, function () { bindTable(); doing = true }); + } else { layer.msg(res.msg, { icon: 2, time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - }, function () { bindTable();doing = true }); - } + }, function () { bindTable(); doing = true }); + } } }); }); @@ -610,18 +620,18 @@ //#region 鑷畾涔夎〃澶� //鑷畾涔夎〃澶� active = { - customCols: function(){ + customCols: function () { layer.open({ type: 2, title: '鑷畾涔夊垪', - content: '../SystemSettings/HeaderSetting.html?Href=BllAsn/GetLabelBoxList&ColsSysArr='+TotalColsSysArr, + content: '../SystemSettings/HeaderSetting.html?Href=BllAsn/GetLabelBoxList&ColsSysArr=' + TotalColsSysArr, maxmin: false, resize: false, area: ['970px', '650px'] }); }, }; - $('.layui-btn').on('click', function() { + $('.layui-btn').on('click', function () { var type = $(this).data('type'); active[type] ? active[type].call(this) : ''; }); diff --git a/HTML/views/ASNSetting/LabelPrint.html b/HTML/views/ASNSetting/LabelPrint.html index c1d7a6b..1704e72 100644 --- a/HTML/views/ASNSetting/LabelPrint.html +++ b/HTML/views/ASNSetting/LabelPrint.html @@ -27,6 +27,16 @@ <body> <div style="width:100%;text-align: center;"> + <div style="padding-top: 10px;text-align: left; margin-left: 5%;" id="button"> + <div class="layui-inline"> + <button id="btnAdd" class="layui-btn layui-btn-sm" lay-event="Add2"><i + class="layui-icon"></i>鐢熸垚鏍囩</button> + </div> + <div class="layui-inline"> + <button id="btnPrint" class="layui-btn layui-btn-sm" lay-event="Add"><i + class="layui-icon"></i>鎵撳嵃</button> + </div> + </div> <div class="layui-form" lay-filter="layuiadmin-app-form-list" id="print" style="width: 100%;height:100%; text-align: right;padding-top: 5px;margin-left: 0%;"> <div> @@ -44,7 +54,7 @@ </tr> <tr> <td>鍝佸悕</td> - <td colspan="3" id="goodName"></td> + <td colspan="3" id="SkuName"></td> </tr> <tr> <td>瑙勬牸/鍨嬪彿</td> @@ -56,7 +66,7 @@ <td>杩涘巶缂栧彿</td> <td style="padding: 1px 0px;"></td> <td>鐗╂枡浠g爜</td> - <td style="padding: 1px 0px;"> </td> + <td id="SkuNo"> </td> </tr> <tr> <td>鍘熷巶鎵瑰彿</td> @@ -80,49 +90,8 @@ </div> <div style="page-break-after: always;"></div> - </div> - <hr> - <div style="padding-top: 10px;text-align: left;" id="button"> - <div class="layui-inline" style="margin-right: 10px;"> - <span style="padding-right: 5px;">鏄惁閲嶇疆鎵规:</span> - <span style="padding-right: 5px;">鏄�</span><input type="radio" checked="true" name="isprint" value="1"> - <span style="padding-right: 5px;">鍚�</span><input type="radio" name="isprint" value="0"> - </div> - <div class="layui-inline"> - 鍒拌揣鏁伴噺锛�<div class="layui-input-inline"> - <input type="text" - oninput="value=value.replace(/[^\d^\.]+/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.').replace(/^(\-)*(\d+)\.(\d\d\d).*$/,'$1$2.$3')" - onafterpaste="this.value=this.value.replace(/[^\d^\.]+/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.').replace(/^(\-)*(\d+)\.(\d\d\d).*$/,'$1$2.$3')" - name="skuNum" id="skuNum" lay-verify="skuNum" placeholder="" style="width: 100px;" - autocomplete="off" class="layui-input InputCss"> - </div> - </div> - <div class="layui-inline"> - 绠辨爣绛炬暟閲忥細<div class="layui-input-inline"> - <input type="text" onkeyup="this.value=this.value.replace(/^0{1,}/g,'')" - onafterpaste="this.value=this.value.replace(/^0{1,}/g,'')" name="bQNum" id="bQNum" - lay-verify="bQNum" placeholder="" style="width: 100px;" autocomplete="off" - class="layui-input InputCss"> - </div> - </div> - - <div> - <div class="layui-inline" style="padding-top: 5px"> - 涓�绾ф爣绛惧繀褰曞弬鏁帮細绠卞唴鏁伴噺锛�<div class="layui-input-inline"> - <input type="text" - oninput="value=value.replace(/[^\d^\.]+/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.').replace(/^(\-)*(\d+)\.(\d\d\d).*$/,'$1$2.$3')" - onafterpaste="this.value=this.value.replace(/[^\d^\.]+/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.').replace(/^(\-)*(\d+)\.(\d\d\d).*$/,'$1$2.$3')" - name="number" id="number" lay-verify="number" placeholder="" style="width: 70px;" - autocomplete="off" class="layui-input InputCss"> - </div> - </div> - <div class="layui-inline"> - <button id="btnPrint" class="layui-btn layui-btn-sm" lay-event="Add"><i - class="layui-icon"></i>鎵撳嵃</button> - </div> - </div> - </div> - + </div> + </div> <script src="../../layuiadmin/layui/layui.js"></script> <script src="../../js/public.js"></script> @@ -141,20 +110,22 @@ form = layui.form, layer = layui.layer; var laydate = layui.laydate; - laydate.render({ - elem: '#ProductionDate' - , format: 'yyyy-MM-dd' //鍙换鎰忕粍鍚� - }); - laydate.render({ - elem: '#InspectTime' - , format: 'yyyy-MM-dd' //鍙换鎰忕粍鍚� - }); - laydate.render({ - elem: '#ExpirationTime' - , format: 'yyyy-MM-dd' //鍙换鎰忕粍鍚� - }); - var id = getQueryString('id'); - var xun = 0; + + var id = getQueryString('Id'); + var reset = getQueryString('Reset'); + var arriveQty = getQueryString('ArriveQty'); + + var productionTime = getQueryString('ProductionTime'); + var expirationTime = getQueryString('ExpirationTime'); + var storeTime = getQueryString('StoreTime'); + // var level = getQueryString('Level'); + // var type = getQueryString('Type'); + // var boxType = getQueryString('BoxType'); + // var qty = getQueryString('Qty'); + + console.log(productionTime); + console.log(expirationTime); + console.log(storeTime); $('#btnPrint').on('click', function () { var param = { @@ -204,7 +175,30 @@ id = 0; } else { - div(-1, 1, 0); + var param = { + id: id, + }; + synData(IP + "/BllAsn/GetLabelBoxModel", param , 'get', function (res) { + if (res.code == 0) { //鎴愬姛 + $("#SkuName").html(res.data.SkuName); + $("#Standard").html(res.data.Standard); + $("#PackageStandard").html(res.data.PackageStandard); + $("#SkuNo").html(res.data.SkuNo); + $("#SupplierLot").html(res.data.SupplierLot); + $("#ExpirationTime").html(expirationTime); + $("#StoreTime").html( storeTime); + + // $("#imgBar").attr("src", res.data[0].imageStr); + } else { //涓嶆垚鍔� + layer.msg(res.msg, { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }, function () { }); + } + }); + + // div(-1, 1, 0); + } @@ -336,7 +330,7 @@ // 鑾峰彇浼犻�掑弬鏁� function getQueryString(name) { var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); - var r = window.location.search.substr(1).match(reg); + var r = window.location.search.substr(1).match(reg); if (r != null) return unescape(r[2]); return null; } diff --git a/HTML/views/ASNSetting/LabelPrintSelect.html b/HTML/views/ASNSetting/LabelPrintSelect.html index 31beeec..1b021e4 100644 --- a/HTML/views/ASNSetting/LabelPrintSelect.html +++ b/HTML/views/ASNSetting/LabelPrintSelect.html @@ -10,6 +10,25 @@ </head> <body> <div class="layui-form" lay-filter="layuiadmin-app-form-list" id="layuiadmin-app-form-list" style="padding: 20px 30px 0 0;"> + + <div class="layui-form-item"> + <label class="layui-form-label">鐢熶骇鏃ユ湡</label> + <div class="layui-input-block"> + <input type="text" name="productionTime" id="productionTime" placeholder="璇疯緭鍏ョ敓浜ф棩鏈�" autocomplete="off" class="layui-input"> + </div> + </div> + <div class="layui-form-item"> + <label class="layui-form-label">鏈夋晥鏈熻嚦</label> + <div class="layui-input-block"> + <input type="text" name="expirationTime" id="expirationTime" placeholder="璇疯緭鍏ユ湁鏁堟湡鑷�" autocomplete="off" class="layui-input"> + </div> + </div> + <div class="layui-form-item"> + <label class="layui-form-label">鍌ㄥ瓨鏈熻嚦</label> + <div class="layui-input-block"> + <input type="text" name="storeTime" id="storeTime" placeholder="璇疯緭鍏ュ偍瀛樻湡鑷�" autocomplete="off" class="layui-input"> + </div> + </div> <div class="layui-form-item"> <label class="layui-form-label">閲嶇疆鎵瑰彿</label> <div class="layui-input-block"> @@ -19,7 +38,7 @@ </select> </div> </div> - <div class="layui-form-item"> + <!-- <div class="layui-form-item"> <label class="layui-form-label">鏍囩绾у埆</label> <div class="layui-input-block"> <select name="level" id="level" lay-filter="levelFil" lay-verify="required"> @@ -36,14 +55,16 @@ <option value="0">鏃犲眰绾�</option> </select> </div> - </div> + </div> --> <div class="layui-form-item"> <label class="layui-form-label">鍒拌揣鏁伴噺</label> <div class="layui-input-block"> - <input type="text" name=arriveQty" id="arriveQty" lay-verify="required" placeholder="璇疯緭鍏ュ贩閬撳悕绉�" autocomplete="off" class="layui-input"> + <input type="text" name="arriveQty" id="arriveQty" lay-verify="required" placeholder="璇疯緭鍏ュ埌璐ф暟閲�" autocomplete="off" class="layui-input" oninput="value=value.replace(/[^\d^\.]+/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.').replace(/^(\-)*(\d+)\.(\d\d\d\d).*$/,'$1$2.$3')" + onafterpaste="this.value=this.value.replace(/[^\d^\.]+/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.').replace(/^(\-)*(\d+)\.(\d\d\d\d).*$/,'$1$2.$3')"> </div> </div> - <div class="layui-form-item" id="boxTypeDiv" style="display: none;"> + + <!-- <div class="layui-form-item" id="boxTypeDiv" style="display: none;"> <label class="layui-form-label">绠辨敮绫诲瀷</label> <div class="layui-input-block"> <select name="boxType" id="boxType" lay-filter="boxTypeFil" lay-search> @@ -56,9 +77,10 @@ <div class="layui-form-item" id="qtyDiv" style="display: none;"> <label class="layui-form-label">鏁伴噺</label> <div class="layui-input-block"> - <input type="text" name="qty" id="qty" placeholder="璇疯緭鍏ュ贩閬撳悕绉�" autocomplete="off" class="layui-input"> + <input type="text" name="qty" id="qty" placeholder="璇疯緭鍏ユ暟閲�" autocomplete="off" class="layui-input" oninput="value=value.replace(/[^\d^\.]+/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.').replace(/^(\-)*(\d+)\.(\d\d\d\d).*$/,'$1$2.$3')" + onafterpaste="this.value=this.value.replace(/[^\d^\.]+/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.').replace(/^(\-)*(\d+)\.(\d\d\d\d).*$/,'$1$2.$3')"> </div> - </div> + </div> --> <div class="layui-form-item layui-hide"> <input type="button" lay-submit lay-filter="layuiadmin-app-form-submit" id="layuiadmin-app-form-submit" value="纭娣诲姞"> <input type="button" lay-submit lay-filter="layuiadmin-app-form-edit" id="layuiadmin-app-form-edit" value="纭缂栬緫"> @@ -75,64 +97,78 @@ base: '../../layuiadmin/' //闈欐�佽祫婧愭墍鍦ㄨ矾寰� }).extend({ index: 'lib/index' //涓诲叆鍙fā鍧� - }).use(['index', 'form', 'layer'], function() { + }).use(['index', 'form', 'layer', 'laydate'], function() { var $ = layui.$; var form = layui.form; var layer = layui.layer; - form.on('select(levelFil)', function(data){ - console.log($("#type").val()); - var type = $("#type").val(); - if (data.value == "1" ) { - $("#boxTypeDiv").css("display","none"); - form.val("layuiadmin-app-form-list", { - "boxType": "" - }); - $("#boxType").removeAttr("lay-verify"); + var laydate = layui.laydate; + laydate.render({ + elem: '#productionTime' + , format: 'yyyy-MM-dd' //鍙换鎰忕粍鍚� + }); + laydate.render({ + elem: '#expirationTime' + , format: 'yyyy-MM-dd' //鍙换鎰忕粍鍚� + }); + laydate.render({ + elem: '#storeTime' + , format: 'yyyy-MM-dd' //鍙换鎰忕粍鍚� + }); - $("#qtyDiv").css("display","none"); - $("#qty").removeAttr("lay-verify"); - $("#qty").val(""); + // form.on('select(levelFil)', function(data){ + // console.log($("#type").val()); + // var type = $("#type").val(); + // if (data.value == "1" ) { + // $("#boxTypeDiv").css("display","none"); + // form.val("layuiadmin-app-form-list", { + // "boxType": "" + // }); + // $("#boxType").removeAttr("lay-verify"); - form.render('select'); - } - if (data.value == "2" && type == "0") { - $("#boxTypeDiv").css("display","block"); - $("#boxType").attr("lay-verify","required"); + // $("#qtyDiv").css("display","none"); + // $("#qty").removeAttr("lay-verify"); + // $("#qty").val(""); + + // form.render('select'); + // } + // if (data.value == "2" && type == "0") { + // $("#boxTypeDiv").css("display","block"); + // $("#boxType").attr("lay-verify","required"); - } - }); - form.on('select(typeFil)', function(data){ - var level = $("#level").val(); - if (data.value == "1") { - $("#boxTypeDiv").css("display","none"); + // } + // }); + // form.on('select(typeFil)', function(data){ + // var level = $("#level").val(); + // if (data.value == "1") { + // $("#boxTypeDiv").css("display","none"); - form.val("layuiadmin-app-form-list", { - "boxType": "" - }); - $("#boxType").removeAttr("lay-verify"); - - $("#qtyDiv").css("display","none"); - $("#qty").removeAttr("lay-verify"); - $("#qty").val(""); - form.render('select'); - } - if (data.value == "0" && level == "2") { - $("#boxTypeDiv").css("display","block"); - $("#boxType").attr("lay-verify","required"); + // form.val("layuiadmin-app-form-list", { + // "boxType": "" + // }); + // $("#boxType").removeAttr("lay-verify"); - } - }); - form.on('select(boxTypeFil)', function(data){ - if (data.value == "1") { //绠� - $("#qtyDiv").css("display","none"); - $("#qty").removeAttr("lay-verify"); - $("#qty").val(""); - } - if (data.value == "2" ) { - $("#qtyDiv").css("display","block"); - $("#qty").attr("lay-verify","required"); - } - }); + // $("#qtyDiv").css("display","none"); + // $("#qty").removeAttr("lay-verify"); + // $("#qty").val(""); + // form.render('select'); + // } + // if (data.value == "0" && level == "2") { + // $("#boxTypeDiv").css("display","block"); + // $("#boxType").attr("lay-verify","required"); + + // } + // }); + // form.on('select(boxTypeFil)', function(data){ + // if (data.value == "1") { //绠� + // $("#qtyDiv").css("display","none"); + // $("#qty").removeAttr("lay-verify"); + // $("#qty").val(""); + // } + // if (data.value == "2" ) { + // $("#qtyDiv").css("display","block"); + // $("#qty").attr("lay-verify","required"); + // } + // }); }) diff --git a/Pda/View/AsnSetting/productEnter1.html b/Pda/View/AsnSetting/productEnter1.html index 1157f96..8cdd898 100644 --- a/Pda/View/AsnSetting/productEnter1.html +++ b/Pda/View/AsnSetting/productEnter1.html @@ -111,7 +111,7 @@ <!-- 鏈夌爜 --> <div id="content1"> <div id="zongDiv" class="layout-bill-info" style="height: 255px;"> - <form class="layui-form" action=""> + <form class="layui-form" id="form1" action=""> <div id="" class="layui-form-item layout-dropdownlist"> <label class="layui-form-label" lang>鍏ュ簱鍗曪細</label> <div class="layui-input-block" id="selectDiv"> @@ -204,19 +204,72 @@ </tr> </table> + + <table class="layout-tbl-submit" border="" cellspacing="" cellpadding=""> + <tr> + <td style="width: 23%;"></td> + <td> + <button class="layout-btn layout-btn-red" lang type="button" lay-submit + lay-filter="formBind">缁戝畾鍒版墭鐩�</button> + </td> + <td style="width: 33%;"></td> + + </tr> + </table> </form> + </div> + + <br> + + <div id="" class="cut-line"> + <img src="/assets/fengexian.png"> + </div> + + <div class="layout-tbl-paging" id=""> + <table id="tableBoxList" class="tbl-box-list" border="" cellspacing="" cellpadding=""> + <tr> + <th lang style="width: 15%;">缂栫爜</th> + <th lang style="width: 35%;">鍚嶇О</th> + <th lang style="width: 25%;">鎵规</th> + <th lang style="width: 15%;">鏁伴噺</th> + <th lang style="width: 10%;">鎿嶄綔</th> + </tr> + <tr id="boxCell" style="display: none;"> + <td name="code">AG000001</td> + <td name="name">鐤嫍鍚嶇О鍚嶇О鍚嶇О</td> + <td name="lotNo">鎵规鍙�</td> + <td name="num">30</td> + <td name="del"> + <div id="" class="tbl-btn-del" lang> + 鍒犻櫎 + </div> + </td> + </tr> + </table> + <!-- 鍒嗛〉 --> + <table id="tableBoxPages" class="tbl-box-pages" border="" cellspacing="" cellpadding=""> + <tr style="display: ;"> + <td class="page-prev">涓婁竴椤�</td> + <td class="page-num page-num-select">1</td> + <td class="page-num">2</td> + <td class="page-num">3</td> + <td class="page-num">4</td> + <td class="page-num">5</td> + <td class="page-next">涓嬩竴椤�</td> + </tr> + </table> </div> </div> <!-- 鏃犵爜 --> <div id="content2"> <div id="zongDiv" class="layout-bill-info" style="height: 255px;"> - <form class="layui-form" action=""> + <form class="layui-form" id="form2" action=""> <div id="" class="layui-form-item layout-dropdownlist"> <label class="layui-form-label" lang>鍏ュ簱鍗曪細</label> - <div class="layui-input-block" id="selectDivw"> - <select id="barw" lay-filter="getbar" lay-search> + <div class="layui-input-block" id="selectDiv1"> + <select id="bar1" lay-filter="getbar" lay-search> <option value=""></option> </select> <img src="/assets/down_arraw.png"> @@ -224,8 +277,8 @@ </div> <div class="layui-form-item layout-dropdownlist" style="margin-top: 10px;"> <label class="layui-form-label">鐗╂枡-鎵规锛�</label> - <div class="layui-input-block" id="goodDivw"> - <select id="goodSelectw" lay-filter="goodSelectw" lay-search> + <div class="layui-input-block" id="goodDiv"> + <select id="goodSelect1" lay-filter="goodSelect1" lay-search> <option value=""></option> </select> <img src="/assets/down_arraw.png"> @@ -235,7 +288,7 @@ <div id="" class="layui-form-item layout-input"> <label class="layui-form-label" lang>鎵樼洏鏉$爜锛�</label> <div class="layui-input-block"> - <input id="STOCKCODEw" type="text" lay-verify="stock" lang langholder placeholder="璇锋壂鎻忔墭鐩樻潯鐮�" + <input id="STOCKCODE1" type="text" lay-verify="stock" lang langholder placeholder="璇锋壂鎻忔墭鐩樻潯鐮�" autocomplete="off" class="layui-input"> </div> </div> @@ -243,7 +296,7 @@ <div id="" class="layui-form-item layout-input"> <label class="layui-form-label" lang>鐗╂枡鏁伴噺锛�</label> <div class="layui-input-block"> - <input id="SkuQtyw" type="text" lay-verify="stock" lang langholder placeholder="璇疯緭鍏ョ墿鏂欐暟閲�" + <input id="SkuQty" type="text" lay-verify="stock" lang langholder placeholder="璇疯緭鍏ョ墿鏂欐暟閲�" autocomplete="off" class="layui-input"> </div> </div> @@ -254,7 +307,7 @@ <div id="" class="layui-form-item layout-boxinfo"> <label class="layui-form-label" lang>瑙勬牸/鍨嬪彿锛�</label> <div class="layui-input-block"> - <input id="Standardw" type="text" disabled placeholder="" autocomplete="off" + <input id="Standard1" type="text" disabled placeholder="" autocomplete="off" class="layui-input"> </div> </div> @@ -265,7 +318,7 @@ <div id="" class="layui-form-item layout-boxinfo"> <label class="layui-form-label" lang>璁″垝鏁伴噺锛�</label> <div class="layui-input-block"> - <input id="ImportQuantityw" type="text" disabled placeholder="" + <input id="ImportQuantity1" type="text" disabled placeholder="" autocomplete="off" class="layui-input"> </div> </div> @@ -277,7 +330,7 @@ <div id="" class="layui-form-item layout-boxinfo"> <label class="layui-form-label" lang>宸茬粍鏁伴噺锛�</label> <div class="layui-input-block"> - <input id="ImportFactQuantityw" type="text" disabled placeholder="" + <input id="ImportFactQuantity1" type="text" disabled placeholder="" autocomplete="off" class="layui-input"> </div> </div> @@ -286,52 +339,63 @@ </table> + <table class="layout-tbl-submit" border="" cellspacing="" cellpadding=""> + <tr> + <td style="width: 23%;"></td> + <td> + <button class="layout-btn layout-btn-red" lang type="button" lay-submit + lay-filter="formBind">缁戝畾鍒版墭鐩�</button> + </td> + <td style="width: 33%;"></td> + + </tr> + </table> + </form> </div> + <br> + + <div id="" class="cut-line"> + <img src="/assets/fengexian.png"> + </div> + + <div class="layout-tbl-paging" id=""> + <table id="tableBoxList1" class="tbl-box-list" border="" cellspacing="" cellpadding=""> + <tr> + <th lang style="width: 15%;">缂栫爜</th> + <th lang style="width: 35%;">鍚嶇О</th> + <th lang style="width: 25%;">鎵规</th> + <th lang style="width: 15%;">鏁伴噺</th> + <th lang style="width: 10%;">鎿嶄綔</th> + </tr> + <tr id="boxCell" style="display: none;"> + <td name="code">AG000001</td> + <td name="name">鐤嫍鍚嶇О鍚嶇О鍚嶇О</td> + <td name="lotNo">鎵规鍙�</td> + <td name="num">30</td> + <td name="del"> + <div id="" class="tbl-btn-del" lang> + 鍒犻櫎 + </div> + </td> + </tr> + </table> + <!-- 鍒嗛〉 --> + <table id="tableBoxPages1" class="tbl-box-pages" border="" cellspacing="" cellpadding=""> + <tr style="display: ;"> + <td class="page-prev">涓婁竴椤�</td> + <td class="page-num page-num-select">1</td> + <td class="page-num">2</td> + <td class="page-num">3</td> + <td class="page-num">4</td> + <td class="page-num">5</td> + <td class="page-next">涓嬩竴椤�</td> + </tr> + </table> + </div> + </div> - - <table class="layout-tbl-submit" border="" cellspacing="" cellpadding=""> - <tr> - <td style="width: 23%;"></td> - <td> - <button class="layout-btn layout-btn-red" lang type="button" lay-submit - lay-filter="formBind">缁戝畾鍒版墭鐩�</button> - </td> - <td style="width: 33%;"></td> - - </tr> - </table> - - <br> - - <div id="" class="cut-line"> - <img src="/assets/fengexian.png"> - </div> - - <div class="layout-tbl-paging" id=""> - <table id="tableBoxList" class="tbl-box-list" border="" cellspacing="" cellpadding=""> - <tr> - <th lang style="width: 15%;">缂栫爜</th> - <th lang style="width: 35%;">鍚嶇О</th> - <th lang style="width: 25%;">鎵规</th> - <th lang style="width: 15%;">鏁伴噺</th> - <th lang style="width: 10%;">鎿嶄綔</th> - </tr> - <tr id="boxCell" style="display: none;"> - <td name="code">AG000001</td> - <td name="name">鐤嫍鍚嶇О鍚嶇О鍚嶇О</td> - <td name="lotNo">鎵规鍙�</td> - <td name="num">30</td> - <td name="del"> - <div id="" class="tbl-btn-del" lang> - 鍒犻櫎 - </div> - </td> - </tr> - </table> - </div> - </div> </div> @@ -353,6 +417,7 @@ $('#content2').hide(); $(document).ready(function() { $('#option1').click(function() { + // qingkong(); xianshiyemian = 0; $('#content1').show(); $('#option1').attr("style", "background-color: aqua;width: 45.77%;float: left;text-align: center;"); //閫変腑鍚庨鑹� @@ -362,6 +427,7 @@ }); $('#option2').click(function() { + // qingkong(); xianshiyemian = 1; $('#content1').hide(); $('#option1').attr("style", "background-color: #999;width: 45.77%;float: left;text-align: center;"); //榛樿棰滆壊 @@ -371,7 +437,30 @@ }); }); - + + //娓呯┖涓や釜鏍囩椤靛唴瀹� + function qingkong() + { + //鍏ュ簱鍗曟嵁 + // $('#form1').reset() + // $('#form2').reset() + + // //琛ㄦ牸鍐呭 + // let trs = $("#tableBoxList tr") + // let len = trs.length + + // for (i = len - 1; i >= 2; i--) { + // trs[i].remove(); + // } + // let trs1 = $("#tableBoxList1 tr") + // let len1 = trs1.length + + // for (i = len1 - 1; i >= 2; i--) { + // trs1[i].remove(); + // } + } + + /*鈥斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺��*/ initLanguage() setLanguage() @@ -401,15 +490,14 @@ } checkPalletStat() }) + // 鎵樼洏鐮佹枃鏈敼鍙樻椂瑙﹀彂 + $("#STOCKCODE1").on('input', function () { - // 鎵樼洏鐮佹枃鏈敼鍙樻椂瑙﹀彂-鏁伴噺 - $("#STOCKCODEw").on('input', function () { - - if ($("#STOCKCODEw").val() == "" || $("#STOCKCODEw").val().length < 8) { + if ($("#STOCKCODE1").val() == "" || $("#STOCKCODE1").val().length < 8) { return } - if ($("#STOCKCODEw").val().length >= 8) { - $("#STOCKCODEw").val($("#STOCKCODEw").val().substr(-8)) + if ($("#STOCKCODE1").val().length >= 8) { + $("#STOCKCODE1").val($("#STOCKCODE1").val().substr(-8)) } checkPalletStat() }) @@ -434,26 +522,117 @@ } }); + + /* 鍏ュ簱鍗曟嵁涓嬫媺妗� */ //鐐瑰嚮鍏ュ簱鍗曟嵁涓嬫媺妗嗕簨浠� $("#selectDiv").click(function () { - var input = $('select[id="bar"]').next().find('.layui-select-title input') - var val = input.val() - //鍏堟洿鏂颁竴涓嬪叆搴撳崟 - updateBillList(function (data) { - $('select[id="bar"]').next().addClass('layui-form-selected') - $('select[id="bar"]').next().find('.layui-select-title input').val(val) - }) + if (xianshiyemian == 0) + { + var input = $('select[id="bar"]').next().find('.layui-select-title input') + var val = input.val() + //鍏堟洿鏂颁竴涓嬪叆搴撳崟 + updateBillList(function (data) { + $('select[id="bar"]').next().addClass('layui-form-selected') + $('select[id="bar"]').next().find('.layui-select-title input').val(val) + }) + } }) - //鐐瑰嚮鍏ュ簱鍗曟嵁涓嬫媺妗嗕簨浠�-鏁伴噺 - $("#selectDivw").click(function () { - var input = $('select[id="barw"]').next().find('.layui-select-title input') - var val = input.val() - //鍏堟洿鏂颁竴涓嬪叆搴撳崟 - updateBillList(function (data) { - $('select[id="barw"]').next().addClass('layui-form-selected') - $('select[id="barw"]').next().find('.layui-select-title input').val(val) - }) + //鐐瑰嚮鍏ュ簱鍗曟嵁涓嬫媺妗嗕簨浠� + $("#selectDiv1").click(function () { + if (xianshiyemian == 1) + { + var input = $('select[id="bar1"]').next().find('.layui-select-title input') + var val = input.val() + //鍏堟洿鏂颁竴涓嬪叆搴撳崟 + updateBillList(function (data) { + $('select[id="bar1"]').next().addClass('layui-form-selected') + $('select[id="bar1"]').next().find('.layui-select-title input').val(val) + }) + } }) + + /*鈥斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺��*/ + + + /* 缁戝畾鍏ュ簱鍗曚俊鎭� */ + + function updateBillList(callback) { + if (xianshiyemian == 0) + { + var input = $('select[id="bar"]').next().find('.layui-select-title input') + var val = input.val() + $("#bar").empty() + $("#bar").append('<option value =>' + '</option>'); + form.render('select'); + + var param = { + Type: "0,1" + }; + sendData(IP + "/PdaAsn/GetArrivalNotices", 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>'); + } + form.render('select'); + + if (!val) { + $('#bar').siblings("div.layui-form-select").find('dl').find('.layui-select-tips').addClass('layui-this') + } else { + var sel = 'dd[lay-value=' + val + ']'; + $('#bar').siblings("div.layui-form-select").find('dl').find(sel).addClass('layui-this') + } + + callback(res.data) + } else { //涓嶆垚鍔� + // layer.msg(res.msg, { + // icon: 2, + // time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + // }, function() {}); + } + }); + } + else if (xianshiyemian == 1) + { + var input = $('select[id="bar1"]').next().find('.layui-select-title input') + var val = input.val() + $("#bar1").empty() + $("#bar1").append('<option value =>' + '</option>'); + form.render('select'); + + var param = { + Type: "2" + }; + sendData(IP + "/PdaAsn/GetArrivalNotices", 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>'); + } + form.render('select'); + + if (!val) { + $('#bar1').siblings("div.layui-form-select").find('dl').find('.layui-select-tips').addClass('layui-this') + } else { + var sel = 'dd[lay-value=' + val + ']'; + $('#bar1').siblings("div.layui-form-select").find('dl').find(sel).addClass('layui-this') + } + + callback(res.data) + } else { //涓嶆垚鍔� + // layer.msg(res.msg, { + // icon: 2, + // time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + // }, function() {}); + } + }); + } + + } + + /*鈥斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺��*/ //鐐瑰嚮鐗╂枡涓嬫媺妗嗕簨浠� $("#goodDiv").click(function () { @@ -464,385 +643,495 @@ }, function () { }); } }) - //鐐瑰嚮鐗╂枡涓嬫媺妗嗕簨浠�-鏁伴噺 - $("#goodDivw").click(function () { - if ($("#barw").val() == null || $("#barw").val() == "" || $("#barw").val() == undefined) { - layer.msg("璇峰厛閫夋嫨鍏ュ簱鍗�", { - icon: 2, - time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - }, function () { }); - } - }) - //閫変腑鍏ュ簱鍗曚簨浠� form.on('select(getbar)', function (data) { updateGoodList() setOrderGoods(); }); - //閫変腑鍏ュ簱鍗曚簨浠�-鏁伴噺 - form.on('select(getbarw)', function (data) { - updateGoodListw() - setOrderGoodsw(); - }); - + //閫変腑鐗╂枡浜嬩欢 form.on('select(goodSelect)', function (data) { setOrderGoods(); }); - //閫変腑鐗╂枡浜嬩欢-鏁伴噺 - form.on('select(goodSelectw)', function (data) { + //閫変腑鐗╂枡浜嬩欢-鏁伴噺 + form.on('select(goodSelect1)', function (data) { setOrderGoods(); }); - //缁戝畾鍒版墭鐩樹簨浠� form.on('submit(formBind)', function (data) { - console.log(isContinue); - 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 param = { - AsnNo: $("#bar").val(), - PalletNo: $("#STOCKCODE").val(), - AsnDetailId: parseInt($("#goodSelect").val()), - BoxNo: $("#BOXCODE").val(), - IsContinue: isContinue, - TailBoxNo: $("#BOXCODE2").val(), - Origin:"PDA" - } - //缁勭洏 - 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 () { - //鍥炶皟 - }); - } - }); + if(xianshiyemian == 0) + { + console.log(isContinue); + 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 param = { + AsnNo: $("#bar").val(), + PalletNo: $("#STOCKCODE").val(), + AsnDetailId: parseInt($("#goodSelect").val()), + BoxNo: $("#BOXCODE").val(), + IsContinue: isContinue, + TailBoxNo: $("#BOXCODE2").val(), + Origin:"PDA" + } + //缁勭洏 + 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 () { + //鍥炶皟 + }); + } + }); + } + 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()), //鐗╂枡鎵规 + SkuQty: parseInt($("#SkuQty").val()), //鐗╂枡鏁伴噺 + Origin:"PDA" + } + + 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 () { + //鍥炶皟 + }); + } + }); + } + return false; //闃绘琛ㄥ崟璺宠浆銆傚鏋滈渶瑕佽〃鍗曡烦杞紝鍘绘帀杩欐鍗冲彲銆� }); // 鏍规嵁鍏ュ簱鏄庣粏ID 鑾峰彇璇︾粏淇℃伅 function setOrderGoods() { - $("#ImportQuantity").val(""); - $("#Standard").val(""); - $("#ImportFactQuantity").val(""); + if (xianshiyemian == 0) + { + $("#ImportQuantity").val(""); + $("#Standard").val(""); + $("#ImportFactQuantity").val(""); - var param = { - Id: parseInt($("#goodSelect").val()) - }; + var param = { + Id: parseInt($("#goodSelect").val()) + }; - synData(IP + "/PdaAsn/GetArrivalNoticeDetail", param, 'post', function (res) { - console.log(JSON.stringify(res)) - if (res.code == 0 && res.data != null) { //鎴愬姛 - $("#ImportQuantity").val(res.data.Qty); - $("#Standard").val(res.data.Standard); - $("#ImportFactQuantity").val(res.data.FactQty + ""); - } - }); + synData(IP + "/PdaAsn/GetArrivalNoticeDetail", param, 'post', function (res) { + console.log(JSON.stringify(res)) + if (res.code == 0 && res.data != null) { //鎴愬姛 + $("#ImportQuantity").val(res.data.Qty); + $("#Standard").val(res.data.Standard); + $("#ImportFactQuantity").val(res.data.FactQty + ""); + } + }); + } + else if (xianshiyemian == 1) + { + $("#ImportQuantity1").val(""); + $("#Standard1").val(""); + $("#ImportFactQuantity1").val(""); + + var param = { + Id: parseInt($("#goodSelect1").val()) + }; + + synData(IP + "/PdaAsn/GetArrivalNoticeDetail", param, 'post', function (res) { + console.log(JSON.stringify(res)) + if (res.code == 0 && res.data != null) { //鎴愬姛 + $("#ImportQuantity1").val(res.data.Qty); + $("#Standard1").val(res.data.Standard); + $("#ImportFactQuantity1").val(res.data.FactQty + ""); + } + }); + } + } - // 鏍规嵁鍏ュ簱鏄庣粏ID 鑾峰彇璇︾粏淇℃伅-鏁伴噺 - function setOrderGoodsw() { - $("#ImportQuantity").val(""); - $("#Standard").val(""); - $("#ImportFactQuantity").val(""); - - var param = { - Id: parseInt($("#goodSelectw").val()) - }; - - synData(IP + "/PdaAsn/GetArrivalNoticeDetail", param, 'post', function (res) { - console.log(JSON.stringify(res)) - if (res.code == 0 && res.data != null) { //鎴愬姛 - $("#ImportQuantity").val(res.data.Qty); - $("#Standard").val(res.data.Standard); - $("#ImportFactQuantity").val(res.data.FactQty + ""); - } - }); - } - - // 缁戝畾鍏ュ簱鍗曚俊鎭� - function updateBillList(callback) { - var input = $('select[id="bar"]').next().find('.layui-select-title input') - var val = input.val() - $("#bar").empty() - $("#bar").append('<option value =>' + '</option>'); - form.render('select'); - - var param = { - Type: "0,1" - }; - sendData(IP + "/PdaAsn/GetArrivalNotices", 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>'); - } - form.render('select'); - - if (!val) { - $('#bar').siblings("div.layui-form-select").find('dl').find('.layui-select-tips').addClass('layui-this') - } else { - var sel = 'dd[lay-value=' + val + ']'; - $('#bar').siblings("div.layui-form-select").find('dl').find(sel).addClass('layui-this') - } - - callback(res.data) - } else { //涓嶆垚鍔� - // layer.msg(res.msg, { - // icon: 2, - // time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - // }, function() {}); - } - }); - } - + var asnDetails = ""; - // 缁戝畾鍏ュ簱鍗曠墿鏂欏強鎵规 + /* 缁戝畾鍏ュ簱鍗曠墿鏂欏強鎵规 */ function updateGoodList() { - console.log("aaaa"); - var input = $('select[id="goodSelect"]').next().find('.layui-select-title input') - var val = input.val() + if (xianshiyemian == 0) + { + console.log("aaaa"); + var input = $('select[id="goodSelect"]').next().find('.layui-select-title input') + var val = input.val() - $("#goodSelect").empty() - $("#goodSelect").append('<option value =>' + '</option>'); + $("#goodSelect").empty() + $("#goodSelect").append('<option value =>' + '</option>'); - var param = { - AsnNo: $("#bar").val(), - }; - synData(IP + "/PdaAsn/GetArrivalNoticeDetails", param, 'post', function (res) { - console.log("鍑哄簱鍙o細" + JSON.stringify(res)) - if (res.code == 0) { //鎴愬姛 - asnDetails = res.data; - for (var i = 0; i < res.data.length; i++) { - if (i == 0) { - $("#goodSelect").append('<option value =' + res.data[i].Id + ' selected>' + res.data[i] - .SkuName + "-" + res.data[i].LotNo + - '</option>'); - } else { - $("#goodSelect").append('<option value =' + res.data[i].Id + '>' + res.data[i] - .SkuName + "-" + res.data[i].LotNo + - '</option>'); - } + var param = { + AsnNo: $("#bar").val(), + }; + synData(IP + "/PdaAsn/GetArrivalNoticeDetails", param, 'post', function (res) { + console.log("鍑哄簱鍙o細" + JSON.stringify(res)) + if (res.code == 0) { //鎴愬姛 + asnDetails = res.data; + for (var i = 0; i < res.data.length; i++) { + if (i == 0) { + $("#goodSelect").append('<option value =' + res.data[i].Id + ' selected>' + res.data[i] + .SkuName + "-" + res.data[i].LotNo + + '</option>'); + } else { + $("#goodSelect").append('<option value =' + res.data[i].Id + '>' + res.data[i] + .SkuName + "-" + res.data[i].LotNo + + '</option>'); + } - } - form.render('select'); + } + 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 { - } - }); + 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) + { + 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>'); + + 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; + for (var i = 0; i < res.data.length; i++) { + if (i == 0) { + $("#goodSelect1").append('<option value =' + res.data[i].Id + ' selected>' + res.data[i] + .SkuName + "-" + res.data[i].LotNo + + '</option>'); + } else { + $("#goodSelect1").append('<option value =' + res.data[i].Id + '>' + 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 { + } + }); + } + } - // 缁戝畾鍏ュ簱鍗曠墿鏂欏強鎵规-鏁伴噺 - function updateGoodList() { - console.log("aaaa"); - var input = $('select[id="goodSelectw"]').next().find('.layui-select-title input') - var val = input.val() - - $("#goodSelectw").empty() - $("#goodSelectw").append('<option value =>' + '</option>'); - - var param = { - AsnNo: $("#bar").val(), - }; - synData(IP + "/PdaAsn/GetArrivalNoticeDetails", param, 'post', function (res) { - console.log("鍑哄簱鍙o細" + JSON.stringify(res)) - if (res.code == 0) { //鎴愬姛 - asnDetails = res.data; - for (var i = 0; i < res.data.length; i++) { - if (i == 0) { - $("#goodSelectw").append('<option value =' + res.data[i].Id + ' selected>' + res.data[i] - .SkuName + "-" + res.data[i].LotNo + - '</option>'); - } else { - $("#goodSelectw").append('<option value =' + res.data[i].Id + '>' + res.data[i] - .SkuName + "-" + res.data[i].LotNo + - '</option>'); - } - - } - form.render('select'); - - if (!val) { - $('#goodSelectw').siblings("div.layui-form-select").find('dl').find('.layui-select-tips').addClass('layui-this') - } else { - var sel = 'dd[lay-value=' + val + ']'; - $('#goodSelectw').siblings("div.layui-form-select").find('dl').find(sel).addClass('layui-this') - } - } else { - } - }); - } - + // 娓叉煋绠辩爜淇℃伅 function refreshTable() { - //鍏堟竻绌轰竴涓嬬瀛愬垪琛� - let trs = $("#tableBoxList tr") - let len = trs.length + if (xianshiyemian == 0) + { - for (i = len - 1; i >= 2; i--) { - trs[i].remove(); - } + //鍏堟竻绌轰竴涓嬬瀛愬垪琛� + let trs = $("#tableBoxList tr") + let len = trs.length - //璁剧疆鎵樼洏鍙� - $("#palletCode").val($.cookie('stockCode')) + for (i = len - 1; i >= 2; i--) { + trs[i].remove(); + } - 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 () { + //璁剧疆鎵樼洏鍙� + $("#palletCode").val($.cookie('stockCode')) - var param = { - Id: Id, - }; - sendData(IP + "/PdaAsn/DelBoxInfo", 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 - } + 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 = { + Id: Id, + }; + sendData(IP + "/PdaAsn/DelBoxInfo", 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 + } - } else { //涓嶆垚鍔� - layer.msg("鏃犳暟鎹�", { - icon: 2, - time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - }, function () { }); - $("#boxNum").val(0) - } - }); + //璁剧疆鍒嗛〉 + setPages(1, list.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/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("#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].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 = { + Id: Id, + }; + sendData(IP + "/PdaAsn/DelBoxInfo", 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, list.length) + + } else { //涓嶆垚鍔� + layer.msg("鏃犳暟鎹�", { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }, function () { }); + $("#boxNum").val(0) + setPages(1, 0) + } + }); + } + } // 鍒ゆ柇鎵樼洏鐮佹槸鍚﹀彲鐢� function checkPalletStat() { - var param = { - "PalletNo": $("#STOCKCODE").val() - } - sendData(IP + "/PdaAsn/IsEnablePalletNo", param, 'post', function (res) { - if (res.code == 0) { + 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(); + $.cookie('stockCode', $("#STOCKCODE").val()); + refreshTable() + $("#BOXCODE").focus(); - } else { - layer.msg(res.msg, { - icon: 2, - time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - }, function () { }); - } - }); + } 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 checkPalletStatw() { - var param = { - "PalletNo": $("#STOCKCODEw").val() - } - sendData(IP + "/PdaAsn/IsEnablePalletNo", param, 'post', function (res) { - if (res.code == 0) { - - $.cookie('STOCKCODEw', $("#STOCKCODEw").val()); - refreshTable() - // $("#BOXCODE").focus(); - - } else { - layer.msg(res.msg, { - icon: 2, - time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - }, function () { }); - } - }); - } + function checkBoxInfo() { var param = { @@ -886,7 +1175,198 @@ } + + /* 鍒嗛〉 */ + //璁剧疆鍒嗛〉 + function setPages(pageIndex, boxNum){ + + if (xianshiyemian == 0) + { + 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) + } + else if (xianshiyemian == 1) + { + if(boxNum <= 0){ + //鍒楄〃涓虹┖锛岄殣钘忓垎椤甸〉鐮� + $("#tableBoxPages1").hide() + return + } + + let pageNum = Math.floor(boxNum / 10); + if(boxNum % 10 > 0){ + pageNum += 1; + } + //console.log("pageNum is " + pageNum) + + $("#tableBoxPages1").find("tr").remove() + let table = $("#tableBoxPages1") + $("<tr></tr>").appendTo("#tableBoxPages1") + + // let newTr = table.append("<tr></tr>") + // newTr.append("<td class='page-prev'>涓婁竴椤�</td>") + $("<td id='prevPage' class='page-prev'>涓婁竴椤�</td>").appendTo("#tableBoxPages1 tr") + $("#tableBoxPages1 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("#tableBoxPages1 tr") + } + // newTr.append("<td class='page-next'>涓嬩竴椤�</td>") + $("<td id='nextPage' class='page-next'>涓嬩竴椤�</td>").appendTo("#tableBoxPages1 tr") + $("#tableBoxPages1 tr").eq(0).find("td[id^='nextPage']").click(function(){ + onClickNextPage() + }) + // pages.show() + $("#tableBoxPages1").show() + + setCurPage(1) + } + + } + + //璁剧疆褰撳墠鍒嗛〉 + function setCurPage(pageIndex){ + if (xianshiyemian == 0) + { + 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 + } + + 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") + } + } + } + else if (xianshiyemian == 1) + { + let totalTrNum = $("#tableBoxList1 tr").length + if(totalTrNum <= 2 ){ + 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 + } + + let trs = $("#tableBoxList1 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 = $("#tableBoxPages1 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") + } + } + } + + } + /*鈥斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺��*/ form.on('switch(IsLianXu)', function (obj) { if (obj.elem.checked) { diff --git a/Wms/Model/ModelDto/BllAsnDto/LabelBoxDto.cs b/Wms/Model/ModelDto/BllAsnDto/LabelBoxDto.cs index 716c14e..83c5d8c 100644 --- a/Wms/Model/ModelDto/BllAsnDto/LabelBoxDto.cs +++ b/Wms/Model/ModelDto/BllAsnDto/LabelBoxDto.cs @@ -18,6 +18,9 @@ public decimal Qty { get; set; } public string SkuNo { get; set; } public string SkuName { get; set; } + public string Standard { get; set; } + public string PackageStandard { get; set; } + public DateTime? StoreTime { get; set; } public string LotNo { get; set; } public string LotText { get; set; } public string SupplierName { get; set; } @@ -41,5 +44,12 @@ public DateTime CreateTime { get; set; } public DateTime? UpdateTime { get; set; } + /// <summary> + /// 鐢熸垚涓�缁寸爜鍥剧墖璺緞 + /// </summary> + public string ImgStr { get; set; } } + + + } diff --git a/Wms/Model/ModelVm/PdaVm/PdaAsnVm.cs b/Wms/Model/ModelVm/PdaVm/PdaAsnVm.cs index 3f9b194..b57c800 100644 --- a/Wms/Model/ModelVm/PdaVm/PdaAsnVm.cs +++ b/Wms/Model/ModelVm/PdaVm/PdaAsnVm.cs @@ -60,5 +60,10 @@ /// </summary> public string TailBoxNo01 { get; set; } + /// <summary> + /// Desc:鐗╂枡鏁伴噺 + /// </summary> + public int SkuQty { get; set; } + } } diff --git a/Wms/WMS.BLL/BllAsnServer/BllLabelBoxNoServer.cs b/Wms/WMS.BLL/BllAsnServer/BllLabelBoxNoServer.cs index 8309e3f..276afd5 100644 --- a/Wms/WMS.BLL/BllAsnServer/BllLabelBoxNoServer.cs +++ b/Wms/WMS.BLL/BllAsnServer/BllLabelBoxNoServer.cs @@ -1,10 +1,12 @@ 锘縰sing System; using System.Collections.Generic; +using System.Linq; using System.Linq.Expressions; using System.Text; using Model.ModelDto.BllAsnDto; using Model.ModelVm.BllAsnVm; using SqlSugar; +using Utility.Tools; using WMS.DAL; using WMS.Entity.BllAsnEntity; using WMS.Entity.Context; @@ -47,6 +49,9 @@ Qty = a.Qty, SkuNo = a.SkuNo, SkuName = a.SkuName, + Standard = a.Standard, + PackageStandard = a.PackageStandard, + StoreTime = a.StoreTime, LotNo = a.LotNo, LotText = a.LotText, SupplierName = a.SupplierName, @@ -79,5 +84,625 @@ throw new Exception(e.Message); } } + + //鑾峰彇鏍囩妯℃澘鏍规嵁鍏ュ簱鍗曟槑缁咺D + public LabelBoxDto GetLabelBoxModel(int id) + { + try + { + var asnDetail = Db.Queryable<BllArrivalNoticeDetail>().First(m => m.Id == id && m.IsDel == "0"); + if (asnDetail == null) + { + throw new Exception("鏈煡璇㈠埌鍗曟嵁鏄庣粏淇℃伅锛岃鏍稿疄"); + } + + var packInfo = Db.Queryable<SysPackag>().First(m => m.IsDel == "0" && m.PackagNo == asnDetail.PackagNo); + if (packInfo == null) + { + throw new Exception("鏈煡璇㈠埌鍗曟嵁鏄庣粏涓殑鐗╂枡鍖呰淇℃伅"); + } + + var str = ""; + + if (!string.IsNullOrWhiteSpace(packInfo.L1Name)) + { + str += packInfo.L1Num + "/" + packInfo.L1Name; + } + if (!string.IsNullOrWhiteSpace(packInfo.L2Name)) + { + str += "-" + packInfo.L2Num + "/" + packInfo.L2Name; + } + if (!string.IsNullOrWhiteSpace(packInfo.L3Name)) + { + str += "-" + packInfo.L3Num + "/" + packInfo.L3Name; + } + if (!string.IsNullOrWhiteSpace(packInfo.L4Name)) + { + str += "-" + packInfo.L4Num + "/" + packInfo.L4Name; + } + if (!string.IsNullOrWhiteSpace(packInfo.L5Name)) + { + str += "-" + packInfo.L5Num + "/" + packInfo.L5Name; + } + + + var data = new LabelBoxDto(); + data.SkuNo = asnDetail.SkuNo; + data.SkuName = asnDetail.SkuName; + data.Standard = asnDetail.Standard; + data.SupplierLot = asnDetail.SupplierLot; + data.PackageStandard = str; + return data; + } + catch (Exception e) + { + throw new Exception(e.Message); + } + } + + //鑾峰彇鏍囩淇℃伅(鐢熸垚鏍囩) + public List<LabelBoxDto> AddLabelBoxReturn(int imId, string isReset,decimal arriveQty, string skuName, string standard, string packStandard, string skuNo, + string supplierLot, string productionTime, string expirationTime, string storeTime, int userId) + { + try + { + #region 蹇呭~楠岃瘉 + + //if (string.IsNullOrWhiteSpace(productionDate)) + //{ + // throw new Exception("鐢熶骇鏃ユ湡闇�蹇呭~锛屼笉鑳戒负绌�"); + //} + + //var twoSeletOne = true;//鏈夋晥鏈熴�佸楠屾湡浜岄�変竴 + //if (string.IsNullOrWhiteSpace(expirationTime)) + //{ + // twoSeletOne = false; + //} + //if (string.IsNullOrWhiteSpace(inspectTime)) + //{ + // twoSeletOne = false; + //} + + //if (twoSeletOne) + //{ + // throw new Exception("鏈夋晥鏈熴�佸楠屾湡鏈�濂藉~鍐欎竴涓�"); + //} + //if (string.IsNullOrWhiteSpace(supplierName)) + //{ + // throw new Exception("鐢熶骇鍘傚闇�蹇呭~锛屼笉鑳戒负绌�"); + //} + //if (string.IsNullOrWhiteSpace(supplierLot)) + //{ + // throw new Exception("鍘傚鎵瑰彿闇�蹇呭~锛屼笉鑳戒负绌�"); + //} + + //if (bQNum <= 0) + //{ + // throw new Exception("澶栫鏍囩鏁伴噺涓嶈兘涓虹┖鎴栧皬浜庣瓑浜�0"); + //} + + #endregion + + #region 鍗曟嵁銆佺墿鏂欍�佸寘瑁呫�佹爣绛句俊鎭幏鍙� + + var asnList = Db.Queryable<BllArrivalNoticeDetail>().First(m => m.Id == imId && m.IsDel == "0"); + if (asnList == null) + { + throw new Exception("鏈煡璇㈠埌鍗曟嵁鏄庣粏淇℃伅"); + } + var asn = Db.Queryable<BllArrivalNotice>().First(m => m.ASNNo == asnList.ASNNo && m.IsDel == "0"); + if (asn == null) + { + throw new Exception("鏈煡璇㈠埌鍗曟嵁淇℃伅"); + } + //鐗╂枡 + var sku = Db.Queryable<SysMaterials>().First(m => m.IsDel == "0" && m.SkuNo == asnList.SkuNo); + var pack = Db.Queryable<SysPackag>().First(m => m.IsDel == "0" && m.PackagNo == asnList.PackagNo); + if (pack == null) + { + throw new Exception("鏈煡璇㈠埌褰撳墠鍗曟嵁涓墿鏂欑殑鍖呰淇℃伅"); + } + //鏍囩琛� + var label = Db.Queryable<BllLabelBoxNo>().Where(m => m.IsDel == "0" && m.ASNDetailNo == imId).ToList(); + + + #endregion + + #region 鍖呰鏌ヨ + + var bNum = 0;//绠辩墿鍝佹暟閲� + var zNum = 0;//鏀墿鍝佹暟閲� + var packLevel = 0; + var isGo = true; + + if (pack.L5Num.HasValue) + { + if (pack.L5Name != "鎵�") + { + isGo = false; + packLevel = 5; + bNum = Convert.ToInt32(pack.L5Num); + } + } + if (pack.L4Num.HasValue && isGo) + { + if (pack.L4Name != "鎵�") + { + isGo = false; + packLevel = 4; + bNum = Convert.ToInt32(pack.L4Num); + } + } + if (pack.L3Num.HasValue && isGo) + { + if (pack.L4Name != "鎵�") + { + isGo = false; + packLevel = 3; + bNum = Convert.ToInt32(pack.L3Num); + } + } + if (pack.L2Num.HasValue) + { + packLevel = 2; + bNum = Convert.ToInt32(pack.L2Num); + + } + if (pack.L1Num.HasValue) + { + if (packLevel == 0) + { + packLevel = 1; + bNum = Convert.ToInt32(pack.L1Num); + } + zNum = Convert.ToInt32(pack.L1Num); + } + + if (packLevel <= 1)//鍖呰绛夌骇灏忎簬1锛屾寜鐓�1绾ф爣绛炬墦鍗� + { + packLevel = 1; + } + + #endregion + + if (packLevel == 1) + { + #region 涓�绾у寘瑁� + + // 鏍规嵁鐢ㄦ埛杈撳叆鐨勭鏁伴噺璁$畻闇�瑕佺殑鏉$爜鏁� + var labQty = label.Sum(m => m.Qty); + var qty = asnList.Qty - labQty;//褰撳墠鍗曟嵁鍓╀綑闇�瑕佹墦鍗扮殑鐗╂枡鏁伴噺(涓嶆槸鏍囩鏁伴噺) + if (qty <= 0) + { + throw new Exception("褰撳墠鍗曟嵁鐗╂枡鏍囩宸叉墦鍗板畬姣曪紝濡傛湁闇�瑕佽琛ユ墦"); + } + + #region 鍒拌揣鏁伴噺 + + if (arriveQty - qty > 0) + { + throw new Exception("鍒拌揣鏁伴噺澶т簬鏈墦鏍囩鏁伴噺锛岃閲嶆柊杈撳叆鍒拌揣鏁伴噺骞舵牳瀹�!"); + } + else + { + qty = arriveQty; + } + + #endregion + + int labelNum = 1; //鐢熶骇鏉$爜鏁伴噺 + if (zNum > 0) + { + labelNum = int.Parse(Math.Ceiling(qty / zNum).ToString());//鏍囩鏁伴噺 + } + else + { + throw new Exception("褰撳墠鍗曟嵁鐗╂枡鏄竴绾у寘瑁咃紝鏈煡璇㈠埌涓�绾у寘瑁呬俊鎭�"); + } + + #region 鑾峰彇/鐢熸垚鎵规鍙� + + string maxLotNoStr = ""; //鎵规鍙� + string maxBoxCode = ""; //绠辩爜鍙� + // 鐢熸垚鑷紪鎵瑰彿 + string toDayTime = DateTime.Now.ToString("yyyyMMdd"); + var diJiJian = 0; + + var maxLotNo = label.Max(a => a.LotNo); + var maxBoxNo = label.Max(a => a.BoxNo); + if (isReset == "0") + { + + maxLotNoStr = maxLotNo; + maxBoxCode = maxBoxNo; + if (string.IsNullOrWhiteSpace(maxLotNoStr)) + { + maxLotNoStr = toDayTime.Substring(2, 6) + "0001"; + } + } + else + { + var maxCode = Db.Queryable<BllLabelBoxNo>().Max(a => a.LotNo); // 鑾峰彇浠婂ぉ鏈�澶ф壒娆″彿 + if (string.IsNullOrWhiteSpace(maxCode)) + { + maxLotNoStr = toDayTime.Substring(2, 6) + "0001"; + } + else + { + var lotStr = maxCode.Substring(0, 6); + var timeStr = toDayTime.Substring(2, 6); + if (lotStr == timeStr) + { + maxLotNoStr = toDayTime.Substring(2, 6) + (int.Parse(maxCode.Substring(6, 4)) + 1).ToString().PadLeft(4, '0'); + } + else + { + maxLotNoStr = timeStr + "0001"; + } + + } + } + + #endregion + + var modelList = new List<LabelBoxDto>(); + + for (int i = 1; i <= labelNum; i++) + { + // 鐗╂枡鏉$爜淇℃伅璧嬪�� + LabelBoxDto model = new LabelBoxDto(); + model.AsnDetailNo = imId; + model.SkuNo = asnList.SkuNo; + model.SkuName = asnList.SkuName; + + model.SupplierName = asn.CustomerName; // 渚涘簲鍟� + + model.Standard = asnList.Standard; // 瑙勬牸 + model.PackageStandard = packStandard; + model.SupplierLot = supplierLot; // 鍘傚鎵瑰彿 + model.LotNo = maxLotNoStr; //鎵规 + + model.ProductionTime = DateTime.Parse(productionTime); // 鐢熶骇鏃ユ湡 + model.StoreTime = DateTime.Parse(storeTime); // 鍌ㄥ瓨鏈熻嚦 + model.ExpirationTime = DateTime.Parse(expirationTime); // 鏈夋晥鏈熻嚦/璐瓨鏈� + if (i == labelNum) + { + // 鏈�鍚庝竴涓潯鐮� + var s = zNum * (i - 1); + if (zNum > qty - s) + { + model.Qty = qty - s;// 鏁伴噺 + } + else + { + model.Qty = zNum;// 鏁伴噺 + } + } + else + { + model.Qty = zNum; // 鏁伴噺 + } + + + if (maxBoxCode == "") + { + var str = model.LotNo + "000001"; + model.BoxNo = str; // 鏀彿 鎵瑰彿+ 娴佹按 2302010001000001 + maxBoxCode = model.BoxNo; + } + else + { + model.BoxNo = maxBoxCode.Substring(0, 10) + (int.Parse(maxBoxCode.Substring(10, 6)) + 1).ToString().PadLeft(6, '0'); + maxBoxCode = model.BoxNo; + } + model.ImgStr = BarcodeHelper.GetCodeBarBase64(model.BoxNo, 80, 50); + + // 娣诲姞鍒發ist闆嗗悎 + modelList.Add(model); + + // 灏嗘潯鐮佷繚瀛樺埌鍘熸枡鏉$爜琛� + var labelModel = new BllLabelBoxNo() + { + ASNNo = asnList.ASNNo, + ASNDetailNo = asnList.Id, + BoxNo = model.BoxNo, + ParentBoxNo = "", + Qty = model.Qty, + SkuNo = model.SkuNo, + SkuName = model.SkuName, + Standard = model.Standard, + PackageStandard = model.PackageStandard, + + LotNo = model.LotNo, + SupplierName = asn.CustomerName, + ProductionTime = model.ProductionTime, + SupplierLot = model.SupplierLot, + StoreTime = model.StoreTime, + ExpirationTime = model.ExpirationTime, + IsUse = "0", + Level = "1", + + CreateUser = userId, + CreateTime = DateTime.Now, + }; + + Db.Insertable(labelModel).ExecuteCommand(); + + } + + #endregion + } + else //(packLevel == 2) + { + #region 浜岀骇鍖呰 + + // 鏍规嵁鐢ㄦ埛杈撳叆鐨勭鏁伴噺璁$畻闇�瑕佺殑鏉$爜鏁� + var labQty = label.Sum(m => m.Qty); + var qty2 = asnList.Qty - labQty; + if (qty2 <= 0) + { + throw new Exception("褰撳墠鍗曟嵁鐗╂枡鏍囩宸叉墦鍗板畬姣曪紝濡傛湁闇�瑕佽琛ユ墦"); + } + + #region 澧炲姞鍒拌揣鏁伴噺 + + if (arriveQty - qty2 > 0) + { + throw new Exception("鍒拌揣鏁伴噺澶т簬鏈墦鏍囩鏁伴噺锛岃閲嶆柊杈撳叆鍒拌揣鏁伴噺!"); + } + else + { + qty2 = arriveQty; + } + #endregion + + int labelNum2 = 1; //鐢熶骇绠辨潯鐮佹暟閲� + + labelNum2 = int.Parse(Math.Ceiling(qty2 / bNum).ToString()); + + + + var ss = bNum / zNum; //姣忕鏀爣绛炬暟閲� + var labelNumZ2 = Math.Ceiling((decimal)ss); + + #region 鑾峰彇/鐢熸垚鎵规鍙� + + string maxCodestr2 = ""; //鎵规 + string maxboxcode2 = ""; //绠辩爜 + string maxboxcode3 = ""; //鏀爜 + // 鐢熸垚鑷紪鎵瑰彿 + string toDayTime2 = DateTime.Now.ToString("yyyyMMdd"); + if (isReset == "0") + { + var maxCode = label.Max(a => a.LotNo); + var boxCode1 = label.Where(m=>m.Level == "1").Max(a => a.BoxNo);//绠卞彿 + var boxCode2 = label.Where(m => m.Level == "2").Max(a => a.BoxNo);//鏀彿 + maxCodestr2 = maxCode; + maxboxcode2 = boxCode1; + maxboxcode3 = boxCode2; + if (string.IsNullOrWhiteSpace(maxCodestr2)) + { + maxCodestr2 = toDayTime2.Substring(2, 6) + "0001"; + } + } + else + { + var maxCode = Db.Queryable<BllLabelBoxNo>().Max(a => a.LotNo); // 鑾峰彇浠婂ぉ鏈�澶ф壒娆″彿 + if (string.IsNullOrWhiteSpace(maxCode)) + { + maxCodestr2 = toDayTime2.Substring(2, 6) + "0001"; + } + else + { + var lotStr = maxCode.Substring(0, 6); + var timeStr = toDayTime2.Substring(2, 6); + if (lotStr == timeStr) + { + maxCodestr2 = timeStr + (int.Parse(maxCode.Substring(6, 4)) + 1).ToString().PadLeft(4, '0'); + } + else + { + maxCodestr2 = timeStr + "0001"; + } + + } + } + + #endregion + + var modelList = new List<LabelBoxDto>(); + + for (int i = 1; i <= labelNum2; i++)//绠辩爜鏍囩 + { + // 鐗╂枡鏉$爜淇℃伅璧嬪�� + LabelBoxDto model = new LabelBoxDto(); + model.AsnDetailNo = imId; + model.SkuNo = asnList.SkuNo; + model.SkuName = asnList.SkuName; + + model.Standard = asnList.Standard; // 瑙勬牸 + model.PackageStandard = packStandard; + + model.SupplierLot = supplierLot; // 鍘傚鎵瑰彿 + model.LotNo = maxCodestr2; //鎵规 + + model.ProductionTime = DateTime.Parse(productionTime); // 鐢熶骇鏃ユ湡 + model.StoreTime = DateTime.Parse(storeTime); // 鍌ㄥ瓨鏈熻嚦 + model.ExpirationTime = DateTime.Parse(expirationTime); // 鏈夋晥鏈熻嚦/璐瓨鏈� + if (i == labelNum2) + { + // 鏈�鍚庝竴涓潯鐮� + var s = bNum * (i - 1); + if (bNum > qty2 - s) + { + model.Qty = qty2 - s;// 鏁伴噺 + } + else + { + model.Qty = bNum;// 鏁伴噺 + } + } + else + { + model.Qty = bNum; // 鏁伴噺 + } + + if (maxboxcode2 == "") + { + maxboxcode2 = model.LotNo +"000001"; + model.BoxNo = maxboxcode2; // 绠卞彿 鎵瑰彿+绗嚑绠� + maxboxcode2 = model.BoxNo; + } + else + { + model.BoxNo = maxboxcode2.Substring(0, 10) + (int.Parse(maxboxcode2.Substring(10, 6)) + 1).ToString().PadLeft(6, '0'); + maxboxcode2 = model.BoxNo; + } + model.ImgStr = BarcodeHelper.GetCodeBarBase64(model.BoxNo, 80, 50); + + // 娣诲姞鍒發ist闆嗗悎 + modelList.Add(model); + + if (i == labelNum2) + { + var isGo2 = false; + var sl = 0; + for (int j = 1; j <= labelNumZ2; j++) + { + if (isGo2) + { + break; + } + var d = zNum; + if (i == labelNum2) + { + var s = bNum * (i - 1); + var s2 = zNum * (j - 1); + if (zNum >= qty2 - s - s2) + { + d = (int)(qty2 - s - s2); // 鏁伴噺 + isGo2 = true; + } + } + sl++; + } + labelNumZ2 = sl; + } + + for (int j = 1; j <= labelNumZ2; j++)//鏈�灏忓崟浣嶆爣绛� + { + if (isGo) + { + break; + } + var d = zNum; + if (i == labelNum2) + { + var s = bNum * (i - 1); + var s2 = zNum * (j - 1); + if (zNum >= qty2 - s - s2) + { + d = (int)(qty2 - s - s2); // 鏁伴噺 + isGo = true; + } + } + //// 鐗╂枡鏉$爜淇℃伅璧嬪�� + //LabelPrint5Model model2 = new LabelPrint5Model(); + //model2.ImportId = imId; + //model2.OuterBillCode = list.OuterBillCode; + //model2.ImportBillCode = list.ImportBillCode; + //model2.SkuNo = list.GoodsCode; + //model2.SkuName = list.GoodsName; + //model2.QtyCount = (int)labelNumZ2; // 鎬讳欢鏁�(int)labelNumZ2 + + //model2.SupplierName = supplierName; // 鐢熶骇鍘傚 + //model2.ProductionDate = productionDate; // 鐢熶骇鏃ユ湡 + //model2.SapSkuNo = sapNo; // SAP浠g爜 + //model2.Standard = good.GoodsStandard; // 瑙勬牸 + //model2.SupplierLot = supplierLot; // 鍘傚鎵瑰彿 + + //model2.LotNo = maxCodestr2; //鎵规 + + + //model2.InspectTime = inspectTime; // 澶嶉獙鏈熻嚦 + //model2.ExpirationTime = expirationTime; // 鏈夋晥鏈熻嚦/璐瓨鏈� + //model2.ExpirationType = good.GoodsTemp; // 璐瓨鏉′欢 + //model2.Qty = d; // 鏁伴噺 + + //model2.QtyOrd = j; // 绗嚑浠� + //if (maxboxcode3 == "") + //{ + // var str = mesGood.PadRight(16, ' ') + model.LotNo.PadRight(12, ' ') + "0001"; + // model2.BoxCode = str; // 鏀彿 鎵瑰彿+绗嚑绠� + // maxboxcode3 = model2.BoxCode; + //} + //else + //{ + // model2.BoxCode = maxboxcode3.Substring(0, 28) + (int.Parse(maxboxcode3.Substring(28, 4)) + 1).ToString().PadLeft(4, '0'); + // maxboxcode3 = model2.BoxCode; + //} + + //model2.imageStr = Utility.Extra.BarcodeHelper.GetQrCodeBase64(model2.BoxCode, 85, 85); + //// 娣诲姞鍒發ist闆嗗悎 + + //if (printModel.Count(m => m.BoxCode.Length > 17) <= 100)//鎺掗櫎寰呯鐮佸垽鏂敮鐮佹槸鍚﹀皬浜�100 + //{ + // printModel.Add(model2); + //} + //var guid = Guid.NewGuid().ToString("N"); + //// 灏嗘潯鐮佷繚瀛樺埌鍘熸枡鏉$爜琛� + //var LabelModel2 = new LabelPrint + //{ + // LabelID = guid, + // LabelStream = model.BoxCode, + // BoxCode1 = model2.BoxCode, + // GoodsCode = model2.SkuNo, + // GoodsName = model2.SkuName, + // GoodsStandard = model2.Standard, + // ImportLotNo = model2.LotNo, + // SupplierName = model2.SupplierName, + // ImportId = model2.ImportId, + // OuterBillCode = model2.OuterBillCode, + // ImportBillCode = model2.ImportBillCode, + // ProductionDate = model2.ProductionDate, + // SapSkuNo = model2.SapSkuNo, + // Qty = model2.Qty, + // SupplierLot = model2.SupplierLot, + // InspectTime = model2.InspectTime, + // ExpirationTime = model2.ExpirationTime, + // QtyCount = model2.QtyCount, + // QtyOrd = model2.QtyOrd, + // ExpirationType = model2.ExpirationType, + // BoxNum = bNum,//model.Qty, + + // BulkTank = model.Qty == bNum ? 0 : 1,//闆跺ご绠� + // BulkCase = 0,//闆跺ご鐩� + + // CreateUser = createUser, + // CreateTime = DateTime.Now, + // IsUse = 0 + //}; + + //DataContext.LabelPrint.InsertOnSubmit(LabelModel2); + } + + + } + + #endregion + } + + //return printModel; + + + throw new NotImplementedException(); + } + catch (Exception e) + { + throw new Exception(e.Message); + } + } + + } } diff --git a/Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs b/Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs index fc46b71..385819f 100644 --- a/Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs +++ b/Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs @@ -132,7 +132,7 @@ public List<BoxInfoDto> GetBoxInfos(BoxInfoVm model) { try - { + { string sqlString = string.Empty; if (model.IsHuiKu == 0) { @@ -517,7 +517,7 @@ #region 鏄惁鍥炴祦鍏ュ簱 int iscount = 0; //搴撳瓨鏄庣粏淇℃伅 - var stockDetail = Db.Queryable<DataStockDetail>().Where(a => a.IsDel == "0" && a.PalletNo == model.PalletNo).ToList(); + var stockDetail = Db.Queryable<DataStockDetail>().Where(a => a.IsDel == "0" && a.PalletNo == model.PalletNo).ToList(); //楠岃瘉搴撳瓨鏄惁鎷ユ湁璇ユ墭淇℃伅 if (stockDetail != null && stockDetail.Count > 0) { @@ -635,7 +635,7 @@ strMsg = "-1:绠辩爜淇℃伅涓嶅瓨鍦紝璇锋牳鏌�!"; return strMsg; } - else + else { // 鏀瑰彉绠辨敮鍏崇郴琛ㄧ姸鎬侊細宸插叆搴� sqlString = $"Update BllBoxInfo set Status = '2' where PalletNo = '{model.PalletNo}' and ASNNo = '{model.ASNNo}' and Status = '1'"; @@ -644,7 +644,7 @@ pallQty = boxinfo2.Sum(w => w.Qty); //鍏ュ簱鍗曟槑缁嗗畬鎴愭暟閲忓鍔� noticeItem.CompleteQty += pallQty; - } + } //鍒ゆ柇鍏ュ簱鏁伴噺澧炲姞鍚庢槸鍚﹀ぇ浜庣瓑浜庡崟鎹暟閲� if (noticeItem.CompleteQty >= noticeItem.Qty) { @@ -703,7 +703,7 @@ sqlString = "select sum(qty) from BllBoxInfo where isdel = 0 and "; sqlString += $"BindNo = '{palletbindInfo.Id}'"; int inspectQty = Db.Ado.GetInt(sqlString); - + // 娣诲姞搴撳瓨鏄庣粏琛� detailModel = new DataStockDetail() { @@ -1109,7 +1109,7 @@ try { //鍏ュ簱涓� - var aSNNoList= Db.Ado.SqlQuery<string>($"SELECT DISTINCT ASNNo from BllPalletBind where IsDel=0 and Status=0 and PalletNo='{palletNo}' ").ToList(); + var aSNNoList = Db.Ado.SqlQuery<string>($"SELECT DISTINCT ASNNo from BllPalletBind where IsDel=0 and Status=0 and PalletNo='{palletNo}' ").ToList(); if (aSNNoList.Count <= 0) { //搴撳鎵樼洏鎴栧钩搴撴墭鐩� @@ -1166,7 +1166,7 @@ //鎷兼墭鍏ュ簱 public void CompleteInStockLing(PdaLingAsnVm model, int userId) { - try + try { if (string.IsNullOrWhiteSpace(model.AsnNo)) { @@ -1203,10 +1203,10 @@ foreach (var item in boxinfo) { if (!string.IsNullOrEmpty(item.PalletNo)) - { + { throw new Exception("-1:璇ョ鐮佸凡缁戝畾鍏朵粬鎵樼洏锛岃鍏堣В缁戞墭鐩�!"); } - bNum += item.Qty; + bNum += item.Qty; } if (bNum == boxinfo[0].FullQty) { @@ -1267,7 +1267,7 @@ //淇敼鍏ュ簱鍗曟�诲崟淇℃伅 arrival.Status = "2"; arrival.CompleteTime = serverTime; - arrival.UpdateUser =userId; + arrival.UpdateUser = userId; arrival.UpdateTime = serverTime; Db.Updateable(arrival).ExecuteCommand(); } @@ -1373,7 +1373,7 @@ #region 搴撳瓨鏄庣粏琛� var boxinfoItem = boxinfo.First(); - var detailModel = Db.Queryable<DataStockDetail>() .First(it => it.PalletNo == model.PalletNo && it.LotNo == arrivalnotice.LotNo + var detailModel = Db.Queryable<DataStockDetail>().First(it => it.PalletNo == model.PalletNo && it.LotNo == arrivalnotice.LotNo && it.SkuNo == arrivalnotice.SkuNo && it.Standard == arrivalnotice.Standard && it.IsDel == "0"); var stId = 0; if (detailModel == null || detailModel.Id == 0) @@ -1537,19 +1537,24 @@ { throw new Exception("-1:鎵樼洏鍙蜂笉鍙负绌�!"); } - if (string.IsNullOrEmpty(model.BoxNo)) + //鍒ゆ柇鐗╂枡鏁伴噺鏄惁涓�0 涓�0鍒ゆ柇绠辩爜淇℃伅 涓嶄负0缁х画 + if (model.SkuQty == 0) { - throw new Exception("-1:绠辩爜淇℃伅涓嶅彲涓虹┖!"); - } - - if (model.IsContinue == "1") - { - if (string.IsNullOrWhiteSpace(model.TailBoxNo)) + if (string.IsNullOrEmpty(model.BoxNo)) { - throw new Exception("-1:寮�鍚繛缁粍鎵樻椂锛屽熬绠辩爜淇℃伅涓嶅彲涓虹┖!"); + throw new Exception("-1:绠辩爜淇℃伅涓嶅彲涓虹┖!"); } + if (model.IsContinue == "1") + { + if (string.IsNullOrWhiteSpace(model.TailBoxNo)) + { + throw new Exception("-1:寮�鍚繛缁粍鎵樻椂锛屽熬绠辩爜淇℃伅涓嶅彲涓虹┖!"); + } + + } } + #endregion // 楠岃瘉鍏ュ簱鍗曟�昏〃 var notice = Db.Queryable<BllArrivalNotice>().First(m => m.IsDel == "0" && m.ASNNo == model.AsnNo); @@ -1560,11 +1565,11 @@ //鍏ュ簱鍗曠被鍨嬶紝0锛氭垚鍝佸叆搴� 1锛氶噰璐叆搴� 2锛氫腑闂村搧鍏ュ簱 3锛氶��璐у叆搴� 4锛氳溅闂翠綑鏂欓��鍥炲叆搴� 5锛氬叾瀹冨叆搴� 6锛氫唬鍌ㄥ叆搴� if (notice.Type == "0" || notice.Type == "3" || notice.Type == "5" || notice.Type == "6") { - BindPalletForBox(model,userId,origin); + BindPalletForBox(model, userId, origin); } else { - BindPalletForLabelBox(model,userId); + BindPalletForLabelBox(model, userId); } } catch (Exception ex) @@ -1763,7 +1768,7 @@ // 鏇存敼鍏ュ簱鍗曟槑缁嗗凡缁勬暟閲� var sqlString = string.Empty; - sqlString += $"update BllArrivalNoticeDetail set FactQty = FactQty + '{factQty}' where id = '{model.AsnDetailId}';"; + sqlString += $"update BllArrivalNoticeDetail set FactQty = FactQty + '{bind.Qty}' where id = '{model.AsnDetailId}';"; Db.Ado.ExecuteCommand(sqlString); // 鏇存敼鍏ュ簱鍗曞強鍏ュ簱鏄庣粏鐘舵�� @@ -1875,7 +1880,7 @@ PalletNo = model.PalletNo, PalletNo2 = "", PalletNo3 = "", - Qty = 0, + Qty = model.SkuQty, FullQty = pNum, Status = "0", Type = "0", @@ -1901,7 +1906,7 @@ } #region 绠辩爜淇℃伅 - + var boxInfoList = new List<BllLabelBoxNo>(); var msgStr = $"绠卞彿涓簕model.BoxNo}"; var boxInfoList = new List<BllLabelBoxNo>(); //棣栫 @@ -1924,6 +1929,29 @@ var sql = $"select * from BllLabelBoxNo where IsDel = '0' and boxNo>'{model.BoxNo}' and boxNo<'{model.TailBoxNo}' and Level='1'; "; var list = Db.Ado.SqlQuery<BllLabelBoxNo>(sql); boxInfoList.AddRange(list); + decimal factQty = 0.00m;//鎵樼洏鎬绘暟閲� + if (model.SkuQty == 0) + { + //棣栫 + var boxInfo = Db.Queryable<BllLabelBoxNo>().Where(m => m.IsDel == "0" && m.BoxNo == model.BoxNo && m.IsUse == "0" && m.Level == "1").ToList(); + if (boxInfo.Count == 0) + { + throw new Exception("-1:绠辩爜淇℃伅涓嶅瓨鍦�!"); + } + //鏄惁杩炵画缁勬墭 + if (model.IsContinue == "1") + { + boxInfoList.AddRange(boxInfo); + //灏剧 + var boxInfo2 = Db.Queryable<BllLabelBoxNo>().Where(m => m.IsDel == "0" && m.BoxNo == model.TailBoxNo && m.IsUse == "0" && m.Level == "1").ToList(); + if (boxInfo2.Count == 0) + { + throw new Exception("-1:灏剧鐮佷俊鎭笉瀛樺湪!"); + } + boxInfoList.AddRange(boxInfo2); + var sql = $"select * from BllLabelBoxNo where IsDel = '0' and IsUse = '0' and boxNo>'{model.BoxNo}' and boxNo<'{model.TailBoxNo}' and Level='1'; "; + var list = Db.Ado.SqlQuery<BllLabelBoxNo>(sql); + boxInfoList.AddRange(list); //鎵惧埌鐩稿叧鐨勪簩绾х爜 foreach (var item in boxInfoList) @@ -2032,7 +2060,7 @@ // 鏇存敼鍏ュ簱鍗曟槑缁嗗凡缁勬暟閲� var sqlString = string.Empty; - sqlString += $"update BllArrivalNoticeDetail set FactQty = FactQty + '{factQty}' where id = '{model.AsnDetailId}';"; + sqlString += $"update BllArrivalNoticeDetail set FactQty = FactQty + '{bind.Qty}' where id = '{model.AsnDetailId}';"; Db.Ado.ExecuteCommand(sqlString); // 鏇存敼鍏ュ簱鍗曞強鍏ュ簱鏄庣粏鐘舵�� diff --git a/Wms/WMS.Entity/BllAsnEntity/BllLabelBoxNo.cs b/Wms/WMS.Entity/BllAsnEntity/BllLabelBoxNo.cs index c9a9ccf..a3311e5 100644 --- a/Wms/WMS.Entity/BllAsnEntity/BllLabelBoxNo.cs +++ b/Wms/WMS.Entity/BllAsnEntity/BllLabelBoxNo.cs @@ -61,6 +61,27 @@ public string SkuName { get; set; } /// <summary> + /// Desc:鐗╂枡瑙勬牸 + /// Default: + /// Nullable:True + /// </summary> + public string Standard { get; set; } + + /// <summary> + /// Desc:鍖呰瑙勬牸 + /// Default: + /// Nullable:True + /// </summary> + public string PackageStandard { get; set; } + + /// <summary> + /// Desc:鍌ㄥ瓨鏈熻嚦 + /// Default: + /// Nullable:True + /// </summary> + public DateTime? StoreTime { get; set; } + + /// <summary> /// Desc:鎵规鍙� /// Default: /// Nullable:True diff --git a/Wms/WMS.IBLL/IBllAsnServer/IBllLabelBoxNoServer.cs b/Wms/WMS.IBLL/IBllAsnServer/IBllLabelBoxNoServer.cs index be6e45b..136e781 100644 --- a/Wms/WMS.IBLL/IBllAsnServer/IBllLabelBoxNoServer.cs +++ b/Wms/WMS.IBLL/IBllAsnServer/IBllLabelBoxNoServer.cs @@ -16,5 +16,48 @@ /// <param name="count">鏁伴噺</param> /// <returns>鏍囩绠辩爜淇℃伅</returns> List<LabelBoxDto> GetLabelBoxList(LabelBoxVm model, out int count); + + /// <summary> + /// 鑾峰彇鏍囩妯℃澘鏍规嵁鍏ュ簱鍗曟槑缁咺D + /// </summary> + /// <param name="id">鍏ュ簱鍗曟槑缁咺D</param> + /// <returns>鏍囩淇℃伅妯℃澘</returns> + LabelBoxDto GetLabelBoxModel(int id); + + ///// <summary> + ///// 鑾峰彇鐗╂枡鏍囩淇℃伅JC06 + ///// </summary> + ///// <param name="imId"></param> + ///// <param name="isPrint">鏄惁閲嶆柊鐢熸垚鑷湁鎵规 0:鍚� 1:鏄� </param> + ///// <param name="createUser">鍒涘缓浜�</param> + ///// <param name="number">绠卞唴鏁伴噺锛堜竴绾ф爣绛惧繀濉級</param> + ///// <param name="productionDate">鐢熶骇鏃ユ湡</param> + ///// <param name="supplierName">鐢熶骇鍘傚</param> + ///// <param name="supplierLot">鐢熶骇鍘傚鎵瑰彿</param> + ///// <param name="inspectTime">鏈夋晥鏈�</param> + ///// <param name="expirationTime">淇濊川鏈�</param> + ///// <param name="bQNum">澶栫鏍囩鏁伴噺</param> + ///// <param name="skuNum">鍒拌揣鏁伴噺</param> + ///// <returns></returns> + + /// <summary> + /// 鑾峰彇鏍囩淇℃伅(鐢熸垚鏍囩) + /// </summary> + /// <param name="imId">鍏ュ簱鍗曟槑缁咺D</param> + /// <param name="isReset">鏄惁閲嶆柊鐢熸垚鑷湁鎵规 0:鍚� 1:鏄�</param> + /// <param name="arriveQty">鍒拌揣鏁伴噺</param> + /// <param name="skuName">鐗╂枡鍚嶇О</param> + /// <param name="standard">瑙勬牸/鍨嬪彿</param> + /// <param name="packStandard">鍖呰瑙勬牸</param> + /// <param name="skuNo">鐗╂枡缂栫爜</param> + /// <param name="supplierLot">渚涘簲鍟嗘壒娆�</param> + /// <param name="productionTime">鐢熶骇鏃ユ湡</param> + /// <param name="expirationTime">鏈夋晥鏈熻嚦</param> + /// <param name="storeTime">鍌ㄥ瓨鏈熻嚦</param> + /// <param name="userId">鎿嶄綔浜�</param> + /// <returns></returns> + List<LabelBoxDto> AddLabelBoxReturn(int imId, string isReset, decimal arriveQty, string skuName,string standard,string packStandard,string skuNo, string supplierLot, string productionTime, string expirationTime, string storeTime,int userId); + + } } diff --git a/Wms/Wms/Controllers/BllAsnController.cs b/Wms/Wms/Controllers/BllAsnController.cs index 081f183..fee616f 100644 --- a/Wms/Wms/Controllers/BllAsnController.cs +++ b/Wms/Wms/Controllers/BllAsnController.cs @@ -862,6 +862,21 @@ } } + [HttpGet] + public IActionResult GetLabelBoxModel(int id) + { + try + { + var list = _labelBox.GetLabelBoxModel(id); + return Ok(new { code = 0, msg = "绠辩爜妯℃澘淇℃伅", data = list }); + } + catch (Exception e) + { + return Ok(new { code = 1, msg = e.Message }); + } + } + + #endregion } -- Gitblit v1.8.0