| | |
| | | <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> |
| | |
| | | |
| | | break; |
| | | case "check" : |
| | | // 代码区域 |
| | | layer.confirm('确定复核此单据吗?', function(index) { |
| | | // 代码区域 |
| | | 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, { |
| | |
| | | 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 }); |
| | | } |
| | | }, function () { |
| | | doing = true ; |
| | | $('#admin').val(""); |
| | | $('#password').val("") |
| | | }); |
| | | } |
| | | layer.close(index); |
| | | }); |
| | | |
| | | |
| | | }else{ |
| | | layer.msg("请勿重复点击", { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }); |
| | | } |
| | | |
| | | } |
| | | }); |
| | | |
| | | break; |
| | |
| | | |
| | | 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, |
| | |
| | | </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> |
| | |
| | | } |
| | | }); |
| | | }else if(obj.event === 'check'){//复核 |
| | | // 代码区域 |
| | | layer.confirm('确定复核此单据吗?', function(index) { |
| | | |
| | | 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, { |
| | |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }, function () { |
| | | refreshTable(); |
| | | doing = true |
| | | $('#admin').val(""); |
| | | $('#password').val(""); |
| | | isChongFu = true |
| | | }); |
| | | } else { //不成功 |
| | | layer.msg(res.msg, { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }, function () { doing = true }); |
| | | } |
| | | }, function () { |
| | | isChongFu = true ; |
| | | $('#admin').val(""); |
| | | $('#password').val("") |
| | | }); |
| | | } |
| | | layer.close(index); |
| | | }); |
| | | |
| | | |
| | | }else{ |
| | | layer.msg("请勿重复点击", { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }); |
| | | } |
| | | |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | |
| | | }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 = ''; |
| | |
| | | </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"> |
| | |
| | | |
| | | $('#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();//光标默认选中 |
| | | }); |
| | | |
| | |
| | | // 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();//光标默认选中 |
| | | }); |
| | | }); |
| | |
| | | |
| | | 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; } |
| | | } |
| | | |
| | | } |
| | |
| | | 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; } |
| | | } |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | //获取入库单明细剩余打印数量 |
| | | public string GetAsnDetailQtyList(int id) |
| | | public LabelPrintInfoDto GetAsnDetailQtyList(int id) |
| | | { |
| | | try |
| | | { |
| | |
| | | { |
| | | 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) |
| | | { |
| | |
| | | } |
| | | |
| | | //订单回传上游系统 |
| | | 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) |
| | | { |
| | |
| | | { |
| | | throw new Exception("未查询到单据明细信息"); |
| | | } |
| | | if (userId == notice.UpdateUser) |
| | | if (date.Id == notice.UpdateUser) |
| | | { |
| | | throw new Exception("复核失败,复核人员和关闭订单人员不能相同!"); |
| | | } |
| | |
| | | |
| | | 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) |
| | |
| | | } |
| | | |
| | | //回传出库单 |
| | | 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) |
| | | { |
| | |
| | | { |
| | | throw new Exception("未查询到单据明细信息"); |
| | | } |
| | | if (userId == notice.UpdateUser) |
| | | if (date.Id == notice.UpdateUser) |
| | | { |
| | | throw new Exception("复核失败,复核人员和关闭订单人员不能相同!"); |
| | | } |
| | |
| | | |
| | | 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) |
| | |
| | | /// </summary> |
| | | /// <param name="id">id</param> |
| | | /// <returns></returns> |
| | | string GetAsnDetailQtyList(int id); |
| | | LabelPrintInfoDto GetAsnDetailQtyList(int id); |
| | | |
| | | /// <summary> |
| | | /// 获取物料信息(添加入库单明细使用) |
| | |
| | | /// <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); |
| | | |
| | |
| | | /// <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> |
| | |
| | | /// <param name="model">入库单号</param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public IActionResult FinishAsn(IdVm model) |
| | | public IActionResult FinishAsn(FinshVm model) |
| | | { |
| | | try |
| | | { |
| | |
| | | { |
| | | 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 = "入库单复核并上传成功" }); |
| | | } |
| | |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public IActionResult FinishExportNotice(IdVm model) |
| | | public IActionResult FinishExportNotice(FinshVm model) |
| | | { |
| | | try |
| | | { |
| | |
| | | { |
| | | 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) |