commit
This commit is contained in:
+15
-3
@@ -75,7 +75,12 @@ public class ActivityWorksCollectionReadController {
|
||||
up.*,
|
||||
co.NAME AS activityName,
|
||||
su.typeName AS subjectName,
|
||||
wo.worksTypeName AS worksName
|
||||
wo.worksTypeName AS worksName,
|
||||
(
|
||||
SELECT COUNT(*)
|
||||
FROM activity_works_collection_upload_like_num likeNum
|
||||
WHERE likeNum.uploadId = up.id
|
||||
) AS num
|
||||
from
|
||||
activity_works_collection_upload up
|
||||
LEFT JOIN activity_works_collection co ON up.activityId = co.id
|
||||
@@ -99,6 +104,7 @@ public class ActivityWorksCollectionReadController {
|
||||
if(!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())) {
|
||||
cnd.and("up.unionId", "=", SecurityUtil.getUnionId());
|
||||
}
|
||||
cnd.desc("up.createdAt");
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
@@ -121,7 +127,12 @@ public class ActivityWorksCollectionReadController {
|
||||
co.NAME AS activityName,
|
||||
su.typeName AS subjectName,
|
||||
wo.worksTypeName AS worksName,
|
||||
u.sex
|
||||
u.sex,
|
||||
(
|
||||
SELECT COUNT(*)
|
||||
FROM activity_works_collection_upload_like_num likeNum
|
||||
WHERE likeNum.uploadId = up.id
|
||||
) AS num
|
||||
from
|
||||
activity_works_collection_upload up
|
||||
LEFT JOIN activity_works_collection co ON up.activityId = co.id
|
||||
@@ -145,6 +156,7 @@ public class ActivityWorksCollectionReadController {
|
||||
if(!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())) {
|
||||
cnd.and("up.unionId", "=", SecurityUtil.getUnionId());
|
||||
}
|
||||
cnd.desc("num");
|
||||
sql.setCondition(cnd);
|
||||
List<NutMap> listMap = baseService.listMap(sql);
|
||||
|
||||
@@ -159,7 +171,7 @@ public class ActivityWorksCollectionReadController {
|
||||
exportEntities.add(new ExcelExportEntity("作品类型", "worksName", 20));
|
||||
exportEntities.add(new ExcelExportEntity("作品名称", "name", 20));
|
||||
exportEntities.add(new ExcelExportEntity("作品描述", "description", 20));
|
||||
//exportEntities.add(new ExcelExportEntity("点赞次数", "dz_num", 20));
|
||||
exportEntities.add(new ExcelExportEntity("点赞次数", "num", 20));
|
||||
|
||||
try {
|
||||
ExportParams exportParams = new ExportParams();
|
||||
|
||||
+18
-3
@@ -1,12 +1,10 @@
|
||||
package com.budwk.app.zhgh.activity.workscollection.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.sys.models.Sys_user;
|
||||
import com.budwk.app.sys.views.View_user;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.activity.basic.models.ActivityUserScope;
|
||||
@@ -27,7 +25,6 @@ import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -50,6 +47,8 @@ public class ActivityWorksCollectionUploadController {
|
||||
public void index() {
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @param pageForm 分页
|
||||
* @param activityId 活动id
|
||||
@@ -63,6 +62,8 @@ public class ActivityWorksCollectionUploadController {
|
||||
select
|
||||
up.*,
|
||||
co.NAME AS activityName,
|
||||
co.startDateTime AS activityStartDateTime,
|
||||
co.endDateTime AS activityEndDateTime,
|
||||
su.typeName AS subjectName,
|
||||
wo.worksTypeName AS worksName
|
||||
from
|
||||
@@ -78,6 +79,7 @@ public class ActivityWorksCollectionUploadController {
|
||||
cnd.andEX("up.activityId", "=", activityId);
|
||||
cnd.andEX("up.subjectId", "=", subjectId);
|
||||
cnd.andEX("up.worksId", "=", worksId);
|
||||
cnd.desc("up.createdAt");
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
@@ -91,8 +93,12 @@ public class ActivityWorksCollectionUploadController {
|
||||
@At
|
||||
@SaCheckPermission("activity.workscollection.upload")
|
||||
public Result insert(@Param("data") @Valid Activity_works_collection_upload upload) {
|
||||
|
||||
String activityId = upload.getActivityId();
|
||||
Activity_works_collection activity = dao.fetch(Activity_works_collection.class, activityId);
|
||||
if (activity.getEndDateTime().getTime() < System.currentTimeMillis()){
|
||||
return Result.error("活动已结束!");
|
||||
}
|
||||
if (activity.getActivityGroupId() != null) {
|
||||
int count = dao.count(ActivityUserScope.class, Cnd.where(ActivityUserScope::getGroupId, "=", activity.getActivityGroupId())
|
||||
.and(ActivityUserScope::getUserId, "=", SecurityUtil.getUserId()));
|
||||
@@ -119,6 +125,10 @@ public class ActivityWorksCollectionUploadController {
|
||||
@At
|
||||
@SaCheckPermission("activity.workscollection.upload")
|
||||
public Result update(@Param("data") @Valid Activity_works_collection_upload upload) {
|
||||
Activity_works_collection activity = dao.fetch(Activity_works_collection.class, upload.getActivityId());
|
||||
if (activity.getEndDateTime().getTime() < System.currentTimeMillis()){
|
||||
return Result.error("活动已结束!");
|
||||
}
|
||||
dao.updateIgnoreNull(upload);
|
||||
return Result.success();
|
||||
}
|
||||
@@ -133,6 +143,11 @@ public class ActivityWorksCollectionUploadController {
|
||||
@At
|
||||
@SaCheckPermission("activity.workscollection.upload")
|
||||
public Result delete(@Valid String id) {
|
||||
Activity_works_collection_upload upload = dao.fetch(Activity_works_collection_upload.class, id);
|
||||
Activity_works_collection activity = dao.fetch(Activity_works_collection.class, upload.getActivityId());
|
||||
if (activity.getEndDateTime().getTime() < System.currentTimeMillis()){
|
||||
return Result.error("活动已结束!");
|
||||
}
|
||||
dao.delete(Activity_works_collection_upload.class, id);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
-42
@@ -1,42 +0,0 @@
|
||||
package com.budwk.app.zhgh.activity.workscollection.controller.h5;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
/**
|
||||
* 手机端作品征集
|
||||
*/
|
||||
@IocBean
|
||||
@At("/platform/h5/activity/worksCollection")
|
||||
@Ok("json:full")
|
||||
public class H5ActivityWorksCollectionController {
|
||||
|
||||
/**
|
||||
* 活动列表页面
|
||||
*/
|
||||
@At("/activity")
|
||||
@Ok("beetl:/platform/zhghh5/activity/workscollection/activity/index.html")
|
||||
@SaCheckPermission("activity.workscollection.upload")
|
||||
public void activity() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传页面
|
||||
*/
|
||||
@At("/upload")
|
||||
@Ok("beetl:/platform/zhghh5/activity/workscollection/upload/index.html")
|
||||
@SaCheckPermission("activity.workscollection.upload")
|
||||
public void upload() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 我的上传页面
|
||||
*/
|
||||
@At("/upload/mine")
|
||||
@Ok("beetl:/platform/zhghh5/activity/workscollection/upload/mine.html")
|
||||
@SaCheckPermission("activity.workscollection.upload")
|
||||
public void uploadMine() {
|
||||
}
|
||||
}
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
package com.budwk.app.zhgh.activity.workscollection.controller.h5;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2025/9/16 08:54
|
||||
* @description 我的作品
|
||||
*/
|
||||
@IocBean
|
||||
@At("/platform/activity/worksCollection/mine/h5")
|
||||
@Ok("json:full")
|
||||
@ApiOperation("手机端我的作品")
|
||||
public class H5ActivityWorksMineCollectionController {
|
||||
|
||||
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
@Inject
|
||||
private Dao dao;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhghh5/activity/workscollection/mine/index.html")
|
||||
@SaCheckPermission("h5.activity.workscollection.mine")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+158
@@ -0,0 +1,158 @@
|
||||
package com.budwk.app.zhgh.activity.workscollection.controller.h5;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.sys.views.View_user;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.activity.workscollection.models.Activity_works_collection;
|
||||
import com.budwk.app.zhgh.activity.workscollection.models.Activity_works_collection_upload;
|
||||
import com.budwk.app.zhgh.activity.workscollection.models.Activity_works_collection_upload_like_num;
|
||||
import com.budwk.app.zhgh.activity.workscollection.param.ActivityWorksCollectionReadPageParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.dao.util.cri.SqlExpressionGroup;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2025/9/18 10:00
|
||||
* @description
|
||||
*/
|
||||
@IocBean
|
||||
@At("/platform/activity/worksCollection/read/h5")
|
||||
@Ok("json:full")
|
||||
@ApiOperation("手机端作品阅览")
|
||||
public class H5ActivityWorksReadCollectionController {
|
||||
|
||||
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
@Inject
|
||||
private Dao dao;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhghh5/activity/workscollection/read/index.html")
|
||||
@SaCheckPermission("h5.activity.workscollection.read")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("h5.activity.workscollection.read")
|
||||
public Result pageData(@Valid ActivityWorksCollectionReadPageParam pageForm) {
|
||||
Sql sql = Sqls.create("""
|
||||
select
|
||||
up.*,
|
||||
co.NAME AS activityName,
|
||||
co.nbCount,
|
||||
su.typeName AS subjectName,
|
||||
wo.worksTypeName AS worksName,
|
||||
(
|
||||
SELECT COUNT(*)
|
||||
FROM activity_works_collection_upload_like_num likeNum
|
||||
WHERE likeNum.uploadId = up.id
|
||||
) AS num,
|
||||
EXISTS(
|
||||
SELECT 1
|
||||
FROM activity_works_collection_upload_like_num thisLikeNum
|
||||
WHERE thisLikeNum.uploadId = up.id
|
||||
AND thisLikeNum.userId = @userId
|
||||
) AS isThisLike
|
||||
from
|
||||
activity_works_collection_upload up
|
||||
LEFT JOIN activity_works_collection co ON up.activityId = co.id
|
||||
LEFT JOIN activity_works_subjecttype su ON up.subjectId = su.id
|
||||
LEFT JOIN activity_works_workstype wo ON up.worksId = wo.id
|
||||
$condition
|
||||
""").setParam("userId", SecurityUtil.getUserId());
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("YEAR(co.startDateTime)", "=", pageForm.getYear());
|
||||
cnd.andEX("up.activityId", "=", pageForm.getActivityId());
|
||||
cnd.andEX("up.subjectId", "=", pageForm.getSubjectId());
|
||||
cnd.andEX("up.worksId", "=", pageForm.getWorksId());
|
||||
cnd.andEX("unionId", "=", pageForm.getUnionId());
|
||||
cnd.andEX("unitId", "=", pageForm.getUnitId());
|
||||
if (StrUtil.isAllNotBlank(pageForm.getSearchKeyword())) {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.orLike("userName", pageForm.getSearchKeyword());
|
||||
seg.orLike("loginName", pageForm.getSearchKeyword());
|
||||
cnd.and(seg);
|
||||
}
|
||||
if (pageForm.getPageOrderName().equals("num")) {
|
||||
cnd.desc(pageForm.getPageOrderName()).asc("createdAt");
|
||||
} else {
|
||||
cnd.asc(pageForm.getPageOrderName());
|
||||
}
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ApiOperation("点赞")
|
||||
@SLog(tag = "作品点赞", msg = "作品Id:${uploadId}")
|
||||
@SaCheckPermission("h5.activity.workscollection.read")
|
||||
public Result doLike(@Valid String uploadId) {
|
||||
Activity_works_collection_upload upload = dao.fetch(Activity_works_collection_upload.class, uploadId);
|
||||
Activity_works_collection activity = dao.fetch(Activity_works_collection.class, upload.getActivityId());
|
||||
if (activity.getNbStartDateTime().getTime() > System.currentTimeMillis()) {
|
||||
return Result.error("点赞未开始!开始时间:" + DateUtil.format(activity.getNbStartDateTime(), "yyyy-MM-dd HH:mm:ss"));
|
||||
}
|
||||
if (activity.getNbEndDateTime().getTime() < System.currentTimeMillis()) {
|
||||
return Result.error("点赞已结束!结束时间:" + DateUtil.format(activity.getNbEndDateTime(), "yyyy-MM-dd HH:mm:ss"));
|
||||
}
|
||||
int count = dao.count(Activity_works_collection_upload_like_num.class,
|
||||
Cnd.where(Activity_works_collection_upload_like_num::getActivityId, "=", activity.getId())
|
||||
.and("DATE(FROM_UNIXTIME(createdAt / 1000))", "=", DateUtil.today())
|
||||
.and(Activity_works_collection_upload_like_num::getUserId, "=", SecurityUtil.getUserId()));
|
||||
if (count >= activity.getNbCount()) {
|
||||
return Result.error("当前活动每天只能点赞" + activity.getNbCount() + "次!");
|
||||
}
|
||||
View_user vwUser = dao.fetch(View_user.class, Cnd.where(View_user::getId, "=", SecurityUtil.getUserId()));
|
||||
Activity_works_collection_upload_like_num likeNum = new Activity_works_collection_upload_like_num();
|
||||
likeNum.setUploadId(uploadId);
|
||||
likeNum.setActivityId(activity.getId());
|
||||
likeNum.setUserId(SecurityUtil.getUserId());
|
||||
likeNum.setUserName(SecurityUtil.getUserUsername());
|
||||
likeNum.setLoginName(SecurityUtil.getUserLoginname());
|
||||
likeNum.setUnitId(SecurityUtil.getUnitId());
|
||||
likeNum.setUnitName(vwUser.getUnitName());
|
||||
likeNum.setUnionId(SecurityUtil.getUnionId());
|
||||
likeNum.setUnionName(vwUser.getUnionName());
|
||||
dao.insert(likeNum);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ApiOperation("取消点赞")
|
||||
@SaCheckPermission("h5.activity.workscollection.read")
|
||||
public Result doDeleteLike(@Valid String uploadId) {
|
||||
Activity_works_collection_upload upload = dao.fetch(Activity_works_collection_upload.class, uploadId);
|
||||
Activity_works_collection activity = dao.fetch(Activity_works_collection.class, upload.getActivityId());
|
||||
if (activity.getNbStartDateTime().getTime() > System.currentTimeMillis()) {
|
||||
return Result.error("点赞未开始!开始时间:" + DateUtil.format(activity.getNbStartDateTime(), "yyyy-MM-dd HH:mm:ss"));
|
||||
}
|
||||
if (activity.getNbEndDateTime().getTime() < System.currentTimeMillis()) {
|
||||
return Result.error("点赞已结束!结束时间:" + DateUtil.format(activity.getNbEndDateTime(), "yyyy-MM-dd HH:mm:ss"));
|
||||
}
|
||||
dao.clear(Activity_works_collection_upload_like_num.class,
|
||||
Cnd.where(Activity_works_collection_upload_like_num::getUploadId, "=", uploadId)
|
||||
.and(Activity_works_collection_upload_like_num::getUserId, "=", SecurityUtil.getUserId()));
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
}
|
||||
+79
@@ -0,0 +1,79 @@
|
||||
package com.budwk.app.zhgh.activity.workscollection.controller.h5;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.dev33.satoken.annotation.SaMode;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.dao.util.cri.Static;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
/**
|
||||
* 手机端作品征集
|
||||
*/
|
||||
@IocBean
|
||||
@At("/platform/activity/worksCollection/upload/h5")
|
||||
@Ok("json:full")
|
||||
@ApiOperation("手机端作品征集")
|
||||
public class H5ActivityWorksUploadCollectionController {
|
||||
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
@Inject
|
||||
private Dao dao;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhghh5/activity/workscollection/upload/index.html")
|
||||
@SaCheckPermission("h5.activity.workscollection.upload")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@At
|
||||
@ApiOperation("活动查询")
|
||||
@SaCheckPermission(value = {"h5.activity.workscollection.upload"}, mode = SaMode.OR)
|
||||
public Result activityPageData(PageForm pageForm,
|
||||
@Param(value = "year") Integer year,
|
||||
@Param(value = "activityType") Integer activityType) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
awc.*,
|
||||
aus.groupName activityGroupName
|
||||
FROM
|
||||
`activity_works_collection` awc
|
||||
LEFT JOIN activity_user_scope aus ON aus.groupId = awc.activityGroupId
|
||||
AND aus.userId = @userId
|
||||
""").setParam("userId", SecurityUtil.getUserId());
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("YEAR(awc.startDateTime)", "=", year);
|
||||
//查询报名中
|
||||
if (activityType == 2) {
|
||||
cnd.and(new Static("now() > awc.startDateTime and now() < awc.endDateTime"));
|
||||
}//查询已结束的
|
||||
else if (activityType == 3) {
|
||||
cnd.and(new Static("now() > awc.startDateTime"));
|
||||
} else if (activityType == 4) {
|
||||
cnd.and(new Static("now() < awc.endDateTime"));
|
||||
}
|
||||
cnd.and("awc.enable", "=", 1);
|
||||
cnd.and("awc.type", "=", 1);
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+72
@@ -0,0 +1,72 @@
|
||||
package com.budwk.app.zhgh.activity.workscollection.models;
|
||||
|
||||
import com.budwk.app.base.model.BaseModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2025/9/18 10:46
|
||||
* @description 作品点赞数量
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Table("activity_works_collection_upload_like_num")
|
||||
@TableMeta("{'mysql-charset':'utf8mb4'}")
|
||||
@Comment("作品点赞数量")
|
||||
public class Activity_works_collection_upload_like_num extends BaseModel {
|
||||
|
||||
@Name
|
||||
@Comment("ID")
|
||||
@PrevInsert(uu32 = true)
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String id;
|
||||
|
||||
|
||||
@Column
|
||||
@Comment("活动Id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32, notNull = true)
|
||||
private String activityId;
|
||||
|
||||
@Column
|
||||
@Comment("作品Id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32, notNull = true)
|
||||
private String uploadId;
|
||||
|
||||
@Column
|
||||
@Comment("点赞人id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32, notNull = true)
|
||||
private String userId;
|
||||
|
||||
@Column
|
||||
@Comment("点赞人姓名")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100, notNull = true)
|
||||
private String userName;
|
||||
|
||||
@Column
|
||||
@Comment("点赞人工号")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100, notNull = true)
|
||||
private String loginName;
|
||||
|
||||
@Column
|
||||
@Comment("点赞人单位id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 200, notNull = true)
|
||||
private String unitId;
|
||||
|
||||
@Column
|
||||
@Comment("点赞人单位")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 200, notNull = true)
|
||||
private String unitName;
|
||||
|
||||
@Column
|
||||
@Comment("点赞人分工会id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32, notNull = true)
|
||||
private String unionId;
|
||||
|
||||
@Column
|
||||
@Comment("点赞人分工会")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50, notNull = true)
|
||||
private String unionName;
|
||||
}
|
||||
+1
-1
@@ -79,7 +79,7 @@ public class OutlayReimburseApplyController {
|
||||
@ApiOperation("查询这个预算已经报销了的金额")
|
||||
@SaCheckPermission(value = {"outlay.reimburse.apply", "h5.outlay.reimburse.apply"}, mode = SaMode.OR)
|
||||
public Result getBxMoneyByBudgetId(String budgetId) {
|
||||
return Result.success(outlayReimburseApplyService.getBxMoneyByActivityId(budgetId,null));
|
||||
return Result.success(outlayReimburseApplyService.getBxMoneyByActivityId(budgetId));
|
||||
}
|
||||
|
||||
|
||||
|
||||
+1
-2
@@ -24,10 +24,9 @@ public interface OutlayReimburseApplyService extends BaseService<OutlayReimburse
|
||||
/**
|
||||
* 查询这个预算已经报销了的金额
|
||||
* @param budgetId
|
||||
* @param isSchoolBudget 是否是校会预算
|
||||
* @return
|
||||
*/
|
||||
BigDecimal getBxMoneyByActivityId(String budgetId,Boolean isSchoolBudget);
|
||||
BigDecimal getBxMoneyByActivityId(String budgetId);
|
||||
|
||||
/**
|
||||
* 判断这个报销的记录预算是否充足
|
||||
|
||||
+8
-10
@@ -136,21 +136,19 @@ public class OutlayReimburseApplyServiceImpl extends BaseServiceImpl<OutlayReimb
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigDecimal getBxMoneyByActivityId(String budgetId, Boolean isSchoolBudget) {
|
||||
public BigDecimal getBxMoneyByActivityId(String budgetId) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
rei.money
|
||||
FROM
|
||||
`outlay_reimburse` rei
|
||||
LEFT JOIN wf_process_instance ins ON ins.businessNo = rei.id
|
||||
WHERE
|
||||
rei.budgetId = @budgetId
|
||||
AND ins.state = 20
|
||||
$condition
|
||||
""").setParam("budgetId", budgetId);
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (isSchoolBudget != null) {
|
||||
cnd.and("isSchoolBudget", "=", isSchoolBudget);
|
||||
}
|
||||
cnd.and("rei.budgetId", "=", budgetId);
|
||||
cnd.and("ins.state", "=", 20);
|
||||
sql.setCondition(cnd);
|
||||
|
||||
List<NutMap> reiList = listMap(sql);
|
||||
|
||||
@@ -174,7 +172,7 @@ public class OutlayReimburseApplyServiceImpl extends BaseServiceImpl<OutlayReimb
|
||||
if (budget.getIsRepeatReimburse()) {
|
||||
//1.查询已经报销了的总金额
|
||||
if (budget.getIsSchoolBudget()) {
|
||||
BigDecimal bXMoney = getBxMoneyByActivityId(budgetId, budget.getIsSchoolBudget());
|
||||
BigDecimal bXMoney = getBxMoneyByActivityId(budgetId);
|
||||
//如果是分工会进来并且报销的活动是校会预算
|
||||
// 1. 计算本次加上之前的报销总金额
|
||||
BigDecimal totalReimbursement = bXMoney.add(moneyBig);
|
||||
@@ -185,7 +183,7 @@ public class OutlayReimburseApplyServiceImpl extends BaseServiceImpl<OutlayReimb
|
||||
return Result.success();
|
||||
}
|
||||
} else {
|
||||
BigDecimal bXMoney = getBxMoneyByActivityId(budgetId, budget.getIsSchoolBudget());
|
||||
BigDecimal bXMoney = getBxMoneyByActivityId(budgetId);
|
||||
//如果是自己的项目就能超20%
|
||||
//1.算出现在还能报销多少钱
|
||||
BigDecimal twentyPercent = budget.getTotalBudgetMoney().multiply(new BigDecimal("20")).divide(new BigDecimal("100"), 2, BigDecimal.ROUND_HALF_UP);
|
||||
@@ -218,7 +216,7 @@ public class OutlayReimburseApplyServiceImpl extends BaseServiceImpl<OutlayReimb
|
||||
//如果报销的项目是可以重复报销的
|
||||
if (budget.getIsRepeatReimburse()) {
|
||||
//这个预算已经报销了多少钱
|
||||
BigDecimal totalMoney = getBxMoneyByActivityId(budgetId, null);
|
||||
BigDecimal totalMoney = getBxMoneyByActivityId(budgetId );
|
||||
//查出这个活动有没有跟其他预算关联,如果跟其他预算关联了,代表当前这条预算是分工会也能报校工会也能报,
|
||||
// schoolBudgetId字段不为空就代表这条预算是使用的校工会的金额
|
||||
List<ActivityBudget> budgetList = dao().query(ActivityBudget.class,
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
v-model="fileList"
|
||||
:before-read="beforeRead"
|
||||
:after-read="afterRead"
|
||||
:before-delete="beforeDelete"
|
||||
multiple
|
||||
progress
|
||||
:accept="accept"
|
||||
@@ -128,12 +129,16 @@ module.exports = {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
beforeDelete(file) {
|
||||
this.fileList = this.fileList.filter((f) => f.url !== file.url)
|
||||
this.$emit("update:value", this.fileList)
|
||||
},
|
||||
beforeRead(file) {
|
||||
return true
|
||||
},
|
||||
afterRead(files) {
|
||||
this.fileList.map((f) => {
|
||||
if (f.file && f.file.name === files.file.name ) {
|
||||
if (f.file && f.file.name === files.file.name) {
|
||||
f.status = "loading"
|
||||
}
|
||||
})
|
||||
|
||||
@@ -67,6 +67,7 @@ layout("/layouts/platform.html"){
|
||||
<span>{{$moment(scope.row.createdAt).format( 'YYYY-MM-DD')}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="点赞数量" prop="num"></el-table-column>
|
||||
<el-table-column label="操作" width="200">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="primary" @click="$refs.auInfoRef.onOpen(scope.row.id)">查看</el-button>
|
||||
|
||||
@@ -39,7 +39,6 @@ layout("/layouts/platform.html"){
|
||||
|
||||
<el-table :data="tableData" @sort-change="pageOrder" style="width: 100%" row-key="id">
|
||||
<el-table-column label="序号" type="index" width="60px" :index="indexMethod"></el-table-column>
|
||||
<el-table-column label="活动主题" prop="name" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column label="作品名称" prop="name" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column label="主题类型" prop="subjectName" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column label="作品类型" prop="worksName" show-overflow-tooltip></el-table-column>
|
||||
|
||||
@@ -8,8 +8,8 @@ layout("/layouts/platform_h5.html"){
|
||||
}
|
||||
|
||||
.list-card-body {
|
||||
/* width: calc(100% - 140px);
|
||||
display: flex;*/
|
||||
width: calc(100% - 140px);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
}
|
||||
@@ -35,9 +35,6 @@ layout("/layouts/platform_h5.html"){
|
||||
padding: 5px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
.list-card-img img{
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
@@ -47,7 +44,6 @@ layout("/layouts/platform_h5.html"){
|
||||
<year-van-dropdown-item :num="5" @change="doSearch" v-model="pageForm.year"></year-van-dropdown-item>
|
||||
<van-dropdown-item :options="stateList" @change="doSearch" v-model="pageForm.state"></van-dropdown-item>
|
||||
<van-dropdown-item :options="isEnrolledOptions" @change="doSearch" v-model="pageForm.isEnrolledText"></van-dropdown-item>
|
||||
<van-dropdown-item :options="activityTypeOptions" @change="doSearch" v-model="pageForm.activity_type"></van-dropdown-item>
|
||||
</van-dropdown-menu>
|
||||
</van-sticky>
|
||||
|
||||
@@ -119,13 +115,12 @@ layout("/layouts/platform_h5.html"){
|
||||
loading: false,
|
||||
refreshing: false,
|
||||
pageForm: {
|
||||
state: 1,
|
||||
state: 2,
|
||||
isEnrolledText: 0,
|
||||
year: new Date().getFullYear(),
|
||||
pageNumber: 1,
|
||||
pageSize: 5,
|
||||
totalCount: 0,
|
||||
activity_type: 40001
|
||||
totalCount: 0
|
||||
},
|
||||
yearList: [],
|
||||
isEnrolledOptions: [
|
||||
@@ -139,12 +134,7 @@ layout("/layouts/platform_h5.html"){
|
||||
],
|
||||
subLoading: false,
|
||||
viewShow: false,
|
||||
viewData: {},
|
||||
activityTypeOptions: [
|
||||
{ value: 40001, text: "校文化活动" },
|
||||
{ value: 40002, text: "分工会文化活动" },
|
||||
{ value: 40003, text: "协会文化活动" },
|
||||
]
|
||||
viewData: {}
|
||||
}
|
||||
},
|
||||
components: {
|
||||
|
||||
@@ -279,7 +279,7 @@ layout("/layouts/platform_h5.html"){
|
||||
|
||||
<!-- 分工会报名-->
|
||||
<div v-else-if="viewData.signUpMethod===3" class="block">
|
||||
<div class="notice-title left-tag-title">选择报名人员
|
||||
<div class="notice-title left-tag-title">选择报名人员
|
||||
<span v-if="viewData.userNumberLimit===2">
|
||||
,报名人数 <span style="color: red">
|
||||
{{viewData.unionTeamNum}}</span>人
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
<!--#
|
||||
layout("/layouts/platform_h5.html"){
|
||||
#-->
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,112 @@
|
||||
<!--#
|
||||
layout("/layouts/platform_h5.html"){
|
||||
#-->
|
||||
<div id="app">
|
||||
<!-- 导航栏 -->
|
||||
|
||||
<van-nav-bar title="作品上传" left-text="返回" left-arrow placeholder
|
||||
@click-left="historyBack" fixed></van-nav-bar>
|
||||
<van-sticky offset-top="46px">
|
||||
<van-dropdown-menu :close-on-click-outside="false" :close-on-click-overlay="false">
|
||||
<year-van-dropdown-item :num="5" @change="doSearch" v-model="pageForm.year"></year-van-dropdown-item>
|
||||
</van-dropdown-menu>
|
||||
</van-sticky>
|
||||
<table-list api="/platform/activity/worksCollection/upload/pageData"
|
||||
:page_form.sync="pageForm"
|
||||
ref="tableListRef"
|
||||
title="name"
|
||||
@ready="onReady"
|
||||
>
|
||||
<template v-slot="{index,row}">
|
||||
<table-column label="主题类型">{{row.subjectName}}</table-column>
|
||||
<table-column label="作品类型">{{row.worksName}}</table-column>
|
||||
<table-column label="姓名">{{row.userName}}</table-column>
|
||||
<table-column label="上传时间">{{$moment(row.createdAt).format('YYYY-MM-DD')}}</table-column>
|
||||
</template>
|
||||
<template #actions="{index,row}">
|
||||
<div class="action-btn" @click="onView(row)">
|
||||
<i class="fa fa-eye"></i>
|
||||
<span>查看</span>
|
||||
</div>
|
||||
<div class="action-btn" @click="onEdit(row)">
|
||||
<i class="fa fa-edit"></i>
|
||||
<span>编辑</span>
|
||||
</div>
|
||||
<div class="action-btn delete" @click="onDelete(row)">
|
||||
<i class="fa fa-trash"></i>
|
||||
<span>删除</span>
|
||||
</div>
|
||||
</template>
|
||||
</table-list>
|
||||
|
||||
<apply-form ref="applyFormRef"></apply-form>
|
||||
<info ref="infoRef"></info>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
<!--#include('../upload/applyForm.js'){}#-->
|
||||
<!--#include('info.js'){}#-->
|
||||
new Vue({
|
||||
el: "#app",
|
||||
store,
|
||||
data() {
|
||||
return {
|
||||
pageForm: {
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
totalCount: 0,
|
||||
searchKeyword: '',
|
||||
year: new Date().getFullYear(),
|
||||
},
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'apply-form': applyForm,
|
||||
'info': INFO,
|
||||
},
|
||||
methods: {
|
||||
onView(row) {
|
||||
this.$refs.infoRef.onOpen(row)
|
||||
},
|
||||
onEdit(row) {
|
||||
if (this.$moment().isAfter(this.$moment(row.activityEndDateTime))) {
|
||||
this.$toast.fail("活动已结束,无法修改!")
|
||||
return
|
||||
}
|
||||
this.$refs.applyFormRef.onOpenEdit(row)
|
||||
},
|
||||
onDelete(row) {
|
||||
this.$dialog.confirm({
|
||||
title: '温馨提示',
|
||||
message: '您确定要删除吗?',
|
||||
}).then(() => {
|
||||
this.$axios.post("/platform/activity/worksCollection/upload/delete", {id:row.id}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$toast.success(res.msg)
|
||||
this.doSearch()
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
// on cancel
|
||||
});
|
||||
},
|
||||
onReady() {
|
||||
this.doSearch()
|
||||
},
|
||||
doSearch() {
|
||||
this.$nextTick(() => {
|
||||
this.pageForm.pageNumber = 1
|
||||
this.pageForm.totalCount = 0
|
||||
this.$refs.tableListRef.doSearch()
|
||||
})
|
||||
},
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,67 @@
|
||||
const INFO = {
|
||||
template: /*language=HTML*/
|
||||
`
|
||||
<div>
|
||||
<van-action-sheet v-model="visible" :style="{ 'background-color': '#F7F8FA' }" title="报名信息">
|
||||
<div class="detail-container">
|
||||
<van-cell-group>
|
||||
<van-cell title="姓名">
|
||||
{{ viewData.userName }}
|
||||
</van-cell>
|
||||
<van-cell title="工号">
|
||||
{{ viewData.loginName }}
|
||||
</van-cell>
|
||||
<van-cell title="单位">
|
||||
{{ viewData.unitName }}
|
||||
</van-cell>
|
||||
<van-cell title="分工会">
|
||||
{{ viewData.unionName }}
|
||||
</van-cell>
|
||||
<van-cell title="分工会">
|
||||
{{ viewData.unionName }}
|
||||
</van-cell>
|
||||
<van-cell title="作品名称">
|
||||
{{ viewData.name }}
|
||||
</van-cell>
|
||||
<van-cell title="活动主题">
|
||||
{{ viewData.activityName }}
|
||||
</van-cell>
|
||||
<van-cell title="主题类型">
|
||||
{{ viewData.subjectName }}
|
||||
</van-cell>
|
||||
<van-cell title="作品类型">
|
||||
{{ viewData.worksName }}
|
||||
</van-cell>
|
||||
<van-cell title="作品描述" class="direction-column-cell">
|
||||
{{ viewData.description }}
|
||||
</van-cell>
|
||||
<van-cell title="作品附件" class="direction-column-cell">
|
||||
<file-preview :files="viewData.files" complete_result></file-preview>
|
||||
</van-cell>
|
||||
</van-cell-group>
|
||||
</div>
|
||||
</van-action-sheet>
|
||||
</div>
|
||||
`,
|
||||
data() {
|
||||
return {
|
||||
viewData: {},
|
||||
visible: false,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onOpen(row) {
|
||||
this.$axios.post("/platform/activity/worksCollection/common/findOne", {id: row.id}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.viewData = res.data
|
||||
try {
|
||||
this.viewData.files = JSON.parse(this.viewData.files)
|
||||
} catch (err) {
|
||||
}
|
||||
}
|
||||
})
|
||||
this.visible = true
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,159 @@
|
||||
<!--#
|
||||
layout("/layouts/platform_h5.html"){
|
||||
#-->
|
||||
<div id="app">
|
||||
<!-- 导航栏 -->
|
||||
|
||||
<van-nav-bar title="作品阅览" left-text="返回" left-arrow placeholder
|
||||
@click-left="historyBack" fixed></van-nav-bar>
|
||||
<van-sticky offset-top="46px">
|
||||
<van-search
|
||||
:reverse-color="false"
|
||||
:show-action="false"
|
||||
@search="doSearch"
|
||||
input-align="left"
|
||||
placeholder="请输入姓名/工号搜索"
|
||||
v-model="pageForm.searchKeyword"
|
||||
></van-search>
|
||||
<van-dropdown-menu :close-on-click-outside="false" :close-on-click-overlay="false">
|
||||
<van-dropdown-item v-model="pageForm.activityId" :options="activityOptions"
|
||||
@change="doSearch"></van-dropdown-item>
|
||||
</van-dropdown-menu>
|
||||
<van-tabs v-model="pageForm.pageOrderName"
|
||||
@change="doSearch">
|
||||
<van-tab title="按上传时间正序排序" name="createdAt"></van-tab>
|
||||
<van-tab title="按点赞多少倒序排序" name="num"></van-tab>
|
||||
</van-tabs>
|
||||
</van-sticky>
|
||||
<table-list api="/platform/activity/worksCollection/read/h5/pageData"
|
||||
:page_form.sync="pageForm"
|
||||
ref="tableListRef"
|
||||
title="name"
|
||||
@ready="onReady"
|
||||
>
|
||||
<template v-slot="{index,row}">
|
||||
<table-column label="主题类型">{{row.subjectName}}</table-column>
|
||||
<table-column label="作品类型">{{row.worksName}}</table-column>
|
||||
<table-column label="姓名">{{row.userName}}</table-column>
|
||||
<table-column label="上传时间">{{$moment(row.createdAt).format('YYYY-MM-DD')}}</table-column>
|
||||
<table-column label="点赞数">{{row.num}}</table-column>
|
||||
<table-column label="附件">
|
||||
<template v-if="row.files">
|
||||
<file-preview :files="JSON.parse(row.files)" complete_result></file-preview>
|
||||
</template>
|
||||
</table-column>
|
||||
|
||||
</template>
|
||||
<template #actions="{index,row}">
|
||||
<div class="action-btn" @click="onView(row)">
|
||||
<i class="fa fa-eye"></i>
|
||||
<span>查看</span>
|
||||
</div>
|
||||
<template v-if="row.nbCount>0">
|
||||
<div class="action-btn" @click="onLike(row)" v-if="!row.isThisLike">
|
||||
<i class="fa fa-thumbs-o-up"></i>
|
||||
<span>点赞</span>
|
||||
</div>
|
||||
<div class="action-btn" @click="onDeleteLike(row)" v-if="row.isThisLike">
|
||||
<i class="fa fa-thumbs-up"></i>
|
||||
<span>取消点赞</span>
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
</table-list>
|
||||
<info ref="infoRef"></info>
|
||||
|
||||
</div>
|
||||
<script>
|
||||
<!--#include('../mine/info.js'){}#-->
|
||||
new Vue({
|
||||
el: "#app",
|
||||
store,
|
||||
data() {
|
||||
return {
|
||||
pageForm: {
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
totalCount: 0,
|
||||
searchKeyword: '',
|
||||
pageOrderName: 'createdAt',
|
||||
pageOrderNameText: '',
|
||||
activityId: '',
|
||||
year: new Date().getFullYear(),
|
||||
},
|
||||
activityOptions: []
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'info': INFO,
|
||||
},
|
||||
methods: {
|
||||
onLike(row) {
|
||||
this.$dialog.confirm({
|
||||
title: '温馨提示',
|
||||
message: '您确定要点赞吗?',
|
||||
}).then(() => {
|
||||
this.$axios.post("/platform/activity/worksCollection/read/h5/doLike", {uploadId: row.id}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
row.num = row.num + 1
|
||||
row.isThisLike = true
|
||||
this.$toast.success(res.msg)
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
// on cancel
|
||||
});
|
||||
},
|
||||
onDeleteLike(row) {
|
||||
this.$dialog.confirm({
|
||||
title: '温馨提示',
|
||||
message: '您确定要取消点赞吗?',
|
||||
}).then(() => {
|
||||
this.$axios.post("/platform/activity/worksCollection/read/h5/doDeleteLike", {uploadId: row.id}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
row.num = row.num - 1
|
||||
row.isThisLike = false
|
||||
this.$toast.success(res.msg)
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
// on cancel
|
||||
});
|
||||
},
|
||||
onView(row) {
|
||||
this.$refs.infoRef.onOpen(row)
|
||||
},
|
||||
async listActivity() {
|
||||
const res = await this.$axios.post("/platform/activity/worksCollection/common/listActivity")
|
||||
if (res.code === 0) {
|
||||
res.data.forEach(v => {
|
||||
v.text = v.name
|
||||
v.value = v.id
|
||||
})
|
||||
this.activityOptions = res.data
|
||||
if (this.activityOptions.length > 0) {
|
||||
this.pageForm.activityId = this.activityOptions[0].id
|
||||
}
|
||||
}
|
||||
},
|
||||
async onReady() {
|
||||
await this.listActivity()
|
||||
this.doSearch()
|
||||
},
|
||||
doSearch() {
|
||||
this.$nextTick(() => {
|
||||
this.pageForm.pageNumber = 1
|
||||
this.pageForm.totalCount = 0
|
||||
this.$refs.tableListRef.doSearch()
|
||||
})
|
||||
},
|
||||
},
|
||||
created() {
|
||||
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
+191
@@ -0,0 +1,191 @@
|
||||
const applyForm = {
|
||||
template:
|
||||
/*language=HTML*/
|
||||
`
|
||||
<div>
|
||||
<van-action-sheet v-model="visible" :style="{ 'background-color': '#F7F8FA' }" title="报名信息">
|
||||
<van-form ref="formRef" class="form-container">
|
||||
<van-cell-group title="基础信息" class="form-section">
|
||||
<van-field label="姓名" readonly v-model="formData.username"></van-field>
|
||||
<van-field label="工号" readonly v-model="formData.loginname"></van-field>
|
||||
<van-field label="所在单位" readonly v-model="formData.unitName"></van-field>
|
||||
<van-field label="所属工会" readonly v-model="formData.unionName"></van-field>
|
||||
<van-field label="性别" readonly v-model="formData.sex"></van-field>
|
||||
</van-cell-group>
|
||||
<van-cell-group title="报名信息" class="form-section">
|
||||
<van-field label="主题类型"
|
||||
required
|
||||
:rules="[{ required: true, message: '请选择主题类型' }]"
|
||||
readonly
|
||||
is-link
|
||||
@click="showSubjectPicker = true"
|
||||
placeholder="请选择主题类型"
|
||||
name="subjectName"
|
||||
v-model="formData.subjectName">
|
||||
</van-field>
|
||||
<van-popup v-model="showSubjectPicker" position="bottom">
|
||||
<van-picker
|
||||
show-toolbar
|
||||
:columns="subjectTypesOptions.map(v=>v.typeName)"
|
||||
@confirm="onSubjectConfirm"
|
||||
@cancel="showSubjectPicker=false"
|
||||
></van-picker>
|
||||
</van-popup>
|
||||
|
||||
<van-field label="作品类型"
|
||||
required
|
||||
:rules="[{ required: true, message: '请选择作品类型' }]"
|
||||
readonly
|
||||
is-link
|
||||
@click="showWorksPicker = true"
|
||||
placeholder="请选择作品类型"
|
||||
name="worksName"
|
||||
v-model="formData.worksName">
|
||||
</van-field>
|
||||
<van-popup v-model="showWorksPicker" position="bottom">
|
||||
<van-picker
|
||||
show-toolbar
|
||||
:columns="worksTypeOptions.map(v=>v.worksTypeName)"
|
||||
@confirm="onWorksConfirm"
|
||||
@cancel="showWorksPicker=false"
|
||||
></van-picker>
|
||||
</van-popup>
|
||||
|
||||
<van-field label="作品名称"
|
||||
required
|
||||
v-model="formData.name"
|
||||
name="name"
|
||||
placeholder="请填写作品名称"
|
||||
:rules="[{ required: true, message: '请填写作品名称' }]"></van-field>
|
||||
<van-field label="作品描述"
|
||||
v-model="formData.description"
|
||||
type="textarea"
|
||||
name="description"
|
||||
rows="4"
|
||||
autosize
|
||||
maxlength="150"
|
||||
:rules="[{ required: true, message: '请填写作品描述' }]"
|
||||
class="more-text"
|
||||
placeholder="请填写作品描述"></van-field>
|
||||
</van-cell-group>
|
||||
<van-cell-group title="附件">
|
||||
<van-field class="more-text"
|
||||
name="files"
|
||||
:rules="[{ required: true,message:'请上传附件' }]"
|
||||
label=""
|
||||
required>
|
||||
<template #input>
|
||||
<h5-file-upload
|
||||
slot="input"
|
||||
:value.sync="formData.files"
|
||||
:upload_number="chooseWorksType && chooseWorksType.allowFileNum"
|
||||
upload_mode="file"
|
||||
upload_result_category="array"
|
||||
upload_result_type="url"
|
||||
complete_result
|
||||
:accept="fileAccept"
|
||||
></h5-file-upload>
|
||||
</template>
|
||||
</van-field>
|
||||
</van-cell-group>
|
||||
|
||||
<div class="form-actions">
|
||||
<van-button @click="onSubmit" round type="info">提交</van-button>
|
||||
</div>
|
||||
</van-form>
|
||||
|
||||
</van-action-sheet>
|
||||
</div>
|
||||
`,
|
||||
data() {
|
||||
return {
|
||||
row: {},
|
||||
visible: false,
|
||||
formData: {},
|
||||
subjectTypesOptions: [],
|
||||
showSubjectPicker: false,
|
||||
|
||||
worksTypeOptions: [],
|
||||
showWorksPicker: false,
|
||||
|
||||
fileAccept: null,
|
||||
chooseWorksType: {}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async onOpen(row) {
|
||||
this.$set(this.formData, 'username', this.$store.state.user.username)
|
||||
this.$set(this.formData, 'loginname', this.$store.state.user.loginname)
|
||||
this.$set(this.formData, 'unionName', this.$store.state.user.union.name)
|
||||
this.$set(this.formData, 'unitName', this.$store.state.user.unit.name)
|
||||
this.$set(this.formData, 'sex', this.$store.state.user.sex)
|
||||
this.$set(this.formData, 'activityId', row.id)
|
||||
await this.activityChange(row.id)
|
||||
this.row = row
|
||||
this.visible = true
|
||||
},
|
||||
async onOpenEdit(row) {
|
||||
const formData = clone(row)
|
||||
formData.files = JSON.parse(formData.files)
|
||||
await this.activityChange(formData.activityId)
|
||||
await this.subjectChange(formData.subjectId)
|
||||
this.row = formData
|
||||
this.formData = formData
|
||||
this.$set(this.formData, 'username', this.$store.state.user.username)
|
||||
this.$set(this.formData, 'loginname', this.$store.state.user.loginname)
|
||||
this.$set(this.formData, 'sex', this.$store.state.user.sex)
|
||||
this.chooseWorksType = this.worksTypeOptions.find((o) => o.id === formData.worksId)
|
||||
if (this.chooseWorksType.allowFileTypes && this.chooseWorksType.allowFileTypes.length > 0) {
|
||||
this.fileAccept = this.chooseWorksType.allowFileTypes.map((item) => "." + item).join(",")
|
||||
}
|
||||
this.visible = true
|
||||
},
|
||||
onWorksConfirm(value, index) {
|
||||
this.$set(this.formData, 'worksName', value)
|
||||
this.$set(this.formData, 'worksId', this.worksTypeOptions[index].id)
|
||||
this.showWorksPicker = false
|
||||
this.chooseWorksType = this.worksTypeOptions.find((o) => o.id === this.worksTypeOptions[index].id)
|
||||
if (this.chooseWorksType.allowFileTypes && this.chooseWorksType.allowFileTypes.length > 0) {
|
||||
this.fileAccept = this.chooseWorksType.allowFileTypes.map((item) => "." + item).join(",")
|
||||
}
|
||||
},
|
||||
async onSubjectConfirm(value, index) {
|
||||
this.$set(this.formData, 'subjectName', value)
|
||||
this.$set(this.formData, 'subjectId', this.subjectTypesOptions[index].id)
|
||||
await this.subjectChange(this.subjectTypesOptions[index].id)
|
||||
this.showSubjectPicker = false
|
||||
},
|
||||
onSubmit() {
|
||||
this.$refs.formRef.validate().then(() => {
|
||||
this.$dialog.confirm({
|
||||
title: "提示",
|
||||
message: "您确定要提交吗?"
|
||||
}).then(() => {
|
||||
this.$toast.loading({
|
||||
message: '提交中...',
|
||||
forbidClick: true,
|
||||
});
|
||||
this.$axios.post("/platform/activity/worksCollection/upload" + (this.formData.id ? "/update" : "/insert"), {data: JSON.stringify(this.formData)}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$toast.clear();
|
||||
this.$toast.success("提交成功")
|
||||
pjaxReplace("/platform/activity/worksCollection/mine/h5")
|
||||
}
|
||||
})
|
||||
})
|
||||
}).catch();
|
||||
},
|
||||
async activityChange(value) {
|
||||
const resp = await this.$axios.post("/platform/activity/worksCollection/common/getSubjectTypes", {activityId: value})
|
||||
if (resp.code === 0) {
|
||||
this.subjectTypesOptions = resp.data
|
||||
}
|
||||
},
|
||||
async subjectChange(value) {
|
||||
const resp = await this.$axios.post("/platform/activity/worksCollection/common/getWorksTypes", {subjectId: value})
|
||||
if (resp.code === 0) {
|
||||
this.worksTypeOptions = resp.data
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+160
-1
@@ -1,7 +1,166 @@
|
||||
<!--#
|
||||
layout("/layouts/platform_h5.html"){
|
||||
#-->
|
||||
22222222222
|
||||
<style scoped>
|
||||
.info-title {
|
||||
font-weight: bold;
|
||||
background-color: white;
|
||||
padding: 13px;
|
||||
box-shadow: 0 8px 12px #ebedf0;
|
||||
text-align: center !important;
|
||||
}
|
||||
|
||||
.info-container {
|
||||
height: calc(100vh - 46px - 44px);
|
||||
min-height: calc(100vh - 46px - 44px);
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.info-img {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.van-count-down {
|
||||
color: #fff;
|
||||
}
|
||||
</style>
|
||||
<div id="app">
|
||||
<!-- 导航栏 -->
|
||||
|
||||
<van-nav-bar title="作品上传" left-text="返回" left-arrow placeholder
|
||||
@click-left="historyBack" fixed></van-nav-bar>
|
||||
|
||||
<van-sticky offset-top="46px">
|
||||
<van-dropdown-menu :close-on-click-outside="false" :close-on-click-overlay="false">
|
||||
<year-van-dropdown-item :num="5" @change="doSearch" v-model="pageForm.year"></year-van-dropdown-item>
|
||||
<van-dropdown-item v-model="pageForm.activityType" :options="typeOptions" :multiple="false"
|
||||
@change="doSearch"></van-dropdown-item>
|
||||
</van-dropdown-menu>
|
||||
</van-sticky>
|
||||
|
||||
|
||||
<table-list api="/platform/activity/worksCollection/upload/h5/activityPageData"
|
||||
:page_form.sync="pageForm"
|
||||
ref="tableListRef"
|
||||
title="name"
|
||||
img="cover"
|
||||
@ready="onReady"
|
||||
>
|
||||
<template v-slot="{index,row}">
|
||||
<table-column label="面向对象">{{row.activityGroupName}}</table-column>
|
||||
<table-column label="报名时间">
|
||||
{{$moment(row.startDateTime).format('MM/DD HH:mm')
|
||||
+ '~' + $moment(row.endDateTime).format('MM/DD HH:mm')}}
|
||||
</table-column>
|
||||
</template>
|
||||
<template #actions="{index,row}">
|
||||
<div class="action-btn" @click="onView(row)">
|
||||
<i class="fa fa-eye"></i>
|
||||
<span>查看介绍</span>
|
||||
</div>
|
||||
<div class="action-btn" @click="onApply(row)">
|
||||
<i class="fa fa-edit"></i>
|
||||
<span>去报名</span>
|
||||
</div>
|
||||
</template>
|
||||
</table-list>
|
||||
|
||||
<van-action-sheet v-model="infoVisible" title="详细信息">
|
||||
<div class="info-container">
|
||||
<van-image class="info-img" height="186" width="100%" :src="infoRow.cover"></van-image>
|
||||
<div class="info-title">{{infoRow.name}}</div>
|
||||
<pdf-preview style="height: calc(100vh - 46px - 44px - 186px - 57px)"
|
||||
:content="infoRow.content"></pdf-preview>
|
||||
</div>
|
||||
<div class="form-container">
|
||||
<div class="form-actions">
|
||||
|
||||
<van-button @click="onApply(infoRow)" type="primary" block>
|
||||
<span v-if="time >= 0">
|
||||
去报名
|
||||
</span>
|
||||
<template v-else>
|
||||
距离开始
|
||||
<van-count-down :time="Math.abs(time)" class="count-down" format="DD 天 HH 时 mm 分 ss 秒"
|
||||
@finish="time = 0"></van-count-down>
|
||||
</template>
|
||||
</van-button>
|
||||
</div>
|
||||
</div>
|
||||
</van-action-sheet>
|
||||
|
||||
<apply-form ref="applyFormRef"></apply-form>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
<!--#include('applyForm.js'){}#-->
|
||||
new Vue({
|
||||
el: "#app",
|
||||
store,
|
||||
data() {
|
||||
return {
|
||||
time: 0,
|
||||
pageForm: {
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
totalCount: 0,
|
||||
searchKeyword: '',
|
||||
year: new Date().getFullYear(),
|
||||
activityType: 2,
|
||||
},
|
||||
typeOptions: [
|
||||
{text: '全部', value: 1},
|
||||
{text: '即将开始', value: 4},
|
||||
{text: '报名中', value: 2},
|
||||
{text: '已结束', value: 3},
|
||||
],
|
||||
infoVisible: false,
|
||||
infoRow: {},
|
||||
|
||||
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'apply-form': applyForm,
|
||||
"pdf-preview": httpVueLoader("/components/plugins/sysFilePreview/PdfIndex.vue?v=" + new Date().getTime())
|
||||
},
|
||||
methods: {
|
||||
onApply(row) {
|
||||
if (this.$moment().isBefore(this.$moment(row.startDateTime))) {
|
||||
this.onView(row)
|
||||
return
|
||||
}
|
||||
if (this.$moment().isAfter(this.$moment(row.endDateTime))) {
|
||||
this.$toast.fail("活动已结束")
|
||||
return
|
||||
}
|
||||
this.$refs.applyFormRef.onOpen(row)
|
||||
},
|
||||
onView(row) {
|
||||
this.infoRow = row
|
||||
this.time = this.$moment().diff(this.$moment(row.startDateTime), 'milliseconds')
|
||||
this.infoVisible = true
|
||||
},
|
||||
onReady() {
|
||||
this.doSearch()
|
||||
},
|
||||
doSearch() {
|
||||
this.$nextTick(() => {
|
||||
this.pageForm.pageNumber = 1
|
||||
this.pageForm.totalCount = 0
|
||||
this.$refs.tableListRef.doSearch()
|
||||
})
|
||||
},
|
||||
},
|
||||
created() {
|
||||
},
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>Title</title>
|
||||
</head>
|
||||
<body></body>
|
||||
</html>
|
||||
@@ -84,7 +84,7 @@ const H5_ASSET_INFO = {
|
||||
<div style="white-space: pre">{{item.oldAssetNotes}}</div>
|
||||
</van-cell>
|
||||
<van-cell title="旧资产图片" class="direction-column-cell">
|
||||
{{item.oldAssetFiles}}
|
||||
<file-preview :files="item.oldAssetFiles" complete_result></file-preview>
|
||||
</van-cell>
|
||||
</van-cell-group>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user