shr.defineClass('shr.salary.salaryBagList',shr.framework.List , {
	
	
	
	initalizeDOM: function () {
		var _self = this;
		shr.salary.salaryBagList.superClass.initalizeDOM.call(this);
		
	},
	
	changeBillAction:function(e){
		var _self = this;
		var selectRows = $("#grid").jqGrid("getSelectedRows");
		if(selectRows!='undefined' && selectRows.length>1){
			shr.showWarning({message: jsBizMultLan.emp_empContractCompsitQueryList_26587569_i18n_0,hideAfter:null});
			return;
		}
		var billId = _self.getSelectedIds("id");
		if (billId != null) {
			var billState = $("#grid").jqGrid('getRowRealData',billId).billState;
			if(billState != '3'){
				shr.showInfo({message: "Only approved salary packages are allowed to change",hideAfter: null});
				return;
			}
			this.reloadPage({
				uipk: 'com.kingdee.eas.custom.bill.salary.app.SalaryBag.changeForm',
				method: 'addNew',
			    sourceBillId:billId,
				ignoreHROrgF7Cache:true
			});
		}else{
			shr.showInfo({message: "Please select the salary package that you want to change",hideAfter: null});
			return;
		}
	},

	againstApproveAction:function(e){
		var selectRows = $("#grid").jqGrid("getSelectedRows");
		if (selectRows == undefined || selectRows.length==0 || (selectRows && selectRows.length == 1 && selectRows[0] == "")) {
			shr.showWarning({message: "Please select Bank of China first！"});
			return ;
		}
		var _self = this;
		shr.showConfirm("Are you sure you want to cancel the approval process", function(){
			_self.remoteCall({
	            type:"post",
	            async: false,
	            method:"againstApprove",
	            param:{"billIds":selectRows.join(",")},
	            success:function(res){
	                shr.showInfo({message: "Reverse approval successful"});
	                _self.reloadGrid();
	            }
	        });
		});
	}
});
