puzhibing
2024-02-05 640ff18d2d7f4be02ddb7f8f75e899f05545eb98
cloud-server-management/src/main/webapp/static/modular/system/tGoods/tGoods_info.js
@@ -16,9 +16,7 @@
 * 验证数据是否为空
 */
TGoodsInfoDlg.validate = function () {
    $('#carInfoForm').data("bootstrapValidator").resetForm();
    $('#carInfoForm').bootstrapValidator('validate');
    return $("#carInfoForm").data('bootstrapValidator').isValid();
};
/**
@@ -249,10 +247,6 @@
    this.clearData();
    this.collectData();
    if(!this.validate()){
        return ;
    }
    const quantityIssuedInput = document.getElementById('quantityIssued');
    const pickUpQuantityInput = document.getElementById('pickUpQuantity');
@@ -260,20 +254,11 @@
    const pickUpQuantity2 = Number(pickUpQuantityInput.value);
    if (isNaN(quantityIssued2) || isNaN(pickUpQuantity2)) {
        Feng.error("优惠卷数量必须为数字")
        console.log('Both quantityIssued and pickUpQuantity must be numbers.');
    } else if (quantityIssued2 >= pickUpQuantity2) {
        console.log('quantityIssued is greater than pickUpQuantity.');
    } else {
        Feng.error("发放数量必须大于等于限领数量")
        return
        console.log('quantityIssued is not greater than pickUpQuantity.');
    }
    let typeAll = document.querySelector('input[name="type"]:checked').value;
    if(typeAll==2){
        let pCode = $("#pCode").val()
@@ -399,7 +384,14 @@
                console.log("请选择相同运营商门店")
                Feng.info("请选择相同运营商门店");
            }else if(data.code == 200){
            }else if (data==5009){
                Feng.error("有效期开始时间不应小于假期课开始时间");
                return;
            }else if (data==5008){
                Feng.error("有效期结束时间不应大于假期课结束时间");
                return;
            }
            else if(data.code == 200){
                if(language==1){
                    Feng.success("添加成功!");
                }else if(language==2){
@@ -575,14 +567,22 @@
        //提交信息
        var ajax = new $ax(Feng.ctxPath + "/tGoods/add", function(data){
            console.log("看看返回参数")
            console.log(data)
            if(data=="5001"){
                Feng.error("改账号已经存在");
                Feng.error("该账号已经存在");
                return;
            }else if(data=="5003"){
                console.log("请选择相同运营商门店")
                Feng.info("请选择相同运营商门店");
            }else
            if(data.code == 200){
                Feng.error("请选择相同运营商门店");
                return;
            }else if (data==5009){
                Feng.error("有效期开始时间不应小于假期课开始时间");
                return;
            }else if (data==5008){
                Feng.error("有效期结束时间不应大于假期课结束时间");
                return;
            } else if(data.code == 200){
                if(language==1){
                    Feng.success("添加成功!");
                }else if(language==2){
@@ -593,7 +593,9 @@
                window.parent.TPointProducts.table.refresh();
                TGoodsInfoDlg.close();
            }else{
                console.log("走这里")
                Feng.error(data.msg);
                return;
            }
        },function(data){
@@ -624,12 +626,9 @@
}
TGoodsInfoDlg.addSubmit1 = function() {
    let company = document.querySelector('input[name="company"]:checked').value;
    let company = 3;
    this.clearData();
    this.collectData();
    if(!this.validate()){
        return ;
    }
    var cityIds = [];
    var cts = "";
    if (company === '2'){
@@ -654,13 +653,9 @@
        }else {
            // 如果只有一个城市,则将cts设置为字符串
            if (cityIds.length === 1) {
                console.log("是1吗?")
                cts = cityIds[0];
                console.log(cts)
            } else {
                console.log("走下面了")
                cts = cityIds.join(',');
                console.log(cts)
            }
        }
    }
@@ -770,7 +765,7 @@
    var stores = "";
    if (company === '3'){
    if (company === 3 && $("#userType").val()!="3"){
        console.log('3---this.storeIds',this.storeIds);
        if (TGoodsInfoDlg.storeIds.length === 0 ){
            return Feng.error('请至少选择一个门店');
@@ -871,12 +866,14 @@
    if (isNaN(quantityIssued1) || isNaN(pickUpQuantity1)) {
        Feng.error("优惠卷数量必须为数字")
        console.log('Both quantityIssued and pickUpQuantity must be numbers.');
        return
    } else if (quantityIssued1 >= pickUpQuantity1) {
        console.log('quantityIssued is greater than pickUpQuantity.');
    } else {
        Feng.error("发放数量必须大于限领数量")
        return
        console.log('quantityIssued is not greater than pickUpQuantity.');
    }
    var imgOne ="";
@@ -947,7 +944,6 @@
    TGoodsInfoDlg.editor = UE.getEditor('editor');
    TGoodsInfoDlg.editor1 = UE.getEditor('editor1');
    getProvince(null);
    Feng.initValidator("carInfoForm", TGoodsInfoDlg.validateFields);
    var drivingLicensePhoto = new $WebUpload("drivingLicensePhoto");
    drivingLicensePhoto.setUploadBarId("progressBar");
    drivingLicensePhoto.init();
@@ -1026,6 +1022,8 @@
    ajax.set("limit",100);
    ajax.start();
}
TGoodsInfoDlg.timeChange = function (e) {
    var oneId=$(e).val();
    var ajax = new $ax(Feng.ctxPath + "/tCity/timeChange", function(data){
@@ -1038,7 +1036,7 @@
                var content='<option value="">Pilih franchisee Anda</option>';
            }
            $.each(data, function(k,v) {
                content += "<option value='"+v+"'>"+v+"</option>";
                content += "<option value='"+v.id+"'>"+v.value+"</option>";
            });
            $("#coursePackageConfigId").empty().append(content);
        }