Compare commits

...
Author SHA1 Message Date
c-chengc1 26db19198d feat:增加分工会临时报销人审批流程 2026-09-11 15:36:54 +08:00
c-chengc1 cba3add65f feat:分工会临时报销人功能 2026-09-10 17:40:35 +08:00
c-zhouhf1 584e710136 commit 2026-09-10 16:09:33 +08:00
c-zhouhf1 9f7c0f214e commit 2026-09-09 10:26:53 +08:00
11 changed files with 1475 additions and 248 deletions
@@ -106,6 +106,7 @@ RoleConstant {
LEGAL_DOCTOR("法律顾问"),
UNION_REIMBURSEMENT_MANAGER("分工会报销负责人"),
UNION_TEMP_REIMBURSEMENT_APPLICANT("分工会临时报销人"),
CLUB_REIMBURSEMENT_MANAGER("协会报销负责人"),
SCHOOL_REIMBURSEMENT_MANAGER("校工会报销负责人"),
@@ -161,7 +161,7 @@ public class FlowDesignController {
return Result.success();
}
@At
@At("/xiugaiDesign")
@ApiOperation("修改流程设计")
@SaCheckPermission("flow.design")
public Result updateContent(@Param("design") ProcessDesign processDesign) {
@@ -6,6 +6,7 @@ import cn.hutool.core.date.DateUtil;
import cn.hutool.core.lang.Dict;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import com.budwk.app.base.annotation.SLog;
import com.budwk.app.base.constant.RoleConstant;
import com.budwk.app.base.page.Pagination;
@@ -23,6 +24,7 @@ import com.budwk.app.zhgh.activity.declarereimbursement.declare.models.ActivityD
import com.budwk.app.zhgh.activity.declarereimbursement.vo.CommonPageParam;
import com.budwk.app.zhgh.activity.declarereimbursement.reimbursement.models.ActivityReimbursementInfo;
import com.budwk.app.zhgh.activity.declarereimbursement.reimbursement.service.ActivityReimbursementService;
import com.budwk.app.zhgh.dayofficework.outlay.activityBudget.models.ActivityBudget;
import com.budwk.app.zhgh.dayofficework.outlay.outlayReimburse.service.OutlayReimburseApplyService;
import io.swagger.annotations.ApiOperation;
import org.nutz.aop.interceptor.ioc.TransAop;
@@ -94,6 +96,10 @@ public class ActivityReimbursementApplyController {
@SaCheckPermission(value = {"activityReimbursement.apply", "h5.activityReimbursement.apply"}, mode = SaMode.OR)
@SLog(tag = "活动申报", msg = "保存申请,申请人: ${args[0].username}")
public Result save(@Param("data") ActivityReimbursementInfo activityReimbursementInfo) {
Result scopeResult = validateTemporaryUnionReimbursement(activityReimbursementInfo);
if (scopeResult != null) {
return scopeResult;
}
activityReimbursementInfo.setUserId(SecurityUtil.getUserId());
activityReimbursementInfo.setLoginName(SecurityUtil.getUserLoginname());
activityReimbursementInfo.setUserName(SecurityUtil.getUserUsername());
@@ -123,6 +129,10 @@ public class ActivityReimbursementApplyController {
@SaCheckPermission(value = {"activityReimbursement.apply", "h5.activityReimbursement.apply"}, mode = SaMode.OR)
@SLog(tag = "活动申报", msg = "提交申请,申请人: ${args[0].username}")
public Result submit(@Param("data") ActivityReimbursementInfo activityReimbursementInfo) {
Result scopeResult = validateTemporaryUnionReimbursement(activityReimbursementInfo);
if (scopeResult != null) {
return scopeResult;
}
activityReimbursementInfo.setUserId(SecurityUtil.getUserId());
activityReimbursementInfo.setLoginName(SecurityUtil.getUserLoginname());
activityReimbursementInfo.setUserName(SecurityUtil.getUserUsername());
@@ -151,7 +161,9 @@ public class ActivityReimbursementApplyController {
args.set(FlowConst.FORM_DATA, activityReimbursementInfo);
args.set("outlayManageSource", activityReimbursementInfo.getOutlayManageSource());
args.set("actualMoney", activityReimbursementInfo.getActualMoney());
args.set("next", activityReimbursementInfo.getReimbursementIdentity());
// 临时报销人通过流程图中的“分工会代报销”独立分支进入财务审核,保留表单的分工会身份。
args.set("next", AuthUtil.hasRole(RoleConstant.UNION_TEMP_REIMBURSEMENT_APPLICANT.name())
? "unionTemp" : activityReimbursementInfo.getReimbursementIdentity());
args.set("clubId",activityReimbursementInfo.getClubId());
ProcessInstance instance = flowEngine.startProcessInstanceByKey("HDBX", activityReimbursementInfo.getId(), SecurityUtil.getUserId(), args);
@@ -170,6 +182,10 @@ public class ActivityReimbursementApplyController {
@SaCheckPermission(value = {"activityReimbursement.apply", "h5.activityReimbursement.apply"}, mode = SaMode.OR)
@SLog(tag = "活动申报", msg = "重新提交申请,申请人: ${args[0].username}")
public Result submitAgain(@Param("data") ActivityReimbursementInfo activityReimbursementInfo, @Param("taskId") Long taskId) {
Result scopeResult = validateTemporaryUnionReimbursement(activityReimbursementInfo);
if (scopeResult != null) {
return scopeResult;
}
if (StrUtil.isBlank(activityReimbursementInfo.getDeclareId())) {
activityReimbursementInfo.setDeclareId(activityReimbursementInfo.getDeclareId());
}
@@ -191,18 +207,90 @@ public class ActivityReimbursementApplyController {
Dict dict = Dict.create();
dict.set(FlowConst.PROCESS_TASK_ID_KEY, taskId);
dict.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.RE_APPLY.getCode());
if (AuthUtil.hasRole(RoleConstant.UNION_TEMP_REIMBURSEMENT_APPLICANT.name())) {
ProcessTask processTask = flowEngine.processTaskService().getById(taskId);
ProcessInstance processInstance = flowEngine.processInstanceService().getById(processTask.getProcessInstanceId());
String originalNext = JSONUtil.parseObj(processInstance.getVariable()).getStr("next");
// 新申请重提沿用独立分支;旧实例仍绑定旧定义,继续使用其已有的财务分支。
dict.set("next", Objects.equals(originalNext, "unionTemp") ? "unionTemp" : "school");
}
flowCommonService.executeTask(dict);
return Result.success();
}
/**
* 临时报销人按本分工会校验申请及实际扣款预算,防止篡改身份、经费类型或预算ID绕过限制。
*/
private Result validateTemporaryUnionReimbursement(ActivityReimbursementInfo info) {
if (!AuthUtil.hasRole(RoleConstant.UNION_TEMP_REIMBURSEMENT_APPLICANT.name())) {
return null;
}
if (info == null || !Objects.equals(info.getReimbursementIdentity(), "union")
|| !Objects.equals(info.getOutlayManageSource(), "ACTIVITY_BUDGET_TYPE_TWO")
|| StrUtil.isNotBlank(info.getClubId())) {
return Result.error("分工会临时报销人仅可使用分工会身份申请分工会经费报销");
}
String unionId = SecurityUtil.getUnionId();
if (StrUtil.isBlank(unionId)) {
return Result.error("当前用户未关联分工会,无法申请报销");
}
if (StrUtil.isNotBlank(info.getId())) {
ActivityReimbursementInfo savedInfo = dao.fetch(ActivityReimbursementInfo.class, info.getId());
if (savedInfo == null || !Objects.equals(savedInfo.getUserId(), SecurityUtil.getUserId())
|| !Objects.equals(savedInfo.getUnionId(), unionId)
|| !Objects.equals(savedInfo.getReimbursementIdentity(), "union")
|| !Objects.equals(savedInfo.getOutlayManageSource(), "ACTIVITY_BUDGET_TYPE_TWO")) {
return Result.error("仅可修改本人所在分工会的分工会经费报销申请");
}
}
if (StrUtil.isBlank(info.getDeductionBudgetId())) {
return Result.error("请选择本分工会的扣款预算");
}
ActivityBudget budget = dao.fetch(ActivityBudget.class, info.getDeductionBudgetId());
if (budget == null || !Objects.equals(budget.getOutlayManageSource(), "ACTIVITY_BUDGET_TYPE_TWO")
|| !Objects.equals(budget.getUnionId(), unionId)) {
return Result.error("扣款预算必须属于本分工会的分工会经费");
}
if (Objects.equals(info.getActivityReimbursementMode(), "activity")) {
if (StrUtil.isBlank(info.getDeclareId())) {
return Result.error("请选择本分工会的申报活动");
}
// 申报通过活动类型区分工会,实际扣款经费类型及归属已由上方预算校验约束。
ActivityDeclareInfo declareInfo = dao.fetch(ActivityDeclareInfo.class, info.getDeclareId());
if (declareInfo == null || !Objects.equals(declareInfo.getUnionId(), unionId)
|| !Objects.equals(declareInfo.getActivityType(), "BRANCH_UNION")) {
return Result.error("仅可报销本分工会使用分工会经费的活动");
}
} else if (Objects.equals(info.getActivityReimbursementMode(), "daily")) {
info.setDeclareId(null);
} else {
return Result.error("请选择报销模式");
}
// 分工会归属以登录用户为准,供后续审批流程使用。
info.setUnionId(unionId);
info.setActivityType("BRANCH_UNION");
return null;
}
@At
@ApiOperation("获取当前用户活动报销")
@SaCheckPermission(value = {"activityReimbursement.apply", "h5.activityReimbursement.apply"}, mode = SaMode.OR)
public Result getActivityReimbursementByUser(String id, String outlayManageSource, String clubId) {
String activityType = "";
boolean temporaryUnionApplicant = AuthUtil.hasRole(RoleConstant.UNION_TEMP_REIMBURSEMENT_APPLICANT.name());
if (temporaryUnionApplicant && (!Objects.equals(outlayManageSource, "ACTIVITY_BUDGET_TYPE_TWO")
|| StrUtil.isBlank(SecurityUtil.getUnionId()))) {
return Result.error("分工会临时报销人仅可申请本分工会经费报销");
}
if (StrUtil.isNotBlank(id)) {
ActivityReimbursementInfo reimbursementInfo = dao.fetch(ActivityReimbursementInfo.class, id);
if (temporaryUnionApplicant && (reimbursementInfo == null
|| !Objects.equals(reimbursementInfo.getUserId(), SecurityUtil.getUserId())
|| !Objects.equals(reimbursementInfo.getUnionId(), SecurityUtil.getUnionId())
|| !Objects.equals(reimbursementInfo.getOutlayManageSource(), "ACTIVITY_BUDGET_TYPE_TWO"))) {
return Result.error("无权访问该报销申请");
}
if (Objects.equals(reimbursementInfo.getActivityReimbursementMode(), "daily")) {
return Result.success();
}
@@ -324,7 +412,20 @@ public class ActivityReimbursementApplyController {
@ApiOperation("获取申报的记录")
@SaCheckPermission(value = {"activityReimbursement.apply", "h5.activityReimbursement.apply"}, mode = SaMode.OR)
public Result getBudgetByYear(String outlayManageSource, String clubId) {
boolean temporaryUnionApplicant = AuthUtil.hasRole(RoleConstant.UNION_TEMP_REIMBURSEMENT_APPLICANT.name());
if (temporaryUnionApplicant && (!Objects.equals(outlayManageSource, "ACTIVITY_BUDGET_TYPE_TWO")
|| StrUtil.isBlank(SecurityUtil.getUnionId()))) {
return Result.error("分工会临时报销人仅可申请本分工会经费报销");
}
List<NutMap> budgetMoney = activityReimbursementService.getBudgetMoney(outlayManageSource, clubId);
if (temporaryUnionApplicant) {
// 兼有系统管理员角色时也必须限制为本分工会预算,不改变原预算金额展示规则。
List<String> unionBudgetIds = dao.query(ActivityBudget.class,
Cnd.where("unionId", "=", SecurityUtil.getUnionId())
.and("outlayManageSource", "=", "ACTIVITY_BUDGET_TYPE_TWO"))
.stream().map(ActivityBudget::getId).toList();
budgetMoney = budgetMoney.stream().filter(v -> unionBudgetIds.contains(v.getString("id"))).toList();
}
return Result.success(budgetMoney);
}
@@ -145,11 +145,13 @@ public class CondolenceApplyController {
}
if(!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())) {
if(AuthUtil.hasRoleOr(
RoleConstant.BRANCH_UNION_ADMIN.name(),
RoleConstant.BRANCH_UNION_ZUZHI_WY.name(),
RoleConstant.BRANCH_UNION_CHAIRMAN.name(),
RoleConstant.BRANCH_UNION_WY.name(),
RoleConstant.BRANCH_UNION_XUANCHUAN_WY.name(),
RoleConstant.BRANCH_UNION_WENTI_WY.name(),
RoleConstant.BRANCH_UNION_WENTI_SPORTS.name(),
RoleConstant.BRANCH_UNION_NVGONG_WY.name(),
RoleConstant.BRANCH_UNION_XJSHAN_PROMOTION.name()
)) {
cnd.and(View_user::getUnionId, "=", SecurityUtil.getUnionId());
@@ -0,0 +1,67 @@
-- 分工会临时报销人:复用现有报销菜单;经费范围由申请页面及后端按角色编码共同限制。
-- 适用于已配置费用报销菜单的 MySQL 数据库,可重复执行,不关联具体用户。
START TRANSACTION;
INSERT INTO sys_role
(id, name, code, aliasName, disabled, unitid, note, sort, createdBy, createdAt, updatedBy, updatedAt, delFlag)
SELECT REPLACE(UUID(), '-', ''), '分工会临时报销人', 'UNION_TEMP_REIMBURSEMENT_APPLICANT',
'分工会临时报销人', 0, '', '仅可使用分工会身份申请本分工会经费报销', 0,
'', FLOOR(UNIX_TIMESTAMP(CURRENT_TIMESTAMP(3)) * 1000),
'', FLOOR(UNIX_TIMESTAMP(CURRENT_TIMESTAMP(3)) * 1000), 0
WHERE NOT EXISTS (
SELECT 1 FROM sys_role WHERE code = 'UNION_TEMP_REIMBURSEMENT_APPLICANT'
);
-- 只授权报销申请、我的报销及其导航父级,不复制原报销角色的审批等权限。
-- activityDeclare 用于报销选取活动后读取申报详情,不授权活动申报、预算申报或审核子菜单。
-- 同时关联已有的手机端报销菜单;通过路径前缀补齐导航父级,不授权同级菜单。
INSERT INTO sys_role_menu (roleId, menuId)
SELECT DISTINCT role.id, menu.id
FROM sys_role role
JOIN sys_menu entry ON entry.permission IN (
'activityReimbursement.apply',
'activityReimbursement.mine',
'h5.activityReimbursement.apply',
'h5.activityReimbursement.mine',
'activityDeclare'
)
JOIN sys_menu menu ON menu.id = entry.id OR (
menu.type = 'menu'
AND menu.path IS NOT NULL
AND menu.path <> ''
AND entry.path LIKE CONCAT(menu.path, '%')
)
WHERE role.code = 'UNION_TEMP_REIMBURSEMENT_APPLICANT'
AND entry.disabled = 0
AND menu.disabled = 0
AND NOT EXISTS (
SELECT 1 FROM sys_role_menu assigned
WHERE assigned.roleId = role.id AND assigned.menuId = menu.id
);
-- 工会管理的角色下拉框及人员列表均读取 BRANCH_UNION_ROLES 字典,角色表记录不会自动成为选项。
-- 沿用字典每级四位的路径规则,将新角色追加到已有子项之后,并按父级与角色编码避免重复插入。
INSERT INTO sys_dict
(id, parentId, path, name, remark, code, disabled, location, hasChildren,
createdBy, createdAt, updatedBy, updatedAt, delFlag)
SELECT REPLACE(UUID(), '-', ''), parent.id,
CONCAT(parent.path, LPAD(COALESCE(siblings.maxSuffix, 0) + 1, 4, '0')),
'分工会临时报销人', '仅可申请本分工会经费报销', 'UNION_TEMP_REIMBURSEMENT_APPLICANT',
0, COALESCE(siblings.maxLocation, 0) + 1, 0,
'', FLOOR(UNIX_TIMESTAMP(CURRENT_TIMESTAMP(3)) * 1000),
'', FLOOR(UNIX_TIMESTAMP(CURRENT_TIMESTAMP(3)) * 1000), 0
FROM sys_dict parent
LEFT JOIN (
SELECT parentId, MAX(CAST(RIGHT(path, 4) AS UNSIGNED)) AS maxSuffix,
MAX(location) AS maxLocation
FROM sys_dict
GROUP BY parentId
) siblings ON siblings.parentId = parent.id
WHERE parent.code = 'BRANCH_UNION_ROLES'
AND NOT EXISTS (
SELECT 1 FROM sys_dict existing
WHERE existing.parentId = parent.id
AND existing.code = 'UNION_TEMP_REIMBURSEMENT_APPLICANT'
);
COMMIT;
+929
View File
@@ -0,0 +1,929 @@
{
"name": "HDBX",
"category": "3",
"displayName": "费用报销管理",
"instanceUrl": "/platform/activityReimbursement/apply",
"h5InstanceUrl": "/platform/activityReimbursement/apply/h5",
"nodes": [
{
"id": "686d23b6-707f-40d4-ab7c-1987616e4ae0",
"type": "snaker:start",
"x": 220,
"y": 240,
"properties": {
"postInterceptors": ""
},
"text": {
"x": 220,
"y": 280,
"value": "开始"
}
},
{
"id": "startTask",
"type": "snaker:task",
"x": 360,
"y": 240,
"properties": {
"form": "/platform/activityReimbursement/mine",
"h5form": "/platform/activityReimbursement/mine/h5",
"assignee": "initiator",
"assigneeMode": "initiator",
"assigneeText": "流程发起人",
"buttonConfig": [
{
"value": 0,
"visible": true,
"disabled": false,
"originalText": "提交"
}
],
"postInterceptors": ""
},
"text": {
"x": 360,
"y": 240,
"value": "提交申请"
}
},
{
"id": "5afcf810-7a8b-4896-9aa7-c99995e0856b",
"type": "snaker:task",
"x": 700,
"y": 240,
"properties": {
"form": "/platform/activityReimbursement/clubPrincipal",
"h5form": "/platform/activityReimbursement/clubPrincipal/h5",
"assignee": "",
"assigneeMode": "manual",
"assigneeText": "",
"buttonConfig": [
{
"value": 0,
"originalText": "发起申请"
},
{
"theme": "primary",
"value": 1,
"visible": true,
"originalText": "同意申请"
},
{
"theme": "danger",
"value": 2,
"visible": true,
"originalText": "拒绝申请"
},
{
"value": 3,
"originalText": "退回上一步"
},
{
"value": 4,
"originalText": "跳转"
},
{
"value": 5,
"originalText": "重新提交"
},
{
"theme": "danger",
"value": 6,
"visible": true,
"originalText": "退回发起人"
},
{
"value": 20,
"originalText": "会签拒绝申请"
}
],
"assignmentHandler": "com.budwk.app.flow.handler.FlowClubPresidentByArgsAssignmentHandler"
},
"text": {
"x": 700,
"y": 240,
"value": "协会负责人审核"
}
},
{
"id": "182768cf-ff70-4b59-8f5d-8523831380e8",
"type": "snaker:decision",
"x": 520,
"y": 240,
"properties": {}
},
{
"id": "1e4cc473-beae-427d-b9dc-c1c4d0eb07c8",
"type": "snaker:task",
"x": 700,
"y": 100,
"properties": {
"form": "/platform/activityReimbursement/branchUnion",
"h5form": "/platform/activityReimbursement/branchUnion/h5",
"assignee": "",
"assigneeMode": "manual",
"assigneeText": "",
"buttonConfig": [
{
"value": 0,
"originalText": "发起申请"
},
{
"theme": "primary",
"value": 1,
"visible": true,
"originalText": "同意申请"
},
{
"theme": "danger",
"value": 2,
"visible": true,
"originalText": "拒绝申请"
},
{
"value": 3,
"originalText": "退回上一步"
},
{
"value": 4,
"originalText": "跳转"
},
{
"value": 5,
"originalText": "重新提交"
},
{
"theme": "danger",
"value": 6,
"visible": true,
"originalText": "退回发起人"
},
{
"value": 20,
"originalText": "会签拒绝申请"
}
],
"assignmentHandler": "com.budwk.app.flow.handler.FlowFghzxAssignmentHandler"
},
"text": {
"x": 700,
"y": 100,
"value": "分工会审核"
}
},
{
"id": "6dd2e8b3-fd0d-4b35-bb2a-1eef227cba96",
"type": "snaker:task",
"x": 1120,
"y": 240,
"properties": {
"form": "/platform/activityReimbursement/schoolPrincipal",
"h5form": "/platform/activityReimbursement/schoolPrincipal/h5",
"assignee": "2c8b9143b5cd491ba49dd4b52a844b10",
"assigneeMode": "select",
"assigneeText": "陈曦",
"buttonConfig": [
{
"value": 0,
"originalText": "发起申请"
},
{
"theme": "primary",
"value": 1,
"visible": true,
"originalText": "同意申请"
},
{
"theme": "danger",
"value": 2,
"visible": true,
"originalText": "拒绝申请"
},
{
"theme": "danger",
"value": 3,
"visible": true,
"originalText": "退回上一步"
},
{
"value": 4,
"originalText": "跳转"
},
{
"value": 5,
"originalText": "重新提交"
},
{
"theme": "danger",
"value": 6,
"visible": true,
"originalText": "退回发起人"
},
{
"value": 20,
"originalText": "会签拒绝申请"
}
]
},
"text": {
"x": 1120,
"y": 240,
"value": "校工会预审"
}
},
{
"id": "47bfdf53-288c-4352-a403-0653483b54eb",
"type": "snaker:task",
"x": 1540,
"y": 240,
"properties": {
"form": "/platform/activityReimbursement/schoolUnion",
"h5form": "/platform/activityReimbursement/schoolUnion/h5",
"assignee": "fd76781c09c04147b5170179be127240",
"assigneeMode": "select",
"assigneeText": "张红萍",
"buttonConfig": [
{
"value": 0,
"originalText": "发起申请"
},
{
"theme": "primary",
"value": 1,
"visible": true,
"originalText": "同意申请"
},
{
"theme": "danger",
"value": 2,
"visible": true,
"originalText": "拒绝申请"
},
{
"theme": "danger",
"value": 3,
"visible": true,
"originalText": "退回上一步"
},
{
"value": 4,
"originalText": "跳转"
},
{
"value": 5,
"originalText": "重新提交"
},
{
"theme": "danger",
"value": 6,
"visible": true,
"originalText": "退回发起人"
},
{
"value": 20,
"originalText": "会签拒绝申请"
}
]
},
"text": {
"x": 1540,
"y": 240,
"value": "校工会主席审核"
}
},
{
"id": "776311f1-b016-4090-9112-1b4a11fb0d4a",
"type": "snaker:end",
"x": 1920,
"y": 240,
"properties": {},
"text": {
"x": 1920,
"y": 280,
"value": "结束"
}
},
{
"id": "ba496ac7-abb3-4e6d-8c8e-212863a0d6ee",
"type": "snaker:task",
"x": 900,
"y": 240,
"properties": {
"form": "/platform/activityReimbursement/schoolFinance",
"h5form": "/platform/activityReimbursement/schoolFinance/h5",
"assignee": "5b8880eeee384eb4be20084735aac6e6",
"assigneeMode": "select",
"assigneeText": "丁彩华",
"buttonConfig": [
{
"value": 0,
"originalText": "发起申请"
},
{
"value": 1,
"originalText": "同意申请"
},
{
"value": 2,
"originalText": "拒绝申请"
},
{
"value": 3,
"originalText": "退回上一步"
},
{
"value": 4,
"originalText": "跳转"
},
{
"value": 5,
"originalText": "重新提交"
},
{
"value": 6,
"originalText": "退回发起人"
},
{
"value": 20,
"originalText": "会签拒绝申请"
}
]
},
"text": {
"x": 900,
"y": 240,
"value": "校工会财务审核"
}
},
{
"id": "f9b8379f-f348-4985-ba58-b6ba28deb9af",
"type": "snaker:task",
"x": 1320,
"y": 240,
"properties": {
"form": "/platform/activityReimbursement/deputySchoolUnion",
"h5form": "/platform/activityReimbursement/deputySchoolUnion/h5",
"assignee": "b472656183e6408697b8ada687cad442",
"assigneeMode": "select",
"assigneeText": "张蕴梅",
"buttonConfig": [
{
"value": 0,
"originalText": "发起申请"
},
{
"value": 1,
"originalText": "同意申请"
},
{
"value": 2,
"originalText": "拒绝申请"
},
{
"value": 3,
"originalText": "退回上一步"
},
{
"value": 4,
"originalText": "跳转"
},
{
"value": 5,
"originalText": "重新提交"
},
{
"value": 6,
"originalText": "退回发起人"
},
{
"value": 20,
"originalText": "会签拒绝申请"
}
]
},
"text": {
"x": 1320,
"y": 240,
"value": "校工会副主席审核"
}
},
{
"id": "409e8fad-6bd5-485a-8b3e-e1d58688e05a",
"type": "snaker:decision",
"x": 1320,
"y": 420,
"properties": {}
},
{
"id": "e283f33f-4ac7-4c66-9b16-e0653e8dc452",
"type": "snaker:task",
"x": 1760,
"y": 240,
"properties": {
"form": "/platform/activityReimbursement/cashier",
"h5form": "/platform/activityReimbursement/cashier/h5",
"assignee": "762206d35f7041178e66956d859b823d",
"assigneeMode": "select",
"assigneeText": "嵇蓉静",
"buttonConfig": [
{
"value": 0,
"originalText": "发起申请"
},
{
"value": 1,
"originalText": "同意申请"
},
{
"value": 2,
"originalText": "拒绝申请"
},
{
"value": 3,
"originalText": "退回上一步"
},
{
"value": 4,
"originalText": "跳转"
},
{
"value": 5,
"originalText": "重新提交"
},
{
"value": 6,
"originalText": "退回发起人"
},
{
"value": 20,
"originalText": "会签拒绝申请"
}
]
},
"text": {
"x": 1760,
"y": 240,
"value": "出纳支付"
}
}
],
"edges": [
{
"id": "7eab997d-639c-49a8-bb1a-f6a0a9983eb7",
"type": "snaker:transition",
"sourceNodeId": "182768cf-ff70-4b59-8f5d-8523831380e8",
"targetNodeId": "ba496ac7-abb3-4e6d-8c8e-212863a0d6ee",
"startPoint": {
"x": 508,
"y": 253
},
"endPoint": {
"x": 940,
"y": 280
},
"properties": {
"expr": "{next=='unionTemp'}"
},
"text": {
"x": 700,
"y": 480,
"value": "分工会代报销"
},
"pointsList": [
{
"x": 508,
"y": 253
},
{
"x": 460,
"y": 253
},
{
"x": 460,
"y": 480
},
{
"x": 940,
"y": 480
},
{
"x": 940,
"y": 280
}
]
},
{
"id": "876385a3-18eb-4022-864b-068053ec9e06",
"type": "snaker:transition",
"sourceNodeId": "182768cf-ff70-4b59-8f5d-8523831380e8",
"targetNodeId": "1e4cc473-beae-427d-b9dc-c1c4d0eb07c8",
"startPoint": {
"x": 520,
"y": 215
},
"endPoint": {
"x": 640,
"y": 100
},
"properties": {
"expr": "{next=='union'}"
},
"text": {
"x": 520,
"y": 157.5,
"value": "分工会"
},
"pointsList": [
{
"x": 520,
"y": 215
},
{
"x": 520,
"y": 100
},
{
"x": 640,
"y": 100
}
]
},
{
"id": "add1a8a8-1bb5-4bb3-adf7-ef4868d4972c",
"type": "snaker:transition",
"sourceNodeId": "182768cf-ff70-4b59-8f5d-8523831380e8",
"targetNodeId": "5afcf810-7a8b-4896-9aa7-c99995e0856b",
"startPoint": {
"x": 545,
"y": 240
},
"endPoint": {
"x": 640,
"y": 240
},
"properties": {
"expr": "{next=='club'}"
},
"text": {
"x": 592.5,
"y": 240,
"value": "协会"
},
"pointsList": [
{
"x": 545,
"y": 240
},
{
"x": 640,
"y": 240
}
]
},
{
"id": "4c288069-d042-4070-9afd-4902baf148b0",
"type": "snaker:transition",
"sourceNodeId": "startTask",
"targetNodeId": "182768cf-ff70-4b59-8f5d-8523831380e8",
"startPoint": {
"x": 420,
"y": 240
},
"endPoint": {
"x": 495,
"y": 240
},
"properties": {},
"pointsList": [
{
"x": 420,
"y": 240
},
{
"x": 495,
"y": 240
}
]
},
{
"id": "de8ae26f-8660-4cd2-9507-ef573bdbef6c",
"type": "snaker:transition",
"sourceNodeId": "686d23b6-707f-40d4-ab7c-1987616e4ae0",
"targetNodeId": "startTask",
"startPoint": {
"x": 238,
"y": 240
},
"endPoint": {
"x": 300,
"y": 240
},
"properties": {},
"pointsList": [
{
"x": 238,
"y": 240
},
{
"x": 300,
"y": 240
}
]
},
{
"id": "b36a46d0-05ff-486c-9cbf-b6f9e4e50217",
"type": "snaker:transition",
"sourceNodeId": "182768cf-ff70-4b59-8f5d-8523831380e8",
"targetNodeId": "ba496ac7-abb3-4e6d-8c8e-212863a0d6ee",
"startPoint": {
"x": 519,
"y": 265
},
"endPoint": {
"x": 902,
"y": 280
},
"properties": {
"expr": "{next=='school'}"
},
"text": {
"x": 710.5,
"y": 376,
"value": "校工会"
},
"pointsList": [
{
"x": 519,
"y": 265
},
{
"x": 519,
"y": 376
},
{
"x": 902,
"y": 376
},
{
"x": 902,
"y": 280
}
]
},
{
"id": "bfb971df-c94b-46f5-9dc2-e0e0624b1f0f",
"type": "snaker:transition",
"sourceNodeId": "ba496ac7-abb3-4e6d-8c8e-212863a0d6ee",
"targetNodeId": "6dd2e8b3-fd0d-4b35-bb2a-1eef227cba96",
"startPoint": {
"x": 960,
"y": 240
},
"endPoint": {
"x": 1060,
"y": 240
},
"properties": {},
"pointsList": [
{
"x": 960,
"y": 240
},
{
"x": 1060,
"y": 240
}
]
},
{
"id": "aae8eac1-3613-49f9-8bdf-5e054de9a78d",
"type": "snaker:transition",
"sourceNodeId": "5afcf810-7a8b-4896-9aa7-c99995e0856b",
"targetNodeId": "ba496ac7-abb3-4e6d-8c8e-212863a0d6ee",
"startPoint": {
"x": 760,
"y": 240
},
"endPoint": {
"x": 840,
"y": 240
},
"properties": {},
"pointsList": [
{
"x": 760,
"y": 240
},
{
"x": 840,
"y": 240
}
]
},
{
"id": "ae58c15a-1a76-4201-9633-cfbdb47b3b2f",
"type": "snaker:transition",
"sourceNodeId": "1e4cc473-beae-427d-b9dc-c1c4d0eb07c8",
"targetNodeId": "ba496ac7-abb3-4e6d-8c8e-212863a0d6ee",
"startPoint": {
"x": 760,
"y": 100
},
"endPoint": {
"x": 900,
"y": 200
},
"properties": {},
"pointsList": [
{
"x": 760,
"y": 100
},
{
"x": 900,
"y": 100
},
{
"x": 900,
"y": 200
}
]
},
{
"id": "b3549e56-d9d4-4a40-ae41-f49f57b20fd4",
"type": "snaker:transition",
"sourceNodeId": "6dd2e8b3-fd0d-4b35-bb2a-1eef227cba96",
"targetNodeId": "f9b8379f-f348-4985-ba58-b6ba28deb9af",
"startPoint": {
"x": 1180,
"y": 240
},
"endPoint": {
"x": 1260,
"y": 240
},
"properties": {},
"pointsList": [
{
"x": 1180,
"y": 240
},
{
"x": 1260,
"y": 240
}
]
},
{
"id": "809cebae-3520-42b9-b781-a4e99f8e8493",
"type": "snaker:transition",
"sourceNodeId": "f9b8379f-f348-4985-ba58-b6ba28deb9af",
"targetNodeId": "409e8fad-6bd5-485a-8b3e-e1d58688e05a",
"startPoint": {
"x": 1315,
"y": 280
},
"endPoint": {
"x": 1315,
"y": 395
},
"properties": {},
"pointsList": [
{
"x": 1315,
"y": 280
},
{
"x": 1315,
"y": 395
}
]
},
{
"id": "d6c1ad28-0a92-463d-b8eb-3566cb996748",
"type": "snaker:transition",
"sourceNodeId": "409e8fad-6bd5-485a-8b3e-e1d58688e05a",
"targetNodeId": "47bfdf53-288c-4352-a403-0653483b54eb",
"startPoint": {
"x": 1345,
"y": 420
},
"endPoint": {
"x": 1574,
"y": 280
},
"properties": {
"expr": "{actualMoney>=10000}"
},
"text": {
"x": 1459.5,
"y": 420,
"value": "金额超过一万"
},
"pointsList": [
{
"x": 1345,
"y": 420
},
{
"x": 1574,
"y": 420
},
{
"x": 1574,
"y": 280
}
]
},
{
"id": "4749adda-4a3a-4fd4-a655-94007ce9eec6",
"type": "snaker:transition",
"sourceNodeId": "47bfdf53-288c-4352-a403-0653483b54eb",
"targetNodeId": "e283f33f-4ac7-4c66-9b16-e0653e8dc452",
"startPoint": {
"x": 1600,
"y": 240
},
"endPoint": {
"x": 1700,
"y": 240
},
"properties": {},
"pointsList": [
{
"x": 1600,
"y": 240
},
{
"x": 1700,
"y": 240
}
]
},
{
"id": "c68c6814-bd8f-4f4d-9dcb-0b79bf9af5c1",
"type": "snaker:transition",
"sourceNodeId": "e283f33f-4ac7-4c66-9b16-e0653e8dc452",
"targetNodeId": "776311f1-b016-4090-9112-1b4a11fb0d4a",
"startPoint": {
"x": 1820,
"y": 240
},
"endPoint": {
"x": 1902,
"y": 240
},
"properties": {},
"pointsList": [
{
"x": 1820,
"y": 240
},
{
"x": 1902,
"y": 240
}
]
},
{
"id": "218593d1-f31b-4c05-bf21-6da6110dc9dd",
"type": "snaker:transition",
"sourceNodeId": "409e8fad-6bd5-485a-8b3e-e1d58688e05a",
"targetNodeId": "e283f33f-4ac7-4c66-9b16-e0653e8dc452",
"startPoint": {
"x": 1320,
"y": 445
},
"endPoint": {
"x": 1760,
"y": 280
},
"properties": {
"expr": "{actualMoney<10000}"
},
"text": {
"x": 1540,
"y": 541,
"value": "金额没有超过一万"
},
"pointsList": [
{
"x": 1320,
"y": 445
},
{
"x": 1320,
"y": 541
},
{
"x": 1760,
"y": 541
},
{
"x": 1760,
"y": 280
}
]
}
]
}
@@ -140,7 +140,7 @@
...this.designerData,
content: val.json
}
$.post("/flow/design/updateContent", { design: JSON.stringify(design) }).then((res) => {
$.post("/flow/design/xiugaiDesign", { design: JSON.stringify(design) }).then((res) => {
if (res.code === 0) {
window.parent.postMessage("success")
} else {
@@ -380,6 +380,9 @@ layout("/layouts/platform.html"){
}
},
methods: {
isTemporaryUnionApplicant() {
return this.$auth.hasRole('UNION_TEMP_REIMBURSEMENT_APPLICANT')
},
hasUnionRole() {
return this.$auth.hasPermission('activityReimbursement.apply.unionHas')
},
@@ -565,6 +568,10 @@ layout("/layouts/platform.html"){
}
this.formData.id = this.bizId ? this.bizId : null
if (this.isTemporaryUnionApplicant()) {
// 申报记录的ID不能作为报销主键,单独保留关联活动以供后端校验。
this.$set(this.formData, 'declareId', id)
}
if (data.planStartTime && data.planEndTime) {
this.formData.planDate = [data.planStartTime, data.planEndTime]
@@ -602,6 +609,15 @@ layout("/layouts/platform.html"){
},
initBudgetType() {
this.$businessTool.getDictOptions("ACTIVITY_BUDGET_TYPE").then(resp => {
// 临时报销人即使兼有其他角色,也只能使用分工会经费。
if (this.isTemporaryUnionApplicant()) {
this.budgetTypeOption = resp.filter(v => v.code === "ACTIVITY_BUDGET_TYPE_TWO")
if (!this.bizId) {
this.$set(this.formData, 'outlayManageSource', 'ACTIVITY_BUDGET_TYPE_TWO')
this.outlayManageSourceChange('ACTIVITY_BUDGET_TYPE_TWO')
}
return
}
this.budgetTypeOption = resp
const budgetTypeCloseOption = []
const typeOneOption = resp.find(v => v.code === "ACTIVITY_BUDGET_TYPE_ONE")
@@ -636,6 +652,16 @@ layout("/layouts/platform.html"){
})
},
initReimbursementIdentity() {
if (this.isTemporaryUnionApplicant()) {
this.reimbursementIdentityOption = [{name: "分工会", code: "union"}]
if (!this.bizId) {
this.$set(this.formData, 'reimbursementIdentity', 'union')
if (this.$store.state.user.union) {
this.reimbursementIdentityChange('union')
}
}
return
}
if (this.$auth.hasPermission('activityReimbursement.apply.schoolHas')) {
this.reimbursementIdentityOption.push({name: "校工会", code: "school"})
}
@@ -226,12 +226,17 @@ layout("/layouts/platform.html"){
files: [{required: true, message: "必填", trigger: ["change", "blur"]}],
signature: [{required: true, message: "必填", trigger: ["change", "blur"]}]
},
chooseType: {},
payUserOptions: [],
helpUserOptions: [],
typeOptions: []
}
},
computed: {
// 类型列表和申请详情独立加载,任一数据变化后重新匹配;未匹配时返回空对象,保证附件区域安全渲染。
chooseType() {
return this.typeOptions.find(o => o.id === this.formData.type) || {}
}
},
methods: {
createRemoteMethod(options) {
return (keyword) => {
@@ -267,10 +272,11 @@ layout("/layouts/platform.html"){
}
},
typeChange(id) {
this.chooseType = this.typeOptions.find(o => o.id === id)
if (this.chooseType) {
this.$set(this.formData, "money", this.chooseType.money)
this.$set(this.formData, "way", this.chooseType.way)
// id 为用户选择的慰问类型 ID;仅匹配成功时更新金额和方式,详情回显时保留原申请值。
const type = this.typeOptions.find(o => o.id === id)
if (type) {
this.$set(this.formData, "money", type.money)
this.$set(this.formData, "way", type.way)
}
},
onSave() {
@@ -335,7 +341,6 @@ layout("/layouts/platform.html"){
this.formData = res.data
this.selectQueryUser(this.formData.helpLoginName, this.helpUserOptions)
this.selectQueryUser(this.formData.payLoginName, this.payUserOptions)
this.chooseType = this.typeOptions.find(o => o.id === this.formData.type)
}
})
} else {
@@ -352,9 +357,10 @@ layout("/layouts/platform.html"){
}
},
queryCondolenceType() {
// 接口无需参数,返回 Resultcode 为 0 时 data 为启用类型数组,异常响应按空列表处理。
this.$axios.post("/platform/condolence/type/queryCondolenceType")
.then((resp) => {
this.typeOptions = resp.data
this.$set(this, "typeOptions", resp && resp.code === 0 && Array.isArray(resp.data) ? resp.data : [])
})
}
},
@@ -276,6 +276,9 @@ layout("/layouts/platform_h5.html"){
}
},
methods: {
isTemporaryUnionApplicant() {
return this.$auth.hasRole('UNION_TEMP_REIMBURSEMENT_APPLICANT')
},
hasUnionRole() {
return this.$auth.hasPermission('activityReimbursement.apply.unionHas')
},
@@ -786,6 +789,16 @@ layout("/layouts/platform_h5.html"){
},
initBudgetType() {
return this.$businessTool.getDictOptions('ACTIVITY_BUDGET_TYPE').then((resp) => {
// 与电脑端保持一致,临时报销人的经费范围不叠加其他角色权限。
if (this.isTemporaryUnionApplicant()) {
this.budgetTypeOption = resp.filter((item) => item.code === 'ACTIVITY_BUDGET_TYPE_TWO')
if (!this.bizId) {
this.$set(this.formData, 'outlayManageSource', 'ACTIVITY_BUDGET_TYPE_TWO')
this.$set(this.formData, 'outlayManageSourceName', '分工会经费')
this.outlayManageSourceChange('ACTIVITY_BUDGET_TYPE_TWO')
}
return
}
const result = []
const typeOne = resp.find((item) => item.code === 'ACTIVITY_BUDGET_TYPE_ONE')
if (typeOne) {
@@ -815,6 +828,17 @@ layout("/layouts/platform_h5.html"){
})
},
initReimbursementIdentity() {
if (this.isTemporaryUnionApplicant()) {
this.reimbursementIdentityOption = [{name: '分工会', code: 'union'}]
if (!this.bizId) {
this.$set(this.formData, 'reimbursementIdentity', 'union')
this.$set(this.formData, 'reimbursementIdentityName', '分工会')
if (this.$store.state.user.union) {
this.reimbursementIdentityChange('union')
}
}
return
}
if (this.hasSchoolLevelRole()) {
this.reimbursementIdentityOption.push({name: '校工会', code: 'school'})
}
@@ -34,10 +34,10 @@ layout("/layouts/platform_h5.html"){
readonly
:rules="[{ required: true }]"
placeholder="请点击选择慰问对象"
@click="helpUserSelectShow = true"
@click="openUserSelect('help')"
is-link
></van-field>
<van-action-sheet v-model="helpUserSelectShow" title="慰问对象" class="height100">
<van-action-sheet v-model="helpUserSelectShow" @close="resetUserSearch" title="慰问对象" class="height100">
<van-search
v-model="searchKeyword"
:show-action="false"
@@ -65,12 +65,13 @@ layout("/layouts/platform_h5.html"){
name="payUserName"
label="收款人"
required
readonly
:rules="[{ required: true }]"
placeholder="请点击选择收款人"
@click="payUserSelectShow = true"
@click="openUserSelect('pay')"
is-link
></van-field>
<van-action-sheet v-model="payUserSelectShow" title="收款人" class="height100">
<van-action-sheet v-model="payUserSelectShow" @close="resetUserSearch" title="收款人" class="height100">
<van-search
v-model="searchKeyword"
:show-action="false"
@@ -101,12 +102,12 @@ layout("/layouts/platform_h5.html"){
readonly
:rules="[{ required: true }]"
placeholder="请点击选择慰问类型"
@click="showTypePicker = true"
@click="this.$set(this, 'showTypePicker', true)"
clickable
is-link
></van-field>
<van-popup position="bottom" round v-model:show="showTypePicker">
<van-picker :columns="typeColumns" @cancel="showTypePicker = false" @confirm="onTypeConfirm" show-toolbar></van-picker>
<van-picker :columns="typeColumns" @cancel="this.$set(this, 'showTypePicker', false)" @confirm="onTypeConfirm" show-toolbar></van-picker>
</van-popup>
<van-field
@@ -140,15 +141,15 @@ layout("/layouts/platform_h5.html"){
clickable
is-link
readonly
@click="showTimePicker = true"
@click="openTimePicker"
></van-field>
<van-popup position="bottom" round v-model:show="showTimePicker">
<van-datetime-picker
v-model="formData.occurTime"
v-model="timePickerValue"
type="date"
title="请选择慰问时间"
@confirm="(val) => {formData.occurTime = $moment(val).format('YYYY-MM-DD'); showTimePicker = false}"
@cancel="showTimePicker = false"
@confirm="onTimeConfirm"
@cancel="this.$set(this, 'showTimePicker', false)"
></van-datetime-picker>
</van-popup>
@@ -163,15 +164,15 @@ layout("/layouts/platform_h5.html"){
clickable
is-link
readonly
@click="showChildPicker = true"
@click="this.$set(this, 'showChildPicker', true)"
></van-field>
<van-popup position="bottom" round v-model:show="showChildPicker">
<van-picker
title="请选择孩次"
show-toolbar
:columns="['一孩', '二孩', '三孩']"
@confirm="(val) => {formData.child = val; showChildPicker = false}"
@cancel="showChildPicker = false"
@confirm="(val) => {this.$set(formData, 'child', val); this.$set(this, 'showChildPicker', false)}"
@cancel="this.$set(this, 'showChildPicker', false)"
></van-picker>
</van-popup>
@@ -223,15 +224,15 @@ layout("/layouts/platform_h5.html"){
clickable
is-link
readonly
@click="showFamilyPicker = true"
@click="this.$set(this, 'showFamilyPicker', true)"
></van-field>
<van-popup position="bottom" round v-model:show="showFamilyPicker">
<van-picker
title="请选择直系亲属"
show-toolbar
:columns="['配偶', '父亲', '母亲', '子女']"
@confirm="(val) => {formData.deadImmediateFamily = val; showFamilyPicker = false}"
@cancel="showFamilyPicker = false"
@confirm="(val) => {this.$set(formData, 'deadImmediateFamily', val); this.$set(this, 'showFamilyPicker', false)}"
@cancel="this.$set(this, 'showFamilyPicker', false)"
></van-picker>
</van-popup>
@@ -255,7 +256,7 @@ layout("/layouts/platform_h5.html"){
{{ '(附件说明:' + chooseType.uploadFileDesc + '' }}
</span>
</template>
<van-field class="direction-column-field" name="avatar" label="">
<van-field class="direction-column-field" name="files" label="" :rules="[{ validator: validateFiles, message: '请上传附件' }]">
<template #input>
<h5-file-upload
slot="input"
@@ -269,7 +270,7 @@ layout("/layouts/platform_h5.html"){
</van-cell-group>
<van-cell-group title="签字" class="form-section">
<van-field class="direction-column-field" name="signature" label="">
<van-field class="direction-column-field" name="signature" label="" :rules="[{ validator: validateSignature, message: '请完成签字' }]">
<template #input>
<h5-signature v-model="formData.signature" slot="input"></h5-signature>
</template>
@@ -278,9 +279,9 @@ layout("/layouts/platform_h5.html"){
<!-- 提交按钮 -->
<div class="form-actions">
<van-button native-type="button" @click="onSave" round type="info" plain>保存申请</van-button>
<van-button @click="onSubmit" round type="info" v-if="!taskId">提交申请</van-button>
<van-button @click="onFinishTask" round type="info" v-else>提交申请</van-button>
<van-button native-type="button" @click="onSave" :loading="formLoading" :disabled="formLoading" round type="info" plain>保存申请</van-button>
<van-button native-type="button" @click="onSubmit" :loading="formLoading" :disabled="formLoading" round type="info" v-if="!taskId">提交申请</van-button>
<van-button native-type="button" @click="onFinishTask" :loading="formLoading" :disabled="formLoading" round type="info" v-else>提交申请</van-button>
</div>
</van-form>
</div>
@@ -296,7 +297,8 @@ layout("/layouts/platform_h5.html"){
taskId: GetQueryString("taskId"),
formData: {},
chooseType: {},
formLoading: false,
userSearchSequence: 0,
userOptions: [],
typeOptions: [],
@@ -307,20 +309,64 @@ layout("/layouts/platform_h5.html"){
searchKeyword: '',
showTimePicker: false,
timePickerValue: new Date(),
showChildPicker: false,
showFamilyPicker: false,
}
},
methods: {
async userRemoteMethod(event, type) {
if (event) {
this.userOptions = await this.selectQueryUser(event)
type === 'help' ? this.helpUserSelectShow = true : this.payUserSelectShow = true
computed: {
// 详情和类型列表任意顺序返回都重新匹配;未匹配时保证附件区域可安全读取属性。
chooseType() {
return this.typeOptions.find(o => o.id === this.formData.type) || {}
}
},
async selectQueryUser(keyword) {
const res = await this.$axios.post("/platform/condolence/apply/listUser", { keyword: keyword })
return res.data
methods: {
// 打开人员选择时清除上次搜索,并使之前尚未返回的请求失效。
openUserSelect(type) {
this.resetUserSearch()
this.$set(this, type === 'help' ? 'helpUserSelectShow' : 'payUserSelectShow', true)
},
resetUserSearch() {
this.userSearchSequence++
this.searchKeyword = ''
this.userOptions = []
},
// keyword 为姓名或工号,type 为 help/pay;只接收最新请求且对应弹框仍打开的结果。
userRemoteMethod(keyword, type) {
const sequence = ++this.userSearchSequence
this.userOptions = []
if (!keyword || !keyword.trim()) return
return this.selectQueryUser(keyword).then((users) => {
const visible = type === 'help' ? this.helpUserSelectShow : this.payUserSelectShow
if (sequence === this.userSearchSequence && visible) this.userOptions = users
}).catch(() => {
// 查询失败保留空结果,后续输入仍可重新查询。
})
},
// keyword 传姓名或工号;返回 Promise<Array>,数组项包含人员 ID、姓名、工号及单位工会信息。
selectQueryUser(keyword) {
return this.$axios.post("/platform/condolence/apply/listUser", { keyword: keyword })
.then((res) => res && res.code === 0 && Array.isArray(res.data) ? res.data : [])
},
// 选择器使用独立 Date 值,取消操作不会改变表单中的日期字符串。
openTimePicker() {
const date = this.$moment(this.formData.occurTime, 'YYYY-MM-DD', true)
this.timePickerValue = date.isValid() ? date.toDate() : new Date()
this.showTimePicker = true
},
onTimeConfirm(value) {
this.$set(this.formData, 'occurTime', this.$moment(value).format('YYYY-MM-DD'))
this.showTimePicker = false
},
// 自定义插槽没有普通输入值,校验直接读取业务附件数组;失败或上传中的文件不算有效附件。
validateFiles() {
return this.chooseType.isUploadFile !== true || (Array.isArray(this.formData.files)
&& this.formData.files.some(file => file && file.status !== 'fail' && file.status !== 'loading'
&& (file.url || file.downloadPath || file.path)))
},
// 签字组件上传成功后将地址写入表单,空地址不能通过提交校验。
validateSignature() {
return typeof this.formData.signature === 'string' && this.formData.signature.trim().length > 0
},
helpUserChange(user) {
const { id, userName, loginName, unitId, unitName, unionId, unionName } = user
@@ -345,53 +391,78 @@ layout("/layouts/platform_h5.html"){
this.userOptions = []
},
typeChange(id) {
this.chooseType = this.typeOptions.find(o => o.id === id)
if (this.chooseType) {
this.$set(this.formData, "money", this.chooseType.money)
this.$set(this.formData, "way", this.chooseType.way)
// 仅用户主动选择时联动金额和方式,详情回显保留历史申请值。
const type = this.typeOptions.find(o => o.id === id)
if (type) {
this.$set(this.formData, "money", type.money)
this.$set(this.formData, "way", type.way)
}
},
onTypeConfirm(o) {
// 空列表或失效选项不能写入申请,提示用户重新选择。
if (!o || !this.typeOptions.some(type => type.id === o.value)) {
this.$toast('暂无可选慰问类型,请重新加载后选择')
return
}
this.$set(this.formData, "typeName", o.text)
this.$set(this.formData, "type", o.value)
this.typeChange(o.value)
this.showTypePicker = false
},
onSave() {
this.$dialog.confirm({
// 从确认框开始锁定操作,取消或请求结束后统一解除,避免重复保存。
if (this.formLoading) return
this.formLoading = true
return this.$dialog.confirm({
title: "提示",
message: "您确定保存吗?"
}).then(() => {
this.$axios.post("/platform/condolence/apply/save", { data: JSON.stringify(this.formData) }).then(res => {
return this.$axios.post("/platform/condolence/apply/save", { data: JSON.stringify(this.formData) }).then(res => {
if (res.code === 0) {
this.$toast(res.msg)
this.$pjaxReplace("/platform/condolence/mine/h5")
}
})
}).catch((error) => {
if (error !== 'cancel' && error !== 'close') this.$toast('保存失败,请重试')
}).finally(() => {
this.formLoading = false
})
},
async onSubmit() {
this.$refs.formRef.validate().then(() => {
this.$dialog.confirm({
onSubmit() {
if (this.formLoading) return
return this.$refs.formRef.validate().then(() => {
// 公共校验失败会停止 Promise 链,因此校验通过后才加锁,并再次拦截并发点击。
if (this.formLoading) return
this.formLoading = true
return this.$dialog.confirm({
title: "提示",
message: "您确定要提交申请吗?"
}).then(() => {
this.$axios.post("/platform/condolence/apply/submit", { data: JSON.stringify(this.formData) }).then(res => {
return this.$axios.post("/platform/condolence/apply/submit", { data: JSON.stringify(this.formData) }).then(res => {
if (res.code === 0) {
this.$toast(res.msg)
this.$pjaxReplace("/platform/condolence/mine/h5")
}
})
}).catch((error) => {
if (error !== 'cancel' && error !== 'close') this.$toast('提交失败,请重试')
}).finally(() => {
this.formLoading = false
})
})
},
async onFinishTask() {
this.$refs.formRef.validate().then(() => {
this.$dialog.confirm({
onFinishTask() {
if (this.formLoading) return
return this.$refs.formRef.validate().then(() => {
// 重新提交与首次提交共用操作锁,校验未通过时保持按钮可用。
if (this.formLoading) return
this.formLoading = true
return this.$dialog.confirm({
title: "提示",
message: "您确定要提交申请吗?"
}).then(() => {
this.$axios.post("/platform/condolence/apply/submitAgain", {
return this.$axios.post("/platform/condolence/apply/submitAgain", {
data: JSON.stringify(this.formData),
taskId: GetQueryString("taskId")
}).then(res => {
@@ -400,6 +471,10 @@ layout("/layouts/platform_h5.html"){
this.$pjaxReplace("/platform/condolence/mine/h5")
}
})
}).catch((error) => {
if (error !== 'cancel' && error !== 'close') this.$toast('重新提交失败,请重试')
}).finally(() => {
this.formLoading = false
})
})
},
@@ -408,9 +483,6 @@ layout("/layouts/platform_h5.html"){
this.$axios.post("/platform/condolence/mine/info", { id: this.bizId }).then((res) => {
if (res.code === 0) {
this.formData = res.data
this.selectQueryUser(this.formData.helpLoginName, this.helpUserOptions)
this.selectQueryUser(this.formData.payLoginName, this.payUserOptions)
this.chooseType = this.typeOptions.find(o => o.id === this.formData.type)
}
})
} else {
@@ -429,10 +501,9 @@ layout("/layouts/platform_h5.html"){
queryCondolenceType() {
this.$axios.post('/platform/condolence/type/queryCondolenceType')
.then((res) => {
this.typeOptions = JSON.parse(JSON.stringify(res.data))
res.data.forEach((v) => {
this.typeColumns.push({ value: v.id, text: v.name + "(" + v.code + ")" })
})
// Result.code 为 0 时 data 为类型数组;异常响应使用空列表,重复加载不累积选项。
this.typeOptions = res && res.code === 0 && Array.isArray(res.data) ? res.data : []
this.typeColumns = this.typeOptions.map(v => ({ value: v.id, text: v.name + "(" + v.code + ")" }))
})
},
},