shr.defineClass("shr.perfweb.evalucardListEx", shr.perfweb.evalucardList, {
    initalizeDOM: function () {
        shr.perfweb.evalucardListEx.superClass.initalizeDOM.call(this);
        var _self = this;
        var colModel = $(this.gridId).jqGrid("getGridParam", "colModel")
        $.each(colModel, function (index, item) {
            if ("interviewed" == item.name) {
                item.formatter = function (cellvalue, options, rowObject) {
                    if ("true" == cellvalue) {
                        // 返回一个包含自定义 data 属性的超链接
                        return "<a href='javascript:void(0)' class='click-interviewed' onclick=showInterviewDialog('" + options.rowId + "','view') '>已维护</a>";
                    } else {
                        return "未维护"
                    }
                }
            }
        });
    },
    /**
     * 维护面谈记录
     */
    interviewRecordAction: function () {
        var self = this;
        var selectedIdsLength = $('#grid').jqGrid('getSelectedRows').length;
        if (selectedIdsLength <= 0) {
            shr.showWarning({
                message: "请先选中数据!",
                hideAfter: 5
            });
            return;
        } else if (selectedIdsLength > 1) {
            shr.showWarning({
                message: "只能选中单行数据!",
                hideAfter: 5
            });
            return;
        }
        //获取选中行id
        var id = this.getSelectedIds();
        //渲染弹窗框
        showInterviewDialog(id);
    },

});
/**
 * 展示维护面谈记录弹窗框
 * @param {} id 
 * @param {*} method 页面操作状态
 */
function showInterviewDialog(id, method) {
    if ($("#interviewDialogDiv").length <= 0) {
        var html = '<div id="interviewDialogDiv" class="dialog">' +
            '<iframe id="interviewDialog" height="1000" width="800" frameborder="0"  src="" />' +
            '</div>';
        //scrolling="no"
        $(document.body).append(html);
    }
    var url = shr.getContextPath() + "/dynamic.do?uipk=com.kingdee.eas.custom.perfwebinterview.app.InterviewRecord.form";
    if (!method) {
        url += "&method=edit"
    } else {
        url += "&method=" + method
    }
    url += '&evaResultId=' + encodeURIComponent(id);
    var selectDialog = $("#interviewDialogDiv");
    selectDialog.children("iframe").attr('src', url);
    selectDialog.children("iframe").css({ "height": "100%", "width": "100%" });
    selectDialog.children("iframe").css('display', 'block');
    selectDialog.dialog({
        autoOpen: true,
        title: '面谈记录',
        width: 1040,
        minWidth: 800,
        height: 600,
        minHeight: 600,
        show: "blind",
        modal: true,
        resizable: false,
        position: ['center', 'center'],
        open: function () { },
        close: function () {
            self.reloadGrid();
        },
        buttons: {
            "关闭": function () {
                $(this).dialog("close");
            }
        }
    })
}