This commit is contained in:
zhengziru
2025-05-09 10:06:26 +08:00
12 changed files with 961 additions and 539 deletions
@@ -523,6 +523,7 @@ public class WelfareCommonController {
Sql sql = Sqls.create(""" Sql sql = Sqls.create("""
SELECT SELECT
id, id,
mobile,
loginname, loginname,
username, username,
personType, personType,
@@ -571,8 +572,9 @@ public class WelfareCommonController {
List<ExcelExportEntity> entityList = new ArrayList<>(); List<ExcelExportEntity> entityList = new ArrayList<>();
entityList.add(new ExcelExportEntity("工号", "loginname", 20)); entityList.add(new ExcelExportEntity("工号", "loginname", 20));
entityList.add(new ExcelExportEntity("姓名", "username", 20)); entityList.add(new ExcelExportEntity("姓名", "username", 20));
entityList.add(new ExcelExportEntity("联系电话", "mobile", 20));
entityList.add(new ExcelExportEntity("在职状态", "userState", 20)); entityList.add(new ExcelExportEntity("在职状态", "userState", 20));
entityList.add(new ExcelExportEntity("人员性质", "personType", 20)); // entityList.add(new ExcelExportEntity("人员类型", "personType", 20));
entityList.add(new ExcelExportEntity("所属工会", "unionname", 50)); entityList.add(new ExcelExportEntity("所属工会", "unionname", 50));
entityList.add(new ExcelExportEntity("所属单位", "unitname", 50)); entityList.add(new ExcelExportEntity("所属单位", "unitname", 50));
@@ -8,6 +8,7 @@ import cn.afterturn.easypoi.excel.entity.TemplateExportParams;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType; import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity; import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.afterturn.easypoi.excel.export.ExcelExportService; import cn.afterturn.easypoi.excel.export.ExcelExportService;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.io.FileUtil; import cn.hutool.core.io.FileUtil;
import cn.hutool.core.lang.Assert; import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
@@ -43,6 +44,7 @@ import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean; import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.json.Json; import org.nutz.json.Json;
import org.nutz.lang.Lang; import org.nutz.lang.Lang;
import org.nutz.lang.random.R;
import org.nutz.lang.util.NutMap; import org.nutz.lang.util.NutMap;
import org.nutz.mvc.annotation.AdaptBy; import org.nutz.mvc.annotation.AdaptBy;
import org.nutz.mvc.annotation.At; import org.nutz.mvc.annotation.At;
@@ -96,16 +98,18 @@ public class WelfareListController {
@Param(value = "provideMode", required = false) Integer provideMode, @Param(value = "provideMode", required = false) Integer provideMode,
@Param(value = "optionId", required = false) String optionId, @Param(value = "optionId", required = false) String optionId,
@Param(value = "month", required = false) String month, @Param(value = "month", required = false) String month,
@Param(value = "isChoose", required = false) Integer isChoose,
@Param(value = "courierNumber", required = false) String courierNumber) { @Param(value = "courierNumber", required = false) String courierNumber) {
Sql sql = Sqls.create(""" Sql sql = Sqls.create("""
SELECT SELECT
CASE CASE
WHEN WHEN
wus.selectUserId IS NOT NULL THEN wus.selectUserId IS NOT NULL THEN
1 ELSE 0 1 ELSE 0
END AS isChoose, END AS isChoose,
wl.id, wl.id,
wl.unionid,
wl.username, wl.username,
wl.loginname, wl.loginname,
wl.personType, wl.personType,
@@ -115,8 +119,13 @@ public class WelfareListController {
wl.listId, wl.listId,
wus.userSign, wus.userSign,
wus.courierNumber, wus.courierNumber,
wus.receiveAddress, GROUP_CONCAT(
GROUP_CONCAT( DISTINCT wuso.optionName, '(', wus.receiveAddress, ')' ) AS receiveAddress2, DISTINCT
CONCAT(
wuso.optionName,
IF(wus.receiveAddress IS NOT NULL AND wus.receiveAddress != '', CONCAT('(', wus.receiveAddress, ')'), '')
)
) AS receiveAddress,
GROUP_CONCAT( DISTINCT wuso.optionName, '(', wus.selectNum, '份)' ) AS gist_list GROUP_CONCAT( DISTINCT wuso.optionName, '(', wus.selectNum, '份)' ) AS gist_list
FROM FROM
view_welfare_list wl view_welfare_list wl
@@ -134,6 +143,14 @@ public class WelfareListController {
cnd.andEX("wl.unionid", "=", pageParam.getWelfareUnit()); cnd.andEX("wl.unionid", "=", pageParam.getWelfareUnit());
cnd.andEX("wl.unitid", "=", pageParam.getUnit()); cnd.andEX("wl.unitid", "=", pageParam.getUnit());
if (isChoose != null) {
if (isChoose.equals(1)) {
cnd.and("wus.selectUserId", "is not", null);
} else if (isChoose.equals(2)) {
cnd.and("wus.selectUserId", "is", null);
}
}
if (Lang.isNotEmpty(pageParam.getPersonTypes())) { if (Lang.isNotEmpty(pageParam.getPersonTypes())) {
String personTypes = pageParam.getPersonTypes(); String personTypes = pageParam.getPersonTypes();
String[] personTypeArray = Json.fromJsonAsArray(String.class, personTypes); String[] personTypeArray = Json.fromJsonAsArray(String.class, personTypes);
@@ -161,11 +178,15 @@ public class WelfareListController {
sql.setCondition(cnd); sql.setCondition(cnd);
Pagination pagination = welfareListService.list(pageForm, sql); Pagination pagination = welfareListService.list(pageForm, sql);
List<NutMap> mapList = pagination.getList(); List<NutMap> mapList = pagination.getList();
if (provideMode != 3) { List<WelfareMemberUnionConfirm> confirms = projectService.dao().query(WelfareMemberUnionConfirm.class, Cnd.where("projectId", "=", projectId));
mapList.forEach(v -> {
v.put("receiveAddress",v.getString("receiveAddress2")); mapList.forEach(v -> {
}); if (StrUtil.isNotBlank(v.getString("unionid"))) {
} WelfareMemberUnionConfirm confirm = confirms.stream().filter(o -> o.getUnionId().equals(v.getString("unionid"))).findFirst().orElse(null);
v.setv("isAudit", confirm != null ? confirm.getIsAudit() : "");
v.setv("auditTime", confirm != null ? confirm.getAuditTime() : "");
}
});
pagination.setList(mapList); pagination.setList(mapList);
return pagination; return pagination;
} }
@@ -514,7 +535,7 @@ public class WelfareListController {
WHERE WHERE
wpus.welfareId = @welfareId wpus.welfareId = @welfareId
AND wpus.selectOptionId = @selectOptionId and wpus.selectNum!=0 AND wpus.selectOptionId = @selectOptionId and wpus.selectNum!=0
""").setParam("welfareId", projectId).setParam("selectOptionId", optionId); """).setParam("welfareId", projectId).setParam("selectOptionId", optionId);
// GROUP BY wpus.selectUserId,wpus.selectOptionId ORDER BY un.unioncode // GROUP BY wpus.selectUserId,wpus.selectOptionId ORDER BY un.unioncode
@@ -652,4 +673,85 @@ public class WelfareListController {
} }
} }
@At
@ViReturn
@RequiresPermissions("welfare.list.mange")
public Object queryNotWelfareListUsers(@Param("projectId") String projectId, @Param("query") String query){
if (StrUtil.isBlank(query)) {
return null;
}
Sql sql = Sqls.create("""
SELECT
id,
loginname,
username,
unitid,
unitname
FROM
`user`
$condition
AND id not in (select userId from welfare_list where projectId = @projectId)
""").setParam("projectId", projectId);
Cnd cnd = Cnd.NEW();
SqlExpressionGroup seg = new SqlExpressionGroup();
seg.orLike("loginname", query);
seg.orLike("username", query);
cnd.and(seg);
sql.setCondition(cnd);
Pagination pagination = welfareListService.listPageMap(1, 10, sql);
return pagination;
}
@At
@ViReturn
@RequiresPermissions("welfare.list.mange")
public Object doAuditUser(@Param(value = "projectId", required = false) String projectId,
@Param(value = "unionId", required = false) String unionId,
@Param(value = "flag") Boolean flag) {
if (flag) {
welfareListService.dao().update(WelfareMemberUnionConfirm.class, Chain.make("isAudit", true)
.add("auditTime", DateUtil.date()).add("auditUser", ShiroUtil.getUserId()),
Cnd.where("projectId", "=", projectId).and("unionId", "=", unionId));
} else {
welfareListService.dao().update(WelfareMemberUnionConfirm.class, Chain.make("isAudit", null)
.add("auditTime", null).add("auditUser", null),
Cnd.where("projectId", "=", projectId).and("unionId", "=", unionId));
}
return null;
}
@At
@ViReturn
@RequiresPermissions("welfare.list.mange")
public Object addWelfareList(@Param("projectId") String projectId, @Param("userIds") String[] userIds) {
List<String> userIdList = Arrays.stream(userIds).collect(Collectors.toList());
Sql sql = Sqls.create("select id,loginname,username,unionid,unitid,userState,personType from `user` where id in (@userIdList)")
.setParam("userIdList", userIdList);
sql.setCallback(Sqls.callback.maps());
dao.execute(sql);
List<NutMap> userInfoList = (List<NutMap>) sql.getResult();
List<WelfareList> welfareLists = userInfoList.stream().map(v -> {
WelfareList welfareList = new WelfareList();
welfareList.setId(R.UU32());
welfareList.setProjectId(projectId);
welfareList.setUserId(v.getString("id"));
welfareList.setWelfareUnitId(v.getString("unionid"));
welfareList.setWelfareSecondLevelUnitId(v.getString("unitid"));
welfareList.setIsReceive(null);
welfareList.setIsAutoSelect(null);
welfareList.setUserState(v.getString("userState"));
welfareList.setPersonType(v.getString("personType"));
return welfareList;
}).collect(Collectors.toList());
dao.fastInsert(welfareLists);
return null;
}
} }
@@ -9,15 +9,13 @@ import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.utils.MsgApi; import io.v.nutz.base.utils.MsgApi;
import io.v.nutz.base.utils.Vi; import io.v.nutz.base.utils.Vi;
import io.v.nutz.sys.models.Sys_home_activity; import io.v.nutz.sys.models.Sys_home_activity;
import io.v.nutz.sys.models.Sys_union;
import io.v.nutz.sys.services.SysTaskService; import io.v.nutz.sys.services.SysTaskService;
import io.v.nutz.task.services.TaskPlatformService; import io.v.nutz.task.services.TaskPlatformService;
import io.v.nutz.zhgh.data.model.MatchConditionStructure; import io.v.nutz.zhgh.data.model.MatchConditionStructure;
import io.v.nutz.zhgh.data.service.MatchConditionStructureService; import io.v.nutz.zhgh.data.service.MatchConditionStructureService;
import io.v.nutz.zhgh.mobileHome.service.MobileHomeService; import io.v.nutz.zhgh.mobileHome.service.MobileHomeService;
import io.v.nutz.zhgh.welfare.model.WelfareProject; import io.v.nutz.zhgh.welfare.model.*;
import io.v.nutz.zhgh.welfare.model.WelfareProjectSubject;
import io.v.nutz.zhgh.welfare.model.WelfareProjectSubjectOption;
import io.v.nutz.zhgh.welfare.model.WelfareUserSelection;
import io.v.nutz.zhgh.welfare.service.WelfareListService; import io.v.nutz.zhgh.welfare.service.WelfareListService;
import io.v.nutz.zhgh.welfare.service.WelfareProjectService; import io.v.nutz.zhgh.welfare.service.WelfareProjectService;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
@@ -39,6 +37,7 @@ import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param; import org.nutz.mvc.annotation.Param;
import org.nutz.trans.Trans; import org.nutz.trans.Trans;
import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@@ -237,6 +236,21 @@ public class WelfareProjectMangeController {
dao.update(project); dao.update(project);
} }
dao.clear(WelfareMemberUnionConfirm.class, Cnd.where("projectId","=",project.getId()));
List<Sys_union> unionList = dao.query(Sys_union.class, Cnd.NEW());
List<WelfareMemberUnionConfirm> confirmList = new ArrayList<>();
for (Sys_union union : unionList) {
WelfareMemberUnionConfirm confirm = new WelfareMemberUnionConfirm();
confirm.setId(R.UU32());
confirm.setProjectId(project.getId());
confirm.setUnionId(union.getId());
confirm.setIsAudit(false);
confirmList.add(confirm);
}
dao.fastInsert(confirmList);
Sys_home_activity sysHomeActivity = project.covertToSysHomeActivity(); Sys_home_activity sysHomeActivity = project.covertToSysHomeActivity();
sysHomeActivity.setEnable(true); sysHomeActivity.setEnable(true);
dao.insertOrUpdate(sysHomeActivity); dao.insertOrUpdate(sysHomeActivity);
@@ -1,10 +1,13 @@
package io.v.nutz.zhgh.welfare.controller; package io.v.nutz.zhgh.welfare.controller;
import cn.hutool.core.util.StrUtil;
import cn.wizzer.framework.base.Result; import cn.wizzer.framework.base.Result;
import cn.wizzer.framework.page.Pagination; import cn.wizzer.framework.page.Pagination;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.query.PageForm; import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.service.SimpleService; import io.v.nutz.base.service.SimpleService;
import io.v.nutz.sys.models.Sys_user;
import io.v.nutz.sys.services.SysUserService;
import io.v.nutz.web.commons.slog.annotation.SLog; import io.v.nutz.web.commons.slog.annotation.SLog;
import io.v.nutz.web.commons.utils.ShiroUtil; import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.welfare.model.WelfareList; import io.v.nutz.zhgh.welfare.model.WelfareList;
@@ -14,6 +17,7 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.aop.interceptor.ioc.TransAop; import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Chain; import org.nutz.dao.Chain;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.dao.Sqls; import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql; import org.nutz.dao.sql.Sql;
import org.nutz.ioc.aop.Aop; import org.nutz.ioc.aop.Aop;
@@ -27,6 +31,7 @@ import org.nutz.mvc.annotation.Param;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.concurrent.locks.ReentrantLock;
/** /**
* @ClassName WelfareChooseController * @ClassName WelfareChooseController
@@ -39,12 +44,17 @@ import java.util.List;
@At("/platform/welfare/userChoose") @At("/platform/welfare/userChoose")
public class WelfareUserChooseController { public class WelfareUserChooseController {
@Inject
private Dao dao;
@Inject @Inject
private SimpleService simpleService; private SimpleService simpleService;
@Inject
private SysUserService sysUserService;
@Inject @Inject
private WelfareProjectService welfareProjectService; private WelfareProjectService welfareProjectService;
private final ReentrantLock lock = new ReentrantLock(true);
@At("") @At("")
@Ok("beetl:/platform/welfare/userChoose.html") @Ok("beetl:/platform/welfare/userChoose.html")
@RequiresPermissions("welfare.user.choose") @RequiresPermissions("welfare.user.choose")
@@ -94,30 +104,44 @@ public class WelfareUserChooseController {
@Aop(TransAop.READ_COMMITTED) @Aop(TransAop.READ_COMMITTED)
@SLog(type = "welfare", tag = "pc电脑选福利", msg = "福利") @SLog(type = "welfare", tag = "pc电脑选福利", msg = "福利")
@RequiresPermissions("welfare.user.choose") @RequiresPermissions("welfare.user.choose")
public Object doChoose(String chooseIds, String projectId, String subjectId, String receiveAddress) { public Object doChoose(String chooseIds, String projectId, String subjectId, String receiveAddress,
//删除上次选择的 @Param(value = "mobile",required = false) String mobile) {
simpleService.dao().clear(WelfareUserSelection.class, Cnd.where("welfareId", "=", projectId) try {
.and("selectUserId", "=", ShiroUtil.getUserId())); lock.lock();
String userId = ShiroUtil.getUserId();
//删除上次选择的
simpleService.dao().clear(WelfareUserSelection.class, Cnd.where("welfareId", "=", projectId)
.and("selectUserId", "=", userId));
List<WelfareUserSelection> insertList = new ArrayList<>(); List<WelfareUserSelection> insertList = new ArrayList<>();
List<String> ids = Json.fromJsonAsList(String.class, chooseIds); List<String> ids = Json.fromJsonAsList(String.class, chooseIds);
ids.forEach(s -> { ids.forEach(s -> {
WelfareUserSelection selection = new WelfareUserSelection(); WelfareUserSelection selection = new WelfareUserSelection();
selection.setWelfareId(projectId); selection.setWelfareId(projectId);
selection.setSubjectId(subjectId); selection.setSubjectId(subjectId);
selection.setSelectUserId(ShiroUtil.getUserId()); selection.setSelectUserId(userId);
selection.setSelectTime(new Date()); selection.setSelectTime(new Date());
selection.setSelectOptionId(s); selection.setSelectOptionId(s);
selection.setReceiveAddress(receiveAddress); selection.setReceiveAddress(receiveAddress);
insertList.add(selection); insertList.add(selection);
}); });
simpleService.dao().insert(insertList); simpleService.dao().insert(insertList);
simpleService.dao().update(WelfareList.class, simpleService.dao().update(WelfareList.class,
Chain.make("isReceive", true), Chain.make("isReceive", true),
Cnd.where("projectId", "=", projectId) Cnd.where("projectId", "=", projectId)
.and("userId", "=", ShiroUtil.getUserId())); .and("userId", "=", userId));
return null;
if (StrUtil.isNotBlank(mobile)) {
dao.update(Sys_user.class, Chain.make("mobile", mobile), Cnd.where("id", "=", userId));
}
return Result.success();
} catch (Exception e) {
e.printStackTrace();
return Result.error();
} finally {
lock.unlock();
}
} }
@@ -127,25 +151,55 @@ public class WelfareUserChooseController {
@SLog(type = "welfare", tag = "选择福利", msg = "福利") @SLog(type = "welfare", tag = "选择福利", msg = "福利")
@RequiresPermissions("welfare.user.choose") @RequiresPermissions("welfare.user.choose")
public Result confirmSelect(@Param("welfareUserSelections") WelfareUserSelection[] welfareUserSelections, public Result confirmSelect(@Param("welfareUserSelections") WelfareUserSelection[] welfareUserSelections,
String projectId) { String projectId, @Param(value = "mobile",required = false) String mobile) {
//删除上次选择的
simpleService.dao().clear(WelfareUserSelection.class,
Cnd.where("welfareId", "=", projectId)
.and("selectUserId", "=", ShiroUtil.getUserId()));
for (WelfareUserSelection welfareUserSelection : welfareUserSelections) { try {
welfareUserSelection.setSelectUserId(ShiroUtil.getUserId()); lock.lock();
welfareUserSelection.setSelectTime(new Date()); String userId = ShiroUtil.getUserId();
int count = simpleService.dao().count(WelfareList.class, Cnd.where("projectId", "=", projectId).and("userId", "=", userId));
if (count <= 0) {
return Result.error("您不在此次选择名单中,如有疑问请及时联系校工会");
}
//删除上次选择的
simpleService.dao().clear(WelfareUserSelection.class,
Cnd.where("welfareId", "=", projectId)
.and("selectUserId", "=", userId));
for (WelfareUserSelection welfareUserSelection : welfareUserSelections) {
welfareUserSelection.setSelectUserId(userId);
welfareUserSelection.setSelectTime(new Date());
}
simpleService.dao().insert(welfareUserSelections);
simpleService.dao().update(WelfareList.class,
Chain.make("isReceive", true),
Cnd.where("projectId", "=", projectId)
.and("userId", "=", userId));
if (StrUtil.isNotBlank(mobile)) {
dao.update(Sys_user.class, Chain.make("mobile", mobile), Cnd.where("id", "=", userId));
}
return Result.success("选择成功");
} catch (Exception e) {
e.printStackTrace();
return Result.error();
} finally {
lock.unlock();
} }
simpleService.dao().insert(welfareUserSelections);
simpleService.dao().update(WelfareList.class,
Chain.make("isReceive", true),
Cnd.where("projectId", "=", projectId)
.and("userId", "=", ShiroUtil.getUserId()));
return Result.success("选择成功");
} }
@At
@ViReturn
@RequiresPermissions("welfare.user.choose")
public Object getUserMobile() {
Sql sql = Sqls.create("SELECT mobile FROM sys_user WHERE id = @userId").setParam("userId", ShiroUtil.getUserId());
sql.setCallback(Sqls.callback.str());
dao.execute(sql);
return sql.getResult();
}
} }
@@ -0,0 +1,49 @@
package io.v.nutz.zhgh.welfare.model;
import io.v.nutz.base.model.BaseModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert;
import java.util.Date;
@Data
@Table
@EqualsAndHashCode(callSuper = true)
public class WelfareMemberUnionConfirm extends BaseModel {
@Column
@Name
@Comment("ID")
@ColDefine(type = ColType.VARCHAR, width = 32)
@PrevInsert(uu32 = true)
private String id;
@Column
@Comment("所属项目")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String projectId;
@Column
@Comment("工会id")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String unionId;
@Column
@Comment("是否确认")
@ColDefine(type = ColType.BOOLEAN)
private Boolean isAudit;
@Column
@Comment("确认时间")
@ColDefine(type = ColType.DATETIME)
private Date auditTime;
@Column
@Comment("操作人")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String auditUser;
}
@@ -203,11 +203,14 @@ public class WelfareSingleServiceImpl extends ViServiceImpl<WelfareProject> impl
boolean isThreeUnit = Globals.MyConfig.getBoolean("isThreeUnit"); boolean isThreeUnit = Globals.MyConfig.getBoolean("isThreeUnit");
Sql welfareUnitSql = Sqls.create(""" Sql welfareUnitSql = Sqls.create("""
SELECT SELECT
unit.* unit.*,
wmuc.isAudit
FROM FROM
welfare_unit unit welfare_unit unit
LEFT JOIN welfare_member_union_confirm wmuc ON wmuc.projectId = @projectId
AND wmuc.unionId = unit.welfareUnitId
$condition $condition
"""); """).setParam("projectId", projectId);
CndPlus cnd = CndPlus.create(); CndPlus cnd = CndPlus.create();
if (!ShiroUtil.hasAnyRoles("sysadmin,SchoolUnionAdmin,SchoolUnionWelfareAdmin")) { if (!ShiroUtil.hasAnyRoles("sysadmin,SchoolUnionAdmin,SchoolUnionWelfareAdmin")) {
@@ -322,6 +322,9 @@ layout("/mobile/platform.html"){
style="border-radius: 8px; background: #ffffff" style="border-radius: 8px; background: #ffffff"
></van-card> ></van-card>
<div class="van-hairline--top"></div> <div class="van-hairline--top"></div>
<van-cell>
<van-field label="联系方式" v-model="mobile" required placeholder="请输入联系方式" type="tel" maxlength="11"></van-field>
</van-cell>
<van-cell @click="openShoppingPopup(item,index)" is-link title="收货门店" v-if="item.shoppingId"> <van-cell @click="openShoppingPopup(item,index)" is-link title="收货门店" v-if="item.shoppingId">
<template #label>{{item.receiveAddress?item.receiveAddress:'暂未选择'}}</template> <template #label>{{item.receiveAddress?item.receiveAddress:'暂未选择'}}</template>
</van-cell> </van-cell>
@@ -420,7 +423,8 @@ layout("/mobile/platform.html"){
optionIndex: null, optionIndex: null,
optionData: {}, optionData: {},
clickUpOrDown: false clickUpOrDown: false,
mobile: ""
} }
}, },
computed: { computed: {
@@ -486,8 +490,8 @@ layout("/mobile/platform.html"){
}, },
methods: { methods: {
addShopping(address) { addShopping(address) {
this.$set(this.projectInfo.welfareProjectSubjects[0].options[this.optionIndex], "receiveAddress", address) this.$set(this.selectedOptions[this.optionIndex], "receiveAddress", address)
this.projectInfo.welfareProjectSubjects[0].options[this.optionIndex].receiveAddress = address this.selectedOptions[this.optionIndex].receiveAddress = address
this.shoppingPopup = false this.shoppingPopup = false
}, },
async onSearchShoppingAddress() { async onSearchShoppingAddress() {
@@ -613,6 +617,12 @@ layout("/mobile/platform.html"){
return return
} }
} }
if (!this.mobile || !this.mobile.match(/^1[3-9]\d{9}$/)) {
this.$modal.msg("请填写正确的手机号码")
return
}
const notReceiveAddress = [] const notReceiveAddress = []
const formData = this.projectInfo.welfareProjectSubjects[0].options const formData = this.projectInfo.welfareProjectSubjects[0].options
.filter((v) => v.selectNum >= 1) .filter((v) => v.selectNum >= 1)
@@ -639,11 +649,15 @@ layout("/mobile/platform.html"){
}) })
if (code === 0) { if (code === 0) {
this.getUserSelection(this.projectId) this.getUserSelection(this.projectId)
this.$modal.msgSuccess(msg) // this.$modal.msgSuccess(msg)
pjaxReplace("/mobile/welfare/list/receive_success?projectId=" + this.projectId + "&provideMode=" + this.projectInfo.provideMode)
} else { } else {
this.$modal.msgError(msg) vant.Dialog.alert({
title: "温馨提示",
message: msg
})
} }
this.confirmPopup = false // this.confirmPopup = false
}, },
//查看详情 //查看详情
@@ -714,6 +728,12 @@ layout("/mobile/platform.html"){
async getShoppingType() { async getShoppingType() {
const resp = await $.get("/platform/shoppingType/apply/getShoppingType") const resp = await $.get("/platform/shoppingType/apply/getShoppingType")
return resp.data return resp.data
},
async getUserMobile() {
const resp = await $.post("/platform/welfare/userChoose/getUserMobile")
if (resp.code === 0) {
this.$set(this, "mobile", resp.data)
}
} }
}, },
async created() { async created() {
@@ -739,8 +759,15 @@ layout("/mobile/platform.html"){
window.sessionStorage.removeItem("welfareProjectSelectInfo" + loginname) window.sessionStorage.removeItem("welfareProjectSelectInfo" + loginname)
// this.selectAddressPopup = true // this.selectAddressPopup = true
} else { } else {
const flag = localStorage.getItem("reload")
if (flag) {
window.location.reload()
localStorage.removeItem("reload")
}
this.getProjectInfo() this.getProjectInfo()
} }
await this.getUserMobile()
} }
}) })
window.addEventListener("pageshow", (e) => { window.addEventListener("pageshow", (e) => {
@@ -8,38 +8,47 @@ layout("/mobile/platform.html"){
</style> </style>
<div id="app" v-cloak> <div id="app" v-cloak>
<van-sticky> <van-sticky>
<van-nav-bar :title="title" left-arrow <van-nav-bar :title="title" left-arrow @click-left="back"></van-nav-bar>
@click-left="history.back()"></van-nav-bar>
</van-sticky> </van-sticky>
<div style="text-align: center;margin-top: 200px;"> <div style="text-align: center; margin-top: 200px">
<svg t="1642388297798" class="icon" viewBox="0 0 1024 1024" version="1.1" <svg
xmlns="http://www.w3.org/2000/svg" t="1642388297798"
p-id="3082" width="80" height="80"> class="icon"
<path d="M37.36963 583.753525a440.246475 430.879529 90 1 0 861.759058 0 440.246475 430.879529 90 1 0-861.759058 0Z" viewBox="0 0 1024 1024"
fill="#07C160" p-id="3083"></path> version="1.1"
<path d="M247.376566 529.799914L391.065522 674.425565l299.742281-299.742281 59.948456 59.948456-359.690737 358.754043L187.240771 589.748371z" xmlns="http://www.w3.org/2000/svg"
fill="#FFFFFF" p-id="3084"></path> p-id="3082"
<path d="M955.330366 240.548613h-83.927839a30.723584 30.723584 0 0 0-31.472939 30.161567v1.124034a30.910923 30.910923 0 0 0 30.348906 31.472939H955.330366a30.723584 30.723584 0 0 0 31.2856-30.348906v-1.124033A30.536245 30.536245 0 0 0 955.330366 240.548613z m-72.125487-168.605033a32.222295 32.222295 0 0 0-43.837308 4.121457L786.725333 141.071644a31.285601 31.285601 0 0 0 48.146104 39.903191l52.080221-64.819268a30.536245 30.536245 0 0 0-2.810084-42.900614zM683.126907 0.005433a30.910923 30.910923 0 0 0-31.47294 30.161567v84.864533a30.723584 30.723584 0 0 0 30.348906 31.285601h1.124034a30.536245 30.536245 0 0 0 31.2856-30.161567V31.291033A30.723584 30.723584 0 0 0 684.25094 0.005433z" width="80"
fill="#07C160" p-id="3085"></path> height="80"
>
<path
d="M37.36963 583.753525a440.246475 430.879529 90 1 0 861.759058 0 440.246475 430.879529 90 1 0-861.759058 0Z"
fill="#07C160"
p-id="3083"
></path>
<path
d="M247.376566 529.799914L391.065522 674.425565l299.742281-299.742281 59.948456 59.948456-359.690737 358.754043L187.240771 589.748371z"
fill="#FFFFFF"
p-id="3084"
></path>
<path
d="M955.330366 240.548613h-83.927839a30.723584 30.723584 0 0 0-31.472939 30.161567v1.124034a30.910923 30.910923 0 0 0 30.348906 31.472939H955.330366a30.723584 30.723584 0 0 0 31.2856-30.348906v-1.124033A30.536245 30.536245 0 0 0 955.330366 240.548613z m-72.125487-168.605033a32.222295 32.222295 0 0 0-43.837308 4.121457L786.725333 141.071644a31.285601 31.285601 0 0 0 48.146104 39.903191l52.080221-64.819268a30.536245 30.536245 0 0 0-2.810084-42.900614zM683.126907 0.005433a30.910923 30.910923 0 0 0-31.47294 30.161567v84.864533a30.723584 30.723584 0 0 0 30.348906 31.285601h1.124034a30.536245 30.536245 0 0 0 31.2856-30.161567V31.291033A30.723584 30.723584 0 0 0 684.25094 0.005433z"
fill="#07C160"
p-id="3085"
></path>
</svg> </svg>
<div style="margin-top: 20px;">{{code=='2' ? '您已领取' : '您已选择'}}</div> <div style="margin-top: 20px">{{code=='2' ? '您已领取' : '您已选择'}}</div>
<div style="margin: 20px auto 0px auto;width: 300px;word-break: break-all"> <div style="margin: 20px auto 0px auto; width: 300px; word-break: break-all">福利品: {{selectOptionNames}}</div>
福利品: {{selectOptionNames}} <van-button style="margin-top: 20px; width: 100px" size="small" hairline type="primary" @click="back">返回</van-button>
</div>
<van-button style="margin-top: 20px;width: 100px" size="small" hairline type="primary"
@click="back">返回
</van-button>
</div> </div>
</div> </div>
<script> <script>
<!--#include("/mobile/welfare/include/mixins.js"){}#--> <!--#include("/mobile/welfare/include/mixins.js"){}#-->
const vue = new Vue({ const vue = new Vue({
el: '#app', el: "#app",
mixins: [mobileMixins, welfareMixins], mixins: [mobileMixins, welfareMixins],
data() { data() {
return { return {
@@ -48,11 +57,12 @@ layout("/mobile/platform.html"){
}, },
methods: { methods: {
async getUserSelection() { async getUserSelection() {
const resp = await $.get('/mobile/welfare/mine/getUserSelect', {projectId: this.projectId}) const resp = await $.get("/mobile/welfare/mine/getUserSelect", { projectId: this.projectId })
this.selectOptionNames = resp.data this.selectOptionNames = resp.data
}, },
back() { back() {
window.history.go(-1) pjaxReplace("/mobile/welfare/list/receive?projectId=" + this.projectId)
localStorage.setItem("reload", "1")
} }
}, },
created() { created() {
@@ -63,7 +73,7 @@ layout("/mobile/platform.html"){
} }
this.provideMode = GetQueryString("provideMode") this.provideMode = GetQueryString("provideMode")
this.code = GetQueryString("code") this.code = GetQueryString("code")
this.title = this.code === '1' ? "选择结果" : '领取结果' this.title = this.code === "1" ? "选择结果" : "领取结果"
} }
}) })
</script> </script>
@@ -106,7 +106,7 @@ let commonColumns = [
{prop: 'loginname', label: '工号', width: "100"}, {prop: 'loginname', label: '工号', width: "100"},
{prop: 'username', label: '姓名', width: "80"}, {prop: 'username', label: '姓名', width: "80"},
{prop: 'sex', label: '性别', sortable: true, width: '100px', checked: 0}, {prop: 'sex', label: '性别', sortable: true, width: '100px', checked: 0},
{prop: 'personType', label: '人员类型', sortable: true, width: "100"}, // {prop: 'personType', label: '人员类型', sortable: true, width: "100"},
{prop: 'userState', label: '在职状态', sortable: true, width: "100"}, {prop: 'userState', label: '在职状态', sortable: true, width: "100"},
{prop: 'unionname', label: '所属工会', sortable: true}, {prop: 'unionname', label: '所属工会', sortable: true},
{prop: 'unitname', label: '所属单位', sortable: true}, {prop: 'unitname', label: '所属单位', sortable: true},
File diff suppressed because it is too large Load Diff
@@ -212,6 +212,10 @@ layout("/layouts/platform.html"){
v-for="column in tableColumns" v-for="column in tableColumns"
> >
<template scope="{row}" v-if="column.prop=='welfareUnitName'">{{row.welfareUnitName}}</template> <template scope="{row}" v-if="column.prop=='welfareUnitName'">{{row.welfareUnitName}}</template>
<template scope="{row}" v-else-if="column.prop=='isAudit'">
<span v-if="row.isAudit"><el-tag>已核对</el-tag></span>
<span v-else><el-tag type="danger">未核对</el-tag></span>
</template>
<template scope="{row}" v-else-if="column.prop=='unselectedTeacherSum'"> <template scope="{row}" v-else-if="column.prop=='unselectedTeacherSum'">
<el-link @click="openUnclaimed(row.welfareUnitCode)" type="primary">{{row.unselectedTeacherSum}}</el-link> <el-link @click="openUnclaimed(row.welfareUnitCode)" type="primary">{{row.unselectedTeacherSum}}</el-link>
</template> </template>
@@ -589,6 +593,7 @@ layout("/layouts/platform.html"){
label: welfare.welfareUnitModeName label: welfare.welfareUnitModeName
} }
].concat(resp.data.tableColumn) ].concat(resp.data.tableColumn)
this.tableColumns.push({prop: "isAudit", label: "是否核对"})
this.tableData = resp.data.tableList this.tableData = resp.data.tableList
} }
loading.close() loading.close()
@@ -29,7 +29,7 @@ layout("/layouts/platform.html"){
} }
.desc_label { .desc_label {
width: 75px; /*width: 75px;*/
-webkit-flex-shrink: 0; -webkit-flex-shrink: 0;
flex-shrink: 0; flex-shrink: 0;
padding-right: 4px; padding-right: 4px;
@@ -153,7 +153,7 @@ layout("/layouts/platform.html"){
<template #edit> <template #edit>
<el-card shadow="never"> <el-card shadow="never">
<el-form :model="formData" label-width="120px" ref="addForm"> <el-form :model="formData" label-width="120px" ref="addForm" :rules="addFormRules">
<el-form-item label="福利名称"> <el-form-item label="福利名称">
<span style="font-weight: bold; font-size: 20px">{{projectInfo.name}}</span> <span style="font-weight: bold; font-size: 20px">{{projectInfo.name}}</span>
</el-form-item> </el-form-item>
@@ -212,12 +212,13 @@ layout("/layouts/platform.html"){
></el-image> ></el-image>
<div style="width: calc(100% - 150px); padding-left: 20px; position: relative"> <div style="width: calc(100% - 150px); padding-left: 20px; position: relative">
<div style="white-space: nowrap; display: flex"> <div style="white-space: normal; display: flex">
<span class="desc_label"></span> <span class="desc_label"></span>
<el-tooltip placement="top" :content="option.supplier"> <el-tooltip placement="top" :content="option.supplier">
<!-- style="width: calc(100% - 80px);text-overflow: ellipsis;overflow: hidden;overflow-y: auto;height: 100px;" -->
<span <span
class="desc_value" class="desc_value"
style="width: calc(100% - 80px); text-overflow: ellipsis; overflow: hidden" style="text-overflow: ellipsis; overflow: hidden; overflow-y: auto; height: 100px"
> >
{{ option.supplier }} {{ option.supplier }}
</span> </span>
@@ -244,7 +245,8 @@ layout("/layouts/platform.html"){
<el-select <el-select
style="width: 100%" style="width: 100%"
clearable clearable
:disabled="option.selectNum == 0" filterable
v-if="option.receiveAddressList && option.receiveAddressList.length > 0 && option.selectNum > 0"
placeholder="请选择取货门店" placeholder="请选择取货门店"
v-model="option.receiveAddress" v-model="option.receiveAddress"
> >
@@ -263,6 +265,21 @@ layout("/layouts/platform.html"){
</el-row> </el-row>
</el-form-item> </el-form-item>
<el-row gutter="20">
<el-col span="24">
<el-form-item label="联系方式" prop="mobile">
<el-input
v-model="formData.mobile"
placeholder="请输入联系方式"
:disabled="isView"
maxlength="11"
type="text"
show-word-limit
></el-input>
</el-form-item>
</el-col>
</el-row>
<template v-if="projectInfo.provideMode===3"> <template v-if="projectInfo.provideMode===3">
<el-row gutter="20"> <el-row gutter="20">
<el-col span="24" v-if="!isView"> <el-col span="24" v-if="!isView">
@@ -453,6 +470,12 @@ layout("/layouts/platform.html"){
{ pattern: /^1[3-9]\d{9}$/, message: "请输入正确的手机号" } { pattern: /^1[3-9]\d{9}$/, message: "请输入正确的手机号" }
] ]
}, },
addFormRules: {
mobile: [
{ required: true, message: "必填", trigger: ["blur", "change"] },
{ pattern: /^1[3-9]\d{9}$/, message: "请输入正确的手机号" }
]
},
// 供应商 // 供应商
shoppingType: [], shoppingType: [],
@@ -627,10 +650,15 @@ layout("/layouts/platform.html"){
} }
// 判断门店是否选择 // 判断门店是否选择
console.log(this.projectInfo.welfareProjectSubjects[0])
const chooseOptions = this.projectInfo.welfareProjectSubjects[0].options const chooseOptions = this.projectInfo.welfareProjectSubjects[0].options
.filter((v) => v.selectNum > 0) .filter((v) => v.selectNum > 0 && v.shoppingId)
.map((item) => { .map((item) => {
return { optionName: item.optionName, selectNum: item.selectNum, receiveAddress: item.receiveAddress } return {
optionName: item.optionName,
selectNum: item.selectNum,
receiveAddress: item.receiveAddress
}
}) })
let isReceiveAddress = true let isReceiveAddress = true
for (const item of chooseOptions) { for (const item of chooseOptions) {
@@ -672,7 +700,8 @@ layout("/layouts/platform.html"){
console.log(formData) console.log(formData)
const { code, msg, data } = await $.post("/platform/welfare/userChoose/confirmSelect", { const { code, msg, data } = await $.post("/platform/welfare/userChoose/confirmSelect", {
welfareUserSelections: JSON.stringify(formData), welfareUserSelections: JSON.stringify(formData),
projectId: this.projectInfo.id projectId: this.projectInfo.id,
mobile: this.formData.mobile
}) })
if (code === 0) { if (code === 0) {
this.$message.success("您已完成本次福利选择。") this.$message.success("您已完成本次福利选择。")
@@ -761,10 +790,16 @@ layout("/layouts/platform.html"){
async getShoppingType() { async getShoppingType() {
const { data } = await $.get("/platform/shoppingType/apply/getShoppingType") const { data } = await $.get("/platform/shoppingType/apply/getShoppingType")
this.projectInfo.welfareProjectSubjects[0].options.forEach((item) => { this.projectInfo.welfareProjectSubjects[0].options.forEach((item) => {
item.receiveAddressList = data.find((v) => v.id === item.shoppingId).offlineStores item.receiveAddressList = data.find((v) => v.id === item.shoppingId)?.offlineStores
}) })
console.log(this.projectInfo.welfareProjectSubjects[0]) console.log(this.projectInfo.welfareProjectSubjects[0])
},
async getUserMobile() {
const resp = await $.post("/platform/welfare/userChoose/getUserMobile")
if (resp.code === 0) {
this.$set(this.formData, "mobile", resp.data)
}
} }
}, },
async created() { async created() {
@@ -776,6 +811,7 @@ layout("/layouts/platform.html"){
getEnumOptions("WelfareSignMode").then((res) => { getEnumOptions("WelfareSignMode").then((res) => {
this.welfareSignMode = res this.welfareSignMode = res
}) })
await this.getUserMobile()
} }
}) })
</script> </script>