var examine = {};
var locked = false;

examine.addSubmit = function() {
    var id = $("#id").val();
    var checkState = $("#checkState").val();
    var checkMsg = $("#checkMsg").val();
    if (checkState==null || checkState=='') {
        Feng.info("请选择审核状态!");
        return;
    }
    if (checkMsg==null || checkMsg=='') {
        Feng.info("请填写审核意见!");
        return;
    }
    var da = {"id":id, "checkState":checkState, "checkMsg":checkMsg};
    if(locked)return;
    locked = true;
    var ajax = new $ax(Feng.ctxPath + "/admin/enterpriseChangeRecord/doExamine", function(data){
        if (data.code == 200) {
            window.parent.parent.EpChange.table.refresh();
            parent.layer.closeAll();
        }
        Feng.info(data.msg);
        locked = false;
    },function(data){
        Feng.error("操作失败!" + data.responseJSON.message + "!");
        locked = false;
    });
    ajax.set(da);
    ajax.start();
};

examine.toggleField = function () {
    var checkState = $("#checkState").val();
    var checkMsg = $("#checkMsg").val();
    if(checkState==4){
        if(checkMsg == null || checkMsg == ''){
            $("#checkMsg").val("机构信息变更审核通过。");
        }
    }else{
        $("#checkMsg").val("");
    }
}
