Demo
2024-02-03 75b62c70cb63bc3ed438485573dacce93b43d55c
添加生成标签按钮权限,修改获取入库单明细信息
7个文件已修改
132 ■■■■ 已修改文件
HTML/views/ASNSetting/ArrivalNotice.html 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HTML/views/ASNSetting/LabelPrint.html 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/Model/ModelDto/BllAsnDto/ArrivalNoticeDetailDto.cs 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.BLL/BllAsnServer/ArrivalNoticeServer.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.BLL/BllAsnServer/BllBoxInfoServer.cs 91 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.IBLL/IBllAsnServer/IBllBoxInfoServer.cs 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/Wms/Controllers/BllAsnController.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HTML/views/ASNSetting/ArrivalNotice.html
@@ -303,13 +303,14 @@
 
                    <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;
@@ -890,6 +891,8 @@
                    $(".clossClass").hide(); 
                    $(".editDemoClass").hide();//备注
                    $(".checkClass").hide(); //复核
                    $(".addLabelClass").hide(); //复核
                });
                sendData(IP + "/Basis/GetRoleRightList", {}, 'get', function(res) {
                    if (res.code == 0) { //成功 
@@ -929,6 +932,11 @@
                                    $(".checkClass").show(); 
                                });
                            }
                            if (res.data[k].MenuName == "生成标签") {
                                $(function() {
                                    $(".addLabelClass").show();
                                });
                            }
                        }
                    } else { //不成功
                        layer.msg('获取权限信息失败', {
HTML/views/ASNSetting/LabelPrint.html
@@ -139,16 +139,11 @@
                        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,
Wms/Model/ModelDto/BllAsnDto/ArrivalNoticeDetailDto.cs
@@ -128,6 +128,13 @@
        /// </summary>           
        public string Status { get; set; }
        /// <summary>
        /// Desc:单据类型
        /// Default:
        /// Nullable:True
        /// </summary>
        public string AsnType { get; set; }
        public string AsnStatus { get; set; }
        /// <summary>
Wms/WMS.BLL/BllAsnServer/ArrivalNoticeServer.cs
@@ -103,7 +103,7 @@
                    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 ";
Wms/WMS.BLL/BllAsnServer/BllBoxInfoServer.cs
@@ -529,7 +529,7 @@
        }
        //获取标签信息(生成标签)
        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
            { 
@@ -586,40 +586,14 @@
                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.L2Name != "托")
                    {
                        packLevel = 2;
                        bNum = Convert.ToInt32(pack.L2Num);
                    }
                }
                if (pack.L1Num.HasValue)
                {
@@ -633,7 +607,7 @@
                if (packLevel <= 1)//包装等级小于1,按照1级标签打印
                {
                    packLevel = 1;
                    throw new Exception("包装信息有误,小于一级");
                }
                #endregion
@@ -744,12 +718,12 @@
                        //获取箱码
                        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');
                        } 
                        
                        // 将条码保存到原料条码表
@@ -868,15 +842,34 @@
                    for (int i = 1; i <= labelNum2; i++)//箱码标签
                    {
                        //获取箱码
                        if (maxboxcode2 == "")
                        //箱内数量
                        decimal boxQty = 0;
                        if (i == labelNum2)
                        {
                            maxboxcode2 = maxCodestr2 + "000001"; // 箱号     批号+第几箱
                            // 最后一个条码
                            var s = bNum * (i - 1);
                            if (bNum > qty2 - s)
                            {
                                boxQty = qty2 - s;// 数量
                            }
                            else
                            {
                                boxQty = bNum;// 数量
                            }
                        }
                        else
                        {
                            maxboxcode2 = maxboxcode2.Substring(0, 10) + (int.Parse(maxboxcode2.Substring(10, 6)) + 1).ToString().PadLeft(6, '0');
                            boxQty = bNum;                                                         // 数量
                        }
                        //获取箱码
                        if (maxboxcode2 == "")
                        {
                            maxboxcode2 = "B"+maxCodestr2 + "000001"; // 箱号     批号+第几箱
                        }
                        else
                        {
                            maxboxcode2 = maxboxcode2.Substring(0, 11) + (int.Parse(maxboxcode2.Substring(11, 6)) + 1).ToString().PadLeft(6, '0');
                        }
                        //获取箱内支标签数量
                        if (i == labelNum2)
@@ -888,6 +881,12 @@
                                if (isGo2)
                                {
                                    break;
                                }
                                var s = bNum * (i - 1);
                                var s2 = zNum * (j - 1);
                                if (zNum >= qty2 - s - s2)
                                {
                                    isGo2 = true;
                                }
                                sl++;
                            }
@@ -910,11 +909,11 @@
                            
                            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');
                            }
                            // 将条码保存到原料条码表
@@ -934,7 +933,7 @@
                                PackageStandard = packStr,
                                SupplierLot = asnList.SupplierLot,
                                InspectMark = "0",
                                BitBoxMark = bNum > d ? "1" : "0",
                                BitBoxMark = bNum > boxQty ? "1" : "0",
                                InspectStatus = "0",
                                ProductionTime = DateTime.Parse(productionTime),
@@ -956,10 +955,10 @@
                    #endregion
                }
                //return labelModel;
                return modelList;
                throw new NotImplementedException();
                //throw new NotImplementedException();
            }
            catch (Exception e)
            {
Wms/WMS.IBLL/IBllAsnServer/IBllBoxInfoServer.cs
@@ -4,6 +4,7 @@
using System.Collections.Generic;
using System.Text;
using Model.ModelDto.BllAsnDto;
using WMS.Entity.BllAsnEntity;
namespace WMS.IBLL.IBllAsnServer
{
@@ -54,7 +55,7 @@
        /// <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);
    }
}
Wms/Wms/Controllers/BllAsnController.cs
@@ -892,8 +892,8 @@
                {
                    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)
            {