chengsc
2024-10-14 b31f32fbfb25c77567e3853e05ca114dd2a00fbe
修改问题
9个文件已修改
368 ■■■■■ 已修改文件
HTML/views/ASNSetting/LabelBox.html 111 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HTML/views/ASNSetting/LabelBoxBuDa.html 52 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/Model/ModelVm/BllAsnVm/BoxInfoVm.cs 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.BLL/BllAsnServer/ArrivalNoticeServer.cs 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.BLL/BllAsnServer/BllBoxInfoServer.cs 139 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.BLL/BllSoServer/ExportNoticeServer.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.IBLL/IBllAsnServer/IBllBoxInfoServer.cs 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/Wms/Controllers/BllAsnController.cs 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HTML/views/ASNSetting/LabelBox.html
@@ -128,7 +128,7 @@
                            <i class="layui-icon layui-icon-delete layuiadmin-button-btn"></i>删除标签
                        </button>
                    </div>
                    <!-- 确认出库口弹窗 -->
                    <!-- 删除标签页面弹窗 -->
                    <div class="layui-inline" id="divDelLotNo" style="display: none; padding-top: 10px;">
                        <div class="layui-inline">
                            <label class="layui-form-label">入库单据</label>
@@ -146,6 +146,16 @@
                            </div>
                        </div>                            
                         
                    </div>
                    <!-- 编辑标签页面弹窗 -->
                    <div class="layui-inline" id="divEditQty" style="display: none; padding-top: 10px;">
                        <div class="layui-inline">
                            <label class="layui-form-label">数量</label>
                            <div class="layui-input-inline" style="width: 220px;">
                                <input type="text" id="LabelQty" name="LabelQty" placeholder="数量" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                    </div>
                </div>
            </div>
@@ -250,9 +260,9 @@
                <script type="text/html" id="toolbarDemoList">
                    {{# function GetBtn2(d){
                            var html = '';
                            if(d.Origin == "WMS生成" || 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.Origin == "WMS生成" && d.Status == "0"){
                                html = `<a class="layui-btn layui-btn-normal layui-btn-xs editClass" lay-event="edit">
                                    <i class="layui-icon layui-icon-delete"></i>编辑</a>`;
                                
                            }
                            return html;
@@ -391,45 +401,56 @@
                });
            });
            //明细表操作栏事件
            table.on('tool(Box-list)', function (obj) {
                var data = obj.data;
                var id = data.Id;
                switch(obj.event)
                {
                    case "edit" :
                        layer.open({
                            type: 1,
                            title: '编辑标签',
                            content: $('#divEditQty'),
                            maxmin: false,
                            area: ['350px','180px'],
                            btn: ['确定', '取消'],
                            yes: function(index, layero) {
                                var param = {
                                    Id: id,
                                    Qty: $('#LabelQty').val(),
                                };
                                sendData(IP + "/BllAsn/EditLabelQty", param, 'post', function(res) {
                                    if (res.code == 0) { //成功
                                        bindTable();
                                        layer.msg(res.msg, {
                                            icon: 1,
                                            time: 1500 //1秒关闭(如果不配置,默认是3秒)
                                        }, function() {
                                            $('#LabelQty').val("");
                                        });
                                    } else { //不成功
                                        layer.msg(res.msg, {
                                            icon: 2,
                                            time: 3000 //2秒关闭(如果不配置,默认是3秒)
                                        }, function() {
                                            bindTable();
                                            $('#LabelQty').val("");
                                        });
                                    }
                                    layer.close(index);
                                });
                            }
                        });
            // // 删除箱支信息
            // table.on('tool(Box-list)', function (obj) {
            //     var data = obj.data;
            //     switch (obj.event) {
            //         case "del":
            //             layer.confirm('确定删除箱支明细吗?', function (index) {
            //                 // 代码区域
            //                 var param = {
            //                     Id: data.Id,
            //                     Status: "0",
            //                 };
            //                 console.log(param);
            //                 sendData(IP + "/BllAsn/DelBllBoxInfo", param, 'post', function (res) {
            //                     if (res.code == 0) { //成功
            //                         layer.msg(res.msg, {
            //                             icon: 1,
            //                             time: 2000 //2秒关闭(如果不配置,默认是3秒)
            //                         }, function () {
            //                             bindTable();
            //                             doing = true
            //                         });
            //                     } else { //不成功
            //                         layer.msg(res.msg, {
            //                             icon: 2,
            //                             time: 2000 //2秒关闭(如果不配置,默认是3秒)
            //                         }, function () { doing = true });
            //                     }
            //                 });
            //             });
            //             break;
            //         default: break;
            //     }
            // });
            //#region 事件方法
                        break;
                    default:break;
                }
            });
            // 查询录入的箱支关系
            //#region 自定义表头
            var TotalColsArr = [[
                { field: 'ASNNo', title: '入库单号', align: 'center',fixed: 'left', width: 180, "disabled": true },
@@ -459,7 +480,7 @@
                { 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 }
                { field: 'caozuo', title: '操作', fixed: 'right', width: 100, align: 'center', toolbar: '#toolbarDemoList', "disabled": true }
            ]];
            //url编码
            var TotalColsSysArr = encodeURIComponent(encodeURIComponent(JSON.stringify(TotalColsArr)))//将表头数据进行url编码
@@ -522,6 +543,7 @@
                $(function () {
                    $(".buDaLabelClass").hide(); 
                    $(".delLabelClass").hide(); 
                    $(".editClass").hide();
                });
                sendData(IP + "/Basis/GetRoleRightList", {}, 'get', function (res) {
                    if (res.code == 0) { //成功 
@@ -536,6 +558,11 @@
                                    $(".delLabelClass").show();
                                });
                            } 
                            if (res.data[k].MenuName == "编辑标签") {
                                $(function () {
                                    $(".editClass").show();
                                });
                            }
                        }
                    } else { //不成功
                        layer.msg('获取权限信息失败', {
HTML/views/ASNSetting/LabelBoxBuDa.html
@@ -41,7 +41,7 @@
            display: block;
        }
        .font-size12{
            font-size: 12px;
            font-size: 10px;
        }
        .font-size10{
            font-size: 10px;
@@ -52,11 +52,11 @@
<body>
    <div style="width:100%;">
        <div class="layui-form hideCls" lay-filter="layuiadmin-app-form-list" id="print" style="width: 100%;height:100%;">
            <div style="display: flex;align-items: center;justify-content: center; height: 260px;">
                <table border="1" id="table" style="width: 90%; height:240px; text-align: center;border-collapse: collapse;table-layout: fixed;">
            <div style="display: flex;align-items: center;justify-content: center; height: 190px;">
                <table border="1" id="table" style="width: 90%; height:170px; text-align: center;border-collapse: collapse;table-layout: fixed;">
                    <tr> 
                        <td colspan="2">
                            <img src="../../img/LiNuo.jpg" style="width: 80%; height: 15px;" />
                            <img src="../../img/LiNuo.jpg" style="width: 80%; height: 13px;" />
                        </td>
                        <td colspan="2" style="padding: 1px 0px;" class="font-size12">SMP-ST002-R08-01</td> 
                    </tr>
@@ -67,12 +67,12 @@
                        <td class="font-size12">品名</td>
                        <td colspan="3" id="SkuName" class="font-size10"></td>
                    </tr>
                    <tr>
                    <!-- <tr>
                        <td class="font-size12">规格/型号</td>
                        <td id="Standard" class="font-size10"></td>
                        <td class="font-size12">包装规格</td>
                        <td id="PackageStandard" class="font-size10"></td>
                    </tr>
                    </tr> -->
                    <tr>
                        <td class="font-size12">进厂编号</td>
                        <td id="LotNo" class="font-size10"></td>
@@ -85,15 +85,15 @@
                        <td class="font-size12">数   量</td>
                        <td id="Qty" class="font-size10"></td> 
                    </tr>
                    <tr>
                    <!-- <tr>
                        <td class="font-size12">有效期至</td>
                        <td id="ExpirationTime" class="font-size10"></td>
                        <td class="font-size12">储存期至</td>
                        <td id="StoreTime" class="font-size10"></td> 
                    </tr>
                    </tr> -->
                    <tr> 
                        <td colspan="4" style="padding: 5px 0px;">
                            <img id="imgBar" style="width: 90%; height: 25px;" />
                        <td colspan="4" style="padding: 2px 0px;">
                            <img id="imgBar" style="width: 90%; height: 20px;" />
                        </td> 
                    </tr>
                    
@@ -241,11 +241,11 @@
                            $("#SkuName" + z.toString()).html( res.data[z].SkuName);
                             
                            $("#PackageStandard").attr("id", "PackageStandard" + z.toString());
                            $("#PackageStandard" + z.toString()).html(res.data[z].PackageStandard);
                            //$("#PackageStandard").attr("id", "PackageStandard" + z.toString());
                            //$("#PackageStandard" + z.toString()).html(res.data[z].PackageStandard);
                            $("#Standard").attr("id", "Standard" + z.toString());
                            $("#Standard" + z.toString()).html(res.data[z].Standard);
                            //$("#Standard").attr("id", "Standard" + z.toString());
                            //$("#Standard" + z.toString()).html(res.data[z].Standard);
                            $("#Qty").attr("id", "Qty" + z.toString());
                            $("#Qty" + z.toString()).html( res.data[z].Qty);
@@ -259,12 +259,12 @@
                            $("#SupplierLot").attr("id", "SupplierLot" + z.toString());
                            $("#SupplierLot" + z.toString()).html( res.data[z].SupplierLot);
                            $("#ExpirationTime").attr("id", "ExpirationTime" + z.toString());
                            $("#ExpirationTime" + z.toString()).html( formatDate2(res.data[z].ExpirationTime));
                            //$("#ExpirationTime").attr("id", "ExpirationTime" + z.toString());
                            //$("#ExpirationTime" + z.toString()).html( formatDate2(res.data[z].ExpirationTime));
                             
                            $("#StoreTime").attr("id", "StoreTime" + z.toString());
                            $("#StoreTime" + z.toString()).html(formatDate2(res.data[z].StoreTime));
                            //$("#StoreTime").attr("id", "StoreTime" + z.toString());
                            //$("#StoreTime" + z.toString()).html(formatDate2(res.data[z].StoreTime));
  
                            $("#imgBar").attr("id", "imgBar" + z.toString());
                            $("#imgBar" + z.toString()).attr("src", res.data[z].ImgStr);
@@ -279,14 +279,14 @@
                            $("#SkuName" + z.toString()).attr("id", "SkuName");
                            $("#SkuName").html("");
                            $("#PackageStandard" + z.toString()).attr("id", "PackageStandard");
                            $("#PackageStandard").html("");
                            //$("#PackageStandard" + z.toString()).attr("id", "PackageStandard");
                            //$("#PackageStandard").html("");
                            $("#Qty" + z.toString()).attr("id", "Qty");
                            $("#Qty").html("");
                            $("#Standard" + z.toString()).attr("id", "Standard");
                            $("#Standard").html("");
                            //$("#Standard" + z.toString()).attr("id", "Standard");
                            //$("#Standard").html("");
                            $("#LotNo" + z.toString()).attr("id", "LotNo");
                            $("#LotNo").html("");
@@ -294,11 +294,11 @@
                            $("#SupplierLot" + z.toString()).attr("id", "SupplierLot");
                            $("#SupplierLot").html("");
                            $("#StoreTime" + z.toString()).attr("id", "StoreTime");
                            $("#StoreTime").html("");
                            //$("#StoreTime" + z.toString()).attr("id", "StoreTime");
                            //$("#StoreTime").html("");
                            $("#ExpirationTime" + z.toString()).attr("id", "ExpirationTime");
                            $("#ExpirationTime").html("");
                            //$("#ExpirationTime" + z.toString()).attr("id", "ExpirationTime");
                            //$("#ExpirationTime").html("");
                            $("#imgBar" + z.toString()).attr("id", "imgBar");
                            $("#imgBar").attr("src", "");
Wms/Model/ModelVm/BllAsnVm/BoxInfoVm.cs
@@ -222,4 +222,14 @@
    }
    /// <summary>
    /// 补打物料标签Vm
    /// </summary>
    public class EditLabelQtyVm
    {
        public int Id { get; set; }
        public string Qty { get; set; }
    }
}
Wms/WMS.BLL/BllAsnServer/ArrivalNoticeServer.cs
@@ -193,7 +193,7 @@
                        skuType = "(0,1,3)";
                        break;
                    case "6"://代储入库
                        skuType = "(2)";
                        skuType = "(0,1,2,3,4)";
                        IsPack = 2; //不贴
                        break;
                    case "7"://寄存入库
@@ -326,11 +326,15 @@
                            continue;
                        }
                    }
                    if (detailModel.LotNo.Length!= 10)
                    if (model.Type != "7")
                    {
                        strMessage = "-1:进厂编号位数长度有误;";
                        continue;
                        if (detailModel.LotNo.Length != 10)
                        {
                            strMessage = "-1:进厂编号位数长度有误;";
                            continue;
                        }
                    }
                    if (model.Type == "1" && string.IsNullOrWhiteSpace(detailModel.SupplierLot)) //采购到货单原厂批号(供货批次)不能为空
                    {
                        strMessage = "-1:原厂批号不可为空;";
Wms/WMS.BLL/BllAsnServer/BllBoxInfoServer.cs
@@ -710,11 +710,11 @@
                        }
                        else
                        {
                            var labelCount = label.Where(m => m.ASNDetailNo == imId).ToList();
                            if (labelCount.Count <= 0)
                            {
                                throw new Exception("当前单据明细还未生成标签,请选择重置批次选项为‘是’;");
                            }
                            //var labelCount = label.Where(m => m.ASNDetailNo == imId).ToList();
                            //if (labelCount.Count <= 0)
                            //{
                            //    throw new Exception("当前单据明细还未生成标签,请选择重置批次选项为‘是’;");
                            //}
                            //maxLotNoStr = labelCount.Max(a => a.LotNo);
                            maxLotNoStr = asnList.LotNo;
                            //if (string.IsNullOrWhiteSpace(maxLotNoStr))
@@ -881,11 +881,11 @@
                        }
                        else
                        {
                            var labelCount = label.Where(m => m.ASNDetailNo == imId).ToList();
                            if (labelCount.Count <= 0)
                            {
                                throw new Exception("当前单据明细还未生成标签,请选择重置批次选项为‘是’;");
                            }
                            //var labelCount = label.Where(m => m.ASNDetailNo == imId).ToList();
                            //if (labelCount.Count <= 0)
                            //{
                            //    throw new Exception("当前单据明细还未生成标签,请选择重置批次选项为‘是’;");
                            //}
                            //maxCodestr2 = labelCount.Max(a => a.LotNo); ;
                            maxCodestr2 = asnList.LotNo;
                            
@@ -1698,17 +1698,17 @@
                        throw new Exception("当前单据批次的标签已有已使用,不能删除");
                    }
                    foreach (var item in asnList)
                    {
                        if (string.IsNullOrWhiteSpace(item.LotNo))
                        {
                            continue;
                        }
                    //foreach (var item in asnList)
                    //{
                    //    if (string.IsNullOrWhiteSpace(item.LotNo))
                    //    {
                    //        continue;
                    //    }
                        item.LotNo = "";
                        Db.Updateable(item).ExecuteCommand();
                    //    item.LotNo = "";
                    //    Db.Updateable(item).ExecuteCommand();
                    }
                    //}
                    Db.Deleteable(labelList).ExecuteCommand();
                }
                else  //删除固定批次标签
@@ -1719,37 +1719,37 @@
                        throw new Exception("当前单据批次的标签已有已使用,不能删除");
                    }
                    foreach (var item in asnList)
                    {
                        if (string.IsNullOrWhiteSpace(item.LotNo) || item.LotNo!=lotNo)
                        {
                            continue;
                        }
                    //foreach (var item in asnList)
                    //{
                    //    if (string.IsNullOrWhiteSpace(item.LotNo) || item.LotNo!=lotNo)
                    //    {
                    //        continue;
                    //    }
                        var strList = item.LotNo.Split(";");
                        var updateLotNo = "";
                        foreach (var str in strList)
                        {
                            if (string.IsNullOrWhiteSpace(str) || str == lotNo)
                            {
                                continue;
                            }
                    //    var strList = item.LotNo.Split(";");
                    //    var updateLotNo = "";
                    //    foreach (var str in strList)
                    //    {
                    //        if (string.IsNullOrWhiteSpace(str) || str == lotNo)
                    //        {
                    //            continue;
                    //        }
                            if (string.IsNullOrWhiteSpace(updateLotNo))
                            {
                                updateLotNo = str;
                            }
                            else
                            {
                                updateLotNo += ";" + str;
                            }
                    //        if (string.IsNullOrWhiteSpace(updateLotNo))
                    //        {
                    //            updateLotNo = str;
                    //        }
                    //        else
                    //        {
                    //            updateLotNo += ";" + str;
                    //        }
                             
                        }
                    //    }
                        item.LotNo = updateLotNo;
                        Db.Updateable(item).ExecuteCommand();
                    //    item.LotNo = updateLotNo;
                    //    Db.Updateable(item).ExecuteCommand();
                    }
                    //}
                    Db.Deleteable(labelList).ExecuteCommand();
                }
@@ -1771,5 +1771,54 @@
            }
        }
        //编辑标签数量
        public void EditLabelQty(int id, string qty, int userId)
        {
            try
            {
                if (string.IsNullOrWhiteSpace(qty))
                {
                    throw new Exception("编辑数量不可为空");
                }
                var qtyData = 0m;
                var isOk = decimal.TryParse(qty, out qtyData);
                var boxInfo = Db.Queryable<BllBoxInfo>().First(m => m.IsDel == "0" && m.Id == id);
                if (boxInfo == null)
                {
                    throw new Exception("未查询到该标签信息");
                }
                if (isOk)
                {
                    if (qtyData <= 0)
                    {
                        throw new Exception("数量不能小于等于0");
                    }
                    boxInfo.Qty = qtyData;
                    Db.Updateable(boxInfo).ExecuteCommand();
                }
                else
                {
                    throw new Exception("数量转换失败");
                }
                var msg = $"编辑了箱号:{boxInfo.BoxNo}";
                if (!string.IsNullOrWhiteSpace(boxInfo.BoxNo3))
                {
                    msg += $"、支号:{boxInfo.BoxNo3}";
                }
                msg += "的标签数量信息";
                new OperationASNServer().AddLogOperationAsn("入库作业", "物料标签", boxInfo.BoxNo, "编辑", msg, userId);
            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }
        }
    }
}
Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs
@@ -2536,7 +2536,7 @@
                            PackagNo = sku.PackagNo,
                            IsBale = bindInfo.IsBale,
                            IsBelt = bindInfo.IsBelt,
                            Demo = bindInfo.Demo,
                            CreateUser = (int)model.CreateUser,
                            CreateTime = serverTime
                        };
Wms/WMS.BLL/BllSoServer/ExportNoticeServer.cs
@@ -441,8 +441,8 @@
                        inspectStatus = "0,1";
                        break;
                    case "6"://代储出库
                        skuType = "(0,1,2,3)";
                        inspectStatus = "0,1";
                        skuType = "(0,1,2,3,4)";
                        inspectStatus = "0,1,2";
                        break;
                    case "8"://寄存出库
                        skuType = "(0,1,2,3)";
@@ -475,7 +475,7 @@
                    .AndIF(!string.IsNullOrWhiteSpace(inspectStatus), it => inspectStatus.Contains(it.InspectStatus))
                    .And(m => skuList.Contains(m.SkuNo))
                    .AndIF(type == "6", m => m.OwnerNo == ownerNo)//代储出库需要关联货主
                    .AndIF(type == "2", m=> string.IsNullOrWhiteSpace(m.OwnerNo))
                    .AndIF(type != "6", m=> string.IsNullOrWhiteSpace(m.OwnerNo))
                    .AndIF(!string.IsNullOrWhiteSpace(msg), it => (it.SkuNo.Contains(msg) || it.SkuName.Contains(msg) || it.LotNo.Contains(msg)))
                    .And(it => (it.Qty - it.LockQty - it.FrozenQty) > 0)
                    .And(it => (it.Status == "0" || it.Status == "1"))
Wms/WMS.IBLL/IBllAsnServer/IBllBoxInfoServer.cs
@@ -85,5 +85,13 @@
        /// <param name="userId">操作人ID</param>
        void DelLabelByAsnNo(string asnNo, string lotNo,int userId);
        /// <summary>
        /// 编辑标签数量
        /// </summary>
        /// <param name="id">ID</param>
        /// <param name="qty">数量</param>
        /// <param name="userId">操作人</param>
        void EditLabelQty(int id, string qty, int userId);
    }
}
Wms/Wms/Controllers/BllAsnController.cs
@@ -995,7 +995,33 @@
                return Ok(new { code = 1, count = 0, msg = e.Message });
            }
        }
        //编辑标签数量
        [HttpPost]
        public IActionResult EditLabelQty(EditLabelQtyVm model)
        {
            try
            {
                //获取当前登录的用户ID
                var claimsIdentity = this.User.Identity as ClaimsIdentity;
                if (claimsIdentity == null)
                {
                    return Ok(new { code = 1, msg = "未获取到当前操作人信息" });
                }
                var userId = claimsIdentity.FindFirst(ClaimTypes.Name)?.Value;
                if (string.IsNullOrWhiteSpace(userId))
                {
                    return Ok(new { code = 1, msg = "未获取到当前操作人信息" });
                }
                _BoxInfoSvc.EditLabelQty(model.Id, model.Qty, int.Parse(userId));
                return Ok(new { code = 0, msg = "编辑成功", data = "" });
            }
            catch (Exception e)
            {
                return Ok(new { code = 1, count = 0, msg = e.Message });
            }
        }
        #endregion
    }