Pu Zhibing
6 天以前 01fb3942136929b10d1fd704330f9d400b38bfb0
ManagementQYTTravel/guns-admin/src/main/webapp/static/modular/system/tCompany/tCompany_info.js
@@ -16,6 +16,10 @@
            validators: {
                notEmpty: {
                    message: '登录账号不能为空'
                },
                regexp: {
                    regexp: /^1[3-9]\d{9}$/,
                    message: '登录账号格式不正确'
                }
            }
        },
@@ -49,6 +53,17 @@
                regexp: {
                    regexp: /^([1-9][0-9]*)$/,
                    message: '分账账期格式不正确'
                }
            }
        },
        identifier: {
            validators: {
                notEmpty: {
                    message: '统一社会信用代码不能为空'
                },
                regexp: {
                    regexp: /^[0-9A-HJ-NPQRTUWXY]{2}\d{6}[0-9A-HJ-NPQRTUWXY]{10}$/i,
                    message: '统一社会信用代码格式不正确'
                }
            }
        }
@@ -304,7 +319,8 @@
        //     }
        // }
    }
    var checkbox8 = $('#checkbox8').prop('checked');
    var checkbox9 = $('#checkbox9').prop('checked');
    var subArr=[];
    $(".timeClass").each(function () {
        subArr.push({
@@ -325,9 +341,13 @@
            Feng.error("登录账户已存在,请重新输入");
            return;
        }
        Feng.success("添加成功!");
        window.parent.TCompany.table.refresh();
        TCompanyInfoDlg.close();
        if(200 == data.code){
            Feng.success("添加成功!");
            window.parent.TCompany.table.refresh();
            TCompanyInfoDlg.close();
        }else{
            Feng.error("添加失败!" + data.message + "!");
        }
    },function(data){
        Feng.error("添加失败!" + data.responseJSON.message + "!");
    });
@@ -401,6 +421,16 @@
        ajax.set("isOnCall",1);
    }else{
        ajax.set("isOnCall",2);
    }
    if (checkbox8){
        ajax.set("isHitchRide",1);
    }else{
        ajax.set("isHitchRide",2);
    }
    if (checkbox9){
        ajax.set("isSubstituteDriving",1);
    }else{
        ajax.set("isSubstituteDriving",2);
    }
    ajax.set("isNeedFerry",isNeedFerry);
@@ -545,7 +575,8 @@
        //     }
        // }
    }
    var checkbox8 = $('#checkbox8').prop('checked');
    var checkbox9 = $('#checkbox9').prop('checked');
    var subArr=[];
    $(".timeClass").each(function () {
        subArr.push({
@@ -643,6 +674,16 @@
    }else{
        ajax.set("isOnCall",2);
    }
    if (checkbox8){
        ajax.set("isHitchRide",1);
    }else{
        ajax.set("isHitchRide",2);
    }
    if (checkbox9){
        ajax.set("isSubstituteDriving",1);
    }else{
        ajax.set("isSubstituteDriving",2);
    }
    ajax.set("isNeedFerry",isNeedFerry);
    ajax.set("subArr",JSON.stringify(subArr));
@@ -726,6 +767,24 @@
        $("#dcxDiv").hide();
    }
}
//顺风车
TCompanyInfoDlg.checkbox8 = function () {
    var checkbox8 = $('#checkbox8').prop('checked');
    if (checkbox8){
        $("#sfDiv").show();
    } else {
        $("#sfDiv").hide();
    }
}
//代驾
TCompanyInfoDlg.checkbox9 = function () {
    var checkbox9 = $('#checkbox9').prop('checked');
    if (checkbox9){
        $("#djDiv").show();
    } else {
        $("#djDiv").hide();
    }
}
//省改变
TCompanyInfoDlg.provinceChange = function (e) {
    var provinceCode=$(e).val();
@@ -804,16 +863,24 @@
};
function deleteSub(e) {
    var ajax = new $ax(Feng.ctxPath + '/tCompany/searchArea', function (data) {
        if (data === "该区域正被打车卡使用,不允许移除"){
            Feng.error(data);
            return false;
        }else {
            $(e).parent().parent().remove();
        }
    swal({
        title: "您是否确认删除该区域?",
        type: "warning",
        showCancelButton: true,
        confirmButtonColor: "#DD6B55",
        confirmButtonText: "删除",
        closeOnConfirm: false
    }, function () {
        var ajax = new $ax(Feng.ctxPath + '/tCompany/searchArea', function (data) {
            if (data === "该区域正被打车卡使用,不允许移除") {
                Feng.error(data);
                return false;
            } else {
                $(e).parent().parent().remove();
            }
        });
        ajax.set("companyId", $("#id").val());   ///   适用地区id
        ajax.set("id", $($(e).parent('td').prev('td').find('input')[0]).val());   ///   适用地区id
        ajax.start();
    });
    ajax.set("companyId",$("#id").val());   ///   适用地区id
    ajax.set("id",$($(e).parent('td').prev('td').find('input')[0]).val());   ///   适用地区id
    ajax.start();
}