工会报销
This commit is contained in:
@@ -42,6 +42,11 @@ public class Sys_dict extends BaseModel implements Serializable {
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String name;
|
||||
|
||||
@Column
|
||||
@Comment("备注")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String remark;
|
||||
|
||||
@Column
|
||||
@Comment("编码")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
|
||||
+240
@@ -0,0 +1,240 @@
|
||||
package com.budwk.app.zhgh.unionReimburse.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckLogin;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
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.page.Pagination;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.flow.constant.FlowConst;
|
||||
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.ProcessSubmitTypeEnum;
|
||||
import com.budwk.app.flow.service.FlowCommonService;
|
||||
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.democratic.suggestionBox.models.SuggestionBox;
|
||||
import com.budwk.app.zhgh.outlay.outlayManage.club.model.OutlayManageClub;
|
||||
import com.budwk.app.zhgh.outlay.outlayManage.school.model.OutlayManageSchool;
|
||||
import com.budwk.app.zhgh.outlay.outlayManage.union.model.OutlayManageUnion;
|
||||
import com.budwk.app.zhgh.staffbenefit.condolence.service.CondolenceTypeService;
|
||||
import com.budwk.app.zhgh.unionReimburse.model.UnionReimburse;
|
||||
import com.budwk.app.zhgh.staffbenefit.condolence.model.CondolenceType;
|
||||
import com.budwk.app.zhgh.unionReimburse.model.UnionReimburse;
|
||||
import com.budwk.app.zhgh.unionReimburse.service.UnionReimburseService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
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.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.Lang;
|
||||
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.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@IocBean
|
||||
@At("/platform/unionReimburse/apply")
|
||||
@Api("工会报销申请")
|
||||
@Ok("json:full")
|
||||
public class UnionReimburseApplyController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private FlowEngine flowEngine;
|
||||
@Inject
|
||||
private UnionReimburseService unionReimburseService;
|
||||
@Inject
|
||||
private FlowCommonService flowCommonService;
|
||||
@Inject
|
||||
private CondolenceTypeService typeService;
|
||||
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/unionReimburse/apply/index.html")
|
||||
@SaCheckLogin
|
||||
public void index() {}
|
||||
|
||||
@At
|
||||
@ApiOperation("保存申请")
|
||||
@SaCheckPermission("unionReimburse.apply")
|
||||
@SLog(type = "unionReimburse", tag = "工会报销-报销申请", msg = "保存报销申请")
|
||||
public Result save(@Param("data") UnionReimburse unionReimburse) {
|
||||
if(StrUtil.isBlank(unionReimburse.getId())) unionReimburse.setCreateTime(DateUtil.now());
|
||||
dao.insertOrUpdate(unionReimburse);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckLogin
|
||||
@ApiOperation("提交申请")
|
||||
public Result submit(@Param("data") UnionReimburse unionReimburse) {
|
||||
if(StrUtil.isBlank(unionReimburse.getId())) unionReimburse.setCreateTime(DateUtil.now());
|
||||
|
||||
dao.insertOrUpdate(unionReimburse);
|
||||
// 开启流程实例
|
||||
Dict args = Dict.create();
|
||||
args.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.APPLY.getCode());
|
||||
args.set(FlowConst.FORM_DATA, unionReimburse);
|
||||
ProcessInstance instance = flowEngine.startProcessInstanceByKey("GHBX", unionReimburse.getId(), SecurityUtil.getUserId(), args);
|
||||
|
||||
// 自动完成第一个申请任务
|
||||
List<ProcessTask> doingTaskList = flowEngine.processTaskService().getDoingTaskList(instance.getId(), null);
|
||||
for (ProcessTask task : doingTaskList) {
|
||||
flowEngine.executeProcessTask(task.getId(), SecurityUtil.getUserId(), args);
|
||||
}
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckLogin
|
||||
@ApiOperation("重新提交申请")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public Result submitAgain(@Param("data") UnionReimburse unionReimburse, @Param("taskId") Long taskId) {
|
||||
if(StrUtil.isBlank(unionReimburse.getId())) unionReimburse.setCreateTime(DateUtil.now());
|
||||
|
||||
dao.insertOrUpdate(unionReimburse);
|
||||
|
||||
Dict dict = Dict.create();
|
||||
dict.set(FlowConst.PROCESS_TASK_ID_KEY, taskId);
|
||||
dict.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.RE_APPLY.getCode());
|
||||
flowCommonService.executeTask(dict);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckLogin
|
||||
@ApiOperation("获取当前登录人的申请信息")
|
||||
public Result info(@Param("id") String id) {
|
||||
UnionReimburse unionReimburse = dao.fetch(UnionReimburse.class, id);
|
||||
CondolenceType type = unionReimburseService.dao().fetch(CondolenceType.class,
|
||||
Cnd.where(CondolenceType::getId, "=", unionReimburse.getCondolenceType()));
|
||||
NutMap nutMap = Lang.obj2nutmap(unionReimburse);
|
||||
// 使用三元运算符处理 null 情况
|
||||
nutMap.put("typeName", type != null ? type.getName() : "");
|
||||
return Result.success(nutMap);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ApiOperation("查询用户")
|
||||
@SaCheckPermission("unionReimburse.apply")
|
||||
@SLog(type = "unionReimburse", tag = "查询用户", msg = "查询用户")
|
||||
public Object listUser(String keyword) {
|
||||
Sql sql = Sqls.create("""
|
||||
select
|
||||
id,
|
||||
username as userName,
|
||||
loginname as loginName,
|
||||
sex,
|
||||
mobile,
|
||||
technicalTitle,
|
||||
IFNULL(unitname, '暂无') as unitName,
|
||||
unitid as unitId,
|
||||
unionid as unionId,
|
||||
unionname as unionName
|
||||
from
|
||||
vw_user
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (StrUtil.isNotBlank(keyword)) {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.or(View_user::getLoginname, "like", "%" + keyword + "%");
|
||||
seg.or(View_user::getUsername, "like", "%" + keyword + "%");
|
||||
cnd.and(seg);
|
||||
}
|
||||
if(!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())) {
|
||||
if(AuthUtil.hasRoleOr(RoleConstant.BRANCH_UNION_ADMIN.name(), RoleConstant.BRANCH_UNION_CHAIRMAN.name())) {
|
||||
cnd.and(View_user::getUnionId, "=", SecurityUtil.getUnionId());
|
||||
} else {
|
||||
cnd.and(View_user::getId, "=", SecurityUtil.getUserId());
|
||||
}
|
||||
|
||||
}
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = unionReimburseService.listPageMap(1, 50, sql);
|
||||
return Result.success(pagination.getList());
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("查询职工慰问类型")
|
||||
@SaCheckLogin
|
||||
public Result queryCondolenceType() {
|
||||
List<CondolenceType> list = typeService.query(Cnd.NEW().desc(CondolenceType::getCode));
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("查询校工会经费余额")
|
||||
@SaCheckPermission("unionReimburse.apply")
|
||||
public Result getSchoolBudget() {
|
||||
OutlayManageSchool outlayManageSchool = dao.fetch(OutlayManageSchool.class,
|
||||
Cnd.where("year", "=", DateUtil.year(new Date())));
|
||||
if (outlayManageSchool != null) {
|
||||
BigDecimal balance = outlayManageSchool.getTotalQuota().subtract(outlayManageSchool.getUsedQuota());
|
||||
double value = balance.setScale(2, RoundingMode.HALF_UP).doubleValue();
|
||||
return Result.success(value);
|
||||
}
|
||||
return Result.success(0.0);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ApiOperation("查询分工会经费余额")
|
||||
@SaCheckPermission("unionReimburse.apply")
|
||||
public Result getUnionBalance() {
|
||||
OutlayManageUnion outlayManageUnion = dao.fetch(OutlayManageUnion.class,
|
||||
Cnd.where("unionId", "=", SecurityUtil.getUnionId()).and("year", "=", DateUtil.year(new Date())));
|
||||
if (outlayManageUnion != null) {
|
||||
BigDecimal balance = outlayManageUnion.getTotalQuota().subtract(outlayManageUnion.getUsedQuota());
|
||||
double value = balance.setScale(2, RoundingMode.HALF_UP).doubleValue();
|
||||
return Result.success(value);
|
||||
}
|
||||
return Result.success(0.0);
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("查询社团经费余额")
|
||||
@SaCheckPermission("unionReimburse.apply")
|
||||
public Result getClubBudget(@Param("clubId") String clubId) {
|
||||
// 检查clubId参数是否为空
|
||||
if (StrUtil.isBlank(clubId)) {
|
||||
return Result.error("社团ID不能为空");
|
||||
}
|
||||
// 根据社团ID和年份查询特定社团的经费信息
|
||||
OutlayManageClub outlayManageClub = dao.fetch(OutlayManageClub.class,
|
||||
Cnd.where("clubId", "=", clubId)
|
||||
.and("year", "=", DateUtil.year(new Date())));
|
||||
|
||||
if (outlayManageClub != null) {
|
||||
BigDecimal balance = outlayManageClub.getTotalQuota().subtract(outlayManageClub.getUsedQuota());
|
||||
double value = balance.setScale(2, RoundingMode.HALF_UP).doubleValue();
|
||||
return Result.success(value);
|
||||
}
|
||||
|
||||
// 如果没有找到该社团的经费记录,返回0
|
||||
return Result.success(0.0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
+217
@@ -0,0 +1,217 @@
|
||||
package com.budwk.app.zhgh.unionReimburse.controller;
|
||||
|
||||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||
import cn.dev33.satoken.annotation.SaCheckLogin;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
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.CommonDownloadUtil;
|
||||
import com.budwk.app.flow.engine.FlowEngine;
|
||||
import com.budwk.app.sys.models.Sys_dict;
|
||||
import com.budwk.app.sys.services.SysDictService;
|
||||
import com.budwk.app.zhgh.unionReimburse.service.UnionReimburseService;
|
||||
import com.budwk.app.zhgh.unionReimburse.vo.UnionReimburseCollectExcelVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
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 javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
@IocBean
|
||||
@At("/platform/unionReimburse/collect")
|
||||
@Ok("json:full")
|
||||
@Api("查询统计")
|
||||
public class UnionReimburseCollectController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private FlowEngine flowEngine;
|
||||
|
||||
@Inject
|
||||
private SysDictService sysDictService;
|
||||
|
||||
@Inject
|
||||
private UnionReimburseService unionReimburseService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/unionReimburse/collect/index.html")
|
||||
@SaCheckLogin
|
||||
public void index() {}
|
||||
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission("unionReimburse.collect")
|
||||
public Result pageData(PageForm pageForm,
|
||||
@Param(value = "year") Integer year,
|
||||
@Param(value = "unionId") String unionId,
|
||||
@Param(value = "unitId") String unitId,
|
||||
@Param(value = "reimburseProject") String reimburseProject,
|
||||
@Param(value = "userName") String userName) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
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,
|
||||
IF((SELECT taskName FROM wf_process_task tt WHERE tt.id = t.taskParentId) = 'startTask', 1, 0) canRevoke,
|
||||
(select MAX(id) from wf_process_task where processInstanceId = ins.id and taskName = 'startTask' AND taskState in (10,20)) AS startTaskId
|
||||
FROM
|
||||
union_reimburse info
|
||||
LEFT JOIN `wf_process_instance` ins ON ins.businessNo = info.id
|
||||
LEFT JOIN wf_process_task t ON t.processInstanceId = ins.id AND t.taskState = 10
|
||||
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
// 年度查询条件
|
||||
cnd.andEX("year(info.createTime)", "=", year);
|
||||
|
||||
// 工会、单位名称查询条件
|
||||
cnd.andEX("info.unionId", "=", unionId);
|
||||
cnd.andEX("info.unitId", "=", unitId);
|
||||
|
||||
// 报销项目查询条件
|
||||
cnd.andEX("info.reimburseProject", "=", reimburseProject);
|
||||
// 经办人姓名查询条件
|
||||
if (StrUtil.isNotBlank(userName)) {
|
||||
cnd.and("info.userName", "like", "%" + userName + "%");
|
||||
}
|
||||
|
||||
// 只查询流程实例状态为20的数据(已完成状态)
|
||||
cnd.and("ins.state", "=", 20);
|
||||
|
||||
cnd.desc("info.createTime");
|
||||
sql.setCondition(cnd);
|
||||
Pagination<NutMap> pagination = unionReimburseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
@SaCheckPermission("unionReimburse.collect")
|
||||
@ApiOperation("导出报销汇总表")
|
||||
public void onExport(@Param(value = "year") Integer year,
|
||||
@Param(value = "unionId") String unionId,
|
||||
@Param(value = "unitId") String unitId,
|
||||
@Param(value = "reimburseProject") String reimburseProject,
|
||||
@Param(value = "userName") String userName,
|
||||
HttpServletResponse response) {
|
||||
//查询审核通过的数据
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
t1.*,
|
||||
ins.state instanceState
|
||||
FROM
|
||||
union_reimburse t1
|
||||
LEFT JOIN `wf_process_instance` ins ON ins.businessNo = t1.id
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = buildCondition(year, unionId, unitId, reimburseProject, userName, "t1.");
|
||||
// 只查询流程实例状态为20的数据(已完成状态)
|
||||
cnd.and("ins.state", "=", 20);
|
||||
cnd.desc("t1.createTime");
|
||||
|
||||
sql.setCondition(cnd);
|
||||
List<UnionReimburseCollectExcelVO> list = unionReimburseService.listVO(sql,UnionReimburseCollectExcelVO.class);
|
||||
|
||||
// 获取字典列表
|
||||
List<Sys_dict> reimburseProjectDictList = sysDictService.getSubListByCode("UNION_REIMBURSE_PROJECT");
|
||||
List<Sys_dict> reimburseFundSourceDictList = sysDictService.getSubListByCode("UNION_REIMBURSE_FUND_SOURCE");
|
||||
|
||||
// 转换字典编码为文字并处理备注字段
|
||||
list.forEach(item -> {
|
||||
// 转换报销项目
|
||||
if (item.getReimburseProject() != null) {
|
||||
Sys_dict projectDict = reimburseProjectDictList.stream()
|
||||
.filter(d -> d.getCode().equals(item.getReimburseProject()))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
if (projectDict != null) {
|
||||
item.setReimburseProject(projectDict.getName());
|
||||
}
|
||||
}
|
||||
// 转换报销经费来源
|
||||
if (item.getReimburseFundSource() != null) {
|
||||
Sys_dict typeDict = reimburseFundSourceDictList.stream()
|
||||
.filter(d -> d.getCode().equals(item.getReimburseFundSource()))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
if (typeDict != null) {
|
||||
item.setReimburseFundSource(typeDict.getName());
|
||||
}
|
||||
}
|
||||
|
||||
// 拼接备注字段(仿照系统代码逻辑,使用activityName和condolenceName字段)
|
||||
if (cn.hutool.core.util.StrUtil.isNotBlank(item.getActivityName())) {
|
||||
item.setRemark("活动名称:" + item.getActivityName());
|
||||
} else if (cn.hutool.core.util.StrUtil.isNotBlank(item.getCondolenceName())) {
|
||||
item.setRemark("慰问对象:" + item.getCondolenceName());
|
||||
}
|
||||
});
|
||||
|
||||
ExportParams exportParams = new ExportParams();
|
||||
exportParams.setType(ExcelType.XSSF);
|
||||
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, UnionReimburseCollectExcelVO.class, list);
|
||||
CommonDownloadUtil.download("工会报销汇总表.xlsx", workbook, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建查询条件
|
||||
* @param year 年度
|
||||
* @param unionId 工会ID
|
||||
* @param unitId 单位ID
|
||||
* @param reimburseProject 报销项目
|
||||
* @param userName 经办人姓名
|
||||
* @param prefix 表前缀
|
||||
* @return 查询条件
|
||||
*/
|
||||
private Cnd buildCondition(Integer year, String unionId, String unitId,
|
||||
String reimburseProject, String userName, String prefix) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
|
||||
// 年度查询条件
|
||||
cnd.andEX("year(" + prefix + "createTime)", "=", year);
|
||||
|
||||
// 工会、单位名称查询条件
|
||||
cnd.andEX(prefix + "unionId", "=", unionId);
|
||||
cnd.andEX(prefix + "unitId", "=", unitId);
|
||||
|
||||
// 报销项目查询条件
|
||||
cnd.andEX(prefix + "reimburseProject", "=", reimburseProject);
|
||||
|
||||
// 经办人姓名查询条件
|
||||
if (StrUtil.isNotBlank(userName)) {
|
||||
cnd.and(prefix + "userName", "like", "%" + userName + "%");
|
||||
}
|
||||
|
||||
return cnd;
|
||||
}
|
||||
}
|
||||
+117
@@ -0,0 +1,117 @@
|
||||
package com.budwk.app.zhgh.unionReimburse.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckLogin;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
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.flow.engine.FlowEngine;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.staffbenefit.condolence.model.Condolence;
|
||||
import com.budwk.app.zhgh.unionReimburse.service.UnionReimburseService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
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.ioc.aop.Aop;
|
||||
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;
|
||||
|
||||
/**
|
||||
* @ClassName UnionReimburseMineController
|
||||
* @Author hongqiwei
|
||||
* @Date 2025/8/27 14:00
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@IocBean
|
||||
@At("/platform/unionReimburse/mine")
|
||||
@Api("工会报销我的")
|
||||
@Ok("json:full")
|
||||
public class UnionReimburseMineController {
|
||||
|
||||
@Inject
|
||||
private UnionReimburseService unionReimburseService;
|
||||
@Inject
|
||||
private FlowEngine flowEngine;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/unionReimburse/mine/index.html")
|
||||
@SaCheckLogin
|
||||
public void index() {}
|
||||
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission("unionReimburse.mine")
|
||||
public Result pageData(PageForm pageForm,
|
||||
@Param(value = "year") Integer year,
|
||||
@Param(value = "unionId") String unionId,
|
||||
@Param(value = "unitId") String unitId,
|
||||
@Param(value = "reimburseProject") String reimburseProject,
|
||||
@Param(value = "userName") String userName) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
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,
|
||||
IF((SELECT taskName FROM wf_process_task tt WHERE tt.id = t.taskParentId) = 'startTask', 1, 0) canRevoke,
|
||||
(select MAX(id) from wf_process_task where processInstanceId = ins.id and taskName = 'startTask') AS startTaskId
|
||||
FROM
|
||||
union_reimburse info
|
||||
LEFT JOIN `wf_process_instance` ins ON ins.businessNo = info.id
|
||||
LEFT JOIN wf_process_task t ON t.processInstanceId = ins.id AND t.taskState = 10
|
||||
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
// 年度查询条件
|
||||
cnd.andEX("year(info.createTime)", "=", year);
|
||||
|
||||
// 工会、单位名称查询条件
|
||||
cnd.andEX("info.unionId", "=", unionId);
|
||||
cnd.andEX("info.unitId", "=", unitId);
|
||||
|
||||
// 报销项目查询条件
|
||||
cnd.andEX("info.reimburseProject", "=", reimburseProject);
|
||||
// 经办人姓名查询条件
|
||||
if (StrUtil.isNotBlank(userName)) {
|
||||
cnd.and("info.userName", "like", "%" + userName + "%");
|
||||
}
|
||||
cnd.desc("info.createTime");
|
||||
sql.setCondition(cnd);
|
||||
Pagination<NutMap> pagination = unionReimburseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("删除")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("unionReimburse.mine")
|
||||
@SLog(type = "unionReimburse", tag = "删除工会报销", msg = "删除工会报销")
|
||||
public Result delete(@Param("id") String id) {
|
||||
unionReimburseService.delete(id);
|
||||
flowEngine.processInstanceService().deleteProcessInstanceByBusinessKey(id);
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
+115
@@ -0,0 +1,115 @@
|
||||
package com.budwk.app.zhgh.unionReimburse.controller;
|
||||
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckLogin;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
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.SecurityUtil;
|
||||
import com.budwk.app.zhgh.unionReimburse.service.UnionReimburseService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
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;
|
||||
|
||||
@IocBean
|
||||
@At("/platform/unionReimburse/review")
|
||||
@Ok("json:full")
|
||||
@Api("审核报销")
|
||||
public class UnionReimburseReviewController {
|
||||
|
||||
@Inject
|
||||
private UnionReimburseService unionReimburseService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/unionReimburse/review/index.html")
|
||||
@SaCheckLogin
|
||||
public void index() {}
|
||||
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission("unionReimburse.review")
|
||||
public Result pageData(PageForm pageForm,
|
||||
boolean approval,
|
||||
Integer year,
|
||||
String unionId,
|
||||
String unitId,
|
||||
String reimburseProject,
|
||||
String userName) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
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 union_reimburse info ON info.id = ins.businessNo
|
||||
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.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("t.taskName", "=", "019925d2-6f33-449a-9fb0-34c470222e99");
|
||||
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
|
||||
|
||||
if (approval) {
|
||||
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.WITHDRAW.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
|
||||
} else {
|
||||
cnd.and("t.taskState", "=", ProcessTaskStateEnum.DOING.getCode());
|
||||
}
|
||||
// 年度查询条件
|
||||
cnd.andEX("year(info.createTime)", "=", year);
|
||||
|
||||
// 工会、单位名称查询条件
|
||||
cnd.andEX("info.unionId", "=", unionId);
|
||||
cnd.andEX("info.unitId", "=", unitId);
|
||||
|
||||
// 报销项目查询条件
|
||||
cnd.andEX("info.reimburseProject", "=", reimburseProject);
|
||||
|
||||
|
||||
// 经办人姓名查询条件
|
||||
if (StrUtil.isNotBlank(userName)) {
|
||||
cnd.and("info.userName", "like", "%" + userName + "%");
|
||||
}
|
||||
if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
|
||||
cnd.desc("info.createTime");
|
||||
} else {
|
||||
cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
|
||||
}
|
||||
cnd.groupBy("t.id");
|
||||
cnd.desc("t.createdAt");
|
||||
sql.setCondition(cnd);
|
||||
Pagination<NutMap> pagination = unionReimburseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
}
|
||||
+117
@@ -0,0 +1,117 @@
|
||||
package com.budwk.app.zhgh.unionReimburse.interceptor;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.budwk.app.base.exception.BaseException;
|
||||
import com.budwk.app.flow.constant.FlowConst;
|
||||
import com.budwk.app.flow.engine.FlowInterceptor;
|
||||
import com.budwk.app.flow.engine.core.Execution;
|
||||
import com.budwk.app.flow.engine.core.ServiceContext;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.outlay.outlayManage.club.model.OutlayManageClub;
|
||||
import com.budwk.app.zhgh.outlay.outlayManage.model.OutlayUseDetail;
|
||||
import com.budwk.app.zhgh.outlay.outlayManage.school.model.OutlayManageSchool;
|
||||
import com.budwk.app.zhgh.outlay.outlayManage.union.model.OutlayManageUnion;
|
||||
import com.budwk.app.zhgh.outlay.outlayReimburse.model.OutlayReimburse;
|
||||
import com.budwk.app.zhgh.unionReimburse.model.UnionReimburse;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.json.Json;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.Date;
|
||||
|
||||
//审核同意后扣除校工会、分工会、社团的经费
|
||||
public class UnionReimburseFundSourceInterceptor implements FlowInterceptor {
|
||||
|
||||
|
||||
@Override
|
||||
public void intercept(Execution execution) {
|
||||
String formDataStr = execution.getArgs().getStr(FlowConst.FORM_DATA);
|
||||
UnionReimburse unionReimburse = Json.fromJson(UnionReimburse.class, formDataStr);
|
||||
// 从ServiceContext获取Dao实例
|
||||
Dao dao = ServiceContext.find(Dao.class);
|
||||
String reimburseFundSource = unionReimburse.getReimburseFundSource();
|
||||
//经费使用记录表
|
||||
OutlayUseDetail detail = new OutlayUseDetail();
|
||||
//校工会
|
||||
if ("UNION_REIMBURSE_FUND_SOURCE_1".equals(reimburseFundSource)) {
|
||||
OutlayManageSchool outlayManageSchool = dao.fetch(OutlayManageSchool.class,
|
||||
Cnd.where("year", "=", DateUtil.year(new Date())));
|
||||
if (outlayManageSchool != null) {
|
||||
//balance已使用额度
|
||||
BigDecimal balance = outlayManageSchool.getUsedQuota().add(BigDecimal.valueOf(unionReimburse.getMoney()));
|
||||
outlayManageSchool.setUsedQuota(balance);
|
||||
dao.updateIgnoreNull(outlayManageSchool);
|
||||
|
||||
detail.setAdjustUserId(SecurityUtil.getUserId());
|
||||
detail.setAdjustUserName(SecurityUtil.getUserUsername());
|
||||
detail.setAdjustLoginName(SecurityUtil.getUserLoginname());
|
||||
detail.setOutlayReimburseId(unionReimburse.getId());
|
||||
detail.setAdjustMoney(BigDecimal.valueOf(unionReimburse.getMoney()));
|
||||
detail.setAdjustReason(unionReimburse.getReimburseProject());
|
||||
detail.setProjectName(unionReimburse.getActivityName());
|
||||
detail.setActivityNumber(unionReimburse.getActivityNumber());
|
||||
detail.setActivityTime(unionReimburse.getCreateTime());
|
||||
detail.setOutlayManageId(outlayManageSchool.getId());
|
||||
|
||||
dao.insert(detail);
|
||||
}
|
||||
}
|
||||
//分工会
|
||||
else if ("UNION_REIMBURSE_FUND_SOURCE_2".equals(reimburseFundSource)) {
|
||||
OutlayManageUnion outlayManageUnion = dao.fetch(OutlayManageUnion.class,
|
||||
Cnd.where("unionId", "=", SecurityUtil.getUnionId()).and("year", "=", DateUtil.year(new Date())));
|
||||
if (outlayManageUnion != null) {
|
||||
//balance已使用额度
|
||||
BigDecimal balance = outlayManageUnion.getUsedQuota().add(BigDecimal.valueOf(unionReimburse.getMoney()));
|
||||
outlayManageUnion.setUsedQuota(balance);
|
||||
dao.updateIgnoreNull(outlayManageUnion);
|
||||
|
||||
detail.setAdjustUserId(SecurityUtil.getUserId());
|
||||
detail.setAdjustUserName(SecurityUtil.getUserUsername());
|
||||
detail.setAdjustLoginName(SecurityUtil.getUserLoginname());
|
||||
detail.setOutlayReimburseId(unionReimburse.getId());
|
||||
detail.setAdjustMoney(BigDecimal.valueOf(unionReimburse.getMoney()));
|
||||
detail.setAdjustReason(unionReimburse.getReimburseProject());
|
||||
detail.setProjectName(unionReimburse.getActivityName());
|
||||
detail.setActivityNumber(unionReimburse.getActivityNumber());
|
||||
detail.setActivityTime(unionReimburse.getCreateTime());
|
||||
detail.setOutlayManageId(outlayManageUnion.getId());
|
||||
|
||||
dao.insert(detail);
|
||||
}
|
||||
}
|
||||
//社团
|
||||
else if ("UNION_REIMBURSE_FUND_SOURCE_3".equals(reimburseFundSource)){
|
||||
OutlayManageClub outlayManageClub = dao.fetch(OutlayManageClub.class,
|
||||
Cnd.where("year", "=", DateUtil.year(new Date())));
|
||||
if (outlayManageClub != null) {
|
||||
//balance已使用额度
|
||||
BigDecimal balance = outlayManageClub.getUsedQuota().add(BigDecimal.valueOf(unionReimburse.getMoney()));
|
||||
outlayManageClub.setUsedQuota(balance);
|
||||
dao.updateIgnoreNull(outlayManageClub);
|
||||
|
||||
detail.setAdjustUserId(SecurityUtil.getUserId());
|
||||
detail.setAdjustUserName(SecurityUtil.getUserUsername());
|
||||
detail.setAdjustLoginName(SecurityUtil.getUserLoginname());
|
||||
detail.setOutlayReimburseId(unionReimburse.getId());
|
||||
detail.setAdjustMoney(BigDecimal.valueOf(unionReimburse.getMoney()));
|
||||
detail.setAdjustReason(unionReimburse.getReimburseProject());
|
||||
detail.setProjectName(unionReimburse.getActivityName());
|
||||
detail.setActivityNumber(unionReimburse.getActivityNumber());
|
||||
detail.setActivityTime(unionReimburse.getCreateTime());
|
||||
detail.setOutlayManageId(outlayManageClub.getId());
|
||||
|
||||
dao.insert(detail);
|
||||
}
|
||||
}
|
||||
else {
|
||||
// 处理未知的经费来源类型
|
||||
throw new BaseException("不支持的经费来源类型: " + reimburseFundSource);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,228 @@
|
||||
package com.budwk.app.zhgh.unionReimburse.model;
|
||||
|
||||
import cn.hutool.db.DaoTemplate;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.budwk.app.base.model.BaseModel;
|
||||
import com.budwk.app.sys.models.Sys_file;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName UnionReimburse
|
||||
* @Author hongqiwei
|
||||
* @Date 2025/8/28 14:43
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Table("union_reimburse")
|
||||
@TableMeta("{'mysql-charset':'utf8mb4'}")
|
||||
@Comment("工会报销系统")
|
||||
public class UnionReimburse extends BaseModel {
|
||||
|
||||
|
||||
@Name
|
||||
@Comment("ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@Comment("经办人id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String userId;
|
||||
|
||||
|
||||
@Column
|
||||
@Comment("经办人姓名")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String userName;
|
||||
|
||||
@Column
|
||||
@Comment("工号")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String loginName;
|
||||
|
||||
@Column
|
||||
@Comment("经办人单位ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String unitId;
|
||||
|
||||
@Column
|
||||
@Comment("经办人单位名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String unitName;
|
||||
|
||||
@Column
|
||||
@Comment("经办人分工会ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String unionId;
|
||||
|
||||
@Column
|
||||
@Comment("经办人分工会名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String unionName;
|
||||
|
||||
|
||||
@Column
|
||||
@Comment("报销类别")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 500)
|
||||
private String reimburseType;
|
||||
|
||||
|
||||
@Column
|
||||
@Comment("报销项目")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
private String reimburseProject;
|
||||
|
||||
|
||||
@Column
|
||||
@Comment("支付方式")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
private String paymentWay;
|
||||
|
||||
@Column
|
||||
@Comment("报销经费来源")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String reimburseFundSource;
|
||||
|
||||
|
||||
@Column
|
||||
@Comment("联系方式(经办人电话)")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String mobile;
|
||||
|
||||
@Column
|
||||
@Comment("经费余额")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private Double fundBalance;
|
||||
|
||||
@Column
|
||||
@Comment("户名")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String bankUserName;
|
||||
|
||||
@Column
|
||||
@Comment("银行账号")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String bankCardNumber;
|
||||
|
||||
@Column
|
||||
@Comment("开户行")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String bankOfDeposit;
|
||||
|
||||
@Column
|
||||
@Comment("发票张数")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
private String invoiceNumber;
|
||||
|
||||
@Column
|
||||
@Comment("发票号码")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
private String invoice;
|
||||
|
||||
@Column
|
||||
@Comment("支付内容")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||
private String paymentNotes;
|
||||
|
||||
@Column
|
||||
@Comment("附件")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<JSONObject> files;
|
||||
|
||||
|
||||
/**
|
||||
* 慰问
|
||||
*/
|
||||
|
||||
@Column
|
||||
@Comment("慰问对象id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String condolenceId;
|
||||
|
||||
@Column
|
||||
@Comment("慰问对象名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String condolenceName;
|
||||
|
||||
@Column
|
||||
@Comment("联系方式(慰问对象电话)")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String condolenceMobile;
|
||||
|
||||
@Column
|
||||
@Comment("慰问类型")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String condolenceType;
|
||||
|
||||
@Column
|
||||
@Comment("慰问金额/报销金额")
|
||||
@ColDefine(type = ColType.FLOAT, width = 10, precision = 2)
|
||||
private Double money;
|
||||
|
||||
|
||||
@Column
|
||||
@Comment("慰问时间")
|
||||
@ColDefine(type = ColType.DATETIME, width = 30)
|
||||
private Date condolenceTime;
|
||||
|
||||
|
||||
/**
|
||||
* 活动/建家/日常
|
||||
*/
|
||||
|
||||
@Column
|
||||
@Comment("活动名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 60)
|
||||
private String activityName;
|
||||
|
||||
@Column
|
||||
@Comment("活动类型(1.分工会,2.校工会,3.社团)")
|
||||
@ColDefine(type = ColType.INT, width = 2)
|
||||
private Integer activityType;
|
||||
|
||||
@Column
|
||||
@Comment("活动人数")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String activityNumber;
|
||||
|
||||
|
||||
@Column
|
||||
@Comment("活动时间")
|
||||
@ColDefine(type = ColType.DATETIME, width = 30)
|
||||
private Date activityTime;
|
||||
|
||||
@Column
|
||||
@Comment("活动地点")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String activityPlace;
|
||||
|
||||
/*
|
||||
* 所属社团
|
||||
*/
|
||||
|
||||
@Column
|
||||
@Comment("社团id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String clubId;
|
||||
|
||||
@Column
|
||||
@Comment("所属社团")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String clubName;
|
||||
|
||||
@Column
|
||||
@Comment("申请时间")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
private String createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.budwk.app.zhgh.unionReimburse.service;
|
||||
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.zhgh.unionReimburse.model.UnionReimburse;
|
||||
|
||||
public interface UnionReimburseService extends BaseService<UnionReimburse> {
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package com.budwk.app.zhgh.unionReimburse.service.impl;
|
||||
|
||||
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.base.service.impl.BaseServiceImpl;
|
||||
import com.budwk.app.zhgh.unionReimburse.model.UnionReimburse;
|
||||
import com.budwk.app.zhgh.unionReimburse.service.UnionReimburseService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
|
||||
@Slf4j
|
||||
@IocBean(args = {"refer:dao"})
|
||||
public class UnionReimburseServiceImpl extends BaseServiceImpl<UnionReimburse> implements UnionReimburseService {
|
||||
public UnionReimburseServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.budwk.app.zhgh.unionReimburse.vo;
|
||||
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
//工会报销导出
|
||||
@Data
|
||||
public class UnionReimburseCollectExcelVO implements Serializable {
|
||||
|
||||
@Excel(name = "经办人工号", width = 20)
|
||||
private String loginName;
|
||||
|
||||
@Excel(name = "姓名", width = 20)
|
||||
private String userName;
|
||||
|
||||
@Excel(name = "所属工会", width = 20)
|
||||
private String unionName;
|
||||
|
||||
@Excel(name = "所属单位", width = 20)
|
||||
private String unitName;
|
||||
|
||||
@Excel(name = "报销项目", width = 20)
|
||||
private String reimburseProject;
|
||||
|
||||
@Excel(name = "备注", width = 20)
|
||||
private String remark;
|
||||
|
||||
@Excel(name = "金额", width = 20)
|
||||
private Double money;
|
||||
|
||||
@Excel(name = "申请时间", width = 30)
|
||||
private String createTime;
|
||||
|
||||
@Excel(name = "经费来源", width = 30)
|
||||
private String reimburseFundSource;
|
||||
|
||||
//活动名称
|
||||
private String activityName;
|
||||
|
||||
//被慰问人
|
||||
private String condolenceName;
|
||||
|
||||
}
|
||||
@@ -83,6 +83,9 @@ layout("/layouts/platform.html"){
|
||||
<el-form-item prop="code" label="字典代码">
|
||||
<el-input maxlength="100" placeholder="字典代码" v-model="formData.code" auto-complete="off" tabindex="5" type="text"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="remark" label="字典备注">
|
||||
<el-input maxlength="100" placeholder="字典备注" v-model="formData.remark" auto-complete="off" tabindex="2" type="text"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="disabled" label="启用状态">
|
||||
<el-switch v-model="formData.disabled" active-color="#ff4949" inactive-color="#13ce66"></el-switch>
|
||||
</el-form-item>
|
||||
@@ -100,6 +103,9 @@ layout("/layouts/platform.html"){
|
||||
<el-form-item prop="code" label="字典代码">
|
||||
<el-input maxlength="100" placeholder="字典代码" v-model="formData.code" auto-complete="off" tabindex="2" type="text"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="remark" label="字典备注">
|
||||
<el-input maxlength="100" placeholder="字典备注" v-model="formData.remark" auto-complete="off" tabindex="2" type="text"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="disabled" label="启用状态">
|
||||
<el-switch v-model="formData.disabled" active-color="#ff4949" inactive-color="#13ce66"></el-switch>
|
||||
</el-form-item>
|
||||
|
||||
@@ -0,0 +1,517 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<el-card shadow="never">
|
||||
<snaker-start slot="header" label="工会报销" define_key="GHBX"></snaker-start>
|
||||
<el-form :model="formData" ref="formRef" :rules="formRules" label-width="0" label-suffix=":"
|
||||
class="flow-task-form">
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="经办人">{{formData.userName}}</el-descriptions-item>
|
||||
<el-descriptions-item label="工号">{{formData.loginName}}</el-descriptions-item>
|
||||
<el-descriptions-item label="报销类别">
|
||||
<el-form-item label="报销类别" prop="reimburseType">
|
||||
<el-radio-group v-model="formData.reimburseType" size="medium">
|
||||
<el-radio :label="item.code" border v-for="item in dict.type.UNION_REIMBURSE_TYPE">
|
||||
{{item.name}}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="支付方式">
|
||||
<el-form-item label="支付方式" prop="paymentWay">
|
||||
<el-radio-group v-model="formData.paymentWay" size="medium">
|
||||
<el-radio :label="item.code" border v-for="item in dict.type.UNION_REIMBURSE_PAYMENT_WAY">
|
||||
{{item.name}}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
|
||||
|
||||
<el-descriptions-item label="报销项目" span="2">
|
||||
<el-form-item label="报销项目" prop="reimburseProject">
|
||||
<el-radio-group v-model="formData.reimburseProject" size="medium">
|
||||
<el-radio :label="item.code" border v-for="item in reimburseProjects">
|
||||
{{item.name}}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="报销经费来源" span="2">
|
||||
<el-form-item label="报销经费来源" prop="reimburseFundSource">
|
||||
<el-radio-group v-model="formData.reimburseFundSource" size="medium" @change="reimburseFundSourceChange">
|
||||
<el-radio :label="item.code" border v-for="item in dict.type.UNION_REIMBURSE_FUND_SOURCE">
|
||||
{{item.name}}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="联系方式">
|
||||
<el-form-item prop="mobile" label="联系方式">
|
||||
<el-input v-model="formData.mobile" show-word-limit
|
||||
placeholder="请输入联系方式"></el-input>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="所属社团" v-if="formData.reimburseFundSource === 'UNION_REIMBURSE_FUND_SOURCE_3'">
|
||||
<el-form-item label="所属社团" prop="clubId">
|
||||
<el-select v-model="formData.clubId" style="width: 100%"
|
||||
placeholder="请选择所属社团" filterable clearable>
|
||||
<el-option v-for="item in clubOptions" :key="item.id" :label="item.clubName" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="经费余额">{{formData.fundBalance}}</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="户名">
|
||||
<el-form-item prop="bankUserName" label="户名">
|
||||
<el-input v-model="formData.bankUserName" show-word-limit
|
||||
placeholder="请输入户名"></el-input>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="银行账号">
|
||||
<el-form-item prop="bankCardNumber" label="银行账号">
|
||||
<el-input v-model="formData.bankCardNumber" show-word-limit
|
||||
placeholder="请输入银行账号"></el-input>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="开户行">
|
||||
<el-form-item prop="bankOfDeposit" label="开户行">
|
||||
<el-input v-model="formData.bankOfDeposit" show-word-limit
|
||||
placeholder="请输入开户行"></el-input>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="慰问对象" v-if="formData.reimburseProject === 'UNION_REIMBURSE_PROJECT_1'">
|
||||
<el-form-item label="慰问对象" prop="condolenceId">
|
||||
<el-select
|
||||
style="width: 100%"
|
||||
v-model="formData.condolenceId"
|
||||
filterable
|
||||
clearable
|
||||
remote
|
||||
reserve-keyword
|
||||
placeholder="请输入姓名或工号查询"
|
||||
:remote-method="createRemoteMethod(userOptions)"
|
||||
@change="userChange">
|
||||
<el-option
|
||||
v-for="item in userOptions"
|
||||
:key="item.id"
|
||||
:label="item.userName+'('+item.loginName+')'+'('+item.unitName+')'+'('+item.sex+')'"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="联系方式" v-if="formData.reimburseProject === 'UNION_REIMBURSE_PROJECT_1'">
|
||||
<el-form-item prop="condolenceMobile" label="联系方式">
|
||||
<el-input v-model="formData.condolenceMobile" show-word-limit
|
||||
placeholder="请输入联系方式"></el-input>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="慰问类型" v-if="formData.reimburseProject === 'UNION_REIMBURSE_PROJECT_1'">
|
||||
<el-form-item label="慰问类型" prop="type">
|
||||
<el-select v-model="formData.condolenceType" @change="typeChange" style="width: 100%"
|
||||
placeholder="请选择慰问类型">
|
||||
<el-option v-for="item in typeOptions"
|
||||
:value="item.id"
|
||||
:key="item.id"
|
||||
:disabled="item.isDisabled"
|
||||
:label="item.name"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="慰问金额" v-if="formData.reimburseProject === 'UNION_REIMBURSE_PROJECT_1'">
|
||||
{{formData.money}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="慰问时间" v-if="formData.reimburseProject === 'UNION_REIMBURSE_PROJECT_1'">
|
||||
<el-form-item label="慰问时间" prop="condolenceTime">
|
||||
<el-date-picker
|
||||
clearable
|
||||
style="width: 100%"
|
||||
v-model="formData.condolenceTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择慰问时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="活动名称" v-if="formData.reimburseProject !== 'UNION_REIMBURSE_PROJECT_1'">
|
||||
<el-form-item label="活动名称" prop="activityName">
|
||||
<el-input type="text" v-model="formData.activityName" placeholder="请输入活动名称"
|
||||
maxlength="60"></el-input>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="活动类型" v-if="formData.reimburseProject === 'UNION_REIMBURSE_PROJECT_2'">
|
||||
<el-form-item label="活动类型" prop="activityType">
|
||||
<el-select v-model="formData.activityType" placeholder="请选择活动类型" style="width: 100%">
|
||||
<el-option label="分工会活动" value="1"></el-option>
|
||||
<el-option label="校工会活动" value="2"></el-option>
|
||||
<el-option label="协会(社团)活动" value="3"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="活动人数" v-if="formData.reimburseProject === 'UNION_REIMBURSE_PROJECT_2'">
|
||||
<el-form-item label="活动人数" prop="activityNumber">
|
||||
<el-input v-model="formData.activityNumber" placeholder="请输入活动人数"
|
||||
type="number"></el-input>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="活动地点" v-if="formData.reimburseProject !== 'UNION_REIMBURSE_PROJECT_1'">
|
||||
<el-form-item label="活动地点" prop="activityPlace">
|
||||
<el-input v-model="formData.activityPlace" placeholder="请输入活动地点" type="text"></el-input>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="报销金额" v-if="formData.reimburseProject !== 'UNION_REIMBURSE_PROJECT_1'">
|
||||
<el-form-item label="报销金额" prop="money">
|
||||
<el-input v-model="formData.money" placeholder="输入报销金额"
|
||||
type="number"></el-input>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="活动时间" v-if="formData.reimburseProject !== 'UNION_REIMBURSE_PROJECT_1'">
|
||||
<el-form-item label="活动时间" prop="activityTime">
|
||||
<el-date-picker v-model="formData.activityTime"
|
||||
placeholder="活动时间"
|
||||
style="width: 100%" type="date"
|
||||
value-format="yyyy-MM-dd">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="发票张数" v-if="formData.reimburseType === 'UNION_REIMBURSE_TYPE_1'">
|
||||
<el-form-item label="发票张数" prop="invoiceNumber">
|
||||
<el-input-number v-model="formData.invoiceNumber"
|
||||
:max="1000" :min="0" controls-position="right"
|
||||
placeholder="请填写发票张数"
|
||||
style="width: 100%"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="发票号码" v-if="formData.reimburseType === 'UNION_REIMBURSE_TYPE_1'">
|
||||
<el-form-item id="invoice" label="发票号码" prop="invoice">
|
||||
<el-input v-model="formData.invoice"
|
||||
placeholder="请填写发票号码,如有多个请用逗号分隔"></el-input>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
|
||||
|
||||
<el-descriptions-item label="支付内容" :span="2">
|
||||
<el-form-item prop="remark" label="支付内容">
|
||||
<el-input maxlength="500" v-model="formData.paymentNotes" placeholder="请填写支付内容"
|
||||
type="textarea" :autosize="{ minRows: 4, maxRows: 8}"></el-input>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item :span="2" >
|
||||
<template slot="label">
|
||||
附件
|
||||
</template>
|
||||
<el-form-item prop="files" label="附件">
|
||||
<file-upload
|
||||
:value.sync="formData.files"
|
||||
:upload_number="5"
|
||||
upload_result_category="array"
|
||||
complete_result
|
||||
upload_mode="drag"
|
||||
></file-upload>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-form>
|
||||
<el-row type="flex" justify="end" class="mt20">
|
||||
<el-button type="primary" plain @click="onSave">保存</el-button>
|
||||
<el-button type="primary" @click="onSubmit" v-if="!taskId">提交</el-button>
|
||||
<el-button type="primary" @click="onFinishTask" v-else>提交1</el-button>
|
||||
</el-row>
|
||||
</el-card>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
new Vue({
|
||||
el: '#app',
|
||||
store,
|
||||
dicts: ["UNION_REIMBURSE_TYPE", "UNION_REIMBURSE_PAYMENT_WAY", "UNION_REIMBURSE_FUND_SOURCE"],
|
||||
data() {
|
||||
return {
|
||||
bizId: GetQueryString("bizId"),
|
||||
taskId: GetQueryString("taskId"),
|
||||
formData: {
|
||||
reimburseType: "",
|
||||
},
|
||||
formRules: {
|
||||
reimburseType: [{required: true, message: '请选择报销类别', trigger: ["change", "blur"]}],
|
||||
paymentWay: [{required: true, message: '请选择支付方式', trigger: ["change", "blur"]}],
|
||||
reimburseProject: [{required: true, message: '请选择报销项目', trigger: ["change", "blur"]}],
|
||||
reimburseFundSource: [{required: true, message: '请选择经费来源', trigger: ["change", "blur"]}],
|
||||
mobile: [{required: true, message: '请填写联系方式', trigger: ["change", "blur"]}],
|
||||
bankUserName: [{required: true, message: '请填写户名', trigger: ["change", "blur"]}],
|
||||
bankCardNumber: [{required: true, message: '请填写银行账号', trigger: ["change", "blur"]}],
|
||||
bankOfDeposit: [{required: true, message: '请填写开户行', trigger: ["change", "blur"]}],
|
||||
condolencePeopleMobile: [{required: true, message: '请填写联系方式', trigger: ["change", "blur"]}],
|
||||
condolenceTime: [{required: true, message: '请选择慰问时间', trigger: ["change", "blur"]}],
|
||||
invoiceNumber: [{required: true, message: '请填写发票张数', trigger: ["change", "blur"]}],
|
||||
invoice: [{required: true, message: '请填写发票号码', trigger: ["change", "blur"]}],
|
||||
paymentNotes: [{required: true, message: '请填写支付内容', trigger: ["change", "blur"]}],
|
||||
},
|
||||
chooseType: {},
|
||||
userOptions: [],
|
||||
typeOptions: [],
|
||||
reimburseProjectList: [],
|
||||
reimburseProjects: [],
|
||||
clubOptions: []
|
||||
}
|
||||
},
|
||||
// 监听报销类别发生变化,报销项目联动改变
|
||||
watch: {
|
||||
"formData.reimburseType"(newVal) {
|
||||
if (newVal === 'UNION_REIMBURSE_TYPE_1') {
|
||||
this.reimburseProjects = this.reimburseProjectList.filter((o) => {
|
||||
return ['1', 'UNION_REIMBURSE_TYPE_1'].includes(o.remark)
|
||||
})
|
||||
} else {
|
||||
this.reimburseProjects = this.reimburseProjectList.filter((o) => {
|
||||
return ['1', 'UNION_REIMBURSE_TYPE_2'].includes(o.remark)
|
||||
})
|
||||
}
|
||||
},
|
||||
// 添加对社团选择的监听
|
||||
"formData.clubId"(newVal) {
|
||||
// 当经费来源是社团且选择了具体社团时,重新查询余额
|
||||
if (this.formData.reimburseFundSource === 'UNION_REIMBURSE_FUND_SOURCE_3' && newVal) {
|
||||
// 选择了具体社团,获取社团名称并保存
|
||||
const selectedClub = this.clubOptions.find(club => club.id === newVal);
|
||||
if (selectedClub) {
|
||||
this.$set(this.formData, 'clubName', selectedClub.clubName);
|
||||
}
|
||||
this.reimburseFundSourceChange();
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
createRemoteMethod(options) {
|
||||
return (keyword) => {
|
||||
this.selectQueryUser(keyword, options)
|
||||
}
|
||||
},
|
||||
//查询慰问对象
|
||||
selectQueryUser(keyword, options) {
|
||||
options.length = 0
|
||||
this.$axios.post("/platform/UnionReimburse/apply/listUser", {keyword: keyword}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
options.push(...res.data)
|
||||
}
|
||||
})
|
||||
},
|
||||
userChange(val) {
|
||||
const user = this.userOptions.find(o => o.id === val)
|
||||
if (user) {
|
||||
const { userName,mobile } = user
|
||||
this.$set(this.formData, "condolenceName", userName)
|
||||
this.$set(this.formData, "condolenceMobile", mobile)
|
||||
}
|
||||
},
|
||||
//
|
||||
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)
|
||||
}
|
||||
},
|
||||
// 保存
|
||||
onSave() {
|
||||
// 余额校验
|
||||
if (this.formData.money && this.formData.fundBalance) {
|
||||
const balance = parseFloat(this.formData.fundBalance);
|
||||
const money = parseFloat(this.formData.money);
|
||||
if (balance < money) {
|
||||
this.$message.warning("经费余额不足");
|
||||
return;
|
||||
}
|
||||
}
|
||||
this.$confirm("您确定保存吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.$axios.post('/platform/unionReimburse/apply/save', {data: JSON.stringify(this.formData)}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
window.location.href = '/platform/unionReimburse/mine'
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
// 提交
|
||||
onSubmit() {
|
||||
// 余额校验
|
||||
if (this.formData.money && this.formData.fundBalance) {
|
||||
const balance = parseFloat(this.formData.fundBalance);
|
||||
const money = parseFloat(this.formData.money);
|
||||
if (balance < money) {
|
||||
this.$message.warning("经费余额不足");
|
||||
return;
|
||||
}
|
||||
}
|
||||
this.$confirm("您确定要提交吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.$axios.post('/platform/unionReimburse/apply/submit', {
|
||||
data: JSON.stringify(this.formData)
|
||||
}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success("提交成功")
|
||||
window.location.href = '/platform/unionReimburse/mine'
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
// 再次提交
|
||||
onFinishTask() {
|
||||
// 余额校验
|
||||
if (this.formData.money && this.formData.fundBalance) {
|
||||
const balance = parseFloat(this.formData.fundBalance);
|
||||
const money = parseFloat(this.formData.money);
|
||||
if (balance < money) {
|
||||
this.$message.warning("经费余额不足");
|
||||
return;
|
||||
}
|
||||
}
|
||||
this.$confirm("您确定要提交吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.$axios.post('/platform/unionReimburse/apply/submitAgain', {
|
||||
data: JSON.stringify(this.formData),
|
||||
taskId: GetQueryString("taskId")
|
||||
}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success("提交成功")
|
||||
window.location.href = '/platform/unionReimburse/mine'
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
// 初始化
|
||||
async init() {
|
||||
this.reimburseProjectList = await this.$businessTool.getDictOptions("UNION_REIMBURSE_PROJECT")
|
||||
if (this.bizId) {
|
||||
this.$axios.post("/platform/unionReimburse/apply/info", {id: this.bizId}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.formData = res.data
|
||||
this.selectQueryUser(this.formData.loginName, this.userOptions)
|
||||
this.chooseType = this.typeOptions.find(o => o.id === this.formData.type)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
const { username, loginname, id, unit, union, mobile } = this.$store.state.user
|
||||
this.formData = {
|
||||
userName: username,
|
||||
loginName: loginname,
|
||||
unitId: unit?.id,
|
||||
unitName: unit?.name,
|
||||
unionId: union?.id,
|
||||
unionName: union?.name,
|
||||
reimburseType: "UNION_REIMBURSE_TYPE_1",
|
||||
mobile: mobile
|
||||
}
|
||||
}
|
||||
},
|
||||
//慰问类型查询
|
||||
queryCondolenceType() {
|
||||
this.$axios.post("/platform/unionReimburse/apply/queryCondolenceType")
|
||||
.then((resp) => {
|
||||
this.typeOptions = resp.data
|
||||
})
|
||||
},
|
||||
//经费来源查询
|
||||
reimburseFundSourceChange() {
|
||||
// 检查是否有选择经费来源
|
||||
if (!this.formData.reimburseFundSource) {
|
||||
this.$set(this.formData, 'fundBalance', '');
|
||||
return;
|
||||
}
|
||||
|
||||
// 如果是社团经费来源,但没有选择具体社团,则不查询
|
||||
if (this.formData.reimburseFundSource === 'UNION_REIMBURSE_FUND_SOURCE_3' && !this.formData.clubId) {
|
||||
this.$set(this.formData, 'fundBalance', '');
|
||||
return;
|
||||
}
|
||||
|
||||
// 定义API映射关系
|
||||
const apiMap = {
|
||||
'UNION_REIMBURSE_FUND_SOURCE_1': {
|
||||
url: "/platform/unionReimburse/apply/getSchoolBudget",
|
||||
},
|
||||
'UNION_REIMBURSE_FUND_SOURCE_2': {
|
||||
url: "/platform/unionReimburse/apply/getUnionBalance",
|
||||
},
|
||||
'UNION_REIMBURSE_FUND_SOURCE_3': {
|
||||
url: "/platform/unionReimburse/apply/getClubBudget",
|
||||
}
|
||||
};
|
||||
|
||||
const fundSource = this.formData.reimburseFundSource;
|
||||
const apiInfo = apiMap[fundSource];
|
||||
|
||||
// 如果没有匹配的API,清空经费余额并返回
|
||||
if (!apiInfo) {
|
||||
this.$set(this.formData, 'fundBalance', '');
|
||||
return;
|
||||
}
|
||||
|
||||
// 构造请求参数
|
||||
const params = {
|
||||
reimburseFundSource: fundSource
|
||||
};
|
||||
|
||||
// 如果是社团经费,需要传递社团ID
|
||||
if (fundSource === 'UNION_REIMBURSE_FUND_SOURCE_3' && this.formData.clubId) {
|
||||
params.clubId = this.formData.clubId;
|
||||
}
|
||||
|
||||
// 显示加载状态
|
||||
this.$set(this.formData, 'fundBalance', '查询中...');
|
||||
|
||||
// 发送请求
|
||||
this.$axios.post(apiInfo.url, params)
|
||||
.then(response => {
|
||||
if (response.code === 0) {
|
||||
// 显示经费余额(只显示数字,不显示"元")
|
||||
this.$set(this.formData, 'fundBalance', response.data || '0.00');
|
||||
} else {
|
||||
this.$set(this.formData, 'fundBalance', '查询失败');
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.error("经费余额查询失败:", error);
|
||||
this.$set(this.formData, 'fundBalance', '查询失败');
|
||||
this.$message.error("经费余额查询失败");
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
created() {
|
||||
this.queryCondolenceType()
|
||||
this.init()
|
||||
//社团查询
|
||||
this.$businessTool.listClub().then((res) => (this.clubOptions = res))
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,208 @@
|
||||
<!--#
|
||||
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%"></el-date-picker>
|
||||
</search-item>
|
||||
<search-item label="工会名称">
|
||||
<el-select v-model="pageForm.unionId" @change="doSearch" style="width: 100%"
|
||||
placeholder="请选择工会名称" clearable>
|
||||
<el-option v-for="item in unionOptions"
|
||||
:value="item.id"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="单位名称">
|
||||
<el-select v-model="pageForm.unitId" @change="doSearch" style="width: 100%"
|
||||
placeholder="请选择单位名称" clearable>
|
||||
<el-option v-for="item in unitOptions"
|
||||
:value="item.id"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="报销项目">
|
||||
<el-select v-model="pageForm.reimburseProject" @change="doSearch" style="width: 100%"
|
||||
placeholder="请选择报销项目" clearable>
|
||||
<el-option v-for="item in dict.type.UNION_REIMBURSE_PROJECT"
|
||||
:value="item.code"
|
||||
:key="item.code"
|
||||
:label="item.name"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="经办人">
|
||||
<el-select
|
||||
style="width: 100%"
|
||||
v-model="pageForm.userName"
|
||||
filterable
|
||||
clearable
|
||||
remote
|
||||
reserve-keyword
|
||||
placeholder="请输入经办人姓名或工号查询"
|
||||
:remote-method="createRemoteMethod(userOptions)"
|
||||
@change="userChange">
|
||||
<el-option
|
||||
v-for="item in userOptions"
|
||||
:key="item.id"
|
||||
:label="item.userName+'('+item.loginName+')'+'('+item.unitName+')'+'('+item.sex+')'"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
|
||||
</search>
|
||||
</el-card>
|
||||
<el-card shadow="never">
|
||||
<table-tool label="申请列表">
|
||||
<el-button @click="onExport" icon="el-icon-s-promotion" type="primary" size="small">导出</el-button>
|
||||
</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 prop="loginName" label="经办人工号"></el-table-column>
|
||||
<el-table-column prop="userName" label="姓名"></el-table-column>
|
||||
<el-table-column prop="unionName" label="所属工会"></el-table-column>
|
||||
<el-table-column prop="unitName" label="所属单位"></el-table-column>
|
||||
<el-table-column prop="reimburseType" label="报销类别">
|
||||
<template slot-scope="{row}">
|
||||
<dict-tag :options="dict.type.UNION_REIMBURSE_TYPE"
|
||||
:value="row.reimburseType">
|
||||
</dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="reimburseProject" label="报销项目">
|
||||
<template slot-scope="{row}">
|
||||
<dict-tag :options="dict.type.UNION_REIMBURSE_PROJECT"
|
||||
:value="row.reimburseProject">
|
||||
</dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="money" label="金额"></el-table-column>
|
||||
<el-table-column prop="createTime" label="申请时间"></el-table-column>
|
||||
<el-table-column prop="taskName" label="当前节点"></el-table-column>
|
||||
<el-table-column prop="instanceState" label="流程状态">
|
||||
<template slot-scope="{row}">
|
||||
<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="$auth.hasRole('SYSADMIN')" @click="onDelete(row.id)" size="mini" type="danger">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
<template #edit>
|
||||
<union-reimburse-info ref="unionReimburseInfoRef">
|
||||
</union-reimburse-info>
|
||||
</template>
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
<!--#include('../info.js'){}#-->
|
||||
new Vue({
|
||||
el: "#app",
|
||||
store,
|
||||
dicts: ["UNION_REIMBURSE_TYPE","UNION_REIMBURSE_PROJECT"],
|
||||
//分页数据
|
||||
mixins: [initTableMixins],
|
||||
components: {
|
||||
"union-reimburse-info": unionReimburseInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
unionOptions: [],
|
||||
unitOptions: [],
|
||||
userOptions: [],
|
||||
}
|
||||
}
|
||||
,
|
||||
methods: {
|
||||
//查询经办人
|
||||
createRemoteMethod(options) {
|
||||
return (keyword) => {
|
||||
this.selectQueryUser(keyword, options)
|
||||
}
|
||||
},
|
||||
selectQueryUser(keyword, options) {
|
||||
options.length = 0
|
||||
this.$axios.post("/platform/UnionReimburse/apply/listUser", {keyword: keyword}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
options.push(...res.data)
|
||||
}
|
||||
})
|
||||
},
|
||||
userChange(val) {
|
||||
const user = this.userOptions.find(o => o.id === val)
|
||||
if (user) {
|
||||
const { userName } = user
|
||||
this.$set(this.pageForm, "userName", userName)
|
||||
}
|
||||
},
|
||||
onView(row) {
|
||||
this.$refs.guava.edit(()=>{
|
||||
this.showApprovalForm = false
|
||||
this.$refs.unionReimburseInfoRef.onOpen(row)
|
||||
})
|
||||
},
|
||||
onDelete(id) {
|
||||
this.$confirm("您确定要删除吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.$axios.post("/platform/unionReimburse/mine/delete", {id}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
onExport() {
|
||||
this.$downLoad(loc() + '/onExport', this.pageForm)
|
||||
},
|
||||
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()
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
created() {
|
||||
this.pageData()
|
||||
//工会查询
|
||||
this.$businessTool.listUnion().then((res) => (this.unionOptions = res))
|
||||
//单位查询
|
||||
this.$businessTool.listUnit().then((res) => (this.unitOptions = res))
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,140 @@
|
||||
const unionReimburseInfo = {
|
||||
template: /*language=HTML*/ `
|
||||
<div>
|
||||
<div class="process-title">
|
||||
申请信息
|
||||
<el-link type="primary" @click="openChart">点击查看流程图</el-link>
|
||||
</div>
|
||||
<el-descriptions :column="2" border class="flow-task-form">
|
||||
<el-descriptions-item label="经办人">{{viewData.userName}}</el-descriptions-item>
|
||||
<el-descriptions-item label="工号">{{viewData.loginName}}</el-descriptions-item>
|
||||
<el-descriptions-item label="单位">{{viewData.unitName}}</el-descriptions-item>
|
||||
<el-descriptions-item label="工会">{{viewData.unionName}}</el-descriptions-item>
|
||||
<el-descriptions-item label="报销类别">
|
||||
<dict-tag :options="dict.type.UNION_REIMBURSE_TYPE"
|
||||
:value="viewData.reimburseType">
|
||||
</dict-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="支付方式">
|
||||
<dict-tag :options="dict.type.UNION_REIMBURSE_PAYMENT_WAY"
|
||||
:value="viewData.paymentWay">
|
||||
</dict-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="报销项目">
|
||||
<dict-tag :options="dict.type.UNION_REIMBURSE_PROJECT"
|
||||
:value="viewData.reimburseProject">
|
||||
</dict-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="报销经费来源">
|
||||
<dict-tag :options="dict.type.UNION_REIMBURSE_FUND_SOURCE"
|
||||
:value="viewData.reimburseFundSource">
|
||||
</dict-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="联系方式" >{{viewData.mobile}}</el-descriptions-item>
|
||||
<el-descriptions-item label="所属社团" v-if="viewData.reimburseFundSource === 'UNION_REIMBURSE_FUND_SOURCE_3'">{{viewData.clubName}}</el-descriptions-item>
|
||||
<el-descriptions-item label="经费余额" >{{viewData.fundBalance}}</el-descriptions-item>
|
||||
<el-descriptions-item label="户名" >{{viewData.bankUserName}}</el-descriptions-item>
|
||||
<el-descriptions-item label="银行账号" >{{viewData.bankCardNumber}}</el-descriptions-item>
|
||||
<el-descriptions-item label="开户行" >{{viewData.bankOfDeposit}}</el-descriptions-item>
|
||||
<el-descriptions-item label="慰问对象" v-if="viewData.reimburseProject === 'UNION_REIMBURSE_PROJECT_1'">{{viewData.condolenceName}}</el-descriptions-item>
|
||||
<el-descriptions-item label="联系方式" v-if="viewData.reimburseProject === 'UNION_REIMBURSE_PROJECT_1'">{{viewData.condolenceMobile}}</el-descriptions-item>
|
||||
<el-descriptions-item label="慰问类型" v-if="viewData.reimburseProject === 'UNION_REIMBURSE_PROJECT_1'">{{viewData.typeName}}</el-descriptions-item>
|
||||
<el-descriptions-item label="慰问金额" v-if="viewData.reimburseProject === 'UNION_REIMBURSE_PROJECT_1'">{{viewData.money}}</el-descriptions-item>
|
||||
<el-descriptions-item label="慰问时间" v-if="viewData.reimburseProject === 'UNION_REIMBURSE_PROJECT_1'">{{viewData.condolenceTime}}</el-descriptions-item>
|
||||
<el-descriptions-item label="活动名称" v-if="viewData.reimburseProject !== 'UNION_REIMBURSE_PROJECT_1'">{{viewData.activityName}}</el-descriptions-item>
|
||||
<el-descriptions-item label="活动类型" v-if="viewData.reimburseProject === 'UNION_REIMBURSE_PROJECT_2'">{{viewData.activityType}}</el-descriptions-item>
|
||||
<el-descriptions-item label="活动人数" v-if="viewData.reimburseProject === 'UNION_REIMBURSE_PROJECT_2'">{{viewData.activityNumber}}</el-descriptions-item>
|
||||
<el-descriptions-item label="活动地点" v-if="viewData.reimburseProject !== 'UNION_REIMBURSE_PROJECT_1'">{{viewData.activityPlace}}</el-descriptions-item>
|
||||
<el-descriptions-item label="报销金额" v-if="viewData.reimburseProject !== 'UNION_REIMBURSE_PROJECT_1'">{{viewData.money}}</el-descriptions-item>
|
||||
<el-descriptions-item label="活动时间" v-if="viewData.reimburseProject !== 'UNION_REIMBURSE_PROJECT_1'">{{viewData.activityTime}}</el-descriptions-item>
|
||||
<el-descriptions-item label="发票张数" v-if="viewData.reimburseType === 'UNION_REIMBURSE_TYPE_1'">{{viewData.invoiceNumber}}</el-descriptions-item>
|
||||
<el-descriptions-item label="发票号码" v-if="viewData.reimburseType === 'UNION_REIMBURSE_TYPE_1'">{{viewData.invoice}}</el-descriptions-item>
|
||||
<el-descriptions-item label="支付内容" :span="2">{{viewData.paymentNotes}}</el-descriptions-item>
|
||||
<el-descriptions-item label="附件" :span="2">
|
||||
<file-preview v-if="viewData.files && viewData.files.length > 0" :files="viewData.files" complete_result></file-preview>
|
||||
<span v-else>暂无附件</span>
|
||||
</el-descriptions-item>
|
||||
|
||||
</el-descriptions>
|
||||
|
||||
<template v-for="task in doneTasks">
|
||||
<div class="mt10">
|
||||
<div class="process-title">{{ task.displayName }}</div>
|
||||
<el-descriptions border class="flow-task-form" :column="3" :key="task.id"
|
||||
v-if="task.ext.isFirstTaskNode">
|
||||
<el-descriptions-item label="申请用户">{{ task.ext.initiatorName
|
||||
}}({{task.ext.initiatorAccount}})
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="申请时间">{{ task.finishTime }}</el-descriptions-item>
|
||||
<el-descriptions-item label="办理结果">
|
||||
<dict-tag :options="dict.type.PROCESS_TASK_SUBMIT_TYPE"
|
||||
:value="task.ext.submitType"></dict-tag>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
|
||||
<el-descriptions border class="flow-task-form" :column="3" :key="task.id" v-else>
|
||||
<el-descriptions-item label="办理用户">{{ task.taskFormData.userName
|
||||
}}({{task.taskFormData.loginName}})
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="办理时间">{{ task.finishTime }}</el-descriptions-item>
|
||||
<el-descriptions-item label="办理结果">
|
||||
<dict-tag :options="dict.type.PROCESS_TASK_SUBMIT_TYPE"
|
||||
:value="task.ext.submitType"></dict-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="办理意见" v-if="!task.ext.isFirstTaskNode">{{
|
||||
task.taskFormData.opinion }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
</template>
|
||||
<slot></slot>
|
||||
|
||||
<snaker-chart ref="snakerChartRef"></snaker-chart>
|
||||
</div>
|
||||
`,
|
||||
store,
|
||||
dicts: ["UNION_REIMBURSE_TYPE", "UNION_REIMBURSE_PAYMENT_WAY", "UNION_REIMBURSE_FUND_SOURCE","UNION_REIMBURSE_PROJECT","PROCESS_TASK_SUBMIT_TYPE"],
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
viewData: {},
|
||||
doneTasks: [],
|
||||
row: null
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 打开
|
||||
onOpen(row) {
|
||||
this.row = row
|
||||
this.visible = true
|
||||
this.getInfo()
|
||||
this.getDoneTasks()
|
||||
},
|
||||
|
||||
// 获取申请信息
|
||||
getInfo() {
|
||||
this.$axios.post('/platform/unionReimburse/apply/info', {id: this.row.id}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.viewData = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 获取已办任务审批记录
|
||||
getDoneTasks() {
|
||||
this.$axios.post("/flow/common/doneTasks", {bizId: this.row.id}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.doneTasks = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 查看流程图
|
||||
openChart(){
|
||||
this.$refs.snakerChartRef.onOpenFull(this.row.instanceProcessDefineId,this.row.instanceId)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,209 @@
|
||||
<!--#
|
||||
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%"></el-date-picker>
|
||||
</search-item>
|
||||
<search-item label="工会名称">
|
||||
<el-select v-model="pageForm.unionId" @change="doSearch" style="width: 100%"
|
||||
placeholder="请选择工会名称" clearable>
|
||||
<el-option v-for="item in unionOptions"
|
||||
:value="item.id"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="单位名称">
|
||||
<el-select v-model="pageForm.unitId" @change="doSearch" style="width: 100%"
|
||||
placeholder="请选择单位名称" clearable>
|
||||
<el-option v-for="item in unitOptions"
|
||||
:value="item.id"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="报销项目">
|
||||
<el-select v-model="pageForm.reimburseProject" @change="doSearch" style="width: 100%"
|
||||
placeholder="请选择报销项目" clearable>
|
||||
<el-option v-for="item in dict.type.UNION_REIMBURSE_PROJECT"
|
||||
:value="item.code"
|
||||
:key="item.code"
|
||||
:label="item.name"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="经办人">
|
||||
<el-select
|
||||
style="width: 100%"
|
||||
v-model="pageForm.userName"
|
||||
filterable
|
||||
clearable
|
||||
remote
|
||||
reserve-keyword
|
||||
placeholder="请输入经办人姓名或工号查询"
|
||||
:remote-method="createRemoteMethod(userOptions)"
|
||||
@change="userChange">
|
||||
<el-option
|
||||
v-for="item in userOptions"
|
||||
:key="item.id"
|
||||
:label="item.userName+'('+item.loginName+')'+'('+item.unitName+')'+'('+item.sex+')'"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
|
||||
</search>
|
||||
</el-card>
|
||||
<el-card shadow="never">
|
||||
<table-tool></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 prop="loginName" label="经办人工号"></el-table-column>
|
||||
<el-table-column prop="userName" label="姓名"></el-table-column>
|
||||
<el-table-column prop="unionName" label="所属工会"></el-table-column>
|
||||
<el-table-column prop="unitName" label="所属单位"></el-table-column>
|
||||
<el-table-column prop="reimburseType" label="报销类别">
|
||||
<template slot-scope="{row}">
|
||||
<dict-tag :options="dict.type.UNION_REIMBURSE_TYPE"
|
||||
:value="row.reimburseType">
|
||||
</dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="reimburseProject" label="报销项目">
|
||||
<template slot-scope="{row}">
|
||||
<dict-tag :options="dict.type.UNION_REIMBURSE_PROJECT"
|
||||
:value="row.reimburseProject">
|
||||
</dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="money" label="金额"></el-table-column>
|
||||
<el-table-column prop="createTime" label="申请时间"></el-table-column>
|
||||
<el-table-column prop="taskName" label="当前节点"></el-table-column>
|
||||
<el-table-column prop="instanceState" label="流程状态">
|
||||
<template slot-scope="{row}">
|
||||
<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.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>
|
||||
<el-button v-if="row.taskKey === 'startTask' || !row.instanceId" @click="onDelete(row.id)" size="mini" type="danger">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
<template #view>
|
||||
<union-reimburse-info ref="unionReimburseInfoRef"></union-reimburse-info>
|
||||
</template>
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
<!--#include('../info.js'){}#-->
|
||||
new Vue({
|
||||
el: "#app",
|
||||
store,
|
||||
dicts: ["UNION_REIMBURSE_TYPE","UNION_REIMBURSE_PROJECT"],
|
||||
//分页数据
|
||||
mixins: [initTableMixins],
|
||||
components: {
|
||||
"union-reimburse-info": unionReimburseInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
unionOptions: [],
|
||||
unitOptions: [],
|
||||
userOptions: [],
|
||||
}
|
||||
}
|
||||
,
|
||||
methods: {
|
||||
//查询经办人
|
||||
createRemoteMethod(options) {
|
||||
return (keyword) => {
|
||||
this.selectQueryUser(keyword, options)
|
||||
}
|
||||
},
|
||||
selectQueryUser(keyword, options) {
|
||||
options.length = 0
|
||||
this.$axios.post("/platform/UnionReimburse/apply/listUser", {keyword: keyword}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
options.push(...res.data)
|
||||
}
|
||||
})
|
||||
},
|
||||
userChange(val) {
|
||||
const user = this.userOptions.find(o => o.id === val)
|
||||
if (user) {
|
||||
const { userName } = user
|
||||
this.$set(this.pageForm, "userName", userName)
|
||||
}
|
||||
},
|
||||
|
||||
onView(row) {
|
||||
this.$refs.guava.view(()=>{
|
||||
this.$refs.unionReimburseInfoRef.onOpen(row)
|
||||
})
|
||||
},
|
||||
onEdit(row) {
|
||||
window.location.href = '/platform/unionReimburse/apply?taskId=' + (row.startTaskId || '') + "&bizId=" + row.id
|
||||
},
|
||||
onRevoke(row) {
|
||||
this.$confirm("您确定要撤回吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.$axios.post("/flow/common/revokeTask", {taskId: row.startTaskId}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
onDelete(id) {
|
||||
this.$confirm("您确定要删除吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.$axios.post("/platform/unionReimburse/mine/delete", {id}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
created() {
|
||||
this.pageData()
|
||||
//工会查询
|
||||
this.$businessTool.listUnion().then((res) => (this.unionOptions = res))
|
||||
//单位查询
|
||||
this.$businessTool.listUnit().then((res) => (this.unitOptions = res))
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,255 @@
|
||||
<!--#
|
||||
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%"></el-date-picker>
|
||||
</search-item>
|
||||
<search-item label="工会名称">
|
||||
<el-select v-model="pageForm.unionId" @change="doSearch" style="width: 100%"
|
||||
placeholder="请选择工会名称" clearable>
|
||||
<el-option v-for="item in unionOptions"
|
||||
:value="item.id"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="单位名称">
|
||||
<el-select v-model="pageForm.unitId" @change="doSearch" style="width: 100%"
|
||||
placeholder="请选择单位名称" clearable>
|
||||
<el-option v-for="item in unitOptions"
|
||||
:value="item.id"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="报销项目">
|
||||
<el-select v-model="pageForm.reimburseProject" @change="doSearch" style="width: 100%"
|
||||
placeholder="请选择报销项目" clearable>
|
||||
<el-option v-for="item in dict.type.UNION_REIMBURSE_PROJECT"
|
||||
:value="item.code"
|
||||
:key="item.code"
|
||||
:label="item.name"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="经办人">
|
||||
<el-select
|
||||
style="width: 100%"
|
||||
v-model="pageForm.userName"
|
||||
filterable
|
||||
clearable
|
||||
remote
|
||||
reserve-keyword
|
||||
placeholder="请输入经办人姓名或工号查询"
|
||||
:remote-method="createRemoteMethod(userOptions)"
|
||||
@change="userChange">
|
||||
<el-option
|
||||
v-for="item in userOptions"
|
||||
:key="item.id"
|
||||
:label="item.userName+'('+item.loginName+')'+'('+item.unitName+')'+'('+item.sex+')'"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
|
||||
</search>
|
||||
</el-card>
|
||||
<el-card shadow="never">
|
||||
<table-tool>
|
||||
<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 prop="loginName" label="经办人工号"></el-table-column>
|
||||
<el-table-column prop="userName" label="姓名"></el-table-column>
|
||||
<el-table-column prop="unionName" label="所属工会"></el-table-column>
|
||||
<el-table-column prop="unitName" label="所属单位"></el-table-column>
|
||||
<el-table-column prop="reimburseType" label="报销类别">
|
||||
<template slot-scope="{row}">
|
||||
<dict-tag :options="dict.type.UNION_REIMBURSE_TYPE"
|
||||
:value="row.reimburseType">
|
||||
</dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="reimburseProject" label="报销项目">
|
||||
<template slot-scope="{row}">
|
||||
<dict-tag :options="dict.type.UNION_REIMBURSE_PROJECT"
|
||||
:value="row.reimburseProject">
|
||||
</dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="money" label="金额"></el-table-column>
|
||||
<el-table-column prop="createTime" label="申请时间"></el-table-column>
|
||||
<el-table-column prop="curTaskName" label="当前节点"></el-table-column>
|
||||
<el-table-column prop="instanceState" label="流程状态">
|
||||
<template slot-scope="{row}">
|
||||
<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="openAudit(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>
|
||||
<union-reimburse-info ref="unionReimburseInfoRef">
|
||||
<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>
|
||||
<el-row type="flex" justify="end">
|
||||
<el-button @click="$refs.guava.index()" size="small">取消</el-button>
|
||||
<el-button @click="handleTaskAction(6)" size="small" type="info">退回到发起人</el-button>
|
||||
<el-button @click="handleTaskAction(2)" size="small" type="danger">拒绝申请</el-button>
|
||||
<el-button @click="handleTaskAction(1)" size="small" type="primary">同意申请</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
</union-reimburse-info>
|
||||
</template>
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
<!--#include('../info.js'){}#-->
|
||||
new Vue({
|
||||
el: "#app",
|
||||
store,
|
||||
dicts: ["UNION_REIMBURSE_TYPE","UNION_REIMBURSE_PROJECT"],
|
||||
//分页数据
|
||||
mixins: [initTableMixins],
|
||||
components: {
|
||||
"union-reimburse-info": unionReimburseInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
pageForm: {
|
||||
approval: false
|
||||
},
|
||||
formData: {},
|
||||
showApprovalForm: false,
|
||||
unionOptions: [],
|
||||
unitOptions: [],
|
||||
userOptions: [],
|
||||
}
|
||||
}
|
||||
,
|
||||
methods: {
|
||||
//查询经办人
|
||||
createRemoteMethod(options) {
|
||||
return (keyword) => {
|
||||
this.selectQueryUser(keyword, options)
|
||||
}
|
||||
},
|
||||
selectQueryUser(keyword, options) {
|
||||
options.length = 0
|
||||
this.$axios.post("/platform/UnionReimburse/apply/listUser", {keyword: keyword}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
options.push(...res.data)
|
||||
}
|
||||
})
|
||||
},
|
||||
userChange(val) {
|
||||
const user = this.userOptions.find(o => o.id === val)
|
||||
if (user) {
|
||||
const { userName } = user
|
||||
this.$set(this.pageForm, "userName", userName)
|
||||
}
|
||||
},
|
||||
|
||||
onView(row) {
|
||||
this.$refs.guava.edit(()=>{
|
||||
this.showApprovalForm = false
|
||||
this.$refs.unionReimburseInfoRef.onOpen(row)
|
||||
})
|
||||
},
|
||||
|
||||
openAudit(row) {
|
||||
this.$refs.guava.edit(()=>{
|
||||
this.showApprovalForm = true
|
||||
this.formData = {
|
||||
processTaskId: row.taskId,
|
||||
taskName: row.curTaskName
|
||||
}
|
||||
this.$refs.unionReimburseInfoRef.onOpen(row)
|
||||
})
|
||||
},
|
||||
|
||||
handleTaskAction(val) {
|
||||
this.$confirm("您确定要提交吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.$axios.post("/flow/common/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()
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
created() {
|
||||
this.pageData()
|
||||
//工会查询
|
||||
this.$businessTool.listUnion().then((res) => (this.unionOptions = res))
|
||||
//单位查询
|
||||
this.$businessTool.listUnit().then((res) => (this.unitOptions = res))
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
Reference in New Issue
Block a user