..
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
package com.budwk.app.zhgh.welfare.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.zhgh.welfare.service.WelfareListService;
|
||||
import com.budwk.app.zhgh.welfare.service.WelfareProjectService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
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;
|
||||
|
||||
@IocBean
|
||||
@Ok("json:full")
|
||||
@At("/platform/welfare/common")
|
||||
public class WelfareCommonController {
|
||||
|
||||
@Inject
|
||||
private WelfareProjectService projectService;
|
||||
@Inject
|
||||
private WelfareListService welfareListService;
|
||||
|
||||
|
||||
@At
|
||||
@SaCheckPermission("welfare")
|
||||
@ApiOperation("获取项目信息")
|
||||
public Result projectInfo(@Valid String id){
|
||||
return Result.success(projectService.projectInfo(id));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import cn.hutool.json.JSONUtil;
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.constant.RoleConstant;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.utils.CommonDownloadUtil;
|
||||
@@ -16,7 +17,10 @@ import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.welfare.mode.WelfareUserTemp;
|
||||
import com.budwk.app.zhgh.welfare.model.WelfareList;
|
||||
import com.budwk.app.zhgh.welfare.model.WelfareUserSelection;
|
||||
import com.budwk.app.zhgh.welfare.param.WelfareFilterUserPageForm;
|
||||
import com.budwk.app.zhgh.welfare.param.WelfareListPageForm;
|
||||
import com.budwk.app.zhgh.welfare.service.WelfareListService;
|
||||
import com.budwk.app.zhgh.welfare.service.WelfareProjectService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
@@ -58,7 +62,8 @@ public class WelfareListController {
|
||||
|
||||
@Inject
|
||||
private WelfareListService welfareListService;
|
||||
|
||||
@Inject
|
||||
private WelfareProjectService welfareProjectService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/welfare/welfareUser/index.html")
|
||||
@@ -69,169 +74,38 @@ public class WelfareListController {
|
||||
|
||||
@At
|
||||
@SaCheckPermission("welfare.list.mange")
|
||||
public Result pageData(PageForm pageForm,
|
||||
String projectId,
|
||||
String optionId,
|
||||
String month,
|
||||
String courierNumber,
|
||||
String unionId,
|
||||
String unitIds,
|
||||
String personTypes,
|
||||
String userStates,
|
||||
String sex
|
||||
) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
CASE
|
||||
|
||||
WHEN
|
||||
wus.selectUserId IS NOT NULL THEN
|
||||
1 ELSE 0
|
||||
END AS isChoose,
|
||||
wl.projectId,
|
||||
vu.id,
|
||||
vu.username,
|
||||
vu.loginname,
|
||||
wl.personType,
|
||||
wl.userState,
|
||||
un.`name` unionname,
|
||||
it.`name` unitname,
|
||||
wl.id listId,
|
||||
wus.userSign,
|
||||
wus.courierNumber,
|
||||
wus.receiveAddress,
|
||||
GROUP_CONCAT( DISTINCT wuso.optionName, '(', wus.selectNum, '份)' ) AS gist_list
|
||||
FROM
|
||||
welfare_list wl
|
||||
LEFT JOIN vw_user vu ON vu.id = wl.userId
|
||||
LEFT JOIN sys_union un ON un.id = wl.welfareUnitId
|
||||
LEFT JOIN sys_unit it ON it.id = wl.welfareSecondLevelUnitId
|
||||
LEFT JOIN welfare_project_user_selection wus ON wus.welfareId = wl.projectId
|
||||
AND wus.selectUserId = wl.userId
|
||||
LEFT JOIN welfare_project_subject_option wuso ON wus.selectOptionId = wuso.id
|
||||
LEFT JOIN welfare_courier_number wcn ON wcn.selectUserId = wl.id
|
||||
AND wcn.welfareId = wl.projectId
|
||||
LEFT JOIN welfare_project wp ON wp.id = wus.welfareId
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
// cnd.and("vu.welfareMember", "=", 1);
|
||||
cnd.and("wl.projectId", "=", projectId);
|
||||
cnd.andEX("wus.selectOptionId", "=", optionId);
|
||||
cnd.andEX("wl.welfareUnitId", "=", unionId);
|
||||
|
||||
if (Lang.isNotEmpty(unitIds)) {
|
||||
String[] unitArray = Json.fromJsonAsArray(String.class, unitIds);
|
||||
cnd.andEX("wl.welfareSecondLevelUnitId", "in", unitArray);
|
||||
}
|
||||
if (Lang.isNotEmpty(personTypes)) {
|
||||
String[] personTypeArray = Json.fromJsonAsArray(String.class, personTypes);
|
||||
cnd.andEX("wl.personType", "in", personTypeArray);
|
||||
}
|
||||
|
||||
if (Lang.isNotEmpty(userStates)) {
|
||||
String[] userStateArray = Json.fromJsonAsArray(String.class, userStates);
|
||||
cnd.andEX("wl.userState", "in", userStateArray);
|
||||
}
|
||||
|
||||
cnd.andEX("vu.sex", "=", sex);
|
||||
|
||||
cnd.andEX("wcn.courierNumber", "=", courierNumber);
|
||||
|
||||
cnd.groupBy("wl.id");
|
||||
cnd.asc("it.unitcode");
|
||||
cnd.asc("vu.loginname");
|
||||
|
||||
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())) {
|
||||
cnd.and("wl.welfareUnitId", "=", SecurityUtil.getUnionId());
|
||||
}
|
||||
|
||||
if (StrUtil.isNotBlank(pageForm.getSearchKeyword()) && StrUtil.isNotBlank(pageForm.getSearchName())) {
|
||||
cnd.and(Cnd.likeEX(pageForm.getSearchName(), pageForm.getSearchKeyword()));
|
||||
|
||||
}
|
||||
sql.setCondition(cnd);
|
||||
return Result.success(welfareListService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql));
|
||||
@Ok("json:{dateFormat:'yyyy-MM-dd'}")
|
||||
public Result pageData(@Valid @Param("pageForm") WelfareListPageForm pageForm) {
|
||||
Pagination pagination = welfareListService.pageData(pageForm);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@ApiOperation("查询福利会员")
|
||||
@SaCheckPermission("welfare.list.mange")
|
||||
@SLog(tag = "福利名单管理", msg = "管理员删除某个福利会员")
|
||||
public Result delete(String projectId, String userId, String id) {
|
||||
welfareListService.delete(id);
|
||||
welfareListService.dao().clear(WelfareUserSelection.class,
|
||||
Cnd.where("welfareId", "=", projectId)
|
||||
.and("selectUserId", "=", userId));
|
||||
welfareListService.dao().clear(WelfareUserSelection.class, Cnd.where("welfareId", "=", projectId).and("selectUserId", "=", userId));
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param projectId
|
||||
* @param optionId
|
||||
* @param response
|
||||
* @author zhf
|
||||
* @description 导出报销表
|
||||
*/
|
||||
@At
|
||||
@Ok("void")
|
||||
@SaCheckPermission("welfare.list.mange")
|
||||
public void doExcelByOptionId(@Valid String projectId, @Valid String optionId, HttpServletResponse response) {
|
||||
welfareListService.doExcelByOptionId(projectId, optionId, response);
|
||||
|
||||
@ApiOperation("分页查询非福利会员")
|
||||
@Ok("json:{dateFormat:'yyyy-MM-dd'}")
|
||||
public Result notWelfareUserPageData(@Valid @Param("pageForm") WelfareFilterUserPageForm pageForm){
|
||||
return Result.success(welfareListService.notWelfareUserPageData(pageForm));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出各套餐选择数据
|
||||
*
|
||||
* @param projectId
|
||||
*/
|
||||
@At
|
||||
@Ok("void")
|
||||
@SaCheckPermission("welfare.list.mange")
|
||||
public void exportSelectData(String projectId, HttpServletResponse response) {
|
||||
welfareListService.exportSelectData(projectId, null, response);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 导入快递单号
|
||||
*
|
||||
* @param file excel文件
|
||||
*/
|
||||
@At
|
||||
@Ok("json")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("welfare.list.mange")
|
||||
@AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"})
|
||||
public Result importCourierNumber(@Param("file") TempFile file,
|
||||
@Param("projectId") String projectId,
|
||||
@Param("optionId") String optionId) {
|
||||
|
||||
|
||||
return welfareListService.importCourierNumber(file, projectId, optionId);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param editWelfareData
|
||||
* @param welfareOptions
|
||||
* @return com.budwk.app.base.result.Result
|
||||
* @author zhf
|
||||
* @description 管理员帮助修改福利套餐
|
||||
*/
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("welfare.list.mange")
|
||||
@SLog(tag = "福利名单管理", msg = "管理员帮助修改福利套餐")
|
||||
public Result doEditWelfareData(@Param("editWelfareData") @Valid String editWelfareData,
|
||||
@Param("welfareOptions") @Valid String welfareOptions) {
|
||||
welfareListService.doEditWelfareData(editWelfareData, welfareOptions);
|
||||
@ApiOperation("添加用户到福利名单")
|
||||
public Result addWelfareUser(@Valid @Param("pageForm") WelfareFilterUserPageForm pageForm){
|
||||
welfareListService.addWelfareUser(pageForm);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@@ -239,11 +113,11 @@ public class WelfareListController {
|
||||
@Ok("void")
|
||||
@SaCheckPermission("welfare.list.mange")
|
||||
public void downloadImport(HttpServletResponse response) {
|
||||
try (ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();){
|
||||
try (ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();) {
|
||||
EasyExcel.write(byteArrayOutputStream, WelfareUserTemp.class)
|
||||
.sheet("福利名单导入模版")
|
||||
.doWrite(ArrayList::new);
|
||||
CommonDownloadUtil.download("福利名单导入模版.xlsx",byteArrayOutputStream.toByteArray() ,response);
|
||||
CommonDownloadUtil.download("福利名单导入模版.xlsx", byteArrayOutputStream.toByteArray(), response);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@@ -299,22 +173,4 @@ public class WelfareListController {
|
||||
}
|
||||
return Result.success("导入成功");
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("welfare.list.mange")
|
||||
@ApiOperation("根据福利id查询不在这个福利名单中的用户")
|
||||
public Result selectNotWelfareList(@Valid String id, PageForm pageForm) {
|
||||
return Result.success(welfareListService.selectNotWelfareList(id, pageForm));
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("通过用户id把当前福利加入到名单中")
|
||||
@SaCheckPermission("welfare.list.mange")
|
||||
public Result doWelfareListUser(String[] ids, @Valid String id) {
|
||||
if (Lang.isEmpty(ids)) {
|
||||
return Result.error();
|
||||
}
|
||||
welfareListService.doWelfareListUser(ids, id);
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,16 +40,8 @@ import java.util.stream.Collectors;
|
||||
@At("/platform/welfare/mine")
|
||||
public class WelfareMineController {
|
||||
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/welfare/mine/index.html")
|
||||
@SaCheckPermission("welfare.mine")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@Inject
|
||||
private WelfareListService welfareListService;
|
||||
|
||||
@Inject
|
||||
private WelfareProjectService welfareProjectService;
|
||||
@Inject
|
||||
@@ -57,6 +49,12 @@ public class WelfareMineController {
|
||||
@Inject
|
||||
private ExpressSelectUtil expressSelectUtil;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/welfare/mine/index.html")
|
||||
@SaCheckPermission("welfare.mine")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("welfare.mine")
|
||||
public Result pageData(PageForm pageForm,
|
||||
@@ -69,7 +67,7 @@ public class WelfareMineController {
|
||||
WHEN wus.selectUserId IS NOT NULL THEN
|
||||
1 ELSE 0
|
||||
END AS isChoose,
|
||||
GROUP_CONCAT(DISTINCT wuso.optionName,wus.selectNum) AS gist_list,
|
||||
GROUP_CONCAT(DISTINCT wuso.optionName ,'(',wus.selectNum,'份)') AS gist_list,
|
||||
wus.receiveAddress,
|
||||
wl.userId
|
||||
FROM
|
||||
@@ -79,7 +77,7 @@ public class WelfareMineController {
|
||||
AND wus.selectUserId = @selectUserId
|
||||
LEFT JOIN welfare_project_subject_option wuso ON wus.selectOptionId = wuso.id
|
||||
$condition
|
||||
""");
|
||||
""");
|
||||
sql.setParam("selectUserId", SecurityUtil.getUserId());
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("wp.isDisabled", "=", 0);
|
||||
@@ -89,21 +87,6 @@ public class WelfareMineController {
|
||||
cnd.groupBy("wl.id");
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = welfareListService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
List<NutMap> list = pagination.getList();
|
||||
for (NutMap nutMap : list) {
|
||||
String gistList = nutMap.getString("gist_list");
|
||||
if (StrUtil.isNotBlank(gistList)) {
|
||||
String[] giftArray = gistList.split(",");
|
||||
List<NutMap> gifts = Arrays.stream(giftArray).map(gift -> {
|
||||
String num = gift.substring(gift.length() - 1);
|
||||
String name = gift.substring(0, gift.length() - 1);
|
||||
return NutMap.NEW().addv("name", name).addv("num", num);
|
||||
}).collect(Collectors.toList());
|
||||
nutMap.put("gifts", gifts);
|
||||
} else {
|
||||
nutMap.put("gifts", new ArrayList<>());
|
||||
}
|
||||
}
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@@ -149,97 +132,4 @@ public class WelfareMineController {
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@SaCheckPermission("welfare.mine")
|
||||
public Result courierNumberInfo(String welfareId, String userId) {
|
||||
//查询的时候去触发福利最新信息
|
||||
List<WelfareCourierNumber> welfareCourierNumberList = welfareListService.dao().query(WelfareCourierNumber.class, Cnd.where("welfareId", "=", welfareId).and("selectUserId", "=", userId));
|
||||
for (WelfareCourierNumber courierNumber : welfareCourierNumberList) {
|
||||
//如果有上次查询的时间
|
||||
|
||||
if (Lang.isNotEmpty(courierNumber.getSelectExpressDate()) && DateUtil.offsetHour(courierNumber.getSelectExpressDate(), 2).getTime() > new Date().getTime()) {
|
||||
//还在有效期内
|
||||
continue;
|
||||
}
|
||||
|
||||
if (Lang.isNotEmpty(courierNumber.getLogisticsTrace()) && List.of("AGENT_SIGN", "SIGN").contains(courierNumber.getLogisticsTrace().getLogisticsStatus())) {
|
||||
//签收了
|
||||
continue;
|
||||
}
|
||||
|
||||
if (Lang.isEmpty(courierNumber.getCourierNumber())) {
|
||||
//没快递单号
|
||||
continue;
|
||||
}
|
||||
|
||||
WelfareUserSelection userSelection = welfareListService.dao().fetch(WelfareUserSelection.class, Cnd.where("welfareId", "=", welfareId).and("selectUserId", "=", userId));
|
||||
|
||||
//需要去查询最新的物流信息
|
||||
String receiveAddress = userSelection.getReceiveAddress();
|
||||
String mobile = receiveAddress.substring(receiveAddress.length() - 11);
|
||||
|
||||
NutMap expressInfo = expressSelectUtil.getExpressInfo(courierNumber.getCourierNumber(), mobile);
|
||||
WelfareUserSelection.LogisticsTrace logisticsTrace = new WelfareUserSelection.LogisticsTrace();
|
||||
logisticsTrace.setTheLastTime(expressInfo.getTime("theLastTime"));
|
||||
logisticsTrace.setTheLastMessage(expressInfo.getString("theLastMessage"));
|
||||
logisticsTrace.setLogisticsStatusDesc(expressInfo.getString("logisticsStatusDesc"));
|
||||
logisticsTrace.setLogisticsStatus(expressInfo.getString("logisticsStatus"));
|
||||
List<NutMap> logisticsTraceDetailList = expressInfo.getAsList("logisticsTraceDetailList", NutMap.class);
|
||||
logisticsTrace.setLogisticsTraceDetailList(logisticsTraceDetailList);
|
||||
|
||||
welfareListService.dao().update(WelfareCourierNumber.class,
|
||||
Chain.make("logisticsTrace", logisticsTrace)
|
||||
.add("selectExpressDate", new Date()),
|
||||
Cnd.where("id", "=", courierNumber.getId()));
|
||||
}
|
||||
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
wpso.optionName,
|
||||
wpso.imgUrl,
|
||||
wcn.courierNumber,
|
||||
wcn.logisticsTrace
|
||||
FROM
|
||||
welfare_courier_number wcn
|
||||
LEFT JOIN welfare_project_subject_option wpso ON wpso.id = wcn.selectOptionId
|
||||
WHERE
|
||||
wcn.welfareId = @welfareId
|
||||
AND wcn.selectUserId = @userId
|
||||
ORDER BY wpso.optionSort
|
||||
""");
|
||||
sql.setParam("welfareId", welfareId);
|
||||
sql.setParam("userId", userId);
|
||||
List<NutMap> list = welfareListService.listMap(sql);
|
||||
|
||||
for (NutMap nutMap : list) {
|
||||
nutMap.put("logisticsTrace", nutMap.getAs("logisticsTrace", WelfareUserSelection.LogisticsTrace.class));
|
||||
}
|
||||
List<NutMap> mapList = sql.getList(NutMap.class);
|
||||
|
||||
Map<String, List<NutMap>> listMap = mapList.stream().collect(Collectors.groupingBy(v -> v.getString("optionName")));
|
||||
return Result.success(listMap);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@SaCheckPermission("welfare.mine")
|
||||
public Result finOneWelfareEvaluate(String projectId, String optionId) {
|
||||
WelfareEvaluate welfareEvaluate = welfareProjectService.dao().fetch(WelfareEvaluate.class,
|
||||
Cnd.where("userId", "=", SecurityUtil.getUserId())
|
||||
.and("projectId", "=", projectId).and("optionId", "=", optionId));
|
||||
return Result.success(welfareEvaluate);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("welfare.mine")
|
||||
public Result doEvaluate(WelfareEvaluate welfareEvaluate) {
|
||||
welfareEvaluate.setUserId(SecurityUtil.getUserId());
|
||||
welfareEvaluate.setUserName(SecurityUtil.getUserUsername());
|
||||
welfareEvaluate.setLoginName(SecurityUtil.getUserLoginname());
|
||||
welfareEvaluate.setApplyDate(new Date());
|
||||
welfareProjectService.insert(welfareEvaluate);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
+34
-11
@@ -1,11 +1,14 @@
|
||||
package com.budwk.app.zhgh.welfare.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.sys.models.Sys_home_activity;
|
||||
import com.budwk.app.zhgh.welfare.model.WelfareProject;
|
||||
import com.budwk.app.zhgh.welfare.param.WelfareFilterUserPageForm;
|
||||
import com.budwk.app.zhgh.welfare.service.WelfareListService;
|
||||
import com.budwk.app.zhgh.welfare.service.WelfareProjectService;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
@@ -21,6 +24,8 @@ import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* @ClassName WelfareProjectMangeController
|
||||
* @Description TODO
|
||||
@@ -34,7 +39,7 @@ public class WelfareProjectMangeController {
|
||||
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/welfare/ProjectMange/index.html")
|
||||
@Ok("beetl:/platform/zhgh/welfare/projectMange/index.html")
|
||||
@SaCheckPermission("welfare.project.mange")
|
||||
public void index() {
|
||||
}
|
||||
@@ -42,7 +47,7 @@ public class WelfareProjectMangeController {
|
||||
@Inject
|
||||
private WelfareProjectService projectService;
|
||||
@Inject
|
||||
private WelfareListService listService;
|
||||
private WelfareListService welfareListService;
|
||||
|
||||
|
||||
@At
|
||||
@@ -70,7 +75,11 @@ public class WelfareProjectMangeController {
|
||||
@SLog(tag = "福利", msg = "新增/编辑了福利")
|
||||
@SaCheckPermission("welfare.project.mange")
|
||||
public Result save(@Param("data") WelfareProject project) {
|
||||
projectService.save(project);
|
||||
if (StrUtil.isNotBlank(project.getId())) {
|
||||
projectService.updateProject(project);
|
||||
} else {
|
||||
projectService.saveProject(project);
|
||||
}
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@@ -106,19 +115,33 @@ public class WelfareProjectMangeController {
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@SaCheckPermission("welfare.project.mange")
|
||||
public Result createList(String id, boolean created) {
|
||||
projectService.createList(id, created);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("welfare.mine")
|
||||
public Result getWelfareList(Integer year) {
|
||||
return Result.success(projectService.getWelfareList(year));
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成福利名单用户查询
|
||||
*/
|
||||
@At
|
||||
@SaCheckPermission("welfare.project.mange")
|
||||
@Ok("json:{dateFormat:'yyyy-MM-dd'}")
|
||||
public Result filterUserPageData(@Valid @Param("pageForm") WelfareFilterUserPageForm pageForm) {
|
||||
Pagination pagination = welfareListService.notWelfareUserPageData(pageForm);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加福利名单用户
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@At
|
||||
@SaCheckPermission("welfare.project.mange")
|
||||
public Result addWelfareUser(@Valid @Param("pageForm") WelfareFilterUserPageForm pageForm) {
|
||||
welfareListService.addWelfareUser(pageForm);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+87
-46
@@ -1,20 +1,37 @@
|
||||
package com.budwk.app.zhgh.welfare.controller;
|
||||
|
||||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.utils.CommonDownloadUtil;
|
||||
import com.budwk.app.sys.models.Sys_union;
|
||||
import com.budwk.app.zhgh.welfare.model.WelfareProject;
|
||||
import com.budwk.app.zhgh.welfare.service.WelfareListService;
|
||||
import com.budwk.app.zhgh.welfare.service.WelfareSingleService;
|
||||
import com.budwk.app.zhgh.welfare.service.WelfareStatisticsService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.FieldFilter;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.dao.util.Daos;
|
||||
import org.nutz.dao.util.cri.SqlExpressionGroup;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
@@ -23,70 +40,94 @@ import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipOutputStream;
|
||||
|
||||
/**
|
||||
* @ClassName WelfareSingleController
|
||||
* @Description 查询统计
|
||||
* @Author zhf
|
||||
* @Date 2024/8/14 13:49
|
||||
*/
|
||||
@IocBean
|
||||
@Ok("json:full")
|
||||
@At("/platform/welfare/project/statistics/single")
|
||||
public class WelfareSingleController {
|
||||
@At("/platform/welfare/statistics")
|
||||
@Slf4j
|
||||
@Api(tags = "福利统计")
|
||||
public class WelfareStatisticsController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private WelfareSingleService welfareSingleService;
|
||||
@Inject
|
||||
private WelfareListService welfareListService;
|
||||
@Inject
|
||||
private WelfareStatisticsService welfareStatisticsService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/welfare/statistics/index.html")
|
||||
@SaCheckPermission("welfare.project.statistics.single")
|
||||
@SaCheckPermission("welfare.statistics")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@Inject
|
||||
private WelfareSingleService welfareSingleService;
|
||||
|
||||
@Inject
|
||||
private WelfareListService welfareListService;
|
||||
|
||||
|
||||
@At
|
||||
@SaCheckPermission("welfare.project.statistics.single")
|
||||
@SaCheckPermission("welfare.statistics")
|
||||
public Result pageData(String projectId, String unionId) {
|
||||
return Result.success(welfareSingleService.pageData(projectId, unionId));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param projectId
|
||||
* @param unionId
|
||||
* @param pageNumber
|
||||
* @param pageSize
|
||||
* @return com.budwk.app.base.result.Result
|
||||
* @author zhf
|
||||
* @description 查询已选择的人
|
||||
*/
|
||||
|
||||
@At
|
||||
@SaCheckPermission("welfare.project.statistics.single")
|
||||
public Result receivePageData(String projectId, String unionId, Integer pageNumber, Integer pageSize) {
|
||||
return Result.success(welfareSingleService.receivePageData(projectId, unionId, pageNumber, pageSize));
|
||||
@SaCheckPermission("welfare.statistics")
|
||||
@ApiOperation("查询某分工会已选择人员")
|
||||
public Result selectedUnionUserPageData(@Valid PageForm pageForm, String projectId, String unionId) {
|
||||
Pagination pagination = welfareStatisticsService.selectedUnionUserPageData(pageForm, projectId, unionId);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param projectId
|
||||
* @param unionId
|
||||
* @param pageNumber
|
||||
* @param pageSize
|
||||
* @return com.budwk.app.base.result.Result
|
||||
* @author zhf
|
||||
* @description 查询未选择的人
|
||||
*/
|
||||
@At
|
||||
@SaCheckPermission("welfare.project.statistics.single")
|
||||
public Result unclaimedData(String projectId, String unionId, Integer pageNumber, Integer pageSize) {
|
||||
return Result.success(welfareSingleService.unclaimedData(projectId, unionId, pageNumber, pageSize));
|
||||
@Ok("void")
|
||||
@SaCheckPermission("welfare.statistics")
|
||||
@ApiOperation("导出某分工会已选择人员")
|
||||
public void exportSelectedUnionUser(String projectId, String unionId, HttpServletResponse response) {
|
||||
welfareStatisticsService.exportSelectedUnionUser(projectId,unionId,response);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("welfare.statistics")
|
||||
@ApiOperation("查询某分工会未选择人员")
|
||||
public Result unSelectedUnionUserPageData(@Valid PageForm pageForm, String projectId, String unionId) {
|
||||
Pagination pagination = welfareStatisticsService.unSelectedUnionUserPageData(pageForm, projectId, unionId);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
@SaCheckPermission("welfare.statistics")
|
||||
@ApiOperation("导出某分工会未选择人员")
|
||||
public void exportUnSelectedUnionUser(String projectId, String unionId, HttpServletResponse response) {
|
||||
welfareStatisticsService.exportUnSelectedUnionUser(projectId,unionId,response);
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
@SaCheckPermission("welfare.statistics")
|
||||
@ApiOperation("导出各分工会选择情况")
|
||||
public void exportUnionExcel(String projectId, HttpServletResponse response) {
|
||||
welfareStatisticsService.exportUnionExcel(projectId,response);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
@SaCheckPermission("welfare.statistics")
|
||||
@ApiOperation("按福利选项导出")
|
||||
public void exportByWelfareOptions(String projectId,HttpServletResponse response){
|
||||
welfareStatisticsService.exportByWelfareOptions(projectId,response);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @param projectId
|
||||
@@ -97,7 +138,7 @@ public class WelfareSingleController {
|
||||
*/
|
||||
@At
|
||||
@Ok("void")
|
||||
@SaCheckPermission("welfare.project.statistics.single")
|
||||
@SaCheckPermission("welfare.statistics")
|
||||
public void exportReceiveDetailByUnionIdWord(String projectId, String unionId, HttpServletResponse response) {
|
||||
WelfareProject welfareProject = welfareSingleService.dao().fetch(WelfareProject.class, projectId);
|
||||
Sys_union sysUnion = welfareSingleService.dao().fetch(Sys_union.class, Cnd.where("id", "=", unionId));
|
||||
@@ -120,7 +161,7 @@ public class WelfareSingleController {
|
||||
*/
|
||||
@At
|
||||
@Ok("void")
|
||||
@SaCheckPermission("welfare.project.statistics.single")
|
||||
@SaCheckPermission("welfare.statistics")
|
||||
public void exportReceiveDetailByUnionId(String projectId, String unionId, Boolean flag, HttpServletResponse response) {
|
||||
|
||||
welfareSingleService.exportReceiveDetailByUnionId(projectId, unionId, flag, response);
|
||||
@@ -129,7 +170,7 @@ public class WelfareSingleController {
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
@SaCheckPermission("welfare.project.statistics.single")
|
||||
@SaCheckPermission("welfare.statistics")
|
||||
public void allExportReceiveDetailByUnionIdWord(String projectId, HttpServletResponse response) {
|
||||
try {
|
||||
WelfareProject welfareProject = welfareSingleService.dao().fetch(WelfareProject.class, projectId);
|
||||
@@ -157,20 +198,20 @@ public class WelfareSingleController {
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
@SaCheckPermission("welfare.project.statistics.single")
|
||||
@SaCheckPermission("welfare.statistics")
|
||||
public void exportSelectData(String projectId, String unionId, HttpServletResponse response) {
|
||||
welfareListService.exportSelectData(projectId, unionId, response);
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
@SaCheckPermission("welfare.project.statistics.single")
|
||||
@SaCheckPermission("welfare.statistics")
|
||||
public void exportSummary(String projectId, String unionId, HttpServletResponse response) {
|
||||
welfareSingleService.exportSummary(projectId, unionId, response);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("welfare.project.statistics.single")
|
||||
@SaCheckPermission("welfare.statistics")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SLog(tag = "福利统计", msg = "管理员代选福利")
|
||||
@ApiOperation("管理员代选福利")
|
||||
+17
-7
@@ -9,9 +9,11 @@ import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.welfare.model.WelfareList;
|
||||
import com.budwk.app.zhgh.welfare.model.WelfareUserSelection;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Chain;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
@@ -22,6 +24,7 @@ import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName WelfareUserChooseController
|
||||
@@ -34,6 +37,10 @@ import java.util.Date;
|
||||
@At("/platform/welfare/userChoose")
|
||||
public class WelfareUserChooseController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/welfare/userChoose/index.html")
|
||||
@@ -41,14 +48,9 @@ public class WelfareUserChooseController {
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
|
||||
|
||||
@At
|
||||
@SaCheckPermission("welfare.user.choose")
|
||||
public Result pageData(PageForm pageForm, Integer year) {
|
||||
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
wp.*,
|
||||
@@ -84,8 +86,7 @@ public class WelfareUserChooseController {
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SLog(type = "welfare", tag = "选择福利", msg = "福利")
|
||||
@SaCheckPermission("welfare.user.choose")
|
||||
public Result confirmSelect(@Param("welfareUserSelections") WelfareUserSelection[] welfareUserSelections,
|
||||
String projectId) {
|
||||
public Result confirmSelect(@Param("welfareUserSelections") WelfareUserSelection[] welfareUserSelections, String projectId) {
|
||||
//删除上次选择的
|
||||
baseService.dao().clear(WelfareUserSelection.class,
|
||||
Cnd.where("welfareId", "=", projectId)
|
||||
@@ -105,4 +106,13 @@ public class WelfareUserChooseController {
|
||||
return Result.success("选择成功");
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("welfare.user.choose")
|
||||
@ApiOperation("获取用户选择信息")
|
||||
public Result getUserSelection(String projectId) {
|
||||
List<WelfareUserSelection> list = dao.query(WelfareUserSelection.class, Cnd.where(WelfareUserSelection::getWelfareId, "=", projectId).and(WelfareUserSelection::getSelectUserId, "=", SecurityUtil.getUserId()));
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,103 @@
|
||||
package com.budwk.app.zhgh.welfare.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.welfare.model.WelfareList;
|
||||
import com.budwk.app.zhgh.welfare.model.WelfareUserSelection;
|
||||
import com.budwk.app.zhgh.welfare.service.WelfareProjectService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Chain;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@IocBean
|
||||
@Ok("json:full")
|
||||
@At("/platform/welfare/userSelect")
|
||||
public class WelfareUserSelectController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private WelfareProjectService welfareProjectService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/welfare/select/index.html")
|
||||
@SaCheckPermission("welfare.user.select")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("welfare.user.select")
|
||||
@ApiOperation("获取用户选择列表分页")
|
||||
public Result pageData(PageForm pageForm, Integer year) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
wp.*,
|
||||
CASE
|
||||
WHEN wus.selectUserId IS NOT NULL THEN 1
|
||||
ELSE 0
|
||||
END AS isChoose,
|
||||
wus.selectTime,
|
||||
GROUP_CONCAT(DISTINCT wuso.optionName ,'(',wus.selectNum,'份)') AS gist_list,
|
||||
wus.receiveAddress
|
||||
FROM
|
||||
welfare_project wp
|
||||
LEFT JOIN welfare_project_user_selection wus ON wp.id = wus.welfareId AND wus.selectUserId = @selectUserId
|
||||
INNER JOIN welfare_list wl ON wp.id = wl.projectId AND wl.userId = @selectUserId
|
||||
LEFT JOIN welfare_project_subject_option wuso ON wus.selectOptionId = wuso.id
|
||||
$condition
|
||||
""");
|
||||
sql.setParam("selectUserId", SecurityUtil.getUserId());
|
||||
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("wp.provideMode", "in", "2,3");
|
||||
cnd.andEX("YEAR(wp.choiceTimeStart)", "in", year);
|
||||
cnd.and("wp.isDisabled", "=", 0);
|
||||
cnd.groupBy("wp.id");
|
||||
cnd.desc("YEAR(wp.choiceTimeStart)");
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = welfareProjectService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SLog(type = "welfare", tag = "选择福利", msg = "福利")
|
||||
@SaCheckPermission("welfare.user.select")
|
||||
public Result confirmSelect(@Param("selections") WelfareUserSelection[] selections, String projectId) {
|
||||
//删除上次选择的
|
||||
dao.clear(WelfareUserSelection.class, Cnd.where(WelfareUserSelection::getWelfareId, "=", projectId).and(WelfareUserSelection::getSelectUserId, "=", SecurityUtil.getUserId()));
|
||||
for (WelfareUserSelection welfareUserSelection : selections) {
|
||||
welfareUserSelection.setWelfareId(projectId);
|
||||
welfareUserSelection.setSelectUserId(SecurityUtil.getUserId());
|
||||
welfareUserSelection.setSelectTime(new Date());
|
||||
}
|
||||
dao.insert(selections);
|
||||
return Result.success("选择成功");
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("welfare.user.select")
|
||||
@ApiOperation("获取用户选择信息")
|
||||
public Result getUserSelection(String projectId) {
|
||||
List<WelfareUserSelection> list = dao.query(WelfareUserSelection.class, Cnd.where(WelfareUserSelection::getWelfareId, "=", projectId).and(WelfareUserSelection::getSelectUserId, "=", SecurityUtil.getUserId()));
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
}
|
||||
-33
@@ -1,33 +0,0 @@
|
||||
package com.budwk.app.zhgh.welfare.h5Controller;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* @ClassName H5WelfareUserChooseController
|
||||
* @Description TODO
|
||||
* @Author zhf
|
||||
* @Date 2024/9/26 9:21
|
||||
*/
|
||||
@IocBean
|
||||
@Ok("json:full")
|
||||
@At("/platform/h5/welfare/userChoose")
|
||||
public class H5WelfareUserChooseController {
|
||||
|
||||
|
||||
@At
|
||||
@Ok("beetl:/platform/zhghh5/welfare/userChoose/list.html")
|
||||
@SaCheckPermission("hs.welfare.user.choose")
|
||||
public void list() {
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("beetl:/platform/zhghh5/welfare/userChoose/index.html")
|
||||
@SaCheckPermission("hs.welfare.user.choose")
|
||||
public void index() {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
package com.budwk.app.zhgh.welfare.h5Controller;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* @ClassName H5WelfareUserChooseController
|
||||
* @Description TODO
|
||||
* @Author zhf
|
||||
* @Date 2024/9/26 9:21
|
||||
*/
|
||||
@IocBean
|
||||
@Ok("json:full")
|
||||
@At("/platform/h5/welfare/userSelect")
|
||||
public class H5WelfareUserSelectController {
|
||||
|
||||
@At
|
||||
@Ok("beetl:/platform/zhghh5/welfare/select/list.html")
|
||||
@SaCheckPermission("hs.welfare.user.select")
|
||||
public void list() {
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("beetl:/platform/zhghh5/welfare/select/index.html")
|
||||
@SaCheckPermission("hs.welfare.user.select")
|
||||
public void index() {
|
||||
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("beetl:/platform/zhghh5/welfare/select/success.html")
|
||||
@SaCheckPermission("hs.welfare.user.select")
|
||||
public void success() {
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package com.budwk.app.zhgh.welfare.model;
|
||||
|
||||
import com.budwk.app.base.model.BaseModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
@@ -15,6 +16,7 @@ import java.io.Serializable;
|
||||
* @date: 2021/2/1
|
||||
* @since 1.0
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Table("welfare_list")
|
||||
@TableIndexes({
|
||||
@Index(name = "INDEX_WELFARE_LIST_USER_ID", fields = {"userId"}, unique = false),
|
||||
@@ -22,9 +24,9 @@ import java.io.Serializable;
|
||||
})
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class WelfareList extends BaseModel implements Serializable {
|
||||
public class WelfareList extends BaseModel{
|
||||
|
||||
@Name
|
||||
@Column
|
||||
@Comment("ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@PrevInsert(uu32 = true)
|
||||
@@ -45,6 +47,37 @@ public class WelfareList extends BaseModel implements Serializable {
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String welfareUnitId;
|
||||
|
||||
@Column
|
||||
@Comment("福利单位名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String welfareUnitName;
|
||||
|
||||
@Column
|
||||
@Comment("福利分工会ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String welfareUnionId;
|
||||
|
||||
@Column
|
||||
@Comment("福利分工会名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String welfareUnionName;
|
||||
|
||||
@Column
|
||||
@Comment("人员类型")
|
||||
@ColDefine(type = ColType.VARCHAR)
|
||||
private String personType;
|
||||
|
||||
@Column
|
||||
@Comment("在职状态")
|
||||
@ColDefine(type = ColType.VARCHAR)
|
||||
private String userState;
|
||||
|
||||
@Column
|
||||
@Comment("聘用方式")
|
||||
@ColDefine(type = ColType.VARCHAR)
|
||||
private String preparedBy;
|
||||
|
||||
@Deprecated
|
||||
@Column
|
||||
@Comment("福利二级单位ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@@ -60,14 +93,4 @@ public class WelfareList extends BaseModel implements Serializable {
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
private Boolean isAutoSelect;
|
||||
|
||||
@Column
|
||||
@Comment("人员类型")
|
||||
@ColDefine(type = ColType.VARCHAR)
|
||||
private String personType;
|
||||
|
||||
@Column
|
||||
@Comment("在职状态")
|
||||
@ColDefine(type = ColType.VARCHAR)
|
||||
private String userState;
|
||||
|
||||
}
|
||||
|
||||
@@ -25,9 +25,7 @@ import java.util.List;
|
||||
@Accessors(chain = true)
|
||||
@Table
|
||||
@Comment("福利项目")
|
||||
public class WelfareProject extends BaseModel implements Serializable, SysHomeConvert {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
public class WelfareProject extends BaseModel implements SysHomeConvert {
|
||||
|
||||
@Column
|
||||
@Name
|
||||
@@ -176,12 +174,15 @@ public class WelfareProject extends BaseModel implements Serializable, SysHomeCo
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String conditionStructureId;
|
||||
|
||||
/* @One(field = "conditionStructureId")
|
||||
private MatchConditionStructure conditionStructure;*/
|
||||
|
||||
@Many(field = "projectId")
|
||||
private List<WelfareProjectSubject> welfareProjectSubjects;
|
||||
|
||||
/**
|
||||
* 套餐选项
|
||||
*/
|
||||
@Many(field = "welfareId")
|
||||
private List<WelfareProjectSubjectOption> options;
|
||||
|
||||
@Column
|
||||
@Comment("题目ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
|
||||
@@ -27,10 +27,15 @@ public class WelfareProjectSubjectOption extends BaseModel implements Serializab
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@Comment("所属题目")
|
||||
@Comment("所属福利")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String subjectId;
|
||||
|
||||
@Column
|
||||
@Comment("所属福利")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String welfareId;
|
||||
|
||||
@Column
|
||||
@Comment("选项类型")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
@@ -54,13 +59,21 @@ public class WelfareProjectSubjectOption extends BaseModel implements Serializab
|
||||
@Column
|
||||
@Comment("没选系统自动选")
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
@Default("0")
|
||||
private Boolean isDefaultOption;
|
||||
|
||||
@Column
|
||||
@Comment("默认选项")
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
@Default("0")
|
||||
private Boolean isSystemDefault;
|
||||
|
||||
@Column
|
||||
@Comment("是否快递")
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
@Default("0")
|
||||
private Boolean isExpressDelivery;
|
||||
|
||||
@Column
|
||||
@Comment("图片地址")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.budwk.app.zhgh.welfare.model;
|
||||
|
||||
import com.budwk.app.base.model.BaseModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
@@ -16,6 +17,7 @@ import java.util.List;
|
||||
* @Description TODO
|
||||
* @createTime 2022年01月12日 17:07:00
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@Table("welfare_project_user_selection")
|
||||
@@ -78,6 +80,11 @@ public class WelfareUserSelection extends BaseModel implements Serializable {
|
||||
@ColDefine(type = ColType.INT)
|
||||
private Integer selectNum;
|
||||
|
||||
@Column
|
||||
@Comment("手机号")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 11)
|
||||
private String mobile;
|
||||
|
||||
@Column
|
||||
@Comment("物流信息")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.budwk.app.zhgh.welfare.param;
|
||||
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@ApiModel("用户生成福利名单分页查询参数")
|
||||
public class WelfareFilterUserPageForm extends PageForm {
|
||||
|
||||
@ApiModelProperty("福利项目id")
|
||||
private String projectId;
|
||||
|
||||
@ApiModelProperty("姓名")
|
||||
private String userName;
|
||||
|
||||
@ApiModelProperty("工号")
|
||||
private String loginName;
|
||||
|
||||
@ApiModelProperty("性别")
|
||||
private String sex;
|
||||
|
||||
@ApiModelProperty("出生日期")
|
||||
private Date birthday;
|
||||
|
||||
@ApiModelProperty("出生月份")
|
||||
private String[] birthMonths;
|
||||
|
||||
@ApiModelProperty("工会id")
|
||||
private String unionId;
|
||||
|
||||
@ApiModelProperty("工会名称")
|
||||
private String unionName;
|
||||
|
||||
@ApiModelProperty("单位id")
|
||||
private String[] unitIds;
|
||||
|
||||
@ApiModelProperty("单位名称")
|
||||
private String unitName;
|
||||
|
||||
@ApiModelProperty("人员类型")
|
||||
private String[] personTypes;
|
||||
|
||||
@ApiModelProperty("聘用方式")
|
||||
private String[] preparedBys;
|
||||
|
||||
@ApiModelProperty("在职状态")
|
||||
private String[] userStates;
|
||||
|
||||
@ApiModelProperty("是否会员")
|
||||
private Boolean isMember;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.budwk.app.zhgh.welfare.param;
|
||||
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@ApiModel(description = "福利名单分页查询参数")
|
||||
public class WelfareListPageForm extends PageForm {
|
||||
|
||||
@ApiModelProperty("年份")
|
||||
private Integer year;
|
||||
|
||||
@ApiModelProperty("福利项目id")
|
||||
private String projectId;
|
||||
|
||||
@ApiModelProperty("姓名")
|
||||
private String userName;
|
||||
|
||||
@ApiModelProperty("工号")
|
||||
private String loginName;
|
||||
|
||||
@ApiModelProperty("性别")
|
||||
private String sex;
|
||||
|
||||
@ApiModelProperty("出生日期")
|
||||
private Date birthday;
|
||||
|
||||
@ApiModelProperty("出生月份")
|
||||
private String[] birthMonths;
|
||||
|
||||
@ApiModelProperty("工会id")
|
||||
private String unionId;
|
||||
|
||||
@ApiModelProperty("工会名称")
|
||||
private String unionName;
|
||||
|
||||
@ApiModelProperty("单位id")
|
||||
private String[] unitIds;
|
||||
|
||||
@ApiModelProperty("单位名称")
|
||||
private String unitName;
|
||||
|
||||
@ApiModelProperty("人员类型")
|
||||
private String[] personTypes;
|
||||
|
||||
@ApiModelProperty("聘用方式")
|
||||
private String[] preparedBys;
|
||||
|
||||
@ApiModelProperty("在职状态")
|
||||
private String[] userStates;
|
||||
|
||||
}
|
||||
@@ -5,6 +5,8 @@ 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.zhgh.welfare.model.WelfareList;
|
||||
import com.budwk.app.zhgh.welfare.param.WelfareFilterUserPageForm;
|
||||
import com.budwk.app.zhgh.welfare.param.WelfareListPageForm;
|
||||
import org.nutz.mvc.upload.TempFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
@@ -23,4 +25,24 @@ public interface WelfareListService extends BaseService<WelfareList> {
|
||||
Pagination selectNotWelfareList(String id, PageForm pageForm);
|
||||
|
||||
void doWelfareListUser(String[] ids,String id);
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param pageForm
|
||||
* @return
|
||||
*/
|
||||
Pagination pageData(WelfareListPageForm pageForm);
|
||||
|
||||
/**
|
||||
* 查询非福利会员用户
|
||||
* @param pageForm
|
||||
* @return
|
||||
*/
|
||||
Pagination notWelfareUserPageData(WelfareFilterUserPageForm pageForm);
|
||||
|
||||
/**
|
||||
* 添加福利会员用户
|
||||
* @param pageForm
|
||||
*/
|
||||
void addWelfareUser(WelfareFilterUserPageForm pageForm);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
package com.budwk.app.zhgh.welfare.service;
|
||||
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.zhgh.welfare.model.WelfareProject;
|
||||
import com.budwk.app.zhgh.welfare.param.WelfareFilterUserPageForm;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
|
||||
import java.util.List;
|
||||
@@ -17,13 +19,35 @@ public interface WelfareProjectService extends BaseService<WelfareProject> {
|
||||
*/
|
||||
WelfareProject projectInfo(String projectId);
|
||||
|
||||
/**
|
||||
* 保存项目信息
|
||||
* @param project
|
||||
*/
|
||||
void saveProject(WelfareProject project);
|
||||
|
||||
void save(WelfareProject project);
|
||||
/**
|
||||
* 修改项目信息
|
||||
* @param project
|
||||
*/
|
||||
void updateProject(WelfareProject project);
|
||||
|
||||
/**
|
||||
* 删除项目信息
|
||||
* @param id
|
||||
*/
|
||||
void deleteWelfare(String id);
|
||||
|
||||
|
||||
/**
|
||||
* 创建福利名单
|
||||
* @param projectId
|
||||
* @param created
|
||||
*/
|
||||
void createList(String projectId, boolean created);
|
||||
|
||||
List<NutMap> getWelfareList(Integer year);
|
||||
/**
|
||||
* 项目列表
|
||||
* @param year
|
||||
* @return
|
||||
*/
|
||||
List<WelfareProject> getWelfareList(Integer year);
|
||||
}
|
||||
|
||||
@@ -9,8 +9,13 @@ import java.util.List;
|
||||
|
||||
public interface WelfareSingleService extends BaseService {
|
||||
|
||||
NutMap pageData(String projectId,
|
||||
String unionId);
|
||||
/**
|
||||
* 查询各分工会已选未选的人数
|
||||
* @param projectId
|
||||
* @param unionId
|
||||
* @return
|
||||
*/
|
||||
NutMap pageData(String projectId, String unionId);
|
||||
|
||||
List<NutMap> getOptionByProjectId(String projectId);
|
||||
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.budwk.app.zhgh.welfare.service;
|
||||
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.zhgh.welfare.model.WelfareProject;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
public interface WelfareStatisticsService extends BaseService<WelfareProject> {
|
||||
|
||||
/**
|
||||
* 查询某分工会已选择人员
|
||||
* @param pageForm
|
||||
* @param projectId
|
||||
* @param unionId
|
||||
*/
|
||||
Pagination selectedUnionUserPageData(PageForm pageForm, String projectId, String unionId);
|
||||
|
||||
/**
|
||||
* 导出某分工会已选择人员
|
||||
* @param projectId
|
||||
* @param unionId
|
||||
* @param response
|
||||
*/
|
||||
void exportSelectedUnionUser(String projectId, String unionId, HttpServletResponse response);
|
||||
|
||||
/**
|
||||
* Pagination
|
||||
* @param pageForm
|
||||
* @param projectId
|
||||
* @param unionId
|
||||
*/
|
||||
Pagination unSelectedUnionUserPageData(PageForm pageForm, String projectId, String unionId);
|
||||
|
||||
/**
|
||||
* 导出某分工会未选择人员
|
||||
* @param projectId
|
||||
* @param unionId
|
||||
* @param response
|
||||
*/
|
||||
void exportUnSelectedUnionUser(String projectId, String unionId, HttpServletResponse response);
|
||||
|
||||
/**
|
||||
* 导出各分工会选择情况
|
||||
* @param projectId
|
||||
* @param response
|
||||
*/
|
||||
void exportUnionExcel(String projectId, HttpServletResponse response);
|
||||
|
||||
/**
|
||||
* 按福利选项导出
|
||||
* @param projectId
|
||||
* @param response
|
||||
*/
|
||||
void exportByWelfareOptions(String projectId, HttpServletResponse response);
|
||||
}
|
||||
@@ -21,7 +21,10 @@ import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.welfare.mode.CourierNumberExcelMode;
|
||||
import com.budwk.app.zhgh.welfare.model.*;
|
||||
import com.budwk.app.zhgh.welfare.param.WelfareFilterUserPageForm;
|
||||
import com.budwk.app.zhgh.welfare.param.WelfareListPageForm;
|
||||
import com.budwk.app.zhgh.welfare.service.WelfareListService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import org.nutz.dao.Chain;
|
||||
@@ -47,6 +50,7 @@ import java.util.stream.Collectors;
|
||||
* @Date 2024/8/12 17:42
|
||||
*/
|
||||
@IocBean(args = {"refer:dao"})
|
||||
@Slf4j
|
||||
public class WelfareListServiceImpl extends BaseServiceImpl<WelfareList> implements WelfareListService {
|
||||
public WelfareListServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
@@ -373,4 +377,165 @@ public class WelfareListServiceImpl extends BaseServiceImpl<WelfareList> impleme
|
||||
}).collect(Collectors.toList());
|
||||
insert(welfareLists);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Pagination pageData(WelfareListPageForm pageForm) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
t1.*,
|
||||
t2.loginname,
|
||||
t2.username,
|
||||
t2.sex,
|
||||
t2.birthday
|
||||
FROM
|
||||
`welfare_list` t1
|
||||
LEFT JOIN sys_user t2 ON t2.id = t1.userId
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (StrUtil.isNotBlank(pageForm.getUserName())) {
|
||||
cnd.where().andLike("t2.username", pageForm.getUserName());
|
||||
}
|
||||
if (StrUtil.isNotBlank(pageForm.getLoginName())) {
|
||||
cnd.where().andLike("t2.loginname", pageForm.getLoginName());
|
||||
}
|
||||
cnd.andEX("t2.sex", "=", pageForm.getSex());
|
||||
cnd.andEX("t2.birthday", "=", pageForm.getBirthday());
|
||||
if (pageForm.getBirthMonths() != null && pageForm.getBirthMonths().length > 0) {
|
||||
cnd.andEX("MONTH(t2.birthday)", "in", pageForm.getBirthMonths());
|
||||
}
|
||||
cnd.andEX("t1.welfareUnitId", "in", pageForm.getUnitIds());
|
||||
cnd.andEX("t1.welfareUnionId", "=", pageForm.getUnionId());
|
||||
cnd.andEX("t1.personType", "in", pageForm.getPersonTypes());
|
||||
cnd.andEX("t1.preparedBy", "in", pageForm.getPreparedBys());
|
||||
cnd.andEX("t1.userState", "in", pageForm.getUserStates());
|
||||
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return pagination;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pagination notWelfareUserPageData(WelfareFilterUserPageForm pageForm) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
id,
|
||||
loginname,
|
||||
username,
|
||||
sex,
|
||||
birthday,
|
||||
personType,
|
||||
preparedBy,
|
||||
userState,
|
||||
unitId,
|
||||
unitName,
|
||||
unionId,
|
||||
unionName,
|
||||
member
|
||||
FROM
|
||||
vw_user
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (StrUtil.isNotBlank(pageForm.getUserName())) {
|
||||
cnd.where().andLike("username", pageForm.getUserName());
|
||||
}
|
||||
if (StrUtil.isNotBlank(pageForm.getLoginName())) {
|
||||
cnd.where().andLike("loginname", pageForm.getLoginName());
|
||||
}
|
||||
cnd.andEX("sex", "=", pageForm.getSex());
|
||||
cnd.andEX("birthday", "=", pageForm.getBirthday());
|
||||
if (pageForm.getBirthMonths() != null && pageForm.getBirthMonths().length > 0) {
|
||||
cnd.andEX("MONTH(birthday)", "in", pageForm.getBirthMonths());
|
||||
}
|
||||
cnd.andEX("unionId", "=", pageForm.getUnionId());
|
||||
cnd.andEX("unitId", "in", pageForm.getUnitIds());
|
||||
cnd.andEX("personType", "in", pageForm.getPersonTypes());
|
||||
cnd.andEX("preparedBy", "in", pageForm.getPreparedBys());
|
||||
cnd.andEX("userState", "in", pageForm.getUserStates());
|
||||
|
||||
if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
|
||||
cnd.asc("unionCode");
|
||||
cnd.asc("unitCode");
|
||||
cnd.asc("sex");
|
||||
} else {
|
||||
cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
|
||||
}
|
||||
|
||||
cnd.and("id", "not in", Sqls.create("select userId from `welfare_list` where projectId = @projectId").setParam("projectId", pageForm.getProjectId()));
|
||||
|
||||
sql.setCondition(cnd);
|
||||
return listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addWelfareUser(WelfareFilterUserPageForm pageForm) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
id,
|
||||
loginname,
|
||||
username,
|
||||
sex,
|
||||
birthday,
|
||||
personType,
|
||||
preparedBy,
|
||||
userState,
|
||||
unitId,
|
||||
unitName,
|
||||
unionId,
|
||||
unionName,
|
||||
member
|
||||
FROM
|
||||
vw_user
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (StrUtil.isNotBlank(pageForm.getUserName())) {
|
||||
cnd.where().andLike("username", pageForm.getUserName());
|
||||
}
|
||||
if (StrUtil.isNotBlank(pageForm.getLoginName())) {
|
||||
cnd.where().andLike("loginname", pageForm.getLoginName());
|
||||
}
|
||||
cnd.andEX("sex", "=", pageForm.getSex());
|
||||
cnd.andEX("birthday", "=", pageForm.getBirthday());
|
||||
if (pageForm.getBirthMonths() != null && pageForm.getBirthMonths().length > 0) {
|
||||
cnd.andEX("MONTH(birthday)", "in", pageForm.getBirthMonths());
|
||||
}
|
||||
cnd.andEX("unionId", "=", pageForm.getUnionId());
|
||||
cnd.andEX("unitId", "in", pageForm.getUnitIds());
|
||||
cnd.andEX("personType", "in", pageForm.getPersonTypes());
|
||||
cnd.andEX("preparedBy", "in", pageForm.getPreparedBys());
|
||||
cnd.andEX("userState", "in", pageForm.getUserStates());
|
||||
|
||||
if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
|
||||
cnd.asc("unionCode");
|
||||
cnd.asc("unitCode");
|
||||
cnd.asc("sex");
|
||||
} else {
|
||||
cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
|
||||
}
|
||||
|
||||
cnd.and("id", "not in", Sqls.create("select userId from `welfare_list` where projectId = @projectId").setParam("projectId", pageForm.getProjectId()));
|
||||
|
||||
sql.setCondition(cnd);
|
||||
List<NutMap> list = listMap(sql);
|
||||
|
||||
// 插入到福利名单表中
|
||||
List<WelfareList> welfareList = list.stream().map(user -> {
|
||||
WelfareList wl = new WelfareList();
|
||||
wl.setProjectId(pageForm.getProjectId());
|
||||
wl.setUserId(user.getString("id"));
|
||||
wl.setWelfareUnitId(user.getString("unionId"));
|
||||
wl.setWelfareUnitName(user.getString("unitName"));
|
||||
wl.setWelfareUnionId(user.getString("unionId"));
|
||||
wl.setWelfareUnionName(user.getString("unionName"));
|
||||
wl.setPersonType(user.getString("personType"));
|
||||
wl.setPreparedBy(user.getString("preparedBy"));
|
||||
wl.setUserState(user.getString("userState"));
|
||||
return wl;
|
||||
}).toList();
|
||||
log.info("选择用户生成福利名单,筛选条件:{},筛选结果条数:{}", Json.toJson(pageForm), welfareList.size());
|
||||
dao().insert(welfareList);
|
||||
}
|
||||
}
|
||||
|
||||
+45
-99
@@ -3,22 +3,30 @@ package com.budwk.app.zhgh.welfare.service.impl;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.service.impl.BaseServiceImpl;
|
||||
import com.budwk.app.base.utils.PageUtil;
|
||||
import com.budwk.app.sys.models.Sys_home_activity;
|
||||
import com.budwk.app.sys.models.Sys_user;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.welfare.model.*;
|
||||
import com.budwk.app.zhgh.welfare.param.WelfareFilterUserPageForm;
|
||||
import com.budwk.app.zhgh.welfare.service.WelfareProjectService;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Chain;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.dao.util.cri.Static;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.json.Json;
|
||||
import org.nutz.lang.Lang;
|
||||
import org.nutz.lang.random.R;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
@@ -33,99 +41,51 @@ import java.util.stream.Collectors;
|
||||
*/
|
||||
@IocBean(args = {"refer:dao"})
|
||||
public class WelfareProjectServiceImpl extends BaseServiceImpl<WelfareProject> implements WelfareProjectService {
|
||||
private static final Logger log = LoggerFactory.getLogger(WelfareProjectServiceImpl.class);
|
||||
|
||||
public WelfareProjectServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WelfareProject projectInfo(String projectId) {
|
||||
WelfareProject project = fetchLinks(dao().fetch(WelfareProject.class, Cnd.where("id", "=", projectId)), "welfareProjectSubjects");
|
||||
List<WelfareProjectSubject> welfareProjectSubjects = project.getWelfareProjectSubjects();
|
||||
Sql sqlo = Sqls.create("""
|
||||
SELECT
|
||||
optionName
|
||||
FROM
|
||||
welfare_project_subject_option
|
||||
WHERE
|
||||
id IN ( SELECT selectOptionId FROM welfare_project_user_selection WHERE selectUserId = @userid AND welfareId = @welfareId )
|
||||
ORDER BY
|
||||
optionSort ASC
|
||||
""");
|
||||
sqlo.setParam("userid", SecurityUtil.getUserId());
|
||||
sqlo.setParam("welfareId", project.getId());
|
||||
List<NutMap> optionNameList = listMap(sqlo);
|
||||
if (Lang.isNotEmpty(optionNameList)) {
|
||||
project.setGift(optionNameList.stream().map(x -> x.getString("optionName")).collect(Collectors.joining("、")));
|
||||
}
|
||||
if (Lang.isNotEmpty(welfareProjectSubjects)) {
|
||||
fetchLinks(welfareProjectSubjects, "options", Cnd.NEW().asc("optionSort"));
|
||||
}
|
||||
WelfareProject project = fetch(projectId);
|
||||
fetchLinks(project, "options");
|
||||
return project;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void save(WelfareProject project) {
|
||||
if (StrUtil.isBlank(project.getId())) {
|
||||
project.setYear(DateUtil.thisYear());
|
||||
WelfareProject insertProject = insertWith(project, "welfareProjectSubjects");
|
||||
if (Lang.isNotEmpty(insertProject.getWelfareProjectSubjects())) {
|
||||
insertProject.getWelfareProjectSubjects().forEach(v -> {
|
||||
insertLinks(v, "options");
|
||||
});
|
||||
}
|
||||
} else {
|
||||
dao().clear(WelfareProjectSubjectOption.class, Cnd.NEW().and(new Static("subjectId in (select id from welfare_project_subject where projectId = '%s')".formatted(project.getId()))));
|
||||
dao().clear(WelfareProjectSubject.class, Cnd.where("projectId", "=", project.getId()));
|
||||
|
||||
update(project);
|
||||
|
||||
List<WelfareProjectSubject> newSubject = project.getWelfareProjectSubjects();
|
||||
|
||||
if (Lang.isNotEmpty(newSubject)) {
|
||||
newSubject.forEach(v -> {
|
||||
if (v.getId() == null) {
|
||||
v.setId(R.UU32());
|
||||
v.setProjectId(project.getId());
|
||||
}
|
||||
|
||||
Chain chain = Chain.make("id", v.getId());
|
||||
chain.add("projectId", v.getProjectId());
|
||||
chain.add("subjectName", v.getSubjectName());
|
||||
chain.add("subjectType", v.getSubjectType());
|
||||
dao().insert(WelfareProjectSubject.class, chain);
|
||||
|
||||
List<WelfareProjectSubjectOption> options = v.getOptions();
|
||||
options.forEach(o -> {
|
||||
if (o.getId() == null) {
|
||||
o.setId(R.UU32());
|
||||
o.setSubjectId(v.getId());
|
||||
}
|
||||
Chain optionChain = Chain.make("id", o.getId());
|
||||
optionChain.add("subjectId", o.getSubjectId());
|
||||
optionChain.add("optionName", o.getOptionName());
|
||||
optionChain.add("optionNameId", o.getOptionNameId());
|
||||
optionChain.add("optionType", o.getOptionType());
|
||||
optionChain.add("isDefaultOption", o.getIsDefaultOption());
|
||||
optionChain.add("isSystemDefault", o.getIsSystemDefault());
|
||||
optionChain.add("optionSort", o.getOptionSort());
|
||||
optionChain.add("imgUrl", o.getImgUrl());
|
||||
optionChain.add("description", o.getDescription());
|
||||
optionChain.add("shoppingId", o.getShoppingId());
|
||||
optionChain.add("shoppingName", o.getShoppingName());
|
||||
optionChain.add("supplier", o.getSupplier());
|
||||
optionChain.add("simpleDesc", o.getSimpleDesc());
|
||||
dao().insert(WelfareProjectSubjectOption.class, optionChain);
|
||||
});
|
||||
});
|
||||
}
|
||||
update(project);
|
||||
}
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public void saveProject(WelfareProject project) {
|
||||
// 插入项目
|
||||
project.setYear(DateUtil.thisYear());
|
||||
insertWith(project, "options");
|
||||
|
||||
// 更新首页活动
|
||||
Sys_home_activity sysHomeActivity = project.covertToSysHomeActivity();
|
||||
dao().insertOrUpdate(sysHomeActivity);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public void updateProject(WelfareProject project) {
|
||||
// 更新项目
|
||||
update(project);
|
||||
|
||||
// 新增或更新选项
|
||||
for (WelfareProjectSubjectOption option : project.getOptions()) {
|
||||
option.setWelfareId(project.getId());
|
||||
dao().insertOrUpdate(option);
|
||||
}
|
||||
|
||||
// 更新首页活动
|
||||
Sys_home_activity sysHomeActivity = project.covertToSysHomeActivity();
|
||||
dao().insertOrUpdate(sysHomeActivity);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public void deleteWelfare(String id) {
|
||||
WelfareProjectSubject welfareProjectSubject = dao().fetch(WelfareProjectSubject.class, Cnd.where("projectId", "=", id));
|
||||
dao().clear(WelfareProjectSubject.class, Cnd.where("projectId", "=", id));
|
||||
@@ -204,28 +164,12 @@ public class WelfareProjectServiceImpl extends BaseServiceImpl<WelfareProject> i
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<NutMap> getWelfareList(Integer year) {
|
||||
List<WelfareProject> projectList = query(Cnd.NEW().andEX("year", "=", year).desc("choiceTimeStart"));
|
||||
List<NutMap> maps = new ArrayList<>();
|
||||
projectList.forEach(v -> {
|
||||
NutMap map = new NutMap();
|
||||
map.setv("id", v.getId());
|
||||
map.setv("name", v.getName());
|
||||
map.setv("provideMode", v.getProvideMode());
|
||||
map.setv("signMode", v.getSignMode());
|
||||
map.setv("isCheckBox", v.getIsCheckBox());
|
||||
map.setv("multiSelectNum", v.getMultiSelectNum());
|
||||
map.setv("choiceTimeStart", v.getChoiceTimeStart());
|
||||
map.setv("choiceTimeEnd", v.getChoiceTimeEnd());
|
||||
map.setv("singleOptionSupportMultipleSelection", v.getSingleOptionSupportMultipleSelection());
|
||||
WelfareProjectSubject subject = dao().fetch(WelfareProjectSubject.class, Cnd.where("projectId", "=", v.getId()));
|
||||
if(ObjectUtil.isNotNull(subject)){
|
||||
List<WelfareProjectSubjectOption> optionList = dao().query(WelfareProjectSubjectOption.class, Cnd.where("subjectId", "=", subject.getId()));
|
||||
map.setv("optionList", optionList);
|
||||
}
|
||||
maps.add(map);
|
||||
});
|
||||
return maps;
|
||||
public List<WelfareProject> getWelfareList(Integer year) {
|
||||
List<WelfareProject> list = dao().query(WelfareProject.class, Cnd.NEW().andEX("year", "=", year).desc(WelfareProject::getChoiceTimeStart));
|
||||
for (WelfareProject project : list) {
|
||||
dao().fetchLinks(project, "options");
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
private void joinWelfareList(List<NutMap> users, String projectId) {
|
||||
@@ -242,4 +186,6 @@ public class WelfareProjectServiceImpl extends BaseServiceImpl<WelfareProject> i
|
||||
}
|
||||
dao().insert(lists);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
+8
-13
@@ -51,9 +51,7 @@ public class WelfareSingleServiceImpl extends BaseServiceImpl implements Welfare
|
||||
@Override
|
||||
public NutMap pageData(String projectId, String unionId) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(),
|
||||
RoleConstant.SCHOOL_UNION_ADMIN.name(),
|
||||
RoleConstant.SCHOOL_UNION_WELFARE_ADMIN.name())) {
|
||||
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name(), RoleConstant.SCHOOL_UNION_WELFARE_ADMIN.name())) {
|
||||
cnd.and("id", "=", SecurityUtil.getUnionId());
|
||||
}
|
||||
cnd.andEX("id", "=", unionId);
|
||||
@@ -62,13 +60,13 @@ public class WelfareSingleServiceImpl extends BaseServiceImpl implements Welfare
|
||||
sqlUnion.setCondition(cnd);
|
||||
List<NutMap> sysUnions = listMap(sqlUnion);
|
||||
|
||||
Sql sqlViewList = Sqls.create("SELECT * FROM welfare_list where projectId=@projectId and welfareUnitId is not null").setParam("projectId", projectId);
|
||||
Sql sqlViewList = Sqls.create("SELECT * FROM welfare_list where projectId=@projectId and welfareUnionId is not null").setParam("projectId", projectId);
|
||||
List<NutMap> viewMap = listMap(sqlViewList);
|
||||
|
||||
//循环每个分工会
|
||||
sysUnions.forEach(v -> {
|
||||
//找出这个分工会的人数
|
||||
List<NutMap> collect = viewMap.stream().filter(view -> view.getString("welfareUnitId").equals(v.getString("id"))).collect(Collectors.toList());
|
||||
List<NutMap> collect = viewMap.stream().filter(view -> view.getString("welfareUnionId").equals(v.getString("id"))).toList();
|
||||
v.addv("teacherSum", collect.size());
|
||||
});
|
||||
|
||||
@@ -81,10 +79,7 @@ public class WelfareSingleServiceImpl extends BaseServiceImpl implements Welfare
|
||||
for (NutMap wUnit : sysUnions) {
|
||||
//该分工会选择数据
|
||||
List<NutMap> thisUnionSelectionList;
|
||||
thisUnionSelectionList = userSelectionList.stream().filter(x ->
|
||||
x.getString("unionId").equals(wUnit.getString("id")) &&
|
||||
x.getString("welfareId").equals(projectId)).collect(Collectors.toList());
|
||||
//
|
||||
thisUnionSelectionList = userSelectionList.stream().filter(x -> x.getString("unionId").equals(wUnit.getString("id")) && x.getString("welfareId").equals(projectId)).toList();
|
||||
optionList.forEach(o -> {
|
||||
int count = 0;
|
||||
count = userSelectionList.stream().filter(x ->
|
||||
@@ -94,9 +89,9 @@ public class WelfareSingleServiceImpl extends BaseServiceImpl implements Welfare
|
||||
wUnit.put(o.getString("optionName"), count);
|
||||
});
|
||||
//已选人数
|
||||
wUnit.put("totalCount", thisUnionSelectionList.stream().map(v -> v.getString("selectUserId")).distinct().count());
|
||||
wUnit.put("selectedNum", thisUnionSelectionList.stream().map(v -> v.getString("selectUserId")).distinct().count());
|
||||
//未选人数
|
||||
wUnit.put("unselectedTeacherSum", wUnit.getInt("teacherSum") - wUnit.getInt("totalCount"));
|
||||
wUnit.put("unSelectedNum", wUnit.getInt("teacherSum") - wUnit.getInt("totalCount"));
|
||||
}
|
||||
|
||||
//表格列数据
|
||||
@@ -105,8 +100,8 @@ public class WelfareSingleServiceImpl extends BaseServiceImpl implements Welfare
|
||||
optionList.forEach(v -> {
|
||||
labelList.add(NutMap.NEW().addv("label", v.getString("optionName")).addv("prop", v.getString("optionName")));
|
||||
});
|
||||
labelList.add(NutMap.NEW().addv("label", "参加人数").addv("prop", "totalCount"));
|
||||
labelList.add(NutMap.NEW().addv("label", "未选人数").addv("prop", "unselectedTeacherSum"));
|
||||
labelList.add(NutMap.NEW().addv("label", "已选人数").addv("prop", "selectedNum"));
|
||||
labelList.add(NutMap.NEW().addv("label", "未选人数").addv("prop", "unSelectedNum"));
|
||||
|
||||
return NutMap.NEW().addv("tableList", sysUnions).addv("tableColumn", labelList);
|
||||
}
|
||||
|
||||
+248
@@ -0,0 +1,248 @@
|
||||
package com.budwk.app.zhgh.welfare.service.impl;
|
||||
|
||||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.service.impl.BaseServiceImpl;
|
||||
import com.budwk.app.base.utils.CommonDownloadUtil;
|
||||
import com.budwk.app.sys.models.Sys_union;
|
||||
import com.budwk.app.zhgh.welfare.model.WelfareProject;
|
||||
import com.budwk.app.zhgh.welfare.model.WelfareProjectSubjectOption;
|
||||
import com.budwk.app.zhgh.welfare.service.WelfareStatisticsService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.FieldFilter;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.dao.util.Daos;
|
||||
import org.nutz.dao.util.cri.SqlExpressionGroup;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
@IocBean(args = {"refer:dao"})
|
||||
@Slf4j
|
||||
public class WelfareStatisticsServiceImpl extends BaseServiceImpl<WelfareProject> implements WelfareStatisticsService {
|
||||
public WelfareStatisticsServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pagination selectedUnionUserPageData(PageForm pageForm, String projectId, String unionId) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
u.loginname AS loginName,
|
||||
u.username AS userName,
|
||||
wl.welfareUnitName,
|
||||
wl.welfareUnionName,
|
||||
wpus.mobile,
|
||||
GROUP_CONCAT(DISTINCT wpso.optionName, '(', wpus.selectNum, '份)') selectOptionName
|
||||
FROM
|
||||
welfare_project_user_selection wpus
|
||||
LEFT JOIN welfare_list wl on wl.userId = wpus.selectUserId AND wl.projectId = wpus.welfareId
|
||||
LEFT JOIN sys_user u ON u.id = wpus.selectUserId
|
||||
LEFT JOIN welfare_project_subject_option wpso ON wpso.id = wpus.selectOptionId
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("wl.welfareUnionId", "=", unionId);
|
||||
cnd.and("wpus.welfareId", "=", projectId);
|
||||
cnd.groupBy("u.loginname");
|
||||
cnd.desc("wl.welfareUnionName").desc("wl.welfareUnitName").desc("wpus.selectOptionId");
|
||||
|
||||
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.orLike("u.loginname", pageForm.getSearchKeyword());
|
||||
seg.orLike("u.username", pageForm.getSearchKeyword());
|
||||
}
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return pagination;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exportSelectedUnionUser(String projectId, String unionId, HttpServletResponse response) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
u.loginname AS loginName,
|
||||
u.username AS userName,
|
||||
wl.welfareUnitName,
|
||||
wl.welfareUnionName,
|
||||
wpus.mobile,
|
||||
GROUP_CONCAT(DISTINCT wpso.optionName, '(', wpus.selectNum, '份)') selectOptionName
|
||||
FROM
|
||||
welfare_project_user_selection wpus
|
||||
LEFT JOIN welfare_list wl on wl.userId = wpus.selectUserId AND wl.projectId = wpus.welfareId
|
||||
LEFT JOIN sys_user u ON u.id = wpus.selectUserId
|
||||
LEFT JOIN welfare_project_subject_option wpso ON wpso.id = wpus.selectOptionId
|
||||
$condition
|
||||
""");
|
||||
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("wl.welfareUnionId", "=", unionId);
|
||||
cnd.and("wpus.welfareId", "=", projectId);
|
||||
cnd.groupBy("u.loginname");
|
||||
cnd.desc("wl.welfareUnionName").desc("wl.welfareUnitName").desc("wpus.selectOptionId");
|
||||
sql.setCondition(cnd);
|
||||
List<NutMap> list = listMap(sql);
|
||||
|
||||
// 项目名称
|
||||
Dao projectDao = Daos.ext(dao(), FieldFilter.create(WelfareProject.class, "name"));
|
||||
WelfareProject welfareProject = projectDao.fetch(WelfareProject.class, projectId);
|
||||
String projectName = welfareProject.getName();
|
||||
|
||||
// 分工会名称
|
||||
Sys_union union = dao().fetch(Sys_union.class, unionId);
|
||||
String unionName = Optional.ofNullable(union).map(Sys_union::getName).orElse("");
|
||||
|
||||
// excel列
|
||||
List<ExcelExportEntity> entities = new ArrayList<>();
|
||||
entities.add(new ExcelExportEntity("工号", "loginName", 20));
|
||||
entities.add(new ExcelExportEntity("姓名", "userName", 20));
|
||||
entities.add(new ExcelExportEntity("单位", "welfareUnitName", 20));
|
||||
entities.add(new ExcelExportEntity("工会", "welfareUnionName", 20));
|
||||
entities.add(new ExcelExportEntity("手机号", "mobile", 20));
|
||||
entities.add(new ExcelExportEntity("所选福利", "selectOptionName", 20));
|
||||
|
||||
// 设置导出参数
|
||||
ExportParams exportParams = new ExportParams();
|
||||
exportParams.setType(ExcelType.XSSF);
|
||||
// 导出Excel并下载
|
||||
try (Workbook workbook = ExcelExportUtil.exportExcel(exportParams, entities, list)) {
|
||||
CommonDownloadUtil.download(projectName + unionName + "已选择人员.xlsx", workbook, response);
|
||||
} catch (Exception e) {
|
||||
log.error("导出Excel失败", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pagination unSelectedUnionUserPageData(PageForm pageForm, String projectId, String unionId) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
u.loginname AS loginName,
|
||||
u.username AS userName,
|
||||
wl.welfareUnitName,
|
||||
wl.welfareUnionName
|
||||
FROM
|
||||
`welfare_list` wl
|
||||
LEFT JOIN welfare_project_user_selection wpus ON wl.userId = wpus.selectUserId
|
||||
AND wpus.welfareId = @projectId
|
||||
LEFT JOIN sys_user u ON u.id = wl.userId
|
||||
WHERE
|
||||
wl.projectId = @projectId
|
||||
AND wl.welfareUnionId = @unionId
|
||||
AND wpus.selectUserId IS NULL
|
||||
GROUP BY
|
||||
u.loginname
|
||||
ORDER BY
|
||||
wl.welfareUnionName DESC,
|
||||
wl.welfareUnitName DESC
|
||||
""");
|
||||
sql.setParam("projectId", projectId);
|
||||
sql.setParam("unionId", unionId);
|
||||
Pagination pagination = listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return pagination;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exportUnSelectedUnionUser(String projectId, String unionId, HttpServletResponse response) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
u.loginname AS loginName,
|
||||
u.username AS userName,
|
||||
wl.welfareUnitName,
|
||||
wl.welfareUnionName
|
||||
FROM
|
||||
`welfare_list` wl
|
||||
LEFT JOIN welfare_project_user_selection wpus ON wl.userId = wpus.selectUserId
|
||||
AND wpus.welfareId = @projectId
|
||||
LEFT JOIN sys_user u ON u.id = wl.userId
|
||||
WHERE
|
||||
wl.projectId = @projectId
|
||||
AND wl.welfareUnionId = @unionId
|
||||
AND wpus.selectUserId IS NULL
|
||||
GROUP BY
|
||||
u.loginname
|
||||
ORDER BY
|
||||
wl.welfareUnionName DESC,
|
||||
wl.welfareUnitName DESC
|
||||
""");
|
||||
sql.setParam("projectId", projectId);
|
||||
sql.setParam("unionId", unionId);
|
||||
List<NutMap> list = listMap(sql);
|
||||
|
||||
// 项目名称
|
||||
Dao projectDao = Daos.ext(dao(), FieldFilter.create(WelfareProject.class, "name"));
|
||||
WelfareProject welfareProject = projectDao.fetch(WelfareProject.class, projectId);
|
||||
String projectName = welfareProject.getName();
|
||||
|
||||
// 分工会名称
|
||||
Sys_union union = dao().fetch(Sys_union.class, unionId);
|
||||
String unionName = Optional.ofNullable(union).map(Sys_union::getName).orElse("");
|
||||
|
||||
// excel列
|
||||
List<ExcelExportEntity> entities = new ArrayList<>();
|
||||
entities.add(new ExcelExportEntity("工号", "loginName", 20));
|
||||
entities.add(new ExcelExportEntity("姓名", "userName", 20));
|
||||
entities.add(new ExcelExportEntity("单位", "welfareUnitName", 20));
|
||||
entities.add(new ExcelExportEntity("工会", "welfareUnionName", 20));
|
||||
|
||||
// 设置导出参数
|
||||
ExportParams exportParams = new ExportParams();
|
||||
exportParams.setType(ExcelType.XSSF);
|
||||
// 导出Excel并下载
|
||||
try (Workbook workbook = ExcelExportUtil.exportExcel(exportParams, entities, list)) {
|
||||
CommonDownloadUtil.download(projectName + unionName + "未选择人员.xlsx", workbook, response);
|
||||
} catch (Exception e) {
|
||||
log.error("导出Excel失败", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void exportUnionExcel(String projectId, HttpServletResponse response) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
u.loginname AS loginName,
|
||||
u.username AS userName,
|
||||
wl.welfareUnitName,
|
||||
wl.welfareUnionName,
|
||||
wpus.mobile,
|
||||
GROUP_CONCAT(DISTINCT wpso.optionName, '(', wpus.selectNum, '份)') selectOptionName
|
||||
FROM
|
||||
welfare_project_user_selection wpus
|
||||
LEFT JOIN welfare_list wl on wl.userId = wpus.selectUserId AND wl.projectId = wpus.welfareId
|
||||
LEFT JOIN sys_user u ON u.id = wpus.selectUserId
|
||||
LEFT JOIN welfare_project_subject_option wpso ON wpso.id = wpus.selectOptionId
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("wpus.welfareId", "=", projectId);
|
||||
cnd.groupBy("u.loginname");
|
||||
cnd.desc("wl.welfareUnionName").desc("wl.welfareUnitName").desc("wpus.selectOptionId");
|
||||
sql.setCondition(cnd);
|
||||
List<NutMap> list = listMap(sql);
|
||||
|
||||
List<ExcelExportEntity> entities = new ArrayList<>();
|
||||
entities.add(new ExcelExportEntity("分工会", "loginName", 20));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void exportByWelfareOptions(String projectId, HttpServletResponse response) {
|
||||
List<WelfareProjectSubjectOption> options = dao().query(WelfareProjectSubjectOption.class, Cnd.where(WelfareProjectSubjectOption::getWelfareId, "=", projectId));
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,224 +0,0 @@
|
||||
let WELFARE_OPTION_TABLE = {
|
||||
template: `
|
||||
<div>
|
||||
<el-card>
|
||||
<el-form ref="form">
|
||||
|
||||
<el-card :key="s.id" class="item" shadow="never" v-for="(s,idx) in subject">
|
||||
<!-- <el-form-item :label="(s.subjectType==='radio'?'(单选)':'(多选)')+ (idx+1)+'.'" prop="subjectName">-->
|
||||
<el-form-item label="" prop="subjectName">
|
||||
<div class="s-title-wrap">
|
||||
<el-row align="middle" style="width: 100%" type="flex">
|
||||
<el-col :xl="15"
|
||||
style="border: 1px dashed rgb(217, 217, 217);border-radius:6px;display: flex;align-items: center;">
|
||||
<el-input class="text-input" data-type="subject"
|
||||
v-model="s.subjectName"></el-input>
|
||||
</el-col>
|
||||
<el-col :xl="2" style="text-align: center"></el-col>
|
||||
<!-- <el-col :xl="2" style="text-align: center">
|
||||
<div class="option-delete">
|
||||
<el-button circle
|
||||
icon="el-icon-delete"
|
||||
size="mini" type="danger"
|
||||
@click="subject.splice(idx,1)"></el-button>
|
||||
</div>
|
||||
</el-col>-->
|
||||
</el-row>
|
||||
</div>
|
||||
<div class="s-options-list" style="margin-top: 10px;">
|
||||
<el-table :data="s.options" border>
|
||||
<el-table-column
|
||||
align="center"
|
||||
header-align="center"
|
||||
label="福利名称"
|
||||
>
|
||||
<template slot-scope="{row}">
|
||||
<div
|
||||
style="border: 1px dashed rgb(217, 217, 217);border-radius:6px;display: flex;align-items: center;padding-left: 10px;">
|
||||
<i class="fa fa-circle-o" style="cursor: pointer"
|
||||
v-if="s.subjectType==='radio'"></i>
|
||||
<i class="fa fa-square-o"
|
||||
style="cursor: pointer"
|
||||
v-else-if="s.subjectType==='checkBox'"></i>
|
||||
|
||||
<el-input autosize class="text-input"
|
||||
data-type="option"
|
||||
v-model="row.optionName"
|
||||
></el-input>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" header-align="center"
|
||||
label="备注1">
|
||||
<template slot-scope="{row}">
|
||||
<el-input max="100" type="textarea"
|
||||
v-model="row.supplier"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" header-align="center"
|
||||
label="备注2">
|
||||
<template slot-scope="{row}">
|
||||
<el-input max="100" type="textarea"
|
||||
v-model="row.simpleDesc"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" header-align="center" label="排序"
|
||||
width="120px">
|
||||
<template slot-scope="{row}">
|
||||
<div
|
||||
style="border: 1px dashed rgb(217, 217, 217);border-radius:6px;display: flex;align-items: center;padding-left: 10px;">
|
||||
<el-input autosize class="text-input"
|
||||
data-type="option"
|
||||
v-model="row.optionSort"
|
||||
></el-input>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" header-align="center" label="图片"
|
||||
width="120">
|
||||
<template slot-scope="{row,$index}">
|
||||
<file-upload :upload_number="1" :value.sync="row.imgUrl"
|
||||
accept=".jpg,.jpeg,.png"
|
||||
class="imgUrl"
|
||||
upload_result_type="url"
|
||||
complete_result upload_mode="image"
|
||||
upload_result_category="interval"></file-upload>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" header-align="center" label="说明"
|
||||
width="100px ">
|
||||
<template slot-scope="scope">
|
||||
<el-link @click="openDescRichText(scope.row.description,idx,scope.$index)"
|
||||
type="primary">
|
||||
编辑说明
|
||||
</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" header-align="center" label="操作"
|
||||
width="100px">
|
||||
<template slot-scope="{row,$index}">
|
||||
<div class="option-delete">
|
||||
<el-button @click="deleteRow(s.options,row,$index)"
|
||||
circle
|
||||
icon="el-icon-delete" size="mini"
|
||||
type="danger"></el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<div class="s-operation">
|
||||
<el-button @click="s.options.push({optionType:'套餐',optionNameId:'',optionName:'福利'+(s.options.length+1),optionSort:s.options.length+1,imgUrl:null,isDefaultOption:false,isSystemDefault:false})" size="small"
|
||||
type="primary">
|
||||
添加福利
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-card>
|
||||
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<el-dialog
|
||||
:append-to-body="true"
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="richTextDialog"
|
||||
title="编辑说明"
|
||||
width="60%">
|
||||
<text-editor v-model="descRichTextContent"></text-editor>
|
||||
<span class="dialog-footer" slot="footer">
|
||||
<el-button @click="richTextDialog = false">取 消</el-button>
|
||||
<el-button @click="saveRichText" type="primary">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
`,
|
||||
watch: {
|
||||
subject(val) {
|
||||
}
|
||||
},
|
||||
props: {
|
||||
subject: {
|
||||
type: Array,
|
||||
default: []
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
descRichTextContent: "",
|
||||
files: [],
|
||||
shoppingTypeOptions: null,
|
||||
richTextDialog: false,
|
||||
subjectIndex: 0,
|
||||
optionIndex: 0,
|
||||
imgPopover: false,
|
||||
idx: null,
|
||||
oidx: null,
|
||||
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
deleteRow(options, row, index) {
|
||||
options.splice(index, 1)
|
||||
const shoppingTypeOption = this.shoppingTypeOptions.find(v => v.id === row.optionNameId)
|
||||
shoppingTypeOption.disabled = false
|
||||
},
|
||||
addSubject(type) {
|
||||
let subject = {
|
||||
subjectName: '题目' + (this.subject.length + 1),
|
||||
subjectType: type,
|
||||
options: [
|
||||
{optionName: '选项一', imgUrl: null},
|
||||
{optionName: '选项一', imgUrl: null}
|
||||
]
|
||||
}
|
||||
this.subject.push(subject)
|
||||
},
|
||||
validate(fn) {
|
||||
if (this._validate()) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
|
||||
},
|
||||
_validate() {
|
||||
return this.subject.some(v => {
|
||||
if (!v.subjectName) return true
|
||||
return v.options.some(x => {
|
||||
if (!x.optionName) return true
|
||||
})
|
||||
})
|
||||
},
|
||||
openDescRichText(description, sIdx, oIdx) {
|
||||
this.descRichTextContent = description
|
||||
this.richTextDialog = true
|
||||
this.subjectIndex = sIdx
|
||||
this.optionIndex = oIdx
|
||||
},
|
||||
saveRichText() {
|
||||
this.subject[this.subjectIndex]['options'][this.optionIndex].description = this.descRichTextContent
|
||||
this.richTextDialog = false
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/*<style>
|
||||
.imgUrl .el-upload--picture-card {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
}
|
||||
|
||||
.imgUrl .el-upload--picture-card i {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
</style>*/
|
||||
@@ -1,35 +1,30 @@
|
||||
let ADDRESS_DIALOG = {
|
||||
template: `
|
||||
<el-dialog
|
||||
:append-to-body="true"
|
||||
:modal-append-to-body="false"
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="dialogVisible"
|
||||
title="收货地址"
|
||||
width="30%">
|
||||
template: /*language=HTML*/ `
|
||||
<el-dialog
|
||||
:append-to-body="true"
|
||||
:modal-append-to-body="false"
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="dialogVisible"
|
||||
title="收货地址"
|
||||
width="30%">
|
||||
|
||||
<el-form :model="formData" label-position="right"
|
||||
label-suffix=":" label-width="120px" ref="addForm">
|
||||
<el-row :gutter="60">
|
||||
<el-col :span="24" class="pb20">
|
||||
<el-form :model="formData" label-position="right" label-suffix=":" label-width="120px" ref="addForm">
|
||||
<el-form-item :rules="{required:true,message: '请选择地址信息', trigger: 'blur'}"
|
||||
label="地址信息"
|
||||
prop="addressList">
|
||||
<el-cascader
|
||||
:options="dzOptions"
|
||||
:props="{ expandTrigger: 'hover' }"
|
||||
@change="handleChange"
|
||||
clearable
|
||||
placeholder="请选择地址信息"
|
||||
style="width: 100%"
|
||||
v-model="formData.addressList"></el-cascader>
|
||||
:options="dzOptions"
|
||||
:props="{ expandTrigger: 'hover' }"
|
||||
@change="handleChange"
|
||||
clearable
|
||||
placeholder="请选择地址信息"
|
||||
style="width: 100%"
|
||||
v-model="formData.addressList"></el-cascader>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" class="pb20">
|
||||
<el-form-item
|
||||
:rules="{required:true,message: '请填写您的详细地址', trigger: 'blur'}"
|
||||
label="详细地址"
|
||||
prop="addressDetail">
|
||||
:rules="{required:true,message: '请填写您的详细地址', trigger: 'blur'}"
|
||||
label="详细地址"
|
||||
prop="addressDetail">
|
||||
<el-input maxlength="100"
|
||||
placeholder="请输入详细地址信息,如道路、门牌号、小区、楼栋号、单元等信息"
|
||||
rows="3"
|
||||
@@ -37,41 +32,35 @@ let ADDRESS_DIALOG = {
|
||||
type="textarea"
|
||||
v-model="formData.addressDetail"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" class="pb20">
|
||||
<el-form-item
|
||||
:rules="{required:true,message: '请填写收货人姓名', trigger: 'blur'}"
|
||||
label="收货人姓名"
|
||||
prop="userName">
|
||||
:rules="{required:true,message: '请填写收货人姓名', trigger: 'blur'}"
|
||||
label="收货人姓名"
|
||||
prop="userName">
|
||||
<el-input maxlength="11"
|
||||
placeholder="请填写收货人姓名"
|
||||
v-model="formData.userName"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" class="pb20">
|
||||
<el-form-item
|
||||
:rules="{required:true,message: '请填写手机号码', trigger: 'blur'}"
|
||||
label="手机号码"
|
||||
prop="tel">
|
||||
:rules="{required:true,message: '请填写手机号码', trigger: 'blur'}"
|
||||
label="手机号码"
|
||||
prop="tel">
|
||||
<el-input maxlength="11" placeholder="请填写手机号码"
|
||||
type="tel"
|
||||
v-model="formData.tel"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-form>
|
||||
|
||||
<span class="dialog-footer" slot="footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button @click="doSaveUserAddress" type="primary">保存</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
`,
|
||||
<span class="dialog-footer" slot="footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button @click="doSaveUserAddress" type="primary">保存</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
`,
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
dzOptions: chengShiList,
|
||||
dialogVisible: false,
|
||||
dialogVisible: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -101,16 +90,16 @@ let ADDRESS_DIALOG = {
|
||||
doSaveUserAddress() {
|
||||
this.$refs["addForm"].validate(async (valid) => {
|
||||
if (valid) {
|
||||
const resp = await this.$axios.post("/platform/welfare/addressManage/doSaveUserAddress", {data: JSON.stringify(this.formData)})
|
||||
const resp = await this.$axios.post("/platform/welfare/addressManage/doSaveUserAddress", { data: JSON.stringify(this.formData) })
|
||||
if (resp.code === 0) {
|
||||
this.$message({
|
||||
message: resp.msg,
|
||||
type: 'success'
|
||||
});
|
||||
type: "success"
|
||||
})
|
||||
this.$emit("select_user_address")
|
||||
this.dialogVisible = false
|
||||
} else {
|
||||
this.$message.error(resp.msg);
|
||||
this.$message.error(resp.msg)
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -121,7 +110,7 @@ let ADDRESS_DIALOG = {
|
||||
row.addressList.push(province.value)
|
||||
const city = province.children.find(p => p.label === row.city)
|
||||
row.addressList.push(city.value)
|
||||
if (row.county){
|
||||
if (row.county) {
|
||||
const county = city.children.find(p => p.label === row.county)
|
||||
if (county) {
|
||||
row.addressList.push(county.value)
|
||||
@@ -130,7 +119,7 @@ let ADDRESS_DIALOG = {
|
||||
|
||||
this.formData = row
|
||||
this.dialogVisible = true
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
<!--#include("/platform/zhgh/welfare/include/chengSh.js"){}#-->
|
||||
|
||||
@@ -1,73 +0,0 @@
|
||||
let COURIER_NUMBER_INFO = {
|
||||
template: `
|
||||
<el-dialog title="快递物流信息" width="60%" :visible.sync="dialogVisible" :append-to-body="true"
|
||||
top="50px">
|
||||
<el-tabs v-model="activeName" v-loading="loading" v-if="activeName">
|
||||
<el-tab-pane v-for="(v,k) in courierNumberInfoData"
|
||||
:label="k"
|
||||
:key="k"
|
||||
:name="k" style="margin: 20px">
|
||||
<div style="height: 600px;overflow-y: auto">
|
||||
<div class="alert alert-info" v-if="v.length>1">
|
||||
<strong>此套餐有多个快递单号</strong>
|
||||
</div>
|
||||
|
||||
<div v-for="item in v" :key="item.courierNumber">
|
||||
<div class="alert alert-info mb20">
|
||||
<strong>快递单号</strong>
|
||||
{{ item.courierNumber || '暂无' }}
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<el-timeline :reverse="true"
|
||||
v-if="item.logisticsTrace && item.logisticsTrace.logisticsTraceDetailList">
|
||||
<el-timeline-item
|
||||
:color="timeline.color"
|
||||
:key="timelineIndex"
|
||||
:timestamp="$moment(timeline.time).format('YYYY-MM-DD HH:mm:ss')"
|
||||
v-for="(timeline, timelineIndex) in item.logisticsTrace.logisticsTraceDetailList">
|
||||
{{ timeline.desc }}
|
||||
</el-timeline-item>
|
||||
</el-timeline>
|
||||
<div v-else>
|
||||
<el-empty description="暂无物流信息"></el-empty>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<div v-else>
|
||||
<el-empty>暂无数据</el-empty>
|
||||
</div>
|
||||
</el-dialog>
|
||||
`,
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
courierNumberInfoData: [],
|
||||
activeName: null,
|
||||
loading: true
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async openView(welfareId, userId) {
|
||||
this.dialogVisible = true
|
||||
this.loading = true
|
||||
const { code, data, msg } = await this.$axios.post("/platform/welfare/mine/courierNumberInfo", { welfareId, userId })
|
||||
this.loading = false
|
||||
if (code === 0) {
|
||||
if (data == null || data.length === 0) {
|
||||
this.dialogVisible = false
|
||||
this.$message.warning("您还没有选择福利套餐")
|
||||
return
|
||||
}
|
||||
this.courierNumberInfoData = data
|
||||
const keys = Object.keys(this.courierNumberInfoData)
|
||||
this.activeName = keys && keys[0]
|
||||
} else {
|
||||
this.$message.warning(msg)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -66,7 +66,6 @@ layout("/layouts/platform.html"){
|
||||
</template>
|
||||
|
||||
<template scope="{row}" v-else-if="column.prop=='gist_list'">
|
||||
<template v-if="!projectInfo.flexible">{{projectInfo.gift}}</template>
|
||||
<template v-if="row.gist_list">{{row.gist_list}}</template>
|
||||
</template>
|
||||
|
||||
@@ -74,115 +73,29 @@ layout("/layouts/platform.html"){
|
||||
<span v-if="row.receiveAddress">{{row.receiveAddress}}</span>
|
||||
<span v-else>暂无</span>
|
||||
</template>
|
||||
|
||||
<template scope="{row}" v-else-if="column.prop=='courierNumber'">
|
||||
<span @click="viewCourierNumber(row)" class="text-primary" style="cursor: pointer">点击查看</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" fixed="right" header-align="center" label="操作" prop="userOnline" width="200px">
|
||||
<template slot-scope="{row}">
|
||||
<el-button @click="openView(row)" size="mini" type="primary">查看</el-button>
|
||||
<el-button :disabled="!row.courierNumber" @click="openEvaluate(row)" size="mini" type="primary">评价</el-button>
|
||||
<!-- <el-button :disabled="!row.courierNumber" @click="openEvaluate(row)" size="mini" type="primary">评价</el-button>-->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<template #edit>
|
||||
<choose-welfare :is_view="true" ref="chooseWelfare" @go_back="go_back"></choose-welfare>
|
||||
</template>
|
||||
</guava>
|
||||
|
||||
<el-dialog :close-on-click-modal="false" :visible.sync="evaluateDialogVisible" title="福利评价" width="40%">
|
||||
<el-form :model="formData" label-width="80px" ref="form">
|
||||
<el-form-item :rules="[{ required: true, message: ''}]" label="评价套餐">
|
||||
<el-radio-group @change="finOneWelfareEvaluate(formData.projectId,formData.optionId)" v-model="formData.optionId">
|
||||
<el-row gutter="10">
|
||||
<el-col :key="item.selectOptionId" class="mt10" span="24" v-for="item in userSelection">
|
||||
<el-radio :label="item.selectOptionId" border style="width: 100%; position: relative">
|
||||
{{item.optionName}}
|
||||
<span style="color: red; position: absolute; right: 10px" v-if="!item.isPj">未评价</span>
|
||||
</el-radio>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item :rules="[{ required: true, message: ''}]" label="评分">
|
||||
<div style="position: absolute; top: 20%">
|
||||
<el-rate :disabled="formData.id" show-score text-color="#ff9900" v-model="formData.evaluateScore"></el-rate>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="评价">
|
||||
<el-input
|
||||
:disabled="formData.id"
|
||||
maxlength="500"
|
||||
placeholder="请输入评价"
|
||||
rows="5"
|
||||
show-word-limit
|
||||
type="textarea"
|
||||
v-model="formData.evaluateText"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span class="dialog-footer" slot="footer">
|
||||
<el-button @click="evaluateDialogVisible = false" type="primary">关 闭</el-button>
|
||||
<el-button :loading="evaluateLoading" @click="doEvaluate" type="primary" v-if="!formData.id">提 交</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
<el-drawer :visible.sync="descDialogVisible" direction="rtl" size="50%" title="福利详情">
|
||||
<el-card style="margin: 20px">
|
||||
<div v-html="descData"></div>
|
||||
</el-card>
|
||||
</el-drawer>
|
||||
|
||||
<el-drawer :visible.sync="expressDrawer" direction="rtl" size="50%">
|
||||
<template #title>
|
||||
<div style="font-size: 20px">
|
||||
物流详情
|
||||
<span style="color: red"> 温馨提示:物流信息一小时更新一次</span>
|
||||
</div>
|
||||
</template>
|
||||
<el-card style="margin: 30px">
|
||||
<el-timeline reverse="true">
|
||||
<el-timeline-item
|
||||
:color="item.color"
|
||||
:key="index"
|
||||
:timestamp="moment().format('YYYY-MM-DD HH:mm:ss')"
|
||||
v-for="(item, index) in logisticsTrace.logisticsTraceDetailList"
|
||||
>
|
||||
{{item.desc}}
|
||||
</el-timeline-item>
|
||||
</el-timeline>
|
||||
</el-card>
|
||||
</el-drawer>
|
||||
|
||||
<!--快递物流信息-->
|
||||
<courier-number-info ref="courierNumberInfo"></courier-number-info>
|
||||
<select-view ref="selectViewRef"></select-view>
|
||||
</div>
|
||||
<script>
|
||||
<!--#include("CourierNumberInfo.js"){}#-->
|
||||
<!--#include("../userChoose/chooseWelfare.js"){}#-->
|
||||
<!--#include('selectView.js'){}#-->
|
||||
|
||||
new Vue({
|
||||
el: "#app",
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
descData: "",
|
||||
descDialogVisible: false,
|
||||
projectInfo: {},
|
||||
userSelection: [],
|
||||
userId: "",
|
||||
projectOptions: [],
|
||||
units: [],
|
||||
welfareUnits: [],
|
||||
|
||||
welfareProvideMode: [],
|
||||
welfareSignMode: [],
|
||||
welfareNoticePushMode: [],
|
||||
pageForm: {
|
||||
year: moment().format("YYYY"),
|
||||
searchName: "username"
|
||||
@@ -192,128 +105,25 @@ layout("/layouts/platform.html"){
|
||||
{ prop: "name", label: "项目名称" },
|
||||
{ prop: "choiceTime", label: "选择时间" },
|
||||
{ prop: "isChoose", label: "是否选择" },
|
||||
{ prop: "gist_list", label: "所选福利" },
|
||||
{ prop: "receiveAddress", label: "收货地址" },
|
||||
{ prop: "courierNumber", label: "快递单号", sortable: true }
|
||||
],
|
||||
formRules: {},
|
||||
selPersonType: [],
|
||||
welfare_id: null,
|
||||
welfarePersonTypeList: [],
|
||||
projectSelectOptions: [],
|
||||
evaluateDialogVisible: false,
|
||||
evaluateLoading: false,
|
||||
|
||||
expressDrawer: false,
|
||||
logisticsTrace: {}
|
||||
{ prop: "gist_list", label: "所选福利" }
|
||||
// { prop: "receiveAddress", label: "收货地址" }
|
||||
// { prop: "courierNumber", label: "快递单号", sortable: true }
|
||||
]
|
||||
}
|
||||
},
|
||||
components: {
|
||||
"courier-number-info": COURIER_NUMBER_INFO,
|
||||
"choose-welfare": CHOOSE_WELFARE
|
||||
"select-view": selectView
|
||||
},
|
||||
methods: {
|
||||
go_back() {
|
||||
this.$refs.guava.index()
|
||||
},
|
||||
//查看快递单号
|
||||
viewCourierNumber(row) {
|
||||
this.$refs.courierNumberInfo.openView(row.projectId, row.userId)
|
||||
},
|
||||
|
||||
async doEvaluate() {
|
||||
if (!this.formData.evaluateScore || !this.formData.optionId) {
|
||||
this.$message({
|
||||
message: "请打分后再提交",
|
||||
type: "warning"
|
||||
})
|
||||
return
|
||||
}
|
||||
const confirm = await this.$confirm("提交后将不能修改,确定要提交评价吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
})
|
||||
if (confirm === "confirm") {
|
||||
this.evaluateLoading = true
|
||||
const resp = await this.$axios.post(loc() + "/doEvaluate", this.formData)
|
||||
if (resp.code === 0) {
|
||||
this.$message({
|
||||
message: resp.msg,
|
||||
type: "success"
|
||||
})
|
||||
this.doSearch()
|
||||
this.evaluateDialogVisible = false
|
||||
} else {
|
||||
this.$message.error(resp.msg)
|
||||
}
|
||||
this.evaluateLoading = false
|
||||
}
|
||||
},
|
||||
async finOneWelfareEvaluate(projectId, optionId) {
|
||||
const { data, code, msg } = await this.$axios.post(loc() + "/finOneWelfareEvaluate", {
|
||||
projectId: projectId,
|
||||
optionId: optionId
|
||||
})
|
||||
if (code === 0) {
|
||||
if (data) {
|
||||
this.formData = data
|
||||
} else {
|
||||
this.formData = {
|
||||
projectId: projectId,
|
||||
optionId: optionId
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.$message.warning(msg)
|
||||
}
|
||||
},
|
||||
async openEvaluate(row) {
|
||||
await this.getUserSelection(row.id)
|
||||
if (this.userSelection && this.userSelection.length > 0) {
|
||||
await this.finOneWelfareEvaluate(row.id, this.userSelection[0].selectOptionId)
|
||||
}
|
||||
|
||||
this.evaluateDialogVisible = true
|
||||
},
|
||||
async openView(row) {
|
||||
this.$refs.guava.edit(() => {
|
||||
this.$refs.chooseWelfare.openChoose(row)
|
||||
})
|
||||
this.$refs.selectViewRef.onOpen(row.id)
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.pageData()
|
||||
this.welfareProvideMode = await this.$businessTool.getDictOptions("welfareProvideMode")
|
||||
this.welfareProvideMode.map((v) => {
|
||||
v.code = Number(v.code)
|
||||
})
|
||||
this.welfareSignMode = await this.$businessTool.getDictOptions("welfareSignMode")
|
||||
this.welfareSignMode.map((v) => {
|
||||
v.code = Number(v.code)
|
||||
})
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<style>
|
||||
.desc_label {
|
||||
width: 75px;
|
||||
-webkit-flex-shrink: 0;
|
||||
flex-shrink: 0;
|
||||
padding-right: 4px;
|
||||
display: inline-block;
|
||||
font-size: 14px;
|
||||
color: #7f7f7f;
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.desc_value {
|
||||
color: #333;
|
||||
font-size: 14px;
|
||||
}
|
||||
</style>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
|
||||
@@ -0,0 +1,517 @@
|
||||
const selectView = {
|
||||
template: /*language=HTML*/ `
|
||||
<el-dialog title="我的福利选择" :visible.sync="visible" width="700px" append-to-body custom-class="welfare-select-view-dialog">
|
||||
<div v-loading="loading">
|
||||
<!-- 项目基本信息 -->
|
||||
<div class="project-info-card">
|
||||
<div class="project-info-header">
|
||||
<i class="el-icon-s-flag"></i>
|
||||
<span>项目基本信息</span>
|
||||
</div>
|
||||
<div class="project-info-content">
|
||||
<div class="info-item">
|
||||
<div class="info-label">项目名称</div>
|
||||
<div class="info-value">{{ projectInfo.name }}</div>
|
||||
</div>
|
||||
<div class="info-item">
|
||||
<div class="info-label">选择时间</div>
|
||||
<div class="info-value">{{ projectInfo.choiceTimeStart }} 至 {{ projectInfo.choiceTimeEnd }}</div>
|
||||
</div>
|
||||
<div class="info-item">
|
||||
<div class="info-label">发放时间</div>
|
||||
<div class="info-value">{{ projectInfo.provideTimeStart }} 至 {{ projectInfo.provideTimeEnd }}</div>
|
||||
</div>
|
||||
<div class="info-item">
|
||||
<div class="info-label">发放地点</div>
|
||||
<div class="info-value">{{ projectInfo.provideAddress }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 联系信息 -->
|
||||
<div class="project-info-card">
|
||||
<div class="project-info-header">
|
||||
<i class="el-icon-user"></i>
|
||||
<span>联系信息</span>
|
||||
</div>
|
||||
<div class="project-info-content">
|
||||
<div class="info-item">
|
||||
<div class="info-label">联系电话</div>
|
||||
<div class="info-value">{{ mergedSelections[0]?.mobile || '暂无' }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 我的选择 -->
|
||||
<div class="my-selections-card">
|
||||
<div class="selections-header">
|
||||
<i class="el-icon-shopping-cart-full"></i>
|
||||
<span>我的选择</span>
|
||||
</div>
|
||||
|
||||
<div v-if="mergedSelections.length > 0" class="selections-content">
|
||||
<div class="selection-item" v-for="item in mergedSelections" :key="item.id">
|
||||
<div class="selection-item-image">
|
||||
<el-image
|
||||
:src="item.imgUrl || '/static/images/default-welfare.png'"
|
||||
fit="cover"
|
||||
:preview-src-list="item.imgUrl ? [item.imgUrl] : []">
|
||||
<div slot="error" class="image-placeholder">
|
||||
<i class="el-icon-picture-outline"></i>
|
||||
</div>
|
||||
</el-image>
|
||||
</div>
|
||||
<div class="selection-item-info">
|
||||
<div class="selection-item-name">{{ item.optionName }}</div>
|
||||
<div class="selection-item-meta">
|
||||
<div class="selection-item-count">
|
||||
<span>数量:</span>
|
||||
<span class="count-value">{{ item.selectNum }}</span>
|
||||
</div>
|
||||
<div class="selection-item-time">
|
||||
<span>选择时间:</span>
|
||||
<span>{{ item.selectTime }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="selection-item-actions">
|
||||
<el-button
|
||||
type="text"
|
||||
size="small"
|
||||
class="detail-btn"
|
||||
@click="showOptionDetail(item)">
|
||||
<i class="el-icon-view"></i> 查看详情
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="selection-item-status">
|
||||
<el-tag size="small" type="success">已选择</el-tag>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-else class="no-selections">
|
||||
<i class="el-icon-warning-outline"></i>
|
||||
<span>您还未选择任何福利项目</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 详情弹窗 -->
|
||||
<el-dialog
|
||||
title="福利详情"
|
||||
:visible.sync="detailDialogVisible"
|
||||
width="650px"
|
||||
append-to-body
|
||||
custom-class="welfare-detail-dialog">
|
||||
<div class="welfare-detail-content" v-if="currentOption">
|
||||
<!-- <div class="detail-header">-->
|
||||
<!-- <div class="detail-image">-->
|
||||
<!-- <el-image -->
|
||||
<!-- :src="currentOption.imgUrl || '/static/images/default-welfare.png'" -->
|
||||
<!-- fit="cover">-->
|
||||
<!-- <div slot="error" class="image-placeholder">-->
|
||||
<!-- <i class="el-icon-picture-outline"></i>-->
|
||||
<!-- </div>-->
|
||||
<!-- </el-image>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div class="detail-title">-->
|
||||
<!-- <h3>{{ currentOption.optionName }}</h3>-->
|
||||
<!-- <div class="detail-meta">-->
|
||||
<!-- <span class="detail-count">-->
|
||||
<!-- <i class="el-icon-shopping-cart-2"></i> -->
|
||||
<!-- 数量: <span class="count-value">{{ currentOption.selectNum }}</span>-->
|
||||
<!-- </span>-->
|
||||
<!-- <span class="detail-time">-->
|
||||
<!-- <i class="el-icon-time"></i> -->
|
||||
<!-- 选择时间: {{ currentOption.selectTime }}-->
|
||||
<!-- </span>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div class="detail-divider"></div>-->
|
||||
<div class="detail-description rich-text-content" v-html="currentOption.description"></div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</el-dialog>
|
||||
`,
|
||||
data() {
|
||||
return {
|
||||
projectId: null,
|
||||
visible: false,
|
||||
loading: false,
|
||||
projectInfo: {
|
||||
name: "",
|
||||
choiceTimeStart: "",
|
||||
choiceTimeEnd: "",
|
||||
provideTimeStart: "",
|
||||
provideTimeEnd: "",
|
||||
provideAddress: "",
|
||||
options: []
|
||||
},
|
||||
selectedOptions: [],
|
||||
detailDialogVisible: false,
|
||||
currentOption: null
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
mergedSelections() {
|
||||
return this.selectedOptions.map((item) => {
|
||||
const option = this.projectInfo.options?.find((opt) => opt.id === item.selectOptionId) || {}
|
||||
return {
|
||||
...item,
|
||||
optionName: option.optionName || "未知选项",
|
||||
imgUrl: option.imgUrl,
|
||||
description: option.description
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onOpen(id) {
|
||||
this.projectId = id
|
||||
this.visible = true
|
||||
this.loadData()
|
||||
},
|
||||
|
||||
async loadData() {
|
||||
this.loading = true
|
||||
await this.getProjectInfo()
|
||||
await this.getUserSelections()
|
||||
this.loading = false
|
||||
},
|
||||
|
||||
async getProjectInfo() {
|
||||
const { code, data, msg } = await this.$axios.post("/platform/welfare/common/projectInfo", {
|
||||
id: this.projectId
|
||||
})
|
||||
if (code === 0) {
|
||||
this.projectInfo = data
|
||||
}
|
||||
},
|
||||
|
||||
async getUserSelections() {
|
||||
const { code, data, msg } = await this.$axios.post("/platform/welfare/userSelect/getUserSelection", { projectId: this.projectId })
|
||||
if (code === 0) {
|
||||
this.selectedOptions = data || []
|
||||
}
|
||||
},
|
||||
|
||||
showOptionDetail(option) {
|
||||
this.currentOption = option
|
||||
this.detailDialogVisible = true
|
||||
}
|
||||
},
|
||||
style: /*language=CSS*/ `
|
||||
.welfare-select-view-dialog .el-dialog__body {
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
/* 项目信息卡片 */
|
||||
.project-info-card {
|
||||
background: #fff;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
|
||||
margin-bottom: 16px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.project-info-header {
|
||||
padding: 14px 16px;
|
||||
border-bottom: 1px solid #EBEEF5;
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #303133;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: linear-gradient(135deg, #f8f9fb 0%, #fff 100%);
|
||||
}
|
||||
|
||||
.project-info-header i {
|
||||
margin-right: 8px;
|
||||
color: var(--color-primary);
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.project-info-content {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.info-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 12px 16px;
|
||||
border-bottom: 1px solid #EBEEF5;
|
||||
}
|
||||
|
||||
.info-item:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.info-label {
|
||||
width: 100px;
|
||||
color: #606266;
|
||||
font-weight: 500;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.info-value {
|
||||
flex: 1;
|
||||
color: #303133;
|
||||
}
|
||||
|
||||
/* 选择卡片 */
|
||||
.my-selections-card {
|
||||
background: #fff;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.selections-header {
|
||||
padding: 14px 16px;
|
||||
border-bottom: 1px solid #EBEEF5;
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #303133;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: linear-gradient(135deg, #f8f9fb 0%, #fff 100%);
|
||||
}
|
||||
|
||||
.selections-header i {
|
||||
margin-right: 8px;
|
||||
color: var(--color-primary);
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.selections-content {
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
.selection-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 12px;
|
||||
border-radius: 6px;
|
||||
margin-bottom: 12px;
|
||||
background: #f8f9fb;
|
||||
transition: all 0.3s;
|
||||
}
|
||||
|
||||
.selection-item:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.selection-item:hover {
|
||||
transform: translateX(4px);
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
.selection-item-image {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
border-radius: 4px;
|
||||
overflow: hidden;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.selection-item-image .el-image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.image-placeholder {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: #f5f7fa;
|
||||
color: #909399;
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
.selection-item-info {
|
||||
flex: 1;
|
||||
padding: 0 16px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.selection-item-name {
|
||||
font-size: 15px;
|
||||
font-weight: 600;
|
||||
color: #303133;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
.selection-item-meta {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.selection-item-count, .selection-item-time {
|
||||
font-size: 13px;
|
||||
color: #606266;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.selection-item-actions {
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.detail-btn {
|
||||
padding: 4px 8px;
|
||||
font-size: 12px;
|
||||
color: var(--color-primary);
|
||||
background: #ecf5ff;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.detail-btn:hover {
|
||||
background: #dbecff;
|
||||
color: #3a8ee6;
|
||||
}
|
||||
|
||||
.detail-btn i {
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
.count-value {
|
||||
color: var(--color-primary);
|
||||
font-weight: 600;
|
||||
background: #ecf5ff;
|
||||
padding: 2px 6px;
|
||||
border-radius: 10px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.selection-item-status {
|
||||
flex-shrink: 0;
|
||||
width: 70px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.no-selections {
|
||||
padding: 40px 0;
|
||||
text-align: center;
|
||||
color: #909399;
|
||||
font-size: 14px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.no-selections i {
|
||||
font-size: 40px;
|
||||
margin-bottom: 10px;
|
||||
color: #C0C4CC;
|
||||
}
|
||||
|
||||
/* 详情弹窗样式 */
|
||||
.welfare-detail-dialog .el-dialog__body {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.welfare-detail-content {
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.detail-header {
|
||||
display: flex;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.detail-image {
|
||||
width: 120px;
|
||||
height: 120px;
|
||||
border-radius: 6px;
|
||||
overflow: hidden;
|
||||
flex-shrink: 0;
|
||||
margin-right: 20px;
|
||||
}
|
||||
|
||||
.detail-image .el-image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.detail-title {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.detail-title h3 {
|
||||
margin: 0 0 12px 0;
|
||||
font-size: 18px;
|
||||
color: #303133;
|
||||
}
|
||||
|
||||
.detail-meta {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.detail-count, .detail-time {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 14px;
|
||||
color: #606266;
|
||||
}
|
||||
|
||||
.detail-count i, .detail-time i {
|
||||
margin-right: 6px;
|
||||
color: #909399;
|
||||
}
|
||||
|
||||
.detail-divider {
|
||||
height: 1px;
|
||||
background: #EBEEF5;
|
||||
margin: 20px 0;
|
||||
}
|
||||
|
||||
.detail-description {
|
||||
color: #606266;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
/* 富文本内容样式 */
|
||||
.rich-text-content {
|
||||
overflow-x: hidden;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
.rich-text-content img {
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
border-radius: 4px;
|
||||
margin: 10px 0;
|
||||
}
|
||||
|
||||
.rich-text-content p {
|
||||
margin: 8px 0;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.rich-text-content a {
|
||||
color: var(--color-primary);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.rich-text-content a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.rich-text-content ul, .rich-text-content ol {
|
||||
padding-left: 20px;
|
||||
margin: 10px 0;
|
||||
}
|
||||
|
||||
.rich-text-content blockquote {
|
||||
padding: 10px 15px;
|
||||
border-left: 4px solid #EBEEF5;
|
||||
background: #f8f9fb;
|
||||
margin: 10px 0;
|
||||
color: #606266;
|
||||
}
|
||||
`
|
||||
}
|
||||
@@ -0,0 +1,235 @@
|
||||
const filterUser = {
|
||||
template: /*language=HTML*/ `
|
||||
<el-dialog title="选择用户生成福利名单" :visible.sync="visible" width="80%">
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="姓名">
|
||||
<el-input @keyup.enter.native="doSearch" clearable placeholder="请输入姓名"
|
||||
style="width: 100%" v-model="pageForm.userName">
|
||||
</el-input>
|
||||
</search-item>
|
||||
|
||||
<search-item label="工号">
|
||||
<el-input @keyup.enter.native="doSearch" clearable placeholder="请输入工号"
|
||||
style="width: 100%" v-model="pageForm.loginName">
|
||||
</el-input>
|
||||
</search-item>
|
||||
|
||||
<search-item label="性别">
|
||||
<el-select clearable placeholder="请选择性别" style="width: 100%" v-model="pageForm.sex">
|
||||
<el-option :key="sex" :label="sex" :value="sex"
|
||||
v-for="sex in sexOptions"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
|
||||
<search-item label="出生日期">
|
||||
<el-date-picker
|
||||
v-model="pageForm.birthday"
|
||||
type="date"
|
||||
placeholder="选择出生日期"
|
||||
value-format="yyyy-MM-dd"
|
||||
style="width: 100%">
|
||||
</el-date-picker>
|
||||
</search-item>
|
||||
|
||||
<search-item label="出生月份">
|
||||
<el-select
|
||||
v-model="pageForm.birthMonths"
|
||||
multiple
|
||||
collapse-tags
|
||||
placeholder="请选择出生月份"
|
||||
style="width: 100%">
|
||||
<el-option
|
||||
v-for="month in 12"
|
||||
:key="month"
|
||||
:label="month + '月'"
|
||||
:value="month">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
|
||||
<search-item label="所属工会">
|
||||
<el-select clearable filterable placeholder="请选择工会"
|
||||
style="width: 100%"
|
||||
v-model="pageForm.unionId">
|
||||
<el-option
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
v-for="item in unionOptions">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
|
||||
<search-item label="所属单位">
|
||||
<el-select clearable filterable
|
||||
multiple
|
||||
collapse-tags
|
||||
placeholder="请选择单位" style="width: 100%"
|
||||
v-model="pageForm.unitIds">
|
||||
<el-option
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
v-for="item in unitOptions">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
|
||||
<search-item label="人员类型:">
|
||||
<dict-select clearable code="USER_PERSON_TYPE"
|
||||
multiple
|
||||
collapse-tags
|
||||
placeholder="请选择人员类型"
|
||||
v-model="pageForm.personTypes"></dict-select>
|
||||
</search-item>
|
||||
|
||||
<search-item label="聘用方式:">
|
||||
<dict-select clearable code="USER_PREPARED_BY_TYPE"
|
||||
multiple
|
||||
collapse-tags
|
||||
placeholder="请选择聘用方式"
|
||||
v-model="pageForm.preparedBys"></dict-select>
|
||||
</search-item>
|
||||
|
||||
<search-item label="在职状态:">
|
||||
<dict-select clearable code="USER_STATE"
|
||||
multiple
|
||||
collapse-tags
|
||||
placeholder="请选择人员状态"
|
||||
v-model="pageForm.userStates"></dict-select>
|
||||
</search-item>
|
||||
<search-item label="是否会员">
|
||||
<el-select clearable placeholder="请选择是否会员" style="width: 100%"
|
||||
v-model="pageForm.isMember">
|
||||
<el-option label="全部" :value="null"></el-option>
|
||||
<el-option label="是" :value="true"></el-option>
|
||||
<el-option label="否" :value="false"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
</search>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never">
|
||||
<el-table :data="tableData"
|
||||
@sort-change="pageOrder"
|
||||
ref="tableRef"
|
||||
row-key="id"
|
||||
style="width: 100%">
|
||||
<el-table-column
|
||||
:index="indexMethod"
|
||||
label="序号"
|
||||
type="index"
|
||||
width="80px"
|
||||
></el-table-column>
|
||||
|
||||
<el-table-column
|
||||
:key="column.prop"
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
:width="column.width"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip
|
||||
v-for="column in tableColumns"
|
||||
>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
|
||||
<template #footer>
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="onSubmit">确认添加到福利名单</el-button>
|
||||
</template>
|
||||
|
||||
</el-dialog>
|
||||
`,
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
projectId: null,
|
||||
pageForm: {
|
||||
birthMonths: [],
|
||||
userStates: [],
|
||||
personTypes: [],
|
||||
preparedBys: [],
|
||||
unitIds: []
|
||||
},
|
||||
sexOptions: ["男", "女"],
|
||||
unionOptions: [],
|
||||
unitOptions: [],
|
||||
tableColumns: [
|
||||
{ prop: "loginname", label: "工号" },
|
||||
{ prop: "username", label: "姓名" },
|
||||
{ prop: "sex", label: "性别", sortable: true, checked: 0 },
|
||||
{ prop: "birthday", label: "出生日期", sortable: true, checked: 0 },
|
||||
{ prop: "personType", label: "人员类型", sortable: true },
|
||||
{ prop: "preparedBy", label: "聘用方式", sortable: true },
|
||||
{ prop: "userState", label: "在职状态", sortable: true },
|
||||
{ prop: "unionName", label: "所属工会", sortable: true },
|
||||
{ prop: "unitName", label: "所属单位", sortable: true }
|
||||
]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async onOpen(id) {
|
||||
this.visible = true
|
||||
this.resetPageForm()
|
||||
this.pageForm.projectId = id
|
||||
this.unionOptions = await this.$businessTool.listUnion()
|
||||
this.unitOptions = await this.$businessTool.listUnit()
|
||||
this.pageData()
|
||||
},
|
||||
|
||||
resetPageForm() {
|
||||
this.pageForm.userName = null
|
||||
this.pageForm.loginName = null
|
||||
this.pageForm.sex = null
|
||||
this.pageForm.birthday = null
|
||||
this.pageForm.birthMonths = []
|
||||
this.pageForm.unionId = null
|
||||
this.pageForm.unitId = null
|
||||
this.pageForm.personTypes = []
|
||||
this.pageForm.preparedBys = []
|
||||
this.pageForm.userStates = []
|
||||
this.pageForm.isMember = null
|
||||
},
|
||||
|
||||
pageData() {
|
||||
this.$axios
|
||||
.post("/platform/welfare/project/mange/filterUserPageData", {
|
||||
pageForm: JSON.stringify(this.pageForm)
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.tableData = res.data.list
|
||||
this.pageForm.totalCount = res.data.totalCount
|
||||
} else {
|
||||
this.$message.error(res.msg)
|
||||
}
|
||||
})
|
||||
},
|
||||
onSubmit() {
|
||||
this.$confirm("当前筛选出" + this.pageForm.totalCount + "条数据,您确认添加到福利名单吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(async () => {
|
||||
const { code, data, msg } = await this.$axios.post("/platform/welfare/project/mange/addWelfareUser", {
|
||||
pageForm: JSON.stringify(this.pageForm),
|
||||
projectId: this.projectId
|
||||
})
|
||||
if (code === 0) {
|
||||
this.$message.success(msg)
|
||||
this.visible = false
|
||||
this.$emit("refresh")
|
||||
} else {
|
||||
this.$message.error(msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
+91
-132
@@ -88,28 +88,14 @@ layout("/layouts/platform.html"){
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item :command="{type:'status',data:row}">{{row.isDisabled?'发布':'关闭'}}</el-dropdown-item>
|
||||
<el-dropdown-item :command="{type:'sendMsg',data:row}">通知未选择人员</el-dropdown-item>
|
||||
<!-- <el-dropdown-item :command="{type:'createList2',data:row}" v-if="row.created">更新福利名单</el-dropdown-item>
|
||||
|
||||
<el-dropdown-item
|
||||
:command="{type:'createList',data:row}"
|
||||
v-if="$auth.hasRoleOr(['SYSADMIN','SCHOOL_UNION_ADMIN','SCHOOL_UNION_WELFARE_ADMIN','SCHOOL_UNION_MEMBER_ADMIN'])"
|
||||
>
|
||||
{{row.created?'重置福利名单':'生成福利名单'}}
|
||||
</el-dropdown-item>-->
|
||||
|
||||
<el-dropdown-item
|
||||
:command="{type:'edit',data:row}"
|
||||
v-if="$auth.hasRoleOr(['SYSADMIN','SCHOOL_UNION_ADMIN','SCHOOL_UNION_WELFARE_ADMIN','SCHOOL_UNION_MEMBER_ADMIN'])"
|
||||
>
|
||||
编辑
|
||||
<!-- <el-dropdown-item :command="{type:'createList2',data:row}" v-if="row.created">更新福利名单</el-dropdown-item>-->
|
||||
<el-dropdown-item :command="{type:'createList',data:row}">
|
||||
<!-- {{row.created?'重置福利名单':'生成福利名单'}}-->
|
||||
生成福利名单
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item :command="{type:'edit',data:row}">编辑</el-dropdown-item>
|
||||
|
||||
<el-dropdown-item
|
||||
:command="{type:'delete',data:row}"
|
||||
v-if="$auth.hasRoleOr(['SYSADMIN','SCHOOL_UNION_ADMIN','SCHOOL_UNION_WELFARE_ADMIN','SCHOOL_UNION_MEMBER_ADMIN'])"
|
||||
>
|
||||
删除
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item :command="{type:'delete',data:row}">删除</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</template>
|
||||
@@ -183,18 +169,17 @@ layout("/layouts/platform.html"){
|
||||
<el-switch @change="isCheckBoxChange" v-model="formData.flexible"></el-switch>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-form-item label="是否全年生日蛋糕券" prop="isYearBirthday">
|
||||
<el-switch v-model="formData.isYearBirthday"></el-switch>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="4">-->
|
||||
<!-- <el-form-item label="是否全年生日蛋糕券" prop="isYearBirthday">-->
|
||||
<!-- <el-switch v-model="formData.isYearBirthday"></el-switch>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- <el-col span="6">
|
||||
<el-form-item label="是否常规" prop="isRoutine" v-if="formData.flexible">
|
||||
<el-switch v-model="formData.isRoutine">
|
||||
</el-switch>
|
||||
</el-form-item>
|
||||
</el-col>-->
|
||||
|
||||
<el-col :span="4" v-if="formData.isRoutine">
|
||||
<el-form-item label="是否多选" prop="isCheckBox">
|
||||
<el-switch
|
||||
@@ -236,9 +221,16 @@ layout("/layouts/platform.html"){
|
||||
<el-input maxlength="100" placeholder="福利礼品" suffix-icon="el-icon-present" v-model="formData.gift"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<!-- {{formData.welfareProjectSubjects}}-->
|
||||
<!-- <template v-if="formData.flexible">-->
|
||||
<!-- <el-form-item label="福利选项" v-if="[2,3,4].includes(formData.provideMode)">-->
|
||||
<!-- <welfare-option-table :subject="formData.welfareProjectSubjects" ref="welfareOptionTable"></welfare-option-table>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </template>-->
|
||||
|
||||
<template v-if="formData.flexible">
|
||||
<el-form-item label="福利选项" v-if="[2,3,4].includes(formData.provideMode)">
|
||||
<welfare-option-table :subject="formData.welfareProjectSubjects" ref="welfareOptionTable"></welfare-option-table>
|
||||
<el-form-item label="福利选项">
|
||||
<welfare-option v-model="formData.options"></welfare-option>
|
||||
</el-form-item>
|
||||
</template>
|
||||
|
||||
@@ -258,15 +250,24 @@ layout("/layouts/platform.html"){
|
||||
</el-row>
|
||||
</template>
|
||||
</guava>
|
||||
|
||||
<filter-user ref="filterUserRef"></filter-user>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
<!--#include("/platform/zhgh/welfare/include/common.js"){}#-->
|
||||
<!--#include("welfareOptionTable.js"){}#-->
|
||||
<!--#include("welfareOption.js"){}#-->
|
||||
<!--#include("filterUser.js"){}#-->
|
||||
new Vue({
|
||||
el: "#app",
|
||||
store,
|
||||
mixins: [initTableMixins],
|
||||
components: {
|
||||
"welfare-option-table": WELFARE_OPTION_TABLE,
|
||||
"welfare-option": welfareOption,
|
||||
"filter-user": filterUser
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
festival: [],
|
||||
@@ -297,26 +298,24 @@ layout("/layouts/platform.html"){
|
||||
welfarePersonTypeList: []
|
||||
}
|
||||
},
|
||||
components: {
|
||||
"welfare-option-table": WELFARE_OPTION_TABLE
|
||||
},
|
||||
methods: {
|
||||
dropdownCommand(command) {
|
||||
const { type, data } = command
|
||||
this.welfare_id = data.id
|
||||
if (type == "view") {
|
||||
if (type === "view") {
|
||||
this.openView(data.id)
|
||||
} else if (type == "edit") {
|
||||
} else if (type === "edit") {
|
||||
this.openEdit(data)
|
||||
} else if (type == "delete") {
|
||||
} else if (type === "delete") {
|
||||
this.doDelete(data.id)
|
||||
} else if (type == "createList") {
|
||||
this.createList(data, false)
|
||||
} else if (type == "createList2") {
|
||||
} else if (type === "createList") {
|
||||
//this.createList(data, false)
|
||||
this.$refs.filterUserRef.onOpen(data.id)
|
||||
} else if (type === "createList2") {
|
||||
this.createList(data, true)
|
||||
} else if (type === "status") {
|
||||
this.projectStatusChange(data)
|
||||
} else if (type == "sendMsg") {
|
||||
} else if (type === "sendMsg") {
|
||||
this.sendMsg(data)
|
||||
}
|
||||
},
|
||||
@@ -324,54 +323,24 @@ layout("/layouts/platform.html"){
|
||||
const formValid = await this.$refs["form"].validate()
|
||||
if (formValid) {
|
||||
if (this.formData.flexible) {
|
||||
const questionValid = this.$refs.welfareOptionTable.validate()
|
||||
if (!questionValid) {
|
||||
this.$message.warning("题目信息填写不完整!")
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
this.submitLoading = true
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: "数据保存中请稍后",
|
||||
spinner: "el-icon-loading",
|
||||
background: "rgba(0, 0, 0, 0.7)"
|
||||
})
|
||||
const formData = clone(this.formData)
|
||||
formData.provideAddress = "工会"
|
||||
|
||||
if (formData.isCheckBox === "radio") {
|
||||
formData.multiSelectNum = 1
|
||||
}
|
||||
|
||||
/* if (formData.conditionStructure)
|
||||
formData.conditionStructure = JSON.stringify(formData.conditionStructure)*/
|
||||
|
||||
if (this.formData.flexible && [2, 3, 4].includes(formData.provideMode)) {
|
||||
formData.welfareProjectSubjects = this.$refs.welfareOptionTable.subject
|
||||
}
|
||||
|
||||
if (!this.formData.id) {
|
||||
const alert = await this.$alert("确定要提交吗?", "提醒", {
|
||||
confirmButtonText: "确定"
|
||||
})
|
||||
}
|
||||
try {
|
||||
this.submitLoading = true
|
||||
const resp = await this.$axios.post(loc() + "/save", { data: JSON.stringify(formData) })
|
||||
loading.close()
|
||||
this.submitLoading = false
|
||||
if (resp.code === 0) {
|
||||
this.$refs.guava.index()
|
||||
this.doSearch()
|
||||
this.$message.success(resp.msg)
|
||||
} else {
|
||||
this.notifyWarning(resp.msg)
|
||||
this.$message.error(resp.msg)
|
||||
}
|
||||
} catch (e) {
|
||||
loading.close()
|
||||
this.submitLoading = false
|
||||
this.notifyWarning(e.status)
|
||||
} finally {
|
||||
this.submitLoading = false
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -454,37 +423,34 @@ layout("/layouts/platform.html"){
|
||||
this.submitLoading = false
|
||||
if (resp.code === 0) {
|
||||
const data = resp.data
|
||||
/* data.flexibleGifts = data.flexibleGifts || [{}]
|
||||
const idx = data.flexibleGifts.findIndex(v => v.isDefault)
|
||||
data.defaultFlexibleGifts = idx < 0 ? 0 : idx*/
|
||||
data.provideTime = [data.provideTimeStart, data.provideTimeEnd]
|
||||
data.choiceTime = [data.choiceTimeStart, data.choiceTimeEnd]
|
||||
if (data.welfareProjectSubjects.length === 0) {
|
||||
data.welfareProjectSubjects = [
|
||||
{
|
||||
subjectName: "请输入福利信息",
|
||||
subjectType: data.isCheckBox,
|
||||
defaultOption: null,
|
||||
options: [
|
||||
{
|
||||
optionType: "套餐",
|
||||
optionName: "福利1",
|
||||
optionNameId: "",
|
||||
optionSort: "1",
|
||||
imgUrl: ""
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
} else {
|
||||
data.welfareProjectSubjects.forEach((v) => {
|
||||
v.options.map((o) => {
|
||||
if (!o.optionNameId) {
|
||||
o.optionNameId = ""
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
// if (data.welfareProjectSubjects.length === 0) {
|
||||
// data.welfareProjectSubjects = [
|
||||
// {
|
||||
// subjectName: "请输入福利信息",
|
||||
// subjectType: data.isCheckBox,
|
||||
// defaultOption: null,
|
||||
// options: [
|
||||
// {
|
||||
// optionType: "套餐",
|
||||
// optionName: "福利1",
|
||||
// optionNameId: "",
|
||||
// optionSort: "1",
|
||||
// imgUrl: ""
|
||||
// }
|
||||
// ]
|
||||
// }
|
||||
// ]
|
||||
// } else {
|
||||
// data.welfareProjectSubjects.forEach((v) => {
|
||||
// v.options.map((o) => {
|
||||
// if (!o.optionNameId) {
|
||||
// o.optionNameId = ""
|
||||
// }
|
||||
// })
|
||||
// })
|
||||
// }
|
||||
this.formData = data
|
||||
this.$refs.guava.edit()
|
||||
} else {
|
||||
@@ -495,21 +461,17 @@ layout("/layouts/platform.html"){
|
||||
this.$confirm("确定要删除吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
callback: async (a, b) => {
|
||||
if ("confirm" == a) {
|
||||
//确认后再执行
|
||||
this.submitLoading = true
|
||||
const resp = await this.$axios.post(loc() + "/delete", { id })
|
||||
if (resp.code === 0) {
|
||||
this.doSearch()
|
||||
this.$message.success(resp.msg)
|
||||
} else {
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
this.submitLoading = false
|
||||
}
|
||||
type: "warning"
|
||||
}).then(async () => {
|
||||
this.submitLoading = true
|
||||
const resp = await this.$axios.post(loc() + "/delete", { id })
|
||||
if (resp.code === 0) {
|
||||
this.doSearch()
|
||||
this.$message.success(resp.msg)
|
||||
} else {
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
this.submitLoading = false
|
||||
})
|
||||
},
|
||||
async createList(row, flag) {
|
||||
@@ -524,23 +486,20 @@ layout("/layouts/platform.html"){
|
||||
this.$confirm(msg, "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
callback: async (a, b) => {
|
||||
if ("confirm" == a) {
|
||||
//确认后再执行
|
||||
this.submitLoading = true
|
||||
const resp = await this.$axios.post(loc() + "/createList", {
|
||||
id: row.id,
|
||||
created: false
|
||||
})
|
||||
this.submitLoading = false
|
||||
if (resp.code === 0) {
|
||||
this.doSearch()
|
||||
this.$message.success(resp.msg)
|
||||
} else {
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
}
|
||||
type: "warning"
|
||||
}).then(async () => {
|
||||
//确认后再执行
|
||||
this.submitLoading = true
|
||||
const resp = await this.$axios.post(loc() + "/createList", {
|
||||
id: row.id,
|
||||
created: false
|
||||
})
|
||||
this.submitLoading = false
|
||||
if (resp.code === 0) {
|
||||
this.doSearch()
|
||||
this.$message.success(resp.msg)
|
||||
} else {
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,192 @@
|
||||
const welfareOption = {
|
||||
template: /*language=HTML*/ `
|
||||
<div class="welfare-option">
|
||||
<el-card shadow="never">
|
||||
<el-table :data="welfareList" border style="width: 100%; margin-top: 20px;">
|
||||
<el-table-column align="center" header-align="center" label="福利名称">
|
||||
<template slot-scope="{row}">
|
||||
<el-input
|
||||
v-model="row.optionName"
|
||||
placeholder="请输入福利名称">
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" header-align="center" label="图片" width="120">
|
||||
<template slot-scope="{row}">
|
||||
<file-upload :upload_number="1" :value.sync="row.imgUrl"
|
||||
accept=".jpg,.jpeg,.png"
|
||||
class="imgUrl"
|
||||
upload_result_type="url"
|
||||
complete_result upload_mode="image"
|
||||
upload_result_category="interval"></file-upload>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" header-align="center" label="说明" width="120">
|
||||
<template slot-scope="{row, $index}">
|
||||
<el-button
|
||||
type="text"
|
||||
@click="openDescription(row, $index)">
|
||||
{{ row.description ? '编辑说明' : '添加说明' }}
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" header-align="center" label="操作" width="100">
|
||||
<template slot-scope="{$index}">
|
||||
<el-button
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
circle
|
||||
size="mini"
|
||||
@click="deleteOption($index)">
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-button type="primary" size="small" @click="addOption">添加福利选项</el-button>
|
||||
</el-card>
|
||||
|
||||
<!-- 说明编辑对话框 -->
|
||||
<el-dialog
|
||||
title="编辑福利说明"
|
||||
:visible.sync="descriptionDialog.visible"
|
||||
width="60%"
|
||||
:append-to-body="true"
|
||||
:close-on-click-modal="false">
|
||||
<text-editor v-model="descriptionDialog.content"></text-editor>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="descriptionDialog.visible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="saveDescription">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
`,
|
||||
|
||||
props: {
|
||||
value: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
}
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
welfareList: [],
|
||||
descriptionDialog: {
|
||||
visible: false,
|
||||
content: '',
|
||||
currentIndex: -1
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
created() {
|
||||
this.welfareList = this.value ? JSON.parse(JSON.stringify(this.value)) : [];
|
||||
},
|
||||
|
||||
watch: {
|
||||
welfareList: {
|
||||
handler(newVal) {
|
||||
this.$emit('input', newVal);
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
addOption() {
|
||||
const newSort = this.welfareList.length + 1;
|
||||
this.welfareList.push({
|
||||
optionName: '福利' + newSort,
|
||||
optionSort: newSort,
|
||||
imgUrl: '',
|
||||
description: ''
|
||||
});
|
||||
},
|
||||
|
||||
deleteOption(index) {
|
||||
this.$confirm('确认删除该福利选项?', '提示', {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.welfareList.splice(index, 1);
|
||||
this.updateSortNumbers();
|
||||
});
|
||||
},
|
||||
|
||||
openDescription(row, index) {
|
||||
this.descriptionDialog.content = row.description || '';
|
||||
this.descriptionDialog.currentIndex = index;
|
||||
this.descriptionDialog.visible = true;
|
||||
},
|
||||
|
||||
saveDescription() {
|
||||
if (this.descriptionDialog.currentIndex > -1) {
|
||||
this.welfareList[this.descriptionDialog.currentIndex].description = this.descriptionDialog.content;
|
||||
}
|
||||
this.descriptionDialog.visible = false;
|
||||
},
|
||||
|
||||
handleSortChange(value, index) {
|
||||
const item = this.welfareList[index];
|
||||
const oldSort = item.optionSort;
|
||||
|
||||
if (value < 1) value = 1;
|
||||
if (value > this.welfareList.length) value = this.welfareList.length;
|
||||
|
||||
this.welfareList.forEach(welfare => {
|
||||
if (welfare !== item) {
|
||||
if (value > oldSort && welfare.optionSort > oldSort && welfare.optionSort <= value) {
|
||||
welfare.optionSort--;
|
||||
} else if (value < oldSort && welfare.optionSort >= value && welfare.optionSort < oldSort) {
|
||||
welfare.optionSort++;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
item.optionSort = value;
|
||||
this.welfareList.sort((a, b) => a.optionSort - b.optionSort);
|
||||
},
|
||||
|
||||
updateSortNumbers() {
|
||||
this.welfareList.forEach((item, index) => {
|
||||
item.optionSort = index + 1;
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
style: /*language=CSS*/ `
|
||||
.welfare-option {
|
||||
|
||||
}
|
||||
|
||||
.welfare-option .el-card__body{
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.welfare-option .el-upload-list__item{
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
}
|
||||
|
||||
.welfare-option .imgUrl .el-upload--picture-card {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
}
|
||||
|
||||
.welfare-option .imgUrl .el-upload--picture-card i {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
|
||||
.preview-image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: block;
|
||||
object-fit: cover;
|
||||
}
|
||||
`
|
||||
};
|
||||
@@ -0,0 +1,226 @@
|
||||
const WELFARE_OPTION_TABLE = {
|
||||
template: /*language=HTML*/ `
|
||||
<div>
|
||||
<el-card>
|
||||
<el-form ref="form">
|
||||
|
||||
<el-card :key="s.id" class="item" shadow="never" v-for="(s,idx) in subject">
|
||||
<!-- <el-form-item :label="(s.subjectType==='radio'?'(单选)':'(多选)')+ (idx+1)+'.'" prop="subjectName">-->
|
||||
<el-form-item label="" prop="subjectName">
|
||||
<div class="s-title-wrap">
|
||||
<el-row align="middle" style="width: 100%" type="flex">
|
||||
<el-col :xl="15"
|
||||
style="border: 1px dashed rgb(217, 217, 217);border-radius:6px;display: flex;align-items: center;">
|
||||
<el-input class="text-input" data-type="subject"
|
||||
v-model="s.subjectName"></el-input>
|
||||
</el-col>
|
||||
<el-col :xl="2" style="text-align: center"></el-col>
|
||||
<!-- <el-col :xl="2" style="text-align: center">
|
||||
<div class="option-delete">
|
||||
<el-button circle
|
||||
icon="el-icon-delete"
|
||||
size="mini" type="danger"
|
||||
@click="subject.splice(idx,1)"></el-button>
|
||||
</div>
|
||||
</el-col>-->
|
||||
</el-row>
|
||||
</div>
|
||||
<div class="s-options-list" style="margin-top: 10px;">
|
||||
<el-table :data="s.options" border>
|
||||
<el-table-column
|
||||
align="center"
|
||||
header-align="center"
|
||||
label="福利名称"
|
||||
>
|
||||
<template slot-scope="{row}">
|
||||
<div
|
||||
style="border: 1px dashed rgb(217, 217, 217);border-radius:6px;display: flex;align-items: center;padding-left: 10px;">
|
||||
<i class="fa fa-circle-o" style="cursor: pointer"
|
||||
v-if="s.subjectType==='radio'"></i>
|
||||
<i class="fa fa-square-o"
|
||||
style="cursor: pointer"
|
||||
v-else-if="s.subjectType==='checkBox'"></i>
|
||||
|
||||
<el-input autosize class="text-input"
|
||||
data-type="option"
|
||||
v-model="row.optionName"
|
||||
></el-input>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" header-align="center"
|
||||
label="备注1">
|
||||
<template slot-scope="{row}">
|
||||
<el-input max="100" type="textarea"
|
||||
v-model="row.supplier"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" header-align="center"
|
||||
label="备注2">
|
||||
<template slot-scope="{row}">
|
||||
<el-input max="100" type="textarea"
|
||||
v-model="row.simpleDesc"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" header-align="center" label="排序"
|
||||
width="120px">
|
||||
<template slot-scope="{row}">
|
||||
<div
|
||||
style="border: 1px dashed rgb(217, 217, 217);border-radius:6px;display: flex;align-items: center;padding-left: 10px;">
|
||||
<el-input autosize class="text-input"
|
||||
data-type="option"
|
||||
v-model="row.optionSort"
|
||||
></el-input>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" header-align="center" label="图片"
|
||||
width="120">
|
||||
<template slot-scope="{row,$index}">
|
||||
<file-upload :upload_number="1" :value.sync="row.imgUrl"
|
||||
accept=".jpg,.jpeg,.png"
|
||||
class="imgUrl"
|
||||
upload_result_type="url"
|
||||
complete_result upload_mode="image"
|
||||
upload_result_category="interval"></file-upload>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" header-align="center" label="说明"
|
||||
width="100px ">
|
||||
<template slot-scope="scope">
|
||||
<el-link @click="openDescRichText(scope.row.description,idx,scope.$index)"
|
||||
type="primary">
|
||||
编辑说明
|
||||
</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" header-align="center" label="操作"
|
||||
width="100px">
|
||||
<template slot-scope="{row,$index}">
|
||||
<div class="option-delete">
|
||||
<el-button @click="deleteRow(s.options,row,$index)"
|
||||
circle
|
||||
icon="el-icon-delete" size="mini"
|
||||
type="danger"></el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<div class="s-operation">
|
||||
<el-button
|
||||
@click="s.options.push({optionType:'套餐',optionNameId:'',optionName:'福利'+(s.options.length+1),optionSort:s.options.length+1,imgUrl:null,isDefaultOption:false,isSystemDefault:false})"
|
||||
size="small"
|
||||
type="primary">
|
||||
添加福利
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-card>
|
||||
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<el-dialog
|
||||
:append-to-body="true"
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="richTextDialog"
|
||||
title="编辑说明"
|
||||
width="60%">
|
||||
<text-editor v-model="descRichTextContent"></text-editor>
|
||||
<span class="dialog-footer" slot="footer">
|
||||
<el-button @click="richTextDialog = false">取 消</el-button>
|
||||
<el-button @click="saveRichText" type="primary">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
`,
|
||||
watch: {
|
||||
subject(val) {
|
||||
}
|
||||
},
|
||||
props: {
|
||||
subject: {
|
||||
type: Array,
|
||||
default: []
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
descRichTextContent: "",
|
||||
files: [],
|
||||
shoppingTypeOptions: null,
|
||||
richTextDialog: false,
|
||||
subjectIndex: 0,
|
||||
optionIndex: 0,
|
||||
imgPopover: false,
|
||||
idx: null,
|
||||
oidx: null
|
||||
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
deleteRow(options, row, index) {
|
||||
options.splice(index, 1)
|
||||
const shoppingTypeOption = this.shoppingTypeOptions.find(v => v.id === row.optionNameId)
|
||||
shoppingTypeOption.disabled = false
|
||||
},
|
||||
addSubject(type) {
|
||||
let subject = {
|
||||
subjectName: "题目" + (this.subject.length + 1),
|
||||
subjectType: type,
|
||||
options: [
|
||||
{ optionName: "选项一", imgUrl: null },
|
||||
{ optionName: "选项一", imgUrl: null }
|
||||
]
|
||||
}
|
||||
this.subject.push(subject)
|
||||
},
|
||||
validate(fn) {
|
||||
if (this._validate()) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
|
||||
},
|
||||
_validate() {
|
||||
return this.subject.some(v => {
|
||||
if (!v.subjectName) return true
|
||||
return v.options.some(x => {
|
||||
if (!x.optionName) return true
|
||||
})
|
||||
})
|
||||
},
|
||||
openDescRichText(description, sIdx, oIdx) {
|
||||
this.descRichTextContent = description
|
||||
this.richTextDialog = true
|
||||
this.subjectIndex = sIdx
|
||||
this.optionIndex = oIdx
|
||||
},
|
||||
saveRichText() {
|
||||
this.subject[this.subjectIndex]["options"][this.optionIndex].description = this.descRichTextContent
|
||||
this.richTextDialog = false
|
||||
}
|
||||
},
|
||||
style: /*language=CSS*/ `
|
||||
.imgUrl .el-upload--picture-card {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
}
|
||||
|
||||
.imgUrl .el-upload--picture-card i {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
`
|
||||
}
|
||||
|
||||
@@ -0,0 +1,196 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<guava :edit_scroll="false" ref="guava">
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<div class="search">
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">年  度:</div>
|
||||
<div class="search-item-option">
|
||||
<el-date-picker
|
||||
@change="doSearch"
|
||||
placeholder="请选择"
|
||||
style="width: 100%"
|
||||
type="year"
|
||||
v-model="pageForm.year"
|
||||
value-format="yyyy"
|
||||
></el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-query">
|
||||
<el-button @click="doSearch" icon="el-icon-search" type="primary">搜索</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card class="mt10" shadow="never">
|
||||
<table-tool :app="this" label="福利项目">
|
||||
<template #func></template>
|
||||
</table-tool>
|
||||
|
||||
<el-table
|
||||
:data="tableData"
|
||||
:size="tableSize"
|
||||
@sort-change="pageOrder"
|
||||
ref="table"
|
||||
row-key="id"
|
||||
style="width: 100%"
|
||||
v-loading="tableLoading"
|
||||
>
|
||||
<el-table-column
|
||||
:index="indexMethod"
|
||||
align="center"
|
||||
header-align="center"
|
||||
label="序号"
|
||||
type="index"
|
||||
width="80px"
|
||||
></el-table-column>
|
||||
|
||||
<el-table-column
|
||||
:key="column.prop"
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
:width="column.width"
|
||||
align="center"
|
||||
header-align="center"
|
||||
min-width="100px"
|
||||
show-overflow-tooltip
|
||||
v-for="column in tableColumns"
|
||||
>
|
||||
<template scope="{row}" v-if="column.prop=='choiceTime'">
|
||||
<i class="el-icon-time"></i>
|
||||
  {{$moment(row.choiceTimeStart) .format('YYYY/MM/DD HH:mm')}}
|
||||
<span>- {{$moment(row.choiceTimeEnd) .format('YYYY/MM/DD HH:mm')}}</span>
|
||||
</template>
|
||||
|
||||
<template scope="{row}" v-else-if="column.prop=='isChoose'">
|
||||
<span class="text-primary" v-if="row.isChoose">已选择</span>
|
||||
<span class="text-danger" v-else>未选择</span>
|
||||
</template>
|
||||
|
||||
<template scope="{row}" v-else-if="column.prop=='gist_list'">
|
||||
<span v-if="row.gist_list">{{row.gist_list}}</span>
|
||||
<span v-else>暂无</span>
|
||||
</template>
|
||||
|
||||
<template scope="{row}" v-else-if="column.prop=='receiveAddress'">
|
||||
<span v-if="row.receiveAddress">{{row.receiveAddress}}</span>
|
||||
<span v-else>暂无</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" header-align="center" label="操作" prop="userOnline" width="150px">
|
||||
<template scope="{row}">
|
||||
<el-button @click="openChoose(row)" size="mini" type="primary">{{confirmButtonInfo(row).text}}</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<template #edit>
|
||||
<option-select ref="optionSelectRef" @refresh="doSearch();$refs.guava.index();"></option-select>
|
||||
</template>
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
<!--#include("optionSelect.js"){}#-->
|
||||
new Vue({
|
||||
el: "#app",
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
tableColumns: [
|
||||
{ prop: "year", label: "年度" },
|
||||
{ prop: "name", label: "项目名称" },
|
||||
{ prop: "choiceTime", label: "选择时间" },
|
||||
{ prop: "isChoose", label: "是否选择" },
|
||||
{ prop: "gist_list", label: "所选福利" }
|
||||
// { prop: "receiveAddress", label: "收货地址" }
|
||||
]
|
||||
}
|
||||
},
|
||||
components: {
|
||||
"option-select": optionSelect
|
||||
},
|
||||
methods: {
|
||||
go_back() {
|
||||
this.doSearch()
|
||||
this.$refs.guava.index()
|
||||
},
|
||||
confirmButtonInfo(row) {
|
||||
const { choiceTimeEnd, choiceTimeStart, overdueChoiceTimeEnd, isChoose, selectTime } = row
|
||||
const now = this.$moment().valueOf()
|
||||
if (overdueChoiceTimeEnd == null || overdueChoiceTimeEnd === "") {
|
||||
if (now > this.$moment(choiceTimeStart).valueOf() && now < moment(choiceTimeEnd).valueOf()) {
|
||||
return { text: isChoose ? "确定修改" : "确定选择", disabled: false }
|
||||
} else if (now > this.$moment(choiceTimeEnd).valueOf()) {
|
||||
return { text: "选择已结束", disabled: true }
|
||||
} else if (now < this.$moment(choiceTimeStart).valueOf()) {
|
||||
return { text: "选择未开始", disabled: true }
|
||||
}
|
||||
} else {
|
||||
//已选择了不能再动了
|
||||
if (isChoose) {
|
||||
if (
|
||||
this.$moment(selectTime).valueOf() > this.$moment(choiceTimeEnd).valueOf() &&
|
||||
now < this.$moment(overdueChoiceTimeEnd).valueOf()
|
||||
) {
|
||||
return { text: "确定修改", disabled: false }
|
||||
}
|
||||
return { text: "选择已结束", disabled: true }
|
||||
} else {
|
||||
if (now > this.$moment(choiceTimeStart).valueOf() && now < this.$moment(overdueChoiceTimeEnd).valueOf()) {
|
||||
return { text: isChoose ? "修改" : "确定选择", disabled: false }
|
||||
} else if (now > this.$moment(overdueChoiceTimeEnd).valueOf()) {
|
||||
return { text: "选择已结束", disabled: true }
|
||||
} else if (now < this.$moment(choiceTimeStart).valueOf()) {
|
||||
return { text: "选择未开始", disabled: true }
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
async openChoose(row) {
|
||||
if (this.confirmButtonInfo(row).disabled) {
|
||||
this.$message.warning("当前时间段无法选择")
|
||||
return
|
||||
}
|
||||
this.$refs.guava.edit(() => {
|
||||
this.$refs.optionSelectRef.onOpen(row.id)
|
||||
})
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<style>
|
||||
.desc_label {
|
||||
width: 75px;
|
||||
-webkit-flex-shrink: 0;
|
||||
flex-shrink: 0;
|
||||
padding-right: 4px;
|
||||
display: inline-block;
|
||||
font-size: 14px;
|
||||
color: #7f7f7f;
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.desc_value {
|
||||
color: #333;
|
||||
font-size: 14px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
File diff suppressed because it is too large
Load Diff
@@ -33,41 +33,7 @@ layout("/layouts/platform.html"){
|
||||
|
||||
<el-card class="mt10" shadow="never" v-loading="tableLoading">
|
||||
<table-tool label="工会列表">
|
||||
<el-button
|
||||
@click="allExportReceiveDetailByUnionIdWord"
|
||||
icon="el-icon-printer"
|
||||
size="small"
|
||||
type="primary"
|
||||
v-if="$auth.hasRoleOr(['SYSADMIN','SCHOOL_UNION_ADMIN',
|
||||
'SCHOOL_UNION_WELFARE_ADMIN'])"
|
||||
>
|
||||
导出各分工会福利签领表
|
||||
</el-button>
|
||||
|
||||
<template
|
||||
v-if="$auth.hasRoleOr(['SYSADMIN','SCHOOL_UNION_ADMIN',
|
||||
'SCHOOL_UNION_WELFARE_ADMIN','BRANCH_UNION_CHAIRMAN'])"
|
||||
>
|
||||
<el-button @click="exportSelectData" icon="el-icon-printer" size="small" type="primary">按品牌导出</el-button>
|
||||
<el-button
|
||||
:disabled="!pageForm.projectId"
|
||||
@click="exportReceiveDetailByUnionId(true)"
|
||||
icon="el-icon-printer"
|
||||
size="small"
|
||||
type="primary"
|
||||
>
|
||||
导出已选名单
|
||||
</el-button>
|
||||
<el-button
|
||||
:disabled="!pageForm.projectId"
|
||||
@click="exportReceiveDetailByUnionId(false)"
|
||||
icon="el-icon-printer"
|
||||
size="small"
|
||||
type="primary"
|
||||
>
|
||||
导出未选名单
|
||||
</el-button>
|
||||
</template>
|
||||
<el-button @click="exportByWelfareOptions" icon="el-icon-printer" size="small" type="primary">按福利选项导出</el-button>
|
||||
<template
|
||||
v-if="$auth.hasRoleOr(['SYSADMIN','SCHOOL_UNION_ADMIN',
|
||||
'SCHOOL_UNION_WELFARE_ADMIN'])"
|
||||
@@ -102,125 +68,33 @@ layout("/layouts/platform.html"){
|
||||
v-for="column in tableColumns"
|
||||
>
|
||||
<template scope="{row}" v-if="column.prop=='welfareUnitName'">{{row.welfareUnitName}}</template>
|
||||
<template scope="{row}" v-else-if="column.prop=='unselectedTeacherSum'">
|
||||
<el-link @click="openUnclaimed(row.id)" type="primary">{{row.unselectedTeacherSum}}</el-link>
|
||||
<template scope="{row}" v-else-if="column.prop=='selectedNum'">
|
||||
<el-link @click="openSelected(row)" type="primary">{{row.selectedNum}}</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" header-align="center" label="操作" v-if="tableColumns.length>0" width="400px">
|
||||
<template scope="{ row }">
|
||||
<el-button @click="exportReceiveDetailByUnionIdWord(row.id)" plain size="mini" type="primary">导出福利签领表</el-button>
|
||||
<el-button @click="openView(row.id)" size="mini" type="primary">查看已选人员</el-button>
|
||||
<template scope="{row}" v-else-if="column.prop=='unSelectedNum'">
|
||||
<el-link @click="openUnSelected(row)" type="primary">{{row.unSelectedNum}}</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<template #view>
|
||||
<el-table
|
||||
:data="receiveTableData"
|
||||
:size="tableSize"
|
||||
class="vi-table"
|
||||
height="100%"
|
||||
row-key="id"
|
||||
style="width: 100%"
|
||||
v-loading="tableLoading"
|
||||
>
|
||||
<el-table-column label="序号" type="index" width="50">
|
||||
<template scope="scope">{{scope.$index + (receivePageForm.pageNumber - 1) * receivePageForm.pageSize + 1}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
:key="column.prop"
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
align="center"
|
||||
show-overflow-tooltip
|
||||
v-for="column in receive_tableColumns"
|
||||
></el-table-column>
|
||||
</el-table>
|
||||
<el-row class="el-pagination-container" style="margin-bottom: 0px">
|
||||
<el-pagination
|
||||
:current-page="receivePageForm.pageNumber"
|
||||
:page-size="receivePageForm.pageSize"
|
||||
:page-sizes="[5,10, 20, 30, 50]"
|
||||
:total="receivePageForm.totalCount"
|
||||
@current-change="receivePageNumberChange"
|
||||
@size-change="receivePageSizeChange"
|
||||
layout="total, sizes, prev, pager, next"
|
||||
></el-pagination>
|
||||
</el-row>
|
||||
</template>
|
||||
</guava>
|
||||
|
||||
<el-dialog :visible.sync="unclaimedDialog" title="未领取人员" width="65%">
|
||||
<el-button @click="exportReceiveDetailByUnionId(false)" class="pull-right" icon="el-icon-printer" type="primary">导出未选名单</el-button>
|
||||
<el-table
|
||||
:data="unclaimedTableData"
|
||||
:size="tableSize"
|
||||
class="vi-table"
|
||||
max-height="650"
|
||||
row-key="id"
|
||||
style="width: 100%"
|
||||
v-loading="tableLoading"
|
||||
>
|
||||
<el-table-column type="index" width="50"></el-table-column>
|
||||
<el-table-column
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
align="center"
|
||||
show-overflow-tooltip
|
||||
v-for="column in unclaimed_tableColumns"
|
||||
></el-table-column>
|
||||
</el-table>
|
||||
<el-row class="el-pagination-container" style="margin-bottom: 0px">
|
||||
<el-pagination
|
||||
:current-page="unclaimedPageForm.pageNumber"
|
||||
:page-size="receivePageForm.pageSize"
|
||||
:page-sizes="[5,10, 20, 30, 50]"
|
||||
:total="unclaimedPageForm.totalCount"
|
||||
@current-change="unclaimedPageNumberChange"
|
||||
@size-change="unclaimedPageSizeChange"
|
||||
layout="total, sizes, prev, pager, next"
|
||||
></el-pagination>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog :visible.sync="selectByAdminDialogVisible" title="管理员统一选择福利" width="35%">
|
||||
<el-form label-position="right" label-width="120px">
|
||||
<el-form-item label="福利选项">
|
||||
<el-row :gutter="10" :key="item.id" style="margin: 10px" v-for="(item,oidx) in welfareOptions">
|
||||
<el-col :span="4">
|
||||
<el-tag style="height: 40px; line-height: 40px; width: 90%">
|
||||
<span style="display: flex; justify-content: center">{{item.optionName}}</span>
|
||||
</el-tag>
|
||||
</el-col>
|
||||
<el-col span="18">
|
||||
<el-input-number
|
||||
:max="item.maxNum"
|
||||
:min="0"
|
||||
@change="numChange(item.selectNum,item,oidx)"
|
||||
style="width: 50%"
|
||||
v-model="item.selectNum"
|
||||
></el-input-number>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-alert class="text-primary mb10">给没有选择的福利人员统一代选择</el-alert>
|
||||
<el-row justify="end" type="flex">
|
||||
<el-button @click="selectByAdminDialogVisible=false">取消</el-button>
|
||||
<el-button @click="doSelectByAdmin" type="primary">提交</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
<selected-user ref="selectedUserRef"></selected-user>
|
||||
<unselected-user ref="unSelectedUserRef"></unselected-user>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
<!--#include('selectedUser.js'){}#-->
|
||||
<!--#include('unSelectedUser.js'){}#-->
|
||||
|
||||
new Vue({
|
||||
el: "#app",
|
||||
mixins: [initTableMixins],
|
||||
components: {
|
||||
"selected-user": selectedUser,
|
||||
"unselected-user": unSelectedUser
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
unions: [],
|
||||
@@ -263,163 +137,47 @@ layout("/layouts/platform.html"){
|
||||
{ label: "工号", prop: "loginName" },
|
||||
{ label: "单位", prop: "unitName" },
|
||||
{ label: "工会", prop: "unionName" }
|
||||
],
|
||||
selectByAdminDialogVisible: false
|
||||
]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
//数量更改
|
||||
numChange(value, option, optionIndex) {
|
||||
this.$nextTick(() => {
|
||||
// 查找+1按钮
|
||||
const plusButton = document.querySelector(".el-input-number__increase")
|
||||
// 添加点击事件监听器
|
||||
plusButton.addEventListener("click", this.handlePlusButtonClick(value, option, optionIndex))
|
||||
})
|
||||
},
|
||||
handlePlusButtonClick(value, option, optionIndex) {
|
||||
const { isCheckBox, multiSelectNum, singleOptionSupportMultipleSelection } = this.projectInfo
|
||||
if (isCheckBox === "checkBox") {
|
||||
//判断是否支持单个多选
|
||||
if (!singleOptionSupportMultipleSelection && value > 1) {
|
||||
this.$set(this.welfareOptions[optionIndex], "selectNum", 1)
|
||||
this.$message("此套餐最多只能选择1份")
|
||||
return
|
||||
}
|
||||
}
|
||||
//获取用户当前选择的数量
|
||||
const selectNums = this.welfareOptions.map((v) => v.selectNum)
|
||||
const sum = selectNums.reduce((accumulator, currentValue) => accumulator + currentValue, 0)
|
||||
|
||||
if (sum > multiSelectNum) {
|
||||
this.$set(this.welfareOptions[optionIndex], "selectNum", 0)
|
||||
this.$message("此次福利最多只能选择" + multiSelectNum + "份")
|
||||
}
|
||||
},
|
||||
doSelectByAdmin() {
|
||||
//获取用户当前选择的数量
|
||||
const selectNums = this.welfareOptions.map((v) => v.selectNum)
|
||||
const sum = selectNums.reduce((accumulator, currentValue) => accumulator + currentValue, 0)
|
||||
if (sum === 0) {
|
||||
this.notifyWarning("请选择福利")
|
||||
return
|
||||
}
|
||||
|
||||
this.$confirm("请确定是否给未选择的教职工一键选择当前福利?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(async () => {
|
||||
this.doSelectByAdminLoading = true
|
||||
const resp = await this.$axios.post("/platform/welfare/project/statistics/single/doSelectByAdmin", {
|
||||
welfareOptions: JSON.stringify(this.welfareOptions),
|
||||
projectId: this.pageForm.projectId
|
||||
})
|
||||
this.doSelectByAdminLoading = false
|
||||
if (resp.code === 0) {
|
||||
this.pageData()
|
||||
this.selectByAdminDialogVisible = false
|
||||
this.$message.success(resp.msg)
|
||||
} else {
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
})
|
||||
},
|
||||
selectOptionByAdmin() {
|
||||
this.selectByAdminDialogVisible = true
|
||||
},
|
||||
exportSummary() {
|
||||
this.$downLoad("/platform/welfare/project/statistics/single/exportSummary", {
|
||||
this.$downLoad("/platform/welfare/statistics/exportSummary", {
|
||||
projectId: this.pageForm.projectId
|
||||
})
|
||||
},
|
||||
exportSelectData() {
|
||||
this.$downLoad("/platform/welfare/project/statistics/single/exportSelectData", {
|
||||
this.$downLoad("/platform/welfare/statistics/exportSelectData", {
|
||||
projectId: this.pageForm.projectId,
|
||||
unionId: this.pageForm.unionId
|
||||
})
|
||||
},
|
||||
allExportReceiveDetailByUnionIdWord() {
|
||||
this.$downLoad("/platform/welfare/project/statistics/single/allExportReceiveDetailByUnionIdWord", {
|
||||
projectId: this.pageForm.projectId
|
||||
})
|
||||
// 查看已选择的人员
|
||||
openSelected(row) {
|
||||
this.$refs.selectedUserRef.onOpen(this.pageForm.projectId, row)
|
||||
},
|
||||
exportReceiveDetailByUnionId(flag) {
|
||||
this.$downLoad("/platform/welfare/project/statistics/single/exportReceiveDetailByUnionId", {
|
||||
|
||||
// 查看未选择的人员
|
||||
async openUnSelected(row) {
|
||||
this.$refs.unSelectedUserRef.onOpen(this.pageForm.projectId, row)
|
||||
},
|
||||
|
||||
// 按福利选项导出
|
||||
exportByWelfareOptions() {
|
||||
this.$downLoad("/platform/welfare/statistics/exportByWelfareOptions", {
|
||||
projectId: this.pageForm.projectId,
|
||||
unionId: this.pageForm.unionId ? this.pageForm.unionId : this.unclaimedPageForm.unionId,
|
||||
flag: flag
|
||||
})
|
||||
},
|
||||
async openUnclaimed(id) {
|
||||
this.unclaimedPageForm.pageNumber = 1
|
||||
this.unclaimedPageForm.pageSize = 10
|
||||
this.unclaimedPageForm.unionId = id
|
||||
await this.unclaimedPageData()
|
||||
this.unclaimedDialog = true
|
||||
},
|
||||
async unclaimedPageData() {
|
||||
this.tableLoading = true
|
||||
const resp = await $.post("/platform/welfare/project/statistics/single/unclaimedData", {
|
||||
unionId: this.unclaimedPageForm.unionId,
|
||||
projectId: this.pageForm.projectId,
|
||||
pageNumber: this.unclaimedPageForm.pageNumber,
|
||||
pageSize: this.unclaimedPageForm.pageSize
|
||||
})
|
||||
this.unclaimedTableData = resp.data.list
|
||||
this.unclaimedPageForm.totalCount = resp.data.totalCount
|
||||
this.tableLoading = false
|
||||
},
|
||||
unclaimedPageSizeChange(val) {
|
||||
this.unclaimedPageForm.pageSize = val
|
||||
this.unclaimedPageData()
|
||||
},
|
||||
unclaimedPageNumberChange(val) {
|
||||
this.unclaimedPageForm.pageNumber = val
|
||||
this.unclaimedPageData()
|
||||
},
|
||||
async openView(id) {
|
||||
this.receivePageForm.pageNumber = 1
|
||||
this.receivePageForm.pageSize = 10
|
||||
this.receivePageForm.unionId = id
|
||||
await this.receivePageData()
|
||||
this.$refs.guava.view()
|
||||
},
|
||||
receivePageSizeChange(val) {
|
||||
this.receivePageForm.pageSize = val
|
||||
this.receivePageData()
|
||||
},
|
||||
receivePageNumberChange(val) {
|
||||
this.receivePageForm.pageNumber = val
|
||||
this.receivePageData()
|
||||
},
|
||||
async receivePageData() {
|
||||
this.tableLoading = true
|
||||
const resp = await this.$axios.post("/platform/welfare/project/statistics/single/receivePageData", {
|
||||
unionId: this.receivePageForm.unionId,
|
||||
projectId: this.pageForm.projectId,
|
||||
pageNumber: this.receivePageForm.pageNumber,
|
||||
pageSize: this.receivePageForm.pageSize
|
||||
})
|
||||
this.receiveTableData = resp.data.list
|
||||
this.receivePageForm.totalCount = resp.data.totalCount
|
||||
this.tableLoading = false
|
||||
},
|
||||
exportReceiveDetailByUnionIdWord(id) {
|
||||
this.$downLoad("/platform/welfare/project/statistics/single/exportReceiveDetailByUnionIdWord", {
|
||||
projectId: this.pageForm.projectId,
|
||||
unionId: id
|
||||
unionId: this.pageForm.unionId
|
||||
})
|
||||
},
|
||||
|
||||
async pageData() {
|
||||
this.tableLoading = true
|
||||
|
||||
const resp = await this.$axios.post("/platform/welfare/project/statistics/single/pageData", this.pageForm)
|
||||
const resp = await this.$axios.post("/platform/welfare/statistics/pageData", this.pageForm)
|
||||
if (resp.code === 0) {
|
||||
this.tableColumns = [
|
||||
{
|
||||
prop: "name",
|
||||
label: "所属工会",
|
||||
label: "分工会",
|
||||
width: "300"
|
||||
}
|
||||
].concat(resp.data.tableColumn)
|
||||
@@ -432,7 +190,6 @@ layout("/layouts/platform.html"){
|
||||
this.welfareProjectList = resp.data
|
||||
if (this.welfareProjectList && this.welfareProjectList.length > 0) {
|
||||
this.$set(this.pageForm, "projectId", this.welfareProjectList[0].id)
|
||||
|
||||
this.getWelfareOptions()
|
||||
} else {
|
||||
this.tableData = []
|
||||
@@ -442,10 +199,7 @@ layout("/layouts/platform.html"){
|
||||
getWelfareOptions() {
|
||||
const data = this.welfareProjectList.find((p) => p.id === this.pageForm.projectId)
|
||||
this.projectInfo = data
|
||||
data.optionList.map((v) => {
|
||||
v.selectNum = 0
|
||||
})
|
||||
this.welfareOptions = data.optionList
|
||||
this.welfareOptions = data.options
|
||||
},
|
||||
async init() {
|
||||
if (
|
||||
|
||||
@@ -0,0 +1,94 @@
|
||||
const selectedUser = {
|
||||
template: /*language=HTML*/ `
|
||||
<el-dialog :title="unionName+'已选择用户'" :visible.sync="visible">
|
||||
<div style="display: flex; justify-content: space-between; margin-bottom: 10px;">
|
||||
<div>
|
||||
<el-input
|
||||
v-model="pageForm.searchKeyword"
|
||||
placeholder="请输入姓名或工号"
|
||||
style="width: 200px;"
|
||||
size="small"
|
||||
clearable
|
||||
@keyup.enter.native="doSearch"
|
||||
>
|
||||
<el-button slot="append" icon="el-icon-search" @click="doSearch"></el-button>
|
||||
</el-input>
|
||||
</div>
|
||||
<div>
|
||||
<el-button type="primary" size="small" @click="handleExport">导出</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<el-table
|
||||
:data="tableData"
|
||||
height="100%"
|
||||
row-key="id"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-table-column label="序号" type="index" :index="indexMethod" width="50"></el-table-column>
|
||||
<el-table-column
|
||||
:key="column.prop"
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
align="center"
|
||||
show-overflow-tooltip
|
||||
v-for="column in tableColumns"
|
||||
></el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-dialog>
|
||||
`,
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
projectId: null,
|
||||
unionId: null,
|
||||
unionName: null,
|
||||
searchKeyword: "",
|
||||
tableColumns: [
|
||||
{ label: "工号", prop: "loginName" },
|
||||
{ label: "姓名", prop: "userName" },
|
||||
{ label: "单位", prop: "welfareUnitName" },
|
||||
{ label: "分工会", prop: "welfareUnionName" },
|
||||
{ label: "手机号", prop: "mobile" },
|
||||
{ label: "所选福利", prop: "selectOptionName" }
|
||||
]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onOpen(projectId, { id, name }) {
|
||||
this.visible = true
|
||||
this.projectId = projectId
|
||||
this.unionId = id
|
||||
this.unionName = name
|
||||
this.searchKeyword = ""
|
||||
this.pageData()
|
||||
},
|
||||
pageData() {
|
||||
this.$axios
|
||||
.post("/platform/welfare/statistics/selectedUnionUserPageData", {
|
||||
...this.pageForm,
|
||||
projectId: this.projectId,
|
||||
unionId: this.unionId,
|
||||
keyword: this.searchKeyword
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.tableData = res.data.list
|
||||
this.pageForm.totalCount = res.data.totalCount
|
||||
}
|
||||
})
|
||||
},
|
||||
handleSearch() {
|
||||
this.pageForm.pageNum = 1
|
||||
this.pageData()
|
||||
},
|
||||
handleExport() {
|
||||
this.$downLoad("/platform/welfare/statistics/exportSelectedUnionUser", {
|
||||
projectId: this.projectId,
|
||||
unionId: this.unionId
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
const unSelectedUser = {
|
||||
template: /*language=HTML*/ `
|
||||
<el-dialog :title="unionName+'未选择用户'" :visible.sync="visible">
|
||||
<div style="display: flex; justify-content: space-between; margin-bottom: 10px;">
|
||||
<div>
|
||||
<el-input
|
||||
v-model="pageForm.searchKeyword"
|
||||
placeholder="请输入姓名或工号"
|
||||
style="width: 200px;"
|
||||
size="small"
|
||||
clearable
|
||||
@keyup.enter.native="doSearch"
|
||||
>
|
||||
<el-button slot="append" icon="el-icon-search" @click="doSearch"></el-button>
|
||||
</el-input>
|
||||
</div>
|
||||
<div>
|
||||
<el-button type="primary" size="small" @click="handleExport">导出</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<el-table
|
||||
:data="tableData"
|
||||
row-key="id"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-table-column label="序号" type="index" :index="indexMethod" width="50"></el-table-column>
|
||||
<el-table-column
|
||||
:key="column.prop"
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
align="center"
|
||||
show-overflow-tooltip
|
||||
v-for="column in tableColumns"
|
||||
></el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-dialog>
|
||||
`,
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
projectId: null,
|
||||
unionId: null,
|
||||
unionName: null,
|
||||
tableColumns: [
|
||||
{ label: "工号", prop: "loginName" },
|
||||
{ label: "姓名", prop: "userName" },
|
||||
{ label: "单位", prop: "welfareUnitName" },
|
||||
{ label: "分工会", prop: "welfareUnionName" }
|
||||
]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onOpen(projectId, { id, name }) {
|
||||
this.visible = true
|
||||
this.projectId = projectId
|
||||
this.unionId = id
|
||||
this.unionName = name
|
||||
this.pageData()
|
||||
},
|
||||
pageData() {
|
||||
this.$axios
|
||||
.post("/platform/welfare/statistics/unSelectedUnionUserPageData", {
|
||||
...this.pageForm,
|
||||
projectId: this.projectId,
|
||||
unionId: this.unionId
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.tableData = res.data.list
|
||||
this.pageForm.totalCount = res.data.totalCount
|
||||
}
|
||||
})
|
||||
},
|
||||
handleExport() {
|
||||
this.$downLoad("/platform/welfare/statistics/exportUnSelectedUnionUser", {
|
||||
projectId: this.projectId,
|
||||
unionId: this.unionId
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,196 +1,196 @@
|
||||
<!--#include("/platform/zhgh/welfare/addressManage/addressDialog.js"){}#-->
|
||||
let CHOOSE_WELFARE = {
|
||||
template: `
|
||||
<div>
|
||||
<el-card shadow="never">
|
||||
<el-form :model="formData" label-width="120px" ref="addForm">
|
||||
<el-form-item label="福利名称">
|
||||
<span style="font-weight: bold;font-size: 20px">{{projectInfo.name}}</span>
|
||||
</el-form-item>
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="福利节日">
|
||||
{{projectInfo.festival}}
|
||||
template: /*language=HTML*/ `
|
||||
<div>
|
||||
<el-card shadow="never">
|
||||
<el-form :model="formData" label-width="120px" ref="addForm">
|
||||
<el-form-item label="福利名称">
|
||||
<span style="font-weight: bold;font-size: 20px">{{projectInfo.name}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" v-if="!projectInfo.flexible">
|
||||
<el-form-item label="福利礼品">
|
||||
{{projectInfo.gift}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="福利节日">
|
||||
{{projectInfo.festival}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" v-if="!projectInfo.flexible">
|
||||
<el-form-item label="福利礼品">
|
||||
{{projectInfo.gift}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
|
||||
<el-form-item label="选择形式">
|
||||
{{projectInfo.isCheckBox==='checkBox'?'多选':'单选'}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" v-if="projectInfo.isCheckBox==='checkBox'">
|
||||
<el-form-item label="最多选几个">
|
||||
{{projectInfo.multiSelectNum}}个
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="发放形式">
|
||||
<template>
|
||||
{{welfareProvideMode.find(v=>v.code==projectInfo.provideMode) &&
|
||||
welfareProvideMode.find(v=>v.code==projectInfo.provideMode).name}}
|
||||
</template>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="签收形式">
|
||||
<template>
|
||||
{{welfareSignMode.find(v=>v.code==projectInfo.signMode) &&
|
||||
welfareSignMode.find(v=>v.code==projectInfo.signMode).name}}
|
||||
</template>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="选择时间">
|
||||
{{projectInfo.choiceTimeStart}}至{{projectInfo.choiceTimeEnd}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="选择形式">
|
||||
{{projectInfo.isCheckBox==='checkBox'?'多选':'单选'}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" v-if="projectInfo.isCheckBox==='checkBox'">
|
||||
<el-form-item label="最多选几个">
|
||||
{{projectInfo.multiSelectNum}}个
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="发放形式">
|
||||
<template>
|
||||
{{welfareProvideMode.find(v=>v.code==projectInfo.provideMode) &&
|
||||
welfareProvideMode.find(v=>v.code==projectInfo.provideMode).name}}
|
||||
</template>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="签收形式">
|
||||
<template>
|
||||
{{welfareSignMode.find(v=>v.code==projectInfo.signMode) &&
|
||||
welfareSignMode.find(v=>v.code==projectInfo.signMode).name}}
|
||||
</template>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="选择时间">
|
||||
{{projectInfo.choiceTimeStart}}至{{projectInfo.choiceTimeEnd}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-form-item label="福利套餐">
|
||||
<el-row :gutter="0">
|
||||
<div :key="subject.id"
|
||||
v-for="subject in projectInfo.welfareProjectSubjects">
|
||||
<el-col :key="oidx" :span="8"
|
||||
v-for="(option, oidx) in subject.options">
|
||||
<el-card
|
||||
style="margin: 5px;">
|
||||
<el-form-item label="福利套餐">
|
||||
<el-row :gutter="0">
|
||||
<div :key="subject.id"
|
||||
v-for="subject in projectInfo.welfareProjectSubjects">
|
||||
<el-col :key="oidx" :span="8"
|
||||
v-for="(option, oidx) in subject.options">
|
||||
<el-card
|
||||
style="margin: 5px;">
|
||||
|
||||
<div slot="header"
|
||||
style="display: flex;justify-content: space-between">
|
||||
<div style="color:#000;font-size: 18px">
|
||||
{{option.optionName}}
|
||||
</div>
|
||||
<div>
|
||||
<el-button @click.stop="viewDesc(option)"
|
||||
type="text">套餐详情
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div slot="header"
|
||||
style="display: flex;justify-content: space-between">
|
||||
<div style="color:#000;font-size: 18px">
|
||||
{{option.optionName}}
|
||||
</div>
|
||||
<div>
|
||||
<el-button @click.stop="viewDesc(option)"
|
||||
type="text">套餐详情
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="display: flex">
|
||||
<el-image
|
||||
style="width: 150px;height: 150px;"
|
||||
:src="option.imgUrl"
|
||||
fit="contain"
|
||||
></el-image>
|
||||
<div style="width:calc(100% - 150px);padding-left: 20px;position: relative">
|
||||
<div style="white-space: nowrap;display: flex">
|
||||
<span class="desc_label">服务专线</span>
|
||||
<el-tooltip :content="option.supplier" placement="top">
|
||||
<div style="display: flex">
|
||||
<el-image
|
||||
style="width: 150px;height: 150px;"
|
||||
:src="option.imgUrl"
|
||||
fit="contain"
|
||||
></el-image>
|
||||
<div style="width:calc(100% - 150px);padding-left: 20px;position: relative">
|
||||
<div style="white-space: nowrap;display: flex">
|
||||
<span class="desc_label">服务专线</span>
|
||||
<el-tooltip :content="option.supplier" placement="top">
|
||||
<span class="desc_value"
|
||||
style="width: calc(100% - 80px);text-overflow: ellipsis;overflow: hidden">
|
||||
{{option.supplier}}
|
||||
</span>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
<div v-if="option.simpleDesc">
|
||||
<span class="desc_label">备  注</span>
|
||||
<span class="desc_value">
|
||||
</el-tooltip>
|
||||
</div>
|
||||
<div v-if="option.simpleDesc">
|
||||
<span class="desc_label">备  注</span>
|
||||
<span class="desc_value">
|
||||
{{option.simpleDesc}}
|
||||
</span>
|
||||
</div>
|
||||
<div>
|
||||
<el-input-number :disabled="is_view"
|
||||
:max="option.maxNum"
|
||||
:min="0"
|
||||
@change="numChange(option.selectNum,option,oidx)"
|
||||
style="width: 150px;position: absolute;right:0px;bottom: 0;"
|
||||
v-model="option.selectNum"></el-input-number>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<el-input-number :disabled="is_view"
|
||||
:max="option.maxNum"
|
||||
:min="0"
|
||||
@change="numChange(option.selectNum,option,oidx)"
|
||||
style="width: 150px;position: absolute;right:0px;bottom: 0;"
|
||||
v-model="option.selectNum"></el-input-number>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</el-card>
|
||||
</el-col>
|
||||
</div>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
|
||||
<template v-if="projectInfo.provideMode===3">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24" v-if="!is_view">
|
||||
<el-form-item label="收货地址" prop="receiveAddress">
|
||||
<div style="display: flex; column-gap: 10px">
|
||||
<div style="flex: 1">
|
||||
<el-select @change="addressChange"
|
||||
filterable placeholder="请选择收货地址"
|
||||
style="width: 100%"
|
||||
v-model="formData.addressId">
|
||||
<el-option
|
||||
:key="item.id"
|
||||
:label="item.name+' '+item.defaultName"
|
||||
:value="item.id"
|
||||
v-for="item in addressOptions">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<el-button
|
||||
@click="openAddress"
|
||||
type="primary">添加收货地址
|
||||
</el-button>
|
||||
</div>
|
||||
|
||||
</el-card>
|
||||
</el-col>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item
|
||||
:rules="{required:true,message: '请确认收货地址', trigger: 'blur'}"
|
||||
label="请确认收货地址"
|
||||
prop="receiveAddress">
|
||||
<el-input :rows="4" disabled maxlength="100"
|
||||
placeholder="选择收货地址联动" type="textarea"
|
||||
v-model="formData.receiveAddress"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</template>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item :rules="{required:true,message: '请签字', trigger: 'blur'}"
|
||||
label="签字" prop="userSign" v-if="projectInfo.signMode===2">
|
||||
<template v-if="isChoice===0||!is_view">
|
||||
<pc-signature v-model="formData.userSign"></pc-signature>
|
||||
</template>
|
||||
<template v-else>
|
||||
<el-image :src="formData.userSign"
|
||||
fit="contain"
|
||||
style="height: 100px;width: 100%" v-if="formData.userSign">
|
||||
</el-image>
|
||||
<span v-else>暂无</span>
|
||||
</template>
|
||||
<template v-if="projectInfo.provideMode===3">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24" v-if="!is_view">
|
||||
<el-form-item label="收货地址" prop="receiveAddress">
|
||||
<div style="display: flex; column-gap: 10px">
|
||||
<div style="flex: 1">
|
||||
<el-select @change="addressChange"
|
||||
filterable placeholder="请选择收货地址"
|
||||
style="width: 100%"
|
||||
v-model="formData.addressId">
|
||||
<el-option
|
||||
:key="item.id"
|
||||
:label="item.name+' '+item.defaultName"
|
||||
:value="item.id"
|
||||
v-for="item in addressOptions">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<el-button
|
||||
@click="openAddress"
|
||||
type="primary">添加收货地址
|
||||
</el-button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item
|
||||
:rules="{required:true,message: '请确认收货地址', trigger: 'blur'}"
|
||||
label="请确认收货地址"
|
||||
prop="receiveAddress">
|
||||
<el-input :rows="4" disabled maxlength="100"
|
||||
placeholder="选择收货地址联动" type="textarea"
|
||||
v-model="formData.receiveAddress"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<el-form-item :rules="{required:true,message: '请签字', trigger: 'blur'}"
|
||||
label="签字" prop="userSign" v-if="projectInfo.signMode===2">
|
||||
<template v-if="isChoice===0||!is_view">
|
||||
<pc-signature v-model="formData.userSign"></pc-signature>
|
||||
</template>
|
||||
<template v-else>
|
||||
<el-image :src="formData.userSign"
|
||||
fit="contain"
|
||||
style="height: 100px;width: 100%" v-if="formData.userSign">
|
||||
</el-image>
|
||||
<span v-else>暂无</span>
|
||||
</template>
|
||||
|
||||
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<el-row class="mt20" justify="end" type="flex">
|
||||
<el-button @click="$emit('go_back')">关闭</el-button>
|
||||
<el-button @click="doChoose" type="primary" v-if="!is_view">确定</el-button>
|
||||
</el-row>
|
||||
<el-drawer
|
||||
:modal-append-to-body="false"
|
||||
:append-to-body="true"
|
||||
:visible.sync="descDialogVisible"
|
||||
direction="rtl"
|
||||
size="50%"
|
||||
title="福利详情">
|
||||
<el-card shadow="never" style="margin: 20px">
|
||||
<div v-html="descData"></div>
|
||||
</el-card>
|
||||
</el-drawer>
|
||||
|
||||
<address-dialog ref="addressDialog" @select_user_address="selectUserAddress"></address-dialog>
|
||||
</div>
|
||||
`,
|
||||
<el-row class="mt20" justify="end" type="flex">
|
||||
<el-button @click="$emit('go_back')">关闭</el-button>
|
||||
<el-button @click="doChoose" type="primary" v-if="!is_view">确定</el-button>
|
||||
</el-row>
|
||||
<el-drawer
|
||||
:modal-append-to-body="false"
|
||||
:append-to-body="true"
|
||||
:visible.sync="descDialogVisible"
|
||||
direction="rtl"
|
||||
size="50%"
|
||||
title="福利详情">
|
||||
<el-card shadow="never" style="margin: 20px">
|
||||
<div v-html="descData"></div>
|
||||
</el-card>
|
||||
</el-drawer>
|
||||
|
||||
<address-dialog ref="addressDialog" @select_user_address="selectUserAddress"></address-dialog>
|
||||
</div>
|
||||
`,
|
||||
store,
|
||||
props: {
|
||||
is_view: {
|
||||
@@ -428,4 +428,4 @@ let CHOOSE_WELFARE = {
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -147,7 +147,7 @@ layout("/layouts/platform.html"){
|
||||
return { text: "选择已结束", disabled: true }
|
||||
} else {
|
||||
if (now > this.$moment(choiceTimeStart).valueOf() && now < this.$moment(overdueChoiceTimeEnd).valueOf()) {
|
||||
return { text: isChoose ? "确定修改" : "确定选择", disabled: false }
|
||||
return { text: isChoose ? "修改" : "确定选择", disabled: false }
|
||||
} else if (now > this.$moment(overdueChoiceTimeEnd).valueOf()) {
|
||||
return { text: "选择已结束", disabled: true }
|
||||
} else if (now < this.$moment(choiceTimeStart).valueOf()) {
|
||||
|
||||
@@ -0,0 +1,250 @@
|
||||
const addUser = {
|
||||
template: /*language=HTML*/ `
|
||||
<el-dialog title="添加用户" :visible.sync="visible" width="80%">
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="姓名">
|
||||
<el-input @keyup.enter.native="doSearch" clearable placeholder="请输入姓名"
|
||||
style="width: 100%" v-model="pageForm.userName">
|
||||
</el-input>
|
||||
</search-item>
|
||||
|
||||
<search-item label="工号">
|
||||
<el-input @keyup.enter.native="doSearch" clearable placeholder="请输入工号"
|
||||
style="width: 100%" v-model="pageForm.loginName">
|
||||
</el-input>
|
||||
</search-item>
|
||||
|
||||
<search-item label="性别">
|
||||
<el-select clearable placeholder="请选择性别" style="width: 100%" v-model="pageForm.sex">
|
||||
<el-option :key="sex" :label="sex" :value="sex"
|
||||
v-for="sex in sexOptions"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
|
||||
<search-item label="出生日期">
|
||||
<el-date-picker
|
||||
v-model="pageForm.birthday"
|
||||
type="date"
|
||||
placeholder="选择出生日期"
|
||||
value-format="yyyy-MM-dd"
|
||||
style="width: 100%">
|
||||
</el-date-picker>
|
||||
</search-item>
|
||||
|
||||
<search-item label="出生月份">
|
||||
<el-select
|
||||
v-model="pageForm.birthMonths"
|
||||
multiple
|
||||
collapse-tags
|
||||
placeholder="请选择出生月份"
|
||||
style="width: 100%">
|
||||
<el-option
|
||||
v-for="month in 12"
|
||||
:key="month"
|
||||
:label="month + '月'"
|
||||
:value="month">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
|
||||
<search-item label="所属工会">
|
||||
<el-select clearable filterable placeholder="请选择工会"
|
||||
style="width: 100%"
|
||||
@change="unionIdChange"
|
||||
v-model="pageForm.unionId">
|
||||
<el-option
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
v-for="item in unionOptions">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
|
||||
<search-item label="所属单位">
|
||||
<el-select clearable
|
||||
filterable
|
||||
multiple
|
||||
collapse-tags
|
||||
placeholder="请选择单位" style="width: 100%"
|
||||
v-model="pageForm.unitIds">
|
||||
<el-option
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
v-for="item in unitOptions">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
|
||||
<search-item label="人员类型:">
|
||||
<dict-select clearable code="USER_PERSON_TYPE"
|
||||
multiple
|
||||
collapse-tags
|
||||
placeholder="请选择人员类型"
|
||||
v-model="pageForm.personTypes"></dict-select>
|
||||
</search-item>
|
||||
|
||||
<search-item label="聘用方式:">
|
||||
<dict-select clearable code="USER_PREPARED_BY_TYPE"
|
||||
multiple
|
||||
collapse-tags
|
||||
placeholder="请选择聘用方式"
|
||||
v-model="pageForm.preparedBys"></dict-select>
|
||||
</search-item>
|
||||
|
||||
<search-item label="在职状态:">
|
||||
<dict-select clearable code="USER_STATE"
|
||||
multiple
|
||||
collapse-tags
|
||||
placeholder="请选择人员状态"
|
||||
v-model="pageForm.userStates"></dict-select>
|
||||
</search-item>
|
||||
<search-item label="是否会员">
|
||||
<el-select clearable placeholder="请选择是否会员" style="width: 100%"
|
||||
v-model="pageForm.isMember">
|
||||
<el-option label="全部" :value="null"></el-option>
|
||||
<el-option label="是" :value="true"></el-option>
|
||||
<el-option label="否" :value="false"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
</search>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never">
|
||||
<el-table :data="tableData"
|
||||
:size="tableSize"
|
||||
@sort-change="pageOrder"
|
||||
ref="tableRef"
|
||||
row-key="id"
|
||||
style="width: 100%">
|
||||
<el-table-column
|
||||
:index="indexMethod"
|
||||
label="序号"
|
||||
type="index"
|
||||
width="80px"
|
||||
></el-table-column>
|
||||
|
||||
<el-table-column
|
||||
:key="column.prop"
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
:width="column.width"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip
|
||||
v-for="column in tableColumns"
|
||||
>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
<template #footer>
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="onSubmit">确定</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
`,
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
projectId: null,
|
||||
pageForm: {
|
||||
userName: null,
|
||||
loginName: null,
|
||||
sex: null,
|
||||
birthday: null,
|
||||
birthMonths: [],
|
||||
unionId: null,
|
||||
unitIds: [],
|
||||
personTypes: [],
|
||||
preparedBys: [],
|
||||
userStates: [],
|
||||
isMember: null
|
||||
},
|
||||
sexOptions: ["男", "女"],
|
||||
unionOptions: [],
|
||||
unitOptions: [],
|
||||
tableColumns: [
|
||||
{ prop: "loginname", label: "工号" },
|
||||
{ prop: "username", label: "姓名" },
|
||||
{ prop: "sex", label: "性别", sortable: true, checked: 0 },
|
||||
{ prop: "birthday", label: "出生日期", sortable: true, checked: 0 },
|
||||
{ prop: "personType", label: "人员类型", sortable: true },
|
||||
{ prop: "preparedBy", label: "聘用方式", sortable: true },
|
||||
{ prop: "userState", label: "在职状态", sortable: true },
|
||||
{ prop: "unionName", label: "所属工会", sortable: true },
|
||||
{ prop: "unitName", label: "所属单位", sortable: true }
|
||||
]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async onOpen(id) {
|
||||
this.visible = true
|
||||
this.resetPageForm()
|
||||
this.pageForm.projectId = id
|
||||
this.unionOptions = await this.$businessTool.listUnion()
|
||||
this.unitOptions = await this.$businessTool.listUnit()
|
||||
this.pageData()
|
||||
},
|
||||
|
||||
resetPageForm() {
|
||||
this.pageForm.userName = null
|
||||
this.pageForm.loginName = null
|
||||
this.pageForm.sex = null
|
||||
this.pageForm.birthday = null
|
||||
this.pageForm.birthMonths = []
|
||||
this.pageForm.unionId = null
|
||||
this.pageForm.unitIds = []
|
||||
this.pageForm.personTypes = []
|
||||
this.pageForm.preparedBys = []
|
||||
this.pageForm.userStates = []
|
||||
this.pageForm.isMember = null
|
||||
},
|
||||
|
||||
async unionIdChange(val) {
|
||||
if (val) {
|
||||
this.unitOptions = await this.$businessTool.listUnit(val)
|
||||
} else {
|
||||
this.pageForm.unitIds = []
|
||||
}
|
||||
},
|
||||
|
||||
pageData() {
|
||||
this.$axios
|
||||
.post("/platform/welfare/list/mange/notWelfareUserPageData", {
|
||||
pageForm: JSON.stringify(this.pageForm)
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.tableData = res.data.list
|
||||
this.pageForm.totalCount = res.data.totalCount
|
||||
} else {
|
||||
this.$message.error(res.msg)
|
||||
}
|
||||
})
|
||||
},
|
||||
onSubmit() {
|
||||
this.$confirm("当前筛选出" + this.pageForm.totalCount + "条数据,您确认添加到福利名单吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(async () => {
|
||||
const { code, data, msg } = await this.$axios.post("/platform/welfare/list/mange/addWelfareUser", {
|
||||
pageForm: JSON.stringify(this.pageForm),
|
||||
projectId: this.projectId
|
||||
})
|
||||
if (code === 0) {
|
||||
this.$message.success(msg)
|
||||
this.visible = false
|
||||
this.$emit("refresh")
|
||||
} else {
|
||||
this.$message.error(msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,234 +6,208 @@ layout("/layouts/platform.html"){
|
||||
<guava ref="guava">
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
|
||||
<search @search="doSearch">
|
||||
<search-item label="所属年份">
|
||||
<el-date-picker
|
||||
:clearable="false"
|
||||
placeholder="所属年份"
|
||||
style="width: 100%"
|
||||
type="year"
|
||||
v-model="pageForm.year"
|
||||
value-format="yyyy"
|
||||
:clearable="false"
|
||||
placeholder="所属年份"
|
||||
style="width: 100%"
|
||||
type="year"
|
||||
v-model="pageForm.year"
|
||||
value-format="yyyy"
|
||||
></el-date-picker>
|
||||
</search-item>
|
||||
|
||||
<search-item label="职工信息">
|
||||
<el-input @keyup.enter.native="doSearch" clearable placeholder="请输入内容"
|
||||
style="width: 100%" v-model="pageForm.searchKeyword">
|
||||
<el-select slot="prepend" style="width: 80px;"
|
||||
v-model="pageForm.searchName">
|
||||
<el-option label="姓名" value="username"></el-option>
|
||||
<el-option label="工号" value="loginname"></el-option>
|
||||
</el-select>
|
||||
</el-input>
|
||||
<search-item label="福利项目">
|
||||
<el-select :clearable="false" filterable placeholder="请选择福利项目" style="width: 100%" v-model="pageForm.projectId">
|
||||
<el-option :key="item.id" :label="item.name" :value="item.id" v-for="item in projectSelectOptions"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
|
||||
<search-item label="福利项目">
|
||||
<el-select :clearable="false" filterable
|
||||
placeholder="请选择福利项目"
|
||||
style="width: 100%"
|
||||
v-model="pageForm.projectId">
|
||||
<el-option
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
v-for="item in projectSelectOptions">
|
||||
</el-option>
|
||||
<search-item label="姓名">
|
||||
<el-input
|
||||
@keyup.enter.native="doSearch"
|
||||
clearable
|
||||
placeholder="请输入姓名"
|
||||
style="width: 100%"
|
||||
v-model="pageForm.userName"
|
||||
></el-input>
|
||||
</search-item>
|
||||
|
||||
<search-item label="工号">
|
||||
<el-input
|
||||
@keyup.enter.native="doSearch"
|
||||
clearable
|
||||
placeholder="请输入工号"
|
||||
style="width: 100%"
|
||||
v-model="pageForm.loginName"
|
||||
></el-input>
|
||||
</search-item>
|
||||
|
||||
<search-item label="性别">
|
||||
<el-select clearable placeholder="请选择性别" style="width: 100%" v-model="pageForm.sex">
|
||||
<el-option :key="sex" :label="sex" :value="sex" v-for="sex in sexOptions"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
|
||||
<search-item label="出生日期">
|
||||
<el-date-picker
|
||||
v-model="pageForm.birthday"
|
||||
type="date"
|
||||
placeholder="选择出生日期"
|
||||
value-format="yyyy-MM-dd"
|
||||
style="width: 100%"
|
||||
></el-date-picker>
|
||||
</search-item>
|
||||
|
||||
<search-item label="出生月份">
|
||||
<el-select v-model="pageForm.birthMonths" multiple collapse-tags placeholder="请选择出生月份" style="width: 100%">
|
||||
<el-option v-for="month in 12" :key="month" :label="month + '月'" :value="month"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
|
||||
<search-item label="所属工会">
|
||||
<el-select clearable filterable placeholder="请选择工会"
|
||||
style="width: 100%"
|
||||
v-model="pageForm.unionId">
|
||||
<el-option
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
v-for="item in unionList">
|
||||
</el-option>
|
||||
<el-select clearable filterable placeholder="请选择工会" style="width: 100%" v-model="pageForm.unionId">
|
||||
<el-option :key="item.id" :label="item.name" :value="item.id" v-for="item in unionOptions"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
|
||||
<search-item label="所属单位">
|
||||
<el-select clearable filterable multiple
|
||||
placeholder="请选择单位" style="width: 100%"
|
||||
v-model="pageForm.unitIds">
|
||||
<el-option
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
v-for="item in unitList">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
|
||||
<search-item label="性别">
|
||||
<el-select clearable placeholder="请选择性别" style="width: 100%"
|
||||
v-model="pageForm.sex">
|
||||
<el-option :key="sex" :label="sex" :value="sex"
|
||||
v-for="sex in sexOptions"></el-option>
|
||||
<el-select
|
||||
clearable
|
||||
filterable
|
||||
multiple
|
||||
collapse-tags
|
||||
placeholder="请选择单位"
|
||||
style="width: 100%"
|
||||
v-model="pageForm.unitIds"
|
||||
>
|
||||
<el-option :key="item.id" :label="item.name" :value="item.id" v-for="item in unitOptions"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
|
||||
<search-item label="人员类型:">
|
||||
<dict-select clearable code="PERSON_TYPE" multiple placeholder="请选择人员类型"
|
||||
v-model="pageForm.personTypes"></dict-select>
|
||||
<dict-select
|
||||
clearable
|
||||
code="USER_PERSON_TYPE"
|
||||
multiple
|
||||
collapse-tags
|
||||
placeholder="请选择人员类型"
|
||||
v-model="pageForm.personTypes"
|
||||
></dict-select>
|
||||
</search-item>
|
||||
<search-item label="在职状态:">
|
||||
<dict-select clearable code="USER_STATE" multiple placeholder="请选择人员状态"
|
||||
v-model="pageForm.userStates"></dict-select>
|
||||
</search-item>
|
||||
<search-item label="所选福利:">
|
||||
<el-select clearable placeholder="请选择所选福利" style="width: 100%"
|
||||
v-model="pageForm.optionId">
|
||||
<el-option :key="item.id" :label="item.optionName" :value="item.id"
|
||||
v-for="item in pageFormProject"></el-option>
|
||||
</el-select>
|
||||
<dict-select
|
||||
clearable
|
||||
code="USER_STATE"
|
||||
multiple
|
||||
collapse-tags
|
||||
placeholder="请选择人员状态"
|
||||
v-model="pageForm.userStates"
|
||||
></dict-select>
|
||||
</search-item>
|
||||
|
||||
|
||||
<!-- <search-item label="所选福利:">-->
|
||||
<!-- <el-select clearable placeholder="请选择所选福利" style="width: 100%" v-model="pageForm.optionId">-->
|
||||
<!-- <el-option :key="item.id" :label="item.optionName" :value="item.id" v-for="item in pageFormProject"></el-option>-->
|
||||
<!-- </el-select>-->
|
||||
<!-- </search-item>-->
|
||||
</search>
|
||||
|
||||
|
||||
</el-card>
|
||||
|
||||
<el-card class="mt10" shadow="never">
|
||||
<table-tool :app="this" label="福利名单">
|
||||
<!-- <el-button :disabled="pageFormProjectType!==3"-->
|
||||
<!-- @click="doExcelByOptionId"-->
|
||||
<!-- icon="el-icon-printer" size="small"-->
|
||||
<!-- type="primary"-->
|
||||
<!-- v-if="$auth.hasRoleOr(['SYSADMIN','SCHOOL_UNION_ADMIN','SCHOOL_UNION_WELFARE_ADMIN','SCHOOL_UNION_MEMBER_ADMIN'])">-->
|
||||
<!-- 导出报销表-->
|
||||
<!-- </el-button>-->
|
||||
<!-- <el-button :disabled="pageFormProjectType!==3"-->
|
||||
<!-- @click="openImportExpressExcel"-->
|
||||
<!-- icon="el-icon-printer" size="small"-->
|
||||
<!-- type="primary"-->
|
||||
<!-- v-if="$auth.hasRoleOr(['SYSADMIN','SCHOOL_UNION_ADMIN','SCHOOL_UNION_WELFARE_ADMIN','SCHOOL_UNION_MEMBER_ADMIN'])">-->
|
||||
<!-- 导入快递单号-->
|
||||
<!-- </el-button>-->
|
||||
|
||||
<el-button :disabled="!pageForm.projectId" @click="openImport"
|
||||
icon="el-icon-document-add"
|
||||
size="small"
|
||||
type="primary">导入名单
|
||||
<el-button :disabled="!pageForm.projectId" @click="openImport" icon="el-icon-document-add" size="small" type="primary">
|
||||
导入名单
|
||||
</el-button>
|
||||
<el-button :disabled="!pageForm.projectId" @click="openWelfareListUser"
|
||||
icon="el-icon-document-add"
|
||||
size="small"
|
||||
type="primary">添加人员
|
||||
<el-button
|
||||
:disabled="!pageForm.projectId"
|
||||
@click="$refs.addUserRef.onOpen(pageForm.projectId)"
|
||||
icon="el-icon-document-add"
|
||||
size="small"
|
||||
type="primary"
|
||||
>
|
||||
添加人员
|
||||
</el-button>
|
||||
</table-tool>
|
||||
|
||||
<el-table :data="tableData" :size="tableSize"
|
||||
@sort-change="pageOrder" class="vi-table"
|
||||
ref="table" row-key="id" style="width: 100%"
|
||||
v-loading="tableLoading">
|
||||
<el-table-column :index="indexMethod" align="center" header-align="center"
|
||||
label="序号" type="index"
|
||||
width="80px"></el-table-column>
|
||||
<el-table
|
||||
:data="tableData"
|
||||
:size="tableSize"
|
||||
@sort-change="pageOrder"
|
||||
ref="tableRef"
|
||||
row-key="id"
|
||||
style="width: 100%"
|
||||
v-loading="tableLoading"
|
||||
>
|
||||
<el-table-column :index="indexMethod" label="序号" type="index" width="80px"></el-table-column>
|
||||
|
||||
<el-table-column
|
||||
:key="column.prop"
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
:width="column.width"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip
|
||||
v-for="column in tableColumns">
|
||||
:key="column.prop"
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
:width="column.width"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip
|
||||
v-for="column in tableColumns"
|
||||
>
|
||||
<template scope="{row}" v-if="column.prop=='isChoose'">
|
||||
<span class="text-primary" v-if="row.isChoose">已选择</span>
|
||||
<span class="text-danger" v-else>未选择</span>
|
||||
</template>
|
||||
<template scope="{row}" v-else-if="column.prop=='gist_list'">
|
||||
{{row.gist_list?row.gist_list:'暂无'}}
|
||||
</template>
|
||||
<template scope="{row}" v-else-if="column.prop=='gist_list'">{{row.gist_list?row.gist_list:'暂无'}}</template>
|
||||
<template scope="{row}" v-else-if="column.prop=='userSign'">
|
||||
<el-image :src="row.userSign"
|
||||
fit="cover"
|
||||
style="height: 60px" v-if="row.userSign"></el-image>
|
||||
<el-image :src="row.userSign" fit="cover" style="height: 60px" v-if="row.userSign"></el-image>
|
||||
<el-tag type="warning" v-else>暂无</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="快递单号" prop="courierNumber" show-overflow-tooltip
|
||||
v-if="pageFormProjectType===3">
|
||||
<el-table-column label="快递单号" prop="courierNumber" show-overflow-tooltip v-if="pageFormProjectType===3">
|
||||
<template scope="{row}">
|
||||
<span @click="viewCourierNumber(row)" class="text-primary"
|
||||
style="cursor: pointer">点击查看</span>
|
||||
<span @click="viewCourierNumber(row)" class="text-primary" style="cursor: pointer">点击查看</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="收货地址" prop="receiveAddress" show-overflow-tooltip
|
||||
v-if="pageFormProjectType===3"></el-table-column>
|
||||
<el-table-column align="center" fixed="right"
|
||||
header-align="center" label="操作"
|
||||
width="200px">
|
||||
<el-table-column label="收货地址" prop="receiveAddress" show-overflow-tooltip v-if="pageFormProjectType===3"></el-table-column>
|
||||
<el-table-column align="center" fixed="right" header-align="center" label="操作" width="100px">
|
||||
<template scope="{row}">
|
||||
<el-button @click="openEditWelfare(row)" size="mini" type="primary"
|
||||
v-if="pageFormSignMode!==1">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button @click="doDelete(row)" size="mini" type="danger"
|
||||
v-if="$auth.hasRoleOr(['SYSADMIN','SCHOOL_UNION_ADMIN','SCHOOL_UNION_WELFARE_ADMIN','SCHOOL_UNION_MEMBER_ADMIN'])">
|
||||
删除
|
||||
</el-button>
|
||||
<el-button @click="doDelete(row)" size="mini" type="danger">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
|
||||
</el-card>
|
||||
|
||||
</template>
|
||||
</guava>
|
||||
|
||||
<edit-welfare-dialog :welfare_options="pageFormProject" ref="editWelfare"
|
||||
:project_type="pageFormProjectType"
|
||||
@do_search="doSearch"></edit-welfare-dialog>
|
||||
|
||||
<import-courier-number-dialog ref="importCourierNumber"></import-courier-number-dialog>
|
||||
<!--快递物流信息-->
|
||||
<courier-number-info ref="courierNumberInfo"></courier-number-info>
|
||||
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="importDialog"
|
||||
title="福利名单导入"
|
||||
width="50%"
|
||||
>
|
||||
<file-import ref="viewImport" temp_url="/platform/welfare/list/mange/downloadImport"
|
||||
post_url="/platform/welfare/list/mange/doImport" is_show_radio
|
||||
@flush="successImport" :business_id="pageForm.projectId"
|
||||
<el-dialog :close-on-click-modal="false" :visible.sync="importDialog" title="福利名单导入" width="50%">
|
||||
<file-import
|
||||
ref="viewImport"
|
||||
temp_url="/platform/welfare/list/mange/downloadImport"
|
||||
post_url="/platform/welfare/list/mange/doImport"
|
||||
is_show_radio
|
||||
@flush="successImport"
|
||||
:business_id="pageForm.projectId"
|
||||
></file-import>
|
||||
|
||||
</el-dialog>
|
||||
|
||||
<add_welfare_list_by_select ref="addWelfareListUser" @search="doSearch"></add_welfare_list_by_select>
|
||||
|
||||
<add_welfare_list_by_select ref="addWelfareListUser" @search="doSearch"></add_welfare_list_by_select>
|
||||
|
||||
|
||||
|
||||
|
||||
<add-user ref="addUserRef" @refresh="doSearch"></add-user>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
<!--#include("editWelfareDialog.js"){}#-->
|
||||
<!--#include("importCourierNumberDialog.js"){}#-->
|
||||
<!--#include("addWelfareListBySelect.js"){}#-->
|
||||
<!--#include("/platform/zhgh/welfare/mine/CourierNumberInfo.js"){}#-->
|
||||
<!--#include("addUser.js"){}#-->
|
||||
new Vue({
|
||||
el: '#app',
|
||||
el: "#app",
|
||||
store,
|
||||
mixins: [initTableMixins],
|
||||
computed: {
|
||||
pageFormProjectType() {
|
||||
if (this.pageForm.projectId) {
|
||||
const projectInfo = this.projectSelectOptions.find(v => v.id === this.pageForm.projectId)
|
||||
const projectInfo = this.projectSelectOptions.find((v) => v.id === this.pageForm.projectId)
|
||||
if (projectInfo) {
|
||||
return projectInfo.provideMode
|
||||
}
|
||||
@@ -243,7 +217,7 @@ layout("/layouts/platform.html"){
|
||||
},
|
||||
pageFormSignMode() {
|
||||
if (this.pageForm.projectId) {
|
||||
const projectInfo = this.projectSelectOptions.find(v => v.id === this.pageForm.projectId)
|
||||
const projectInfo = this.projectSelectOptions.find((v) => v.id === this.pageForm.projectId)
|
||||
if (projectInfo) {
|
||||
return projectInfo.signMode
|
||||
}
|
||||
@@ -253,57 +227,52 @@ layout("/layouts/platform.html"){
|
||||
},
|
||||
pageFormProject() {
|
||||
if (this.pageForm.projectId) {
|
||||
const projectInfo = this.projectSelectOptions.find(v => v.id === this.pageForm.projectId)
|
||||
const projectInfo = this.projectSelectOptions.find((v) => v.id === this.pageForm.projectId)
|
||||
if (projectInfo) {
|
||||
return projectInfo.optionList
|
||||
}
|
||||
return null
|
||||
}
|
||||
return null
|
||||
},
|
||||
}
|
||||
},
|
||||
components: {
|
||||
"edit-welfare-dialog": EDIT_WELFARE_DIALOG,
|
||||
"import-courier-number-dialog": IMPORT_COURIER_NUMBER_DIALOG,
|
||||
"courier-number-info": COURIER_NUMBER_INFO,
|
||||
"add_welfare_list_by_select": ADD_WELFARE_LIST_BY_SELECT,
|
||||
"file-import": httpVueLoader("/components/plugins/sysImport/index.vue?v=" + new Date().getTime())
|
||||
add_welfare_list_by_select: ADD_WELFARE_LIST_BY_SELECT,
|
||||
"file-import": httpVueLoader("/components/plugins/sysImport/index.vue?v=" + new Date().getTime()),
|
||||
"add-user": addUser
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
pageForm: {
|
||||
searchName: "username",
|
||||
year: moment().format('YYYY')
|
||||
year: new Date().getFullYear().toString()
|
||||
},
|
||||
unionList: [],
|
||||
unitList: [],
|
||||
unionOptions: [],
|
||||
unitOptions: [],
|
||||
sexOptions: ["男", "女"],
|
||||
projectSelectOptions: [],
|
||||
tableColumns: [
|
||||
{ prop: "loginname", label: "工号" },
|
||||
{ prop: "username", label: "姓名" },
|
||||
// {prop: 'sex', label: '性别', sortable: true, checked: 0},
|
||||
{ prop: "sex", label: "性别", sortable: true, checked: 0 },
|
||||
{ prop: "birthday", label: "出生日期", sortable: true, checked: 0 },
|
||||
{ prop: "personType", label: "人员类型", sortable: true },
|
||||
{ prop: "preparedBy", label: "聘用方式", sortable: true },
|
||||
{ prop: "userState", label: "在职状态", sortable: true },
|
||||
{ prop: "unionname", label: "所属工会", sortable: true },
|
||||
{ prop: "unitname", label: "所属单位", sortable: true }
|
||||
// {prop: 'isChoose', label: '是否选择', sortable: true},
|
||||
// {prop: 'gist_list', label: '所选福利'},
|
||||
// {prop: 'userSign', label: '签字', width: "100"},
|
||||
{ prop: "welfareUnionName", label: "所属工会", sortable: true },
|
||||
{ prop: "welfareUnitName", label: "所属单位", sortable: true }
|
||||
],
|
||||
|
||||
importData: { fileList: [], isfg: 1 },
|
||||
importLoading: false,
|
||||
importDialog: false,
|
||||
|
||||
welfareListUserDrawer:false,
|
||||
|
||||
welfareListUserDrawer: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
openWelfareListUser(){
|
||||
console.log(this.$refs)
|
||||
this.$refs.addWelfareListUser.welfareListUserDrawer=true
|
||||
openWelfareListUser() {
|
||||
this.$refs.addWelfareListUser.welfareListUserDrawer = true
|
||||
this.$refs.addWelfareListUser.selectNotWelfareList(this.pageForm.projectId)
|
||||
},
|
||||
successImport() {
|
||||
@@ -328,11 +297,11 @@ layout("/layouts/platform.html"){
|
||||
},
|
||||
doExcelByOptionId() {
|
||||
if (!this.pageForm.optionId) {
|
||||
this.$message.warning('请选择要导出的套餐')
|
||||
this.$message.warning("请选择要导出的套餐")
|
||||
return
|
||||
}
|
||||
if (!this.pageForm.projectId) {
|
||||
this.$message.warning('请选择要导出的福利')
|
||||
this.$message.warning("请选择要导出的福利")
|
||||
return
|
||||
}
|
||||
this.$downLoad("/platform/welfare/list/mange/doExcelByOptionId", {
|
||||
@@ -344,28 +313,22 @@ layout("/layouts/platform.html"){
|
||||
this.$refs.editWelfare.openEditWelfare(row, this.projectSelectOptions)
|
||||
},
|
||||
doDelete(row) {
|
||||
this.$confirm('确定要移除吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
callback: async (a, b) => {
|
||||
if ("confirm" == a) {//确认后再执行
|
||||
const resp = await this.$axios.post("/platform/welfare/list/mange/delete", {
|
||||
id: row.listId,
|
||||
userId: row.id,
|
||||
projectId: this.pageForm.projectId,
|
||||
});
|
||||
if (resp.code === 0) {
|
||||
this.doSearch()
|
||||
} else {
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
}
|
||||
this.$confirm("您确定要删除吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(async () => {
|
||||
const resp = await this.$axios.post("/platform/welfare/list/mange/delete", { id: row.id })
|
||||
if (resp.code === 0) {
|
||||
this.$message.success(resp.msg)
|
||||
this.doSearch()
|
||||
} else {
|
||||
this.$message.error(resp.msg)
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
getWelfareList() {
|
||||
this.$axios.post("/platform/welfare/project/mange/getWelfareList", {year: this.pageForm.year}).then(res => {
|
||||
this.$axios.post("/platform/welfare/project/mange/getWelfareList", { year: this.pageForm.year }).then((res) => {
|
||||
this.projectSelectOptions = res.data
|
||||
if (res.data && res.data.length > 0) {
|
||||
this.$set(this.pageForm, "projectId", res.data[0].id)
|
||||
@@ -374,27 +337,28 @@ layout("/layouts/platform.html"){
|
||||
},
|
||||
pageData() {
|
||||
this.tableLoading = true
|
||||
const pageForm = clone(this.pageForm)
|
||||
pageForm.unitIds = JSON.stringify(pageForm.unitIds)
|
||||
pageForm.personTypes = JSON.stringify(pageForm.personTypes)
|
||||
pageForm.userStates = JSON.stringify(pageForm.userStates)
|
||||
this.$axios.post("/platform/welfare/list/mange/pageData", pageForm).then((res) => {
|
||||
this.tableLoading = false
|
||||
this.tableData = res.data.list
|
||||
this.pageForm.totalCount = res.data.totalCount
|
||||
})
|
||||
},
|
||||
this.$axios
|
||||
.post("/platform/welfare/list/mange/pageData", {
|
||||
pageForm: JSON.stringify(this.pageForm)
|
||||
})
|
||||
.then((res) => {
|
||||
this.tableData = res.data.list
|
||||
this.pageForm.totalCount = res.data.totalCount
|
||||
})
|
||||
.finally(() => {
|
||||
this.tableLoading = false
|
||||
})
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.getWelfareList()
|
||||
this.unionList = await this.$businessTool.listUnion()
|
||||
this.unitList = await this.$businessTool.listUnit()
|
||||
this.unionOptions = await this.$businessTool.listUnion()
|
||||
this.unitOptions = await this.$businessTool.listUnit()
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
|
||||
@@ -2,230 +2,114 @@
|
||||
layout("/layouts/platform_h5.html"){
|
||||
#-->
|
||||
<style>
|
||||
.van-card {
|
||||
background: transparent;
|
||||
/* 列表卡片样式 */
|
||||
.wf-welfare-list {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.address-cell .van-cell__title {
|
||||
width: 0 !important;
|
||||
}
|
||||
|
||||
.van-cell-group--inset {
|
||||
margin: 10px 16px !important;
|
||||
.wf-welfare-card {
|
||||
position: relative;
|
||||
background: #fff;
|
||||
border-radius: 8px;
|
||||
margin-bottom: 15px;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.logistics_cell {
|
||||
/* 左右布局容器 */
|
||||
.wf-card-layout {
|
||||
display: flex;
|
||||
padding: 15px;
|
||||
}
|
||||
/* 左侧图片容器 */
|
||||
.wf-card-img-container {
|
||||
width: 120px;
|
||||
height: 120px;
|
||||
flex-shrink: 0;
|
||||
margin-right: 15px;
|
||||
}
|
||||
/* 右侧信息容器 */
|
||||
.wf-card-content {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.logistics_cell .van-step__title {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.logistics_cell .van-step__title h3 {
|
||||
margin: 0;
|
||||
font-weight: normal;
|
||||
font-size: inherit;
|
||||
}
|
||||
|
||||
.evaluateForm .evaluateTextField .van-field__label {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.evaluateForm .evaluateTextField .van-field__value textarea {
|
||||
padding: 10px;
|
||||
background-color: #f3f3f3;
|
||||
}
|
||||
|
||||
.van-action-sheet__header {
|
||||
/* 标题样式 */
|
||||
.wf-card-heading {
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
margin-bottom: 8px;
|
||||
color: #333;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.courierNumberSheet .van-empty {
|
||||
position: relative;
|
||||
left: unset !important;
|
||||
top: unset !important;
|
||||
transform: unset !important;
|
||||
/* 时间信息样式 */
|
||||
.wf-time-row {
|
||||
font-size: 14px;
|
||||
color: #666;
|
||||
margin-bottom: 5px;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
width: 100%;
|
||||
}
|
||||
.wf-time-label {
|
||||
color: #999;
|
||||
display: inline-block;
|
||||
width: 70px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<div>
|
||||
<van-sticky>
|
||||
<van-nav-bar
|
||||
@click-left="()=>this.$pjaxReplace('/platform/h5/home')"
|
||||
left-arrow
|
||||
left-text="返回"
|
||||
placeholder
|
||||
title="我的福利"
|
||||
></van-nav-bar>
|
||||
<van-dropdown-menu>
|
||||
<year-van-dropdown-item :num="5" @change="doSearch" v-model="pageForm.year"></year-van-dropdown-item>
|
||||
</van-dropdown-menu>
|
||||
</van-sticky>
|
||||
<van-sticky>
|
||||
<van-nav-bar @click-left="()=>this.$pjaxReplace('/platform/h5/home')" left-arrow left-text="返回" placeholder title="我的福利"></van-nav-bar>
|
||||
<van-dropdown-menu>
|
||||
<year-van-dropdown-item :num="5" @change="doSearch" v-model="pageForm.year"></year-van-dropdown-item>
|
||||
</van-dropdown-menu>
|
||||
</van-sticky>
|
||||
|
||||
<div>
|
||||
<van-list :finished="finished" @load="pageData" finished-text="没有更多了" v-if="tableData.length>0" v-model="loading">
|
||||
<div class="table-list">
|
||||
<div :key="row.id" class="table-card" v-for="row in tableData">
|
||||
<van-tag :type="row.isChoose?'success':''" mark style="position: absolute; left: 5px; top: 5px; z-index: 1">
|
||||
{{row.isChoose?'已选择':'未选择'}}
|
||||
</van-tag>
|
||||
<div>
|
||||
<van-image :src="row.cover" fit="cover" height="200" v-if="row.cover" width="100%"></van-image>
|
||||
<van-image src="/assets/mobile/svg/welfare/welfareHome.svg" style="width: 88px; height: 88px" v-else></van-image>
|
||||
<div>
|
||||
<van-list :finished="finished" @load="pageData" finished-text="没有更多了" v-if="tableData.length>0" v-model="loading">
|
||||
<div class="wf-welfare-list">
|
||||
<div class="wf-welfare-card" v-for="row in tableData" :key="row.id" @click="openView(row)">
|
||||
<van-tag mark :type="row.isChoose?'success':''" style="position: absolute; left: 5px; top: 5px; z-index: 1">
|
||||
{{row.isChoose?'已选择':'未选择'}}
|
||||
</van-tag>
|
||||
<div class="wf-card-layout">
|
||||
<div class="wf-card-img-container">
|
||||
<van-image :src="row.cover" fit="cover" width="100%" height="100%" radius="4"></van-image>
|
||||
</div>
|
||||
<div class="wf-card-content">
|
||||
<div class="wf-card-heading">{{row.name}}</div>
|
||||
<div class="wf-time-row">
|
||||
<span class="wf-time-label">开始时间:</span>
|
||||
{{row.choiceTimeStart}}
|
||||
</div>
|
||||
<div class="wf-time-row">
|
||||
<span class="wf-time-label">结束时间:</span>
|
||||
{{row.choiceTimeEnd}}
|
||||
</div>
|
||||
</div>
|
||||
<van-cell>
|
||||
<template slot="title">
|
||||
<div class="flex-align">
|
||||
<span class="font-size3 bold">{{row.name}}</span>
|
||||
</div>
|
||||
</template>
|
||||
</van-cell>
|
||||
<template v-if="row.gifts">
|
||||
<van-cell :key="gift.name" :title="gift.name" v-for="gift in row.gifts">
|
||||
<template #right-icon>x{{gift.num}}</template>
|
||||
</van-cell>
|
||||
</template>
|
||||
<van-cell class="table-card-footer">
|
||||
<van-button @click="openEvaluate(row)" plain round size="small" type="primary">评价商品</van-button>
|
||||
<van-button @click="openView(row)" plain round size="small" type="primary">查看详情</van-button>
|
||||
</van-cell>
|
||||
</div>
|
||||
</div>
|
||||
</van-list>
|
||||
<van-empty image="/assets/platform/plugins/vant-green/images/nodata/nodata.png" description="暂无数据" v-else></van-empty>
|
||||
</div>
|
||||
|
||||
<van-action-sheet title="查看详情" v-model="descPopup">
|
||||
<div class="van-cell-group--inset">
|
||||
<van-cell>
|
||||
<template #title>
|
||||
<div style="font-weight: bold; font-size: 15px">已选福利</div>
|
||||
</template>
|
||||
</van-cell>
|
||||
<van-cell style="padding: 0">
|
||||
<van-card
|
||||
:key="item.id"
|
||||
:num="item.selectNum"
|
||||
:thumb="item.imgUrl"
|
||||
:title="item.optionName"
|
||||
style="border-radius: 8px; background: #ffffff"
|
||||
v-for="item in selectedOptions"
|
||||
>
|
||||
<template #desc>
|
||||
<div>{{item.supplier}}</div>
|
||||
<div>{{item.simpleDesc}}</div>
|
||||
</template>
|
||||
</van-card>
|
||||
</van-cell>
|
||||
</div>
|
||||
|
||||
<!--邮寄到家 填写收货地址-->
|
||||
<div class="van-cell-group--inset" v-if="provideMode===3">
|
||||
<van-cell>
|
||||
<template #title>
|
||||
<div style="font-weight: bold; font-size: 15px">收货地址</div>
|
||||
</template>
|
||||
</van-cell>
|
||||
<van-field readonly rows="3" type="textarea" v-model="receiveAddress"></van-field>
|
||||
</div>
|
||||
|
||||
<!--电子签字-->
|
||||
<div class="van-cell-group--inset" v-if="signMode===2">
|
||||
<van-cell>
|
||||
<template #title>
|
||||
<div style="font-weight: bold; font-size: 15px">电子签名</div>
|
||||
</template>
|
||||
</van-cell>
|
||||
<van-cell title="">
|
||||
<template #label>
|
||||
<van-image :src="userSign" style="width: 100%; height: 150px; border: 1px dashed"></van-image>
|
||||
</template>
|
||||
</van-cell>
|
||||
</div>
|
||||
</van-action-sheet>
|
||||
|
||||
<!--评价-->
|
||||
<van-action-sheet title="评价" v-model="evaluatePopup">
|
||||
<div style="margin-top: 20px">
|
||||
<van-radio-group v-model="evaluateFormData.optionId">
|
||||
<van-cell-group>
|
||||
<van-cell :key="item.selectOptionId" @click="optionIdClick(item.selectOptionId)" clickable v-for="item in selectedOptions">
|
||||
<template #title>
|
||||
{{item.optionName}}
|
||||
<span style="color: red" v-if="!item.isPj">未评价</span>
|
||||
</template>
|
||||
<template #right-icon>
|
||||
<van-radio :name="item.selectOptionId"></van-radio>
|
||||
</template>
|
||||
</van-cell>
|
||||
</van-cell-group>
|
||||
</van-radio-group>
|
||||
</div>
|
||||
<div class="evaluateForm">
|
||||
<div style="text-align: center; margin: 20px 0; font-size: 20px; color: #f18d8d; font-weight: bold">您的评价让我们做的更好</div>
|
||||
|
||||
<div style="display: flex; justify-content: center; flex-direction: column; align-items: center">
|
||||
<div style="text-align: center; font-size: 13px; color: rgb(139 134 134)">为本次福利打分</div>
|
||||
<van-rate
|
||||
:gutter="10"
|
||||
:readonly="evaluateFormData.id?true:false"
|
||||
:size="40"
|
||||
color="#ffd21e"
|
||||
v-model="evaluateFormData.evaluateScore"
|
||||
void-color="#eee"
|
||||
void-icon="star"
|
||||
></van-rate>
|
||||
</div>
|
||||
|
||||
<van-field
|
||||
:readonly="evaluateFormData.id?true:false"
|
||||
autosize
|
||||
class="evaluateTextField"
|
||||
label="评价"
|
||||
label-width="0"
|
||||
maxlength="100"
|
||||
placeholder="请输入评价"
|
||||
rows="5"
|
||||
type="textarea"
|
||||
v-model="evaluateFormData.evaluateText"
|
||||
>
|
||||
<div slot="label"></div>
|
||||
</van-field>
|
||||
</div>
|
||||
<div style="padding: 10px 16px">
|
||||
<van-button @click="doSubmitEvaluate" block type="primary" v-if="!evaluateFormData.id">提交</van-button>
|
||||
|
||||
<div style="display: flex; align-items: center; color: #52c41a; justify-content: center; font-size: 20px" v-else>
|
||||
<svg
|
||||
class="icon"
|
||||
height="32"
|
||||
p-id="2914"
|
||||
t="1715150529722"
|
||||
version="1.1"
|
||||
viewBox="0 0 1024 1024"
|
||||
width="32"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
d="M596.48 113.024a142.848 142.848 0 0 0-169.024 0l-49.472 36.288a62.848 62.848 0 0 1-27.648 11.52l-60.8 9.28a142.848 142.848 0 0 0-119.424 119.488l-9.344 60.8a62.848 62.848 0 0 1-11.52 27.648l-36.224 49.472a142.848 142.848 0 0 0 0 169.088l36.288 49.472a62.336 62.336 0 0 1 11.456 27.648l9.344 60.672a142.848 142.848 0 0 0 119.488 119.488l60.672 9.344a62.656 62.656 0 0 1 27.648 11.52l49.472 36.224a142.848 142.848 0 0 0 169.088 0l49.472-36.288a62.4 62.4 0 0 1 27.648-11.52l60.672-9.28a142.912 142.912 0 0 0 119.552-119.552l9.344-60.672a62.656 62.656 0 0 1 11.52-27.648l36.224-49.472a142.848 142.848 0 0 0 0-169.088l-36.288-49.472a62.848 62.848 0 0 1-11.456-27.648l-9.28-60.8a142.848 142.848 0 0 0-119.488-119.424l-60.672-9.344a62.912 62.912 0 0 1-27.648-11.52l-49.536-36.224zM474.88 177.472a62.72 62.72 0 0 1 74.368 0l49.472 36.288c18.56 13.632 40.128 22.528 62.976 26.048l60.544 9.28a62.848 62.848 0 0 1 52.672 52.672l9.28 60.608c3.52 22.784 12.416 44.352 26.048 62.976l36.288 49.408a62.72 62.72 0 0 1 0 74.368l-36.288 49.472c-13.632 18.56-22.592 40.192-26.048 62.976l-9.28 60.608a62.848 62.848 0 0 1-52.672 52.608l-60.608 9.28a142.784 142.784 0 0 0-62.976 26.112l-49.408 36.224a62.72 62.72 0 0 1-74.368 0l-49.472-36.224a142.784 142.784 0 0 0-62.976-26.112l-60.544-9.28a62.784 62.784 0 0 1-52.672-52.608l-9.28-60.672a142.848 142.848 0 0 0-26.112-62.912l-36.224-49.472a62.848 62.848 0 0 1 0-74.368l36.224-49.472a142.72 142.72 0 0 0 26.112-62.912l9.28-60.608a62.848 62.848 0 0 1 52.672-52.672l60.608-9.28c22.784-3.456 44.352-12.416 62.912-26.048l49.472-36.288z m212.096 269.44A40 40 0 0 0 630.4 390.4L458.688 562.112 393.6 497.088a40 40 0 0 0-56.576 56.512l93.376 93.312a40 40 0 0 0 56.512 0l200-200z"
|
||||
fill="#52C41A"
|
||||
p-id="2915"
|
||||
></path>
|
||||
</svg>
|
||||
评价完成
|
||||
</div>
|
||||
</div>
|
||||
</van-action-sheet>
|
||||
</van-list>
|
||||
<van-empty v-else image="/assets/platform/plugins/vant-green/images/nodata/nodata.png" description="暂无数据"></van-empty>
|
||||
</div>
|
||||
<select-view ref="selectViewRef"></select-view>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
<!--#include('selectView.js'){}#-->
|
||||
|
||||
new Vue({
|
||||
el: "#app",
|
||||
store,
|
||||
components: {
|
||||
"select-view": selectView
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tableData: [],
|
||||
@@ -237,32 +121,7 @@ layout("/layouts/platform_h5.html"){
|
||||
totalCount: 0,
|
||||
year: new Date().getFullYear()
|
||||
},
|
||||
yearList: [],
|
||||
|
||||
selectedOptions: [],
|
||||
|
||||
provideMode: null,
|
||||
signMode: null,
|
||||
|
||||
descPopup: false,
|
||||
|
||||
evaluatePopup: false,
|
||||
|
||||
evaluateFormData: {}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
receiveAddress() {
|
||||
if (this.selectedOptions && this.selectedOptions.length > 0) {
|
||||
return this.selectedOptions[0].receiveAddress
|
||||
}
|
||||
return null
|
||||
},
|
||||
userSign() {
|
||||
if (this.selectedOptions && this.selectedOptions.length > 0) {
|
||||
return this.selectedOptions[0].userSign
|
||||
}
|
||||
return null
|
||||
yearList: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -294,68 +153,7 @@ layout("/layouts/platform_h5.html"){
|
||||
return resp
|
||||
},
|
||||
async openView(item) {
|
||||
const { projectId, provideMode, signMode } = item
|
||||
this.provideMode = provideMode
|
||||
this.signMode = signMode
|
||||
const { code, data, msg } = await this.getUserSelection(projectId)
|
||||
if (code === 0) {
|
||||
if (data.length === 0) {
|
||||
this.$toast("您还没有选择福利,请先到职工福利->福利列表下选择")
|
||||
return
|
||||
}
|
||||
this.descPopup = true
|
||||
this.selectedOptions = data
|
||||
}
|
||||
},
|
||||
//打开评价
|
||||
async openEvaluate(item) {
|
||||
/* if (!item.courierNumber) {
|
||||
this.$toast("收货后才能评价")
|
||||
return
|
||||
}*/
|
||||
|
||||
const resp = await this.getUserSelection(item.projectId)
|
||||
this.selectedOptions = resp.data
|
||||
if (this.selectedOptions && this.selectedOptions.length > 0) {
|
||||
await this.finOneWelfareEvaluate(item.id, this.selectedOptions[0].selectOptionId)
|
||||
}
|
||||
this.evaluatePopup = true
|
||||
},
|
||||
async finOneWelfareEvaluate(projectId, optionId) {
|
||||
const { data, code, msg } = await this.$axios.post("/platform/welfare/mine/finOneWelfareEvaluate", {
|
||||
projectId: projectId,
|
||||
optionId: optionId
|
||||
})
|
||||
if (code === 0) {
|
||||
if (data) {
|
||||
this.evaluateFormData = data
|
||||
} else {
|
||||
this.evaluateFormData = {
|
||||
projectId: projectId,
|
||||
optionId: optionId
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.$toast(msg)
|
||||
}
|
||||
},
|
||||
//评价
|
||||
async doSubmitEvaluate() {
|
||||
if (!this.evaluateFormData.evaluateScore) {
|
||||
this.$modal.msg("请为本次福利评分")
|
||||
return
|
||||
}
|
||||
const { code, data, msg } = await $.post("/platform/welfare/mine/doEvaluate", this.evaluateFormData)
|
||||
if (code === 0) {
|
||||
this.$toast.success("评价成功")
|
||||
this.evaluatePopup = false
|
||||
} else {
|
||||
this.$toast.fail(msg)
|
||||
}
|
||||
},
|
||||
optionIdClick(selectOptionId) {
|
||||
this.$set(this.evaluateFormData, "optionId", selectOptionId)
|
||||
this.finOneWelfareEvaluate(this.evaluateFormData.projectId, selectOptionId)
|
||||
this.$refs.selectViewRef.onOpen(item.id)
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
||||
@@ -0,0 +1,512 @@
|
||||
const selectView = {
|
||||
template: /*language=HTML*/ `
|
||||
<van-action-sheet
|
||||
v-model="visible"
|
||||
:title="'我的福利选择'"
|
||||
close-icon="close"
|
||||
safe-area-inset-bottom
|
||||
@close="handleClose"
|
||||
:overlay-class="detailVisible ? 'no-overlay' : ''"
|
||||
>
|
||||
<div class="welfare-view">
|
||||
<!-- 内容区域 -->
|
||||
<div class="welfare-view__content">
|
||||
<van-pull-refresh v-model="refreshing" @refresh="onRefresh">
|
||||
<van-skeleton title :row="6" :loading="loading" animated>
|
||||
<!-- 项目基本信息 -->
|
||||
<div class="welfare-card">
|
||||
<div class="welfare-card__header">
|
||||
<i class="el-icon-s-flag"></i>
|
||||
<span>项目基本信息</span>
|
||||
</div>
|
||||
<div class="welfare-card__content">
|
||||
<div class="info-row">
|
||||
<div class="info-row__label">项目名称</div>
|
||||
<div class="info-row__value">{{ projectInfo.name }}</div>
|
||||
</div>
|
||||
<div class="info-row info-row--time">
|
||||
<div class="info-row__label">选择时间</div>
|
||||
<div class="info-row__value">
|
||||
<div class="time-item time-item--start">{{ projectInfo.choiceTimeStart }}</div>
|
||||
<div class="time-item time-item--end">{{ projectInfo.choiceTimeEnd }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="info-row info-row--time">
|
||||
<div class="info-row__label">发放时间</div>
|
||||
<div class="info-row__value">
|
||||
<div class="time-item time-item--start">{{ projectInfo.provideTimeStart }}</div>
|
||||
<div class="time-item time-item--end">{{ projectInfo.provideTimeEnd }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="info-row">
|
||||
<div class="info-row__label">发放地点</div>
|
||||
<div class="info-row__value">{{ projectInfo.provideAddress || '暂无' }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 联系信息 -->
|
||||
<div class="welfare-card">
|
||||
<div class="welfare-card__header">
|
||||
<i class="el-icon-user"></i>
|
||||
<span>联系信息</span>
|
||||
</div>
|
||||
<div class="welfare-card__content">
|
||||
<div class="info-row">
|
||||
<div class="info-row__label">联系电话</div>
|
||||
<div class="info-row__value">{{ mergedSelections[0]?.mobile || '暂无' }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 我的选择 -->
|
||||
<div class="selections-container">
|
||||
<div class="welfare-card">
|
||||
<div class="welfare-card__header">
|
||||
<i class="el-icon-shopping-cart-full"></i>
|
||||
<span>我的选择</span>
|
||||
</div>
|
||||
|
||||
<div v-if="mergedSelections.length > 0" class="selection-list">
|
||||
<div class="selection-item"
|
||||
v-for="item in mergedSelections"
|
||||
:key="item.id"
|
||||
@click="showOptionDetail(item)">
|
||||
<div class="selection-item__image">
|
||||
<img :src="item.imgUrl || '/static/images/default-welfare.png'"
|
||||
alt="福利图片"
|
||||
@error="handleImageError">
|
||||
</div>
|
||||
<div class="selection-item__content">
|
||||
<div class="selection-item__name">{{ item.optionName }}</div>
|
||||
<div class="selection-item__meta">
|
||||
<div class="selection-item__count">
|
||||
<i class="el-icon-shopping-cart-2"></i> {{ item.selectNum }}
|
||||
</div>
|
||||
<div class="selection-item__time">
|
||||
<i class="el-icon-time"></i> {{ formatDate(item.selectTime) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="selection-item__arrow">
|
||||
<i class="el-icon-arrow-right"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-else class="empty-state">
|
||||
<i class="el-icon-warning-outline"></i>
|
||||
<span>您还未选择任何福利项目</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</van-skeleton>
|
||||
</van-pull-refresh>
|
||||
</div>
|
||||
|
||||
<!-- 选项详情弹窗 -->
|
||||
<van-action-sheet
|
||||
v-model="detailVisible"
|
||||
:title="currentOption?.optionName || '福利详情'"
|
||||
close-icon="close"
|
||||
safe-area-inset-bottom
|
||||
@close="closeDetail"
|
||||
:z-index="2001"
|
||||
>
|
||||
<div class="welfare-detail" v-if="currentOption">
|
||||
<van-skeleton title :row="10" :loading="descLoading" animated>
|
||||
<div class="welfare-detail__content rich-text" v-html="currentOption.description || '暂无详细说明'"></div>
|
||||
</van-skeleton>
|
||||
</div>
|
||||
</van-action-sheet>
|
||||
</div>
|
||||
</van-action-sheet>
|
||||
`,
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
projectId: null,
|
||||
loading: false,
|
||||
refreshing: false,
|
||||
descLoading: false,
|
||||
projectInfo: {
|
||||
name: "",
|
||||
choiceTimeStart: "",
|
||||
choiceTimeEnd: "",
|
||||
provideTimeStart: "",
|
||||
provideTimeEnd: "",
|
||||
provideAddress: "",
|
||||
options: []
|
||||
},
|
||||
selectedOptions: [],
|
||||
detailVisible: false,
|
||||
currentOption: null
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
mergedSelections() {
|
||||
return this.selectedOptions.map((item) => {
|
||||
const option = this.projectInfo.options?.find((opt) => opt.id === item.selectOptionId) || {}
|
||||
return {
|
||||
...item,
|
||||
optionName: option.optionName || "未知选项",
|
||||
imgUrl: option.imgUrl,
|
||||
description: option.description
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onOpen(id) {
|
||||
this.projectId = id
|
||||
this.visible = true
|
||||
this.loadData()
|
||||
},
|
||||
|
||||
handleClose() {
|
||||
// 如果详情弹窗打开,先关闭详情弹窗
|
||||
if (this.detailVisible) {
|
||||
this.closeDetail()
|
||||
return
|
||||
}
|
||||
// 否则关闭整个组件
|
||||
this.$emit("close")
|
||||
},
|
||||
|
||||
async onRefresh() {
|
||||
try {
|
||||
await this.loadData()
|
||||
} finally {
|
||||
this.refreshing = false
|
||||
}
|
||||
},
|
||||
|
||||
async loadData() {
|
||||
try {
|
||||
this.loading = true
|
||||
await Promise.all([this.getProjectInfo(), this.getUserSelections()])
|
||||
} catch (error) {
|
||||
console.error("加载数据失败:", error)
|
||||
this.$toast && this.$toast("加载数据失败,请稍后重试")
|
||||
} finally {
|
||||
this.loading = false
|
||||
}
|
||||
},
|
||||
|
||||
async getProjectInfo() {
|
||||
try {
|
||||
const { code, data, msg } = await this.$axios.post("/platform/welfare/common/projectInfo", {
|
||||
id: this.projectId
|
||||
})
|
||||
if (code === 0) {
|
||||
this.projectInfo = data || this.projectInfo
|
||||
} else {
|
||||
console.warn("获取项目信息失败:", msg)
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("获取项目信息异常:", error)
|
||||
throw error
|
||||
}
|
||||
},
|
||||
|
||||
async getUserSelections() {
|
||||
try {
|
||||
const { code, data, msg } = await this.$axios.post("/platform/welfare/userSelect/getUserSelection", { projectId: this.projectId })
|
||||
if (code === 0) {
|
||||
this.selectedOptions = data || []
|
||||
} else {
|
||||
console.warn("获取用户选择失败:", msg)
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("获取用户选择异常:", error)
|
||||
throw error
|
||||
}
|
||||
},
|
||||
|
||||
showOptionDetail(option) {
|
||||
this.descLoading = true
|
||||
this.currentOption = option
|
||||
this.detailVisible = true
|
||||
// 短暂延迟后关闭加载状态,给内容渲染留出时间
|
||||
setTimeout(() => {
|
||||
this.descLoading = false
|
||||
}, 300)
|
||||
},
|
||||
|
||||
closeDetail() {
|
||||
this.detailVisible = false
|
||||
},
|
||||
|
||||
handleImageError(e) {
|
||||
e.target.src = "/static/images/default-welfare.png"
|
||||
},
|
||||
|
||||
formatDate(dateStr) {
|
||||
if (!dateStr) return ""
|
||||
try {
|
||||
// 简化日期显示,只保留月-日 时:分
|
||||
const date = new Date(dateStr.replace(/-/g, "/"))
|
||||
return date.getMonth() + 1 + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes().toString().padStart(2, "0")
|
||||
} catch (e) {
|
||||
console.error("日期格式化错误:", e)
|
||||
return dateStr
|
||||
}
|
||||
}
|
||||
},
|
||||
style: /*language=CSS*/ `
|
||||
.welfare-view {
|
||||
background: #f7f8fa;
|
||||
overflow-y: auto;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
|
||||
/* 内容区域样式 */
|
||||
.welfare-view__content {
|
||||
padding: 16px;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
/* 卡片通用样式 */
|
||||
.welfare-card {
|
||||
background: #fff;
|
||||
border-radius: 8px;
|
||||
margin-bottom: 12px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.welfare-card__header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 16px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.welfare-card__header::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 16px;
|
||||
right: 16px;
|
||||
bottom: 0;
|
||||
height: 1px;
|
||||
background: #f5f5f5;
|
||||
transform: scaleY(0.5);
|
||||
}
|
||||
|
||||
.welfare-card__header i {
|
||||
font-size: 16px;
|
||||
margin-right: 6px;
|
||||
color: var(--color-primary);
|
||||
}
|
||||
|
||||
.welfare-card__header span {
|
||||
font-size: 15px;
|
||||
font-weight: 500;
|
||||
color: #323233;
|
||||
}
|
||||
|
||||
.welfare-card__content {
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
/* 信息行样式 */
|
||||
.info-row {
|
||||
display: flex;
|
||||
margin-bottom: 12px;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.info-row:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.info-row__label {
|
||||
width: 70px;
|
||||
color: #969799;
|
||||
font-size: 14px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.info-row__value {
|
||||
flex: 1;
|
||||
color: #323233;
|
||||
font-size: 14px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.info-row--time {
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.info-row--time .info-row__value {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.time-item {
|
||||
position: relative;
|
||||
padding-left: 42px;
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
.time-item--start::before {
|
||||
content: "开始:";
|
||||
position: absolute;
|
||||
left: 0;
|
||||
color: #969799;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.time-item--end::before {
|
||||
content: "结束:";
|
||||
position: absolute;
|
||||
left: 0;
|
||||
color: #969799;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
/* 选择列表样式 */
|
||||
.selections-container {
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.selection-list {
|
||||
padding: 8px 16px;
|
||||
}
|
||||
|
||||
.selection-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 12px;
|
||||
background: #fff;
|
||||
position: relative;
|
||||
border-radius: 8px;
|
||||
margin-bottom: 12px;
|
||||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
|
||||
}
|
||||
|
||||
.selection-item:active {
|
||||
background: #f8f9fa;
|
||||
}
|
||||
|
||||
.selection-item:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.selection-item__image {
|
||||
width: 72px;
|
||||
height: 72px;
|
||||
margin-right: 12px;
|
||||
border-radius: 6px;
|
||||
overflow: hidden;
|
||||
background: #f5f6f7;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.selection-item__image img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
.selection-item__content {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
padding: 4px 0;
|
||||
}
|
||||
|
||||
.selection-item__name {
|
||||
font-size: 15px;
|
||||
font-weight: 500;
|
||||
color: #323233;
|
||||
margin-bottom: 8px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.selection-item__meta {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 13px;
|
||||
color: #969799;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.selection-item__count {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-right: 16px;
|
||||
background: #f7f8fa;
|
||||
padding: 4px 8px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.selection-item__time {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: #f7f8fa;
|
||||
padding: 4px 8px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.selection-item__meta i {
|
||||
margin-right: 4px;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.selection-item__arrow {
|
||||
color: #c8c9cc;
|
||||
font-size: 16px;
|
||||
padding: 0 0 0 12px;
|
||||
}
|
||||
|
||||
/* 空状态样式 */
|
||||
.empty-state {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: 32px 16px;
|
||||
color: #969799;
|
||||
}
|
||||
|
||||
.empty-state__icon {
|
||||
font-size: 48px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
/* 详情弹窗样式 */
|
||||
.welfare-detail {
|
||||
padding: 20px 16px;
|
||||
max-height: 60vh;
|
||||
overflow-y: auto;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
|
||||
.welfare-detail__content {
|
||||
font-size: 14px;
|
||||
line-height: 1.6;
|
||||
color: #323233;
|
||||
}
|
||||
|
||||
.rich-text {
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
.rich-text img {
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
margin: 8px 0;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.rich-text p {
|
||||
margin: 8px 0;
|
||||
}
|
||||
|
||||
/* 阻止嵌套 action-sheet 时的背景重叠 */
|
||||
.no-overlay {
|
||||
background-color: transparent !important;
|
||||
}
|
||||
`
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,154 @@
|
||||
<!--#
|
||||
layout("/layouts/platform_h5.html"){
|
||||
#-->
|
||||
|
||||
<style>
|
||||
/* 列表卡片样式 */
|
||||
.wf-welfare-list {
|
||||
padding: 10px;
|
||||
}
|
||||
.wf-welfare-card {
|
||||
position: relative;
|
||||
background: #fff;
|
||||
border-radius: 8px;
|
||||
margin-bottom: 15px;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
||||
overflow: hidden;
|
||||
}
|
||||
/* 左右布局容器 */
|
||||
.wf-card-layout {
|
||||
display: flex;
|
||||
padding: 15px;
|
||||
}
|
||||
/* 左侧图片容器 */
|
||||
.wf-card-img-container {
|
||||
width: 120px;
|
||||
height: 120px;
|
||||
flex-shrink: 0;
|
||||
margin-right: 15px;
|
||||
}
|
||||
/* 右侧信息容器 */
|
||||
.wf-card-content {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
}
|
||||
/* 标题样式 */
|
||||
.wf-card-heading {
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
margin-bottom: 8px;
|
||||
color: #333;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
width: 100%;
|
||||
}
|
||||
/* 时间信息样式 */
|
||||
.wf-time-row {
|
||||
font-size: 14px;
|
||||
color: #666;
|
||||
margin-bottom: 5px;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
width: 100%;
|
||||
}
|
||||
.wf-time-label {
|
||||
color: #999;
|
||||
display: inline-block;
|
||||
width: 70px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<van-sticky>
|
||||
<van-nav-bar @click-left="()=>this.$pjaxReplace('/platform/h5/home')" left-arrow left-text="返回" placeholder title="福利列表"></van-nav-bar>
|
||||
<van-dropdown-menu>
|
||||
<year-van-dropdown-item :num="10" v-model="pageForm.year" @change="doSearch"></year-van-dropdown-item>
|
||||
</van-dropdown-menu>
|
||||
</van-sticky>
|
||||
|
||||
<div>
|
||||
<van-list :finished="finished" @load="pageData" finished-text="没有更多了" v-if="tableData.length>0" v-model="loading">
|
||||
<div class="wf-welfare-list">
|
||||
<div class="wf-welfare-card" v-for="row in tableData" :key="row.id" @click="openChoose(row)">
|
||||
<van-tag mark :type="row.isChoose?'success':''" style="position: absolute; left: 5px; top: 5px; z-index: 1">
|
||||
{{row.isChoose?'已选择':'未选择'}}
|
||||
</van-tag>
|
||||
<div class="wf-card-layout">
|
||||
<div class="wf-card-img-container">
|
||||
<van-image :src="row.cover" fit="cover" width="100%" height="100%" radius="4"></van-image>
|
||||
</div>
|
||||
<div class="wf-card-content">
|
||||
<div class="wf-card-heading">{{row.name}}</div>
|
||||
<div class="wf-time-row">
|
||||
<span class="wf-time-label">开始时间:</span>
|
||||
{{row.choiceTimeStart}}
|
||||
</div>
|
||||
<div class="wf-time-row">
|
||||
<span class="wf-time-label">结束时间:</span>
|
||||
{{row.choiceTimeEnd}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</van-list>
|
||||
<van-empty v-else image="/assets/platform/plugins/vant-green/images/nodata/nodata.png" description="暂无数据"></van-empty>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
new Vue({
|
||||
el: "#app",
|
||||
data() {
|
||||
return {
|
||||
tableData: [],
|
||||
finished: false,
|
||||
loading: false,
|
||||
pageForm: {
|
||||
pageNumber: 1,
|
||||
pageSize: 5,
|
||||
totalCount: 0,
|
||||
year: new Date().getFullYear()
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
doSearch() {
|
||||
this.tableKey = new Date().getTime()
|
||||
this.pageForm.pageNumber = 1
|
||||
this.pageForm.totalCount = 0
|
||||
this.tableData = []
|
||||
this.pageData()
|
||||
},
|
||||
pageData() {
|
||||
this.loading = true
|
||||
this.$axios.post("/platform/welfare/userSelect/pageData", this.pageForm).then((res) => {
|
||||
this.tableData = this.tableData.concat(res.data.list)
|
||||
if (this.tableData.length === res.data.totalCount) {
|
||||
this.finished = true
|
||||
} else {
|
||||
this.pageForm.pageNumber++
|
||||
}
|
||||
this.pageForm.totalCount = res.data.totalCount
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
|
||||
async openChoose(row) {
|
||||
this.$pjaxReplace("/platform/h5/welfare/userSelect/index?id=" + row.id)
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,111 @@
|
||||
<!--#
|
||||
layout("/layouts/platform_h5.html"){
|
||||
#-->
|
||||
|
||||
<style>
|
||||
.success-container {
|
||||
min-height: 100vh;
|
||||
background-color: #f7f8fa;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: 0 20px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.success-icon {
|
||||
margin-top: 80px;
|
||||
width: 120px;
|
||||
height: 120px;
|
||||
border-radius: 60px;
|
||||
background: #fff;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
box-shadow: 0 4px 16px rgba(25, 137, 250, 0.15);
|
||||
}
|
||||
|
||||
.success-icon .van-icon {
|
||||
font-size: 60px;
|
||||
color: #07c160;
|
||||
}
|
||||
|
||||
.success-title {
|
||||
margin-top: 30px;
|
||||
font-size: 22px;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.success-desc {
|
||||
margin-top: 16px;
|
||||
font-size: 15px;
|
||||
color: #666;
|
||||
text-align: center;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.button-group {
|
||||
margin-top: 50px;
|
||||
width: 100%;
|
||||
padding: 0 20px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.back-btn {
|
||||
width: 100%;
|
||||
height: 44px;
|
||||
font-size: 16px;
|
||||
border-radius: 22px;
|
||||
}
|
||||
|
||||
.home-btn {
|
||||
margin-top: 12px;
|
||||
width: 100%;
|
||||
height: 44px;
|
||||
font-size: 16px;
|
||||
border-radius: 22px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<div class="success-container">
|
||||
<div class="success-icon">
|
||||
<van-icon name="checked" />
|
||||
</div>
|
||||
<div class="success-title">选择成功</div>
|
||||
<div class="success-desc">
|
||||
您的福利选择已提交成功!
|
||||
<br />
|
||||
请在选择时间截止前,您仍可以重新选择并修改。
|
||||
<br />
|
||||
请留意系统通知,了解福利发放信息。
|
||||
</div>
|
||||
|
||||
<div class="button-group">
|
||||
<van-button type="primary" class="back-btn" @click="goToList">查看我的福利</van-button>
|
||||
<van-button type="default" class="home-btn" @click="goToHome">返回首页</van-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
new Vue({
|
||||
el: "#app",
|
||||
data() {
|
||||
return {}
|
||||
},
|
||||
methods: {
|
||||
goToList() {
|
||||
this.$pjaxReplace("/platform/h5/welfare/mine/list")
|
||||
},
|
||||
goToHome() {
|
||||
this.$pjaxReplace("/platform/h5/home")
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -140,14 +140,14 @@ layout("/layouts/platform_h5.html"){
|
||||
class="van-cell-group--inset"
|
||||
style="margin: 10px auto"
|
||||
v-if="projectInfo.flexible && [2,3].includes(projectInfo.provideMode)
|
||||
&& projectInfo.welfareProjectSubjects
|
||||
&& projectInfo.welfareProjectSubjects.length>0"
|
||||
&& projectInfo.options
|
||||
&& projectInfo.options.length>0"
|
||||
>
|
||||
<van-cell>
|
||||
<div style="font-weight: bold; font-size: 15px; display: flex; align-items: center">选择套餐</div>
|
||||
</van-cell>
|
||||
|
||||
<div :key="subject.id" v-for="(subject,subjectIndex) in projectInfo.welfareProjectSubjects" style="margin-bottom: 30px">
|
||||
<div style="margin-bottom: 30px">
|
||||
<div>
|
||||
<van-text-box
|
||||
:content="option.supplier"
|
||||
@@ -156,7 +156,7 @@ layout("/layouts/platform_h5.html"){
|
||||
:title="option.optionName"
|
||||
sub-title=" "
|
||||
type="5"
|
||||
v-for="(option, optionIndex) in subject.options"
|
||||
v-for="(option, optionIndex) in projectInfo.options"
|
||||
>
|
||||
<template #tip>
|
||||
<span @click="openViewDesc(option.description)">查看详情</span>
|
||||
@@ -358,49 +358,37 @@ layout("/layouts/platform_h5.html"){
|
||||
}
|
||||
return true
|
||||
},
|
||||
getWelfareInfo(id) {
|
||||
const loading = this.$toast.loading({
|
||||
message: "加载中...",
|
||||
forbidClick: true,
|
||||
overlay: true,
|
||||
duration: 0
|
||||
})
|
||||
this.$axios.post("/platform/welfare/project/mange/findOne", { id: id }).then((res) => {
|
||||
getWelfareInfo() {
|
||||
this.$axios.post("/platform/welfare/project/mange/findOne", { id: this.projectId }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
setTimeout(() => {
|
||||
res.data.multiSelectNum = res.data.multiSelectNum ? res.data.multiSelectNum : 1
|
||||
this.projectInfo = res.data
|
||||
this.getUserSelection(this.$store.state.user.id)
|
||||
loading.close()
|
||||
}, 500)
|
||||
this.projectInfo = res.data
|
||||
} else {
|
||||
loading.close()
|
||||
this.$toast(res.msg)
|
||||
this.$toast.fail(res.msg)
|
||||
}
|
||||
})
|
||||
},
|
||||
getUserSelection(id) {
|
||||
this.$axios
|
||||
.post("/platform/welfare/mine/getUserSelection", {
|
||||
projectId: this.projectInfo.id,
|
||||
userId: id
|
||||
})
|
||||
.then((resp) => {
|
||||
// 获取用户选择的数据
|
||||
getUserSelection() {
|
||||
this.$axios.post("/platform/welfare/userChoose/getUserSelection", { projectId: this.projectInfo.id }).then((resp) => {
|
||||
if (resp.code === 0) {
|
||||
this.userSelection = resp.data
|
||||
this.echoUserSelection()
|
||||
})
|
||||
} else {
|
||||
this.$toast(resp.msg)
|
||||
}
|
||||
})
|
||||
},
|
||||
//回显用户选择的数据
|
||||
echoUserSelection() {
|
||||
//获取用户当前选择的数量
|
||||
this.projectInfo.welfareProjectSubjects[0].options.forEach((v) => {
|
||||
const option = this.userSelection.find((x) => x.selectOptionId === v.id)
|
||||
if (option) {
|
||||
v.selectNum = option.selectNum
|
||||
} else {
|
||||
v.selectNum = 0
|
||||
}
|
||||
})
|
||||
// this.projectInfo.welfareProjectSubjects[0].options.forEach((v) => {
|
||||
// const option = this.userSelection.find((x) => x.selectOptionId === v.id)
|
||||
// if (option) {
|
||||
// v.selectNum = option.selectNum
|
||||
// } else {
|
||||
// v.selectNum = 0
|
||||
// }
|
||||
// })
|
||||
},
|
||||
//查看详情
|
||||
openViewDesc(desc) {
|
||||
@@ -551,9 +539,11 @@ layout("/layouts/platform_h5.html"){
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
const id = GetQueryString("id")
|
||||
if (id) {
|
||||
this.getWelfareInfo(id)
|
||||
this.projectId = GetQueryString("id")
|
||||
if (this.projectId) {
|
||||
this.getWelfareInfo()
|
||||
this.getUserSelection()
|
||||
|
||||
this.welfareProvideMode = await this.$businessTool.getDictOptions("welfareProvideMode")
|
||||
this.welfareProvideMode.map((v) => {
|
||||
v.code = Number(v.code)
|
||||
|
||||
@@ -2,7 +2,52 @@
|
||||
layout("/layouts/platform_h5.html"){
|
||||
#-->
|
||||
|
||||
<style></style>
|
||||
<style>
|
||||
.table-card {
|
||||
position: relative;
|
||||
background: #fff;
|
||||
border-radius: 8px;
|
||||
margin-bottom: 15px;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
||||
overflow: hidden;
|
||||
}
|
||||
/* 左右布局容器 */
|
||||
.card-content {
|
||||
display: flex;
|
||||
padding: 15px;
|
||||
}
|
||||
/* 左侧图片容器 */
|
||||
.card-image {
|
||||
width: 120px;
|
||||
height: 120px;
|
||||
flex-shrink: 0;
|
||||
margin-right: 15px;
|
||||
}
|
||||
/* 右侧信息容器 */
|
||||
.card-info {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
}
|
||||
/* 标题样式 */
|
||||
.card-title {
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
margin-bottom: 8px;
|
||||
color: #333;
|
||||
}
|
||||
/* 时间信息样式 */
|
||||
.time-info {
|
||||
font-size: 14px;
|
||||
color: #666;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
.time-label {
|
||||
color: #999;
|
||||
margin-right: 5px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<van-sticky>
|
||||
@@ -19,19 +64,22 @@ layout("/layouts/platform_h5.html"){
|
||||
<van-tag mark :type="row.isChoose?'success':''" style="position: absolute; left: 5px; top: 5px; z-index: 1">
|
||||
{{row.isChoose?'已选择':'未选择'}}
|
||||
</van-tag>
|
||||
<van-image :src="row.cover" fit="cover" height="200" width="100%"></van-image>
|
||||
<van-cell>
|
||||
<template slot="title">
|
||||
<div class="flex-align">
|
||||
<span class="font-size3 bold">{{row.name}}</span>
|
||||
<div class="card-content">
|
||||
<div class="card-image">
|
||||
<van-image :src="row.cover" fit="cover" width="100%" height="100%" radius="4"></van-image>
|
||||
</div>
|
||||
<div class="card-info">
|
||||
<div class="card-title">{{row.name}}</div>
|
||||
<div class="time-info">
|
||||
<span class="time-label">开始时间:</span>
|
||||
{{row.choiceTimeStart}}
|
||||
</div>
|
||||
</template>
|
||||
</van-cell>
|
||||
<van-cell title="开始时间" :value="row.choiceTimeStart"></van-cell>
|
||||
<van-cell title="结束时间" :value="row.choiceTimeEnd"></van-cell>
|
||||
<van-cell class="table-card-footer">
|
||||
<!-- <van-button @click="openChoose(o)" size="middle" type="primary" round>查看</van-button>-->
|
||||
</van-cell>
|
||||
<div class="time-info">
|
||||
<span class="time-label">结束时间:</span>
|
||||
{{row.choiceTimeEnd}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</van-list>
|
||||
|
||||
Reference in New Issue
Block a user