Merge branch 'master' into wxw
| | |
| | | active = { |
| | | add: function () { |
| | | var typeValue = $("#Type").val(); |
| | | console.log(typeValue) |
| | | layer.open({ |
| | | type: 2, |
| | | title: '添加明细', |
| | |
| | | <option value="4">车间余料退回入库</option> |
| | | <option value="5">其它入库</option> |
| | | <option value="6">代储入库</option> |
| | | <option value="7">寄存入库</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | |
| | | var repeatClick = true; |
| | | var tableIns; |
| | | refreshTable(); |
| | | //正常显示 |
| | | var colsa = |
| | | [[ |
| | | { |
| | | field: 'LocatNo', |
| | | title: '储位编码', |
| | | align: 'center', |
| | | width: 110, |
| | | fixed: 'left', |
| | | },{ |
| | | field: 'PalletNo', |
| | | title: '托盘条码', |
| | | align: 'center', |
| | | width: 100, |
| | | fixed: 'left', |
| | | }, { |
| | | field: 'SkuNo', |
| | | title: '物品编码', |
| | | width: 100, |
| | | align: 'center', |
| | | fixed: 'left', |
| | | }, { |
| | | field: 'SkuName', |
| | | title: '物品名称', |
| | | minWidth: 200, |
| | | align: 'center', |
| | | fixed: 'left', |
| | | }, { |
| | | field: 'LotNo', |
| | | title: '批次', |
| | | align: 'center' |
| | | }, { |
| | | field: 'LotText', |
| | | title: '批次描述', |
| | | align: 'center', |
| | | }, { |
| | | field: 'Standard', |
| | | title: '物品规格', |
| | | align: 'center', |
| | | minWidth: 100 |
| | | }, { |
| | | field: 'RoadwayNo', |
| | | title: '所属巷道', |
| | | align: 'center', |
| | | width: 100 |
| | | }, { |
| | | field: 'Qty', |
| | | title: '库存数量', |
| | | width: 100, |
| | | fixed: 'right', |
| | | align: 'center', |
| | | }, { |
| | | field: 'ExportQty', |
| | | title: '出库数量', |
| | | align: 'center', |
| | | width: 100, |
| | | fixed: 'right', |
| | | edit: 'number', |
| | | event: 'dataNumber', |
| | | } |
| | | ]]; |
| | | //寄存显示 |
| | | var colsb = |
| | | [[ |
| | | { |
| | | field: 'LocatNo', |
| | | title: '储位编码', |
| | | align: 'center', |
| | | width: 110, |
| | | fixed: 'left', |
| | | },{ |
| | | field: 'PalletNo', |
| | | title: '托盘条码', |
| | | align: 'center', |
| | | width: 100, |
| | | fixed: 'left', |
| | | }, { |
| | | field: 'SkuNo', |
| | | title: '物品编码', |
| | | width: 100, |
| | | align: 'center', |
| | | fixed: 'left', |
| | | }, { |
| | | field: 'SkuName', |
| | | title: '物品名称', |
| | | minWidth: 200, |
| | | align: 'center', |
| | | fixed: 'left', |
| | | }, { |
| | | field: 'LotNo', |
| | | title: '批次', |
| | | align: 'center' |
| | | }, { |
| | | field: 'LotText', |
| | | title: '批次描述', |
| | | align: 'center', |
| | | }, { |
| | | field: 'Standard', |
| | | title: '物品规格', |
| | | align: 'center', |
| | | minWidth: 100 |
| | | }, { |
| | | field: 'Demo', |
| | | title: '备注', |
| | | align: 'center', |
| | | width: 100 |
| | | }, { |
| | | field: 'RoadwayNo', |
| | | title: '所属巷道', |
| | | align: 'center', |
| | | width: 100 |
| | | },{ |
| | | field: 'Qty', |
| | | title: '库存数量', |
| | | width: 100, |
| | | fixed: 'right', |
| | | align: 'center', |
| | | }, { |
| | | field: 'ExportQty', |
| | | title: '出库数量', |
| | | align: 'center', |
| | | width: 100, |
| | | fixed: 'right', |
| | | edit: 'number', |
| | | event: 'dataNumber', |
| | | } |
| | | ]]; |
| | | |
| | | function refreshTable() { |
| | | detailId = getQueryString('Id'); |
| | | var param = { |
| | |
| | | }; |
| | | sendData(IP + "/BllSo/GetHandOutList", param, 'post', function(res) { |
| | | if (res.code == 0) { //成功 |
| | | |
| | | var list = res.data; |
| | | $.extend(infoOptions, { |
| | | data: list |
| | | }); |
| | | infoOptions.page = { |
| | | curr: 1 |
| | | } |
| | | infoOptions.cols = colsa; |
| | | //判断单据明细信息是否为寄存明细 |
| | | if(res.data[0].SkuNo == "100088") |
| | | { |
| | | infoOptions.cols = colsb; |
| | | // colsa = colsb; |
| | | console.log(colsa) |
| | | } |
| | | tableIns = table.render(infoOptions); |
| | | } else { //不成功 |
| | |
| | | } |
| | | }); |
| | | } |
| | | |
| | | var infoOptions = { |
| | | elem: '#LAY-app-content-list', |
| | | height: 'full-160', |
| | |
| | | limit: pageCnt, |
| | | limits: pageLimits, |
| | | cellMinWidth: 60, //全局定义常规单元格的最小宽度,layui 2.2.1 新增 |
| | | cols: [ |
| | | [ //标题栏 |
| | | { |
| | | field: 'LocatNo', |
| | | title: '储位编码', |
| | | align: 'center', |
| | | width: 110, |
| | | fixed: 'left', |
| | | },{ |
| | | field: 'PalletNo', |
| | | title: '托盘条码', |
| | | align: 'center', |
| | | width: 100, |
| | | fixed: 'left', |
| | | }, { |
| | | field: 'SkuNo', |
| | | title: '物品编码', |
| | | width: 100, |
| | | align: 'center', |
| | | fixed: 'left', |
| | | }, { |
| | | field: 'SkuName', |
| | | title: '物品名称', |
| | | minWidth: 200, |
| | | align: 'center', |
| | | fixed: 'left', |
| | | }, { |
| | | field: 'LotNo', |
| | | title: '批次', |
| | | align: 'center' |
| | | }, { |
| | | field: 'LotText', |
| | | title: '批次描述', |
| | | align: 'center', |
| | | }, { |
| | | field: 'Standard', |
| | | title: '物品规格', |
| | | align: 'center', |
| | | minWidth: 100 |
| | | }, { |
| | | field: 'RoadwayNo', |
| | | title: '所属巷道', |
| | | align: 'center', |
| | | width: 100 |
| | | }, { |
| | | field: 'Qty', |
| | | title: '库存数量', |
| | | width: 100, |
| | | fixed: 'right', |
| | | align: 'center', |
| | | }, { |
| | | field: 'ExportQty', |
| | | title: '出库数量', |
| | | align: 'center', |
| | | width: 100, |
| | | fixed: 'right', |
| | | edit: 'number', |
| | | event: 'dataNumber', |
| | | } |
| | | ] |
| | | ], |
| | | cols: null, |
| | | //标题栏 |
| | | |
| | | |
| | | }; |
| | | |
| | | //获取仓库下拉框数据 |
| | |
| | | var html = ''; |
| | | if(d.IsWave == '0'){ |
| | | if(d.Status == '0' || d.Status == '1' ){ |
| | | html += `<a class="layui-btn layui-btn-normal layui-btn-xs zifenClass" lay-event="auto"> |
| | | <i class="layui-icon layui-icon-ok"></i>自动分配 |
| | | </a>`; |
| | | if(d.Type != "8") { |
| | | html += `<a class="layui-btn layui-btn-normal layui-btn-xs zifenClass" lay-event="auto"> |
| | | <i class="layui-icon layui-icon-ok"></i>自动分配 |
| | | </a>`; |
| | | } |
| | | } |
| | | if(d.Status == '0' && d.Origin == 'WMS'){ |
| | | html += `<a class="layui-btn layui-btn-normal layui-btn-xs uptClass" lay-event="edit"> |
| | |
| | | </form> |
| | | </div> |
| | | |
| | | <br> |
| | | <!-- <br> --> |
| | | |
| | | <div id="" class="cut-line"> |
| | | <img src="/assets/fengexian.png"> |
| | |
| | | |
| | | </table> |
| | | |
| | | <!-- <div id="demodiv" class="layui-form-item layout-input"> |
| | | <label class="layui-form-label" lang>寄存备注:</label> |
| | | <div class="layui-input-block"> |
| | | <textarea placeholder="请输入内容" id="Demo" name="Demo" class="layui-textarea" ></textarea> |
| | | |
| | | </div> |
| | | </div> --> |
| | | <!-- 维护备注弹框 --> |
| | | <div id="demodiv" class="layui-form-item layout-input" style="height: auto;"> |
| | | <label class="layui-form-label">寄存备注:</label> |
| | | <div class="layui-input-inline" style="width: 365px;height: auto;"> |
| | | <textarea placeholder="请输入内容" id="NoticeDemo" name="NoticeDemo" class="layui-textarea" ></textarea> |
| | | </div> |
| | | <br> |
| | | </div> |
| | | |
| | | <table class="layout-tbl-submit" border="" cellspacing="" cellpadding=""> |
| | | <tr> |
| | | <td style="width: 23%;"></td> |
| | |
| | | </div> |
| | | |
| | | <br> |
| | | <br> |
| | | <div id="demodiv1"> |
| | | <br><br><br><br><br><br><br> |
| | | </div> |
| | | |
| | | |
| | | <div id="" class="cut-line"> |
| | | <img src="/assets/fengexian.png"> |
| | |
| | | var form = layui.form |
| | | |
| | | /* 标签切换代码 */ |
| | | |
| | | $('#demodiv').hide(); |
| | | $('#demodiv1').hide(); |
| | | var xianshiyemian = 0; |
| | | |
| | | $('#option1').attr("style", "background-color: aqua;width: 45.77%;float: left;text-align: center;"); //选中后颜色 |
| | |
| | | xianshiyemian = 1; |
| | | $('#content1').hide(); |
| | | $('#option1').attr("style", "background-color: #999;width: 45.77%;float: left;text-align: center;"); //默认颜色 |
| | | |
| | | |
| | | |
| | | $('#content2').show(); |
| | | $('#option2').attr("style", "background-color: aqua;width: 45.77%;float: right;text-align: center;"); //选中后颜色 |
| | | |
| | |
| | | }); |
| | | //选中入库单事件-数量 |
| | | form.on('select(getbar1)', function (data) { |
| | | updateDemoDiv(); |
| | | updateGoodList() |
| | | setOrderGoods(); |
| | | }); |
| | |
| | | AsnDetailId: parseInt($("#goodSelect1").val()), //入库单明细ID |
| | | LotNo: $("#goodSelect1").find("option:selected").text(), //物料批次 |
| | | SkuQty: parseInt($("#SkuQty").val()), //物料数量 |
| | | Demo: $("#NoticeDemo").val(), //物料数量 |
| | | Origin: "PDA" |
| | | } |
| | | |
| | |
| | | return false; //阻止表单跳转。如果需要表单跳转,去掉这段即可。 |
| | | }); |
| | | |
| | | |
| | | // 根据入库单号 获取备注是否显示及备注信息 |
| | | function updateDemoDiv() { |
| | | var param = { |
| | | AsnNo: $("#bar1").val(), |
| | | }; |
| | | synData(IP + "/PdaAsn/GetArrivalNotice", param, 'post', function (res) { |
| | | console.log(res) |
| | | if (res.code == 0 && res.data != null) { //成功 |
| | | |
| | | //判断默认选中是否为寄存物料 |
| | | if(res.data[0].Type == "7") |
| | | { |
| | | $("textarea[name='NoticeDemo']").val(res.data[0].Demo); //备注 |
| | | $('#demodiv').show(); |
| | | $('#demodiv1').show(); |
| | | } |
| | | else |
| | | { |
| | | $('#demodiv').hide(); |
| | | $('#demodiv1').hide(); |
| | | } |
| | | } |
| | | else{ |
| | | $('#demodiv').hide(); |
| | | $('#demodiv1').hide(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | // 根据入库明细ID 获取详细信息 |
| | | function setOrderGoods() { |
| | |
| | | $("#Standard1").val(res.data.Standard); |
| | | $("#ImportFactQuantity1").val(res.data.FactQty + ""); |
| | | } |
| | | else{} |
| | | }); |
| | | } |
| | | |
| | |
| | | asnDetails = res.data; |
| | | for (var i = 0; i < res.data.length; i++) { |
| | | if (skuNo != '' && skuNo == res.data[i].SkuNo) { |
| | | |
| | | if (i == 0) { |
| | | $("#goodSelect1").append('<option value =' + res.data[i].Id + ' selected>' + res.data[i] |
| | | .SkuName); |
| | |
| | | $('#goodSelect1').siblings("div.layui-form-select").find('dl').find(sel).addClass('layui-this') |
| | | } |
| | | } else { |
| | | |
| | | } |
| | | }); |
| | | } |
| | |
| | | /// Nullable:True |
| | | /// </summary> |
| | | public string OwnerName { get; set; } |
| | | |
| | | |
| | | /// <summary> |
| | | /// Desc:备注 |
| | | /// Default: |
| | | /// Nullable:True |
| | | /// </summary> |
| | | public string Demo { get; set; } |
| | | } |
| | | } |
| | |
| | | /// Desc:批次号 |
| | | /// </summary> |
| | | public string LotNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// Desc:备注 |
| | | /// </summary> |
| | | public string Demo { get; set; } |
| | | } |
| | | } |
| | |
| | | skuType = "(4)"; |
| | | break; |
| | | case "7"://寄存入库 |
| | | skuType = "(0,1,2,3,4)"; |
| | | skuType = "(3)"; |
| | | break; |
| | | default: //其它 |
| | | skuType = "(0,1,2,3,4)"; |
| | |
| | | PackagNo = noticeDetail.PackagNo, |
| | | IsBale = item.IsBale, |
| | | IsBelt = item.IsBelt, |
| | | Demo = item.Demo, |
| | | |
| | | OwnerNo = ownerNo, |
| | | OwnerName = ownerName, |
| | |
| | | } |
| | | } |
| | | |
| | | //根据入库单号获取入库总单信息 |
| | | public List<BllArrivalNotice> GetArrivalNotice(ArrivalNoticeVm model) |
| | | { |
| | | string sqlString = string.Empty; |
| | | try |
| | | { |
| | | sqlString = $"select * from BllArrivalNotice where ASNNo = '{model.ASNNo}' and isdel='0' "; |
| | | var modelList = Db.Ado.SqlQuery<BllArrivalNotice>(sqlString); |
| | | |
| | | return modelList; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | throw ex; |
| | | } |
| | | } |
| | | |
| | | // 根据单据号获取单据明细列表 |
| | | public List<ArrivalNoticeDetailDto> GetArrivalNoticeDetails(ArrivalNoticeVm model) |
| | | { |
| | |
| | | /// </summary> |
| | | /// <param name="locatNo">储位编码</param> |
| | | /// <returns></returns> |
| | | public string CheckLocatNo(string locatNo) |
| | | public string CheckLocatNo(string locatNo) |
| | | { |
| | | try |
| | | { |
| | |
| | | { |
| | | model.LotNo = model.LotNo.Substring(indexOfDash + 1); |
| | | } |
| | | else |
| | | { |
| | | model.LotNo = ""; |
| | | } |
| | | } |
| | | //判断物料数量是否为0 为0判断箱码信息 不为0继续 |
| | | if (model.SkuQty == 0) |
| | |
| | | |
| | | } |
| | | } |
| | | int isDeposit = 0; |
| | | //判断总单单据是否为寄存单据 |
| | | if (notice.Type == "7") |
| | | { |
| | | isDeposit = 1; |
| | | } |
| | | if (isDeposit == 1) |
| | | { |
| | | //判断总单备注是否为空 |
| | | if (!string.IsNullOrWhiteSpace(notice.Demo)) |
| | | { |
| | | //分割总单备注及托盘备注 |
| | | var noticeDemo = notice.Demo.Split('、'); //总单备注 |
| | | var palletDemo = model.Demo.Split('、'); //托盘备注 |
| | | |
| | | //循环托盘备注 |
| | | foreach (var itemPallet in palletDemo) |
| | | { |
| | | int isDemo = 0; |
| | | //循环总单备注 |
| | | foreach (var itemNotice in noticeDemo) |
| | | { |
| | | //判断是否有相同备注 |
| | | if (itemPallet == itemNotice) |
| | | { |
| | | isDemo = 1; |
| | | break; |
| | | } |
| | | } |
| | | if (isDemo == 0) |
| | | { |
| | | throw new Exception("-1:总单备注与托盘备注不符,请核实后重新绑定!"); |
| | | } |
| | | } |
| | | } |
| | | else if (string.IsNullOrWhiteSpace(notice.Demo)) |
| | | { |
| | | //判断托盘备注是否为空 |
| | | if (!string.IsNullOrWhiteSpace(model.Demo)) |
| | | { |
| | | throw new Exception("-1:请添加总单备注后输入托盘备注!"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | #endregion |
| | | |
| | | Db.BeginTran(); |
| | |
| | | var package = Db.Queryable<SysPackag>().Where(m => m.IsDel == "0"); |
| | | var sku = Db.Queryable<SysMaterials>().First(m => m.IsDel == "0" && m.SkuNo == detail.SkuNo); |
| | | var pack = package.First(m => m.IsDel == "0" && m.PackagNo == sku.PackagNo); |
| | | if (pack == null) |
| | | { |
| | | throw new Exception("-1:获取物料包装失败,请核实!"); |
| | | } |
| | | |
| | | var pNum = 0;//托盘物品数量 |
| | | var bNum = 0;//箱码物品数量 |
| | | if (pack.L5Num.HasValue) |
| | | |
| | | //判断是否为寄存物料 |
| | | if (isDeposit == 0) |
| | | { |
| | | pNum = (int)pack.L5Num; |
| | | bNum = (int)pack.L4Num; |
| | | } |
| | | else if (pack.L4Num.HasValue) |
| | | { |
| | | pNum = (int)pack.L4Num; |
| | | bNum = (int)pack.L3Num; |
| | | } |
| | | else if (pack.L3Num.HasValue) |
| | | { |
| | | pNum = (int)pack.L3Num; |
| | | bNum = (int)pack.L2Num; |
| | | } |
| | | else if (pack.L2Num.HasValue) |
| | | { |
| | | pNum = (int)pack.L2Num; |
| | | bNum = (int)pack.L1Num; |
| | | } |
| | | else if (pack.L1Num.HasValue) |
| | | { |
| | | pNum = (int)pack.L1Num; |
| | | bNum = (int)pack.L1Num; |
| | | } |
| | | if (pNum == 0 || bNum == 0) |
| | | { |
| | | throw new Exception($"绑定失败,{detail.SkuNo}物品包装未找到!"); |
| | | if (pack == null) |
| | | { |
| | | throw new Exception("-1:获取物料包装失败,请核实!"); |
| | | } |
| | | if (pack.L5Num.HasValue) |
| | | { |
| | | pNum = (int)pack.L5Num; |
| | | bNum = (int)pack.L4Num; |
| | | } |
| | | else if (pack.L4Num.HasValue) |
| | | { |
| | | pNum = (int)pack.L4Num; |
| | | bNum = (int)pack.L3Num; |
| | | } |
| | | else if (pack.L3Num.HasValue) |
| | | { |
| | | pNum = (int)pack.L3Num; |
| | | bNum = (int)pack.L2Num; |
| | | } |
| | | else if (pack.L2Num.HasValue) |
| | | { |
| | | pNum = (int)pack.L2Num; |
| | | bNum = (int)pack.L1Num; |
| | | } |
| | | else if (pack.L1Num.HasValue) |
| | | { |
| | | pNum = (int)pack.L1Num; |
| | | bNum = (int)pack.L1Num; |
| | | } |
| | | if (pNum == 0 || bNum == 0) |
| | | { |
| | | throw new Exception($"绑定失败,{detail.SkuNo}物品包装未找到!"); |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | |
| | | BitPalletMark = "1", |
| | | IsBale = "0", |
| | | IsBelt = "0", |
| | | CreateUser = userId |
| | | CreateUser = userId, |
| | | Demo = model.Demo, |
| | | |
| | | }; |
| | | if (model.SkuQty > pNum) |
| | | if (model.SkuQty > pNum && isDeposit == 0) |
| | | { |
| | | throw new Exception($"绑定失败,{model.PalletNo}托盘绑定数量大于该物品托盘包装数量!"); |
| | | } |
| | |
| | | // 更新托盘绑定表 |
| | | bind.Qty += factQty; |
| | | } |
| | | if (bind.FullQty < bind.Qty) |
| | | if (bind.FullQty < bind.Qty && isDeposit == 0) |
| | | { |
| | | throw new Exception("托盘绑定数量已超出该物料包装数量"); |
| | | } |
| | |
| | | { |
| | | bind.BitPalletMark = "0"; |
| | | } |
| | | if (bind.Qty > pNum) |
| | | if (bind.Qty > pNum && isDeposit == 0) |
| | | { |
| | | throw new Exception($"绑定失败,{bind.PalletNo}托盘绑定数量大于该物品托盘包装数量!"); |
| | | } |
| | |
| | | { |
| | | // 不贴码物料 无需验证箱码信息 |
| | | } |
| | | else |
| | | else |
| | | { |
| | | //验证箱码信息是否存在 |
| | | if (boxInfoList.Count <= 0) |
| | |
| | | case "6"://代储出库 |
| | | skuType = "(2)"; |
| | | break; |
| | | case "8"://寄存出库 |
| | | skuType = "(3)"; |
| | | break; |
| | | default: //其它出库 |
| | | skuType = "(0,1,2,3,4)"; |
| | | break; |
| | |
| | | LocatNo = a.LocatNo, |
| | | RoadwayNo = a.RoadwayNo, |
| | | PalletNo = a.PalletNo, |
| | | Demo = a.Demo, |
| | | }).ToList(); |
| | | |
| | | return list; |
| | |
| | | /// </summary> |
| | | public string IsBelt {get;set;} |
| | | |
| | | |
| | | /// <summary> |
| | | /// Desc:备注 |
| | | /// Default: |
| | | /// Nullable:True |
| | | /// </summary> |
| | | public string Demo { get; set; } |
| | | |
| | | } |
| | | } |
| | |
| | | /// </summary> |
| | | public string IsBelt {get;set;} |
| | | |
| | | |
| | | /// <summary> |
| | | /// Desc:备注 |
| | | /// Default: |
| | | /// Nullable:True |
| | | /// </summary> |
| | | public string Demo { get; set; } |
| | | |
| | | } |
| | | } |
| | |
| | | // 根据单据号获取单据明细列表 |
| | | List<ArrivalNoticeDetailDto> GetArrivalNoticeDetails(ArrivalNoticeVm model); |
| | | |
| | | //根据入库单号获取入库总单信息 |
| | | List<BllArrivalNotice> GetArrivalNotice(ArrivalNoticeVm model); |
| | | |
| | | // 根据单据明细ID获取明细详情 |
| | | ArrivalNoticeDetailDto GetArrivalNoticeDetail(ArrivalNoticeDetailVm model); |
| | | |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 根据入库单获取入库总单信息 |
| | | /// </summary> |
| | | /// <param name="model">ASNNo:入库单号</param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public IActionResult GetArrivalNotice(ArrivalNoticeVm model) |
| | | { |
| | | try |
| | | { |
| | | var models = _PdaAsnSvc.GetArrivalNotice(model); |
| | | |
| | | if (models == null) |
| | | { |
| | | return Ok(new { code = 1, msg = "入库单信息", data = models }); |
| | | } |
| | | else |
| | | { |
| | | return Ok(new { code = 0, msg = "入库单信息", data = models }); |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return Ok(new { code = 1, msg = e.Message }); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 判断托盘是否可用 |
| | | /// </summary> |
| | | /// <param name="model">PalletNo:托盘条码</param> |