| | |
| | | <button id="btnAdd" class="layui-btn layui-btn-sm" lay-event="Add2"><i |
| | | class="layui-icon"></i>生成标签</button> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <!-- <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 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%;"> |
| | |
| | | </tr> |
| | | <tr> |
| | | <td>进厂编号</td> |
| | | <td style="padding: 1px 0px;"></td> |
| | | <td id="Lotno"> </td> |
| | | <td>物料代码</td> |
| | | <td id="SkuNo"> </td> |
| | | </tr> |
| | |
| | | var laydate = layui.laydate; |
| | | |
| | | var id = getQueryString('Id'); |
| | | var reset = getQueryString('Reset'); |
| | | var reset = getQueryString('IsReset'); |
| | | var arriveQty = getQueryString('ArriveQty'); |
| | | |
| | | var productionTime = getQueryString('ProductionTime'); |
| | | var expirationTime = getQueryString('ExpirationTime'); |
| | | var storeTime = getQueryString('StoreTime'); |
| | | |
| | | |
| | | console.log(productionTime); |
| | | console.log(expirationTime); |
| | | console.log(storeTime); |
| | | |
| | | var supplierLot=getQueryString('SupplierLot'); //原厂批号 |
| | | //$("#SupplierLot").html(supplierLot); |
| | | //console.log(supplierLot); |
| | | |
| | | var Lotno=getQueryString('Lotno'); //原厂批号 |
| | | $("#Lotno").html(Lotno); |
| | | var doing = true; |
| | | // console.log(productionTime); |
| | | // console.log(expirationTime); |
| | | // console.log(storeTime); |
| | | |
| | | //生成 |
| | | $('#btnAdd').on('click', function () { |
| | | var param = { |
| | | Id: parseInt(id), |
| | | IsReset:reset, |
| | | ArriveQty:arriveQty, |
| | | ProductionTime:productionTime, |
| | | ExpirationTime:expirationTime, |
| | | StoreTime:storeTime |
| | | }; |
| | | console.log(param); |
| | | synData(IP + "/BllAsn/AddLabelBox", param , 'post', function (res) { |
| | | if (res.code == 0) { //成功 |
| | | layer.msg(res.msg, { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }, function () { |
| | | parent.location.reload(); |
| | | parent.layer.close(layer.index); |
| | | }); |
| | | |
| | | } else { //不成功 |
| | | layer.msg(res.msg, { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }, function () { }); |
| | | } |
| | | }); |
| | | if(doing){ |
| | | doing= false; |
| | | |
| | | |
| | | var param = { |
| | | Id: parseInt(id), |
| | | IsReset:reset, |
| | | ArriveQty:arriveQty, |
| | | ProductionTime:productionTime, |
| | | ExpirationTime:expirationTime, |
| | | StoreTime:storeTime, |
| | | SupplierLot:supplierLot//原厂批号 |
| | | }; |
| | | // console.log(param); |
| | | synData(IP + "/BllAsn/AddLabelBox", param , 'post', function (res) { |
| | | if (res.code == 0) { //成功 |
| | | layer.msg(res.msg, { |
| | | icon: 1, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }, function () { |
| | | parent.location.reload(); |
| | | parent.layer.close(layer.index); |
| | | doing = true; |
| | | }); |
| | | |
| | | } else { //不成功 |
| | | layer.msg(res.msg, { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }, function () { |
| | | doing = true; |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | //打印 |
| | | $('#btnPrint').on('click', function () { |
| | | var param = { |
| | | ImportId: id, |
| | | }; |
| | | if ($("#ProductionDate").val() == "" || $("#ProductionDate").val() == undefined || $("#ProductionDate").val() == null) { |
| | | layer.msg("生产日期不能为空", { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }, function () { return; }); |
| | | } |
| | | if ($("#SupplierName").val() == "" || $("#SupplierName").val() == undefined || $("#SupplierName").val() == null) { |
| | | layer.msg("生产厂家不能为空", { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }, function () { return; }); |
| | | } |
| | | if ($("#SupplierLot").val() == "" || $("#SupplierLot").val() == undefined || $("#SupplierLot").val() == null) { |
| | | console.log($("#SupplierLot").val()) |
| | | layer.msg("厂家批号不能为空", { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }, function () { return; }); |
| | | } |
| | | |
| | | if ($('#number').val() > 0) { |
| | | |
| | | if ($('#bQNum').val() > 0) { |
| | | div($('#number').val(), $('input[name="isprint"]:checked').val(), $('#bQNum').val()); |
| | | } else { |
| | | div($('#number').val(), $('input[name="isprint"]:checked').val(), 0); |
| | | } |
| | | |
| | | } |
| | | else { |
| | | |
| | | if ($('#bQNum').val() >= 0) { |
| | | div(0, $('input[name="isprint"]:checked').val(), $('#bQNum').val()); |
| | | } else { |
| | | div(0, $('input[name="isprint"]:checked').val(), 0); |
| | | } |
| | | |
| | | } |
| | | |
| | | }); |
| | | |
| | | if (!id) { |
| | |
| | | $("#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); |
| | | $("#StoreTime").html(storeTime); |
| | | $("#SupplierLot").html(res.data.SupplierLot); |
| | | |
| | | |
| | | // $("#imgBar").attr("src", res.data[0].imageStr); |
| | | } else { //不成功 |
| | |
| | | }, function () { }); |
| | | } |
| | | }); |
| | | |
| | | // div(-1, 1, 0); |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | // 循环加载标签 |
| | | function div(number, isprint, bqNum) { |
| | | GetImportId(number, isprint, bqNum); |
| | | } |
| | | |
| | | // 标签变量赋值 |
| | | function GetImportId(i, isprint, bqNum) { |
| | | |
| | | // 加载标签 |
| | | function div(i, isprint, bqNum) { |
| | | |
| | | var param1 = { |
| | | isprint: isprint, |
| | | ImportId: id, |
| | |
| | | $("input[name='SupplierName']").val(res.data[0].SupplierName); |
| | | $("input[name='ProductionDate']").val(res.data[0].ProductionDate); |
| | | $("input[name='SapSkuNo']").val(res.data[0].SapSkuNo); |
| | | $("input[name='Qty']").val(res.data[0].Qty); |
| | | $("input[name='Qty']").val(res.data[0].Qty+res.data[0]); |
| | | $("input[name='Standard']").val(res.data[0].Standard); |
| | | $("input[name='SupplierLot']").val(res.data[0].SupplierLot); |
| | | $("input[name='LotNo']").val(res.data[0].LotNo); |
| | |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }, function () { }); |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | }); |
| | | } |
| | | // 获取传递参数 |
| | | function getQueryString(name) { |
| | | var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); |