
shr.defineClass("shr.affair.hrman.ReinviteFireBizBillHrManEditExt", shr.affair.hrman.ReinviteFireBizBillHrManEdit, {
	
	initalizeDOM : function () {
		var _self = this;
		shr.affair.hrman.ReinviteFireBizBillHrManEditExt.superClass.initalizeDOM.call(this);
		
	},
	
	
	
	//默认新岗位和新组织填充原岗位和原组织
	initShrAffairBizBillData : function (data) {
	    //职务
		if(data[0] && data[0].oldJob && data[0].oldJob.length !=0){
			var entrys_oldJob = {
				id : data[0].oldJob.id,
				name : data[0].oldJob.name
			};
			$("#entrys_oldJob").shrPromptBox("setValue", entrys_oldJob);
		}else{
			$("#entrys_oldJob").shrPromptBox("setValue", null);
		}
		//职等
		if( data[0] && data[0].oldJobGrade && data[0].oldJobGrade.length !=0){
			var entrys_oldJobGrade = {
				id : data[0].oldJobGrade.id,
				name : data[0].oldJobGrade.name
			};
			$("#entrys_oldJobGrade").shrPromptBox("setValue", entrys_oldJobGrade);
		}else{
			$("#entrys_oldJobGrade").shrPromptBox("setValue", null);
		}
		//变动记录赋值
		this.updatePerson();
	},
	
	updatePerson : function(){
		var self = this;
		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});
			}
		});
	},
	
});