Under the Payment of Gratuity Act, gratuity is be calculated on the rate of last drawn wages which includes only Basic and DA.
If there is no division of various components of salary in your salary slip and you are getting consolidated salary, then you are entitled to gratuity on your last drawn consolidated salary.
If there is basic compnent in your salary, but your appointment letter states that your gratuity will be calculated on the basis of gross salary (which is a better benefit than what the statute provides) then you are entitled to get gratuity on gross salary. It is settled law that if the contract between employer and employee is more beneficial than what is provided under the provisions of the statute, then contract will prevail over statute.