女职工卫生费75%

This commit is contained in:
=
2025-11-03 08:52:46 +08:00
parent 1968db5e9a
commit f290949019
36 changed files with 1536 additions and 347 deletions
@@ -81,7 +81,7 @@ public class FellowshipTypeController {
c.and("typeId", "=", item.getString("id"));
c.asc("columnIndex");
List<FellowshipMobileSignColumn> signColumns = dao.query(FellowshipMobileSignColumn.class, c);
item.put("trainMobileSignColumnList", signColumns);
item.put("mobileSignColumnList", signColumns);
});
return Result.success().addData(pagination);
@@ -99,7 +99,7 @@ public class FellowshipTypeController {
}
int totalCount = dao.count(FellowshipType.class);
type.setXh(totalCount + 1);
dao.insertWith(type, "trainMobileSignColumnList");
dao.insertWith(type, "mobileSignColumnList");
return Result.success();
}
@@ -114,7 +114,7 @@ public class FellowshipTypeController {
}
dao.update(type);
dao.clear(FellowshipMobileSignColumn.class, Cnd.where("typeId", "=", type.getId()));
dao.insertLinks(type, "trainMobileSignColumnList");
dao.insertLinks(type, "mobileSignColumnList");
return Result.success();
}
@@ -152,7 +152,7 @@ public class FellowshipTypeController {
@SaCheckLogin
public Result getAllType(@Param(value = "id") String id) {
List<FellowshipType> fellowshipTypeList = dao.query(FellowshipType.class, Cnd.NEW().andEX("id", "=", id).asc("xh"));
dao.fetchLinks(fellowshipTypeList, "trainMobileSignColumnList", Cnd.NEW().asc("columnIndex"));
dao.fetchLinks(fellowshipTypeList, "mobileSignColumnList", Cnd.NEW().asc("columnIndex"));
return Result.success().addData(fellowshipTypeList);
}
@@ -0,0 +1,190 @@
package com.budwk.app.zhgh.dayofficework.womanSanitary.controller;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.dev33.satoken.annotation.SaMode;
import cn.hutool.core.util.StrUtil;
import com.alibaba.excel.EasyExcel;
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.zhgh.dayofficework.cadreTraining.model.CadreTrainingAct;
import com.budwk.app.zhgh.dayofficework.exerciseCard.vo.ExercisePeopleImportVo;
import com.budwk.app.zhgh.dayofficework.womanSanitary.model.WomanSanitaryUser;
import com.budwk.app.zhgh.dayofficework.womanSanitary.service.WomanSanitaryUserService;
import com.budwk.app.zhgh.dayofficework.womanSanitary.vo.WomanSanitaryUserImportVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Chain;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.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.AdaptBy;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import org.nutz.mvc.upload.TempFile;
import org.nutz.mvc.upload.UploadAdaptor;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.net.URLEncoder;
import java.util.ArrayList;
/**
* @author : hongqiwei
* @description :
* @createDate : 2025/11/1 14:11
*/
@IocBean
@At("/platform/womanSanitary/manage")
@Api("人员管理")
@Ok("json:full")
@Slf4j
public class WomanSanitaryManageController {
@Inject
private Dao dao;
@Inject
private WomanSanitaryUserService womanSanitaryUserService;
@At("/index")
@Ok("beetl:/platform/zhgh/dayofficework/womanSanitary/manage/index.html")
@SaCheckPermission("womanSanitary.manage")
public void index() {
}
@At("/h5")
@Ok("beetl:/platform/zhghh5/dayofficework/womanSanitary/manage/index.html")
@SaCheckPermission("h5.womanSanitary.manage")
public void h5Index() {
}
@At
@ApiOperation("人员分页")
@SaCheckPermission(value = {"womanSanitary.manage", "h5.womanSanitary.manage"}, mode = SaMode.OR)
public Result pageData(@Valid PageForm pageForm,
Integer year,
String unionId,
String unitId,
String searchKeyword,
String sex) {
Cnd cnd = Cnd.NEW();
// 年度查询条件
cnd.andEX("year(applyTime)", "=", year);
// 姓名和工号查询条件
if (StrUtil.isNotBlank(searchKeyword)) {
SqlExpressionGroup seg = new SqlExpressionGroup();
seg.orLike("userName", "%" + searchKeyword + "%");
seg.orLike("loginName", "%" + searchKeyword + "%");
cnd.and(seg);
}
// 工会、单位名称查询条件
cnd.andEX("unionId", "=", unionId);
cnd.andEX("unitId", "=", unitId);
// 性别查询条件
cnd.andEX("sex", "=", sex);
cnd.desc("applyTime");
Pagination pagination = womanSanitaryUserService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), cnd);
return Result.success(pagination);
}
@At
@ApiOperation("删除")
@Aop(TransAop.READ_COMMITTED)
@SaCheckPermission(value = {"womanSanitary.manage", "h5.womanSanitary.manage"}, mode = SaMode.OR)
public Result delete(@Param("id") String id) {
womanSanitaryUserService.delete(id);
return Result.success();
}
@At
@SaCheckPermission(value = {"womanSanitary.manage", "h5.womanSanitary.manage"}, mode = SaMode.OR)
public Result findOne(String id){
WomanSanitaryUser project = womanSanitaryUserService.fetch(id);
return Result.success(project);
}
@At
@ApiOperation("设置发放状态")
@SaCheckPermission(value = {"womanSanitary.query", "h5.womanSanitary.query"}, mode = SaMode.OR)
public Result setIssue(@Param("id") String id, @Param("issue") boolean issue) {
try {
womanSanitaryUserService.update(Chain.make("issue", issue), Cnd.where("id", "=", id));
return Result.success(issue ? "发放成功" : "取消发放成功");
} catch (Exception e) {
log.error("设置发放状态失败", e);
return Result.error("操作失败: " + e.getMessage());
}
}
@At
@ApiOperation("批量切换发放状态")
@SaCheckPermission(value = {"womanSanitary.manage", "h5.womanSanitary.manage"}, mode = SaMode.OR)
public Result batchIssue() {
try {
// 方案1: 使用SQL直接切换所有记录的状态
Sql sql = Sqls.create("UPDATE woman_sanitary_user SET issue = !issue");
dao.execute(sql);
return Result.success("状态切换成功");
} catch (Exception e) {
log.error("批量切换发放状态失败", e);
return Result.error("操作失败: " + e.getMessage());
}
}
@At
@Ok("void")
@ApiOperation("导入模板下载")
@SaCheckPermission("womanSanitary.manage")
public void downloadTemplate(HttpServletResponse response) {
try {
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
response.setCharacterEncoding("utf-8");
String fileName = URLEncoder.encode("人员导入模版", "UTF-8").replaceAll("\\+", "%20");
response.setHeader("Content-disposition", "attachment;filename*=" + fileName + ".xlsx");
EasyExcel.write(response.getOutputStream(), WomanSanitaryUserImportVo.class)
.sheet("人员导入模版")
.doWrite(ArrayList::new);
} catch (Exception e) {
throw new RuntimeException("导出失败");
}
}
@At
@Aop(TransAop.READ_COMMITTED)
@ApiOperation("导入人员")
@SaCheckPermission("womanSanitary.manage")
@AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"})
public Result importData(TempFile file, Boolean isFlag) {
try {
System.out.println(isFlag);
NutMap nutMap = womanSanitaryUserService.handlingMemberImport(file, isFlag);
if (Lang.isNotEmpty(nutMap)) {
return Result.success(nutMap);
}
return Result.success("导入成功");
} catch (Exception e) {
e.printStackTrace();
return Result.error();
}
}
}
@@ -0,0 +1,108 @@
package com.budwk.app.zhgh.dayofficework.womanSanitary.controller;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.dev33.satoken.annotation.SaMode;
import cn.hutool.core.date.DateUtil;
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.zhgh.dayofficework.cadreTraining.model.CadreTrainingAct;
import com.budwk.app.zhgh.dayofficework.womanSanitary.model.WomanSanitaryProject;
import com.budwk.app.zhgh.dayofficework.womanSanitary.model.WomanSanitaryUser;
import com.budwk.app.zhgh.dayofficework.womanSanitary.service.WomanSanitaryProjectService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.ioc.aop.Aop;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import javax.validation.Valid;
/**
* @author : hongqiwei
* @description :
* @createDate : 2025/11/1 14:11
*/
@IocBean
@At("/platform/womanSanitary/project")
@Api("项目管理")
@Ok("json:full")
@Slf4j
public class WomanSanitaryProjectController {
@Inject
private Dao dao;
@Inject
private WomanSanitaryProjectService womanSanitaryProjectService;
@At("/index")
@Ok("beetl:/platform/zhgh/dayofficework/womanSanitary/project/index.html")
@SaCheckPermission("womanSanitary.project")
public void index() {
}
@At("/h5")
@Ok("beetl:/platform/zhghh5/dayofficework/womanSanitary/project/index.html")
@SaCheckPermission("h5.womanSanitary.project")
public void h5Index() {
}
@At
@ApiOperation("事项分页")
@SaCheckPermission(value = {"womanSanitary.project", "h5.womanSanitary.project"}, mode = SaMode.OR)
public Result pageData(@Valid PageForm pageForm, Integer year) {
Cnd cnd = Cnd.NEW();
cnd.andEX("year", "=", year);
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
cnd.and(Cnd.likeEX("projectName", pageForm.getSearchKeyword()));
}
Pagination pagination = womanSanitaryProjectService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), cnd);
return Result.success(pagination);
}
@At
@ApiOperation("事项保存")
@SaCheckPermission(value = {"womanSanitary.project", "h5.womanSanitary.project"}, mode = SaMode.OR)
public Result save( @Param("data") WomanSanitaryProject womanSanitaryProject) {
if (StrUtil.isBlank(womanSanitaryProject.getId())) womanSanitaryProject.setYear(DateUtil.thisYear());
dao.insertOrUpdate(womanSanitaryProject);
return Result.success();
}
@At
@ApiOperation("状态切换")
@SaCheckPermission(value = {"womanSanitary.project", "h5.womanSanitary.project"}, mode = SaMode.OR)
public Result switchChange(WomanSanitaryProject womanSanitaryProject) {
womanSanitaryProjectService.updateIgnoreNull(womanSanitaryProject);
return Result.success();
}
@At
@ApiOperation("删除")
@Aop(TransAop.READ_COMMITTED)
@SaCheckPermission(value = {"womanSanitary.project", "h5.womanSanitary.project"}, mode = SaMode.OR)
public Result delete(@Param("id") String id) {
womanSanitaryProjectService.delete(id);
dao.clear(WomanSanitaryUser.class, Cnd.where(WomanSanitaryUser::getProjectId, "=", id));
return Result.success();
}
@At
@SaCheckPermission(value = {"womanSanitary.project", "h5.womanSanitary.project"}, mode = SaMode.OR)
public Result findOne(String id){
WomanSanitaryProject project = womanSanitaryProjectService.fetch(id);
return Result.success(project);
}
}
@@ -0,0 +1,85 @@
package com.budwk.app.zhgh.dayofficework.womanSanitary.controller;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.dev33.satoken.annotation.SaMode;
import cn.hutool.core.date.DateUtil;
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.zhgh.dayofficework.cadreTraining.model.CadreTrainingAct;
import com.budwk.app.zhgh.dayofficework.womanSanitary.model.WomanSanitaryProject;
import com.budwk.app.zhgh.dayofficework.womanSanitary.model.WomanSanitaryUser;
import com.budwk.app.zhgh.dayofficework.womanSanitary.service.WomanSanitaryProjectService;
import com.budwk.app.zhgh.dayofficework.womanSanitary.service.WomanSanitaryUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.ioc.aop.Aop;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import javax.validation.Valid;
/**
* @author : hongqiwei
* @description :
* @createDate : 2025/11/1 14:11
*/
@IocBean
@At("/platform/womanSanitary/query")
@Api("查询统计")
@Ok("json:full")
@Slf4j
public class WomanSanitaryQueryController {
@Inject
private Dao dao;
@Inject
private WomanSanitaryUserService womanSanitaryUserService;
@At("/index")
@Ok("beetl:/platform/zhgh/dayofficework/womanSanitary/query/index.html")
@SaCheckPermission("womanSanitary.query")
public void index() {
}
@At("/h5")
@Ok("beetl:/platform/zhghh5/dayofficework/womanSanitary/query/index.html")
@SaCheckPermission("h5.womanSanitary.query")
public void h5Index() {
}
@At
@ApiOperation("分页")
@SaCheckPermission(value = {"womanSanitary.query", "h5.womanSanitary.query"}, mode = SaMode.OR)
public Result pageData(@Valid PageForm pageForm, Integer year) {
Cnd cnd = Cnd.NEW();
cnd.andEX("year", "=", year);
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
cnd.and(Cnd.likeEX("projectName", pageForm.getSearchKeyword()));
}
Pagination pagination = womanSanitaryUserService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), cnd);
return Result.success(pagination);
}
@At
@ApiOperation("删除")
@Aop(TransAop.READ_COMMITTED)
@SaCheckPermission(value = {"womanSanitary.query", "h5.womanSanitary.query"}, mode = SaMode.OR)
public Result delete(@Param("id") String id) {
womanSanitaryUserService.delete(id);
dao.clear(CadreTrainingAct.class, Cnd.where(CadreTrainingAct::getId, "=", id));
return Result.success();
}
}
@@ -0,0 +1,74 @@
package com.budwk.app.zhgh.dayofficework.womanSanitary.model;
import cn.hutool.json.JSONObject;
import com.budwk.app.base.model.BaseModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.nutz.dao.entity.annotation.*;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* @author : hongqiwei
* @description :
* @createDate : 2025/11/1 14:11
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Table("woman_sanitary_project")
@TableMeta("{'mysql-charset':'utf8mb4'}")
@Comment("女职工卫生费事项")
public class WomanSanitaryProject extends BaseModel implements Serializable {
@Column
@Name
@Comment("id")
@ColDefine(type = ColType.VARCHAR, width = 32)
@Prev(els = {@EL("uuid()")})
private String id;
@Column
@Comment("年度")
@ColDefine(type = ColType.INT)
private Integer year;
@Column
@Comment("项目名称")
@ColDefine(type = ColType.VARCHAR, width = 255)
private String projectName;
@Column
@Comment("活动范围Id")
@ColDefine(type = ColType.INT, width = 32)
private Integer activityGroupId;
@Column
@Comment("开始时间")
@ColDefine(type = ColType.DATETIME)
private Date startTime;
@Column
@Comment("结束时间")
@ColDefine(type = ColType.DATETIME)
private Date endTime;
@Column
@Comment("详细信息")
@ColDefine(type = ColType.TEXT)
private String content;
@Column
@Comment("是否发布")
@ColDefine(type = ColType.BOOLEAN)
private Boolean isOpen;
@Column
@Comment("附件")
@ColDefine(type = ColType.MYSQL_JSON)
private List<JSONObject> files;
}
@@ -0,0 +1,101 @@
package com.budwk.app.zhgh.dayofficework.womanSanitary.model;
import com.budwk.app.base.model.BaseModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert;
import java.io.Serializable;
import java.util.Date;
/**
* @author : hongqiwei
* @description :
* @createDate : 2025/11/1 15:29
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Table("woman_sanitary_user")
@TableMeta("{'mysql-charset':'utf8mb4'}")
@Comment("个人信息")
public class WomanSanitaryUser extends BaseModel implements Serializable {
@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 projectId;
@Column
@Comment("项目名称")
@ColDefine(type = ColType.VARCHAR, width = 255)
private String projectName;
@Column
@Comment("userid")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String userId;
@Column
@Comment("工号")
@ColDefine(type = ColType.VARCHAR, width = 50)
private String loginName;
@Column
@Comment("申请人")
@ColDefine(type = ColType.VARCHAR, width = 50)
private String userName;
@Column
@Comment("所属单位Id")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String unitId;
@Column
@Comment("所属单位")
@ColDefine(type = ColType.VARCHAR, width = 50)
private String unitName;
@Column
@Comment("所属工会Id")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String unionId;
@Column
@Comment("所属工会")
@ColDefine(type = ColType.VARCHAR, width = 50)
private String unionName;
@Column
@Comment("性别")
@ColDefine(type = ColType.VARCHAR, width = 4)
private String sex;
@Column
@Comment("手机号")
@ColDefine(type = ColType.VARCHAR, width = 50)
private String mobile;
@Column
@Comment("是否发放")
@ColDefine(type = ColType.BOOLEAN)
@Default("0")
private Boolean issue;
@Column
@Comment("发放金额")
@ColDefine(type = ColType.FLOAT, width = 10, precision = 2)
private Double money;
@Column
@Comment("申请时间")
@ColDefine(type = ColType.DATETIME)
private Date applyTime;
}
@@ -0,0 +1,8 @@
package com.budwk.app.zhgh.dayofficework.womanSanitary.service;
import com.budwk.app.base.service.BaseService;
import com.budwk.app.zhgh.dayofficework.womanSanitary.model.WomanSanitaryProject;
public interface WomanSanitaryProjectService extends BaseService<WomanSanitaryProject> {
}
@@ -0,0 +1,16 @@
package com.budwk.app.zhgh.dayofficework.womanSanitary.service;
import com.budwk.app.base.service.BaseService;
import com.budwk.app.zhgh.dayofficework.womanSanitary.model.WomanSanitaryUser;
import org.nutz.lang.util.NutMap;
import org.nutz.mvc.upload.TempFile;
public interface WomanSanitaryUserService extends BaseService<WomanSanitaryUser> {
/**
* 导入会员数据处理
* @param file 文件
* @param isFlag 是否清空更新
*/
NutMap handlingMemberImport(TempFile file, Boolean isFlag);
}
@@ -0,0 +1,21 @@
package com.budwk.app.zhgh.dayofficework.womanSanitary.service.impl;
import com.budwk.app.base.service.impl.BaseServiceImpl;
import com.budwk.app.zhgh.dayofficework.womanSanitary.model.WomanSanitaryProject;
import com.budwk.app.zhgh.dayofficework.womanSanitary.service.WomanSanitaryProjectService;
import lombok.extern.slf4j.Slf4j;
import org.nutz.dao.Dao;
import org.nutz.ioc.loader.annotation.IocBean;
/**
* @author : hongqiwei
* @description :
* @createDate : 2025/11/1 14:15
*/
@Slf4j
@IocBean(args = {"refer:dao"})
public class WomanSanitaryProjectServiceImpl extends BaseServiceImpl<WomanSanitaryProject> implements WomanSanitaryProjectService{
public WomanSanitaryProjectServiceImpl(Dao dao) {
super(dao);
}
}
@@ -0,0 +1,169 @@
package com.budwk.app.zhgh.dayofficework.womanSanitary.service.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import com.budwk.app.base.service.impl.BaseServiceImpl;
import com.budwk.app.base.utils.EasyExcelUtil;
import com.budwk.app.base.utils.ManyAddOrRenewUtil;
import com.budwk.app.sys.models.Sys_user;
import com.budwk.app.zhgh.dayofficework.exerciseCard.model.ExerciseCard;
import com.budwk.app.zhgh.dayofficework.exerciseCard.vo.ExercisePeopleImportVo;
import com.budwk.app.zhgh.dayofficework.womanSanitary.model.WomanSanitaryUser;
import com.budwk.app.zhgh.dayofficework.womanSanitary.service.WomanSanitaryUserService;
import com.budwk.app.zhgh.dayofficework.womanSanitary.vo.WomanSanitaryUserImportVo;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.formula.functions.T;
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.entity.Record;
import org.nutz.dao.sql.Sql;
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.random.R;
import org.nutz.lang.util.NutMap;
import org.nutz.mvc.upload.TempFile;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @author : hongqiwei
* @description :
* @createDate : 2025/11/1 14:15
*/
@Slf4j
@IocBean(args = {"refer:dao"})
public class WomanSanitaryUserServiceImpl extends BaseServiceImpl<WomanSanitaryUser> implements WomanSanitaryUserService {
public WomanSanitaryUserServiceImpl(Dao dao) {
super(dao);
}
@Inject
private ManyAddOrRenewUtil manyAddOrRenewUtil;
// 修改导入部分的代码
@Aop(TransAop.READ_COMMITTED)
@Override
public NutMap handlingMemberImport(TempFile file, Boolean isFlag) {
// 修改1: 使用正确的VO类
List<T> ts = EasyExcelUtil.syncReadModel(file.getFile(), WomanSanitaryUserImportVo.class, 0, 1);
List<WomanSanitaryUserImportVo> list = JSONUtil.parseArray(JSONUtil.toJsonStr(ts)).toList(WomanSanitaryUserImportVo.class);
// 获取系统用户
Cnd cnd = Cnd.NEW();
List<Sys_user> dataUserList = dao().query(Sys_user.class, cnd);
Map<String, Sys_user> userMap = dataUserList.stream().collect(Collectors.toMap(Sys_user::getLoginname, v -> v));
Sql vwUserSql = Sqls.create("""
SELECT
id,
loginname,
username,
birthday,
mobile,
sex,
unitName,
unionName,
unionId,
unitId
FROM
`vw_user`
""");
vwUserSql.setCallback(Sqls.callback.records());
dao().execute(vwUserSql);
List<Record> vwUserList = vwUserSql.getList(Record.class);
Map<String, Record> vwUserMap = vwUserList.stream().collect(Collectors.toMap(r -> r.getString("loginname"), r -> r));
// 修改2: 使用正确的实体类
List<WomanSanitaryUser> userList = new ArrayList<>();
List<Sys_user> insertOrUpdateUserList = new ArrayList<>();
//返回错误记录
List<WomanSanitaryUserImportVo> errorInfos = new ArrayList<>();
for (WomanSanitaryUserImportVo v : list) {
if (StrUtil.isNotBlank(v.getLoginName())) {
v.setLoginName(v.getLoginName().trim());
} else {
v.setErrorInfo("工号不能为空!");
errorInfos.add(v);
continue;
}
//判断是否在系统中
Sys_user user = userMap.get(v.getLoginName());
if (user == null) {
v.setErrorInfo("该人员没有录入系统中!");
errorInfos.add(v);
continue;
}
insertOrUpdateUserList.add(user);
// 创建女性卫生用品用户记录并设置用户详细信息
WomanSanitaryUser womanUser = new WomanSanitaryUser();
womanUser.setId(R.UU32());
// 根据工号查询vw_user视图,设置人员信息
Record vwUser = vwUserMap.get(v.getLoginName());
if (vwUser != null) {
womanUser.setUserId(vwUser.getString("id"));
womanUser.setUserName(vwUser.getString("username"));
womanUser.setUnionId(vwUser.getString("unionId"));
womanUser.setUnitId(vwUser.getString("unitId"));
womanUser.setSex(vwUser.getString("sex"));
womanUser.setUnionName(vwUser.getString("unionName"));
womanUser.setUnitName(vwUser.getString("unitName"));
}
// 设置其他基本信息
womanUser.setLoginName(v.getLoginName());
womanUser.setApplyTime(new Date()); // 设置当前时间为申请时间
womanUser.setIssue(false);
if (v.getMoney() != null) {
try {
womanUser.setMoney(Double.valueOf(v.getMoney()));
} catch (NumberFormatException e) {
v.setErrorInfo("当前额度格式错误!");
errorInfos.add(v);
continue;
}
}
userList.add(womanUser);
}
if (Lang.isNotEmpty(insertOrUpdateUserList)) {
manyAddOrRenewUtil.asyncExecuteInsertOrUpdate(insertOrUpdateUserList,200);
// 批量保存女性卫生用品用户记录
if (Lang.isNotEmpty(userList)) {
manyAddOrRenewUtil.asyncExecuteInsert(userList,200);
}
}
//如果有错误数据就返回给前端
if (Lang.isNotEmpty(errorInfos)) {
NutMap nutMap = NutMap.NEW();
nutMap.setv("totalCount", list.size());
nutMap.setv("successCount", Math.max(list.size() - errorInfos.size(), 0));
nutMap.setv("errorCount", errorInfos.size());
nutMap.setv("errorList", errorInfos.stream().map(v -> {
return NutMap.NEW().addv("工号", v.getLoginName()).addv("姓名", v.getUsername()).addv("错误原因", v.getErrorInfo());
}).collect(Collectors.toList()));
return nutMap;
}
return null;
}
}
@@ -0,0 +1,47 @@
package com.budwk.app.zhgh.dayofficework.womanSanitary.vo;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* @version 1.0
* @Author hongqiwei
* @nameExercisePeopleImportVo
* @Date 2025/10/14 10:04
* @注释
*/
@Data
@EqualsAndHashCode
@ContentRowHeight(20) // 内容行高
@HeadRowHeight(20) // 表头行高
@ColumnWidth(25) //列宽
public class WomanSanitaryUserImportVo {
@ExcelProperty("工号")
private String loginName;
@ExcelProperty("姓名")
private String username;
@ExcelProperty("性别")
private String sex;
@ExcelProperty("工会")
private String unionName;
@ExcelProperty("单位")
private String unitName;
@ExcelProperty("发放金额")
private Double money;
@ExcelIgnore
private String errorInfo;
}
@@ -11,6 +11,7 @@ import com.budwk.app.base.result.Result;
import com.budwk.app.sys.models.Sys_home_activity;
import com.budwk.app.zhgh.dayofficework.cadreTraining.model.CadreTrainingAct;
import com.budwk.app.zhgh.staffbenefit.mutualInsurance.model.MutualInsuranceProject;
import com.budwk.app.zhgh.staffbenefit.mutualInsurance.model.MutualInsuranceUserInfo;
import com.budwk.app.zhgh.staffbenefit.mutualInsurance.service.MutualInsuranceProjectService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@@ -101,7 +102,7 @@ public class MutualInsuranceProjectController {
@SaCheckPermission(value = {"mutualInsurance.project", "h5.mutualInsurance.project"}, mode = SaMode.OR)
public Result delete(@Param("id") String id) {
mutualInsuranceProjectService.delete(id);
dao.clear(CadreTrainingAct.class, Cnd.where(CadreTrainingAct::getId, "=", id));
dao.clear(MutualInsuranceUserInfo.class, Cnd.where(MutualInsuranceUserInfo::getProjectId, "=", id));
return Result.success();
}
@@ -20,7 +20,7 @@ layout("/layouts/platform.html"){
@change="doSearch"
></el-date-picker>
</search-item>
<search-item label="活动状态" style="width: 340px">
<search-item label="活动状态" style="width: 340px">
<el-select v-model="pageForm.activityType" @change="doSearch" style="width: 100%"
placeholder="请选择活动状态" filterable>
<el-option :value="1" label="全部"></el-option>
@@ -198,14 +198,14 @@ const basicForm = {
</template>
</el-table-column>
<el-table-column :label="trainType + '名称'" prop="courseName">
<el-table-column :label="trainType + '人员'" prop="courseName">
<template v-slot="{row}">
<el-input size="small" v-model="row.courseName"
:placeholder="'请输入' + trainType + '名称'"></el-input>
</template>
</el-table-column>
<el-table-column label="类型" prop="courseType" sortable>
<el-table-column label="联谊类型" prop="courseType" sortable>
<template v-slot="{row}">
<el-select size="small" v-model="row.courseType"
@change="(val) => {courseTypeChange(val, row)}">
@@ -267,7 +267,7 @@ const basicForm = {
<el-table-column :label="trainType + '负责人'" prop="courseInstructor">
<template v-slot="{row}">
<el-input size="small" v-model="row.courseInstructor"
:placeholder="'请输入' + trainType + '负责人'"></el-input>
:placeholder="'请输入' + trainType + '交友联谊负责人'"></el-input>
</template>
</el-table-column>
@@ -280,7 +280,7 @@ const basicForm = {
<el-table-column :label="trainType + '时间'">
<template v-slot="scope">
<el-button @click="openSetUpCourseTime(scope.$index)" type="text">设置{{ trainType
}}时间
}}交友联谊时间
</el-button>
</template>
</el-table-column>
@@ -379,7 +379,7 @@ const basicForm = {
},
historicalActList: [],
trainTypeList: [],
trainType: "培训班",
trainType: "",
activityGroupList: [],
pickerOptions: {
disabledDate(time) {
@@ -13,7 +13,7 @@ const info = {
<el-descriptions-item label="报名结束时间">{{viewData.activitySignUpEndTime}}</el-descriptions-item>
</el-descriptions>
</el-tab-pane>
<el-tab-pane :label="trainType + '信息'">
<el-tab-pane label="活动信息">
<el-table :data="viewData.courseList" class="mt20">
<el-table-column :label="trainType + '名称'" prop="courseName"></el-table-column>
<el-table-column label="类型" prop="courseTypeName"></el-table-column>
@@ -26,9 +26,9 @@ const info = {
</el-table-column>
<el-table-column label="校区" prop="campus"></el-table-column>
<el-table-column label="负责人" prop="courseInstructor"></el-table-column>
<el-table-column label="上课时间" prop="courseTimeList" width="200px">
<el-table-column label="活动时间" prop="courseTimeList" width="200px">
<template v-slot="{ row }">
<el-button @click="openViewCourseTime(row.courseTimeList)" type="text">点击查看课程时间</el-button>
<el-button @click="openViewCourseTime(row.courseTimeList)" type="text">点击查看活动时间</el-button>
</template>
</el-table-column>
</el-table>
@@ -71,7 +71,7 @@ const info = {
if (resp.code === 0) {
this.viewData = resp.data
const type = this.dict.type.FELLOWSHIP_TYPE.find((o) => o.code === resp.data.trainType)
this.trainType = type?.name || "培训班"
this.trainType = type?.name || ""
}
})
},
@@ -37,9 +37,9 @@ layout("/layouts/platform.html"){
</table-tool>
<el-table :data="tableData" :size="tableSize">
<el-table-column :index="indexMethod" label="序号" type="index" width="80px"></el-table-column>
<el-table-column :label="trainType" prop="courseName" show-overflow-tooltip></el-table-column>
<el-table-column label="活动名称" prop="courseName" show-overflow-tooltip></el-table-column>
<el-table-column label="类型" prop="courseType" sortable show-overflow-tooltip></el-table-column>
<el-table-column :label="trainType + '地点'" prop="courseLocation" sortable show-overflow-tooltip></el-table-column>
<el-table-column label="活动地点" prop="courseLocation" sortable show-overflow-tooltip></el-table-column>
<el-table-column label="负责人" prop="courseInstructor" sortable show-overflow-tooltip></el-table-column>
<el-table-column label="最多报名人数" prop="coursePeopleNumber" sortable align="center" header-align="center" show-overflow-tooltip>
<template v-slot="{row}">
@@ -250,7 +250,7 @@ const basicForm = {
this.formData.mobileSignColumnList[index].columnType = "JSON"
this.formData.mobileSignColumnList[index].isDisabled = true
} else {
this.formData.mobileSignColumnList[index].columnType = ""
// this.formData.mobileSignColumnList[index].columnType = ""
this.formData.mobileSignColumnList[index].isDisabled = false
}
},
@@ -326,9 +326,13 @@ const basicForm = {
initData(row) {
if(row && row.id) {
this.formData = JSON.parse(JSON.stringify(row))
this.formData.mobileSignColumnList.forEach((item) => {
item.isDisabled = item.columnFormType === "FILE"
})
if (!this.formData.mobileSignColumnList || !Array.isArray(this.formData.mobileSignColumnList)) {
this.formData.mobileSignColumnList = [{ isRequired: false }]
} else {
this.formData.mobileSignColumnList.forEach((item) => {
item.isDisabled = item.columnFormType === "FILE"
})
}
} else {
this.formData = {
mobileSignColumnList: [{ isRequired: false }],
@@ -16,7 +16,7 @@ layout("/layouts/platform.html"){
<template>
<el-card shadow="never">
<search @search="doSearch">
<search-item label="类型名称">
<search-item label="类型名称">
<el-input clearable placeholder="请输入类型名称" v-model="pageForm.typeName"></el-input>
</search-item>
</search>
@@ -32,15 +32,9 @@ layout("/layouts/platform.html"){
<table-tool label="人员调整"></table-tool>
<el-table :data="tableData" :size="tableSize">
<el-table-column :index="indexMethod" label="序号" type="index" width="80px"></el-table-column>
<el-table-column :label="trainType" prop="courseName" show-overflow-tooltip></el-table-column>
<el-table-column label="活动名称" prop="courseName" show-overflow-tooltip></el-table-column>
<el-table-column label="类型" prop="courseType" sortable show-overflow-tooltip></el-table-column>
<el-table-column :label="trainType + '地点'" prop="courseLocation" sortable show-overflow-tooltip></el-table-column>
<el-table-column
:label="trainType === '培训班' ? '讲师' : '负责人'"
prop="courseInstructor"
sortable
show-overflow-tooltip
></el-table-column>
<el-table-column label="活动地点" prop="courseLocation" sortable show-overflow-tooltip></el-table-column>
<el-table-column label="最多报名人数" prop="coursePeopleNumber" sortable show-overflow-tooltip>
<template v-slot="{row}">
<span v-if="row.reserveMode === 1">
@@ -20,13 +20,13 @@ layout("/layouts/platform.html"){
<el-option :label="item.activityName" :value="item.id" v-for="item in activityList" :key="item.id"></el-option>
</el-select>
</search-item>
<search-item :label="trainType + ''">
<search-item :label="trainType">
<el-select @change="courseChange" :placeholder="'请选择' + trainType" style="width: 100%" v-model="pageForm.courseId">
<el-option :label="item.courseName" :value="item.id" v-for="item in courseList" :key="item.id"></el-option>
</el-select>
</search-item>
<search-item label="人员信息">
<el-input clearable placeholder="输入姓名或工号搜索" v-model="pageForm.userKeyWord"></el-input>
<search-item label="姓名/工号">
<el-input clearable placeholder="输入姓名或工号" v-model="pageForm.userKeyWord"></el-input>
</search-item>
</search>
</el-card>
@@ -110,11 +110,11 @@ layout("/layouts/platform.html"){
{ label: "联系方式", prop: "mobile" },
{ label: "单位", prop: "unitname", sortable: true },
{ label: "分工会", prop: "unionname", sortable: true },
{ label: "课程", prop: "courseNames", sortable: true },
{ label: "活动名称", prop: "courseNames", sortable: true },
{ label: "缺席次数", prop: "absentCount" },
{ label: "是否黑名单", prop: "isDisabled", sortable: true }
],
trainType: "培训班",
trainType: "",
courseList: [],
course: {},
reserveMode: 1,
@@ -194,7 +194,7 @@ layout("/layouts/platform.html"){
async activityChange(val) {
const activity = this.activityList.find((o) => o.id === val)
const type = this.dict.type.FELLOWSHIP_TYPE.find(o => o.code === activity.trainType)
this.trainType = type?.name || "培训班"
this.trainType = type?.name || "活动名称"
const resp = await this.$axios.post(loc() + "/getCourseByActivityId", { activityId: val })
this.courseList = resp.data
this.pageForm.courseId = ""
@@ -238,33 +238,6 @@ layout("/layouts/platform.html"){
this.$set(this.formData, 'money', null);
}
},
// 添加日期格式化方法
/*formatDate(date) {
if (!date) return '';
// 如果已经是 yyyy-MM-dd 格式,直接返回
if (typeof date === 'string' && /^\d{4}-\d{2}-\d{2}/.test(date)) {
// 如果包含时间,只取日期部分
if (date.length > 10) {
return date.substring(0, 10);
}
return date;
}
// 否则转换为 yyyy-MM-dd 格式
try {
const d = new Date(date);
if (isNaN(d.getTime())) {
return date;
}
const year = d.getFullYear();
const month = String(d.getMonth() + 1).padStart(2, '0');
const day = String(d.getDate()).padStart(2, '0');
return year + '-' + month + '-' + day;
} catch (e) {
return date;
}
},*/
// 保存
onSave() {
if (!this.checkBalance()) {
@@ -6,7 +6,7 @@ const EXERCISECARD_INFO = {
<el-descriptions-item label="工号">{{viewData.loginName}}</el-descriptions-item>
<el-descriptions-item label="职工姓名">{{viewData.userName}}</el-descriptions-item>
<el-descriptions-item label="性别">{{viewData.sex}}</el-descriptions-item>
<el-descriptions-item label="出生年月">{{formatDate(viewData.birthday)}}</el-descriptions-item>
<el-descriptions-item label="出生年月">{{$moment(viewData.birthday).format('YYYY-MM-DD')}}</el-descriptions-item>
<el-descriptions-item label="工会">{{viewData.unionName}}</el-descriptions-item>
<el-descriptions-item label="单位">{{viewData.unitName}}</el-descriptions-item>
<el-descriptions-item label="初始额度">{{viewData.initMoney}}</el-descriptions-item>
@@ -36,32 +36,6 @@ const EXERCISECARD_INFO = {
}
},
methods: {
// 添加日期格式化方法
formatDate(date) {
if (!date) return '';
// 如果已经是 yyyy-MM-dd 格式,直接返回
if (typeof date === 'string' && /^\d{4}-\d{2}-\d{2}/.test(date)) {
// 如果包含时间,只取日期部分
if (date.length > 10) {
return date.substring(0, 10);
}
return date;
}
// 否则转换为 yyyy-MM-dd 格式
try {
const d = new Date(date);
if (isNaN(d.getTime())) {
return date;
}
const year = d.getFullYear();
const month = String(d.getMonth() + 1).padStart(2, '0');
const day = String(d.getDate()).padStart(2, '0');
return year + '-' + month + '-' + day;
} catch (e) {
return date;
}
},
// 打开
onOpen(row) {
this.row = row
@@ -40,13 +40,13 @@ const unionReimburseInfo = {
<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'">{{formatDate(viewData.condolenceTime)}}</el-descriptions-item>
<el-descriptions-item label="慰问时间" v-if="viewData.reimburseProject === 'UNION_REIMBURSE_PROJECT_1'">{{$moment(viewData.condolenceTime).format('YYYY-MM-DD')}}</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'">{{formatDate(viewData.activityTime)}}</el-descriptions-item>
<el-descriptions-item label="活动时间" v-if="viewData.reimburseProject !== 'UNION_REIMBURSE_PROJECT_1'">{{$moment(viewData.activityTime).format('YYYY-MM-DD')}}</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>
@@ -110,32 +110,6 @@ const unionReimburseInfo = {
this.getInfo()
this.getDoneTasks()
},
// 添加日期格式化方法
formatDate(date) {
if (!date) return '';
// 如果已经是 yyyy-MM-dd 格式,直接返回
if (typeof date === 'string' && /^\d{4}-\d{2}-\d{2}/.test(date)) {
// 如果包含时间,只取日期部分
if (date.length > 10) {
return date.substring(0, 10);
}
return date;
}
// 否则转换为 yyyy-MM-dd 格式
try {
const d = new Date(date);
if (isNaN(d.getTime())) {
return date;
}
const year = d.getFullYear();
const month = String(d.getMonth() + 1).padStart(2, '0');
const day = String(d.getDate()).padStart(2, '0');
return year + '-' + month + '-' + day;
} catch (e) {
return date;
}
},
// 获取申请信息
getInfo() {
this.$axios.post('/platform/unionReimburse/apply/info', {id: this.row.id}).then((res) => {
@@ -0,0 +1,172 @@
const formEdit = {
template: /*language=HTML*/ `
<el-dialog :title="formData.id ? '编辑项目' : '新增项目'" :visible="visible" width="70%" :close-on-click-modal="false" :before-close="handleClose">
<el-form :model="formData" :rules="formRules" label-width="110px" ref="form">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="事项名称" prop="projectName">
<el-input v-model="formData.projectName" placeholder="请输入事项名称" maxlength="50"
show-word-limit></el-input>
</el-col>
</el-form-item>
<el-col :span="12">
<el-form-item prop="activityGroupId" label="面向对象">
<div style="display: flex; justify-content: space-between">
<div style="width: 99%">
<el-select prop="groupId" placeholder="参与人员范围"
v-model="formData.activityGroupId"
style="width: 99%;"
clearable
filterable>
<el-option v-for="item in activityGroupList"
:label="item.groupName"
:value="item.groupId"
:key="item.groupId"
></el-option>
</el-select>
</div>
<div>
<el-button
@click="$refs.drawerUserScope.userScopeDialog = true"
type="primary">设置
</el-button>
</div>
</div>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="开始时间" prop="startTime">
<el-date-picker v-model="formData.startTime" type="datetime"
placeholder="请选择活动开始时间"
value-format="yyyy-MM-dd HH:mm:ss" style="width: 100%">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="结束时间" prop="endTime">
<el-date-picker v-model="formData.endTime" type="datetime"
placeholder="请选择活动结束时间"
value-format="yyyy-MM-dd HH:mm:ss" style="width: 100%">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="内容详情" prop="content">
<text-editor v-model="formData.content"></text-editor>
</el-form-item>
<el-form-item prop="files" label="附件">
<file-upload :upload_number="5" :value.sync="formData.files"
upload_result_type="url"
upload_text="请上传附件"
complete_result upload_mode="drag"
upload_result_category="array"></file-upload>
</el-form-item>
</el-form>
<div slot="footer" style="text-align: right">
<el-button @click="handleClose">取消</el-button>
<el-button @click="doSubmit" type="primary" :loading="submitting">确定</el-button>
</div>
<drawer-user-scope
@group_change="getActivityGroup"
ref="drawerUserScope"
:group_id.sync="formData.activityGroupId"
></drawer-user-scope>
</el-dialog>
`,
components: {
"drawer-user-scope": httpVueLoader("/components/module/activity/DrawerUserScope.vue")
},
data() {
// 日期验证器
const validateDateRange = (rule, value, callback) => {
const { startTime, endTime } = this.formData
if (rule.field === "endTime" && startTime && endTime) {
if (new Date(endTime) <= new Date(startTime)) {
callback(new Error("结束时间必须晚于开始时间"))
return
}
}
callback()
}
return {
visible: false,
submitting: false,
formData: {},
activityGroupList: [],
formRules: {
projectName: [
{ required: true, message: "请输入事项名称", trigger: "blur" },
{ min: 1, max: 50, message: "长度在 1 到 50 个字符", trigger: "blur" }
],
startTime: [
{ required: true, message: "请选择活动开始时间", trigger: "blur" }
],
endTime: [
{ required: true, message: "请选择活动结束时间", trigger: "blur" },
{ validator: validateDateRange, trigger: "blur" }
],
content: [{ required: true, message: "内容详情", trigger: "blur" }]
}
}
},
methods: {
// 处理关闭弹窗
handleClose() {
this.visible = false;
},
// 打开表单
onOpen(id) {
this.visible = true
this.formData = {}
if (id) {
// 如果是编辑模式,加载数据
this.$axios.post("/platform/womanSanitary/project/findOne", { id: id }).then((res) => {
if (res.code === 0) {
this.formData = res.data
}
})
}
},
async getActivityGroup() {
const { data } = await $.get("/platform/activity/basic/scope/getActivityUserScopeGroup")
this.activityGroupList = data
},
async doSubmit() {
const valid = await this.$refs['form'].validate()
if (!valid) return
this.submitting = true
this.$confirm("您确定保存吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.$axios.post('/platform/womanSanitary/project/save', {data: JSON.stringify(this.formData)}).then(res => {
if (res.code === 0) {
this.visible = false
this.$message.success(res.msg)
this.submitting = false
// 通过 $emit 触发父组件的刷新方法
this.$emit('refresh')
}
})
}).catch(() => {
this.submitting = false;
})
}
},
async created() {
await this.getActivityGroup()
}
}
@@ -0,0 +1,51 @@
const projectInfo = {
template: /*language=HTML*/ `
<div>
<div class="process-title">事项信息</div>
<el-descriptions :column="2" border class="flow-task-form">
<el-descriptions-item label="年度">{{viewData.year}}</el-descriptions-item>
<el-descriptions-item label="事项名称">{{viewData.projectName}}</el-descriptions-item>
<el-descriptions-item label="开始时间">{{viewData.startTime}}</el-descriptions-item>
<el-descriptions-item label="结束时间">{{viewData.endTime}}</el-descriptions-item>
<el-descriptions-item label="详细信息" :span="2">
<div v-html="stripHtmlTags(viewData.content)"></div>
</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>
</div>
`,
store,
data() {
return {
visible: false,
viewData: {},
row: null
}
},
methods: {
// 打开
onOpen(projectId) {
this.projectId = projectId
this.visible = true
this.getInfo()
},
// 获取申请信息
getInfo() {
this.$axios.post('/platform/womanSanitary/project/findOne', {id: this.projectId}).then((res) => {
if (res.code === 0) {
this.viewData = res.data
}
})
},
// 去除HTML标签的方法
stripHtmlTags(html) {
if (!html) return '';
// 去除所有HTML标签
return html.replace(/<[^>]*>/g, '');
}
}
}
@@ -0,0 +1,189 @@
<!--#
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-input placeholder="请输入姓名或工号" clearable v-model="pageForm.searchKeyword"></el-input>
</search-item>
<search-item label="性别">
<el-select v-model="pageForm.sex" placeholder="请选择性别" clearable style="width: 100%">
<el-option label="男" value="男"></el-option>
<el-option label="女" value="女"></el-option>
</el-select>
</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>
</el-card>
<el-card shadow="never">
<table-tool>
<el-button type="primary" size="small" icon="el-icon-upload2" @click="openImport">导入人员</el-button>
<el-button type="primary" size="small" @click="isIssue">确认发放</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="sex" 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="mobile" label="联系方式"></el-table-column>
<el-table-column prop="money" label="发放金额"></el-table-column>
<el-table-column prop="issue" label="是否发放">
<template slot-scope="{row}">
<span :style="{color: row.issue ? '#67C23A' : ''}">{{ row.issue ? '已发放' : '未发放' }}</span>
</template>
</el-table-column>
<el-table-column prop="applyTime" label="录入时间"></el-table-column>
<el-table-column label="操作" fixed="right" width="300px">
<template slot-scope="{row}">
<el-button
@click="setIssue(row.id)"
size="mini"
:type="row.issue ? 'info' : 'primary'">
{{ row.issue ? '设置未发放' : '设置发放' }}</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>
<el-dialog title="人员导入" :visible.sync="importDialog" width="50%" :close-on-click-modal="false" :close-on-press-escape="false">
<file-import
ref="viewImport"
temp_url="/platform/womanSanitary/manage/downloadTemplate"
post_url="/platform/womanSanitary/manage/importData"
@flush="successImport"
></file-import>
</el-dialog>
</guava>
</div>
<script>
new Vue({
el: "#app",
store,
//分页数据
mixins: [initTableMixins],
data() {
return {
pageDataUrl: "/platform/womanSanitary/manage/pageData",
unionOptions: [],
unitOptions: [],
userOptions: [],
importDialog: false,
checkedFields: []
}
},
components: {
"file-import": httpVueLoader("/components/plugins/sysImport/index.vue?v=" + new Date().getTime())
},
methods: {
openImport() {
this.importDialog = true
},
successImport() {
this.importDialog = false
this.pageData()
},
setIssue(id) {
// 根据ID找到对应的行数据
const row = this.tableData.find(item => item.id === id);
if (!row) return;
// 切换发放状态
const newIssueStatus = !row.issue;
// 修复:确保actionText变量正确定义
const actionText = newIssueStatus ? '发放' : '取消发放';
this.$axios.post("/platform/womanSanitary/manage/setIssue", {
id: id,
issue: newIssueStatus
}).then((res) => {
if (res.code === 0) {
this.$message.success(`成功`);
// 更新表格数据中的状态
row.issue = newIssueStatus;
} else {
this.$message.error(res.msg || `失败`);
}
}).catch(() => {
this.$message.error(`请求失败`);
});
},
isIssue() {
// 确认发放所有列表数据
this.$confirm("您确定要发放所有显示的数据吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.$axios.post("/platform/womanSanitary/manage/batchIssue").then((res) => {
if (res.code === 0) {
this.$message.success("发放成功");
this.pageData(); // 重新加载数据
} else {
this.$message.error(res.msg || "发放失败");
}
}).catch(() => {
this.$message.error("发放请求失败");
});
}).catch(() => {
// 用户取消操作
});
},
onDelete(id) {
this.$confirm("您确定要删除吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.$axios.post("/platform/womanSanitary/manage/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,121 @@
<!--#
layout("/layouts/platform.html"){
#-->
<div id="app" v-cloak>
<el-card shadow="never">
<search @search="doSearch">
<search-item label="年度">
<el-date-picker placeholder="请选择年度" type="year" style="width: 100%" v-model="pageForm.year" value-format="yyyy"></el-date-picker>
</search-item>
<search-item label="事项名称">
<el-input placeholder="请输入事项名称查询" clearable v-model="pageForm.searchKeyword"></el-input>
</search-item>
</search>
</el-card>
<el-card shadow="never">
<table-tool>
<el-button size="mini" type="primary" icon="el-icon-plus" @click="openAdd">新增</el-button>
</table-tool>
<el-table :data="tableData">
<el-table-column type="index" width="50px" label="序号" :index="indexMethod"></el-table-column>
<el-table-column prop="projectName" label="事项名称" show-overflow-tooltip></el-table-column>
<el-table-column prop="year" label="年度" show-overflow-tooltip></el-table-column>
<el-table-column prop="startTime" label="开始时间"></el-table-column>
<el-table-column prop="endTime" label="结束时间"></el-table-column>
<!-- <el-table-column prop="isOpen" label="是否发布">-->
<!-- <template slot-scope="{row}">-->
<!-- <el-switch @change="switchChange(row)" active-color="#13ce66"-->
<!-- inactive-color="#ff4949"-->
<!-- v-model="row.isOpen"></el-switch>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="操作" width="200px" fixed="right">
<template slot-scope="{row}">
<el-button size="mini" type="primary" @click="openEdit(row)">编辑</el-button>
<el-button size="mini" type="danger" @click="onDelete(row.id)">删除</el-button>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
<form-edit ref="formEditRef" @refresh="doSearch"></form-edit>
</div>
<script>
<!--#include('../common/formEdit.js'){}#-->
new Vue({
el: "#app",
mixins: [initTableMixins],
components: {
"form-edit": formEdit
},
data() {
return {
pageForm: {
year: moment().format('YYYY') + "",
},
}
},
methods: {
pageData() {
this.tableLoading = true
this.$axios
.post("/platform/womanSanitary/project/pageData", this.pageForm)
.then((res) => {
if (res.code === 0) {
this.tableData = res.data.list
this.pageForm.totalCount = res.data.totalCount
}
})
.finally(() => {
this.tableLoading = false
})
},
openAdd() {
this.$refs.formEditRef.onOpen()
},
openEdit(row) {
this.$refs.formEditRef.onOpen(row.id)
},
async switchChange(row) {
const resp = await this.$axios.post("/platform/womanSanitary/project/switchChange", row)
if (resp.code === 0) {
this.pageData()
this.$message.success(resp.msg)
} else {
this.$message.warning(resp.msg)
}
},
onDelete(id) {
// 查找当前行数据以获取关联人员数
const row = this.tableData.find(item => item.id === id);
let msg = row && row.count > 0 ? '该事项下有' + row.count + '条数据,' : ''
this.$confirm(msg + "您确定要删除吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(async () => {
const { code, msg } = await this.$axios.post("/platform/womanSanitary/project/delete", { id: id })
if (code === 0) {
this.$message.success(msg)
this.doSearch()
}
})
.catch(() => {})
}
},
created() {
this.pageData()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,118 @@
<!--#
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-input placeholder="请输入姓名或工号" clearable v-model="pageForm.searchKeyword"></el-input>
</search-item>
<search-item label="性别">
<el-select v-model="pageForm.sex" placeholder="请选择性别" clearable style="width: 100%">
<el-option label="男" value="男"></el-option>
<el-option label="女" value="女"></el-option>
</el-select>
</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>
</el-card>
<el-card shadow="never">
<table-tool>
<el-button type="primary" size="small" @click="">导出</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="sex" 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="money" label="发放金额"></el-table-column>
<el-table-column prop="issue" label="是否发放"></el-table-column>
<el-table-column prop="applyTime" label="录入时间"></el-table-column>
<el-table-column label="操作" fixed="right" width="300px">
<template slot-scope="{row}">
<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>
</guava>
</div>
<script>
new Vue({
el: "#app",
store,
//分页数据
mixins: [initTableMixins],
data() {
return {
pageDataUrl: "/platform/womanSanitary/query/pageData",
unionOptions: [],
unitOptions: [],
userOptions: [],
importDialog: false,
checkedFields: []
}
},
methods: {
// isIssue() {
// },
onDelete(id) {
this.$confirm("您确定要删除吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.$axios.post("/platform/exerciseCard/query/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>
<!--#
}
#-->
@@ -9,15 +9,15 @@ const DSZNFMTX_INFO = {
<el-descriptions :column="3" border class="flow-task-form">
<el-descriptions-item label="职工姓名">{{viewData.userName}}</el-descriptions-item>
<el-descriptions-item label="性别">{{viewData.sex}}</el-descriptions-item>
<el-descriptions-item label="出生年月">{{formatDate(viewData.birthday)}}</el-descriptions-item>
<el-descriptions-item label="出生年月">{{$moment(viewData.birthday).format('YYYY-MM-DD')}}</el-descriptions-item>
<el-descriptions-item label="原工作单位">{{viewData.unitName}}</el-descriptions-item>
<el-descriptions-item label="退休时间" >{{formatDate(viewData.retireTime)}}</el-descriptions-item>
<el-descriptions-item label="退休时间" >{{$moment(viewData.retireTime).format('YYYY-MM-DD')}}</el-descriptions-item>
<el-descriptions-item label="爱人姓名">{{viewData.loverName}}</el-descriptions-item>
<el-descriptions-item label="性别">{{viewData.loverSex}}</el-descriptions-item>
<el-descriptions-item label="工作单位" :span="2">{{viewData.loverUnitName}}</el-descriptions-item>
<el-descriptions-item label="结婚日期">{{formatDate(viewData.marryTime)}}</el-descriptions-item>
<el-descriptions-item label="子女出生日">{{formatDate(viewData.childrenBirthday)}}</el-descriptions-item>
<el-descriptions-item label="领独生子女证时间">{{formatDate(viewData.getCertificateTime)}}</el-descriptions-item>
<el-descriptions-item label="结婚日期">{{$moment(viewData.marryTime).format('YYYY-MM-DD')}}</el-descriptions-item>
<el-descriptions-item label="子女出生日">{{$moment(viewData.childrenBirthday).format('YYYY-MM-DD')}}</el-descriptions-item>
<el-descriptions-item label="领独生子女证时间">{{$moment(viewData.getCertificateTime).format('YYYY-MM-DD')}}</el-descriptions-item>
<el-descriptions-item label="独生子女光荣证号">{{viewData.childrenGraceNumber}}</el-descriptions-item>
<el-descriptions-item label="办证机关">{{viewData.office}}</el-descriptions-item>
<el-descriptions-item label="奖励金额">{{viewData.bonus}}</el-descriptions-item>
@@ -88,32 +88,6 @@ const DSZNFMTX_INFO = {
}
},
methods: {
// 添加日期格式化方法
formatDate(date) {
if (!date) return '';
// 如果已经是 yyyy-MM-dd 格式,直接返回
if (typeof date === 'string' && /^\d{4}-\d{2}-\d{2}/.test(date)) {
// 如果包含时间,只取日期部分
if (date.length > 10) {
return date.substring(0, 10);
}
return date;
}
// 否则转换为 yyyy-MM-dd 格式
try {
const d = new Date(date);
if (isNaN(d.getTime())) {
return date;
}
const year = d.getFullYear();
const month = String(d.getMonth() + 1).padStart(2, '0');
const day = String(d.getDate()).padStart(2, '0');
return year + '-' + month + '-' + day;
} catch (e) {
return date;
}
},
// 打开
onOpen(row) {
this.row = row
@@ -12,7 +12,7 @@ layout("/layouts/platform.html"){
<el-descriptions-item label="职工姓名">{{formData.userName}}</el-descriptions-item>
<el-descriptions-item label="性别">{{formData.sex}}</el-descriptions-item>
<el-descriptions-item label="民族">{{formData.nation}}</el-descriptions-item>
<el-descriptions-item label="出生年月">{{formatDate(formData.birthday)}}</el-descriptions-item>
<el-descriptions-item label="出生年月">{{$moment(formData.birthday).format('YYYY-MM-DD')}}</el-descriptions-item>
<el-descriptions-item label="工作单位" >{{formData.unitName}}</el-descriptions-item>
<el-descriptions-item label="电话" >{{formData.mobile}}</el-descriptions-item>
@@ -253,31 +253,6 @@ layout("/layouts/platform.html"){
}
},
methods: {
// 添加日期格式化方法
formatDate(date) {
if (!date) return '';
// 如果已经是 yyyy-MM-dd 格式,直接返回
if (typeof date === 'string' && /^\d{4}-\d{2}-\d{2}/.test(date)) {
// 如果包含时间,只取日期部分
if (date.length > 10) {
return date.substring(0, 10);
}
return date;
}
// 否则转换为 yyyy-MM-dd 格式
try {
const d = new Date(date);
if (isNaN(d.getTime())) {
return date;
}
const year = d.getFullYear();
const month = String(d.getMonth() + 1).padStart(2, '0');
const day = String(d.getDate()).padStart(2, '0');
return year + '-' + month + '-' + day;
} catch (e) {
return date;
}
},
// 计算休假时间止
calculateEndTime() {
// 如果是男性,则不自动计算结束时间
@@ -10,13 +10,14 @@ const maternityLeaveInfo = {
<el-descriptions-item label="职工姓名">{{viewData.userName}}</el-descriptions-item>
<el-descriptions-item label="性别">{{viewData.sex}}</el-descriptions-item>
<el-descriptions-item label="民族">{{viewData.nation}}</el-descriptions-item>
<el-descriptions-item label="出生年月">{{formatDate(viewData.birthday)}}</el-descriptions-item> <el-descriptions-item label="单位">{{viewData.unitName}}</el-descriptions-item>
<el-descriptions-item label="出生年月">{{$moment(viewData.birthday).format('YYYY-MM-DD')}}</el-descriptions-item>
<el-descriptions-item label="单位">{{viewData.unitName}}</el-descriptions-item>
<el-descriptions-item label="电话">{{viewData.mobile}}</el-descriptions-item>
<el-descriptions-item label="爱人姓名">{{viewData.loverName}}</el-descriptions-item>
<el-descriptions-item label="性别">{{viewData.loverSex}}</el-descriptions-item>
<el-descriptions-item label="民族">{{viewData.loverNation}}</el-descriptions-item>
<el-descriptions-item label="出生年月">{{formatDate(viewData.loverBirthday)}}</el-descriptions-item> <el-descriptions-item label="单位" span="2">{{viewData.loverUnitName}}</el-descriptions-item>
<el-descriptions-item label="出生年月">{{$moment(viewData.loverBirthday).format('YYYY-MM-DD')}}</el-descriptions-item> <el-descriptions-item label="单位" span="2">{{viewData.loverUnitName}}</el-descriptions-item>
</el-descriptions>
<table-tool label="假期类型"></table-tool>
<el-descriptions :column="2" border class="flow-task-form">
@@ -42,9 +43,9 @@ const maternityLeaveInfo = {
<el-descriptions-item label="暑假">{{viewData.summerLeave}}</el-descriptions-item>
<el-descriptions-item label="合计" :span="2">{{viewData.leaveDays}}</el-descriptions-item>
<el-descriptions-item label="休假时间起">{{formatDate(viewData.startTime)}}</el-descriptions-item>
<el-descriptions-item label="休假时间止">{{formatDate(viewData.endTime)}}</el-descriptions-item>
<el-descriptions-item label="子女出生日">{{formatDate(viewData.childrenBirthday)}}</el-descriptions-item>
<el-descriptions-item label="休假时间起">{{$moment(viewData.startTime).format('YYYY-MM-DD')}}</el-descriptions-item>
<el-descriptions-item label="休假时间止">{{$moment(viewData.endTime).format('YYYY-MM-DD')}}</el-descriptions-item>
<el-descriptions-item label="子女出生日">{{$moment(viewData.childrenBirthday).format('YYYY-MM-DD')}}</el-descriptions-item>
</el-descriptions>
<template v-for="task in doneTasks">
@@ -107,32 +108,6 @@ const maternityLeaveInfo = {
this.getDoneTasks()
},
// 添加日期格式化方法
formatDate(date) {
if (!date) return '';
// 如果已经是 yyyy-MM-dd 格式,直接返回
if (typeof date === 'string' && /^\d{4}-\d{2}-\d{2}/.test(date)) {
// 如果包含时间,只取日期部分
if (date.length > 10) {
return date.substring(0, 10);
}
return date;
}
// 否则转换为 yyyy-MM-dd 格式
try {
const d = new Date(date);
if (isNaN(d.getTime())) {
return date;
}
const year = d.getFullYear();
const month = String(d.getMonth() + 1).padStart(2, '0');
const day = String(d.getDate()).padStart(2, '0');
return year + '-' + month + '-' + day;
} catch (e) {
return date;
}
},
// 获取申请信息
getInfo() {
this.$axios.post('/platform/maternityLeave/apply/findOne', {id: this.row.id}).then((res) => {
@@ -10,7 +10,7 @@ const childManageInfo = {
<el-descriptions-item label="入学年份">{{viewData.childrenYear}}</el-descriptions-item>
<el-descriptions-item label="姓名">{{viewData.childrenName}}</el-descriptions-item>
<el-descriptions-item label="身份证号">{{viewData.childrenIdCard}}</el-descriptions-item>
<el-descriptions-item label="出生日期">{{formatDate(viewData.childrenBirthday)}}</el-descriptions-item>
<el-descriptions-item label="出生日期">{{$moment(viewData.childrenBirthday).format('YYYY-MM-DD')}}</el-descriptions-item>
<el-descriptions-item label="性别">{{viewData.childrenSex}}</el-descriptions-item>
<el-descriptions-item label="国籍">{{viewData.childrenCountry}}</el-descriptions-item>
<el-descriptions-item label="就读学校">{{viewData.childrenCurrentSchool}}</el-descriptions-item>
@@ -42,31 +42,6 @@ const childManageInfo = {
this.row = row
this.getInfo()
},
// 添加日期格式化方法
formatDate(date) {
if (!date) return '';
// 如果已经是 yyyy-MM-dd 格式,直接返回
if (typeof date === 'string' && /^\d{4}-\d{2}-\d{2}/.test(date)) {
// 如果包含时间,只取日期部分
if (date.length > 10) {
return date.substring(0, 10);
}
return date;
}
// 否则转换为 yyyy-MM-dd 格式
try {
const d = new Date(date);
if (isNaN(d.getTime())) {
return date;
}
const year = d.getFullYear();
const month = String(d.getMonth() + 1).padStart(2, '0');
const day = String(d.getDate()).padStart(2, '0');
return year + '-' + month + '-' + day;
} catch (e) {
return date;
}
},
// 获取申请信息
getInfo() {
this.$axios.post('/platform/childManage/write/findOne', {id: this.row.id}).then((res) => {
@@ -34,13 +34,13 @@ const UNION_REIMBURSE_INFO = {
<van-cell title="联系方式" v-if="viewData.reimburseProject === 'UNION_REIMBURSE_PROJECT_1'">{{ viewData.condolenceMobile }}</van-cell>
<van-cell title="慰问类型" v-if="viewData.reimburseProject === 'UNION_REIMBURSE_PROJECT_1'">{{ viewData.typeName }}</van-cell>
<van-cell title="慰问金额" v-if="viewData.reimburseProject === 'UNION_REIMBURSE_PROJECT_1'">{{ viewData.money }}</van-cell>
<van-cell title="慰问时间" v-if="viewData.reimburseProject === 'UNION_REIMBURSE_PROJECT_1'">{{ formatDate(viewData.condolenceTime) }}</van-cell>
<van-cell title="慰问时间" v-if="viewData.reimburseProject === 'UNION_REIMBURSE_PROJECT_1'">{{$moment(viewData.condolenceTime).format('YYYY-MM-DD')}}</van-cell>
<van-cell title="活动名称" v-if="viewData.reimburseProject !== 'UNION_REIMBURSE_PROJECT_1'">{{ viewData.activityName }}</van-cell>
<van-cell title="活动类型" v-if="viewData.reimburseProject === 'UNION_REIMBURSE_PROJECT_2'">{{ viewData.activityType }}</van-cell>
<van-cell title="活动人数" v-if="viewData.reimburseProject === 'UNION_REIMBURSE_PROJECT_2'">{{ viewData.activityNumber }}</van-cell>
<van-cell title="活动地点" v-if="viewData.reimburseProject !== 'UNION_REIMBURSE_PROJECT_1'">{{ viewData.activityPlace }}</van-cell>
<van-cell title="报销金额" v-if="viewData.reimburseProject !== 'UNION_REIMBURSE_PROJECT_1'">{{ viewData.money }}</van-cell>
<van-cell title="活动时间" v-if="viewData.reimburseProject !== 'UNION_REIMBURSE_PROJECT_1'">{{ formatDate(viewData.activityTime) }}</van-cell>
<van-cell title="活动时间" v-if="viewData.reimburseProject !== 'UNION_REIMBURSE_PROJECT_1'">{{$moment(viewData.activityTime).format('YYYY-MM-DD')}}</van-cell>
<van-cell title="发票张数" v-if="viewData.reimburseType === 'UNION_REIMBURSE_TYPE_1'">{{ viewData.invoiceNumber }}</van-cell>
<van-cell title="发票号码" v-if="viewData.reimburseType === 'UNION_REIMBURSE_TYPE_1'">{{ viewData.invoice }}</van-cell>
<van-cell title="支付内容">{{ viewData.paymentNotes }}</van-cell>
@@ -111,31 +111,6 @@ const UNION_REIMBURSE_INFO = {
this.getInfo()
this.getDoneTasks()
},
// 添加日期格式化方法
formatDate(date) {
if (!date) return '';
// 如果已经是 yyyy-MM-dd 格式,直接返回
if (typeof date === 'string' && /^\d{4}-\d{2}-\d{2}/.test(date)) {
// 如果包含时间,只取日期部分
if (date.length > 10) {
return date.substring(0, 10);
}
return date;
}
// 否则转换为 yyyy-MM-dd 格式
try {
const d = new Date(date);
if (isNaN(d.getTime())) {
return date;
}
const year = d.getFullYear();
const month = String(d.getMonth() + 1).padStart(2, '0');
const day = String(d.getDate()).padStart(2, '0');
return year + '-' + month + '-' + day;
} catch (e) {
return date;
}
},
// 关闭
onClose(){
this.visible = false
@@ -6,15 +6,15 @@ const DSZNFMTX_INFO = {
<van-cell-group title="基本信息">
<van-cell title="职工姓名">{{ viewData.userName }}</van-cell>
<van-cell title="性别">{{ viewData.sex }}</van-cell>
<van-cell title="出生年月">{{ formatDate(viewData.birthday) }}</van-cell>
<van-cell title="出生年月">{{$moment(viewData.birthday).format('YYYY-MM-DD')}}</van-cell>
<van-cell title="原工作单位">{{ viewData.unitName }}</van-cell>
<van-cell title="退休时间">{{ formatDate(viewData.retireTime) }}</van-cell>
<van-cell title="退休时间">{{$moment(viewData.retireTime).format('YYYY-MM-DD')}}</van-cell>
<van-cell title="爱人姓名">{{ viewData.loverName }}</van-cell>
<van-cell title="性别">{{ viewData.loverSex }}</van-cell>
<van-cell title="工作单位">{{ viewData.loverUnitName }}</van-cell>
<van-cell title="结婚日期">{{ formatDate(viewData.marryTime) }}</van-cell>
<van-cell title="子女出生日">{{ formatDate(viewData.childrenBirthday) }}</van-cell>
<van-cell title="领独生子女光时间">{{ formatDate(viewData.getCertificateTime) }}</van-cell>
<van-cell title="结婚日期">{{$moment(viewData.marryTime).format('YYYY-MM-DD')}}</van-cell>
<van-cell title="子女出生日">{{$moment(viewData.childrenBirthday).format('YYYY-MM-DD')}}</van-cell>
<van-cell title="领独生子女光时间">{{$moment(viewData.getCertificateTime).format('YYYY-MM-DD')}}</van-cell>
<van-cell title="独生子女光荣证号">{{ viewData.childrenGraceNumber }}</van-cell>
<van-cell title="办证机关">{{ viewData.office }}</van-cell>
<van-cell title="奖励金额">{{ viewData.bonus }}</van-cell>
@@ -39,7 +39,7 @@ const DSZNFMTX_INFO = {
{{ task.ext.initiatorName}}({{task.ext.initiatorAccount}})
</van-cell>
<van-cell title="申请时间">
{{ formatDate(task.finishTime) }}
{{task.finishTime}}
</van-cell>
<van-cell title="办理结果">
<dict-tag :options="dict.type.PROCESS_TASK_SUBMIT_TYPE"
@@ -51,7 +51,7 @@ const DSZNFMTX_INFO = {
{{ task.taskFormData.userName}}({{task.taskFormData.loginName}})
</van-cell>
<van-cell title="办理时间">
{{ formatDate(task.finishTime) }}
{{task.finishTime}}
</van-cell>
<van-cell title="办理结果">
<dict-tag :options="dict.type.PROCESS_TASK_SUBMIT_TYPE"
@@ -86,31 +86,6 @@ const DSZNFMTX_INFO = {
}
},
methods: {
// 添加日期格式化方法
formatDate(date) {
if (!date) return '';
// 如果已经是 yyyy-MM-dd 格式,直接返回
if (typeof date === 'string' && /^\d{4}-\d{2}-\d{2}/.test(date)) {
// 如果包含时间,只取日期部分
if (date.length > 10) {
return date.substring(0, 10);
}
return date;
}
// 否则转换为 yyyy-MM-dd 格式
try {
const d = new Date(date);
if (isNaN(d.getTime())) {
return date;
}
const year = d.getFullYear();
const month = String(d.getMonth() + 1).padStart(2, '0');
const day = String(d.getDate()).padStart(2, '0');
return year + '-' + month + '-' + day;
} catch (e) {
return date;
}
},
onOpen(row) {
this.row = row
@@ -7,13 +7,13 @@ const MATERNITY_LEAVE_INFO = {
<van-cell title="职工姓名">{{ viewData.userName }}</van-cell>
<van-cell title="性别">{{ viewData.sex }}</van-cell>
<van-cell title="民族">{{ viewData.nation }}</van-cell>
<van-cell title="出生年月">{{ formatDate(viewData.birthday) }}</van-cell>
<van-cell title="出生年月">{{$moment(viewData.birthday).format('YYYY-MM-DD')}}</van-cell>
<van-cell title="单位">{{ viewData.unitName }}</van-cell>
<van-cell title="电话">{{ viewData.mobile }}</van-cell>
<van-cell title="爱人姓名">{{ viewData.loverName }}</van-cell>
<van-cell title="性别">{{ viewData.loverSex }}</van-cell>
<van-cell title="民族">{{ viewData.loverNation }}</van-cell>
<van-cell title="出生年月">{{ formatDate(viewData.loverBirthday) }}</van-cell>
<van-cell title="出生年月">{{$moment(viewData.loverBirthday).format('YYYY-MM-DD')}}</van-cell>
<van-cell title="单位">{{ viewData.loverUnitName }}</van-cell>
</van-cell-group>
@@ -27,9 +27,9 @@ const MATERNITY_LEAVE_INFO = {
<van-cell title="寒假">{{ viewData.winterLeave }}</van-cell>
<van-cell title="暑假">{{ viewData.summerLeave }}</van-cell>
<van-cell title="合计">{{ viewData.leaveDays }}</van-cell>
<van-cell title="休假时间起">{{ formatDate(viewData.startTime) }}</van-cell>
<van-cell title="休假时间止">{{ formatDate(viewData.endTime) }}</van-cell>
<van-cell title="子女出生日">{{ formatDate(viewData.childrenBirthday) }}</van-cell>
<van-cell title="休假时间起">{{$moment(viewData.startTime).format('YYYY-MM-DD')}}</van-cell>
<van-cell title="休假时间止">{{$moment(viewData.endTime).format('YYYY-MM-DD')}}</van-cell>
<van-cell title="子女出生日">{{$moment(viewData.childrenBirthday).format('YYYY-MM-DD')}}</van-cell>
</van-cell-group>
@@ -89,31 +89,6 @@ const MATERNITY_LEAVE_INFO = {
}
},
methods: {
// 添加日期格式化方法
formatDate(date) {
if (!date) return '';
// 如果已经是 yyyy-MM-dd 格式,直接返回
if (typeof date === 'string' && /^\d{4}-\d{2}-\d{2}/.test(date)) {
// 如果包含时间,只取日期部分
if (date.length > 10) {
return date.substring(0, 10);
}
return date;
}
// 否则转换为 yyyy-MM-dd 格式
try {
const d = new Date(date);
if (isNaN(d.getTime())) {
return date;
}
const year = d.getFullYear();
const month = String(d.getMonth() + 1).padStart(2, '0');
const day = String(d.getDate()).padStart(2, '0');
return year + '-' + month + '-' + day;
} catch (e) {
return date;
}
},
onOpen(row) {
this.row = row
this.visible = true
@@ -11,7 +11,7 @@
</dict-tag></van-cell>
<van-cell title="入学年份">{{ viewData.childrenYear }}</van-cell>
<van-cell title="身份证号">{{ viewData.childrenIdCard }}</van-cell>
<van-cell title="出生日期">{{ formatDate(viewData.childrenBirthday) }}</van-cell>
<van-cell title="出生日期">{{$moment(viewData.childrenBirthday).format('YYYY-MM-DD')}}</van-cell>
<van-cell title="性别">{{ viewData.childrenSex }}</van-cell>
<van-cell title="国籍">{{ viewData.childrenCountry }}</van-cell>
<van-cell title="就读学校">{{ viewData.childrenCurrentSchool }}</van-cell>
@@ -50,31 +50,6 @@
this.visible = true
this.getInfo()
},
// 添加日期格式化方法
formatDate(date) {
if (!date) return '';
// 如果已经是 yyyy-MM-dd 格式,直接返回
if (typeof date === 'string' && /^\d{4}-\d{2}-\d{2}/.test(date)) {
// 如果包含时间,只取日期部分
if (date.length > 10) {
return date.substring(0, 10);
}
return date;
}
// 否则转换为 yyyy-MM-dd 格式
try {
const d = new Date(date);
if (isNaN(d.getTime())) {
return date;
}
const year = d.getFullYear();
const month = String(d.getMonth() + 1).padStart(2, '0');
const day = String(d.getDate()).padStart(2, '0');
return year + '-' + month + '-' + day;
} catch (e) {
return date;
}
},
// 关闭
onClose(){
this.visible = false