| | |
| | | |
| | | <script type="text/html" id="toolbarDemoList"> |
| | | {{# function GetBtn2(d){ |
| | | console.log(d); |
| | | var html = ``; |
| | | if(d.Status == "0"){ |
| | | html = `<a class="layui-btn layui-btn-danger layui-btn-xs delClass" lay-event="del"> |
| | | <i class="layui-icon layui-icon-delete"></i>删除</a>`; |
| | | } |
| | | if(d.Status == "0" || d.Status == "1"){ |
| | | html += `<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="Addlabel"> |
| | | if((d.AsnType =="1" || d.AsnType == "4") && (d.Status == "0" || d.Status == "1")){ |
| | | html += `<a class="layui-btn layui-btn-normal layui-btn-xs addLabelClass" lay-event="Addlabel"> |
| | | <i class="layui-icon layui-icon-edit"></i>生成标签</a>`; |
| | | } |
| | | return html; |
| | |
| | | $(".clossClass").hide(); |
| | | $(".editDemoClass").hide();//备注 |
| | | $(".checkClass").hide(); //复核 |
| | | $(".addLabelClass").hide(); //复核 |
| | | |
| | | }); |
| | | sendData(IP + "/Basis/GetRoleRightList", {}, 'get', function(res) { |
| | | if (res.code == 0) { //成功 |
| | |
| | | $(".checkClass").show(); |
| | | }); |
| | | } |
| | | if (res.data[k].MenuName == "生成标签") { |
| | | $(function() { |
| | | $(".addLabelClass").show(); |
| | | }); |
| | | } |
| | | } |
| | | } else { //不成功 |
| | | layer.msg('获取权限信息失败', { |
| | |
| | | layer.msg(res.msg, { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }, function () { }); |
| | | // $("#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); |
| | | }, function () { |
| | | parent.location.reload(); |
| | | parent.layer.close(layer.index); |
| | | }); |
| | | |
| | | // $("#imgBar").attr("src", res.data[0].imageStr); |
| | | } else { //不成功 |
| | | layer.msg(res.msg, { |
| | | icon: 2, |
| | |
| | | /// </summary> |
| | | public string Status { get; set; } |
| | | |
| | | /// <summary> |
| | | /// Desc:单据类型 |
| | | /// Default: |
| | | /// Nullable:True |
| | | /// </summary> |
| | | public string AsnType { get; set; } |
| | | |
| | | public string AsnStatus { get; set; } |
| | | |
| | | /// <summary> |
| | |
| | | rowCount = count; |
| | | } |
| | | |
| | | sqlString += "SELECT DISTINCT tb1.*,tb2.Status as AsnStatus,tb3.RealName as CreateUserName, "; |
| | | sqlString += "SELECT DISTINCT tb1.*,tb2.Type as AsnType,tb2.Status as AsnStatus,tb3.RealName as CreateUserName, "; |
| | | sqlString += "tb4.RealName as UpdateUserName,isnull(tb6.UnitName,tb5.UnitNo) as UnitName,tb7.PackagName "; |
| | | sqlString += "FROM BllArrivalNoticeDetail AS tb1 "; |
| | | sqlString += "LEFT JOIN BllArrivalNotice AS tb2 ON tb1.ASNNo = tb2.ASNNo "; |
| | |
| | | } |
| | | |
| | | //获取标签信息(生成标签) |
| | | public List<BoxInfoDto> AddLabelBoxReturn(int imId, string isReset, decimal arriveQty, string productionTime, string expirationTime, string storeTime, int userId) |
| | | public List<BllBoxInfo> AddLabelBox(int imId, string isReset, decimal arriveQty, string productionTime, string expirationTime, string storeTime, int userId) |
| | | { |
| | | try |
| | | { |
| | |
| | | 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) |
| | | { |
| | | if (pack.L2Name != "托") |
| | | { |
| | | packLevel = 2; |
| | | bNum = Convert.ToInt32(pack.L2Num); |
| | | |
| | | } |
| | | } |
| | | if (pack.L1Num.HasValue) |
| | | { |
| | |
| | | |
| | | if (packLevel <= 1)//包装等级小于1,按照1级标签打印 |
| | | { |
| | | packLevel = 1; |
| | | throw new Exception("包装信息有误,小于一级"); |
| | | } |
| | | |
| | | #endregion |
| | |
| | | //获取箱码 |
| | | if (maxBoxCode == "") |
| | | { |
| | | var str = maxLotNoStr + "000001"; //批号+ 流水 2302010001000001 |
| | | var str = "B"+maxLotNoStr + "000001"; //批号+ 流水 2302010001000001 |
| | | maxBoxCode = str; |
| | | } |
| | | else |
| | | { |
| | | maxBoxCode = maxBoxCode.Substring(0, 10) + (int.Parse(maxBoxCode.Substring(10, 6)) + 1).ToString().PadLeft(6, '0'); |
| | | maxBoxCode = maxBoxCode.Substring(0, 11) + (int.Parse(maxBoxCode.Substring(11, 6)) + 1).ToString().PadLeft(6, '0'); |
| | | } |
| | | |
| | | // 将条码保存到原料条码表 |
| | |
| | | |
| | | for (int i = 1; i <= labelNum2; i++)//箱码标签 |
| | | { |
| | | //箱内数量 |
| | | decimal boxQty = 0; |
| | | if (i == labelNum2) |
| | | { |
| | | // 最后一个条码 |
| | | var s = bNum * (i - 1); |
| | | if (bNum > qty2 - s) |
| | | { |
| | | boxQty = qty2 - s;// 数量 |
| | | } |
| | | else |
| | | { |
| | | boxQty = bNum;// 数量 |
| | | } |
| | | } |
| | | else |
| | | { |
| | | boxQty = bNum; // 数量 |
| | | } |
| | | |
| | | //获取箱码 |
| | | if (maxboxcode2 == "") |
| | | { |
| | | maxboxcode2 = maxCodestr2 + "000001"; // 箱号 批号+第几箱 |
| | | maxboxcode2 = "B"+maxCodestr2 + "000001"; // 箱号 批号+第几箱 |
| | | } |
| | | else |
| | | { |
| | | maxboxcode2 = maxboxcode2.Substring(0, 10) + (int.Parse(maxboxcode2.Substring(10, 6)) + 1).ToString().PadLeft(6, '0'); |
| | | maxboxcode2 = maxboxcode2.Substring(0, 11) + (int.Parse(maxboxcode2.Substring(11, 6)) + 1).ToString().PadLeft(6, '0'); |
| | | } |
| | | //获取箱内支标签数量 |
| | | if (i == labelNum2) |
| | |
| | | if (isGo2) |
| | | { |
| | | break; |
| | | } |
| | | var s = bNum * (i - 1); |
| | | var s2 = zNum * (j - 1); |
| | | if (zNum >= qty2 - s - s2) |
| | | { |
| | | isGo2 = true; |
| | | } |
| | | sl++; |
| | | } |
| | |
| | | |
| | | if (maxboxcode3 == "") |
| | | { |
| | | maxboxcode3 = maxCodestr2 + "0001"; // 支号 批号+第几箱 |
| | | maxboxcode3 = "Z"+maxCodestr2 + "0001"; // 支号 批号+第几箱 |
| | | } |
| | | else |
| | | { |
| | | maxboxcode3 = maxboxcode3.Substring(0, 28) + (int.Parse(maxboxcode3.Substring(28, 4)) + 1).ToString().PadLeft(4, '0'); |
| | | maxboxcode3 = maxboxcode3.Substring(0, 11) + (int.Parse(maxboxcode3.Substring(11, 4)) + 1).ToString().PadLeft(4, '0'); |
| | | } |
| | | |
| | | // 将条码保存到原料条码表 |
| | |
| | | PackageStandard = packStr, |
| | | SupplierLot = asnList.SupplierLot, |
| | | InspectMark = "0", |
| | | BitBoxMark = bNum > d ? "1" : "0", |
| | | BitBoxMark = bNum > boxQty ? "1" : "0", |
| | | InspectStatus = "0", |
| | | |
| | | ProductionTime = DateTime.Parse(productionTime), |
| | |
| | | #endregion |
| | | } |
| | | |
| | | //return labelModel; |
| | | return modelList; |
| | | |
| | | |
| | | throw new NotImplementedException(); |
| | | //throw new NotImplementedException(); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | |
| | | using System.Collections.Generic; |
| | | using System.Text; |
| | | using Model.ModelDto.BllAsnDto; |
| | | using WMS.Entity.BllAsnEntity; |
| | | |
| | | namespace WMS.IBLL.IBllAsnServer |
| | | { |
| | |
| | | /// <param name="storeTime">储存期至</param> |
| | | /// <param name="userId">操作人</param> |
| | | /// <returns></returns> |
| | | List<BoxInfoDto> AddLabelBoxReturn(int imId, string isReset, decimal arriveQty, string productionTime, string expirationTime, string storeTime, int userId); |
| | | List<BllBoxInfo> AddLabelBox(int imId, string isReset, decimal arriveQty, string productionTime, string expirationTime, string storeTime, int userId); |
| | | |
| | | } |
| | | } |
| | |
| | | { |
| | | return Ok(new { code = 1, msg = "未获取到当前操作人信息" }); |
| | | } |
| | | var list = _BoxInfoSvc.AddLabelBoxReturn(model.Id, model.IsReset, decimal.Parse(model.ArriveQty), model.ProductionTime, model.ExpirationTime, model.StoreTime, int.Parse(userId)); |
| | | return Ok(new { code = 0, msg = "箱码标签列表", data = list }); |
| | | var list = _BoxInfoSvc.AddLabelBox(model.Id, model.IsReset, decimal.Parse(model.ArriveQty), model.ProductionTime, model.ExpirationTime, model.StoreTime, int.Parse(userId)); |
| | | return Ok(new { code = 0, msg = "生成箱码标签成功", data = list }); |
| | | } |
| | | catch (Exception e) |
| | | { |