6 Commits
Author SHA1 Message Date
c-chenxs1 2ebc204803 feat: 职工慰问 整改 优化2 2026-10-09 20:59:26 +08:00
c-chenxs1 5f064b076c feat: 职工慰问 整改 优化 2026-10-09 20:45:33 +08:00
c-chenxs1 783e751560 feat: 职工慰问 整改 2026-10-09 20:19:41 +08:00
c-chenxs1 b325e8a8f5 feat: 职工慰问 2026-10-09 19:39:26 +08:00
c-chenxs1 45121f7b2e feat: 困难帮扶 优化 2026-10-09 17:30:07 +08:00
c-chenxs1 7d76ae4e36 feat: 困难帮扶 整改 2026-10-09 17:14:31 +08:00
67 changed files with 96994 additions and 356 deletions
+2
View File
@@ -2,6 +2,8 @@
**/node_modules/
**/dist/
**/build/
!src/main/resources/static/assets/platform/plugins/pdfJs/build/
!src/main/resources/static/assets/platform/plugins/pdfJs/build/**
**/target/
**/out/
**/.next/
@@ -19,6 +19,7 @@ RoleConstant {
SCHOOL_UNION_ADMIN("校工会管理员"),
SCHOOL_UNION_CHAIRMAN("校工会主席"),
SCHOOL_UNION_VICE_CHAIRMAN("校工会副主席"),
SCHOOL_OFFICE_DIRECTOR("校工会办公室主任"),
SCHOOL_UNION_WELFARE_ADMIN("校工会福利管理员"),
SCHOOL_UNION_MEMBER_ADMIN("校工会会员管理员"),
SCHOOL_UNION_TC_ADMIN("校工会教代会管理员"),
@@ -50,7 +51,7 @@ RoleConstant {
BRANCH_UNION_WENTI_SPORTS("分工会文体福利委员"),
UNIT_PARTY_SECRETARY("单位党委书记"),
UNIT_SCHOOL_LEADER("分管校领导"),
UNIT_SCHOOL_LEADER("单位分管校领导"),
TEACHER_CONGRESS_DELEGATE_FORMAL("教代会正式代表"),
TEACHER_CONGRESS_DELEGATE_ATTENDANCE("教代会列席代表"),
@@ -31,6 +31,20 @@ public class SysOfficeTemplateUtil {
@Inject
private Dao dao;
public String getTemplateFileName(String templateCode) {
Sys_office_template officeTemplate = dao.fetch(Sys_office_template.class, Cnd.where(Sys_office_template::getTemplateCode, "=", templateCode));
if (ObjectUtil.isNull(officeTemplate)) {
throw new BaseException("代码为:{}的模板不存在", templateCode);
}
String templatePath = officeTemplate.getTemplatePath();
String id = templatePath.substring(templatePath.indexOf("id=") + "id=".length());
Sys_file sysFile = dao.fetch(Sys_file.class, id);
if (ObjectUtil.isEmpty(sysFile)) {
throw new BaseException("模板文件不存在");
}
return sysFile.getName();
}
/**
* 获取模板文件输入流
*
@@ -21,6 +21,7 @@ import com.budwk.app.flow.vo.HighLightVO;
import com.budwk.app.flow.vo.ProcessInstanceVO;
import com.budwk.app.flow.vo.ProcessTaskVO;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.zhgh.staffbenefit.difficulthelp.models.DifficultHelpInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.nutz.aop.interceptor.ioc.TransAop;
@@ -251,6 +252,15 @@ public class FlowCommonController {
public Result revokeTask(@Param("taskId") Long taskId) {
// 自己任务
ProcessTask selfTask = dao.fetch(ProcessTask.class, taskId);
if ("startTask".equals(selfTask.getTaskName())) {
ProcessInstance instance = dao.fetch(ProcessInstance.class, selfTask.getProcessInstanceId());
if (instance != null && StrUtil.isNotBlank(instance.getBusinessNo())) {
DifficultHelpInfo helpInfo = dao.fetch(DifficultHelpInfo.class, instance.getBusinessNo());
if (helpInfo != null && !SecurityUtil.getUserId().equals(helpInfo.getCreatedBy())) {
return Result.error("只能撤回自己创建的困难帮扶申请");
}
}
}
selfTask.setTaskState(ProcessTaskStateEnum.DOING.getCode());
// 撤销任务
@@ -0,0 +1,67 @@
package com.budwk.app.flow.handler;
import cn.hutool.core.util.StrUtil;
import com.budwk.app.base.constant.RoleConstant;
import com.budwk.app.base.exception.BaseException;
import com.budwk.app.flow.engine.AssignmentHandler;
import com.budwk.app.flow.engine.core.Execution;
import com.budwk.app.flow.engine.core.ServiceContext;
import com.budwk.app.flow.engine.model.TaskModel;
import com.budwk.app.sys.models.Sys_role;
import com.budwk.app.sys.models.Sys_user_role;
import com.budwk.app.sys.services.SysRoleService;
import com.budwk.app.zhgh.staffbenefit.condolence.model.Condolence;
import com.budwk.app.zhgh.staffbenefit.difficulthelp.models.DifficultHelpInfo;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.lang.Lang;
import java.util.List;
public class FlowRecipientUnitSchoolLeaderHandler implements AssignmentHandler {
@Override
public List<String> assign(TaskModel model, Execution execution) {
Dao dao = ServiceContext.find(Dao.class);
String businessNo = execution.getProcessInstance().getBusinessNo();
if (StrUtil.isBlank(businessNo)) {
throw new BaseException("申请记录编号不能为空。");
}
String processName = execution.getProcessModel().getName();
String unitId;
if ("KNBF".equals(processName)) {
DifficultHelpInfo difficultHelpInfo = dao.fetch(DifficultHelpInfo.class, businessNo);
if (difficultHelpInfo == null) {
throw new BaseException("未找到申请记录。");
}
unitId = difficultHelpInfo.getUnitId();
} else if ("ZGWW".equals(processName)) {
Condolence condolence = dao.fetch(Condolence.class, businessNo);
if (condolence == null) {
throw new BaseException("未找到申请记录。");
}
unitId = condolence.getHelpUnitId();
} else {
throw new BaseException("当前流程不支持获取受助人所在单位分管校领导。");
}
if (StrUtil.isBlank(unitId)) {
throw new BaseException("受助人所在单位不能为空。");
}
SysRoleService sysRoleService = ServiceContext.find(SysRoleService.class);
Sys_role role = sysRoleService.getByCode(RoleConstant.UNIT_SCHOOL_LEADER);
List<Sys_user_role> roles = dao.query(
Sys_user_role.class,
Cnd.where(Sys_user_role::getRoleId, "=", role.getId())
.and(Sys_user_role::getUnitId, "=", unitId)
);
if (Lang.isEmpty(roles)) {
throw new BaseException("受助人/申请人所在单位未设置单位分管校领导,请联系校工会进行设置。");
}
return roles.stream().map(Sys_user_role::getUserId).distinct().toList();
}
@Override
public String getMessage() {
return "获取受助人所在单位分管校领导";
}
}
@@ -0,0 +1,44 @@
package com.budwk.app.flow.handler;
import com.budwk.app.base.constant.RoleConstant;
import com.budwk.app.flow.engine.AssignmentHandler;
import com.budwk.app.flow.engine.core.Execution;
import com.budwk.app.flow.engine.core.ServiceContext;
import com.budwk.app.flow.engine.model.TaskModel;
import org.nutz.dao.Dao;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import java.util.List;
public class FlowSchoolOfficeDirectorHandler implements AssignmentHandler {
@Override
public List<String> assign(TaskModel model, Execution execution) {
Dao dao = ServiceContext.find(Dao.class);
Sql sql = Sqls.create("""
SELECT
userRole.userId
FROM
`sys_user_role` userRole
LEFT JOIN sys_role role ON role.id = userRole.roleId
WHERE
role.`code` = @roleCode
GROUP BY
userRole.userId
""").setParam("roleCode", RoleConstant.SCHOOL_OFFICE_DIRECTOR.name());
sql.setCallback(Sqls.callback.strList());
dao.execute(sql);
return sql.getList(String.class);
}
@Override
public String getMessage() {
return "获取校工会办公室主任";
}
@Override
public int getOrder() {
return AssignmentHandler.super.getOrder();
}
}
@@ -0,0 +1,60 @@
package com.budwk.app.zhgh.staffbenefit.condolence.controller;
import cn.dev33.satoken.annotation.SaCheckLogin;
import cn.hutool.core.lang.Dict;
import cn.hutool.core.util.StrUtil;
import com.budwk.app.base.exception.BaseException;
import com.budwk.app.base.result.Result;
import com.budwk.app.flow.constant.FlowConst;
import com.budwk.app.flow.entity.ProcessInstance;
import com.budwk.app.flow.entity.ProcessTask;
import com.budwk.app.flow.service.FlowCommonService;
import com.budwk.app.zhgh.staffbenefit.condolence.model.Condolence;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Dao;
import org.nutz.ioc.aop.Aop;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.json.Json;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
@IocBean
@Ok("json")
@At("/platform/condolence/approval")
public class CondolenceApprovalController {
@Inject
private Dao dao;
@Inject
private FlowCommonService flowCommonService;
@At
@SaCheckLogin
@Aop(TransAop.READ_COMMITTED)
public Result executeTask(@Param("data") String data) {
Dict args = Json.fromJson(Dict.class, data);
if (args == null || args.getLong(FlowConst.PROCESS_TASK_ID_KEY) == null) {
throw new BaseException("审批任务不能为空");
}
ProcessTask task = dao.fetch(ProcessTask.class, args.getLong(FlowConst.PROCESS_TASK_ID_KEY));
if (task == null) throw new BaseException("审批任务不存在");
if (!"4dad0bef-3cf2-4a7d-bba3-35020b9b216d".equals(task.getTaskName())
&& !"34f7938e-47a3-4b3a-b4e0-92b7a3f47865".equals(task.getTaskName())
&& !"ecdaef3b-edf4-4143-9a96-887dd5921711".equals(task.getTaskName())
&& !"cbd41337-3c87-4959-9027-809df5c7ef5e".equals(task.getTaskName())) {
throw new BaseException("当前任务不是职工慰问审批任务");
}
ProcessInstance instance = dao.fetch(ProcessInstance.class, task.getProcessInstanceId());
Condolence info = instance == null ? null : dao.fetch(Condolence.class, instance.getBusinessNo());
if (info == null) throw new BaseException("职工慰问申请不存在");
if (StrUtil.isBlank(args.getStr("tf_sign"))) throw new BaseException("请完成审批签字");
if (StrUtil.isBlank(args.getStr("tf_opinion"))) throw new BaseException("请填写审批意见");
// 参与者权限由流程引擎校验,业务入口不接受客户端指定管理员代办。
args.remove(FlowConst.EXT_ENABLE_OPERATOR);
flowCommonService.executeTask(args);
return Result.success();
}
}
@@ -17,6 +17,7 @@ import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.dao.util.cri.SqlExpressionGroup;
import org.nutz.dao.util.cri.Static;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.util.NutMap;
@@ -27,7 +28,7 @@ import org.nutz.mvc.annotation.Param;
import java.util.List;
/**
* @ClassName CondolenceBranchUnionApprovalController
* @ClassName CondolenceFirstApprovalController
* @Author JyuHsin
* @Date 2025/7/28 11:33
* @Version 1.0
@@ -35,26 +36,26 @@ import java.util.List;
*/
@IocBean
@At("/platform/condolence/branchUnionApproval")
@Api("职工慰问分工会审核")
@Api("职工慰问一级审核")
@Ok("json:full")
public class CondolenceBranchUnionApprovalController {
public class CondolenceFirstApprovalController {
@Inject
private CondolenceService condolenceService;
@At("/")
@Ok("beetl:/platform/zhgh/staffbenefit/condolence/branchUnionApproval/index.html")
@SaCheckPermission("condolence.branchUnionApproval")
@SaCheckPermission("condolence.firstApproval")
public void index() {}
@At("/h5")
@Ok("beetl:/platform/zhghh5/staffbenefit/condolence/branchUnionApproval/index.html")
@SaCheckPermission("h5.condolence.branchUnionApproval")
@SaCheckPermission("h5.condolence.firstApproval")
public void h5Index() {}
@At
@ApiOperation("分页查询")
@SaCheckPermission(value = {"condolence.branchUnionApproval", "h5.condolence.branchUnionApproval"}, mode = SaMode.OR)
@SaCheckPermission(value = {"condolence.firstApproval", "h5.condolence.firstApproval"}, mode = SaMode.OR)
public Result pageData(PageForm pageForm,
@Param(value = "year") Integer year,
@Param(value = "type") String type,
@@ -90,6 +91,14 @@ public class CondolenceBranchUnionApprovalController {
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.and(new Static("""
NOT EXISTS (
SELECT 1 FROM wf_process_task newer
WHERE newer.processInstanceId = t.processInstanceId
AND newer.taskName = t.taskName
AND newer.id > t.id
)
"""));
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
SqlExpressionGroup seg = new SqlExpressionGroup();
seg.or(Condolence::getHelpUserName, "like", "%" + pageForm.getSearchKeyword() + "%");
@@ -100,7 +109,9 @@ public class CondolenceBranchUnionApprovalController {
cnd.andEX("YEAR(info.createTime)", "=", year);
cnd.and("t.taskName", "=", "4dad0bef-3cf2-4a7d-bba3-35020b9b216d");
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
if (!"superadmin".equals(SecurityUtil.getUserLoginname())) {
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
}
if (approval) {
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
@@ -0,0 +1,160 @@
package com.budwk.app.zhgh.staffbenefit.condolence.controller;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.dev33.satoken.annotation.SaMode;
import cn.hutool.core.util.StrUtil;
import com.budwk.app.base.constant.RoleConstant;
import com.budwk.app.base.page.Pagination;
import com.budwk.app.base.param.PageForm;
import com.budwk.app.base.result.Result;
import com.budwk.app.base.utils.PageUtil;
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
import com.budwk.app.web.commons.auth.utils.AuthUtil;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.zhgh.staffbenefit.condolence.model.Condolence;
import com.budwk.app.zhgh.staffbenefit.condolence.service.CondolenceService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.dao.util.cri.SqlExpressionGroup;
import org.nutz.dao.util.cri.Static;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.util.NutMap;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import java.util.List;
/**
* @ClassName CondolenceFourthApprovalController
* @Author JyuHsin
* @Date 2025/7/29 16:23
* @Version 1.0
* @Description TODO
*/
@IocBean
@At("/platform/condolence/fourthApproval")
@Api("职工慰问四级审核")
@Ok("json:full")
public class CondolenceFourthApprovalController {
@Inject
private Dao dao;
@Inject
private CondolenceService condolenceService;
@At("/")
@Ok("beetl:/platform/zhgh/staffbenefit/condolence/fourthApproval/index.html")
@SaCheckPermission("condolence.fourthApproval")
public void index() {}
@At("/h5")
@Ok("beetl:/platform/zhghh5/staffbenefit/condolence/fourthApproval/index.html")
@SaCheckPermission("h5.condolence.fourthApproval")
public void h5Index() {}
@At
@ApiOperation("分页查询")
@SaCheckPermission(value = {"condolence.fourthApproval", "h5.condolence.fourthApproval"}, mode = SaMode.OR)
public Result pageData(PageForm pageForm,
@Param(value = "year") Integer year,
@Param(value = "type") String type,
@Param(value = "unionId") String unionId,
@Param(value = "unitId") String unitId,
@Param(value = "approval") Boolean approval) {
Sql sql = Sqls.create("""
SELECT
info.*,
type.name as typeName,
ins.id AS instanceId,
ins.businessNo,
ins.state instanceState,
ins.variable instanceVariable,
ins.processDefineId instanceProcessDefineId,
t.id taskId,
t.taskName AS taskKey,
t.displayName taskName,
t.taskType,
t.performType taskPerformType,
t.taskState,
t.finishTime,
t.taskParentId,
t.variable taskVariable,
IFNULL(GROUP_CONCAT(DISTINCT nt.displayName),'结束') curTaskName,
IF(rt.id IS NOT NULL, 1, 0) AS canRevoke
FROM
wf_process_task t
LEFT JOIN wf_process_instance ins ON ins.id = t.processInstanceId
LEFT JOIN condolence info ON info.id = ins.businessNo
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
LEFT JOIN condolence_type type ON info.type = type.id
LEFT JOIN wf_process_task nt ON nt.processInstanceId = ins.id AND nt.taskState = 10
LEFT JOIN wf_process_task rt ON rt.processInstanceId = ins.id AND rt.taskParentId = t.id AND rt.taskState = 10
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.and(new Static("""
NOT EXISTS (
SELECT 1 FROM wf_process_task newer
WHERE newer.processInstanceId = t.processInstanceId
AND newer.taskName = t.taskName
AND newer.id > t.id
)
"""));
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
SqlExpressionGroup seg = new SqlExpressionGroup();
seg.or(Condolence::getHelpUserName, "like", "%" + pageForm.getSearchKeyword() + "%");
seg.or(Condolence::getHelpLoginName, "like", "%" + pageForm.getSearchKeyword() + "%");
cnd.and(seg);
}
cnd.andEX("info.type", "=", type);
cnd.andEX("YEAR(info.createTime)", "=", year);
cnd.andEX("info.applyUnionId", "=", unionId);
cnd.andEX("info.applyUnitId", "=", unitId);
cnd.and("t.taskName", "=", "cbd41337-3c87-4959-9027-809df5c7ef5e");
if (!"superadmin".equals(SecurityUtil.getUserLoginname()) && !AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name())) {
Sql unitSql = Sqls.queryString("""
SELECT DISTINCT ur.unitId
FROM sys_user_role ur
INNER JOIN sys_role r ON r.id = ur.roleId
WHERE ur.userId = @userId
AND ur.enable = true
AND r.disabled = false
AND r.code = @roleCode
AND ur.unitId IS NOT NULL
AND ur.unitId <> ''
""");
unitSql.setParam("userId", SecurityUtil.getUserId());
unitSql.setParam("roleCode", RoleConstant.UNIT_SCHOOL_LEADER.name());
dao.execute(unitSql);
List<String> managedUnitIds = unitSql.getList(String.class);
if (managedUnitIds.isEmpty()) {
cnd.and(new Static("1 = 0"));
} else {
cnd.and("info.applyUnitId", "in", managedUnitIds);
}
}
if (approval) {
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
} else {
cnd.and("t.taskState", "=", ProcessTaskStateEnum.DOING.getCode());
}
if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
cnd.desc("info.createTime");
} else {
cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
}
cnd.groupBy("t.id");
sql.setCondition(cnd);
Pagination<NutMap> pageVO = condolenceService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
return Result.success(pageVO);
}
}
@@ -3,21 +3,33 @@ package com.budwk.app.zhgh.staffbenefit.condolence.controller;
import cn.dev33.satoken.annotation.SaCheckLogin;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.dev33.satoken.annotation.SaMode;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.lang.Dict;
import cn.hutool.core.util.StrUtil;
import com.budwk.app.base.annotation.SLog;
import com.budwk.app.base.constant.RoleConstant;
import com.budwk.app.base.exception.BaseException;
import com.budwk.app.base.page.Pagination;
import com.budwk.app.base.param.PageForm;
import com.budwk.app.base.result.Result;
import com.budwk.app.base.sms.SmsService;
import com.budwk.app.base.utils.PageUtil;
import com.budwk.app.base.utils.CommonDownloadUtil;
import com.budwk.app.base.utils.SysOfficeTemplateUtil;
import com.budwk.app.flow.engine.FlowEngine;
import com.budwk.app.flow.entity.ProcessInstance;
import com.budwk.app.flow.entity.ProcessTask;
import com.budwk.app.flow.enums.ProcessInstanceStateEnum;
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
import com.budwk.app.flow.vo.ProcessTaskVO;
import com.budwk.app.sys.views.View_user;
import com.budwk.app.web.commons.auth.utils.AuthUtil;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.zhgh.staffbenefit.condolence.model.Condolence;
import com.budwk.app.zhgh.staffbenefit.condolence.model.CondolenceType;
import com.budwk.app.zhgh.staffbenefit.condolence.service.CondolenceService;
import com.deepoove.poi.XWPFTemplate;
import com.deepoove.poi.data.PictureRenderData;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.nutz.aop.interceptor.ioc.TransAop;
@@ -34,6 +46,12 @@ import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.util.List;
/**
* @ClassName CondolenceApplyController
* @Author JyuHsin
@@ -51,6 +69,8 @@ public class CondolenceMineController {
private CondolenceService condolenceService;
@Inject
private FlowEngine flowEngine;
@Inject
private SysOfficeTemplateUtil sysOfficeTemplateUtil;
@At("/")
@Ok("beetl:/platform/zhgh/staffbenefit/condolence/mine/index.html")
@@ -132,6 +152,91 @@ public class CondolenceMineController {
return Result.success(pagination);
}
@At
@Ok("void")
@ApiOperation("导出职工慰问申请表")
@SaCheckPermission("condolence.mine")
public void doExportApply(String id, HttpServletResponse response, Boolean print) throws Exception {
Condolence condolence = condolenceService.fetch(id);
if (condolence == null) throw new BaseException("该条记录不存在");
if (!SecurityUtil.getUserId().equals(condolence.getCreatedBy())) {
throw new BaseException("只能导出本人提交的申请");
}
ProcessInstance instance = condolenceService.dao().fetch(ProcessInstance.class,
Cnd.where("businessNo", "=", id).desc("id"));
if (instance == null || !ProcessInstanceStateEnum.FINISHED.getCode().equals(instance.getState())) {
throw new BaseException("只能导出已完成的申请");
}
NutMap docData = Lang.obj2nutmap(condolence);
docData.put("payUserName", StrUtil.nullToEmpty(condolence.getBankUserName()));
CondolenceType type = condolenceService.dao().fetch(CondolenceType.class, condolence.getType());
docData.put("typeName", type == null ? "" : type.getName());
docData.put("signature", "");
if (StrUtil.isNotBlank(condolence.getSignature())) {
PictureRenderData signature = sysOfficeTemplateUtil.createPictureRenderData(90, 40, condolence.getSignature());
if (signature == null) throw new BaseException("申请人签字图片读取失败");
docData.put("signature", signature);
}
fillApplyApprovals(docData, instance);
String fileName = "重庆工贸职业技术学院职工慰问申请表_" + StrUtil.nullToEmpty(condolence.getHelpUserName());
try (InputStream input = getClass().getResourceAsStream("/templates/condolence/重庆工贸职业技术学院职工慰问申请表.doc");
ByteArrayOutputStream templateOutput = new ByteArrayOutputStream();
ByteArrayOutputStream output = new ByteArrayOutputStream()) {
if (input == null) throw new BaseException("职工慰问申请表模板不存在");
com.aspose.words.Document document = new com.aspose.words.Document(input);
document.save(templateOutput, com.aspose.words.SaveFormat.DOCX);
try (ByteArrayInputStream templateInput = new ByteArrayInputStream(templateOutput.toByteArray())) {
XWPFTemplate.compile(templateInput).render(docData).writeAndClose(output);
}
if (Boolean.TRUE.equals(print)) {
try (ByteArrayInputStream wordInput = new ByteArrayInputStream(output.toByteArray());
ByteArrayOutputStream pdfOutput = new ByteArrayOutputStream()) {
new com.aspose.words.Document(wordInput).save(pdfOutput, com.aspose.words.SaveFormat.PDF);
CommonDownloadUtil.download(fileName + ".pdf", pdfOutput.toByteArray(), response);
}
} else {
CommonDownloadUtil.download(fileName + ".docx", output.toByteArray(), response);
}
}
}
private void fillApplyApprovals(NutMap docData, ProcessInstance instance) {
String[] taskKeys = {"4dad0bef-3cf2-4a7d-bba3-35020b9b216d", "34f7938e-47a3-4b3a-b4e0-92b7a3f47865",
"ecdaef3b-edf4-4143-9a96-887dd5921711", "cbd41337-3c87-4959-9027-809df5c7ef5e"};
String[] fields = {"firstApproval", "secondApproval", "thirdApproval", "fourthApproval"};
List<String> suffixes = List.of("Opinion", "Sign", "Year", "Month", "Day");
for (String field : fields) {
for (String suffix : suffixes) docData.put(field + suffix, "");
}
List<ProcessTask> tasks = condolenceService.dao().query(ProcessTask.class,
Cnd.where("processInstanceId", "=", instance.getId()).asc("id"));
for (ProcessTask task : tasks) {
ProcessTaskVO taskVO = flowEngine.processTaskService().findById(task.getId());
if ("startTask".equals(task.getTaskName()) || (taskVO.getExt() != null && Boolean.TRUE.equals(taskVO.getExt().getBool("isFirstTaskNode")))) {
// 重新申请后,仅导出本轮审批记录。
for (String field : fields) {
for (String suffix : suffixes) docData.put(field + suffix, "");
}
continue;
}
for (int i = 0; i < taskKeys.length; i++) {
if (!taskKeys[i].equals(task.getTaskName())) continue;
for (String suffix : suffixes) docData.put(fields[i] + suffix, "");
if (!ProcessTaskStateEnum.FINISHED.getCode().equals(task.getTaskState())) continue;
Dict data = taskVO.getExt() == null ? Dict.create() : taskVO.getTaskFormData();
docData.put(fields[i] + "Opinion", StrUtil.nullToEmpty(data.getStr("opinion")));
if (StrUtil.isNotBlank(data.getStr("sign"))) {
PictureRenderData signature = sysOfficeTemplateUtil.createPictureRenderData(90, 40, data.getStr("sign"));
if (signature == null) throw new BaseException("审批签字图片读取失败");
docData.put(fields[i] + "Sign", signature);
}
docData.put(fields[i] + "Year", task.getFinishTime() == null ? "" : DateUtil.format(task.getFinishTime(), "yyyy"));
docData.put(fields[i] + "Month", task.getFinishTime() == null ? "" : DateUtil.format(task.getFinishTime(), "M"));
docData.put(fields[i] + "Day", task.getFinishTime() == null ? "" : DateUtil.format(task.getFinishTime(), "d"));
}
}
}
@At
@ApiOperation("删除")
@Aop(TransAop.READ_COMMITTED)
@@ -106,7 +106,7 @@ public class CondolenceReadController {
cnd.and(seg);
}
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())) {
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_CHAIRMAN.name())) {
cnd.and("info.applyUnionId", "=", SecurityUtil.getUnionId());
}
@@ -153,7 +153,7 @@ public class CondolenceReadController {
seg.or("info.helpLoginName", "like", "%" + pageForm.getSearchKeyword() + "%");
cnd.and(seg);
}
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())) {
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_CHAIRMAN.name())) {
cnd.and("con.applyUnionId", "=", SecurityUtil.getUnionId());
}
sql.setCondition(cnd);
@@ -17,6 +17,7 @@ import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.dao.util.cri.SqlExpressionGroup;
import org.nutz.dao.util.cri.Static;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.util.NutMap;
@@ -33,26 +34,26 @@ import java.util.List;
*/
@IocBean
@At("/platform/condolence/schoolPrincipalApproval")
@Api("职工慰问校工会预审")
@Api("职工慰问二级审核")
@Ok("json:full")
public class CondolenceSchoolPrincipalApprovalController {
public class CondolenceSecondApprovalController {
@Inject
private CondolenceService condolenceService;
@At("/")
@Ok("beetl:/platform/zhgh/staffbenefit/condolence/schoolPrincipalApproval/index.html")
@SaCheckPermission("condolence.schoolPrincipalApproval")
@SaCheckPermission("condolence.secondApproval")
public void index() {}
@At("/h5")
@Ok("beetl:/platform/zhghh5/staffbenefit/condolence/schoolPrincipalApproval/index.html")
@SaCheckPermission("h5.condolence.schoolPrincipalApproval")
@SaCheckPermission("h5.condolence.secondApproval")
public void h5Index() {}
@At
@ApiOperation("分页查询")
@SaCheckPermission(value = {"condolence.schoolPrincipalApproval", "h5.condolence.schoolPrincipalApproval"}, mode = SaMode.OR)
@SaCheckPermission(value = {"condolence.secondApproval", "h5.condolence.secondApproval"}, mode = SaMode.OR)
public Result pageData(PageForm pageForm,
@Param(value = "year") Integer year,
@Param(value = "type") String type,
@@ -90,6 +91,14 @@ public class CondolenceSchoolPrincipalApprovalController {
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.and(new Static("""
NOT EXISTS (
SELECT 1 FROM wf_process_task newer
WHERE newer.processInstanceId = t.processInstanceId
AND newer.taskName = t.taskName
AND newer.id > t.id
)
"""));
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
SqlExpressionGroup seg = new SqlExpressionGroup();
seg.or(Condolence::getHelpUserName, "like", "%" + pageForm.getSearchKeyword() + "%");
@@ -17,6 +17,7 @@ import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.dao.util.cri.SqlExpressionGroup;
import org.nutz.dao.util.cri.Static;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.util.NutMap;
@@ -27,7 +28,7 @@ import org.nutz.mvc.annotation.Param;
import java.util.List;
/**
* @ClassName CondolenceSchoolUnionApprovalController
* @ClassName CondolenceThirdApprovalController
* @Author JyuHsin
* @Date 2025/7/29 16:23
* @Version 1.0
@@ -35,26 +36,26 @@ import java.util.List;
*/
@IocBean
@At("/platform/condolence/schoolUnionApproval")
@Api("职工慰问校工会审核")
@Api("职工慰问三级审核")
@Ok("json:full")
public class CondolenceSchoolUnionApprovalController {
public class CondolenceThirdApprovalController {
@Inject
private CondolenceService condolenceService;
@At("/")
@Ok("beetl:/platform/zhgh/staffbenefit/condolence/schoolUnionApproval/index.html")
@SaCheckPermission("condolence.schoolUnionApproval")
@SaCheckPermission("condolence.thirdApproval")
public void index() {}
@At("/h5")
@Ok("beetl:/platform/zhghh5/staffbenefit/condolence/schoolUnionApproval/index.html")
@SaCheckPermission("h5.condolence.schoolUnionApproval")
@SaCheckPermission("h5.condolence.thirdApproval")
public void h5Index() {}
@At
@ApiOperation("分页查询")
@SaCheckPermission(value = {"condolence.schoolUnionApproval", "h5.condolence.schoolUnionApproval"}, mode = SaMode.OR)
@SaCheckPermission(value = {"condolence.thirdApproval", "h5.condolence.thirdApproval"}, mode = SaMode.OR)
public Result pageData(PageForm pageForm,
@Param(value = "year") Integer year,
@Param(value = "type") String type,
@@ -92,6 +93,14 @@ public class CondolenceSchoolUnionApprovalController {
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.and(new Static("""
NOT EXISTS (
SELECT 1 FROM wf_process_task newer
WHERE newer.processInstanceId = t.processInstanceId
AND newer.taskName = t.taskName
AND newer.id > t.id
)
"""));
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
SqlExpressionGroup seg = new SqlExpressionGroup();
seg.or(Condolence::getHelpUserName, "like", "%" + pageForm.getSearchKeyword() + "%");
@@ -104,7 +113,9 @@ public class CondolenceSchoolUnionApprovalController {
cnd.andEX("info.applyUnitId", "=", unitId);
cnd.and("t.taskName", "=", "ecdaef3b-edf4-4143-9a96-887dd5921711");
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
if (!"superadmin".equals(SecurityUtil.getUserLoginname())) {
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
}
if (approval) {
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
@@ -112,6 +112,7 @@ public class DifficultHelpApplyController {
@SaCheckPermission("member.apply.submit")
@SLog(tag = "困难补助申请", msg = "保存申请,填写人: ${args[0].proxyUserName}")
public Result save(@Param("data") DifficultHelpInfo difficultHelpInfo) {
difficultHelpCommonService.validateApplyUser(difficultHelpInfo);
difficultHelpInfo.setApplyTime(ObjectUtil.defaultIfNull(difficultHelpInfo.getApplyTime(), new Date()));
difficultHelpCommonService.refreshApplyCount(difficultHelpInfo);
if (difficultHelpCommonService.hasAppliedInYear(difficultHelpInfo.getUserId(), difficultHelpInfo.getApplyTime(), difficultHelpInfo.getId())) {
@@ -128,6 +129,7 @@ public class DifficultHelpApplyController {
@SaCheckPermission("member.apply.submit")
@SLog(tag = "困难补助申请", msg = "提交申请,填写人: ${args[0].proxyUserName}")
public Result submit(@Param("data") DifficultHelpInfo difficultHelpInfo){
difficultHelpCommonService.validateApplyUser(difficultHelpInfo);
difficultHelpInfo.setApplyTime(new Date());
difficultHelpCommonService.refreshApplyCount(difficultHelpInfo);
if (difficultHelpCommonService.hasAppliedInYear(difficultHelpInfo.getUserId(), difficultHelpInfo.getApplyTime(), difficultHelpInfo.getId())) {
@@ -156,6 +158,7 @@ public class DifficultHelpApplyController {
@SaCheckPermission("member.apply.submit")
@SLog(tag = "困难补助申请", msg = "重新提交申请,填写人: ${args[0].proxyUserName}")
public Result submitAgain(@Param("data") DifficultHelpInfo difficultHelpInfo, @Param("taskId") Long taskId) {
difficultHelpCommonService.validateApplyUser(difficultHelpInfo);
difficultHelpInfo.setApplyTime(ObjectUtil.defaultIfNull(difficultHelpInfo.getApplyTime(), new Date()));
difficultHelpCommonService.refreshApplyCount(difficultHelpInfo);
if (difficultHelpCommonService.hasAppliedInYear(difficultHelpInfo.getUserId(), difficultHelpInfo.getApplyTime(), difficultHelpInfo.getId())) {
@@ -176,6 +179,12 @@ public class DifficultHelpApplyController {
@ApiOperation("获取受助人")
@SaCheckPermission("difficultHelp.apply")
public Result queryRecipients(String key){
if (!AuthUtil.hasRoleOr(RoleConstant.BRANCH_UNION_CHAIRMAN.name())) {
return Result.error("只有分工会主席可以替他人申请");
}
if (Strings.isBlank(SecurityUtil.getUnionId())) {
return Result.error("当前用户未设置所属分工会");
}
Sql sql = Sqls.create("""
SELECT
id,
@@ -194,13 +203,7 @@ public class DifficultHelpApplyController {
""");
Cnd cnd = Cnd.NEW();
cnd.and("id", "<>", SecurityUtil.getUserId());
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())) {
if (AuthUtil.hasRoleOr(RoleConstant.BRANCH_UNION_CHAIRMAN.name(), RoleConstant.BRANCH_UNION_ADMIN.name(), RoleConstant.BRANCH_UNION_OPERATOR.name())) {
cnd.and("unionid", "=", SecurityUtil.getUnionId());
} else {
cnd.and("id", "=", SecurityUtil.getUserId());
}
}
cnd.and("unionid", "=", SecurityUtil.getUnionId());
if (Strings.isNotBlank(key)) {
SqlExpressionGroup group = new SqlExpressionGroup();
@@ -0,0 +1,74 @@
package com.budwk.app.zhgh.staffbenefit.difficulthelp.controller;
import cn.dev33.satoken.annotation.SaCheckLogin;
import cn.hutool.core.lang.Dict;
import cn.hutool.core.util.StrUtil;
import com.budwk.app.base.exception.BaseException;
import com.budwk.app.base.result.Result;
import com.budwk.app.flow.constant.FlowConst;
import com.budwk.app.flow.entity.ProcessInstance;
import com.budwk.app.flow.entity.ProcessTask;
import com.budwk.app.flow.enums.ProcessSubmitTypeEnum;
import com.budwk.app.flow.service.FlowCommonService;
import com.budwk.app.zhgh.staffbenefit.difficulthelp.models.DifficultHelpInfo;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Chain;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.ioc.aop.Aop;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.json.Json;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
@IocBean
@Ok("json")
@At("/platform/difficultHelp/approval")
public class DifficultHelpApprovalController {
@Inject
private Dao dao;
@Inject
private FlowCommonService flowCommonService;
@At
@SaCheckLogin
@Aop(TransAop.READ_COMMITTED)
public Result executeTask(@Param("data") String data) {
Dict args = Json.fromJson(Dict.class, data);
if (args == null || args.getLong(FlowConst.PROCESS_TASK_ID_KEY) == null) {
throw new BaseException("审批任务不能为空");
}
ProcessTask task = dao.fetch(ProcessTask.class, args.getLong(FlowConst.PROCESS_TASK_ID_KEY));
if (task == null) throw new BaseException("审批任务不存在");
boolean amountApproval = "36ebafda-44c2-4bd3-bd7f-10839a575a0d".equals(task.getTaskName())
|| "715ece82-4ae3-433c-ad18-ed875f45d1e3".equals(task.getTaskName());
if (!amountApproval && !"e405f96c-5fc0-4f63-b323-e69dfe853253".equals(task.getTaskName())) {
throw new BaseException("当前任务不是困难帮扶审批任务");
}
ProcessInstance instance = dao.fetch(ProcessInstance.class, task.getProcessInstanceId());
DifficultHelpInfo info = instance == null ? null : dao.fetch(DifficultHelpInfo.class, instance.getBusinessNo());
if (info == null) throw new BaseException("困难帮扶申请不存在");
if (StrUtil.isBlank(args.getStr("tf_sign"))) throw new BaseException("请完成审批签字");
if (StrUtil.isBlank(args.getStr("tf_opinion"))) throw new BaseException("请填写审批意见");
String level = args.getStr("level");
Double money = amountApproval ? args.getDouble("money") : null;
if (amountApproval) {
if (StrUtil.isBlank(level) || money == null || !Double.isFinite(money) || money < 0) {
throw new BaseException("请填写完整的级别和帮扶金额");
}
args.put("tf_level", level);
args.put("tf_money", money);
}
// 参与者权限由流程引擎校验,业务入口不接受客户端指定管理员代办。
args.remove(FlowConst.EXT_ENABLE_OPERATOR);
flowCommonService.executeTask(args);
if (amountApproval && Integer.valueOf(ProcessSubmitTypeEnum.AGREE.getCode()).equals(args.getInt(FlowConst.SUBMIT_TYPE))) {
dao.update(DifficultHelpInfo.class, Chain.make("level", level).add("money", money), Cnd.where("id", "=", info.getId()));
}
return Result.success();
}
}
@@ -2,10 +2,12 @@ package com.budwk.app.zhgh.staffbenefit.difficulthelp.controller;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.util.StrUtil;
import com.budwk.app.base.constant.RoleConstant;
import com.budwk.app.base.page.Pagination;
import com.budwk.app.base.result.Result;
import com.budwk.app.base.utils.PageUtil;
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
import com.budwk.app.web.commons.auth.utils.AuthUtil;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.zhgh.staffbenefit.difficulthelp.service.DifficultHelpCommonService;
import com.budwk.app.zhgh.staffbenefit.difficulthelp.vo.DifficultHelpPageParam;
@@ -14,6 +16,7 @@ import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.dao.util.cri.Static;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.util.NutMap;
@@ -25,15 +28,15 @@ import java.util.List;
/**
* @version 1.0
* @Author zzr
* @name:DifficultHelpBranchUnionApprovalController
* @name:DifficultHelpFirstApprovalController
* @Date 2025/7/31 11:47
* @注释
* @注释 困难帮扶一级审批
*/
@IocBean
@Ok("json")
@ApiOperation("困难补助分工会审核")
@ApiOperation("困难帮扶一级审批")
@At("/platform/difficultHelp/branchUnionApproval")
public class DifficultHelpBranchUnionApprovalController {
public class DifficultHelpFirstApprovalController {
@Inject
private Dao dao;
@@ -41,27 +44,27 @@ public class DifficultHelpBranchUnionApprovalController {
private DifficultHelpCommonService difficultHelpCommonService;
@At("")
@SaCheckPermission("difficultHelp.branchUnionApproval")
@SaCheckPermission("difficultHelp.firstApproval")
@Ok("beetl:/platform/zhgh/staffbenefit/difficulthelp/branchunionapproval/index.html")
public void index() {
}
@At
@SaCheckPermission("difficultHelp.branchUnionApproval")
@SaCheckPermission("difficultHelp.firstApproval")
@Ok("beetl:/platform/zhgh/staffbenefit/difficulthelp/branchunionapproval/form.html")
public void form() {
}
@At
@SaCheckPermission("h5.difficultHelp.branchUnionApproval")
@SaCheckPermission("h5.difficultHelp.firstApproval")
@Ok("beetl:/platform/zhghh5/staffbenefit/difficulthelp/branchunionapproval/index.html")
public void h5() {
}
@At
@ApiOperation("困难补助分工会审核列表")
@SaCheckPermission("difficultHelp.branchUnionApproval")
@ApiOperation("困难帮扶一级审批列表")
@SaCheckPermission("difficultHelp.firstApproval")
public Result pageData(DifficultHelpPageParam pageParam) {
Sql sql = Sqls.create("""
SELECT
@@ -102,10 +105,21 @@ public class DifficultHelpBranchUnionApprovalController {
$condition
""");
Cnd cnd = Cnd.NEW();
pageParam.buildSearch(cnd, "info.");
cnd.and(new Static("""
NOT EXISTS (
SELECT 1 FROM wf_process_task newer
WHERE newer.processInstanceId = t.processInstanceId
AND newer.taskName = t.taskName
AND newer.id > t.id
)
"""));
boolean schoolApproval = AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name(), RoleConstant.SCHOOL_OFFICE_DIRECTOR.name());
pageParam.buildSearch(cnd, "info.", !schoolApproval);
cnd.and("t.taskName", "=", "9d11798e-a0e4-4ff5-939b-e6c5519e0eb6");
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
cnd.and("t.taskName", "=", "36ebafda-44c2-4bd3-bd7f-10839a575a0d");
if (!schoolApproval) {
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
}
if (pageParam.getAudit()) {
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.WITHDRAW.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
@@ -68,6 +68,7 @@ public class DifficultHelpMineController {
Sql sql = Sqls.create("""
SELECT
info.id,
info.createdBy,
info.proxyUserName,
info.proxyLoginName,
info.userName,
@@ -78,6 +79,7 @@ public class DifficultHelpMineController {
LEFT(info.applyTime, 10) AS applyTime,
info.applyCount,
info.mobile,
info.applyMoney,
info.money,
ins.id AS instanceId,
ins.businessNo,
@@ -103,7 +105,8 @@ public class DifficultHelpMineController {
""");
Cnd cnd = Cnd.NEW();
pageParam.buildSearch(cnd, "info.");
cnd.and("info.createdBy", "=", SecurityUtil.getUserId());
cnd.and(Cnd.exps("info.createdBy", "=", SecurityUtil.getUserId())
.or("info.userId", "=", SecurityUtil.getUserId()));
if (StrUtil.isAllBlank(pageParam.getPageOrderName(), pageParam.getPageOrderBy())) {
cnd.desc("info.applyTime");
} else {
@@ -121,6 +124,10 @@ public class DifficultHelpMineController {
@SaCheckPermission("difficultHelp.mine")
@SLog(tag = "困难补助申请", msg = "删除困难补助申请,id: ${args[0]}")
public Result onDelete(@Valid String id){
DifficultHelpInfo helpInfo = dao.fetch(DifficultHelpInfo.class, id);
if (helpInfo == null || !SecurityUtil.getUserId().equals(helpInfo.getCreatedBy())) {
return Result.error("只能删除自己创建的申请记录");
}
dao.clear(DifficultHelpInfo.class, Cnd.where("id", "=", id));
// 删除流程相关操作
flowEngine.processInstanceService().deleteProcessInstanceByBusinessKey(id);
@@ -21,6 +21,10 @@ import com.budwk.app.base.utils.MoneyUtil;
import com.budwk.app.base.utils.OfficePlusUtil;
import com.budwk.app.base.utils.SysOfficeTemplateUtil;
import com.budwk.app.flow.engine.FlowEngine;
import com.budwk.app.flow.entity.ProcessInstance;
import com.budwk.app.flow.entity.ProcessTask;
import com.budwk.app.flow.vo.ProcessTaskVO;
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
import com.budwk.app.sys.models.Sys_union;
import com.budwk.app.sys.models.Sys_user;
import com.budwk.app.sys.services.SysUserService;
@@ -361,6 +365,9 @@ public class DifficultHelpReadingController {
.build();
String templateName= "difficulty_apply";
docData.put("applyMoney", difficultHelp.getApplyMoney());
docData.put("money", difficultHelp.getMoney());
fillApplyApprovals(docData, difficultHelp.getId());
if (print) {
exportAsPDF(templateName, docData, config, difficultHelp, response);
} else {
@@ -368,14 +375,86 @@ public class DifficultHelpReadingController {
}
}
private void fillApplyApprovals(HashMap<String, Object> docData, String businessId) {
String[] taskKeys = {"36ebafda-44c2-4bd3-bd7f-10839a575a0d", "715ece82-4ae3-433c-ad18-ed875f45d1e3", "e405f96c-5fc0-4f63-b323-e69dfe853253"};
String[] fields = {"firstApproval", "secondApproval", "thirdApproval"};
for (String field : fields) {
for (String suffix : List.of("", "Opinion", "User", "Date", "Year", "Month", "Day", "Sign")) docData.put(field + suffix, "");
}
ProcessInstance instance = dao.fetch(ProcessInstance.class, Cnd.where("businessNo", "=", businessId).desc("id"));
if (instance == null) return;
List<ProcessTask> tasks = dao.query(ProcessTask.class, Cnd.where("processInstanceId", "=", instance.getId()).asc("id"));
for (ProcessTask task : tasks) {
ProcessTaskVO taskVO = flowEngine.processTaskService().findById(task.getId());
if ("startTask".equals(task.getTaskName()) || (taskVO.getExt() != null && Boolean.TRUE.equals(taskVO.getExt().getBool("isFirstTaskNode")))) {
// 重新申请后,仅导出本轮审批,避免混入上一次退回或撤销前的意见。
for (String field : fields) {
for (String suffix : List.of("", "Opinion", "User", "Date", "Year", "Month", "Day", "Sign")) docData.put(field + suffix, "");
}
continue;
}
if (!Integer.valueOf(ProcessTaskStateEnum.FINISHED.getCode()).equals(task.getTaskState())) continue;
for (int i = 0; i < taskKeys.length; i++) {
if (!taskKeys[i].equals(task.getTaskName())) continue;
cn.hutool.core.lang.Dict data = taskVO.getTaskFormData();
String opinion = StrUtil.nullToEmpty(data.getStr("opinion"));
docData.put(fields[i] + "Opinion", opinion);
docData.put(fields[i] + "User", StrUtil.nullToEmpty(data.getStr("userName")));
if (StrUtil.isNotBlank(data.getStr("sign"))) {
PictureRenderData signature = sysOfficeTemplateUtil.createPictureRenderData(90, 40, data.getStr("sign"));
if (signature == null) throw new IllegalStateException("审批签字图片读取失败");
docData.put(fields[i] + "Sign", signature);
}
docData.put(fields[i] + "Date", task.getFinishTime() == null ? "" : DateUtil.format(task.getFinishTime(), "yyyy-MM-dd"));
docData.put(fields[i] + "Year", task.getFinishTime() == null ? "" : DateUtil.format(task.getFinishTime(), "yyyy"));
docData.put(fields[i] + "Month", task.getFinishTime() == null ? "" : DateUtil.format(task.getFinishTime(), "M"));
docData.put(fields[i] + "Day", task.getFinishTime() == null ? "" : DateUtil.format(task.getFinishTime(), "d"));
String approval = "审批意见:" + opinion;
approval += "\n审批人:" + StrUtil.nullToEmpty(data.getStr("userName"));
approval += "\n审批日期:" + (task.getFinishTime() == null ? "" : DateUtil.format(task.getFinishTime(), "yyyy-MM-dd"));
docData.put(fields[i], approval);
}
}
}
private InputStream getApplyTemplate(String templateName) throws Exception {
byte[] templateBytes;
try (InputStream input = sysOfficeTemplateUtil.getTemplate(templateName)) {
templateBytes = input.readAllBytes();
}
// 按审批栏限定通用日期占位符,同时将旧版 Word 模板转换为 DOCX。
try (ByteArrayInputStream input = new ByteArrayInputStream(templateBytes);
ByteArrayOutputStream output = new ByteArrayOutputStream()) {
com.aspose.words.Document document = new com.aspose.words.Document(input);
com.aspose.words.NodeCollection cells = document.getChildNodes(com.aspose.words.NodeType.CELL, true);
for (int index = 0; index < cells.getCount(); index++) {
com.aspose.words.Cell cell = (com.aspose.words.Cell) cells.get(index);
for (String field : List.of("firstApproval", "secondApproval", "thirdApproval")) {
if (!cell.getText().contains("{{" + field + "Opinion}}")) continue;
com.aspose.words.FindReplaceOptions options = new com.aspose.words.FindReplaceOptions();
cell.getRange().replace("{{year}}", "{{" + field + "Year}}", options);
cell.getRange().replace("{{month}}", "{{" + field + "Month}}", options);
cell.getRange().replace("{{day}}", "{{" + field + "Day}}", options);
if ("firstApproval".equals(field)) {
cell.getRange().replace("{{secondApprovalUser}}", "{{firstApprovalUser}}", options);
}
cell.getRange().replace("{{" + field + "User}}", "{{@" + field + "Sign}}", options);
}
}
document.save(output, com.aspose.words.SaveFormat.DOCX);
templateBytes = output.toByteArray();
}
return new ByteArrayInputStream(templateBytes);
}
@At
private void exportAsPDF(String templateName, HashMap<String, Object> docData,Configure config,
DifficultHelpInfo difficultHelp, HttpServletResponse response) throws Exception {
String fileName = "中国地质大学(武汉)困难慰问申请表_" + difficultHelp.getUserName() + "_" +
String fileName = FileUtil.mainName(sysOfficeTemplateUtil.getTemplateFileName(templateName)) + "_" + difficultHelp.getUserName() + "_" +
DateUtil.format(difficultHelp.getApplyTime(), "yyyyMMdd") + ".pdf";
try (ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream()) {
XWPFTemplate.compile(sysOfficeTemplateUtil.getTemplate(templateName),config)
XWPFTemplate.compile(getApplyTemplate(templateName),config)
.render(docData)
.writeAndClose(byteArrayOutputStream);
byte[] bytes = byteArrayOutputStream.toByteArray();
@@ -396,11 +475,11 @@ public class DifficultHelpReadingController {
@At
private void exportAsWord(String templateName, HashMap<String, Object> docData,Configure config,
DifficultHelpInfo difficultHelp, HttpServletResponse response) throws Exception {
String fileName = "中国地质大学(武汉)困难慰问申请表_" + difficultHelp.getUserName() + "_" +
String fileName = FileUtil.mainName(sysOfficeTemplateUtil.getTemplateFileName(templateName)) + "_" + difficultHelp.getUserName() + "_" +
DateUtil.format(difficultHelp.getApplyTime(), "yyyyMMdd") + ".docx";
try (ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream()) {
XWPFTemplate.compile(sysOfficeTemplateUtil.getTemplate(templateName),config)
XWPFTemplate.compile(getApplyTemplate(templateName),config)
.render(docData)
.writeAndClose(byteArrayOutputStream);
CommonDownloadUtil.download(fileName, byteArrayOutputStream.toByteArray(), response);
@@ -2,10 +2,12 @@ package com.budwk.app.zhgh.staffbenefit.difficulthelp.controller;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.util.StrUtil;
import com.budwk.app.base.constant.RoleConstant;
import com.budwk.app.base.page.Pagination;
import com.budwk.app.base.result.Result;
import com.budwk.app.base.utils.PageUtil;
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
import com.budwk.app.web.commons.auth.utils.AuthUtil;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.zhgh.staffbenefit.difficulthelp.service.DifficultHelpCommonService;
import com.budwk.app.zhgh.staffbenefit.difficulthelp.vo.DifficultHelpPageParam;
@@ -14,6 +16,7 @@ import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.dao.util.cri.Static;
import org.nutz.dao.util.cri.SqlExpressionGroup;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
@@ -26,15 +29,15 @@ import java.util.List;
/**
* @version 1.0
* @Author zzr
* @name:DifficultHelpBranchUnionApprovalController
* @name:DifficultHelpSecondApprovalController
* @Date 2025/7/31 11:47
* @注释
* @注释 困难帮扶二级审批
*/
@IocBean
@Ok("json")
@ApiOperation("困难补助二级党组织审核")
@ApiOperation("困难帮扶二级审批")
@At("/platform/difficultHelp/unionLeaderApproval")
public class DifficultHelpBranchUnionLeaderApprovalController {
public class DifficultHelpSecondApprovalController {
@Inject
private Dao dao;
@@ -42,27 +45,27 @@ public class DifficultHelpBranchUnionLeaderApprovalController {
private DifficultHelpCommonService difficultHelpCommonService;
@At("")
@SaCheckPermission("difficultHelp.unionLeaderApproval")
@SaCheckPermission("difficultHelp.secondApproval")
@Ok("beetl:/platform/zhgh/staffbenefit/difficulthelp/unionLeaderApproval/index.html")
public void index() {
}
@At
@SaCheckPermission("difficultHelp.unionLeaderApproval")
@SaCheckPermission("difficultHelp.secondApproval")
@Ok("beetl:/platform/zhgh/staffbenefit/difficulthelp/unionLeaderApproval/form.html")
public void form() {
}
@At
@SaCheckPermission("h5.difficultHelp.unionLeaderApproval")
@SaCheckPermission("h5.difficultHelp.secondApproval")
@Ok("beetl:/platform/zhghh5/staffbenefit/difficulthelp/unionLeaderApproval/index.html")
public void h5() {
}
@At
@ApiOperation("困难补助分工会审核列表")
@SaCheckPermission("difficultHelp.unionLeaderApproval")
@ApiOperation("困难帮扶二级审批列表")
@SaCheckPermission("difficultHelp.secondApproval")
public Result pageData(DifficultHelpPageParam pageParam) {
Sql sql = Sqls.create("""
SELECT
@@ -103,6 +106,14 @@ public class DifficultHelpBranchUnionLeaderApprovalController {
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.and(new Static("""
NOT EXISTS (
SELECT 1 FROM wf_process_task newer
WHERE newer.processInstanceId = t.processInstanceId
AND newer.taskName = t.taskName
AND newer.id > t.id
)
"""));
// pageParam.buildSearchUnit(cnd, "info.");
if (StrUtil.isNotBlank(pageParam.getSearchKeyword())) {
@@ -114,8 +125,10 @@ public class DifficultHelpBranchUnionLeaderApprovalController {
cnd.andEX("info.unionId", "=", pageParam.getUnionId());
cnd.andEX("info.unitId", "=", pageParam.getUnitId());
cnd.and("t.taskName", "=", "36ebafda-44c2-4bd3-bd7f-10839a575a0d");
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
cnd.and("t.taskName", "=", "715ece82-4ae3-433c-ad18-ed875f45d1e3");
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name(), RoleConstant.SCHOOL_UNION_CHAIRMAN.name())) {
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
}
if (pageParam.getAudit()) {
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.WITHDRAW.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
@@ -4,10 +4,12 @@ import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.budwk.app.base.annotation.SLog;
import com.budwk.app.base.constant.RoleConstant;
import com.budwk.app.base.page.Pagination;
import com.budwk.app.base.result.Result;
import com.budwk.app.base.utils.PageUtil;
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
import com.budwk.app.web.commons.auth.utils.AuthUtil;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.zhgh.staffbenefit.difficulthelp.models.DifficultHelpInfo;
import com.budwk.app.zhgh.staffbenefit.difficulthelp.service.DifficultHelpCommonService;
@@ -17,6 +19,7 @@ import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.dao.util.cri.Static;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.util.NutMap;
@@ -30,15 +33,15 @@ import java.util.List;
/**
* @version 1.0
* @Author zzr
* @name:DifficultHelpSchoolUnionApprovalController
* @name:DifficultHelpThirdApprovalController
* @Date 2025/7/31 11:47
* @注释
* @注释 困难帮扶三级审批
*/
@IocBean
@Ok("json")
@ApiOperation("困难补助校工会审核")
@ApiOperation("困难帮扶三级审批")
@At("/platform/difficultHelp/schoolUnionApproval")
public class DifficultHelpSchoolUnionApprovalController {
public class DifficultHelpThirdApprovalController {
@Inject
private Dao dao;
@@ -46,26 +49,26 @@ public class DifficultHelpSchoolUnionApprovalController {
private DifficultHelpCommonService difficultHelpCommonService;
@At("")
@SaCheckPermission("difficultHelp.schoolUnionApproval")
@SaCheckPermission("difficultHelp.thirdApproval")
@Ok("beetl:/platform/zhgh/staffbenefit/difficulthelp/schoolunionapproval/index.html")
public void index() {
}
@At
@SaCheckPermission("difficultHelp.schoolUnionApproval")
@SaCheckPermission("difficultHelp.thirdApproval")
@Ok("beetl:/platform/zhgh/staffbenefit/difficulthelp/schoolunionapproval/form.html")
public void form() {
}
@At
@SaCheckPermission("h5.difficultHelp.schoolUnionApproval")
@SaCheckPermission("h5.difficultHelp.thirdApproval")
@Ok("beetl:/platform/zhghh5/staffbenefit/difficulthelp/schoolunionapproval/index.html")
public void h5() {
}
@At
@ApiOperation("困难补助校工会审核列表")
@SaCheckPermission("difficultHelp.schoolUnionApproval")
@ApiOperation("困难帮扶三级审批列表")
@SaCheckPermission("difficultHelp.thirdApproval")
public Result pageData(DifficultHelpPageParam pageParam) {
Sql sql = Sqls.create("""
SELECT
@@ -106,10 +109,39 @@ public class DifficultHelpSchoolUnionApprovalController {
$condition
""");
Cnd cnd = Cnd.NEW();
pageParam.buildSearch(cnd, "info.");
cnd.and(new Static("""
NOT EXISTS (
SELECT 1 FROM wf_process_task newer
WHERE newer.processInstanceId = t.processInstanceId
AND newer.taskName = t.taskName
AND newer.id > t.id
)
"""));
pageParam.buildSearch(cnd, "info.", false);
cnd.and("t.taskName", "=", "715ece82-4ae3-433c-ad18-ed875f45d1e3");
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
cnd.and("t.taskName", "=", "e405f96c-5fc0-4f63-b323-e69dfe853253");
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name())) {
Sql unitSql = Sqls.queryString("""
SELECT DISTINCT ur.unitId
FROM sys_user_role ur
INNER JOIN sys_role r ON r.id = ur.roleId
WHERE ur.userId = @userId
AND ur.enable = true
AND r.disabled = false
AND r.code = @roleCode
AND ur.unitId IS NOT NULL
AND ur.unitId <> ''
""");
unitSql.setParam("userId", SecurityUtil.getUserId());
unitSql.setParam("roleCode", RoleConstant.UNIT_SCHOOL_LEADER.name());
dao.execute(unitSql);
List<String> managedUnitIds = unitSql.getList(String.class);
if (managedUnitIds.isEmpty()) {
cnd.and(new Static("1 = 0"));
} else {
cnd.and("info.unitId", "in", managedUnitIds);
}
}
if (pageParam.getAudit()) {
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.WITHDRAW.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
@@ -131,11 +163,10 @@ public class DifficultHelpSchoolUnionApprovalController {
@At
@ApiOperation("保存补助金额、级别")
@SaCheckPermission("difficultHelp.schoolUnionApproval")
@SaCheckPermission("difficultHelp.thirdApproval")
@SLog(tag = "困难补助申请", msg = "保存申请,填写人: ${args[0].proxyUserName}")
public Result save(@Param("data") DifficultHelpInfo difficultHelpInfo) {
dao.updateIgnoreNull(difficultHelpInfo);
return Result.success();
return Result.error("三级审批不再设置级别和帮扶金额,请在一级、二级审批中填写");
}
}
@@ -6,6 +6,7 @@ import com.budwk.app.flow.engine.core.Execution;
import com.budwk.app.flow.engine.core.ServiceContext;
import com.budwk.app.flow.entity.ProcessInstance;
import com.budwk.app.zhgh.staffbenefit.difficulthelp.models.DifficultHelpInfo;
import com.budwk.app.zhgh.staffbenefit.difficulthelp.service.DifficultHelpCommonService;
import org.nutz.dao.Chain;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
@@ -29,6 +30,7 @@ public class DifficultHelpSaveInterceptor implements FlowInterceptor {
Dao dao = ServiceContext.find(Dao.class);
DifficultHelpInfo difficultHelpInfo = Json.fromJson(DifficultHelpInfo.class, formDataStr);
ServiceContext.find(DifficultHelpCommonService.class).validateApplyUser(difficultHelpInfo);
difficultHelpInfo.setApplyTime(new Date());
dao.insertOrUpdate(difficultHelpInfo);
@@ -194,6 +194,11 @@ public class DifficultHelpInfo extends BaseModel {
@ColDefine(type = ColType.INT)
private Integer applyCount;
@Column
@Comment("申请金额")
@ColDefine(type = ColType.VARCHAR, width = 200)
private Double applyMoney;
@Column
@Comment("补助金额")
@ColDefine(type = ColType.VARCHAR, width = 200)
@@ -19,6 +19,8 @@ import java.util.List;
*/
public interface DifficultHelpCommonService extends BaseService<DifficultHelpInfo> {
void validateApplyUser(DifficultHelpInfo difficultHelpInfo);
/**
* 导入实际金额数据处理
* @param file 文件
@@ -4,6 +4,10 @@ import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import com.budwk.app.base.service.impl.BaseServiceImpl;
import com.budwk.app.base.constant.RoleConstant;
import com.budwk.app.base.exception.BaseException;
import com.budwk.app.web.commons.auth.utils.AuthUtil;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.base.utils.ManyAddOrRenewUtil;
import com.budwk.app.base.utils.easyexcel.EasyExcelUtil;
import com.budwk.app.sys.models.Sys_user;
@@ -50,6 +54,34 @@ public class DifficultHelpCommonServiceImpl extends BaseServiceImpl<DifficultHel
@Inject
private ManyAddOrRenewUtil manyAddOrRenewUtil;
@Override
public void validateApplyUser(DifficultHelpInfo difficultHelpInfo) {
if (difficultHelpInfo == null || StrUtil.isBlank(difficultHelpInfo.getUserId())) {
throw new BaseException("请选择受助人");
}
if (StrUtil.isNotBlank(difficultHelpInfo.getId())) {
DifficultHelpInfo dbInfo = dao().fetch(DifficultHelpInfo.class, difficultHelpInfo.getId());
if (dbInfo != null && !SecurityUtil.getUserId().equals(dbInfo.getCreatedBy())) {
throw new BaseException("只能查看他人代为申请的记录,不能修改或提交");
}
}
if (difficultHelpInfo.getApplyMoney() == null || !Double.isFinite(difficultHelpInfo.getApplyMoney())
|| difficultHelpInfo.getApplyMoney() <= 0) {
throw new BaseException("请填写大于零的申请金额");
}
if (difficultHelpInfo.getUserId().equals(SecurityUtil.getUserId())) {
return;
}
if (!AuthUtil.hasRoleOr(RoleConstant.BRANCH_UNION_CHAIRMAN.name())) {
throw new BaseException("只有分工会主席可以替他人申请");
}
View_user recipient = dao().fetch(View_user.class, Cnd.where("id", "=", difficultHelpInfo.getUserId()));
if (recipient == null || StrUtil.isBlank(SecurityUtil.getUnionId())
|| !SecurityUtil.getUnionId().equals(recipient.getUnionId())) {
throw new BaseException("只能替本分工会人员申请");
}
}
@Override
public boolean hasAppliedInYear(String userId, Date applyTime, String excludeRecordId) {
if (StrUtil.isBlank(userId) || applyTime == null) {
@@ -33,6 +33,10 @@ public class DifficultHelpPageParam extends PageForm {
private List<String> dateRange;
public void buildSearch(Cnd cnd, String prefix){
buildSearch(cnd, prefix, true);
}
public void buildSearch(Cnd cnd, String prefix, boolean restrictDataScope){
if (cnd == null) {
cnd = Cnd.NEW();
}
@@ -46,7 +50,7 @@ public class DifficultHelpPageParam extends PageForm {
cnd.andEX("YEAR(" + prefix + "applyTime)", "=", this.getYear());
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())) {
if (restrictDataScope && !AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())) {
if (AuthUtil.hasRoleOr(RoleConstant.BRANCH_UNION_CHAIRMAN.name(), RoleConstant.BRANCH_UNION_ADMIN.name(), RoleConstant.BRANCH_UNION_OPERATOR.name())) {
cnd.and(prefix + "unionid", "=", SecurityUtil.getUnionId());
} else {
@@ -0,0 +1,117 @@
# 新增角色
INSERT INTO sys_role (id, name, code, aliasName, disabled, unitid, moduleId, note, sort, createdBy, createdAt,
updatedBy, updatedAt, delFlag)
VALUES ('494ac71eb8b44d0e99e19b7fde6bd469', '校工会办公室主任', 'SCHOOL_OFFICE_DIRECTOR', null, false, null,
'07d940ba34bd47399cda140894f5d86b', null, null, '17a7f8ad3ee947b4a26175049a9c253d', 1791510778436,
'17a7f8ad3ee947b4a26175049a9c253d', 1791510778437, false);
# 修改审核菜单名称
UPDATE sys_menu t
SET t.name = '校工会办公室主任审批'
WHERE t.id = 'df2fb530141c4245826ac9974ec90c9a';
UPDATE sys_menu t
SET t.name = '校工会主席审批'
WHERE t.id = 'a473302b80ce404e93bc820f858a14da';
UPDATE sys_menu t
SET t.name = '分管校领导审批'
WHERE t.id = '3e0bb63c5f0044bd837ad24633e92560';
UPDATE sys_menu t
SET t.name = '校工会办公室主任审批'
WHERE t.id = '23d30124199b486d8af79aba62440b15';
UPDATE sys_menu t
SET t.name = '校工会主席审批'
WHERE t.id = 'd736e4d7e8644cf38f248e7ad87ed6ad';
UPDATE sys_menu t
SET t.name = '分管校领导审批'
WHERE t.id = '35a9239d754c47b9afccce173cb72d64';
# 清除之前的菜单角色权限
# 校工会办公室主任审批
delete
from sys_role_menu
where menuId = 'df2fb530141c4245826ac9974ec90c9a';
INSERT INTO sys_role_menu (roleId, menuId)
VALUES ('7f4a820d5a394bb8a0a92d6699afe7c8', 'df2fb530141c4245826ac9974ec90c9a');
INSERT INTO sys_role_menu (roleId, menuId)
VALUES ('494ac71eb8b44d0e99e19b7fde6bd469', 'df2fb530141c4245826ac9974ec90c9a');
delete
from sys_role_menu
where menuId = '23d30124199b486d8af79aba62440b15';
INSERT INTO sys_role_menu (roleId, menuId)
VALUES ('7f4a820d5a394bb8a0a92d6699afe7c8', '23d30124199b486d8af79aba62440b15');
INSERT INTO sys_role_menu (roleId, menuId)
VALUES ('494ac71eb8b44d0e99e19b7fde6bd469', '23d30124199b486d8af79aba62440b15');
# 校工会主席审批
delete
from sys_role_menu
where menuId = 'a473302b80ce404e93bc820f858a14da';
INSERT INTO sys_role_menu (roleId, menuId)
VALUES ('7f4a820d5a394bb8a0a92d6699afe7c8', 'a473302b80ce404e93bc820f858a14da');
INSERT INTO sys_role_menu (roleId, menuId)
VALUES ('6aece46b946e4fb9ac4cb15c0cd8c3e6', 'a473302b80ce404e93bc820f858a14da');
delete
from sys_role_menu
where menuId = 'd736e4d7e8644cf38f248e7ad87ed6ad';
INSERT INTO sys_role_menu (roleId, menuId)
VALUES ('7f4a820d5a394bb8a0a92d6699afe7c8', 'd736e4d7e8644cf38f248e7ad87ed6ad');
INSERT INTO sys_role_menu (roleId, menuId)
VALUES ('6aece46b946e4fb9ac4cb15c0cd8c3e6', 'd736e4d7e8644cf38f248e7ad87ed6ad');
# 分管校领导审批
delete
from sys_role_menu
where menuId = '3e0bb63c5f0044bd837ad24633e92560';
INSERT INTO sys_role_menu (roleId, menuId)
VALUES ('7f4a820d5a394bb8a0a92d6699afe7c8', '3e0bb63c5f0044bd837ad24633e92560');
INSERT INTO sys_role_menu (roleId, menuId)
VALUES ('b3854469e6f44901b22bb791cb538431', '3e0bb63c5f0044bd837ad24633e92560');
delete
from sys_role_menu
where menuId = '35a9239d754c47b9afccce173cb72d64';
INSERT INTO sys_role_menu (roleId, menuId)
VALUES ('7f4a820d5a394bb8a0a92d6699afe7c8', '35a9239d754c47b9afccce173cb72d64');
INSERT INTO sys_role_menu (roleId, menuId)
VALUES ('b3854469e6f44901b22bb791cb538431', '35a9239d754c47b9afccce173cb72d64');
# 更新权限
UPDATE zhgh_cqgmy.sys_menu
SET permission = 'difficultHelp.firstApproval'
WHERE permission = 'difficultHelp.branchUnionApproval';
UPDATE zhgh_cqgmy.sys_menu
SET permission = 'difficultHelp.secondApproval'
WHERE permission = 'difficultHelp.unionLeaderApproval';
UPDATE zhgh_cqgmy.sys_menu
SET permission = 'difficultHelp.thirdApproval'
WHERE permission = 'difficultHelp.schoolUnionApproval';
UPDATE zhgh_cqgmy.sys_menu
SET permission = 'h5.difficultHelp.firstApproval'
WHERE permission = 'h5.difficultHelp.branchUnionApproval';
UPDATE zhgh_cqgmy.sys_menu
SET permission = 'h5.difficultHelp.secondApproval'
WHERE permission = 'h5.difficultHelp.unionLeaderApproval';
UPDATE zhgh_cqgmy.sys_menu
SET permission = 'h5.difficultHelp.thirdApproval'
WHERE permission = 'h5.difficultHelp.schoolUnionApproval';
# 新增字典项
INSERT INTO sys_dict (id, parentId, path, name, code, disabled, location, hasChildren, createdBy, createdAt, updatedBy,
updatedAt, delFlag, remark)
VALUES ('4d3e3472ae324552b16f0aaf07c37004', '501e0a4edca748ddb739ffb679170d50', '00020017', '校工会办公室主任',
'SCHOOL_OFFICE_DIRECTOR', false, 9614, false, '17a7f8ad3ee947b4a26175049a9c253d', 1791517263500,
'17a7f8ad3ee947b4a26175049a9c253d', 1791517263500, false, null);
ALTER TABLE difficult_help_info ADD COLUMN applyMoney VARCHAR(200) NULL COMMENT '申请金额';
@@ -0,0 +1,136 @@
START TRANSACTION;
-- 一级:分工会主席审批,节点 4dad0bef-3cf2-4a7d-bba3-35020b9b216d。
UPDATE zhgh_cqgmy.sys_menu
SET name = '分工会主席审批', initialPinyinName = 'f', note = '分工会主席审批',
permission = 'condolence.firstApproval'
WHERE id = '8e24dfdb70e448a899ea7de92319789c';
UPDATE zhgh_cqgmy.sys_menu
SET name = '分工会主席审批', initialPinyinName = 'f', note = '分工会主席审批',
permission = 'h5.condolence.firstApproval'
WHERE id = '330e42e0ae914f5392b96fb933f17b5b';
-- 二级:校工会办公室主任审批,节点 34f7938e-47a3-4b3a-b4e0-92b7a3f47865。
UPDATE zhgh_cqgmy.sys_menu
SET name = '校工会办公室主任审批', initialPinyinName = 'x', note = '校工会办公室主任审批',
permission = 'condolence.secondApproval'
WHERE id = '09a59e7a99204ceca8e5dbbf8b2fafcf';
UPDATE zhgh_cqgmy.sys_menu
SET name = '校工会办公室主任审批', initialPinyinName = 'x', note = '校工会办公室主任审批',
permission = 'h5.condolence.secondApproval'
WHERE id = '87a2dcfac0da4ec4870b65693807a4d1';
-- 三级:校工会主席审批,节点 ecdaef3b-edf4-4143-9a96-887dd5921711。
UPDATE zhgh_cqgmy.sys_menu
SET name = '校工会主席审批', initialPinyinName = 'x', note = '校工会主席审批',
permission = 'condolence.thirdApproval'
WHERE id = '0917928006574b2a99f7ef3e8804d873';
UPDATE zhgh_cqgmy.sys_menu
SET name = '校工会主席审批', initialPinyinName = 'x', note = '校工会主席审批',
permission = 'h5.condolence.thirdApproval'
WHERE id = 'c269f94a5c8a4a4a8c8de0bb8f8f9f9a';
-- 四级:分管校领导审批,节点 cbd41337-3c87-4959-9027-809df5c7ef5e。
INSERT INTO zhgh_cqgmy.sys_menu
(id, parentId, path, name, aliasName, type, href, target, icon, showit, disabled,
permission, note, location, hasChildren, createdBy, createdAt, updatedBy, updatedAt,
delFlag, processKey, platform, moduleId, isQuickEntry, picIcon, initialPinyinName,
isRecommendApp, isRecommendService)
VALUES ('3561e97f44d14b47ae07f63ff8312a90', '3b49290f7db44130b9f6394a8212321f', '00900009',
'分管校领导审批', null, 'menu', '/platform/condolence/fourthApproval', null, null, true, false,
'condolence.fourthApproval', '分管校领导审批', 146, false,
'17a7f8ad3ee947b4a26175049a9c253d', UNIX_TIMESTAMP() * 1000,
'17a7f8ad3ee947b4a26175049a9c253d', UNIX_TIMESTAMP() * 1000,
false, null, 'PC', '07d940ba34bd47399cda140894f5d86b', false, null, 'f', false, false);
INSERT INTO zhgh_cqgmy.sys_menu
(id, parentId, path, name, aliasName, type, href, target, icon, showit, disabled,
permission, note, location, hasChildren, createdBy, createdAt, updatedBy, updatedAt,
delFlag, processKey, platform, moduleId, isQuickEntry, picIcon, initialPinyinName,
isRecommendApp, isRecommendService)
VALUES ('f02d5a68bdeb4c63a1b8ce47296d7304', '024811fd168e44948e6ab84911fc26bb', '01220006',
'分管校领导审批', null, 'menu', '/platform/condolence/fourthApproval/h5', null, null, true, false,
'h5.condolence.fourthApproval', '分管校领导审批', 32, false,
'17a7f8ad3ee947b4a26175049a9c253d', UNIX_TIMESTAMP() * 1000,
'17a7f8ad3ee947b4a26175049a9c253d', UNIX_TIMESTAMP() * 1000,
false, null, 'H5', '586fffaeddc94a7493c81b6d69e546ab', false, '/platform/sys/file/download?id=d2095854e67dcf28dea1a4a975e90aba', 'f', false, false);
-- 清除之前的菜单角色权限,按审核角色重新配置。
-- 一级:分工会主席审批,节点 4dad0bef-3cf2-4a7d-bba3-35020b9b216d。
DELETE FROM zhgh_cqgmy.sys_role_menu WHERE menuId = '8e24dfdb70e448a899ea7de92319789c';
INSERT INTO zhgh_cqgmy.sys_role_menu (roleId, menuId)
VALUES ('7f4a820d5a394bb8a0a92d6699afe7c8', '8e24dfdb70e448a899ea7de92319789c');
INSERT INTO zhgh_cqgmy.sys_role_menu (roleId, menuId)
values ('fd753e8a8c5a404e8e00ef8e0b0c69da', '8e24dfdb70e448a899ea7de92319789c');
DELETE FROM zhgh_cqgmy.sys_role_menu WHERE menuId = '330e42e0ae914f5392b96fb933f17b5b';
INSERT INTO zhgh_cqgmy.sys_role_menu (roleId, menuId)
VALUES ('7f4a820d5a394bb8a0a92d6699afe7c8', '330e42e0ae914f5392b96fb933f17b5b');
INSERT INTO zhgh_cqgmy.sys_role_menu (roleId, menuId)
values ('fd753e8a8c5a404e8e00ef8e0b0c69da', '330e42e0ae914f5392b96fb933f17b5b');
-- 二级:校工会办公室主任审批,节点 34f7938e-47a3-4b3a-b4e0-92b7a3f47865。
DELETE FROM zhgh_cqgmy.sys_role_menu WHERE menuId = '09a59e7a99204ceca8e5dbbf8b2fafcf';
INSERT INTO zhgh_cqgmy.sys_role_menu (roleId, menuId)
VALUES ('7f4a820d5a394bb8a0a92d6699afe7c8', '09a59e7a99204ceca8e5dbbf8b2fafcf');
INSERT INTO zhgh_cqgmy.sys_role_menu (roleId, menuId)
VALUES ('494ac71eb8b44d0e99e19b7fde6bd469', '09a59e7a99204ceca8e5dbbf8b2fafcf');
DELETE FROM zhgh_cqgmy.sys_role_menu WHERE menuId = '87a2dcfac0da4ec4870b65693807a4d1';
INSERT INTO zhgh_cqgmy.sys_role_menu (roleId, menuId)
VALUES ('7f4a820d5a394bb8a0a92d6699afe7c8', '87a2dcfac0da4ec4870b65693807a4d1');
INSERT INTO zhgh_cqgmy.sys_role_menu (roleId, menuId)
VALUES ('494ac71eb8b44d0e99e19b7fde6bd469', '87a2dcfac0da4ec4870b65693807a4d1');
-- 三级:校工会主席审批,节点 ecdaef3b-edf4-4143-9a96-887dd5921711。
DELETE FROM zhgh_cqgmy.sys_role_menu WHERE menuId = '0917928006574b2a99f7ef3e8804d873';
INSERT INTO zhgh_cqgmy.sys_role_menu (roleId, menuId)
VALUES ('7f4a820d5a394bb8a0a92d6699afe7c8', '0917928006574b2a99f7ef3e8804d873');
INSERT INTO zhgh_cqgmy.sys_role_menu (roleId, menuId)
VALUES ('6aece46b946e4fb9ac4cb15c0cd8c3e6', '0917928006574b2a99f7ef3e8804d873');
DELETE FROM zhgh_cqgmy.sys_role_menu WHERE menuId = 'c269f94a5c8a4a4a8c8de0bb8f8f9f9a';
INSERT INTO zhgh_cqgmy.sys_role_menu (roleId, menuId)
VALUES ('7f4a820d5a394bb8a0a92d6699afe7c8', 'c269f94a5c8a4a4a8c8de0bb8f8f9f9a');
INSERT INTO zhgh_cqgmy.sys_role_menu (roleId, menuId)
VALUES ('6aece46b946e4fb9ac4cb15c0cd8c3e6', 'c269f94a5c8a4a4a8c8de0bb8f8f9f9a');
DELETE FROM zhgh_cqgmy.sys_role_menu WHERE menuId = '3561e97f44d14b47ae07f63ff8312a90';
INSERT INTO zhgh_cqgmy.sys_role_menu (roleId, menuId)
VALUES ('7f4a820d5a394bb8a0a92d6699afe7c8', '3561e97f44d14b47ae07f63ff8312a90');
INSERT INTO zhgh_cqgmy.sys_role_menu (roleId, menuId)
VALUES ('b3854469e6f44901b22bb791cb538431', '3561e97f44d14b47ae07f63ff8312a90');
DELETE FROM zhgh_cqgmy.sys_role_menu WHERE menuId = 'f02d5a68bdeb4c63a1b8ce47296d7304';
INSERT INTO zhgh_cqgmy.sys_role_menu (roleId, menuId)
VALUES ('7f4a820d5a394bb8a0a92d6699afe7c8', 'f02d5a68bdeb4c63a1b8ce47296d7304');
INSERT INTO zhgh_cqgmy.sys_role_menu (roleId, menuId)
VALUES ('b3854469e6f44901b22bb791cb538431', 'f02d5a68bdeb4c63a1b8ce47296d7304');
-- 补充职工慰问父菜单权限。
INSERT IGNORE INTO zhgh_cqgmy.sys_role_menu (roleId, menuId)
VALUES ('7f4a820d5a394bb8a0a92d6699afe7c8', '3b49290f7db44130b9f6394a8212321f');
INSERT IGNORE INTO zhgh_cqgmy.sys_role_menu (roleId, menuId)
VALUES ('494ac71eb8b44d0e99e19b7fde6bd469', '3b49290f7db44130b9f6394a8212321f');
INSERT IGNORE INTO zhgh_cqgmy.sys_role_menu (roleId, menuId)
VALUES ('6aece46b946e4fb9ac4cb15c0cd8c3e6', '3b49290f7db44130b9f6394a8212321f');
INSERT IGNORE INTO zhgh_cqgmy.sys_role_menu (roleId, menuId)
VALUES ('b3854469e6f44901b22bb791cb538431', '3b49290f7db44130b9f6394a8212321f');
INSERT IGNORE INTO zhgh_cqgmy.sys_role_menu (roleId, menuId)
SELECT id, '3b49290f7db44130b9f6394a8212321f' FROM zhgh_cqgmy.sys_role WHERE code = 'BRANCH_UNION_CHAIRMAN' AND disabled = false AND delFlag = false;
INSERT IGNORE INTO zhgh_cqgmy.sys_role_menu (roleId, menuId)
VALUES ('7f4a820d5a394bb8a0a92d6699afe7c8', '024811fd168e44948e6ab84911fc26bb');
INSERT IGNORE INTO zhgh_cqgmy.sys_role_menu (roleId, menuId)
VALUES ('494ac71eb8b44d0e99e19b7fde6bd469', '024811fd168e44948e6ab84911fc26bb');
INSERT IGNORE INTO zhgh_cqgmy.sys_role_menu (roleId, menuId)
VALUES ('6aece46b946e4fb9ac4cb15c0cd8c3e6', '024811fd168e44948e6ab84911fc26bb');
INSERT IGNORE INTO zhgh_cqgmy.sys_role_menu (roleId, menuId)
VALUES ('b3854469e6f44901b22bb791cb538431', '024811fd168e44948e6ab84911fc26bb');
INSERT IGNORE INTO zhgh_cqgmy.sys_role_menu (roleId, menuId)
SELECT id, '024811fd168e44948e6ab84911fc26bb' FROM zhgh_cqgmy.sys_role WHERE code = 'BRANCH_UNION_CHAIRMAN' AND disabled = false AND delFlag = false;
COMMIT;
@@ -0,0 +1,14 @@
truncate table condolence_type;
INSERT INTO condolence_type (id, code, name, money, way, disabled, isUploadFile, uploadFileDesc, sortNum, createdBy, createdAt, updatedBy, updatedAt, delFlag, isDisabled, location, uploadMeetingRecord, enable) VALUES ('00016fcb72234a8f95cd173665bbe563', 'C3', '生育(三孩)', 5000.00, '慰问金 (A)', false, null, null, 0, '17a7f8ad3ee947b4a26175049a9c253d', 1791539298087, '17a7f8ad3ee947b4a26175049a9c253d', 1791539298087, false, null, 8, false, true);
INSERT INTO condolence_type (id, code, name, money, way, disabled, isUploadFile, uploadFileDesc, sortNum, createdBy, createdAt, updatedBy, updatedAt, delFlag, isDisabled, location, uploadMeetingRecord, enable) VALUES ('3777d15929dd4c66b3aa9ae67dc62528', 'C2', '生育(二孩)', 3000.00, '慰问金 (A)', false, null, null, 0, '17a7f8ad3ee947b4a26175049a9c253d', 1791539214037, '17a7f8ad3ee947b4a26175049a9c253d', 1791539269588, false, null, 7, false, true);
INSERT INTO condolence_type (id, code, name, money, way, disabled, isUploadFile, uploadFileDesc, sortNum, createdBy, createdAt, updatedBy, updatedAt, delFlag, isDisabled, location, uploadMeetingRecord, enable) VALUES ('4cdf253d26044261a1a81359bbde1bb8', 'G', '直系亲属去世', 2000.00, '慰问金 (A)', false, true, '', 0, '17a7f8ad3ee947b4a26175049a9c253d', 1765427298440, '17a7f8ad3ee947b4a26175049a9c253d', 1791539615689, false, null, 2, false, true);
INSERT INTO condolence_type (id, code, name, money, way, disabled, isUploadFile, uploadFileDesc, sortNum, createdBy, createdAt, updatedBy, updatedAt, delFlag, isDisabled, location, uploadMeetingRecord, enable) VALUES ('4e316737e71047e0b01aea78524c1416', 'E', '生病住院', 1000.00, '慰问金 (A)', false, true, '每年累计不超过3000元、每人每年最多申请3次', 1, '29847d7826aa415a92d03b9576d01d3f', 1722084651317, '29847d7826aa415a92d03b9576d01d3f', 1791539558039, false, false, null, false, true);
INSERT INTO condolence_type (id, code, name, money, way, disabled, isUploadFile, uploadFileDesc, sortNum, createdBy, createdAt, updatedBy, updatedAt, delFlag, isDisabled, location, uploadMeetingRecord, enable) VALUES ('5b5f135e523d4cc5b5dc4355ffe9e024', 'B', '生日', 600.00, '慰问金 (A)', false, null, null, 0, '17a7f8ad3ee947b4a26175049a9c253d', 1791539148841, '17a7f8ad3ee947b4a26175049a9c253d', 1791539148841, false, null, 6, false, true);
INSERT INTO condolence_type (id, code, name, money, way, disabled, isUploadFile, uploadFileDesc, sortNum, createdBy, createdAt, updatedBy, updatedAt, delFlag, isDisabled, location, uploadMeetingRecord, enable) VALUES ('60f03a87b62b4823855814afdbf5672a', 'F', '会员去世', 3000.00, '慰问金 (A)', false, true, '需要提供购买的慰问品发票,慰问照片', 0, '17a7f8ad3ee947b4a26175049a9c253d', 1765427276486, '17a7f8ad3ee947b4a26175049a9c253d', 1791539570707, false, null, 1, false, true);
INSERT INTO condolence_type (id, code, name, money, way, disabled, isUploadFile, uploadFileDesc, sortNum, createdBy, createdAt, updatedBy, updatedAt, delFlag, isDisabled, location, uploadMeetingRecord, enable) VALUES ('b8ee30faacb2469593dfedb5b52565aa', 'D', '光荣退休', 2000.00, '慰问金 (A)', false, true, '需要提供购买的慰问品发票,慰问照片', 0, '17a7f8ad3ee947b4a26175049a9c253d', 1765427383848, '17a7f8ad3ee947b4a26175049a9c253d', 1791539529423, false, null, 3, false, true);
INSERT INTO condolence_type (id, code, name, money, way, disabled, isUploadFile, uploadFileDesc, sortNum, createdBy, createdAt, updatedBy, updatedAt, delFlag, isDisabled, location, uploadMeetingRecord, enable) VALUES ('c90cb10dce6542e99ae271bee6fe8cc0', 'C1', '生育(一孩)', 2000.00, '慰问金 (A)', false, true, '需要提供购买的慰问品发票,慰问照片(会员与婴儿合影照,或慰问人员与会员和婴儿的合影照)', 0, '17a7f8ad3ee947b4a26175049a9c253d', 1765427542820, '17a7f8ad3ee947b4a26175049a9c253d', 1791539263656, false, null, 5, false, true);
INSERT INTO condolence_type (id, code, name, money, way, disabled, isUploadFile, uploadFileDesc, sortNum, createdBy, createdAt, updatedBy, updatedAt, delFlag, isDisabled, location, uploadMeetingRecord, enable) VALUES ('cf4ce7af322d464f8f86d818fcc00203', 'A', '结婚', 1000.00, '慰问金 (A)', false, true, '需要提供购买的慰问品的发票、慰问照片、会员的结婚证复印件', 2, '29847d7826aa415a92d03b9576d01d3f', 1722084861840, '29847d7826aa415a92d03b9576d01d3f', 1768875320985, false, false, null, false, true);
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,6 +1,6 @@
<template>
<div class="signature-wrap">
<canvas id="canvas"></canvas>
<canvas ref="canvas" @touchstart.stop @touchmove.stop></canvas>
<div :class="isLikelyMobile() ? 'action-buttons' : 'action-buttons pc-action-buttons'">
<button @click="clear" class="action-button-danger" type="button">清空</button>
<button @click="undo" class="action-button-warning" type="button">撤销</button>
@@ -30,23 +30,23 @@
// window.addEventListener("orientationchange", a)
// a()
let signature = null
module.exports = {
name: "sysSignature",
data() {
return {
content: null
content: null,
signature: null
}
},
methods: {
clear() {
signature.clear()
this.signature.clear()
},
undo() {
signature.undo()
this.signature.undo()
},
rotate() {
signature.getRotateCanvas(90)
this.signature.getRotateCanvas(90)
},
isLikelyMobile() {
const isTouchDevice = 'ontouchstart' in window || navigator.maxTouchPoints > 0;
@@ -56,7 +56,7 @@ module.exports = {
return hasMobileUA || (isTouchDevice && isSmallScreen);
},
save() {
if (signature.isEmpty()) {
if (this.signature.isEmpty()) {
// H5 页面使用统一的 Vant 提示;未加载 Vant 的独立签字页保留原生提示作为兼容兜底。
if (typeof this.$toast === "function") {
this.$toast({
@@ -71,11 +71,11 @@ module.exports = {
}
// const png = signature.getPNG()
//旋转一下 横过来
const rotateCanvas = signature.getRotateCanvas(-90)
const rotateCanvas = this.signature.getRotateCanvas(-90)
if (this.isLikelyMobile()) {
this.$emit("save", rotateCanvas.toDataURL())
} else {
this.$emit("save", signature.toDataURL())
this.$emit("save", this.signature.toDataURL())
}
}
},
@@ -83,10 +83,10 @@ module.exports = {
const innerWidth = window.innerWidth
const innerHeight = window.innerHeight
const canvas = document.getElementById("canvas")
const canvas = this.$refs.canvas
canvas.width = window.innerWidth
canvas.height = window.innerHeight
signature = new SmoothSignature(canvas, {
this.signature = new SmoothSignature(canvas, {
width: innerWidth - 30,
height: innerHeight - 30,
scale: 2,
@@ -95,6 +95,15 @@ module.exports = {
color: "#000000"
// bgColor: "#f6f6f6"
})
canvas.addEventListener("touchstart", this.signature.onDrawStart, { passive: false })
canvas.addEventListener("touchmove", this.signature.onDrawMove, { passive: false })
document.addEventListener("touchend", this.signature.onDrawEnd, { passive: false })
document.addEventListener("touchcancel", this.signature.onDrawEnd, { passive: false })
},
beforeDestroy() {
if (this.signature) {
this.signature.removeListener()
}
}
}
</script>
@@ -219,6 +219,15 @@ layout("/layouts/platform.html"){
new Vue({
el: "#app",
store,
components: {
ElDatePicker: {
extends: ELEMENT.DatePicker,
mounted() {
// 手动输入触发 change 前初始化日期面板,避免 picker 尚未创建。
if (!this.picker) this.mountPicker()
}
}
},
data() {
return {
bizId: GetQueryString("bizId"),
@@ -81,6 +81,9 @@ layout("/layouts/platform.html"){
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<user-opinion-textarea v-model="formData.tf_opinion"></user-opinion-textarea>
</el-form-item>
<el-form-item label="签字" prop="tf_sign" :rules="[{required:true,message:'请完成审批签字',trigger:['change','blur']}]">
<pc-signature v-model="formData.tf_sign" :key="formData.processTaskId"></pc-signature>
</el-form-item>
</el-form>
<el-row type="flex" justify="end">
<el-button @click="handleTaskAction(1)" size="small" type="primary">同意申请</el-button>
@@ -135,18 +138,26 @@ layout("/layouts/platform.html"){
this.showApprovalForm = true
this.formData = {
processTaskId: row.taskId,
taskName: row.curTaskName
taskName: row.curTaskName,
tf_sign: "",
tf_opinion: ""
}
this.$refs.condolenceInfoRef.onOpen(row)
})
},
handleTaskAction(val) {
async handleTaskAction(val) {
try {
const valid = await this.$refs.formRef.validate()
if (!valid) return
} catch (error) {
return
}
this.$confirm("您确定要提交吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.$axios.post("/flow/common/executeTask", {
this.$axios.post("/platform/condolence/approval/executeTask", {
data: JSON.stringify({
...this.formData,
submitType: val
@@ -65,6 +65,9 @@ const condolenceInfo = {
<dict-tag :options="dict.type.PROCESS_TASK_SUBMIT_TYPE"
:value="task.ext.submitType"></dict-tag>
</el-descriptions-item>
<el-descriptions-item label="审批签字" :span="3" v-if="task.taskFormData && task.taskFormData.sign">
<el-image :src="task.taskFormData.sign" style="height: 80px" fit="contain"></el-image>
</el-descriptions-item>
<el-descriptions-item label="办理意见" v-if="!task.ext.isFirstTaskNode">{{
task.taskFormData.opinion }}
</el-descriptions-item>
@@ -0,0 +1,229 @@
<!--#
layout("/layouts/platform.html"){
#-->
<div id="app">
<guava ref="guava">
<el-card shadow="never">
<search @search="doSearch">
<search-item label="年度">
<el-date-picker
v-model="pageForm.year"
type="year"
value-format="yyyy"
placeholder="请选择年度"
style="width: 100%"
@change="doSearch"
></el-date-picker>
</search-item>
<search-item label="姓名/工号">
<el-input placeholder="请输入姓名或工号" clearable v-model="pageForm.searchKeyword"
@keyup.enter.native="doSearch">
</el-input>
</search-item>
<search-item label="慰问类型">
<el-select v-model="pageForm.type" @change="doSearch" style="width: 100%"
placeholder="请选择慰问类型" filterable clearable>
<el-option v-for="item in typeOptions"
:value="item.id"
:key="item.id"
:label="item.name"
></el-option>
</el-select>
</search-item>
<search-item label="所属工会">
<el-select v-model="pageForm.unionId" placeholder="请选择所属工会" filterable clearable
@change="doSearch" style="width: 100%">
<el-option
v-for="item in unionList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</search-item>
<search-item label="所属单位">
<el-select @change="doSearch"
clearable
filterable
placeholder="请选择单位" style="width: 100%" v-model="pageForm.unitId">
<el-option :key="item.id" :label="item.name" :value="item.id" v-for="item in unitList"></el-option>
</el-select>
</search-item>
</search>
</el-card>
<el-card shadow="never">
<table-tool label="申请列表">
<el-radio-group v-model="pageForm.approval" size="small" @change="doSearch">
<el-radio-button :label="true">已审核</el-radio-button>
<el-radio-button :label="false">未审核</el-radio-button>
</el-radio-group>
</table-tool>
<el-table :data="tableData" @sort-change="pageOrder" style="width: 100%">
<el-table-column type="index" width="50px" label="序号" :index="indexMethod"></el-table-column>
<el-table-column
:label="column.label"
:prop="column.prop"
:key="column.prop"
:width="column.width"
:sortable="column.sortable"
align="center"
header-align="center"
show-overflow-tooltip
v-for="column in tableColumns"
>
<template v-slot="{ row }" v-if="column.prop === 'instanceState'">
<enum-tag :value="row.instanceState" name="ProcessInstanceStateEnum" label_key="message" size="small"></enum-tag>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" width="300px">
<template slot-scope="{row}">
<el-button @click="onView(row)" size="mini" type="primary">查看</el-button>
<el-button v-if="row.taskState === 10" @click="onAudit(row)" size="mini" type="primary">审核</el-button>
<el-button v-if="row.canRevoke" @click="onRevoke(row)" size="mini" type="danger">撤回</el-button>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
<template #edit>
<condolence-info ref="condolenceInfoRef">
<div v-if="showApprovalForm">
<div class="process-title">
{{formData.taskName}}
</div>
<el-form :model="formData" ref="formRef" :rules="formRules" label-width="0" label-suffix=":"
class="flow-task-form">
<el-form-item label="审批意见" prop="tf_opinion"
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<user-opinion-textarea v-model="formData.tf_opinion"></user-opinion-textarea>
</el-form-item>
<el-form-item label="签字" prop="tf_sign" :rules="[{required:true,message:'请完成审批签字',trigger:['change','blur']}]">
<pc-signature v-model="formData.tf_sign" :key="formData.processTaskId"></pc-signature>
</el-form-item>
</el-form>
<el-row type="flex" justify="end">
<el-button @click="handleTaskAction(1)" size="small" type="primary">同意申请</el-button>
<el-button @click="handleTaskAction(2)" size="small" type="danger">拒绝申请</el-button>
<el-button @click="handleTaskAction(6)" size="small" type="info">退回到发起人</el-button>
<el-button @click="$refs.guava.index()" size="small">取消</el-button>
</el-row>
</div>
</condolence-info>
</template>
</guava>
</div>
<script nonce="${cspNonce!}">
<!--#include('../common/info.js'){}#-->
new Vue({
el: "#app",
store,
mixins: [initTableMixins],
components: {
"condolence-info": condolenceInfo
},
data() {
return {
pageForm: {
approval: false
},
typeOptions: [],
tableColumns: [
{prop: 'helpUserName', label: '慰问对象'},
{prop: 'helpLoginName', label: '慰问对象工号'},
{prop: 'applyUserName', label: '申请人'},
{prop: 'applyUnionName', label: '所属工会'},
{prop: 'applyUnitName', label: '所属单位'},
{prop: 'typeName', label: '慰问类型'},
{prop: 'curTaskName', label: '当前节点'},
{prop: 'instanceState', label: '流程状态'},
],
unionList: [],
unitList: [],
formData: {},
showApprovalForm: false
}
},
methods: {
onView(row) {
this.$refs.guava.edit(()=>{
this.showApprovalForm = false
this.$refs.condolenceInfoRef.onOpen(row)
})
},
onAudit(row) {
this.$refs.guava.edit(()=>{
this.showApprovalForm = true
this.formData = {
processTaskId: row.taskId,
taskName: row.curTaskName,
tf_sign: "",
tf_opinion: ""
}
this.$refs.condolenceInfoRef.onOpen(row)
})
},
async handleTaskAction(val) {
try {
const valid = await this.$refs.formRef.validate()
if (!valid) return
} catch (error) {
return
}
this.$confirm("您确定要提交吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.$axios.post("/platform/condolence/approval/executeTask", {
data: JSON.stringify({
...this.formData,
submitType: val
})
}).then((res) => {
if (res.code === 0) {
this.$refs.guava.index()
this.$message.success(res.msg)
this.doSearch()
}
})
})
},
onRevoke(row) {
this.$confirm("您确定要撤回吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "info"
}).then(() => {
this.$axios.post("/flow/common/revokeTask", {taskId: row.taskId}).then((res) => {
if (res.code === 0) {
this.$message.success(res.msg)
this.doSearch()
}
})
})
},
queryCondolenceType() {
this.$axios.post('/platform/condolence/type/queryCondolenceType')
.then((resp) => {
this.typeOptions = resp.data
})
},
},
async created() {
this.unionList = await this.$businessTool.listUnion()
this.unitList = await this.$businessTool.listUnit()
this.queryCondolenceType()
this.pageData()
}
})
</script>
<!--#
}
#-->
@@ -62,6 +62,13 @@ layout("/layouts/platform.html"){
<el-button @click="onView(row)" size="mini" type="primary">查看</el-button>
<el-button v-if="row.taskKey === 'startTask' || !row.instanceId" @click="onEdit(row)" size="mini" type="primary">编辑</el-button>
<el-button v-if="row.canRevoke" size="mini" type="danger" @click="onRevoke(row)">撤回</el-button>
<el-dropdown v-if="row.createdBy === $store.state.user.id && row.instanceState == 20" trigger="click" @command="format => doExportApply(row, format)">
<el-button size="mini" type="primary">导出</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="pdf">导出 PDF</el-dropdown-item>
<el-dropdown-item command="word">导出 Word</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<el-button v-if="row.taskKey === 'startTask' || !row.instanceId" @click="onDelete(row.id)" size="mini" type="danger">
删除
</el-button>
@@ -102,6 +109,9 @@ layout("/layouts/platform.html"){
}
},
methods: {
doExportApply(row, format) {
this.$downLoad('/platform/condolence/mine/doExportApply?id=' + row.id + '&print=' + (format === 'pdf'))
},
onAdd() {
commonUtil.pjaxPush('/platform/condolence/apply')
},
@@ -101,6 +101,9 @@ layout("/layouts/platform.html"){
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<user-opinion-textarea v-model="formData.tf_opinion"></user-opinion-textarea>
</el-form-item>
<el-form-item label="签字" prop="tf_sign" :rules="[{required:true,message:'请完成审批签字',trigger:['change','blur']}]">
<pc-signature v-model="formData.tf_sign" :key="formData.processTaskId"></pc-signature>
</el-form-item>
</el-form>
<el-row type="flex" justify="end">
<el-button @click="handleTaskAction(1)" size="small" type="primary">同意申请</el-button>
@@ -158,18 +161,26 @@ layout("/layouts/platform.html"){
this.showApprovalForm = true
this.formData = {
processTaskId: row.taskId,
taskName: row.curTaskName
taskName: row.curTaskName,
tf_sign: "",
tf_opinion: ""
}
this.$refs.condolenceInfoRef.onOpen(row)
})
},
handleTaskAction(val) {
async handleTaskAction(val) {
try {
const valid = await this.$refs.formRef.validate()
if (!valid) return
} catch (error) {
return
}
this.$confirm("您确定要提交吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.$axios.post("/flow/common/executeTask", {
this.$axios.post("/platform/condolence/approval/executeTask", {
data: JSON.stringify({
...this.formData,
submitType: val
@@ -101,6 +101,9 @@ layout("/layouts/platform.html"){
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<user-opinion-textarea v-model="formData.tf_opinion"></user-opinion-textarea>
</el-form-item>
<el-form-item label="签字" prop="tf_sign" :rules="[{required:true,message:'请完成审批签字',trigger:['change','blur']}]">
<pc-signature v-model="formData.tf_sign" :key="formData.processTaskId"></pc-signature>
</el-form-item>
</el-form>
<el-row type="flex" justify="end">
<el-button @click="handleTaskAction(1)" size="small" type="primary">同意申请</el-button>
@@ -158,18 +161,26 @@ layout("/layouts/platform.html"){
this.showApprovalForm = true
this.formData = {
processTaskId: row.taskId,
taskName: row.curTaskName
taskName: row.curTaskName,
tf_sign: "",
tf_opinion: ""
}
this.$refs.condolenceInfoRef.onOpen(row)
})
},
handleTaskAction(val) {
async handleTaskAction(val) {
try {
const valid = await this.$refs.formRef.validate()
if (!valid) return
} catch (error) {
return
}
this.$confirm("您确定要提交吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.$axios.post("/flow/common/executeTask", {
this.$axios.post("/platform/condolence/approval/executeTask", {
data: JSON.stringify({
...this.formData,
submitType: val
@@ -17,7 +17,7 @@
@change="modeChange"
:disabled="formData.id" style="width: 100%">
<el-option label="本人申请" value="1"></el-option>
<el-option v-if="$auth.hasRoleOr('SYSADMIN, SCHOOL_UNION_ADMIN, BRANCH_UNION_CHAIRMAN, BRANCH_UNION_OPERATOR')"
<el-option v-if="$auth.hasRoleOr('BRANCH_UNION_CHAIRMAN')"
label="替他人申请" value="2"></el-option>
</el-select>
</el-form-item>
@@ -127,7 +127,12 @@
</el-descriptions-item>
<el-descriptions-item label="申请原因" :span="3">
<el-descriptions-item label="申请金额(元)">
<el-form-item prop="applyMoney" :rules="[{required:true,type:'number',min:0.01,message:'请填写大于零的申请金额',trigger:['change','blur']}]">
<el-input-number v-model="formData.applyMoney" :precision="2" :min="0.01" placeholder="请输入申请金额"></el-input-number>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="申请原因" :span="3">
<el-form-item prop="reason">
<el-input maxlength="500" :autosize="{ minRows: 5, maxRows: 10}"
placeholder="请简述申请原因"
@@ -230,6 +235,7 @@
businessId: GetQueryString("businessId"),
instanceId: GetQueryString("instanceId"),
formData: {
applyMoney: undefined,
id: GetQueryString("businessId"),
mode: '1'
},
@@ -263,6 +269,9 @@
methods: {
// 查询受助人
queryRecipients(key) {
if (String(this.formData.mode) !== "2" || !this.$auth.hasRoleOr('BRANCH_UNION_CHAIRMAN')) {
return
}
this.$axios.get("/platform/difficultHelp/apply/queryRecipients", {
key
}).then(res => {
@@ -417,10 +426,10 @@
this.$set(this.formData, 'proxyLoginName', user.loginname)
this.$set(this.formData, 'mode', "1")
this.$set(this.formData, 'sex', user.sex)
this.$set(this.formData, 'unitId', user.unit.id)
this.$set(this.formData, 'unitName', user.unit.name)
this.$set(this.formData, 'unionId', user.union.id)
this.$set(this.formData, 'unionName', user.union.name)
this.$set(this.formData, 'unitId', (user.unit || {}).id || user.unitId || null)
this.$set(this.formData, 'unitName', (user.unit || {}).name || '')
this.$set(this.formData, 'unionId', (user.union || {}).id || (user.unit || {}).unionId || null)
this.$set(this.formData, 'unionName', (user.union || {}).name || '')
this.$set(this.formData, 'monthlyIncome', null)
this.$set(this.formData, 'birthday', user.birthday)
this.$set(this.formData, 'mobile', user.mobile)
@@ -15,7 +15,7 @@ layout("/layouts/platform.html"){
<el-form-item prop="mode">
<el-select v-model="formData.mode" placeholder="申请模式" @change="modeChange" style="width: 100%">
<el-option label="本人申请" value="1"></el-option>
<el-option v-if="$auth.hasRoleOr('SYSADMIN, SCHOOL_UNION_ADMIN, BRANCH_UNION_CHAIRMAN, BRANCH_UNION_OPERATOR')"
<el-option v-if="$auth.hasRoleOr('BRANCH_UNION_CHAIRMAN')"
label="替他人申请" value="2"></el-option>
</el-select>
</el-form-item>
@@ -151,7 +151,12 @@ layout("/layouts/platform.html"){
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="生活致困原因" :span="3">
<el-descriptions-item label="申请金额(元)">
<el-form-item prop="applyMoney" :rules="[{required:true,type:'number',min:0.01,message:'请填写大于零的申请金额',trigger:['change','blur']}]">
<el-input-number v-model="formData.applyMoney" :precision="2" :min="0.01" placeholder="请输入申请金额"></el-input-number>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="生活致困原因" :span="3">
<el-form-item prop="reason">
<el-input maxlength="500" :autosize="{ minRows: 5, maxRows: 10}"
placeholder="请简述生活致困原因"
@@ -292,7 +297,7 @@ layout("/layouts/platform.html"){
</el-card>
<div v-else>
<el-card class="box-card" style="height: 92vh" shadow="never">
<el-result icon="warning" title="温馨提醒" subTitle="">
<el-result icon="warning" title="温馨提醒" sub-title="">
<template slot="extra">
<span v-if="blockMessage">{{blockMessage}}</span>
<span v-else>抱歉,当前时间不能申请,可申请时间为{{time}}。</span>
@@ -315,6 +320,7 @@ layout("/layouts/platform.html"){
time: '',
blockMessage: '',
formData: {
applyMoney: undefined,
id: GetQueryString("bizId"),
mode: '1',
applyCount: '1',
@@ -429,6 +435,9 @@ layout("/layouts/platform.html"){
// 查询受助人
queryRecipients(key) {
if (String(this.formData.mode) !== "2" || !this.$auth.hasRoleOr('BRANCH_UNION_CHAIRMAN')) {
return
}
this.$axios.post("/platform/difficultHelp/apply/queryRecipients", {
key
}).then(res => {
@@ -486,10 +495,10 @@ layout("/layouts/platform.html"){
this.$set(this.formData, 'proxyLoginName', user.loginname)
this.$set(this.formData, 'mode', "1")
this.$set(this.formData, 'sex', user.sex)
this.$set(this.formData, 'unitId', user.unit.id)
this.$set(this.formData, 'unitName', user.unit.name)
this.$set(this.formData, 'unionId', user.union.id)
this.$set(this.formData, 'unionName', user.union.name)
this.$set(this.formData, 'unitId', (user.unit || {}).id || user.unitId || null)
this.$set(this.formData, 'unitName', (user.unit || {}).name || '')
this.$set(this.formData, 'unionId', (user.union || {}).id || (user.unit || {}).unionId || null)
this.$set(this.formData, 'unionName', (user.union || {}).name || '')
this.$set(this.formData, 'yearIncome', null)
this.$set(this.formData, 'birthday', user.birthday)
this.$set(this.formData, 'idCard', user.idCard)
@@ -605,7 +614,7 @@ layout("/layouts/platform.html"){
this.$axios.post('/platform/difficultHelp/apply/getIsCanPlay').then(res => {
if (res.code === 0) {
// 新增申请进入页面时,优先校验当前登录人本年度是否已经申请过,已申请则直接拦截新增。
if (!this.bizId && res.data.hasCurrentYearApply) {
if (!this.bizId && res.data.hasCurrentYearApply && !this.$auth.hasRoleOr('BRANCH_UNION_CHAIRMAN')) {
this.isShow = false
this.$set(this, 'blockMessage', '抱歉,您本年度已申请困难帮扶,不能重复申请。')
} else {
@@ -1,8 +1,23 @@
<div id="difficult_help_branch_union_approval_form">
<el-form :model="formData" ref="formRef" label-width="0" label-suffix=":" class="flow-task-form">
<el-form :model="formData" ref="formRef" label-width="100px" label-suffix=":">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="级别" prop="level" :rules="[{required:true,message:'请选择级别',trigger:['change','blur']}]">
<dict-select v-model="formData.level" code="DIFFICULT_LEVEL" style="width: 100%" placeholder="请选择级别"></dict-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="帮扶金额" prop="money" :rules="[{required:true,message:'请填写帮扶金额',trigger:['change','blur']}]">
<el-input-number v-model="formData.money" style="width: 100%" :precision="2" :min="0" placeholder="请输入帮扶金额"></el-input-number>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="审批意见" prop="tf_opinion" :rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<user-opinion-textarea v-model="formData.tf_opinion"></user-opinion-textarea>
</el-form-item>
<el-form-item label="签字" prop="tf_sign" :rules="[{required:true,message:'请完成审批签字',trigger:['change','blur']}]">
<pc-signature v-model="formData.tf_sign" :key="formData.processTaskId"></pc-signature>
</el-form-item>
</el-form>
<snaker-flow-task-form-action @task-action="handleTaskAction" @cancel="handleCancel"></snaker-flow-task-form-action>
</div>
@@ -14,14 +29,23 @@
return {
businessId: GetQueryString("businessId"),
formData: {
tf_opinion: ""
level: "",
money: undefined,
tf_sign: "", tf_opinion: ""
},
}
},
methods: {
handleTaskAction(val) {
async handleTaskAction(val) {
try {
const valid = await this.$refs.formRef.validate()
if (!valid) return
} catch (error) {
return
}
console.log(val)
this.$axios.post("/flow/common/executeTask", {
this.$axios.post("/platform/difficultHelp/approval/executeTask", {
data: JSON.stringify({
...val,
...this.formData
@@ -82,18 +82,56 @@ layout("/layouts/platform.html"){
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
<el-dialog title="设置帮扶审批信息" :visible.sync="batchVisible" width="760px">
<el-form :model="batchForm" ref="batchFormRef" label-width="130px">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="级别" prop="level" :rules="[{required:true,message:'请选择级别',trigger:['change','blur']}]">
<dict-select v-model="batchForm.level" code="DIFFICULT_LEVEL" style="width: 100%" placeholder="请选择级别"></dict-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="帮扶金额(元)" prop="money" :rules="[{required:true,message:'请填写帮扶金额',trigger:['change','blur']}]">
<el-input-number v-model="batchForm.money" style="width: 100%" :precision="2" :min="0" placeholder="请输入帮扶金额"></el-input-number>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="审批意见" prop="tf_opinion" :rules="[{required:true,whitespace:true,message:'请填写审批意见',trigger:['change','blur']}]">
<user-opinion-textarea v-model="batchForm.tf_opinion"></user-opinion-textarea>
</el-form-item>
<el-form-item label="签字" prop="tf_sign" :rules="[{required:true,message:'请完成审批签字',trigger:['change','blur']}]">
<pc-signature v-model="batchForm.tf_sign" :key="batchForm.processTaskId"></pc-signature>
</el-form-item>
</el-form>
<span slot="footer"><el-button @click="batchVisible = false">取消</el-button><el-button type="primary" @click="submitBatch">确定</el-button></span>
</el-dialog>
<template #edit>
<info ref="infoRef">
<div v-if="showApprovalForm">
<div class="process-title">
{{formData.taskName}}
</div>
<el-form :model="formData" ref="formRef" :rules="formRules" label-width="0" label-suffix=":"
class="flow-task-form">
<el-form :model="formData" ref="formRef" :rules="formRules" label-width="100px" label-suffix=":">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="级别" prop="level" :rules="[{required:true,message:'请选择级别',trigger:['change','blur']}]">
<dict-select v-model="formData.level" code="DIFFICULT_LEVEL" style="width: 100%" placeholder="请选择级别"></dict-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="帮扶金额" prop="money" :rules="[{required:true,message:'请填写帮扶金额',trigger:['change','blur']}]">
<el-input-number v-model="formData.money" style="width: 100%" :precision="2" :min="0" placeholder="请输入帮扶金额"></el-input-number>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="审批意见" prop="tf_opinion"
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<user-opinion-textarea v-model="formData.tf_opinion"></user-opinion-textarea>
</el-form-item>
<el-form-item label="签字" prop="tf_sign" :rules="[{required:true,message:'请完成审批签字',trigger:['change','blur']}]">
<pc-signature v-model="formData.tf_sign" :key="formData.processTaskId"></pc-signature>
</el-form-item>
</el-form>
<el-row type="flex" justify="end">
<el-button @click="handleTaskAction(1)" size="small" type="primary">同意申请</el-button>
@@ -132,13 +170,15 @@ layout("/layouts/platform.html"){
{ prop: "subsidyStandards", label: "困难类型", sortable: true },
{ prop: "applyTime", label: "申请时间", sortable: true },
{ prop: "applyCount", label: "申请次数", sortable: true },
{ prop: "taskName", label: "当前节点" },
{ prop: "curTaskName", label: "当前节点" },
{ prop: "instanceState", label: "流程状态" }
],
unions: [],
units: [],
formData: {},
batchVisible: false,
batchForm: {level: "", money: undefined, tf_sign: "", tf_opinion: ""},
showApprovalForm: false,
selectData: []
}
@@ -168,12 +208,23 @@ layout("/layouts/platform.html"){
return;
}
this.batchForm = {level: "", money: undefined, tf_sign: "", tf_opinion: ""}
this.batchVisible = true
},
async submitBatch() {
try {
const valid = await this.$refs.batchFormRef.validate()
if (!valid) return
} catch (error) {
return
}
const message = '确定要一键审核这 ' + this.selectData.length + ' 条记录吗?';
this.$confirm(message, '批量审核确认', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.batchVisible = false;
this.batchApprove(this.selectData);
}).catch(() => {
@@ -221,10 +272,10 @@ layout("/layouts/platform.html"){
approveSingleItem(item) {
return new Promise((resolve, reject) => {
this.$axios.post("/flow/common/executeTask", {
this.$axios.post("/platform/difficultHelp/approval/executeTask", {
data: JSON.stringify({
processTaskId: item.taskId,
tf_opinion: '审核通过',
...this.batchForm,
submitType: 1
})
}).then((res) => {
@@ -243,19 +294,29 @@ layout("/layouts/platform.html"){
this.showApprovalForm = true
this.formData = {
processTaskId: row.taskId,
taskName: row.curTaskName
taskName: row.curTaskName,
level: "",
money: undefined,
tf_sign: "", tf_opinion: ""
}
this.$refs.infoRef.onOpen(row)
})
},
handleTaskAction(val) {
async handleTaskAction(val) {
try {
const valid = await this.$refs.formRef.validate()
if (!valid) return
} catch (error) {
return
}
this.$confirm("您确定要提交吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.$axios.post("/flow/common/executeTask", {
this.$axios.post("/platform/difficultHelp/approval/executeTask", {
data: JSON.stringify({
...this.formData,
submitType: val
@@ -289,7 +350,7 @@ layout("/layouts/platform.html"){
if (this.$auth.hasRoleOr('SYSADMIN, SCHOOL_UNION_ADMIN')) {
this.units = await this.$businessTool.listUnit(this.pageForm.unionId)
} else {
this.units = await this.$businessTool.listUnit(this.$store.state.user.union.id)
this.units = await this.$businessTool.listUnit((this.$store.state.user.union || {}).id || this.pageForm.unionId)
}
},
handleSelectionChange: function (val) {
@@ -301,7 +362,7 @@ layout("/layouts/platform.html"){
if (this.$auth.hasRoleOr('SYSADMIN, SCHOOL_UNION_ADMIN')) {
this.unions = await this.$businessTool.listUnion()
} else {
this.unions = await this.$businessTool.listUnion(this.$store.state.user.union.id)
this.unions = await this.$businessTool.listUnion((this.$store.state.user.union || {}).id)
}
}
})
@@ -6,6 +6,7 @@ const INFO = {
</div>
<el-descriptions :column="3" border>
<el-descriptions-item label="填写人姓名">{{ viewData.proxyUserName }}</el-descriptions-item>
<el-descriptions-item label="申请金额(元)">{{ viewData.applyMoney }}</el-descriptions-item>
<el-descriptions-item label="性别">{{ viewData.sex }}</el-descriptions-item>
<el-descriptions-item label="填写人工号">{{ viewData.proxyLoginName }}</el-descriptions-item>
<!--\t\t<el-descriptions-item label="申请模式">{{ viewData.mode == 1 ? '本人申请' : '替他人申请' }}</el-descriptions-item>-->
@@ -87,12 +88,15 @@ const INFO = {
:value="task.ext.submitType"></dict-tag>
</el-descriptions-item>
<template v-if="task.displayName == '校工会审核'">
<el-descriptions-item label="审批级别">{{ viewData.level }}</el-descriptions-item>
<el-descriptions-item label="审批金额">{{ '¥' + viewData.money }}</el-descriptions-item>
<template v-if="task.taskFormData.level != null">
<el-descriptions-item label="审批级别">{{ task.taskFormData.level }}</el-descriptions-item>
<el-descriptions-item label="帮扶金额(元)">{{ task.taskFormData.money }}</el-descriptions-item>
</template>
<el-descriptions-item label="审批签字" :span="3" v-if="task.taskFormData && task.taskFormData.sign">
<el-image :src="task.taskFormData.sign" style="height: 80px" fit="contain"></el-image>
</el-descriptions-item>
<el-descriptions-item label="办理意见" :span="3" v-if="!task.ext.isFirstTaskNode">{{
task.taskFormData.opinion }}
</el-descriptions-item>
@@ -64,16 +64,22 @@ layout("/layouts/platform.html"){
size="small"></enum-tag>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" width="300px">
<el-table-column label="操作" fixed="right" width="300px" class-name="difficult-help-mine-actions">
<template slot-scope="{row}">
<el-button @click="openView(row)" size="mini" type="primary">查看</el-button>
<el-button v-if="row.taskKey === 'startTask' || !row.instanceId" @click="onEdit(row)" size="mini" type="primary">
<el-button v-if="row.createdBy === $store.state.user.id && (row.taskKey === 'startTask' || !row.instanceId)" @click="onEdit(row)" size="mini" type="primary">
编辑
</el-button>
<el-button v-if="row.canRevoke" @click="onRevoke(row)" size="mini" type="danger">撤回
<el-button v-if="row.createdBy === $store.state.user.id && row.canRevoke" @click="onRevoke(row)" size="mini" type="danger">撤回
</el-button>
<el-button @click="doExportApply(row)" size="mini" type="primary">打印</el-button>
<el-button v-if="row.taskKey === 'startTask' || !row.instanceId" @click="onDelete(row.id)" size="mini" type="danger">删除</el-button>
<el-dropdown v-if="row.createdBy === $store.state.user.id && row.instanceState == 20" trigger="click" @command="format => doExportApply(row, format)">
<el-button size="mini" type="primary">导出</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="pdf">导出 PDF</el-dropdown-item>
<el-dropdown-item command="word">导出 Word</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<el-button v-if="row.createdBy === $store.state.user.id && (row.taskKey === 'startTask' || !row.instanceId)" @click="onDelete(row.id)" size="mini" type="danger">删除</el-button>
</template>
</el-table-column>
</el-table>
@@ -87,6 +93,18 @@ layout("/layouts/platform.html"){
</div>
<style nonce="${cspNonce!}">
#app .difficult-help-mine-actions .cell {
display: flex;
align-items: center;
justify-content: center;
gap: 10px;
}
#app .difficult-help-mine-actions .cell > .el-button {
margin-left: 0;
}
</style>
<script nonce="${cspNonce!}">
<!--#include("../common/info.js"){}#-->
@@ -107,6 +125,7 @@ layout("/layouts/platform.html"){
{ prop: "unitName", label: "所属单位", sortable: true },
{ prop: "mobile", label: "联系方式", sortable: true },
{ prop: "subsidyStandards", label: "困难类型", sortable: true },
{ prop: "applyMoney", label: "申请金额", sortable: true, width: "135"},
{ prop: "money", label: "实际帮扶金额", sortable: true, width: "135"},
{ prop: "applyTime", label: "申请时间", sortable: true },
{ prop: "applyCount", label: "申请次数", sortable: true },
@@ -165,11 +184,11 @@ layout("/layouts/platform.html"){
if (this.$auth.hasRoleOr('SYSADMIN, SCHOOL_UNION_ADMIN')) {
this.units = await this.$businessTool.listUnit(this.pageForm.unionId)
} else {
this.units = await this.$businessTool.listUnit(this.$store.state.user.union.id)
this.units = await this.$businessTool.listUnit((this.$store.state.user.union || {}).id || this.pageForm.unionId)
}
},
doExportApply(row) {
this.$downLoad('/platform/difficultHelp/reading/doExportApply?id=' + row.id + '&print=true')
doExportApply(row, format) {
this.$downLoad('/platform/difficultHelp/reading/doExportApply?id=' + row.id + '&print=' + (format === 'pdf'))
}
},
async created() {
@@ -177,7 +196,7 @@ layout("/layouts/platform.html"){
if (this.$auth.hasRoleOr('SYSADMIN, SCHOOL_UNION_ADMIN')) {
this.unions = await this.$businessTool.listUnion()
} else {
this.unions = await this.$businessTool.listUnion(this.$store.state.user.union.id)
this.unions = await this.$businessTool.listUnion((this.$store.state.user.union || {}).id)
}
}
})
@@ -181,7 +181,7 @@ layout("/layouts/platform.html"){
if (this.$auth.hasRoleOr('SYSADMIN, SCHOOL_UNION_ADMIN')) {
this.units = await this.$businessTool.listUnit(this.pageForm.unionId)
} else {
this.units = await this.$businessTool.listUnit(this.$store.state.user.union.id)
this.units = await this.$businessTool.listUnit((this.$store.state.user.union || {}).id || this.pageForm.unionId)
}
},
exportYearPayRecord(){
@@ -207,7 +207,7 @@ layout("/layouts/platform.html"){
if (this.$auth.hasRoleOr('SYSADMIN, SCHOOL_UNION_ADMIN')) {
this.unions = await this.$businessTool.listUnion()
} else {
this.unions = await this.$businessTool.listUnion(this.$store.state.user.union.id)
this.unions = await this.$businessTool.listUnion((this.$store.state.user.union || {}).id)
}
}
})
@@ -1,11 +1,11 @@
<div id="difficult_help_school_union_approval_form">
<el-form :model="formData" ref="formRef" label-width="0" label-suffix=":" class="flow-task-form">
<el-form-item label="审核金额" prop="tf_money" :rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<el-input-number placeholder="请输入金额" v-model="formData.tf_money"></el-input-number>
</el-form-item>
<el-form-item label="审批意见" prop="tf_opinion" :rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<el-form :model="formData" ref="formRef" label-width="100px" label-suffix=":">
<el-form-item label="审批意见" prop="tf_opinion" :rules="[{required:true,whitespace:true,message:'请填写审批意见',trigger:['change','blur']}]">
<user-opinion-textarea v-model="formData.tf_opinion"></user-opinion-textarea>
</el-form-item>
<el-form-item label="签字" prop="tf_sign" :rules="[{required:true,message:'请完成审批签字',trigger:['change','blur']}]">
<pc-signature v-model="formData.tf_sign" :key="formData.processTaskId"></pc-signature>
</el-form-item>
</el-form>
<snaker-flow-task-form-action @task-action="handleTaskAction" @cancel="handleCancel"></snaker-flow-task-form-action>
</div>
@@ -17,15 +17,20 @@
return {
businessId: GetQueryString("businessId"),
formData: {
tf_money: 0,
tf_opinion: "",
tf_sign: "", tf_opinion: "",
},
}
},
methods: {
handleTaskAction(val) {
async handleTaskAction(val) {
try {
const valid = await this.$refs.formRef.validate()
if (!valid) return
} catch (error) {
return
}
console.log(val)
this.$axios.post("/flow/common/executeTask", {
this.$axios.post("/platform/difficultHelp/approval/executeTask", {
data: JSON.stringify({
...val,
...this.formData
@@ -83,11 +83,11 @@ layout("/layouts/platform.html"){
<el-dialog title="设置审核信息" :visible.sync="dialogVisible" width="30%" center>
<el-form :model="formData" ref="formData" label-width="100px">
<el-form-item label="级别" prop="level" :rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<dict-select v-model="formData.level" code="DIFFICULT_LEVEL" style="width: 100%" placeholder="请选择级别"></dict-select>
<el-form-item label="审批意见" prop="tf_opinion" :rules="[{required:true,whitespace:true,message:'请填写审批意见',trigger:['change','blur']}]">
<user-opinion-textarea v-model="formData.tf_opinion"></user-opinion-textarea>
</el-form-item>
<el-form-item label="审核金额" prop="money" :rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<el-input-number placeholder="请输入金额" v-model="formData.money" style="width: 100%" :precision="2" :min="0"></el-input-number>
<el-form-item label="签字" prop="tf_sign" :rules="[{required:true,message:'请完成审批签字',trigger:['change','blur']}]">
<pc-signature v-model="formData.tf_sign" :key="formData.processTaskId"></pc-signature>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
@@ -103,25 +103,13 @@ layout("/layouts/platform.html"){
{{formData.taskName}}
</div>
<el-form :model="formData" ref="formRef" :rules="formRules" label-width="100px" label-suffix=":">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="级别" prop="level" :rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<search-item>
<dict-select v-model="formData.level" code="DIFFICULT_LEVEL" style="width: 100%" placeholder="请选择级别"></dict-select>
</search-item>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="审核金额" prop="money" :rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<el-input-number placeholder="请输入金额" v-model="formData.money" style="width: 100%" :precision="2"
:min="0" ></el-input-number>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="审批意见" prop="tf_opinion"
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
:rules="[{required:true,whitespace:true,message:'请填写审批意见',trigger:['change','blur']}]">
<user-opinion-textarea v-model="formData.tf_opinion"></user-opinion-textarea>
</el-form-item>
<el-form-item label="签字" prop="tf_sign" :rules="[{required:true,message:'请完成审批签字',trigger:['change','blur']}]">
<pc-signature v-model="formData.tf_sign" :key="formData.processTaskId"></pc-signature>
</el-form-item>
</el-form>
<el-row type="flex" justify="end">
<el-button @click="handleTaskAction(1)" size="small" type="primary">同意申请</el-button>
@@ -166,14 +154,10 @@ layout("/layouts/platform.html"){
units: [],
formData: {
level: '',
money: 0,
tf_opinion: "",
tf_sign: "", tf_opinion: "",
},
showApprovalForm: false,
auditForm: {
level: '',
money: 0
},
dialogVisible: false
}
@@ -254,39 +238,17 @@ layout("/layouts/platform.html"){
}
},
approveSingleItem(item) {
return new Promise((resolve, reject) => {
this.$axios.post("/platform/difficultHelp/schoolUnionApproval/save", {
data: JSON.stringify({
...this.formData,
id: item.id
})
}).then((saveRes) => {
if (saveRes.code !== 0) {
throw new Error(saveRes.msg || '保存失败');
}
return this.$axios.post("/flow/common/executeTask", {
data: JSON.stringify({
processTaskId: item.taskId,
tf_opinion: '审核通过',
submitType: 1,
})
});
}).then((taskRes) => {
if (taskRes.code === 0) {
resolve(taskRes);
} else {
throw new Error(taskRes.msg || '审批失败');
}
}).catch((error) => {
reject(error);
});
});
async approveSingleItem(item) {
const res = await this.$axios.post("/platform/difficultHelp/approval/executeTask", {
data: JSON.stringify({processTaskId: item.taskId, tf_opinion: this.formData.tf_opinion, tf_sign: this.formData.tf_sign, submitType: 1})
})
if (res.code !== 0) throw new Error(res.msg || '审批失败')
},
openAudit(row) {
this.$refs.guava.edit(()=>{
this.showApprovalForm = true
this.formData = {
tf_sign: "",
processTaskId: row.taskId,
taskName: row.curTaskName,
id: row.id
@@ -295,35 +257,24 @@ layout("/layouts/platform.html"){
})
},
handleTaskAction(val) {
this.$confirm("您确定要提交吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.$axios.post("/platform/difficultHelp/schoolUnionApproval/save", {
data: JSON.stringify({
...this.formData,
})
}).then((saveRes) => {
if (saveRes.code === 0) {
this.$axios.post("/flow/common/executeTask", {
data: JSON.stringify({
...this.formData,
submitType: val
})
}).then((taskRes) => {
if (taskRes.code === 0) {
this.$message.success('操作成功');
this.$refs.guava.index();
this.doSearch();
}
});
}
});
}).catch(() => {
});
async handleTaskAction(val) {
try {
const valid = await this.$refs.formRef.validate()
if (!valid) return
} catch (error) {
return
}
this.$confirm("您确定要提交吗?", "提示", {type: "warning"}).then(() => {
this.$axios.post("/platform/difficultHelp/approval/executeTask", {
data: JSON.stringify({...this.formData, submitType: val})
}).then(res => {
if (res.code === 0) {
this.$message.success('操作成功')
this.$refs.guava.index()
this.doSearch()
}
})
}).catch(() => {})
},
onRevoke(row) {
@@ -345,7 +296,7 @@ layout("/layouts/platform.html"){
if (this.$auth.hasRoleOr('SYSADMIN, SCHOOL_UNION_ADMIN')) {
this.units = await this.$businessTool.listUnit(this.pageForm.unionId)
} else {
this.units = await this.$businessTool.listUnit(this.$store.state.user.union.id)
this.units = await this.$businessTool.listUnit((this.$store.state.user.union || {}).id || this.pageForm.unionId)
}
},
},
@@ -354,7 +305,7 @@ layout("/layouts/platform.html"){
if (this.$auth.hasRoleOr('SYSADMIN, SCHOOL_UNION_ADMIN')) {
this.unions = await this.$businessTool.listUnion()
} else {
this.unions = await this.$businessTool.listUnion(this.$store.state.user.union.id)
this.unions = await this.$businessTool.listUnion((this.$store.state.user.union || {}).id)
}
}
})
@@ -1,8 +1,23 @@
<div id="difficult_help_branch_union_approval_form">
<el-form :model="formData" ref="formRef" label-width="0" label-suffix=":" class="flow-task-form">
<el-form :model="formData" ref="formRef" label-width="100px" label-suffix=":">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="级别" prop="level" :rules="[{required:true,message:'请选择级别',trigger:['change','blur']}]">
<dict-select v-model="formData.level" code="DIFFICULT_LEVEL" style="width: 100%" placeholder="请选择级别"></dict-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="帮扶金额" prop="money" :rules="[{required:true,message:'请填写帮扶金额',trigger:['change','blur']}]">
<el-input-number v-model="formData.money" style="width: 100%" :precision="2" :min="0" placeholder="请输入帮扶金额"></el-input-number>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="审批意见" prop="tf_opinion" :rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<user-opinion-textarea v-model="formData.tf_opinion"></user-opinion-textarea>
</el-form-item>
<el-form-item label="签字" prop="tf_sign" :rules="[{required:true,message:'请完成审批签字',trigger:['change','blur']}]">
<pc-signature v-model="formData.tf_sign" :key="formData.processTaskId"></pc-signature>
</el-form-item>
</el-form>
<snaker-flow-task-form-action @task-action="handleTaskAction" @cancel="handleCancel"></snaker-flow-task-form-action>
</div>
@@ -14,14 +29,23 @@
return {
businessId: GetQueryString("businessId"),
formData: {
tf_opinion: ""
level: "",
money: undefined,
tf_sign: "", tf_opinion: ""
},
}
},
methods: {
handleTaskAction(val) {
async handleTaskAction(val) {
try {
const valid = await this.$refs.formRef.validate()
if (!valid) return
} catch (error) {
return
}
console.log(val)
this.$axios.post("/flow/common/executeTask", {
this.$axios.post("/platform/difficultHelp/approval/executeTask", {
data: JSON.stringify({
...val,
...this.formData
@@ -81,18 +81,56 @@ layout("/layouts/platform.html"){
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
<el-dialog title="设置帮扶审批信息" :visible.sync="batchVisible" width="760px">
<el-form :model="batchForm" ref="batchFormRef" label-width="130px">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="级别" prop="level" :rules="[{required:true,message:'请选择级别',trigger:['change','blur']}]">
<dict-select v-model="batchForm.level" code="DIFFICULT_LEVEL" style="width: 100%" placeholder="请选择级别"></dict-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="帮扶金额(元)" prop="money" :rules="[{required:true,message:'请填写帮扶金额',trigger:['change','blur']}]">
<el-input-number v-model="batchForm.money" style="width: 100%" :precision="2" :min="0" placeholder="请输入帮扶金额"></el-input-number>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="审批意见" prop="tf_opinion" :rules="[{required:true,whitespace:true,message:'请填写审批意见',trigger:['change','blur']}]">
<user-opinion-textarea v-model="batchForm.tf_opinion"></user-opinion-textarea>
</el-form-item>
<el-form-item label="签字" prop="tf_sign" :rules="[{required:true,message:'请完成审批签字',trigger:['change','blur']}]">
<pc-signature v-model="batchForm.tf_sign" :key="batchForm.processTaskId"></pc-signature>
</el-form-item>
</el-form>
<span slot="footer"><el-button @click="batchVisible = false">取消</el-button><el-button type="primary" @click="submitBatch">确定</el-button></span>
</el-dialog>
<template #edit>
<info ref="infoRef">
<div v-if="showApprovalForm">
<div class="process-title">
{{formData.taskName}}
</div>
<el-form :model="formData" ref="formRef" :rules="formRules" label-width="0" label-suffix=":"
class="flow-task-form">
<el-form :model="formData" ref="formRef" :rules="formRules" label-width="100px" label-suffix=":">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="级别" prop="level" :rules="[{required:true,message:'请选择级别',trigger:['change','blur']}]">
<dict-select v-model="formData.level" code="DIFFICULT_LEVEL" style="width: 100%" placeholder="请选择级别"></dict-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="帮扶金额" prop="money" :rules="[{required:true,message:'请填写帮扶金额',trigger:['change','blur']}]">
<el-input-number v-model="formData.money" style="width: 100%" :precision="2" :min="0" placeholder="请输入帮扶金额"></el-input-number>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="审批意见" prop="tf_opinion"
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<user-opinion-textarea v-model="formData.tf_opinion"></user-opinion-textarea>
</el-form-item>
<el-form-item label="签字" prop="tf_sign" :rules="[{required:true,message:'请完成审批签字',trigger:['change','blur']}]">
<pc-signature v-model="formData.tf_sign" :key="formData.processTaskId"></pc-signature>
</el-form-item>
</el-form>
<el-row type="flex" justify="end">
<el-button @click="handleTaskAction(1)" size="small" type="primary">同意申请</el-button>
@@ -138,6 +176,8 @@ layout("/layouts/platform.html"){
units: [],
formData: {},
batchVisible: false,
batchForm: {level: "", money: undefined, tf_sign: "", tf_opinion: ""},
showApprovalForm: false,
selectData: [],
}
@@ -161,12 +201,23 @@ layout("/layouts/platform.html"){
this.$message.warning('请勾选待审核数据!');
return;
}
this.batchForm = {level: "", money: undefined, tf_sign: "", tf_opinion: ""}
this.batchVisible = true
},
async submitBatch() {
try {
const valid = await this.$refs.batchFormRef.validate()
if (!valid) return
} catch (error) {
return
}
const message = '确定要一键审核这 ' + this.selectData.length + ' 条记录吗?';
this.$confirm(message, '批量审核确认', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.batchVisible = false;
this.batchApprove(this.selectData);
}).catch(() => {
@@ -214,10 +265,10 @@ layout("/layouts/platform.html"){
approveSingleItem(item) {
return new Promise((resolve, reject) => {
this.$axios.post("/flow/common/executeTask", {
this.$axios.post("/platform/difficultHelp/approval/executeTask", {
data: JSON.stringify({
processTaskId: item.taskId,
tf_opinion: '审核通过',
...this.batchForm,
submitType: 1
})
}).then((res) => {
@@ -236,19 +287,29 @@ layout("/layouts/platform.html"){
this.showApprovalForm = true
this.formData = {
processTaskId: row.taskId,
taskName: row.curTaskName
taskName: row.curTaskName,
level: "",
money: undefined,
tf_sign: "", tf_opinion: ""
}
this.$refs.infoRef.onOpen(row)
})
},
handleTaskAction(val) {
async handleTaskAction(val) {
try {
const valid = await this.$refs.formRef.validate()
if (!valid) return
} catch (error) {
return
}
this.$confirm("您确定要提交吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.$axios.post("/flow/common/executeTask", {
this.$axios.post("/platform/difficultHelp/approval/executeTask", {
data: JSON.stringify({
...this.formData,
submitType: val
@@ -282,7 +343,7 @@ layout("/layouts/platform.html"){
if (this.$auth.hasRoleOr('SYSADMIN, SCHOOL_UNION_ADMIN')) {
this.units = await this.$businessTool.listUnit(this.pageForm.unionId)
} else {
this.units = await this.$businessTool.listUnit(this.$store.state.user.union.id)
this.units = await this.$businessTool.listUnit((this.$store.state.user.union || {}).id || this.pageForm.unionId)
}
},
handleSelectionChange: function (val) {
@@ -294,7 +355,7 @@ layout("/layouts/platform.html"){
if (this.$auth.hasRoleOr('SYSADMIN, SCHOOL_UNION_ADMIN')) {
this.unions = await this.$businessTool.listUnion()
} else {
this.unions = await this.$businessTool.listUnion(this.$store.state.user.union.id)
this.unions = await this.$businessTool.listUnion((this.$store.state.user.union || {}).id)
}
}
})
@@ -5,7 +5,8 @@
<el-descriptions-item label="申请模式">{{ viewData.mode == 1 ? '本人申请' : '替他人申请' }}</el-descriptions-item>
<el-descriptions-item label="受助人">{{ viewData.userName + '(' + viewData.loginName + ')' }}</el-descriptions-item>
<el-descriptions-item label="性别">{{ viewData.sex }}</el-descriptions-item>
<el-descriptions-item label="申请金额(元)">{{ viewData.applyMoney }}</el-descriptions-item>
<el-descriptions-item label="性别">{{ viewData.sex }}</el-descriptions-item>
<el-descriptions-item label="出生年月">{{ viewData.birthday }}</el-descriptions-item>
<el-descriptions-item label="所属工会">{{ viewData.unionName }}</el-descriptions-item>
@@ -55,7 +55,7 @@ layout("/layouts/platform_h5.html"){
<div id="app">
<div class="condolence-list-page">
<van-nav-bar title="分工会审核" left-text="返回" left-arrow @click-left="historyBack" fixed placeholder></van-nav-bar>
<van-nav-bar title="分工会主席审批" left-text="返回" left-arrow @click-left="historyBack" fixed placeholder></van-nav-bar>
<van-sticky offset-top="46px">
<div class="condolence-list-sticky">
@@ -148,11 +148,17 @@ layout("/layouts/platform_h5.html"){
maxlength="100"
show-word-limit
></van-field>
<h2 class="condolence-info-card__title">
审批签字<span class="condolence-audit-card__required">*</span>
</h2>
<van-field name="tf_sign" :value="formData.tf_sign" required :rules="[{required:true,message:'请完成审批签字'}]">
<template #input><h5-signature v-model="formData.tf_sign" :key="formData.processTaskId"></h5-signature></template>
</van-field>
</van-form>
</section>
<div class="condolence-popup-actions">
<van-button class="condolence-action-danger" type="danger" block :loading="formLoading" @click="handleTaskAction(6)">退回</van-button>
<van-button class="condolence-action-danger" type="danger" block :loading="formLoading" @click="handleTaskAction(20)">不同意</van-button>
<van-button class="condolence-action-danger" type="danger" block :loading="formLoading" @click="handleTaskAction(2)">不同意</van-button>
<van-button class="condolence-action-primary" type="primary" block :loading="formLoading" @click="handleTaskAction(1)">同意</van-button>
</div>
</div>
@@ -227,6 +233,7 @@ layout("/layouts/platform_h5.html"){
this.$set(this, "formData", {
processTaskId: row.taskId,
taskName: row.curTaskName,
tf_sign: "",
tf_opinion: ""
})
this.$refs.infoRef.onOpen(row, row.curTaskName || "慰问审核")
@@ -252,10 +259,10 @@ layout("/layouts/platform_h5.html"){
this.submitTaskAction()
})
},
// 提交 processTaskId、taskName、tf_opinion 和 submitType,接口返回统一响应对象。
// 提交 processTaskId、taskName、tf_opinion、tf_sign 和 submitType,接口返回统一响应对象。
submitTaskAction() {
this.$set(this, "formLoading", true)
this.$axios.post("/flow/common/executeTask", {
this.$axios.post("/platform/condolence/approval/executeTask", {
data: JSON.stringify({
...this.formData,
submitType: this.pendingSubmitType
@@ -85,6 +85,9 @@ const condolenceInfo = {
:value="task.ext && task.ext.submitType"
></dict-tag>
</van-cell>
<van-cell v-if="task.taskFormData && task.taskFormData.sign" title="审批签字">
<img :src="task.taskFormData.sign" style="max-width: 100%; height: 80px; object-fit: contain">
</van-cell>
<van-cell class="condolence-info-long-cell" title="办理意见">
<div v-html="task.taskFormData && task.taskFormData.tf_opinion || '暂无'"></div>
</van-cell>
@@ -0,0 +1,350 @@
<!--#
layout("/layouts/platform_h5.html"){
#-->
<style>
#app { --color-primary: #1989fa; }
.condolence-list-page { min-height: 100vh; padding-bottom: calc(24px + env(safe-area-inset-bottom)); box-sizing: border-box; background: #f3f7fd; }
.condolence-list-page .van-nav-bar, .condolence-list-page .van-sticky--fixed { background: #fff; }
.condolence-list-page .van-nav-bar__title { color: #172033; font-size: 16px; font-weight: 600; }
.condolence-list-page .van-nav-bar .van-icon, .condolence-list-page .van-nav-bar__text { color: #1989fa; }
.condolence-list-sticky { padding: 22px 12px 1px; box-sizing: border-box; background: #f3f7fd; }
.condolence-list-search { margin: 0 0 8px; padding: 0; overflow: hidden; border-radius: 12px; background: #fff; box-shadow: 0 5px 16px rgba(43, 73, 112, .1); }
.condolence-list-search .van-search__content { height: 42px; padding-left: 12px; align-items: center; border-radius: 12px; background: #fff; }
.condolence-list-search .van-field__control { color: #263548; font-size: 14px; }
.condolence-list-search .van-field__control::placeholder { color: #a7b0bf; }
.condolence-list-filter { margin-bottom: 8px; overflow: hidden; border-radius: 10px; box-shadow: 0 5px 16px rgba(43, 73, 112, .08); }
.condolence-list-filter .van-dropdown-menu__bar { height: 44px; box-shadow: none; }
.condolence-list-filter .van-dropdown-menu__item, .condolence-list-filter .van-dropdown-menu__title { height: 44px; }
.condolence-list-filter .van-dropdown-menu__item { align-items: center; justify-content: center; }
.condolence-list-filter .van-dropdown-menu__title { display: inline-flex; align-items: center; line-height: 20px; color: #66758a; font-size: 14px; }
.condolence-list-filter .van-dropdown-menu__title--active, .condolence-list-filter .van-dropdown-item__option--active, .condolence-list-filter .van-dropdown-item__option--active .van-dropdown-item__icon { color: #1989fa; }
.condolence-list-filter .van-dropdown-item__content { width: calc(100% - 24px); margin: 0 12px; overflow: hidden; box-sizing: border-box; border-radius: 0 0 12px 12px; box-shadow: 0 10px 24px rgba(31, 65, 108, .14); }
.condolence-list-filter .van-dropdown-item__option { display: flex; min-height: 48px; padding: 0 16px; align-items: center; color: #46566c; font-size: 14px; }
.condolence-list-filter .van-dropdown-item__option .van-cell__title { display: flex; min-height: 20px; align-items: center; line-height: 20px; }
.condolence-list-content { padding: 0 12px; }
.condolence-list-skeleton { padding-top: 2px; }
.condolence-list-skeleton__card { margin-bottom: 12px; padding: 18px 14px 14px; border: 1px solid #e9eff7; border-radius: 12px; background: #fff; box-shadow: 0 5px 16px rgba(43, 73, 112, .08); }
.condolence-list-skeleton__card .van-skeleton { padding: 0; }
.condolence-list-skeleton__card .van-skeleton__title { width: 42%; height: 18px; margin-bottom: 18px; }
.condolence-list-skeleton__card .van-skeleton__row { height: 14px; margin-top: 12px; }
.condolence-list-skeleton__card .van-skeleton__row:nth-child(2n) { width: 72% !important; }
.condolence-list-skeleton__card .van-skeleton__row:last-child { width: 34% !important; margin-top: 18px; margin-left: auto; }
.condolence-list-page .table-list-container { margin-top: 0; padding-bottom: 2px; }
.condolence-list-page .table-list-container .table-list-item { margin-bottom: 12px; padding: 14px; border: 1px solid #e9eff7; border-radius: 12px; box-shadow: 0 5px 16px rgba(43, 73, 112, .08); }
.condolence-card-header { display: flex; margin-bottom: 8px; align-items: flex-start; justify-content: space-between; }
.condolence-card-heading { min-width: 0; padding-right: 10px; flex: 1; }
.condolence-card-title { overflow: hidden; color: #253247; font-size: 15px; font-weight: 600; line-height: 22px; text-overflow: ellipsis; white-space: nowrap; }
.condolence-card-code { margin-top: 1px; color: #9ba6b6; font-size: 12px; line-height: 18px; }
.condolence-card-status { display: inline-flex; flex: none; }
.condolence-card-status .van-tag { min-height: 24px; padding: 3px 9px; border: 0; border-radius: 12px; box-sizing: border-box; font-size: 12px; line-height: 18px; }
.condolence-list-page .table-list-container .table-list-item .item-actions { margin-top: 10px; padding-top: 10px; border-top-color: #edf1f6; }
.condolence-list-page .table-list-container .table-list-item .action-btn { min-height: 28px; padding: 4px 11px; border-radius: 14px; color: #1989fa; background: #eaf4ff; font-size: 12px; line-height: 18px; }
.condolence-list-page .table-list-container .table-list-item .action-btn.delete { color: #f04444; background: #fff0f0; }
.condolence-list-page .table-list-container .table-list-item .action-btn i { margin-right: 5px; font-size: 13px; }
.condolence-list-page .empty-state { padding: 0; }
.condolence-list-empty { display: flex; min-height: 280px; padding: 46px 18px 36px; align-items: center; justify-content: center; box-sizing: border-box; flex-direction: column; text-align: center; }
.condolence-list-empty img { display: block; width: 86%; max-width: 290px; height: auto; object-fit: contain; }
.condolence-list-empty__title { margin-top: 14px; color: #50627a; font-size: 15px; font-weight: 600; line-height: 22px; }
.condolence-list-empty__hint { margin-top: 5px; color: #9aa7b8; font-size: 12px; line-height: 18px; }
</style>
<style id="style-condolence-info-h5">
<!--#include("../common/info.css"){}#-->
</style>
<div id="app">
<div class="condolence-list-page">
<van-nav-bar title="分管校领导审批" left-text="返回" left-arrow @click-left="historyBack" fixed placeholder></van-nav-bar>
<van-sticky offset-top="46px">
<div class="condolence-list-sticky">
<van-search
v-model="pageForm.searchKeyword"
class="condolence-list-search"
placeholder="请输入姓名或者工号搜索"
shape="round"
clearable
@search="doSearch"
@clear="doSearch"
></van-search>
<van-dropdown-menu class="condolence-list-filter" :close-on-click-outside="false" :close-on-click-overlay="false">
<year-van-dropdown-item :num="5" @change="doSearch" v-model="pageForm.year"></year-van-dropdown-item>
<van-dropdown-item v-model="pageForm.type" :options="typeOptions" :multiple="false"
@change="doSearch"></van-dropdown-item>
<van-dropdown-item v-model="pageForm.approvalText" :options="approvalOptions" :multiple="false"
@change="onApprovalFilterChange"></van-dropdown-item>
</van-dropdown-menu>
</div>
</van-sticky>
<main class="condolence-list-content">
<div class="condolence-list-skeleton" v-if="skeletonLoading">
<div class="condolence-list-skeleton__card" v-for="index in 3" :key="'fourth-approval-skeleton-' + index">
<van-skeleton title :row="5" animated></van-skeleton>
</div>
</div>
<table-list api="/platform/condolence/fourthApproval/pageData" :page_form.sync="pageForm" ref="tableListRef"
v-show="!skeletonLoading" :show_loading_overlay="false" @ready="onReady"
@loading-change="handleListLoadingChange">
<template #header="{index,row}">
<div class="condolence-card-header">
<div class="condolence-card-heading">
<div class="condolence-card-title">{{row.helpUserName || '--'}}</div>
<div class="condolence-card-code">工号:{{row.helpLoginName || '--'}}</div>
</div>
<enum-tag class="condolence-card-status" v-if="row.instanceState" :value="row.instanceState"
name="ProcessInstanceStateEnum" label_key="message" size="small"></enum-tag>
</div>
</template>
<template v-slot="{index,row}">
<table-column label="慰问对象">{{row.helpUserName}}</table-column>
<table-column label="慰问对象工号">{{row.helpLoginName}}</table-column>
<table-column label="申请人">{{row.applyUserName}}</table-column>
<table-column label="所属工会">{{row.applyUnionName}}</table-column>
<table-column label="所属单位">{{row.applyUnitName}}</table-column>
<table-column label="慰问类型">{{row.typeName}}</table-column>
<table-column label="当前节点">{{row.curTaskName}}</table-column>
</template>
<template #actions="{index,row}">
<div class="action-btn" @click="onView(row)">
<van-icon name="eye-o"></van-icon>
<span>查看</span>
</div>
<div class="action-btn" v-if="row.taskState === 10" @click="onApproval(row)">
<van-icon name="edit"></van-icon>
<span>审核</span>
</div>
<div class="action-btn delete" v-if="row.canRevoke" @click="onRevoke(row)">
<van-icon name="revoke"></van-icon>
<span>撤回</span>
</div>
</template>
<template #empty>
<div class="condolence-list-empty">
<img src="/assets/mobile/img/condolence/condolence-empty.png" alt="暂无慰问审核记录插画">
<div class="condolence-list-empty__title">暂无慰问审核记录</div>
<div class="condolence-list-empty__hint">当前筛选条件下暂时没有慰问申请</div>
</div>
</template>
</table-list>
</main>
<info ref="infoRef" page-key="condolence-fourth-detail">
<div v-if="showApprovalForm">
<section class="condolence-info-card">
<h2 class="condolence-info-card__title">
审批意见<span class="condolence-audit-card__required">*</span>
</h2>
<van-form ref="formRef">
<van-field
v-model="formData.tf_opinion"
class="condolence-audit-field"
name="tf_opinion"
type="textarea"
rows="6"
placeholder="请输入审批意见"
:rules="[{ required: true, message: '请填写审批意见' }]"
maxlength="100"
show-word-limit
></van-field>
<h2 class="condolence-info-card__title">
审批签字<span class="condolence-audit-card__required">*</span>
</h2>
<van-field name="tf_sign" :value="formData.tf_sign" required :rules="[{required:true,message:'请完成审批签字'}]">
<template #input><h5-signature v-model="formData.tf_sign" :key="formData.processTaskId"></h5-signature></template>
</van-field>
</van-form>
</section>
<div class="condolence-popup-actions">
<van-button class="condolence-action-danger" type="danger" block :loading="formLoading" @click="handleTaskAction(6)">退回</van-button>
<van-button class="condolence-action-danger" type="danger" block :loading="formLoading" @click="handleTaskAction(2)">不同意</van-button>
<van-button class="condolence-action-primary" type="primary" block :loading="formLoading" @click="handleTaskAction(1)">同意</van-button>
</div>
</div>
</info>
<van-dialog
:value="confirmVisible"
title="提示"
:message="confirmActionType === 'revoke' ? '您确定要撤回吗?' : '您确定要提交吗?'"
show-cancel-button
confirm-button-color="#1989fa"
@confirm="confirmPendingAction"
@cancel="closeActionConfirm"
></van-dialog>
</div>
</div>
<script nonce="${cspNonce!}">
<!--#include('../common/info.js'){}#-->
new Vue({
el: "#app",
store,
components: {
info: condolenceInfo
},
data() {
return {
pageForm: {
pageNumber: 1,
pageSize: 10,
totalCount: 0,
searchKeyword: '',
approvalText: "0",
approval: false,
year: new Date().getFullYear(),
type: null,
},
typeOptions: [],
approvalOptions: [
{text: "未审核", value: "0"},
{text: "已审核", value: "1"}
],
skeletonLoading: true,
formData: {},
showApprovalForm: false,
formLoading: false,
confirmVisible: false,
confirmActionType: "task",
pendingSubmitType: null,
pendingRevokeRow: null,
historyLayerUnsubscribe: null
}
},
methods: {
// state.initial 表示当前查询前列表为空,仅此阶段使用整组卡片骨架屏。
handleListLoadingChange(state) {
if (state.initial) this.$set(this, "skeletonLoading", state.loading)
},
// 审核状态下拉值为字符串,接口参数 approval 继续使用布尔值。
onApprovalFilterChange(val) {
this.$set(this.pageForm, "approval", val === "1")
this.doSearch()
},
onReady() {
this.queryCondolenceType()
},
onView(row) {
this.$set(this, "showApprovalForm", false)
this.$refs.infoRef.onOpen(row, "慰问详情")
},
onApproval(row) {
this.$set(this, "showApprovalForm", true)
this.$set(this, "formData", {
processTaskId: row.taskId,
taskName: row.curTaskName,
tf_sign: "",
tf_opinion: ""
})
this.$refs.infoRef.onOpen(row, row.curTaskName || "慰问审核")
},
// val 为流程提交类型:1 同意、20 不同意、6 退回;校验通过后打开历史栈确认框。
handleTaskAction(val) {
this.$refs.formRef.validate()
.then(() => {
this.$set(this, "confirmActionType", "task")
this.$set(this, "pendingSubmitType", val)
if (window.h5HistoryLayerManager && window.h5HistoryLayerManager.open("condolence-action-confirm")) return
this.$set(this, "confirmVisible", true)
})
.catch(() => {})
},
// 确认操作时先回退确认框历史,再根据操作类型调用办理或撤回接口。
confirmPendingAction() {
this.closeActionConfirm(() => {
if (this.confirmActionType === "revoke") {
this.revokeTask()
return
}
this.submitTaskAction()
})
},
// 提交 processTaskId、taskName、tf_opinion、tf_sign 和 submitType,接口返回统一响应对象。
submitTaskAction() {
this.$set(this, "formLoading", true)
this.$axios.post("/platform/condolence/approval/executeTask", {
data: JSON.stringify({
...this.formData,
submitType: this.pendingSubmitType
})
})
.then((res) => {
if (res && res.code === 0) {
const afterClose = () => {
this.$toast.success(res.msg)
this.doSearch()
}
if (window.h5HistoryLayerManager && window.h5HistoryLayerManager.closeAll(afterClose)) return
this.$refs.infoRef.onClose(afterClose)
}
})
.finally(() => {
this.$set(this, "formLoading", false)
})
},
closeActionConfirm(afterClose = null) {
if (window.h5HistoryLayerManager && window.h5HistoryLayerManager.close("condolence-action-confirm", afterClose)) return
this.$set(this, "confirmVisible", false)
if (typeof afterClose === "function") afterClose()
},
// row 提供待撤回任务 taskId,确认后保存当前行并由统一确认框执行撤回。
onRevoke(row){
this.$set(this, "confirmActionType", "revoke")
this.$set(this, "pendingRevokeRow", row)
if (window.h5HistoryLayerManager && window.h5HistoryLayerManager.open("condolence-action-confirm")) return
this.$set(this, "confirmVisible", true)
},
// 使用 pendingRevokeRow.taskId 撤回任务,接口返回统一响应对象。
revokeTask() {
if (!this.pendingRevokeRow) return
this.$set(this, "formLoading", true)
this.$axios.post("/flow/common/revokeTask", {taskId: this.pendingRevokeRow.taskId})
.then((res) => {
if (res.code === 0) {
this.$toast.success(res.msg)
this.doSearch()
}
})
.finally(() => {
this.$set(this, "formLoading", false)
})
},
queryCondolenceType() {
this.$axios.post('/platform/condolence/type/queryCondolenceType', {}, {h5SkeletonLoading: true})
.then((res) => {
const typeList = res.data || []
this.$set(this, "typeOptions", [
{
text: "全部慰问类型",
value: null
}
].concat(typeList.map((v) => ({ text: v.name, value: v.id }))))
if (this.typeOptions.length > 0) {
this.$set(this.pageForm, "type", this.typeOptions[0].value)
this.doSearch()
}
})
},
doSearch() {
this.$nextTick(() => {
this.pageForm.pageNumber = 1
this.pageForm.totalCount = 0
this.$refs.tableListRef.doSearch()
})
}
},
created() {
if (!window.h5HistoryLayerManager) return
this.$set(this, "historyLayerUnsubscribe", window.h5HistoryLayerManager.subscribe((stack) => {
this.$set(this, "confirmVisible", stack.includes("condolence-action-confirm"))
}))
},
beforeDestroy() {
if (typeof this.historyLayerUnsubscribe === "function") this.historyLayerUnsubscribe()
}
})
</script>
<!--#
}
#-->
@@ -55,7 +55,7 @@ layout("/layouts/platform_h5.html"){
<div id="app">
<div class="condolence-list-page">
<van-nav-bar title="校工会预审" left-text="返回" left-arrow @click-left="historyBack" fixed placeholder></van-nav-bar>
<van-nav-bar title="校工会办公室主任审批" left-text="返回" left-arrow @click-left="historyBack" fixed placeholder></van-nav-bar>
<van-sticky offset-top="46px">
<div class="condolence-list-sticky">
@@ -148,11 +148,17 @@ layout("/layouts/platform_h5.html"){
maxlength="100"
show-word-limit
></van-field>
<h2 class="condolence-info-card__title">
审批签字<span class="condolence-audit-card__required">*</span>
</h2>
<van-field name="tf_sign" :value="formData.tf_sign" required :rules="[{required:true,message:'请完成审批签字'}]">
<template #input><h5-signature v-model="formData.tf_sign" :key="formData.processTaskId"></h5-signature></template>
</van-field>
</van-form>
</section>
<div class="condolence-popup-actions">
<van-button class="condolence-action-danger" type="danger" block :loading="formLoading" @click="handleTaskAction(6)">退回</van-button>
<van-button class="condolence-action-danger" type="danger" block :loading="formLoading" @click="handleTaskAction(20)">不同意</van-button>
<van-button class="condolence-action-danger" type="danger" block :loading="formLoading" @click="handleTaskAction(2)">不同意</van-button>
<van-button class="condolence-action-primary" type="primary" block :loading="formLoading" @click="handleTaskAction(1)">同意</van-button>
</div>
</div>
@@ -227,6 +233,7 @@ layout("/layouts/platform_h5.html"){
this.$set(this, "formData", {
processTaskId: row.taskId,
taskName: row.curTaskName,
tf_sign: "",
tf_opinion: ""
})
this.$refs.infoRef.onOpen(row, row.curTaskName || "慰问审核")
@@ -252,10 +259,10 @@ layout("/layouts/platform_h5.html"){
this.submitTaskAction()
})
},
// 提交 processTaskId、taskName、tf_opinion 和 submitType,接口返回统一响应对象。
// 提交 processTaskId、taskName、tf_opinion、tf_sign 和 submitType,接口返回统一响应对象。
submitTaskAction() {
this.$set(this, "formLoading", true)
this.$axios.post("/flow/common/executeTask", {
this.$axios.post("/platform/condolence/approval/executeTask", {
data: JSON.stringify({
...this.formData,
submitType: this.pendingSubmitType
@@ -55,7 +55,7 @@ layout("/layouts/platform_h5.html"){
<div id="app">
<div class="condolence-list-page">
<van-nav-bar title="校工会审核" left-text="返回" left-arrow @click-left="historyBack" fixed placeholder></van-nav-bar>
<van-nav-bar title="分工会主席审批" left-text="返回" left-arrow @click-left="historyBack" fixed placeholder></van-nav-bar>
<van-sticky offset-top="46px">
<div class="condolence-list-sticky">
@@ -148,11 +148,17 @@ layout("/layouts/platform_h5.html"){
maxlength="100"
show-word-limit
></van-field>
<h2 class="condolence-info-card__title">
审批签字<span class="condolence-audit-card__required">*</span>
</h2>
<van-field name="tf_sign" :value="formData.tf_sign" required :rules="[{required:true,message:'请完成审批签字'}]">
<template #input><h5-signature v-model="formData.tf_sign" :key="formData.processTaskId"></h5-signature></template>
</van-field>
</van-form>
</section>
<div class="condolence-popup-actions">
<van-button class="condolence-action-danger" type="danger" block :loading="formLoading" @click="handleTaskAction(6)">退回</van-button>
<van-button class="condolence-action-danger" type="danger" block :loading="formLoading" @click="handleTaskAction(20)">不同意</van-button>
<van-button class="condolence-action-danger" type="danger" block :loading="formLoading" @click="handleTaskAction(2)">不同意</van-button>
<van-button class="condolence-action-primary" type="primary" block :loading="formLoading" @click="handleTaskAction(1)">同意</van-button>
</div>
</div>
@@ -227,6 +233,7 @@ layout("/layouts/platform_h5.html"){
this.$set(this, "formData", {
processTaskId: row.taskId,
taskName: row.curTaskName,
tf_sign: "",
tf_opinion: ""
})
this.$refs.infoRef.onOpen(row, row.curTaskName || "慰问审核")
@@ -252,10 +259,10 @@ layout("/layouts/platform_h5.html"){
this.submitTaskAction()
})
},
// 提交 processTaskId、taskName、tf_opinion 和 submitType,接口返回统一响应对象。
// 提交 processTaskId、taskName、tf_opinion、tf_sign 和 submitType,接口返回统一响应对象。
submitTaskAction() {
this.$set(this, "formLoading", true)
this.$axios.post("/flow/common/executeTask", {
this.$axios.post("/platform/condolence/approval/executeTask", {
data: JSON.stringify({
...this.formData,
submitType: this.pendingSubmitType
@@ -94,6 +94,22 @@ layout("/layouts/platform_h5.html"){
color: #f06464;
}
.difficult-help-apply-form .difficult-help-apply-mode {
flex-wrap: nowrap;
gap: 8px;
}
.difficult-help-apply-form .difficult-help-apply-mode .van-radio {
flex-shrink: 0;
margin-right: 0;
}
.difficult-help-apply-form .difficult-help-apply-mode .van-radio__label {
margin-left: 4px;
font-size: 12px;
white-space: nowrap;
}
.difficult-help-apply-actions {
position: fixed;
z-index: 100;
@@ -308,10 +324,10 @@ layout("/layouts/platform_h5.html"){
required name="proxyLoginName"></van-field>
<van-field label="申请模式" name="mode" required :rules="[{ required: true }]">
<template #input>
<van-radio-group v-model="formData.mode" @change="modeChange" direction="horizontal">
<van-radio-group class="difficult-help-apply-mode" :value="formData.mode" @input="formData.mode !== $event && modeChange($event)" direction="horizontal" icon-size="14px">
<van-radio name="1" shape="square">本人申请</van-radio>
<van-radio
v-if="$auth.hasRoleOr('SYSADMIN, SCHOOL_UNION_ADMIN, BRANCH_UNION_CHAIRMAN, BRANCH_UNION_OPERATOR')"
v-if="$auth.hasRoleOr('BRANCH_UNION_CHAIRMAN')"
name="2" shape="square">替他人申请
</van-radio>
</van-radio-group>
@@ -496,6 +512,9 @@ layout("/layouts/platform_h5.html"){
name="bankOfDeposit"
></van-field>
<van-field v-model="formData.applyMoney" name="applyMoney" label="申请金额(元)" type="number"
placeholder="请输入申请金额" required
:rules="[{required:true,message:'请填写申请金额'},{validator: value => Number(value) > 0, message:'申请金额必须大于零'}]"></van-field>
<van-field
v-model="formData.reason"
label="生活致困原因"
@@ -685,6 +704,7 @@ layout("/layouts/platform_h5.html"){
recipientHasSearched: false,
historyLayerPageKey: "difficult-help-apply",
formData: {
applyMoney: undefined,
id: GetQueryString("bizId"),
mode: "1",
familyList: [],
@@ -114,6 +114,33 @@ layout("/layouts/platform_h5.html"){
审批意见<span class="difficult-help-audit-card__required">*</span>
</h2>
<van-form ref="formRef">
<section class="difficult-help-info-card">
<h2 class="difficult-help-info-card__title">审核信息</h2>
<div class="difficult-help-audit-form">
<van-field
v-model="formData.level"
class="difficult-help-audit-select"
name="level"
label="级别"
placeholder="请选择级别"
readonly
is-link
required
@click="openLevelPicker"
:rules="[{ required: true, message: '请选择级别' }]"
></van-field>
<van-field
v-model="formData.money"
class="difficult-help-audit-money"
name="money"
label="帮扶金额(元)"
placeholder="请输入帮扶金额(元)"
type="number"
required
:rules="[{ required: true, message: '请输入帮扶金额(元)' }]"
></van-field>
</div>
</section>
<van-field
v-model="formData.tf_opinion"
class="difficult-help-audit-textarea"
@@ -125,7 +152,13 @@ layout("/layouts/platform_h5.html"){
maxlength="100"
show-word-limit
></van-field>
</van-form>
<section class="difficult-help-info-card">
<h2 class="difficult-help-info-card__title">审批签字</h2>
<van-field name="tf_sign" :value="formData.tf_sign" required :rules="[{required:true,message:'请完成审批签字'}]">
<template #input><h5-signature v-model="formData.tf_sign" :key="formData.processTaskId"></h5-signature></template>
</van-field>
</section>
</van-form>
</section>
<div class="difficult-help-popup-actions">
<van-button class="difficult-help-action-danger" type="danger" block :loading="formLoading" @click="handleTaskAction(6)">退回</van-button>
@@ -134,6 +167,14 @@ layout("/layouts/platform_h5.html"){
</div>
</div>
</info>
<van-popup :value="showLevelPicker" position="bottom" :close-on-click-overlay="false">
<van-picker
show-toolbar
:columns="levelColumns"
@confirm="onLevelConfirm"
@cancel="closeLevelPicker">
</van-picker>
</van-popup>
<van-dialog
:value="confirmVisible"
title="提示"
@@ -173,6 +214,8 @@ layout("/layouts/platform_h5.html"){
skeletonLoading: true,
formData: {},
levelColumns: [],
showLevelPicker: false,
showApprovalForm: false,
formLoading: false,
confirmVisible: false,
@@ -229,12 +272,43 @@ layout("/layouts/platform_h5.html"){
this.$set(this, "formData", {
processTaskId: row.taskId,
taskName: row.curTaskName,
tf_opinion: ""
level: "",
money: undefined,
tf_sign: "", tf_opinion: ""
})
this.$refs.infoRef.onOpen(row, row.curTaskName || "帮扶审核")
},
// val 为流程提交类型:1 同意、2 拒绝、6 退回;校验通过后打开历史栈确认框。
// 加载困难级别字典并转换为 Vant Picker 所需的 text/value 结构。
initLevelDict() {
return this.$axios.post("/open/common/dictOptions", {code: "DIFFICULT_LEVEL"}, {h5SkeletonLoading: true}).then((res) => {
const levelData = res && res.code === 0 ? res.data : []
this.$set(this, "levelColumns", (levelData || []).map((item) => ({
text: item.name,
value: item.code
})))
})
},
// 级别选择器作为详情上层弹框,打开时同步增加浏览器历史。
openLevelPicker() {
if (window.h5HistoryLayerManager && window.h5HistoryLayerManager.open("difficult-help-level-picker")) return
this.$set(this, "showLevelPicker", true)
},
closeLevelPicker(afterClose = null) {
if (window.h5HistoryLayerManager && window.h5HistoryLayerManager.close("difficult-help-level-picker", afterClose)) return
this.$set(this, "showLevelPicker", false)
if (typeof afterClose === "function") afterClose()
},
onLevelConfirm(option) {
this.closeLevelPicker(() => {
this.$set(this.formData, "level", option.value)
})
},
// val 为流程提交类型:1 同意、2 拒绝、6 退回;校验通过后打开历史栈确认框。
handleTaskAction(val) {
this.$refs.formRef.validate()
.then(() => {
@@ -260,7 +334,7 @@ layout("/layouts/platform_h5.html"){
// 提交流程任务参数,接口成功后清理详情弹框历史并刷新列表。
submitTaskAction() {
this.$set(this, "formLoading", true)
this.$axios.post("/flow/common/executeTask", {
this.$axios.post("/platform/difficultHelp/approval/executeTask", {
data: JSON.stringify({
...this.formData,
submitType: this.pendingSubmitType
@@ -345,10 +419,12 @@ layout("/layouts/platform_h5.html"){
},
},
created() {
this.initLevelDict()
this.initUnion().then(() => this.flushUnits())
if (!window.h5HistoryLayerManager) return
this.$set(this, "historyLayerUnsubscribe", window.h5HistoryLayerManager.subscribe((stack) => {
this.$set(this, "confirmVisible", stack.includes("difficult-help-action-confirm"))
this.$set(this, "showLevelPicker", stack.includes("difficult-help-level-picker"))
}))
},
beforeDestroy() {
@@ -25,6 +25,7 @@ const INFO = {
<van-cell-group :title="fullScreen ? '' : '基本信息'" :border="!fullScreen">
<van-cell title="填写人姓名">{{ viewData.proxyUserName || '--' }}</van-cell>
<van-cell title="填写人工号">{{ viewData.proxyLoginName || '--' }}</van-cell>
<van-cell title="申请金额(元)">{{ viewData.applyMoney }}</van-cell>
<van-cell title="性别">{{ viewData.sex || '--' }}</van-cell>
<van-cell title="受助人">
{{ viewData.userName || '--' }}{{ viewData.loginName ? '(' + viewData.loginName + ')' : '' }}
@@ -188,11 +189,14 @@ const INFO = {
{{ task.taskFormData && task.taskFormData.userName || '--' }}{{ task.taskFormData && task.taskFormData.loginName ? '(' + task.taskFormData.loginName + ')' : '' }}
</van-cell>
<van-cell title="办理时间">{{ task.finishTime || '--' }}</van-cell>
<van-cell v-if="task.displayName === '校工会审核'" title="审批级别">
{{ viewData.level || '--' }}
<van-cell v-if="task.taskFormData && task.taskFormData.sign" title="审批签字">
<img :src="task.taskFormData.sign" style="max-width: 100%; height: 80px; object-fit: contain">
</van-cell>
<van-cell v-if="task.displayName === '校工会审核'" title="审批金额">
{{ viewData.money ? '¥' + viewData.money : '--' }}
<van-cell v-if="task.taskFormData && task.taskFormData.level != null" title="审批级别">
{{ task.taskFormData.level }}
</van-cell>
<van-cell v-if="task.taskFormData && task.taskFormData.money != null" title="帮扶金额(元)">
{{ task.taskFormData.money }}
</van-cell>
<van-cell title="办理结果">
<dict-tag
@@ -388,16 +388,16 @@ layout("/layouts/platform_h5.html"){
<van-icon name="eye-o"></van-icon>
<span>查看</span>
</div>
<div class="action-btn" v-if="row.taskKey === 'startTask' || !row.instanceId"
<div class="action-btn" v-if="row.createdBy === $store.state.user.id && (row.taskKey === 'startTask' || !row.instanceId)"
@click="onEdit(row)">
<van-icon name="edit"></van-icon>
<span>编辑</span>
</div>
<div class="action-btn delete" v-if="row.canRevoke" @click="onRevoke(row)">
<div class="action-btn delete" v-if="row.createdBy === $store.state.user.id && row.canRevoke" @click="onRevoke(row)">
<van-icon name="revoke"></van-icon>
<span>撤回</span>
</div>
<div class="action-btn delete" v-if="row.taskKey === 'startTask' || !row.instanceId"
<div class="action-btn delete" v-if="row.createdBy === $store.state.user.id && (row.taskKey === 'startTask' || !row.instanceId)"
@click="onDelete(row.id)">
<van-icon name="delete-o"></van-icon>
<span>删除</span>
@@ -110,33 +110,7 @@ layout("/layouts/platform_h5.html"){
<info ref="infoRef" page-key="difficult-help-school-union-detail" full-screen>
<div v-if="showApprovalForm">
<van-form ref="formRef">
<section class="difficult-help-info-card">
<h2 class="difficult-help-info-card__title">审核信息</h2>
<div class="difficult-help-audit-form">
<van-field
v-model="formData.level"
class="difficult-help-audit-select"
name="level"
label="级别"
placeholder="请选择级别"
readonly
is-link
required
@click="openLevelPicker"
:rules="[{ required: true, message: '请选择级别' }]"
></van-field>
<van-field
v-model="formData.money"
class="difficult-help-audit-money"
name="money"
label="审核金额"
placeholder="请输入审核金额"
type="number"
required
:rules="[{ required: true, message: '请输入审核金额' }]"
></van-field>
</div>
</section>
<section class="difficult-help-info-card">
<h2 class="difficult-help-info-card__title">
审批意见<span class="difficult-help-audit-card__required">*</span>
@@ -153,6 +127,12 @@ layout("/layouts/platform_h5.html"){
show-word-limit
></van-field>
</section>
<section class="difficult-help-info-card">
<h2 class="difficult-help-info-card__title">审批签字</h2>
<van-field name="tf_sign" :value="formData.tf_sign" required :rules="[{required:true,message:'请完成审批签字'}]">
<template #input><h5-signature v-model="formData.tf_sign" :key="formData.processTaskId"></h5-signature></template>
</van-field>
</section>
</van-form>
<div class="difficult-help-popup-actions">
<van-button class="difficult-help-action-danger" type="danger" block :loading="formLoading" @click="handleTaskAction(6)">退回</van-button>
@@ -161,14 +141,7 @@ layout("/layouts/platform_h5.html"){
</div>
</div>
</info>
<van-popup :value="showLevelPicker" position="bottom" :close-on-click-overlay="false">
<van-picker
show-toolbar
:columns="levelColumns"
@confirm="onLevelConfirm"
@cancel="closeLevelPicker">
</van-picker>
</van-popup>
<van-dialog
:value="confirmVisible"
title="提示"
@@ -210,8 +183,6 @@ layout("/layouts/platform_h5.html"){
formData: {},
showApprovalForm: false,
formLoading: false,
showLevelPicker: false,
levelColumns: [],
confirmVisible: false,
confirmActionType: "task",
pendingSubmitType: null,
@@ -265,43 +236,12 @@ layout("/layouts/platform_h5.html"){
this.$set(this, "formData", {
processTaskId: row.taskId,
taskName: row.curTaskName,
money: 0,
id: row.id,
level: "",
tf_opinion: ""
tf_sign: "", tf_opinion: ""
})
this.$refs.infoRef.onOpen(row, row.curTaskName || "帮扶审核")
},
// 加载困难级别字典并转换为 Vant Picker 所需的 text/value 结构。
initLevelDict() {
return this.$axios.post("/open/common/dictOptions", {code: "DIFFICULT_LEVEL"}, {h5SkeletonLoading: true}).then((res) => {
const levelData = res && res.code === 0 ? res.data : []
this.$set(this, "levelColumns", (levelData || []).map((item) => ({
text: item.name,
value: item.code
})))
})
},
// 级别选择器作为详情上层弹框,打开时同步增加浏览器历史。
openLevelPicker() {
if (window.h5HistoryLayerManager && window.h5HistoryLayerManager.open("difficult-help-level-picker")) return
this.$set(this, "showLevelPicker", true)
},
closeLevelPicker(afterClose = null) {
if (window.h5HistoryLayerManager && window.h5HistoryLayerManager.close("difficult-help-level-picker", afterClose)) return
this.$set(this, "showLevelPicker", false)
if (typeof afterClose === "function") afterClose()
},
onLevelConfirm(option) {
this.closeLevelPicker(() => {
this.$set(this.formData, "level", option.value)
})
},
// val 为流程提交类型:1 同意、2 拒绝、6 退回;校验通过后打开历史栈确认框。
handleTaskAction(val) {
this.$refs.formRef.validate()
@@ -325,21 +265,14 @@ layout("/layouts/platform_h5.html"){
})
},
// 先保存级别和金额,再提交 processTaskId、审批意见及流程提交类型。
submitTaskAction() {
this.$set(this, "formLoading", true)
this.$axios.post("/platform/difficultHelp/schoolUnionApproval/save", {
data: JSON.stringify({...this.formData})
})
.then((saveRes) => {
if (!saveRes || saveRes.code !== 0) return null
return this.$axios.post("/flow/common/executeTask", {
data: JSON.stringify({
...this.formData,
submitType: this.pendingSubmitType
})
})
this.$axios.post("/platform/difficultHelp/approval/executeTask", {
data: JSON.stringify({
...this.formData,
submitType: this.pendingSubmitType
})
})
.then((res) => {
if (res && res.code === 0) {
const afterClose = () => {
@@ -420,11 +353,9 @@ layout("/layouts/platform_h5.html"){
},
created() {
this.initUnion().then(() => this.flushUnits())
this.initLevelDict()
if (!window.h5HistoryLayerManager) return
this.$set(this, "historyLayerUnsubscribe", window.h5HistoryLayerManager.subscribe((stack) => {
this.$set(this, "confirmVisible", stack.includes("difficult-help-action-confirm"))
this.$set(this, "showLevelPicker", stack.includes("difficult-help-level-picker"))
}))
},
beforeDestroy() {
@@ -129,11 +129,11 @@ layout("/layouts/platform_h5.html"){
v-model="formData.money"
class="difficult-help-audit-money"
name="money"
label="审核金额"
placeholder="请输入审核金额"
label="帮扶金额(元)"
placeholder="请输入帮扶金额(元)"
type="number"
required
:rules="[{ required: true, message: '请输入审核金额' }]"
:rules="[{ required: true, message: '请输入帮扶金额(元)' }]"
></van-field>
</div>
</section>
@@ -153,6 +153,12 @@ layout("/layouts/platform_h5.html"){
show-word-limit
></van-field>
</section>
<section class="difficult-help-info-card">
<h2 class="difficult-help-info-card__title">审批签字</h2>
<van-field name="tf_sign" :value="formData.tf_sign" required :rules="[{required:true,message:'请完成审批签字'}]">
<template #input><h5-signature v-model="formData.tf_sign" :key="formData.processTaskId"></h5-signature></template>
</van-field>
</section>
</van-form>
<div class="difficult-help-popup-actions">
<van-button class="difficult-help-action-danger" type="danger" block :loading="formLoading" @click="handleTaskAction(6)">退回</van-button>
@@ -267,8 +273,8 @@ layout("/layouts/platform_h5.html"){
processTaskId: row.taskId,
taskName: row.curTaskName,
level: "",
money: 0,
tf_opinion: ""
money: undefined,
tf_sign: "", tf_opinion: ""
})
this.$refs.infoRef.onOpen(row, row.curTaskName || "帮扶审核")
},
@@ -328,7 +334,7 @@ layout("/layouts/platform_h5.html"){
// 提交级别、金额、审批意见和流程提交类型,接口返回统一响应对象。
submitTaskAction() {
this.$set(this, "formLoading", true)
this.$axios.post("/flow/common/executeTask", {
this.$axios.post("/platform/difficultHelp/approval/executeTask", {
data: JSON.stringify({
...this.formData,
submitType: this.pendingSubmitType