/**
 * 离职申请：专业用户
 */
shr.defineClass("shr.affair.hrman.ResignBizBillHrManEditExt", shr.affair.hrman.ResignBizBillHrManEdit, {

	initalizeDOM : function () {
		var _self = this;
		shr.affair.hrman.ResignBizBillHrManEditExt.superClass.initalizeDOM.call(_self);
		if(this.getOperateState() != 'VIEW'){
			_self.personChange(); 
		}
	},
	
	personChange:function(){
		var _self = this;
		_self.getField("entrys_oldPosition").on("change", function(){
			var personId =  $("#entrys_person_el").val();
			var positionId = $("#entrys_oldPosition_el").val();
			shr.callHandler({
				handler : "com.kingdee.shr.affair.web.handler.hrman.FluctuationBizBillHrManEditHandlerEx",
				action : 'getEmpOrgRelation',
				async : false,
				type : "POST",
				param : {
						"personId" : personId,
						"positionId" : positionId
						},
				success:function(data){
					//【调动前直属上级】
					_self.getField("entrys_lmanager").shrPromptBox("setValue", {id:data.leaderId,name:data.leaderName});
					
					//【员工类别】 
					_self.getField("entrys_wcategory").shrPromptBox("setValue", {id:data.personTypeId,name:data.personTypeName});
					
					//【Academic Title】
					_self.getField("entrys_academictitle").shrPromptBox("setValue", {id:data.academicId,name:data.academicName});
					
					//【Admin Title】
					_self.getField("entrys_admintitle").shrTextField('setValue',data.admint);
					
					//【当前时薪】
					_self.getField("entrys_hwage").shrTextField('setValue',data.hourlywage);
					
					//【Job2】
					_self.getField("entrys_jobs").shrPromptBox('setValue',{id:data.jobTwoId,name:data.jobTwoName});
				}
			});

		});
		
	},

});
