| | |
| | | <div class="layui-input-inline"> |
| | | <select name="Type" id="Type" lay-filter="Type" lay-search> |
| | | <option value=""></option> |
| | | <!-- JC24 --> |
| | | <option value="0">成品入库</option> |
| | | <option value="1">采购入库</option> |
| | | <option value="2">中间品入库</option> |
| | | <option value="3">退货入库</option> |
| | | <option value="4">车间余料退回入库</option> |
| | | <option value="5">其它入库</option> |
| | | <option value="6">代储入库</option> |
| | | <!-- JC09 --> |
| | | <option value="0">标准产品入库</option> |
| | | <option value="1">非标产品入库</option> |
| | | <!-- <option value="0">标准产品入库</option> |
| | | <option value="1">非标产品入库</option> --> |
| | | <!-- JC08 --> |
| | | <!-- <option value="0">成品入库</option> |
| | | <option value="1">原料入库</option> |
| | |
| | | //明细表操作栏事件 |
| | | table.on('tool(LAY-app-content-list2)', function (obj) { |
| | | var data = obj.data; |
| | | var id = data.Id; |
| | | switch(obj.event) |
| | | { |
| | | case "del" : |
| | |
| | | title: '生成标签', |
| | | content: 'LabelPrintSelect.html', |
| | | maxmin: true, |
| | | area: ['460px', '460px'], |
| | | area: ['480px', '615px'], |
| | | btn: ['确定','取消'], |
| | | yes: function(index, layero){ |
| | | var iframeWindow = window['layui-layer-iframe'+ index] |
| | |
| | | var field = data.field; //获取提交的字段 |
| | | console.log(field); |
| | | //提交 Ajax 成功后,静态更新表格中的数据 |
| | | var param = { |
| | | Id: data.Id, |
| | | Reset: field.reset, //重置批号 |
| | | Level: field.level, //标签级别 1/2级 |
| | | Type:field.type, //关系层级 有/无层级 |
| | | ArriveQty:field.arriveQty, //到货数量 |
| | | BoxType:field.boxType ,// 箱支类型 箱/支 |
| | | Qty:field.qty //箱/支数量 |
| | | }; |
| | | console.log(param); |
| | | //"&Level="+field.level+"&Type="+field.type+"&BoxType="+field.boxType+"&Qty="+field.qty+ |
| | | var str = "Id="+id+"&Reset="+field.reset+"&ArriveQty="+field.arriveQty+"&ProductionTime="+field.productionTime+"&ExpirationTime="+field.expirationTime+"&StoreTime="+field.storeTime; |
| | | |
| | | layer.open({ |
| | | type: 2, |
| | | title: '生成标签', |
| | | content: 'LabelPrint.html', |
| | | content: 'LabelPrint.html?'+str, |
| | | maxmin: true, |
| | | area: ['660px', '660px'], |
| | | btn: ['取消'], |
| | |
| | | |
| | | <head> |
| | | <meta charset="utf-8"> |
| | | <title>物料信息录入</title> |
| | | <title>物料标签</title> |
| | | <meta name="renderer" content="webkit"> |
| | | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| | | <meta name="viewport" |
| | |
| | | </style> |
| | | <script> |
| | | // 这里是需要在页面渲染之前执行的代码 |
| | | document.addEventListener("DOMContentLoaded", function() { |
| | | |
| | | document.addEventListener("DOMContentLoaded", function () { |
| | | |
| | | //获取table默认显示数 |
| | | pageCntFirst(); |
| | | //判断是否开启table列表列宽调整功能。 |
| | | GetIsSetColW(); |
| | | }); |
| | | </script> |
| | | </script> |
| | | </head> |
| | | |
| | | |
| | |
| | | <div class="layui-card"> |
| | | <div class="layui-form layui-card-header layuiadmin-card-header-auto"> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline" style="margin-right: 0;"> |
| | | <label class="layui-form-label" style="width: 60px;">入库单号</label> |
| | | <div class="layui-input-inline" style="margin-right: 0;"> |
| | | <input type="text" id="ASNNo" name="ASNNo" placeholder="入库单号" autocomplete="off" |
| | | class="layui-input"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="margin-right: 0;"> |
| | | <label class="layui-form-label" style="width: 60px;">箱 号</label> |
| | | <div class="layui-input-inline" style="margin-right: 0;"> |
| | |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="margin-right: 0;"> |
| | | <label class="layui-form-label" style="width: 60px;">批次描述</label> |
| | | <label class="layui-form-label" style="width: 60px;">供货批次</label> |
| | | <div class="layui-input-inline" style="margin-right: 0;"> |
| | | <div class="layui-input-inline" style="margin-right: 0;"> |
| | | <input type="text" id="LotText" name="LotText" placeholder="批次描述" autocomplete="off" |
| | | class="layui-input"> |
| | | <input type="text" id="SupplierLot" name="SupplierLot" placeholder="供货批次" |
| | | autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-inline" style="margin-right: 0;"> |
| | | <label class="layui-form-label">是否使用</label> |
| | | <div class="layui-input-inline" style="margin-right: 0;"> |
| | | <div class="layui-input-inline" style="margin-right: 0;"> |
| | | <select name="IsUse" id="IsUse" lay-filter="IsUse" lay-search> |
| | | <option value=""></option> |
| | | <option value="0">否</option> |
| | | <option value="1">是</option> |
| | | |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | </button> --> |
| | | <div class="position-relative"> |
| | | <table id="Box-list" lay-filter="Box-list"></table> |
| | | |
| | | |
| | | <div class="headerSetIcon"> |
| | | <button class="layui-btn layui-btn-primary layui-btn-sm" data-type="customCols"> |
| | | <i class="layui-icon"></i> |
| | | </button> |
| | | </div> |
| | | |
| | | |
| | | <script type="text/html" id="templetProductionTime"> |
| | | {{# function GetBtn3(d){ |
| | | return formatDate2(d.ProductionTime); |
| | |
| | | }} |
| | | {{ GetBtn4(d) }} |
| | | </script> |
| | | |
| | | |
| | | <script type="text/html" id="templetInspectTime"> |
| | | {{# function GetBtn5(d){ |
| | | return formatDate2(d.InspectTime); |
| | |
| | | }} |
| | | {{ GetBtn5(d) }} |
| | | </script> |
| | | |
| | | |
| | | <script type="text/html" id="templetCompleteTime"> |
| | | {{# function GetBtn6(d){ |
| | | return formatDate(d.CompleteTime); |
| | |
| | | {{ GetBtn7(d) }} |
| | | </script> |
| | | |
| | | |
| | | |
| | | |
| | | <script type="text/html" id="templetCreateTime"> |
| | | {{# function GetBtn8(d){ |
| | |
| | | }} |
| | | {{ GetBtn8(d) }} |
| | | </script> |
| | | </div> |
| | | </div> |
| | | |
| | | <script type="text/html" id="toolbarDemo"> |
| | | <!-- <script type="text/html" id="toolbarDemo"> |
| | | <button style="margin-right: 5px;" class="layui-btn layui-btn-sm layuiadmin-btn-list addClass" lay-event="add" > |
| | | <i class="layui-icon"></i>添加 |
| | | </button> |
| | |
| | | <button style="margin-right: 5px;" id="daoru" class="layui-btn layui-btn-sm layuiadmin-btn-list DaoRuClass" lay-event="import" > |
| | | <i class="layui-icon"></i>导入 |
| | | </button> |
| | | </script> |
| | | </script> --> |
| | | |
| | | <script type="text/html" id="toolbarDemoList"> |
| | | {{# function GetBtn2(d){ |
| | |
| | | |
| | | // 搜索方法 |
| | | form.on('submit(LAY-app-contlist-search)', function (data) { |
| | | bindTable(); |
| | | |
| | | }); |
| | | bindTable(); |
| | | |
| | | }); |
| | | |
| | | // 页面加载绑定Table |
| | | bindTable(); |
| | | |
| | | |
| | | |
| | | // 添加导入按钮单机事件 |
| | | table.on('toolbar(Box-list)', function (obj) { |
| | | switch (obj.event) { |
| | | case 'add': // 添加箱支关系 |
| | | // layer.open({ |
| | | // type: 2, |
| | | // title: '自定义列', |
| | | // content: '../SystemSettings/HeaderSetting.html', |
| | | // maxmin: false, |
| | | // resize: false, |
| | | // area: ['970px', '650px'] |
| | | // }); |
| | | layer.open({ |
| | | type: 2, |
| | | title: '打印', |
| | | content: 'LabelPrint.html?', |
| | | maxmin: true, |
| | | area: ['600px', '670px'], |
| | | btn: ['取消'] |
| | | }); |
| | | // layer.open({ |
| | | // type: 2, |
| | | // title: '自定义列', |
| | | // content: '../SystemSettings/HeaderSetting.html', |
| | | // maxmin: false, |
| | | // resize: false, |
| | | // area: ['970px', '650px'] |
| | | // }); |
| | | layer.open({ |
| | | type: 2, |
| | | title: '打印', |
| | | content: 'LabelPrint.html?', |
| | | maxmin: true, |
| | | area: ['600px', '670px'], |
| | | btn: ['取消'] |
| | | }); |
| | | break; |
| | | |
| | | |
| | | default: break; |
| | | } |
| | | }); |
| | |
| | | // 查询录入的箱支关系 |
| | | //#region 自定义表头 |
| | | var TotalColsArr = [[ |
| | | |
| | | {field: 'BoxNo',title: '箱号',align: 'center',fixed: 'left',width: 220, "disabled": true}, |
| | | {field: 'ParentBoxNo',title: '父级箱号',align: 'center',fixed: 'left',width: 220, "disabled": true}, |
| | | {field: 'SkuNo',title: '物料编码',align: 'center',fixed: 'left',width: 140, "disabled": true }, |
| | | {field: 'SkuName',title: '物料名称',align: 'center',width: 240, }, |
| | | {field: 'Qty',title: '数量',align: 'center',width: 100,}, |
| | | {field: 'LotNo',title: '批次号',align: 'center',width: 155,}, |
| | | {field: 'LotText',title: '批次描述',align: 'center',width: 165}, |
| | | {field: 'AsnNo',title: '单据号',align: 'center',width: 155,}, |
| | | {field: 'IsUse',title: '是否使用',align: 'center',templet: '#templetIsUse',width: 90}, |
| | | {field: 'Level',title: '级别',align: 'center',width: 90}, |
| | | {field: 'ProductionTime',title: '生产日期',align: 'center',width: 160,templet: '#templetProductionTime'}, |
| | | {field: 'ExpirationTime',title: '过期日期',align: 'center',width: 160,templet: '#templetExpirationTime'}, |
| | | {field: 'InspectTime',title: '复验日期',align: 'center',width: 160,templet: '#templetInspectTime'}, |
| | | {field: 'CompleteTime',title: '完成日期',align: 'center',width: 160,templet: '#templetCompleteTime'}, |
| | | {field: 'SupplierName',title: '供应商',align: 'center',width: 155}, |
| | | {field: 'SupplierLot',title: '供货批次',align: 'center',width: 155}, |
| | | |
| | | {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} |
| | | ]]; |
| | | //url编码 |
| | | var TotalColsSysArr=encodeURIComponent(encodeURIComponent(JSON.stringify(TotalColsArr)))//将表头数据进行url编码 |
| | | |
| | | { field: 'AsnNo', title: '入库单号', align: 'center', width: 155, "disabled": true }, |
| | | { field: 'BoxNo', title: '箱号', align: 'center', fixed: 'left', width: 220, "disabled": true }, |
| | | { field: 'ParentBoxNo', title: '父级箱号', align: 'center', fixed: 'left', width: 220, "disabled": true }, |
| | | { field: 'SkuNo', title: '物料编码', align: 'center', fixed: 'left', width: 140, "disabled": true }, |
| | | { field: 'SkuName', title: '物料名称', align: 'center', width: 240, }, |
| | | { field: 'Qty', title: '数量', align: 'center', width: 100, }, |
| | | { field: 'LotNo', title: '批次号', align: 'center', width: 155, }, |
| | | { field: 'LotText', title: '批次描述', align: 'center', width: 165 }, |
| | | { field: 'IsUse', title: '是否使用', align: 'center', templet: '#templetIsUse', width: 90 }, |
| | | { field: 'Level', title: '级别', align: 'center', width: 90 }, |
| | | { field: 'ProductionTime', title: '生产日期', align: 'center', width: 160, templet: '#templetProductionTime' }, |
| | | { field: 'ExpirationTime', title: '过期日期', align: 'center', width: 160, templet: '#templetExpirationTime' }, |
| | | { field: 'InspectTime', title: '复验日期', align: 'center', width: 160, templet: '#templetInspectTime' }, |
| | | { field: 'CompleteTime', title: '完成日期', align: 'center', width: 160, templet: '#templetCompleteTime' }, |
| | | { field: 'SupplierName', title: '供应商', align: 'center', width: 155 }, |
| | | { field: 'SupplierLot', title: '供货批次', align: 'center', width: 155 }, |
| | | |
| | | { 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 } |
| | | ]]; |
| | | //url编码 |
| | | var TotalColsSysArr = encodeURIComponent(encodeURIComponent(JSON.stringify(TotalColsArr)))//将表头数据进行url编码 |
| | | //#endregion |
| | | function bindTable() { |
| | | |
| | | |
| | | |
| | | //#region 自定义表头 |
| | | var colsJson |
| | | var param1={ |
| | | Href:'BllAsn/GetLabelBoxList' |
| | | var param1 = { |
| | | Href: 'BllAsn/GetLabelBoxList' |
| | | }; |
| | | sendData(IP + "/Sys/GetTableColsByUserId", param1, 'post', function(res) { |
| | | if (res.code == 0){ |
| | | if(res.data=='' || res.data==undefined || res.data==null){ |
| | | colsJson=TotalColsArr |
| | | }else{ |
| | | colsJson= eval(res.data); |
| | | sendData(IP + "/Sys/GetTableColsByUserId", param1, 'post', function (res) { |
| | | if (res.code == 0) { |
| | | if (res.data == '' || res.data == undefined || res.data == null) { |
| | | colsJson = TotalColsArr |
| | | } else { |
| | | colsJson = eval(res.data); |
| | | } |
| | | }else{ |
| | | colsJson=TotalColsArr |
| | | } else { |
| | | colsJson = TotalColsArr |
| | | } |
| | | var param = { |
| | | BoxNo: $("#BoxNo").val(), |
| | | // BoxNo2: $("#BoxNo2").val(), |
| | | BoxNo3: $("#BoxNo3").val(), |
| | | SkuNo: $("#SkuNo").val(), |
| | | LotNo: $("#LotNo").val(), |
| | |
| | | ProductionTime: $("#ProductionTime").val(), |
| | | InspectMark: $("#InspectMark").val(), |
| | | BitBoxMark: $("#BitBoxMark").val(), |
| | | // Origin: "录入", |
| | | }; |
| | | table.render({ |
| | | elem: '#Box-list', |
| | |
| | | id: 'Box-list', |
| | | where: param, |
| | | contentType: 'application/json', |
| | | toolbar: '#toolbarDemo', |
| | | defaultToolbar: [], //'filter','print', 'exports' |
| | | headers: { ToKen: $.cookie('token') }, |
| | | page: true, |
| | |
| | | done: function (res) { |
| | | setRight(); |
| | | //自定义列宽 |
| | | SetTableColW('Box-list','BllAsn/GetLabelBoxList',TotalColsSysArr); |
| | | SetTableColW('Box-list', 'BllAsn/GetLabelBoxList', TotalColsSysArr); |
| | | }, |
| | | cols: colsJson |
| | | }); |
| | |
| | | $(function () { |
| | | $(".addClass").hide(); |
| | | $(".DaoRuClass").hide(); |
| | | $(".delClass").hide(); |
| | | $(".delClass").hide(); |
| | | }); |
| | | sendData(IP + "/Basis/GetRoleRightList", {}, 'get', function (res) { |
| | | if (res.code == 0) { //成功 |
| | |
| | | } |
| | | if (res.data[k].MenuName == "删除箱支录入") { |
| | | $(function () { |
| | | $(".delClass").show(); |
| | | $(".delClass").show(); |
| | | }); |
| | | } |
| | | } |
| | |
| | | }); |
| | | return msg; |
| | | } |
| | | // if ($("#BoxNo2").val() == "") { |
| | | // layer.msg("请输入盒码!", { |
| | | // icon: 2, |
| | | // time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | // }); |
| | | // return msg; |
| | | // } |
| | | if ($("#BoxNo3").val() == "") { |
| | | layer.msg("请输入支码!", { |
| | | icon: 2, |
| | |
| | | |
| | | var param = { |
| | | BoxNo: $("#BoxNo").val(), |
| | | // BoxNo2: $("#BoxNo2").val(), |
| | | BoxNo3: $("#BoxNo3").val(), |
| | | SkuNo: $("#SkuNo").val(), |
| | | LotNo: $("#LotNo").val(), |
| | |
| | | doing = true |
| | | }); |
| | | } else { //不成功 |
| | | if(res.msg==undefined){ |
| | | if (res.msg == undefined) { |
| | | layer.msg("后台正在导入中,请稍后查看结果", { |
| | | icon: 2, |
| | | time: 3000 //2秒关闭(如果不配置,默认是3秒) |
| | | }, function () { bindTable();doing = true }); |
| | | }else{ |
| | | }, function () { bindTable(); doing = true }); |
| | | } else { |
| | | layer.msg(res.msg, { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }, function () { bindTable();doing = true }); |
| | | } |
| | | }, function () { bindTable(); doing = true }); |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | |
| | | //#region 自定义表头 |
| | | //自定义表头 |
| | | active = { |
| | | customCols: function(){ |
| | | customCols: function () { |
| | | layer.open({ |
| | | type: 2, |
| | | title: '自定义列', |
| | | content: '../SystemSettings/HeaderSetting.html?Href=BllAsn/GetLabelBoxList&ColsSysArr='+TotalColsSysArr, |
| | | content: '../SystemSettings/HeaderSetting.html?Href=BllAsn/GetLabelBoxList&ColsSysArr=' + TotalColsSysArr, |
| | | maxmin: false, |
| | | resize: false, |
| | | area: ['970px', '650px'] |
| | | }); |
| | | }, |
| | | }; |
| | | $('.layui-btn').on('click', function() { |
| | | $('.layui-btn').on('click', function () { |
| | | var type = $(this).data('type'); |
| | | active[type] ? active[type].call(this) : ''; |
| | | }); |
| | |
| | | |
| | | <body> |
| | | <div style="width:100%;text-align: center;"> |
| | | <div style="padding-top: 10px;text-align: left; margin-left: 5%;" id="button"> |
| | | <div class="layui-inline"> |
| | | <button id="btnAdd" class="layui-btn layui-btn-sm" lay-event="Add2"><i |
| | | class="layui-icon"></i>生成标签</button> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <button id="btnPrint" class="layui-btn layui-btn-sm" lay-event="Add"><i |
| | | class="layui-icon"></i>打印</button> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form" lay-filter="layuiadmin-app-form-list" id="print" |
| | | style="width: 100%;height:100%; text-align: right;padding-top: 5px;margin-left: 0%;"> |
| | | <div> |
| | |
| | | </tr> |
| | | <tr> |
| | | <td>品名</td> |
| | | <td colspan="3" id="goodName"></td> |
| | | <td colspan="3" id="SkuName"></td> |
| | | </tr> |
| | | <tr> |
| | | <td>规格/型号</td> |
| | |
| | | <td>进厂编号</td> |
| | | <td style="padding: 1px 0px;"></td> |
| | | <td>物料代码</td> |
| | | <td style="padding: 1px 0px;"> </td> |
| | | <td id="SkuNo"> </td> |
| | | </tr> |
| | | <tr> |
| | | <td>原厂批号</td> |
| | |
| | | |
| | | </div> |
| | | <div style="page-break-after: always;"></div> |
| | | </div> |
| | | <hr> |
| | | <div style="padding-top: 10px;text-align: left;" id="button"> |
| | | <div class="layui-inline" style="margin-right: 10px;"> |
| | | <span style="padding-right: 5px;">是否重置批次:</span> |
| | | <span style="padding-right: 5px;">是</span><input type="radio" checked="true" name="isprint" value="1"> |
| | | <span style="padding-right: 5px;">否</span><input type="radio" name="isprint" value="0"> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | 到货数量:<div class="layui-input-inline"> |
| | | <input type="text" |
| | | oninput="value=value.replace(/[^\d^\.]+/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.').replace(/^(\-)*(\d+)\.(\d\d\d).*$/,'$1$2.$3')" |
| | | onafterpaste="this.value=this.value.replace(/[^\d^\.]+/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.').replace(/^(\-)*(\d+)\.(\d\d\d).*$/,'$1$2.$3')" |
| | | name="skuNum" id="skuNum" lay-verify="skuNum" placeholder="" style="width: 100px;" |
| | | autocomplete="off" class="layui-input InputCss"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | 箱标签数量:<div class="layui-input-inline"> |
| | | <input type="text" onkeyup="this.value=this.value.replace(/^0{1,}/g,'')" |
| | | onafterpaste="this.value=this.value.replace(/^0{1,}/g,'')" name="bQNum" id="bQNum" |
| | | lay-verify="bQNum" placeholder="" style="width: 100px;" autocomplete="off" |
| | | class="layui-input InputCss"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div> |
| | | <div class="layui-inline" style="padding-top: 5px"> |
| | | 一级标签必录参数:箱内数量:<div class="layui-input-inline"> |
| | | <input type="text" |
| | | oninput="value=value.replace(/[^\d^\.]+/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.').replace(/^(\-)*(\d+)\.(\d\d\d).*$/,'$1$2.$3')" |
| | | onafterpaste="this.value=this.value.replace(/[^\d^\.]+/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.').replace(/^(\-)*(\d+)\.(\d\d\d).*$/,'$1$2.$3')" |
| | | name="number" id="number" lay-verify="number" placeholder="" style="width: 70px;" |
| | | autocomplete="off" class="layui-input InputCss"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <button id="btnPrint" class="layui-btn layui-btn-sm" lay-event="Add"><i |
| | | class="layui-icon"></i>打印</button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | </div> |
| | | <script src="../../layuiadmin/layui/layui.js"></script> |
| | | <script src="../../js/public.js"></script> |
| | |
| | | form = layui.form, |
| | | layer = layui.layer; |
| | | var laydate = layui.laydate; |
| | | laydate.render({ |
| | | elem: '#ProductionDate' |
| | | , format: 'yyyy-MM-dd' //可任意组合 |
| | | }); |
| | | laydate.render({ |
| | | elem: '#InspectTime' |
| | | , format: 'yyyy-MM-dd' //可任意组合 |
| | | }); |
| | | laydate.render({ |
| | | elem: '#ExpirationTime' |
| | | , format: 'yyyy-MM-dd' //可任意组合 |
| | | }); |
| | | var id = getQueryString('id'); |
| | | var xun = 0; |
| | | |
| | | var id = getQueryString('Id'); |
| | | var reset = getQueryString('Reset'); |
| | | var arriveQty = getQueryString('ArriveQty'); |
| | | |
| | | var productionTime = getQueryString('ProductionTime'); |
| | | var expirationTime = getQueryString('ExpirationTime'); |
| | | var storeTime = getQueryString('StoreTime'); |
| | | // var level = getQueryString('Level'); |
| | | // var type = getQueryString('Type'); |
| | | // var boxType = getQueryString('BoxType'); |
| | | // var qty = getQueryString('Qty'); |
| | | |
| | | console.log(productionTime); |
| | | console.log(expirationTime); |
| | | console.log(storeTime); |
| | | |
| | | $('#btnPrint').on('click', function () { |
| | | var param = { |
| | |
| | | id = 0; |
| | | } |
| | | else { |
| | | div(-1, 1, 0); |
| | | var param = { |
| | | id: id, |
| | | }; |
| | | synData(IP + "/BllAsn/GetLabelBoxModel", param , 'get', function (res) { |
| | | if (res.code == 0) { //成功 |
| | | $("#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); |
| | | |
| | | // $("#imgBar").attr("src", res.data[0].imageStr); |
| | | } else { //不成功 |
| | | layer.msg(res.msg, { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }, function () { }); |
| | | } |
| | | }); |
| | | |
| | | // div(-1, 1, 0); |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | // 获取传递参数 |
| | | function getQueryString(name) { |
| | | var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); |
| | | var r = window.location.search.substr(1).match(reg); |
| | | var r = window.location.search.substr(1).match(reg); |
| | | if (r != null) return unescape(r[2]); |
| | | return null; |
| | | } |
| | |
| | | </head> |
| | | <body> |
| | | <div class="layui-form" lay-filter="layuiadmin-app-form-list" id="layuiadmin-app-form-list" style="padding: 20px 30px 0 0;"> |
| | | |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">生产日期</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="productionTime" id="productionTime" placeholder="请输入生产日期" autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">有效期至</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="expirationTime" id="expirationTime" placeholder="请输入有效期至" autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">储存期至</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="storeTime" id="storeTime" placeholder="请输入储存期至" autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">重置批号</label> |
| | | <div class="layui-input-block"> |
| | |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <!-- <div class="layui-form-item"> |
| | | <label class="layui-form-label">标签级别</label> |
| | | <div class="layui-input-block"> |
| | | <select name="level" id="level" lay-filter="levelFil" lay-verify="required"> |
| | |
| | | <option value="0">无层级</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> --> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">到货数量</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name=arriveQty" id="arriveQty" lay-verify="required" placeholder="请输入巷道名称" autocomplete="off" class="layui-input"> |
| | | <input type="text" name="arriveQty" id="arriveQty" lay-verify="required" placeholder="请输入到货数量" autocomplete="off" class="layui-input" oninput="value=value.replace(/[^\d^\.]+/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.').replace(/^(\-)*(\d+)\.(\d\d\d\d).*$/,'$1$2.$3')" |
| | | onafterpaste="this.value=this.value.replace(/[^\d^\.]+/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.').replace(/^(\-)*(\d+)\.(\d\d\d\d).*$/,'$1$2.$3')"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item" id="boxTypeDiv" style="display: none;"> |
| | | |
| | | <!-- <div class="layui-form-item" id="boxTypeDiv" style="display: none;"> |
| | | <label class="layui-form-label">箱支类型</label> |
| | | <div class="layui-input-block"> |
| | | <select name="boxType" id="boxType" lay-filter="boxTypeFil" lay-search> |
| | |
| | | <div class="layui-form-item" id="qtyDiv" style="display: none;"> |
| | | <label class="layui-form-label">数量</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="qty" id="qty" placeholder="请输入巷道名称" autocomplete="off" class="layui-input"> |
| | | <input type="text" name="qty" id="qty" placeholder="请输入数量" autocomplete="off" class="layui-input" oninput="value=value.replace(/[^\d^\.]+/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.').replace(/^(\-)*(\d+)\.(\d\d\d\d).*$/,'$1$2.$3')" |
| | | onafterpaste="this.value=this.value.replace(/[^\d^\.]+/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.').replace(/^(\-)*(\d+)\.(\d\d\d\d).*$/,'$1$2.$3')"> |
| | | </div> |
| | | </div> |
| | | </div> --> |
| | | <div class="layui-form-item layui-hide"> |
| | | <input type="button" lay-submit lay-filter="layuiadmin-app-form-submit" id="layuiadmin-app-form-submit" value="确认添加"> |
| | | <input type="button" lay-submit lay-filter="layuiadmin-app-form-edit" id="layuiadmin-app-form-edit" value="确认编辑"> |
| | |
| | | base: '../../layuiadmin/' //静态资源所在路径 |
| | | }).extend({ |
| | | index: 'lib/index' //主入口模块 |
| | | }).use(['index', 'form', 'layer'], function() { |
| | | }).use(['index', 'form', 'layer', 'laydate'], function() { |
| | | var $ = layui.$; |
| | | var form = layui.form; |
| | | var layer = layui.layer; |
| | | form.on('select(levelFil)', function(data){ |
| | | console.log($("#type").val()); |
| | | var type = $("#type").val(); |
| | | if (data.value == "1" ) { |
| | | $("#boxTypeDiv").css("display","none"); |
| | | form.val("layuiadmin-app-form-list", { |
| | | "boxType": "" |
| | | }); |
| | | $("#boxType").removeAttr("lay-verify"); |
| | | var laydate = layui.laydate; |
| | | laydate.render({ |
| | | elem: '#productionTime' |
| | | , format: 'yyyy-MM-dd' //可任意组合 |
| | | }); |
| | | laydate.render({ |
| | | elem: '#expirationTime' |
| | | , format: 'yyyy-MM-dd' //可任意组合 |
| | | }); |
| | | laydate.render({ |
| | | elem: '#storeTime' |
| | | , format: 'yyyy-MM-dd' //可任意组合 |
| | | }); |
| | | |
| | | $("#qtyDiv").css("display","none"); |
| | | $("#qty").removeAttr("lay-verify"); |
| | | $("#qty").val(""); |
| | | // form.on('select(levelFil)', function(data){ |
| | | // console.log($("#type").val()); |
| | | // var type = $("#type").val(); |
| | | // if (data.value == "1" ) { |
| | | // $("#boxTypeDiv").css("display","none"); |
| | | // form.val("layuiadmin-app-form-list", { |
| | | // "boxType": "" |
| | | // }); |
| | | // $("#boxType").removeAttr("lay-verify"); |
| | | |
| | | form.render('select'); |
| | | } |
| | | if (data.value == "2" && type == "0") { |
| | | $("#boxTypeDiv").css("display","block"); |
| | | $("#boxType").attr("lay-verify","required"); |
| | | // $("#qtyDiv").css("display","none"); |
| | | // $("#qty").removeAttr("lay-verify"); |
| | | // $("#qty").val(""); |
| | | |
| | | // form.render('select'); |
| | | // } |
| | | // if (data.value == "2" && type == "0") { |
| | | // $("#boxTypeDiv").css("display","block"); |
| | | // $("#boxType").attr("lay-verify","required"); |
| | | |
| | | } |
| | | }); |
| | | form.on('select(typeFil)', function(data){ |
| | | var level = $("#level").val(); |
| | | if (data.value == "1") { |
| | | $("#boxTypeDiv").css("display","none"); |
| | | // } |
| | | // }); |
| | | // form.on('select(typeFil)', function(data){ |
| | | // var level = $("#level").val(); |
| | | // if (data.value == "1") { |
| | | // $("#boxTypeDiv").css("display","none"); |
| | | |
| | | form.val("layuiadmin-app-form-list", { |
| | | "boxType": "" |
| | | }); |
| | | $("#boxType").removeAttr("lay-verify"); |
| | | |
| | | $("#qtyDiv").css("display","none"); |
| | | $("#qty").removeAttr("lay-verify"); |
| | | $("#qty").val(""); |
| | | form.render('select'); |
| | | } |
| | | if (data.value == "0" && level == "2") { |
| | | $("#boxTypeDiv").css("display","block"); |
| | | $("#boxType").attr("lay-verify","required"); |
| | | // form.val("layuiadmin-app-form-list", { |
| | | // "boxType": "" |
| | | // }); |
| | | // $("#boxType").removeAttr("lay-verify"); |
| | | |
| | | } |
| | | }); |
| | | form.on('select(boxTypeFil)', function(data){ |
| | | if (data.value == "1") { //箱 |
| | | $("#qtyDiv").css("display","none"); |
| | | $("#qty").removeAttr("lay-verify"); |
| | | $("#qty").val(""); |
| | | } |
| | | if (data.value == "2" ) { |
| | | $("#qtyDiv").css("display","block"); |
| | | $("#qty").attr("lay-verify","required"); |
| | | } |
| | | }); |
| | | // $("#qtyDiv").css("display","none"); |
| | | // $("#qty").removeAttr("lay-verify"); |
| | | // $("#qty").val(""); |
| | | // form.render('select'); |
| | | // } |
| | | // if (data.value == "0" && level == "2") { |
| | | // $("#boxTypeDiv").css("display","block"); |
| | | // $("#boxType").attr("lay-verify","required"); |
| | | |
| | | // } |
| | | // }); |
| | | // form.on('select(boxTypeFil)', function(data){ |
| | | // if (data.value == "1") { //箱 |
| | | // $("#qtyDiv").css("display","none"); |
| | | // $("#qty").removeAttr("lay-verify"); |
| | | // $("#qty").val(""); |
| | | // } |
| | | // if (data.value == "2" ) { |
| | | // $("#qtyDiv").css("display","block"); |
| | | // $("#qty").attr("lay-verify","required"); |
| | | // } |
| | | // }); |
| | | |
| | | |
| | | }) |
| | |
| | | <!-- 有码 --> |
| | | <div id="content1"> |
| | | <div id="zongDiv" class="layout-bill-info" style="height: 255px;"> |
| | | <form class="layui-form" action=""> |
| | | <form class="layui-form" id="form1" action=""> |
| | | <div id="" class="layui-form-item layout-dropdownlist"> |
| | | <label class="layui-form-label" lang>入库单:</label> |
| | | <div class="layui-input-block" id="selectDiv"> |
| | |
| | | </tr> |
| | | |
| | | </table> |
| | | |
| | | <table class="layout-tbl-submit" border="" cellspacing="" cellpadding=""> |
| | | <tr> |
| | | <td style="width: 23%;"></td> |
| | | <td> |
| | | <button class="layout-btn layout-btn-red" lang type="button" lay-submit |
| | | lay-filter="formBind">绑定到托盘</button> |
| | | </td> |
| | | <td style="width: 33%;"></td> |
| | | |
| | | </tr> |
| | | </table> |
| | | |
| | | </form> |
| | | </div> |
| | | |
| | | <br> |
| | | |
| | | <div id="" class="cut-line"> |
| | | <img src="/assets/fengexian.png"> |
| | | </div> |
| | | |
| | | <div class="layout-tbl-paging" id=""> |
| | | <table id="tableBoxList" class="tbl-box-list" border="" cellspacing="" cellpadding=""> |
| | | <tr> |
| | | <th lang style="width: 15%;">编码</th> |
| | | <th lang style="width: 35%;">名称</th> |
| | | <th lang style="width: 25%;">批次</th> |
| | | <th lang style="width: 15%;">数量</th> |
| | | <th lang style="width: 10%;">操作</th> |
| | | </tr> |
| | | <tr id="boxCell" style="display: none;"> |
| | | <td name="code">AG000001</td> |
| | | <td name="name">疫苗名称名称名称</td> |
| | | <td name="lotNo">批次号</td> |
| | | <td name="num">30</td> |
| | | <td name="del"> |
| | | <div id="" class="tbl-btn-del" lang> |
| | | 删除 |
| | | </div> |
| | | </td> |
| | | </tr> |
| | | </table> |
| | | <!-- 分页 --> |
| | | <table id="tableBoxPages" class="tbl-box-pages" border="" cellspacing="" cellpadding=""> |
| | | <tr style="display: ;"> |
| | | <td class="page-prev">上一页</td> |
| | | <td class="page-num page-num-select">1</td> |
| | | <td class="page-num">2</td> |
| | | <td class="page-num">3</td> |
| | | <td class="page-num">4</td> |
| | | <td class="page-num">5</td> |
| | | <td class="page-next">下一页</td> |
| | | </tr> |
| | | </table> |
| | | </div> |
| | | |
| | | </div> |
| | | <!-- 无码 --> |
| | | <div id="content2"> |
| | | <div id="zongDiv" class="layout-bill-info" style="height: 255px;"> |
| | | <form class="layui-form" action=""> |
| | | <form class="layui-form" id="form2" action=""> |
| | | <div id="" class="layui-form-item layout-dropdownlist"> |
| | | <label class="layui-form-label" lang>入库单:</label> |
| | | <div class="layui-input-block" id="selectDivw"> |
| | | <select id="barw" lay-filter="getbar" lay-search> |
| | | <div class="layui-input-block" id="selectDiv1"> |
| | | <select id="bar1" lay-filter="getbar" lay-search> |
| | | <option value=""></option> |
| | | </select> |
| | | <img src="/assets/down_arraw.png"> |
| | |
| | | </div> |
| | | <div class="layui-form-item layout-dropdownlist" style="margin-top: 10px;"> |
| | | <label class="layui-form-label">物料-批次:</label> |
| | | <div class="layui-input-block" id="goodDivw"> |
| | | <select id="goodSelectw" lay-filter="goodSelectw" lay-search> |
| | | <div class="layui-input-block" id="goodDiv"> |
| | | <select id="goodSelect1" lay-filter="goodSelect1" lay-search> |
| | | <option value=""></option> |
| | | </select> |
| | | <img src="/assets/down_arraw.png"> |
| | |
| | | <div id="" class="layui-form-item layout-input"> |
| | | <label class="layui-form-label" lang>托盘条码:</label> |
| | | <div class="layui-input-block"> |
| | | <input id="STOCKCODEw" type="text" lay-verify="stock" lang langholder placeholder="请扫描托盘条码" |
| | | <input id="STOCKCODE1" type="text" lay-verify="stock" lang langholder placeholder="请扫描托盘条码" |
| | | autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | |
| | | <div id="" class="layui-form-item layout-input"> |
| | | <label class="layui-form-label" lang>物料数量:</label> |
| | | <div class="layui-input-block"> |
| | | <input id="SkuQtyw" type="text" lay-verify="stock" lang langholder placeholder="请输入物料数量" |
| | | <input id="SkuQty" type="text" lay-verify="stock" lang langholder placeholder="请输入物料数量" |
| | | autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | |
| | | <div id="" class="layui-form-item layout-boxinfo"> |
| | | <label class="layui-form-label" lang>规格/型号:</label> |
| | | <div class="layui-input-block"> |
| | | <input id="Standardw" type="text" disabled placeholder="" autocomplete="off" |
| | | <input id="Standard1" type="text" disabled placeholder="" autocomplete="off" |
| | | class="layui-input"> |
| | | </div> |
| | | </div> |
| | |
| | | <div id="" class="layui-form-item layout-boxinfo"> |
| | | <label class="layui-form-label" lang>计划数量:</label> |
| | | <div class="layui-input-block"> |
| | | <input id="ImportQuantityw" type="text" disabled placeholder="" |
| | | <input id="ImportQuantity1" type="text" disabled placeholder="" |
| | | autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | |
| | | <div id="" class="layui-form-item layout-boxinfo"> |
| | | <label class="layui-form-label" lang>已组数量:</label> |
| | | <div class="layui-input-block"> |
| | | <input id="ImportFactQuantityw" type="text" disabled placeholder="" |
| | | <input id="ImportFactQuantity1" type="text" disabled placeholder="" |
| | | autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | |
| | | |
| | | </table> |
| | | |
| | | <table class="layout-tbl-submit" border="" cellspacing="" cellpadding=""> |
| | | <tr> |
| | | <td style="width: 23%;"></td> |
| | | <td> |
| | | <button class="layout-btn layout-btn-red" lang type="button" lay-submit |
| | | lay-filter="formBind">绑定到托盘</button> |
| | | </td> |
| | | <td style="width: 33%;"></td> |
| | | |
| | | </tr> |
| | | </table> |
| | | |
| | | </form> |
| | | </div> |
| | | |
| | | <br> |
| | | |
| | | <div id="" class="cut-line"> |
| | | <img src="/assets/fengexian.png"> |
| | | </div> |
| | | |
| | | <div class="layout-tbl-paging" id=""> |
| | | <table id="tableBoxList1" class="tbl-box-list" border="" cellspacing="" cellpadding=""> |
| | | <tr> |
| | | <th lang style="width: 15%;">编码</th> |
| | | <th lang style="width: 35%;">名称</th> |
| | | <th lang style="width: 25%;">批次</th> |
| | | <th lang style="width: 15%;">数量</th> |
| | | <th lang style="width: 10%;">操作</th> |
| | | </tr> |
| | | <tr id="boxCell" style="display: none;"> |
| | | <td name="code">AG000001</td> |
| | | <td name="name">疫苗名称名称名称</td> |
| | | <td name="lotNo">批次号</td> |
| | | <td name="num">30</td> |
| | | <td name="del"> |
| | | <div id="" class="tbl-btn-del" lang> |
| | | 删除 |
| | | </div> |
| | | </td> |
| | | </tr> |
| | | </table> |
| | | <!-- 分页 --> |
| | | <table id="tableBoxPages1" class="tbl-box-pages" border="" cellspacing="" cellpadding=""> |
| | | <tr style="display: ;"> |
| | | <td class="page-prev">上一页</td> |
| | | <td class="page-num page-num-select">1</td> |
| | | <td class="page-num">2</td> |
| | | <td class="page-num">3</td> |
| | | <td class="page-num">4</td> |
| | | <td class="page-num">5</td> |
| | | <td class="page-next">下一页</td> |
| | | </tr> |
| | | </table> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | <table class="layout-tbl-submit" border="" cellspacing="" cellpadding=""> |
| | | <tr> |
| | | <td style="width: 23%;"></td> |
| | | <td> |
| | | <button class="layout-btn layout-btn-red" lang type="button" lay-submit |
| | | lay-filter="formBind">绑定到托盘</button> |
| | | </td> |
| | | <td style="width: 33%;"></td> |
| | | |
| | | </tr> |
| | | </table> |
| | | |
| | | <br> |
| | | |
| | | <div id="" class="cut-line"> |
| | | <img src="/assets/fengexian.png"> |
| | | </div> |
| | | |
| | | <div class="layout-tbl-paging" id=""> |
| | | <table id="tableBoxList" class="tbl-box-list" border="" cellspacing="" cellpadding=""> |
| | | <tr> |
| | | <th lang style="width: 15%;">编码</th> |
| | | <th lang style="width: 35%;">名称</th> |
| | | <th lang style="width: 25%;">批次</th> |
| | | <th lang style="width: 15%;">数量</th> |
| | | <th lang style="width: 10%;">操作</th> |
| | | </tr> |
| | | <tr id="boxCell" style="display: none;"> |
| | | <td name="code">AG000001</td> |
| | | <td name="name">疫苗名称名称名称</td> |
| | | <td name="lotNo">批次号</td> |
| | | <td name="num">30</td> |
| | | <td name="del"> |
| | | <div id="" class="tbl-btn-del" lang> |
| | | 删除 |
| | | </div> |
| | | </td> |
| | | </tr> |
| | | </table> |
| | | </div> |
| | | |
| | | |
| | | </div> |
| | | </div> |
| | |
| | | $('#content2').hide(); |
| | | $(document).ready(function() { |
| | | $('#option1').click(function() { |
| | | // qingkong(); |
| | | xianshiyemian = 0; |
| | | $('#content1').show(); |
| | | $('#option1').attr("style", "background-color: aqua;width: 45.77%;float: left;text-align: center;"); //选中后颜色 |
| | |
| | | }); |
| | | |
| | | $('#option2').click(function() { |
| | | // qingkong(); |
| | | xianshiyemian = 1; |
| | | $('#content1').hide(); |
| | | $('#option1').attr("style", "background-color: #999;width: 45.77%;float: left;text-align: center;"); //默认颜色 |
| | |
| | | |
| | | }); |
| | | }); |
| | | |
| | | |
| | | //清空两个标签页内容 |
| | | function qingkong() |
| | | { |
| | | //入库单据 |
| | | // $('#form1').reset() |
| | | // $('#form2').reset() |
| | | |
| | | // //表格内容 |
| | | // let trs = $("#tableBoxList tr") |
| | | // let len = trs.length |
| | | |
| | | // for (i = len - 1; i >= 2; i--) { |
| | | // trs[i].remove(); |
| | | // } |
| | | // let trs1 = $("#tableBoxList1 tr") |
| | | // let len1 = trs1.length |
| | | |
| | | // for (i = len1 - 1; i >= 2; i--) { |
| | | // trs1[i].remove(); |
| | | // } |
| | | } |
| | | |
| | | /*——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————*/ |
| | | |
| | | initLanguage() |
| | | setLanguage() |
| | |
| | | } |
| | | checkPalletStat() |
| | | }) |
| | | // 托盘码文本改变时触发 |
| | | $("#STOCKCODE1").on('input', function () { |
| | | |
| | | // 托盘码文本改变时触发-数量 |
| | | $("#STOCKCODEw").on('input', function () { |
| | | |
| | | if ($("#STOCKCODEw").val() == "" || $("#STOCKCODEw").val().length < 8) { |
| | | if ($("#STOCKCODE1").val() == "" || $("#STOCKCODE1").val().length < 8) { |
| | | return |
| | | } |
| | | if ($("#STOCKCODEw").val().length >= 8) { |
| | | $("#STOCKCODEw").val($("#STOCKCODEw").val().substr(-8)) |
| | | if ($("#STOCKCODE1").val().length >= 8) { |
| | | $("#STOCKCODE1").val($("#STOCKCODE1").val().substr(-8)) |
| | | } |
| | | checkPalletStat() |
| | | }) |
| | |
| | | } |
| | | }); |
| | | |
| | | |
| | | /* 入库单据下拉框 */ |
| | | //点击入库单据下拉框事件 |
| | | $("#selectDiv").click(function () { |
| | | var input = $('select[id="bar"]').next().find('.layui-select-title input') |
| | | var val = input.val() |
| | | //先更新一下入库单 |
| | | updateBillList(function (data) { |
| | | $('select[id="bar"]').next().addClass('layui-form-selected') |
| | | $('select[id="bar"]').next().find('.layui-select-title input').val(val) |
| | | }) |
| | | if (xianshiyemian == 0) |
| | | { |
| | | var input = $('select[id="bar"]').next().find('.layui-select-title input') |
| | | var val = input.val() |
| | | //先更新一下入库单 |
| | | updateBillList(function (data) { |
| | | $('select[id="bar"]').next().addClass('layui-form-selected') |
| | | $('select[id="bar"]').next().find('.layui-select-title input').val(val) |
| | | }) |
| | | } |
| | | }) |
| | | //点击入库单据下拉框事件-数量 |
| | | $("#selectDivw").click(function () { |
| | | var input = $('select[id="barw"]').next().find('.layui-select-title input') |
| | | var val = input.val() |
| | | //先更新一下入库单 |
| | | updateBillList(function (data) { |
| | | $('select[id="barw"]').next().addClass('layui-form-selected') |
| | | $('select[id="barw"]').next().find('.layui-select-title input').val(val) |
| | | }) |
| | | //点击入库单据下拉框事件 |
| | | $("#selectDiv1").click(function () { |
| | | if (xianshiyemian == 1) |
| | | { |
| | | var input = $('select[id="bar1"]').next().find('.layui-select-title input') |
| | | var val = input.val() |
| | | //先更新一下入库单 |
| | | updateBillList(function (data) { |
| | | $('select[id="bar1"]').next().addClass('layui-form-selected') |
| | | $('select[id="bar1"]').next().find('.layui-select-title input').val(val) |
| | | }) |
| | | } |
| | | }) |
| | | |
| | | /*————————————————————————————————————————————————————————————————————————————————————————————————*/ |
| | | |
| | | |
| | | /* 绑定入库单信息 */ |
| | | |
| | | function updateBillList(callback) { |
| | | if (xianshiyemian == 0) |
| | | { |
| | | var input = $('select[id="bar"]').next().find('.layui-select-title input') |
| | | var val = input.val() |
| | | $("#bar").empty() |
| | | $("#bar").append('<option value =>' + '</option>'); |
| | | form.render('select'); |
| | | |
| | | var param = { |
| | | Type: "0,1" |
| | | }; |
| | | sendData(IP + "/PdaAsn/GetArrivalNotices", param, 'post', function (res) { |
| | | if (res.code == 0) { //成功 |
| | | for (var i = 0; i < res.data.length; i++) { |
| | | $("#bar").append('<option value =' + res.data[i].ASNNo + '>' + res.data[i] |
| | | .ASNNo + |
| | | '</option>'); |
| | | } |
| | | form.render('select'); |
| | | |
| | | if (!val) { |
| | | $('#bar').siblings("div.layui-form-select").find('dl').find('.layui-select-tips').addClass('layui-this') |
| | | } else { |
| | | var sel = 'dd[lay-value=' + val + ']'; |
| | | $('#bar').siblings("div.layui-form-select").find('dl').find(sel).addClass('layui-this') |
| | | } |
| | | |
| | | callback(res.data) |
| | | } else { //不成功 |
| | | // layer.msg(res.msg, { |
| | | // icon: 2, |
| | | // time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | // }, function() {}); |
| | | } |
| | | }); |
| | | } |
| | | else if (xianshiyemian == 1) |
| | | { |
| | | var input = $('select[id="bar1"]').next().find('.layui-select-title input') |
| | | var val = input.val() |
| | | $("#bar1").empty() |
| | | $("#bar1").append('<option value =>' + '</option>'); |
| | | form.render('select'); |
| | | |
| | | var param = { |
| | | Type: "2" |
| | | }; |
| | | sendData(IP + "/PdaAsn/GetArrivalNotices", param, 'post', function (res) { |
| | | if (res.code == 0) { //成功 |
| | | for (var i = 0; i < res.data.length; i++) { |
| | | $("#bar1").append('<option value =' + res.data[i].ASNNo + '>' + res.data[i] |
| | | .ASNNo + |
| | | '</option>'); |
| | | } |
| | | form.render('select'); |
| | | |
| | | if (!val) { |
| | | $('#bar1').siblings("div.layui-form-select").find('dl').find('.layui-select-tips').addClass('layui-this') |
| | | } else { |
| | | var sel = 'dd[lay-value=' + val + ']'; |
| | | $('#bar1').siblings("div.layui-form-select").find('dl').find(sel).addClass('layui-this') |
| | | } |
| | | |
| | | callback(res.data) |
| | | } else { //不成功 |
| | | // layer.msg(res.msg, { |
| | | // icon: 2, |
| | | // time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | // }, function() {}); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | } |
| | | |
| | | /*————————————————————————————————————————————————————————————————————————————————————————————————*/ |
| | | |
| | | //点击物料下拉框事件 |
| | | $("#goodDiv").click(function () { |
| | |
| | | }, function () { }); |
| | | } |
| | | }) |
| | | //点击物料下拉框事件-数量 |
| | | $("#goodDivw").click(function () { |
| | | if ($("#barw").val() == null || $("#barw").val() == "" || $("#barw").val() == undefined) { |
| | | layer.msg("请先选择入库单", { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }, function () { }); |
| | | } |
| | | }) |
| | | |
| | | //选中入库单事件 |
| | | form.on('select(getbar)', function (data) { |
| | | updateGoodList() |
| | | setOrderGoods(); |
| | | }); |
| | | //选中入库单事件-数量 |
| | | form.on('select(getbarw)', function (data) { |
| | | updateGoodListw() |
| | | setOrderGoodsw(); |
| | | }); |
| | | |
| | | |
| | | //选中物料事件 |
| | | form.on('select(goodSelect)', function (data) { |
| | | setOrderGoods(); |
| | | }); |
| | | //选中物料事件-数量 |
| | | form.on('select(goodSelectw)', function (data) { |
| | | //选中物料事件-数量 |
| | | form.on('select(goodSelect1)', function (data) { |
| | | setOrderGoods(); |
| | | }); |
| | | |
| | | |
| | | //绑定到托盘事件 |
| | | form.on('submit(formBind)', function (data) { |
| | | console.log(isContinue); |
| | | console.log($("#goodSelect").val()); |
| | | if ($("#bar").val() == "") { |
| | | layer.msg('请选择入库单', { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }); |
| | | return; |
| | | } |
| | | if ($("#goodSelect").val() == "") { |
| | | layer.msg('请选择物料及明细', { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }); |
| | | return; |
| | | } |
| | | if ($("#STOCKCODE").val() == "") { |
| | | layer.msg('请扫描托盘条码', { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }); |
| | | return; |
| | | } |
| | | if ($("#BOXCODE").val() == "") { |
| | | layer.msg('请扫描外箱条码', { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }); |
| | | return; |
| | | } |
| | | var param = { |
| | | AsnNo: $("#bar").val(), |
| | | PalletNo: $("#STOCKCODE").val(), |
| | | AsnDetailId: parseInt($("#goodSelect").val()), |
| | | BoxNo: $("#BOXCODE").val(), |
| | | IsContinue: isContinue, |
| | | TailBoxNo: $("#BOXCODE2").val(), |
| | | Origin:"PDA" |
| | | } |
| | | //组盘 |
| | | sendData(IP + "/PdaAsn/BindPallet", param, 'post', function (res) { |
| | | if (res.code == 0) { //成功 |
| | | layer.msg(res.msg, { |
| | | icon: 1, |
| | | time: 1000 //2秒关闭(如果不配置,默认是3秒) |
| | | }, function () { |
| | | setOrderGoods(); |
| | | refreshTable(); |
| | | $("#BOXCODE").val(""); |
| | | $("#BOXCODE2").val(""); |
| | | $("#QTY").val(""); |
| | | }); |
| | | } else { //不成功 |
| | | layer.msg(res.msg, { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }, function () { |
| | | //回调 |
| | | }); |
| | | } |
| | | }); |
| | | if(xianshiyemian == 0) |
| | | { |
| | | console.log(isContinue); |
| | | console.log($("#goodSelect").val()); |
| | | if ($("#bar").val() == "") { |
| | | layer.msg('请选择入库单', { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }); |
| | | return; |
| | | } |
| | | if ($("#goodSelect").val() == "") { |
| | | layer.msg('请选择物料及明细', { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }); |
| | | return; |
| | | } |
| | | if ($("#STOCKCODE").val() == "") { |
| | | layer.msg('请扫描托盘条码', { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }); |
| | | return; |
| | | } |
| | | if ($("#BOXCODE").val() == "") { |
| | | layer.msg('请扫描外箱条码', { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }); |
| | | return; |
| | | } |
| | | var param = { |
| | | AsnNo: $("#bar").val(), |
| | | PalletNo: $("#STOCKCODE").val(), |
| | | AsnDetailId: parseInt($("#goodSelect").val()), |
| | | BoxNo: $("#BOXCODE").val(), |
| | | IsContinue: isContinue, |
| | | TailBoxNo: $("#BOXCODE2").val(), |
| | | Origin:"PDA" |
| | | } |
| | | //组盘 |
| | | sendData(IP + "/PdaAsn/BindPallet", param, 'post', function (res) { |
| | | if (res.code == 0) { //成功 |
| | | layer.msg(res.msg, { |
| | | icon: 1, |
| | | time: 1000 //2秒关闭(如果不配置,默认是3秒) |
| | | }, function () { |
| | | setOrderGoods(); |
| | | refreshTable(); |
| | | $("#BOXCODE").val(""); |
| | | $("#BOXCODE2").val(""); |
| | | $("#QTY").val(""); |
| | | }); |
| | | } else { //不成功 |
| | | layer.msg(res.msg, { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }, function () { |
| | | //回调 |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | else if(xianshiyemian == 1) |
| | | { |
| | | if ($("#bar1").val() == "") { |
| | | layer.msg('请选择入库单', { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }); |
| | | return; |
| | | } |
| | | if ($("#goodSelect1").val() == "") { |
| | | layer.msg('请选择物料及明细', { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }); |
| | | return; |
| | | } |
| | | if ($("#STOCKCODE1").val() == "") { |
| | | layer.msg('请扫描托盘条码', { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }); |
| | | return; |
| | | } |
| | | var param = { |
| | | AsnNo: $("#bar1").val(), //出库单据 |
| | | PalletNo: $("#STOCKCODE1").val(), //托盘条码 |
| | | AsnDetailId: parseInt($("#goodSelect1").val()), //物料批次 |
| | | SkuQty: parseInt($("#SkuQty").val()), //物料数量 |
| | | Origin:"PDA" |
| | | } |
| | | |
| | | console.log(param) |
| | | //组盘 |
| | | sendData(IP + "/PdaAsn/BindPallet", param, 'post', function (res) { |
| | | if (res.code == 0) { //成功 |
| | | layer.msg(res.msg, { |
| | | icon: 1, |
| | | time: 1000 //2秒关闭(如果不配置,默认是3秒) |
| | | }, function () { |
| | | setOrderGoods(); |
| | | refreshTable(); |
| | | $("#STOCKCODE").val(""); |
| | | $("#SkuQty").val(""); |
| | | }); |
| | | } else { //不成功 |
| | | layer.msg(res.msg, { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }, function () { |
| | | //回调 |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | return false; //阻止表单跳转。如果需要表单跳转,去掉这段即可。 |
| | | }); |
| | | |
| | | |
| | | // 根据入库明细ID 获取详细信息 |
| | | function setOrderGoods() { |
| | | $("#ImportQuantity").val(""); |
| | | $("#Standard").val(""); |
| | | $("#ImportFactQuantity").val(""); |
| | | if (xianshiyemian == 0) |
| | | { |
| | | $("#ImportQuantity").val(""); |
| | | $("#Standard").val(""); |
| | | $("#ImportFactQuantity").val(""); |
| | | |
| | | var param = { |
| | | Id: parseInt($("#goodSelect").val()) |
| | | }; |
| | | var param = { |
| | | Id: parseInt($("#goodSelect").val()) |
| | | }; |
| | | |
| | | synData(IP + "/PdaAsn/GetArrivalNoticeDetail", param, 'post', function (res) { |
| | | console.log(JSON.stringify(res)) |
| | | if (res.code == 0 && res.data != null) { //成功 |
| | | $("#ImportQuantity").val(res.data.Qty); |
| | | $("#Standard").val(res.data.Standard); |
| | | $("#ImportFactQuantity").val(res.data.FactQty + ""); |
| | | } |
| | | }); |
| | | synData(IP + "/PdaAsn/GetArrivalNoticeDetail", param, 'post', function (res) { |
| | | console.log(JSON.stringify(res)) |
| | | if (res.code == 0 && res.data != null) { //成功 |
| | | $("#ImportQuantity").val(res.data.Qty); |
| | | $("#Standard").val(res.data.Standard); |
| | | $("#ImportFactQuantity").val(res.data.FactQty + ""); |
| | | } |
| | | }); |
| | | } |
| | | else if (xianshiyemian == 1) |
| | | { |
| | | $("#ImportQuantity1").val(""); |
| | | $("#Standard1").val(""); |
| | | $("#ImportFactQuantity1").val(""); |
| | | |
| | | var param = { |
| | | Id: parseInt($("#goodSelect1").val()) |
| | | }; |
| | | |
| | | synData(IP + "/PdaAsn/GetArrivalNoticeDetail", param, 'post', function (res) { |
| | | console.log(JSON.stringify(res)) |
| | | if (res.code == 0 && res.data != null) { //成功 |
| | | $("#ImportQuantity1").val(res.data.Qty); |
| | | $("#Standard1").val(res.data.Standard); |
| | | $("#ImportFactQuantity1").val(res.data.FactQty + ""); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | } |
| | | // 根据入库明细ID 获取详细信息-数量 |
| | | function setOrderGoodsw() { |
| | | $("#ImportQuantity").val(""); |
| | | $("#Standard").val(""); |
| | | $("#ImportFactQuantity").val(""); |
| | | |
| | | var param = { |
| | | Id: parseInt($("#goodSelectw").val()) |
| | | }; |
| | | |
| | | synData(IP + "/PdaAsn/GetArrivalNoticeDetail", param, 'post', function (res) { |
| | | console.log(JSON.stringify(res)) |
| | | if (res.code == 0 && res.data != null) { //成功 |
| | | $("#ImportQuantity").val(res.data.Qty); |
| | | $("#Standard").val(res.data.Standard); |
| | | $("#ImportFactQuantity").val(res.data.FactQty + ""); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | // 绑定入库单信息 |
| | | function updateBillList(callback) { |
| | | var input = $('select[id="bar"]').next().find('.layui-select-title input') |
| | | var val = input.val() |
| | | $("#bar").empty() |
| | | $("#bar").append('<option value =>' + '</option>'); |
| | | form.render('select'); |
| | | |
| | | var param = { |
| | | Type: "0,1" |
| | | }; |
| | | sendData(IP + "/PdaAsn/GetArrivalNotices", param, 'post', function (res) { |
| | | if (res.code == 0) { //成功 |
| | | for (var i = 0; i < res.data.length; i++) { |
| | | $("#bar").append('<option value =' + res.data[i].ASNNo + '>' + res.data[i] |
| | | .ASNNo + |
| | | '</option>'); |
| | | } |
| | | form.render('select'); |
| | | |
| | | if (!val) { |
| | | $('#bar').siblings("div.layui-form-select").find('dl').find('.layui-select-tips').addClass('layui-this') |
| | | } else { |
| | | var sel = 'dd[lay-value=' + val + ']'; |
| | | $('#bar').siblings("div.layui-form-select").find('dl').find(sel).addClass('layui-this') |
| | | } |
| | | |
| | | callback(res.data) |
| | | } else { //不成功 |
| | | // layer.msg(res.msg, { |
| | | // icon: 2, |
| | | // time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | // }, function() {}); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | var asnDetails = ""; |
| | | |
| | | // 绑定入库单物料及批次 |
| | | /* 绑定入库单物料及批次 */ |
| | | function updateGoodList() { |
| | | console.log("aaaa"); |
| | | var input = $('select[id="goodSelect"]').next().find('.layui-select-title input') |
| | | var val = input.val() |
| | | if (xianshiyemian == 0) |
| | | { |
| | | console.log("aaaa"); |
| | | var input = $('select[id="goodSelect"]').next().find('.layui-select-title input') |
| | | var val = input.val() |
| | | |
| | | $("#goodSelect").empty() |
| | | $("#goodSelect").append('<option value =>' + '</option>'); |
| | | $("#goodSelect").empty() |
| | | $("#goodSelect").append('<option value =>' + '</option>'); |
| | | |
| | | var param = { |
| | | AsnNo: $("#bar").val(), |
| | | }; |
| | | synData(IP + "/PdaAsn/GetArrivalNoticeDetails", param, 'post', function (res) { |
| | | console.log("出库口:" + JSON.stringify(res)) |
| | | if (res.code == 0) { //成功 |
| | | asnDetails = res.data; |
| | | for (var i = 0; i < res.data.length; i++) { |
| | | if (i == 0) { |
| | | $("#goodSelect").append('<option value =' + res.data[i].Id + ' selected>' + res.data[i] |
| | | .SkuName + "-" + res.data[i].LotNo + |
| | | '</option>'); |
| | | } else { |
| | | $("#goodSelect").append('<option value =' + res.data[i].Id + '>' + res.data[i] |
| | | .SkuName + "-" + res.data[i].LotNo + |
| | | '</option>'); |
| | | } |
| | | var param = { |
| | | AsnNo: $("#bar").val(), |
| | | }; |
| | | synData(IP + "/PdaAsn/GetArrivalNoticeDetails", param, 'post', function (res) { |
| | | console.log("出库口:" + JSON.stringify(res)) |
| | | if (res.code == 0) { //成功 |
| | | asnDetails = res.data; |
| | | for (var i = 0; i < res.data.length; i++) { |
| | | if (i == 0) { |
| | | $("#goodSelect").append('<option value =' + res.data[i].Id + ' selected>' + res.data[i] |
| | | .SkuName + "-" + res.data[i].LotNo + |
| | | '</option>'); |
| | | } else { |
| | | $("#goodSelect").append('<option value =' + res.data[i].Id + '>' + res.data[i] |
| | | .SkuName + "-" + res.data[i].LotNo + |
| | | '</option>'); |
| | | } |
| | | |
| | | } |
| | | form.render('select'); |
| | | } |
| | | form.render('select'); |
| | | |
| | | if (!val) { |
| | | $('#goodSelect').siblings("div.layui-form-select").find('dl').find('.layui-select-tips').addClass('layui-this') |
| | | } else { |
| | | var sel = 'dd[lay-value=' + val + ']'; |
| | | $('#goodSelect').siblings("div.layui-form-select").find('dl').find(sel).addClass('layui-this') |
| | | } |
| | | } else { |
| | | } |
| | | }); |
| | | if (!val) { |
| | | $('#goodSelect').siblings("div.layui-form-select").find('dl').find('.layui-select-tips').addClass('layui-this') |
| | | } else { |
| | | var sel = 'dd[lay-value=' + val + ']'; |
| | | $('#goodSelect').siblings("div.layui-form-select").find('dl').find(sel).addClass('layui-this') |
| | | } |
| | | } else { |
| | | } |
| | | }); |
| | | } |
| | | else if (xianshiyemian == 1) |
| | | { |
| | | console.log("bbbb"); |
| | | var input = $('select[id="goodSelect1"]').next().find('.layui-select-title input') |
| | | var val = input.val() |
| | | |
| | | $("#goodSelect1").empty() |
| | | $("#goodSelect1").append('<option value =>' + '</option>'); |
| | | |
| | | var param = { |
| | | AsnNo: $("#bar1").val(), |
| | | }; |
| | | synData(IP + "/PdaAsn/GetArrivalNoticeDetails", param, 'post', function (res) { |
| | | console.log("出库口:" + JSON.stringify(res)) |
| | | if (res.code == 0) { //成功 |
| | | asnDetails = res.data; |
| | | 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>'); |
| | | } else { |
| | | $("#goodSelect1").append('<option value =' + res.data[i].Id + '>' + res.data[i] |
| | | .SkuName + "-" + res.data[i].LotNo + |
| | | '</option>'); |
| | | } |
| | | |
| | | } |
| | | form.render('select'); |
| | | |
| | | if (!val) { |
| | | $('#goodSelect1').siblings("div.layui-form-select").find('dl').find('.layui-select-tips').addClass('layui-this') |
| | | } else { |
| | | var sel = 'dd[lay-value=' + val + ']'; |
| | | $('#goodSelect1').siblings("div.layui-form-select").find('dl').find(sel).addClass('layui-this') |
| | | } |
| | | } else { |
| | | } |
| | | }); |
| | | } |
| | | |
| | | } |
| | | // 绑定入库单物料及批次-数量 |
| | | function updateGoodList() { |
| | | console.log("aaaa"); |
| | | var input = $('select[id="goodSelectw"]').next().find('.layui-select-title input') |
| | | var val = input.val() |
| | | |
| | | $("#goodSelectw").empty() |
| | | $("#goodSelectw").append('<option value =>' + '</option>'); |
| | | |
| | | var param = { |
| | | AsnNo: $("#bar").val(), |
| | | }; |
| | | synData(IP + "/PdaAsn/GetArrivalNoticeDetails", param, 'post', function (res) { |
| | | console.log("出库口:" + JSON.stringify(res)) |
| | | if (res.code == 0) { //成功 |
| | | asnDetails = res.data; |
| | | for (var i = 0; i < res.data.length; i++) { |
| | | if (i == 0) { |
| | | $("#goodSelectw").append('<option value =' + res.data[i].Id + ' selected>' + res.data[i] |
| | | .SkuName + "-" + res.data[i].LotNo + |
| | | '</option>'); |
| | | } else { |
| | | $("#goodSelectw").append('<option value =' + res.data[i].Id + '>' + res.data[i] |
| | | .SkuName + "-" + res.data[i].LotNo + |
| | | '</option>'); |
| | | } |
| | | |
| | | } |
| | | form.render('select'); |
| | | |
| | | if (!val) { |
| | | $('#goodSelectw').siblings("div.layui-form-select").find('dl').find('.layui-select-tips').addClass('layui-this') |
| | | } else { |
| | | var sel = 'dd[lay-value=' + val + ']'; |
| | | $('#goodSelectw').siblings("div.layui-form-select").find('dl').find(sel).addClass('layui-this') |
| | | } |
| | | } else { |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | // 渲染箱码信息 |
| | | function refreshTable() { |
| | | //先清空一下箱子列表 |
| | | let trs = $("#tableBoxList tr") |
| | | let len = trs.length |
| | | if (xianshiyemian == 0) |
| | | { |
| | | |
| | | for (i = len - 1; i >= 2; i--) { |
| | | trs[i].remove(); |
| | | } |
| | | //先清空一下箱子列表 |
| | | let trs = $("#tableBoxList tr") |
| | | let len = trs.length |
| | | |
| | | //设置托盘号 |
| | | $("#palletCode").val($.cookie('stockCode')) |
| | | for (i = len - 1; i >= 2; i--) { |
| | | trs[i].remove(); |
| | | } |
| | | |
| | | var param = { |
| | | PalletNo: $.cookie('stockCode') |
| | | }; |
| | | // 根据托盘号获取箱码信息 |
| | | sendData(IP + "/PdaAsn/GetBoxInfos", param, 'post', function (res) { |
| | | if (res.code == 0) { //成功 |
| | | var list = res |
| | | var arrTrs = new Array() |
| | | let idx = 0 |
| | | for (var i in res.data) { |
| | | var tr = $("#boxCell").eq(0).clone(); |
| | | tr.appendTo("#tableBoxList"); |
| | | tr.attr('id', res.data[i].Id) |
| | | tr.attr('boxno', res.data[i].BoxNo) |
| | | tr.attr('BindNo', res.data[i].BindNo) |
| | | idx++; |
| | | tr.attr('index', idx) |
| | | tr.find("td[name='code']").html(res.data[i].BoxNo); |
| | | tr.find("td[name='name']").html(res.data[i].SkuName); |
| | | tr.find("td[name='lotNo']").html(res.data[i].LotNo); |
| | | tr.find("td[name='num']").html(res.data[i].Qty); |
| | | tr.find("td[name='del']").click(function () { |
| | | var elem = $(this).parent() |
| | | var boxno = elem.attr('boxno') |
| | | var BindNo = elem.attr('BindNo') |
| | | var Id = elem.attr('id') |
| | | layer.alert("确定要从托盘上删除这个箱物料吗?<br>" + boxno, { |
| | | icon: 2, |
| | | time: 0, //2秒关闭(如果不配置,默认是3秒) |
| | | btn: ['删除', '取消'], |
| | | yes: function () { |
| | | //设置托盘号 |
| | | $("#palletCode").val($.cookie('stockCode')) |
| | | |
| | | var param = { |
| | | Id: Id, |
| | | }; |
| | | sendData(IP + "/PdaAsn/DelBoxInfo", param, 'post', function (res) { |
| | | if (res.code == 0) { //成功 |
| | | layer.msg(res.msg, { |
| | | icon: 1, |
| | | time: 1000 //2秒关闭(如果不配置,默认是3秒) |
| | | }); |
| | | elem.remove() |
| | | setOrderGoods(); |
| | | refreshTable(); |
| | | } else { //不成功 |
| | | layer.msg(res.msg, { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }, function () { }); |
| | | } |
| | | }); |
| | | } |
| | | }) |
| | | }) |
| | | tr.show(); |
| | | arrTrs[i] = tr |
| | | } |
| | | var param = { |
| | | PalletNo: $.cookie('stockCode') |
| | | }; |
| | | // 根据托盘号获取箱码信息 |
| | | sendData(IP + "/PdaAsn/GetBoxInfos", param, 'post', function (res) { |
| | | if (res.code == 0) { //成功 |
| | | var list = res |
| | | var arrTrs = new Array() |
| | | let idx = 0 |
| | | for (var i in res.data) { |
| | | var tr = $("#boxCell").eq(0).clone(); |
| | | tr.appendTo("#tableBoxList"); |
| | | tr.attr('id', res.data[i].Id) |
| | | tr.attr('boxno', res.data[i].BoxNo) |
| | | tr.attr('BindNo', res.data[i].BindNo) |
| | | idx++; |
| | | tr.attr('index', idx) |
| | | tr.find("td[name='code']").html(res.data[i].BoxNo); |
| | | tr.find("td[name='name']").html(res.data[i].SkuName); |
| | | tr.find("td[name='lotNo']").html(res.data[i].LotNo); |
| | | tr.find("td[name='num']").html(res.data[i].Qty); |
| | | tr.find("td[name='del']").click(function () { |
| | | var elem = $(this).parent() |
| | | var boxno = elem.attr('boxno') |
| | | var BindNo = elem.attr('BindNo') |
| | | var Id = elem.attr('id') |
| | | layer.alert("确定要从托盘上删除这个箱物料吗?<br>" + boxno, { |
| | | icon: 2, |
| | | time: 0, //2秒关闭(如果不配置,默认是3秒) |
| | | btn: ['删除', '取消'], |
| | | yes: function () { |
| | | |
| | | var param = { |
| | | Id: Id, |
| | | }; |
| | | sendData(IP + "/PdaAsn/DelBoxInfo", param, 'post', function (res) { |
| | | if (res.code == 0) { //成功 |
| | | layer.msg(res.msg, { |
| | | icon: 1, |
| | | time: 1000 //2秒关闭(如果不配置,默认是3秒) |
| | | }); |
| | | elem.remove() |
| | | setOrderGoods(); |
| | | refreshTable(); |
| | | } else { //不成功 |
| | | layer.msg(res.msg, { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }, function () { }); |
| | | } |
| | | }); |
| | | } |
| | | }) |
| | | }) |
| | | tr.show(); |
| | | arrTrs[i] = tr |
| | | } |
| | | |
| | | } else { //不成功 |
| | | layer.msg("无数据", { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }, function () { }); |
| | | $("#boxNum").val(0) |
| | | } |
| | | }); |
| | | //设置分页 |
| | | setPages(1, list.length) |
| | | } else { //不成功 |
| | | layer.msg("无数据", { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }, function () { }); |
| | | $("#boxNum").val(0) |
| | | setPages(1, 0) |
| | | } |
| | | }); |
| | | |
| | | } |
| | | else if (xianshiyemian == 1) |
| | | { |
| | | //先清空一下箱子列表 |
| | | let trs = $("#tableBoxList1 tr") |
| | | let len = trs.length |
| | | |
| | | for (i = len - 1; i >= 2; i--) { |
| | | trs[i].remove(); |
| | | } |
| | | |
| | | //设置托盘号 |
| | | $("#palletCode").val($.cookie('stockCode1')) |
| | | |
| | | var param = { |
| | | PalletNo: $.cookie('stockCode1') |
| | | }; |
| | | // 根据托盘号获取箱码信息 |
| | | sendData(IP + "/PdaAsn/GetBoxInfos", param, 'post', function (res) { |
| | | if (res.code == 0) { //成功 |
| | | var list = res |
| | | var arrTrs = new Array() |
| | | let idx = 0 |
| | | for (var i in res.data) { |
| | | var tr = $("#boxCell").eq(0).clone(); |
| | | tr.appendTo("#tableBoxList1"); |
| | | tr.attr('id', res.data[i].Id) |
| | | tr.attr('boxno', res.data[i].BoxNo) |
| | | tr.attr('BindNo', res.data[i].BindNo) |
| | | idx++; |
| | | tr.attr('index', idx) |
| | | tr.find("td[name='code']").html(res.data[i].BoxNo); |
| | | tr.find("td[name='name']").html(res.data[i].SkuName); |
| | | tr.find("td[name='lotNo']").html(res.data[i].LotNo); |
| | | tr.find("td[name='num']").html(res.data[i].Qty); |
| | | tr.find("td[name='del']").click(function () { |
| | | var elem = $(this).parent() |
| | | var boxno = elem.attr('boxno') |
| | | var BindNo = elem.attr('BindNo') |
| | | var Id = elem.attr('id') |
| | | layer.alert("确定要从托盘上删除这托物料吗?<br>" + boxno, { |
| | | icon: 2, |
| | | time: 0, //2秒关闭(如果不配置,默认是3秒) |
| | | btn: ['删除', '取消'], |
| | | yes: function () { |
| | | |
| | | var param = { |
| | | Id: Id, |
| | | }; |
| | | sendData(IP + "/PdaAsn/DelBoxInfo", param, 'post', function (res) { |
| | | if (res.code == 0) { //成功 |
| | | layer.msg(res.msg, { |
| | | icon: 1, |
| | | time: 1000 //2秒关闭(如果不配置,默认是3秒) |
| | | }); |
| | | elem.remove() |
| | | setOrderGoods(); |
| | | refreshTable(); |
| | | } else { //不成功 |
| | | layer.msg(res.msg, { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }, function () { }); |
| | | } |
| | | }); |
| | | } |
| | | }) |
| | | }) |
| | | tr.show(); |
| | | arrTrs[i] = tr |
| | | } |
| | | |
| | | //设置分页 |
| | | setPages(1, list.length) |
| | | |
| | | } else { //不成功 |
| | | layer.msg("无数据", { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }, function () { }); |
| | | $("#boxNum").val(0) |
| | | setPages(1, 0) |
| | | } |
| | | }); |
| | | } |
| | | |
| | | } |
| | | |
| | | // 判断托盘码是否可用 |
| | | function checkPalletStat() { |
| | | var param = { |
| | | "PalletNo": $("#STOCKCODE").val() |
| | | } |
| | | sendData(IP + "/PdaAsn/IsEnablePalletNo", param, 'post', function (res) { |
| | | if (res.code == 0) { |
| | | if (xianshiyemian == 0) |
| | | { |
| | | var param = { |
| | | "PalletNo": $("#STOCKCODE").val() |
| | | } |
| | | sendData(IP + "/PdaAsn/IsEnablePalletNo", param, 'post', function (res) { |
| | | if (res.code == 0) { |
| | | |
| | | $.cookie('stockCode', $("#STOCKCODE").val()); |
| | | refreshTable() |
| | | $("#BOXCODE").focus(); |
| | | $.cookie('stockCode', $("#STOCKCODE").val()); |
| | | refreshTable() |
| | | $("#BOXCODE").focus(); |
| | | |
| | | } else { |
| | | layer.msg(res.msg, { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }, function () { }); |
| | | } |
| | | }); |
| | | } else { |
| | | layer.msg(res.msg, { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }, function () { }); |
| | | } |
| | | }); |
| | | } |
| | | else if (xianshiyemian == 1) |
| | | { |
| | | var param = { |
| | | "PalletNo": $("#STOCKCODE1").val() |
| | | } |
| | | sendData(IP + "/PdaAsn/IsEnablePalletNo", param, 'post', function (res) { |
| | | if (res.code == 0) { |
| | | |
| | | $.cookie('stockCode1', $("#STOCKCODE1").val()); |
| | | refreshTable() |
| | | $("#SkuQty").focus(); |
| | | |
| | | } else { |
| | | layer.msg(res.msg, { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }, function () { }); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | } |
| | | // 判断托盘码是否可用 |
| | | function checkPalletStatw() { |
| | | var param = { |
| | | "PalletNo": $("#STOCKCODEw").val() |
| | | } |
| | | sendData(IP + "/PdaAsn/IsEnablePalletNo", param, 'post', function (res) { |
| | | if (res.code == 0) { |
| | | |
| | | $.cookie('STOCKCODEw', $("#STOCKCODEw").val()); |
| | | refreshTable() |
| | | // $("#BOXCODE").focus(); |
| | | |
| | | } else { |
| | | layer.msg(res.msg, { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }, function () { }); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | function checkBoxInfo() { |
| | | var param = { |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | /* 分页 */ |
| | | //设置分页 |
| | | function setPages(pageIndex, boxNum){ |
| | | |
| | | if (xianshiyemian == 0) |
| | | { |
| | | if(boxNum <= 0){ |
| | | //列表为空,隐藏分页页码 |
| | | $("#tableBoxPages").hide() |
| | | return |
| | | } |
| | | |
| | | let pageNum = Math.floor(boxNum / 10); |
| | | if(boxNum % 10 > 0){ |
| | | pageNum += 1; |
| | | } |
| | | //console.log("pageNum is " + pageNum) |
| | | |
| | | $("#tableBoxPages").find("tr").remove() |
| | | let table = $("#tableBoxPages") |
| | | $("<tr></tr>").appendTo("#tableBoxPages") |
| | | |
| | | // let newTr = table.append("<tr></tr>") |
| | | // newTr.append("<td class='page-prev'>上一页</td>") |
| | | $("<td id='prevPage' class='page-prev'>上一页</td>").appendTo("#tableBoxPages tr") |
| | | $("#tableBoxPages tr").eq(0).find("td[id^='prevPage']").click(function(){ |
| | | onClickPrevPage() |
| | | }) |
| | | for(i=1; i < pageNum + 1; i++){ |
| | | // newTr.append("<td class='page-num'>"+ i +"</td>") |
| | | $("<td class='page-num'>"+ i +"</td>").appendTo("#tableBoxPages tr") |
| | | } |
| | | // newTr.append("<td class='page-next'>下一页</td>") |
| | | $("<td id='nextPage' class='page-next'>下一页</td>").appendTo("#tableBoxPages tr") |
| | | $("#tableBoxPages tr").eq(0).find("td[id^='nextPage']").click(function(){ |
| | | onClickNextPage() |
| | | }) |
| | | // pages.show() |
| | | $("#tableBoxPages").show() |
| | | |
| | | setCurPage(1) |
| | | } |
| | | else if (xianshiyemian == 1) |
| | | { |
| | | if(boxNum <= 0){ |
| | | //列表为空,隐藏分页页码 |
| | | $("#tableBoxPages1").hide() |
| | | return |
| | | } |
| | | |
| | | let pageNum = Math.floor(boxNum / 10); |
| | | if(boxNum % 10 > 0){ |
| | | pageNum += 1; |
| | | } |
| | | //console.log("pageNum is " + pageNum) |
| | | |
| | | $("#tableBoxPages1").find("tr").remove() |
| | | let table = $("#tableBoxPages1") |
| | | $("<tr></tr>").appendTo("#tableBoxPages1") |
| | | |
| | | // let newTr = table.append("<tr></tr>") |
| | | // newTr.append("<td class='page-prev'>上一页</td>") |
| | | $("<td id='prevPage' class='page-prev'>上一页</td>").appendTo("#tableBoxPages1 tr") |
| | | $("#tableBoxPages1 tr").eq(0).find("td[id^='prevPage']").click(function(){ |
| | | onClickPrevPage() |
| | | }) |
| | | for(i=1; i < pageNum + 1; i++){ |
| | | // newTr.append("<td class='page-num'>"+ i +"</td>") |
| | | $("<td class='page-num'>"+ i +"</td>").appendTo("#tableBoxPages1 tr") |
| | | } |
| | | // newTr.append("<td class='page-next'>下一页</td>") |
| | | $("<td id='nextPage' class='page-next'>下一页</td>").appendTo("#tableBoxPages1 tr") |
| | | $("#tableBoxPages1 tr").eq(0).find("td[id^='nextPage']").click(function(){ |
| | | onClickNextPage() |
| | | }) |
| | | // pages.show() |
| | | $("#tableBoxPages1").show() |
| | | |
| | | setCurPage(1) |
| | | } |
| | | |
| | | } |
| | | |
| | | //设置当前分页 |
| | | function setCurPage(pageIndex){ |
| | | if (xianshiyemian == 0) |
| | | { |
| | | let totalTrNum = $("#tableBoxList tr").length |
| | | if(totalTrNum <= 2 ){ |
| | | //console.log("tableBoxList 为空 totalTrNum: " + totalTrNum) |
| | | //curPageIndex = 1 |
| | | return |
| | | } |
| | | |
| | | let pageNum = getBoxPageNum() |
| | | if(pageIndex > pageNum){ |
| | | //console.log("设置的页码超出页数, pageIndex : " + pageIndex) |
| | | //curPageIndex = 1 |
| | | return |
| | | } |
| | | |
| | | let startIndex = (pageIndex - 1) * 10 + 1 |
| | | let n = totalTrNum - startIndex |
| | | let endIndex = 0 |
| | | if(n > 9){ |
| | | endIndex = startIndex + 9 |
| | | }else{ |
| | | endIndex = startIndex + n |
| | | } |
| | | |
| | | let trs = $("#tableBoxList tr") |
| | | //console.log("行数 "+trs.length) |
| | | let d = 0 |
| | | for(let i = 2; i < trs.length; i++){ |
| | | //console.log("行索引 " + trs.eq(i).attr('index')) |
| | | let t = trs.eq(i) |
| | | d = t.attr('index') |
| | | if(d >= startIndex && d <= endIndex){ |
| | | //console.log("需要显示") |
| | | //显示行 |
| | | t.show() |
| | | }else{ |
| | | //隐藏行 |
| | | t.hide() |
| | | } |
| | | } |
| | | |
| | | curPageIndex = pageIndex |
| | | |
| | | let ptr = $("#tableBoxPages tr") |
| | | for(let i = 1; i < pageNum+1; i++){ |
| | | ptr.eq(0).find("td").eq(i).removeClass("page-num-select") |
| | | if(i == curPageIndex){ |
| | | ptr.eq(0).find("td").eq(i).addClass("page-num-select") |
| | | } |
| | | } |
| | | } |
| | | else if (xianshiyemian == 1) |
| | | { |
| | | let totalTrNum = $("#tableBoxList1 tr").length |
| | | if(totalTrNum <= 2 ){ |
| | | return |
| | | } |
| | | |
| | | let pageNum = getBoxPageNum() |
| | | if(pageIndex > pageNum){ |
| | | //console.log("设置的页码超出页数, pageIndex : " + pageIndex) |
| | | //curPageIndex = 1 |
| | | return |
| | | } |
| | | |
| | | let startIndex = (pageIndex - 1) * 10 + 1 |
| | | let n = totalTrNum - startIndex |
| | | let endIndex = 0 |
| | | if(n > 9){ |
| | | endIndex = startIndex + 9 |
| | | }else{ |
| | | endIndex = startIndex + n |
| | | } |
| | | |
| | | let trs = $("#tableBoxList1 tr") |
| | | //console.log("行数 "+trs.length) |
| | | let d = 0 |
| | | for(let i = 2; i < trs.length; i++){ |
| | | //console.log("行索引 " + trs.eq(i).attr('index')) |
| | | let t = trs.eq(i) |
| | | d = t.attr('index') |
| | | if(d >= startIndex && d <= endIndex){ |
| | | //console.log("需要显示") |
| | | //显示行 |
| | | t.show() |
| | | }else{ |
| | | //隐藏行 |
| | | t.hide() |
| | | } |
| | | } |
| | | |
| | | curPageIndex = pageIndex |
| | | |
| | | let ptr = $("#tableBoxPages1 tr") |
| | | for(let i = 1; i < pageNum+1; i++){ |
| | | ptr.eq(0).find("td").eq(i).removeClass("page-num-select") |
| | | if(i == curPageIndex){ |
| | | ptr.eq(0).find("td").eq(i).addClass("page-num-select") |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | /*——————————————————————————————————————————————————————————*/ |
| | | |
| | | form.on('switch(IsLianXu)', function (obj) { |
| | | if (obj.elem.checked) { |
| | |
| | | public decimal Qty { get; set; } |
| | | public string SkuNo { get; set; } |
| | | public string SkuName { get; set; } |
| | | public string Standard { get; set; } |
| | | public string PackageStandard { get; set; } |
| | | public DateTime? StoreTime { get; set; } |
| | | public string LotNo { get; set; } |
| | | public string LotText { get; set; } |
| | | public string SupplierName { get; set; } |
| | |
| | | public DateTime CreateTime { get; set; } |
| | | public DateTime? UpdateTime { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 生成一维码图片路径 |
| | | /// </summary> |
| | | public string ImgStr { get; set; } |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | /// </summary> |
| | | public string TailBoxNo01 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// Desc:物料数量 |
| | | /// </summary> |
| | | public int SkuQty { get; set; } |
| | | |
| | | } |
| | | } |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Linq.Expressions; |
| | | using System.Text; |
| | | using Model.ModelDto.BllAsnDto; |
| | | using Model.ModelVm.BllAsnVm; |
| | | using SqlSugar; |
| | | using Utility.Tools; |
| | | using WMS.DAL; |
| | | using WMS.Entity.BllAsnEntity; |
| | | using WMS.Entity.Context; |
| | |
| | | Qty = a.Qty, |
| | | SkuNo = a.SkuNo, |
| | | SkuName = a.SkuName, |
| | | Standard = a.Standard, |
| | | PackageStandard = a.PackageStandard, |
| | | StoreTime = a.StoreTime, |
| | | LotNo = a.LotNo, |
| | | LotText = a.LotText, |
| | | SupplierName = a.SupplierName, |
| | |
| | | throw new Exception(e.Message); |
| | | } |
| | | } |
| | | |
| | | //获取标签模板根据入库单明细ID |
| | | public LabelBoxDto GetLabelBoxModel(int id) |
| | | { |
| | | try |
| | | { |
| | | var asnDetail = Db.Queryable<BllArrivalNoticeDetail>().First(m => m.Id == id && m.IsDel == "0"); |
| | | if (asnDetail == null) |
| | | { |
| | | throw new Exception("未查询到单据明细信息,请核实"); |
| | | } |
| | | |
| | | var packInfo = Db.Queryable<SysPackag>().First(m => m.IsDel == "0" && m.PackagNo == asnDetail.PackagNo); |
| | | if (packInfo == null) |
| | | { |
| | | throw new Exception("未查询到单据明细中的物料包装信息"); |
| | | } |
| | | |
| | | var str = ""; |
| | | |
| | | if (!string.IsNullOrWhiteSpace(packInfo.L1Name)) |
| | | { |
| | | str += packInfo.L1Num + "/" + packInfo.L1Name; |
| | | } |
| | | if (!string.IsNullOrWhiteSpace(packInfo.L2Name)) |
| | | { |
| | | str += "-" + packInfo.L2Num + "/" + packInfo.L2Name; |
| | | } |
| | | if (!string.IsNullOrWhiteSpace(packInfo.L3Name)) |
| | | { |
| | | str += "-" + packInfo.L3Num + "/" + packInfo.L3Name; |
| | | } |
| | | if (!string.IsNullOrWhiteSpace(packInfo.L4Name)) |
| | | { |
| | | str += "-" + packInfo.L4Num + "/" + packInfo.L4Name; |
| | | } |
| | | if (!string.IsNullOrWhiteSpace(packInfo.L5Name)) |
| | | { |
| | | str += "-" + packInfo.L5Num + "/" + packInfo.L5Name; |
| | | } |
| | | |
| | | |
| | | var data = new LabelBoxDto(); |
| | | data.SkuNo = asnDetail.SkuNo; |
| | | data.SkuName = asnDetail.SkuName; |
| | | data.Standard = asnDetail.Standard; |
| | | data.SupplierLot = asnDetail.SupplierLot; |
| | | data.PackageStandard = str; |
| | | return data; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | throw new Exception(e.Message); |
| | | } |
| | | } |
| | | |
| | | //获取标签信息(生成标签) |
| | | public List<LabelBoxDto> AddLabelBoxReturn(int imId, string isReset,decimal arriveQty, string skuName, string standard, string packStandard, string skuNo, |
| | | string supplierLot, string productionTime, string expirationTime, string storeTime, int userId) |
| | | { |
| | | try |
| | | { |
| | | #region 必填验证 |
| | | |
| | | //if (string.IsNullOrWhiteSpace(productionDate)) |
| | | //{ |
| | | // throw new Exception("生产日期需必填,不能为空"); |
| | | //} |
| | | |
| | | //var twoSeletOne = true;//有效期、复验期二选一 |
| | | //if (string.IsNullOrWhiteSpace(expirationTime)) |
| | | //{ |
| | | // twoSeletOne = false; |
| | | //} |
| | | //if (string.IsNullOrWhiteSpace(inspectTime)) |
| | | //{ |
| | | // twoSeletOne = false; |
| | | //} |
| | | |
| | | //if (twoSeletOne) |
| | | //{ |
| | | // throw new Exception("有效期、复验期最好填写一个"); |
| | | //} |
| | | //if (string.IsNullOrWhiteSpace(supplierName)) |
| | | //{ |
| | | // throw new Exception("生产厂家需必填,不能为空"); |
| | | //} |
| | | //if (string.IsNullOrWhiteSpace(supplierLot)) |
| | | //{ |
| | | // throw new Exception("厂家批号需必填,不能为空"); |
| | | //} |
| | | |
| | | //if (bQNum <= 0) |
| | | //{ |
| | | // throw new Exception("外箱标签数量不能为空或小于等于0"); |
| | | //} |
| | | |
| | | #endregion |
| | | |
| | | #region 单据、物料、包装、标签信息获取 |
| | | |
| | | var asnList = Db.Queryable<BllArrivalNoticeDetail>().First(m => m.Id == imId && m.IsDel == "0"); |
| | | if (asnList == null) |
| | | { |
| | | throw new Exception("未查询到单据明细信息"); |
| | | } |
| | | var asn = Db.Queryable<BllArrivalNotice>().First(m => m.ASNNo == asnList.ASNNo && m.IsDel == "0"); |
| | | if (asn == null) |
| | | { |
| | | throw new Exception("未查询到单据信息"); |
| | | } |
| | | //物料 |
| | | var sku = Db.Queryable<SysMaterials>().First(m => m.IsDel == "0" && m.SkuNo == asnList.SkuNo); |
| | | var pack = Db.Queryable<SysPackag>().First(m => m.IsDel == "0" && m.PackagNo == asnList.PackagNo); |
| | | if (pack == null) |
| | | { |
| | | throw new Exception("未查询到当前单据中物料的包装信息"); |
| | | } |
| | | //标签表 |
| | | var label = Db.Queryable<BllLabelBoxNo>().Where(m => m.IsDel == "0" && m.ASNDetailNo == imId).ToList(); |
| | | |
| | | |
| | | #endregion |
| | | |
| | | #region 包装查询 |
| | | |
| | | 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.L1Num.HasValue) |
| | | { |
| | | if (packLevel == 0) |
| | | { |
| | | packLevel = 1; |
| | | bNum = Convert.ToInt32(pack.L1Num); |
| | | } |
| | | zNum = Convert.ToInt32(pack.L1Num); |
| | | } |
| | | |
| | | if (packLevel <= 1)//包装等级小于1,按照1级标签打印 |
| | | { |
| | | packLevel = 1; |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | if (packLevel == 1) |
| | | { |
| | | #region 一级包装 |
| | | |
| | | // 根据用户输入的箱数量计算需要的条码数 |
| | | var labQty = label.Sum(m => m.Qty); |
| | | var qty = asnList.Qty - labQty;//当前单据剩余需要打印的物料数量(不是标签数量) |
| | | if (qty <= 0) |
| | | { |
| | | throw new Exception("当前单据物料标签已打印完毕,如有需要请补打"); |
| | | } |
| | | |
| | | #region 到货数量 |
| | | |
| | | if (arriveQty - qty > 0) |
| | | { |
| | | throw new Exception("到货数量大于未打标签数量,请重新输入到货数量并核实!"); |
| | | } |
| | | else |
| | | { |
| | | qty = arriveQty; |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | int labelNum = 1; //生产条码数量 |
| | | if (zNum > 0) |
| | | { |
| | | labelNum = int.Parse(Math.Ceiling(qty / zNum).ToString());//标签数量 |
| | | } |
| | | else |
| | | { |
| | | throw new Exception("当前单据物料是一级包装,未查询到一级包装信息"); |
| | | } |
| | | |
| | | #region 获取/生成批次号 |
| | | |
| | | string maxLotNoStr = ""; //批次号 |
| | | string maxBoxCode = ""; //箱码号 |
| | | // 生成自编批号 |
| | | string toDayTime = DateTime.Now.ToString("yyyyMMdd"); |
| | | var diJiJian = 0; |
| | | |
| | | var maxLotNo = label.Max(a => a.LotNo); |
| | | var maxBoxNo = label.Max(a => a.BoxNo); |
| | | if (isReset == "0") |
| | | { |
| | | |
| | | maxLotNoStr = maxLotNo; |
| | | maxBoxCode = maxBoxNo; |
| | | if (string.IsNullOrWhiteSpace(maxLotNoStr)) |
| | | { |
| | | maxLotNoStr = toDayTime.Substring(2, 6) + "0001"; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | var maxCode = Db.Queryable<BllLabelBoxNo>().Max(a => a.LotNo); // 获取今天最大批次号 |
| | | if (string.IsNullOrWhiteSpace(maxCode)) |
| | | { |
| | | maxLotNoStr = toDayTime.Substring(2, 6) + "0001"; |
| | | } |
| | | else |
| | | { |
| | | var lotStr = maxCode.Substring(0, 6); |
| | | var timeStr = toDayTime.Substring(2, 6); |
| | | if (lotStr == timeStr) |
| | | { |
| | | maxLotNoStr = toDayTime.Substring(2, 6) + (int.Parse(maxCode.Substring(6, 4)) + 1).ToString().PadLeft(4, '0'); |
| | | } |
| | | else |
| | | { |
| | | maxLotNoStr = timeStr + "0001"; |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | var modelList = new List<LabelBoxDto>(); |
| | | |
| | | for (int i = 1; i <= labelNum; i++) |
| | | { |
| | | // 物料条码信息赋值 |
| | | LabelBoxDto model = new LabelBoxDto(); |
| | | model.AsnDetailNo = imId; |
| | | model.SkuNo = asnList.SkuNo; |
| | | model.SkuName = asnList.SkuName; |
| | | |
| | | model.SupplierName = asn.CustomerName; // 供应商 |
| | | |
| | | model.Standard = asnList.Standard; // 规格 |
| | | model.PackageStandard = packStandard; |
| | | model.SupplierLot = supplierLot; // 厂家批号 |
| | | model.LotNo = maxLotNoStr; //批次 |
| | | |
| | | model.ProductionTime = DateTime.Parse(productionTime); // 生产日期 |
| | | model.StoreTime = DateTime.Parse(storeTime); // 储存期至 |
| | | model.ExpirationTime = DateTime.Parse(expirationTime); // 有效期至/贮存期 |
| | | if (i == labelNum) |
| | | { |
| | | // 最后一个条码 |
| | | var s = zNum * (i - 1); |
| | | if (zNum > qty - s) |
| | | { |
| | | model.Qty = qty - s;// 数量 |
| | | } |
| | | else |
| | | { |
| | | model.Qty = zNum;// 数量 |
| | | } |
| | | } |
| | | else |
| | | { |
| | | model.Qty = zNum; // 数量 |
| | | } |
| | | |
| | | |
| | | if (maxBoxCode == "") |
| | | { |
| | | var str = model.LotNo + "000001"; |
| | | model.BoxNo = str; // 支号 批号+ 流水 2302010001000001 |
| | | maxBoxCode = model.BoxNo; |
| | | } |
| | | else |
| | | { |
| | | model.BoxNo = maxBoxCode.Substring(0, 10) + (int.Parse(maxBoxCode.Substring(10, 6)) + 1).ToString().PadLeft(6, '0'); |
| | | maxBoxCode = model.BoxNo; |
| | | } |
| | | model.ImgStr = BarcodeHelper.GetCodeBarBase64(model.BoxNo, 80, 50); |
| | | |
| | | // 添加到list集合 |
| | | modelList.Add(model); |
| | | |
| | | // 将条码保存到原料条码表 |
| | | var labelModel = new BllLabelBoxNo() |
| | | { |
| | | ASNNo = asnList.ASNNo, |
| | | ASNDetailNo = asnList.Id, |
| | | BoxNo = model.BoxNo, |
| | | ParentBoxNo = "", |
| | | Qty = model.Qty, |
| | | SkuNo = model.SkuNo, |
| | | SkuName = model.SkuName, |
| | | Standard = model.Standard, |
| | | PackageStandard = model.PackageStandard, |
| | | |
| | | LotNo = model.LotNo, |
| | | SupplierName = asn.CustomerName, |
| | | ProductionTime = model.ProductionTime, |
| | | SupplierLot = model.SupplierLot, |
| | | StoreTime = model.StoreTime, |
| | | ExpirationTime = model.ExpirationTime, |
| | | IsUse = "0", |
| | | Level = "1", |
| | | |
| | | CreateUser = userId, |
| | | CreateTime = DateTime.Now, |
| | | }; |
| | | |
| | | Db.Insertable(labelModel).ExecuteCommand(); |
| | | |
| | | } |
| | | |
| | | #endregion |
| | | } |
| | | else //(packLevel == 2) |
| | | { |
| | | #region 二级包装 |
| | | |
| | | // 根据用户输入的箱数量计算需要的条码数 |
| | | var labQty = label.Sum(m => m.Qty); |
| | | var qty2 = asnList.Qty - labQty; |
| | | if (qty2 <= 0) |
| | | { |
| | | throw new Exception("当前单据物料标签已打印完毕,如有需要请补打"); |
| | | } |
| | | |
| | | #region 增加到货数量 |
| | | |
| | | if (arriveQty - qty2 > 0) |
| | | { |
| | | throw new Exception("到货数量大于未打标签数量,请重新输入到货数量!"); |
| | | } |
| | | else |
| | | { |
| | | qty2 = arriveQty; |
| | | } |
| | | #endregion |
| | | |
| | | int labelNum2 = 1; //生产箱条码数量 |
| | | |
| | | labelNum2 = int.Parse(Math.Ceiling(qty2 / bNum).ToString()); |
| | | |
| | | |
| | | |
| | | var ss = bNum / zNum; //每箱支标签数量 |
| | | var labelNumZ2 = Math.Ceiling((decimal)ss); |
| | | |
| | | #region 获取/生成批次号 |
| | | |
| | | string maxCodestr2 = ""; //批次 |
| | | string maxboxcode2 = ""; //箱码 |
| | | string maxboxcode3 = ""; //支码 |
| | | // 生成自编批号 |
| | | string toDayTime2 = DateTime.Now.ToString("yyyyMMdd"); |
| | | if (isReset == "0") |
| | | { |
| | | var maxCode = label.Max(a => a.LotNo); |
| | | var boxCode1 = label.Where(m=>m.Level == "1").Max(a => a.BoxNo);//箱号 |
| | | var boxCode2 = label.Where(m => m.Level == "2").Max(a => a.BoxNo);//支号 |
| | | maxCodestr2 = maxCode; |
| | | maxboxcode2 = boxCode1; |
| | | maxboxcode3 = boxCode2; |
| | | if (string.IsNullOrWhiteSpace(maxCodestr2)) |
| | | { |
| | | maxCodestr2 = toDayTime2.Substring(2, 6) + "0001"; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | var maxCode = Db.Queryable<BllLabelBoxNo>().Max(a => a.LotNo); // 获取今天最大批次号 |
| | | if (string.IsNullOrWhiteSpace(maxCode)) |
| | | { |
| | | maxCodestr2 = toDayTime2.Substring(2, 6) + "0001"; |
| | | } |
| | | else |
| | | { |
| | | var lotStr = maxCode.Substring(0, 6); |
| | | var timeStr = toDayTime2.Substring(2, 6); |
| | | if (lotStr == timeStr) |
| | | { |
| | | maxCodestr2 = timeStr + (int.Parse(maxCode.Substring(6, 4)) + 1).ToString().PadLeft(4, '0'); |
| | | } |
| | | else |
| | | { |
| | | maxCodestr2 = timeStr + "0001"; |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | var modelList = new List<LabelBoxDto>(); |
| | | |
| | | for (int i = 1; i <= labelNum2; i++)//箱码标签 |
| | | { |
| | | // 物料条码信息赋值 |
| | | LabelBoxDto model = new LabelBoxDto(); |
| | | model.AsnDetailNo = imId; |
| | | model.SkuNo = asnList.SkuNo; |
| | | model.SkuName = asnList.SkuName; |
| | | |
| | | model.Standard = asnList.Standard; // 规格 |
| | | model.PackageStandard = packStandard; |
| | | |
| | | model.SupplierLot = supplierLot; // 厂家批号 |
| | | model.LotNo = maxCodestr2; //批次 |
| | | |
| | | model.ProductionTime = DateTime.Parse(productionTime); // 生产日期 |
| | | model.StoreTime = DateTime.Parse(storeTime); // 储存期至 |
| | | model.ExpirationTime = DateTime.Parse(expirationTime); // 有效期至/贮存期 |
| | | if (i == labelNum2) |
| | | { |
| | | // 最后一个条码 |
| | | var s = bNum * (i - 1); |
| | | if (bNum > qty2 - s) |
| | | { |
| | | model.Qty = qty2 - s;// 数量 |
| | | } |
| | | else |
| | | { |
| | | model.Qty = bNum;// 数量 |
| | | } |
| | | } |
| | | else |
| | | { |
| | | model.Qty = bNum; // 数量 |
| | | } |
| | | |
| | | if (maxboxcode2 == "") |
| | | { |
| | | maxboxcode2 = model.LotNo +"000001"; |
| | | model.BoxNo = maxboxcode2; // 箱号 批号+第几箱 |
| | | maxboxcode2 = model.BoxNo; |
| | | } |
| | | else |
| | | { |
| | | model.BoxNo = maxboxcode2.Substring(0, 10) + (int.Parse(maxboxcode2.Substring(10, 6)) + 1).ToString().PadLeft(6, '0'); |
| | | maxboxcode2 = model.BoxNo; |
| | | } |
| | | model.ImgStr = BarcodeHelper.GetCodeBarBase64(model.BoxNo, 80, 50); |
| | | |
| | | // 添加到list集合 |
| | | modelList.Add(model); |
| | | |
| | | if (i == labelNum2) |
| | | { |
| | | var isGo2 = false; |
| | | var sl = 0; |
| | | for (int j = 1; j <= labelNumZ2; j++) |
| | | { |
| | | if (isGo2) |
| | | { |
| | | break; |
| | | } |
| | | var d = zNum; |
| | | if (i == labelNum2) |
| | | { |
| | | var s = bNum * (i - 1); |
| | | var s2 = zNum * (j - 1); |
| | | if (zNum >= qty2 - s - s2) |
| | | { |
| | | d = (int)(qty2 - s - s2); // 数量 |
| | | isGo2 = true; |
| | | } |
| | | } |
| | | sl++; |
| | | } |
| | | labelNumZ2 = sl; |
| | | } |
| | | |
| | | for (int j = 1; j <= labelNumZ2; j++)//最小单位标签 |
| | | { |
| | | if (isGo) |
| | | { |
| | | break; |
| | | } |
| | | var d = zNum; |
| | | if (i == labelNum2) |
| | | { |
| | | var s = bNum * (i - 1); |
| | | var s2 = zNum * (j - 1); |
| | | if (zNum >= qty2 - s - s2) |
| | | { |
| | | d = (int)(qty2 - s - s2); // 数量 |
| | | isGo = true; |
| | | } |
| | | } |
| | | //// 物料条码信息赋值 |
| | | //LabelPrint5Model model2 = new LabelPrint5Model(); |
| | | //model2.ImportId = imId; |
| | | //model2.OuterBillCode = list.OuterBillCode; |
| | | //model2.ImportBillCode = list.ImportBillCode; |
| | | //model2.SkuNo = list.GoodsCode; |
| | | //model2.SkuName = list.GoodsName; |
| | | //model2.QtyCount = (int)labelNumZ2; // 总件数(int)labelNumZ2 |
| | | |
| | | //model2.SupplierName = supplierName; // 生产厂家 |
| | | //model2.ProductionDate = productionDate; // 生产日期 |
| | | //model2.SapSkuNo = sapNo; // SAP代码 |
| | | //model2.Standard = good.GoodsStandard; // 规格 |
| | | //model2.SupplierLot = supplierLot; // 厂家批号 |
| | | |
| | | //model2.LotNo = maxCodestr2; //批次 |
| | | |
| | | |
| | | //model2.InspectTime = inspectTime; // 复验期至 |
| | | //model2.ExpirationTime = expirationTime; // 有效期至/贮存期 |
| | | //model2.ExpirationType = good.GoodsTemp; // 贮存条件 |
| | | //model2.Qty = d; // 数量 |
| | | |
| | | //model2.QtyOrd = j; // 第几件 |
| | | //if (maxboxcode3 == "") |
| | | //{ |
| | | // var str = mesGood.PadRight(16, ' ') + model.LotNo.PadRight(12, ' ') + "0001"; |
| | | // model2.BoxCode = str; // 支号 批号+第几箱 |
| | | // maxboxcode3 = model2.BoxCode; |
| | | //} |
| | | //else |
| | | //{ |
| | | // model2.BoxCode = maxboxcode3.Substring(0, 28) + (int.Parse(maxboxcode3.Substring(28, 4)) + 1).ToString().PadLeft(4, '0'); |
| | | // maxboxcode3 = model2.BoxCode; |
| | | //} |
| | | |
| | | //model2.imageStr = Utility.Extra.BarcodeHelper.GetQrCodeBase64(model2.BoxCode, 85, 85); |
| | | //// 添加到list集合 |
| | | |
| | | //if (printModel.Count(m => m.BoxCode.Length > 17) <= 100)//排除待箱码判断支码是否小于100 |
| | | //{ |
| | | // printModel.Add(model2); |
| | | //} |
| | | //var guid = Guid.NewGuid().ToString("N"); |
| | | //// 将条码保存到原料条码表 |
| | | //var LabelModel2 = new LabelPrint |
| | | //{ |
| | | // LabelID = guid, |
| | | // LabelStream = model.BoxCode, |
| | | // BoxCode1 = model2.BoxCode, |
| | | // GoodsCode = model2.SkuNo, |
| | | // GoodsName = model2.SkuName, |
| | | // GoodsStandard = model2.Standard, |
| | | // ImportLotNo = model2.LotNo, |
| | | // SupplierName = model2.SupplierName, |
| | | // ImportId = model2.ImportId, |
| | | // OuterBillCode = model2.OuterBillCode, |
| | | // ImportBillCode = model2.ImportBillCode, |
| | | // ProductionDate = model2.ProductionDate, |
| | | // SapSkuNo = model2.SapSkuNo, |
| | | // Qty = model2.Qty, |
| | | // SupplierLot = model2.SupplierLot, |
| | | // InspectTime = model2.InspectTime, |
| | | // ExpirationTime = model2.ExpirationTime, |
| | | // QtyCount = model2.QtyCount, |
| | | // QtyOrd = model2.QtyOrd, |
| | | // ExpirationType = model2.ExpirationType, |
| | | // BoxNum = bNum,//model.Qty, |
| | | |
| | | // BulkTank = model.Qty == bNum ? 0 : 1,//零头箱 |
| | | // BulkCase = 0,//零头盒 |
| | | |
| | | // CreateUser = createUser, |
| | | // CreateTime = DateTime.Now, |
| | | // IsUse = 0 |
| | | //}; |
| | | |
| | | //DataContext.LabelPrint.InsertOnSubmit(LabelModel2); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | #endregion |
| | | } |
| | | |
| | | //return printModel; |
| | | |
| | | |
| | | throw new NotImplementedException(); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | throw new Exception(e.Message); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | public List<BoxInfoDto> GetBoxInfos(BoxInfoVm model) |
| | | { |
| | | try |
| | | { |
| | | { |
| | | string sqlString = string.Empty; |
| | | if (model.IsHuiKu == 0) |
| | | { |
| | |
| | | #region 是否回流入库 |
| | | int iscount = 0; |
| | | //库存明细信息 |
| | | var stockDetail = Db.Queryable<DataStockDetail>().Where(a => a.IsDel == "0" && a.PalletNo == model.PalletNo).ToList(); |
| | | var stockDetail = Db.Queryable<DataStockDetail>().Where(a => a.IsDel == "0" && a.PalletNo == model.PalletNo).ToList(); |
| | | //验证库存是否拥有该托信息 |
| | | if (stockDetail != null && stockDetail.Count > 0) |
| | | { |
| | |
| | | strMsg = "-1:箱码信息不存在,请核查!"; |
| | | return strMsg; |
| | | } |
| | | else |
| | | else |
| | | { |
| | | // 改变箱支关系表状态:已入库 |
| | | sqlString = $"Update BllBoxInfo set Status = '2' where PalletNo = '{model.PalletNo}' and ASNNo = '{model.ASNNo}' and Status = '1'"; |
| | |
| | | pallQty = boxinfo2.Sum(w => w.Qty); |
| | | //入库单明细完成数量增加 |
| | | noticeItem.CompleteQty += pallQty; |
| | | } |
| | | } |
| | | //判断入库数量增加后是否大于等于单据数量 |
| | | if (noticeItem.CompleteQty >= noticeItem.Qty) |
| | | { |
| | |
| | | sqlString = "select sum(qty) from BllBoxInfo where isdel = 0 and "; |
| | | sqlString += $"BindNo = '{palletbindInfo.Id}'"; |
| | | int inspectQty = Db.Ado.GetInt(sqlString); |
| | | |
| | | |
| | | // 添加库存明细表 |
| | | detailModel = new DataStockDetail() |
| | | { |
| | |
| | | try |
| | | { |
| | | //入库中 |
| | | var aSNNoList= Db.Ado.SqlQuery<string>($"SELECT DISTINCT ASNNo from BllPalletBind where IsDel=0 and Status=0 and PalletNo='{palletNo}' ").ToList(); |
| | | var aSNNoList = Db.Ado.SqlQuery<string>($"SELECT DISTINCT ASNNo from BllPalletBind where IsDel=0 and Status=0 and PalletNo='{palletNo}' ").ToList(); |
| | | if (aSNNoList.Count <= 0) |
| | | { |
| | | //库外托盘或平库托盘 |
| | |
| | | //拼托入库 |
| | | public void CompleteInStockLing(PdaLingAsnVm model, int userId) |
| | | { |
| | | try |
| | | try |
| | | { |
| | | if (string.IsNullOrWhiteSpace(model.AsnNo)) |
| | | { |
| | |
| | | foreach (var item in boxinfo) |
| | | { |
| | | if (!string.IsNullOrEmpty(item.PalletNo)) |
| | | { |
| | | { |
| | | throw new Exception("-1:该箱码已绑定其他托盘,请先解绑托盘!"); |
| | | } |
| | | bNum += item.Qty; |
| | | bNum += item.Qty; |
| | | } |
| | | if (bNum == boxinfo[0].FullQty) |
| | | { |
| | |
| | | //修改入库单总单信息 |
| | | arrival.Status = "2"; |
| | | arrival.CompleteTime = serverTime; |
| | | arrival.UpdateUser =userId; |
| | | arrival.UpdateUser = userId; |
| | | arrival.UpdateTime = serverTime; |
| | | Db.Updateable(arrival).ExecuteCommand(); |
| | | } |
| | |
| | | |
| | | #region 库存明细表 |
| | | var boxinfoItem = boxinfo.First(); |
| | | var detailModel = Db.Queryable<DataStockDetail>() .First(it => it.PalletNo == model.PalletNo && it.LotNo == arrivalnotice.LotNo |
| | | var detailModel = Db.Queryable<DataStockDetail>().First(it => it.PalletNo == model.PalletNo && it.LotNo == arrivalnotice.LotNo |
| | | && it.SkuNo == arrivalnotice.SkuNo && it.Standard == arrivalnotice.Standard && it.IsDel == "0"); |
| | | var stId = 0; |
| | | if (detailModel == null || detailModel.Id == 0) |
| | |
| | | { |
| | | throw new Exception("-1:托盘号不可为空!"); |
| | | } |
| | | if (string.IsNullOrEmpty(model.BoxNo)) |
| | | //判断物料数量是否为0 为0判断箱码信息 不为0继续 |
| | | if (model.SkuQty == 0) |
| | | { |
| | | throw new Exception("-1:箱码信息不可为空!"); |
| | | } |
| | | |
| | | if (model.IsContinue == "1") |
| | | { |
| | | if (string.IsNullOrWhiteSpace(model.TailBoxNo)) |
| | | if (string.IsNullOrEmpty(model.BoxNo)) |
| | | { |
| | | throw new Exception("-1:开启连续组托时,尾箱码信息不可为空!"); |
| | | throw new Exception("-1:箱码信息不可为空!"); |
| | | } |
| | | |
| | | if (model.IsContinue == "1") |
| | | { |
| | | if (string.IsNullOrWhiteSpace(model.TailBoxNo)) |
| | | { |
| | | throw new Exception("-1:开启连续组托时,尾箱码信息不可为空!"); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | // 验证入库单总表 |
| | | var notice = Db.Queryable<BllArrivalNotice>().First(m => m.IsDel == "0" && m.ASNNo == model.AsnNo); |
| | |
| | | //入库单类型,0:成品入库 1:采购入库 2:中间品入库 3:退货入库 4:车间余料退回入库 5:其它入库 6:代储入库 |
| | | if (notice.Type == "0" || notice.Type == "3" || notice.Type == "5" || notice.Type == "6") |
| | | { |
| | | BindPalletForBox(model,userId,origin); |
| | | BindPalletForBox(model, userId, origin); |
| | | } |
| | | else |
| | | { |
| | | BindPalletForLabelBox(model,userId); |
| | | BindPalletForLabelBox(model, userId); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | |
| | | |
| | | // 更改入库单明细已组数量 |
| | | var sqlString = string.Empty; |
| | | sqlString += $"update BllArrivalNoticeDetail set FactQty = FactQty + '{factQty}' where id = '{model.AsnDetailId}';"; |
| | | sqlString += $"update BllArrivalNoticeDetail set FactQty = FactQty + '{bind.Qty}' where id = '{model.AsnDetailId}';"; |
| | | Db.Ado.ExecuteCommand(sqlString); |
| | | |
| | | // 更改入库单及入库明细状态 |
| | |
| | | PalletNo = model.PalletNo, |
| | | PalletNo2 = "", |
| | | PalletNo3 = "", |
| | | Qty = 0, |
| | | Qty = model.SkuQty, |
| | | FullQty = pNum, |
| | | Status = "0", |
| | | Type = "0", |
| | |
| | | } |
| | | |
| | | #region 箱码信息 |
| | | |
| | | var boxInfoList = new List<BllLabelBoxNo>(); |
| | | var msgStr = $"箱号为{model.BoxNo}"; |
| | | var boxInfoList = new List<BllLabelBoxNo>(); |
| | | //首箱 |
| | |
| | | var sql = $"select * from BllLabelBoxNo where IsDel = '0' and boxNo>'{model.BoxNo}' and boxNo<'{model.TailBoxNo}' and Level='1'; "; |
| | | var list = Db.Ado.SqlQuery<BllLabelBoxNo>(sql); |
| | | boxInfoList.AddRange(list); |
| | | decimal factQty = 0.00m;//托盘总数量 |
| | | if (model.SkuQty == 0) |
| | | { |
| | | //首箱 |
| | | var boxInfo = Db.Queryable<BllLabelBoxNo>().Where(m => m.IsDel == "0" && m.BoxNo == model.BoxNo && m.IsUse == "0" && m.Level == "1").ToList(); |
| | | if (boxInfo.Count == 0) |
| | | { |
| | | throw new Exception("-1:箱码信息不存在!"); |
| | | } |
| | | //是否连续组托 |
| | | if (model.IsContinue == "1") |
| | | { |
| | | boxInfoList.AddRange(boxInfo); |
| | | //尾箱 |
| | | var boxInfo2 = Db.Queryable<BllLabelBoxNo>().Where(m => m.IsDel == "0" && m.BoxNo == model.TailBoxNo && m.IsUse == "0" && m.Level == "1").ToList(); |
| | | if (boxInfo2.Count == 0) |
| | | { |
| | | throw new Exception("-1:尾箱码信息不存在!"); |
| | | } |
| | | boxInfoList.AddRange(boxInfo2); |
| | | var sql = $"select * from BllLabelBoxNo where IsDel = '0' and IsUse = '0' and boxNo>'{model.BoxNo}' and boxNo<'{model.TailBoxNo}' and Level='1'; "; |
| | | var list = Db.Ado.SqlQuery<BllLabelBoxNo>(sql); |
| | | boxInfoList.AddRange(list); |
| | | |
| | | //找到相关的二级码 |
| | | foreach (var item in boxInfoList) |
| | |
| | | |
| | | // 更改入库单明细已组数量 |
| | | var sqlString = string.Empty; |
| | | sqlString += $"update BllArrivalNoticeDetail set FactQty = FactQty + '{factQty}' where id = '{model.AsnDetailId}';"; |
| | | sqlString += $"update BllArrivalNoticeDetail set FactQty = FactQty + '{bind.Qty}' where id = '{model.AsnDetailId}';"; |
| | | Db.Ado.ExecuteCommand(sqlString); |
| | | |
| | | // 更改入库单及入库明细状态 |
| | |
| | | public string SkuName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// Desc:物料规格 |
| | | /// Default: |
| | | /// Nullable:True |
| | | /// </summary> |
| | | public string Standard { get; set; } |
| | | |
| | | /// <summary> |
| | | /// Desc:包装规格 |
| | | /// Default: |
| | | /// Nullable:True |
| | | /// </summary> |
| | | public string PackageStandard { get; set; } |
| | | |
| | | /// <summary> |
| | | /// Desc:储存期至 |
| | | /// Default: |
| | | /// Nullable:True |
| | | /// </summary> |
| | | public DateTime? StoreTime { get; set; } |
| | | |
| | | /// <summary> |
| | | /// Desc:批次号 |
| | | /// Default: |
| | | /// Nullable:True |
| | |
| | | /// <param name="count">数量</param> |
| | | /// <returns>标签箱码信息</returns> |
| | | List<LabelBoxDto> GetLabelBoxList(LabelBoxVm model, out int count); |
| | | |
| | | /// <summary> |
| | | /// 获取标签模板根据入库单明细ID |
| | | /// </summary> |
| | | /// <param name="id">入库单明细ID</param> |
| | | /// <returns>标签信息模板</returns> |
| | | LabelBoxDto GetLabelBoxModel(int id); |
| | | |
| | | ///// <summary> |
| | | ///// 获取物料标签信息JC06 |
| | | ///// </summary> |
| | | ///// <param name="imId"></param> |
| | | ///// <param name="isPrint">是否重新生成自有批次 0:否 1:是 </param> |
| | | ///// <param name="createUser">创建人</param> |
| | | ///// <param name="number">箱内数量(一级标签必填)</param> |
| | | ///// <param name="productionDate">生产日期</param> |
| | | ///// <param name="supplierName">生产厂家</param> |
| | | ///// <param name="supplierLot">生产厂家批号</param> |
| | | ///// <param name="inspectTime">有效期</param> |
| | | ///// <param name="expirationTime">保质期</param> |
| | | ///// <param name="bQNum">外箱标签数量</param> |
| | | ///// <param name="skuNum">到货数量</param> |
| | | ///// <returns></returns> |
| | | |
| | | /// <summary> |
| | | /// 获取标签信息(生成标签) |
| | | /// </summary> |
| | | /// <param name="imId">入库单明细ID</param> |
| | | /// <param name="isReset">是否重新生成自有批次 0:否 1:是</param> |
| | | /// <param name="arriveQty">到货数量</param> |
| | | /// <param name="skuName">物料名称</param> |
| | | /// <param name="standard">规格/型号</param> |
| | | /// <param name="packStandard">包装规格</param> |
| | | /// <param name="skuNo">物料编码</param> |
| | | /// <param name="supplierLot">供应商批次</param> |
| | | /// <param name="productionTime">生产日期</param> |
| | | /// <param name="expirationTime">有效期至</param> |
| | | /// <param name="storeTime">储存期至</param> |
| | | /// <param name="userId">操作人</param> |
| | | /// <returns></returns> |
| | | List<LabelBoxDto> AddLabelBoxReturn(int imId, string isReset, decimal arriveQty, string skuName,string standard,string packStandard,string skuNo, string supplierLot, string productionTime, string expirationTime, string storeTime,int userId); |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | [HttpGet] |
| | | public IActionResult GetLabelBoxModel(int id) |
| | | { |
| | | try |
| | | { |
| | | var list = _labelBox.GetLabelBoxModel(id); |
| | | return Ok(new { code = 0, msg = "箱码模板信息", data = list }); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return Ok(new { code = 1, msg = e.Message }); |
| | | } |
| | | } |
| | | |
| | | |
| | | #endregion |
| | | } |
| | | |