xuhy
2025-01-09 475993b4a8221e3dd434460569d1c878cdb61495
ManagementOKTravel/guns-admin/src/main/webapp/static/modular/system/tCompany/franchisee_info.js
@@ -147,6 +147,9 @@
        .set('scopeCode')
        .set('idCardPositive')
        .set('idCardReverse')
        .set('fixedDeduction')
        .set('percentageDeduction')
        .set('driverRestriction')
        .set('serviceScope');
}
@@ -170,6 +173,168 @@
    }
    var checkbox2 = $('#checkbox2').prop('checked');
    let fixedDeduction = $('#fixedDeduction').val();
    regexp(fixedDeduction, "固定费用")
    let percentageDeduction = $('#percentageDeduction').val();
    regexp(percentageDeduction, "线上下单扣除")
    let driverRestriction = $('#driverRestriction').val();
    regexp(driverRestriction, "司机接单限制")
    var b = false;
    var waitFee = '{';
    $('.waitFee input[type="text"]').each(function(){
        var value = $(this).val();
        if('' == value){
            b = true;
            Feng.info("请填写完整配置");
            return
        }
        waitFee = waitFee + '"'+$(this)[0].name+'":"'+value+'",';
    });
    waitFee = waitFee.substring(0,waitFee.length-1);
    waitFee += '}';
    console.log(waitFee);
    var p1 = '{';
    $('.p1 input[type="text"]').each(function(){
        var value = $(this).val();
        if('' == value){
            b = true;
            Feng.info("请填写完整配置");
            return
        }
        p1 = p1 + '"'+$(this)[0].name+'":"'+value+'",';
    });
    p1 = p1.substring(0,p1.length-1);
    p1 += '}';
    console.log(p1);
    if(b){
        return
    }
    var p2 = '{';
    $('.p2 input[type="text"]').each(function(){
        var value = $(this).val();
        if('' == value){
            b = true;
            Feng.info("请填写完整配置");
            return
        }
        p2 = p2 + '"'+$(this)[0].name+'":"'+value+'",';
    });
    p2 = p2.substring(0,p2.length-1);
    p2 += '}';
    console.log(p2);
    if(b){
        return
    }
    var p3 = '{';
    $('.p3 input[type="text"]').each(function(){
        var value = $(this).val();
        if('' == value){
            b = true;
            Feng.info("请填写完整配置");
            return
        }
        p3 = p3 + '"'+$(this)[0].name+'":"'+value+'",';
    });
    p3 = p3.substring(0,p3.length-1);
    p3 += '}';
    console.log(p3);
    if(b){
        return
    }
    var wp1 = '{';
    $('.wp1 input[type="text"]').each(function(){
        var value = $(this).val();
        if('' == value){
            b = true;
            Feng.info("请填写完整配置");
            return
        }
        wp1 = wp1 + '"'+$(this)[0].name+'":"'+value+'",';
    });
    wp1 = wp1.substring(0,wp1.length-1);
    wp1 += '}';
    console.log(wp1);
    if(b){
        return
    }
    var wp2 = '{';
    $('.wp2 input[type="text"]').each(function(){
        var value = $(this).val();
        if('' == value){
            b = true;
            Feng.info("请填写完整配置");
            return
        }
        wp2 = wp2 + '"'+$(this)[0].name+'":"'+value+'",';
    });
    wp2 = wp2.substring(0,wp2.length-1);
    wp2 += '}';
    console.log(wp2);
    if(b){
        return
    }
    var wp3 = '{';
    $('.wp3 input[type="text"]').each(function(){
        var value = $(this).val();
        if('' == value){
            b = true;
            Feng.info("请填写完整配置");
            return
        }
        wp3 = wp3 + '"'+$(this)[0].name+'":"'+value+'",';
    });
    wp3 = wp3.substring(0,wp3.length-1);
    wp3 += '}';
    console.log(wp3);
    if(b){
        return
    }
    var contentExclusive = '{';
    //拼接数据
    $(".exclusivePriceSettings input[type='text']").each(function(){
        var value = $(this).val();
        if('' == value){
            b = true;
            Feng.info("请填写完整配置");
            return
        }
        contentExclusive = contentExclusive + '"'+$(this)[0].name+'":"'+value+'",';
    });
    contentExclusive = contentExclusive.substring(0,contentExclusive.length-1);
    contentExclusive += '}';
    console.log(contentExclusive);
    if(b){
        return
    }
    var contentPrice = '{';
    //拼接数据
    $(".onePriceSetting input[type='text']").each(function(){
        var value = $(this).val();
        if('' == value){
            b = true;
            Feng.info("请填写完整配置");
            return
        }
        contentPrice = contentPrice + '"'+$(this)[0].name+'":"'+value+'",';
    });
    contentPrice = contentPrice.substring(0,contentPrice.length-1);
    contentPrice += '}';
    console.log(contentPrice);
    if(b){
        return
    }
    //提交信息
@@ -233,6 +398,170 @@
        }
    }
    let fixedDeduction = $('#fixedDeduction').val();
    regexp(fixedDeduction, "固定费用")
    let percentageDeduction = $('#percentageDeduction').val();
    regexp(percentageDeduction, "线上下单扣除")
    let driverRestriction = $('#driverRestriction').val();
    regexp(driverRestriction, "司机接单限制")
    var b = false;
    var waitFee = '{';
    $('.waitFee input[type="text"]').each(function(){
        var value = $(this).val();
        if('' == value){
            b = true;
            Feng.info("请填写完整配置");
            return
        }
        waitFee = waitFee + '"'+$(this)[0].name+'":"'+value+'",';
    });
    waitFee = waitFee.substring(0,waitFee.length-1);
    waitFee += '}';
    console.log(waitFee);
    var p1 = '{';
    $('.p1 input[type="text"]').each(function(){
        var value = $(this).val();
        if('' == value){
            b = true;
            Feng.info("请填写完整配置");
            return
        }
        p1 = p1 + '"'+$(this)[0].name+'":"'+value+'",';
    });
    p1 = p1.substring(0,p1.length-1);
    p1 += '}';
    console.log(p1);
    if(b){
        return
    }
    var p2 = '{';
    $('.p2 input[type="text"]').each(function(){
        var value = $(this).val();
        if('' == value){
            b = true;
            Feng.info("请填写完整配置");
            return
        }
        p2 = p2 + '"'+$(this)[0].name+'":"'+value+'",';
    });
    p2 = p2.substring(0,p2.length-1);
    p2 += '}';
    console.log(p2);
    if(b){
        return
    }
    var p3 = '{';
    $('.p3 input[type="text"]').each(function(){
        var value = $(this).val();
        if('' == value){
            b = true;
            Feng.info("请填写完整配置");
            return
        }
        p3 = p3 + '"'+$(this)[0].name+'":"'+value+'",';
    });
    p3 = p3.substring(0,p3.length-1);
    p3 += '}';
    console.log(p3);
    if(b){
        return
    }
    var wp1 = '{';
    $('.wp1 input[type="text"]').each(function(){
        var value = $(this).val();
        if('' == value){
            b = true;
            Feng.info("请填写完整配置");
            return
        }
        wp1 = wp1 + '"'+$(this)[0].name+'":"'+value+'",';
    });
    wp1 = wp1.substring(0,wp1.length-1);
    wp1 += '}';
    console.log(wp1);
    if(b){
        return
    }
    var wp2 = '{';
    $('.wp2 input[type="text"]').each(function(){
        var value = $(this).val();
        if('' == value){
            b = true;
            Feng.info("请填写完整配置");
            return
        }
        wp2 = wp2 + '"'+$(this)[0].name+'":"'+value+'",';
    });
    wp2 = wp2.substring(0,wp2.length-1);
    wp2 += '}';
    console.log(wp2);
    if(b){
        return
    }
    var wp3 = '{';
    $('.wp3 input[type="text"]').each(function(){
        var value = $(this).val();
        if('' == value){
            b = true;
            Feng.info("请填写完整配置");
            return
        }
        wp3 = wp3 + '"'+$(this)[0].name+'":"'+value+'",';
    });
    wp3 = wp3.substring(0,wp3.length-1);
    wp3 += '}';
    console.log(wp3);
    if(b){
        return
    }
    var contentExclusive = '{';
    //拼接数据
    $(".exclusivePriceSettings input[type='text']").each(function(){
        var value = $(this).val();
        if('' == value){
            b = true;
            Feng.info("请填写完整配置");
            return
        }
        contentExclusive = contentExclusive + '"'+$(this)[0].name+'":"'+value+'",';
    });
    contentExclusive = contentExclusive.substring(0,contentExclusive.length-1);
    contentExclusive += '}';
    console.log(contentExclusive);
    if(b){
        return
    }
    var contentPrice = '{';
    //拼接数据
    $(".onePriceSetting input[type='text']").each(function(){
        var value = $(this).val();
        if('' == value){
            b = true;
            Feng.info("请填写完整配置");
            return
        }
        contentPrice = contentPrice + '"'+$(this)[0].name+'":"'+value+'",';
    });
    contentPrice = contentPrice.substring(0,contentPrice.length-1);
    contentPrice += '}';
    console.log(contentPrice);
    if(b){
        return
    }
    //提交信息
    var ajax = new $ax(Feng.ctxPath + "/tCompany/updateFranchisee", function(data){
        if ("error" == data){
@@ -268,6 +597,20 @@
    Feng.initValidator("franchiseeInfoForm", FranchiseeInfoDlg.validateFields);
});
function regexp(value, msg){
    var reg=/^(\d+.?)?\d{0,2}$/;//由 1-9开头 的正则表达式 整数 两位小数
    //先判断是否为整数 在判断 是否在 1-总页  整数范围之内
    if(reg.test(value)){
        if(value == 0){
            Feng.error(msg+"请输入大于0的整数或保留两位小数");
            return;
        }
    }else{
        Feng.error(msg+"请输入整数或保留两位小数");
        return;
    }
}
//专车
FranchiseeInfoDlg.checkbox1 = function () {
    var checkbox1 = $('#checkbox1').prop('checked');