/**
 * 离职申请：专业用户
 */
shr.defineClass("shr.affair.ResignBizBillEditExt", shr.affair.ResignBizBillEdit, {

	initalizeDOM : function () {
		var self = this;
		if(this.operateState.toUpperCase() != 'VIEW'){
			self.personChange(); 
		}
		shr.affair.ResignBizBillEditExt.superClass.initalizeDOM.call(this);
		
	},
	
	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){
					//【调动前直属上级】
					$("#entrys_lmanager").shrPromptBox("setValue", {id:data.leaderId,name:data.leaderName});
					
					//【员工类别】 
					$("#entrys_wcategory").shrPromptBox("setValue", {id:data.personTypeId,name:data.personTypeName});
					
					//【全职或兼职】
					//$("#entrys_fullorpart").shrPromptBox('setValue',{id:data.fullorpartID,name:data.fullorpartName});
					
					//【Academic Title】
					$("#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});
				}
			});

		});
		
	},

});
