chengsc
2024-10-19 27daf7546721754a451b5df16bb716c1cbb33458
修改问题
12个文件已修改
369 ■■■■ 已修改文件
HTML/views/ASNSetting/ArrivalNotice.html 105 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HTML/views/ASNSetting/LabelPrintSelect.html 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HTML/views/SOSetting/ExportNotice.html 100 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HTML/views/index.html 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Pda/View/SoSetting/SampleOut.html 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/Model/ModelDto/BllAsnDto/ArrivalNoticeDto.cs 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/Model/ModelVm/IdVm.cs 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.BLL/BllAsnServer/ArrivalNoticeServer.cs 44 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.BLL/BllSoServer/ExportNoticeServer.cs 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.IBLL/IBllAsnServer/IArrivalNoticeServer.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.IBLL/IBllSoServer/IExportNoticeServer.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/Wms/Controllers/UpApiController.cs 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HTML/views/ASNSetting/ArrivalNotice.html
@@ -145,7 +145,22 @@
                            <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>搜索
                        </button>
                    </div>
                    <div class="layui-inline" id="divFinish" 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="admin" name="admin" placeholder="账号" autocomplete="off"
                                class="layui-input">
                            </div>
                        </div>
                        <div class="layui-inline DivLoadingArea" style="margin-top: 10px;">
                            <label class="layui-form-label">密码</label>
                            <div class="layui-input-inline" style="width: 220px;">
                                <input type="text" id="password" name="password" placeholder="密码" autocomplete="off"
                                class="layui-input">
                            </div>
                        </div>
                    </div>
                    <!-- 维护备注弹框 -->
                    <div class="layui-inline" id="divEditDemo" style="display: none; padding-top: 10px;">
                        <label class="layui-form-label">备注</label>
@@ -728,30 +743,78 @@
                        break;
                    case "check" :
                        // 代码区域
                        layer.confirm('确定复核此单据吗?', function(index) {
                            // 代码区域
                            var param = {
                                Id:data.Id,
                            };
                            sendData(IP + "/UpApi/FinishAsn", param, 'post', function (res) {
                                if (res.code == 0) { //成功
                                    layer.msg(res.msg, {
                                        icon: 1,
                                        time: 2000 //2秒关闭(如果不配置,默认是3秒)
                                    }, function () {
                                        refreshTable();
                                        doing = true
                        layer.open({
                            type: 1,
                            title: '复核确认',
                            content: $('#divFinish'),
                            maxmin: true,
                            area: ['350px','215px'],
                            btn: ['确定', '取消'],
                            yes: function(index, layero) {
                                var pa = $('#PickingArea').val();
                                console.log(pa)
                                if (doing== true) {
                                    doing= false;
                                    if($('#admin').val()==''){
                                        layer.msg("请输入账号", {
                                            icon: 2,
                                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                                        });
                                        doing= true;
                                        return;
                                    }
                                    if($("#password").val() == '')
                                    {
                                        layer.msg("请输入密码", {
                                            icon: 2,
                                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                                        });
                                        doing= true;
                                        return;
                                    }
                                    var param = {
                                        Id:data.Id,
                                        UserNo:$('#admin').val(),
                                        Password:$('#password').val(),
                                    };
                                    console.log(param);
                                    sendData(IP + "/UpApi/FinishAsn", param, 'post', function (res) {
                                        if (res.code == 0) { //成功
                                            layer.msg(res.msg, {
                                                icon: 1,
                                                time: 2000 //2秒关闭(如果不配置,默认是3秒)
                                            }, function () {
                                                refreshTable();
                                                $('#admin').val("");
                                                $('#password').val("");
                                                doing = true
                                            });
                                        } else { //不成功
                                            layer.msg(res.msg, {
                                                icon: 2,
                                                time: 2000 //2秒关闭(如果不配置,默认是3秒)
                                            }, function () {
                                                doing = true ;
                                                $('#admin').val("");
                                                $('#password').val("")
                                            });
                                        }
                                        layer.close(index);
                                    });
                                } else { //不成功
                                    layer.msg(res.msg, {
                                }else{
                                    layer.msg("请勿重复点击", {
                                        icon: 2,
                                        time: 2000 //2秒关闭(如果不配置,默认是3秒)
                                    }, function () { doing = true });
                                    });
                                }
                            });
                        });
                            }
                        });
                        break;
                    case "chexiao" :
                        layer.open({
HTML/views/ASNSetting/LabelPrintSelect.html
@@ -141,7 +141,11 @@
                     
                    synData(IP + "/BllAsn/GetAsnDetailQtyList", param , 'get', function (res) {
                        if (res.code == 0) { //成功  
                            $("#arriveQty").val(res.data);
                            $("#arriveQty").val(res.data.Qty);
                            $("#productionTime").val(res.data.ProductionTime);
                            $("#expirationTime").val(res.data.ExpirationTime);
                            $("#storeTime").val(res.data.StoreTime);
                            console.log(res.data);
                        } else { //不成功
                            layer.msg(res.msg, {
                                icon: 2,
HTML/views/SOSetting/ExportNotice.html
@@ -173,6 +173,22 @@
                                </div>
                            </div>
                        </div>
                        <div class="layui-inline" id="divFinish" 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="admin" name="admin" placeholder="账号" autocomplete="off"
                                    class="layui-input">
                                </div>
                            </div>
                            <div class="layui-inline DivLoadingArea" style="margin-top: 10px;">
                                <label class="layui-form-label">密码</label>
                                <div class="layui-input-inline" style="width: 220px;">
                                    <input type="text" id="password" name="password" placeholder="密码" autocomplete="off"
                                    class="layui-input">
                                </div>
                            </div>
                        </div>
                        <!-- 维护备注弹框 -->
                        <div class="layui-inline" id="divEditDemo" style="display: none; padding-top: 10px;">
                            <label class="layui-form-label">备注</label>
@@ -977,27 +993,77 @@
                            }
                        }); 
                    }else if(obj.event === 'check'){//复核
                        // 代码区域
                        layer.confirm('确定复核此单据吗?', function(index) {
                            var param = {
                                Id:data.Id,
                            };
                            sendData(IP + "/UpApi/FinishExportNotice", param, 'post', function (res) {
                                if (res.code == 0) { //成功
                                    layer.msg(res.msg, {
                                        icon: 1,
                                        time: 2000 //2秒关闭(如果不配置,默认是3秒)
                                    }, function () {
                                        refreshTable();
                                        doing = true
                        layer.open({
                            type: 1,
                            title: '复核确认',
                            content: $('#divFinish'),
                            maxmin: true,
                            area: ['350px','215px'],
                            btn: ['确定', '取消'],
                            yes: function(index, layero) {
                                var pa = $('#PickingArea').val();
                                console.log(pa)
                                if (isChongFu== true) {
                                    isChongFu= false;
                                    if($('#admin').val()==''){
                                        layer.msg("请输入账号", {
                                            icon: 2,
                                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                                        });
                                        isChongFu= true;
                                        return;
                                    }
                                    if($("#password").val() == '')
                                    {
                                        layer.msg("请输入密码", {
                                            icon: 2,
                                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                                        });
                                        isChongFu= true;
                                        return;
                                    }
                                    var param = {
                                        Id:data.Id,
                                        UserNo:$('#admin').val(),
                                        Password:$('#password').val(),
                                    };
                                    console.log(param);
                                    sendData(IP + "/UpApi/FinishExportNotice", param, 'post', function (res) {
                                        if (res.code == 0) { //成功
                                            layer.msg(res.msg, {
                                                icon: 1,
                                                time: 2000 //2秒关闭(如果不配置,默认是3秒)
                                            }, function () {
                                                refreshTable();
                                                $('#admin').val("");
                                                $('#password').val("");
                                                isChongFu = true
                                            });
                                        } else { //不成功
                                            layer.msg(res.msg, {
                                                icon: 2,
                                                time: 2000 //2秒关闭(如果不配置,默认是3秒)
                                            }, function () {
                                                isChongFu = true ;
                                                $('#admin').val("");
                                                $('#password').val("")
                                            });
                                        }
                                        layer.close(index);
                                    });
                                } else { //不成功
                                    layer.msg(res.msg, {
                                }else{
                                    layer.msg("请勿重复点击", {
                                        icon: 2,
                                        time: 2000 //2秒关闭(如果不配置,默认是3秒)
                                    }, function () { doing = true });
                                    });
                                }
                            });
                            }
                        });
                    }
                });
HTML/views/index.html
@@ -136,6 +136,31 @@
                }else{
                    $("#token").text($.cookie('token'));
                }                
                var lastTime = new Date().getTime();
                var currentTime = new Date().getTime();
                var timeOut = 1*5*1000;
                $(function () {
                    $(document).mouseover(function () {
                        lastTime = new Date().getTime();
                    })
                });
                function testTime() {
                    // console.log("计时:"+new Date().getTime());
                    console.log("lastTime:"+lastTime);
                    //console.log("currentTime:"+currentTime);
                    //console.log("lastTime - currentTime:"+lastTime - currentTime);
                    currentTime = new Date().getTime();
                    if(currentTime - lastTime > timeOut){
                        console.log("超时");
                        location.href = "Login.html";
                    }
                }
                window.setInterval(testTime,1000);
                var element = layui.element; 
                 
                var xml = '';
Pda/View/SoSetting/SampleOut.html
@@ -169,12 +169,13 @@
                </ul>
            </div>
            <ul>
            <!-- <ul>
                <li id="option1">标签</li>
                <li id="option2">数量</li>
            </ul>
            <br />
            </ul> -->
            <button id="option1" class="layout-btn" type="button">标签</button>
            <button id="option2" class="layout-btn" type="button">数量</button>
            <br /><br />
            <!-- 有码 -->
            <div id="content1">
@@ -560,18 +561,18 @@
            
            $('#kuneiQty').hide();
            $('#option1').attr("style", "background-color: aqua;width: 45.77%;float: left;text-align: center;"); //选中后颜色
            $('#option2').attr("style", "background-color: #999;width: 45.77%;float: right;text-align: center;"); //默认颜色
            $('#option1').attr("style", "background-color: red;width: 50%;float: left;text-align: center;"); //选中后颜色
            $('#option2').attr("style", "background-color: #999;width: 50%;float: right;text-align: center;"); //默认颜色
            $('#content2').hide();
            $(document).ready(function () {
                $('#option1').click(function () {
                    // qingkong();
                    // qingkong();aqua
                    xianshiyemian = 0;
                    $('#content1').show();
                    $('#option1').attr("style", "background-color: aqua;width: 45.77%;float: left;text-align: center;"); //选中后颜色
                    $('#option1').attr("style", "background-color: red;width: 50%;float: left;text-align: center;"); //选中后颜色
                    $('#content2').hide();
                    $('#option2').attr("style", "background-color: #999;width: 45.77%;float: right;text-align: center;"); //默认颜色
                    $('#option2').attr("style", "background-color: #999;width: 50%;float: right;text-align: center;"); //默认颜色
                    $("#palletNo").focus();//光标默认选中
                });
@@ -579,10 +580,10 @@
                    // qingkong();
                    xianshiyemian = 1;
                    $('#content1').hide();
                    $('#option1').attr("style", "background-color: #999;width: 45.77%;float: left;text-align: center;"); //默认颜色
                    $('#option1').attr("style", "background-color: #999;width: 50%;float: left;text-align: center;"); //默认颜色
                    $('#content2').show();
                    $('#option2').attr("style", "background-color: aqua;width: 45.77%;float: right;text-align: center;"); //选中后颜色
                    $('#option2').attr("style", "background-color: red;width: 50%;float: right;text-align: center;"); //选中后颜色
                    $("#palletNo2").focus();//光标默认选中
                });
            });
Wms/Model/ModelDto/BllAsnDto/ArrivalNoticeDto.cs
@@ -99,4 +99,25 @@
        public string CheckUserName { get; set; }
    }
    public class LabelPrintInfoDto
    {
        /// <summary>
        /// 剩余打印的数量
        /// </summary>
        public string Qty { get; set; }
        /// <summary>
        /// 生产日期
        /// </summary>
        public string ProductionTime { get; set; }
        /// <summary>
        /// 有效期
        /// </summary>
        public string ExpirationTime { get; set; }
        /// <summary>
        /// 储存期至
        /// </summary>
        public string StoreTime { get; set; }
    }
}
Wms/Model/ModelVm/IdVm.cs
@@ -7,4 +7,15 @@
        public int Id { get; set; }
        public List<int> Ids { get; set; }
    }
    /// <summary>
    /// 复核VM
    /// </summary>
    public class FinshVm
    {
        public int Id { get; set; }
        public string UserNo { get; set; }
        public string Password { get; set; }
    }
}
Wms/WMS.BLL/BllAsnServer/ArrivalNoticeServer.cs
@@ -131,7 +131,7 @@
        }
        //获取入库单明细剩余打印数量
        public string GetAsnDetailQtyList(int id)
        public LabelPrintInfoDto GetAsnDetailQtyList(int id)
        {
            try
            {
@@ -140,11 +140,29 @@
                {
                    throw new Exception("未查询到入库单明细");
                }
                var data = new LabelPrintInfoDto();
                var notice = Db.Queryable<BllArrivalNotice>().Where(m => m.IsDel == "0" && m.ASNNo == detail.ASNNo).First();
                if (notice != null && notice.Type == "4") //判断是否是余料退回单
                {
                    var noticeStr = Db.Queryable<BllArrivalNotice>().Where(m => m.Type == "1").Select(m => m.ASNNo).ToList();
                    var detailOld = Db.Queryable<BllArrivalNoticeDetail>().Where(m => m.IsDel == "0" && noticeStr.Contains(m.ASNNo) && m.SkuNo == detail.SkuNo && m.LotNo == detail.LotNo).OrderByDescending(m => m.CreateTime).First();
                    if (detailOld != null)
                    {
                        var boxInfo = Db.Queryable<BllBoxInfo>().First(m => m.IsDel == "0" && m.ASNNo == detailOld.ASNNo);
                        if (boxInfo!= null)
                        {
                            data.ProductionTime = boxInfo.ProductionTime!= null ? ((DateTime)boxInfo.ProductionTime).ToString("yyyy-MM-dd"):"";
                            data.ExpirationTime = boxInfo.ExpirationTime != null ? ((DateTime)boxInfo.ExpirationTime).ToString("yyyy-MM-dd") : "";
                            data.StoreTime = boxInfo.StoreTime != null ? ((DateTime)boxInfo.StoreTime).ToString("yyyy-MM-dd") : "";
                        }
                    }
                }
                var labelQty = Db.Queryable<BllBoxInfo>().Where(m => m.IsDel == "0" && m.ASNDetailNo == id).Sum(m => m.Qty);
                var qty = detail.Qty - labelQty;
                return qty.ToString();
                data.Qty = qty.ToString();
                return data;
            }
            catch (Exception e)
            {
@@ -1051,10 +1069,22 @@
        }
        //订单回传上游系统
        public bool FinishAsn(int id, string erpUrl, string mesUrl,string mesTokenUrl, int userId)
        public bool FinishAsn(int id, string erpUrl, string mesUrl,string mesTokenUrl,string userNo,string pwd, int userId)
        {
            try
            {
                var loginPwd = Md5Tools.CalcMd5(pwd);
                var date = Db.Queryable<SysUserInfor>().First(m =>m.IsDel=="0" && m.UserName == userNo && m.PassWord == loginPwd);
                if (date == null) //账号密码是否正确
                {
                   throw new Exception("账号密码不正确或没有此账号");
                }
                if (date.Status != "0") //当前账号是否正常启用
                {
                    throw new Exception("当前账号非启用状态");
                }
                var notice = Db.Queryable<BllArrivalNotice>().First(m => m.Id == id && m.IsDel == "0");
                if (notice == null)
                {
@@ -1069,7 +1099,7 @@
                {
                    throw new Exception("未查询到单据明细信息");
                }
                if (userId == notice.UpdateUser)
                if (date.Id == notice.UpdateUser)
                {
                    throw new Exception("复核失败,复核人员和关闭订单人员不能相同!");
                }
@@ -1150,10 +1180,10 @@
                notice.Status = "4";
                notice.CheckTime = DateTime.Now;
                notice.CheckUser = userId;
                notice.CheckUser = date.Id;
                Db.Updateable(notice).ExecuteCommand();
                new OperationASNServer().AddLogOperationAsn("入库作业", "入库单据", notice.ASNNo, "复核", $"复核了单据号为{notice.ASNNo}的单据信息", userId);
                new OperationASNServer().AddLogOperationAsn("入库作业", "入库单据", notice.ASNNo, "复核", $"{date.RealName}复核了单据号为{notice.ASNNo}的单据信息", userId);
                return true;
            }
            catch (Exception e)
Wms/WMS.BLL/BllSoServer/ExportNoticeServer.cs
@@ -262,10 +262,22 @@
        }
        //回传出库单
        public bool FinishSo(int id, string url, int userId)
        public bool FinishSo(int id, string url, string userNo, string pwd, int userId)
        {
            try
            {
                var loginPwd = Md5Tools.CalcMd5(pwd);
                var date = Db.Queryable<SysUserInfor>().First(m => m.IsDel == "0" && m.UserName == userNo && m.PassWord == loginPwd);
                if (date == null) //账号密码是否正确
                {
                    throw new Exception("账号密码不正确或没有此账号");
                }
                if (date.Status != "0") //当前账号是否正常启用
                {
                    throw new Exception("当前账号非启用状态");
                }
                var notice = Db.Queryable<BllExportNotice>().First(m => m.Id == id && m.IsDel == "0");
                if (notice == null)
                {
@@ -280,7 +292,7 @@
                {
                    throw new Exception("未查询到单据明细信息");
                }
                if (userId == notice.UpdateUser)
                if (date.Id == notice.UpdateUser)
                {
                    throw new Exception("复核失败,复核人员和关闭订单人员不能相同!");
                }
@@ -315,10 +327,10 @@
                notice.Status = "6";
                notice.CheckTime = DateTime.Now;
                notice.CheckUser = userId;
                notice.CheckUser = date.Id;
                Db.Updateable(notice).ExecuteCommand();
                new OperationSOServer().AddLogOperationSo("出库作业", "出库单据", notice.SONo, "复核", $"复核了单据号为{notice.SONo}的单据信息", userId);
                new OperationSOServer().AddLogOperationSo("出库作业", "出库单据", notice.SONo, "复核", $"{date.RealName}复核了单据号为{notice.SONo}的单据信息", userId);
                return true;
            }
            catch (Exception e)
Wms/WMS.IBLL/IBllAsnServer/IArrivalNoticeServer.cs
@@ -32,7 +32,7 @@
        /// </summary>
        /// <param name="id">id</param> 
        /// <returns></returns>
        string GetAsnDetailQtyList(int id);
        LabelPrintInfoDto GetAsnDetailQtyList(int id);
        /// <summary>
        /// 获取物料信息(添加入库单明细使用)
@@ -103,7 +103,7 @@
        /// <param name="mesTokenUrl">mes获取令牌路径</param>
        /// <param name="userId">操作人</param>
        /// <returns></returns>
        bool FinishAsn(int id, string erpurl, string mesUrl,string mesTokenUrl, int userId);
        bool FinishAsn(int id, string erpurl, string mesUrl,string mesTokenUrl, string userNo, string pwd, int userId);
        void UpLocate(string wareNo, string locatNo);
Wms/WMS.IBLL/IBllSoServer/IExportNoticeServer.cs
@@ -23,7 +23,7 @@
        /// <param name="url">上传路径</param>
        /// <param name="userId">操作人</param>
        /// <returns></returns>
        bool FinishSo(int id, string url, int userId);
        bool FinishSo(int id, string url, string userNo, string pwd, int userId);
        //------------------------------------------------------------------------------------------
        /// <summary>
Wms/Wms/Controllers/UpApiController.cs
@@ -74,7 +74,7 @@
        /// <param name="model">入库单号</param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult FinishAsn(IdVm model)
        public IActionResult FinishAsn(FinshVm model)
        {
            try
            {
@@ -89,7 +89,7 @@
                {
                    return Ok(new { code = 1, msg = "未获取到当前操作人信息" });
                }
                _arrivalNoticeSvc.FinishAsn(model.Id, _config.ErpHost + _config.AsnFinishUrl, _config.MesHost + _config.MesAsnFinishUrl, _config.MesHost + _config.MesGetTokenUrl, int.Parse(userId));
                _arrivalNoticeSvc.FinishAsn(model.Id, _config.ErpHost + _config.AsnFinishUrl, _config.MesHost + _config.MesAsnFinishUrl, _config.MesHost + _config.MesGetTokenUrl,model.UserNo,model.Password, int.Parse(userId));
                return Ok(new { code = 0, count = 0, msg = "入库单复核并上传成功" });
            }
@@ -135,7 +135,7 @@
        /// <param name="model"></param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult FinishExportNotice(IdVm model)
        public IActionResult FinishExportNotice(FinshVm model)
        {
            try
            {
@@ -150,7 +150,7 @@
                {
                    return Ok(new { code = 1, msg = "未获取到当前操作人信息" });
                }
                _exNoticeSvc.FinishSo(model.Id, _config.ErpHost + _config.SoFinishUrl, int.Parse(userId));
                _exNoticeSvc.FinishSo(model.Id, _config.ErpHost + _config.SoFinishUrl, model.UserNo, model.Password, int.Parse(userId));
                return Ok(new { code = 0, count = 0, msg = "出库单复核并上传成功" });
            }
            catch (Exception e)