
shr.defineClass("shr.affair.hrman.EmpFluctuationBizBillMultiEntryHrManEditExt", shr.affair.hrman.EmpFluctuationBizBillMultiEntryHrManEdit, {
	
	initalizeDOM : function () {
		var _self = this;
		shr.affair.hrman.EmpFluctuationBizBillMultiEntryHrManEditExt.superClass.initalizeDOM.call(this);
		//_self.personDefult();
	},
	
	/**
	 * 监听分录改变事件
	 */
	/*personDefult:function(){
		var that = this;
		var grid = that.$editGrid;
		grid.jqGrid("option",{
			afterSaveCell:function(rowid,cellname,value,iRow,iCol){
				that.rowid = rowid;
				that.iRow = iRow;
				that.iCol = iCol;
				var person = grid.jqGrid('getCell',rowid,'person');
				var personId = person.id;
				var oldPosition = grid.jqGrid('getCell',rowid,'oldPosition');
				var oldPositionId = oldPosition.id;
				console.log("personId========"+personId);
				console.log("oldPosition========"+oldPosition);
			}
		});
	},*/
	assembleCustomRowData : function(rowdata, data, commonData, defaultValue){
		var personId = rowdata.person.id;
		var oldPositionId = rowdata.oldPosition.id;
		shr.callHandler({
			handler:"com.kingdee.shr.affair.web.handler.hrman.FluctuationBizBillHrManEditHandlerEx",
			action:"getEmpOrgRelation",
			param:{
				"personId" : personId,
				"positionId" : oldPositionId},
			async:false,
			type:"POST",
			success:function(resultData){
				//【调动前直属上级】
				rowdata.clmanager = {id:resultData.leaderId,name:resultData.leaderName};
				//【员工类别】 
				rowdata.workercategory = {id:resultData.personTypeId,name:resultData.personTypeName};
				//【全职或兼职】
				//rowdata.fullorpart = {id:resultData.fullorpartID,name:resultData.fullorpartName};
				//【Academic Title】
				rowdata.academictitle = {id:resultData.academicId,name:resultData.academicName};
				//【Job2】
				rowdata.jobs = {id:resultData.jobTwoId,name:resultData.jobTwoName};
				//【Admin Title】
				rowdata.admintitle = resultData.admint;
				//【当前时薪】
				rowdata.chrate = resultData.hourlywage;
				
			}
		});

		//获取默认调动类型
		shr.callHandler({
			handler:"com.kingdee.shr.affair.web.handler.hrman.FluctuationBizBillHrManEditHandlerEx",
			action:"getDefaultChangeType",
			param:{
				changeTypeNumber : "0207"
			},
			async:false,
			type:"POST",
			success:function(resultData){
				if(resultData && resultData.changeTypeId){
					rowdata.affairActionReason = {id:resultData.changeTypeId,name:resultData.changeTypeName};
				}
			}
		});

		return rowdata;
	},
	
	
	
});