//调用非同视图下方法
shr.callHandler({
handler: "com.kingdee.eas.custom.shr.person.PeriodConfirmEditHandler",
action: 'savePerson',
param: {currentids:currentid,calSchemeid:calScheme,cmpPeriodid:cmpPeriod,cmpItemid:cmpItem},
async: false,
type:"POST",
success: function(data) {
}
});
//调用同视图下方法
this.remoteCall({
method: "getOperate",
success: function(data) {
$("#person").shrPromptBox("setValue", data.person);
$("#personDep").shrPromptBox("setValue", data.personDep);
$("#billCreateTime").shrDatePicker('setValue',data.billCreateTime);
}
});
//后台标准返回方法
public void getOperateAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws WafException{
try {
UserInfo userInfo = ContextUtil.getCurrentUserInfo(this.ctx);
PersonInfo personInfo = userInfo.getPerson();
String personId = personInfo.getId().toString();
PersonPositionInfo personPositionInfo = PersonPositionFactory.getLocalInstance(this.ctx).getPersonPositionInfo("where person='"+personId+"'");
String personDepID = personPositionInfo.getPersonDep().getId().toString();
AdminOrgUnitInfo adminOrgUnitInfo = AdminOrgUnitFactory.getLocalInstance(this.ctx).getAdminOrgUnitInfo(new ObjectUuidPK(personDepID));
Timestamp billCreateTime = HRTimeWebUtils.dateToTimestamp(new Date());
modelMap.put("person", personInfo);
modelMap.put("personDep", adminOrgUnitInfo);
modelMap.put("billCreateTime", billCreateTime);
writeSuccessData(modelMap);
} catch (Exception e) {
JSONUtils.ERROR("获取制单人信息失败!");
}
}
//后台返回参数两种方法
(1)writeSuccessData(param);
(2)JSONUtils.SUCCESS(ajaxData);
//catch到异常用
JSONUtils.ERROR("获取制单人信息失败!");