Merge remote-tracking branch 'origin/main'

This commit is contained in:
@jyuhsin
2025-09-19 17:18:42 +08:00
51 changed files with 3965 additions and 332 deletions
@@ -75,7 +75,12 @@ public class ActivityWorksCollectionReadController {
up.*,
co.NAME AS activityName,
su.typeName AS subjectName,
wo.worksTypeName AS worksName
wo.worksTypeName AS worksName,
(
SELECT COUNT(*)
FROM activity_works_collection_upload_like_num likeNum
WHERE likeNum.uploadId = up.id
) AS num
from
activity_works_collection_upload up
LEFT JOIN activity_works_collection co ON up.activityId = co.id
@@ -99,6 +104,7 @@ public class ActivityWorksCollectionReadController {
if(!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())) {
cnd.and("up.unionId", "=", SecurityUtil.getUnionId());
}
cnd.desc("up.createdAt");
sql.setCondition(cnd);
Pagination pagination = baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
return Result.success(pagination);
@@ -121,7 +127,12 @@ public class ActivityWorksCollectionReadController {
co.NAME AS activityName,
su.typeName AS subjectName,
wo.worksTypeName AS worksName,
u.sex
u.sex,
(
SELECT COUNT(*)
FROM activity_works_collection_upload_like_num likeNum
WHERE likeNum.uploadId = up.id
) AS num
from
activity_works_collection_upload up
LEFT JOIN activity_works_collection co ON up.activityId = co.id
@@ -145,6 +156,7 @@ public class ActivityWorksCollectionReadController {
if(!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())) {
cnd.and("up.unionId", "=", SecurityUtil.getUnionId());
}
cnd.desc("num");
sql.setCondition(cnd);
List<NutMap> listMap = baseService.listMap(sql);
@@ -159,7 +171,7 @@ public class ActivityWorksCollectionReadController {
exportEntities.add(new ExcelExportEntity("作品类型", "worksName", 20));
exportEntities.add(new ExcelExportEntity("作品名称", "name", 20));
exportEntities.add(new ExcelExportEntity("作品描述", "description", 20));
//exportEntities.add(new ExcelExportEntity("点赞次数", "dz_num", 20));
exportEntities.add(new ExcelExportEntity("点赞次数", "num", 20));
try {
ExportParams exportParams = new ExportParams();
@@ -1,12 +1,10 @@
package com.budwk.app.zhgh.activity.workscollection.controller;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.date.DateUtil;
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.service.BaseService;
import com.budwk.app.sys.models.Sys_user;
import com.budwk.app.sys.views.View_user;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.zhgh.activity.basic.models.ActivityUserScope;
@@ -27,7 +25,6 @@ import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import javax.validation.Valid;
import java.util.Date;
import java.util.List;
/**
@@ -50,6 +47,8 @@ public class ActivityWorksCollectionUploadController {
public void index() {
}
/**
* @param pageForm 分页
* @param activityId 活动id
@@ -63,6 +62,8 @@ public class ActivityWorksCollectionUploadController {
select
up.*,
co.NAME AS activityName,
co.startDateTime AS activityStartDateTime,
co.endDateTime AS activityEndDateTime,
su.typeName AS subjectName,
wo.worksTypeName AS worksName
from
@@ -78,6 +79,7 @@ public class ActivityWorksCollectionUploadController {
cnd.andEX("up.activityId", "=", activityId);
cnd.andEX("up.subjectId", "=", subjectId);
cnd.andEX("up.worksId", "=", worksId);
cnd.desc("up.createdAt");
sql.setCondition(cnd);
Pagination pagination = baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
return Result.success(pagination);
@@ -91,8 +93,12 @@ public class ActivityWorksCollectionUploadController {
@At
@SaCheckPermission("activity.workscollection.upload")
public Result insert(@Param("data") @Valid Activity_works_collection_upload upload) {
String activityId = upload.getActivityId();
Activity_works_collection activity = dao.fetch(Activity_works_collection.class, activityId);
if (activity.getEndDateTime().getTime() < System.currentTimeMillis()){
return Result.error("活动已结束!");
}
if (activity.getActivityGroupId() != null) {
int count = dao.count(ActivityUserScope.class, Cnd.where(ActivityUserScope::getGroupId, "=", activity.getActivityGroupId())
.and(ActivityUserScope::getUserId, "=", SecurityUtil.getUserId()));
@@ -119,6 +125,10 @@ public class ActivityWorksCollectionUploadController {
@At
@SaCheckPermission("activity.workscollection.upload")
public Result update(@Param("data") @Valid Activity_works_collection_upload upload) {
Activity_works_collection activity = dao.fetch(Activity_works_collection.class, upload.getActivityId());
if (activity.getEndDateTime().getTime() < System.currentTimeMillis()){
return Result.error("活动已结束!");
}
dao.updateIgnoreNull(upload);
return Result.success();
}
@@ -133,6 +143,11 @@ public class ActivityWorksCollectionUploadController {
@At
@SaCheckPermission("activity.workscollection.upload")
public Result delete(@Valid String id) {
Activity_works_collection_upload upload = dao.fetch(Activity_works_collection_upload.class, id);
Activity_works_collection activity = dao.fetch(Activity_works_collection.class, upload.getActivityId());
if (activity.getEndDateTime().getTime() < System.currentTimeMillis()){
return Result.error("活动已结束!");
}
dao.delete(Activity_works_collection_upload.class, id);
return Result.success();
}
@@ -1,42 +0,0 @@
package com.budwk.app.zhgh.activity.workscollection.controller.h5;
import cn.dev33.satoken.annotation.SaCheckPermission;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
/**
* 手机端作品征集
*/
@IocBean
@At("/platform/h5/activity/worksCollection")
@Ok("json:full")
public class H5ActivityWorksCollectionController {
/**
* 活动列表页面
*/
@At("/activity")
@Ok("beetl:/platform/zhghh5/activity/workscollection/activity/index.html")
@SaCheckPermission("activity.workscollection.upload")
public void activity() {
}
/**
* 上传页面
*/
@At("/upload")
@Ok("beetl:/platform/zhghh5/activity/workscollection/upload/index.html")
@SaCheckPermission("activity.workscollection.upload")
public void upload() {
}
/**
* 我的上传页面
*/
@At("/upload/mine")
@Ok("beetl:/platform/zhghh5/activity/workscollection/upload/mine.html")
@SaCheckPermission("activity.workscollection.upload")
public void uploadMine() {
}
}
@@ -0,0 +1,36 @@
package com.budwk.app.zhgh.activity.workscollection.controller.h5;
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.budwk.app.base.service.BaseService;
import io.swagger.annotations.ApiOperation;
import org.nutz.dao.Dao;
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;
/**
* @author zhf
* @date 2025/9/16 08:54
* @description 我的作品
*/
@IocBean
@At("/platform/activity/worksCollection/mine/h5")
@Ok("json:full")
@ApiOperation("手机端我的作品")
public class H5ActivityWorksMineCollectionController {
@Inject
private BaseService baseService;
@Inject
private Dao dao;
@At("")
@Ok("beetl:/platform/zhghh5/activity/workscollection/mine/index.html")
@SaCheckPermission("h5.activity.workscollection.mine")
public void index() {
}
}
@@ -0,0 +1,158 @@
package com.budwk.app.zhgh.activity.workscollection.controller.h5;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.date.DateUtil;
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.result.Result;
import com.budwk.app.base.service.BaseService;
import com.budwk.app.sys.views.View_user;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.zhgh.activity.workscollection.models.Activity_works_collection;
import com.budwk.app.zhgh.activity.workscollection.models.Activity_works_collection_upload;
import com.budwk.app.zhgh.activity.workscollection.models.Activity_works_collection_upload_like_num;
import com.budwk.app.zhgh.activity.workscollection.param.ActivityWorksCollectionReadPageParam;
import io.swagger.annotations.ApiOperation;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.dao.util.cri.SqlExpressionGroup;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import javax.validation.Valid;
/**
* @author zhf
* @date 2025/9/18 10:00
* @description
*/
@IocBean
@At("/platform/activity/worksCollection/read/h5")
@Ok("json:full")
@ApiOperation("手机端作品阅览")
public class H5ActivityWorksReadCollectionController {
@Inject
private BaseService baseService;
@Inject
private Dao dao;
@At("")
@Ok("beetl:/platform/zhghh5/activity/workscollection/read/index.html")
@SaCheckPermission("h5.activity.workscollection.read")
public void index() {
}
@At
@SaCheckPermission("h5.activity.workscollection.read")
public Result pageData(@Valid ActivityWorksCollectionReadPageParam pageForm) {
Sql sql = Sqls.create("""
select
up.*,
co.NAME AS activityName,
co.nbCount,
su.typeName AS subjectName,
wo.worksTypeName AS worksName,
(
SELECT COUNT(*)
FROM activity_works_collection_upload_like_num likeNum
WHERE likeNum.uploadId = up.id
) AS num,
EXISTS(
SELECT 1
FROM activity_works_collection_upload_like_num thisLikeNum
WHERE thisLikeNum.uploadId = up.id
AND thisLikeNum.userId = @userId
) AS isThisLike
from
activity_works_collection_upload up
LEFT JOIN activity_works_collection co ON up.activityId = co.id
LEFT JOIN activity_works_subjecttype su ON up.subjectId = su.id
LEFT JOIN activity_works_workstype wo ON up.worksId = wo.id
$condition
""").setParam("userId", SecurityUtil.getUserId());
Cnd cnd = Cnd.NEW();
cnd.andEX("YEAR(co.startDateTime)", "=", pageForm.getYear());
cnd.andEX("up.activityId", "=", pageForm.getActivityId());
cnd.andEX("up.subjectId", "=", pageForm.getSubjectId());
cnd.andEX("up.worksId", "=", pageForm.getWorksId());
cnd.andEX("unionId", "=", pageForm.getUnionId());
cnd.andEX("unitId", "=", pageForm.getUnitId());
if (StrUtil.isAllNotBlank(pageForm.getSearchKeyword())) {
SqlExpressionGroup seg = new SqlExpressionGroup();
seg.orLike("userName", pageForm.getSearchKeyword());
seg.orLike("loginName", pageForm.getSearchKeyword());
cnd.and(seg);
}
if (pageForm.getPageOrderName().equals("num")) {
cnd.desc(pageForm.getPageOrderName()).asc("createdAt");
} else {
cnd.asc(pageForm.getPageOrderName());
}
sql.setCondition(cnd);
Pagination pagination = baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
return Result.success(pagination);
}
@At
@ApiOperation("点赞")
@SLog(tag = "作品点赞", msg = "作品Id:${uploadId}")
@SaCheckPermission("h5.activity.workscollection.read")
public Result doLike(@Valid String uploadId) {
Activity_works_collection_upload upload = dao.fetch(Activity_works_collection_upload.class, uploadId);
Activity_works_collection activity = dao.fetch(Activity_works_collection.class, upload.getActivityId());
if (activity.getNbStartDateTime().getTime() > System.currentTimeMillis()) {
return Result.error("点赞未开始!开始时间:" + DateUtil.format(activity.getNbStartDateTime(), "yyyy-MM-dd HH:mm:ss"));
}
if (activity.getNbEndDateTime().getTime() < System.currentTimeMillis()) {
return Result.error("点赞已结束!结束时间:" + DateUtil.format(activity.getNbEndDateTime(), "yyyy-MM-dd HH:mm:ss"));
}
int count = dao.count(Activity_works_collection_upload_like_num.class,
Cnd.where(Activity_works_collection_upload_like_num::getActivityId, "=", activity.getId())
.and("DATE(FROM_UNIXTIME(createdAt / 1000))", "=", DateUtil.today())
.and(Activity_works_collection_upload_like_num::getUserId, "=", SecurityUtil.getUserId()));
if (count >= activity.getNbCount()) {
return Result.error("当前活动每天只能点赞" + activity.getNbCount() + "次!");
}
View_user vwUser = dao.fetch(View_user.class, Cnd.where(View_user::getId, "=", SecurityUtil.getUserId()));
Activity_works_collection_upload_like_num likeNum = new Activity_works_collection_upload_like_num();
likeNum.setUploadId(uploadId);
likeNum.setActivityId(activity.getId());
likeNum.setUserId(SecurityUtil.getUserId());
likeNum.setUserName(SecurityUtil.getUserUsername());
likeNum.setLoginName(SecurityUtil.getUserLoginname());
likeNum.setUnitId(SecurityUtil.getUnitId());
likeNum.setUnitName(vwUser.getUnitName());
likeNum.setUnionId(SecurityUtil.getUnionId());
likeNum.setUnionName(vwUser.getUnionName());
dao.insert(likeNum);
return Result.success();
}
@At
@ApiOperation("取消点赞")
@SaCheckPermission("h5.activity.workscollection.read")
public Result doDeleteLike(@Valid String uploadId) {
Activity_works_collection_upload upload = dao.fetch(Activity_works_collection_upload.class, uploadId);
Activity_works_collection activity = dao.fetch(Activity_works_collection.class, upload.getActivityId());
if (activity.getNbStartDateTime().getTime() > System.currentTimeMillis()) {
return Result.error("点赞未开始!开始时间:" + DateUtil.format(activity.getNbStartDateTime(), "yyyy-MM-dd HH:mm:ss"));
}
if (activity.getNbEndDateTime().getTime() < System.currentTimeMillis()) {
return Result.error("点赞已结束!结束时间:" + DateUtil.format(activity.getNbEndDateTime(), "yyyy-MM-dd HH:mm:ss"));
}
dao.clear(Activity_works_collection_upload_like_num.class,
Cnd.where(Activity_works_collection_upload_like_num::getUploadId, "=", uploadId)
.and(Activity_works_collection_upload_like_num::getUserId, "=", SecurityUtil.getUserId()));
return Result.success();
}
}
@@ -0,0 +1,79 @@
package com.budwk.app.zhgh.activity.workscollection.controller.h5;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.dev33.satoken.annotation.SaMode;
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.service.BaseService;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import io.swagger.annotations.ApiOperation;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.dao.util.cri.Static;
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;
/**
* 手机端作品征集
*/
@IocBean
@At("/platform/activity/worksCollection/upload/h5")
@Ok("json:full")
@ApiOperation("手机端作品征集")
public class H5ActivityWorksUploadCollectionController {
@Inject
private BaseService baseService;
@Inject
private Dao dao;
@At("")
@Ok("beetl:/platform/zhghh5/activity/workscollection/upload/index.html")
@SaCheckPermission("h5.activity.workscollection.upload")
public void index() {
}
@At
@ApiOperation("活动查询")
@SaCheckPermission(value = {"h5.activity.workscollection.upload"}, mode = SaMode.OR)
public Result activityPageData(PageForm pageForm,
@Param(value = "year") Integer year,
@Param(value = "activityType") Integer activityType) {
Sql sql = Sqls.create("""
SELECT
awc.*,
aus.groupName activityGroupName
FROM
`activity_works_collection` awc
LEFT JOIN activity_user_scope aus ON aus.groupId = awc.activityGroupId
AND aus.userId = @userId
""").setParam("userId", SecurityUtil.getUserId());
Cnd cnd = Cnd.NEW();
cnd.andEX("YEAR(awc.startDateTime)", "=", year);
//查询报名中
if (activityType == 2) {
cnd.and(new Static("now() > awc.startDateTime and now() < awc.endDateTime"));
}//查询已结束的
else if (activityType == 3) {
cnd.and(new Static("now() > awc.startDateTime"));
} else if (activityType == 4) {
cnd.and(new Static("now() < awc.endDateTime"));
}
cnd.and("awc.enable", "=", 1);
cnd.and("awc.type", "=", 1);
sql.setCondition(cnd);
Pagination pagination = baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
return Result.success(pagination);
}
}
@@ -0,0 +1,72 @@
package com.budwk.app.zhgh.activity.workscollection.models;
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;
/**
* @author zhf
* @date 2025/9/18 10:46
* @description 作品点赞数量
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Table("activity_works_collection_upload_like_num")
@TableMeta("{'mysql-charset':'utf8mb4'}")
@Comment("作品点赞数量")
public class Activity_works_collection_upload_like_num extends BaseModel {
@Name
@Comment("ID")
@PrevInsert(uu32 = true)
@ColDefine(type = ColType.VARCHAR, width = 32)
private String id;
@Column
@Comment("活动Id")
@ColDefine(type = ColType.VARCHAR, width = 32, notNull = true)
private String activityId;
@Column
@Comment("作品Id")
@ColDefine(type = ColType.VARCHAR, width = 32, notNull = true)
private String uploadId;
@Column
@Comment("点赞人id")
@ColDefine(type = ColType.VARCHAR, width = 32, notNull = true)
private String userId;
@Column
@Comment("点赞人姓名")
@ColDefine(type = ColType.VARCHAR, width = 100, notNull = true)
private String userName;
@Column
@Comment("点赞人工号")
@ColDefine(type = ColType.VARCHAR, width = 100, notNull = true)
private String loginName;
@Column
@Comment("点赞人单位id")
@ColDefine(type = ColType.VARCHAR, width = 200, notNull = true)
private String unitId;
@Column
@Comment("点赞人单位")
@ColDefine(type = ColType.VARCHAR, width = 200, notNull = true)
private String unitName;
@Column
@Comment("点赞人分工会id")
@ColDefine(type = ColType.VARCHAR, width = 32, notNull = true)
private String unionId;
@Column
@Comment("点赞人分工会")
@ColDefine(type = ColType.VARCHAR, width = 50, notNull = true)
private String unionName;
}
@@ -79,7 +79,7 @@ public class OutlayReimburseApplyController {
@ApiOperation("查询这个预算已经报销了的金额")
@SaCheckPermission(value = {"outlay.reimburse.apply", "h5.outlay.reimburse.apply"}, mode = SaMode.OR)
public Result getBxMoneyByBudgetId(String budgetId) {
return Result.success(outlayReimburseApplyService.getBxMoneyByActivityId(budgetId,null));
return Result.success(outlayReimburseApplyService.getBxMoneyByActivityId(budgetId));
}
@@ -24,10 +24,9 @@ public interface OutlayReimburseApplyService extends BaseService<OutlayReimburse
/**
* 查询这个预算已经报销了的金额
* @param budgetId
* @param isSchoolBudget 是否是校会预算
* @return
*/
BigDecimal getBxMoneyByActivityId(String budgetId,Boolean isSchoolBudget);
BigDecimal getBxMoneyByActivityId(String budgetId);
/**
* 判断这个报销的记录预算是否充足
@@ -136,21 +136,19 @@ public class OutlayReimburseApplyServiceImpl extends BaseServiceImpl<OutlayReimb
}
@Override
public BigDecimal getBxMoneyByActivityId(String budgetId, Boolean isSchoolBudget) {
public BigDecimal getBxMoneyByActivityId(String budgetId) {
Sql sql = Sqls.create("""
SELECT
rei.money
FROM
`outlay_reimburse` rei
LEFT JOIN wf_process_instance ins ON ins.businessNo = rei.id
WHERE
rei.budgetId = @budgetId
AND ins.state = 20
$condition
""").setParam("budgetId", budgetId);
Cnd cnd = Cnd.NEW();
if (isSchoolBudget != null) {
cnd.and("isSchoolBudget", "=", isSchoolBudget);
}
cnd.and("rei.budgetId", "=", budgetId);
cnd.and("ins.state", "=", 20);
sql.setCondition(cnd);
List<NutMap> reiList = listMap(sql);
@@ -174,7 +172,7 @@ public class OutlayReimburseApplyServiceImpl extends BaseServiceImpl<OutlayReimb
if (budget.getIsRepeatReimburse()) {
//1.查询已经报销了的总金额
if (budget.getIsSchoolBudget()) {
BigDecimal bXMoney = getBxMoneyByActivityId(budgetId, budget.getIsSchoolBudget());
BigDecimal bXMoney = getBxMoneyByActivityId(budgetId);
//如果是分工会进来并且报销的活动是校会预算
// 1. 计算本次加上之前的报销总金额
BigDecimal totalReimbursement = bXMoney.add(moneyBig);
@@ -185,7 +183,7 @@ public class OutlayReimburseApplyServiceImpl extends BaseServiceImpl<OutlayReimb
return Result.success();
}
} else {
BigDecimal bXMoney = getBxMoneyByActivityId(budgetId, budget.getIsSchoolBudget());
BigDecimal bXMoney = getBxMoneyByActivityId(budgetId);
//如果是自己的项目就能超20%
//1.算出现在还能报销多少钱
BigDecimal twentyPercent = budget.getTotalBudgetMoney().multiply(new BigDecimal("20")).divide(new BigDecimal("100"), 2, BigDecimal.ROUND_HALF_UP);
@@ -218,7 +216,7 @@ public class OutlayReimburseApplyServiceImpl extends BaseServiceImpl<OutlayReimb
//如果报销的项目是可以重复报销的
if (budget.getIsRepeatReimburse()) {
//这个预算已经报销了多少钱
BigDecimal totalMoney = getBxMoneyByActivityId(budgetId, null);
BigDecimal totalMoney = getBxMoneyByActivityId(budgetId );
//查出这个活动有没有跟其他预算关联,如果跟其他预算关联了,代表当前这条预算是分工会也能报校工会也能报,
// schoolBudgetId字段不为空就代表这条预算是使用的校工会的金额
List<ActivityBudget> budgetList = dao().query(ActivityBudget.class,
@@ -6,6 +6,7 @@ import cn.dev33.satoken.annotation.SaMode;
import cn.hutool.core.lang.Dict;
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.result.Result;
import com.budwk.app.base.service.BaseService;
import com.budwk.app.flow.constant.FlowConst;
@@ -16,18 +17,24 @@ import com.budwk.app.flow.enums.ProcessSubmitTypeEnum;
import com.budwk.app.flow.service.FlowCommonService;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.zhgh.staffbenefit.dsznfmtx.models.Dsznfmtx;
import com.budwk.app.zhgh.staffbenefit.dsznfmtx.service.DsznfmtxService;
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.dao.Sqls;
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.util.NutMap;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.List;
@@ -49,6 +56,8 @@ public class DsznfmtxApplyController {
@Inject
private BaseService baseService;
@Inject
private DsznfmtxService dsznfmtxService;
@Inject
private FlowEngine flowEngine;
@Inject
private FlowCommonService flowCommonService;
@@ -111,6 +120,53 @@ public class DsznfmtxApplyController {
return Result.success();
}
@At
@Ok("json")
@ApiOperation("是否为退休、离休、离退休人员")
@SaCheckPermission(value = {"dsznfmtx.apply", "h5.dsznfmtx.apply"}, mode = SaMode.OR)
public Object checkRetirementStatus(HttpServletRequest req) {
Sql sql = Sqls.create("""
SELECT
info.id,
info.userState
FROM
sys_user info
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.and("info.id", "=", SecurityUtil.getUserId());
sql.setCondition(cnd);
List<NutMap> map = dsznfmtxService.listMap(sql);
if (!map.isEmpty()) {
NutMap user = map.get(0);
String userState = user.getString("userState");
// 检查用户状态是否为退休相关状态
if ("退休".equals(userState) || "离休".equals(userState) || "离退休".equals(userState)) {
return Result.success(true);
}
}
return Result.success(false);
}
@At
@Ok("json")
@ApiOperation("是否已经申请过")
@SaCheckPermission(value = {"dsznfmtx.apply", "h5.dsznfmtx.apply"}, mode = SaMode.OR)
public Object checkUserApplied(HttpServletRequest req) {
try {
// 查询该用户是否已有申请记录
long count = dao.count(Dsznfmtx.class, Cnd.where("userId", "=", SecurityUtil.getUserId()));
// 返回true表示已申请,false表示未申请
return Result.success(count > 0);
} catch (Exception e) {
log.error("检查用户申请状态失败", e);
return Result.error("检查用户申请状态失败");
}
}
@At
@SaCheckLogin
public Result findOne(String id) {
@@ -146,5 +146,6 @@ public class Dsznfmtx extends BaseModel implements Serializable {
@Comment("办证机关")
private String office;
}
@@ -126,7 +126,7 @@ public class MaternityLeaveCollectController {
@At
@ApiOperation("删除")
@Aop(TransAop.READ_COMMITTED)
@SaCheckPermission(value = {"maternityLeave.mine", "h5.maternityLeave.mine"}, mode = SaMode.OR)
@SaCheckPermission(value = {"maternityLeave.collect", "h5.maternityLeave.collect"}, mode = SaMode.OR)
@SLog( tag = "删除工会报销", msg = "删除工会报销")
public Result delete(@Param("id") String id) {
maternityLeaveService.delete(id);
@@ -53,7 +53,7 @@ public class MaternityLeaveSchoolAuditController {
@At
@ApiOperation("分页查询")
@SaCheckPermission(value = {"maternityLeave.unionAudit", "h5.maternityLeave.unionAudit"}, mode = SaMode.OR)
@SaCheckPermission(value = {"maternityLeave.schoolAudit", "h5.maternityLeave.schoolAudit"}, mode = SaMode.OR)
public Result pageData(PageForm pageForm,
boolean approval,
Integer year,
@@ -4,6 +4,7 @@
v-model="fileList"
:before-read="beforeRead"
:after-read="afterRead"
:before-delete="beforeDelete"
multiple
progress
:accept="accept"
@@ -128,12 +129,16 @@ module.exports = {
}
},
methods: {
beforeDelete(file) {
this.fileList = this.fileList.filter((f) => f.url !== file.url)
this.$emit("update:value", this.fileList)
},
beforeRead(file) {
return true
},
afterRead(files) {
this.fileList.map((f) => {
if (f.file && f.file.name === files.file.name ) {
if (f.file && f.file.name === files.file.name) {
f.status = "loading"
}
})
@@ -67,6 +67,7 @@ layout("/layouts/platform.html"){
<span>{{$moment(scope.row.createdAt).format( 'YYYY-MM-DD')}}</span>
</template>
</el-table-column>
<el-table-column label="点赞数量" prop="num"></el-table-column>
<el-table-column label="操作" width="200">
<template slot-scope="scope">
<el-button size="mini" type="primary" @click="$refs.auInfoRef.onOpen(scope.row.id)">查看</el-button>
@@ -39,7 +39,6 @@ layout("/layouts/platform.html"){
<el-table :data="tableData" @sort-change="pageOrder" style="width: 100%" row-key="id">
<el-table-column label="序号" type="index" width="60px" :index="indexMethod"></el-table-column>
<el-table-column label="活动主题" prop="name" show-overflow-tooltip></el-table-column>
<el-table-column label="作品名称" prop="name" show-overflow-tooltip></el-table-column>
<el-table-column label="主题类型" prop="subjectName" show-overflow-tooltip></el-table-column>
<el-table-column label="作品类型" prop="worksName" show-overflow-tooltip></el-table-column>
@@ -353,8 +353,21 @@ layout("/layouts/platform.html"){
})
})
},
// 提交验证
validateBeforeSubmit() {
return new Promise((resolve) => {
this.$refs.formRef.validate((valid) => {
if (valid) {
resolve(true);
} else {
this.$message.error('请完善必填信息');
resolve(false);
}
});
});
},
// 提交
onSubmit() {
async onSubmit() {
// 余额校验
if (this.formData.money && this.formData.fundBalance) {
const balance = parseFloat(this.formData.fundBalance);
@@ -364,6 +377,10 @@ layout("/layouts/platform.html"){
return;
}
}
// 表单验证
const isValid = await this.validateBeforeSubmit();
if (!isValid) return;
this.$confirm("您确定要提交吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
@@ -380,7 +397,7 @@ layout("/layouts/platform.html"){
})
},
// 再次提交
onFinishTask() {
async onFinishTask() {
// 余额校验
if (this.formData.money && this.formData.fundBalance) {
const balance = parseFloat(this.formData.fundBalance);
@@ -390,6 +407,10 @@ layout("/layouts/platform.html"){
return;
}
}
// 表单验证
const isValid = await this.validateBeforeSubmit();
if (!isValid) return;
this.$confirm("您确定要提交吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
@@ -3,164 +3,156 @@ layout("/layouts/platform.html"){
#-->
<div id="app" v-cloak>
<el-card shadow="never">
<snaker-start slot="header" label="申请表单" define_key="DSZNFMTX"></snaker-start>
<el-form :model="formData" ref="formRef" :rules="formRules" label-suffix="" label-width="120px">
<!-- 将表单项按两列重新排列 -->
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="职工姓名" prop="userName">
<el-input v-model="formData.userName" readonly></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="性别" prop="sex">
<el-input v-model="formData.sex" readonly></el-input>
</el-form-item>
</el-col>
<snaker-start slot="header" label="申请表单" define_key="DSZNFMTX"></snaker-start>
<el-form :model="formData" ref="formRef" :rules="formRules" label-suffix="" label-width="120px">
<!-- 将表单项按两列重新排列 -->
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="职工姓名" prop="userName">
<el-input v-model="formData.userName" readonly></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="性别" prop="sex">
<el-input v-model="formData.sex" readonly></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="出生年月" prop="birthday">
<el-input v-model="formData.birthday" readonly></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="原工作单位" prop="unitName">
<el-input v-model="formData.unitName" readonly></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="退休时间" prop="retireTime">
<el-date-picker type="date"
v-model="formData.retireTime"
placeholder="请选择"
clearable
style="width: 100%"
value-format="yyyy-MM-dd">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="爱人姓名" prop="loverName">
<el-input type="text" v-model="formData.loverName" placeholder="请输入爱人姓名"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="性别" prop="loverSex">
<el-select v-model="formData.loverSex" placeholder="请选择" style="width: 100%">
<el-option label="男性" value="男性"></el-option>
<el-option label="女性" value="女性"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="工作单位" prop="loverUnitName">
<el-input type="text" v-model="formData.loverUnitName"
placeholder="请输入工作单位"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="结婚日期" prop="marryTime">
<el-date-picker type="date"
v-model="formData.marryTime"
placeholder="请选择"
clearable
style="width: 100%"
value-format="yyyy-MM-dd">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="子女出生日" prop="childrenBirthday">
<el-date-picker type="date"
v-model="formData.childrenBirthday"
placeholder="请选择子女出生日"
clearable
style="width: 100%"
value-format="yyyy-MM-dd">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="领独生子女证日" prop="getCertificateTime">
<el-date-picker type="date"
v-model="formData.getCertificateTime"
placeholder="请选择"
clearable
style="width: 100%"
value-format="yyyy-MM-dd">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="独生子女光荣证号" prop="childrenGraceNumber">
<el-input type="text" v-model="formData.childrenGraceNumber"
placeholder="请输入独生子女光荣证号"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="办证机关" prop="office">
<el-input type="text" v-model="formData.office"
placeholder="请输入办证机关"></el-input>
</el-form-item>
</el-col>
</el-row>
<!-- 以下项目保持单独一行 -->
<el-form-item prop="honorFiles" label="独生子女父母光荣证">
<file-upload :upload_number="5" :value.sync="formData.honorFiles"
upload_result_type="url"
upload_text="请上传独生子女父母光荣证"
complete_result upload_mode="drag"
upload_result_category="array"></file-upload>
</el-form-item>
<el-form-item prop="retireFiles" label="退休证">
<file-upload :upload_number="5" :value.sync="formData.retireFiles"
upload_result_type="url"
upload_text="请上传退休证"
complete_result upload_mode="drag"
upload_result_category="array"></file-upload>
</el-form-item>
<el-form-item prop="sign" label="签字">
<pc-signature v-model="formData.sign"></pc-signature>
</el-form-item>
<el-form-item prop="declarationAgreed">
<el-checkbox v-model="formData.declarationAgreed">
根据《河北省人口与计划生育条例》第四章第三十四条第四款"独生子女父母是国家工作人员、企事业单位员工的,退休时分别给予不低于三千元一次性奖励"的规定。<br/>
说明:1. 本人应如实填写各项情况。2. 申报时需持《独生子女父母光荣证》、《退休证》原件及其复印件各一份。
</el-checkbox>
</el-form-item>
</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-row :gutter="20">
<el-col :span="12">
<el-form-item label="出生年月" prop="birthday">
<el-input v-model="formData.birthday" readonly></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="原工作单位" prop="unitName">
<el-input v-model="formData.unitName" readonly></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="退休时间" prop="retireTime">
<el-date-picker type="date"
v-model="formData.retireTime"
placeholder="请选择"
clearable
style="width: 100%"
value-format="yyyy-MM-dd">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="爱人姓名" prop="loverName">
<el-input type="text" v-model="formData.loverName" placeholder="请输入爱人姓名"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="性别" prop="loverSex">
<el-select v-model="formData.loverSex" placeholder="请选择" style="width: 100%">
<el-option label="男性" value="男性"></el-option>
<el-option label="女性" value="女性"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="工作单位" prop="loverUnitName">
<el-input type="text" v-model="formData.loverUnitName"
placeholder="请输入工作单位"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="结婚日期" prop="marryTime">
<el-date-picker type="date"
v-model="formData.marryTime"
placeholder="请选择"
clearable
style="width: 100%"
value-format="yyyy-MM-dd">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="子女出生日" prop="childrenBirthday">
<el-date-picker type="date"
v-model="formData.childrenBirthday"
placeholder="请选择子女出生日"
clearable
style="width: 100%"
value-format="yyyy-MM-dd">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="领独生子女证日" prop="getCertificateTime">
<el-date-picker type="date"
v-model="formData.getCertificateTime"
placeholder="请选择"
clearable
style="width: 100%"
value-format="yyyy-MM-dd">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="独生子女光荣证号" prop="childrenGraceNumber">
<el-input type="text" v-model="formData.childrenGraceNumber"
placeholder="请输入独生子女光荣证号"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="办证机关" prop="office">
<el-input type="text" v-model="formData.office"
placeholder="请输入办证机关"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="奖励金额" prop="bonus">
<el-input type="text" v-model="formData.bonus"
placeholder="请输入奖励金额"></el-input>
</el-form-item>
</el-col>
</el-row>
<!-- 以下项目保持单独一行 -->
<el-form-item prop="honorFiles" label="独生子女父母光荣证">
<file-upload :upload_number="5" :value.sync="formData.honorFiles"
upload_result_type="url"
upload_text="请上传独生子女父母光荣证"
complete_result upload_mode="drag"
upload_result_category="array"></file-upload>
</el-form-item>
<el-form-item prop="retireFiles" label="退休证">
<file-upload :upload_number="5" :value.sync="formData.retireFiles"
upload_result_type="url"
upload_text="请上传退休证"
complete_result upload_mode="drag"
upload_result_category="array"></file-upload>
</el-form-item>
<el-form-item prop="sign" label="签字">
<pc-signature v-model="formData.sign"></pc-signature>
</el-form-item>
<el-form-item prop="declarationAgreed">
<el-checkbox v-model="formData.declarationAgreed">
根据《河北省人口与计划生育条例》第四章第三十四条第四款"独生子女父母是国家工作人员、企事业单位员工的,退休时分别给予不低于三千元一次性奖励"的规定。<br/>
说明:1. 本人应如实填写各项情况。2. 申报时需持《独生子女父母光荣证》、《退休证》原件及其复印件各一份。
</el-checkbox>
</el-form-item>
</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>
@@ -176,9 +168,23 @@ layout("/layouts/platform.html"){
taskId: GetQueryString("taskId"),
formData: {},
formRules: {
declarationAgreed: [
{ required: true, message: '请勾选申报理由', trigger: 'change' }
]
userName: [{ required: true, message: '职工姓名不能为空', trigger: 'blur' }],
sex: [{ required: true, message: '性别不能为空', trigger: 'blur' }],
birthday: [{ required: true, message: '出生年月不能为空', trigger: 'blur' }],
unitName: [{ required: true, message: '原工作单位不能为空', trigger: 'blur' }],
retireTime: [{ required: true, message: '请选择退休时间', trigger: 'change' }],
loverName: [{ required: true, message: '请输入爱人姓名', trigger: 'blur' }],
loverSex: [{ required: true, message: '请选择爱人性别', trigger: 'change' }],
loverUnitName: [{ required: true, message: '请输入爱人工作单位', trigger: 'blur' }],
marryTime: [{ required: true, message: '请选择结婚日期', trigger: 'change' }],
childrenBirthday: [{ required: true, message: '请选择子女出生日', trigger: 'change' }],
getCertificateTime: [{ required: true, message: '请选择领独生子女证日', trigger: 'change' }],
childrenGraceNumber: [{ required: true, message: '请输入独生子女光荣证号', trigger: 'blur' }],
office: [{ required: true, message: '请输入办证机关', trigger: 'blur' }],
honorFiles: [{ required: true, message: '请上传独生子女父母光荣证', trigger: 'change' }],
retireFiles: [{ required: true, message: '请上传退休证', trigger: 'change' }],
sign: [{ required: true, message: '请签字', trigger: 'change' }],
declarationAgreed: [{ required: true, message: '请勾选申报理由', trigger: 'change', type: 'enum', enum: [true] }]
},
}
},
@@ -199,54 +205,101 @@ layout("/layouts/platform.html"){
})
})
},
// 提交
onSubmit() {
this.$refs.formRef.validate((valid) => {
if (valid) {
this.$confirm("您确定要提交吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.$axios.post('/platform/dsznfmtx/apply/submit', {
data: JSON.stringify(this.formData)
}).then(res => {
if (res.code === 0) {
this.$message.success("提交成功")
commonUtil.pjaxPush('/platform/dsznfmtx/mine/index')
}
})
})
} else {
this.$message.error('请完善表单信息并勾选申报理由');
return false;
}
// 提交验证
validateBeforeSubmit() {
return new Promise((resolve) => {
this.$refs.formRef.validate((valid) => {
if (valid) {
resolve(true);
} else {
this.$message.error('请完善表单信息并勾选申报理由');
resolve(false);
}
});
});
},
// 再次提交
onFinishTask() {
this.$refs.formRef.validate((valid) => {
if (valid) {
this.$confirm("您确定要提交吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.$axios.post('/platform/dsznfmtx/apply/submitAgain', {
data: JSON.stringify(this.formData),
taskId: GetQueryString("taskId")
}).then(res => {
if (res.code === 0) {
this.$message.success("提交成功")
commonUtil.pjaxPush('/platform/dsznfmtx/mine/index')
}
})
})
} else {
this.$message.error('请完善表单信息并勾选申报理由');
return false;
// 添加检查是否为退休人员的方法
async checkRetirementStatus() {
try {
const resp = await this.$axios.post('/platform/dsznfmtx/apply/checkRetirementStatus');
// 如果返回code为0且data为true,表示用户是退休人员
if (resp.code === 0 && resp.data === true) {
return true;
}
});
return false;
} catch (error) {
console.error('检查退休状态失败:', error);
return false;
}
},
// 检查用户是否已申请过
async checkUserApplication() {
try {
const resp = await this.$axios.post('/platform/dsznfmtx/apply/checkUserApplied');
// 如果返回code为0且data为true,表示用户已申请过
if (resp.code === 0 && resp.data === true) {
return true;
}
return false;
} catch (error) {
console.error('检查用户申请状态失败:', error);
return false;
}
},
// 提交
async onSubmit() {
// 检查是否为退休人员
const isRetired = await this.checkRetirementStatus();
if (!isRetired) {
this.$message.warning('您不是退休人员,无法申请此项福利');
return;
}
if (!this.bizId) {
const isApplied = await this.checkUserApplication();
if (isApplied) {
this.$message.warning('您已经提交过申请,不能重复申请');
return;
}
}
const isValid = await this.validateBeforeSubmit();
if (!isValid) return;
this.$confirm("您确定要提交吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.$axios.post('/platform/dsznfmtx/apply/submit', {
data: JSON.stringify(this.formData)
}).then(res => {
if (res.code === 0) {
this.$message.success("提交成功")
commonUtil.pjaxPush('/platform/dsznfmtx/mine/index')
}
})
})
},
// 再次提交
async onFinishTask() {
const isValid = await this.validateBeforeSubmit();
if (!isValid) return;
this.$confirm("您确定要提交吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.$axios.post('/platform/dsznfmtx/apply/submitAgain', {
data: JSON.stringify(this.formData),
taskId: GetQueryString("taskId")
}).then(res => {
if (res.code === 0) {
this.$message.success("提交成功")
commonUtil.pjaxPush('/platform/dsznfmtx/mine/index')
}
})
})
},
async findOne(id) {
const resp = await $.get('/platform/dsznfmtx/apply/findOne', {id})
@@ -272,9 +325,7 @@ layout("/layouts/platform.html"){
sex: sex,
birthday: birthday,
}
}
}
},
created() {
@@ -284,6 +335,7 @@ layout("/layouts/platform.html"){
</script>
<!--#
}
#-->
@@ -86,7 +86,7 @@ layout("/layouts/platform.html"){
//分页数据
mixins: [initTableMixins],
components: {
"dsznfmtx-info": dsznfmtxInfo
"dsznfmtx-info": DSZNFMTX_INFO
},
data() {
return {
@@ -1,4 +1,4 @@
const dsznfmtxInfo = {
const DSZNFMTX_INFO = {
template: /*language=HTML*/ `
<div>
<div class="process-title">
@@ -17,7 +17,7 @@ const dsznfmtxInfo = {
<el-descriptions-item label="工作单位" :span="2">{{viewData.loverUnitName}}</el-descriptions-item>
<el-descriptions-item label="结婚日期">{{viewData.marryTime}}</el-descriptions-item>
<el-descriptions-item label="子女出生日">{{viewData.childrenBirthday}}</el-descriptions-item>
<el-descriptions-item label="领独生子女证时间">{{viewData.startTime}}</el-descriptions-item>
<el-descriptions-item label="领独生子女证时间">{{viewData.getCertificateTime}}</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>
@@ -63,6 +63,12 @@ const dsznfmtxInfo = {
<el-descriptions-item label="办理意见" v-if="!task.ext.isFirstTaskNode">{{
task.taskFormData.opinion }}
</el-descriptions-item>
<el-descriptions-item label="签字" :span="3" v-if="!task.ext.isFirstTaskNode">
<el-image :src="task.ext.tf_userSign"
v-if="task.ext.tf_userSign"
class="signature-image"></el-image>
<span v-else>暂无</span>
</el-descriptions-item>
</el-descriptions>
</div>
</template>
@@ -34,7 +34,7 @@ layout("/layouts/platform.html"){
<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>
<el-button @click="onDelete(row.id)" size="mini" type="danger">删除</el-button>
</template>
</el-table-column>
</el-table>
@@ -57,7 +57,7 @@ layout("/layouts/platform.html"){
//分页数据
mixins: [initTableMixins],
components: {
"dsznfmtx-info": dsznfmtxInfo
"dsznfmtx-info": DSZNFMTX_INFO
},
data() {
return {
@@ -88,6 +88,9 @@ layout("/layouts/platform.html"){
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<user-opinion-textarea v-model="formData.tf_opinion"></user-opinion-textarea>
</el-form-item>
<el-form-item label="电子签名" prop="tf_userSign" :rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<pc-signature v-model="formData.tf_userSign"></pc-signature>
</el-form-item>
</el-form>
<el-row type="flex" justify="end">
<el-button @click="$refs.guava.index()" size="small">取消</el-button>
@@ -99,6 +102,19 @@ layout("/layouts/platform.html"){
</dsznfmtx-info>
</template>
</guava>
<el-dialog title="输入奖励金额" :visible.sync="bonusDialogVisible" width="400px">
<el-form label-width="80px">
<el-form-item label="奖励金额">
<el-input v-model="bonusFormData.bonus" placeholder="请输入奖励金额">
<template slot="append"></template>
</el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="cancelBonusInput">取 消</el-button>
<el-button type="primary" @click="confirmBonusInput">确 定</el-button>
</div>
</el-dialog>
</div>
@@ -111,7 +127,7 @@ layout("/layouts/platform.html"){
//分页数据
mixins: [initTableMixins],
components: {
"dsznfmtx-info": dsznfmtxInfo
"dsznfmtx-info": DSZNFMTX_INFO
},
data() {
return {
@@ -124,6 +140,13 @@ layout("/layouts/platform.html"){
unionOptions: [],
unitOptions: [],
userOptions: [],
// 奖励金额输入对话框相关数据
bonusDialogVisible: false,
bonusFormData: {
bonus: ''
},
currentRow: null,
currentSubmitType: null
}
}
,
@@ -140,6 +163,7 @@ layout("/layouts/platform.html"){
processTaskId: row.taskId,
taskName: row.curTaskName
}
this.currentRow = row;
this.$refs.dsznfmtxInfoRef.onOpen(row)
})
},
@@ -157,7 +181,77 @@ layout("/layouts/platform.html"){
})
})
},
// 显示奖励金额输入对话框
showBonusInputDialog(submitType) {
this.currentSubmitType = submitType;
this.bonusFormData.bonus = '';
this.bonusDialogVisible = true;
},
// 确认奖励金额输入并提交
confirmBonusInput() {
if (!this.bonusFormData.bonus) {
this.$message.warning('请输入奖励金额');
return;
}
// 验证金额格式
const bonusPattern = /^([0-9]*[.]{0,1}[0-9]{0,2})$/;
if (!bonusPattern.test(this.bonusFormData.bonus)) {
this.$message.warning('请输入有效的金额格式');
return;
}
this.bonusDialogVisible = false;
// 调用申请页面的保存方法来更新奖励金额
this.saveBonusAndApprove();
},
// 取消奖励金额输入
cancelBonusInput() {
this.bonusDialogVisible = false;
},
// 保存奖励金额并执行审批
// 保存奖励金额并执行审批
saveBonusAndApprove() {
// 先获取完整的申请数据
this.$axios.post('/platform/dsznfmtx/apply/findOne', {id: this.currentRow.id}).then(res => {
if (res.code === 0) {
// 获取完整的数据后,更新奖励金额
const fullData = res.data;
fullData.bonus = this.bonusFormData.bonus;
// 调用申请页面的保存方法,传递完整数据
this.$axios.post('/platform/dsznfmtx/apply/save', {data: JSON.stringify(fullData)}).then(saveRes => {
if (saveRes.code === 0) {
// 保存成功后执行审批操作
this.executeTaskAction(this.currentSubmitType);
} else {
this.$message.error(saveRes.msg || '保存奖励金额失败');
}
}).catch(error => {
this.$message.error('保存奖励金额失败');
console.error('保存奖励金额失败:', error);
});
} else {
this.$message.error(res.msg || '获取申请数据失败');
}
}).catch(error => {
this.$message.error('获取申请数据失败');
console.error('获取申请数据失败:', error);
});
},
handleTaskAction(val) {
// 如果是同意申请操作(val=1),需要先输入奖励金额
if (val === 1) {
this.showBonusInputDialog(val);
return;
}
// 其他操作直接执行
this.executeTaskAction(val);
},
// 执行任务操作
executeTaskAction(val) {
this.$confirm("您确定要提交吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
@@ -170,9 +264,9 @@ layout("/layouts/platform.html"){
})
}).then((res) => {
if (res.code === 0) {
this.$refs.guava.index()
this.$message.success(res.msg)
this.doSearch()
this.$refs.guava.index();
this.$message.success(res.msg);
this.doSearch();
}
})
})
@@ -86,6 +86,9 @@ layout("/layouts/platform.html"){
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<user-opinion-textarea v-model="formData.tf_opinion"></user-opinion-textarea>
</el-form-item>
<el-form-item label="电子签名" prop="tf_userSign" :rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<pc-signature v-model="formData.tf_userSign"></pc-signature>
</el-form-item>
</el-form>
<el-row type="flex" justify="end">
<el-button @click="$refs.guava.index()" size="small">取消</el-button>
@@ -109,7 +112,7 @@ layout("/layouts/platform.html"){
//分页数据
mixins: [initTableMixins],
components: {
"dsznfmtx-info": dsznfmtxInfo
"dsznfmtx-info": DSZNFMTX_INFO
},
data() {
return {
@@ -111,12 +111,8 @@ layout("/layouts/platform.html"){
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="合计天数" span="2">{{formData.leaveDays}}
</el-descriptions-item>
</el-descriptions>
<table-tool label="休假时间"></table-tool>
<el-descriptions :column="2" border>
<el-descriptions-item label="休假时间起">
<el-form-item label="休假时间起" prop="startTime">
<el-date-picker type="date"
@@ -172,7 +168,16 @@ layout("/layouts/platform.html"){
bizId: GetQueryString("bizId"),
taskId: GetQueryString("taskId"),
formData: {},
formRules: {},
formRules: {
loverName: [{ required: true, message: '请输入爱人姓名', trigger: 'blur' }],
loverSex: [{ required: true, message: '请选择爱人性别', trigger: 'change' }],
loverNation: [{ required: true, message: '请选择爱人民族', trigger: 'change' }],
loverBirthday: [{ required: true, message: '请选择爱人出生年月', trigger: 'change' }],
loverUnitName: [{ required: true, message: '请输入爱人工作单位', trigger: 'blur' }],
startTime: [{ required: true, message: '请选择休假开始时间', trigger: 'change' }],
endTime: [{ required: true, message: '请选择休假结束时间', trigger: 'change' }],
childrenBirthday: [{ required: true, message: '请选择子女出生日期', trigger: 'change' }]
},
}
},
computed: {
@@ -216,8 +221,24 @@ layout("/layouts/platform.html"){
})
})
},
// 提交验证
validateBeforeSubmit() {
return new Promise((resolve) => {
this.$refs.formRef.validate((valid) => {
if (valid) {
resolve(true);
} else {
this.$message.error('请完善必填信息');
resolve(false);
}
});
});
},
// 提交
onSubmit() {
async onSubmit() {
const isValid = await this.validateBeforeSubmit();
if (!isValid) return;
this.$confirm("您确定要提交吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
@@ -234,7 +255,10 @@ layout("/layouts/platform.html"){
})
},
// 再次提交
onFinishTask() {
async onFinishTask() {
const isValid = await this.validateBeforeSubmit();
if (!isValid) return;
this.$confirm("您确定要提交吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
@@ -289,6 +313,7 @@ layout("/layouts/platform.html"){
</script>
<!--#
}
#-->
@@ -42,11 +42,8 @@ const maternityLeaveInfo = {
</el-descriptions-item>
<el-descriptions-item label="寒假">{{viewData.winterLeave}}</el-descriptions-item>
<el-descriptions-item label="暑假">{{viewData.summerLeave}}</el-descriptions-item>
<el-descriptions-item label="合计">{{viewData.leaveDays}}</el-descriptions-item>
</el-descriptions>
<el-descriptions-item label="合计" :span="2">{{viewData.leaveDays}}</el-descriptions-item>
<table-tool label="休假时间"></table-tool>
<el-descriptions :column="2" border class="flow-task-form">
<el-descriptions-item label="休假时间起">{{viewData.startTime}}</el-descriptions-item>
<el-descriptions-item label="休假时间止">{{viewData.endTime}}</el-descriptions-item>
<el-descriptions-item label="子女出生日">{{viewData.childrenBirthday}}</el-descriptions-item>
@@ -76,9 +73,15 @@ const maternityLeaveInfo = {
<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">{{
<el-descriptions-item label="办理意见" :span="3" v-if="!task.ext.isFirstTaskNode">{{
task.taskFormData.opinion }}
</el-descriptions-item>
<el-descriptions-item label="签字" :span="3" v-if="!task.ext.isFirstTaskNode">
<el-image :src="task.ext.tf_userSign"
v-if="task.ext.tf_userSign"
class="signature-image"></el-image>
<span v-else>暂无</span>
</el-descriptions-item>
</el-descriptions>
</div>
</template>
@@ -87,6 +87,9 @@ layout("/layouts/platform.html"){
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<user-opinion-textarea v-model="formData.tf_opinion"></user-opinion-textarea>
</el-form-item>
<el-form-item label="电子签名" prop="tf_userSign" :rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<pc-signature v-model="formData.tf_userSign"></pc-signature>
</el-form-item>
</el-form>
<el-row type="flex" justify="end">
<el-button @click="$refs.guava.index()" size="small">取消</el-button>
@@ -86,6 +86,9 @@ layout("/layouts/platform.html"){
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<user-opinion-textarea v-model="formData.tf_opinion"></user-opinion-textarea>
</el-form-item>
<el-form-item label="电子签名" prop="tf_userSign" :rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<pc-signature v-model="formData.tf_userSign"></pc-signature>
</el-form-item>
</el-form>
<el-row type="flex" justify="end">
<el-button @click="$refs.guava.index()" size="small">取消</el-button>
@@ -128,6 +131,7 @@ layout("/layouts/platform.html"){
methods: {
onView(row) {
this.$refs.guava.view(()=>{
this.showApprovalForm = false;
this.$refs.maternityLeaveInfoRef.onOpen(row)
})
},
@@ -8,8 +8,8 @@ layout("/layouts/platform_h5.html"){
}
.list-card-body {
/* width: calc(100% - 140px);
display: flex;*/
width: calc(100% - 140px);
display: flex;
flex-direction: column;
justify-content: space-between;
}
@@ -35,9 +35,6 @@ layout("/layouts/platform_h5.html"){
padding: 5px;
border-radius: 5px;
}
.list-card-img img{
width: 100%;
}
</style>
<div id="app" v-cloak>
@@ -47,7 +44,6 @@ layout("/layouts/platform_h5.html"){
<year-van-dropdown-item :num="5" @change="doSearch" v-model="pageForm.year"></year-van-dropdown-item>
<van-dropdown-item :options="stateList" @change="doSearch" v-model="pageForm.state"></van-dropdown-item>
<van-dropdown-item :options="isEnrolledOptions" @change="doSearch" v-model="pageForm.isEnrolledText"></van-dropdown-item>
<van-dropdown-item :options="activityTypeOptions" @change="doSearch" v-model="pageForm.activity_type"></van-dropdown-item>
</van-dropdown-menu>
</van-sticky>
@@ -119,13 +115,12 @@ layout("/layouts/platform_h5.html"){
loading: false,
refreshing: false,
pageForm: {
state: 1,
state: 2,
isEnrolledText: 0,
year: new Date().getFullYear(),
pageNumber: 1,
pageSize: 5,
totalCount: 0,
activity_type: 40001
totalCount: 0
},
yearList: [],
isEnrolledOptions: [
@@ -139,12 +134,7 @@ layout("/layouts/platform_h5.html"){
],
subLoading: false,
viewShow: false,
viewData: {},
activityTypeOptions: [
{ value: 40001, text: "校文化活动" },
{ value: 40002, text: "分工会文化活动" },
{ value: 40003, text: "协会文化活动" },
]
viewData: {}
}
},
components: {
@@ -279,7 +279,7 @@ layout("/layouts/platform_h5.html"){
<!-- 分工会报名-->
<div v-else-if="viewData.signUpMethod===3" class="block">
<div class="notice-title left-tag-title">选择报名人员
<div class="notice-title left-tag-title">选择报名人员
<span v-if="viewData.userNumberLimit===2">
,报名人数 <span style="color: red">
{{viewData.unionTeamNum}}</span>
@@ -1,7 +0,0 @@
<!--#
layout("/layouts/platform_h5.html"){
#-->
<!--#
}
#-->
@@ -0,0 +1,112 @@
<!--#
layout("/layouts/platform_h5.html"){
#-->
<div id="app">
<!-- 导航栏 -->
<van-nav-bar title="作品上传" left-text="返回" left-arrow placeholder
@click-left="historyBack" fixed></van-nav-bar>
<van-sticky offset-top="46px">
<van-dropdown-menu :close-on-click-outside="false" :close-on-click-overlay="false">
<year-van-dropdown-item :num="5" @change="doSearch" v-model="pageForm.year"></year-van-dropdown-item>
</van-dropdown-menu>
</van-sticky>
<table-list api="/platform/activity/worksCollection/upload/pageData"
:page_form.sync="pageForm"
ref="tableListRef"
title="name"
@ready="onReady"
>
<template v-slot="{index,row}">
<table-column label="主题类型">{{row.subjectName}}</table-column>
<table-column label="作品类型">{{row.worksName}}</table-column>
<table-column label="姓名">{{row.userName}}</table-column>
<table-column label="上传时间">{{$moment(row.createdAt).format('YYYY-MM-DD')}}</table-column>
</template>
<template #actions="{index,row}">
<div class="action-btn" @click="onView(row)">
<i class="fa fa-eye"></i>
<span>查看</span>
</div>
<div class="action-btn" @click="onEdit(row)">
<i class="fa fa-edit"></i>
<span>编辑</span>
</div>
<div class="action-btn delete" @click="onDelete(row)">
<i class="fa fa-trash"></i>
<span>删除</span>
</div>
</template>
</table-list>
<apply-form ref="applyFormRef"></apply-form>
<info ref="infoRef"></info>
</div>
<script>
<!--#include('../upload/applyForm.js'){}#-->
<!--#include('info.js'){}#-->
new Vue({
el: "#app",
store,
data() {
return {
pageForm: {
pageNumber: 1,
pageSize: 10,
totalCount: 0,
searchKeyword: '',
year: new Date().getFullYear(),
},
}
},
components: {
'apply-form': applyForm,
'info': INFO,
},
methods: {
onView(row) {
this.$refs.infoRef.onOpen(row)
},
onEdit(row) {
if (this.$moment().isAfter(this.$moment(row.activityEndDateTime))) {
this.$toast.fail("活动已结束,无法修改!")
return
}
this.$refs.applyFormRef.onOpenEdit(row)
},
onDelete(row) {
this.$dialog.confirm({
title: '温馨提示',
message: '您确定要删除吗?',
}).then(() => {
this.$axios.post("/platform/activity/worksCollection/upload/delete", {id:row.id}).then((res) => {
if (res.code === 0) {
this.$toast.success(res.msg)
this.doSearch()
}
})
}).catch(() => {
// on cancel
});
},
onReady() {
this.doSearch()
},
doSearch() {
this.$nextTick(() => {
this.pageForm.pageNumber = 1
this.pageForm.totalCount = 0
this.$refs.tableListRef.doSearch()
})
},
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,67 @@
const INFO = {
template: /*language=HTML*/
`
<div>
<van-action-sheet v-model="visible" :style="{ 'background-color': '#F7F8FA' }" title="报名信息">
<div class="detail-container">
<van-cell-group>
<van-cell title="姓名">
{{ viewData.userName }}
</van-cell>
<van-cell title="工号">
{{ viewData.loginName }}
</van-cell>
<van-cell title="单位">
{{ viewData.unitName }}
</van-cell>
<van-cell title="分工会">
{{ viewData.unionName }}
</van-cell>
<van-cell title="分工会">
{{ viewData.unionName }}
</van-cell>
<van-cell title="作品名称">
{{ viewData.name }}
</van-cell>
<van-cell title="活动主题">
{{ viewData.activityName }}
</van-cell>
<van-cell title="主题类型">
{{ viewData.subjectName }}
</van-cell>
<van-cell title="作品类型">
{{ viewData.worksName }}
</van-cell>
<van-cell title="作品描述" class="direction-column-cell">
{{ viewData.description }}
</van-cell>
<van-cell title="作品附件" class="direction-column-cell">
<file-preview :files="viewData.files" complete_result></file-preview>
</van-cell>
</van-cell-group>
</div>
</van-action-sheet>
</div>
`,
data() {
return {
viewData: {},
visible: false,
}
},
methods: {
onOpen(row) {
this.$axios.post("/platform/activity/worksCollection/common/findOne", {id: row.id}).then((res) => {
if (res.code === 0) {
this.viewData = res.data
try {
this.viewData.files = JSON.parse(this.viewData.files)
} catch (err) {
}
}
})
this.visible = true
},
}
}
@@ -0,0 +1,159 @@
<!--#
layout("/layouts/platform_h5.html"){
#-->
<div id="app">
<!-- 导航栏 -->
<van-nav-bar title="作品阅览" left-text="返回" left-arrow placeholder
@click-left="historyBack" fixed></van-nav-bar>
<van-sticky offset-top="46px">
<van-search
:reverse-color="false"
:show-action="false"
@search="doSearch"
input-align="left"
placeholder="请输入姓名/工号搜索"
v-model="pageForm.searchKeyword"
></van-search>
<van-dropdown-menu :close-on-click-outside="false" :close-on-click-overlay="false">
<van-dropdown-item v-model="pageForm.activityId" :options="activityOptions"
@change="doSearch"></van-dropdown-item>
</van-dropdown-menu>
<van-tabs v-model="pageForm.pageOrderName"
@change="doSearch">
<van-tab title="按上传时间正序排序" name="createdAt"></van-tab>
<van-tab title="按点赞多少倒序排序" name="num"></van-tab>
</van-tabs>
</van-sticky>
<table-list api="/platform/activity/worksCollection/read/h5/pageData"
:page_form.sync="pageForm"
ref="tableListRef"
title="name"
@ready="onReady"
>
<template v-slot="{index,row}">
<table-column label="主题类型">{{row.subjectName}}</table-column>
<table-column label="作品类型">{{row.worksName}}</table-column>
<table-column label="姓名">{{row.userName}}</table-column>
<table-column label="上传时间">{{$moment(row.createdAt).format('YYYY-MM-DD')}}</table-column>
<table-column label="点赞数">{{row.num}}</table-column>
<table-column label="附件">
<template v-if="row.files">
<file-preview :files="JSON.parse(row.files)" complete_result></file-preview>
</template>
</table-column>
</template>
<template #actions="{index,row}">
<div class="action-btn" @click="onView(row)">
<i class="fa fa-eye"></i>
<span>查看</span>
</div>
<template v-if="row.nbCount>0">
<div class="action-btn" @click="onLike(row)" v-if="!row.isThisLike">
<i class="fa fa-thumbs-o-up"></i>
<span>点赞</span>
</div>
<div class="action-btn" @click="onDeleteLike(row)" v-if="row.isThisLike">
<i class="fa fa-thumbs-up"></i>
<span>取消点赞</span>
</div>
</template>
</template>
</table-list>
<info ref="infoRef"></info>
</div>
<script>
<!--#include('../mine/info.js'){}#-->
new Vue({
el: "#app",
store,
data() {
return {
pageForm: {
pageNumber: 1,
pageSize: 10,
totalCount: 0,
searchKeyword: '',
pageOrderName: 'createdAt',
pageOrderNameText: '',
activityId: '',
year: new Date().getFullYear(),
},
activityOptions: []
}
},
components: {
'info': INFO,
},
methods: {
onLike(row) {
this.$dialog.confirm({
title: '温馨提示',
message: '您确定要点赞吗?',
}).then(() => {
this.$axios.post("/platform/activity/worksCollection/read/h5/doLike", {uploadId: row.id}).then((res) => {
if (res.code === 0) {
row.num = row.num + 1
row.isThisLike = true
this.$toast.success(res.msg)
}
})
}).catch(() => {
// on cancel
});
},
onDeleteLike(row) {
this.$dialog.confirm({
title: '温馨提示',
message: '您确定要取消点赞吗?',
}).then(() => {
this.$axios.post("/platform/activity/worksCollection/read/h5/doDeleteLike", {uploadId: row.id}).then((res) => {
if (res.code === 0) {
row.num = row.num - 1
row.isThisLike = false
this.$toast.success(res.msg)
}
})
}).catch(() => {
// on cancel
});
},
onView(row) {
this.$refs.infoRef.onOpen(row)
},
async listActivity() {
const res = await this.$axios.post("/platform/activity/worksCollection/common/listActivity")
if (res.code === 0) {
res.data.forEach(v => {
v.text = v.name
v.value = v.id
})
this.activityOptions = res.data
if (this.activityOptions.length > 0) {
this.pageForm.activityId = this.activityOptions[0].id
}
}
},
async onReady() {
await this.listActivity()
this.doSearch()
},
doSearch() {
this.$nextTick(() => {
this.pageForm.pageNumber = 1
this.pageForm.totalCount = 0
this.$refs.tableListRef.doSearch()
})
},
},
created() {
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,191 @@
const applyForm = {
template:
/*language=HTML*/
`
<div>
<van-action-sheet v-model="visible" :style="{ 'background-color': '#F7F8FA' }" title="报名信息">
<van-form ref="formRef" class="form-container">
<van-cell-group title="基础信息" class="form-section">
<van-field label="姓名" readonly v-model="formData.username"></van-field>
<van-field label="工号" readonly v-model="formData.loginname"></van-field>
<van-field label="所在单位" readonly v-model="formData.unitName"></van-field>
<van-field label="所属工会" readonly v-model="formData.unionName"></van-field>
<van-field label="性别" readonly v-model="formData.sex"></van-field>
</van-cell-group>
<van-cell-group title="报名信息" class="form-section">
<van-field label="主题类型"
required
:rules="[{ required: true, message: '请选择主题类型' }]"
readonly
is-link
@click="showSubjectPicker = true"
placeholder="请选择主题类型"
name="subjectName"
v-model="formData.subjectName">
</van-field>
<van-popup v-model="showSubjectPicker" position="bottom">
<van-picker
show-toolbar
:columns="subjectTypesOptions.map(v=>v.typeName)"
@confirm="onSubjectConfirm"
@cancel="showSubjectPicker=false"
></van-picker>
</van-popup>
<van-field label="作品类型"
required
:rules="[{ required: true, message: '请选择作品类型' }]"
readonly
is-link
@click="showWorksPicker = true"
placeholder="请选择作品类型"
name="worksName"
v-model="formData.worksName">
</van-field>
<van-popup v-model="showWorksPicker" position="bottom">
<van-picker
show-toolbar
:columns="worksTypeOptions.map(v=>v.worksTypeName)"
@confirm="onWorksConfirm"
@cancel="showWorksPicker=false"
></van-picker>
</van-popup>
<van-field label="作品名称"
required
v-model="formData.name"
name="name"
placeholder="请填写作品名称"
:rules="[{ required: true, message: '请填写作品名称' }]"></van-field>
<van-field label="作品描述"
v-model="formData.description"
type="textarea"
name="description"
rows="4"
autosize
maxlength="150"
:rules="[{ required: true, message: '请填写作品描述' }]"
class="more-text"
placeholder="请填写作品描述"></van-field>
</van-cell-group>
<van-cell-group title="附件">
<van-field class="more-text"
name="files"
:rules="[{ required: true,message:'请上传附件' }]"
label=""
required>
<template #input>
<h5-file-upload
slot="input"
:value.sync="formData.files"
:upload_number="chooseWorksType && chooseWorksType.allowFileNum"
upload_mode="file"
upload_result_category="array"
upload_result_type="url"
complete_result
:accept="fileAccept"
></h5-file-upload>
</template>
</van-field>
</van-cell-group>
<div class="form-actions">
<van-button @click="onSubmit" round type="info">提交</van-button>
</div>
</van-form>
</van-action-sheet>
</div>
`,
data() {
return {
row: {},
visible: false,
formData: {},
subjectTypesOptions: [],
showSubjectPicker: false,
worksTypeOptions: [],
showWorksPicker: false,
fileAccept: null,
chooseWorksType: {}
}
},
methods: {
async onOpen(row) {
this.$set(this.formData, 'username', this.$store.state.user.username)
this.$set(this.formData, 'loginname', this.$store.state.user.loginname)
this.$set(this.formData, 'unionName', this.$store.state.user.union.name)
this.$set(this.formData, 'unitName', this.$store.state.user.unit.name)
this.$set(this.formData, 'sex', this.$store.state.user.sex)
this.$set(this.formData, 'activityId', row.id)
await this.activityChange(row.id)
this.row = row
this.visible = true
},
async onOpenEdit(row) {
const formData = clone(row)
formData.files = JSON.parse(formData.files)
await this.activityChange(formData.activityId)
await this.subjectChange(formData.subjectId)
this.row = formData
this.formData = formData
this.$set(this.formData, 'username', this.$store.state.user.username)
this.$set(this.formData, 'loginname', this.$store.state.user.loginname)
this.$set(this.formData, 'sex', this.$store.state.user.sex)
this.chooseWorksType = this.worksTypeOptions.find((o) => o.id === formData.worksId)
if (this.chooseWorksType.allowFileTypes && this.chooseWorksType.allowFileTypes.length > 0) {
this.fileAccept = this.chooseWorksType.allowFileTypes.map((item) => "." + item).join(",")
}
this.visible = true
},
onWorksConfirm(value, index) {
this.$set(this.formData, 'worksName', value)
this.$set(this.formData, 'worksId', this.worksTypeOptions[index].id)
this.showWorksPicker = false
this.chooseWorksType = this.worksTypeOptions.find((o) => o.id === this.worksTypeOptions[index].id)
if (this.chooseWorksType.allowFileTypes && this.chooseWorksType.allowFileTypes.length > 0) {
this.fileAccept = this.chooseWorksType.allowFileTypes.map((item) => "." + item).join(",")
}
},
async onSubjectConfirm(value, index) {
this.$set(this.formData, 'subjectName', value)
this.$set(this.formData, 'subjectId', this.subjectTypesOptions[index].id)
await this.subjectChange(this.subjectTypesOptions[index].id)
this.showSubjectPicker = false
},
onSubmit() {
this.$refs.formRef.validate().then(() => {
this.$dialog.confirm({
title: "提示",
message: "您确定要提交吗?"
}).then(() => {
this.$toast.loading({
message: '提交中...',
forbidClick: true,
});
this.$axios.post("/platform/activity/worksCollection/upload" + (this.formData.id ? "/update" : "/insert"), {data: JSON.stringify(this.formData)}).then((res) => {
if (res.code === 0) {
this.$toast.clear();
this.$toast.success("提交成功")
pjaxReplace("/platform/activity/worksCollection/mine/h5")
}
})
})
}).catch();
},
async activityChange(value) {
const resp = await this.$axios.post("/platform/activity/worksCollection/common/getSubjectTypes", {activityId: value})
if (resp.code === 0) {
this.subjectTypesOptions = resp.data
}
},
async subjectChange(value) {
const resp = await this.$axios.post("/platform/activity/worksCollection/common/getWorksTypes", {subjectId: value})
if (resp.code === 0) {
this.worksTypeOptions = resp.data
}
}
}
}
@@ -1,7 +1,166 @@
<!--#
layout("/layouts/platform_h5.html"){
#-->
22222222222
<style scoped>
.info-title {
font-weight: bold;
background-color: white;
padding: 13px;
box-shadow: 0 8px 12px #ebedf0;
text-align: center !important;
}
.info-container {
height: calc(100vh - 46px - 44px);
min-height: calc(100vh - 46px - 44px);
overflow-y: auto;
}
.info-img {
display: block;
}
.van-count-down {
color: #fff;
}
</style>
<div id="app">
<!-- 导航栏 -->
<van-nav-bar title="作品上传" left-text="返回" left-arrow placeholder
@click-left="historyBack" fixed></van-nav-bar>
<van-sticky offset-top="46px">
<van-dropdown-menu :close-on-click-outside="false" :close-on-click-overlay="false">
<year-van-dropdown-item :num="5" @change="doSearch" v-model="pageForm.year"></year-van-dropdown-item>
<van-dropdown-item v-model="pageForm.activityType" :options="typeOptions" :multiple="false"
@change="doSearch"></van-dropdown-item>
</van-dropdown-menu>
</van-sticky>
<table-list api="/platform/activity/worksCollection/upload/h5/activityPageData"
:page_form.sync="pageForm"
ref="tableListRef"
title="name"
img="cover"
@ready="onReady"
>
<template v-slot="{index,row}">
<table-column label="面向对象">{{row.activityGroupName}}</table-column>
<table-column label="报名时间">
{{$moment(row.startDateTime).format('MM/DD HH:mm')
+ '~' + $moment(row.endDateTime).format('MM/DD HH:mm')}}
</table-column>
</template>
<template #actions="{index,row}">
<div class="action-btn" @click="onView(row)">
<i class="fa fa-eye"></i>
<span>查看介绍</span>
</div>
<div class="action-btn" @click="onApply(row)">
<i class="fa fa-edit"></i>
<span>去报名</span>
</div>
</template>
</table-list>
<van-action-sheet v-model="infoVisible" title="详细信息">
<div class="info-container">
<van-image class="info-img" height="186" width="100%" :src="infoRow.cover"></van-image>
<div class="info-title">{{infoRow.name}}</div>
<pdf-preview style="height: calc(100vh - 46px - 44px - 186px - 57px)"
:content="infoRow.content"></pdf-preview>
</div>
<div class="form-container">
<div class="form-actions">
<van-button @click="onApply(infoRow)" type="primary" block>
<span v-if="time >= 0">
去报名
</span>
<template v-else>
距离开始
<van-count-down :time="Math.abs(time)" class="count-down" format="DD 天 HH 时 mm 分 ss 秒"
@finish="time = 0"></van-count-down>
</template>
</van-button>
</div>
</div>
</van-action-sheet>
<apply-form ref="applyFormRef"></apply-form>
</div>
<script>
<!--#include('applyForm.js'){}#-->
new Vue({
el: "#app",
store,
data() {
return {
time: 0,
pageForm: {
pageNumber: 1,
pageSize: 10,
totalCount: 0,
searchKeyword: '',
year: new Date().getFullYear(),
activityType: 2,
},
typeOptions: [
{text: '全部', value: 1},
{text: '即将开始', value: 4},
{text: '报名中', value: 2},
{text: '已结束', value: 3},
],
infoVisible: false,
infoRow: {},
}
},
components: {
'apply-form': applyForm,
"pdf-preview": httpVueLoader("/components/plugins/sysFilePreview/PdfIndex.vue?v=" + new Date().getTime())
},
methods: {
onApply(row) {
if (this.$moment().isBefore(this.$moment(row.startDateTime))) {
this.onView(row)
return
}
if (this.$moment().isAfter(this.$moment(row.endDateTime))) {
this.$toast.fail("活动已结束")
return
}
this.$refs.applyFormRef.onOpen(row)
},
onView(row) {
this.infoRow = row
this.time = this.$moment().diff(this.$moment(row.startDateTime), 'milliseconds')
this.infoVisible = true
},
onReady() {
this.doSearch()
},
doSearch() {
this.$nextTick(() => {
this.pageForm.pageNumber = 1
this.pageForm.totalCount = 0
this.$refs.tableListRef.doSearch()
})
},
},
created() {
},
})
</script>
<!--#
}
#-->
@@ -1,8 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Title</title>
</head>
<body></body>
</html>
@@ -84,7 +84,7 @@ const H5_ASSET_INFO = {
<div style="white-space: pre">{{item.oldAssetNotes}}</div>
</van-cell>
<van-cell title="旧资产图片" class="direction-column-cell">
{{item.oldAssetFiles}}
<file-preview :files="item.oldAssetFiles" complete_result></file-preview>
</van-cell>
</van-cell-group>
</template>
@@ -5,6 +5,9 @@ layout("/layouts/platform_h5.html"){
<div id="app" v-cloak>
<van-nav-bar @click-left="historyBack" left-arrow left-text="返回" title="报销统计" placeholder fixed></van-nav-bar>
<van-sticky offset-top="46px">
<van-dropdown-menu :close-on-click-outside="false" :close-on-click-overlay="false">
<van-dropdown-item :options="yearList" @change="doSearch" v-model="pageForm.year"></van-dropdown-item>
</van-dropdown-menu>
<van-search
:reverse-color="false"
:show-action="false"
@@ -13,9 +16,6 @@ layout("/layouts/platform_h5.html"){
placeholder="请输入经办人搜索"
v-model="pageForm.userName"
></van-search>
<van-dropdown-menu :close-on-click-outside="false" :close-on-click-overlay="false">
<van-dropdown-item :options="yearList" @change="doSearch" v-model="pageForm.year"></van-dropdown-item>
</van-dropdown-menu>
</van-sticky>
@@ -0,0 +1,378 @@
<!--#
layout("/layouts/platform_h5.html"){
#-->
<style>
.signature-image {
max-width: 200px;
max-height: 100px;
}
</style>
<div id="app" v-cloak>
<van-nav-bar title="独生子女父母退休申请" left-text="返回" left-arrow @click-left="historyBack" placeholder fixed z-index="999"
class="custom-nav"></van-nav-bar>
<div class="form-container">
<van-form ref="formRef">
<van-cell-group title="人员信息" class="form-section">
<van-field label="职工姓名" v-model="formData.userName" placeholder="从信息中心获取"
readonly></van-field>
<van-field label="性别" v-model="formData.sex" placeholder="从信息中心获取" readonly></van-field>
<van-field label="出生年月" v-model="formData.birthday" placeholder="从信息中心获取"
readonly></van-field>
<van-field label="原工作单位" v-model="formData.unitName" placeholder="从信息中心获取"
readonly></van-field>
<van-field label="退休时间"
v-model="formData.retireTime"
placeholder="请选择退休时间"
readonly
@click="showDatePicker('retireTime')"
clickable
required
></van-field>
<van-field label="爱人姓名" v-model="formData.loverName" placeholder="请输入爱人姓名" required></van-field>
<van-field
v-model="formData.loverSex"
name="loverSex"
label="性别"
readonly
placeholder="请选择性别"
@click="showLoverSexPicker = true"
clickable
required
></van-field>
<van-popup position="bottom" round v-model:show="showLoverSexPicker">
<van-picker :columns="loverSexColumns" @cancel="showLoverSexPicker = false"
@confirm="onLoverSexConfirm" show-toolbar ></van-picker>
</van-popup>
<van-field label="工作单位" v-model="formData.loverUnitName" placeholder="请输入工作单位" required></van-field>
<van-field label="结婚日期"
v-model="formData.marryTime"
placeholder="请选择结婚日期"
readonly
@click="showDatePicker('marryTime')"
clickable
required
></van-field>
<van-field label="子女出生日"
v-model="formData.childrenBirthday"
placeholder="请选择子女出生日"
readonly
@click="showDatePicker('childrenBirthday')"
clickable
required
></van-field>
<van-field label="领独生子女证日"
v-model="formData.getCertificateTime"
placeholder="请选择日期"
readonly
@click="showDatePicker('getCertificateTime')"
clickable
required
></van-field>
<van-field label="独生子女光荣证号" v-model="formData.childrenGraceNumber" placeholder="请输入独生子女光荣证号" required></van-field>
<van-field label="办证机关" v-model="formData.office" placeholder="请输入办证机关" required></van-field>
<van-field class="more-text" name="honorFiles"
label="独生子女父母光荣证" required>
<template #input>
<h5-file-upload
slot="input"
:value.sync="formData.honorFiles"
:upload_number="10"
upload_mode="file"
upload_result_category="array"
upload_result_type="url"
complete_result
></h5-file-upload>
</template>
</van-field>
<van-field class="more-text" name="retireFiles"
label="退休证" required>
<template #input>
<h5-file-upload
slot="input"
:value.sync="formData.retireFiles"
:upload_number="10"
upload_mode="file"
upload_result_category="array"
upload_result_type="url"
complete_result
></h5-file-upload>
</template>
</van-field>
<van-field class="more-text" name="sign" label="">
<template #input>
<h5-signature v-model="formData.sign" slot="input"></h5-signature>
</template>
</van-field>
</van-cell-group>
<van-field name="declarationAgreed" class="declaration-checkbox">
<template #input>
<van-checkbox v-model="formData.declarationAgreed" checked-color="#ee0a24">
我已阅读并同意以下声明
</van-checkbox>
</template>
</van-field>
<van-cell class="declaration-text">
根据《河北省人口与计划生育条例》第四章第三十四条第四款"独生子女父母是国家工作人员、企事业单位员工的,退休时分别给予不低于三千元一次性奖励"的规定。<br/>
说明:1. 本人应如实填写各项情况。2. 申报时需持《独生子女父母光荣证》、《退休证》原件及其复印件各一份。
</van-cell>
</van-cell-group>
<!-- 日期选择器弹窗 -->
<van-popup position="bottom" round v-model:show="showDatePopup">
<van-datetime-picker
type="date"
:min-date="minDate"
:max-date="maxDate"
@confirm="onDateConfirm"
@cancel="showDatePopup = false"
show-toolbar
/>
</van-popup>
<!-- 提交按钮 -->
<div class="form-actions">
<van-button plain @click="onSave" type="info">保存</van-button>
<van-button @click="onSubmit" type="primary" v-if="!taskId">提交</van-button>
<van-button @click="onSubmitAgain" type="primary" v-else>提交1</van-button>
</div>
</van-form>
</div>
</div>
<script>
new Vue({
store,
el: '#app',
dicts: ["USER_NATION"],
data() {
return {
bizId: GetQueryString("bizId"),
taskId: GetQueryString("taskId"),
formData: {},
// 性别选择器
showLoverSexPicker: false,
loverSexColumns: [
{ value: '男性', text: '男性' },
{ value: '女性', text: '女性' }
],
// 日期选择器
showDatePopup: false,
currentDatePickerField: '', // 当前正在选择日期的字段名
minDate: new Date(1950, 0, 1),
maxDate: new Date(2040, 11, 31)
}
},
methods: {
// 显示日期选择器
showDatePicker(fieldName) {
this.currentDatePickerField = fieldName;
this.showDatePopup = true;
},
// 日期确认事件
onDateConfirm(value) {
const formattedDate = this.$moment(value).format("YYYY-MM-DD");
this.$set(this.formData, this.currentDatePickerField, formattedDate);
this.showDatePopup = false;
},
async onSave() {
// 保存时不需要验证,直接提交数据
this.$axios.post("/platform/dsznfmtx/apply/save", {data: JSON.stringify(this.formData)})
.then((res) => {
this.$toast.clear();
if (res.code === 0) {
this.$toast.success(res.msg);
pjaxReplace('/platform/dsznfmtx/mine/h5')
} else {
this.$toast.fail(res.msg || '保存失败');
}
})
.catch(err => {
this.$toast.clear();
this.$toast.fail('网络错误,请稍后重试');
});
},
// 提交前进行表单验证
async validateForm() {
const errors = [];
// 必填字段验证
if (!this.formData.retireTime) {
errors.push('请选择退休时间');
}
if (!this.formData.loverName) {
errors.push('请输入爱人姓名');
}
if (!this.formData.loverSex) {
errors.push('请选择爱人性别');
}
if (!this.formData.loverUnitName) {
errors.push('请输入爱人工作单位');
}
if (!this.formData.marryTime) {
errors.push('请选择结婚日期');
}
if (!this.formData.childrenBirthday) {
errors.push('请选择子女出生日');
}
if (!this.formData.getCertificateTime) {
errors.push('请选择领独生子女证日');
}
if (!this.formData.childrenGraceNumber) {
errors.push('请输入独生子女光荣证号');
}
if (!this.formData.office) {
errors.push('请输入办证机关');
}
if (!this.formData.honorFiles || this.formData.honorFiles.length === 0) {
errors.push('请上传独生子女父母光荣证');
}
if (!this.formData.retireFiles || this.formData.retireFiles.length === 0) {
errors.push('请上传退休证');
}
if (!this.formData.sign) {
errors.push('请签字');
}
if (!this.formData.declarationAgreed) {
errors.push('请阅读并同意声明');
}
return errors;
},
// 添加检查是否为退休人员的方法
async checkRetirementStatus() {
try {
const resp = await this.$axios.post('/platform/dsznfmtx/apply/checkRetirementStatus');
// 如果返回code为0且data为true,表示用户是退休人员
if (resp.code === 0 && resp.data === true) {
return true;
}
return false;
} catch (error) {
console.error('检查退休状态失败:', error);
return false;
}
},
// 检查用户是否已申请过
async checkUserApplication() {
try {
const resp = await this.$axios.post('/platform/dsznfmtx/apply/checkUserApplied');
// 如果返回code为0且data为true,表示用户已申请过
if (resp.code === 0 && resp.data === true) {
return true;
}
return false;
} catch (error) {
console.error('检查用户申请状态失败:', error);
return false;
}
},
// 提交
async onSubmit() {
// 检查是否为退休人员
const isRetired = await this.checkRetirementStatus();
if (!isRetired) {
this.$message.warning('您不是退休人员,无法申请此项福利');
return;
}
if (!this.bizId) {
const isApplied = await this.checkUserApplication();
if (isApplied) {
this.$message.warning('您已经提交过申请,不能重复申请');
return;
}
}
// 提交时进行表单验证
const errors = await this.validateForm();
if (errors.length > 0) {
this.$toast.fail(errors[0]); // 显示第一条错误信息
return;
}
this.$axios.post('/platform/dsznfmtx/apply/submit', {data: JSON.stringify(this.formData)})
.then(res => {
this.$toast.clear();
if (res.code === 0) {
this.$toast.success("提交成功");
pjaxReplace('/platform/dsznfmtx/mine/h5')
} else {
this.$toast.fail(res.msg || '提交失败');
}
})
.catch(err => {
this.$toast.clear();
this.$toast.fail('网络错误,请稍后重试');
});
},
// 再次提交
async onSubmitAgain() {
// 提交时进行表单验证
const errors = await this.validateForm();
if (errors.length > 0) {
this.$toast.fail(errors[0]); // 显示第一条错误信息
return;
}
this.$axios.post('/platform/dsznfmtx/apply/submitAgain', {
data: JSON.stringify(this.formData),
taskId: GetQueryString("taskId")
}).then(res => {
this.$toast.clear();
if (res.code === 0) {
this.$toast.success("提交成功");
setTimeout(() => {
pjaxReplace('/platform/dsznfmtx/mine/h5')
}, 1500);
} else {
this.$toast.fail(res.msg || '提交失败');
}
}).catch(err => {
this.$toast.clear();
this.$toast.fail('网络错误,请稍后重试');
});
},
// 添加性别确认方法
onLoverSexConfirm(o) {
this.$set(this.formData, "loverSex", o.text);
this.showLoverSexPicker = false;
},
init() {
this.bizId = GetQueryString("bizId")
if (this.bizId) {
this.$axios.post("/platform/dsznfmtx/apply/findOne", {id: this.bizId}).then((res) => {
if (res.code === 0) {
this.formData = res.data;
}
})
} else {
const user = this.$store.state.user
this.$set(this.formData, "userId", user.id)
this.$set(this.formData, "userName", user.username)
this.$set(this.formData, "loginName", user.loginname)
this.$set(this.formData, "unitId", user.unitId)
this.$set(this.formData, "unitName", user.unit.name)
this.$set(this.formData, "unionId", user.union.id)
this.$set(this.formData, "unionName", user.union.name)
this.$set(this.formData, "sex", user.sex)
this.$set(this.formData, "birthday", user.birthday)
}
}
},
async created() {
await this.init();
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,127 @@
<!--#
layout("/layouts/platform_h5.html"){
#-->
<div id="app" v-cloak>
<van-nav-bar @click-left="historyBack" left-arrow left-text="返回" title="查询统计" placeholder fixed></van-nav-bar>
<van-sticky offset-top="46px">
<van-dropdown-menu :close-on-click-outside="false" :close-on-click-overlay="false">
<van-dropdown-item :options="yearList" @change="doSearch" v-model="pageForm.year"></van-dropdown-item>
</van-dropdown-menu>
<van-search
:reverse-color="false"
:show-action="false"
@search="doSearch"
input-align="left"
placeholder="请输入职工姓名搜索"
v-model="pageForm.userName"
></van-search>
</van-sticky>
<table-list api="/platform/dsznfmtx/collect/pageData" :page_form.sync="pageForm" ref="tableListRef"
@ready="doSearch" >
<template v-slot="{index,row}">
<table-column label="职工姓名">{{row.userName}}</table-column>
<table-column label="性别">{{row.sex}}</table-column>
<table-column label="工会">{{row.unionName}}</table-column>
<table-column label="所属单位">{{row.unitName}}</table-column>
<table-column label="退休时间">{{row.retireTime}}</table-column>
<table-column label="申请时间">{{row.applyTime}}</table-column>
<table-column label="当前节点">{{row.taskName}}</table-column>
</template>
<template #actions="{index,row}">
<div class="action-btn" @click="onView(row)">
<i class="fa fa-eye"></i>
<span>查看</span>
</div>
<div class="action-btn delete" @click="onDelete(row)" v-if="$auth.hasRole('SYSADMIN')">
<i class="fa fa-trash"></i>
<span>删除</span>
</div>
</template>
</table-list>
<dsznfmtx-info ref="dsznfmtxInfoRef"></dsznfmtx-info>
</div>
<script>
<!--#include('../common/info.js'){}#-->
const vue = new Vue({
el: "#app",
store,
dicts: [],
components: {
"dsznfmtx-info":DSZNFMTX_INFO
},
data() {
return {
viewShow: false,
yearList: [],
pageForm: {
pageNumber: 1,
pageSize: 10,
totalCount: 0,
searchKeyword: "",
year: "",
},
infoShow: false
}
},
methods: {
onView(row) {
this.showApprovalForm = false
this.$refs.dsznfmtxInfoRef.onOpen(row)
},
onRevoke(row){
this.$dialog
.confirm({
title: "提示",
message: "您确定要撤销申请吗?"
})
.then(() => {
this.$axios.post("/flow/common/revokeTask", {taskId: row.startTaskId}).then((resp) => {
this.$toast.success(resp.msg)
this.doSearch()
})
})
},
onDelete(row) {
this.$dialog
.confirm({
title: "提示",
message: "您确定要删除吗?"
})
.then(() => {
this.$axios.post("/platform/dsznfmtx/mine/delete", {id: row.id}).then((resp) => {
if (resp.code === 0) {
this.$toast.success(resp.msg)
this.doSearch()
}
})
})
},
doSearch() {
this.$nextTick(() => {
this.pageForm.pageNumber = 1
this.pageForm.totalCount = 0
this.$refs.tableListRef.doSearch()
})
},
initData() {
for (let i = new Date().getFullYear() - 10; i <= new Date().getFullYear(); i++) {
this.yearList.unshift({value: i, text: i + "年"})
}
this.$set(this.pageForm, "year", this.yearList[0].value)
},
},
created() {
this.initData()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,123 @@
const DSZNFMTX_INFO = {
template:
/*language=HTML*/`
<van-action-sheet v-model="visible" title="查看详情">
<div class="detail-container">
<van-cell-group title="基本信息">
<van-cell title="职工姓名">{{ viewData.userName }}</van-cell>
<van-cell title="性别">{{ viewData.sex }}</van-cell>
<van-cell title="出生年月">{{ viewData.birthday }}</van-cell>
<van-cell title="原工作单位">{{ viewData.unitName }}</van-cell>
<van-cell title="退休时间">{{ viewData.retireTime }}</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="结婚日期">{{ viewData.loverBirthday }}</van-cell>
<van-cell title="子女出生日">{{ viewData.loverBirthday }}</van-cell>
<van-cell title="领独生子女光时间">{{ viewData.getCertificateTime }}</van-cell>
<van-cell title="独生子女光荣证号">{{ viewData.childrenGraceNumber }}</van-cell>
<van-cell title="办证机关">{{ viewData.office }}</van-cell>
<van-cell title="奖励金额">{{ viewData.bonus }}</van-cell>
<van-cell title="独生子女父母光荣证">
<file-preview :files="viewData.honorFiles" complete_result></file-preview>
</van-cell>
<van-cell title="退休证">
<file-preview :files="viewData.retireFiles" complete_result></file-preview>
</van-cell>
<van-cell title="签字" >
<van-image :src="viewData.sign"
v-if="viewData.sign"
class="signature-image"></van-image>
</van-cell>
</van-cell-group>
<template v-for="(task,index) in doneTasks">
<div class="process-title">
{{ task.displayName }}
</div>
<van-cell-group v-if="task.ext.isFirstTaskNode">
<van-cell title="申请用户">
{{ task.ext.initiatorName}}({{task.ext.initiatorAccount}})
</van-cell>
<van-cell title="申请时间">
{{ task.finishTime}}
</van-cell>
<van-cell title="办理结果">
<dict-tag :options="dict.type.PROCESS_TASK_SUBMIT_TYPE"
:value="task.ext.submitType"></dict-tag>
</van-cell>
</van-cell-group>
<van-cell-group v-else>
<van-cell title="办理用户">
{{ task.taskFormData.userName}}({{task.taskFormData.loginName}})
</van-cell>
<van-cell title="办理时间">
{{ task.finishTime}}
</van-cell>
<van-cell title="办理结果">
<dict-tag :options="dict.type.PROCESS_TASK_SUBMIT_TYPE"
:value="task.ext.submitType"></dict-tag>
</van-cell>
<van-cell title="办理意见" v-if="!task.ext.isFirstTaskNode">
<template #label>
{{
task.taskFormData.opinion
}}
</template>
</van-cell>
<van-cell title="签字" v-if="!task.ext.isFirstTaskNode">
<van-image :src="task.ext.tf_userSign"
v-if="task.ext.tf_userSign"
class="signature-image"></van-image>
</van-cell>
</van-cell-group>
</template>
</div>
<slot></slot>
</van-action-sheet>
`,
dicts: ["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()
},
// 关闭
onClose(){
this.visible = false
},
// 获取申请信息
getInfo() {
this.$axios.post("/platform/dsznfmtx/apply/findOne", {id: this.row.id}).then((res) => {
if (res.code === 0) {
this.viewData = res.data
}
})
},
// 查看
openView(id) {
this.$nextTick(() => {
this.$refs.infoDialogRef.onOpen(id)
})
},
// 获取已办任务审批记录
getDoneTasks() {
this.$axios.post("/flow/common/doneTasks", {bizId: this.row.id}).then((res) => {
if (res.code === 0) {
this.doneTasks = res.data
}
})
},
},
}
@@ -0,0 +1,134 @@
<!--#
layout("/layouts/platform_h5.html"){
#-->
<div id="app" v-cloak>
<van-nav-bar @click-left="historyBack" left-arrow left-text="返回" title="我的申请" placeholder fixed></van-nav-bar>
<van-sticky offset-top="46px">
<van-dropdown-menu :close-on-click-outside="false" :close-on-click-overlay="false">
<van-dropdown-item :options="yearList" @change="doSearch" v-model="pageForm.year"></van-dropdown-item>
</van-dropdown-menu>
</van-sticky>
<table-list api="/platform/dsznfmtx/mine/pageData" :page_form.sync="pageForm" ref="tableListRef"
@ready="doSearch" >
<template v-slot="{index,row}">
<table-column label="职工姓名">{{row.userName}}</table-column>
<table-column label="性别">{{row.sex}}</table-column>
<table-column label="工会">{{row.unionName}}</table-column>
<table-column label="所属单位">{{row.unitName}}</table-column>
<table-column label="退休时间">{{row.retireTime}}</table-column>
<table-column label="申请时间">{{row.applyTime}}</table-column>
<table-column label="当前节点">{{row.taskName}}</table-column>
</template>
<template #actions="{index,row}">
<div class="action-btn" @click="onView(row)">
<i class="fa fa-eye"></i>
<span>查看</span>
</div>
<div class="action-btn" @click="onEdit(row)" v-if="row.taskKey === 'startTask' || !row.instanceId">
<i class="fa fa-edit"></i>
<span>编辑</span>
</div>
<div class="action-btn delete" v-if="row.canRevoke" @click="onRevoke(row)">
<i class="fa fa-undo"></i>
<span>撤回</span>
</div>
<div class="action-btn delete" @click="onDelete(row)" v-if="row.taskKey === 'startTask' || !row.instanceId">
<i class="fa fa-trash"></i>
<span>删除</span>
</div>
</template>
</table-list>
<dsznfmtx-info ref="dsznfmtxInfoRef"></dsznfmtx-info>
</div>
<script>
<!--#include('../common/info.js'){}#-->
const vue = new Vue({
el: "#app",
store,
dicts: [],
components: {
"dsznfmtx-info":DSZNFMTX_INFO
},
data() {
return {
viewShow: false,
yearList: [],
pageForm: {
pageNumber: 1,
pageSize: 10,
totalCount: 0,
searchKeyword: "",
year: "",
},
infoShow: false
}
},
methods: {
onView(row) {
this.showApprovalForm = false
this.$refs.dsznfmtxInfoRef.onOpen(row)
},
onEdit(row) {
this.$pjaxReplace('/platform/dsznfmtx/apply/h5?taskId=' + (row.startTaskId || '') + "&bizId=" + row.id)
},
onRevoke(row){
this.$dialog
.confirm({
title: "提示",
message: "您确定要撤销申请吗?"
})
.then(() => {
this.$axios.post("/flow/common/revokeTask", {taskId: row.startTaskId}).then((resp) => {
this.$toast.success(resp.msg)
this.doSearch()
})
})
},
onDelete(row) {
this.$dialog
.confirm({
title: "提示",
message: "您确定要删除吗?"
})
.then(() => {
this.$axios.post("/platform/dsznfmtx/mine/delete", {id: row.id}).then((resp) => {
if (resp.code === 0) {
this.$toast.success(resp.msg)
this.doSearch()
}
})
})
},
doSearch() {
this.$nextTick(() => {
this.pageForm.pageNumber = 1
this.pageForm.totalCount = 0
this.$refs.tableListRef.doSearch()
})
},
initData() {
for (let i = new Date().getFullYear() - 10; i <= new Date().getFullYear(); i++) {
this.yearList.unshift({value: i, text: i + "年"})
}
this.$set(this.pageForm, "year", this.yearList[0].value)
},
},
created() {
this.initData()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,257 @@
<!--#
layout("/layouts/platform_h5.html"){
#-->
<div id="app" v-cloak>
<van-nav-bar @click-left="historyBack" left-arrow left-text="返回" title="校工会审核" placeholder fixed></van-nav-bar>
<van-sticky offset-top="46px">
<van-search
:reverse-color="false"
:show-action="false"
@search="doSearch"
input-align="left"
placeholder="请输入职工姓名搜索"
v-model="pageForm.userName"
></van-search>
<van-tabs v-model="pageForm.approvalText"
@change="(val)=>{this.pageForm.approval = val==='1';this.doSearch();}">
<van-tab title="已审核" name="1"></van-tab>
<van-tab title="未审核" name="0"></van-tab>
</van-tabs>
</van-sticky>
<table-list api="/platform/dsznfmtx/schoolAudit/pageData" :page_form.sync="pageForm" ref="tableListRef"
@ready="doSearch" >
<template v-slot="{index,row}">
<table-column label="职工姓名">{{row.userName}}</table-column>
<table-column label="性别">{{row.sex}}</table-column>
<table-column label="工会">{{row.unionName}}</table-column>
<table-column label="所属单位">{{row.unitName}}</table-column>
<table-column label="奖励金额">{{row.bonus}}</table-column>
<table-column label="申请时间">{{row.applyTime}}</table-column>
<table-column label="当前节点">{{row.curTaskName}}</table-column>
</template>
<template #actions="{index,row}">
<div class="action-btn" @click="onView(row)">
<i class="fa fa-eye"></i>
<span>查看</span>
</div>
<div class="action-btn" v-if="row.taskState === 10" @click="onAudit(row)">
<i class="fa fa-edit"></i>
<span>审核</span>
</div>
</template>
</table-list>
<dsznfmtx-info ref="dsznfmtxInfoRef">
<div v-if="showApprovalForm">
<div class="process-title">
校工会审核
</div>
<div class="form-container">
<van-form ref="formRef">
<van-cell-group title="审批意见">
<van-field label=""
:rules="[{ required: true,message:'请填审批意见' }]"
v-model="formData.tf_opinion"
required
type="textarea"
name="tf_opinion"
rows="4"
autosize
class="more-text"
placeholder="请填审批意见"></van-field>
</van-cell-group>
<van-cell-group title="电子签名" class="form-section">
<van-field class="more-text" name="tf_userSign" label="">
<template #input>
<h5-signature v-model="formData.tf_userSign" slot="input"></h5-signature>
</template>
</van-field>
</van-cell-group>
<!-- 按钮区域 -->
<div class="form-actions">
<van-button type="danger" @click="handleTaskAction(6)">退回到发起人</van-button>
<van-button type="danger" @click="handleTaskAction(2)">拒绝申请</van-button>
<van-button type="primary" @click="handleTaskAction(1)">同意申请</van-button>
</div>
</van-form>
</div>
</div>
</dsznfmtx-info>
<!-- 奖励金额输入弹窗 -->
<van-dialog v-model="bonusDialogVisible" title="输入奖励金额" show-cancel-button
@confirm="confirmBonusInput" @cancel="cancelBonusInput">
<van-field v-model="bonusFormData.bonus" placeholder="请输入奖励金额" type="number">
<template #right-icon>
<span></span>
</template>
</van-field>
</van-dialog>
</div>
<script>
<!--#include('../common/info.js'){}#-->
const vue = new Vue({
el: "#app",
store,
dicts: [],
components: {
"dsznfmtx-info":DSZNFMTX_INFO
},
data() {
return {
pageForm: {
pageNumber: 1,
pageSize: 10,
totalCount: 0,
searchKeyword: "",
approvalText: "0",
approval: false,
year: new Date().getFullYear(),
},
formData: {},
showApprovalForm: false,
infoShow: false,
// 奖励金额输入弹窗相关数据
bonusDialogVisible: false,
bonusFormData: {
bonus: ''
},
currentRow: null,
currentSubmitType: null
}
},
methods: {
// 显示奖励金额输入弹窗
showBonusInputDialog(submitType) {
this.currentSubmitType = submitType;
this.bonusFormData.bonus = '';
this.bonusDialogVisible = true;
},
// 确认奖励金额输入
confirmBonusInput() {
if (!this.bonusFormData.bonus) {
this.$toast.fail('请输入奖励金额');
return false; // 阻止弹窗关闭
}
// 验证金额格式
const bonusPattern = /^([0-9]*[.]{0,1}[0-9]{0,2})$/;
if (!bonusPattern.test(this.bonusFormData.bonus)) {
this.$toast.fail('请输入有效的金额格式');
return false; // 阻止弹窗关闭
}
this.bonusDialogVisible = false;
// 保存奖励金额并执行审批操作
this.saveBonusAndApprove();
return true; // 允许弹窗关闭
},
// 取消奖励金额输入
cancelBonusInput() {
this.bonusDialogVisible = false;
},
// 保存奖励金额并执行审批
saveBonusAndApprove() {
// 先获取完整的申请数据
this.$axios.post('/platform/dsznfmtx/apply/findOne', {id: this.currentRow.id}).then(res => {
if (res.code === 0) {
// 获取完整的数据后,更新奖励金额
const fullData = res.data;
fullData.bonus = this.bonusFormData.bonus;
// 调用申请页面的保存方法,传递完整数据
this.$axios.post('/platform/dsznfmtx/apply/save', {data: JSON.stringify(fullData)}).then(saveRes => {
if (saveRes.code === 0) {
// 保存成功后执行审批操作
this.executeTaskAction(this.currentSubmitType);
} else {
this.$toast.fail(saveRes.msg || '保存奖励金额失败');
}
}).catch(error => {
this.$toast.fail('保存奖励金额失败');
console.error('保存奖励金额失败:', error);
});
} else {
this.$toast.fail(res.msg || '获取申请数据失败');
}
}).catch(error => {
this.$toast.fail('获取申请数据失败');
console.error('获取申请数据失败:', error);
});
},
// 执行任务操作
executeTaskAction(val) {
this.$refs.formRef.validate().then(() => {
this.$dialog.confirm({
title: '温馨提示',
message: '您确定要提交吗?',
}).then(() => {
this.$axios.post('/flow/common/executeTask', {
data: JSON.stringify({
...this.formData,
submitType: val
})
}).then(res => {
if (res.code === 0) {
this.$toast.success("提交成功")
this.doSearch()
this.$refs.dsznfmtxInfoRef.onClose()
}
})
}).catch(() => {
// on cancel
});
}).catch();
},
handleTaskAction(val) {
// 如果是同意申请操作(val=1),需要先输入奖励金额
if (val === 1) {
this.showBonusInputDialog(val);
return;
}
// 其他操作直接执行
this.executeTaskAction(val);
},
onView(row) {
this.showApprovalForm = false
this.$refs.dsznfmtxInfoRef.onOpen(row)
},
onAudit(row) {
this.showApprovalForm = true
this.currentRow = row;
this.formData = {
tf_opinion: null,
tf_userSign: null,
processTaskId: row.taskId,
taskName: row.curTaskName
}
this.$refs.dsznfmtxInfoRef.onOpen(row)
},
doSearch() {
this.$nextTick(() => {
this.pageForm.pageNumber = 1
this.pageForm.totalCount = 0
this.$refs.tableListRef.doSearch()
})
},
},
created() {
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,167 @@
<!--#
layout("/layouts/platform_h5.html"){
#-->
<div id="app" v-cloak>
<van-nav-bar @click-left="historyBack" left-arrow left-text="返回" title="分工会审核" placeholder fixed></van-nav-bar>
<van-sticky offset-top="46px">
<van-search
:reverse-color="false"
:show-action="false"
@search="doSearch"
input-align="left"
placeholder="请输入职工姓名搜索"
v-model="pageForm.userName"
></van-search>
<van-tabs v-model="pageForm.approvalText"
@change="(val)=>{this.pageForm.approval = val==='1';this.doSearch();}">
<van-tab title="已审核" name="1"></van-tab>
<van-tab title="未审核" name="0"></van-tab>
</van-tabs>
</van-sticky>
<table-list api="/platform/dsznfmtx/unionAudit/pageData" :page_form.sync="pageForm" ref="tableListRef"
@ready="doSearch" >
<template v-slot="{index,row}">
<table-column label="职工姓名">{{row.userName}}</table-column>
<table-column label="性别">{{row.sex}}</table-column>
<table-column label="工会">{{row.unionName}}</table-column>
<table-column label="所属单位">{{row.unitName}}</table-column>
<table-column label="退休时间">{{row.retireTime}}</table-column>
<table-column label="申请时间">{{row.applyTime}}</table-column>
<table-column label="当前节点">{{row.curTaskName}}</table-column>
</template>
<template #actions="{index,row}">
<div class="action-btn" @click="onView(row)">
<i class="fa fa-eye"></i>
<span>查看</span>
</div>
<div class="action-btn" v-if="row.taskState === 10" @click="onAudit(row)">
<i class="fa fa-edit"></i>
<span>审核</span>
</div>
</template>
</table-list>
<dsznfmtx-info ref="dsznfmtxInfoRef">
<div v-if="showApprovalForm">
<div class="process-title">
分工会审核
</div>
<div class="form-container">
<van-form ref="formRef">
<van-cell-group title="审批意见">
<van-field label=""
:rules="[{ required: true,message:'请填审批意见' }]"
v-model="formData.tf_opinion"
required
type="textarea"
name="tf_opinion"
rows="4"
autosize
class="more-text"
placeholder="请填审批意见"></van-field>
</van-cell-group>
<van-cell-group title="电子签名" class="form-section">
<van-field class="more-text" name="tf_userSign" label="">
<template #input>
<h5-signature v-model="formData.tf_userSign" slot="input"></h5-signature>
</template>
</van-field>
</van-cell-group>
<!-- 按钮区域 -->
<div class="form-actions">
<van-button type="danger" @click="handleTaskAction(6)">退回到发起人</van-button>
<van-button type="danger" @click="handleTaskAction(2)">拒绝申请</van-button>
<van-button type="primary" @click="handleTaskAction(1)">同意申请</van-button>
</div>
</van-form>
</div>
</div>
</dsznfmtx-info>
</div>
<script>
<!--#include('../common/info.js'){}#-->
const vue = new Vue({
el: "#app",
store,
dicts: [],
components: {
"dsznfmtx-info":DSZNFMTX_INFO
},
data() {
return {
pageForm: {
pageNumber: 1,
pageSize: 10,
totalCount: 0,
searchKeyword: "",
approvalText: "0",
approval: false,
year: new Date().getFullYear(),
},
formData: {},
showApprovalForm: false,
infoShow: false
}
},
methods: {
handleTaskAction(val) {
this.$refs.formRef.validate().then(() => {
this.$dialog.confirm({
title: '温馨提示',
message: '您确定要提交吗?',
}).then(() => {
this.$axios.post('/flow/common/executeTask', {
data: JSON.stringify({
...this.formData,
submitType: val
})
}).then(res => {
if (res.code === 0) {
this.$toast.success("提交成功")
this.doSearch()
this.$refs.dsznfmtxInfoRef.onClose()
}
})
}).catch(() => {
// on cancel
});
}).catch();
},
onView(row) {
this.showApprovalForm = false
this.$refs.dsznfmtxInfoRef.onOpen(row)
},
onAudit(row) {
this.showApprovalForm = true
this.formData = {
tf_opinion: null,
tf_userSign: null,
processTaskId: row.taskId,
taskName: row.curTaskName
}
this.$refs.dsznfmtxInfoRef.onOpen(row)
},
doSearch() {
this.$nextTick(() => {
this.pageForm.pageNumber = 1
this.pageForm.totalCount = 0
this.$refs.tableListRef.doSearch()
})
},
},
created() {
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,465 @@
<!--#
layout("/layouts/platform_h5.html"){
#-->
<style>
</style>
<div id="app" v-cloak>
<van-nav-bar title="生育休假申请" left-text="返回" left-arrow @click-left="historyBack" placeholder fixed z-index="999"
class="custom-nav"></van-nav-bar>
<div class="form-container">
<van-form ref="formRef">
<van-cell-group title="人员信息" class="form-section">
<van-field label="职工姓名" v-model="formData.userName" placeholder="从信息中心获取"
readonly></van-field>
<van-field label="性别" v-model="formData.sex" placeholder="从信息中心获取" readonly></van-field>
<van-field label="民族" v-model="formData.nation" placeholder="从信息中心获取" readonly></van-field>
<van-field label="出生年月" v-model="formData.birthday" placeholder="从信息中心获取"
readonly></van-field>
<van-field label="工作单位" v-model="formData.unitName" placeholder="从信息中心获取"
readonly></van-field>
<van-field label="电话" v-model="formData.mobile" placeholder="从信息中心获取" readonly></van-field>
<van-field label="爱人姓名" v-model="formData.loverName" placeholder="请输入爱人姓名" required></van-field>
<van-field
v-model="formData.loverSex"
name="loverSex"
label="性别"
readonly
placeholder="请选择性别"
@click="showLoverSexPicker = true"
clickable
required
></van-field>
<van-popup position="bottom" round v-model:show="showLoverSexPicker">
<van-picker :columns="loverSexColumns" @cancel="showLoverSexPicker = false"
@confirm="onLoverSexConfirm" show-toolbar></van-picker>
</van-popup>
<van-field
v-model="formData.loverNationName"
name="loverNationName"
label="民族"
readonly
placeholder="请选择民族"
@click="showLoverNationPicker = true"
clickable
required
></van-field>
<van-popup position="bottom" round v-model:show="showLoverNationPicker">
<van-picker :columns="loverNationColumns" @cancel="showLoverNationPicker = false"
@confirm="onLoverNationConfirm" show-toolbar></van-picker>
</van-popup>
<van-field label="出生年月"
v-model="formData.loverBirthday"
placeholder="请选择出生年月"
readonly
@click="showLoverBirthdayPicker = true"
clickable
required
></van-field>
<van-popup position="bottom" round v-model:show="showLoverBirthdayPicker">
<van-datetime-picker
type="date"
:min-date="minDate"
:max-date="maxDate"
@confirm="onLoverBirthdayConfirm"
@cancel="showLoverBirthdayPicker = false"
show-toolbar
/>
</van-popup>
<van-field label="工作单位" v-model="formData.loverUnitName" placeholder="请输入工作单位" required></van-field>
</van-cell-group>
<van-cell-group title="假期类型" class="form-section">
<van-field label="陪产假" v-model="formData.withLeave" placeholder="请输入天数" type="number"
v-if="formData.sex === '男性' || formData.sex === '男'" required></van-field>
<van-field label="育儿假" v-model="formData.parentalLeave" placeholder="请输入天数" type="number"
v-if="formData.sex === '男性' || formData.sex === '男'" required></van-field>
<van-field label="产假" v-model="formData.maternityLeave" placeholder="请输入天数" type="number"
v-if="formData.sex === '女性' || formData.sex === '女'" required></van-field>
<van-field label="延长假" v-model="formData.extendLeave" placeholder="请输入天数" type="number"
v-if="formData.sex === '女性' || formData.sex === '女'" required></van-field>
<van-field label="多胞胎" v-model="formData.birthsLeave" placeholder="请输入天数" type="number"
v-if="formData.sex === '女性' || formData.sex === '女'" required></van-field>
<van-field label="难产假" v-model="formData.difficultLeave" placeholder="请输入天数" type="number"
v-if="formData.sex === '女性' || formData.sex === '女'" required></van-field>
<van-field label="寒假" v-model="formData.winterLeave" placeholder="请输入天数"
type="number" required></van-field>
<van-field label="暑假" v-model="formData.summerLeave" placeholder="请输入天数"
type="number" required></van-field>
<van-field label="合计天数" :value="totalLeaveDays" readonly></van-field>
<van-field label="休假时间起"
v-model="formData.startTime"
placeholder="请选择休假开始时间"
readonly
@click="showStartTimePicker = true"
clickable
required
></van-field>
<van-popup position="bottom" round v-model:show="showStartTimePicker">
<van-datetime-picker
type="date"
:min-date="minDate"
:max-date="maxDate"
@confirm="onStartTimeConfirm"
@cancel="showStartTimePicker = false"
show-toolbar
/>
</van-popup>
<van-field label="休假时间止"
v-model="formData.endTime"
placeholder="请选择休假结束时间"
readonly
@click="showEndTimePicker = true"
clickable
required
></van-field>
<van-popup position="bottom" round v-model:show="showEndTimePicker">
<van-datetime-picker
type="date"
:min-date="minDate"
:max-date="maxDate"
@confirm="onEndTimeConfirm"
@cancel="showEndTimePicker = false"
show-toolbar
/>
</van-popup>
<van-field label="子女出生日"
v-model="formData.childrenBirthday"
placeholder="请选择子女出生日期"
readonly
@click="showChildrenBirthdayPicker = true"
clickable
required
></van-field>
<van-popup position="bottom" round v-model:show="showChildrenBirthdayPicker">
<van-datetime-picker
type="date"
:min-date="minDate"
:max-date="maxDate"
@confirm="onChildrenBirthdayConfirm"
@cancel="showChildrenBirthdayPicker = false"
show-toolbar
/>
</van-popup>
</van-cell-group>
<!-- 提交按钮 -->
<div class="form-actions">
<van-button plain @click="onSave" type="info">保存</van-button>
<van-button @click="onSubmit" type="primary" v-if="!taskId">提交</van-button>
<van-button @click="onSubmitAgain" type="primary" v-else>提交1</van-button>
</div>
</van-form>
</div>
</div>
<script>
new Vue({
store,
el: '#app',
dicts: ["USER_NATION"],
data() {
return {
bizId: GetQueryString("bizId"),
taskId: GetQueryString("taskId"),
formData: {},
// 民族
showLoverNationPicker: false,
loverNationColumns: [],
// 性别
showLoverSexPicker: false,
loverSexColumns: [
{ value: '男性', text: '男性' },
{ value: '女性', text: '女性' }
],
showLoverBirthdayPicker: false,
showStartTimePicker: false,
showEndTimePicker: false,
showChildrenBirthdayPicker: false,
minDate: new Date(1950, 0, 1), // 设置最小日期为2000年1月1日
maxDate: new Date(2040, 12, 31), // 设置最大日期为2030年12月31日
// 表单验证规则
formRules: {
loverName: [{ required: true, message: '请输入爱人姓名' }],
loverSex: [{ required: true, message: '请选择爱人性别' }],
loverNationName: [{ required: true, message: '请选择爱人民族' }],
loverBirthday: [{ required: true, message: '请选择爱人出生年月' }],
loverUnitName: [{ required: true, message: '请输入爱人工作单位' }],
withLeave: [{ required: true, message: '请输入陪产假天数' }],
parentalLeave: [{ required: true, message: '请输入育儿假天数' }],
maternityLeave: [{ required: true, message: '请输入产假天数' }],
extendLeave: [{ required: true, message: '请输入延长假天数' }],
birthsLeave: [{ required: true, message: '请输入多胞胎天数' }],
difficultLeave: [{ required: true, message: '请输入难产假天数' }],
winterLeave: [{ required: true, message: '请输入寒假天数' }],
summerLeave: [{ required: true, message: '请输入暑假天数' }],
startTime: [{ required: true, message: '请选择休假开始时间' }],
endTime: [{ required: true, message: '请选择休假结束时间' }],
childrenBirthday: [{ required: true, message: '请选择子女出生日期' }]
}
}
},
computed: {
totalLeaveDays() {
const fields = [
'withLeave', // 陪产假
'parentalLeave', // 育儿假
'maternityLeave', // 产假
'extendLeave', // 延长假
'birthsLeave', // 多胞胎
'difficultLeave', // 难产假
'winterLeave', // 寒假
'summerLeave' // 暑假
];
let total = 0;
fields.forEach(field => {
const value = parseFloat(this.formData[field]) || 0;
total += value;
});
// 同时更新 formData.leaveDays,以便保存到后端
this.$set(this.formData, 'leaveDays', total);
return total;
}
},
methods: {
async onSave() {
// 保存时不需要验证,直接提交数据
this.$axios.post("/platform/maternityLeave/apply/save", {data: JSON.stringify(this.formData)})
.then((res) => {
this.$toast.clear();
if (res.code === 0) {
this.$toast.success(res.msg);
pjaxReplace('/platform/maternityLeave/mine/h5')
} else {
this.$toast.fail(res.msg || '保存失败');
}
})
.catch(err => {
this.$toast.clear();
this.$toast.fail('网络错误,请稍后重试');
});
},
// 提交前进行表单验证
async validateForm() {
const errors = [];
// 根据性别确定需要验证的字段
const isMale = this.formData.sex === '男性' || this.formData.sex === '男';
const isFemale = this.formData.sex === '女性' || this.formData.sex === '女';
// 必填字段验证
if (!this.formData.loverName) {
errors.push('请输入爱人姓名');
}
if (!this.formData.loverSex) {
errors.push('请选择爱人性别');
}
if (!this.formData.loverNationName) {
errors.push('请选择爱人民族');
}
if (!this.formData.loverBirthday) {
errors.push('请选择爱人出生年月');
}
if (!this.formData.loverUnitName) {
errors.push('请输入爱人工作单位');
}
// 根据性别验证假期字段
if (isMale) {
if (!this.formData.withLeave && this.formData.withLeave !== 0) {
errors.push('请输入陪产假天数');
}
if (!this.formData.parentalLeave && this.formData.parentalLeave !== 0) {
errors.push('请输入育儿假天数');
}
}
if (isFemale) {
if (!this.formData.maternityLeave && this.formData.maternityLeave !== 0) {
errors.push('请输入产假天数');
}
if (!this.formData.extendLeave && this.formData.extendLeave !== 0) {
errors.push('请输入延长假天数');
}
if (!this.formData.birthsLeave && this.formData.birthsLeave !== 0) {
errors.push('请输入多胞胎天数');
}
if (!this.formData.difficultLeave && this.formData.difficultLeave !== 0) {
errors.push('请输入难产假天数');
}
}
// 所人性别都需要填写的字段
if (!this.formData.winterLeave && this.formData.winterLeave !== 0) {
errors.push('请输入寒假天数');
}
if (!this.formData.summerLeave && this.formData.summerLeave !== 0) {
errors.push('请输入暑假天数');
}
if (!this.formData.startTime) {
errors.push('请选择休假开始时间');
}
if (!this.formData.endTime) {
errors.push('请选择休假结束时间');
}
if (!this.formData.childrenBirthday) {
errors.push('请选择子女出生日期');
}
return errors;
},
// 提交
async onSubmit() {
// 提交时进行表单验证
const errors = await this.validateForm();
if (errors.length > 0) {
this.$toast.fail(errors[0]); // 显示第一条错误信息
return;
}
this.$axios.post('/platform/maternityLeave/apply/submit', {data: JSON.stringify(this.formData)})
.then(res => {
this.$toast.clear();
if (res.code === 0) {
this.$toast.success("提交成功");
pjaxReplace('/platform/maternityLeave/mine/h5')
} else {
this.$toast.fail(res.msg || '提交失败');
}
})
.catch(err => {
this.$toast.clear();
this.$toast.fail('网络错误,请稍后重试');
});
},
// 再次提交
async onSubmitAgain() {
// 提交时进行表单验证
const errors = await this.validateForm();
if (errors.length > 0) {
this.$toast.fail(errors[0]); // 显示第一条错误信息
return;
}
this.$axios.post('/platform/maternityLeave/apply/submitAgain', {
data: JSON.stringify(this.formData),
taskId: GetQueryString("taskId")
}).then(res => {
this.$toast.clear();
if (res.code === 0) {
this.$toast.success("提交成功");
setTimeout(() => {
pjaxReplace('/platform/maternityLeave/mine/h5')
}, 1500);
} else {
this.$toast.fail(res.msg || '提交失败');
}
}).catch(err => {
this.$toast.clear();
this.$toast.fail('网络错误,请稍后重试');
});
},
// 出生日期确认事件
onLoverBirthdayConfirm(value) {
this.$set(this.formData, "loverBirthday", this.$moment(value).format("YYYY-MM-DD"));
this.showLoverBirthdayPicker = false;
},
// 休假开始时间确认事件
onStartTimeConfirm(value) {
this.$set(this.formData, "startTime", this.$moment(value).format("YYYY-MM-DD"));
this.showStartTimePicker = false;
},
// 休假结束时间确认事件
onEndTimeConfirm(value) {
this.$set(this.formData, "endTime", this.$moment(value).format("YYYY-MM-DD"));
this.showEndTimePicker = false;
},
// 子女出生日期确认事件
onChildrenBirthdayConfirm(value) {
this.$set(this.formData, "childrenBirthday", this.$moment(value).format("YYYY-MM-DD"));
this.showChildrenBirthdayPicker = false;
},
onLoverNationConfirm(o) {
this.$set(this.formData, "loverNationName", o.text); // 显示名称
this.$set(this.formData, "loverNation", o.value); // 字典值
this.showLoverNationPicker = false;
},
// 添加性别确认方法
onLoverSexConfirm(o) {
this.$set(this.formData, "loverSex", o.text);
this.showLoverSexPicker = false;
},
async initDictOptions() {
// 民族
const loverNationData = await this.$businessTool.getDictOptions('USER_NATION')
this.loverNationColumns = loverNationData.map(item => {
return {value: item.code, text: item.name}
})
},
init() {
this.bizId = GetQueryString("bizId")
if (this.bizId) {
this.$axios.post("/platform/maternityLeave/apply/findOne", {id: this.bizId}).then((res) => {
if (res.code === 0) {
// 先保存原始数据
const originalData = {...res.data};
this.formData = res.data;
// 处理支付方式显示
if (this.loverNationColumns.length > 0) {
const matched = this.loverNationColumns.find(item =>
item.value === originalData.loverNation
)
if (matched) {
this.$set(this.formData, "loverNationName", matched.text)
this.$set(this.formData, "loverNation", matched.value)
}
}
}
})
} else {
const user = this.$store.state.user
this.$set(this.formData, "userId", user.id)
this.$set(this.formData, "userName", user.username)
this.$set(this.formData, "loginName", user.loginname)
this.$set(this.formData, "unitId", user.unitId)
this.$set(this.formData, "unitName", user.unit.name)
this.$set(this.formData, "unionId", user.union.id)
this.$set(this.formData, "unionName", user.union.name)
this.$set(this.formData, "sex", user.sex)
this.$set(this.formData, "nation", user.nation)
this.$set(this.formData, "birthday", user.birthday)
this.$set(this.formData, "mobile", user.mobile)
}
}
},
async created() {
await this.initDictOptions();
await this.init();
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,127 @@
<!--#
layout("/layouts/platform_h5.html"){
#-->
<div id="app" v-cloak>
<van-nav-bar @click-left="historyBack" left-arrow left-text="返回" title="查询统计" placeholder fixed></van-nav-bar>
<van-sticky offset-top="46px">
<van-dropdown-menu :close-on-click-outside="false" :close-on-click-overlay="false">
<van-dropdown-item :options="yearList" @change="doSearch" v-model="pageForm.year"></van-dropdown-item>
</van-dropdown-menu>
<van-search
:reverse-color="false"
:show-action="false"
@search="doSearch"
input-align="left"
placeholder="请输入职工姓名搜索"
v-model="pageForm.userName"
></van-search>
</van-sticky>
<table-list api="/platform/maternityLeave/collect/pageData" :page_form.sync="pageForm" ref="tableListRef"
@ready="doSearch" >
<template v-slot="{index,row}">
<table-column label="职工姓名">{{row.userName}}</table-column>
<table-column label="性别">{{row.sex}}</table-column>
<table-column label="工会">{{row.unionName}}</table-column>
<table-column label="所属单位">{{row.unitName}}</table-column>
<table-column label="休假天数">{{row.leaveDays}}</table-column>
<table-column label="申请时间">{{row.applyTime}}</table-column>
<table-column label="当前节点">{{row.taskName}}</table-column>
</template>
<template #actions="{index,row}">
<div class="action-btn" @click="onView(row)">
<i class="fa fa-eye"></i>
<span>查看</span>
</div>
<div class="action-btn delete" @click="onDelete(row)" v-if="$auth.hasRole('SYSADMIN')">
<i class="fa fa-trash"></i>
<span>删除</span>
</div>
</template>
</table-list>
<maternity-leave-info ref="maternityLeaveInfoRef"></maternity-leave-info>
</div>
<script>
<!--#include('../common/info.js'){}#-->
const vue = new Vue({
el: "#app",
store,
dicts: [],
components: {
"maternity-leave-info":MATERNITY_LEAVE_INFO
},
data() {
return {
viewShow: false,
yearList: [],
pageForm: {
pageNumber: 1,
pageSize: 10,
totalCount: 0,
searchKeyword: "",
year: "",
},
infoShow: false
}
},
methods: {
onView(row) {
this.showApprovalForm = false
this.$refs.maternityLeaveInfoRef.onOpen(row)
},
onRevoke(row){
this.$dialog
.confirm({
title: "提示",
message: "您确定要撤销申请吗?"
})
.then(() => {
this.$axios.post("/flow/common/revokeTask", {taskId: row.startTaskId}).then((resp) => {
this.$toast.success(resp.msg)
this.doSearch()
})
})
},
onDelete(row) {
this.$dialog
.confirm({
title: "提示",
message: "您确定要删除吗?"
})
.then(() => {
this.$axios.post("/platform/maternityLeave/mine/delete", {id: row.id}).then((resp) => {
if (resp.code === 0) {
this.$toast.success(resp.msg)
this.doSearch()
}
})
})
},
doSearch() {
this.$nextTick(() => {
this.pageForm.pageNumber = 1
this.pageForm.totalCount = 0
this.$refs.tableListRef.doSearch()
})
},
initData() {
for (let i = new Date().getFullYear() - 10; i <= new Date().getFullYear(); i++) {
this.yearList.unshift({value: i, text: i + "年"})
}
this.$set(this.pageForm, "year", this.yearList[0].value)
},
},
created() {
this.initData()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,125 @@
const MATERNITY_LEAVE_INFO = {
template:
/*language=HTML*/`
<van-action-sheet v-model="visible" title="查看详情">
<div class="detail-container">
<van-cell-group title="人员信息">
<van-cell title="职工姓名">{{ viewData.userName }}</van-cell>
<van-cell title="性别">{{ viewData.sex }}</van-cell>
<van-cell title="民族">{{ viewData.nation }}</van-cell>
<van-cell title="出生年月">{{ viewData.birthday }}</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="出生年月">{{ viewData.loverBirthday }}</van-cell>
<van-cell title="单位">{{ viewData.loverUnitName }}</van-cell>
</van-cell-group>
<van-cell-group title="假期类型">
<van-cell title="陪产假" v-if="viewData.sex === '男性' || viewData.sex === '男'">{{ viewData.withLeave }}</van-cell>
<van-cell title="育儿假" v-if="viewData.sex === '男性' || viewData.sex === '男'">{{ viewData.parentalLeave }}</van-cell>
<van-cell title="产假" v-if="viewData.sex === '女性' || viewData.sex === '女'">{{ viewData.maternityLeave }}</van-cell>
<van-cell title="延长假" v-if="viewData.sex === '女性' || viewData.sex === '女'">{{ viewData.extendLeave }}</van-cell>
<van-cell title="多胞胎" v-if="viewData.sex === '女性' || viewData.sex === '女'">{{ viewData.birthsLeave }}</van-cell>
<van-cell title="难产假" v-if="viewData.sex === '女性' || viewData.sex === '女'">{{ viewData.difficultLeave }}</van-cell>
<van-cell title="寒假">{{ viewData.winterLeave }}</van-cell>
<van-cell title="暑假">{{ viewData.summerLeave }}</van-cell>
<van-cell title="合计">{{ viewData.leaveDays }}</van-cell>
<van-cell title="休假时间起">{{ viewData.startTime }}</van-cell>
<van-cell title="休假时间止">{{ viewData.endTime }}</van-cell>
<van-cell title="子女出生日">{{ viewData.childrenBirthday }}</van-cell>
</van-cell-group>
<template v-for="(task,index) in doneTasks">
<div class="process-title">
{{ task.displayName }}
</div>
<van-cell-group v-if="task.ext.isFirstTaskNode">
<van-cell title="申请用户">
{{ task.ext.initiatorName}}({{task.ext.initiatorAccount}})
</van-cell>
<van-cell title="申请时间">
{{ task.finishTime}}
</van-cell>
<van-cell title="办理结果">
<dict-tag :options="dict.type.PROCESS_TASK_SUBMIT_TYPE"
:value="task.ext.submitType"></dict-tag>
</van-cell>
</van-cell-group>
<van-cell-group v-else>
<van-cell title="办理用户">
{{ task.taskFormData.userName}}({{task.taskFormData.loginName}})
</van-cell>
<van-cell title="办理时间">
{{ task.finishTime}}
</van-cell>
<van-cell title="办理结果">
<dict-tag :options="dict.type.PROCESS_TASK_SUBMIT_TYPE"
:value="task.ext.submitType"></dict-tag>
</van-cell>
<van-cell title="办理意见" v-if="!task.ext.isFirstTaskNode">
<template #label>
{{
task.taskFormData.opinion
}}
</template>
</van-cell>
<van-cell title="签字" v-if="!task.ext.isFirstTaskNode">
<van-image :src="task.ext.tf_userSign"
v-if="task.ext.tf_userSign"
class="signature-image"></van-image>
</van-cell>
</van-cell-group>
</template>
</div>
<slot></slot>
</van-action-sheet>
`,
dicts: ["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()
},
// 关闭
onClose(){
this.visible = false
},
// 获取申请信息
getInfo() {
this.$axios.post("/platform/maternityLeave/apply/findOne", {id: this.row.id}).then((res) => {
if (res.code === 0) {
this.viewData = res.data
}
})
},
// 查看
openView(id) {
this.$nextTick(() => {
this.$refs.infoDialogRef.onOpen(id)
})
},
// 获取已办任务审批记录
getDoneTasks() {
this.$axios.post("/flow/common/doneTasks", {bizId: this.row.id}).then((res) => {
if (res.code === 0) {
this.doneTasks = res.data
}
})
},
},
}
@@ -0,0 +1,133 @@
<!--#
layout("/layouts/platform_h5.html"){
#-->
<div id="app" v-cloak>
<van-nav-bar @click-left="historyBack" left-arrow left-text="返回" title="我的申请" placeholder fixed></van-nav-bar>
<van-sticky offset-top="46px">
<van-dropdown-menu :close-on-click-outside="false" :close-on-click-overlay="false">
<van-dropdown-item :options="yearList" @change="doSearch" v-model="pageForm.year"></van-dropdown-item>
</van-dropdown-menu>
</van-sticky>
<table-list api="/platform/maternityLeave/mine/pageData" :page_form.sync="pageForm" ref="tableListRef"
@ready="doSearch" >
<template v-slot="{index,row}">
<table-column label="职工姓名">{{row.userName}}</table-column>
<table-column label="性别">{{row.sex}}</table-column>
<table-column label="工会">{{row.unionName}}</table-column>
<table-column label="所属单位">{{row.unitName}}</table-column>
<table-column label="休假天数">{{row.leaveDays}}</table-column>
<table-column label="申请时间">{{row.applyTime}}</table-column>
<table-column label="当前节点">{{row.taskName}}</table-column>
</template>
<template #actions="{index,row}">
<div class="action-btn" @click="onView(row)">
<i class="fa fa-eye"></i>
<span>查看</span>
</div>
<div class="action-btn" @click="onEdit(row)" v-if="row.taskKey === 'startTask' || !row.instanceId">
<i class="fa fa-edit"></i>
<span>编辑</span>
</div>
<div class="action-btn delete" v-if="row.canRevoke" @click="onRevoke(row)">
<i class="fa fa-undo"></i>
<span>撤回</span>
</div>
<div class="action-btn delete" @click="onDelete(row)" v-if="row.taskKey === 'startTask' || !row.instanceId">
<i class="fa fa-trash"></i>
<span>删除</span>
</div>
</template>
</table-list>
<maternity-leave-info ref="maternityLeaveInfoRef"></maternity-leave-info>
</div>
<script>
<!--#include('../common/info.js'){}#-->
const vue = new Vue({
el: "#app",
store,
dicts: [],
components: {
"maternity-leave-info":MATERNITY_LEAVE_INFO
},
data() {
return {
viewShow: false,
yearList: [],
pageForm: {
pageNumber: 1,
pageSize: 10,
totalCount: 0,
searchKeyword: "",
year: "",
},
infoShow: false
}
},
methods: {
onView(row) {
this.showApprovalForm = false
this.$refs.maternityLeaveInfoRef.onOpen(row)
},
onEdit(row) {
this.$pjaxReplace('/platform/maternityLeave/apply/h5?taskId=' + (row.startTaskId || '') + "&bizId=" + row.id)
},
onRevoke(row){
this.$dialog
.confirm({
title: "提示",
message: "您确定要撤销申请吗?"
})
.then(() => {
this.$axios.post("/flow/common/revokeTask", {taskId: row.startTaskId}).then((resp) => {
this.$toast.success(resp.msg)
this.doSearch()
})
})
},
onDelete(row) {
this.$dialog
.confirm({
title: "提示",
message: "您确定要删除吗?"
})
.then(() => {
this.$axios.post("/platform/maternityLeave/mine/delete", {id: row.id}).then((resp) => {
if (resp.code === 0) {
this.$toast.success(resp.msg)
this.doSearch()
}
})
})
},
doSearch() {
this.$nextTick(() => {
this.pageForm.pageNumber = 1
this.pageForm.totalCount = 0
this.$refs.tableListRef.doSearch()
})
},
initData() {
for (let i = new Date().getFullYear() - 10; i <= new Date().getFullYear(); i++) {
this.yearList.unshift({value: i, text: i + "年"})
}
this.$set(this.pageForm, "year", this.yearList[0].value)
},
},
created() {
this.initData()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,167 @@
<!--#
layout("/layouts/platform_h5.html"){
#-->
<div id="app" v-cloak>
<van-nav-bar @click-left="historyBack" left-arrow left-text="返回" title="校工会审核" placeholder fixed></van-nav-bar>
<van-sticky offset-top="46px">
<van-search
:reverse-color="false"
:show-action="false"
@search="doSearch"
input-align="left"
placeholder="请输入职工姓名搜索"
v-model="pageForm.userName"
></van-search>
<van-tabs v-model="pageForm.approvalText"
@change="(val)=>{this.pageForm.approval = val==='1';this.doSearch();}">
<van-tab title="已审核" name="1"></van-tab>
<van-tab title="未审核" name="0"></van-tab>
</van-tabs>
</van-sticky>
<table-list api="/platform/maternityLeave/schoolAudit/pageData" :page_form.sync="pageForm" ref="tableListRef"
@ready="doSearch" >
<template v-slot="{index,row}">
<table-column label="职工姓名">{{row.userName}}</table-column>
<table-column label="性别">{{row.sex}}</table-column>
<table-column label="工会">{{row.unionName}}</table-column>
<table-column label="所属单位">{{row.unitName}}</table-column>
<table-column label="休假天数">{{row.leaveDays}}</table-column>
<table-column label="申请时间">{{row.applyTime}}</table-column>
<table-column label="当前节点">{{row.curTaskName}}</table-column>
</template>
<template #actions="{index,row}">
<div class="action-btn" @click="onView(row)">
<i class="fa fa-eye"></i>
<span>查看</span>
</div>
<div class="action-btn" v-if="row.taskState === 10" @click="onAudit(row)">
<i class="fa fa-edit"></i>
<span>审核</span>
</div>
</template>
</table-list>
<maternity-leave-info ref="maternityLeaveInfoRef">
<div v-if="showApprovalForm">
<div class="process-title">
校工会审核
</div>
<div class="form-container">
<van-form ref="formRef">
<van-cell-group title="审批意见">
<van-field label=""
:rules="[{ required: true,message:'请填审批意见' }]"
v-model="formData.tf_opinion"
required
type="textarea"
name="tf_opinion"
rows="4"
autosize
class="more-text"
placeholder="请填审批意见"></van-field>
</van-cell-group>
<van-cell-group title="电子签名" class="form-section">
<van-field class="more-text" name="tf_userSign" label="">
<template #input>
<h5-signature v-model="formData.tf_userSign" slot="input"></h5-signature>
</template>
</van-field>
</van-cell-group>
<!-- 按钮区域 -->
<div class="form-actions">
<van-button type="danger" @click="handleTaskAction(6)">退回到发起人</van-button>
<van-button type="danger" @click="handleTaskAction(2)">拒绝申请</van-button>
<van-button type="primary" @click="handleTaskAction(1)">同意申请</van-button>
</div>
</van-form>
</div>
</div>
</maternity-leave-info>
</div>
<script>
<!--#include('../common/info.js'){}#-->
const vue = new Vue({
el: "#app",
store,
dicts: [],
components: {
"maternity-leave-info":MATERNITY_LEAVE_INFO
},
data() {
return {
pageForm: {
pageNumber: 1,
pageSize: 10,
totalCount: 0,
searchKeyword: "",
approvalText: "0",
approval: false,
year: new Date().getFullYear(),
},
formData: {},
showApprovalForm: false,
infoShow: false
}
},
methods: {
handleTaskAction(val) {
this.$refs.formRef.validate().then(() => {
this.$dialog.confirm({
title: '温馨提示',
message: '您确定要提交吗?',
}).then(() => {
this.$axios.post('/flow/common/executeTask', {
data: JSON.stringify({
...this.formData,
submitType: val
})
}).then(res => {
if (res.code === 0) {
this.$toast.success("提交成功")
this.doSearch()
this.$refs.maternityLeaveInfoRef.onClose()
}
})
}).catch(() => {
// on cancel
});
}).catch();
},
onView(row) {
this.showApprovalForm = false
this.$refs.maternityLeaveInfoRef.onOpen(row)
},
onAudit(row) {
this.showApprovalForm = true
this.formData = {
tf_opinion: null,
tf_userSign: null,
processTaskId: row.taskId,
taskName: row.curTaskName
}
this.$refs.maternityLeaveInfoRef.onOpen(row)
},
doSearch() {
this.$nextTick(() => {
this.pageForm.pageNumber = 1
this.pageForm.totalCount = 0
this.$refs.tableListRef.doSearch()
})
},
},
created() {
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,167 @@
<!--#
layout("/layouts/platform_h5.html"){
#-->
<div id="app" v-cloak>
<van-nav-bar @click-left="historyBack" left-arrow left-text="返回" title="分工会审核" placeholder fixed></van-nav-bar>
<van-sticky offset-top="46px">
<van-search
:reverse-color="false"
:show-action="false"
@search="doSearch"
input-align="left"
placeholder="请输入职工姓名搜索"
v-model="pageForm.userName"
></van-search>
<van-tabs v-model="pageForm.approvalText"
@change="(val)=>{this.pageForm.approval = val==='1';this.doSearch();}">
<van-tab title="已审核" name="1"></van-tab>
<van-tab title="未审核" name="0"></van-tab>
</van-tabs>
</van-sticky>
<table-list api="/platform/maternityLeave/unionAudit/pageData" :page_form.sync="pageForm" ref="tableListRef"
@ready="doSearch" >
<template v-slot="{index,row}">
<table-column label="职工姓名">{{row.userName}}</table-column>
<table-column label="性别">{{row.sex}}</table-column>
<table-column label="工会">{{row.unionName}}</table-column>
<table-column label="所属单位">{{row.unitName}}</table-column>
<table-column label="休假天数">{{row.leaveDays}}</table-column>
<table-column label="申请时间">{{row.applyTime}}</table-column>
<table-column label="当前节点">{{row.curTaskName}}</table-column>
</template>
<template #actions="{index,row}">
<div class="action-btn" @click="onView(row)">
<i class="fa fa-eye"></i>
<span>查看</span>
</div>
<div class="action-btn" v-if="row.taskState === 10" @click="onAudit(row)">
<i class="fa fa-edit"></i>
<span>审核</span>
</div>
</template>
</table-list>
<maternity-leave-info ref="maternityLeaveInfoRef">
<div v-if="showApprovalForm">
<div class="process-title">
分工会审核
</div>
<div class="form-container">
<van-form ref="formRef">
<van-cell-group title="审批意见">
<van-field label=""
:rules="[{ required: true,message:'请填审批意见' }]"
v-model="formData.tf_opinion"
required
type="textarea"
name="tf_opinion"
rows="4"
autosize
class="more-text"
placeholder="请填审批意见"></van-field>
</van-cell-group>
<van-cell-group title="电子签名" class="form-section">
<van-field class="more-text" name="tf_userSign" label="">
<template #input>
<h5-signature v-model="formData.tf_userSign" slot="input"></h5-signature>
</template>
</van-field>
</van-cell-group>
<!-- 按钮区域 -->
<div class="form-actions">
<van-button type="danger" @click="handleTaskAction(6)">退回到发起人</van-button>
<van-button type="danger" @click="handleTaskAction(2)">拒绝申请</van-button>
<van-button type="primary" @click="handleTaskAction(1)">同意申请</van-button>
</div>
</van-form>
</div>
</div>
</maternity-leave-info>
</div>
<script>
<!--#include('../common/info.js'){}#-->
const vue = new Vue({
el: "#app",
store,
dicts: [],
components: {
"maternity-leave-info":MATERNITY_LEAVE_INFO
},
data() {
return {
pageForm: {
pageNumber: 1,
pageSize: 10,
totalCount: 0,
searchKeyword: "",
approvalText: "0",
approval: false,
year: new Date().getFullYear(),
},
formData: {},
showApprovalForm: false,
infoShow: false
}
},
methods: {
handleTaskAction(val) {
this.$refs.formRef.validate().then(() => {
this.$dialog.confirm({
title: '温馨提示',
message: '您确定要提交吗?',
}).then(() => {
this.$axios.post('/flow/common/executeTask', {
data: JSON.stringify({
...this.formData,
submitType: val
})
}).then(res => {
if (res.code === 0) {
this.$toast.success("提交成功")
this.doSearch()
this.$refs.maternityLeaveInfoRef.onClose()
}
})
}).catch(() => {
// on cancel
});
}).catch();
},
onView(row) {
this.showApprovalForm = false
this.$refs.maternityLeaveInfoRef.onOpen(row)
},
onAudit(row) {
this.showApprovalForm = true
this.formData = {
tf_opinion: null,
tf_userSign: null,
processTaskId: row.taskId,
taskName: row.curTaskName
}
this.$refs.maternityLeaveInfoRef.onOpen(row)
},
doSearch() {
this.$nextTick(() => {
this.pageForm.pageNumber = 1
this.pageForm.totalCount = 0
this.$refs.tableListRef.doSearch()
})
},
},
created() {
}
})
</script>
<!--#
}
#-->