var that = '';
var orgunitId = ''; //行政组织id
var hrorg = '';
var isOrg = '0'; //组织考核-yien
var scoreDefaultPage = "";
var hrOrgUnit;
var msg1="正态分布校验结果";
var msg2="上季度部门绩效等级结果";
shr.defineClass("shr.custom.evaResultManagerListExEx", shr.custom.evaResultManagerListEx, {
    levelScoreLVInfo: {},
    initalizeDOM: function () {
        // 初始化JS环境
        that = this;
        var _self = this;
        shr.custom.evaResultManagerListExEx.superClass.initalizeDOM.call(_self);
        var perobjectId = _self.initData.perobjectId;
        var projectName = _self.initData.projectName;
        if(perobjectId){
            msg1=projectName+"项目绩效正态分布校验结果";
            msg2=projectName+"项目绩效等级结果";
            $("#bindProjectBatch").show();
            $("#bindDepBatch").hide();
            $("#getSpanDepCollaborate").hide();
            $("#getSpanDepCollaborateOne").hide();
            $("#getSpanDepCollaborateTwo").hide();
            // $("[aria-describedby='grid_projectLevel']").css("display","")
            // $("#grid_projectLevel").css("display","")
            // $("[aria-describedby='grid_orgLevel']").css("display","none")
            // $("#grid_orgLevel").css("display","none")
            $("#grid").setGridParam().hideCol("orgLevel");//隐藏
            $("#grid").setGridParam().showCol("projectLevel");//显示
            $("#grid").setGridParam().hideCol("oldSumScore");//隐藏
            $("#grid").setGridParam().hideCol("depCoefficient");//隐藏

        }else{
            msg1="正态分布校验结果";
            msg2="上季度部门绩效等级结果";
            $("#bindProjectBatch").hide();
            $("#bindDepBatch").show();
            $("#getSpanDepCollaborate").show();
            $("#getSpanDepCollaborateOne").show();
            $("#getSpanDepCollaborateTwo").show();
            $("#grid").setGridParam().showCol("orgLevel");//显示
            $("#grid").setGridParam().hideCol("projectLevel");//隐藏
            $("#grid").setGridParam().showCol("oldSumScore");//显示
            $("#grid").setGridParam().showCol("depCoefficient");//显示
            // $("[aria-describedby='grid_projectLevel']").css("display","none")
            // $("#grid_projectLevel").css("display","none")
            // $("[aria-describedby='grid_orgLevel']").css("display","")
            // $("#grid_orgLevel").css("display","")
        }
    },
    // 批量录入修订
    batchReviseAction: function(){
        var grid = $("#grid");
        that.bindBatchReviseGridEvent(grid);
        var ids = this.getSelectedFields();
        that.initData.custom_params.reviseGradeLevelSelect = "true";
        that.initData.custom_params.ids = ids;
        grid.jqGrid("option", "custom_params", JSON.stringify(that.initData.custom_params)).jqGrid("reloadGrid");
        $('.singleradioallselectwrap').hide();
    },

    // 绑定重新刷新页面事件
    bindBatchReviseGridEvent: function(grid){
        $(".shr-toolbar").find("button").hide();
        $("#batchSaveReviseData").show();
        $("#batchSaveReviseDataExit").show();
        if (typeof grid == 'undefined') {
            grid = $(this.gridId);
        }
        grid.setGridParam().hideCol("hrOrgUnit.name");
        grid.setGridParam().hideCol("perfPersonIncharge");
        grid.setGridParam().hideCol("evaObj.workFlowStatus");
        grid.setGridParam().hideCol("evaResultAuditBill.billState");
        grid.setGridParam().hideCol("billState");
        grid.setGridParam().hideCol("lastSumScore");
        grid.setGridParam().hideCol("lastGradeLevel");
        grid.setGridParam().hideCol("confirmState");
        grid.setGridParam().hideCol("appealState");
        grid.setGridParam().hideCol("status");
        grid.setGridParam().hideCol("employeeType.name");
        grid.setGridParam().hideCol("interview.interviewStatus");
        grid.setGridParam({cellEdit: true});
        grid.setColProp('reviseSumScore', {editable: true});
        grid.setColProp('reviseGradeLevel', {editable: true, edittype: 'shrselect',formatter: 'shrtext',editoptions: {
                selectJson: {
                    onChange: function(){
                        var $this = $(this);
                        var selectVal = $(this).val();
                    }
                }
            }});
        grid.setColProp('reviseReason', {editable: true, edittype: 'wafTextArea',formatter: function(val,msg){
                return '<div class="cell-height scrollbarthin">'+(val?val:'')+'</div>';
            }});
        grid.setColProp('perCoefficient', {editable: true});
        var _self = this;
        grid.jqGrid('option', {
            cellsubmit: 'clientArray',
            onCellSelect: function (rowid, colIndex, cellcontent, e) {
                _self.onCellSelect(rowid, colIndex, cellcontent, e);

            },
            onSelectAll: function (rowIds, checked) {
                _self.onSelectAll(rowIds, checked);
            },
            onPaging: function () {
                _self.onPaging();
            },
            beforeEditCell: function (rowid, cellname, value, iRow, iCol) {
                var $cell_reviseSumScore = $('[id="' + rowid + '"]').find("td[aria-describedby='grid_reviseSumScore']");
                var $cell_reviseGradeLevel = $('[id="' + rowid + '"]').find("td[aria-describedby='grid_reviseGradeLevel']");
                var $cell_reviseReason = $('[id="' + rowid + '"]').find("td[aria-describedby='grid_reviseReason']");
                if ($cell_reviseSumScore.hasClass("disabled") && cellname == "reviseSumScore") {
                    return false;
                }
                if ($cell_reviseGradeLevel.hasClass("disabled") && cellname == "reviseGradeLevel") {
                    return false;
                }
                return true;
            },
            afterEditCell: function (rowid, cellname, value, iRow, iCol) {
                if(cellname == 'reviseReason'){
                    $(this).find('textarea[id="'+iRow+'_'+cellname+'"]').val($(value).text());
                }
                var $cell_reviseSumScore = $('[id="' + rowid + '"]').find("td[aria-describedby='grid_reviseSumScore']");
                var $cell_reviseGradeLevel = $('[id="' + rowid + '"]').find("td[aria-describedby='grid_reviseGradeLevel']");
                var $cell_reviseReason = $('[id="' + rowid + '"]').find("td[aria-describedby='grid_reviseReason']");
                var reviseGradeLevelSelectJSON=$('[id="' + rowid + '"]').find("td[aria-describedby='grid_reviseGradeLevelSelect']").html();
                reviseGradeLevelSelectJSON = JSON.parse(reviseGradeLevelSelectJSON);
                if ("reviseGradeLevel" == cellname) {
                    $('#' + iRow + '_' + cellname).attr('readonly', true);
                    $('#' + iRow + '_' + cellname).shrSelect('addOption', reviseGradeLevelSelectJSON);
                }
                var _grid = $(this);
                if(cellname == 'reviseSumScore'){
                    $('#' + iRow + '_' + cellname).bind('blur',function(){
                        that.setReviseLevel(rowid, cellname, $(this).val(), iRow, iCol, _grid);
                    })
                }
            },
            loadComplete: function (data) {
                _self.gridLoadComplete();
                var $grid = $("#grid");
                $("td[role='gridcell']").each(function () {
                    $(this).removeClass("disabled");
                    $(this).addClass("gridcell0");
                });
            }
        });
    },

    // 修改分数后匹配等级
    setReviseLevel: function(rowid, cellname, value, iRow, iCol, _grid){
        var rowData = _grid.getRowData(rowid);
        if(!rowData.levelScoreKVInfo) return false;
        var levelScoreKVInfo = JSON.parse(rowData.levelScoreKVInfo);
        var wholeGrade = '';
        if(value){
            var minGrade = '', maxGrade = '', scoreLowLimit = rowData.scoreLowLimit, scoreUpLimit = rowData.scoreUpLimit;
            for(var key in levelScoreKVInfo){
                var range = key.split('~');
                if(Number(value) > Number(range[0]) && Number(value) <= Number(range[1])){
                    wholeGrade = key;
                    break;
                }
                if(scoreLowLimit == Number(range[0])){
                    minGrade = key;
                }
                if(scoreUpLimit == Number(range[1])){
                    maxGrade = key
                }
            }
            if(!wholeGrade){
                if(Number(value) <= Number(scoreLowLimit)){
                    wholeGrade = minGrade;
                }
                if(Number(value) > Number(scoreUpLimit)){
                    wholeGrade = maxGrade;
                }
            }
            _grid.jqGrid('setCell', rowid, 'reviseGradeLevel',levelScoreKVInfo[wholeGrade]);
        }else{
            _grid.jqGrid('setCell', rowid, 'reviseGradeLevel',null);
        }
    },

    /**
     * 批量修订分数等级保存
     */
    batchSaveReviseDataAction: function (obj) {
        var _self = this;
        var $grid = $("#grid");
        $('#grid').jqGrid('editStop')
        var rowDatas = $grid.jqGrid("getRowData");
        if (rowDatas && rowDatas.length > 0) {
            var editData = [];
            var errData = [];
            var billId = [];
            for (var i = 0; i < rowDatas.length; i++) {
                var rowData = rowDatas[i];
                var $cell = $(shr.xssFilter('[id="' + rowData.id + '"]')).find("td[aria-describedby='grid_reviseSumScore']");
                var $cell2 = $(shr.xssFilter('[id="' + rowData.id + '"]')).find("td[aria-describedby='grid_reviseGradeLevel']");
                var $cell3 = $(shr.xssFilter('[id="' + rowData.id + '"]')).find("td[aria-describedby='grid_reviseReason']");
                var $cell4 = $(shr.xssFilter('[id="' + rowData.id + '"]')).find("td[aria-describedby='grid_perCoefficient']");
                var val = {};
                val.id = rowData.id;
                val.periodId = parent.periodInfo.id;
                var modified = false;
                if ($cell.hasClass("dirty-cell")||$cell2.hasClass("dirty-cell")||$cell3.hasClass("dirty-cell")||$cell4.hasClass("dirty-cell")){
                    val.reviseSumScore = rowData['reviseSumScore'];
                    val.reviseGradeLevel = rowData['reviseGradeLevel'];
                    val.reviseReason = $(rowData['reviseReason']).text().trim();
                    if(null!=rowData['perCoefficient']&&null!=rowData['perMaxCoefficient']&&null!=rowData['perMinCoefficient']){
                        val.perCoefficient = rowData['perCoefficient'];
                        val.perMaxCoefficient = rowData['perMaxCoefficient'];
                        val.perMinCoefficient = rowData['perMinCoefficient'];
                        if(Number(val.perCoefficient)>Number(val.perMaxCoefficient)
                            ||Number(val.perCoefficient)<Number(val.perMinCoefficient)){
                            errData.push(val);
                            modified = false;
                        } else {
                            modified = true;
                        }
                    }else {
                        modified = true;
                    }
                }

                if (modified) {
                    editData.push(val);
                    billId.push(rowData.id);
                }
            }
            if (errData.length > 0) {
                return shr.showWarning({message: "所修改的绩效系数，大于最大绩效系数或者小于最小绩效系数！"});
            }
            if (editData.length == 0) {
                return shr.showWarning({message: $.perfwebI18n.commonMsg.msg17});
            }

            shr.showConfirm($.perfwebI18n.commonMsg.msg18, function () {
                _self.doRemoteWithBatchExtendAction({
                    method: "batchSaveReviseData",
                    datas: JSON.stringify(editData),
                    billId: billId.join(","),
                    permItemId: $(obj.currentTarget).attr("data-permitemid"),
                });
                $('#appealBillList').hide();
            });
        }
    },
    appendBatchHtml: function () {
        var orgHtml = new Array();
        orgHtml.push(
            '<div class="group-panel">',
            '<div class="row-fluid row-block">',
            '<div class="row-fluid row-block flex-rw " id="">',
            '<div data-ctrlrole="labelContainer" class="field-area flex-c ">',
            '<div class="label-ctrl flex-cc flex-r">',
            '<div class="field-label" title="绩效分组" style="">绩效分组</div>',
            '<div class="field-desc"><span id="d_group_desc">:</span></div>',
            '</div>',
            '<div class="field-ctrl flex-c">',
            '<input class="block-father input-height" type="text" id="groupValue">',
            '</div>',
            '</div>',
            '</div>',
            '</div>',
            '</div>',
        );
        return orgHtml;
    },
    // 修改按钮样式  看似无意义的操作  其实是为了迎合平台对弹出框中再加基础资料f7弹出框不支持的一种处理方式
    changeButtonClass: function () {
        $(".ui-dialog-buttonset").addClass("ui-dialog-buttonset-private")
            .removeClass("ui-dialog-buttonset");
        $(".ui-dialog-buttonset-private").css({
            "float": "right",
            "color": "#333"
        });
        $(".ui-dialog-buttonset-private").find("button").css({
            "background": "#005BAC",
            "border": "solid 1px #ccc",
            "font-size": "14px",
            "color": "#fff"
        });
    },
    /**
     * 修改分组
     */
    assignBelongGroupAction: function () {
        if (!this.checkSelectIds()) {
            return;
        }

        $body = $(document.body);
        $("#batchSet_dialog").remove();
        $editCol = $("<form id='batchSet_dialog'></from>").appendTo($body);
        var formJson = {
            id: "batchSet_dialog"
        };
        $('#batchSet_dialog').shrForm(formJson);
        var orgHtml = that.appendBatchHtml();
        $('#batchSet_dialog').append(orgHtml.join(""));

        var buttons = [];
        var param = {};
        buttons.push({
            text: "确定",
            click: function () {
                let groupValue_val = $("#groupValue").val();
                if (groupValue_val == null) {
                    shr.showInfo({
                        message: "请输入分组!",
                    });
                }
                that.doRemoteWithBatchExtendAction({
                    method: "batchAssignGroup",
                    group: groupValue_val,
                    async: true,
                    buttonName: 'assignBelongGroup',
                    // success: function (response) {
                    //
                    // }
                });
                $('.view_manager_body').children().css('height', '')
                $('#dialog_F7grid').css('height', '455px');
                $("#batchSet_dialog").dialog("close");
            }
        });

        showDialog("#batchSet_dialog", "绩效分组", $('#batchSet_dialog').html(), buttons, 600, 410);
        that.changeButtonClass();
        var text_json = {
            id:"groupValue",
            name: "groupValue",
            readonly: "",
            value: "{&quot;l2&quot;:&quot;&quot;}",
            validate: "{maxlength:255,required:true}",
            trimAll:false,
            isHtmlDecode:true,
            isMultiLan:true,
            isNumberfield:false,
            isMenuIcon: false,
            onChange: null,
            joinSelectField: "",
            extendOptions:{},
            numberfieldBlank:false
        };
        $('#groupValue').shrTextField(text_json);
    },
    /**
     * 清除分组
     */
    clearBelongGroupAction: function () {
        if (!this.checkSelectIds()) {
            return;
        }

        that.doRemoteWithBatchExtendAction({
            method: "clearBelongGroup",
            async: true,
            buttonName: 'clearBelongGroup'
        });
    },
    /**
     * 获取绩效系数fperfFileid
     */
    performanceLevelAction: function () {
        if (!this.checkSelectIds()) {
            return;
        }

        that.doRemoteWithBatchExtendAction({
            method: "performanceLevel",
            async: true,
            buttonName: 'performanceLevel',
            period: parent.periodInfo.id,
            planId: parent.planId,
        });
    },
    /**
     * 上季度部门绩效等级结果
     */
    bindDepAction: function () {
        var ids = that.getSelectedIds();
        that.remoteCall({
            method: "bindDep",
            async: false,
            param: {
                period: parent.periodInfo.id,
                planId: parent.planId,
                billId: ids,
            },
            success: function (data) {
                console.log(JSON.stringify(data))
            }
        });
    },
    /**
     * 上季度部门绩效等级结果或项目绩效等级结果
     */
    bindDep_OR_ProjectBatchAction: function () {
        //审核操作
        that.doRemoteWithBatchExtendAction({
            method: "bindDep_OR_ProjectBatch",
            type: '600', //列表页签类型-未审核
            period: parent.currentPeriod,
            messageService: '501', //考核结果通知
            buttonName: 'bindDep_OR_ProjectBatch',
            planId: parent.planId,
        });
    },
    /**
     * 项目绩效等级结果
     */
    bindProjectBatchAction: function () {
        //审核操作
        that.doRemoteWithBatchExtendAction({
            method: "bindProjectBatch",
            type: '600', //列表页签类型-未审核
            period: parent.currentPeriod,
            messageService: '501', //考核结果通知
            buttonName: 'bindProjectBatch',
            planId: parent.planId,
        });
    },
    /**
     * 上季度部门绩效等级结果
     */
    bindDepBatchAction: function () {
        //审核操作
        that.doRemoteWithBatchExtendAction({
            method: "bindDepBatch",
            type: '600', //列表页签类型-未审核
            period: parent.currentPeriod,
            messageService: '501', //考核结果通知
            buttonName: 'bindDepBatch',
            planId: parent.planId,
        });
    },
    /**
     * 正态分布校验结果
     */
    beforeAuditEvaResutAction: function () {
        //审核操作
        that.doRemoteWithBatchExtendAction({
            method: "beforeAuditEvaResut",
            type: '600', //列表页签类型-未审核
            period: parent.currentPeriod,
            messageService: '501', //考核结果通知
            buttonName: 'beforeAuditEvaResut',
            planId: parent.planId,

        });
    },
    auditBeforeResut: function (_self, data) {
        //提交前校验正则
        that.doRemoteWithBatchExtendAction({
            method: "beforeAuditEvaResut",
            type: '600', //列表页签类型-未审核
            period: parent.currentPeriod,
            messageService: '501', //考核结果通知
            buttonName: 'beforeAuditEvaResut',
            planId: parent.planId,
            success: function (response) {
                if (response) {
                    const batchTipsData = _self.batchTipsDataHandler(response, data);
                    if (batchTipsData.successCount > 0 && batchTipsData.failureCount <= 0) {
                        shr.custom.evaResultManagerListExEx.superClass.auditAction.call(that);
                    } else {
                        let len = 0;
                        $(_self).shrMessageTips({
                            isSuccess: batchTipsData.isSuccess,
                            successCount: batchTipsData.successCount,
                            failureCount: batchTipsData.failureCount,
                            confirmCallback: function () {
                                $(_self).shrDetailTips({
                                    tableData: batchTipsData.tmp,
                                    successCount: batchTipsData.successCount,
                                    failureCount: batchTipsData.failureCount,
                                    colNamesData: batchTipsData.tableModel,
                                    isSortable: _self.batchHandlerWhetherSortable(),
                                    modalWidth: ''
                                }).shrDetailTips("open");
                                let modal_title = $("#detailTipsCode .modal-title");
                                let modal_titleStr = modal_title.html().replace('批量处理结果', msg1);
                                modal_title.html(modal_titleStr);
                            },
                            closeCallback: function () {
                                //shr.custom.evaResultManagerListExEx.superClass.auditAction.call(_self);
                                _self.reloadGrid();
                            },
                            openCallback: function () {
                                if (len > 0) {
                                    $("#tips-title").html(msg1);
                                    //第二次进入返回false，让其不需要加载dom，加载我的业务
                                    $("#tips-detail").prepend('<button class="shrbtn shrbtn-intermediate continue">继续</button>');
                                    $("#tips-detail .continue").css("width", "auto");
                                    $("#tips-detail .continue").css("height", "30px");
                                    $("#tips-detail .continue").css("margin", "15px 12px 0 0");
                                    $("#message-tips").find("p#tips-detail button.continue").click(function (event) {
                                        //_self.reloadGrid();
                                        $("#mask").remove();
                                        shr.custom.evaResultManagerListExEx.superClass.auditAction.call(that);

                                    });
                                    return false;
                                } else {
                                    //第一次进入返回true，让其先加载dom
                                    len++;
                                    return true;
                                }
                            }
                        }).shrMessageTips("open");
                        $(_self).shrMessageTips("open");
                        $(_self).shrMessageTips({openCallback: function () { return true;}})
                    }
                }
            },
        });
    },
    evaresultAuditBeforeResut: function (_self, data) {
        //提交前校验正则
        that.doRemoteWithBatchExtendAction({
            method: "beforeAuditEvaResut",
            type: '600', //列表页签类型-未审核
            period: parent.currentPeriod,
            messageService: '501', //考核结果通知
            buttonName: 'beforeAuditEvaResut',
            planId: parent.planId,
            success: function (response) {
                if (response) {
                    const batchTipsData = _self.batchTipsDataHandler(response, data);
                    if (batchTipsData.successCount > 0 && batchTipsData.failureCount <= 0) {
                        shr.custom.evaResultManagerListExEx.superClass.evaresultAuditAction.call(that);
                    } else {
                        let len = 0;
                        $(_self).shrMessageTips({
                            isSuccess: batchTipsData.isSuccess,
                            successCount: batchTipsData.successCount,
                            failureCount: batchTipsData.failureCount,
                            confirmCallback: function () {
                                $(_self).shrDetailTips({
                                    tableData: batchTipsData.tmp,
                                    successCount: batchTipsData.successCount,
                                    failureCount: batchTipsData.failureCount,
                                    colNamesData: batchTipsData.tableModel,
                                    isSortable: _self.batchHandlerWhetherSortable(),
                                    modalWidth: ''
                                }).shrDetailTips("open");
                                let modal_title = $("#detailTipsCode .modal-title");
                                let modal_titleStr = modal_title.html().replace('批量处理结果', msg1);
                                modal_title.html(modal_titleStr);
                            },
                            closeCallback: function () {
                                //shr.custom.evaResultManagerListExEx.superClass.auditAction.call(_self);
                                _self.reloadGrid();
                            },
                            openCallback: function () {
                                if (len > 0) {
                                    $("#tips-title").html(msg1);
                                    //第二次进入返回false，让其不需要加载dom，加载我的业务
                                    // $("#tips-detail").prepend('<button class="shrbtn shrbtn-intermediate continue">继续</button>');
                                    // $("#tips-detail .continue").css("width", "auto");
                                    // $("#tips-detail .continue").css("height", "30px");
                                    // $("#tips-detail .continue").css("margin", "15px 12px 0 0");
                                    // $("#message-tips").find("p#tips-detail button.continue").click(function (event) {
                                    //     //_self.reloadGrid();
                                    //     $("#mask").remove();
                                    //     shr.custom.evaResultManagerListExEx.superClass.evaresultAuditAction.call(that);
                                    // });
                                    return false;
                                } else {
                                    //第一次进入返回true，让其先加载dom
                                    len++;
                                    return true;
                                }
                            }
                        }).shrMessageTips("open");
                        $(_self).shrMessageTips("open");
                        $(_self).shrMessageTips({openCallback: function () { return true;}})
                    }
                }
            },
        });
    },
    /**
     * strat
     */
    /**
     * 【已打分】【未审核】审核弹出提示（跨页全选改造）
     * @author liuzw
     * @returns
     */
    auditAction: function () {
        var _self = this;
        var billIds = this.getSelectedIds();
        if(!billIds){
            return;
        }

        that.remoteCall({
            method: "temp",
            async: true,
            param: {
                period: parent.periodInfo.id,
                planId: parent.planId,
                billId: billIds,
            },
            success: function (data) {
                if(data.ProjectManager=="1"){
                    shr.custom.evaResultManagerListExEx.superClass.auditAction.call(that);
                }else {
                    _self.auditAction2();
                }
            }
        });
    },
    evaresultAuditAction: function () {
        var _self = this;
        var billIds = this.getSelectedIds();
        if(!billIds){
            return;
        }

        that.remoteCall({
            method: "temp",
            async: true,
            param: {
                period: parent.periodInfo.id,
                planId: parent.planId,
                billId: billIds,
            },
            success: function (data) {
                if(data.ProjectManager=="1"){
                    shr.custom.evaResultManagerListExEx.superClass.evaresultAuditAction.call(that);
                }else {
                    _self.evaresultAuditAction2();
                }
            }
        });
    },
    /**
     * end
     */
    /**
     * 【已打分】【未审核】审核弹出提示（跨页全选改造）
     * @author liuzw
     * @returns
     */
    auditAction2: function () {

        if (!this.checkSelectIds()) {
            return;
        }
        var _self = this;
        var rowDatas = $(this.gridId).jqGrid("getSelectedRowsData");
        var flag = true;
        rowDatas.forEach(function (item, index) {
            if (item['billState'] == '3') {
                shr.showWarning({message: jsBizMultLan.perfweb_evaResultManagerList_auditCheckTip_001});
                flag = false;
                return false;
            }
        });
        if (!flag) {
            return;
        }
        var billIds = this.getSelectedIds();
        if(!billIds){
            return;
        }

        let data = {};
        data = $.extend(_self.prepareParam(), data);
        data = $.extend({permItemId: shr.getCurrentPagePermItemId()}, data);

        //审核操作
        that.doRemoteWithBatchExtendAction({
            method: "bindDep_OR_ProjectBatch",
            type: '600', //列表页签类型-未审核
            period: parent.currentPeriod,
            messageService: '501', //考核结果通知
            buttonName: 'bindDep_OR_ProjectBatch',
            planId: parent.planId,
            success: function (resp) {
                if (resp) {
                    const bindDepTipsData = _self.batchTipsDataHandler(resp, data);
                    if (bindDepTipsData.successCount > 0 && bindDepTipsData.failureCount <= 0) {
                        _self.auditBeforeResut(_self, data);
                    } else {
                        let bindDepLen = 0;
                        $(_self).shrMessageTips({
                            isSuccess: bindDepTipsData.isSuccess,
                            successCount: bindDepTipsData.successCount,
                            failureCount: bindDepTipsData.failureCount,
                            confirmCallback: function () {
                                $(_self).shrDetailTips({
                                    tableData: bindDepTipsData.tmp,
                                    successCount: bindDepTipsData.successCount,
                                    failureCount: bindDepTipsData.failureCount,
                                    colNamesData: bindDepTipsData.tableModel,
                                    isSortable: _self.batchHandlerWhetherSortable(),
                                    modalWidth: ''
                                }).shrDetailTips("open");
                                let modal_title = $("#detailTipsCode .modal-title");
                                let modal_titleStr = modal_title.html().replace('批量处理结果', msg2);
                                modal_title.html(modal_titleStr);
                            },
                            closeCallback: function () {
                                //shr.custom.evaResultManagerListExEx.superClass.auditAction.call(_self);
                                _self.reloadGrid();
                            },
                            openCallback: function () {
                                if (bindDepLen > 0) {
                                    $("#tips-title").html(msg2);
                                    //第二次进入返回false，让其不需要加载dom，加载我的业务
                                    $("#tips-detail").prepend('<button class="shrbtn shrbtn-intermediate continue">继续</button>');
                                    $("#tips-detail .continue").css("width", "auto");
                                    $("#tips-detail .continue").css("height", "30px");
                                    $("#tips-detail .continue").css("margin", "15px 12px 0 0");
                                    $("#message-tips").find("p#tips-detail button.continue").click(function (event) {
                                        //_self.reloadGrid();
                                        $("#mask").remove();
                                        _self.auditBeforeResut(_self, data);
                                    });
                                    return false;
                                } else {
                                    //第一次进入返回true，让其先加载dom
                                    bindDepLen++;
                                    return true;
                                }
                            }
                        }).shrMessageTips("open");
                        $(_self).shrMessageTips("open");
                        $(_self).shrMessageTips({openCallback: function () { return true;}})
                    }
                }
            },
        });
    },
    /**
     * 工作流审核
     * @author caiwei_li
     * @returns
     */
    evaresultAuditAction2: function () {
        // if (!this.checkSelectIds()) {
        //     return;
        // }
        var _self = this;
        var rowDatas = $(this.gridId).jqGrid("getSelectedRowsData");
        var flag = true;
        rowDatas.forEach(function (item, index) {
            if (item['billState'] == '3') {
                shr.showWarning({message: jsBizMultLan.perfweb_evaResultManagerList_auditCheckTip_001});
                flag = false;
                return false;
            }
        });
        if (!flag) {
            return;
        }
        var billIds = this.getSelectedIds();
        let data = {};
        data = $.extend(_self.prepareParam(), data);
        data = $.extend({permItemId: shr.getCurrentPagePermItemId()}, data);
        //审核操作
        that.doRemoteWithBatchExtendAction({
            method: "bindDep_OR_ProjectBatch",
            type: '600', //列表页签类型-未审核
            period: parent.currentPeriod,
            messageService: '501', //考核结果通知
            buttonName: 'bindDep_OR_ProjectBatch',
            planId: parent.planId,
            success: function (resp) {
                if (resp) {
                    const bindDepTipsData = _self.batchTipsDataHandler(resp, data);
                    if (bindDepTipsData.successCount > 0 && bindDepTipsData.failureCount <= 0) {
                        _self.evaresultAuditBeforeResut(_self, data);
                    } else {
                        let bindDepLen = 0;
                        $(_self).shrMessageTips({
                            isSuccess: bindDepTipsData.isSuccess,
                            successCount: bindDepTipsData.successCount,
                            failureCount: bindDepTipsData.failureCount,
                            confirmCallback: function () {
                                $(_self).shrDetailTips({
                                    tableData: bindDepTipsData.tmp,
                                    successCount: bindDepTipsData.successCount,
                                    failureCount: bindDepTipsData.failureCount,
                                    colNamesData: bindDepTipsData.tableModel,
                                    isSortable: _self.batchHandlerWhetherSortable(),
                                    modalWidth: ''
                                }).shrDetailTips("open");
                                let modal_title = $("#detailTipsCode .modal-title");
                                let modal_titleStr = modal_title.html().replace('批量处理结果', msg2);
                                modal_title.html(modal_titleStr);
                            },
                            closeCallback: function () {
                                //shr.custom.evaResultManagerListExEx.superClass.auditAction.call(_self);
                                _self.reloadGrid();
                            },
                            openCallback: function () {
                                if (bindDepLen > 0) {
                                    // $("#tips-title").html("上季度部门绩效等级结果");
                                    // //第二次进入返回false，让其不需要加载dom，加载我的业务
                                    // $("#tips-detail").prepend('<button class="shrbtn shrbtn-intermediate continue">继续</button>');
                                    // $("#tips-detail .continue").css("width", "auto");
                                    // $("#tips-detail .continue").css("height", "30px");
                                    // $("#tips-detail .continue").css("margin", "15px 12px 0 0");
                                    // $("#message-tips").find("p#tips-detail button.continue").click(function (event) {
                                    //     //_self.reloadGrid();
                                    //     $("#mask").remove();
                                    //     _self.evaresultAuditBeforeResut(_self, data);
                                    // });
                                    return false;
                                } else {
                                    //第一次进入返回true，让其先加载dom
                                    bindDepLen++;
                                    return true;
                                }
                            }
                        }).shrMessageTips("open");
                        $(_self).shrMessageTips("open");
                        $(_self).shrMessageTips({openCallback: function () { return true;}})
                    }
                }
            },
        });
    },
});
