
shr.defineClass("shr.ats.HolidayLimitListExt", shr.ats.HolidayLimitList, {

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


	annualLeaveAction:function(){
		
		var _self = this;
		shr.showConfirm('Are you sure you want to re-create the annual leave carryforward amount ？', function() {
			_self.remoteCall({
				method : 'annualLeave',
				type:"post",
				success:function(res){
					if(res==true){
						shr.showInfo({
							message: "The annual leave allowance has been regenerated！",
						});
						document.location.reload();
					}else{
						shr.showWarning({
							message: "The annual leave quota fails to be generated. Contact the administrator！",
						});
					}
				}
			});
		});
		
	},

	generateAnnualLeaveAction: function () {
    	var _self = this;
		_self.remoteCall({
			method: "generateAnnualLeave",
			async: false,
			param: {},
			success: function (data) {
				_self.reloadGrid();
			},
			error: function (err) {
				shr.showError({message: err});
			},
		});
	}
});