From 4981a1e8bfe9c18965d93dec8569d4980e824884 Mon Sep 17 00:00:00 2001 From: chengsc <11752@DESKTOP-DS49RCP> Date: 星期二, 24 六月 2025 09:12:19 +0800 Subject: [PATCH] 修改拆箱换标问题,添加拆托功能页 --- Pda/View/HouseDataSetting/SkuDismantling.html | 846 +++++++++++++++++++++++++++++++++++++++++++++++++ Pda/View/HouseDataSetting/BoxDevanning.html | 117 ++++-- Wms/Wms/Controllers/PdaCrController.cs | 4 Wms/WMS.BLL/BllPdaServer/PdaCrServer.cs | 48 ++ Wms/WMS.IBLL/IPdaServer/IPdaCrServer.cs | 3 5 files changed, 978 insertions(+), 40 deletions(-) diff --git a/Pda/View/HouseDataSetting/BoxDevanning.html b/Pda/View/HouseDataSetting/BoxDevanning.html index 1f90bfa..5c9dae2 100644 --- a/Pda/View/HouseDataSetting/BoxDevanning.html +++ b/Pda/View/HouseDataSetting/BoxDevanning.html @@ -40,7 +40,11 @@ <li><a href="../login.html">閲嶆柊鐧诲綍</a></li> </ul> </div> - + <div> + <button id="click" class="layout-btn" type="button" + style="background-color: #999; width: 100%;text-align: center; margin-top: 2px;">杩炴帴钃濈墮</button> + + </div> <div id="" class="layout-bill-info"> <form class="layui-form" action=""> <div id="BOX" class="layui-form-item layout-input"> @@ -62,7 +66,7 @@ <tr> <td style="width: 23%;"></td> <td> - <button class="layout-btn layout-btn-red" lang type="button" lay-submit + <button id="click2" class="layout-btn layout-btn-red" lang type="button" lay-submit lay-filter="formUnbind">鎷嗙</button> </td> <td style="width: 33%;"></td> @@ -79,7 +83,14 @@ <script src="/layui/layui.js"></script> <script src="/js/public.js"></script> <script src="/js/jquery.cookie.js"></script> + + <script type="text/javascript" src="https://js.cdn.aliyun.dcloud.net.cn/dev/uni-app/uni.webview.1.5.2.js"></script> + <script> + + var dataLists; + + var isChongFu = true; layui.use(['form', 'jquery'], function() { var form = layui.form @@ -97,10 +108,22 @@ // //console.log("body") $("#menuList").hide() }) - - var isChongFu = true; - form.on('submit(formUnbind)', function(data) { + }) + + document.addEventListener("UniAppJSBridgeReady", function () { + document.getElementById("click").addEventListener("click", function () { + let data = { + type: "search" + }; + console.log("缁� uni-app 鍙戦�佹暟鎹�", data); + + uni.postMessage({ + data: data, + }); + }); + document.getElementById("click2").addEventListener("click", function () { + if (!$("#devanQty").val()) { layer.msg('璇疯緭鍏ユ媶绠辨暟閲�', { icon: 2, @@ -116,7 +139,7 @@ }); return; } - if (!$("#BOXCODE").val()) { + if (!$("#BOXCODE").val()) { layer.msg('璇锋壂鎻忓绠辨潯鐮�', { icon: 2, time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 @@ -124,44 +147,66 @@ return; } if (isChongFu == true) { - isChongFu = false; - var param = { - "DevanQty":parseFloat($("#devanQty").val()), - "BoxNo": $("#BOXCODE").val(), - } - sendData(IP + "/PdaCr/AddLableByDevanning", param, 'post', function(res) { - if (res.code == 0) { //鎴愬姛 - layer.msg("鎴愬姛", { - icon: 1, - time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - }, function () { - tableData = null - $("#devanQty").val('') - $("#BOXCODE").val('') + isChongFu = false; + var param = { + "DevanQty":parseFloat($("#devanQty").val()), + "BoxNo": $("#BOXCODE").val(), + } + synData(IP + "/PdaCr/AddLableByDevanning", param, 'post', function(res) { + if (res.code == 0) { //鎴愬姛 + layer.msg("鎴愬姛", { + icon: 1, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }, function () { + $("#devanQty").val('') + $("#BOXCODE").val('') + dataLists = res.data; + console.log(dataLists); + + isChongFu = true; + let data = { + type: "print", + listData:dataLists + // { + // SkuNo:'541100554848', + // SkuName:'钁¤悇绯栬憽钀勭硸钁¤悇绯栬憽钀勭硸钁¤悇绯�', + // LotNo:'120326', + // Date1:'2025-04-10', + // Date2:'2026-04-10', + // BoxNo:['T2300001','T2300002','T2300003'], + // } + // lstData: { + // name: "Iuhuy", + // avatar: + // "http://thirdwx.qlogo.cn/mmopen/vi_32/EURpungADj4vP3UczBVvD1DcEUt9q7WFqc6mZlSZoXoS9PyaPicnX8pjmic0rLbmwYCSa247gibINd1dWr0ic1QTvw/132", + // }, + }; + console.log("缁� uni-app 鍙戦�佹暟鎹�", data); - isChongFu = true; - }); - } else { //涓嶆垚鍔� - layer.msg(res.msg, { - icon: 2, - time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - }, function() {isChongFu = true;}); - } - }); - return false; //闃绘琛ㄥ崟璺宠浆銆傚鏋滈渶瑕佽〃鍗曡烦杞紝鍘绘帀杩欐鍗冲彲銆� - }else{ + uni.postMessage({ + data: data, + }); + }); + } else { //涓嶆垚鍔� + layer.msg(res.msg, { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }, function() {isChongFu = true;}); + } + }); + + }else{ layer.msg("璇峰嬁閲嶅鐐瑰嚮", { icon: 2, time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 }); } + }); - - // form.verify({ - // stock: [/^[\S]{6}$/, '鎵樼洏鏉$爜蹇呴』涓哄叚浣嶅瓧绗�'] - // }); - }) + }); + + </script> </body> </html> diff --git a/Pda/View/HouseDataSetting/SkuDismantling.html b/Pda/View/HouseDataSetting/SkuDismantling.html new file mode 100644 index 0000000..9905e2c --- /dev/null +++ b/Pda/View/HouseDataSetting/SkuDismantling.html @@ -0,0 +1,846 @@ +<!DOCTYPE html> +<html> + +<head> + <meta charset="UTF-8" /> + <meta name="viewport" content="user-scalable=0,width=device-width,initial-scale=1.0" /> + <!-- <meta name="viewport" content="width=device-width, initial-scale=0.665, minimum-scale=0.5, maximum-scale=2.0, user-scalable=no" /> --> + <meta http-equiv="X-UA-Compatible" content="ie=edge" /> + <title>Boxline PDA</title> + + <link rel="stylesheet" href="/layui/css/layui.css" /> + <link rel="stylesheet" href="/css/style.css" /> + <script src="/js/adaptive.js"></script> + + <link rel="stylesheet" href="/css/my.css" /> + <style type="text/css"> + .layout-bill-info { + height: auto; + /* background-color: #009E94; */ + } + + .layout-tbl-submit { + margin-top: 10px; + } + + /* .out-scatter-num { + background-color: #009688; + + } */ + .out-scatter-num .local-input { + width: 40%; + height: 25px; + float: left; + } + + .out-scatter-num .local-ok button { + height: 25px; + border: 0; + color: #FFFFFF; + background-color: #0a93e3; + border-radius: 3px; + padding: 2px; + margin-left: 10px; + width: 100%; + } + + .out-scatter-num .layui-input-block { + width: 100%; + /* background-color: #009E94; */ + margin-left: 0; + } + + .out-scatter-num .local-ok { + width: 20%; + height: 25px; + float: left; + } + + .btn-ok-blue { + border: none; + color: #FFFFFF; + background-color: #0a93e3; + width: 48%; + height: 36px; + border-radius: 5px; + } + + .btn-ok-red { + border: none; + color: #FFFFFF; + background-color: #9f1707; + width: 48%; + height: 36px; + border-radius: 5px; + } + + .btn-ok-blue:active { + opacity: 0.8; + } + + .btn-ok-red:active { + opacity: 0.8; + } + + .layout-tbl-paging { + margin-top: 20px; + } + + .foot-container { + text-align: center; + } + + .layout-tab-page { + height: auto; + } + + .layui-form-checkbox { + margin: auto; + /* padding-left: 2px; */ + /* padding-right: 2px; */ + } + + .div-tbl-title { + width: 98%; + margin: auto; + /* background-color: #4476A7; */ + height: 30px; + } + + .div-tbl-title table { + width: 100%; + height: 30px; + } + + td { + word-break: break-all; + word-wrap: break-word; + } + + .layui-input-block .layui-input, + .layui-input-block .layui-textarea { + padding-left: 0rem; + font-size: 13px; + } + + .lableWidth { + width: 17%; + } + + .layui-input-block { + width: 83%; + margin-left: 17%; + } + + .layui-form-switch { + margin-top: 0; + } + + ul { + list-style-type: none; + padding: 0; + } + + li { + cursor: pointer; + background-color: lightgray; + padding: 10px; + margin-bottom: 5px; + } + </style> + <link rel="stylesheet" href="/css/adapter.css" /> +</head> + +<body> + <div id="" class="main-content"> + <div id="" class="layout-title"> + <table border="" cellspacing="" cellpadding=""> + <tr> + <td class="img-back"><a href="../index.html"><img src="/assets/back.jpg"></a></td> + <td class="title-text">鐗╂枡鎷嗘墭</td> + <td class="title-menu-icon"><img id="menuImg" src="/assets/menu.jpg"></td> + </tr> + </table> + </div> + <div id="" class="layout-sub-content"> + <div id="menuList" class="menu"> + <ul class="" style="text-align: center;"> + <li><a href="../index.html">涓婚〉</a></li> + <li><a href="../login.html">閲嶆柊鐧诲綍</a></li> + </ul> + </div> + + <!-- <ul> + <li id="option1">鏍囩</li> + <li id="option2">鏁伴噺</li> + </ul> --> + + <button id="option1" class="layout-btn" type="button">鏍囩</button> + <button id="option2" class="layout-btn" type="button">鏁伴噺</button> + <br /><br /> + + <!-- 鏈夌爜 --> + <div id="content1"> + + <div id="" class="layout-bill-info"> + <form class="layui-form" action="" style="height: auto;"> + + <div id="layout-pallet" class="layui-form-item layout-input"> + <label class="layui-form-label lableWidth">鎵樼洏鏉$爜锛�</label> + <div class="layui-input-block"> + <input id="palletNo" type="text" lay-verify="stock" placeholder="璇锋壂鎻忔墭鐩樻潯鐮�" + autocomplete="off" class="layui-input" style="height:24px"> + </div> + </div> + + <div class="layui-form-item layout-input"> + <label class="layui-form-label lableWidth">澶栫鏉$爜锛�</label> + <div class="layui-input-block"> + <input id="boxNo" type="text" placeholder="璇锋壂鎻忓绠辨潯鐮�" autocomplete="off" + class="layui-input"> + </div> + </div> + + <div id="layout-pallet" class="layui-form-item layout-input" style="margin-top: 5px;"> + <label class="layui-form-label lableWidth">鏂版墭鐩樻潯鐮侊細</label> + <div class="layui-input-block"> + <input id="palletNo3" type="text" lay-verify="stock" placeholder="璇锋壂鎻忔柊鎵樼洏鏉$爜" + autocomplete="off" class="layui-input" style="height:24px"> + </div> + </div> + + <div id="" class="layout-tab-page"> + + <table class="layout-tab-content"> + <tr> + <td style="width: 33%;"></td> + <td> + <button class="layout-btn layout-btn-red" lang type="button" lay-submit + lay-filter="formPickScatter">鎷h揣</button> + </td> + <td style="width: 33%;"></td> + </tr> + </table> + <div id="" style="text-align: right;margin-top: 10px; display: none;"> + <div id="" class="cut-line"> + <img src="/assets/fengexian.png"> + </div> + </div> + </div> + + </form> + </div> + + </div> + <!-- 鏃犵爜 --> + <div id="content2"> + + <div id="" class="layout-bill-info"> + <form class="layui-form" action="" style="height: auto;"> + + + + <div id="layout-pallet" class="layui-form-item layout-input"> + <label class="layui-form-label lableWidth">鎵樼洏鏉$爜锛�</label> + <div class="layui-input-block"> + <input id="palletNo2" type="text" lay-verify="stock" placeholder="璇锋壂鎻忔墭鐩樻潯鐮�" + autocomplete="off" class="layui-input" style="height:24px"> + </div> + </div> + + <div id="layout-skuLotNo2" class="layui-form-item layout-dropdownlist"> + <label class="layui-form-label lableWidth">鐗╂枡 - 鎵规锛�</label> + <div class="layui-input-block"> + <select id="skuLotNo2" lay-filter="getSkuLotNo2" lay-search> + <option value=""></option> + </select> + <img src="/assets/down_arraw.png"> + </div> + </div> + <div id="layout-pallet" class="layui-form-item layout-input"> + <label class="layui-form-label lableWidth">鏂版墭鐩樻潯鐮侊細</label> + <div class="layui-input-block"> + <input id="palletNo4" type="text" lay-verify="stock" placeholder="璇锋壂鎻忔柊鎵樼洏鏉$爜" + autocomplete="off" class="layui-input" style="height:24px"> + </div> + </div> + + + <div id="" class="layout-tab-page"> + + <table class="layout-tab-content"> + <tr> + <td> + <div id="layout-qty" class="layui-form-item out-scatter-num"> + <label class="layui-form-label lableWidth">鎷嗘墭鏁伴噺锛�</label> + <div id="" class="local-input"> + <div class="layui-input-block"> + <input id="pickQty2" type="number" placeholder="璇疯緭鍏ユ嫞璐ф暟閲�" + autocomplete="off" class="layui-input" + style="padding-left:0.1rem;" + oninput="value=value.replace(/^(0+)|[^\d]+/g,'')"> + </div> + </div> + <div id="" class="local-ok"> + <button type="button" lay-submit + lay-filter="formPickScatter2">纭</button> + </div> + </div> + </td> + </tr> + </table> + <div id="" style="text-align: right;margin-top: 10px; display: none;"> + <div id="" class="cut-line"> + <img src="/assets/fengexian.png"> + </div> + </div> + </div> + + </form> + </div> + </div> + + </div> + + </div> + + + <script src="/js/jquery-3.5.1.min.js"></script> + <script src="/layui/layui.js"></script> + <script src="/js/jquery.cookie.js"></script> + <script src="/js/public.js"></script> + + <script> + layui.use(['form', 'jquery'], function () { + var form = layui.form; + + /* 鏍囩鍒囨崲浠g爜 */ + + var xianshiyemian = 0; + + $('#option1').attr("style", "background-color: red;width: 50%;float: left;text-align: center;"); //閫変腑鍚庨鑹� + $('#option2').attr("style", "background-color: #999;width: 50%;float: right;text-align: center;"); //榛樿棰滆壊 + $('#content2').hide(); + $(document).ready(function () { + $('#option1').click(function () { + // qingkong(); + xianshiyemian = 0; + $('#content1').show(); + $('#option1').attr("style", "background-color: red;width: 50%;float: left;text-align: center;"); //閫変腑鍚庨鑹� + + $('#content2').hide(); + $('#option2').attr("style", "background-color: #999;width: 50%;float: right;text-align: center;"); //榛樿棰滆壊 + $("#palletNo").focus();//鍏夋爣榛樿閫変腑 + }); + + $('#option2').click(function () { + // qingkong(); + xianshiyemian = 1; + $('#content1').hide(); + $('#option1').attr("style", "background-color: #999;width: 50%;float: left;text-align: center;"); //榛樿棰滆壊 + + $('#content2').show(); + $('#option2').attr("style", "background-color: red;width: 50%;float: right;text-align: center;"); //閫変腑鍚庨鑹� + $("#palletNo2").focus();//鍏夋爣榛樿閫変腑 + }); + }); + + + //鏄惁鏁存墭鎷h揣 + var isContinue = "0"; + var canPickBox = true + $("#palletNo").focus();//鍏夋爣榛樿閫変腑 + + //褰撴墭鐩樻潯鐮佽緭鍏ユ鏂囨湰鏀瑰彉鏃�,妫�鏌ヤ竴涓嬫墭鐩樼姸鎬� + $("#palletNo").on('input', function () { + + if ($("#palletNo").val() == "" || $("#palletNo").val().length < 8) { + return + } + if ($("#palletNo").val().length >= 8) { + $("#palletNo").val($("#palletNo").val().substr(-8)) + } + checkPalletState() + }) + + //绠辩爜鏂囨湰妗嗗洖杞︿簨浠� + $("#boxNo").blur(function () { + GetBoxInfo(); + + }); + + //鏌ヨ绠辩爜淇℃伅 + function GetBoxInfo(){ + var param = { + "PalletNo": $("#palletNo").val(), + "BoxNo": $("#boxNo").val(), + } + synData(IP + "/PdaCr/GetBoxInfo", param, 'post', function (res) { + + if (res.code == 0) { //鎴愬姛 + $("#boxNo").focus();//鍏夋爣榛樿閫変腑 + } else { //涓嶆垚鍔� + layer.msg(res.msg, { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }, function () { }); + } + }); + } + + + //妫�鏌ユ墭鐩樼姸鎬� + function checkPalletState() { + + var param = { + "PalletNo": $("#palletNo").val() + } + synData(IP + "/PdaSo/IsEnableOkPalletNo", param, 'post', function (res) { + + if (res.code == 0) { //鎴愬姛 + $("#boxNo").focus();//鍏夋爣榛樿閫変腑 + } else { //涓嶆垚鍔� + layer.msg(res.msg, { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }, function () { }); + } + }); + } + + //鍗曟嫞璐э紙纭鎸夐挳锛� + form.on('submit(formPickScatter)', function (data) { + + + if ($('#palletNo').val() == "") { + layer.msg("璇疯緭鍏ユ墭鐩樼爜", { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }); return; + } + if ($('#palletNo3').val() == "") { + layer.msg("璇疯緭鍏ユ柊鎵樼洏鐮�", { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }); return; + } + if (isContinue == "0") { + if ($('#boxNo').val() == "") { + layer.msg("璇疯緭鍏ョ鐮�", { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }); return; + } + if ($('#boxQty').val() == "") { + layer.msg("绠卞唴鏁伴噺涓虹┖锛屼笉鑳芥嫞璐�", { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }); + return; + } + + } + + + if (canPickBox == false) { + + layer.msg("璇锋眰鏈畬鎴愶紝涓嶈閲嶅璇锋眰", { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }); + return; + } + + reqPickScatter() + + return false; //闃绘琛ㄥ崟璺宠浆銆傚鏋滈渶瑕佽〃鍗曡烦杞紝鍘绘帀杩欐鍗冲彲銆� + }); + + //纭鎷h揣 + function reqPickScatter() { + var param = { + "PalletNo": $('#palletNo').val(), + "BoxNo": $('#boxNo').val(), + "palletNoNew": $('#palletNo3').val(), + } + sendData(IP + "/PdaSo/SoSetPinPick", param, 'post', function (res) { + //console.log(res); + + if (res.code == 0) { //鎴愬姛 + layer.msg(res.msg, { + icon: 1, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }, function () { + canPickBox = true//鍥炶皟 + $("#boxNo").val(''); + }); + } else { //涓嶆垚鍔� + layer.msg(res.msg, { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }, function () { + canPickBox = true;//鍥炶皟 + }); + } + }); + } + + //---------------------------------------------------------------------------------- + //涓婚〉鍙婇噸鏂扮櫥褰� + $("#menuImg").click(function (e) { + //console.log("menuImg") + e.stopPropagation() + + if ($("#menuList").is(":hidden")) { + $("#menuList").show() + } else { + $("#menuList").hide() + } + }) + $('body').click(function () { + // //console.log("body") + $("#menuList").hide() + }) + + + + + + + //鏁伴噺鏍囩------------------------------------------------------------------------------- + + function clear21() { + $('#outModel2').val("");//鍑哄簱鍙� + $('#standard2').val("");//瑙勬牸 + + $('#pickQty2').val("");//寰呮嫞鏁伴噺 + $('#pickedQty2').val("");//宸叉嫞鏁伴噺 + } + function clear22() { + //鐗╂枡鎵规 + $("#skuLotNo2").empty() + $("#skuLotNo2").append('<option value =>' + '</option>'); + form.render('select'); + } + function clear23() { + $("#planQty2").val(""); //璁″垝鏁伴噺 + $("#finishQty2").val("");//瀹屾垚鏁伴噺 + } + function clear24() { + $('#boxNo2').val("");//绠辩爜 + $('#boxQty2').val("");//绠卞唴鏁伴噺 + } + + + //褰撴墭鐩樻潯鐮佽緭鍏ユ鏂囨湰鏀瑰彉鏃�,妫�鏌ヤ竴涓嬫墭鐩樼姸鎬� + $("#palletNo2").on('input', function () { + if ($("#palletNo2").val() == "" || $("#palletNo2").val().length < 8) { + return + } + if ($("#palletNo2").val().length >= 8) { + $("#palletNo2").val($("#palletNo2").val().substr(-8)) + } + checkPalletState2() + }) + //妫�鏌ユ墭鐩樼姸鎬� + function checkPalletState2() { + var param = { + "PalletNo": $("#palletNo2").val() + } + synData(IP + "/PdaSo/IsEnableOkPalletNo", param, 'post', function (res) { + if (res.code == 0) { //鎴愬姛 + updateBillList2(); + console.log($('#bar2').val()) + if ($('#bar2').val() == "") { + console.log(1) + clear21(); + return; + } else { + console.log(2) + updateSkuLotNoList2(); + updateQtyList2(); + getBar2(); + // GetDataInfo(); + } + + } else { //涓嶆垚鍔� + layer.msg(res.msg, { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }, function () { }); + } + }); + } + //鍒濆鍖栨覆鏌� 鍑哄簱鍗� + function updateBillList2() { + $("#bar2").empty() + $("#bar2").append('<option value =>' + '</option>'); + form.render('select'); + + var param = { + PalletNo: $("#palletNo2").val(), + }; + synData(IP + "/PdaSo/GetRunSoNoticeList", param, 'post', function (res) { + if (res.code == 0) { //鎴愬姛 + console.log(res.data); + for (var i = 0; i < res.data.length; i++) { + if (i == 0) { + $("#bar2").append('<option value =' + res.data[i] + ' selected>' + res.data[i] + '</option>'); + } else { + $("#bar2").append('<option value =' + res.data[i] + '>' + res.data[i] + '</option>'); + } + } + form.render('select'); + + } else { //涓嶆垚鍔� + layer.msg(res.msg, { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }); + } + }); + } + + //鍒濆鍖栨覆鏌� 鐗╂枡-鎵规 + function updateSkuLotNoList2() { + clear22(); + var param = { + PalletNo: $("#palletNo2").val(), + SoNo: $("#bar2").val(), + }; + synData(IP + "/PdaSo/GetSoSkuLotNoListByPallet", param, 'post', function (res) { + + console.log(res); + if (res.code == 0) { //鎴愬姛 + for (var i = 0; i < res.data.length; i++) { + if (i == 0) { + $("#skuLotNo2").append('<option value =' + res.data[i].SoDetailId + ' selected>' + res.data[i].SkuName); + if (res.data[i].LotNo != null) { + $("#skuLotNo2").append(" - " + res.data[i].LotNo); + } + $("#skuLotNo2").append('</option>'); + + } else { + $("#skuLotNo2").append('<option value =' + res.data[i].SoDetailId + '>' + res.data[i].SkuName); + if (res.data[i].LotNo != null) { + $("#skuLotNo2").append(" - " + res.data[i].LotNo); + } + $("#skuLotNo2").append('</option>'); + } + } + form.render('select'); + + } else { //涓嶆垚鍔� + layer.msg(res.msg, { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }, function () { }); + } + }); + } + + //鍒濆鍖栨覆鍗曟嵁鐨勮鍒掓暟閲忓拰瀹屾垚鏁伴噺 + function updateQtyList2() { + clear23(); + console.log("AA"); + var param = { + SoDetailId: $("#skuLotNo2").val(), + }; + synData(IP + "/PdaSo/GetPlanAndFinishQty", param, 'post', function (res) { + console.log(res); + console.log(res.data); + if (res.code == 0) { //鎴愬姛 + $("#planQty2").val(res.data.PlanQty) + $("#finishQty2").val(res.data.FinishQty) + } else { //涓嶆垚鍔� + layer.msg(res.msg, { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }, function () { }); + } + }); + } + + //鏍规嵁鍗曟嵁鑾峰彇鍑哄簱鍙c�佽鏍笺�佸緟妫�鏁伴噺銆佸凡鎷f暟閲� + function getBar2() { + clear21(); + + var param = { + PalletNo: $("#palletNo2").val(), + SoDetailId: $("#skuLotNo2").val(), + } + synData(IP + "/PdaSo/GetOutlets", param, 'post', function (res) { + if (res.code == 0) { //鎴愬姛 + let data = res.data + console.log(res.data); + $('#outModel2').val(res.data.OutModel); + $('#standard2').val(res.data.Standard); + + $('#pickQty2').val(res.data.PickQty - res.data.PickedQty); + $('#pickedQty2').val(res.data.PickedQty); + } else { //涓嶆垚鍔� + layer.msg(res.msg, { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }, function () { }); + } + }); + + } + + //鑾峰彇鎵樼洏鐗╂枡鍚嶇粏 + function GetDataInfo() { + let param2 = { + "SoDetailId": $("#skuLotNo2").val(), + "PalletNo": $("#palletNo2").val(), + } + console.log(param2); + synData(IP + "/PdaSo/GetAllotPlnInfo", param2, 'post', function (res) { + if (res.code == 0) { + tableData2 = deepCopy(res.data) + + refreshTable2(tableData2) + } else { + layer.msg(res.msg, { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }, function () { }); + } + }); + } + + //娓叉煋琛ㄦ牸鏁版嵁 + function refreshTable2(list) { + //鍏堟竻绌轰竴涓嬩俊鎭垪琛� + let trs = $("#tableBoxList2 tr") + let len = trs.length + //console.log("tr 鏁伴噺 + " + trs.length) + for (i = len - 1; i >= 2; i--) { + trs[i].remove(); + } + + console.log(list != null); + console.log(list); + if (list != null && list.length > 0) { //鎴愬姛 + + var arrTrs = new Array() + let idx = 0 + for (var i in list) { + // list[i].BoxCode + var tr = $("#boxCell2").eq(0).clone(); + tr.appendTo("#tableBoxList2"); + // tr.attr('id', list[i].BoxCode) + idx++; + tr.attr('index', idx) + // tr.find("td[name='skuNo']").attr('style', 'max-width:90px;'); + // tr.find("td[name='skuName']").attr('style', 'max-width:120px;'); + tr.find("td[name='SkuNo']").html(list[i].BoxNo); + tr.find("td[name='Qty']").html(list[i].Qty); + tr.find("td[name='pickedQty']").html(list[i].PickedQty); + + tr.show(); + arrTrs[i] = tr + } + setPages(1, list.length) + canPickBox = true + + } else { //涓嶆垚鍔� + layer.msg("鏃犳暟鎹�", { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }, function () { }); + // $("#boxNum").val(0) + setPages(1, 0) + } + } + + //鍗曟嫞璐э紙纭鎸夐挳锛� + form.on('submit(formPickScatter2)', function (data) { + + if ($('#bar2').val() == "") { + layer.msg("璇烽�夋嫨鍑哄簱鍗�", { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }); return; + } + if ($('#skuLotNo2').val() == "") { + layer.msg("璇烽�夋嫨鐗╂枡-鎵规", { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }); return; + } + if ($('#palletNo2').val() == "") { + layer.msg("璇疯緭鍏ユ墭鐩樼爜", { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }); return; + } + if ($('#palletNo4').val() == "") { + layer.msg("璇疯緭鍏ユ柊鎵樼洏鐮�", { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }); return; + } + let pickedQty = parseInt($('#pickedQty2').val()) //宸叉嫞鏁伴噺 + let pickQty = parseInt($('#pickQty2').val()) //鎷h揣鏁伴噺 + if (pickQty <= 0) { + layer.msg("鎷h揣鏁伴噺闇�澶т簬0", { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }); + return; + } + + if (canPickBox == false) { + + layer.msg("璇锋眰鏈畬鎴愶紝涓嶈閲嶅璇锋眰", { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }); + return; + } + + reqPickScatter2() + + return false; //闃绘琛ㄥ崟璺宠浆銆傚鏋滈渶瑕佽〃鍗曡烦杞紝鍘绘帀杩欐鍗冲彲銆� + }); + + //纭鎷h揣 + function reqPickScatter2() { + var param = { + "SoNo": $("#bar2").val(), + "SoDetailId": $("#skuLotNo2").val(), + "PalletNo": $('#palletNo2').val(), + "PickQty": $('#pickQty2').val(), + "PalletNoNew": $('#palletNo4').val(), + } + sendData(IP + "/PdaSo/SoSetQtyPinPick", param, 'post', function (res) { + //console.log(res); + + if (res.code == 0) { //鎴愬姛 + layer.msg(res.msg, { + icon: 1, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }, function () { + canPickBox = true//鍥炶皟 + updateQtyList2(); + getBar2(); + GetDataInfo(); + }); + } else { //涓嶆垚鍔� + layer.msg(res.msg, { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }, function () { + canPickBox = true;//鍥炶皟 + }); + } + }); + } + + + }) + </script> +</body> + +</html> \ No newline at end of file diff --git a/Wms/WMS.BLL/BllPdaServer/PdaCrServer.cs b/Wms/WMS.BLL/BllPdaServer/PdaCrServer.cs index fc62305..e1297a5 100644 --- a/Wms/WMS.BLL/BllPdaServer/PdaCrServer.cs +++ b/Wms/WMS.BLL/BllPdaServer/PdaCrServer.cs @@ -1217,7 +1217,7 @@ /// <param name="boxNo"></param> /// <param name="devanQty"></param> /// <param name="userId"></param> - public void AddLableByDevanning(string boxNo, decimal devanQty, int userId) + public BoxListInfoDto AddLableByDevanning(string boxNo, decimal devanQty, int userId) { try { @@ -1293,6 +1293,24 @@ new OperationCrServer().AddLogOperationCr("搴撳唴浣滀笟", "鎿嶄綔鏃ュ織", boxNo, "缂栬緫", $"鎷嗙璐存爣锛氬師绠辩爜锛歿boxNo}鎷嗙锛屾坊鍔犳柊绠辩爜{boxNoNew}", userId); //鎻愪氦浜嬪姟 Db.CommitTran(); + + #region 鑾峰彇鎷嗙鐨勪俊鎭墦鍗� + + + var data = new BoxListInfoDto() + { + SkuNo = boxInfo.SkuNo, + SkuName = boxInfo.SkuName, + LotNo = boxInfo.LotNo, + BoxNoList = new List<string>() { boxNoNew } , + Date1 = boxInfo.ProductionTime.ToString(), + Date2 = boxInfo.ExpirationTime.ToString(), + + }; + + #endregion + + return data; } catch (Exception e) { @@ -1424,5 +1442,33 @@ #endregion + #region 鐗╂枡鎷嗘墭 锛堟爣绛俱�佹暟閲忥級 + + public void GetBoxInfo(string boxNo,string pallNo) + { + try + { + + + var boxInfo = Db.Queryable<DataBoxInfo>().Where(m=>m.IsDel == "0" && m.BoxNo == boxNo).ToList(); + if (!string.IsNullOrWhiteSpace(pallNo)) + { + boxInfo = boxInfo.Where(m=>m.PalletNo == pallNo).ToList(); + } + if (boxInfo.Count!=1) + { + throw new Exception("鏍囩淇℃伅閿欒锛岃鑱旂郴绠$悊鍛�"); + } + + + } + catch (Exception e) + { + throw new Exception(e.Message); + } + } + + #endregion + } } diff --git a/Wms/WMS.IBLL/IPdaServer/IPdaCrServer.cs b/Wms/WMS.IBLL/IPdaServer/IPdaCrServer.cs index aaa18a1..b87ed44 100644 --- a/Wms/WMS.IBLL/IPdaServer/IPdaCrServer.cs +++ b/Wms/WMS.IBLL/IPdaServer/IPdaCrServer.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Text; using System.Threading.Tasks; +using Model.ModelDto; using Model.ModelDto.BllCheckDto; using Model.ModelDto.PdaDto; using WMS.Entity.DataEntity; @@ -155,7 +156,7 @@ #region 绠辩爜鎷嗙璐存爣 //绠辩爜鎷嗙娣诲姞鏍囩淇℃伅 - void AddLableByDevanning(string boxNo,decimal devanQty, int userId); + BoxListInfoDto AddLableByDevanning(string boxNo,decimal devanQty, int userId); /// <summary> diff --git a/Wms/Wms/Controllers/PdaCrController.cs b/Wms/Wms/Controllers/PdaCrController.cs index 9a2d0d9..6a97983 100644 --- a/Wms/Wms/Controllers/PdaCrController.cs +++ b/Wms/Wms/Controllers/PdaCrController.cs @@ -312,9 +312,9 @@ } var uId = int.Parse(userId); - _pdaCrSvc.AddLableByDevanning(model.BoxNo, model.DevanQty,uId); + var list = _pdaCrSvc.AddLableByDevanning(model.BoxNo, model.DevanQty,uId); - return Ok(new { data = "", code = 0, msg = "鎴愬姛" }); + return Ok(new { data = list, code = 0, msg = "鎴愬姛" }); } catch (Exception e) { -- Gitblit v1.8.0