yuyou_x
2024-02-04 3ad0ef8e8bdfd94d63d06aedbbc0fe02c1ae476b
HTML/views/ASNSetting/LabelPrint.html
@@ -117,58 +117,47 @@
            
            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');
            var storeTime = getQueryString('StoreTime');
            
            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 () { });
                    }
                });
            });
            //打印
            $('#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) {
@@ -196,20 +185,13 @@
                        }, 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,
@@ -324,9 +306,8 @@
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        }, function () { });
                    }
                });
            };
                });
            }
            // 获取传递参数
            function getQueryString(name) {
                var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");