完善APP端OA功能
This commit is contained in:
parent
98398ad6f7
commit
231830ece0
@ -43,7 +43,7 @@ public class OaFormReportController extends DefaultBaseController {
|
||||
@ApiImplicitParam(name = "formVersion", value = "表单版本", paramType = "path")
|
||||
})
|
||||
@PostMapping("save/definition-id/{processDefinitionId}/code/{formCode}/version/{formVersion}")
|
||||
public SuccessResult save(@PathVariable("processDefinitionId") String processDefinitionId,
|
||||
public synchronized SuccessResult save(@PathVariable("processDefinitionId") String processDefinitionId,
|
||||
@PathVariable("formCode") String formCode,
|
||||
@PathVariable("formVersion") Integer formVersion,
|
||||
@RequestBody Map<String, Object> params) {
|
||||
@ -60,7 +60,7 @@ public class OaFormReportController extends DefaultBaseController {
|
||||
@ApiImplicitParam(name = "uid", value = "表单主键", paramType = "path")
|
||||
})
|
||||
@PutMapping("update/task-id/{taskId}/code/{formCode}/version/{formVersion}/is-need-claim/{isNeedClaim}/uid/{uid}")
|
||||
public SuccessResult update(@PathVariable("taskId") String taskId,
|
||||
public synchronized SuccessResult update(@PathVariable("taskId") String taskId,
|
||||
@PathVariable("formCode") String formCode,
|
||||
@PathVariable("formVersion") Integer formVersion,
|
||||
@PathVariable("isNeedClaim") Integer isNeedClaim,
|
||||
|
@ -1,8 +1,10 @@
|
||||
package ink.wgink.module.activiti.controller.app.api.oa;
|
||||
|
||||
import ink.wgink.annotation.CheckRequestBodyAnnotation;
|
||||
import ink.wgink.common.base.DefaultBaseController;
|
||||
import ink.wgink.exceptions.ParamsException;
|
||||
import ink.wgink.interfaces.consts.ISystemConstant;
|
||||
import ink.wgink.module.activiti.pojo.vos.oa.UpdateTaskAssigneeVO;
|
||||
import ink.wgink.module.activiti.service.oa.IOaFormReportService;
|
||||
import ink.wgink.module.activiti.util.oa.OaFormReportUtil;
|
||||
import ink.wgink.pojo.ListPage;
|
||||
@ -42,7 +44,7 @@ public class OaFormReportAppController extends DefaultBaseController {
|
||||
@ApiImplicitParam(name = "formVersion", value = "表单版本", paramType = "path")
|
||||
})
|
||||
@PostMapping("save/definition-id/{processDefinitionId}/code/{formCode}/version/{formVersion}")
|
||||
public SuccessResult save(@RequestHeader("token") String token,
|
||||
public synchronized SuccessResult save(@RequestHeader("token") String token,
|
||||
@PathVariable("processDefinitionId") String processDefinitionId,
|
||||
@PathVariable("formCode") String formCode,
|
||||
@PathVariable("formVersion") Integer formVersion,
|
||||
@ -61,7 +63,7 @@ public class OaFormReportAppController extends DefaultBaseController {
|
||||
@ApiImplicitParam(name = "uid", value = "表单主键", paramType = "path")
|
||||
})
|
||||
@PutMapping("update/task-id/{taskId}/code/{formCode}/version/{formVersion}/is-need-claim/{isNeedClaim}/uid/{uid}")
|
||||
public SuccessResult update(@RequestHeader("token") String token,
|
||||
public synchronized SuccessResult update(@RequestHeader("token") String token,
|
||||
@PathVariable("taskId") String taskId,
|
||||
@PathVariable("formCode") String formCode,
|
||||
@PathVariable("formVersion") Integer formVersion,
|
||||
@ -76,6 +78,62 @@ public class OaFormReportAppController extends DefaultBaseController {
|
||||
return new SuccessResult();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "更新回退", notes = "更新回退接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "token", value = "token", paramType = "header"),
|
||||
@ApiImplicitParam(name = "processInstanceId", value = "流程实例ID", paramType = "path"),
|
||||
@ApiImplicitParam(name = "taskId", value = "当前任务ID", paramType = "path"),
|
||||
@ApiImplicitParam(name = "nodeId", value = "跳转节点ID", paramType = "path")
|
||||
})
|
||||
@PutMapping("update-go-back/process-instance-id/{processInstanceId}/task-id/{taskId}/node-id/{nodeId}")
|
||||
public synchronized SuccessResult updateGoBack(@RequestHeader("token") String token,
|
||||
@PathVariable("processInstanceId") String processInstanceId,
|
||||
@PathVariable("taskId") String taskId,
|
||||
@PathVariable("nodeId") String nodeId,
|
||||
@RequestBody Map<String, String> params) {
|
||||
String reason = params.get(IOaFormReportService.KEY_REASON);
|
||||
if (StringUtils.isBlank(reason)) {
|
||||
throw new ParamsException("回退原因不能为空");
|
||||
}
|
||||
oaFormReportService.updateGoBack(token, processInstanceId, taskId, nodeId, reason);
|
||||
return new SuccessResult();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "更新强制结束", notes = "更新强制结束接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "token", value = "token", paramType = "header"),
|
||||
@ApiImplicitParam(name = "processInstanceId", value = "流程实例ID", paramType = "path"),
|
||||
@ApiImplicitParam(name = "taskId", value = "当前任务ID", paramType = "path")
|
||||
})
|
||||
@PutMapping("update-forced-end/process-instance-id/{processInstanceId}/task-id/{taskId}")
|
||||
public synchronized SuccessResult updateForcedEnd(@RequestHeader("token") String token,
|
||||
@PathVariable("processInstanceId") String processInstanceId,
|
||||
@PathVariable("taskId") String taskId,
|
||||
@RequestBody Map<String, String> params) {
|
||||
String reason = params.get(IOaFormReportService.KEY_REASON);
|
||||
if (StringUtils.isBlank(reason)) {
|
||||
throw new ParamsException("结束原因不能为空");
|
||||
}
|
||||
oaFormReportService.updateForcedEnd(token, processInstanceId, taskId, reason);
|
||||
return new SuccessResult();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "更新代理人", notes = "更新代理人接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "token", value = "token", paramType = "header"),
|
||||
@ApiImplicitParam(name = "processInstanceId", value = "流程实例ID", paramType = "path"),
|
||||
@ApiImplicitParam(name = "taskId", value = "当前任务ID", paramType = "path")
|
||||
})
|
||||
@PutMapping("update-assignee/process-instance-id/{processInstanceId}/task-id/{taskId}")
|
||||
@CheckRequestBodyAnnotation
|
||||
public synchronized SuccessResult updateAssignee(@RequestHeader("token") String token,
|
||||
@PathVariable("processInstanceId") String processInstanceId,
|
||||
@PathVariable("taskId") String taskId,
|
||||
@RequestBody UpdateTaskAssigneeVO updateTaskAssigneeVO) {
|
||||
oaFormReportService.updateTaskAssignee(token, processInstanceId, taskId, updateTaskAssigneeVO);
|
||||
return new SuccessResult();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询表单", notes = "更新表单接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "token", value = "token", paramType = "header"),
|
||||
|
@ -28,10 +28,10 @@ public class OaFormReportAppRouteController extends DefaultBaseController {
|
||||
private IOaFormReportRouteService oaFormReportRouteService;
|
||||
|
||||
@GetMapping("save/definition-id/{processDefinitionId}/code/{formCode}/version/{formVersion}")
|
||||
public void get(@RequestParam("token") String token,
|
||||
@PathVariable("processDefinitionId") String processDefinitionId,
|
||||
public void get(@PathVariable("processDefinitionId") String processDefinitionId,
|
||||
@PathVariable("formCode") String formCode,
|
||||
@PathVariable("formVersion") Integer formVersion,
|
||||
@RequestParam("token") String token,
|
||||
HttpSession httpSession,
|
||||
HttpServletRequest httpServletRequest,
|
||||
HttpServletResponse httpServletResponse) {
|
||||
@ -39,11 +39,11 @@ public class OaFormReportAppRouteController extends DefaultBaseController {
|
||||
}
|
||||
|
||||
@GetMapping("update/task-id/{taskId}/code/{formCode}/version/{formVersion}/is-need-claim/{isNeedClaim}")
|
||||
public void update(@RequestHeader("token") String token,
|
||||
@PathVariable("taskId") String taskId,
|
||||
public void update(@PathVariable("taskId") String taskId,
|
||||
@PathVariable("formCode") String formCode,
|
||||
@PathVariable("formVersion") Integer formVersion,
|
||||
@PathVariable("isNeedClaim") Integer isNeedClaim,
|
||||
@RequestParam("token") String token,
|
||||
HttpSession httpSession,
|
||||
HttpServletRequest httpServletRequest,
|
||||
HttpServletResponse httpServletResponse) {
|
||||
@ -51,9 +51,9 @@ public class OaFormReportAppRouteController extends DefaultBaseController {
|
||||
}
|
||||
|
||||
@GetMapping("show/code/{formCode}/version/{formVersion}")
|
||||
public void show(@RequestHeader("token") String token,
|
||||
@PathVariable("formCode") String formCode,
|
||||
public void show(@PathVariable("formCode") String formCode,
|
||||
@PathVariable("formVersion") Integer formVersion,
|
||||
@RequestParam("token") String token,
|
||||
HttpSession httpSession,
|
||||
HttpServletRequest httpServletRequest,
|
||||
HttpServletResponse httpServletResponse) {
|
||||
|
@ -123,6 +123,29 @@ public interface IOaFormReportService {
|
||||
*/
|
||||
void updateGoBack(String processInstanceId, String currentTaskId, String jumpNodeId, String reason);
|
||||
|
||||
/**
|
||||
* 更新回退
|
||||
*
|
||||
* @param token
|
||||
* @param processInstanceId
|
||||
* @param currentTaskId
|
||||
* @param jumpNodeId
|
||||
* @param reason
|
||||
*/
|
||||
void updateGoBack(String token, String processInstanceId, String currentTaskId, String jumpNodeId, String reason);
|
||||
|
||||
/**
|
||||
* 更新回退
|
||||
*
|
||||
* @param userId
|
||||
* @param userName
|
||||
* @param processInstanceId
|
||||
* @param currentTaskId
|
||||
* @param jumpNodeId
|
||||
* @param reason
|
||||
*/
|
||||
void updateGoBackByUserIdAndUserName(String userId, String userName, String processInstanceId, String currentTaskId, String jumpNodeId, String reason);
|
||||
|
||||
/**
|
||||
* 强制结束
|
||||
*
|
||||
@ -132,6 +155,27 @@ public interface IOaFormReportService {
|
||||
*/
|
||||
void updateForcedEnd(String processInstanceId, String currentTaskId, String reason);
|
||||
|
||||
/**
|
||||
* 强制结束
|
||||
*
|
||||
* @param token
|
||||
* @param processInstanceId
|
||||
* @param currentTaskId
|
||||
* @param reason
|
||||
*/
|
||||
void updateForcedEnd(String token, String processInstanceId, String currentTaskId, String reason);
|
||||
|
||||
/**
|
||||
* 强制结束
|
||||
*
|
||||
* @param userId
|
||||
* @param userName
|
||||
* @param processInstanceId
|
||||
* @param currentTaskId
|
||||
* @param reason
|
||||
*/
|
||||
void updateForcedEndByUserIdAndUserName(String userId, String userName, String processInstanceId, String currentTaskId, String reason);
|
||||
|
||||
/**
|
||||
* 更新任务
|
||||
*
|
||||
@ -141,6 +185,25 @@ public interface IOaFormReportService {
|
||||
*/
|
||||
void updateTaskAssignee(String processInstanceId, String taskId, UpdateTaskAssigneeVO updateTaskAssigneeVO);
|
||||
|
||||
/**
|
||||
* 更新任务
|
||||
* @param token
|
||||
* @param processInstanceId
|
||||
* @param taskId
|
||||
* @param updateTaskAssigneeVO
|
||||
*/
|
||||
void updateTaskAssignee(String token, String processInstanceId, String taskId, UpdateTaskAssigneeVO updateTaskAssigneeVO);
|
||||
|
||||
/**
|
||||
* 更新任务
|
||||
* @param userId
|
||||
* @param userName
|
||||
* @param processInstanceId
|
||||
* @param taskId
|
||||
* @param updateTaskAssigneeVO
|
||||
*/
|
||||
void updateTaskAssigneeByUserIdAndUserName(String userId, String userName, String processInstanceId, String taskId, UpdateTaskAssigneeVO updateTaskAssigneeVO);
|
||||
|
||||
/**
|
||||
* 表单详情
|
||||
*
|
||||
|
@ -21,6 +21,7 @@ import ink.wgink.module.form.service.design.IFormService;
|
||||
import ink.wgink.module.form.service.report.IFormReportRouteService;
|
||||
import ink.wgink.module.form.service.report.IFormReportService;
|
||||
import ink.wgink.pojo.app.AppTokenUser;
|
||||
import ink.wgink.pojo.app.AppTokenUserDepartment;
|
||||
import ink.wgink.pojo.bos.UserInfoBO;
|
||||
import ink.wgink.pojo.dtos.department.DepartmentSimpleDTO;
|
||||
import ink.wgink.pojo.dtos.user.UserDTO;
|
||||
@ -88,15 +89,17 @@ public class OaFormReportRouteServiceImpl extends DefaultBaseService implements
|
||||
|
||||
@Override
|
||||
public void save(String processDefinitionId, String formCode, Integer formVersion, HttpSession httpSession, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) {
|
||||
Map<String, Object> model = getSaveModel(processDefinitionId);
|
||||
setPageCurrentUser(model);
|
||||
UserInfoBO currentUser = securityComponent.getCurrentUser();
|
||||
Map<String, Object> model = getSaveModel(currentUser.getUserId(), processDefinitionId);
|
||||
setPageCurrentUser(currentUser.getUserId(), currentUser.getUserName(), currentUser.getDepartments(), model);
|
||||
formReportRouteService.save(formCode, formVersion, httpSession, httpServletRequest, httpServletResponse, model);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(String taskId, String formCode, Integer formVersion, Integer isNeedClaim, HttpSession httpSession, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) {
|
||||
Map<String, Object> model = getUpdateModel(taskId, isNeedClaim);
|
||||
setPageCurrentUser(model);
|
||||
UserInfoBO currentUser = securityComponent.getCurrentUser();
|
||||
Map<String, Object> model = getUpdateModel(currentUser.getUserId(), taskId, isNeedClaim);
|
||||
setPageCurrentUser(currentUser.getUserId(), currentUser.getUserName(), currentUser.getDepartments(), model);
|
||||
// 设置代理人
|
||||
formReportRouteService.update(formCode, formVersion, httpSession, httpServletRequest, httpServletResponse, model);
|
||||
}
|
||||
@ -135,15 +138,17 @@ public class OaFormReportRouteServiceImpl extends DefaultBaseService implements
|
||||
|
||||
@Override
|
||||
public void appSave(String token, String processDefinitionId, String formCode, Integer formVersion, HttpSession httpSession, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) {
|
||||
Map<String, Object> model = getSaveModel(processDefinitionId);
|
||||
setAppPageCurrentUser(token, model);
|
||||
AppTokenUser appTokenUser = getAppTokenUser(token);
|
||||
Map<String, Object> model = getSaveModel(appTokenUser.getId(), processDefinitionId);
|
||||
setAppPageCurrentUser(appTokenUser.getId(), appTokenUser.getName(), appTokenUser.getDepartments(), model);
|
||||
formReportRouteService.appSave(formCode, formVersion, httpSession, httpServletRequest, httpServletResponse, model);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void appUpdate(String token, String taskId, String formCode, Integer formVersion, Integer isNeedClaim, HttpSession httpSession, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) {
|
||||
Map<String, Object> model = getUpdateModel(taskId, isNeedClaim);
|
||||
setAppPageCurrentUser(token, model);
|
||||
AppTokenUser appTokenUser = getAppTokenUser(token);
|
||||
Map<String, Object> model = getUpdateModel(appTokenUser.getId(), taskId, isNeedClaim);
|
||||
setAppPageCurrentUser(appTokenUser.getId(), appTokenUser.getName(), appTokenUser.getDepartments(), model);
|
||||
formReportRouteService.appUpdate(formCode, formVersion, httpSession, httpServletRequest, httpServletResponse, model);
|
||||
}
|
||||
|
||||
@ -170,7 +175,6 @@ public class OaFormReportRouteServiceImpl extends DefaultBaseService implements
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 设置会签
|
||||
*
|
||||
@ -211,12 +215,11 @@ public class OaFormReportRouteServiceImpl extends DefaultBaseService implements
|
||||
*
|
||||
* @param model
|
||||
*/
|
||||
private void setPageCurrentUser(Map<String, Object> model) {
|
||||
private void setPageCurrentUser(String userId, String userName, List<DepartmentSimpleDTO> departmentSimpleDTOS, Map<String, Object> model) {
|
||||
CurrentUserVO currentUserVO = new CurrentUserVO();
|
||||
UserInfoBO currentUser = securityComponent.getCurrentUser();
|
||||
currentUserVO.setUserId(currentUser.getUserId());
|
||||
currentUserVO.setUserName(currentUser.getUserName());
|
||||
currentUserVO.setDepartments(currentUser.getDepartments());
|
||||
currentUserVO.setUserId(userId);
|
||||
currentUserVO.setUserName(userName);
|
||||
currentUserVO.setDepartments(departmentSimpleDTOS);
|
||||
model.put("currentUser", JSONObject.toJSONString(currentUserVO));
|
||||
}
|
||||
|
||||
@ -225,12 +228,11 @@ public class OaFormReportRouteServiceImpl extends DefaultBaseService implements
|
||||
*
|
||||
* @param model
|
||||
*/
|
||||
private void setAppPageCurrentUser(String token, Map<String, Object> model) {
|
||||
AppTokenUser appTokenUser = getAppTokenUser(token);
|
||||
private void setAppPageCurrentUser(String userId, String userName, List<AppTokenUserDepartment> appTokenUserDepartments, Map<String, Object> model) {
|
||||
CurrentUserVO currentUserVO = new CurrentUserVO();
|
||||
currentUserVO.setUserId(appTokenUser.getId());
|
||||
currentUserVO.setUserName(appTokenUser.getName());
|
||||
currentUserVO.setDepartments(appTokenUser.getDepartments().stream().map(appTokenUserDepartment -> {
|
||||
currentUserVO.setUserId(userId);
|
||||
currentUserVO.setUserName(userName);
|
||||
currentUserVO.setDepartments(appTokenUserDepartments.stream().map(appTokenUserDepartment -> {
|
||||
DepartmentSimpleDTO departmentSimpleDTO = new DepartmentSimpleDTO();
|
||||
departmentSimpleDTO.setDepartmentId(appTokenUserDepartment.getDepartmentId());
|
||||
departmentSimpleDTO.setDepartmentName(appTokenUserDepartment.getDepartmentName());
|
||||
@ -245,7 +247,7 @@ public class OaFormReportRouteServiceImpl extends DefaultBaseService implements
|
||||
* @param processDefinitionId
|
||||
* @return
|
||||
*/
|
||||
private Map<String, Object> getSaveModel(String processDefinitionId) {
|
||||
private Map<String, Object> getSaveModel(String currentUserId, String processDefinitionId) {
|
||||
Map<String, Object> model = getHashMap(10);
|
||||
model.put("processDefinitionId", processDefinitionId);
|
||||
model.put("formType", FormTypeEnum.OA.getValue());
|
||||
@ -257,7 +259,7 @@ public class OaFormReportRouteServiceImpl extends DefaultBaseService implements
|
||||
LOG.debug("发起流程,查询第一个用户任务");
|
||||
UserTask firstUserTask = activitiModelService.getFirstUserTaskByProcessDefinitionId(processDefinitionId);
|
||||
LOG.debug("发起流程,查询第一个用户任务后直连用户任务列表");
|
||||
List<ConfirmAssigneeVO> confirmAssigneeVOs = listConfirmAssignee(deploymentId, firstUserTask);
|
||||
List<ConfirmAssigneeVO> confirmAssigneeVOs = listConfirmAssignee(currentUserId, deploymentId, firstUserTask);
|
||||
model.put("confirmAssignees", JSON.toJSONString(confirmAssigneeVOs));
|
||||
|
||||
setPageFields(deploymentId, firstUserTask, model);
|
||||
@ -268,11 +270,12 @@ public class OaFormReportRouteServiceImpl extends DefaultBaseService implements
|
||||
/**
|
||||
* 编辑页面Model
|
||||
*
|
||||
* @param currentUserId
|
||||
* @param taskId
|
||||
* @param isNeedClaim
|
||||
* @return
|
||||
*/
|
||||
private Map<String, Object> getUpdateModel(String taskId, Integer isNeedClaim) {
|
||||
private Map<String, Object> getUpdateModel(String currentUserId, String taskId, Integer isNeedClaim) {
|
||||
Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
|
||||
if (task == null) {
|
||||
throw new SearchException("任务不存在");
|
||||
@ -292,7 +295,7 @@ public class OaFormReportRouteServiceImpl extends DefaultBaseService implements
|
||||
model.put("processInstanceId", task.getProcessInstanceId());
|
||||
model.put("isNeedClaim", isNeedClaim);
|
||||
LOG.debug("查询下一个用户任务后直连用户任务列表");
|
||||
List<ConfirmAssigneeVO> confirmAssigneeVOs = listConfirmAssignee(deploymentId, currentUserTask);
|
||||
List<ConfirmAssigneeVO> confirmAssigneeVOs = listConfirmAssignee(currentUserId, deploymentId, currentUserTask);
|
||||
model.put("confirmAssignees", JSON.toJSONString(confirmAssigneeVOs));
|
||||
|
||||
setPageFields(deploymentId, currentUserTask, model);
|
||||
@ -394,7 +397,7 @@ public class OaFormReportRouteServiceImpl extends DefaultBaseService implements
|
||||
* @param currentUserTask
|
||||
* @return
|
||||
*/
|
||||
private List<ConfirmAssigneeVO> listConfirmAssignee(String deploymentId, UserTask currentUserTask) {
|
||||
private List<ConfirmAssigneeVO> listConfirmAssignee(String currentUserId, String deploymentId, UserTask currentUserTask) {
|
||||
LOG.debug("1.获取后续任务节点");
|
||||
List<UserTask> nextUserTasks = activitiModelService.listNextUserTasksByUserTask(currentUserTask);
|
||||
clearUserTask(nextUserTasks);
|
||||
@ -424,7 +427,7 @@ public class OaFormReportRouteServiceImpl extends DefaultBaseService implements
|
||||
// 设置节点类型
|
||||
confirmAssigneeVO.setNodeType(oaNodeAssigneePO.getNodeType());
|
||||
// 设置节点代理人列表
|
||||
List<String> assigneeList = nodeAssigneeService.listAssigneeUserId(securityComponent.getCurrentUser().getUserId(), oaNodeAssigneePO);
|
||||
List<String> assigneeList = nodeAssigneeService.listAssigneeUserId(currentUserId, oaNodeAssigneePO);
|
||||
List<UserDTO> userDTOs = userBaseService.listByUserIds(assigneeList);
|
||||
List<ConfirmAssigneeVO.AssigneeVO> assigneeVOs = userDTOs.stream().map(userDTO -> {
|
||||
ConfirmAssigneeVO.AssigneeVO assigneeVO = new ConfirmAssigneeVO.AssigneeVO();
|
||||
|
@ -86,7 +86,7 @@ public class OaFormReportServiceImpl extends DefaultBaseService implements IOaFo
|
||||
OaFormReportUnWantedValueBO oaFormReportUnWantedValueBO = getOaFormReportUnWantedValue(params);
|
||||
|
||||
LOG.debug("保存表单");
|
||||
String uid = formReportService.saveAndReturnId(formCode, formVersion, params);
|
||||
String uid = formReportService.saveByUserIdAndReturnId(userId, formCode, formVersion, params);
|
||||
LOG.debug("定义流程发起人");
|
||||
Map<String, Object> variables = getHashMap(2);
|
||||
variables.put(KEY_FORM_CODE, formCode);
|
||||
@ -157,14 +157,27 @@ public class OaFormReportServiceImpl extends DefaultBaseService implements IOaFo
|
||||
|
||||
@Override
|
||||
public void updateGoBack(String processInstanceId, String currentTaskId, String jumpNodeId, String reason) {
|
||||
UserInfoBO currentUser = securityComponent.getCurrentUser();
|
||||
String userId = currentUser.getUserId();
|
||||
String userName = currentUser.getUserName();
|
||||
updateGoBackByUserIdAndUserName(userId, userName, processInstanceId, currentTaskId, jumpNodeId, reason);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateGoBack(String token, String processInstanceId, String currentTaskId, String jumpNodeId, String reason) {
|
||||
AppTokenUser appTokenUser = getAppTokenUser(token);
|
||||
String userId = appTokenUser.getId();
|
||||
String userName = appTokenUser.getName();
|
||||
updateGoBackByUserIdAndUserName(userId, userName, processInstanceId, currentTaskId, jumpNodeId, reason);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateGoBackByUserIdAndUserName(String userId, String userName, String processInstanceId, String currentTaskId, String jumpNodeId, String reason) {
|
||||
LOG.debug("OA流程回退");
|
||||
Task currentTask = taskService.createTaskQuery().taskId(currentTaskId).singleResult();
|
||||
if (currentTask == null) {
|
||||
throw new SearchException("任务不存在或已被处理");
|
||||
}
|
||||
UserInfoBO currentUser = securityComponent.getCurrentUser();
|
||||
String userId = currentUser.getUserId();
|
||||
String userName = currentUser.getUserName();
|
||||
|
||||
List<HistoricTaskInstance> historicTaskInstances = historyService.createHistoricTaskInstanceQuery().processInstanceId(processInstanceId).list();
|
||||
BpmnModel bpmnModel = activitiModelService.getBpmnModelByProcessDefinitionId(currentTask.getProcessDefinitionId());
|
||||
@ -266,14 +279,27 @@ public class OaFormReportServiceImpl extends DefaultBaseService implements IOaFo
|
||||
|
||||
@Override
|
||||
public void updateForcedEnd(String processInstanceId, String currentTaskId, String reason) {
|
||||
UserInfoBO currentUser = securityComponent.getCurrentUser();
|
||||
String userId = currentUser.getUserId();
|
||||
String userName = currentUser.getUserName();
|
||||
updateForcedEndByUserIdAndUserName(userId, userName, processInstanceId, currentTaskId, reason);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateForcedEnd(String token, String processInstanceId, String currentTaskId, String reason) {
|
||||
AppTokenUser appTokenUser = getAppTokenUser(token);
|
||||
String userId = appTokenUser.getId();
|
||||
String userName = appTokenUser.getName();
|
||||
updateForcedEndByUserIdAndUserName(userId, userName, processInstanceId, currentTaskId, reason);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateForcedEndByUserIdAndUserName(String userId, String userName, String processInstanceId, String currentTaskId, String reason) {
|
||||
LOG.debug("OA强制结束");
|
||||
Task currentTask = taskService.createTaskQuery().taskId(currentTaskId).singleResult();
|
||||
if (currentTask == null) {
|
||||
throw new SearchException("任务不存在或已被处理");
|
||||
}
|
||||
UserInfoBO currentUser = securityComponent.getCurrentUser();
|
||||
String userId = currentUser.getUserId();
|
||||
String userName = currentUser.getUserName();
|
||||
|
||||
List<HistoricTaskInstance> historicTaskInstances = historyService.createHistoricTaskInstanceQuery().processInstanceId(processInstanceId).unfinished().list();
|
||||
BpmnModel bpmnModel = activitiModelService.getBpmnModelByProcessDefinitionId(currentTask.getProcessDefinitionId());
|
||||
@ -286,7 +312,7 @@ public class OaFormReportServiceImpl extends DefaultBaseService implements IOaFo
|
||||
List<SequenceFlow> outgoingFlows = currentUserTask.getOutgoingFlows();
|
||||
LOG.debug("4. 缓存原始输出流");
|
||||
List<SequenceFlow> oldOutgoingFlows = new ArrayList<>();
|
||||
oldOutgoingFlows.addAll(currentUserTask.getOutgoingFlows());
|
||||
oldOutgoingFlows.addAll(outgoingFlows);
|
||||
LOG.debug("5. 创建新序列流");
|
||||
currentUserTask.getOutgoingFlows().clear();
|
||||
List<SequenceFlow> newOutgoingFlows = new ArrayList<>();
|
||||
@ -344,7 +370,19 @@ public class OaFormReportServiceImpl extends DefaultBaseService implements IOaFo
|
||||
UserInfoBO currentUser = securityComponent.getCurrentUser();
|
||||
String userId = currentUser.getUserId();
|
||||
String userName = currentUser.getUserName();
|
||||
updateTaskAssigneeByUserIdAndUserName(userId, userName, processInstanceId, taskId, updateTaskAssigneeVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTaskAssignee(String token, String processInstanceId, String taskId, UpdateTaskAssigneeVO updateTaskAssigneeVO) {
|
||||
AppTokenUser appTokenUser = getAppTokenUser(token);
|
||||
String userId = appTokenUser.getId();
|
||||
String userName = appTokenUser.getName();
|
||||
updateTaskAssigneeByUserIdAndUserName(userId, userName, processInstanceId, taskId, updateTaskAssigneeVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTaskAssigneeByUserIdAndUserName(String userId, String userName, String processInstanceId, String taskId, UpdateTaskAssigneeVO updateTaskAssigneeVO) {
|
||||
taskService.setAssignee(taskId, updateTaskAssigneeVO.getAssignee());
|
||||
|
||||
TaskCommentBO taskCommentBO = new TaskCommentBO();
|
||||
|
@ -81,7 +81,6 @@ public class FormReportServiceImpl extends DefaultBaseService implements IFormRe
|
||||
// 设置主标题,并更新到params,保存到流程中
|
||||
inserts.add(IFormDesignService.FIELD_MAIN_TITLE);
|
||||
String mainTitle = getMainTitleCode(formPO.getMainTitleTpl(), params);
|
||||
params.put(IFormDesignService.FIELD_MAIN_TITLE, mainTitle);
|
||||
values.add(mainTitle);
|
||||
|
||||
for (Map.Entry<String, Object> kv : params.entrySet()) {
|
||||
@ -105,6 +104,8 @@ public class FormReportServiceImpl extends DefaultBaseService implements IFormRe
|
||||
insertParams.put(IFormDesignService.PARAM_FORM_VERSION, formVersion);
|
||||
insertParams.put(IFormDesignService.PARAM_INSERTS, inserts);
|
||||
insertParams.put(IFormDesignService.PARAM_VALUES, values);
|
||||
params.put(IFormDesignService.FIELD_MAIN_TITLE, mainTitle);
|
||||
|
||||
formReportDao.save(insertParams);
|
||||
return uid;
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
}
|
||||
.layui-form-item {
|
||||
margin-bottom: 0px;
|
||||
padding: 15px 0;
|
||||
padding: 0;
|
||||
clear: both;
|
||||
border-top: 1px;
|
||||
border-left: 0;
|
||||
@ -237,3 +237,45 @@
|
||||
text-align: center;
|
||||
background-color: #FFF;
|
||||
}
|
||||
|
||||
#appSubmitFormBtns {
|
||||
display: none;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: rgba(0, 0, 0, 0.3);
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
#appSubmitFormBtnsContainer {
|
||||
position: absolute;
|
||||
bottom: -160px;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
max-height: 160px;
|
||||
background-color: white;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
#appFormBtns {
|
||||
display: none;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
right: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: rgba(0, 0, 0, 0.3);
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
#appFormBtnsContainer {
|
||||
position: absolute;
|
||||
bottom: -160px;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
max-height: 160px;
|
||||
background-color: white;
|
||||
overflow: auto;
|
||||
}
|
@ -9,6 +9,17 @@
|
||||
border-bottom: 1px solid #f1f1f1;
|
||||
}
|
||||
|
||||
.oa-form-footer-tool-bar {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
padding: 15px 0;
|
||||
z-index: 100;
|
||||
background-color: #FFF;
|
||||
border-bottom: 1px solid #f1f1f1;
|
||||
}
|
||||
|
||||
.layui-card {
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
@ -30,6 +41,17 @@
|
||||
padding: 0 15px;
|
||||
}
|
||||
|
||||
.oa-form-footer-tool-bar .tool-bar-left {
|
||||
min-height: 30px;
|
||||
padding: 0 15px;
|
||||
}
|
||||
|
||||
.oa-form-footer-tool-bar .tool-bar-right {
|
||||
min-height: 30px;
|
||||
text-align: right;
|
||||
padding: 0 15px;
|
||||
}
|
||||
|
||||
#runtimeProcessImageBox {
|
||||
position: relative;
|
||||
}
|
||||
@ -69,11 +91,18 @@
|
||||
}
|
||||
|
||||
#submitFormBtnsContainer {
|
||||
position: relative;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: -180px;
|
||||
left: 0;
|
||||
width: 180px;
|
||||
height: 100%;
|
||||
background-color: white;
|
||||
overflow: auto;
|
||||
animation-name: slideLeftBtnsIn;
|
||||
animation-duration: 300ms;
|
||||
}
|
||||
|
||||
@keyframes slideLeftBtnsIn {
|
||||
from {left: -180px}
|
||||
to {left: 0px}
|
||||
}
|
@ -243,22 +243,21 @@ function OaFormUtil(layui) {
|
||||
/**
|
||||
* 初始化提交按钮
|
||||
* @param confirmAssignees
|
||||
* @param opt
|
||||
*/
|
||||
this.initSubmitBtns = function (confirmAssignees) {
|
||||
this.initSubmitBtns = function (confirmAssignees, opt) {
|
||||
var btnColor = ['', 'layui-btn-normal', 'layui-btn-warm'];
|
||||
if(confirmAssignees.length < 3) {
|
||||
var btns = '';
|
||||
for (var i = 0, item; item = confirmAssignees[i++];) {
|
||||
btns += '<button type="button" id="submitFormBtn' + i + '" class="layui-btn layui-btn-sm ' + btnColor[(i - 1) % 3] + ' confirm-btn" lay-submit lay-filter="submit' + i + '" data-select-type="' + item.nodeType + '" data-index="' + (i - 1) + '" data-next-end-event="' + item.nextEndEvent + '" data-btn-exc="' + item.btnExc + '">' + item.btnText + '</button>'
|
||||
}
|
||||
$('#submitBtnGroup').append(btns);
|
||||
} else {
|
||||
$('#submitBtnGroup').append('<button type="button" id="showSubmitFormBtns" class="layui-btn layui-btn-primary layui-btn-xs"><i class="fa fa-list-ul" aria-hidden="true"></i> 提交</button>');
|
||||
var isApp = opt && opt.isApp ? opt.isApp : false;
|
||||
if(isApp) {
|
||||
var appButtonCount = 0;
|
||||
|
||||
var html = '<div id="submitFormBtns">';
|
||||
html += '<div id="submitFormBtnsContainer">';
|
||||
html += '<div class="layui-btn-container" style="padding: 10px;">'
|
||||
$('#submitBtnGroup').append('<button type="button" id="appShowSubmitFormBtns" class="layui-btn layui-btn-primary layui-btn-xs"><i class="fa fa-list-ul" aria-hidden="true"></i> 提交</button>');
|
||||
|
||||
var html = '<div id="appSubmitFormBtns">';
|
||||
html += '<div id="appSubmitFormBtnsContainer">';
|
||||
html += '<div class="layui-btn-container" style="padding: 10px;">';
|
||||
for (var i = 0, item; item = confirmAssignees[i++];) {
|
||||
appButtonCount++;
|
||||
html += '<button type="button" id="submitFormBtn' + i + '" class="layui-col-xs12 layui-btn layui-btn-sm ' + btnColor[(i - 1) % 3] + ' confirm-btn" lay-submit lay-filter="submit' + i + '" data-select-type="' + item.nodeType + '" data-index="' + (i - 1) + '" data-next-end-event="' + item.nextEndEvent + '" data-btn-exc="' + item.btnExc + '">' + item.btnText + '</button>'
|
||||
}
|
||||
html += '</div>';
|
||||
@ -267,19 +266,56 @@ function OaFormUtil(layui) {
|
||||
|
||||
$('#submitBtnGroup').append(html)
|
||||
|
||||
$(document).on('click', '#submitFormBtns', function() {
|
||||
var maxHeight = appButtonCount * 30 + (appButtonCount + 1) * 10;
|
||||
maxHeight = maxHeight > 160 ? 160 : maxHeight;
|
||||
|
||||
$(document).on('click', '#appSubmitFormBtns', function() {
|
||||
$(this).hide();
|
||||
$('#submitFormBtnsContainer').css('left', '-180px');
|
||||
$('#appSubmitFormBtnsContainer').css('bottom', (-1 * maxHeight +'px'));
|
||||
})
|
||||
|
||||
$(document).on('click', '#submitFormBtnsContainer', function(e) {
|
||||
$(document).on('click', '#appSubmitFormBtnsContainer', function(e) {
|
||||
e.stopPropagation()
|
||||
})
|
||||
|
||||
$(document).on('click', '#showSubmitFormBtns', function() {
|
||||
$('#submitFormBtns').show();
|
||||
$('#submitFormBtnsContainer').animate({left: '0'}, 300);
|
||||
$(document).on('click', '#appShowSubmitFormBtns', function() {
|
||||
$('#appSubmitFormBtns').show();
|
||||
$('#appSubmitFormBtnsContainer').animate({bottom: 0}, 200);
|
||||
})
|
||||
} else {
|
||||
if(confirmAssignees.length < 4) {
|
||||
var btns = '';
|
||||
for (var i = 0, item; item = confirmAssignees[i++];) {
|
||||
btns += '<button type="button" id="submitFormBtn' + i + '" class="layui-btn layui-btn-sm ' + btnColor[(i - 1) % 3] + ' confirm-btn" lay-submit lay-filter="submit' + i + '" data-select-type="' + item.nodeType + '" data-index="' + (i - 1) + '" data-next-end-event="' + item.nextEndEvent + '" data-btn-exc="' + item.btnExc + '">' + item.btnText + '</button>'
|
||||
}
|
||||
$('#submitBtnGroup').append(btns);
|
||||
} else {
|
||||
$('#submitBtnGroup').append('<button type="button" id="showSubmitFormBtns" class="layui-btn layui-btn-primary layui-btn-xs"><i class="fa fa-list-ul" aria-hidden="true"></i> 提交</button>');
|
||||
|
||||
var html = '<div id="submitFormBtns">';
|
||||
html += '<div id="submitFormBtnsContainer">';
|
||||
html += '<div class="layui-btn-container" style="padding: 10px;">'
|
||||
for (var i = 0, item; item = confirmAssignees[i++];) {
|
||||
html += '<button type="button" id="submitFormBtn' + i + '" class="layui-col-xs12 layui-btn layui-btn-sm ' + btnColor[(i - 1) % 3] + ' confirm-btn" lay-submit lay-filter="submit' + i + '" data-select-type="' + item.nodeType + '" data-index="' + (i - 1) + '" data-next-end-event="' + item.nextEndEvent + '" data-btn-exc="' + item.btnExc + '">' + item.btnText + '</button>'
|
||||
}
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
|
||||
$('#submitBtnGroup').append(html)
|
||||
|
||||
$(document).on('click', '#submitFormBtns', function() {
|
||||
$(this).hide();
|
||||
})
|
||||
|
||||
$(document).on('click', '#submitFormBtnsContainer', function(e) {
|
||||
e.stopPropagation()
|
||||
})
|
||||
|
||||
$(document).on('click', '#showSubmitFormBtns', function() {
|
||||
$('#submitFormBtns').show();
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -371,29 +407,65 @@ function OaFormUtil(layui) {
|
||||
var formVersion = opt.formVersion;
|
||||
var uid = opt.uid;
|
||||
var onPreview = typeof (opt.onPreview) === 'function' ? opt.onPreview : null;
|
||||
var appButtonCount = 0;
|
||||
|
||||
function initButton() {
|
||||
var buttons = '';
|
||||
buttons += '<div class="layui-btn-group">'
|
||||
if(formButton.btnPrint) {
|
||||
buttons += '<button id="printBtn" type="button" class="layui-btn layui-btn-xs layui-btn-primary confirm-btn">打印</button>';
|
||||
|
||||
if(isApp) {
|
||||
buttons += '<button type="button" id="appShowFormBtns" class="layui-btn layui-btn-primary layui-btn-xs"><i class="fa fa-list-ul" aria-hidden="true"></i> 操作</button>'
|
||||
buttons += '<div id="appFormBtns">';
|
||||
buttons += '<div id="appFormBtnsContainer">';
|
||||
buttons += '<div class="layui-btn-container" style="padding: 10px;">'
|
||||
if(formButton.btnPrint) {
|
||||
buttons += '<button id="printBtn" type="button" class="layui-col-xs12 layui-btn layui-btn-xs layui-btn-primary confirm-btn">打印</button>';
|
||||
appButtonCount++;
|
||||
}
|
||||
if (formButton.btnGoBack) {
|
||||
buttons += '<button id="goBackBtn" type="button" class="layui-col-xs12 layui-btn layui-btn-xs layui-btn-warm confirm-btn">回退</button>';
|
||||
appButtonCount++;
|
||||
}
|
||||
if(formButton.btnForcedEnd) {
|
||||
buttons += '<button id="forcedEndBtn" type="button" class="layui-col-xs12 layui-btn layui-btn-xs layui-btn-danger confirm-btn">强制结束</button>';
|
||||
appButtonCount++;
|
||||
}
|
||||
if(formButton.btnCc) {
|
||||
buttons += '<button id="ccBtn" type="button" class="layui-col-xs12 layui-btn layui-btn-xs layui-btn-normal confirm-btn">抄送</button>';
|
||||
appButtonCount++;
|
||||
}
|
||||
if(formButton.btnTransfer) {
|
||||
buttons += '<button id="transferBtn" type="button" class="layui-col-xs12 layui-btn layui-btn-xs layui-btn-primary confirm-btn">转交</button>';
|
||||
appButtonCount++;
|
||||
}
|
||||
if (formButton.btnAttachment) {
|
||||
buttons += '<button id="attachmentBtn" type="button" class="layui-col-xs12 layui-btn layui-btn-xs layui-btn-default confirm-btn">上传附件</button>';
|
||||
appButtonCount++;
|
||||
}
|
||||
buttons += '</div>';
|
||||
buttons += '</div>';
|
||||
buttons += '</div>';
|
||||
} else {
|
||||
buttons += '<div class="layui-btn-group">'
|
||||
if(formButton.btnPrint) {
|
||||
buttons += '<button id="printBtn" type="button" class="layui-btn layui-btn-xs layui-btn-primary confirm-btn">打印</button>';
|
||||
}
|
||||
if (formButton.btnGoBack) {
|
||||
buttons += '<button id="goBackBtn" type="button" class="layui-btn layui-btn-xs layui-btn-warm confirm-btn">回退</button>';
|
||||
}
|
||||
if(formButton.btnForcedEnd) {
|
||||
buttons += '<button id="forcedEndBtn" type="button" class="layui-btn layui-btn-xs layui-btn-danger confirm-btn">强制结束</button>';
|
||||
}
|
||||
if(formButton.btnCc) {
|
||||
buttons += '<button id="ccBtn" type="button" class="layui-btn layui-btn-xs layui-btn-normal confirm-btn">抄送</button>';
|
||||
}
|
||||
if(formButton.btnTransfer) {
|
||||
buttons += '<button id="transferBtn" type="button" class="layui-btn layui-btn-xs layui-btn-primary confirm-btn">转交</button>';
|
||||
}
|
||||
if (formButton.btnAttachment) {
|
||||
buttons += '<button id="attachmentBtn" type="button" class="layui-btn layui-btn-xs layui-btn-default confirm-btn">上传附件</button>';
|
||||
}
|
||||
buttons += '</div>';
|
||||
}
|
||||
if (formButton.btnGoBack) {
|
||||
buttons += '<button id="goBackBtn" type="button" class="layui-btn layui-btn-xs layui-btn-warm confirm-btn">回退</button>';
|
||||
}
|
||||
if(formButton.btnForcedEnd) {
|
||||
buttons += '<button id="forcedEndBtn" type="button" class="layui-btn layui-btn-xs layui-btn-danger confirm-btn">强制结束</button>';
|
||||
}
|
||||
if(formButton.btnCc) {
|
||||
buttons += '<button id="ccBtn" type="button" class="layui-btn layui-btn-xs layui-btn-normal confirm-btn">抄送</button>';
|
||||
}
|
||||
if(formButton.btnTransfer) {
|
||||
buttons += '<button id="transferBtn" type="button" class="layui-btn layui-btn-xs layui-btn-primary confirm-btn">转交</button>';
|
||||
}
|
||||
if (formButton.btnAttachment) {
|
||||
buttons += '<button id="attachmentBtn" type="button" class="layui-btn layui-btn-xs layui-btn-default confirm-btn">上传附件</button>';
|
||||
}
|
||||
buttons += '</div>';
|
||||
buttons += '<div class="layui-btn-group">';
|
||||
buttons += '<button id="showAttachmentBtn" type="button" class="layui-btn layui-btn-xs layui-btn-primary" title="附件列表"><i class="fa fa-list-ul" aria-hidden="true"></i></button>';
|
||||
buttons += '<input type="hidden" name="attachments" id="attachments"/>';
|
||||
@ -403,6 +475,24 @@ function OaFormUtil(layui) {
|
||||
}
|
||||
|
||||
function addClick() {
|
||||
if(isApp) {
|
||||
var maxHeight = appButtonCount * 30 + (appButtonCount + 1) * 10;
|
||||
maxHeight = maxHeight > 160 ? 160 : maxHeight;
|
||||
$(document).on('click', '#appFormBtns', function() {
|
||||
$(this).hide();
|
||||
$('#appFormBtnsContainer').css('bottom', (-1 * maxHeight +'px'));
|
||||
})
|
||||
|
||||
$(document).on('click', '#appFormBtnsContainer', function(e) {
|
||||
e.stopPropagation()
|
||||
})
|
||||
|
||||
$(document).on('click', '#appShowFormBtns', function() {
|
||||
$('#appFormBtns').show();
|
||||
$('#appFormBtnsContainer').animate({bottom: 0}, 200);
|
||||
})
|
||||
}
|
||||
|
||||
if (formButton.btnAttachment) {
|
||||
var layerLoadingIndex;
|
||||
var url = 'api/file/v2/upload-file';
|
||||
@ -465,7 +555,7 @@ function OaFormUtil(layui) {
|
||||
' <table class="layui-table" lay-size="sm">',
|
||||
' <colgroup>',
|
||||
' <col>',
|
||||
onPreview && formButton.btnAttachment ? '<col width="100">' : '<col width="60">',
|
||||
onPreview && formButton.btnAttachment ? '<col width="120">' : '<col width="60">',
|
||||
' </colgroup>',
|
||||
' <thead>',
|
||||
' <tr>',
|
||||
@ -500,11 +590,21 @@ function OaFormUtil(layui) {
|
||||
' </table>',
|
||||
'</div>'
|
||||
].join('');
|
||||
|
||||
var area;
|
||||
var offset;
|
||||
if(isApp) {
|
||||
area = ['100%', '400px'];
|
||||
offset = 'b';
|
||||
} else {
|
||||
area = ['400px', '100%'];
|
||||
offset = 'r';
|
||||
}
|
||||
layer.open({
|
||||
type: 1,
|
||||
title: false,
|
||||
area: ['400px', '100%'],
|
||||
offset: 'r',
|
||||
area: area,
|
||||
offset: offset,
|
||||
anim: 2,
|
||||
isOutAnim: false,
|
||||
closeBtn: 0,
|
||||
|
@ -222,9 +222,18 @@ function OaUserSelect(layui, opt) {
|
||||
Methods.refreshSelectedUser();
|
||||
return;
|
||||
}
|
||||
top.restAjax.post(top.restAjax.path('api/user/listbyids', []), {
|
||||
var url;
|
||||
if(isApp) {
|
||||
url = 'app/user/list/ids';
|
||||
} else {
|
||||
url = 'api/user/listbyids';
|
||||
}
|
||||
console.log(headers);
|
||||
restAjax.post(restAjax.path(url, []), {
|
||||
ids: selectedUserIdArray
|
||||
}, null, function(code, data) {
|
||||
}, {
|
||||
headers: headers
|
||||
}, function(code, data) {
|
||||
for(var i = 0, item; item = data[i++];) {
|
||||
var user = {
|
||||
userId: item.userId,
|
||||
@ -246,7 +255,16 @@ function OaUserSelect(layui, opt) {
|
||||
// 初始化部门与部门用户
|
||||
initDepartmentAndUser: function(parentDepartmentId) {
|
||||
var loadLayerIndex;
|
||||
top.restAjax.get(top.restAjax.path('api/department/user/get-department-contain-user-and-sub/department-id/{departmentId}', [parentDepartmentId]), {}, null, function(code, data) {
|
||||
var url;
|
||||
if(isApp) {
|
||||
url = 'app/department/user/get-department-contain-user-and-sub/department-id/{departmentId}';
|
||||
} else {
|
||||
url = 'api/department/user/get-department-contain-user-and-sub/department-id/{departmentId}';
|
||||
}
|
||||
console.log(headers);
|
||||
restAjax.get(restAjax.path(url, [parentDepartmentId]), {}, {
|
||||
headers: headers
|
||||
}, function(code, data) {
|
||||
Properties.selectedDepartmentArray.push({
|
||||
departmentId: data.departmentId,
|
||||
departmentName: data.departmentName,
|
||||
|
@ -13,21 +13,26 @@
|
||||
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
|
||||
<link rel="stylesheet" type="text/css" href="assets/js/vendor/viewer/viewer.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="static/form/css/form-app.css?v=1">
|
||||
<script src="static/form/js/rem.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="static/form/css/oa-user-select.css?v=1">
|
||||
<link rel="stylesheet" type="text/css" href="static/form/css/oa-form.css?v=1">
|
||||
</head>
|
||||
<body>
|
||||
<div class="layui-anim layui-anim-fadein">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body" style="padding: 15px;">
|
||||
<form class="layui-form layui-form-pane" lay-filter="dataForm">
|
||||
<#list fields as field>
|
||||
${field.html}
|
||||
</#list>
|
||||
<div class="layui-layout-admin">
|
||||
<div class="layui-footer form-report-foot">
|
||||
<div class="layui-row oa-form-footer-tool-bar">
|
||||
<div class="layui-col-xs7 tool-bar-left layui-layout-admin">
|
||||
<div id="submitBtnGroup" class="layui-btn-group"></div>
|
||||
<button type="button" class="layui-btn layui-btn-sm layui-btn-primary close">返回</button>
|
||||
</div>
|
||||
<div class="layui-col-xs5 tool-bar-right">
|
||||
<div id="formButtonGroup"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="reportForm" class="save-report-form">
|
||||
<#list fields as field>
|
||||
${field.html}
|
||||
</#list>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@ -37,6 +42,8 @@
|
||||
<input type="hidden" id="formVersion" value="${r'${formVersion}'}">
|
||||
</div>
|
||||
<script src="static/form/js/form-util.js?v=1"></script>
|
||||
<script src="static/form/js/oa-user-select.js?v=1"></script>
|
||||
<script src="static/form/js/oa-form-util.js?v=1"></script>
|
||||
<script src="assets/js/vendor/viewer/viewer.min.js"></script>
|
||||
<script src="assets/layuiadmin/layui/layui.js"></script>
|
||||
<script>
|
||||
@ -53,21 +60,18 @@
|
||||
var queryParams = restAjax.params(window.location.href);
|
||||
var token = queryParams.token;
|
||||
var formUtil = new FormUtil(layui, Viewer);
|
||||
var oaFormUtil = new OaFormUtil(layui);
|
||||
// 调试可先设置为空对象
|
||||
var confirmAssignees = ${r"${confirmAssignees}"};
|
||||
var fields = ${r"${fields}"};
|
||||
|
||||
function initSubmitBtns() {
|
||||
var btnColor = ['', 'layui-btn-normal', 'layui-btn-warm'];
|
||||
var btns = '';
|
||||
for(var i = 0, item; item = confirmAssignees[i++];) {
|
||||
btns += '<button type="button" id="submitFormBtn'+ i +'" class="layui-btn layui-btn-sm '+ btnColor[(i - 1) % 3] +' confirm-btn" lay-submit lay-filter="submit'+ i +'" data-select-type="'+ item.nodeType +'" data-index="'+ (i - 1) +'" data-next-end-event="'+ item.nextEndEvent +'" data-btn-exc="'+ item.btnExc +'">'+ item.btnText +'</button>'
|
||||
}
|
||||
$('#submitBtnGroup').append(btns);
|
||||
}
|
||||
var formButton = ${r"${formButton}"};
|
||||
var currentUser = ${r"${currentUser}"};
|
||||
|
||||
// 初始化
|
||||
function initData() {
|
||||
oaFormUtil.initSubmitBtns(confirmAssignees, {isApp: true});
|
||||
oaFormUtil.initFormButtons(formButton, {isApp:false, headers: {token: token}});
|
||||
|
||||
<#list fields as field>
|
||||
<#if field.data.tag == 'uploadImage'>
|
||||
formUtil.initAppUploadImage('${field.data.id}', ${field.data.count}, {token: token});
|
||||
@ -88,16 +92,20 @@
|
||||
});
|
||||
</#if>
|
||||
</#list>
|
||||
initSubmitBtns();
|
||||
formUtil.hideFields(fields);
|
||||
formUtil.disableFields(fields);
|
||||
oaFormUtil.backFillFields(fields, currentUser);
|
||||
oaFormUtil.hideFields(fields);
|
||||
oaFormUtil.disableFields(fields);
|
||||
}
|
||||
initData();
|
||||
|
||||
function close() {
|
||||
window.android.invokeNative('back');
|
||||
}
|
||||
|
||||
// 关闭页面
|
||||
$('.close').on('click', function () {
|
||||
// 这里写返回按钮的逻辑,默认是关闭',
|
||||
parent.layer.close(parent.layer.getFrameIndex(window.name));
|
||||
close();
|
||||
});
|
||||
|
||||
// 初始化按钮
|
||||
@ -108,6 +116,8 @@
|
||||
|
||||
// 提交前处理
|
||||
formUtil.clearUploadField(formData);
|
||||
oaFormUtil.setEditHistoryFields(formData, fields);
|
||||
oaFormUtil.setCcs(formData);
|
||||
|
||||
var loadLayerIndex;
|
||||
restAjax.post(restAjax.path('app/oa-form-report/save/definition-id/{processDefinitionId}/code/{formCode}/version/{formVersion}', [
|
||||
@ -119,8 +129,10 @@
|
||||
token: token
|
||||
}
|
||||
}, function (code, data) {
|
||||
layer.msg('提交成功');
|
||||
// 这里手动添加操作成功后的操作',
|
||||
layer.msg('提交成功', {time: 1000}, function() {
|
||||
close();
|
||||
});
|
||||
}, function (code, data) {
|
||||
$('.confirm-btn').show();
|
||||
layer.msg(data.msg);
|
||||
@ -164,6 +176,9 @@
|
||||
users: confirmAssignees[index].assignees,
|
||||
selectedUserIds: [],
|
||||
onConfirm: function(selectedUsers) {
|
||||
if(!selectedUsers) {
|
||||
return;
|
||||
}
|
||||
var assignees = [];
|
||||
for(var j = 0, jItem; jItem = selectedUsers[j++];) {
|
||||
assignees.push(jItem.userId);
|
||||
|
Loading…
Reference in New Issue
Block a user