添加入库单需根据单据类型验证是否要填写批次号,增加托盘绑定无批次时只显示物料信息。
5个文件已修改
156 ■■■■■ 已修改文件
HTML/views/ASNSetting/ArrivalNotice.html 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HTML/views/ASNSetting/ArrivalNoticeDetail.html 81 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Pda/View/AsnSetting/productEnterQuantity .html 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.BLL/BllAsnServer/ArrivalNoticeServer.cs 59 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/Wms/Controllers/BllAsnController.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HTML/views/ASNSetting/ArrivalNotice.html
@@ -100,6 +100,7 @@
                                <option value="4">车间余料退回入库</option>
                                <option value="5">其它入库</option>
                                <option value="6">代储入库</option>
                                <option value="7">寄存入库</option>
                                <!-- JC09 -->
                                <!-- <option value="0">标准产品入库</option>
                                <option value="1">非标产品入库</option> -->
@@ -241,6 +242,8 @@
                                    html = `其它入库`; 
                                }else if(d.Type=='6') { 
                                    html = `代储入库`; 
                                }else if(d.Type=='7') {
                                    html = `寄存入库`;
                                }else {
                                    
                                }
HTML/views/ASNSetting/ArrivalNoticeDetail.html
@@ -55,6 +55,7 @@
                    <option value="4">车间余料退回入库</option>
                    <option value="5">其它入库</option>
                    <option value="6">代储入库</option>
                    <option value="7">寄存入库</option>
                    <!-- JC08 -->
                    <!-- <option value="0">成品入库</option>
                    <option value="1">原料入库</option>
@@ -143,10 +144,6 @@
            });
            var arr = [];
            var TypeValue=$("#Type").val();
            var type0 = [3]; //客户
            var type1 = [1,5]; //供应商
            var type2 = [0,2,4,6]; //货主
            // 加载下拉信息
            getCustomerList();
@@ -605,14 +602,31 @@
                        $("#CustomerName").empty();
                        $("#CustomerName").append('<option value =""></option>');
                        for (var i = 0; i < res.data.length; i++) {
                            //判断单据类型
                            if (type0[0] == $("#Type").val())
                            var TypeNum = 0;
                            switch($("#Type").val())
                            {
                                /*
                                    0:客户
                                    退货入库
                                    3
                                */
                                case "3": //退货入库
                                    TypeNum = 0;
                                    console.log(TypeNum)
                                    break;
                                case "1": //采购入库
                                case "5": //其它入库
                                    TypeNum = 1;
                                    console.log(TypeNum)
                                    break;
                                case "0": //成品入库
                                case "2": //中间品入库
                                case "4": //车间余料入库
                                case "6": //代储入库
                                case "7": //寄存入库
                                    TypeNum = 2;
                                    console.log(TypeNum)
                                    break;
                            }
                            //判断单据类型
                            if (TypeNum == 0)
                            {
                                if (res.data[i].Type == 0)
                                {
                                    $("#CustomerNamep").html("客户选择");
@@ -620,13 +634,8 @@
                                    res.data[i].CustomerName + '</option>');
                                }
                            }
                            else if (type1[0] == $("#Type").val() || type1[1] == $("#Type").val())
                            else if (TypeNum == 1)
                            {
                                /*
                                    1:供应商
                                    采购入库、其它入库
                                    1、5
                                */
                                if (res.data[i].Type == 1)
                                {
                                    $("#CustomerNamep").html("供应商选择");
@@ -634,13 +643,8 @@
                                    res.data[i].CustomerName + '</option>');
                                }
                            }
                            else if (type2[0] == $("#Type").val() || type2[1] == $("#Type").val() || type2[2] == $("#Type").val() || type2[3] == $("#Type").val())
                            else if (TypeNum == 2)
                            {
                                /*
                                    2:货主
                                    成品入库、中间品入库、车间余料入库、代储入库
                                    0、2、4、6
                                */
                                if (res.data[i].Type == 2)
                                {
                                    $("#CustomerNamep").html("货主选择");
@@ -762,11 +766,32 @@
                        return -1;
                    }
                    if (arr[i].LotNo == "" || arr[i].LotNo ==undefined) {
                        layer.msg("请输入批次!", {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        });
                        return -1;
                        //判断是否为对应不需要批次的单据
                        var TypeNum = 0;
                        switch($("#Type").val())
                        {
                            //1:采购入库 2:中间品入库 5:其它入库 6:代储入库 7:寄存入库
                            case "1" :
                            case "2" :
                            case "5" :
                            case "6" :
                            case "7" :
                                console.log($("#Type").val())
                                TypeNum = 1;
                                break;
                        }
                        console.log(TypeNum)
                        if (TypeNum == 0)
                        {
                            layer.msg("请输入批次!1", {
                                icon: 2,
                                time: 2000 //2秒关闭(如果不配置,默认是3秒)
                            });
                            return -1;
                        }
                    }
                    
                    if (!reg.test(arr[i].Qty)) {
Pda/View/AsnSetting/productEnterQuantity .html
@@ -598,7 +598,7 @@
                    form.render('select');
                    var param = {
                        Type: "2,5,6"
                        Type: "2,5,6,7"
                    };
                    sendData(IP + "/PdaAsn/GetArrivalNotices", param, 'post', function (res) {
                        if (res.code == 0) { //成功
@@ -903,11 +903,14 @@
                            for (var i = 0; i < res.data.length; i++) {
                                if (i == 0) {
                                    $("#goodSelect1").append('<option value =' + res.data[i].Id + ' selected>' + res.data[i]
                                        .SkuName + "-" + res.data[i].LotNo +
                                        '</option>');
                                        .SkuName);
                                } else {
                                    $("#goodSelect1").append('<option value =' + res.data[i].Id + '>' + res.data[i]
                                        .SkuName + "-" + res.data[i].LotNo +
                                        .SkuName);
                                }
                                if (res.data[i].LotNo != null)
                                {
                                    $("#goodSelect1").append("-" + res.data[i].LotNo +
                                        '</option>');
                                }
Wms/WMS.BLL/BllAsnServer/ArrivalNoticeServer.cs
@@ -130,28 +130,26 @@
            try
            {
                string skuType = string.Empty;
                switch(model.Type)//0:原料 1:包材 2:成品 3:耗材 4:半成品
                switch (model.Type)//0:原料 1:包材 2:成品 3:耗材 4:半成品
                {
                    case "0"://成品入库
                    case "3"://退货入库
                    case "5"://其它入库
                    case "6"://代储入库
                        skuType = "(2)";
                        break;
                    case "1"://采购入库
                    case "4"://车间余料退回入库
                        skuType = "(0,1,3)";
                        break;
                    case "2"://中间品入库
                        skuType = "(4)";
                        break;
                    case "3"://退货入库
                        skuType = "(2)";
                    case "7"://寄存入库
                        skuType = "(0,1,2,3,4)";
                        break;
                    case "4"://车间余料退回入库
                        skuType = "(0,1,3)";
                        break;
                    case "5"://其它入库
                        skuType = "(2)";
                        break;
                    case "6"://代储入库
                        skuType = "(2)";
                    default: //其它
                        skuType = "(0,1,2,3,4)";
                        break;
                }
@@ -208,6 +206,9 @@
            string strMessage = "";
            string sqlString = string.Empty;
            string sqlDetailStr = string.Empty;
            //0:成品入库 1:采购入库 2:中间品入库 3:退货入库 4:车间余料入库 5:其它入库 6:代储入库 7:寄存入库
            var TypeLot = "1, 2, 5, 6, 7";
            try
            {
                if (model.Origin == "录入")
@@ -251,8 +252,12 @@
                    }
                    if (string.IsNullOrEmpty(detailModel.LotNo))
                    {
                        strMessage = "-1:批次号不可为空;";
                        continue;
                        //判断是否为不限制批次单据
                        if (!TypeLot.Contains(model.Type))
                        {
                            strMessage = "-1:批次号不可为空;";
                            continue;
                        }
                    }
                    // 判断是否已存在当前明细
                    string sqlCount = $"SELECT COUNT(ID) FROM BllArrivalNoticeDetail where ASNNo = '{model.ASNNo}' ";
@@ -330,7 +335,7 @@
                sqlString = "UPDATE BllArrivalNotice SET ";
                sqlString += $"CustomerNo = '{model.CustomerNo}',CustomerName = '{model.CustomerName}',";
                sqlString += $"LotNo = '{model.LotNo}',LotText = '{model.LotText}',";
                sqlString += $"LotNo = '{model.LotNo}',LotText = '{model.LotText}',";
                sqlString += $"UpdateTime = GETDATE(),UpdateUser = '{model.CreateUser}' ";
                sqlString += $"WHERE ASNNo = '{model.ASNNo}'";
@@ -603,7 +608,7 @@
            }
        }
        //入库单撤销申请
        public void CancelOrder(int id,string reason,int userId)
        public void CancelOrder(int id, string reason, int userId)
        {
            try
            {
@@ -612,29 +617,29 @@
                {
                    throw new Exception("未查询到入库单据信息");
                }
                if (notice.Status!="1" && notice.Status != "2")
                if (notice.Status != "1" && notice.Status != "2")
                {
                    throw new Exception("入库单据状态不是正在执行或执行完成,不能撤销");
                }
                var bind = Db.Queryable<BllPalletBind>().Where(m => m.IsDel == "0" && m.ASNNo == notice.ASNNo).ToList();
                if (bind.Count==0)
                if (bind.Count == 0)
                {
                    throw new Exception("未查询到入库单据的托盘绑定信息");
                }
                if (bind.Count(m=>m.Status== "1")>0)
                if (bind.Count(m => m.Status == "1") > 0)
                {
                    throw new Exception("当前入库单据的托盘绑定信息有正在执行的,请稍后完成后再撤销");
                }
                var auditLog = Db.Queryable<BllAuditLog>().Where(m => m.IsDel == "0" && m.Status == "0");
                var boxInfo = Db.Queryable<BllBoxInfo>().Where(m => m.IsDel == "0" && m.ASNNo == notice.ASNNo);
                if (auditLog.Count(m=>m.OrderNo == notice.ASNNo)>0)
                if (auditLog.Count(m => m.OrderNo == notice.ASNNo) > 0)
                {
                    throw new Exception("当前入库单据已有撤销审核,请等待审核完成");
                }
                var startStatusName = "";
                var endStatusName = "";
@@ -649,7 +654,7 @@
                        endStatusName = "正在执行";
                        break;
                    default:
                        throw new Exception("单据状态错误");
                        throw new Exception("单据状态错误");
                }
                var palletStr = "";
@@ -657,16 +662,16 @@
                var msgL = "";
                foreach (var item in bind)
                {
                    if (auditLog.Count(m=>m.OrderNo ==item.ASNNo && m.PalletNo.Contains(item.PalletNo)) >0)
                    if (auditLog.Count(m => m.OrderNo == item.ASNNo && m.PalletNo.Contains(item.PalletNo)) > 0)
                    {
                        continue;
                    }
                    if (!palletStr.Contains(item.PalletNo))
                    {
                        palletStr += item.PalletNo+";";
                        palletStr += item.PalletNo + ";";
                    }
                    var info = boxInfo.First(m => m.BindNo == item.Id);
                    if (!msgS.Contains(info.SkuNo))
                    {
@@ -695,7 +700,7 @@
                    IsDel = "0",
                    CreateUser = userId,
                    CreateTime = time
                };
                };
                Db.Insertable(log).ExecuteCommand();
                new OperationASNServer().AddLogOperationAsn("入库作业", "入库单据", notice.ASNNo, "添加", $"添加了单据号为{notice.ASNNo}的单据撤销申请", userId);
            }
@@ -729,7 +734,7 @@
                {
                    //添加操作日志
                    new OperationASNServer().AddLogOperationAsn("入库作业", "入库单据", notice.ASNNo, "编辑", $"编辑了单据号为{notice.ASNNo}的备注信息", userId);
                }
                }
            }
            catch (Exception ex)
            {
@@ -926,5 +931,5 @@
        #endregion
    }
}
Wms/Wms/Controllers/BllAsnController.cs
@@ -118,7 +118,7 @@
                }
                if (strMesage.Contains("-1"))
                {
                    return Ok(new { code = 0, msg = strMesage });
                    return Ok(new { code = 1, msg = strMesage });
                }
                else
                {