
shr.defineClass("shr.synSalarySchemeEdit",shr.framework.Edit, {

    initalizeDOM : function() {
        shr.synSalarySchemeEdit.superClass.initalizeDOM.call(this);
    },

    /**
     * 保存
     */
    saveAction: function(event) {
        var _self = this;
        var datas = $("#entrys").wafGrid("getAllRowData");
        var cmpItemFieldSns = [];
        var fieldTemp;
        var fileName;
        for(var i = 0;i < datas.length;i++){
            fieldTemp = datas[i].cmpItem.fieldSn;
            fileName = datas[i].cmpItem.name;
            if(cmpItemFieldSns.indexOf(fieldTemp)!=-1){
                shr.showWarning({
                    message: fileName+ '薪酬项目已重复，请删除多余的'+ fileName +'的薪酬项目',
                    hideAfter: 3
                });
                return;
            }
            //添加项目到集合
            cmpItemFieldSns[i] =  fieldTemp;
        }
        if (_self.validate() && _self.verify()) {
            _self.doSave(event, 'save');
        }else{
            if(_self != top){// in iframe
                shr.setIframeHeight(window.name);
            }

        }
    },
})



