{"size": 2185, "ext": "js", "max_stars_repo_path": "src/main/webapp/static/modular/meetingapply/meetingapply/meetingapply_info.js", "max_stars_repo_name": "ysuMgl/guns-modified", "max_stars_repo_stars_event_min_datetime": "2020-08-18T16:27:54.000Z", "max_stars_repo_stars_event_max_datetime": "2020-08-24T12:00:35.000Z", "max_issues_repo_path": "src/main/webapp/static/modular/meetingapply/meetingapply/meetingapply_info.js", "max_issues_repo_name": "ysuMgl/guns-modified", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/main/webapp/static/modular/meetingapply/meetingapply/meetingapply_info.js", "max_forks_repo_name": "ysuMgl/guns-modified", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 2, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 19.6846846847, "max_line_length": 92, "alphanum_fraction": 0.5743707094}
/**
 * 初始化预约会议申请审批详情对话框
 */
var MeetingapplyInfoDlg = {
    meetingapplyInfoData : {}
};

/**
 * 清除数据
 */
MeetingapplyInfoDlg.clearData = function() {
    this.meetingapplyInfoData = {};
}

/**
 * 设置对话框中的数据
 *
 * @param key 数据的名称
 * @param val 数据的具体值
 */
MeetingapplyInfoDlg.set = function(key, val) {
    this.meetingapplyInfoData[key] = (typeof val == "undefined") ? $("#" + key).val() : val;
    return this;
}

/**
 * 设置对话框中的数据
 *
 * @param key 数据的名称
 * @param val 数据的具体值
 */
MeetingapplyInfoDlg.get = function(key) {
    return $("#" + key).val();
}

/**
 * 关闭此对话框
 */
MeetingapplyInfoDlg.close = function() {
    parent.layer.close(window.parent.Meetingapply.layerIndex);
}

/**
 * 收集数据
 */
MeetingapplyInfoDlg.collectData = function() {
    this
    .set('id')
    .set('workerid')
    .set('topic')
    .set('documentlink')
    .set('homeid')
    .set('attendance')
    .set('begintime')
    .set('endtime')
    .set('statusid');
    // .set('applytime');
}

/**
 * 提交添加
 */
MeetingapplyInfoDlg.addSubmit = function() {

    this.clearData();
    this.collectData();

    //提交信息
    var ajax = new $ax(Feng.ctxPath + "/meetingapply/add", function(data){
        if (data.code === 200) {
            Feng.success("添加成功!");
            window.parent.Meetingapply.table.refresh();
            MeetingapplyInfoDlg.close();
        }else {
            Feng.error(data.message)
        }
    },function(data){
        Feng.error("添加失败!" + data.responseJSON.message + "!");
    });
    ajax.set(this.meetingapplyInfoData);
    ajax.start();
}

/**
 * 提交修改
 */
MeetingapplyInfoDlg.editSubmit = function() {

    this.clearData();
    // this.collectData();
    this.set("id").set("statusid");
    //提交信息
    var ajax = new $ax(Feng.ctxPath + "/meetingapply/update", function(data){
        if (data.code === 200) {
            Feng.success("修改成功!");
            window.parent.Meetingapply.table.refresh();
            MeetingapplyInfoDlg.close();
        }else {
            Feng.error(data.message)
        }
    },function(data){
        Feng.error("修改失败!" + data.responseJSON.message + "!");
    });
    ajax.set(this.meetingapplyInfoData);
    ajax.start();
}

$(function() {

});
