This commit is contained in:
Paidax
2024-11-22 16:56:54 +08:00
parent 9c21da4f0f
commit f5d37974cd
146 changed files with 8256 additions and 7800 deletions
+19
View File
@@ -259,6 +259,25 @@
</exclusion> </exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
<dependency>
<groupId>com.luhuiguo</groupId>
<artifactId>aspose-words</artifactId>
<version>23.1</version>
</dependency>
<!--xlsx或xls转pdf-->
<dependency>
<groupId>com.luhuiguo</groupId>
<artifactId>aspose-cells</artifactId>
<version>23.1</version>
</dependency>
<!--ppt转pdf-->
<dependency>
<groupId>com.luhuiguo</groupId>
<artifactId>aspose-slides</artifactId>
<version>23.1</version>
</dependency>
<dependency> <dependency>
<groupId>org.nutz</groupId> <groupId>org.nutz</groupId>
<artifactId>nutzboot-starter-test-junit4</artifactId> <artifactId>nutzboot-starter-test-junit4</artifactId>
+16 -7
View File
@@ -1,18 +1,18 @@
package io.v.nutz.base.utils; package io.v.nutz.base.utils;
import com.deepoove.poi.data.PictureRenderData; import com.deepoove.poi.data.PictureRenderData;
import com.deepoove.poi.data.PictureType;
import io.v.nutz.base.service.BaseService; import io.v.nutz.base.service.BaseService;
import io.v.nutz.sys.models.*; import io.v.nutz.sys.models.*;
import io.v.nutz.zhgh.jdh.model.cb.Jdh_jdhxx;
import io.v.nutz.sys.services.SysMenuService; import io.v.nutz.sys.services.SysMenuService;
import io.v.nutz.sys.services.SysUserRoleService; import io.v.nutz.sys.services.SysUserRoleService;
import io.v.nutz.sys.services.SysUserService; import io.v.nutz.sys.services.SysUserService;
import io.v.nutz.web.commons.utils.ShiroUtil; import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.jdh.model.cb.Jdh_jdhxx;
import org.nutz.boot.starter.ftp.FtpService; import org.nutz.boot.starter.ftp.FtpService;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
import org.nutz.dao.Dao; import org.nutz.dao.Dao;
import org.nutz.dao.Sqls; import org.nutz.dao.Sqls;
import org.nutz.dao.entity.Record;
import org.nutz.dao.sql.Sql; import org.nutz.dao.sql.Sql;
import org.nutz.dao.util.Daos; import org.nutz.dao.util.Daos;
import org.nutz.ioc.loader.annotation.Inject; import org.nutz.ioc.loader.annotation.Inject;
@@ -24,6 +24,7 @@ import org.nutz.mvc.Mvcs;
import javax.servlet.http.Cookie; import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.io.ByteArrayOutputStream;
import java.io.IOException; import java.io.IOException;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@@ -48,6 +49,9 @@ public class Vi {
@Inject @Inject
private SysUserRoleService sysUserRoleService; private SysUserRoleService sysUserRoleService;
@Inject
private static FtpService ftpService;
/** /**
* @return 当前登录用户的福利单位 * @return 当前登录用户的福利单位
*/ */
@@ -191,9 +195,16 @@ public class Vi {
} }
public static PictureRenderData getImg(String base64) throws IOException { public static PictureRenderData getImg(String base64) throws IOException {
String s = base64.split(",")[1]; if (base64.startsWith(base64)) {
byte[] bytes = Base64.getDecoder().decode(s); String s = base64.split(",")[1];
return new PictureRenderData(70, 30, ".png", bytes); byte[] bytes = Base64.getDecoder().decode(s);
return new PictureRenderData(70, 30, ".png", bytes);
} else {
ByteArrayOutputStream os = new ByteArrayOutputStream();
ftpService.download(base64, os);
os.close();
return new PictureRenderData(70, 30, PictureType.PNG, os.toByteArray());
}
} }
public static String getCron(Date time) { public static String getCron(Date time) {
@@ -250,8 +261,6 @@ public class Vi {
}); });
} }
@Inject
private FtpService ftpService;
public void deleteSysFiles(List<Sys_file> files) { public void deleteSysFiles(List<Sys_file> files) {
try { try {
@@ -85,8 +85,9 @@ public class SysAppController {
List<LoglevelProperty> list = (List) entry.getValue(); List<LoglevelProperty> list = (List) entry.getValue();
for (LoglevelProperty property : list) { for (LoglevelProperty property : list) {
NutMap nutMap = NutMap.NEW().addv("hostName", property.getHostName()).addv("hostAddress", property.getHostAddress()); NutMap nutMap = NutMap.NEW().addv("hostName", property.getHostName()).addv("hostAddress", property.getHostAddress());
if (!hostList.contains(nutMap)) if (!hostList.contains(nutMap)) {
hostList.add(nutMap); hostList.add(nutMap);
}
if (Strings.isBlank(hostName) || (Strings.isNotBlank(hostName) && property.getHostName().equals(hostName))) { if (Strings.isBlank(hostName) || (Strings.isNotBlank(hostName) && property.getHostName().equals(hostName))) {
dataList.add(property); dataList.add(property);
} }
@@ -0,0 +1,125 @@
package io.v.nutz.sys.controllers.platform.sys;
import cn.hutool.core.util.StrUtil;
import cn.wizzer.framework.base.Result;
import cn.wizzer.framework.page.Pagination;
import io.v.nutz.sys.models.Sys_home_activity;
import io.v.nutz.sys.param.SysHomeActivityPageForm;
import io.v.nutz.sys.services.SysHomeActivityService;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.activity.models.ActivityUserScope;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.dao.*;
import org.nutz.dao.sql.Sql;
import org.nutz.dao.util.Daos;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.Lang;
import org.nutz.lang.util.NutMap;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import javax.validation.Valid;
import java.util.ArrayList;
import java.util.List;
@IocBean
@At("/platform/sys/homeActivity")
@Ok("json:full")
public class SysHomeActivityController {
@Inject
private Dao dao;
@Inject
private SysHomeActivityService sysHomeActivityService;
@At("")
@Ok("beetl:/platform/sys/homeActivity/index.html")
@RequiresPermissions("sys.homeActivity")
public void index() {
}
@At
@RequiresPermissions("sys.homeActivity")
public Object pageData(SysHomeActivityPageForm pageForm) {
Cnd cnd = Cnd.NEW();
cnd.and(Cnd.likeEX("`name`",pageForm.getName()));
cnd.desc("sortNo");
Pagination pagination = sysHomeActivityService.listPage(pageForm.getPageNumber(), pageForm.getPageSize(), cnd);
return Result.success(pagination);
}
@At
@RequiresPermissions("sys.homeActivity")
public Object enable(@Valid String id) {
sysHomeActivityService.update(Chain.make("enable", 1), Cnd.where("id", "=", id));
return Result.success();
}
@At
@RequiresPermissions("sys.homeActivity")
public Object disable(@Valid String id) {
sysHomeActivityService.update(Chain.make("enable", 0), Cnd.where("id", "=", id));
return Result.success();
}
@At
@RequiresPermissions("sys.homeActivity")
public Object topUp(@Valid String id){
Sys_home_activity sysHomeActivity = new Sys_home_activity();
sysHomeActivity.setId(id);
sysHomeActivity.setTop(true);
sysHomeActivityService.updateIgnoreNull(sysHomeActivity);
return Result.success();
}
@At
@RequiresPermissions("sys.homeActivity")
public Object cancelTopUp(@Valid String id){
Sys_home_activity sysHomeActivity = new Sys_home_activity();
sysHomeActivity.setId(id);
sysHomeActivity.setTop(false);
sysHomeActivityService.updateIgnoreNull(sysHomeActivity);
return Result.success();
}
@At
@RequiresAuthentication
public Result listHomeActivity() {
FieldFilter fieldFilter = FieldFilter.locked(Sys_home_activity.class, "classPath");
List<Sys_home_activity> list = Daos.ext(dao,fieldFilter) .query(Sys_home_activity.class, Cnd.where("enable", "=", 1).desc("top"));
String userId = ShiroUtil.getUserId();
List<Sys_home_activity> allowActivityList = new ArrayList<>();
for (Sys_home_activity activity : list) {
Integer allowUserGroupId = activity.getAllowUserGroupId();
String allowUserSql = activity.getAllowUserSql();
activity.setAllowUserSql(null);
if (allowUserGroupId == null && StrUtil.isBlank(allowUserSql)) {
allowActivityList.add(activity);
continue;
}
if (allowUserGroupId != null) {
int count = dao.count(ActivityUserScope.class, Cnd.where("groupId", "=", allowUserGroupId).and("userId", "=", userId));
if (count > 0) {
allowActivityList.add(activity);
continue;
}
}
if (StrUtil.isNotBlank(allowUserSql)){
Sql sql = Sqls.create(allowUserSql).setParam("userId", userId);
NutMap nutMap = (NutMap) Daos.query(dao, sql.toString(), Sqls.callback.map());
if (Lang.isNotEmpty(nutMap) && StrUtil.isNotBlank(nutMap.getString("userId"))) {
allowActivityList.add(activity);
}
}
}
return Result.success(allowActivityList);
}
}
@@ -35,6 +35,10 @@ public class SysAppModule extends BaseModel {
@Column @Column
private Boolean enable; private Boolean enable;
@ColDefine(type = ColType.VARCHAR, width = 500)
@Comment("图标")
@Column
private String iconClass;
/** /**
* 子菜单 * 子菜单
*/ */
@@ -0,0 +1,83 @@
package io.v.nutz.sys.models;
import io.v.nutz.base.model.BaseModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.nutz.dao.entity.annotation.*;
import java.util.Date;
@EqualsAndHashCode(callSuper = true)
@Data
@Table
@Comment("首页活动")
public class Sys_home_activity extends BaseModel {
@Name
@ColDefine(type = ColType.VARCHAR, width = 32)
@Comment("主键ID,和业务ID保持一致")
private String id;
@Column
@ColDefine(type = ColType.VARCHAR, width = 50)
@Comment("活动名称")
private String name;
@Column
@ColDefine(type = ColType.VARCHAR, width = 255)
@Comment("活动封面")
private String cover;
@Column
@ColDefine(type = ColType.VARCHAR, width = 1000)
@Comment("活动链接")
private String url;
@Column
@ColDefine(type = ColType.VARCHAR, width = 1000)
@Comment("h5活动链接")
private String h5Url;
@Column
@ColDefine(type = ColType.INT)
@Comment("面向人员分组ID")
private Integer allowUserGroupId;
@Column
@ColDefine(type = ColType.VARCHAR, width = 1000)
@Comment("允许查看的人员sql")
private String allowUserSql;
@Column
@ColDefine(type = ColType.BOOLEAN)
@Comment("是否启用")
@Default("0")
private Boolean enable;
@Column
@Comment("类路径")
@ColDefine(type = ColType.VARCHAR, width = 500)
private String classPath;
@Column
@Comment("是否置顶")
@ColDefine(type = ColType.BOOLEAN)
@Default("0")
private Boolean top;
@Column
@Comment("排序号")
@Default("0")
private Integer sortNo;
@Column
@Comment("开始时间")
@ColDefine(type = ColType.DATETIME)
private Date startDate;
@Column
@Comment("结束时间")
@ColDefine(type = ColType.DATETIME)
private Date endDate;
}
@@ -0,0 +1,13 @@
package io.v.nutz.sys.param;
import io.v.nutz.base.query.PageForm;
import lombok.Data;
import lombok.EqualsAndHashCode;
@EqualsAndHashCode(callSuper = true)
@Data
public class SysHomeActivityPageForm extends PageForm {
private String name;
}
@@ -0,0 +1,8 @@
package io.v.nutz.sys.services;
import cn.wizzer.framework.base.service.BaseService;
import io.v.nutz.sys.models.Sys_home_activity;
public interface SysHomeActivityService extends BaseService<Sys_home_activity> {
}
@@ -0,0 +1,10 @@
package io.v.nutz.sys.services;
import io.v.nutz.sys.models.Sys_home_activity;
public interface SysHomeConvert {
Sys_home_activity covertToSysHomeActivity();
}
@@ -0,0 +1,15 @@
package io.v.nutz.sys.services.impl;
import cn.wizzer.framework.base.service.BaseServiceImpl;
import io.v.nutz.sys.models.Sys_home_activity;
import io.v.nutz.sys.services.SysHomeActivityService;
import org.nutz.dao.Dao;
import org.nutz.ioc.loader.annotation.IocBean;
@IocBean(args = {"refer:dao"})
public class SysHomeActivityServiceImpl extends BaseServiceImpl<Sys_home_activity> implements SysHomeActivityService {
public SysHomeActivityServiceImpl(Dao dao) {
super(dao);
}
}
@@ -6,15 +6,17 @@ import cn.wizzer.framework.base.Result;
import com.artofsolving.jodconverter.openoffice.connection.OpenOfficeConnection; import com.artofsolving.jodconverter.openoffice.connection.OpenOfficeConnection;
import com.artofsolving.jodconverter.openoffice.connection.SocketOpenOfficeConnection; import com.artofsolving.jodconverter.openoffice.connection.SocketOpenOfficeConnection;
import com.artofsolving.jodconverter.openoffice.converter.StreamOpenOfficeDocumentConverter; import com.artofsolving.jodconverter.openoffice.converter.StreamOpenOfficeDocumentConverter;
import com.aspose.words.*;
import io.v.nutz.sys.models.Sys_file; import io.v.nutz.sys.models.Sys_file;
import io.v.nutz.sys.models.Sys_log; import io.v.nutz.sys.models.Sys_log;
import io.v.nutz.sys.models.Sys_user; import io.v.nutz.sys.models.Sys_user;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.web.commons.slog.SLogService; import io.v.nutz.web.commons.slog.SLogService;
import io.v.nutz.web.commons.utils.ShiroUtil;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import net.coobird.thumbnailator.Thumbnails; import net.coobird.thumbnailator.Thumbnails;
import org.apache.commons.io.FilenameUtils; import org.apache.commons.io.FilenameUtils;
import org.apache.shiro.authz.annotation.RequiresAuthentication; import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.jsoup.Jsoup;
import org.nutz.boot.starter.ftp.FtpService; import org.nutz.boot.starter.ftp.FtpService;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
import org.nutz.dao.Dao; import org.nutz.dao.Dao;
@@ -40,7 +42,10 @@ import java.nio.file.Files;
import java.nio.file.Path; import java.nio.file.Path;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Base64;
import java.util.List; import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/** /**
* @FileName io.v.nutz.web.commons.controller.FilePreviewController * @FileName io.v.nutz.web.commons.controller.FilePreviewController
@@ -58,6 +63,8 @@ public class FileServerController {
@Inject @Inject
private PropertiesProxy conf; private PropertiesProxy conf;
private static final String IMG_BASE64_PATTERN = "<img\\s+[^>]*src\\s*=\\s*['\"](data:image/[^'\"]+;base64,[^'\"]+)['\"][^>]*>";
private static final List<String> IMGTYPES = new ArrayList<>() {{ private static final List<String> IMGTYPES = new ArrayList<>() {{
add("JPG"); add("JPG");
add("JPEG"); add("JPEG");
@@ -377,4 +384,68 @@ public class FileServerController {
} }
@At
@AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"})
@RequiresAuthentication
@Ok("json")
public Object convertHtml(TempFile file) {
try {
Document doc = new Document(file.getInputStream());
for (Shape shape : (Iterable<Shape>) doc.getChildNodes(NodeType.SHAPE, true)) {
if (shape.hasImage()) {
ImageSize imageSize = shape.getImageData().getImageSize();
shape.setWidth(imageSize.getWidthPoints());
shape.setHeight(imageSize.getHeightPoints());
}
}
HtmlSaveOptions saveOptions = new HtmlSaveOptions();
saveOptions.setExportImagesAsBase64(true);
ByteArrayOutputStream bos = new ByteArrayOutputStream();
doc.save(bos, saveOptions);
String htmlContent = Jsoup.parse(bos.toString()).body().html();
Pattern pattern = Pattern.compile(IMG_BASE64_PATTERN, Pattern.CASE_INSENSITIVE);
Matcher matcher = pattern.matcher(htmlContent);
StringBuffer sb = new StringBuffer();
while (matcher.find()) {
String srcValue = matcher.group(1);
String[] parts = srcValue.split(";base64,");
String base64Content = parts[1];
try{
//转为在线地址 base64很喜欢被信息中心拦截
byte[] imageBytes = Base64.getDecoder().decode(base64Content);
// 获取当前上传时间
LocalDateTime uploadTime = LocalDateTime.now();
String folderPath = String.format("/%04d/%02d/%02d/", uploadTime.getYear(), uploadTime.getMonthValue(), uploadTime.getDayOfMonth());
//文件id
String fileId = R.UU64();
String filePath = folderPath + fileId + ".png";
boolean uploadRes = ftpService.upload(folderPath, fileId + ".png", new ByteArrayInputStream(imageBytes));
if (uploadRes) {
//上传成功记录到文件表
Sys_file sys_file = new Sys_file();
sys_file.setFilename(fileId + ".png");
sys_file.setFilepath(filePath);
sys_file.setSource(null);
dao.insert(sys_file);
String imgUrl = "/file_server/fileStreamPreview?id=" + sys_file.getId();
String replacement = "<img src=\"" + imgUrl + "\">";
matcher.appendReplacement(sb, Matcher.quoteReplacement(replacement));
} else {
throw new RuntimeException("上传文件失败");
}
}catch (Exception e){
matcher.appendReplacement(sb, Matcher.quoteReplacement("<img src=>"));
}
}
matcher.appendTail(sb);
return Result.success().addData(sb.toString());
} catch (Exception e) {
log.error("文件转换HTML异常", e);
throw new RuntimeException("文件读取失败");
}
}
} }
@@ -2,11 +2,11 @@ package io.v.nutz.web.commons.controller;
import cn.hutool.core.codec.Base64; import cn.hutool.core.codec.Base64;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.io.IoUtil;
import cn.wizzer.framework.base.Result; import cn.wizzer.framework.base.Result;
import com.aliyun.core.utils.Base64Util; import io.v.nutz.sys.models.Sys_file;
import org.apache.shiro.authz.annotation.RequiresAuthentication; import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.nutz.boot.starter.ftp.FtpService; import org.nutz.boot.starter.ftp.FtpService;
import org.nutz.dao.Dao;
import org.nutz.integration.jedis.RedisService; import org.nutz.integration.jedis.RedisService;
import org.nutz.ioc.loader.annotation.Inject; import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean; import org.nutz.ioc.loader.annotation.IocBean;
@@ -28,6 +28,9 @@ import java.io.InputStream;
@At("/signature") @At("/signature")
public class SignatureController { public class SignatureController {
@Inject
private Dao dao;
@Inject @Inject
private RedisService redisService; private RedisService redisService;
@@ -65,8 +68,18 @@ public class SignatureController {
String replaceData = base64.replaceAll("data:image/png;base64,", ""); String replaceData = base64.replaceAll("data:image/png;base64,", "");
try (InputStream is = new ByteArrayInputStream(Base64.decode(replaceData))) { try (InputStream is = new ByteArrayInputStream(Base64.decode(replaceData))) {
ftpService.upload(todayPath, fileName, is); boolean uploadRes = ftpService.upload(todayPath, fileName, is);
redisService.setex(prefix + ":" + id, 60 * 10, fullPath); if (uploadRes) {
//上传成功记录到文件表
Sys_file sysFile = new Sys_file();
sysFile.setFilename(fileName);
sysFile.setFilepath(fullPath);
sysFile.setSource(null);
dao.insert(sysFile);
redisService.setex(prefix + ":" + id, 60 * 10, fullPath);
} else {
throw new RuntimeException("上传文件失败");
}
} catch (Exception e) { } catch (Exception e) {
return Result.error("签字数据上传失败"); return Result.error("签字数据上传失败");
} }
@@ -111,9 +124,18 @@ public class SignatureController {
String replaceData = data.replaceAll("data:image/png;base64,", ""); String replaceData = data.replaceAll("data:image/png;base64,", "");
try (InputStream is = new ByteArrayInputStream(Base64.decode(replaceData))) { try (InputStream is = new ByteArrayInputStream(Base64.decode(replaceData))) {
ftpService.upload(todayPath, fileName, is); boolean uploadRes = ftpService.upload(todayPath, fileName, is);
if (uploadRes) {
//上传成功记录到文件表
Sys_file sysFile = new Sys_file();
sysFile.setFilename(fileName);
sysFile.setFilepath(fullPath);
sysFile.setSource(null);
dao.insert(sysFile);
} else {
throw new RuntimeException("上传文件失败");
}
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace();
return Result.error("签字数据上传失败"); return Result.error("签字数据上传失败");
} }
@@ -45,6 +45,8 @@ import org.springframework.util.StringUtils;
import java.util.*; import java.util.*;
import java.util.concurrent.*; import java.util.concurrent.*;
import java.util.concurrent.atomic.AtomicReference; import java.util.concurrent.atomic.AtomicReference;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@@ -124,7 +126,7 @@ public class SourceUserServiceImpl extends ViServiceImpl<UserSource> implements
//新增的用户 //新增的用户
List<Sys_user> needInitUserList = new CopyOnWriteArrayList<>(); List<Sys_user> needInitUserList = new CopyOnWriteArrayList<>();
//添加角色的用户 //添加角色的用户
List<Sys_user_role> userRoles = new ArrayList<>(); List<Sys_user_role> userRoles = new CopyOnWriteArrayList<>();
// 创建一个固定大小的线程池 可以根据服务器性能调整线程池大小 // 创建一个固定大小的线程池 可以根据服务器性能调整线程池大小
int numberOfThreads = Runtime.getRuntime().availableProcessors() * 2; int numberOfThreads = Runtime.getRuntime().availableProcessors() * 2;
@@ -172,7 +174,7 @@ public class SourceUserServiceImpl extends ViServiceImpl<UserSource> implements
} }
} }
List<UserChangeType> changeTypes = getChangeTypes(source, user); List<UserChangeType> changeTypes = getChangeTypes(source, user, sourceType);
if (changeTypes.contains(UserChangeType.NEW)) { if (changeTypes.contains(UserChangeType.NEW)) {
user = UserMode.initUser(u); user = UserMode.initUser(u);
needInitUserList.add(user); needInitUserList.add(user);
@@ -233,35 +235,36 @@ public class SourceUserServiceImpl extends ViServiceImpl<UserSource> implements
dao().clear(UserSource.class, Cnd.where("DATE(pullTime)", "<", formatAgoWeekDate)); dao().clear(UserSource.class, Cnd.where("DATE(pullTime)", "<", formatAgoWeekDate));
} }
private List<UserChangeType> getChangeTypes(Sys_user source, Sys_user user) { private List<UserChangeType> getChangeTypes(Sys_user source, Sys_user user, String sourceType) {
List<UserChangeType> userChangeTypes = new ArrayList<>(); List<UserChangeType> userChangeTypes = new ArrayList<>();
if (user == null) { if (user == null) {
userChangeTypes.add(UserChangeType.NEW); userChangeTypes.add(UserChangeType.NEW);
return userChangeTypes; } else {
} if ("add".equals(sourceType)) {
if (!StringUtils.isEmpty(source.getUnitid()) && !source.getUnitid().equals(user.getUnitid())) { return userChangeTypes;
userChangeTypes.add(UserChangeType.UNIT_CHANGE); }
} if (!StringUtils.isEmpty(source.getUnitid()) && !source.getUnitid().equals(user.getUnitid())) {
if (!StringUtils.isEmpty(user.getUserState()) && StrUtil.isNotEmpty(source.getUserState()) && !source.getUserState().equals(user.getUserState())) { userChangeTypes.add(UserChangeType.UNIT_CHANGE);
for (UserChangeType value : UserChangeType.values()) { }
if (value.getDescription().equals(source.getUserState())) { if (StrUtil.isNotBlank(user.getUserState()) && StrUtil.isNotEmpty(source.getUserState()) && !source.getUserState().equals(user.getUserState())) {
userChangeTypes.add(value); for (UserChangeType value : UserChangeType.values()) {
if (value.getDescription().equals(source.getUserState())) {
userChangeTypes.add(value);
}
}
}
List<String> columns = List.of("nation", "birthday", "personType", "political", "schoolTime", "jobTitle", "education", "academicDegree", "position");
for (String column : columns) {
NutMap userSourceMap = Lang.obj2nutmap(source);
NutMap userMap = Lang.obj2nutmap(user);
String sourceValue = userSourceMap.getString(column, "");
String value = userMap.getString(column, "");
if (!sourceValue.equals(value) && StrUtil.isNotBlank(sourceValue)) {
userChangeTypes.add(UserChangeType.BASIC_CHANGE);
break;
} }
} }
} }
List<String> columns = List.of("nation", "birthday", "personType", "political", "schoolTime", "jobTitle", "education", "academicDegree", "position", "leaveSchoolDate", "retireDate");
for (String column : columns) {
NutMap userSourceMap = Lang.obj2nutmap(source);
NutMap userMap = Lang.obj2nutmap(user);
String sourceValue = userSourceMap.getString(column, "");
String value = userMap.getString(column, "");
if (!sourceValue.equals(value) && StrUtil.isNotBlank(sourceValue)) {
userChangeTypes.add(UserChangeType.BASIC_CHANGE);
break;
}
}
return userChangeTypes; return userChangeTypes;
} }
@@ -300,53 +303,51 @@ public class SourceUserServiceImpl extends ViServiceImpl<UserSource> implements
* @param filterColumnDao 部分更新传递(部分更新存在过滤字段) * @param filterColumnDao 部分更新传递(部分更新存在过滤字段)
*/ */
private void massUpdatesAsync(List<Sys_user> needDoUpdateList, Boolean isPart, AtomicReference<Dao> filterColumnDao) { private void massUpdatesAsync(List<Sys_user> needDoUpdateList, Boolean isPart, AtomicReference<Dao> filterColumnDao) {
// 根据服务器性能和任务特性动态确定线程池大小;通常,线程池大小为CPU核心数的2倍 // 创建一个CPU核心数的2倍的线程池
int numberOfThreads = Runtime.getRuntime().availableProcessors() * 2; int numberOfThreads = Runtime.getRuntime().availableProcessors() * 2;
ExecutorService executorService = Executors.newFixedThreadPool(numberOfThreads); ExecutorService executorService = Executors.newFixedThreadPool(numberOfThreads);
ExecutorCompletionService<Void> ecs = new ExecutorCompletionService<>(executorService); ExecutorCompletionService<Void> ecs = new ExecutorCompletionService<>(executorService);
// 每批处理的数据量 int batchSize = 200;
int batchSize = 100; // 共享锁
Lock lock = new ReentrantLock();
try { try {
// 将sources分成若干批
for (int i = 0; i < needDoUpdateList.size(); i += batchSize) { for (int i = 0; i < needDoUpdateList.size(); i += batchSize) {
final int end = Math.min(i + batchSize, needDoUpdateList.size()); final int end = Math.min(i + batchSize, needDoUpdateList.size());
List<Sys_user> batch = needDoUpdateList.subList(i, end); List<Sys_user> batch = needDoUpdateList.subList(i, end);
// 提交任务给线程池执行
ecs.submit(() -> { ecs.submit(() -> {
Dao daoToUse = isPart ? filterColumnDao.get() : dao(); Dao daoToUse = isPart ? filterColumnDao.get() : dao();
// 执行数据库更新操作 lock.lock();
synchronized (daoToUse) { try {
daoToUse.updateIgnoreNull(batch); daoToUse.updateIgnoreNull(batch);
} finally {
lock.unlock();
} }
return null; // CompletionService需要一个返回值,这里返回null return null;
}); });
} }
// 等待所有任务完成
for (int i = 0; i < needDoUpdateList.size(); i += batchSize) { for (int i = 0; i < needDoUpdateList.size(); i += batchSize) {
try { try {
Future<Void> future = ecs.take(); Future<Void> future = ecs.take();
future.get(); // 等待任务完成 future.get();
} catch (InterruptedException | ExecutionException e) { } catch (InterruptedException | ExecutionException e) {
Thread.currentThread().interrupt(); // 恢复中断状态 Thread.currentThread().interrupt();
throw new RuntimeException(e); throw new RuntimeException("Error during batch update", e);
} }
} }
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); log.error("Error in massUpdatesAsync", e);
throw new RuntimeException("Error in massUpdatesAsync", e);
} finally { } finally {
// 关闭线程池
executorService.shutdown(); executorService.shutdown();
try { try {
// 设置合理的超时时间,防止无限期阻塞
if (!executorService.awaitTermination(10, TimeUnit.SECONDS)) { if (!executorService.awaitTermination(10, TimeUnit.SECONDS)) {
executorService.shutdownNow(); // 如果超时,强制关闭 executorService.shutdownNow();
} }
} catch (InterruptedException e) { } catch (InterruptedException e) {
Thread.currentThread().interrupt(); // 恢复中断状态 Thread.currentThread().interrupt();
} }
} }
} }
@@ -1,17 +1,17 @@
package io.v.nutz.zhgh.jf.controller.Funds; package io.v.nutz.zhgh.jf.controller.Funds;
import io.v.nutz.zhgh.activity.models.ActivityTissue;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.zhgh.jf.model.ActivityBx;
import io.v.nutz.zhgh.jf.service.ActivityBxService;
import io.v.nutz.base.service.ViService; import io.v.nutz.base.service.ViService;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.sys.models.Sys_club_user; import io.v.nutz.sys.models.Sys_club_user;
import io.v.nutz.web.commons.utils.ShiroUtil; import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.activity.models.ActivityTissue;
import io.v.nutz.zhgh.jf.service.ActivityBxService;
import org.apache.shiro.authz.annotation.Logical; import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresAuthentication; import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.dao.Sqls; import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql; import org.nutz.dao.sql.Sql;
import org.nutz.dao.util.cri.Static; import org.nutz.dao.util.cri.Static;
@@ -23,8 +23,6 @@ import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param; import org.nutz.mvc.annotation.Param;
import java.util.Calendar; import java.util.Calendar;
import java.util.List;
import java.util.stream.Collectors;
/** /**
* @author zhf * @author zhf
@@ -44,6 +42,8 @@ public class FundsApplyController {
@Inject @Inject
private Vi vi; private Vi vi;
@Inject @Inject
private Dao dao;
@Inject
private ActivityBxService activityBxService; private ActivityBxService activityBxService;
@Inject("ActivityTissue") @Inject("ActivityTissue")
private ViService<ActivityTissue> tissueViService; private ViService<ActivityTissue> tissueViService;
@@ -85,6 +85,7 @@ public class FundsApplyController {
*/ */
@At @At
@ViReturn @ViReturn
@RequiresPermissions(value = {"sys.jf.Funds.apply","sys.jf.Funds.apply2"},logical = Logical.OR)
public Object generateProjectCode(String activity_type) { public Object generateProjectCode(String activity_type) {
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
int year = Calendar.getInstance().get(Calendar.YEAR); int year = Calendar.getInstance().get(Calendar.YEAR);
@@ -104,13 +105,28 @@ public class FundsApplyController {
@At @At
@ViReturn @ViReturn
@RequiresPermissions(value = {"sys.jf.Funds.apply","sys.jf.Funds.apply2"},logical = Logical.OR) @RequiresPermissions(value = {"sys.jf.Funds.apply","sys.jf.Funds.apply2","sys.jf.reimbursement.apply"},logical = Logical.OR)
public Object getCardNumberByPayeeId(String payeeId){ public Object getCardNumberByPayeeId(String payeeId){
List<ActivityBx> query = activityBxService.query(Cnd.where("payeeId", "=", payeeId).desc("apply_time")); Sql sql = Sqls.create("""
return query.stream().map(v -> { SELECT
NutMap map = new NutMap(); JT.bankName,
return map.addv("activity_card_number", v.getActivity_card_number()).addv("activity_card_name", v.getActivity_card_name()); JT.bankCardNum
}).collect(Collectors.toList()); FROM
activity_bx AS bx,
JSON_TABLE(
budgets,
'$[*]' COLUMNS(
payeeId VARCHAR(255) PATH '$.payeeId',
bankName VARCHAR(255) PATH '$.bankName',
bankCardNum VARCHAR(255) PATH '$.bankCardNum'
)
) AS JT
WHERE
JT.payeeId = @payeeId
ORDER BY bx.apply_time DESC LIMIT 1
""").setParam("payeeId", payeeId);
sql.setCallback(Sqls.callback.map());
dao.execute(sql);
return sql.getResult();
} }
} }
@@ -149,13 +149,13 @@ public class AccountingCon {
Sys_user_role sys_user_role = activityBxService.dao().fetch(Sys_user_role.class, Cnd.where("roleId", "=", Roles.GH_WYH_ZX)); Sys_user_role sys_user_role = activityBxService.dao().fetch(Sys_user_role.class, Cnd.where("roleId", "=", Roles.GH_WYH_ZX));
if (Lang.isNotEmpty(sys_user_role)) { if (Lang.isNotEmpty(sys_user_role)) {
Sys_user user = activityBxService.dao().fetch(Sys_user.class, sys_user_role.getUserId()); Sys_user user = activityBxService.dao().fetch(Sys_user.class, sys_user_role.getUserId());
////msgApi.sendWxMsg("活动申报", "", "text", aid.getUser_name() + "申报了一条活动【" + aid.getActivity_name() + "】,请前往智慧工会进行审核。", List.of(user.getLoginname()), null); msgApi.sendWxMsg("活动申报", "", "text", aid.getUser_name() + "申报了一条活动【" + aid.getActivity_name() + "】,请前往智慧工会进行审核。", List.of(user.getLoginname()), null);
FundsToHandler.CREATE_SCHOOL_TASK.exec(aid.getId(), null, List.of(user.getLoginname())); FundsToHandler.CREATE_SCHOOL_TASK.exec(aid.getId(), null, List.of(user.getLoginname()));
} }
} else { } else {
nodeName = "校工会负责人拒绝"; nodeName = "校工会负责人拒绝";
Sys_user user = activityBxService.dao().fetch(Sys_user.class, aid.getUser_id()); Sys_user user = activityBxService.dao().fetch(Sys_user.class, aid.getUser_id());
////msgApi.sendWxMsg("活动申报", "", "text", "您申报的活动【" + aid.getActivity_name() + "】被校工会负责人拒绝,审核意见:" + aid.getAccounting_idea(), List.of(user.getLoginname()), null); msgApi.sendWxMsg("活动申报", "", "text", "您申报的活动【" + aid.getActivity_name() + "】被校工会负责人拒绝,审核意见:" + aid.getAccounting_idea(), List.of(user.getLoginname()), null);
FundsToHandler.REFUSE_TASK.exec(aid.getId(), new NutMap().addv("option", nodeName), null); FundsToHandler.REFUSE_TASK.exec(aid.getId(), new NutMap().addv("option", nodeName), null);
} }
FundsToHandler.COMPLETE_SCHOOL_FZR_TASK.exec(aid.getId(), new NutMap().addv("option", nodeName), null); FundsToHandler.COMPLETE_SCHOOL_FZR_TASK.exec(aid.getId(), new NutMap().addv("option", nodeName), null);
@@ -2,8 +2,8 @@ package io.v.nutz.zhgh.jf.controller.activitybx;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.utils.Vi; import io.v.nutz.base.utils.Vi;
import io.v.nutz.zhgh.jf.service.ActivityBxService;
import io.v.nutz.web.commons.utils.ShiroUtil; import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.jf.service.ActivityBxService;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls; import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql; import org.nutz.dao.sql.Sql;
@@ -1,19 +1,22 @@
package io.v.nutz.zhgh.jf.controller.activitybx; package io.v.nutz.zhgh.jf.controller.activitybx;
import cn.hutool.core.util.StrUtil;
import cn.wizzer.framework.base.Result;
import cn.wizzer.framework.base.service.BaseService; import cn.wizzer.framework.base.service.BaseService;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.utils.DateUtil; import io.v.nutz.base.utils.DateUtil;
import io.v.nutz.base.utils.MsgApi; import io.v.nutz.base.utils.MsgApi;
import io.v.nutz.base.utils.Roles; import io.v.nutz.base.utils.Roles;
import io.v.nutz.base.utils.Vi; import io.v.nutz.base.utils.Vi;
import io.v.nutz.zhgh.jf.handle.funds.FundsToHandler;
import io.v.nutz.zhgh.jf.model.ActivityBx;
import io.v.nutz.zhgh.jf.service.ActivityBxService;
import io.v.nutz.sys.models.Sys_signature; import io.v.nutz.sys.models.Sys_signature;
import io.v.nutz.sys.models.Sys_user; import io.v.nutz.sys.models.Sys_user;
import io.v.nutz.sys.models.Sys_user_role; import io.v.nutz.sys.models.Sys_user_role;
import io.v.nutz.sys.services.SysSignatureService; import io.v.nutz.sys.services.SysSignatureService;
import io.v.nutz.web.commons.utils.ShiroUtil; import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.jf.handle.funds.FundsToHandler;
import io.v.nutz.zhgh.jf.model.ActivityBx;
import io.v.nutz.zhgh.jf.service.ActivityBxService;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.aop.interceptor.ioc.TransAop; import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
@@ -73,13 +76,37 @@ public class ApplyController {
@At @At
@ViReturn @ViReturn
@Aop(TransAop.READ_COMMITTED) @Aop(TransAop.READ_COMMITTED)
@RequiresPermissions(value = {"sys.jf.Funds.apply","sys.jf.Funds.apply2","sys.jf.reimbursement.apply","sys.jf.activity_bx.apply"},logical = Logical.OR)
public Object doSave(@Param("activityBx") ActivityBx activityBx, @Param("sign") String sign) {
activityBx.setState_id("999");
activityBx.setYear(activityBx.getYear() != null ? activityBx.getYear() : DateUtil.getYear());
activityBx.setApply_time(StrUtil.isNotBlank(activityBx.getApply_time()) ? activityBx.getApply_time() : DateUtil.getDateTime());
activityBx.setUser_id(StrUtil.isNotBlank(activityBx.getUser_id()) ? activityBx.getUser_id() : ShiroUtil.getUserId());
if (Strings.isNotBlank(sign)) {
activityBx.setUser_signature(sysSignatureService.insert(new Sys_signature(sign)).getId());
}
if (StrUtil.isNotBlank(activityBx.getId())) {
activityBxService.update(activityBx);
} else {
activityBxService.doAdd(activityBx);
}
return null;
}
@At
@ViReturn
@Aop(TransAop.READ_COMMITTED)
@RequiresPermissions(value = {"sys.jf.Funds.apply","sys.jf.Funds.apply2","sys.jf.reimbursement.apply","sys.jf.activity_bx.apply"},logical = Logical.OR)
public Object doAdd(@Param("activityBx") ActivityBx activityBx, @Param("sign") String sign) { public Object doAdd(@Param("activityBx") ActivityBx activityBx, @Param("sign") String sign) {
List<String> loginNames = new ArrayList<>(); List<String> loginNames = new ArrayList<>();
activityBx.setYear(Calendar.getInstance().get(Calendar.YEAR)); activityBx.setYear(activityBx.getYear() != null ? activityBx.getYear() : DateUtil.getYear());
if (activityBx.getActivity_type() == 40001) { if (activityBx.getActivity_type() == 40001) {
// 校工会活动
activityBx.setState_id("1020"); activityBx.setState_id("1020");
loginNames.add("8333300107"); loginNames.add("1019911404");
} else if (activityBx.getActivity_type() == 40002) { } else if (activityBx.getActivity_type() == 40002) {
// 分工会活动
activityBx.setState_id("1010"); activityBx.setState_id("1010");
Sys_user_role sys_user_role = activityBxService.dao().fetch(Sys_user_role.class, Cnd.where("roleId", "=", Roles.GH01).and("unionid", "=", Vi.getUnionId())); Sys_user_role sys_user_role = activityBxService.dao().fetch(Sys_user_role.class, Cnd.where("roleId", "=", Roles.GH01).and("unionid", "=", Vi.getUnionId()));
if (Lang.isNotEmpty(sys_user_role)) { if (Lang.isNotEmpty(sys_user_role)) {
@@ -87,6 +114,7 @@ public class ApplyController {
loginNames.add(user.getLoginname()); loginNames.add(user.getLoginname());
} }
} else if (activityBx.getActivity_type() == 40003) { } else if (activityBx.getActivity_type() == 40003) {
// 协会活动
Sys_user_role sys_user_role = activityBxService.dao().fetch(Sys_user_role.class, Cnd.where("roleId", "=", Roles.club01).and("stid", "=", activityBx.getClubId())); Sys_user_role sys_user_role = activityBxService.dao().fetch(Sys_user_role.class, Cnd.where("roleId", "=", Roles.club01).and("stid", "=", activityBx.getClubId()));
if (Lang.isNotEmpty(sys_user_role)) { if (Lang.isNotEmpty(sys_user_role)) {
Sys_user user = activityBxService.dao().fetch(Sys_user.class, sys_user_role.getUserId()); Sys_user user = activityBxService.dao().fetch(Sys_user.class, sys_user_role.getUserId());
@@ -96,8 +124,8 @@ public class ApplyController {
} else { } else {
activityBx.setState_id("1010"); activityBx.setState_id("1010");
} }
activityBx.setApply_time(DateUtil.getDateTime()); activityBx.setApply_time(StrUtil.isNotBlank(activityBx.getApply_time()) ? activityBx.getApply_time() : DateUtil.getDateTime());
activityBx.setUser_id(ShiroUtil.getPrincipalProperty("id").toString()); activityBx.setUser_id(StrUtil.isNotBlank(activityBx.getUser_id()) ? activityBx.getUser_id() : ShiroUtil.getUserId());
if (Strings.isNotBlank(sign)) { if (Strings.isNotBlank(sign)) {
activityBx.setUser_signature(sysSignatureService.insert(new Sys_signature(sign)).getId()); activityBx.setUser_signature(sysSignatureService.insert(new Sys_signature(sign)).getId());
} }
@@ -125,14 +153,29 @@ public class ApplyController {
@At @At
@ViReturn @ViReturn
@Aop(TransAop.READ_COMMITTED) @Aop(TransAop.READ_COMMITTED)
@RequiresPermissions(value = {"sys.jf.Funds.apply","sys.jf.Funds.apply2","sys.jf.reimbursement.apply","sys.jf.activity_bx.apply"},logical = Logical.OR)
public Object doEdit(@Param("activityBx") ActivityBx activityBx, @Param("sign") String sign) { public Object doEdit(@Param("activityBx") ActivityBx activityBx, @Param("sign") String sign) {
List<String> loginNames = new ArrayList<>();
ActivityBx oldActivity = activityBxService.dao().fetch(ActivityBx.class, activityBx.getId());
activityBx.setYear(Calendar.getInstance().get(Calendar.YEAR)); activityBx.setYear(Calendar.getInstance().get(Calendar.YEAR));
if (activityBx.getActivity_type() == 40001) { if (activityBx.getActivity_type() == 40001) {
activityBx.setState_id("1020"); activityBx.setState_id("1020");
loginNames.add("1019911404");
} else if (activityBx.getActivity_type() == 40002) { } else if (activityBx.getActivity_type() == 40002) {
activityBx.setState_id("1010"); activityBx.setState_id("1010");
Sys_user_role sys_user_role = activityBxService.dao().fetch(Sys_user_role.class, Cnd.where("roleId", "=", Roles.GH01).and("unionid", "=", Vi.getUnionId()));
if (Lang.isNotEmpty(sys_user_role)) {
Sys_user user = activityBxService.dao().fetch(Sys_user.class, sys_user_role.getUserId());
loginNames.add(user.getLoginname());
}
} else if (activityBx.getActivity_type() == 40003) { } else if (activityBx.getActivity_type() == 40003) {
activityBx.setState_id("1000"); activityBx.setState_id("1000");
// 协会活动
Sys_user_role sys_user_role = activityBxService.dao().fetch(Sys_user_role.class, Cnd.where("roleId", "=", Roles.club01).and("stid", "=", activityBx.getClubId()));
if (Lang.isNotEmpty(sys_user_role)) {
Sys_user user = activityBxService.dao().fetch(Sys_user.class, sys_user_role.getUserId());
loginNames.add(user.getLoginname());
}
} else { } else {
activityBx.setState_id("1010"); activityBx.setState_id("1010");
} }
@@ -141,20 +184,50 @@ public class ApplyController {
if (Strings.isNotBlank(sign)) { if (Strings.isNotBlank(sign)) {
activityBx.setUser_signature(sysSignatureService.insert(new Sys_signature(sign)).getId()); activityBx.setUser_signature(sysSignatureService.insert(new Sys_signature(sign)).getId());
} }
if ("1025".equals(oldActivity.getState_id()) || "1045".equals(oldActivity.getState_id()) ) {
activityBx.setState_id("1025".equals(oldActivity.getState_id()) ? "1020" : "1040");
}
activityBxService.doEdit(activityBx); activityBxService.doEdit(activityBx);
NutMap map = new NutMap();
map.setv("userId",activityBx.getUser_id());
map.setv("activityName",activityBx.getActivity_name());
FundsToHandler.START_PROCESS.exec(activityBx.getId(),map,loginNames);
// FundsToHandler.START_PROCESS.exec(activityBx.getId(),NutMap.NEW().addv("userId",ShiroUtil.getUserId()),null); if ("999".equals(activityBx.getState_id())) {
//
// if (activityBx.getActivity_type() == 40001) { if (activityBx.getActivity_type() == 40001) {
//// FundsToHandler.CREATE_SCHOOL_FZR_TASK.exec(activityBx.getId(),NutMap.NEW().addv("userId",ShiroUtil.getUserId()),loginNames); FundsToHandler.CREATE_SCHOOL_FZR_TASK.exec(activityBx.getId(),NutMap.NEW().addv("userId",ShiroUtil.getUserId()),loginNames);
// } else if (activityBx.getActivity_type() == 40002) { } else if (activityBx.getActivity_type() == 40002) {
// FundsToHandler.CREATE_UNION_TASK.exec(activityBx.getId(),NutMap.NEW().addv("userId",ShiroUtil.getUserId()),List.of("1019971597")); FundsToHandler.CREATE_UNION_TASK.exec(activityBx.getId(),NutMap.NEW().addv("userId",ShiroUtil.getUserId()),List.of("1019971597"));
// } else if (activityBx.getActivity_type() == 40003) { } else if (activityBx.getActivity_type() == 40003) {
//// FundsToHandler.CREATE_CLUB_TASK.exec(activityBx.getId(),NutMap.NEW().addv("userId",ShiroUtil.getUserId()),loginNames); FundsToHandler.CREATE_CLUB_TASK.exec(activityBx.getId(),NutMap.NEW().addv("userId",ShiroUtil.getUserId()),loginNames);
// } }
}
return null; return null;
} }
@At
@RequiresPermissions(value = {"sys.jf.Funds.apply","sys.jf.Funds.apply2","sys.jf.reimbursement.apply","sys.jf.activity_bx.apply"},logical = Logical.OR)
public Object checkActivity(String activityName, String activityType) {
List<String> list = new ArrayList<>();
list.add("999");
switch (activityType) {
case "40001": list.add("1020");
case "40002": list.add("1010");
case "40003": list.add("1000");
}
ActivityBx activityBx = baseService.dao().fetch(ActivityBx.class, Cnd.where("activity_name", "=", activityName)
.and("user_id", "=", ShiroUtil.getUserId()).and("activity_type", "=", activityType)
.and("state_id", "in", list).desc("apply_time"));
if (Lang.isNotEmpty(activityBx)) {
return Result.success().addData(activityBx);
} else {
return Result.error();
}
}
} }
@@ -131,12 +131,12 @@ public class AssociationCon {
String nodeName = ""; String nodeName = "";
if (flag) { if (flag) {
////msgApi.sendWxMsg("活动申报", "", "text", aid.getUser_name() + "申报了一条活动【" + aid.getActivity_name() + "】,请前往智慧工会进行审核。", List.of("1019911404"), null); msgApi.sendWxMsg("活动申报", "", "text", aid.getUser_name() + "申报了一条活动【" + aid.getActivity_name() + "】,请前往智慧工会进行审核。", List.of("1019911404"), null);
FundsToHandler.CREATE_SCHOOL_FZR_TASK.exec(id, new NutMap().addv("userId", aid.getUser_id()), List.of("8333300107")); FundsToHandler.CREATE_SCHOOL_FZR_TASK.exec(id, new NutMap().addv("userId", aid.getUser_id()), List.of("1019911404"));
nodeName = "校工会负责人审核"; nodeName = "校工会负责人审核";
} else { } else {
Sys_user user = activityBxService.dao().fetch(Sys_user.class, aid.getUser_id()); Sys_user user = activityBxService.dao().fetch(Sys_user.class, aid.getUser_id());
////msgApi.sendWxMsg("活动申报", "", "text", "您申报的活动【" + aid.getActivity_name() + "】被协会拒绝,审核意见:" + aid.getAssociation_principal_idea(), List.of(user.getLoginname()), null); msgApi.sendWxMsg("活动申报", "", "text", "您申报的活动【" + aid.getActivity_name() + "】被协会拒绝,审核意见:" + aid.getAssociation_principal_idea(), List.of(user.getLoginname()), null);
nodeName = "协会审核拒绝"; nodeName = "协会审核拒绝";
FundsToHandler.REFUSE_TASK.exec(id, new NutMap().addv("option", nodeName), null); FundsToHandler.REFUSE_TASK.exec(id, new NutMap().addv("option", nodeName), null);
} }
@@ -3,11 +3,11 @@ package io.v.nutz.zhgh.jf.controller.activitybx;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.utils.DateUtil; import io.v.nutz.base.utils.DateUtil;
import io.v.nutz.base.utils.Vi; import io.v.nutz.base.utils.Vi;
import io.v.nutz.zhgh.jf.model.ActivityBx;
import io.v.nutz.zhgh.jf.service.ActivityBxService;
import io.v.nutz.sys.models.Sys_signature; import io.v.nutz.sys.models.Sys_signature;
import io.v.nutz.sys.services.SysSignatureService; import io.v.nutz.sys.services.SysSignatureService;
import io.v.nutz.web.commons.utils.ShiroUtil; import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.jf.model.ActivityBx;
import io.v.nutz.zhgh.jf.service.ActivityBxService;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls; import org.nutz.dao.Sqls;
@@ -3,11 +3,11 @@ package io.v.nutz.zhgh.jf.controller.activitybx;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.utils.DateUtil; import io.v.nutz.base.utils.DateUtil;
import io.v.nutz.base.utils.Vi; import io.v.nutz.base.utils.Vi;
import io.v.nutz.zhgh.jf.model.ActivityBx;
import io.v.nutz.zhgh.jf.service.ActivityBxService;
import io.v.nutz.sys.models.Sys_signature; import io.v.nutz.sys.models.Sys_signature;
import io.v.nutz.sys.services.SysSignatureService; import io.v.nutz.sys.services.SysSignatureService;
import io.v.nutz.web.commons.utils.ShiroUtil; import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.jf.model.ActivityBx;
import io.v.nutz.zhgh.jf.service.ActivityBxService;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls; import org.nutz.dao.Sqls;
@@ -3,11 +3,9 @@ package io.v.nutz.zhgh.jf.controller.activitybx;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.utils.DateUtil; import io.v.nutz.base.utils.DateUtil;
import io.v.nutz.base.utils.MsgApi; import io.v.nutz.base.utils.MsgApi;
import io.v.nutz.base.utils.Roles;
import io.v.nutz.base.utils.Vi; import io.v.nutz.base.utils.Vi;
import io.v.nutz.sys.models.Sys_signature; import io.v.nutz.sys.models.Sys_signature;
import io.v.nutz.sys.models.Sys_user; import io.v.nutz.sys.models.Sys_user;
import io.v.nutz.sys.models.Sys_user_role;
import io.v.nutz.sys.services.SysSignatureService; import io.v.nutz.sys.services.SysSignatureService;
import io.v.nutz.web.commons.utils.ShiroUtil; import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.jf.handle.funds.FundsToHandler; import io.v.nutz.zhgh.jf.handle.funds.FundsToHandler;
@@ -21,7 +19,6 @@ import org.nutz.dao.sql.Sql;
import org.nutz.ioc.aop.Aop; import org.nutz.ioc.aop.Aop;
import org.nutz.ioc.loader.annotation.Inject; import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean; import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.Lang;
import org.nutz.lang.Strings; import org.nutz.lang.Strings;
import org.nutz.lang.util.NutMap; import org.nutz.lang.util.NutMap;
import org.nutz.mvc.annotation.At; import org.nutz.mvc.annotation.At;
@@ -141,14 +138,14 @@ public class DivisionCon {
// Sys_user_role sys_user_role = activityBxService.dao().fetch(Sys_user_role.class, Cnd.where("roleId", "=", Roles.GH_WYH_ZX)); // Sys_user_role sys_user_role = activityBxService.dao().fetch(Sys_user_role.class, Cnd.where("roleId", "=", Roles.GH_WYH_ZX));
// if (Lang.isNotEmpty(sys_user_role)) { // if (Lang.isNotEmpty(sys_user_role)) {
// Sys_user user = activityBxService.dao().fetch(Sys_user.class, sys_user_role.getUserId()); // Sys_user user = activityBxService.dao().fetch(Sys_user.class, sys_user_role.getUserId());
Sys_user user = activityBxService.dao().fetch(Sys_user.class, Cnd.where("loginname","=","8333300107")); Sys_user user = activityBxService.dao().fetch(Sys_user.class, Cnd.where("loginname","=","1019911404"));
//msgApi.sendWxMsg("活动申报", "", "text", aid.getUser_name() + "申报了一条活动【" + aid.getActivity_name() + "】,请前往智慧工会进行审核。", List.of(user.getLoginname()), null); msgApi.sendWxMsg("活动申报", "", "text", aid.getUser_name() + "申报了一条活动【" + aid.getActivity_name() + "】,请前往智慧工会进行审核。", List.of(user.getLoginname()), null);
FundsToHandler.CREATE_SCHOOL_FZR_TASK.exec(id, null, List.of(user.getLoginname())); FundsToHandler.CREATE_SCHOOL_FZR_TASK.exec(id, null, List.of(user.getLoginname()));
// } // }
} else { } else {
nodeName = "基层工会主席拒绝"; nodeName = "基层工会主席拒绝";
Sys_user user = activityBxService.dao().fetch(Sys_user.class, aid.getUser_id()); Sys_user user = activityBxService.dao().fetch(Sys_user.class, aid.getUser_id());
//msgApi.sendWxMsg("活动申报", "", "text", "您申报的活动【" + aid.getActivity_name() + "】被基层工会主席拒绝,审核意见:" + aid.getDivision_chairman_idea(), List.of(user.getLoginname()), null); msgApi.sendWxMsg("活动申报", "", "text", "您申报的活动【" + aid.getActivity_name() + "】被基层工会主席拒绝,审核意见:" + aid.getDivision_chairman_idea(), List.of(user.getLoginname()), null);
FundsToHandler.REFUSE_TASK.exec(id, new NutMap().addv("option", nodeName), null); FundsToHandler.REFUSE_TASK.exec(id, new NutMap().addv("option", nodeName), null);
} }
FundsToHandler.COMPLETE_UNION_TASK.exec(id, new NutMap().addv("option", nodeName), null); FundsToHandler.COMPLETE_UNION_TASK.exec(id, new NutMap().addv("option", nodeName), null);
@@ -3,15 +3,16 @@ package io.v.nutz.zhgh.jf.controller.activitybx;
import cn.hutool.core.convert.Convert; import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import cn.wizzer.framework.base.service.BaseService; import cn.wizzer.framework.base.service.BaseService;
import com.deepoove.poi.XWPFTemplate; import com.deepoove.poi.XWPFTemplate;
import com.deepoove.poi.config.Configure; import com.deepoove.poi.config.Configure;
import com.deepoove.poi.data.PictureRenderData; import com.deepoove.poi.data.PictureRenderData;
import com.deepoove.poi.policy.HackLoopTableRenderPolicy;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.model.Goods; import io.v.nutz.base.model.Goods;
import io.v.nutz.base.utils.DateUtil; import io.v.nutz.base.utils.DateUtil;
import io.v.nutz.base.utils.Html2Text; import io.v.nutz.base.utils.Html2Text;
import io.v.nutz.base.utils.Roles;
import io.v.nutz.base.utils.Vi; import io.v.nutz.base.utils.Vi;
import io.v.nutz.sys.models.Sys_signature; import io.v.nutz.sys.models.Sys_signature;
import io.v.nutz.sys.services.SysSignatureService; import io.v.nutz.sys.services.SysSignatureService;
@@ -35,7 +36,6 @@ import org.nutz.lang.util.NutMap;
import org.nutz.mvc.annotation.At; import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok; import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param; import org.nutz.mvc.annotation.Param;
import org.nutz.trans.Trans;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
@@ -44,6 +44,7 @@ import java.math.BigDecimal;
import java.math.RoundingMode; import java.math.RoundingMode;
import java.util.Base64; import java.util.Base64;
import java.util.Calendar; import java.util.Calendar;
import java.util.List;
/** /**
* @author zhf * @author zhf
@@ -142,20 +143,6 @@ public class ReimbursementCon {
$condition $condition
"""); """);
sql.setParam("role1", Roles.CLUB_FZR);
sql.setParam("role2", Roles.UNION_MANGER);
sql.setParam("role3", Roles.XGH_HD);
sql.setParam("role4", Roles.GH_WYH_FZX);
sql.setParam("role5", Roles.GH_WYH_CWFZX);
sql.setParam("role6", Roles.XGHCN);
sql.setParam("state1", 1000);
sql.setParam("state2", 1010);
sql.setParam("state3", 1020);
sql.setParam("state4", 1030);
sql.setParam("state5", 1040);
sql.setParam("state6", 1050);
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
if (!ShiroUtil.hasAnyRoles("sysadmin")) { if (!ShiroUtil.hasAnyRoles("sysadmin")) {
cnd.and("bx.user_id", "=", ShiroUtil.getPrincipalProperty("id")); cnd.and("bx.user_id", "=", ShiroUtil.getPrincipalProperty("id"));
@@ -172,7 +159,6 @@ public class ReimbursementCon {
} }
Vi.cndPlus(cnd, "bxr.unitid", "=", unitId); Vi.cndPlus(cnd, "bxr.unitid", "=", unitId);
Vi.cndPlus(cnd, "bxr.unionid", "=", unionId); Vi.cndPlus(cnd, "bxr.unionid", "=", unionId);
Vi.cndPlus(cnd, "bx.apply_type", "=", apply_type);
sql.setCondition(cnd); sql.setCondition(cnd);
return activityBxService.listPageMap(pageNumber, pageSize, sql); return activityBxService.listPageMap(pageNumber, pageSize, sql);
} }
@@ -237,6 +223,11 @@ public class ReimbursementCon {
one.setv("money_big", Convert.digitToChinese(one.getDouble("activity_money"))); one.setv("money_big", Convert.digitToChinese(one.getDouble("activity_money")));
one.setv("apply_time", one.getString("apply_time").substring(0, 10)); one.setv("apply_time", one.getString("apply_time").substring(0, 10));
String budgets = one.getString("budgets");
List<NutMap> goods = JSONUtil.parseArray(budgets).toList(NutMap.class);
one.put("goods",goods);
if (one.getString("activity_type").equals("40001")) { if (one.getString("activity_type").equals("40001")) {
one.setv("jfName", "校工会"); one.setv("jfName", "校工会");
} else if (one.getString("activity_type").equals("40002")) { } else if (one.getString("activity_type").equals("40002")) {
@@ -251,7 +242,6 @@ public class ReimbursementCon {
BigDecimal priceBigDecimal = new BigDecimal(price); BigDecimal priceBigDecimal = new BigDecimal(price);
BigDecimal moneyDecimal = priceBigDecimal.subtract(new BigDecimal(money_int)); BigDecimal moneyDecimal = priceBigDecimal.subtract(new BigDecimal(money_int));
double money_decimal = money_int - price;
one.setv("one", money_int >= 1000000 ? (money_int / 1000000) % 10 : null); one.setv("one", money_int >= 1000000 ? (money_int / 1000000) % 10 : null);
one.setv("two", money_int >= 100000 ? (money_int / 100000) % 10 : null); one.setv("two", money_int >= 100000 ? (money_int / 100000) % 10 : null);
one.setv("three", money_int >= 10000 ? (money_int / 10000) % 10 : null); one.setv("three", money_int >= 10000 ? (money_int / 10000) % 10 : null);
@@ -260,10 +250,16 @@ public class ReimbursementCon {
one.setv("six", money_int >= 10 ? (money_int / 10) % 10 : null); one.setv("six", money_int >= 10 ? (money_int / 10) % 10 : null);
one.setv("seven", money_int >= 1 ? money_int % 10 : null); one.setv("seven", money_int >= 1 ? money_int % 10 : null);
BigDecimal decimalPart1 = moneyDecimal.divide(new BigDecimal("1"), 1, RoundingMode.HALF_UP); // 提取小数部分的各个位上的数值
BigDecimal decimalPart2 = moneyDecimal.divide(new BigDecimal("0.1"), 1, RoundingMode.HALF_UP); BigDecimal tenthsPart = moneyDecimal.multiply(BigDecimal.TEN).setScale(0, RoundingMode.DOWN);
one.setv("eight", decimalPart1.movePointRight(1).intValueExact()); int tenths = tenthsPart.intValue();
one.setv("nine", decimalPart2.movePointRight(1).intValueExact()); BigDecimal hundredthsPart = moneyDecimal.multiply(BigDecimal.valueOf(100)).setScale(0, RoundingMode.DOWN);
int hundredths = hundredthsPart.intValue();
// BigDecimal decimalPart1 = moneyDecimal.divide(new BigDecimal("1"), 1, RoundingMode.HALF_UP);
// BigDecimal decimalPart2 = moneyDecimal.divide(new BigDecimal("0.1"), 1, RoundingMode.HALF_UP);
one.setv("eight", (tenths % 10));
one.setv("nine", (hundredths % 10) + 1);
/*基层工会主席签字*/ /*基层工会主席签字*/
@@ -308,7 +304,9 @@ public class ReimbursementCon {
String fileName = Globals.schoolName + "【" + one.getString("activity_name") + "】报销凭证"; String fileName = Globals.schoolName + "【" + one.getString("activity_name") + "】报销凭证";
Configure config = Configure.newBuilder().build(); HackLoopTableRenderPolicy policy = new HackLoopTableRenderPolicy();
Configure config = Configure.newBuilder().bind("goods", policy).build();
InputStream inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("docTemplate/funds3.docx"); InputStream inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("docTemplate/funds3.docx");
response.addHeader("Content-Type", "application/octet-stream"); response.addHeader("Content-Type", "application/octet-stream");
response.addHeader("Content-Disposition", "attachment; filename=\"" + new String(fileName.getBytes("UTF-8"), "ISO-8859-1") + "\".docx"); response.addHeader("Content-Disposition", "attachment; filename=\"" + new String(fileName.getBytes("UTF-8"), "ISO-8859-1") + "\".docx");
@@ -1,6 +1,7 @@
package io.v.nutz.zhgh.jf.controller.activitybx; package io.v.nutz.zhgh.jf.controller.activitybx;
import cn.afterturn.easypoi.excel.annotation.Excel; import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.hutool.json.JSONUtil;
import com.deepoove.poi.XWPFTemplate; import com.deepoove.poi.XWPFTemplate;
import com.deepoove.poi.config.Configure; import com.deepoove.poi.config.Configure;
import com.deepoove.poi.data.PictureRenderData; import com.deepoove.poi.data.PictureRenderData;
@@ -8,11 +9,11 @@ import com.deepoove.poi.policy.HackLoopTableRenderPolicy;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.utils.Html2Text; import io.v.nutz.base.utils.Html2Text;
import io.v.nutz.base.utils.Vi; import io.v.nutz.base.utils.Vi;
import io.v.nutz.zhgh.jf.model.ActivityBx;
import io.v.nutz.zhgh.jf.service.ActivityBxService;
import io.v.nutz.sys.services.SysUnionService; import io.v.nutz.sys.services.SysUnionService;
import io.v.nutz.web.commons.base.Globals; import io.v.nutz.web.commons.base.Globals;
import io.v.nutz.web.commons.utils.ShiroUtil; import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.jf.model.ActivityBx;
import io.v.nutz.zhgh.jf.service.ActivityBxService;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls; import org.nutz.dao.Sqls;
@@ -137,7 +138,11 @@ public class ReimbursementViewCon {
NutMap nutMap = activityBxService.queryOne(id); NutMap nutMap = activityBxService.queryOne(id);
nutMap.setv("activity_content", Html2Text.toPlainText(nutMap.getString("activity_content"))); nutMap.setv("activity_content", Html2Text.toPlainText(nutMap.getString("activity_content")));
nutMap.setv("apply_time", nutMap.getString("apply_time").substring(0, 10)); nutMap.setv("apply_time", nutMap.getString("apply_time").substring(0, 10));
List<NutMap> goods = nutMap.getAsList("Goods", NutMap.class);
String budgets = nutMap.getString("budgets");
List<NutMap> goods = JSONUtil.parseArray(budgets).toList(NutMap.class);
// List<NutMap> goods = nutMap.getAsList("budgets", NutMap.class);
for (int i = 0; i < goods.size(); i++) { for (int i = 0; i < goods.size(); i++) {
goods.get(i).put("ranking", i + 1); goods.get(i).put("ranking", i + 1);
@@ -151,7 +151,7 @@ public class UnionCon {
String nodeName = ""; String nodeName = "";
if (nutMap.getBoolean("flag")) { if (nutMap.getBoolean("flag")) {
User user = activityBxService.dao().fetch(User.class, Cnd.where("id", "=", aid.getUser_id())); User user = activityBxService.dao().fetch(User.class, Cnd.where("id", "=", aid.getUser_id()));
//msgApi.sendWxMsg("活动申报", "", "text", "您申报的活动【" + aid.getActivity_name() + "】已审核通过,请前往智慧工会进行查看。", List.of(user.getLoginname()), null); msgApi.sendWxMsg("活动申报", "", "text", "您申报的活动【" + aid.getActivity_name() + "】已审核通过,请前往智慧工会进行查看。", List.of(user.getLoginname()), null);
if (aid.getActivity_id() == null) { if (aid.getActivity_id() == null) {
@@ -161,12 +161,11 @@ public class UnionCon {
activityTissue.setType(aid.getActivity_type()); activityTissue.setType(aid.getActivity_type());
activityTissue.setActivityCode(aid.getProjectCode()); activityTissue.setActivityCode(aid.getProjectCode());
activityTissue.setName(aid.getActivity_name()); activityTissue.setName(aid.getActivity_name());
activityTissue.setUserId(ShiroUtil.getUserId()); activityTissue.setUserId(aid.getUser_id());
activityTissue.setStartPlannedDate(aid.getStartPlannedDate()); activityTissue.setStartPlannedDate(aid.getStartPlannedDate());
activityTissue.setEndPlannedDate(aid.getEndPlannedDate()); activityTissue.setEndPlannedDate(aid.getEndPlannedDate());
activityTissue.setStartTime(aid.getStartTime()); activityTissue.setStartTime(aid.getStartTime());
activityTissue.setEndTime(aid.getEndTime()); activityTissue.setEndTime(aid.getEndTime());
activityTissue.setUserId(ShiroUtil.getUserId());
activityTissue.setAddress(aid.getAddress()); activityTissue.setAddress(aid.getAddress());
if (aid.getActivity_type() == 40002) { if (aid.getActivity_type() == 40002) {
activityTissue.setUnionId(user.getUnionid()); activityTissue.setUnionId(user.getUnionid());
@@ -180,7 +179,7 @@ public class UnionCon {
nodeName = "审核通过"; nodeName = "审核通过";
} else { } else {
Sys_user user = activityBxService.dao().fetch(Sys_user.class, aid.getUser_id()); Sys_user user = activityBxService.dao().fetch(Sys_user.class, aid.getUser_id());
//msgApi.sendWxMsg("活动申报", "", "text", "您申报的活动【" + aid.getActivity_name() + "】被校工会主席拒绝,审核意见:" + aid.getUnion_chairman_idea(), List.of(user.getLoginname()), null); msgApi.sendWxMsg("活动申报", "", "text", "您申报的活动【" + aid.getActivity_name() + "】被校工会主席拒绝,审核意见:" + aid.getUnion_chairman_idea(), List.of(user.getLoginname()), null);
FundsToHandler.REFUSE_TASK.exec(aid.getId(), new NutMap().addv("option", nodeName), null); FundsToHandler.REFUSE_TASK.exec(aid.getId(), new NutMap().addv("option", nodeName), null);
} }
activityBxService.update(aid); activityBxService.update(aid);
@@ -3,10 +3,10 @@ package io.v.nutz.zhgh.jf.controller.club;
import cn.afterturn.easypoi.excel.ExcelImportUtil; import cn.afterturn.easypoi.excel.ExcelImportUtil;
import cn.afterturn.easypoi.excel.entity.ImportParams; import cn.afterturn.easypoi.excel.entity.ImportParams;
import cn.wizzer.framework.base.Result; import cn.wizzer.framework.base.Result;
import io.v.nutz.zhgh.jf.model.jf_club;
import io.v.nutz.zhgh.jf.service.jfClubService;
import io.v.nutz.sys.models.Sys_club; import io.v.nutz.sys.models.Sys_club;
import io.v.nutz.sys.services.SysClubService; import io.v.nutz.sys.services.SysClubService;
import io.v.nutz.zhgh.jf.model.jf_club;
import io.v.nutz.zhgh.jf.service.jfClubService;
import org.nutz.ioc.loader.annotation.Inject; import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean; import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.util.NutMap; import org.nutz.lang.util.NutMap;
@@ -5,9 +5,9 @@ import cn.wizzer.framework.page.Pagination;
import io.v.nutz.base.utils.ExcelUtil; import io.v.nutz.base.utils.ExcelUtil;
import io.v.nutz.base.utils.PageUtil; import io.v.nutz.base.utils.PageUtil;
import io.v.nutz.base.utils.Roles; import io.v.nutz.base.utils.Roles;
import io.v.nutz.zhgh.jf.service.jfClubService;
import io.v.nutz.sys.models.Sys_user_role; import io.v.nutz.sys.models.Sys_user_role;
import io.v.nutz.web.commons.utils.ShiroUtil; import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.jf.service.jfClubService;
import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.shiro.authz.annotation.RequiresAuthentication; import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
@@ -2,15 +2,15 @@ package io.v.nutz.zhgh.jf.controller.costsSet;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.utils.DateUtil; import io.v.nutz.base.utils.DateUtil;
import io.v.nutz.sys.models.Sys_club;
import io.v.nutz.sys.models.Sys_union;
import io.v.nutz.sys.services.SysClubService;
import io.v.nutz.sys.services.SysUnionService;
import io.v.nutz.zhgh.jf.model.CostsSet; import io.v.nutz.zhgh.jf.model.CostsSet;
import io.v.nutz.zhgh.jf.model.jf_club; import io.v.nutz.zhgh.jf.model.jf_club;
import io.v.nutz.zhgh.jf.model.jf_school; import io.v.nutz.zhgh.jf.model.jf_school;
import io.v.nutz.zhgh.jf.model.jf_yjgh; import io.v.nutz.zhgh.jf.model.jf_yjgh;
import io.v.nutz.zhgh.jf.service.CostsSetService; import io.v.nutz.zhgh.jf.service.CostsSetService;
import io.v.nutz.sys.models.Sys_club;
import io.v.nutz.sys.models.Sys_union;
import io.v.nutz.sys.services.SysClubService;
import io.v.nutz.sys.services.SysUnionService;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
import org.nutz.ioc.loader.annotation.Inject; import org.nutz.ioc.loader.annotation.Inject;
@@ -9,17 +9,16 @@ import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.result.Result; import io.v.nutz.base.result.Result;
import io.v.nutz.base.service.BaseService; import io.v.nutz.base.service.BaseService;
import io.v.nutz.base.utils.ViTool;
import io.v.nutz.sys.models.Sys_club;
import io.v.nutz.sys.models.Sys_union;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.jf.mode.FinancialImportExcelMode; import io.v.nutz.zhgh.jf.mode.FinancialImportExcelMode;
import io.v.nutz.zhgh.jf.model.jf_club; import io.v.nutz.zhgh.jf.model.jf_club;
import io.v.nutz.zhgh.jf.model.jf_use; import io.v.nutz.zhgh.jf.model.jf_use;
import io.v.nutz.zhgh.jf.model.jf_yjgh; import io.v.nutz.zhgh.jf.model.jf_yjgh;
import io.v.nutz.sys.models.Sys_club;
import io.v.nutz.sys.models.Sys_union;
import io.v.nutz.base.utils.ViTool;
import io.v.nutz.web.commons.utils.ShiroUtil;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.aop.interceptor.ioc.TransAop; import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Chain; import org.nutz.dao.Chain;
@@ -3,11 +3,11 @@ package io.v.nutz.zhgh.jf.controller.jfbx;
import cn.wizzer.framework.base.Result; import cn.wizzer.framework.base.Result;
import cn.wizzer.framework.page.Pagination; import cn.wizzer.framework.page.Pagination;
import io.v.nutz.base.utils.DateUtil; import io.v.nutz.base.utils.DateUtil;
import io.v.nutz.zhgh.jf.model.jf_bxyy;
import io.v.nutz.zhgh.jf.service.jfBxYyFjService;
import io.v.nutz.sys.models.Sys_user; import io.v.nutz.sys.models.Sys_user;
import io.v.nutz.sys.services.SysUserService; import io.v.nutz.sys.services.SysUserService;
import io.v.nutz.web.commons.utils.ShiroUtil; import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.jf.model.jf_bxyy;
import io.v.nutz.zhgh.jf.service.jfBxYyFjService;
import org.apache.shiro.authz.annotation.RequiresAuthentication; import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
@@ -4,12 +4,12 @@ import cn.wizzer.framework.base.Result;
import cn.wizzer.framework.base.service.BaseService; import cn.wizzer.framework.base.service.BaseService;
import cn.wizzer.framework.page.Pagination; import cn.wizzer.framework.page.Pagination;
import io.v.nutz.base.utils.DateUtil; import io.v.nutz.base.utils.DateUtil;
import io.v.nutz.zhgh.jf.model.jf_bxyy;
import io.v.nutz.zhgh.jf.model.jf_bxyy_fj;
import io.v.nutz.sys.models.Sys_file; import io.v.nutz.sys.models.Sys_file;
import io.v.nutz.sys.models.Sys_user; import io.v.nutz.sys.models.Sys_user;
import io.v.nutz.web.commons.utils.DocConverter; import io.v.nutz.web.commons.utils.DocConverter;
import io.v.nutz.web.commons.utils.ShiroUtil; import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.jf.model.jf_bxyy;
import io.v.nutz.zhgh.jf.model.jf_bxyy_fj;
import org.apache.shiro.authz.annotation.RequiresAuthentication; import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.boot.starter.ftp.FtpService; import org.nutz.boot.starter.ftp.FtpService;
@@ -5,12 +5,12 @@ import cn.wizzer.framework.page.Pagination;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.utils.DateUtil; import io.v.nutz.base.utils.DateUtil;
import io.v.nutz.base.utils.PageUtil; import io.v.nutz.base.utils.PageUtil;
import io.v.nutz.sys.models.Sys_user;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.jf.model.jf_club; import io.v.nutz.zhgh.jf.model.jf_club;
import io.v.nutz.zhgh.jf.model.jf_use; import io.v.nutz.zhgh.jf.model.jf_use;
import io.v.nutz.zhgh.jf.model.jf_yjgh; import io.v.nutz.zhgh.jf.model.jf_yjgh;
import io.v.nutz.zhgh.jf.service.ActivityBxService; import io.v.nutz.zhgh.jf.service.ActivityBxService;
import io.v.nutz.sys.models.Sys_user;
import io.v.nutz.web.commons.utils.ShiroUtil;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls; import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql; import org.nutz.dao.sql.Sql;
@@ -1,15 +1,17 @@
package io.v.nutz.zhgh.jf.controller.reimbursement; package io.v.nutz.zhgh.jf.controller.reimbursement;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ArrayUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.jf.handle.reimbursement.ReimbursementToHandler; import io.v.nutz.zhgh.jf.handle.reimbursement.ReimbursementToHandler;
import io.v.nutz.zhgh.jf.model.ActivityBx; import io.v.nutz.zhgh.jf.model.ActivityBx;
import io.v.nutz.zhgh.jf.service.ActivityBxService; import io.v.nutz.zhgh.jf.service.ActivityBxService;
import io.v.nutz.web.commons.utils.ShiroUtil;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.aop.interceptor.ioc.TransAop; import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
import org.nutz.dao.util.cri.SqlExpressionGroup;
import org.nutz.ioc.aop.Aop; import org.nutz.ioc.aop.Aop;
import org.nutz.ioc.loader.annotation.Inject; import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean; import org.nutz.ioc.loader.annotation.IocBean;
@@ -18,15 +20,17 @@ import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok; import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param; import org.nutz.mvc.annotation.Param;
import java.util.List;
/** /**
* @version 1.0 * @version 1.0
* @Author zzr * @Author zzr
* @name:ActivityReimbursementApplyController * @name:ActivityReimbursementApplyController
* @Date 2024/4/26 14:58 * @Date 2024/4/26 14:58
* @注释 活动报销,报销申请 * @注释 活动报销,报销申请
* 校工会活动——>校工会负责人(姜学军)审核——>校工会主席审核——>流程结束 * 校工会活动——>校工会负责人(姜学军)审核——>校工会主席审核——>流程结束
* 基层工会活动——>基层工会主席审核——>校工会负责人(姜学军)审核——>校工会主席审核——>流程结束 * 基层工会活动——>基层工会主席审核——>校工会负责人(姜学军)审核——>校工会主席审核——>流程结束
* 协会活动——>协会负责人审核——>校工会负责人(姜学军)审核——>校工会主席审核——>流程结束 * 协会活动——>协会负责人审核——>校工会负责人(姜学军)审核——>校工会主席审核——>流程结束
*/ */
@IocBean @IocBean
@Ok("json:full") @Ok("json:full")
@@ -39,63 +43,92 @@ public class ActivityReimbursementApplyController {
@At("") @At("")
@Ok("beetl:/platform/jf/reimbursement/apply.html") @Ok("beetl:/platform/jf/reimbursement/apply.html")
@RequiresPermissions("sys.jf.reimbursement.apply") @RequiresPermissions("sys.jf.reimbursement.apply")
public void index() {} public void index() {
}
@At @At
@ViReturn @ViReturn
@RequiresPermissions("sys.jf.reimbursement.apply") @RequiresPermissions("sys.jf.reimbursement.apply")
@Aop(TransAop.READ_COMMITTED) @Aop(TransAop.READ_COMMITTED)
public Object doEdit(@Param("activityBx") ActivityBx activityBx,@Param(value = "sign",required = false)String sign){ public Object doSave(@Param("activityBx") ActivityBx activityBx) {
List<ActivityBx.Budget> budgets = activityBx.getBudgets();
if (ArrayUtil.isNotEmpty(budgets)) {
double sum = budgets.stream().mapToDouble(ActivityBx.Budget::getActualPrice).sum();
activityBx.setActivity_money(sum);
activityBx.setReimbursement_apply_time(DateUtil.today());
}
activityBx.setFiles(null);
activityBx.setActivity_content(null);
activityBx.setReimbursement_state_id(999);
activityBxService.updateIgnoreNull(activityBx);
return null;
}
@At
@ViReturn
@RequiresPermissions("sys.jf.reimbursement.apply")
@Aop(TransAop.READ_COMMITTED)
public Object doEdit(@Param("activityBx") ActivityBx activityBx, @Param(value = "sign", required = false) String sign) {
int count = activityBxService.count(Cnd.where("id", "=", activityBx.getId())); int count = activityBxService.count(Cnd.where("id", "=", activityBx.getId()));
switch (activityBx.getActivity_type()){ switch (activityBx.getActivity_type()) {
case 40001 -> activityBx.setReimbursement_state_id(1020); case 40001 -> activityBx.setReimbursement_state_id(1020);
case 40002 -> activityBx.setReimbursement_state_id(1010); case 40002 -> activityBx.setReimbursement_state_id(1010);
case 40003 -> activityBx.setReimbursement_state_id(1000); case 40003 -> activityBx.setReimbursement_state_id(1000);
} }
List<ActivityBx.Budget> budgets = activityBx.getBudgets();
double sum = budgets.stream().mapToDouble(ActivityBx.Budget::getActualPrice).sum();
activityBx.setActivity_money(sum);
activityBx.setReimbursement_apply_time(DateUtil.today()); activityBx.setReimbursement_apply_time(DateUtil.today());
if (StrUtil.isNotBlank(activityBx.getId()) && count>0){ if (StrUtil.isNotBlank(activityBx.getId()) && count > 0) {
activityBx.setFiles(null); activityBx.setFiles(null);
activityBx.setActivity_content(null); activityBx.setActivity_content(null);
activityBxService.updateIgnoreNull(activityBx); activityBxService.updateIgnoreNull(activityBx);
} else { } else {
activityBxService.doAdd(activityBx); // activityBxService.doAdd(activityBx);
} }
NutMap map = new NutMap(); NutMap map = new NutMap();
map.put("userId",ShiroUtil.getUserId()); map.put("userId", ShiroUtil.getUserId());
//流程开始 //流程开始
ReimbursementToHandler.START_PROCESS.exec(activityBx.getId(),map); ReimbursementToHandler.START_PROCESS.exec(activityBx.getId(), map);
if (activityBx.getActivity_type() == 40001) { if (activityBx.getActivity_type() == 40001) {
//校工会申请,校工会负责人审核 //校工会申请,校工会负责人审核
ReimbursementToHandler.CREATE_SCHOOL_DIRECTOR_TASK.exec(activityBx.getId(), map); ReimbursementToHandler.CREATE_SCHOOL_DIRECTOR_TASK.exec(activityBx.getId(), map);
} else if (activityBx.getActivity_type() == 40002) { } else if (activityBx.getActivity_type() == 40002) {
//分工会 //分工会
ReimbursementToHandler.CREATE_UNION_TASK.exec(activityBx.getId(),map); ReimbursementToHandler.CREATE_UNION_TASK.exec(activityBx.getId(), map);
} else if (activityBx.getActivity_type() == 40003) { } else if (activityBx.getActivity_type() == 40003) {
//协会 //协会
ReimbursementToHandler.CREATE_CLUB_TASK.exec(activityBx.getId(),map); ReimbursementToHandler.CREATE_CLUB_TASK.exec(activityBx.getId(), map);
} }
return null; return null;
} }
@At @At
@ViReturn @ViReturn
@RequiresPermissions("sys.jf.reimbursement.apply") @RequiresPermissions("sys.jf.reimbursement.apply")
public Object getActivityReimbursementByUser(){ public Object getActivityReimbursementByUser() {
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
cnd.and("state_id", "=", 1060); cnd.and("state_id", "=", 1060);
cnd.andEX("`year`","=",DateUtil.thisYear()); cnd.andEX("`year`", "=", DateUtil.thisYear());
cnd.and(Cnd.exps("reimbursement_state_id","is",null).or("reimbursement_state_id","=","")); SqlExpressionGroup seg = new SqlExpressionGroup();
cnd.and(Cnd.exps("reimbursement_state_id","is",null).or("reimbursement_state_id","=","")); seg.or("reimbursement_state_id", "in", List.of(1005, 1015, 1025, 1045));
if (!ShiroUtil.hasAnyRoles("sysadmin")){ seg.or("reimbursement_union_audit_id", "is", null);
cnd.and("user_id","=",ShiroUtil.getUserId()); cnd.and(seg);
// cnd.and("reimbursement_unit_secretary_audit_id", "is", null);
// cnd.and("reimbursement_finance_audit_id", "is", null);
// cnd.and("reimbursement_school_director_id", "is", null);
// cnd.and("reimbursement_school_chairman_id", "is", null);
if (!ShiroUtil.hasAnyRoles("sysadmin")) {
cnd.and("user_id", "=", ShiroUtil.getUserId());
} }
return activityBxService.query(cnd); return activityBxService.query(cnd);
} }
@@ -104,7 +137,7 @@ public class ActivityReimbursementApplyController {
@At @At
@ViReturn @ViReturn
@RequiresPermissions("sys.jf.reimbursement.apply") @RequiresPermissions("sys.jf.reimbursement.apply")
public Object findOne(String id){ public Object findOne(String id) {
return activityBxService.queryOne(id); return activityBxService.queryOne(id);
} }
} }
@@ -2,9 +2,7 @@ package io.v.nutz.zhgh.jf.controller.reimbursement;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.wizzer.framework.base.Result; import cn.wizzer.framework.base.Result;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.utils.Vi; import io.v.nutz.base.utils.Vi;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.jf.service.ActivityBxService; import io.v.nutz.zhgh.jf.service.ActivityBxService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
@@ -19,8 +17,10 @@ import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok; import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param; import org.nutz.mvc.annotation.Param;
import java.util.*; import java.util.ArrayList;
import java.util.stream.Collectors; import java.util.HashMap;
import java.util.List;
import java.util.Map;
/** /**
* @version 1.0 * @version 1.0
@@ -3,18 +3,17 @@ package io.v.nutz.zhgh.jf.controller.reimbursement;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.zhgh.jf.handle.reimbursement.ReimbursementToHandler;
import io.v.nutz.zhgh.jf.service.ActivityBxService;
import io.v.nutz.base.model.Audit; import io.v.nutz.base.model.Audit;
import io.v.nutz.base.query.PageForm; import io.v.nutz.base.query.PageForm;
import io.v.nutz.web.commons.utils.ShiroUtil; import io.v.nutz.base.utils.Vi;
import io.v.nutz.web.commons.slog.annotation.SLog; import io.v.nutz.web.commons.slog.annotation.SLog;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.jf.handle.reimbursement.ReimbursementToHandler;
import io.v.nutz.zhgh.jf.service.ActivityBxService;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.aop.interceptor.ioc.TransAop; import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Chain; import org.nutz.dao.Chain;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql; import org.nutz.dao.sql.Sql;
import org.nutz.ioc.aop.Aop; import org.nutz.ioc.aop.Aop;
import org.nutz.ioc.loader.annotation.Inject; import org.nutz.ioc.loader.annotation.Inject;
@@ -5,19 +5,17 @@ import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity; import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import io.v.nutz.zhgh.activity.models.ActivityTissuePerson;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.utils.Vi; import io.v.nutz.base.utils.Vi;
import io.v.nutz.base.utils.ViTool;
import io.v.nutz.sys.models.Sys_file;
import io.v.nutz.web.commons.utils.FileUtil;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.activity.models.ActivityTissuePerson;
import io.v.nutz.zhgh.jf.handle.reimbursement.ReimbursementToHandler; import io.v.nutz.zhgh.jf.handle.reimbursement.ReimbursementToHandler;
import io.v.nutz.zhgh.jf.model.ActivityBx; import io.v.nutz.zhgh.jf.model.ActivityBx;
import io.v.nutz.zhgh.jf.service.ActivityBxService; import io.v.nutz.zhgh.jf.service.ActivityBxService;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.sys.models.Sys_file;
import io.v.nutz.sys.models.Sys_union;
import io.v.nutz.sys.models.Sys_user;
import io.v.nutz.base.utils.ViTool;
import io.v.nutz.web.commons.utils.FileUtil;
import io.v.nutz.web.commons.utils.ShiroUtil;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
@@ -25,7 +23,6 @@ import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.boot.starter.ftp.FtpService; import org.nutz.boot.starter.ftp.FtpService;
import org.nutz.dao.Chain; import org.nutz.dao.Chain;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.dao.Sqls; import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql; import org.nutz.dao.sql.Sql;
import org.nutz.dao.util.cri.SqlExpressionGroup; import org.nutz.dao.util.cri.SqlExpressionGroup;
@@ -33,7 +30,6 @@ import org.nutz.ioc.aop.Aop;
import org.nutz.ioc.loader.annotation.Inject; import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean; import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.Lang; import org.nutz.lang.Lang;
import org.nutz.lang.Strings;
import org.nutz.lang.random.R; import org.nutz.lang.random.R;
import org.nutz.lang.util.NutMap; import org.nutz.lang.util.NutMap;
import org.nutz.mvc.annotation.At; import org.nutz.mvc.annotation.At;
@@ -44,7 +40,6 @@ import javax.servlet.http.HttpServletResponse;
import java.io.File; import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.io.IOException;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@@ -106,15 +101,15 @@ public class ActivityReimbursementMineController {
$condition $condition
"""); """);
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
if (!ShiroUtil.hasAnyRoles("sysadmin,wyh02,H10,xghng")) { if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) {
SqlExpressionGroup group2 = new SqlExpressionGroup(); SqlExpressionGroup group2 = new SqlExpressionGroup();
// if (ShiroUtil.hasAnyRoles("gh01,H04")) { if (ShiroUtil.hasAnyRoles("gh01,H04")) {
// group2.or("u.unionid", "=", vi.getUnionId()); group2.or("u.unionid", "=", vi.getUnionId());
// } else if (ShiroUtil.hasRole("H02")) { } else if (ShiroUtil.hasRole("H02")) {
// group2.or("scu.clubid", "=", vi.getClubId()); group2.or("scu.clubid", "=", vi.getClubId());
// } else { } else {
// } group2.or("act.user_id", "=", ShiroUtil.getUserId());
group2.or("act.user_id", "=", ShiroUtil.getUserId()); }
cnd.and(group2); cnd.and(group2);
} }
@@ -2,17 +2,15 @@ package io.v.nutz.zhgh.jf.controller.reimbursement;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.zhgh.jf.handle.reimbursement.ReimbursementToHandler;
import io.v.nutz.zhgh.jf.service.ActivityBxService;
import io.v.nutz.base.model.Audit; import io.v.nutz.base.model.Audit;
import io.v.nutz.base.query.PageForm; import io.v.nutz.base.query.PageForm;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.web.commons.slog.annotation.SLog; import io.v.nutz.web.commons.slog.annotation.SLog;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.jf.handle.reimbursement.ReimbursementToHandler;
import io.v.nutz.zhgh.jf.service.ActivityBxService;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.dao.Chain; import org.nutz.dao.Chain;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql; import org.nutz.dao.sql.Sql;
import org.nutz.ioc.loader.annotation.Inject; import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean; import org.nutz.ioc.loader.annotation.IocBean;
@@ -2,13 +2,12 @@ package io.v.nutz.zhgh.jf.controller.reimbursement;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.zhgh.jf.handle.reimbursement.ReimbursementToHandler;
import io.v.nutz.zhgh.jf.service.ActivityBxService;
import io.v.nutz.base.model.Audit; import io.v.nutz.base.model.Audit;
import io.v.nutz.base.query.PageForm; import io.v.nutz.base.query.PageForm;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.web.commons.slog.annotation.SLog; import io.v.nutz.web.commons.slog.annotation.SLog;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.jf.handle.reimbursement.ReimbursementToHandler;
import io.v.nutz.zhgh.jf.service.ActivityBxService;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.dao.Chain; import org.nutz.dao.Chain;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
@@ -2,11 +2,9 @@ package io.v.nutz.zhgh.jf.controller.reimbursement;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.zhgh.jf.model.ActivityBx; import io.v.nutz.zhgh.jf.model.ActivityBx;
import io.v.nutz.zhgh.jf.service.ActivityBxService; import io.v.nutz.zhgh.jf.service.ActivityBxService;
import io.v.nutz.base.model.Audit;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.web.commons.slog.annotation.SLog;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
import org.nutz.dao.sql.Sql; import org.nutz.dao.sql.Sql;
@@ -18,7 +16,6 @@ import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param; import org.nutz.mvc.annotation.Param;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
/** /**
* @version 1.0 * @version 1.0
@@ -2,17 +2,16 @@ package io.v.nutz.zhgh.jf.controller.reimbursement;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.zhgh.jf.handle.reimbursement.ReimbursementToHandler;
import io.v.nutz.zhgh.jf.service.ActivityBxService;
import io.v.nutz.base.model.Audit; import io.v.nutz.base.model.Audit;
import io.v.nutz.base.query.PageForm; import io.v.nutz.base.query.PageForm;
import io.v.nutz.web.commons.utils.ShiroUtil; import io.v.nutz.base.utils.Vi;
import io.v.nutz.web.commons.slog.annotation.SLog; import io.v.nutz.web.commons.slog.annotation.SLog;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.jf.handle.reimbursement.ReimbursementToHandler;
import io.v.nutz.zhgh.jf.service.ActivityBxService;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.dao.Chain; import org.nutz.dao.Chain;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql; import org.nutz.dao.sql.Sql;
import org.nutz.ioc.loader.annotation.Inject; import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean; import org.nutz.ioc.loader.annotation.IocBean;
@@ -65,7 +64,7 @@ public class ActivityReimbursementUnionChairmanController {
//1已审核;2未审核;0全部 //1已审核;2未审核;0全部
cnd.and("act.reimbursement_state_id", "1".equals(isAudit) ? ">" : "2".equals(isAudit) ? "=" : ">=", 1010); cnd.and("act.reimbursement_state_id", "1".equals(isAudit) ? ">" : "2".equals(isAudit) ? "=" : ">=", 1010);
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")){ if (ShiroUtil.hasAnyRoles("sysadmin,A06")){
cnd.andEX("u.unionid","=",unionId); cnd.andEX("u.unionid","=",unionId);
} else { } else {
cnd.and("u.unionid","=", Vi.getUnionId()); cnd.and("u.unionid","=", Vi.getUnionId());
@@ -1,11 +1,11 @@
package io.v.nutz.zhgh.jf.controller.school; package io.v.nutz.zhgh.jf.controller.school;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.service.BaseService; import io.v.nutz.base.service.BaseService;
import io.v.nutz.base.utils.DateUtil; import io.v.nutz.base.utils.DateUtil;
import io.v.nutz.zhgh.jf.model.CostsSet; import io.v.nutz.zhgh.jf.model.CostsSet;
import io.v.nutz.zhgh.jf.model.jf_school; import io.v.nutz.zhgh.jf.model.jf_school;
import io.v.nutz.base.query.PageForm;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.dao.Chain; import org.nutz.dao.Chain;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
@@ -3,9 +3,9 @@ package io.v.nutz.zhgh.jf.controller.yjgh;
import cn.afterturn.easypoi.excel.ExcelImportUtil; import cn.afterturn.easypoi.excel.ExcelImportUtil;
import cn.afterturn.easypoi.excel.entity.ImportParams; import cn.afterturn.easypoi.excel.entity.ImportParams;
import cn.wizzer.framework.base.Result; import cn.wizzer.framework.base.Result;
import io.v.nutz.zhgh.jf.model.jf_yjgh;
import io.v.nutz.sys.models.Sys_union; import io.v.nutz.sys.models.Sys_union;
import io.v.nutz.sys.services.SysUnionService; import io.v.nutz.sys.services.SysUnionService;
import io.v.nutz.zhgh.jf.model.jf_yjgh;
import org.nutz.ioc.loader.annotation.Inject; import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean; import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.util.NutMap; import org.nutz.lang.util.NutMap;
@@ -7,7 +7,6 @@ import io.v.nutz.base.utils.PageUtil;
import io.v.nutz.base.utils.Roles; import io.v.nutz.base.utils.Roles;
import io.v.nutz.web.commons.utils.ShiroUtil; import io.v.nutz.web.commons.utils.ShiroUtil;
import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.dao.Chain; import org.nutz.dao.Chain;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
@@ -3,14 +3,13 @@ package io.v.nutz.zhgh.jf.controller.yjgh;
import cn.wizzer.framework.base.Result; import cn.wizzer.framework.base.Result;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.page.Pagination; import io.v.nutz.base.page.Pagination;
import io.v.nutz.base.service.AsyncService;
import io.v.nutz.base.service.BaseService; import io.v.nutz.base.service.BaseService;
import io.v.nutz.base.utils.DateUtil; import io.v.nutz.base.utils.DateUtil;
import io.v.nutz.zhgh.jf.model.CostsSet; import io.v.nutz.zhgh.jf.model.CostsSet;
import io.v.nutz.zhgh.jf.model.jf_yjgh; import io.v.nutz.zhgh.jf.model.jf_yjgh;
import io.v.nutz.zhgh.jf.service.CostsSetService; import io.v.nutz.zhgh.jf.service.CostsSetService;
import io.v.nutz.zhgh.jf.service.jfYjghService; import io.v.nutz.zhgh.jf.service.jfYjghService;
import io.v.nutz.base.service.AsyncService;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.aop.interceptor.ioc.TransAop; import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Chain; import org.nutz.dao.Chain;
@@ -1,32 +1,20 @@
package io.v.nutz.zhgh.jf.handle.reimbursement; package io.v.nutz.zhgh.jf.handle.reimbursement;
import io.v.nutz.base.utils.Roles;
import io.v.nutz.base.utils.Vi; import io.v.nutz.base.utils.Vi;
import io.v.nutz.base.utils.ViResource; import io.v.nutz.base.utils.ViResource;
import io.v.nutz.sys.models.Sys_user_role;
import io.v.nutz.sys.models.User; import io.v.nutz.sys.models.User;
import io.v.nutz.sys.services.SysLocalProcessService; import io.v.nutz.sys.services.SysLocalProcessService;
import io.v.nutz.sys.services.impl.SysLocalProcessServiceImpl; import io.v.nutz.sys.services.impl.SysLocalProcessServiceImpl;
import io.v.nutz.web.commons.base.Globals;
import io.v.nutz.web.commons.utils.ShiroUtil; import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.member.model.MemberChangeRecord;
import io.v.nutz.zhgh.needhandlebycpu.model.vo.ParticipantVO;
import io.v.nutz.zhgh.needhandlebycpu.model.vo.TaskVO;
import io.v.nutz.zhgh.needhandlebycpu.service.HandleCpuCommonService; import io.v.nutz.zhgh.needhandlebycpu.service.HandleCpuCommonService;
import io.v.nutz.zhgh.needhandlebycpu.service.impl.HandleCpuCommonServiceImpl; import io.v.nutz.zhgh.needhandlebycpu.service.impl.HandleCpuCommonServiceImpl;
import io.v.nutz.zhgh.zgfw.model.condolence.Condolence;
import io.v.nutz.zhgh.zgfw.model.difficult.Zgfw_knbf;
import io.v.nutz.zhgh.zgfw.service.CondolenceService; import io.v.nutz.zhgh.zgfw.service.CondolenceService;
import io.v.nutz.zhgh.zgfw.service.impl.CondolenceServiceImpl; import io.v.nutz.zhgh.zgfw.service.impl.CondolenceServiceImpl;
import lombok.Getter; import lombok.Getter;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
import org.nutz.dao.Dao; import org.nutz.dao.Dao;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.lang.util.NutMap; import org.nutz.lang.util.NutMap;
import java.util.ArrayList;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@@ -50,7 +38,7 @@ public enum ReimbursementToHandler {
User user = dao.fetch(User.class, Cnd.where("id", "=", userId)); User user = dao.fetch(User.class, Cnd.where("id", "=", userId));
localProcessService.startProcess( localProcessService.startProcess(
user.getUnionname() + "(" + user.getUsername() + ")【活动报销】申请", "【活动报销】" + user.getUnionname() + "(" + user.getUsername() + ")",
"activity_reimbursement@" + reimbursementId, "activity_reimbursement@" + reimbursementId,
"", "",
userId, userId,
@@ -209,7 +197,7 @@ public enum ReimbursementToHandler {
"activity_reimbursement_school_director_audit", "activity_reimbursement_school_director_audit",
"校工会负责人审核", "校工会负责人审核",
ShiroUtil.getUserId(), ShiroUtil.getUserId(),
List.of("8333300107"), List.of("1019911404"),
"/platform/jf/reimbursement/schoolDirector", "/platform/jf/reimbursement/schoolDirector",
"/platform/jf/reimbursement/schoolDirector", "/platform/jf/reimbursement/schoolDirector",
"/platform/jf/reimbursement/schoolDirector", "/platform/jf/reimbursement/schoolDirector",
@@ -405,6 +405,36 @@ public class ActivityBx {
private List<Sys_file> newsFiles; private List<Sys_file> newsFiles;
@Column
@Comment("活动经费预算")
@ColDefine(type = ColType.MYSQL_JSON)
private List<Budget> budgets;
/**
* 活动费用预算
*/
@Data
public static class Budget{
// 名称
private String name;
// 预算费用
private Double budgetPrice;
// 实际费用
private Double actualPrice;
// 收款人id
private String payeeId;
// 收款人姓名
private String username;
// 收款人工号
private String loginName;
// 支行名称
private String bankName;
// 报销卡号
private String bankCardNum;
// 备注
private String remark;
}
@Column @Column
@Comment("单据号") @Comment("单据号")
@Prev({ @Prev({
@@ -3,7 +3,6 @@ package io.v.nutz.zhgh.jf.model;
import lombok.Data; import lombok.Data;
import org.nutz.dao.entity.annotation.*; import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert; import org.nutz.dao.interceptor.annotation.PrevInsert;
import org.nutz.integration.json4excel.annotation.J4EIgnore;
/** /**
* TODO * TODO
@@ -1,7 +1,7 @@
package io.v.nutz.zhgh.jf.service; package io.v.nutz.zhgh.jf.service;
import io.v.nutz.zhgh.jf.model.ActivityBx;
import io.v.nutz.base.service.ViService; import io.v.nutz.base.service.ViService;
import io.v.nutz.zhgh.jf.model.ActivityBx;
import org.nutz.dao.Sqls; import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql; import org.nutz.dao.sql.Sql;
import org.nutz.lang.util.NutMap; import org.nutz.lang.util.NutMap;
@@ -3,22 +3,18 @@ package io.v.nutz.zhgh.jf.service.impl;
import cn.hutool.core.convert.Convert; import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import com.deepoove.poi.XWPFTemplate; import com.deepoove.poi.XWPFTemplate;
import com.deepoove.poi.config.Configure; import com.deepoove.poi.config.Configure;
import com.deepoove.poi.data.PictureRenderData; import com.deepoove.poi.data.PictureRenderData;
import com.deepoove.poi.policy.HackLoopTableRenderPolicy; import com.deepoove.poi.policy.HackLoopTableRenderPolicy;
import io.v.nutz.zhgh.activity.models.ActivityTissue; import io.v.nutz.base.model.Audit;
import io.v.nutz.base.utils.DateUtil; import io.v.nutz.base.service.impl.ViServiceImpl;
import io.v.nutz.base.utils.Html2Text; import io.v.nutz.base.utils.Html2Text;
import io.v.nutz.base.utils.Vi; import io.v.nutz.base.utils.Vi;
import io.v.nutz.base.model.Goods;
import io.v.nutz.zhgh.jf.model.ActivityBx; import io.v.nutz.zhgh.jf.model.ActivityBx;
import io.v.nutz.zhgh.jf.model.ActivityFile; import io.v.nutz.zhgh.jf.model.ActivityFile;
import io.v.nutz.zhgh.jf.service.ActivityBxService; import io.v.nutz.zhgh.jf.service.ActivityBxService;
import io.v.nutz.base.model.Audit;
import io.v.nutz.base.service.impl.ViServiceImpl;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.web.commons.base.Globals;
import org.nutz.aop.interceptor.ioc.TransAop; import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
import org.nutz.dao.Dao; import org.nutz.dao.Dao;
@@ -30,9 +26,10 @@ import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.Strings; import org.nutz.lang.Strings;
import org.nutz.lang.util.NutMap; import org.nutz.lang.util.NutMap;
import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.OutputStream; import java.io.OutputStream;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Base64; import java.util.Base64;
import java.util.HashMap; import java.util.HashMap;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
@@ -68,11 +65,12 @@ public class ActivityBxServiceImpl extends ViServiceImpl<ActivityBx> implements
@Aop(TransAop.READ_COMMITTED) @Aop(TransAop.READ_COMMITTED)
public void doEdit(ActivityBx activityBx) { public void doEdit(ActivityBx activityBx) {
activityBx.getGoods().forEach(v -> { /*activityBx.getGoods().forEach(v -> {
v.setReid(activityBx.getId()); v.setReid(activityBx.getId());
}); });
dao().clear(Goods.class,Cnd.where("reid","=",activityBx.getId())); dao().clear(Goods.class,Cnd.where("reid","=",activityBx.getId()));
insert(activityBx.getGoods()); insert(activityBx.getGoods());*/
update(activityBx);
} }
@Override @Override
@@ -130,7 +128,7 @@ public class ActivityBxServiceImpl extends ViServiceImpl<ActivityBx> implements
sql.setCallback(Sqls.callback.map()); sql.setCallback(Sqls.callback.map());
dao().execute(sql); dao().execute(sql);
NutMap record = (NutMap) sql.getResult(); NutMap record = (NutMap) sql.getResult();
record.setv("Goods", dao().query(Goods.class, Cnd.where("reid", "=", record.getString("id")))); // record.setv("Goods", dao().query("Goods", Cnd.where("reid", "=", record.getString("id"))));
if (record.size() == 0) { if (record.size() == 0) {
return null; return null;
@@ -172,7 +170,9 @@ public class ActivityBxServiceImpl extends ViServiceImpl<ActivityBx> implements
NutMap nutMap = queryOne(id); NutMap nutMap = queryOne(id);
nutMap.setv("activity_content", Html2Text.toPlainText(nutMap.getString("activity_content"))); nutMap.setv("activity_content", Html2Text.toPlainText(nutMap.getString("activity_content")));
nutMap.setv("apply_time", nutMap.getString("apply_time").substring(0, 10)); nutMap.setv("apply_time", nutMap.getString("apply_time").substring(0, 10));
List<NutMap> goods = nutMap.getAsList("Goods", NutMap.class);
String budgets = nutMap.getString("budgets");
List<NutMap> goods = JSONUtil.parseArray(budgets).toList(NutMap.class);
for (int i = 0; i < goods.size(); i++) { for (int i = 0; i < goods.size(); i++) {
goods.get(i).put("ranking", i + 1); goods.get(i).put("ranking", i + 1);
@@ -233,18 +233,26 @@ public class ActivityBxServiceImpl extends ViServiceImpl<ActivityBx> implements
if (StrUtil.isNotBlank(one.getString("activity_content"))) { if (StrUtil.isNotBlank(one.getString("activity_content"))) {
one.setv("activity_content", Html2Text.getContent(one.getString("activity_content"))); one.setv("activity_content", Html2Text.getContent(one.getString("activity_content")));
} }
one.setv("money_big", Convert.digitToChinese(one.getDouble("funds_money"))); one.setv("money_big", Convert.digitToChinese(one.getDouble("activity_money")));
one.setv("apply_time", one.getString("apply_time").substring(0, 10)); one.setv("apply_time", one.getString("apply_time").substring(0, 10));
String budgets = one.getString("budgets");
List<NutMap> goods = JSONUtil.parseArray(budgets).toList(NutMap.class);
one.put("goods",goods);
switch (one.getString("activity_type")) { switch (one.getString("activity_type")) {
case "40001" -> one.setv("jfName", "校工会"); case "40001" -> one.setv("jfName", "校工会");
case "40002" -> one.setv("jfName", "分工会"); case "40002" -> one.setv("jfName", "分工会");
case "40003" -> one.setv("jfName", "协会"); case "40003" -> one.setv("jfName", "协会");
} }
double price = one.getDouble("funds_money"); double price = one.getDouble("activity_money");
int money_int = (int) price; int money_int = (int) price;
double money_decimal = money_int - price;
BigDecimal priceBigDecimal = new BigDecimal(price);
BigDecimal moneyDecimal = priceBigDecimal.subtract(new BigDecimal(money_int));
one.setv("one", money_int >= 1000000 ? (money_int / 1000000) % 10 : null); one.setv("one", money_int >= 1000000 ? (money_int / 1000000) % 10 : null);
one.setv("two", money_int >= 100000 ? (money_int / 100000) % 10 : null); one.setv("two", money_int >= 100000 ? (money_int / 100000) % 10 : null);
one.setv("three", money_int >= 10000 ? (money_int / 10000) % 10 : null); one.setv("three", money_int >= 10000 ? (money_int / 10000) % 10 : null);
@@ -252,8 +260,17 @@ public class ActivityBxServiceImpl extends ViServiceImpl<ActivityBx> implements
one.setv("five", money_int >= 100 ? (money_int / 100) % 10 : null); one.setv("five", money_int >= 100 ? (money_int / 100) % 10 : null);
one.setv("six", money_int >= 10 ? (money_int / 10) % 10 : null); one.setv("six", money_int >= 10 ? (money_int / 10) % 10 : null);
one.setv("seven", money_int >= 1 ? money_int % 10 : null); one.setv("seven", money_int >= 1 ? money_int % 10 : null);
one.setv("eight", (int) (money_decimal / 1) * 10);
one.setv("nine", (int) (money_decimal / 0.1) * 100); // 提取小数部分的各个位上的数值
BigDecimal tenthsPart = moneyDecimal.multiply(BigDecimal.TEN).setScale(0, RoundingMode.DOWN);
int tenths = tenthsPart.intValue();
BigDecimal hundredthsPart = moneyDecimal.multiply(BigDecimal.valueOf(100)).setScale(0, RoundingMode.DOWN);
int hundredths = hundredthsPart.intValue();
// BigDecimal decimalPart1 = moneyDecimal.divide(new BigDecimal("1"), 1, RoundingMode.HALF_UP);
// BigDecimal decimalPart2 = moneyDecimal.divide(new BigDecimal("0.1"), 1, RoundingMode.HALF_UP);
one.setv("eight", (tenths % 10));
one.setv("nine", (hundredths % 10) + 1);
/*基层工会主席签字*/ /*基层工会主席签字*/
@@ -277,7 +294,9 @@ public class ActivityBxServiceImpl extends ViServiceImpl<ActivityBx> implements
} }
// String fileName = Globals.schoolName + "【" + one.getString("activity_name") + "】报销凭证"; // String fileName = Globals.schoolName + "【" + one.getString("activity_name") + "】报销凭证";
Configure config = Configure.newBuilder().build(); HackLoopTableRenderPolicy policy = new HackLoopTableRenderPolicy();
Configure config = Configure.newBuilder().bind("goods", policy).build();
InputStream inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("docTemplate/funds3.docx"); InputStream inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("docTemplate/funds3.docx");
// response.addHeader("Content-Type", "application/octet-stream"); // response.addHeader("Content-Type", "application/octet-stream");
// response.addHeader("Content-Disposition", "attachment; filename=\"" + new String(fileName.getBytes("UTF-8"), "ISO-8859-1") + "\".docx"); // response.addHeader("Content-Disposition", "attachment; filename=\"" + new String(fileName.getBytes("UTF-8"), "ISO-8859-1") + "\".docx");
@@ -1,8 +1,8 @@
package io.v.nutz.zhgh.jf.service.impl; package io.v.nutz.zhgh.jf.service.impl;
import io.v.nutz.base.service.impl.ViServiceImpl;
import io.v.nutz.zhgh.jf.model.jf_club; import io.v.nutz.zhgh.jf.model.jf_club;
import io.v.nutz.zhgh.jf.service.jfClubService; import io.v.nutz.zhgh.jf.service.jfClubService;
import io.v.nutz.base.service.impl.ViServiceImpl;
import org.nutz.dao.Dao; import org.nutz.dao.Dao;
import org.nutz.ioc.loader.annotation.IocBean; import org.nutz.ioc.loader.annotation.IocBean;
@@ -1,8 +1,8 @@
package io.v.nutz.zhgh.jf.service.impl; package io.v.nutz.zhgh.jf.service.impl;
import io.v.nutz.base.service.impl.ViServiceImpl;
import io.v.nutz.zhgh.jf.model.jf_yjgh; import io.v.nutz.zhgh.jf.model.jf_yjgh;
import io.v.nutz.zhgh.jf.service.jfYjghService; import io.v.nutz.zhgh.jf.service.jfYjghService;
import io.v.nutz.base.service.impl.ViServiceImpl;
import org.nutz.dao.Dao; import org.nutz.dao.Dao;
import org.nutz.ioc.loader.annotation.IocBean; import org.nutz.ioc.loader.annotation.IocBean;
@@ -1,7 +1,7 @@
package io.v.nutz.zhgh.jf.service; package io.v.nutz.zhgh.jf.service;
import io.v.nutz.zhgh.jf.model.jf_club;
import io.v.nutz.base.service.ViService; import io.v.nutz.base.service.ViService;
import io.v.nutz.zhgh.jf.model.jf_club;
public interface jfClubService extends ViService<jf_club> { public interface jfClubService extends ViService<jf_club> {
} }
@@ -1,7 +1,7 @@
package io.v.nutz.zhgh.jf.service; package io.v.nutz.zhgh.jf.service;
import io.v.nutz.zhgh.jf.model.jf_yjgh;
import io.v.nutz.base.service.ViService; import io.v.nutz.base.service.ViService;
import io.v.nutz.zhgh.jf.model.jf_yjgh;
public interface jfYjghService extends ViService<jf_yjgh> { public interface jfYjghService extends ViService<jf_yjgh> {
} }
@@ -411,7 +411,7 @@ public class WelfareCommonController {
@Excel(name = "身份证号", width = 20d) @Excel(name = "身份证号", width = 20d)
private String idcard; private String idcard;
/* @Excel(name = "人员类型", width = 20d) /* @Excel(name = "人员性质", width = 20d)
private String personType; private String personType;
@Excel(name = "在职状态", width = 20d) @Excel(name = "在职状态", width = 20d)
@@ -465,7 +465,7 @@ public class WelfareCommonController {
ExportParams exportParams = new ExportParams(); ExportParams exportParams = new ExportParams();
if (!ShiroUtil.hasAnyRoles("sysadmin,SchoolUnionAdmin,SchoolUnionMemberAdmin,SchoolUnionWelfareAdmin")) { if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) {
cnd.and("vwl.unionid", "=", Vi.getUnionId()); cnd.and("vwl.unionid", "=", Vi.getUnionId());
exportParams.setTitle(Vi.getUnion().getUnionname() + "名单"); exportParams.setTitle(Vi.getUnion().getUnionname() + "名单");
} }
@@ -541,7 +541,7 @@ public class WelfareCommonController {
cnd.andEX("personType", "in", personTypes); cnd.andEX("personType", "in", personTypes);
cnd.andEX("userState", "in", userStates); cnd.andEX("userState", "in", userStates);
if (!ShiroUtil.hasAnyRoles("sysadmin,SchoolUnionAdmin,SchoolUnionMemberAdmin,SchoolUnionWelfareAdmin,H04,gh12") && Globals.MyConfig.getBoolean("isThreeUnit")) { if (!ShiroUtil.hasAnyRoles("sysadmin,A06,H04,gh12") && Globals.MyConfig.getBoolean("isThreeUnit")) {
cnd.and("list.unionGroupId", "in", ShiroUtil.getUnionGroupIds()); cnd.and("list.unionGroupId", "in", ShiroUtil.getUnionGroupIds());
} }
cnd.asc("unionname"); cnd.asc("unionname");
@@ -572,7 +572,7 @@ public class WelfareCommonController {
entityList.add(new ExcelExportEntity("工号", "loginname", 20)); entityList.add(new ExcelExportEntity("工号", "loginname", 20));
entityList.add(new ExcelExportEntity("姓名", "username", 20)); entityList.add(new ExcelExportEntity("姓名", "username", 20));
entityList.add(new ExcelExportEntity("在职状态", "userState", 20)); entityList.add(new ExcelExportEntity("在职状态", "userState", 20));
entityList.add(new ExcelExportEntity("人员类型", "personType", 20)); entityList.add(new ExcelExportEntity("人员性质", "personType", 20));
entityList.add(new ExcelExportEntity("所属工会", "unionname", 50)); entityList.add(new ExcelExportEntity("所属工会", "unionname", 50));
entityList.add(new ExcelExportEntity("所属单位", "unitname", 50)); entityList.add(new ExcelExportEntity("所属单位", "unitname", 50));
@@ -4,11 +4,13 @@ import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.ExcelImportUtil; import cn.afterturn.easypoi.excel.ExcelImportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams; import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.ImportParams; import cn.afterturn.easypoi.excel.entity.ImportParams;
import cn.afterturn.easypoi.excel.entity.TemplateExportParams;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType; import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity; import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.afterturn.easypoi.excel.export.ExcelExportService; import cn.afterturn.easypoi.excel.export.ExcelExportService;
import cn.hutool.core.io.FileUtil; import cn.hutool.core.io.FileUtil;
import cn.hutool.core.lang.Assert; import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.wizzer.framework.base.Result; import cn.wizzer.framework.base.Result;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
@@ -34,6 +36,7 @@ import org.nutz.dao.Dao;
import org.nutz.dao.Sqls; import org.nutz.dao.Sqls;
import org.nutz.dao.entity.Record; import org.nutz.dao.entity.Record;
import org.nutz.dao.sql.Sql; import org.nutz.dao.sql.Sql;
import org.nutz.dao.util.cri.SqlExpressionGroup;
import org.nutz.ioc.aop.Aop; import org.nutz.ioc.aop.Aop;
import org.nutz.ioc.loader.annotation.Inject; import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean; import org.nutz.ioc.loader.annotation.IocBean;
@@ -91,8 +94,7 @@ public class WelfareListController {
@Param(value = "projectId", required = false) String projectId, @Param(value = "projectId", required = false) String projectId,
@Param(value = "optionId", required = false) String optionId, @Param(value = "optionId", required = false) String optionId,
@Param(value = "month", required = false) String month, @Param(value = "month", required = false) String month,
@Param(value = "courierNumber", required = false) String courierNumber @Param(value = "courierNumber", required = false) String courierNumber) {
) {
Sql sql = Sqls.create(""" Sql sql = Sqls.create("""
SELECT SELECT
CASE CASE
@@ -115,10 +117,10 @@ public class WelfareListController {
GROUP_CONCAT( DISTINCT wuso.optionName, '(', wus.selectNum, '份)' ) AS gist_list GROUP_CONCAT( DISTINCT wuso.optionName, '(', wus.selectNum, '份)' ) AS gist_list
FROM FROM
view_welfare_list wl view_welfare_list wl
LEFT JOIN welfare_project_user_selection wus ON wus.welfareId = wl.projectId LEFT JOIN welfare_project_user_selection wus ON wus.welfareId = wl.projectId
AND wus.selectUserId = wl.id AND wus.selectUserId = wl.id
LEFT JOIN welfare_project_subject_option wuso ON wus.selectOptionId = wuso.id 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_courier_number wcn on wcn.selectUserId = wl.id
LEFT JOIN welfare_project wp ON wp.id = wus.welfareId LEFT JOIN welfare_project wp ON wp.id = wus.welfareId
$condition $condition
"""); """);
@@ -143,11 +145,12 @@ public class WelfareListController {
cnd.andEX("wl.sex", "in", pageParam.getSex()); cnd.andEX("wl.sex", "in", pageParam.getSex());
cnd.andEX("wcn.courierNumber","=",courierNumber); cnd.andEX("wcn.courierNumber", "=", courierNumber);
cnd.groupBy("wl.id"); cnd.groupBy("wl.id");
cnd.asc("wl.unitCode"); cnd.asc("wl.unitid");
cnd.asc("wl.loginname"); cnd.asc("wl.userSortNum");
cnd.desc("wl.id");
if (!ShiroUtil.hasAnyRoles("sysadmin")) { if (!ShiroUtil.hasAnyRoles("sysadmin")) {
cnd.and("wl.unionid", "=", Vi.getUnionId()); cnd.and("wl.unionid", "=", Vi.getUnionId());
@@ -242,9 +245,17 @@ public class WelfareListController {
NutMap editData = Json.fromJson(NutMap.class, editWelfareData); NutMap editData = Json.fromJson(NutMap.class, editWelfareData);
List<NutMap> optionList = Json.fromJsonAsList(NutMap.class, welfareOptions); List<NutMap> optionList = Json.fromJsonAsList(NutMap.class, welfareOptions);
Dao dao = welfareListService.dao(); Dao dao = welfareListService.dao();
WelfareUserSelection oldSelection = dao.fetch(WelfareUserSelection.class, Cnd.where("welfareId", "=", editData.getString("projectId"))
.and("selectUserId", "=", editData.getString("userId")));
String sign = "";
if (ObjectUtil.isNotEmpty(oldSelection)) {
sign = oldSelection.getUserSign();
}
dao.clear(WelfareUserSelection.class, dao.clear(WelfareUserSelection.class,
Cnd.where("welfareId", "=", editData.getString("projectId")) Cnd.where("welfareId", "=", editData.getString("projectId"))
.and("selectUserId", "=", editData.getString("userId"))); .and("selectUserId", "=", editData.getString("userId")));
String finalSign = sign;
List<WelfareUserSelection> userSelections = optionList.stream().map(v -> { List<WelfareUserSelection> userSelections = optionList.stream().map(v -> {
WelfareUserSelection selection = new WelfareUserSelection(); WelfareUserSelection selection = new WelfareUserSelection();
selection.setSelectTime(new Date()); selection.setSelectTime(new Date());
@@ -254,6 +265,7 @@ public class WelfareListController {
selection.setReceiveAddress(editData.getString("receiveAddress")); selection.setReceiveAddress(editData.getString("receiveAddress"));
selection.setSubjectId(v.getString("subjectId")); selection.setSubjectId(v.getString("subjectId"));
selection.setSelectNum(v.getInt("selectNum")); selection.setSelectNum(v.getInt("selectNum"));
selection.setUserSign(finalSign);
return selection; return selection;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
@@ -318,7 +330,7 @@ public class WelfareListController {
"""); """);
cnd.and("wpus.welfareId", "=", projectId); cnd.and("wpus.welfareId", "=", projectId);
if (!ShiroUtil.hasAnyRoles("sysadmin,SchoolUnionWelfareAdmin")) { if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) {
cnd.and("u.unionId", "=", Vi.getUnionId()); cnd.and("u.unionId", "=", Vi.getUnionId());
} }
@@ -484,7 +496,7 @@ public class WelfareListController {
it.`name` unitname, it.`name` unitname,
wpus.selectNum wpus.selectNum
FROM FROM
welfare_project_user_selection_copy wpus welfare_project_user_selection wpus
LEFT JOIN `welfare_list` wl ON wpus.selectUserId = wl.userId LEFT JOIN `welfare_list` wl ON wpus.selectUserId = wl.userId
LEFT JOIN `sys_user` u ON u.id = wl.userId LEFT JOIN `sys_user` u ON u.id = wl.userId
LEFT JOIN sys_union un ON un.id = wl.welfareUnitId LEFT JOIN sys_union un ON un.id = wl.welfareUnitId
@@ -492,7 +504,7 @@ public class WelfareListController {
WHERE WHERE
wpus.welfareId = @welfareId wpus.welfareId = @welfareId
AND wpus.selectOptionId = @selectOptionId and wpus.selectNum!=0 AND wpus.selectOptionId = @selectOptionId and wpus.selectNum!=0
""").setParam("welfareId", projectId).setParam("selectOptionId", optionId); """).setParam("welfareId", projectId).setParam("selectOptionId", optionId);
// GROUP BY wpus.selectUserId,wpus.selectOptionId ORDER BY un.unioncode // GROUP BY wpus.selectUserId,wpus.selectOptionId ORDER BY un.unioncode
@@ -557,8 +569,77 @@ public class WelfareListController {
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
@At
@Ok("void")
@RequiresPermissions("welfare.list.mange")
public void doExportReimbursement(@Param(value = "projectId", required = false) String projectId,
@Param(value = "optionId", required = false) String optionId,
@Param(value = "personType", required = false) String personType,
HttpServletResponse response) {
WelfareProject project = welfareListService.dao().fetch(WelfareProject.class, projectId);
WelfareProjectSubjectOption subjectOption = welfareListService.dao().fetch(WelfareProjectSubjectOption.class, optionId);
Sql sql = Sqls.create("""
SELECT
u.id,
u.loginname,
u.username,
wl.personType,
un.unionname,
it.`name` unitname,
wpus.selectNum,
GROUP_CONCAT(wcn.courierNumber) as courierNumber
FROM
welfare_project_user_selection wpus
LEFT JOIN `welfare_list` wl ON wpus.selectUserId = wl.userId
LEFT JOIN `sys_user` u ON u.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_courier_number wcn ON wcn.welfareId = wpus.welfareId\s
AND wcn.selectUserId = wpus.selectUserId
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.groupBy("wpus.id");
cnd.and("wpus.welfareId", "=", projectId);
cnd.and("wpus.selectOptionId", "=", optionId);
cnd.and("wpus.selectNum", "!=", 0);
if (Objects.equals("在职教职工", personType)) {
cnd.and("wl.personType", "is not", null);
cnd.and("wl.personType", "!=", "");
cnd.and("wl.personType", "!=", "劳务人才派遣");
cnd.and("wl.personType", "!=", "其他类");
} else if (Objects.equals("劳务派遣人员", personType)) {
cnd.and("wl.personType", "in", List.of("劳务人才派遣", "其他类"));
} else if (Objects.equals("空状态", personType)) {
SqlExpressionGroup seg = new SqlExpressionGroup();
seg.or("wl.personType", "=", "");
seg.orIsNull("wl.personType");
cnd.and(seg);
}
sql.setCondition(cnd);
List<NutMap> mapList = welfareListService.listMap(sql);
HashMap<String, Object> data = new HashMap<>();
data.put("data", mapList);
data.put("projectName", project.getName());
data.put("optionName", subjectOption.getOptionName());
data.put("personType", personType);
try {
ViTool.excelResponse(response, subjectOption.getOptionName() + "(" + personType + ")" + "发放名单.xlsx");
TemplateExportParams templateExportParams = new TemplateExportParams();
//开启横向遍历
templateExportParams.setColForEach(true);
templateExportParams.setTemplateUrl("C:\\Users\\jug\\Desktop\\福利发放名单.xlsx");
Workbook workbook = ExcelExportUtil.exportExcel(templateExportParams, data);
workbook.write(response.getOutputStream());
} catch (IOException e) {
e.printStackTrace();
}
}
} }
@@ -96,18 +96,13 @@ public class WelfareMemberAdjustmentController {
mcr_state.stateColor mcrStateColor mcr_state.stateColor mcrStateColor
FROM FROM
`user` u `user` u
LEFT JOIN user_history_latest his ON his.loginname = u.loginname LEFT JOIN user_history_latest his ON his.loginname = u.loginname
LEFT JOIN welfare_member_apply_record_latest wmar ON wmar.userId = u.id LEFT JOIN welfare_member_apply_record_latest wmar ON wmar.userId = u.id
LEFT JOIN member_change_record_latest mcr on mcr.userId = u.id LEFT JOIN member_change_record_latest mcr on mcr.userId = u.id
LEFT JOIN audit_state state ON wmar.stateId = state.stateId LEFT JOIN audit_state state ON wmar.stateId = state.stateId
LEFT JOIN audit_state mcr_state ON mcr_state.stateId = mcr.stateId LEFT JOIN audit_state mcr_state ON mcr_state.stateId = mcr.stateId
$condition $condition
""") """)
.setParam("recordMode", MemberChangeRecordMode.WELFARE_MEMBER.getCode()) .setParam("recordMode", MemberChangeRecordMode.WELFARE_MEMBER.getCode())
.setParam("changeUnitAuditing", MemberChangeApplyState.SCHOOL_UNION) .setParam("changeUnitAuditing", MemberChangeApplyState.SCHOOL_UNION)
.setParam("changeUnitError", MemberChangeApplyState.SCHOOL_UNION_FAIL); .setParam("changeUnitError", MemberChangeApplyState.SCHOOL_UNION_FAIL);
@@ -120,7 +115,7 @@ public class WelfareMemberAdjustmentController {
cnd.andEX("u.unionGroupId", "=", pageParam.getUnionGroupId()); cnd.andEX("u.unionGroupId", "=", pageParam.getUnionGroupId());
if (!ShiroUtil.hasAnyRoles("sysadmin,SchoolUnionAdmin,SchoolUnionMemberAdmin,SchoolUnionWelfareAdmin")) { if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) {
if (ShiroUtil.hasAnyRoles("H04,gh12")) { if (ShiroUtil.hasAnyRoles("H04,gh12")) {
cnd.and("u.unionId", "=", Vi.getUnionId()); cnd.and("u.unionId", "=", Vi.getUnionId());
} else if (ShiroUtil.hasRole("ghxzzz")) { } else if (ShiroUtil.hasRole("ghxzzz")) {
@@ -163,8 +158,10 @@ public class WelfareMemberAdjustmentController {
WelfareFeature.Condition.judgmentAuthority(cnd, "u"); WelfareFeature.Condition.judgmentAuthority(cnd, "u");
cnd.and(pageForm); cnd.and(pageForm);
cnd.desc("u.threeUnitId"); cnd.desc("his.changeTime");
cnd.asc("u.loginname"); cnd.asc("u.unitid");
cnd.asc("COALESCE(u.userSortNum, 999999)");
cnd.desc("u.id");
pageParam.participate(cnd, "u"); pageParam.participate(cnd, "u");
@@ -221,7 +218,7 @@ public class WelfareMemberAdjustmentController {
} }
} }
cnd.andEX("u.unionGroupId", "=", pageParam.getUnionGroupId()); cnd.andEX("u.unionGroupId", "=", pageParam.getUnionGroupId());
if (!ShiroUtil.hasAnyRoles("sysadmin,SchoolUnionAdmin,SchoolUnionMemberAdmin,SchoolUnionWelfareAdmin")) { if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) {
if (ShiroUtil.hasAnyRoles("H04,gh12")) { if (ShiroUtil.hasAnyRoles("H04,gh12")) {
cnd.and("u.unionId", "=", Vi.getUnionId()); cnd.and("u.unionId", "=", Vi.getUnionId());
} else if (ShiroUtil.hasRole("ghxzzz")) { } else if (ShiroUtil.hasRole("ghxzzz")) {
@@ -307,7 +304,7 @@ public class WelfareMemberAdjustmentController {
@ViReturn @ViReturn
@RequiresPermissions("welfare.member.adjustment") @RequiresPermissions("welfare.member.adjustment")
public Object joinWelfareMember(String[] userIds) { public Object joinWelfareMember(String[] userIds) {
if (ShiroUtil.hasAnyRoles("sysadmin,SchoolUnionAdmin,SchoolUnionMemberAdmin,SchoolUnionWelfareAdmin")) { if (ShiroUtil.hasAnyRoles("sysadmin,A06")) {
WelfareMemberMode.joinWelfareMember(Arrays.stream(userIds).collect(Collectors.toList())); WelfareMemberMode.joinWelfareMember(Arrays.stream(userIds).collect(Collectors.toList()));
return null; return null;
} }
@@ -75,7 +75,7 @@ public class WelfareMemberChangeApplyAuditController {
wun.welfareUnitId realWelfareUnitId, wun.welfareUnitId realWelfareUnitId,
wun.welfareUnitCode realWelfareUnitCode, wun.welfareUnitCode realWelfareUnitCode,
wun.welfareUnitName realWelfareUnitName, wun.welfareUnitName realWelfareUnitName,
u.mobile, u.mobile AS MMobile,
state.stateName, state.stateName,
state.stateColor, state.stateColor,
originUnit.unitcode originUnitCode, originUnit.unitcode originUnitCode,
@@ -95,7 +95,9 @@ public class WelfareMemberMangeController {
} }
pageParam.participate(cnd); pageParam.participate(cnd);
cnd.and(pageForm); cnd.and(pageForm);
cnd.asc("loginname"); cnd.asc("unitid");
cnd.asc("COALESCE(userSortNum, 999999)");
cnd.desc("id");
sql.setCondition(cnd); sql.setCondition(cnd);
return welfareMemberService.list(pageForm, sql); return welfareMemberService.list(pageForm, sql);
} }
@@ -178,7 +180,7 @@ public class WelfareMemberMangeController {
if (member != null && member) { if (member != null && member) {
cnd.and("u.member", "=", MemberMode.NORMAL.getCode()); cnd.and("u.member", "=", MemberMode.NORMAL.getCode());
} }
if (!ShiroUtil.hasAnyRoles("sysadmin,SchoolUnionAdmin,SchoolUnionMemberAdmin,SchoolUnionWelfareAdmin")) { if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) {
cnd.and("u.unionid", "=", Vi.getUnionId()); cnd.and("u.unionid", "=", Vi.getUnionId());
} }
@@ -257,7 +259,7 @@ public class WelfareMemberMangeController {
List<WelfareMemberTemp> memberImportList = ExcelImportUtil.importExcel(file.getFile(), WelfareMemberTemp.class, new ImportParams()); List<WelfareMemberTemp> memberImportList = ExcelImportUtil.importExcel(file.getFile(), WelfareMemberTemp.class, new ImportParams());
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
if (!ShiroUtil.hasAnyRoles("sysadmin,SchoolUnionAdmin,SchoolUnionMemberAdmin,SchoolUnionWelfareAdmin")) { if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) {
cnd.and("unionid", "=", Vi.getUnionId()); cnd.and("unionid", "=", Vi.getUnionId());
} }
cnd.andEX("unionid", "=", unionId); cnd.andEX("unionid", "=", unionId);
@@ -339,7 +341,7 @@ public class WelfareMemberMangeController {
public void exportList(HttpServletResponse response) { public void exportList(HttpServletResponse response) {
Sql sql = Sqls.create("SELECT loginname,username,sex,personType,userState,unionname,unitname,CASE member WHEN 1 THEN '是' ELSE '否' END as member from welfare_member $condition"); Sql sql = Sqls.create("SELECT loginname,username,sex,personType,userState,unionname,unitname,CASE member WHEN 1 THEN '是' ELSE '否' END as member from welfare_member $condition");
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
if (!ShiroUtil.hasAnyRoles("sysadmin,SchoolUnionWelfareAdmin")) { if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) {
cnd.andEX("unionid", "=", Vi.getUnionId()); cnd.andEX("unionid", "=", Vi.getUnionId());
} }
sql.setCondition(cnd); sql.setCondition(cnd);
@@ -349,7 +351,7 @@ public class WelfareMemberMangeController {
exportEntities.add(new ExcelExportEntity("工号","loginname",20)); exportEntities.add(new ExcelExportEntity("工号","loginname",20));
exportEntities.add(new ExcelExportEntity("姓名","username",20)); exportEntities.add(new ExcelExportEntity("姓名","username",20));
exportEntities.add(new ExcelExportEntity("性别","sex",20)); exportEntities.add(new ExcelExportEntity("性别","sex",20));
exportEntities.add(new ExcelExportEntity("人员类型","personType",20)); exportEntities.add(new ExcelExportEntity("人员性质","personType",20));
exportEntities.add(new ExcelExportEntity("在职状态","userState",20)); exportEntities.add(new ExcelExportEntity("在职状态","userState",20));
exportEntities.add(new ExcelExportEntity("分工会","unionname",20)); exportEntities.add(new ExcelExportEntity("分工会","unionname",20));
exportEntities.add(new ExcelExportEntity("单位","unitname",50)); exportEntities.add(new ExcelExportEntity("单位","unitname",50));
@@ -86,7 +86,8 @@ public class WelfareMineController {
sql.setParam("selectUserId", ShiroUtil.getUserId()); sql.setParam("selectUserId", ShiroUtil.getUserId());
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
cnd.and("wp.isDisabled", "=", 0); cnd.and("wp.isDisabled", "=", 0);
cnd.andEX("YEAR(wp.choiceTimeStart)", "=", year); // cnd.andEX("YEAR(wp.choiceTimeStart)", "=", year);
cnd.and("wp.id","in",Sqls.create("(select projectId from view_welfare_list where id = @userId)").setParam("userId",ShiroUtil.getUserId()));
cnd.groupBy("wp.id"); cnd.groupBy("wp.id");
cnd.desc("wp.choiceTimeStart"); cnd.desc("wp.choiceTimeStart");
sql.setCondition(cnd); sql.setCondition(cnd);
@@ -6,6 +6,7 @@ import io.v.nutz.base.dao.CndPlus;
import io.v.nutz.base.query.PageForm; import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.utils.MsgApi; import io.v.nutz.base.utils.MsgApi;
import io.v.nutz.base.utils.Vi; import io.v.nutz.base.utils.Vi;
import io.v.nutz.sys.models.Sys_home_activity;
import io.v.nutz.sys.services.SysTaskService; import io.v.nutz.sys.services.SysTaskService;
import io.v.nutz.task.services.TaskPlatformService; import io.v.nutz.task.services.TaskPlatformService;
import io.v.nutz.zhgh.data.model.MatchConditionStructure; import io.v.nutz.zhgh.data.model.MatchConditionStructure;
@@ -37,7 +38,6 @@ import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param; import org.nutz.mvc.annotation.Param;
import org.nutz.trans.Trans; import org.nutz.trans.Trans;
import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@@ -235,9 +235,11 @@ public class WelfareProjectMangeController {
dao.update(project); dao.update(project);
} }
if (project.getIsPushHome() != 0) { // if (project.getIsPushHome() != 0) {
mobileHomeService.handle(project, "welfare", "/mobile/welfare/list/receive?projectId=" + project.getId(), project.getIsPushHome()); // mobileHomeService.handle(project, "welfare", "/mobile/welfare/list/receive?projectId=" + project.getId(), project.getIsPushHome());
} // }
Sys_home_activity sysHomeActivity = project.covertToSysHomeActivity();
dao.insertOrUpdate(sysHomeActivity);
}); });
return null; return null;
} }
@@ -290,8 +292,7 @@ public class WelfareProjectMangeController {
public Object sendMsgToNotWelfareUsers(String projectId, String sendMsgValue) { public Object sendMsgToNotWelfareUsers(String projectId, String sendMsgValue) {
Sql sql = Sqls.create(""" Sql sql = Sqls.create("""
SELECT SELECT
u.loginname, u.loginname as userId
u.username
FROM FROM
welfare_list wl welfare_list wl
left join sys_user u on u.id = wl.userId left join sys_user u on u.id = wl.userId
@@ -308,13 +309,7 @@ public class WelfareProjectMangeController {
"""); """);
sql.setParam("projectId", projectId); sql.setParam("projectId", projectId);
List<NutMap> userList = listService.listMap(sql); List<NutMap> userList = listService.listMap(sql);
// msgApi.sendMsg(sendMsgValue, "福利选择链接", "", "https://zhgh.jiangnan.edu.cn/mobile/welfare/list/receive?projectId=4fa233704ddb41bc8e34e966efeda0a4", "4", userList);
// for (NutMap map : userList) {
// msgApi.sendMsg(sendMsgValue, "", "", "", "4", new ArrayList<>() {{
// add(NutMap.NEW().addv("userId", map.getString("loginname")));
// }});
// }
return null; return null;
} }
@@ -55,22 +55,21 @@ public class WelfareUserChooseController {
@ViReturn @ViReturn
@RequiresPermissions("welfare.user.choose") @RequiresPermissions("welfare.user.choose")
public Object pageData(PageForm pageForm, Integer year) { public Object pageData(PageForm pageForm, Integer year) {
Sql sql = Sqls.create(""" Sql sql = Sqls.create("""
SELECT SELECT
wp.*, wp.*,
CASE CASE
WHEN wus.selectUserId IS NOT NULL THEN 1 WHEN wus.selectUserId IS NOT NULL THEN 1
ELSE 0 ELSE 0
END AS isChoose, END AS isChoose,
wus.selectTime, wus.selectTime,
GROUP_CONCAT(DISTINCT wuso.optionName ,'(',wus.selectNum,'份)') AS gist_list, GROUP_CONCAT(DISTINCT wuso.optionName ,'(',wus.selectNum,'份)') AS gist_list,
wus.receiveAddress wus.receiveAddress
FROM FROM
welfare_project wp welfare_project wp
LEFT JOIN welfare_project_user_selection wus ON wp.id = wus.welfareId AND wus.selectUserId = @selectUserId LEFT JOIN welfare_project_user_selection wus ON wp.id = wus.welfareId AND wus.selectUserId = @selectUserId
LEFT JOIN welfare_list wl ON wp.id = wl.projectId AND wl.userId = @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 LEFT JOIN welfare_project_subject_option wuso ON wus.selectOptionId = wuso.id
$condition $condition
"""); """);
sql.setParam("selectUserId", ShiroUtil.getUserId()); sql.setParam("selectUserId", ShiroUtil.getUserId());
@@ -201,7 +201,7 @@ public class WelfareCheckPersonalController {
exportEntities.add(new ExcelExportEntity("姓名", "username", 20)); exportEntities.add(new ExcelExportEntity("姓名", "username", 20));
exportEntities.add(new ExcelExportEntity("性别", "sex", 20)); exportEntities.add(new ExcelExportEntity("性别", "sex", 20));
exportEntities.add(new ExcelExportEntity("联系电话", "mobile", 20)); exportEntities.add(new ExcelExportEntity("联系电话", "mobile", 20));
exportEntities.add(new ExcelExportEntity("人员类型", "personType", 20)); exportEntities.add(new ExcelExportEntity("人员性质", "personType", 20));
exportEntities.add(new ExcelExportEntity("所属工会", "unionname", 20)); exportEntities.add(new ExcelExportEntity("所属工会", "unionname", 20));
exportEntities.add(new ExcelExportEntity("所在单位", "unitname", 20)); exportEntities.add(new ExcelExportEntity("所在单位", "unitname", 20));
exportEntities.add(new ExcelExportEntity("核对情况", "isfinish", 20)); exportEntities.add(new ExcelExportEntity("核对情况", "isfinish", 20));
@@ -131,7 +131,7 @@ public class WelfareMemberCheckUnionController {
/* if (!ShiroUtil.hasAnyRoles("sysadmin,A06,flwyh01")) { /* if (!ShiroUtil.hasAnyRoles("sysadmin,A06,flwyh01")) {
cnd.and("u.unionGroupId", "in", io.v.nutz.web.commons.utils.ShiroUtil.getUnionGroupIds()); cnd.and("u.unionGroupId", "in", io.v.nutz.web.commons.utils.ShiroUtil.getUnionGroupIds());
}*/ }*/
if (!ShiroUtil.hasAnyRoles("sysadmin,SchoolUnionAdmin,SchoolUnionMemberAdmin,SchoolUnionWelfareAdmin")) { if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) {
if (ShiroUtil.hasAnyRoles("H04,gh12")) { if (ShiroUtil.hasAnyRoles("H04,gh12")) {
cnd.and("u.unionId", "=", Vi.getUnionId()); cnd.and("u.unionId", "=", Vi.getUnionId());
} else if (ShiroUtil.hasRole("ghxzzz")) { } else if (ShiroUtil.hasRole("ghxzzz")) {
@@ -166,9 +166,9 @@ public class WelfareMemberCheckUnionController {
cnd.and(pageForm); cnd.and(pageForm);
cnd.desc("his.changeTime"); cnd.desc("his.changeTime");
cnd.asc("u.userState");
cnd.asc("u.unitid"); cnd.asc("u.unitid");
cnd.asc("u.loginname"); cnd.asc("COALESCE(u.userSortNum, 999999)");
cnd.desc("u.id");
if (Lang.isNotEmpty(changeTypes)) { if (Lang.isNotEmpty(changeTypes)) {
SqlExpressionGroup seg = new SqlExpressionGroup(); SqlExpressionGroup seg = new SqlExpressionGroup();
@@ -227,9 +227,9 @@ public class WelfareMemberCheckUnionController {
@ViReturn @ViReturn
@RequiresPermissions("welfare.member.check.union") @RequiresPermissions("welfare.member.check.union")
public Object doSubmitChangeUser(MemberChangeRecord memberChangeRecord) { public Object doSubmitChangeUser(MemberChangeRecord memberChangeRecord) {
if (Objects.equals(memberChangeRecord.getType(), UserChangeType.NEW.getCode())) { /*if (Objects.equals(memberChangeRecord.getType(), UserChangeType.NEW.getCode())) {
return Result.error("您已经入职,可以选择恢复功能入会!"); return Result.error("您已经入职,可以选择恢复功能入会!");
} }*/
if (Objects.equals(memberChangeRecord.getType(), UserChangeType.UNIT_CHANGE.getCode())) { if (Objects.equals(memberChangeRecord.getType(), UserChangeType.UNIT_CHANGE.getCode())) {
boolean unionGroupEnable = Optional.ofNullable(dao.fetch(Sys_config.class, Cnd.where("configKey", "=", "isThreeUnit"))).map(v -> v.getConfigValue()).orElse("false").equals("true"); boolean unionGroupEnable = Optional.ofNullable(dao.fetch(Sys_config.class, Cnd.where("configKey", "=", "isThreeUnit"))).map(v -> v.getConfigValue()).orElse("false").equals("true");
@@ -239,21 +239,21 @@ public class WelfareMemberCheckUnionController {
return Result.error("请选择不同的单位!"); return Result.error("请选择不同的单位!");
} }
} }
if (!Objects.equals(memberChangeRecord.getType(), UserChangeType.UNIT_CHANGE.getCode())) { /*if (!Objects.equals(memberChangeRecord.getType(), UserChangeType.UNIT_CHANGE.getCode())) {
memberChangeRecord.setCurrentUnitId(null); memberChangeRecord.setCurrentUnitId(null);
memberChangeRecord.setCurrentUnionId(null); memberChangeRecord.setCurrentUnionId(null);
} }*/
Sql userSql = Sqls.fetchString("select userState from sys_user where id = @userId"); Sql userSql = Sqls.fetchString("select userState from sys_user where id = @userId");
userSql.setParam("userId", memberChangeRecord.getUserId()); userSql.setParam("userId", memberChangeRecord.getUserId());
dao.execute(userSql); dao.execute(userSql);
String userState = StrUtil.blankToDefault(userSql.getString(), ""); String userState = StrUtil.blankToDefault(userSql.getString(), "");
if (memberChangeRecord.getType() == UserChangeType.ON_DUTY.getCode()) { // if (memberChangeRecord.getType() == UserChangeType.WORK.getCode()) {
if (userState.equals(UserChangeType.ON_DUTY.getDescription())) { // if (userState.equals(UserChangeType.WORK.getDescription())) {
return Result.error("该用户当前的状态已经是" + UserChangeType.ON_DUTY.getDescription() + ",您无需变更!"); // return Result.error("该用户当前的状态已经是" + UserChangeType.WORK.getDescription() + ",您无需变更!");
} // }
} // }
if (memberChangeRecord.getType() == UserChangeType.RESIGN.getCode()) { if (memberChangeRecord.getType() == UserChangeType.RESIGN.getCode()) {
if (userState.equals(UserChangeType.RESIGN.getDescription())) { if (userState.equals(UserChangeType.RESIGN.getDescription())) {
return Result.error("该用户当前的状态已经是" + UserChangeType.RESIGN.getDescription() + ",您无需变更!"); return Result.error("该用户当前的状态已经是" + UserChangeType.RESIGN.getDescription() + ",您无需变更!");
@@ -265,7 +265,6 @@ public class WelfareMemberCheckUnionController {
} }
} }
memberChangeRecord.setRecordMode(MemberChangeRecordMode.WELFARE_MEMBER.getCode()); memberChangeRecord.setRecordMode(MemberChangeRecordMode.WELFARE_MEMBER.getCode());
memberChangeRecord.setApplyOrigin(MemberChangeOrigin.UNION.getCode()); memberChangeRecord.setApplyOrigin(MemberChangeOrigin.UNION.getCode());
memberChangeRecord = MemberChangeAuditHandle.CREATE.next(memberChangeRecord, null); memberChangeRecord = MemberChangeAuditHandle.CREATE.next(memberChangeRecord, null);
@@ -310,7 +309,7 @@ public class WelfareMemberCheckUnionController {
public Object doWelfareMember(String[] userIds, String taskId, public Object doWelfareMember(String[] userIds, String taskId,
@Param(value = "threeUnitId", required = false) String threeUnitId, @Param(value = "threeUnitId", required = false) String threeUnitId,
@Param(value = "unitId", required = false) String unitId) { @Param(value = "unitId", required = false) String unitId) {
if (ShiroUtil.hasAnyRoles("sysadmin,SchoolUnionAdmin,SchoolUnionMemberAdmin,SchoolUnionWelfareAdmin")) { if (ShiroUtil.hasAnyRoles("sysadmin,A06")) {
WelfareMemberMode.joinWelfareMember(Arrays.stream(userIds).collect(Collectors.toList())); WelfareMemberMode.joinWelfareMember(Arrays.stream(userIds).collect(Collectors.toList()));
return null; return null;
} }
@@ -3,23 +3,22 @@ package io.v.nutz.zhgh.welfare.controller.statistics;
import cn.afterturn.easypoi.excel.ExcelExportUtil; import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.annotation.Excel; import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.entity.ExportParams; import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.TemplateExportParams;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType; import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity; import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.afterturn.easypoi.excel.export.ExcelExportService; import cn.afterturn.easypoi.excel.export.ExcelExportService;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.utils.MsgApi; import io.v.nutz.base.utils.MsgApi;
import io.v.nutz.base.utils.OfficeTemplateUtil;
import io.v.nutz.base.utils.Vi; import io.v.nutz.base.utils.Vi;
import io.v.nutz.base.utils.ViTool; import io.v.nutz.base.utils.ViTool;
import io.v.nutz.sys.models.SysUnionGroup; import io.v.nutz.sys.models.SysUnionGroup;
import io.v.nutz.sys.models.Sys_union; import io.v.nutz.sys.models.Sys_union;
import io.v.nutz.sys.models.Sys_unit;
import io.v.nutz.web.commons.base.Globals; import io.v.nutz.web.commons.base.Globals;
import io.v.nutz.web.commons.utils.ShiroUtil; import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.welfare.mode.WelfareUnitMode; import io.v.nutz.zhgh.welfare.mode.WelfareUnitMode;
import io.v.nutz.zhgh.welfare.model.WelfareList; import io.v.nutz.zhgh.welfare.model.*;
import io.v.nutz.zhgh.welfare.model.WelfareProject;
import io.v.nutz.zhgh.welfare.model.WelfareUserSelection;
import io.v.nutz.zhgh.welfare.service.WelfareSingleService; import io.v.nutz.zhgh.welfare.service.WelfareSingleService;
import lombok.Data; import lombok.Data;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@@ -32,11 +31,11 @@ import org.nutz.dao.Cnd;
import org.nutz.dao.Dao; import org.nutz.dao.Dao;
import org.nutz.dao.Sqls; import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql; import org.nutz.dao.sql.Sql;
import org.nutz.dao.util.cri.SqlExpressionGroup;
import org.nutz.ioc.aop.Aop; import org.nutz.ioc.aop.Aop;
import org.nutz.ioc.loader.annotation.Inject; import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean; import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.json.Json; import org.nutz.json.Json;
import org.nutz.lang.Lang;
import org.nutz.lang.Strings; import org.nutz.lang.Strings;
import org.nutz.lang.util.NutMap; import org.nutz.lang.util.NutMap;
import org.nutz.mvc.annotation.At; import org.nutz.mvc.annotation.At;
@@ -48,10 +47,7 @@ import javax.servlet.http.HttpServletResponse;
import java.io.BufferedOutputStream; import java.io.BufferedOutputStream;
import java.io.IOException; import java.io.IOException;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.util.ArrayList; import java.util.*;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.zip.ZipEntry; import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream; import java.util.zip.ZipOutputStream;
@@ -74,6 +70,8 @@ public class WelfareSingleController {
@Inject @Inject
private Dao dao; private Dao dao;
@Inject
private OfficeTemplateUtil officeTemplateUtil;
@At("") @At("")
@Ok("beetl:/platform/welfare/statistics/single.html") @Ok("beetl:/platform/welfare/statistics/single.html")
@@ -94,8 +92,10 @@ public class WelfareSingleController {
public Object pageData(@Param(value = "projectId", required = false) String projectId, public Object pageData(@Param(value = "projectId", required = false) String projectId,
@Param(value = "month", required = false) String month, @Param(value = "month", required = false) String month,
@Param(value = "welfareUnitCode", required = false) String welfareUnitCode, @Param(value = "welfareUnitCode", required = false) String welfareUnitCode,
@Param(value = "unionGroupId", required = false) String unionGroupId) { @Param(value = "unionGroupId", required = false) String unionGroupId,
return welfareSingleService.pageData(projectId, month, welfareUnitCode, unionGroupId); @Param(value = "personType", required = false) String personType
) {
return welfareSingleService.pageData(projectId, month, welfareUnitCode, unionGroupId, personType);
} }
/** /**
@@ -209,49 +209,149 @@ public class WelfareSingleController {
@Param(value = "month", required = false) String month, @Param(value = "month", required = false) String month,
@Param(value = "unionGroupId", required = false) String unionGroupId, @Param(value = "unionGroupId", required = false) String unionGroupId,
@Param(value = "isThreeUnit", required = false) Boolean isThreeUnit, @Param(value = "isThreeUnit", required = false) Boolean isThreeUnit,
@Param(value = "personType", required = false) String personType,
HttpServletResponse response) { HttpServletResponse response) {
String title = "统计名单"; WelfareProject project = dao.fetch(WelfareProject.class, projectId);
if (StrUtil.isNotBlank(welfareUnitCode)) { WelfareProjectSubject subject = dao.fetch(WelfareProjectSubject.class, Cnd.where("projectId", "=", projectId));
switch (WelfareUnitMode.getMode().name()) { List<WelfareProjectSubjectOption> subjectOptions = dao.query(WelfareProjectSubjectOption.class, Cnd.where("subjectId", "=", subject.getId()).asc("optionSort"));
case "UNION" -> {
Sys_union sysUnion = dao.fetch(Sys_union.class, Cnd.where("unioncode", "=", welfareUnitCode));
title = (Lang.isNotEmpty(sysUnion) ? sysUnion.getUnionname() : "") + "统计名单";
}
case "UNIT" -> {
Sys_unit sysUnit = dao.fetch(Sys_unit.class, Cnd.where("unitcode", "=", welfareUnitCode));
title = (Lang.isNotEmpty(sysUnit) ? sysUnit.getName() : "") + "统计名单";
}
}
List<WelfareList> welfareLists = dao.query(WelfareList.class, Cnd.where("projectId", "=", projectId));
HashMap<String, Object> data = new HashMap<>();
data.put("projectName", project.getName());
data.put("personType", personType);
List<NutMap> titles = subjectOptions.stream().map(o -> {
NutMap nutMap = NutMap.NEW();
nutMap.put("optionName", o.getOptionName());
nutMap.put("val", "t." + o.getOptionName());
return nutMap;
}).collect(Collectors.toList());
data.put("titles", titles);
List<HashMap<String, Object>> datas = new ArrayList<>();
Sql sql = Sqls.create("""
SELECT
t1.selectOptionId,
t1.selectNum,
t2.welfareUnitId,
t3.unionname,
t2.personType
FROM
`welfare_project_user_selection` t1
LEFT JOIN welfare_list t2 ON t2.userId = t1.selectUserId
AND t2.projectId = t1.welfareId
LEFT JOIN sys_union t3 ON t3.id = t2.welfareUnitId
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.and("t1.welfareId", "=", projectId);
cnd.groupBy("t1.id");
if (Objects.equals("在职教职工", personType)) {
cnd.and("t2.personType", "is not", null);
cnd.and("t2.personType", "!=", "");
cnd.and("t2.personType", "!=", "劳务人才派遣");
cnd.and("t2.personType", "!=", "其他类");
} else if (Objects.equals("劳务派遣人员", personType)) {
cnd.and("t2.personType", "in", List.of("劳务人才派遣", "其他类"));
} else if (Objects.equals("空状态", personType)) {
SqlExpressionGroup seg = new SqlExpressionGroup();
seg.or("t2.personType", "=", "");
seg.orIsNull("t2.personType");
cnd.and(seg);
} }
sql.setCondition(cnd);
List<NutMap> list = welfareSingleService.listMap(sql);
NutMap dataMap = welfareSingleService.pageData(projectId, month, welfareUnitCode, unionGroupId); Map<String, List<NutMap>> welfareUnitGroups = list.stream().collect(Collectors.groupingBy(v -> v.getString("unionname")));
List<ExcelExportEntity> entityList = new ArrayList<>();
List<NutMap> labelList = dataMap.getAsList("tableColumn", NutMap.class);
List<NutMap> list = dataMap.getAsList("tableList", NutMap.class);
NutMap map = NutMap.NEW().setv("welfareUnitName", "合计"); welfareUnitGroups.forEach((welfareUnitName, welfareUnitList) -> {
labelList.forEach(o -> { NutMap welfareUnitMap = NutMap.NEW();
List<Integer> numList = list.stream().map(v -> v.getInt(o.getString("prop"))).collect(Collectors.toList()); welfareUnitMap.addv("name", welfareUnitName);
int sum = numList.stream().mapToInt(Integer::intValue).sum(); for (int i = 0; i < subjectOptions.size(); i++) {
map.setv(o.getString("prop"), sum); int finalI = i;
}); int sum = welfareUnitList.stream().filter(v -> v.getString("selectOptionId").equals(subjectOptions.get(finalI).getId())).mapToInt(x -> x.getInt("selectNum")).sum();
list.add(map); welfareUnitMap.put(subjectOptions.get(finalI).getOptionName(), sum);
}
welfareUnitMap.addv("total", welfareUnitList.stream().mapToInt(x -> x.getInt("selectNum")).sum());
labelList.add(0, NutMap.NEW().addv("label", "福利单位").addv("prop", "welfareUnitName")); String welfareUnitId = welfareUnitList.stream().findFirst().map(v -> v.getString("welfareUnitId")).orElse(null);
labelList.add(1, NutMap.NEW().addv("label", "福利单位编码").addv("prop", "welfareUnitCode"));
labelList.forEach(v -> { long welfareMemberCount = 0;
entityList.add(new ExcelExportEntity(v.getString("label"), v.getString("prop"), 20));
if (Objects.equals("在职人员", personType)) {
welfareMemberCount = welfareLists.stream().filter(v -> Objects.equals(v.getWelfareUnitId(), welfareUnitId)
&& !Objects.equals(v.getPersonType(), "劳务人才派遣") && !Objects.equals(v.getPersonType(), "其他类")).count();
} else if (Objects.equals("劳务派遣人员", personType)) {
welfareMemberCount = welfareLists.stream().filter(v -> Objects.equals(v.getWelfareUnitId(), welfareUnitId)
&& (Objects.equals(v.getPersonType(), "劳务人才派遣") || Objects.equals(v.getPersonType(), "其他类"))).count();
} else if (Objects.equals("空状态", personType)) {
welfareMemberCount = welfareLists.stream().filter(v -> Objects.equals(v.getWelfareUnitId(), welfareUnitId)
&& StrUtil.isBlank(v.getPersonType())).count();
}
// long welfareMemberCount = welfareLists.stream().filter(v -> Objects.equals(v.getWelfareUnitId(), welfareUnitId)).count();
welfareUnitMap.addv("welfareMemberCount", welfareMemberCount);
datas.add(welfareUnitMap);
}); });
data.put("data", datas);
try { try {
ViTool.excelResponse(response, "汇总表.xls"); ViTool.excelResponse(response, personType + "发放清单.xlsx");
Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(title, ""), entityList, list); TemplateExportParams templateExportParams = new TemplateExportParams();
//开启横向遍历
templateExportParams.setColForEach(true);
templateExportParams.setTemplateUrl("E:\\env\\福利导出模板.xlsx");
Workbook workbook = ExcelExportUtil.exportExcel(templateExportParams, data);
workbook.write(response.getOutputStream()); workbook.write(response.getOutputStream());
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
} }
// String title = "统计名单";
// if (StrUtil.isNotBlank(welfareUnitCode)) {
// switch (WelfareUnitMode.getMode().name()) {
// case "UNION" -> {
// Sys_union sysUnion = dao.fetch(Sys_union.class, Cnd.where("unioncode", "=", welfareUnitCode));
// title = (Lang.isNotEmpty(sysUnion) ? sysUnion.getUnionname() : "") + "统计名单";
// }
// case "UNIT" -> {
// Sys_unit sysUnit = dao.fetch(Sys_unit.class, Cnd.where("unitcode", "=", welfareUnitCode));
// title = (Lang.isNotEmpty(sysUnit) ? sysUnit.getName() : "") + "统计名单";
// }
// }
//
// }
// NutMap dataMap = welfareSingleService.pageData(projectId, month, welfareUnitCode, unionGroupId,personType);
// List<ExcelExportEntity> entityList = new ArrayList<>();
// List<NutMap> labelList = dataMap.getAsList("tableColumn", NutMap.class);
// List<NutMap> list = dataMap.getAsList("tableList", NutMap.class);
// NutMap map = NutMap.NEW().setv("welfareUnitName", "合计");
// labelList.forEach(o -> {
// List<Integer> numList = list.stream().map(v -> v.getInt(o.getString("prop"))).collect(Collectors.toList());
// int sum = numList.stream().mapToInt(Integer::intValue).sum();
// map.setv(o.getString("prop"), sum);
// });
// list.add(map);
//
// labelList.add(0, NutMap.NEW().addv("label", "福利单位").addv("prop", "welfareUnitName"));
// labelList.add(1, NutMap.NEW().addv("label", "福利单位编码").addv("prop", "welfareUnitCode"));
// labelList.forEach(v -> {
// entityList.add(new ExcelExportEntity(v.getString("label"), v.getString("prop"), 20));
// });
//
//
// try {
// ViTool.excelResponse(response, "汇总表.xls");
// Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(title, ""), entityList, list);
// workbook.write(response.getOutputStream());
// } catch (IOException e) {
// e.printStackTrace();
// }
} }
@@ -698,10 +798,10 @@ public class WelfareSingleController {
wpus.selectNum, wpus.selectNum,
wpso.optionName wpso.optionName
FROM FROM
welfare_project_user_selection_copy wpus welfare_project_user_selection wpus
left join sys_user u on u.id = wpus.selectUserId left join sys_user u on u.id = wpus.selectUserId
left join welfare_project_subject_option wpso on wpso.id = wpus.selectOptionId left join welfare_project_subject_option wpso on wpso.id = wpus.selectOptionId
left join welfare_list wl on wl.userId = wpus.selectUserId left join welfare_list wl on wl.userId = wpus.selectUserId AND wpus.welfareId = wl.projectId
left join sys_union gh on gh.id = wl.welfareUnitId left join sys_union gh on gh.id = wl.welfareUnitId
left join sys_unit dw on dw.id = wl.welfareSecondLevelUnitId left join sys_unit dw on dw.id = wl.welfareSecondLevelUnitId
$condition $condition
@@ -724,7 +824,7 @@ public class WelfareSingleController {
exportEntities.add(new ExcelExportEntity("姓名", "username", 20)); exportEntities.add(new ExcelExportEntity("姓名", "username", 20));
exportEntities.add(new ExcelExportEntity("电话号码", "mobile", 20)); exportEntities.add(new ExcelExportEntity("电话号码", "mobile", 20));
exportEntities.add(new ExcelExportEntity("在职状态", "userState", 20)); exportEntities.add(new ExcelExportEntity("在职状态", "userState", 20));
exportEntities.add(new ExcelExportEntity("人员类型", "personType", 20)); exportEntities.add(new ExcelExportEntity("人员性质", "personType", 20));
exportEntities.add(new ExcelExportEntity("所在分工会", "unionname", 30)); exportEntities.add(new ExcelExportEntity("所在分工会", "unionname", 30));
exportEntities.add(new ExcelExportEntity("所在单位", "unitname", 50)); exportEntities.add(new ExcelExportEntity("所在单位", "unitname", 50));
exportEntities.add(new ExcelExportEntity("选择份数", "selectNum", 20)); exportEntities.add(new ExcelExportEntity("选择份数", "selectNum", 20));
@@ -29,7 +29,7 @@ public interface WelfareFeature {
* @return * @return
*/ */
static boolean judgmentAuthority() { static boolean judgmentAuthority() {
return ShiroUtil.hasAnyRoles("sysadmin,SchoolUnionWelfareAdmin,SchoolUnionAdmin,SchoolUnionMemberAdmin"); return ShiroUtil.hasAnyRoles("sysadmin,A06");
} }
interface Condition { interface Condition {
@@ -58,7 +58,7 @@ public class WelfareList {
private Boolean isAutoSelect; private Boolean isAutoSelect;
@Column @Column
@Comment("人员类型") @Comment("人员性质")
@ColDefine(type = ColType.VARCHAR) @ColDefine(type = ColType.VARCHAR)
private String personType; private String personType;
@@ -1,6 +1,8 @@
package io.v.nutz.zhgh.welfare.model; package io.v.nutz.zhgh.welfare.model;
import io.v.nutz.base.model.ViBaseModel; import io.v.nutz.base.model.ViBaseModel;
import io.v.nutz.sys.models.Sys_home_activity;
import io.v.nutz.sys.services.SysHomeConvert;
import io.v.nutz.zhgh.data.model.MatchConditionStructure; import io.v.nutz.zhgh.data.model.MatchConditionStructure;
import io.v.nutz.zhgh.welfare.mode.WelfareNoticePushMode; import io.v.nutz.zhgh.welfare.mode.WelfareNoticePushMode;
import io.v.nutz.zhgh.welfare.mode.WelfareProvideMode; import io.v.nutz.zhgh.welfare.mode.WelfareProvideMode;
@@ -11,6 +13,7 @@ import lombok.experimental.Accessors;
import org.nutz.dao.entity.annotation.*; import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert; import org.nutz.dao.interceptor.annotation.PrevInsert;
import java.io.Serializable;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@@ -26,7 +29,10 @@ import java.util.List;
@Accessors(chain = true) @Accessors(chain = true)
@Table("welfare_project") @Table("welfare_project")
@Comment("福利项目") @Comment("福利项目")
public class WelfareProject extends ViBaseModel { public class WelfareProject extends ViBaseModel implements Serializable, SysHomeConvert {
private static final long serialVersionUID = 1L;
@Column @Column
@Name @Name
@Comment("ID") @Comment("ID")
@@ -215,4 +221,20 @@ public class WelfareProject extends ViBaseModel {
@ColDefine(type = ColType.BOOLEAN) @ColDefine(type = ColType.BOOLEAN)
private Boolean isDisabled; private Boolean isDisabled;
@Override
public Sys_home_activity covertToSysHomeActivity() {
Sys_home_activity sysHomeActivity = new Sys_home_activity();
sysHomeActivity.setId(this.getId());
sysHomeActivity.setName(this.getName());
sysHomeActivity.setCover(this.getCover());
sysHomeActivity.setUrl("/platform/welfare/userChoose");
sysHomeActivity.setH5Url("/mobile/welfare/list/receive?projectId=" + this.getId());
sysHomeActivity.setStartDate(this.getChoiceTimeStart());
sysHomeActivity.setEndDate(this.getChoiceTimeEnd());
sysHomeActivity.setAllowUserSql("select userId from welfare_list where projectId = '"+this.getId()+"' and userId = @userId");
sysHomeActivity.setEnable(true);
sysHomeActivity.setClassPath(this.getClass().getPackageName() + this.getClass().getName());
return sysHomeActivity;
}
} }
@@ -53,7 +53,7 @@ public interface WelfareSingleService extends ViService<WelfareProject> {
* @param projectId 福利id * @param projectId 福利id
* @return * @return
*/ */
NutMap pageData(String projectId, String month, String welfareUnitCode, String unionGroupId); NutMap pageData(String projectId, String month, String welfareUnitCode, String unionGroupId,String personType);
NutMap exportByUnit(String projectId, String welfareUnitCode); NutMap exportByUnit(String projectId, String welfareUnitCode);
@@ -149,6 +149,8 @@ public class WelfareListServiceImpl extends ViServiceImpl<WelfareList> implement
list.setUserId(user.getString("id")); list.setUserId(user.getString("id"));
list.setWelfareUnitId(user.getString(field)); list.setWelfareUnitId(user.getString(field));
list.setWelfareSecondLevelUnitId(user.getString("unitid")); list.setWelfareSecondLevelUnitId(user.getString("unitid"));
list.setUserState(user.getString("userState"));
list.setPersonType(user.getString("personType"));
lists.add(list); lists.add(list);
} }
dao().insert(lists); dao().insert(lists);
@@ -119,7 +119,7 @@ public class WelfareSingleServiceImpl extends ViServiceImpl<WelfareProject> impl
sys_union un sys_union un
$condition $condition
"""); """);
if (!ShiroUtil.hasAnyRoles("sysadmin,SchoolUnionAdmin,SchoolUnionMemberAdmin,SchoolUnionWelfareAdmin")) { if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) {
if (ShiroUtil.hasAnyRoles("H04,gh12")) { if (ShiroUtil.hasAnyRoles("H04,gh12")) {
cnd.and("un.id", "=", Vi.getUnionId()); cnd.and("un.id", "=", Vi.getUnionId());
} }
@@ -184,10 +184,11 @@ public class WelfareSingleServiceImpl extends ViServiceImpl<WelfareProject> impl
wpus.selectUserId, wpus.selectUserId,
wl.welfareUnitId as unionId wl.welfareUnitId as unionId
FROM FROM
`welfare_project_user_selection_copy` wpus `welfare_project_user_selection` wpus
LEFT JOIN welfare_list wl on wl.userId = wpus.selectUserId LEFT JOIN welfare_list wl on wl.userId = wpus.selectUserId AND wpus.welfareId = wl.projectId
$condition $condition
"""); """);
cnd.groupBy("wpus.id");
sql.setCondition(cnd); sql.setCondition(cnd);
return listMap(sql); return listMap(sql);
} }
@@ -199,7 +200,7 @@ public class WelfareSingleServiceImpl extends ViServiceImpl<WelfareProject> impl
* @return * @return
*/ */
@Override @Override
public NutMap pageData(String projectId, String month, String welfareUnitCode, String unionGroupId) { public NutMap pageData(String projectId, String month, String welfareUnitCode, String unionGroupId, String personType) {
boolean isThreeUnit = Globals.MyConfig.getBoolean("isThreeUnit"); boolean isThreeUnit = Globals.MyConfig.getBoolean("isThreeUnit");
Sql welfareUnitSql = Sqls.create(""" Sql welfareUnitSql = Sqls.create("""
SELECT SELECT
@@ -210,8 +211,8 @@ public class WelfareSingleServiceImpl extends ViServiceImpl<WelfareProject> impl
"""); """);
CndPlus cnd = CndPlus.create(); CndPlus cnd = CndPlus.create();
if(!ShiroUtil.hasAnyRoles("sysadmin,SchoolUnionAdmin,SchoolUnionWelfareAdmin")){ if (!ShiroUtil.hasAnyRoles("sysadmin,A06,SchoolUnionWelfareAdmin")) {
cnd.and("unit.welfareUnitId","=",Vi.getUnionId()); cnd.and("unit.welfareUnitId", "=", Vi.getUnionId());
} }
@@ -476,7 +477,7 @@ public class WelfareSingleServiceImpl extends ViServiceImpl<WelfareProject> impl
welfare_project_user_selection wpus welfare_project_user_selection wpus
LEFT JOIN `user` u ON u.id = wpus.selectUserId LEFT JOIN `user` u ON u.id = wpus.selectUserId
LEFT JOIN welfare_project_subject_option wpso ON wpso.id = wpus.selectOptionId LEFT JOIN welfare_project_subject_option wpso ON wpso.id = wpus.selectOptionId
LEFT JOIN view_welfare_list vwl on vwl.id = wpus.selectUserId LEFT JOIN view_welfare_list vwl on vwl.id = wpus.selectUserId AND wpus.welfareId=vwl.projectId
$condition $condition
$monthCnd $monthCnd
""").setParam("welfareId", projectId); """).setParam("welfareId", projectId);
@@ -530,14 +531,6 @@ public class WelfareSingleServiceImpl extends ViServiceImpl<WelfareProject> impl
* 未领取人员信息 * 未领取人员信息
* *
* @param projectId * @param projectId
*
*
*
*
*
*
*
*
* @param welfareUnitCode * @param welfareUnitCode
* @return * @return
*/ */
@@ -658,27 +651,51 @@ public class WelfareSingleServiceImpl extends ViServiceImpl<WelfareProject> impl
optionSql.setParam("projectId", projectId); optionSql.setParam("projectId", projectId);
List<NutMap> options = (List<NutMap>) Daos.query(dao(), optionSql.toString(), Sqls.callback.maps()); List<NutMap> options = (List<NutMap>) Daos.query(dao(), optionSql.toString(), Sqls.callback.maps());
// Sql sql = Sqls.create("""
// SELECT
// vwl.loginname,
// vwl.username,
// vwl.unionid,
// vwl.unionname,
// wpus.userSign,
// wpus.selectOptionId,
// wpus.selectNum
// FROM
// view_welfare_list vwl
// LEFT JOIN welfare_project_user_selection wpus ON wpus.selectUserId = vwl.id
// AND wpus.welfareId = @projectId
// WHERE
// projectId = @projectId
// AND vwl.unionid = @unionId
// """);
Sql sql = Sqls.create(""" Sql sql = Sqls.create("""
SELECT SELECT
vwl.loginname, u.loginname,
vwl.username, u.username,
vwl.unionid, vwl.welfareUnitId as unionid,
vwl.unionname, gh.unionname as unionname,
vwl.welfareSecondLevelUnitId as unitid,
dw.`name` as unitname,
wpus.userSign, wpus.userSign,
wpus.selectOptionId, wpus.selectOptionId,
wpus.selectNum wpus.selectNum\s
FROM FROM
view_welfare_list vwl welfare_list vwl
LEFT JOIN welfare_project_user_selection wpus ON wpus.selectUserId = vwl.id LEFT join sys_user u on u.id = vwl.userId
AND wpus.welfareId = @projectId left join sys_union gh on gh.id = vwl.welfareUnitId
left join sys_unit dw on dw.id = vwl.welfareSecondLevelUnitId
LEFT JOIN welfare_project_user_selection wpus ON wpus.selectUserId = vwl.userId\s
AND wpus.welfareId = @projectId\s
WHERE WHERE
projectId = @projectId projectId = @projectId
AND vwl.unionid = @unionId AND vwl.welfareUnitId = @unionId
order by vwl.welfareUnitId,vwl.welfareSecondLevelUnitId
"""); """);
sql.setParam("projectId", projectId); sql.setParam("projectId", projectId);
sql.setParam("unionId", welfareUnitId); sql.setParam("unionId", welfareUnitId);
List<NutMap> list = listMap(sql); List<NutMap> list = listMap(sql);
list.forEach(l->{ list.forEach(l -> {
if (StrUtil.isNotBlank(l.getString("userSign"))) { if (StrUtil.isNotBlank(l.getString("userSign"))) {
try { try {
ByteArrayOutputStream signOs = new ByteArrayOutputStream(); ByteArrayOutputStream signOs = new ByteArrayOutputStream();
@@ -698,6 +715,10 @@ public class WelfareSingleServiceImpl extends ViServiceImpl<WelfareProject> impl
List<ExcelExportEntity> exportEntities = new ArrayList<>(); List<ExcelExportEntity> exportEntities = new ArrayList<>();
exportEntities.add(new ExcelExportEntity("序号", "no", 20)); exportEntities.add(new ExcelExportEntity("序号", "no", 20));
exportEntities.add(new ExcelExportEntity("姓名", "username", 20)); exportEntities.add(new ExcelExportEntity("姓名", "username", 20));
exportEntities.add(new ExcelExportEntity("工号", "loginname", 20));
exportEntities.add(new ExcelExportEntity("所在分工会", "unionname", 20));
exportEntities.add(new ExcelExportEntity("所在单位", "unitname", 20));
for (NutMap option : options) { for (NutMap option : options) {
exportEntities.add(new ExcelExportEntity(option.getString("optionName"), option.getString("id"), 20)); exportEntities.add(new ExcelExportEntity(option.getString("optionName"), option.getString("id"), 20));
} }
@@ -715,6 +736,10 @@ public class WelfareSingleServiceImpl extends ViServiceImpl<WelfareProject> impl
NutMap data = NutMap.NEW(); NutMap data = NutMap.NEW();
NutMap userMap = list.stream().filter(x -> x.getString("loginname").equals(v)).findFirst().get(); NutMap userMap = list.stream().filter(x -> x.getString("loginname").equals(v)).findFirst().get();
data.put("username", userMap.getString("username")); data.put("username", userMap.getString("username"));
data.put("loginname", userMap.getString("loginname"));
data.put("unitname", userMap.getString("unitname"));
data.put("unionname", userMap.getString("unionname"));
data.put("qzBytes", userMap.get("qzBytes")); data.put("qzBytes", userMap.get("qzBytes"));
for (NutMap option : options) { for (NutMap option : options) {
if (StrUtil.isNotBlank(userMap.getString("selectOptionId"))) { if (StrUtil.isNotBlank(userMap.getString("selectOptionId"))) {
@@ -0,0 +1,23 @@
Vue.mixin({
mounted() {
if (this.$options.style) {
const styleId = `style-${this._uid}`
const style = document.createElement("style")
style.id = styleId
//支持函数和字符串
const css = typeof this.$options.style === "function" ? this.$options.style.call(this) : this.$options.style
style.textContent = css
document.head.appendChild(style)
}
},
beforeDestroy() {
if (this.$options.style) {
const styleId = `style-${this._uid}`
const style = document.getElementById(styleId)
if (style) {
document.head.removeChild(style)
}
}
}
})
File diff suppressed because it is too large Load Diff
@@ -1,73 +1,68 @@
<template> <template>
<div> <div>
<el-card shadow="never"> <el-card shadow="never">
<div class="btn-group tool-button mt5"> <div class="btn-group tool-button mt5">
<el-date-picker <el-date-picker
v-model="page_form.year" v-model="page_form.year"
type="year" type="year"
value-format="yyyy" style="width: 150px" value-format="yyyy"
placeholder="选择年" @change="$emit('search')"> style="width: 150px"
</el-date-picker> placeholder="选择年"
</div> @change="$emit('search')"
<div class="btn-group tool-button mt5"> ></el-date-picker>
<el-input placeholder="请输入内容" clearable v-model="page_form.searchKeyword" </div>
@keyup.enter.native="$emit('search')"> <div class="btn-group tool-button mt5">
<el-select v-model="page_form.searchName" slot="prepend" placeholder="查询类型" <el-input placeholder="请输入内容" clearable v-model="page_form.searchKeyword" @keyup.enter.native="$emit('search')">
style="width: 120px;"> <el-select v-model="page_form.searchName" slot="prepend" placeholder="查询类型" style="width: 120px">
<el-option label="姓名" value="username"></el-option> <el-option label="姓名" value="username"></el-option>
<el-option label="工号" value="loginname"></el-option> <el-option label="工号" value="loginname"></el-option>
</el-select> </el-select>
</el-input> </el-input>
</div> </div>
<slot name="column"></slot> <slot name="column"></slot>
<div class="btn-group tool-button">
<el-button type="primary" icon="el-icon-search" @click="$emit('search')"></el-button>
</div>
<div class="btn-group tool-button"> <!-- <div class="pull-right offscreen-right mt5" v-if="has_add">
<el-button type="primary" icon="el-icon-search" @click="$emit('search')"></el-button> <el-button icon="el-icon-edit" @click="$emit('openAdd')">申请活动报销</el-button>
</div> </div>-->
<!-- <div class="pull-right offscreen-right mt5" v-if="has_add"> <div class="pull-right offscreen-right mt5" v-if="has_sh">
<el-button icon="el-icon-edit" @click="$emit('openAdd')">申请活动报销</el-button> <el-radio-group v-model="page_form.isAudit" @change="$emit('search')">
</div>--> <el-radio-button :label="1">全部</el-radio-button>
<el-radio-button :label="2">已审核</el-radio-button>
<div class="pull-right offscreen-right mt5" v-if="has_sh"> <el-radio-button :label="3">未审核</el-radio-button>
<el-radio-group v-model="page_form.isAudit" @change="$emit('search')"> </el-radio-group>
<el-radio-button :label="1">全部</el-radio-button> </div>
<el-radio-button :label="2">已审核</el-radio-button> </el-card>
<el-radio-button :label="3">未审核</el-radio-button> </div>
</el-radio-group>
</div>
</el-card>
</div>
</template> </template>
<script> <script>
module.exports = { module.exports = {
props: { props: {
page_form: '', page_form: "",
has_add: { has_add: {
type: Boolean, type: Boolean,
default: false default: false
},
has_sh: {
type: Boolean,
default: false
},
has_type: {
type: Boolean,
default: false
}
}, },
has_sh: { data() {
type: Boolean, return {}
default: false
}, },
has_type: { watch: {},
type: Boolean, methods: {},
default: false async created() {}
},
},
data() {
return {}
},
watch: {},
methods: {},
async created() {
}
} }
</script> </script>
File diff suppressed because it is too large Load Diff
@@ -1,230 +1,222 @@
/**
*Desc:
*Create by: jug
*Create time:2024/1/24/16:40
*/
<template> <template>
<div> <div>
<div ref="editorDom"></div> <div ref="editorRef"></div>
<input type="file" style="display: none;"> <input type="file" style="display: none" />
</div> </div>
</template> </template>
<script src="/assets/platform/plugins/jquery/jquery-1.11.1.min.js"></script>
<script> <script>
const { $, BtnMenu, Panel, Tooltip } = wangEditor
const {$, BtnMenu, DropListMenu, PanelMenu, DropList, Panel, Tooltip} = wangEditor //注册上传word按钮
class DocMenu extends BtnMenu {
constructor(editor) {
const $elem = wangEditor.$(
`<div class="w-e-menu" data-title="上传文档">
<i class="fa fa-file-word-o" aria-hidden="true" /></i>
</div>`
)
super($elem, editor)
}
class AlertMenu extends BtnMenu { clickHandler() {
constructor(editor) { const fileInputId = this.editor.textElemId + "input-file"
const $elem = wangEditor.$( const existingInput = document.getElementById(fileInputId)
`<div class="w-e-menu" data-title="上传word"> if (existingInput) {
word existingInput.remove()
</div>`
)
super($elem, editor)
}
clickHandler() {
const _this = this
const inputFileElement = document.querySelector('#'+this.editor.textElemId).parentElement.parentElement.nextElementSibling
inputFileElement.click()
inputFileElement.addEventListener('change', function () {
const file = this.files[0];
const fileName = file.name
if (!fileName.toLowerCase().endsWith('.doc') && !fileName.toLowerCase().endsWith('.docx')) {
alert('请上传doc或者docx的文件')
_this.clearInputFile()
return
}
const formData = new FormData()
formData.append('file', file, file.name)
axios.post('/file_server/word2Html', formData, {}).then(response => {
console.log(response.data)
if (response.data.code === 0) {
_this.editor.txt.html(response.data.data)
} else {
alert(response.data.msg + ',上传word失败,请联系管理员!')
_this.clearInputFile()
} }
}).catch(error => {
console.log(error)
_this.clearInputFile()
alert('上传word失败,请联系管理员!')
});
});
}
clearInputFile() { const input = document.createElement("input")
const obj = document.getElementById('fileInput'); input.type = "file"
obj.outerHTML = obj.outerHTML input.accept = "application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document"
} input.id = fileInputId
input.style.display = "none"
tryChangeActive() { input.addEventListener("change", (event) => {
this.active() const files = event.target.files
} if (!files || files.length === 0) {
return
}
wangEditor.registerMenu('alertMenuKey', AlertMenu)
module.exports = {
name: "textEditor",
props: {
// 定义值属性,用于接收父组件传递的值
value: {
type: String,
default: ''
},
height: {
type: Number,
default: 300
},
menus: {
type: Array,
default: () => {
return [
'head',//标题
'bold',//加粗
'fontSize',//字号
'fontName',//字体
'italic',//斜体
'underline',//下划线
'strikeThrough',//删除线
'indent',//缩进
'lineHeight',//行高
'foreColor',//文字颜色
'backColor',//背景颜色
//'link',//链接
'list',//序列
'todo',//待办
'justify',//对齐
'quote',//引用
// 'emoticon',//表情
'image',
//'video',
'table',
//'code',
'splitLine',//分割线
'undo',
'redo',
]
}
}
},
data() {
return {
editor: null
}
},
mounted() {
this.initEditor()
},
watch: {
value: {
handler: function (newValue) {
this.$nextTick(() => {
this.editor.txt.html(newValue);
// this.editor.config.focus = true
})
// const _this = this
// const waitUntilEditorNotNull = () => {
// if (_this.editor != null) {
// _this.editor.txt.html(newValue);
// } else {
// setTimeout(waitUntilEditorNotNull, 100); // 每隔100毫秒检查一次
// }
// }
// waitUntilEditorNotNull();
},
immediate: true
}
},
methods: {
initEditor() {
let _this = this
this.editor = new wangEditor(this.$refs.editorDom)
// this.editor.config.focus = false // 取消光标自动定位
//内容change回调
this.editor.config.onchange = function (newHtml) {
let content = _this.editor.txt.html()
let text = _this.editor.txt.text()
// 对于一键格式化后的内容,空内容可能会出现<p></br></p>标签,此处进行判断
// if (_this.isEmptyEditor()) {
// content = ''
// }
const newContent = content.replaceAll('<img', '<image');
_this.$emit('input', newContent)
_this.$emit('catchData', newContent, text)
}
//配置图片上传
this.editor.config.customUploadImg = function (resultFiles, insertImgFn) {
// resultFiles 是 input 中选中的文件列表
// insertImgFn 是获取图片 url 后,插入到编辑器的方法
Promise.all(_this.uploadFiles(resultFiles)).then(res => {
res.forEach(v => {
if (v.code === 0) {
insertImgFn(APP_DOMAIN + CREATE_PREVIEW_URL(v.data.filepath))
} else {
ELEMENT.message.warning('图片上传失败')
} }
})
})
} let loading = null
//粘贴过滤 if (window.ELEMENT) {
this.editor.config.pasteFilterStyle = false loading = ELEMENT.Loading.service({
//高度 lock: true,
this.editor.config.height = this.height text: "文件读取中",
//菜单 spinner: "el-icon-loading",
this.editor.config.menus = this.menus background: "rgba(0, 0, 0, 0.7)"
this.editor.create() })
}, } else if (window.vant) {
isEmptyEditor() { loading = vant.Toast.loading({
const children = this.editor.$textElem.children() message: "文件读取中",
for (let i = 0; i < children.elems.length; i++) { forbidClick: true,
const node = children.elems[i] overlay: true,
if (node && node.nodeType === Node.TEXT_NODE && node.textContent.trim().length !== '') { duration: 0
return false })
} }
if (node && node.nodeType === Node.ELEMENT_NODE && node.tagName.toLowerCase() === 'p' && node.innerText.trim() !== '') {
return false const formData = new FormData()
} formData.append("file", files[0])
}
return true axios
}, .post("/file_server/convertHtml", formData, {
uploadFiles(resultFiles) { headers: { "Content-Type": "multipart/form-data", "x-requested-with": "XMLHttpRequest" }
return resultFiles.map(async file => { })
const formData = new FormData() .then((response) => {
formData.append('file', file, file.name) loading.close()
formData.append("folderPath", "/wangEditorImg/") if (response.data.code === 0) {
return jQuery.ajax({ this.editor.txt.html(response.data.data)
url: '/file_server/uploadFile', } else {
type: 'post', if (window.ELEMENT) {
data: formData, ELEMENT.Message.error(response.data.msg)
processData: false, } else if (window.vant) {
contentType: false vant.Toast(response.data.msg)
} else {
alert(response.data.msg)
}
}
})
.catch((error) => {
console.log(error)
alert("上传word失败,请联系管理员!")
})
.finally(() => {
input.remove()
})
}) })
}) input.click()
document.body.appendChild(input)
} }
},
created() {
} tryChangeActive() {}
} }
wangEditor.registerMenu("docMenu", DocMenu)
module.exports = {
name: "textEditor",
props: {
content: {
type: String,
default: ""
},
// 定义值属性,用于接收父组件传递的值
value: {
type: String,
default: ""
},
height: {
type: Number,
default: 300
},
menus: {
type: Array,
default: () => {
return [
"head", //标题
"bold", //加粗
"fontSize", //字号
"fontName", //字体
"italic", //斜体
"underline", //下划线
"strikeThrough", //删除线
"indent", //缩进
"lineHeight", //行高
"foreColor", //文字颜色
"backColor", //背景颜色
//'link',//链接
"list", //序列
"todo", //待办
"justify", //对齐
"quote", //引用
// 'emoticon',//表情
"image",
//'video',
"table",
//'code',
"splitLine", //分割线
"undo",
"redo"
]
}
}
},
data() {
return {
editor: null,
cursorPos: 0
}
},
mounted() {
this.initEditor()
},
watch: {
value: {
handler: function (newValue) {
this.$nextTick(() => {
if (newValue !== this.editor.txt.html()) {
this.editor.txt.html(newValue)
} else {
// this.editor.selection.moveCursor(this.editor.$textElem.elems[0], 1)
}
})
},
immediate: true
}
},
methods: {
initEditor() {
let _this = this
this.editor = new wangEditor(this.$refs.editorRef)
this.editor.config.focus = false
//内容change回调
this.editor.config.onchange = (newHtml) => {
this.cursorPos = this.editor.selection.getCursorPos()
const range = this.editor.selection.getRange()
range.setStart(range.startContainer, Math.max(this.cursorPos, range.endOffset))
this.$emit("input", newHtml)
}
this.editor.config.linkImgCheck = function (imgSrc, alt, href) {
// 1. 返回 true ,说明检查通过
return true
}
//配置图片上传
this.editor.config.customUploadImg = function (resultFiles, insertImgFn) {
// resultFiles 是 input 中选中的文件列表
// insertImgFn 是获取图片 url 后,插入到编辑器的方法
Promise.all(_this.uploadFiles(resultFiles)).then((res) => {
res.forEach((v) => {
if (v.data && v.data.code === 0) {
insertImgFn(v.data.data)
} else {
ELEMENT.message.error("图片上传失败")
}
})
})
}
this.editor.config.pasteFilterStyle = false
this.editor.config.height = this.height
this.editor.config.menus = this.menus
this.editor.create()
},
uploadFiles(resultFiles) {
return resultFiles.map(async (file) => {
const formData = new FormData()
formData.append("file", file, file.name)
formData.append("folderPath", "/wangEditorImg/")
return jQuery.ajax({
url: "/file_server/uploadFile",
type: "post",
data: formData,
processData: false,
contentType: false
})
})
}
},
created() {}
}
</script> </script>
<style scoped></style>
<style scoped>
</style>
@@ -1,166 +1,156 @@
<template> <template>
<div style="width: 100%"> <div style="width: 100%">
<van-image :src="imageUrl" v-if="!signDrawingBoardShow" <van-image :src="imageUrl" v-if="!signDrawingBoardShow" style="width: 100%; height: 150px; border: 1px dashed"></van-image>
style="width: 100%;height: 150px;border: 1px dashed"></van-image> <div style="text-align: right">
<div style="text-align: right"> <van-button plain type="danger" hairline size="small" @click="openSignDrawingBoard" native-type="button">打开签字版</van-button>
<van-button plain type="danger" hairline size="small" @click="openSignDrawingBoard"> </div>
打开签字版 <van-popup v-model="signDrawingBoardShow" position="bottom" :style="{ height: '60vh' }">
</van-button> <div id="canvas" style="position: relative; width: 100%"></div>
<div class="button-extra">
<van-button plain type="danger" hairline size="small" @click="reset" native-type="button">清空重签</van-button>
<van-button plain type="primary" hairline size="small" @click="confirm" native-type="button">确定</van-button>
</div>
</van-popup>
</div> </div>
<van-popup v-model="signDrawingBoardShow" position="bottom" :style="{ height: '60vh' }">
<div id="canvas" style="position: relative;width: 100%"></div>
<div class="button-extra">
<van-button plain type="danger" hairline size="small" @click="reset">清空重签</van-button>
<van-button plain type="primary" hairline size="small" @click="confirm">确定</van-button>
</div>
</van-popup>
</div>
</template> </template>
<script> <script>
module.exports = { module.exports = {
props: { props: {
my_sign: { my_sign: {
type: String type: String
}, },
value: { value: {
type: String type: String
}, },
is_value_base64: { is_value_base64: {
type: Boolean, type: Boolean,
default: true default: true
}, },
prefix: { prefix: {
type: String, type: String,
default: '' default: ""
},
},
data() {
return {
signDrawingBoardShow: false,
signData: null,
imageUrl: "",
}
},
watch: {
value:{
handler:function (val){
if(val){
this.getImageUrl(val)
} }
},
immediate:true
}
},
methods: {
//打开签字画板
openSignDrawingBoard() {
this.signDrawingBoardShow = true
this.$nextTick(() => {
$("#canvas").jSignature({
width: '100%',
height: '100%',
"decor-color": "transparent",
lineWidth: '3'
})
})
}, },
reset() { data() {
$('#canvas').jSignature('reset') return {
this.$emit("update:my_sign", null) signDrawingBoardShow: false,
}, signData: null,
imageUrl: ""
confirm() {
const isNull = $('#canvas').jSignature('getData', 'native').length === 0
if (isNull) {
this.$modal.msgError("请签字后再确定")
return
}
this.signData = $('#canvas').jSignature('getData')
this.signDrawingBoardShow = false
this.uploadSignData()
},
async uploadSignData() {
if (this.is_value_base64) {
this.$emit('input', this.signData)
this.$emit("update:my_sign", this.signData)
this.getImageUrl(this.signData)
} else {
const {data, code, msg} = await $.post('/signature/uploadSignData', {data: this.signData})
if (code === 0) {
console.log(data)
this.getImageUrl(data)
this.$emit('input', data)
this.$emit("update:my_sign", data)
} else {
this.$modal.msgError(msg)
} }
} },
watch: {
value: {
handler: function (val) {
if (val) {
this.getImageUrl(val)
}
},
immediate: true
}
},
methods: {
//打开签字画板
openSignDrawingBoard() {
this.signDrawingBoardShow = true
this.$nextTick(() => {
$("#canvas").jSignature({
width: "100%",
height: "100%",
"decor-color": "transparent",
lineWidth: "3"
})
})
},
reset() {
$("#canvas").jSignature("reset")
this.$emit("update:my_sign", null)
},
confirm() {
const isNull = $("#canvas").jSignature("getData", "native").length === 0
if (isNull) {
this.$modal.msgError("请签字后再确定")
return
}
this.signData = $("#canvas").jSignature("getData")
this.signDrawingBoardShow = false
this.uploadSignData()
},
async uploadSignData() {
if (this.is_value_base64) {
this.$emit("input", this.signData)
this.$emit("update:my_sign", this.signData)
this.getImageUrl(this.signData)
} else {
const { data, code, msg } = await $.post("/signature/uploadSignData", { data: this.signData })
if (code === 0) {
console.log(data)
this.getImageUrl(data)
this.$emit("input", data)
this.$emit("update:my_sign", data)
} else {
this.$modal.msgError(msg)
}
}
},
getImageUrl(value) {
if (this.is_value_base64) {
this.imageUrl = value
} else {
this.imageUrl = "/signature/getSignData?path=" + value
}
},
checkNull() {
return $("#canvas").jSignature("getData", "native").length === 0
},
submitSign() {
this.$emit("update:my_sign", $("#canvas").jSignature("getData"))
},
async updateSign() {
const data = await $.post("/mobile/common/signing/update", {
sign: $("#canvas").jSignature("getData"),
prefix: this.prefix
})
},
async getMySign() {
const data = await $.get("/mobile/common/signing/getMySign", { prefix: this.prefix })
if (data) {
this.getImageUrl(data)
}
}
}, },
getImageUrl(value) { created() {
if (this.is_value_base64) { this.getMySign()
this.imageUrl = value
} else {
this.imageUrl = '/signature/getSignData?path=' + value
}
}, },
checkNull() { async mounted() {}
return $('#canvas').jSignature('getData', 'native').length === 0
},
submitSign() {
this.$emit("update:my_sign", $('#canvas').jSignature('getData'))
},
async updateSign() {
const data = await $.post("/mobile/common/signing/update", {
sign: $('#canvas').jSignature('getData'),
prefix: this.prefix
})
},
async getMySign() {
const data = await $.get("/mobile/common/signing/getMySign", {prefix: this.prefix})
if (data) {
this.getImageUrl(data)
}
}
},
created() {
this.getMySign()
},
async mounted() {
}
} }
</script> </script>
<style scoped> <style scoped>
.clearBtn { .clearBtn {
position: absolute !important; position: absolute !important;
bottom: 5px; bottom: 5px;
right: 5px; right: 5px;
color: red; color: red;
z-index: 99; z-index: 99;
} }
#canvas { #canvas {
height: calc(60vh - 100px); height: calc(60vh - 100px);
width: 100vw; width: 100vw;
} }
.button-extra { .button-extra {
height: 100px; height: 100px;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
padding: 0 20px; padding: 0 20px;
} }
.button-extra button { .button-extra button {
width: 40%; width: 40%;
} }
</style> </style>
+171 -173
View File
@@ -1,203 +1,201 @@
<template> <template>
<el-card class="box-card" shadow="never"> <el-card class="box-card" shadow="never">
<div class="signature-body">
<el-collapse-transition>
<div v-show="showQrCode" class="qr-code-div">
<el-link type="primary" :underline="false">{{ scan_title }}</el-link>
<QrCode v-if="postAddress" :options="{ width: 126 }" :value="postAddress"></QrCode>
</div>
</el-collapse-transition>
<div class="signature-body"> <el-image fit="contain" v-show="!showQrCode" v-loading="loading" style="height: 100px; width: 100%" :src="imageUrl">
<el-collapse-transition> <div slot="error" class="image-slot">
<div v-show="showQrCode" class="qr-code-div"> <i class="el-icon-picture-outline"></i>
<el-link type="primary" :underline="false">{{ scan_title }}</el-link> </div>
<QrCode v-if="postAddress" :options="{ width: 126 }" :value="postAddress"></QrCode> </el-image>
<el-link
type="danger"
style="font-size: 12px; margin-top: 20px"
@click="
refresh()
clear()
"
icon="el-icon-edit"
v-show="!showQrCode"
>
重签
</el-link>
</div> </div>
</el-collapse-transition> </el-card>
<el-image fit="contain" v-show="!showQrCode" v-loading="loading"
style="height: 100px;width: 100%" :src="imageUrl">
<div slot="error" class="image-slot">
<i class="el-icon-picture-outline"></i>
</div>
</el-image>
<el-link type="danger" style="font-size: 12px;margin-top: 20px" @click="refresh();clear()"
icon="el-icon-edit"
v-show="!showQrCode">重签
</el-link>
</div>
</el-card>
</template> </template>
<script> <script>
window.signatureInterval = null window.signatureInterval = null
module.exports = { module.exports = {
name: "Signature", name: "Signature",
props: { props: {
scan_title: { scan_title: {
type: String, type: String,
default: '扫描下方二维码进行签字' default: "扫描下方二维码进行签字"
},
prefix: {
type: String,
default: "DEFAULT"
},
qz: {
type: String,
default: ""
},
value: {
type: String,
default: ""
},
is_value_base64: {
type: Boolean,
default: true
}
}, },
prefix: { model: {
type: String, prop: "qz",
default: 'DEFAULT' event: "change"
}, },
qz: { data() {
type: String, return {
default: '' showQrCode: false,
loading: true,
postAddress: "",
imageUrl: ""
}
}, },
value: { methods: {
type: String, refresh() {
default: '' this.qz = ""
}, },
is_value_base64: { getImageUrl(value) {
type: Boolean, if (this.is_value_base64) {
default: true this.imageUrl = value
} } else {
}, this.imageUrl = "/signature/getSignData?path=" + value
model: {
prop: 'qz',
event: 'change'
},
data() {
return {
showQrCode: false,
loading: true,
postAddress: '',
imageUrl: '',
}
},
methods: {
refresh() {
this.qz = ''
},
getImageUrl(value) {
if (this.is_value_base64) {
this.imageUrl = value
} else {
this.imageUrl = '/signature/getSignData?path=' + value
}
},
startRequest() {
this.imageUrl = ''
clearInterval(signatureInterval)
const ts = new Date().getTime() + (Math.floor(Math.random() * (1000 - 1 + 1)) + 1).toString()
console.log(ts)
this.postAddress = location.protocol + '//' + location.host + '/signature?prefix=' + this.prefix + '&id=' + ts + "&is_value_base64=" + this.is_value_base64
// this.postAddress = 'http://zhgh.jiangnan.edu.cn/signature?prefix=' + this.prefix + '&id=' + ts + "&is_value_base64=" + this.is_value_base64
this.showQrCode = true
console.log(this.postAddress)
window.signatureInterval = setInterval(() => {
$.get("/signature/getBase64?prefix=" + this.prefix + "&id=" + ts).then(res => {
if (res != null) {
this.$emit("change", res)
this.$emit("update:qz", res)
this.getImageUrl(res)
this.qz = res
this.loading = false
this.save()
clearInterval(signatureInterval)
}
})
}, 1000 * 3)
},
async save() {
if (this.is_value_base64) {
localStorage.setItem("signature", this.qz)
} else {
return localStorage.setItem("signatureWelfare", this.qz)
}
},
clear() {
if (this.is_value_base64) {
localStorage.removeItem("signature")
} else {
localStorage.removeItem("signatureWelfare")
}
},
getSignature() {
if (this.is_value_base64) {
return localStorage.getItem("signature")
} else {
return localStorage.getItem("signatureWelfare")
}
},
async getMySign() {
setTimeout(() => {
if (this.qz) {
this.getImageUrl(this.qz)
} else {
$.get("/mobile/common/signing/getMySign", {prefix: this.prefix}).then(data => {
if (data) {
this.getImageUrl(data)
this.$emit("change", data)
this.$emit("update:qz", data)
this.qz = data
} }
}) },
startRequest() {
this.imageUrl = ""
clearInterval(signatureInterval)
const ts = new Date().getTime() + (Math.floor(Math.random() * (1000 - 1 + 1)) + 1).toString()
console.log(ts)
// this.postAddress = location.protocol + '//' + location.host + '/signature?prefix=' + this.prefix + '&id=' + ts + "&is_value_base64=" + this.is_value_base64
this.postAddress = "http://10.10.10.15/signature?prefix=" + this.prefix + "&id=" + ts + "&is_value_base64=" + this.is_value_base64
this.showQrCode = true
console.log(this.postAddress)
window.signatureInterval = setInterval(() => {
$.get("/signature/getBase64?prefix=" + this.prefix + "&id=" + ts).then((res) => {
if (res != null) {
this.$emit("change", res)
this.$emit("update:qz", res)
this.getImageUrl(res)
this.qz = res
this.loading = false
this.save()
clearInterval(signatureInterval)
}
})
}, 1000 * 3)
},
async save() {
if (this.is_value_base64) {
localStorage.setItem("signature", this.qz)
} else {
return localStorage.setItem("signatureWelfare", this.qz)
}
},
clear() {
if (this.is_value_base64) {
localStorage.removeItem("signature")
} else {
localStorage.removeItem("signatureWelfare")
}
},
getSignature() {
if (this.is_value_base64) {
return localStorage.getItem("signature")
} else {
return localStorage.getItem("signatureWelfare")
}
},
async getMySign() {
setTimeout(() => {
if (this.qz) {
this.getImageUrl(this.qz)
} else {
$.get("/mobile/common/signing/getMySign", { prefix: this.prefix }).then((data) => {
if (data) {
this.getImageUrl(data)
this.$emit("change", data)
this.$emit("update:qz", data)
this.qz = data
}
})
}
}, 500)
} }
}, 500) },
created() {
this.getMySign()
} },
}, watch: {
created() { qz: {
this.getMySign() handler(s) {
}, this.loading = !s
watch: { if (!s) {
'qz': { const qz = this.getSignature()
handler(s) { if (!qz) {
this.loading = !s this.$emit("change", "")
if (!s) { this.$emit("update:qz", "")
const qz = this.getSignature() this.startRequest()
if (!qz) { } else {
this.$emit("change", '') this.qz = qz
this.$emit("update:qz", '') this.$emit("change", qz)
this.startRequest() this.$emit("update:qz", qz)
} else { }
this.qz = qz } else {
this.$emit("change", qz) this.qz = s
this.$emit("update:qz", qz) this.showQrCode = false
} }
} else { },
this.qz = s immediate: true
this.showQrCode = false
} }
},
immediate: true
} }
}
} }
</script> </script>
<style scoped> <style scoped>
.el-card__body { .el-card__body {
position: relative !important; position: relative !important;
} }
.signature-body { .signature-body {
width: 100%; width: 100%;
height: 100%; height: 100%;
min-height: 160px; min-height: 160px;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
flex-direction: column; flex-direction: column;
} }
.qr-code-div { .qr-code-div {
position: absolute; position: absolute;
width: 100%; width: 100%;
height: 100%; height: 100%;
left: 0; left: 0;
top: 0; top: 0;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
flex-direction: column; flex-direction: column;
z-index: 999; z-index: 999;
} }
</style> </style>
@@ -24,57 +24,47 @@ layout("/mobile/platform.html"){
.list-card .van-cell__value { .list-card .van-cell__value {
flex: 2; flex: 2;
} }
</style> </style>
<div id="app" v-cloak> <div id="app" v-cloak>
<van-nav-bar :title="title" @click-left="history.back()" fixed left-arrow <van-nav-bar :title="title" @click-left="pjaxReplace('/mobile/index')" fixed left-arrow placeholder></van-nav-bar>
placeholder></van-nav-bar>
<div class="search-fixed"> <div class="search-fixed">
<van-dropdown-menu active-color="#1989fa"> <van-dropdown-menu active-color="#1989fa">
<!-- <van-dropdown-item v-model="pageForm.isMenWomen" @change="yearChange" <!-- <van-dropdown-item v-model="pageForm.isMenWomen" @change="yearChange"
:options="sexList"></van-dropdown-item>--> :options="sexList"></van-dropdown-item>-->
<van-dropdown-item v-model="pageForm.groupName" @change="yearChange" <van-dropdown-item v-model="pageForm.groupName" @change="yearChange" :options="groupList"></van-dropdown-item>
:options="groupList"></van-dropdown-item> <van-dropdown-item :options="eventList" @change="yearChange" v-model="pageForm.eventId"></van-dropdown-item>
<van-dropdown-item :options="eventList" @change="yearChange" <van-dropdown-item :options="auditList" @change="yearChange" v-model="pageForm.isAudit"></van-dropdown-item>
v-model="pageForm.eventId"></van-dropdown-item>
<van-dropdown-item :options="auditList" @change="yearChange"
v-model="pageForm.isAudit"></van-dropdown-item>
</van-dropdown-menu> </van-dropdown-menu>
</div> </div>
<div style="margin: 60px auto 0 auto"> <div style="margin: 60px auto 0 auto">
<van-list :finished="finished" :finished-text="tableData.length>0?'没有更多了':''" <van-list :finished="finished" :finished-text="tableData.length>0?'没有更多了':''" v-model="loading" @load="pageData">
v-model="loading"
@load="pageData">
<div v-for="o in tableData" class="list-card"> <div v-for="o in tableData" class="list-card">
<van-cell-group inset> <van-cell-group inset>
<image class="register-icon" src="/assets/mobile/svg/activity/wbm.svg" <image
@click="openActivity(o)" class="register-icon"
v-if="o.userApply==0&&o.applyWay.includes(1)"></image> src="/assets/mobile/svg/activity/wbm.svg"
<image class="register-icon" src="/assets/mobile/svg/activity/qxbm.svg" @click="openActivity(o)"
@click="openActivity(o)" v-if="o.userApply==0&&o.applyWay.includes(1)"
v-if="o.userApply>0&&o.applyWay.includes(1)"></image> ></image>
<image
class="register-icon"
src="/assets/mobile/svg/activity/qxbm.svg"
@click="openActivity(o)"
v-if="o.userApply>0&&o.applyWay.includes(1)"
></image>
<van-cell :border="false" title="项目名称"> <van-cell :border="false" title="项目名称">
<span :style="{color:themeColor}" class="van-ellipsis" <span :style="{color:themeColor}" class="van-ellipsis" style="font-size: 16px">{{o.allName}}</span>
style="font-size: 16px;">
{{o.allName}}
</span>
</van-cell> </van-cell>
<van-cell :border="false" title="项目类型">{{o.projectType==1?'单项':'团体'}}</van-cell> <van-cell :border="false" title="项目类型">{{o.projectType==1?'单项':'团体'}}</van-cell>
<van-cell :border="false" title="您报队伍"> <van-cell :border="false" title="您报队伍">{{o.activityTeamName?o.activityTeamName:'暂无'}}</van-cell>
{{o.activityTeamName?o.activityTeamName:'暂无'}}
</van-cell>
<van-cell :border="false" title="年龄限制" v-if="o.projectType==1"> <van-cell :border="false" title="年龄限制" v-if="o.projectType==1">
<span v-if="o.startAgeDate!=null">{{o.startAgeDate}}至{{o.endAgeDate}}</span> <span v-if="o.startAgeDate!=null">{{o.startAgeDate}}至{{o.endAgeDate}}</span>
<span v-else>暂无</span> <span v-else>暂无</span>
</van-cell> </van-cell>
<van-cell :border="false" title="可报队数" v-if="o.projectType==2"> <van-cell :border="false" title="可报队数" v-if="o.projectType==2">{{o.restrictTotalTeam}}队</van-cell>
{{o.restrictTotalTeam}}队
</van-cell>
<van-cell :border="false" title="每队可报人数" v-if="o.applyUserModel===1"> <van-cell :border="false" title="每队可报人数" v-if="o.applyUserModel===1">
<span v-if="o.athletesMaxNum">{{o.athletesMaxNum}}人</span> <span v-if="o.athletesMaxNum">{{o.athletesMaxNum}}人</span>
<span v-else-if="o.applyType==1">{{o.athletesMaxNum*o.restrictTotalTeam}}人</span> <span v-else-if="o.applyType==1">{{o.athletesMaxNum*o.restrictTotalTeam}}人</span>
@@ -87,15 +77,19 @@ layout("/mobile/platform.html"){
<span v-else-if="o.totalApplyNum>0&&o.applyType==3">{{o.totalApplyNum}}人</span> <span v-else-if="o.totalApplyNum>0&&o.applyType==3">{{o.totalApplyNum}}人</span>
<span v-else>0人</span> <span v-else>0人</span>
</van-cell> </van-cell>
</van-cell-group> </van-cell-group>
</div> </div>
</van-list> </van-list>
</div> </div>
<van-dialog @confirm="doActivityConfirm" show-cancel-button title="您确定要报名此活动吗?" <van-dialog
v-model="activityDialog" @confirm="doActivityConfirm"
@cancel="activityDialog = false" :before-close="onBeforeClose"> show-cancel-button
title="您确定要报名此活动吗?"
v-model="activityDialog"
@cancel="activityDialog = false"
:before-close="onBeforeClose"
>
<van-radio-group v-model="formData.teamId" v-if="projectType==2"> <van-radio-group v-model="formData.teamId" v-if="projectType==2">
<van-cell-group> <van-cell-group>
<template v-for="i in teams"> <template v-for="i in teams">
@@ -105,21 +99,16 @@ layout("/mobile/platform.html"){
</template> </template>
</van-cell> </van-cell>
</template> </template>
</van-cell-group> </van-cell-group>
</van-radio-group> </van-radio-group>
</van-dialog> </van-dialog>
<van-empty v-if="mLoading==false&&tableData.length==0" class="custom-image" image="/none.svg" <van-empty v-if="mLoading==false&&tableData.length==0" class="custom-image" image="/none.svg" description="暂无数据"></van-empty>
description="暂无数据">
</van-empty>
</div> </div>
<script> <script>
const vue = new Vue({ const vue = new Vue({
el: '#app', el: "#app",
mixins: [mobileMixins], mixins: [mobileMixins],
data() { data() {
return { return {
@@ -139,27 +128,27 @@ layout("/mobile/platform.html"){
events: [], events: [],
eventList: [], eventList: [],
groupList: [ groupList: [
{text: '按组别', value: null}, { text: "按组别", value: null },
{text: '甲组', value: '甲组'}, { text: "甲组", value: "甲组" },
{text: '乙组', value: '乙组'}, { text: "乙组", value: "乙组" },
{text: '丙组', value: '丙组'}, { text: "丙组", value: "丙组" },
{text: '丁组', value: '丁组'}, { text: "丁组", value: "丁组" }
], ],
sexList: [ sexList: [
{text: '按性别', value: 1}, { text: "按性别", value: 1 },
{text: '男子', value: 2}, { text: "男子", value: 2 },
{text: '女子', value: 3}, { text: "女子", value: 3 },
{text: '团体', value: 4}, { text: "团体", value: 4 }
], ],
auditList: [ auditList: [
{text: '全部', value: null}, { text: "全部", value: null },
{text: '已报名', value: "true"}, { text: "已报名", value: "true" },
{text: '未报名', value: "false"}, { text: "未报名", value: "false" }
], ],
teams: [], teams: [],
yearOption: [], yearOption: [],
pageForm: { pageForm: {
year: '', year: "",
isMenWomen: "1" isMenWomen: "1"
} }
} }
@@ -173,14 +162,14 @@ layout("/mobile/platform.html"){
this.$toast("请选择报名的小队") this.$toast("请选择报名的小队")
return return
} else { } else {
const {data} = await $.post("/mobile/activity/Sports/list/getTeamUserData", { const { data } = await $.post("/mobile/activity/Sports/list/getTeamUserData", {
teamId: this.formData.teamId, teamId: this.formData.teamId,
activityId: this.formData.activityId, activityId: this.formData.activityId,
eventId: this.formData.eventId, eventId: this.formData.eventId,
applyType: this.applyType applyType: this.applyType
}) })
const nv = data.filter(v => v.sex === '女') const nv = data.filter((v) => v.sex === "女")
const nan = data.filter(v => v.sex === '男') const nan = data.filter((v) => v.sex === "男")
let title = this.projectType === 1 ? "项目" : "小队" let title = this.projectType === 1 ? "项目" : "小队"
/* if (this.applyType !== 3) { /* if (this.applyType !== 3) {
if (this.isManGirlNum === false && "${@shiro.getPrincipalProperty('sex')}" == '男' && nan.length == (this.applyType === 1 ? (this.athletesMaxNum - this.restrictGirlNum) : this.restrictBoyNum)) { if (this.isManGirlNum === false && "${@shiro.getPrincipalProperty('sex')}" == '男' && nan.length == (this.applyType === 1 ? (this.athletesMaxNum - this.restrictGirlNum) : this.restrictBoyNum)) {
@@ -192,11 +181,11 @@ layout("/mobile/platform.html"){
return return
} }
}*/ }*/
if (this.athletesMaxNum && (data.length >= this.athletesMaxNum)) { if (this.athletesMaxNum && data.length >= this.athletesMaxNum) {
this.$toast("该" + title + "人员已报满!") this.$toast("该" + title + "人员已报满!")
return return
} }
if (this.formData.teamId != null) this.$set(this.formData, "teamName", this.teams.find(v => v.id == this.formData.teamId).name) if (this.formData.teamId != null) this.$set(this.formData, "teamName", this.teams.find((v) => v.id == this.formData.teamId).name)
await $.post("/mobile/activity/Sports/list/doActivity", this.formData) await $.post("/mobile/activity/Sports/list/doActivity", this.formData)
await this.onRefresh() await this.onRefresh()
@@ -222,7 +211,7 @@ layout("/mobile/platform.html"){
this.applyType = applyType this.applyType = applyType
this.isManGirlNum = isManGirlNum this.isManGirlNum = isManGirlNum
const res = await $.get("/mobile/activity/Sports/list/getScopeUser", {activityGroupId: activityGroupId}) const res = await $.get("/mobile/activity/Sports/list/getScopeUser", { activityGroupId: activityGroupId })
if (res.data == 0) { if (res.data == 0) {
this.$toast("您不在报名人员内!") this.$toast("您不在报名人员内!")
return return
@@ -238,10 +227,10 @@ layout("/mobile/platform.html"){
}*/ }*/
if (userApply == 1) { if (userApply == 1) {
const confirm = await vant.Dialog.confirm({ const confirm = await vant.Dialog.confirm({
title: '提示', title: "提示",
message: '确定取消此次报名吗?', message: "确定取消此次报名吗?"
}) })
if (confirm === 'confirm') { if (confirm === "confirm") {
await $.get("/platform/activity/apply/doDeleteApply", { await $.get("/platform/activity/apply/doDeleteApply", {
userId: "${@shiro.getPrincipalProperty('id')}", userId: "${@shiro.getPrincipalProperty('id')}",
activityId: activityId, activityId: activityId,
@@ -253,16 +242,11 @@ layout("/mobile/platform.html"){
return return
} }
this.events = [] this.events = []
const data = await $.get("/platform/activity/apply/getEvents", {activityId: activityId}) const data = await $.get("/platform/activity/apply/getEvents", { activityId: activityId })
this.events = data this.events = data
const { const { athletesMaxNum, startAgeDate, endAgeDate, isMenWomen, restrictBoyNum, restrictGirlNum } = this.events.find(
athletesMaxNum, (v) => v.id == eventId
startAgeDate, )
endAgeDate,
isMenWomen,
restrictBoyNum,
restrictGirlNum
} = this.events.find(v => v.id == eventId)
if (isMenWomen) { if (isMenWomen) {
this.restrictBoyNum = athletesMaxNum this.restrictBoyNum = athletesMaxNum
this.restrictGirlNum = athletesMaxNum this.restrictGirlNum = athletesMaxNum
@@ -272,24 +256,24 @@ layout("/mobile/platform.html"){
} }
this.athletesMaxNum = athletesMaxNum this.athletesMaxNum = athletesMaxNum
if (projectType == 1) { if (projectType == 1) {
if (isMenWomen != null && isMenWomen === 1 && "${@shiro.getPrincipalProperty('sex')}" != '男') { if (isMenWomen != null && isMenWomen === 1 && "${@shiro.getPrincipalProperty('sex')}" != "男") {
this.$toast("此项目只能男性老师才能报名!") this.$toast("此项目只能男性老师才能报名!")
return return
} }
if (isMenWomen != null && isMenWomen === 2 && "${@shiro.getPrincipalProperty('sex')}" != '女') { if (isMenWomen != null && isMenWomen === 2 && "${@shiro.getPrincipalProperty('sex')}" != "女") {
this.$toast("此项目只能女性老师才能报名!") this.$toast("此项目只能女性老师才能报名!")
return return
} }
if (restrictRegNumber > 0) { if (restrictRegNumber > 0) {
const {data} = await $.post("/platform/activity/apply/getActivityData", {activityId}) const { data } = await $.post("/platform/activity/apply/getActivityData", { activityId })
const userApplyNum = data.filter(v => v.userId == "${@shiro.getPrincipalProperty('id')}").length const userApplyNum = data.filter((v) => v.userId == "${@shiro.getPrincipalProperty('id')}").length
if (userApplyNum >= restrictRegNumber) { if (userApplyNum >= restrictRegNumber) {
this.$toast('单项项目,每人限报' + restrictRegNumber + '个!团体项目除外') this.$toast("单项项目,每人限报" + restrictRegNumber + "个!团体项目除外")
return return
} }
} }
const {data} = await $.post("/mobile/activity/Sports/list/getTeamUserData", { const { data } = await $.post("/mobile/activity/Sports/list/getTeamUserData", {
activityId: this.formData.activityId, activityId: this.formData.activityId,
applyType: applyType, applyType: applyType,
eventId: eventId eventId: eventId
@@ -303,18 +287,15 @@ layout("/mobile/platform.html"){
} }
} }
} else { } else {
unionLimit = JSON.parse(unionLimit) unionLimit = JSON.parse(unionLimit)
const limit = unionLimit.find(v => v.id === "${@shiro.getPrincipalProperty('unit').getUnionid()}") const limit = unionLimit.find((v) => v.id === "${@shiro.getPrincipalProperty('unit').getUnionid()}")
this.athletesMaxNum = limit.limitCount this.athletesMaxNum = limit.limitCount
if (data.length >= limit.limitCount) { if (data.length >= limit.limitCount) {
this.$toast("此项目报名人数已满!此项目只需报" + limit.limitCount + "人") this.$toast("此项目报名人数已满!此项目只需报" + limit.limitCount + "人")
return return
} }
} }
if (startAgeDate != null) { if (startAgeDate != null) {
const birthday = moment("${@shiro.getPrincipalProperty('birthday')}").valueOf() const birthday = moment("${@shiro.getPrincipalProperty('birthday')}").valueOf()
if (birthday < moment(startAgeDate).valueOf() || birthday > moment(endAgeDate).valueOf()) { if (birthday < moment(startAgeDate).valueOf() || birthday > moment(endAgeDate).valueOf()) {
@@ -322,27 +303,24 @@ layout("/mobile/platform.html"){
return return
} }
} }
} else { } else {
if (isMenWomen != null && isMenWomen == 1 && "${@shiro.getPrincipalProperty('sex')}" != '男') { if (isMenWomen != null && isMenWomen == 1 && "${@shiro.getPrincipalProperty('sex')}" != "男") {
this.$toast("此项目只能男性老师才能报名!") this.$toast("此项目只能男性老师才能报名!")
return return
} }
if (isMenWomen != null && isMenWomen == 2 && "${@shiro.getPrincipalProperty('sex')}" != '女') { if (isMenWomen != null && isMenWomen == 2 && "${@shiro.getPrincipalProperty('sex')}" != "女") {
this.$toast("此项目只能女性老师才能报名!") this.$toast("此项目只能女性老师才能报名!")
return return
} }
} }
if (projectType == 2) { if (projectType == 2) {
const {data} = await $.get("/platform/activity/apply/getActivityTeamId", { const { data } = await $.get("/platform/activity/apply/getActivityTeamId", {
activityId: activityId, activityId: activityId,
eventId: eventId eventId: eventId
}) })
this.teams = data this.teams = data
if (data.length && data.length > 0) this.$set(this.formData, "teamId", data[0].id) if (data.length && data.length > 0) this.$set(this.formData, "teamId", data[0].id)
} }
this.activityDialog = true this.activityDialog = true
}, },
@@ -355,7 +333,7 @@ layout("/mobile/platform.html"){
async pageData() { async pageData() {
this.loading = true this.loading = true
const {data} = await $.get('/platform/activity/apply/pageData', this.pageForm) const { data } = await $.get("/platform/activity/apply/pageData", this.pageForm)
setTimeout(() => { setTimeout(() => {
this.tableData = this.tableData.concat(data.list) this.tableData = this.tableData.concat(data.list)
if (this.tableData.length === data.totalCount) { if (this.tableData.length === data.totalCount) {
@@ -366,31 +344,26 @@ layout("/mobile/platform.html"){
this.loading = false this.loading = false
this.pageForm.totalCount = data.totalCount this.pageForm.totalCount = data.totalCount
}, 300) }, 300)
} }
,
}, },
async created() { async created() {
const id = GetQueryString('id') const id = GetQueryString("id")
const applyType = GetQueryString('applyType') const applyType = GetQueryString("applyType")
this.pageForm.activityId = id this.pageForm.activityId = id
this.pageForm.applyType = applyType this.pageForm.applyType = applyType
const data = await $.post("/platform/activity/apply/getEvents", {activityId: id}) const data = await $.post("/platform/activity/apply/getEvents", { activityId: id })
data.forEach(v => { data.forEach((v) => {
this.eventList.push({value: v.eventId, text: v.allName}) this.eventList.push({ value: v.eventId, text: v.allName })
}) })
this.eventList.unshift({value: null, text: "按项目"}) this.eventList.unshift({ value: null, text: "按项目" })
this.$set(this.pageForm, "eventId", this.eventList[0].value) this.$set(this.pageForm, "eventId", this.eventList[0].value)
this.$set(this.pageForm, "isMenWomen", 1) this.$set(this.pageForm, "isMenWomen", 1)
this.$set(this.pageForm, "groupName", null) this.$set(this.pageForm, "groupName", null)
this.$set(this.pageForm, "isAudit", null) this.$set(this.pageForm, "isAudit", null)
} }
}) })
</script> </script>
<!--# <!--#
} }
#--> #-->
@@ -18,14 +18,12 @@ layout("/mobile/platform.html"){
</style> </style>
<div id="app" v-cloak> <div id="app" v-cloak>
<m-page-loading v-if="mLoading"></m-page-loading> <m-page-loading v-if="mLoading"></m-page-loading>
<van-nav-bar title="活动列表" left-arrow placeholder fixed @click-left="history.back()"></van-nav-bar> <van-nav-bar title="活动列表" left-arrow placeholder fixed @click-left="pjaxReplace('/mobile/index')"></van-nav-bar>
<div class="search-fixed"> <div class="search-fixed">
<van-dropdown-menu active-color="#1989fa"> <van-dropdown-menu active-color="#1989fa">
<van-dropdown-item v-model="pageForm.year" :options="yearList" <van-dropdown-item v-model="pageForm.year" :options="yearList" @change="getActivityData"></van-dropdown-item>
@change="getActivityData"></van-dropdown-item> <van-dropdown-item v-model="pageForm.isActivity" :options="activityList" @change="getActivityData"></van-dropdown-item>
<van-dropdown-item v-model="pageForm.isActivity" :options="activityList"
@change="getActivityData"></van-dropdown-item>
</van-dropdown-menu> </van-dropdown-menu>
</div> </div>
@@ -34,27 +32,33 @@ layout("/mobile/platform.html"){
<div v-for="o in tableData" class="list-card" @click="openInfo(o.id,o.applyEndTime,o.applyType)"> <div v-for="o in tableData" class="list-card" @click="openInfo(o.id,o.applyEndTime,o.applyType)">
<van-cell-group inset> <van-cell-group inset>
<van-cell :border="false" title="活动名称"> <van-cell :border="false" title="活动名称">
<span class="van-ellipsis" style="font-size: 16px;" :style="{color:themeColor}"> <span class="van-ellipsis" style="font-size: 16px" :style="{color:themeColor}">{{o.NAME}}</span>
{{o.NAME}}
</span>
</van-cell> </van-cell>
<van-cell :border="false" title="活动地址">{{o.address}}</van-cell> <van-cell :border="false" title="活动地址">{{o.address}}</van-cell>
<van-cell :border="false" title="报名时间"> <van-cell :border="false" title="报名时间">
<span style="font-size: 12px"> <span style="font-size: 12px">
{{moment(o.applyStartTime).format('YYYY/MM/DD HH:mm')}} 至 {{moment(o.applyStartTime).format('YYYY/MM/DD HH:mm')}} 至 {{moment(o.applyEndTime).format('YYYY/MM/DD HH:mm')}}
{{moment(o.applyEndTime).format('YYYY/MM/DD HH:mm')}}
</span> </span>
</van-cell> </van-cell>
<van-cell :border="false" title="活动时间"> <van-cell :border="false" title="活动时间">
<span style="font-size: 12px"> <span style="font-size: 12px">
{{moment(o.startTime).format('YYYY/MM/DD HH:mm')}} 至 {{moment(o.startTime).format('YYYY/MM/DD HH:mm')}} 至 {{moment(o.endTime).format('YYYY/MM/DD HH:mm')}}
{{moment(o.endTime).format('YYYY/MM/DD HH:mm')}}
</span> </span>
</van-cell> </van-cell>
<van-cell :border="false" title="活动状态"> <van-cell :border="false" title="活动状态">
<van-tag type="warning" v-if="moment(o.applyStartTime).valueOf() > moment().valueOf()">未开始</van-tag> <van-tag type="warning" v-if="moment(o.applyStartTime).valueOf() > moment().valueOf()">未开始</van-tag>
<van-tag type="primary" v-else-if="moment(o.applyEndTime).valueOf() > moment().valueOf() && moment().valueOf() > moment(o.applyStartTime).valueOf()">报名中</van-tag> <van-tag
<van-tag type="success" v-else-if="moment(o.startTime).valueOf() < moment().valueOf() && moment().valueOf() < moment(o.endTime).valueOf()">进行中</van-tag> type="primary"
v-else-if="moment(o.applyEndTime).valueOf() > moment().valueOf() && moment().valueOf() > moment(o.applyStartTime).valueOf()"
>
报名中
</van-tag>
<van-tag
type="success"
v-else-if="moment(o.startTime).valueOf() < moment().valueOf() && moment().valueOf() < moment(o.endTime).valueOf()"
>
进行中
</van-tag>
<van-tag type="danger" v-else-if="moment().valueOf() > moment(o.endTime).valueOf()">活动结束</van-tag> <van-tag type="danger" v-else-if="moment().valueOf() > moment(o.endTime).valueOf()">活动结束</van-tag>
</van-cell> </van-cell>
</van-cell-group> </van-cell-group>
@@ -62,27 +66,24 @@ layout("/mobile/platform.html"){
</van-list> </van-list>
</div> </div>
<van-empty v-if="mLoading==false&&tableData.length==0" class="custom-image" image="/none.svg" <van-empty v-if="mLoading==false&&tableData.length==0" class="custom-image" image="/none.svg" description="暂无数据"></van-empty>
description="暂无数据">
</van-empty>
</div> </div>
<script> <script>
const vue = new Vue({ const vue = new Vue({
el: '#app', el: "#app",
mixins: [mobileMixins], mixins: [mobileMixins],
data() { data() {
return { return {
activityList: [ activityList: [
{text: '全部', value: 1}, { text: "全部", value: 1 },
{text: '未开始', value: 5}, { text: "未开始", value: 5 },
{text: '报名中', value: 2}, { text: "报名中", value: 2 },
{text: '进行中', value: 4}, { text: "进行中", value: 4 },
{text: '已结束', value: 3}, { text: "已结束", value: 3 }
], ],
pageForm: { pageForm: {
year: '', year: "",
isActivity: "1" isActivity: "1"
} }
} }
@@ -94,7 +95,7 @@ layout("/mobile/platform.html"){
this.pageData() this.pageData()
}, },
async getActivityData() { async getActivityData() {
const {data} = await $.post("/platform/activity/apply/activityData", { const { data } = await $.post("/platform/activity/apply/activityData", {
year: this.pageForm.year, year: this.pageForm.year,
isActivity: this.pageForm.isActivity isActivity: this.pageForm.isActivity
}) })
@@ -105,7 +106,7 @@ layout("/mobile/platform.html"){
this.$toast("活动已结束,暂不能报名") this.$toast("活动已结束,暂不能报名")
return return
} }
window.location.href = '/mobile/activity/Sports/list/activityEventList?id=' + id + "&applyType=" + applyType window.location.href = "/mobile/activity/Sports/list/activityEventList?id=" + id + "&applyType=" + applyType
} }
}, },
async created() { async created() {
@@ -114,12 +115,10 @@ layout("/mobile/platform.html"){
this.$set(this.pageForm, "isActivity", 1) this.$set(this.pageForm, "isActivity", 1)
await this.getActivityData() await this.getActivityData()
this.mLoading = false this.mLoading = false
} }
}) })
</script> </script>
<!--# <!--#
} }
#--> #-->
@@ -20,20 +20,19 @@ layout("/mobile/platform.html"){
</style> </style>
<div id="app" v-cloak> <div id="app" v-cloak>
<van-nav-bar title="报名详情" left-arrow placeholder fixed <van-nav-bar title="报名详情" left-arrow placeholder fixed @click-left="pjaxReplace('/mobile/index')"></van-nav-bar>
@click-left="history.back()"></van-nav-bar>
<div style="margin: 20px auto 0 auto"> <div style="margin: 20px auto 0 auto">
<div v-for="o in tableData" class="list-card"> <div v-for="o in tableData" class="list-card">
<van-cell-group inset> <van-cell-group inset>
<image class="register-icon" src="/assets/mobile/svg/activity/ybm.svg" <image
@click="openActivity(o)" class="register-icon"
v-if="o.userApply>0&&o.applyWay.includes(1)"></image> src="/assets/mobile/svg/activity/ybm.svg"
@click="openActivity(o)"
v-if="o.userApply>0&&o.applyWay.includes(1)"
></image>
<van-cell :border="false" title="项目名称"> <van-cell :border="false" title="项目名称">
<span class="van-ellipsis" style="font-size: 16px;" <span class="van-ellipsis" style="font-size: 16px" :style="{color:themeColor}">{{o.allName}}</span>
:style="{color:themeColor}">
{{o.allName}}
</span>
</van-cell> </van-cell>
<van-cell :border="false" title="项目类型">{{o.projectType==1?'单项':'团体'}}</van-cell> <van-cell :border="false" title="项目类型">{{o.projectType==1?'单项':'团体'}}</van-cell>
<van-cell :border="false" title="年龄限制" v-if="o.projectType==1"> <van-cell :border="false" title="年龄限制" v-if="o.projectType==1">
@@ -47,7 +46,6 @@ layout("/mobile/platform.html"){
<span v-else-if="o.applyType==2&&o.projectType==1">{{o.athletesMaxNum}}人</span> <span v-else-if="o.applyType==2&&o.projectType==1">{{o.athletesMaxNum}}人</span>
<span v-else-if="o.applyType==2&&o.projectType==2">{{o.restrictGirlNum+o.restrictBoyNum}}人</span> <span v-else-if="o.applyType==2&&o.projectType==2">{{o.restrictGirlNum+o.restrictBoyNum}}人</span>
<span v-else>暂无</span> <span v-else>暂无</span>
</van-cell> </van-cell>
<van-cell :border="false" title="已报名人数"> <van-cell :border="false" title="已报名人数">
<span v-if="o.applyNum>0&&o.applyType!=3">{{o.applyNum}}人</span> <span v-if="o.applyNum>0&&o.applyType!=3">{{o.applyNum}}人</span>
@@ -57,24 +55,22 @@ layout("/mobile/platform.html"){
</van-cell-group> </van-cell-group>
</div> </div>
</div> </div>
</div> </div>
<script> <script>
const vue = new Vue({ const vue = new Vue({
el: '#app', el: "#app",
mixins: [mobileMixins], mixins: [mobileMixins],
data() { data() {
return { return {
activityId: '', activityId: "",
o: {}, o: {},
projectInfo: null projectInfo: null
} }
}, },
methods: { methods: {
async getActivityInfo() { async getActivityInfo() {
const resp = await $.get('/mobile/activity/unionActivity/findOne', {id: this.activityId}) const resp = await $.get("/mobile/activity/unionActivity/findOne", { id: this.activityId })
if (resp.code === 0) { if (resp.code === 0) {
this.o = resp.data this.o = resp.data
this.$nextTick(() => { this.$nextTick(() => {
@@ -83,36 +79,26 @@ layout("/mobile/platform.html"){
} }
}, },
async getSchoolActivityProjectInfoByMine() { async getSchoolActivityProjectInfoByMine() {
const resp = await $.get('/mobile/activity/myActivity/getSchoolActivityProjectInfoByMine', {activityId: this.activityId}) const resp = await $.get("/mobile/activity/myActivity/getSchoolActivityProjectInfoByMine", { activityId: this.activityId })
if (resp.code === 0) { if (resp.code === 0) {
this.projectInfo = resp.data this.projectInfo = resp.data
} }
}, },
async getHasRegEventProject() { async getHasRegEventProject() {
const resp = await $.get('/platform/activity/apply/pageData', this.pageForm) const resp = await $.get("/platform/activity/apply/pageData", this.pageForm)
if (resp.code === 0) { if (resp.code === 0) {
this.tableData = resp.data.list this.tableData = resp.data.list
} }
}, },
async openActivity(o) { async openActivity(o) {
const { const { applyType, eventId, activityId, projectType, userApply, applyNum, name, activityGroupId, restrictRegNumber } = o
applyType,
eventId,
activityId,
projectType,
userApply,
applyNum,
name,
activityGroupId,
restrictRegNumber
} = o
const confirm = await vant.Dialog.confirm({ const confirm = await vant.Dialog.confirm({
title: '提示', title: "提示",
message: '确定取消此次报名吗?', message: "确定取消此次报名吗?"
}) })
if (confirm === 'confirm') { if (confirm === "confirm") {
const loading = this.$toast.loading({ const loading = this.$toast.loading({
message: '取消中...', message: "取消中...",
forbidClick: true, forbidClick: true,
overlay: true, overlay: true,
duration: 0 duration: 0
@@ -124,20 +110,18 @@ layout("/mobile/platform.html"){
}) })
loading.close() loading.close()
if (resp.code === 0) { if (resp.code === 0) {
this.$toast.success('取消成功') this.$toast.success("取消成功")
this.getHasRegEventProject() this.getHasRegEventProject()
} }
} }
} }
}, },
created() { created() {
const id = GetQueryString("id") const id = GetQueryString("id")
if (id) { if (id) {
this.$set(this.pageForm, 'isAudit', 'true') this.$set(this.pageForm, "isAudit", "true")
this.$set(this.pageForm, 'activityId', id) this.$set(this.pageForm, "activityId", id)
this.$set(this.pageForm, 'pageSize', 100) this.$set(this.pageForm, "pageSize", 100)
this.activityId = id this.activityId = id
this.getActivityInfo() this.getActivityInfo()
this.getHasRegEventProject() this.getHasRegEventProject()
@@ -147,4 +131,4 @@ layout("/mobile/platform.html"){
</script> </script>
<!--# <!--#
} }
#--> #-->
@@ -7,7 +7,6 @@ layout("/mobile/platform.html"){
background: #ececec; background: #ececec;
} }
.tips .content { .tips .content {
height: calc(80vh - 49px); height: calc(80vh - 49px);
overflow-y: scroll; overflow-y: scroll;
@@ -15,7 +14,12 @@ layout("/mobile/platform.html"){
/*padding: 5px*/ /*padding: 5px*/
} }
.tips .content h1, h2, h3, h4, h5, h6 { .tips .content h1,
h2,
h3,
h4,
h5,
h6 {
font-weight: unset; font-weight: unset;
margin: 10px; margin: 10px;
} }
@@ -58,7 +62,6 @@ layout("/mobile/platform.html"){
/*border-left: none;*/ /*border-left: none;*/
} }
.table-container table td { .table-container table td {
/*background-color: #f2f2f2;*/ /*background-color: #f2f2f2;*/
} }
@@ -81,180 +84,188 @@ layout("/mobile/platform.html"){
.siteUsageTabs .van-tabs__line { .siteUsageTabs .van-tabs__line {
display: none; display: none;
} }
</style> </style>
<div id="app" v-cloak> <div id="app" v-cloak>
<div> <div>
<van-nav-bar title="场地预约" left-arrow placeholder fixed <van-nav-bar title="场地预约" left-arrow placeholder fixed @click-left="pjaxReplace('/mobile/index')"></van-nav-bar>
@click-left="history.back()"></van-nav-bar>
<div class="van-sidebar-item van-sidebar-item--select" style="margin-top: 10px !important">近一周预约情况</div>
<div class="van-sidebar-item van-sidebar-item--select" style="margin-top: 10px!important;">
近一周预约情况
</div>
<van-tabs v-model="tabActive" class="siteUsageTabs"> <van-tabs v-model="tabActive" class="siteUsageTabs">
<van-tab :title="k" v-for="(v,k) in allSiteUsageInfo" :item="k"> <van-tab :title="k" v-for="(v,k) in allSiteUsageInfo" :item="k">
<template #title> <template #title>
<svg t="1702637676312" class="icon" viewBox="0 0 1111 1024" version="1.1" <svg
xmlns="http://www.w3.org/2000/svg" p-id="7468" width="20" height="20"> t="1702637676312"
<path d="M463.784229 127.356343a9.698743 9.698743 0 0 1-9.713372-9.669486c0-5.3248 4.344686-9.654857 9.713372-9.654857h103.658057c5.339429 0 9.698743 4.330057 9.698743 9.654857 0 5.3248-4.359314 9.654857-9.698743 9.654857h-103.658057z m150.176914 0a9.698743 9.698743 0 0 1-9.713372-9.669486c0-5.3248 4.359314-9.654857 9.713372-9.654857h34.040686c5.354057 0 9.713371 4.330057 9.713371 9.654857 0 5.3248-4.359314 9.654857-9.713371 9.654857H613.961143zM51.243886 36.571429a14.599314 14.599314 0 0 0-14.555429 14.584685v549.653943l3.364572-1.243428c67.978971-25.1904 125.952-66.706286 172.295314-123.406629 71.723886-87.771429 103.892114-197.778286 118.272-274.578286 15.4624-82.7392 14.218971-147.265829 14.160457-149.972114a18.139429 18.139429 0 0 1 3.349943-11.044571l2.735543-3.9936H51.243886z m703.619657 4.008228c2.296686 3.2768 3.466971 7.109486 3.364571 11.044572-0.073143 2.633143-1.579886 65.8432 14.160457 149.942857 14.336 76.8 46.4896 186.748343 118.286629 274.578285 46.928457 57.431771 105.632914 99.240229 174.4896 124.298972 2.048 0.731429 3.949714 1.872457 5.792914 3.4816l4.125257 3.554743V51.170743a14.599314 14.599314 0 0 0-14.555428-14.584686H752.054857l2.779429 4.008229zM36.688457 752.7424c0 8.045714 6.538971 14.584686 14.555429 14.584686h215.508114l0.146286-2.369829a18.578286 18.578286 0 0 1 5.983085-12.682971c51.258514-47.162514 60.298971-119.456914 46.518858-170.174172-4.8128-17.495771-20.3776-60.430629-61.513143-80.866743l-12.551315-6.2464-9.025828 10.708115C185.782857 565.496686 123.318857 609.206857 50.673371 635.611429a18.870857 18.870857 0 0 1-6.436571 1.170285c-1.418971 0-2.779429-0.321829-4.447086-0.731428l-3.101257-0.775315v117.4528z m755.712 14.584686l-3.569371-4.183772c-43.680914-51.156114-59.538286-124.269714-41.428115-190.829714 11.790629-43.344457 37.156571-78.599314 71.402058-99.240229l15.594057-9.376914-9.654857-15.433143a597.825829 597.825829 0 0 1-48.405943-96.241371c-17.759086-44.704914-31.6416-93.622857-41.194057-145.393372-16.325486-88.298057-14.5408-153.365943-14.453029-156.086857 0.117029-3.584 1.2288-7.021714 3.232914-9.991314l2.691657-3.949714H376.290743l2.735543 3.949714c2.048 2.954971 3.1744 6.407314 3.291428 9.976686 0.087771 2.720914 1.872457 67.774171-14.482285 156.086857-9.537829 51.755886-23.405714 100.688457-41.179429 145.408a601.512229 601.512229 0 0 1-48.391314 96.241371l-9.654857 15.433143 15.5648 9.376914c34.230857 20.626286 59.582171 55.851886 71.402057 99.210972 18.154057 66.603886 2.296686 139.717486-41.398857 190.858971l-3.569372 4.183772h481.792z m268.127086 0a14.599314 14.599314 0 0 0 14.555428-14.584686v-124.416l-4.139885 3.627886c-2.530743 2.194286-6.685257 4.827429-12.214857 4.827428a19.017143 19.017143 0 0 1-6.392686-1.141028c-72.630857-26.433829-135.080229-70.158629-185.636572-129.9456l-9.040457-10.708115-12.551314 6.2464c-41.150171 20.450743-56.700343 63.370971-61.483886 80.881372-13.809371 50.702629-4.783543 122.997029 46.533486 170.159543 3.569371 3.262171 5.690514 7.767771 5.968457 12.668343l0.146286 2.384457h224.256zM51.243886 803.913143A51.273143 51.273143 0 0 1 0 752.7424V51.170743A51.273143 51.273143 0 0 1 51.243886 0h1009.283657A51.273143 51.273143 0 0 1 1111.771429 51.170743v701.571657a51.273143 51.273143 0 0 1-51.243886 51.170743H51.243886z m-6.977829 105.003886a18.768457 18.768457 0 0 1-18.768457-18.724572c0-10.327771 8.426057-18.724571 18.768457-18.724571h234.8032c10.3424 0 18.768457 8.3968 18.768457 18.724571 0 10.313143-8.426057 18.724571-18.768457 18.724572H44.266057z m394.210743 0a18.768457 18.768457 0 0 1-18.753829-18.724572c0-10.327771 8.411429-18.724571 18.753829-18.724571h234.832457c10.3424 0 18.753829 8.3968 18.753829 18.724571 0 10.313143-8.411429 18.724571-18.753829 18.724572H438.4768z m394.210743 0a18.753829 18.753829 0 0 1-18.753829-18.724572c0-10.327771 8.411429-18.724571 18.753829-18.724571h234.832457c10.3424 0 18.753829 8.3968 18.753829 18.724571 0 10.313143-8.411429 18.724571-18.753829 18.724572H832.687543zM236.982857 1024a18.768457 18.768457 0 0 1-18.768457-18.724571c0-10.313143 8.426057-18.724571 18.768457-18.724572h234.832457c10.3424 0 18.768457 8.411429 18.768457 18.724572 0 10.327771-8.426057 18.724571-18.768457 18.724571H236.982857z m394.210743 0a18.753829 18.753829 0 0 1-18.753829-18.724571c0-10.313143 8.411429-18.724571 18.753829-18.724572H866.011429c10.3424 0 18.753829 8.411429 18.753828 18.724572 0 10.327771-8.411429 18.724571-18.753828 18.724571H631.1936z" class="icon"
fill="#44BBE0" p-id="7469"></path> viewBox="0 0 1111 1024"
version="1.1"
xmlns="http://www.w3.org/2000/svg"
p-id="7468"
width="20"
height="20"
>
<path
d="M463.784229 127.356343a9.698743 9.698743 0 0 1-9.713372-9.669486c0-5.3248 4.344686-9.654857 9.713372-9.654857h103.658057c5.339429 0 9.698743 4.330057 9.698743 9.654857 0 5.3248-4.359314 9.654857-9.698743 9.654857h-103.658057z m150.176914 0a9.698743 9.698743 0 0 1-9.713372-9.669486c0-5.3248 4.359314-9.654857 9.713372-9.654857h34.040686c5.354057 0 9.713371 4.330057 9.713371 9.654857 0 5.3248-4.359314 9.654857-9.713371 9.654857H613.961143zM51.243886 36.571429a14.599314 14.599314 0 0 0-14.555429 14.584685v549.653943l3.364572-1.243428c67.978971-25.1904 125.952-66.706286 172.295314-123.406629 71.723886-87.771429 103.892114-197.778286 118.272-274.578286 15.4624-82.7392 14.218971-147.265829 14.160457-149.972114a18.139429 18.139429 0 0 1 3.349943-11.044571l2.735543-3.9936H51.243886z m703.619657 4.008228c2.296686 3.2768 3.466971 7.109486 3.364571 11.044572-0.073143 2.633143-1.579886 65.8432 14.160457 149.942857 14.336 76.8 46.4896 186.748343 118.286629 274.578285 46.928457 57.431771 105.632914 99.240229 174.4896 124.298972 2.048 0.731429 3.949714 1.872457 5.792914 3.4816l4.125257 3.554743V51.170743a14.599314 14.599314 0 0 0-14.555428-14.584686H752.054857l2.779429 4.008229zM36.688457 752.7424c0 8.045714 6.538971 14.584686 14.555429 14.584686h215.508114l0.146286-2.369829a18.578286 18.578286 0 0 1 5.983085-12.682971c51.258514-47.162514 60.298971-119.456914 46.518858-170.174172-4.8128-17.495771-20.3776-60.430629-61.513143-80.866743l-12.551315-6.2464-9.025828 10.708115C185.782857 565.496686 123.318857 609.206857 50.673371 635.611429a18.870857 18.870857 0 0 1-6.436571 1.170285c-1.418971 0-2.779429-0.321829-4.447086-0.731428l-3.101257-0.775315v117.4528z m755.712 14.584686l-3.569371-4.183772c-43.680914-51.156114-59.538286-124.269714-41.428115-190.829714 11.790629-43.344457 37.156571-78.599314 71.402058-99.240229l15.594057-9.376914-9.654857-15.433143a597.825829 597.825829 0 0 1-48.405943-96.241371c-17.759086-44.704914-31.6416-93.622857-41.194057-145.393372-16.325486-88.298057-14.5408-153.365943-14.453029-156.086857 0.117029-3.584 1.2288-7.021714 3.232914-9.991314l2.691657-3.949714H376.290743l2.735543 3.949714c2.048 2.954971 3.1744 6.407314 3.291428 9.976686 0.087771 2.720914 1.872457 67.774171-14.482285 156.086857-9.537829 51.755886-23.405714 100.688457-41.179429 145.408a601.512229 601.512229 0 0 1-48.391314 96.241371l-9.654857 15.433143 15.5648 9.376914c34.230857 20.626286 59.582171 55.851886 71.402057 99.210972 18.154057 66.603886 2.296686 139.717486-41.398857 190.858971l-3.569372 4.183772h481.792z m268.127086 0a14.599314 14.599314 0 0 0 14.555428-14.584686v-124.416l-4.139885 3.627886c-2.530743 2.194286-6.685257 4.827429-12.214857 4.827428a19.017143 19.017143 0 0 1-6.392686-1.141028c-72.630857-26.433829-135.080229-70.158629-185.636572-129.9456l-9.040457-10.708115-12.551314 6.2464c-41.150171 20.450743-56.700343 63.370971-61.483886 80.881372-13.809371 50.702629-4.783543 122.997029 46.533486 170.159543 3.569371 3.262171 5.690514 7.767771 5.968457 12.668343l0.146286 2.384457h224.256zM51.243886 803.913143A51.273143 51.273143 0 0 1 0 752.7424V51.170743A51.273143 51.273143 0 0 1 51.243886 0h1009.283657A51.273143 51.273143 0 0 1 1111.771429 51.170743v701.571657a51.273143 51.273143 0 0 1-51.243886 51.170743H51.243886z m-6.977829 105.003886a18.768457 18.768457 0 0 1-18.768457-18.724572c0-10.327771 8.426057-18.724571 18.768457-18.724571h234.8032c10.3424 0 18.768457 8.3968 18.768457 18.724571 0 10.313143-8.426057 18.724571-18.768457 18.724572H44.266057z m394.210743 0a18.768457 18.768457 0 0 1-18.753829-18.724572c0-10.327771 8.411429-18.724571 18.753829-18.724571h234.832457c10.3424 0 18.753829 8.3968 18.753829 18.724571 0 10.313143-8.411429 18.724571-18.753829 18.724572H438.4768z m394.210743 0a18.753829 18.753829 0 0 1-18.753829-18.724572c0-10.327771 8.411429-18.724571 18.753829-18.724571h234.832457c10.3424 0 18.753829 8.3968 18.753829 18.724571 0 10.313143-8.411429 18.724571-18.753829 18.724572H832.687543zM236.982857 1024a18.768457 18.768457 0 0 1-18.768457-18.724571c0-10.313143 8.426057-18.724571 18.768457-18.724572h234.832457c10.3424 0 18.768457 8.411429 18.768457 18.724572 0 10.327771-8.426057 18.724571-18.768457 18.724571H236.982857z m394.210743 0a18.753829 18.753829 0 0 1-18.753829-18.724571c0-10.313143 8.411429-18.724571 18.753829-18.724572H866.011429c10.3424 0 18.753829 8.411429 18.753828 18.724572 0 10.327771-8.411429 18.724571-18.753828 18.724571H631.1936z"
fill="#44BBE0"
p-id="7469"
></path>
</svg> </svg>
{{k}} {{k}}
</template> </template>
<div class="table-container"> <div class="table-container">
<table> <table>
<thead> <thead>
<tr> <tr>
<td>开始时间</td> <td>开始时间</td>
<td>结束时间</td> <td>结束时间</td>
<td>联系人</td> <td>联系人</td>
<td>联系人部门</td> <td>联系人部门</td>
<td>活动名称</td> <td>活动名称</td>
<td>活动性质</td> <td>活动性质</td>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr v-for="item in v" :key="item.id"> <tr v-for="item in v" :key="item.id">
<td>{{item.reserve_start_time}}</td> <td>{{item.reserve_start_time}}</td>
<td>{{item.reserve_end_time}}</td> <td>{{item.reserve_end_time}}</td>
<td>{{item.reserve_person_username}}</td> <td>{{item.reserve_person_username}}</td>
<td>{{item.reserve_person_unitname}}</td> <td>{{item.reserve_person_unitname}}</td>
<td>{{item.reserve_activity}}</td> <td>{{item.reserve_activity}}</td>
<td>{{item.activity_nature}}</td> <td>{{item.activity_nature}}</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</div> </div>
</van-tab> </van-tab>
</van-tabs> </van-tabs>
<div class="van-sidebar-item van-sidebar-item--select" style="margin-top: 10px!important;"> <div class="van-sidebar-item van-sidebar-item--select" style="margin-top: 10px !important">填写预约信息</div>
填写预约信息
</div>
<van-form @submit="onSubmit"> <van-form @submit="onSubmit">
<van-cell-group class=""> <van-cell-group class="">
<van-field v-model="formData.reserve_activity" <van-field
name="reserve_activity" v-model="formData.reserve_activity"
rows="1" name="reserve_activity"
autosize rows="1"
type="textarea" autosize
:rules="[{ required: true, message: '请填写' }]" type="textarea"
placeholder="请填写活动名称" :rules="[{ required: true, message: '请填写' }]"
required placeholder="请填写活动名称"
label="活动名称"></van-field> required
label="活动名称"
></van-field>
<van-field readonly <van-field
clickable readonly
name="activity_nature" clickable
:value="formData.activity_nature" name="activity_nature"
label="活动性质" :value="formData.activity_nature"
placeholder="点击选择活动性质" label="活动性质"
:rules="[{ required: true, message: '请选择' }]" placeholder="点击选择活动性质"
required :rules="[{ required: true, message: '请选择' }]"
@click="showSiteNaturePicker = true" required
> @click="showSiteNaturePicker = true"
</van-field> ></van-field>
<van-field v-model="formData.reserve_join_user_num" <van-field
name="reserve_join_user_num" v-model="formData.reserve_join_user_num"
rows="1" name="reserve_join_user_num"
autosize rows="1"
type="textarea" autosize
:rules="[{ required: true, message: '请填写' }]" type="textarea"
placeholder="请填写活动人数" :rules="[{ required: true, message: '请填写' }]"
required placeholder="请填写活动人数"
label="活动人数"></van-field> required
label="活动人数"
></van-field>
<van-field
v-model="formData.site_responsible_person"
name="site_responsible_person"
rows="1"
autosize
type="textarea"
:rules="[{ required: true, message: '请填写' }]"
placeholder="请填写活动现场负责人"
required
label="现场负责人"
></van-field>
<van-field v-model="formData.site_responsible_person" <van-field readonly :value="formData.reserve_person_username" name="reserve_person_username" label="联系人"></van-field>
name="site_responsible_person" <van-field readonly :value="formData.reserve_person_loginname" name="reserve_person_loginname" label="联系人工号"></van-field>
rows="1" <van-field readonly :value="formData.reserve_person_sex" name="reserve_person_sex" label="联系人性别"></van-field>
autosize <van-field readonly :value="formData.reserve_person_phone" name="reserve_person_phone" label="联系电话"></van-field>
type="textarea" <van-field readonly :value="formData.reserve_person_unitname" name="reserve_person_unitname" label="申请部门"></van-field>
:rules="[{ required: true, message: '请填写' }]" <van-field readonly :value="formData.reserve_person_unionname" name="reserve_person_unionname" label="申请工会"></van-field>
placeholder="请填写活动现场负责人"
required
label="现场负责人"></van-field>
<van-field
readonly
clickable
name="site_name"
:value="formData.site_name"
label="预约场地"
placeholder="点击选择预约场地"
:rules="[{ required: true, message: '请选择' }]"
required
@click="showSitePicker = true"
></van-field>
<van-field readonly :value="formData.reserve_person_username" name="reserve_person_username" <van-field
label="联系人"></van-field> readonly
<van-field readonly :value="formData.reserve_person_loginname" name="reserve_person_loginname" clickable
label="联系人工号"></van-field> name="selectList"
<van-field readonly :value="formData.reserve_person_sex" name="reserve_person_sex" :value="selectList"
label="联系人性别"></van-field> label="使用设备"
<van-field readonly :value="formData.reserve_person_phone" name="reserve_person_phone" placeholder="点击选择使用设备"
label="联系电话"></van-field> @click="showSiteEquipmentPicker = true"
<van-field readonly :value="formData.reserve_person_unitname" name="reserve_person_unitname" ></van-field>
label="申请部门"></van-field>
<van-field readonly :value="formData.reserve_person_unionname" name="reserve_person_unionname"
label="申请工会"></van-field>
<van-field readonly <van-field
clickable readonly
name="site_name" clickable
:value="formData.site_name" label="预约开始时间"
label="预约场地" :value="formData.reserve_start_time"
placeholder="点击选择预约场地" name="reserve_start_time"
:rules="[{ required: true, message: '请选择' }]" :rules="[{ required: true, message: '请选择' }]"
required placeholder="请选择预约开始时间"
@click="showSitePicker = true" required
> @click="startTimePicker = true"
</van-field> ></van-field>
<van-field
readonly
clickable
label="预约结束时间"
:value="formData.reserve_end_time"
name="reserve_end_time"
:rules="[{ required: true, message: '请选择' }]"
placeholder="请选择预约结束时间"
required
@click="endTimePicker = true"
></van-field>
<van-field readonly <van-field
clickable v-model="formData.banner_slogans"
name="selectList" name="banner_slogans"
:value="selectList" rows="2"
label="使用设备" autosize
placeholder="点击选择使用设备" type="textarea"
@click="showSiteEquipmentPicker = true" placeholder="请填写横幅标语内容"
> label="是否有横幅标语"
</van-field> ></van-field>
<van-field
<van-field readonly clickable v-model="formData.off_campus_personnel"
label="预约开始时间" name="off_campus_personnel"
:value="formData.reserve_start_time" rows="3"
name="reserve_start_time" autosize
:rules="[{ required: true, message: '请选择' }]" type="textarea"
placeholder="请选择预约开始时间" placeholder="请在此注明参加的校外人员"
required label="是否有校外人员参加"
@click="startTimePicker = true"> ></van-field>
</van-field>
<van-field readonly clickable
label="预约结束时间"
:value="formData.reserve_end_time"
name="reserve_end_time"
:rules="[{ required: true, message: '请选择' }]"
placeholder="请选择预约结束时间"
required
@click="endTimePicker = true">
</van-field>
<van-field v-model="formData.banner_slogans"
name="banner_slogans"
rows="2"
autosize
type="textarea"
placeholder="请填写横幅标语内容"
label="是否有横幅标语"></van-field>
<van-field v-model="formData.off_campus_personnel"
name="off_campus_personnel"
rows="3"
autosize
type="textarea"
placeholder="请在此注明参加的校外人员"
label="是否有校外人员参加"></van-field>
</van-cell-group> </van-cell-group>
<div style="margin: 16px;"> <div style="margin: 16px">
<van-button round block type="info" native-type="submit">提交</van-button> <van-button round block type="info" native-type="submit">提交</van-button>
</div> </div>
</van-form> </van-form>
<!--<van-popup v-model="showTips" :style="{ height: '80%',width:'90%' }" round> <!--<van-popup v-model="showTips" :style="{ height: '80%',width:'90%' }" round>
@@ -320,33 +331,28 @@ layout("/mobile/platform.html"){
</van-popup>--> </van-popup>-->
<van-popup v-model="startTimePicker" position="bottom"> <van-popup v-model="startTimePicker" position="bottom">
<van-datetime-picker <van-datetime-picker
v-model="startTime" v-model="startTime"
type="datetime" type="datetime"
title="选择预约开始时间" title="选择预约开始时间"
@confirm="onStartTimeConfirm" @confirm="onStartTimeConfirm"
@cancel="startTimePicker = false" @cancel="startTimePicker = false"
:min-date="startMinDate" :min-date="startMinDate"
></van-datetime-picker> ></van-datetime-picker>
</van-popup> </van-popup>
<van-popup v-model="endTimePicker" position="bottom"> <van-popup v-model="endTimePicker" position="bottom">
<van-datetime-picker <van-datetime-picker
v-model="endTime" v-model="endTime"
type="datetime" type="datetime"
title="选择预约结束时间" title="选择预约结束时间"
@confirm="onEndTimeConfirm" @confirm="onEndTimeConfirm"
@cancel="endTimePicker = false" @cancel="endTimePicker = false"
:min-date="endMinDate" :min-date="endMinDate"
></van-datetime-picker> ></van-datetime-picker>
</van-popup> </van-popup>
<van-popup v-model="showSitePicker" position="bottom"> <van-popup v-model="showSitePicker" position="bottom">
<van-picker <van-picker title="请选择需要预约的场地" show-toolbar :columns="siteColumns" @confirm="onSiteConfirm" @cancel="showSitePicker = false">
title="请选择需要预约的场地"
show-toolbar
:columns="siteColumns"
@confirm="onSiteConfirm"
@cancel="showSitePicker = false">
<template #option="option"> <template #option="option">
<div style="display: flex; flex-direction: column; align-items: center;"> <div style="display: flex; flex-direction: column; align-items: center">
<div>{{ option.name }}</div> <div>{{ option.name }}</div>
</div> </div>
</template> </template>
@@ -354,37 +360,37 @@ layout("/mobile/platform.html"){
</van-popup> </van-popup>
<van-popup v-model="showSiteNaturePicker" position="bottom"> <van-popup v-model="showSiteNaturePicker" position="bottom">
<van-picker <van-picker
title="请选择活动性质" title="请选择活动性质"
show-toolbar show-toolbar
:columns="siteNatureColumns" :columns="siteNatureColumns"
@confirm="onsiteNatureConfirm" @confirm="onsiteNatureConfirm"
@cancel="showSiteNaturePicker = false"> @cancel="showSiteNaturePicker = false"
>
<template #option="option"> <template #option="option">
<div style="display: flex; flex-direction: column; align-items: center;"> <div style="display: flex; flex-direction: column; align-items: center">
<div>{{ option.name }}</div> <div>{{ option.name }}</div>
</div> </div>
</template> </template>
</van-picker> </van-picker>
</van-popup> </van-popup>
<!-- <van-popup v-model="showSiteEquipmentPicker" position="bottom">--> <!-- <van-popup v-model="showSiteEquipmentPicker" position="bottom">-->
<!-- <van-picker--> <!-- <van-picker-->
<!-- title="请选择使用设备"--> <!-- title="请选择使用设备"-->
<!-- show-toolbar--> <!-- show-toolbar-->
<!-- :columns="siteEquipmentColumns"--> <!-- :columns="siteEquipmentColumns"-->
<!-- @confirm="onsiteEquipmentConfirm"--> <!-- @confirm="onsiteEquipmentConfirm"-->
<!-- @cancel="showSiteEquipmentPicker = false">--> <!-- @cancel="showSiteEquipmentPicker = false">-->
<!-- <template #option="option">--> <!-- <template #option="option">-->
<!-- <div style="display: flex; flex-direction: column; align-items: center;">--> <!-- <div style="display: flex; flex-direction: column; align-items: center;">-->
<!-- <div>{{ option.name }}</div>--> <!-- <div>{{ option.name }}</div>-->
<!-- </div>--> <!-- </div>-->
<!-- </template>--> <!-- </template>-->
<!-- </van-picker>--> <!-- </van-picker>-->
<!-- </van-popup>--> <!-- </van-popup>-->
<van-popup v-model="showSiteEquipmentPicker" position="bottom" :style="{ height: '50%' }"> <van-popup v-model="showSiteEquipmentPicker" position="bottom" :style="{ height: '50%' }">
<div style="display: flex;justify-content: space-between;height: 44px;line-height: 44px;"> <div style="display: flex; justify-content: space-between; height: 44px; line-height: 44px">
<van-button style="border: none; color: #969799" @click="showSiteEquipmentPicker = false" size="normal">取消</van-button> <van-button style="border: none; color: #969799" @click="showSiteEquipmentPicker = false" size="normal">取消</van-button>
<div style="border: none; color: #000" size="normal">确认</div> <div style="border: none; color: #000" size="normal">确认</div>
<van-button style="border: none; color: #6398fb" @click="checkedChange" size="normal">确认</van-button> <van-button style="border: none; color: #6398fb" @click="checkedChange" size="normal">确认</van-button>
@@ -402,7 +408,7 @@ layout("/mobile/platform.html"){
<script> <script>
const vue = new Vue({ const vue = new Vue({
el: '#app', el: "#app",
mixins: [mobileMixins], mixins: [mobileMixins],
data() { data() {
return { return {
@@ -416,156 +422,155 @@ layout("/mobile/platform.html"){
startTime: null, startTime: null,
endTime: null, endTime: null,
siteColumns: [], siteColumns: [],
siteNatureColumns:[{name:'测试',id:'测试'}], siteNatureColumns: [{ name: "测试", id: "测试" }],
siteEquipmentColumns:[], siteEquipmentColumns: [],
showSiteUsage: false, showSiteUsage: false,
allSiteUsageInfo: {}, allSiteUsageInfo: {},
tabActive: null, tabActive: null,
startMinDate: moment().add(2, 'days').toDate(), startMinDate: moment().add(2, "days").toDate(),
endMinDate: moment().add(2, 'days').add(30, 'minute').toDate(), endMinDate: moment().add(2, "days").add(30, "minute").toDate(),
selectList:[], selectList: [],
selectEquipmentList:[] selectEquipmentList: []
// endMaxDate: moment().add(2, 'days').toDate() // endMaxDate: moment().add(2, 'days').toDate()
} }
}, },
methods: { methods: {
checkedChange(){ checkedChange() {
this.selectList = this.selectEquipmentList.map(v=>{return v.equipmentName}) this.selectList = this.selectEquipmentList.map((v) => {
this.formData.equipment_ids = this.selectEquipmentList.map(v=> {return v.id}) return v.equipmentName
})
this.formData.equipment_ids = this.selectEquipmentList.map((v) => {
return v.id
})
this.showSiteEquipmentPicker = false this.showSiteEquipmentPicker = false
}, },
async onSubmit(values) { async onSubmit(values) {
console.log(this.formData) console.log(this.formData)
const resp = await $.get('/platform/activity/site/apply/checkApplyTime', { const resp = await $.get("/platform/activity/site/apply/checkApplyTime", {
time: this.formData.reserve_start_time, time: this.formData.reserve_start_time,
endTime: this.formData.reserve_end_time, endTime: this.formData.reserve_end_time,
siteId: this.formData.site_id siteId: this.formData.site_id
}) })
if (resp.code === 1) { if (resp.code === 1) {
this.$toast(resp.msg) this.$toast(resp.msg)
this.formData.reserve_start_time = '' this.formData.reserve_start_time = ""
this.formData.reserve_end_time = '' this.formData.reserve_end_time = ""
return return
} }
const {site_name, reserve_start_time, reserve_end_time} = this.formData const { site_name, reserve_start_time, reserve_end_time } = this.formData
this.$dialog.confirm({ this.$dialog
title: '提示', .confirm({
message: '您确定要提交' + site_name + '\n' + reserve_start_time + "\n至\n" + reserve_end_time + '\n的预约吗?', title: "提示",
}).then(async () => { message: "您确定要提交" + site_name + "\n" + reserve_start_time + "\n至\n" + reserve_end_time + "\n的预约吗?"
const loading = this.$toast.loading({ })
message: '提交中...', .then(async () => {
forbidClick: true, const loading = this.$toast.loading({
}); message: "提交中...",
const { forbidClick: true
data, })
code, const { data, code, msg } = await $.post("/platform/activity/site/apply/insert", {
msg siteReserve: JSON.stringify(this.formData)
} = await $.post('/platform/activity/site/apply/insert', {"siteReserve": JSON.stringify(this.formData)}) })
loading.clear() loading.clear()
if (code === 0) { if (code === 0) {
this.$toast.success(msg) this.$toast.success(msg)
setTimeout(() => { setTimeout(() => {
location.href = '/mobile/activity/site/mine' location.href = "/mobile/activity/site/mine"
}, 500) }, 500)
} else { } else {
this.$toast.fail(msg) this.$toast.fail(msg)
} }
}).catch(() => { })
}) .catch(() => {})
}, },
onStartTimeConfirm(time) { onStartTimeConfirm(time) {
const hours = time.getHours(); const hours = time.getHours()
const minutes = time.getMinutes(); const minutes = time.getMinutes()
const day = time.getDay() const day = time.getDay()
if (day === 0 || day === 6) { if (day === 0 || day === 6) {
this.$toast('周六周日预约不了喔') this.$toast("周六周日预约不了喔")
return return
} }
if (hours < 8 || (hours === 8 && minutes < 30)) { if (hours < 8 || (hours === 8 && minutes < 30)) {
this.$toast('请预约上午8点半之后的时间') this.$toast("请预约上午8点半之后的时间")
return return
} }
this.formData.reserve_start_time = moment(time).format('YYYY-MM-DD HH:mm:ss'); this.formData.reserve_start_time = moment(time).format("YYYY-MM-DD HH:mm:ss")
this.startTimePicker = false; this.startTimePicker = false
}, },
onEndTimeConfirm(time) { onEndTimeConfirm(time) {
if (!this.formData.reserve_start_time) { if (!this.formData.reserve_start_time) {
this.$toast('请先选择预约开始时间') this.$toast("请先选择预约开始时间")
return return
} }
const day = time.getDay() const day = time.getDay()
const hours = time.getHours(); const hours = time.getHours()
const minutes = time.getMinutes(); const minutes = time.getMinutes()
if (day === 0 || day === 6) { if (day === 0 || day === 6) {
this.$toast('周六周日预约不了喔') this.$toast("周六周日预约不了喔")
return return
} }
if (hours > 17 || (hours >= 17 && minutes > 0)) { if (hours > 17 || (hours >= 17 && minutes > 0)) {
this.$toast('结束时间不能超过下午5点') this.$toast("结束时间不能超过下午5点")
return return
} }
const isSameDay = moment(this.formData.reserve_start_time).isSame(moment(time), 'day') const isSameDay = moment(this.formData.reserve_start_time).isSame(moment(time), "day")
if (!isSameDay) { if (!isSameDay) {
this.$toast('不能跨天预约喔') this.$toast("不能跨天预约喔")
return return
} }
this.formData.reserve_end_time = moment(time).format('YYYY-MM-DD HH:mm:ss'); this.formData.reserve_end_time = moment(time).format("YYYY-MM-DD HH:mm:ss")
this.endTimePicker = false; this.endTimePicker = false
}, },
onSiteConfirm(value, index) { onSiteConfirm(value, index) {
this.$set(this.formData, 'site_name', value.name) this.$set(this.formData, "site_name", value.name)
this.$set(this.formData, 'site_id', value.id) this.$set(this.formData, "site_id", value.id)
this.showSitePicker = false this.showSitePicker = false
this.listSiteEquipment(value.id) this.listSiteEquipment(value.id)
}, },
async listSite() { async listSite() {
const {data} = await $.get(loc() + '/listSite') const { data } = await $.get(loc() + "/listSite")
this.siteColumns = data this.siteColumns = data
}, },
onsiteNatureConfirm(value, index){ onsiteNatureConfirm(value, index) {
this.$set(this.formData, 'activity_nature', value.name) this.$set(this.formData, "activity_nature", value.name)
// this.$set(this.formData, 'site_id', value.id) // this.$set(this.formData, 'site_id', value.id)
this.showSiteNaturePicker = false this.showSiteNaturePicker = false
}, },
async listSiteNature(){ async listSiteNature() {},
onsiteEquipmentConfirm(value, index) {},
}, async listSiteEquipment(siteId) {
onsiteEquipmentConfirm(value, index){ const { data } = await $.get("/platform/activity/site/apply/getSiteEquipmentList", { siteId: siteId })
},
async listSiteEquipment(siteId){
const {data} = await $.get('/platform/activity/site/apply/getSiteEquipmentList',{siteId:siteId})
this.siteEquipmentColumns = data this.siteEquipmentColumns = data
}, },
async applyUserInfo() { async applyUserInfo() {
const {data} = await $.get('/platform/activity/site/apply/applyUserInfo') const { data } = await $.get("/platform/activity/site/apply/applyUserInfo")
this.$set(this.formData, 'reserve_person_id', data.reserve_person_id) this.$set(this.formData, "reserve_person_id", data.reserve_person_id)
this.$set(this.formData, 'reserve_person_username', data.reserve_person_username) this.$set(this.formData, "reserve_person_username", data.reserve_person_username)
this.$set(this.formData, 'reserve_person_loginname', data.reserve_person_loginname) this.$set(this.formData, "reserve_person_loginname", data.reserve_person_loginname)
this.$set(this.formData, 'reserve_person_sex', data.reserve_person_sex) this.$set(this.formData, "reserve_person_sex", data.reserve_person_sex)
this.$set(this.formData, 'reserve_person_phone', data.reserve_person_phone) this.$set(this.formData, "reserve_person_phone", data.reserve_person_phone)
this.$set(this.formData, 'reserve_person_unitname', data.reserve_person_unitname) this.$set(this.formData, "reserve_person_unitname", data.reserve_person_unitname)
this.$set(this.formData, 'reserve_person_unionname', data.reserve_person_unionname) this.$set(this.formData, "reserve_person_unionname", data.reserve_person_unionname)
this.$set(this.formData, 'reserve_person_unionid', data.reserve_person_unionid) this.$set(this.formData, "reserve_person_unionid", data.reserve_person_unionid)
}, },
async init() { async init() {
const id = GetQueryString('id') const id = GetQueryString("id")
if (id) { if (id) {
} else { } else {
await this.applyUserInfo() await this.applyUserInfo()
} }
}, },
async allSiteUsage() { async allSiteUsage() {
const {data} = await $.get('/platform/activity/site/apply/allSiteUsage') const { data } = await $.get("/platform/activity/site/apply/allSiteUsage")
this.allSiteUsageInfo = data this.allSiteUsageInfo = data
} }
}, },
@@ -3,8 +3,8 @@ layout("/mobile/platform.html"){
#--> #-->
<style> <style>
.van-hairline--top-bottom::after,
.van-hairline--top-bottom::after, .van-hairline-unset--top-bottom::after { .van-hairline-unset--top-bottom::after {
border: 0; border: 0;
} }
@@ -185,48 +185,32 @@ layout("/mobile/platform.html"){
</style> </style>
<div id="app" v-cloak> <div id="app" v-cloak>
<m-page-loading v-if="mLoading"></m-page-loading> <m-page-loading v-if="mLoading"></m-page-loading>
<!--top栏--> <!--top栏-->
<van-nav-bar <van-nav-bar title="场地预约审核" left-arrow placeholder fixed @click-left="pjaxReplace('/mobile/index')" safe-area-inset-top></van-nav-bar>
title="场地预约审核"
left-arrow
placeholder
fixed
@click-left="history.go(-1)"
safe-area-inset-top
></van-nav-bar>
<!--筛选框--> <!--筛选框-->
<div class="search-fixed"> <div class="search-fixed">
<van-search <van-search
v-model="pageForm.searchKeyword" v-model="pageForm.searchKeyword"
shape="round" shape="round"
maxlength="10" maxlength="10"
@search="doSearch" @search="doSearch"
placeholder="请输入场地名称、场地地点进行查询" placeholder="请输入场地名称、场地地点进行查询"
> ></van-search>
</van-search>
<van-dropdown-menu> <van-dropdown-menu>
<!--<van-dropdown-item v-model="pageForm.meetingTime" :options="meetingTimeList" <!--<van-dropdown-item v-model="pageForm.meetingTime" :options="meetingTimeList"
@change="doSearch"></van-dropdown-item>--> @change="doSearch"></van-dropdown-item>-->
<van-dropdown-item v-model="pageForm.typeId" :options="typeList" <van-dropdown-item v-model="pageForm.typeId" :options="typeList" @change="doSearch"></van-dropdown-item>
@change="doSearch"></van-dropdown-item>
</van-dropdown-menu> </van-dropdown-menu>
</div> </div>
<!--列表--> <!--列表-->
<div style="margin-top: 116px"> <div style="margin-top: 116px">
<van-list <van-list v-model="loading" :finished="finished" :immediate-check="false" :finished-text="tableData.length>0?'没有更多了':''" @load="onLoad">
v-model="loading"
:finished="finished" :immediate-check="false"
:finished-text="tableData.length>0?'没有更多了':''"
@load="onLoad">
<div class="van-doc-card" v-for="o in tableData"> <div class="van-doc-card" v-for="o in tableData">
<div @click="openView(o.id, o.modulename)"> <div @click="openView(o.id, o.modulename)">
<div style="display: flex; justify-content: space-between"> <div style="display: flex; justify-content: space-between">
<div style="width: 74%"> <div style="width: 74%">
<div class="van-ellipsis title"> <div class="van-ellipsis title">
@@ -235,21 +219,23 @@ layout("/mobile/platform.html"){
</div> </div>
<div style="color: grey">{{o.address}}</div> <div style="color: grey">{{o.address}}</div>
</div> </div>
<div style="color: #1867b0;"> <div style="color: #1867b0">{{o.meetingtypename}}</div>
{{o.meetingtypename}}
</div>
</div> </div>
<van-divider></van-divider> <van-divider></van-divider>
<div style="margin-top: 10px"> <div style="margin-top: 10px">
<van-row> <van-row>
<van-col span="12"><span style="color: grey">&emsp;联系人:</span>{{o.unitname ? (o.unitname + <van-col span="12">
'') : '' + '' + o.contact_person}} <span style="color: grey">&emsp;联系人:</span>
{{o.unitname ? (o.unitname + '') : '' + '' + o.contact_person}}
</van-col> </van-col>
</van-row> </van-row>
<van-row> <van-row>
<van-col span="12"><span style="color: grey">联系方式:</span>{{o.contact_phone}}</van-col> <van-col span="12">
<span style="color: grey">联系方式:</span>
{{o.contact_phone}}
</van-col>
</van-row> </van-row>
</div> </div>
@@ -263,25 +249,32 @@ layout("/mobile/platform.html"){
<div style="display: flex; justify-content: flex-end; margin-top: 4px"> <div style="display: flex; justify-content: flex-end; margin-top: 4px">
<div> <div>
<van-button @click.stop="getAuditList(o)" class="cus_button" <van-button
type="primary" size="small" color="#1867b0" @click.stop="getAuditList(o)"
style="margin-right: 8px; width: auto;">已审{{o.audit}} class="cus_button"
type="primary"
size="small"
color="#1867b0"
style="margin-right: 8px; width: auto"
>
已审{{o.audit}}
</van-button> </van-button>
<van-button @click.stop="openView(o.id, o.modulename)" class="cus_button" <van-button
type="primary" size="small" color="#1867b0" @click.stop="openView(o.id, o.modulename)"
style="margin-right: 8px; width: auto;">未审{{o.no_audit}} class="cus_button"
type="primary"
size="small"
color="#1867b0"
style="margin-right: 8px; width: auto"
>
未审{{o.no_audit}}
</van-button> </van-button>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</van-list> </van-list>
<van-empty <van-empty v-if="mLoading==false&&tableData.length==0" class="custom-image" image="/none.svg" description="暂无数据"></van-empty>
v-if="mLoading==false&&tableData.length==0"
class="custom-image"
image="/none.svg"
description="暂无数据"
></van-empty>
</div> </div>
<!--弹出框--> <!--弹出框-->
@@ -292,13 +285,10 @@ layout("/mobile/platform.html"){
<van-icon @click="popupShow = false" class="cus_icon" v-if="popupShow" name="close"></van-icon> <van-icon @click="popupShow = false" class="cus_icon" v-if="popupShow" name="close"></van-icon>
<!--审核人员--> <!--审核人员-->
<van-action-sheet v-model:show="userShow" :title="queryType === 'notAudit' ? '预约列表' : '预约列表'" <van-action-sheet v-model:show="userShow" :title="queryType === 'notAudit' ? '预约列表' : '预约列表'" class="userPopup" @close="popClose">
class="userPopup" @close="popClose">
<div :class="queryType == 'notAudit' ? 'content' : 'no_content'"> <div :class="queryType == 'notAudit' ? 'content' : 'no_content'">
<div v-if="queryType === 'notAudit'" style="text-align: right; width: 96%"> <div v-if="queryType === 'notAudit'" style="text-align: right; width: 96%">
<van-tag color="#1867b0" style="margin-right: 10px" @click="cancelAll" size="large" type="primary"> <van-tag color="#1867b0" style="margin-right: 10px" @click="cancelAll" size="large" type="primary">取消选中</van-tag>
取消选中
</van-tag>
<van-tag color="#1867b0" @click="allIn" size="large" type="primary">全选</van-tag> <van-tag color="#1867b0" @click="allIn" size="large" type="primary">全选</van-tag>
</div> </div>
<div class="van-doc-card in-sheet-card" v-for="(item, i) in userList"> <div class="van-doc-card in-sheet-card" v-for="(item, i) in userList">
@@ -319,19 +309,22 @@ layout("/mobile/platform.html"){
<span class="unit">{{item.unitname}}</span> <span class="unit">{{item.unitname}}</span>
</div> </div>
<div style="width: 94%; display: flex"> <div style="width: 94%; display: flex">
<div style="color: grey;">预约时间:</div> <div style="color: grey">预约时间:</div>
<div> <div>
<div v-for="(d,index) in item.concat_day.split(',')">{{getTime(item, d)}}</div> <div v-for="(d,index) in item.concat_day.split(',')">{{getTime(item, d)}}</div>
</div> </div>
</div> </div>
<div style="width: 94%;"> <div style="width: 94%">
<span style="color: grey">参加人员:</span><span>{{item.joinUser}}</span> <span style="color: grey">参加人员:</span>
<span>{{item.joinUser}}</span>
</div> </div>
<div style="width: 94%;"> <div style="width: 94%">
<span style="color: grey">预约事由:</span><span>{{item.reserve_cause}}</span> <span style="color: grey">预约事由:</span>
<span>{{item.reserve_cause}}</span>
</div> </div>
<div style="width: 94%;"> <div style="width: 94%">
<span style="color: grey">审核状态:</span><span>{{item.stateName}}</span> <span style="color: grey">审核状态:</span>
<span>{{item.stateName}}</span>
</div> </div>
<!--<div v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('xghng')||@shiro.hasRole('A06')}" <!--<div v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('xghng')||@shiro.hasRole('A06')}"
style="width: 94%;"> style="width: 94%;">
@@ -340,17 +333,19 @@ layout("/mobile/platform.html"){
</div> </div>
<van-checkbox-group v-model="result" ref="checkboxGroup"> <van-checkbox-group v-model="result" ref="checkboxGroup">
<van-cell-group> <van-cell-group>
<van-cell <van-cell clickable class="cus_cell" :key="item.id" @click="toggle(i)">
clickable class="cus_cell" <van-icon
:key="item.id" class="audit_icon"
@click="toggle(i)"> color="green"
v-if="queryType === 'hasAudit' && item.auditState == true"
<van-icon class="audit_icon" color="green" name="passed"
v-if="queryType === 'hasAudit' && item.auditState == true" ></van-icon>
name="passed"></van-icon> <van-icon
<van-icon class="audit_icon" color="grey" class="audit_icon"
v-if="queryType === 'hasAudit' && item.auditState == false" color="grey"
name="close"></van-icon> v-if="queryType === 'hasAudit' && item.auditState == false"
name="close"
></van-icon>
<template #right-icon v-if="queryType === 'notAudit'"> <template #right-icon v-if="queryType === 'notAudit'">
<van-checkbox :name="item.id" ref="checkboxes"></van-checkbox> <van-checkbox :name="item.id" ref="checkboxes"></van-checkbox>
</template> </template>
@@ -363,32 +358,34 @@ layout("/mobile/platform.html"){
<van-button @click="audit('all', 'pass')" color="#1867b0" size="small" style="height: 38px">一键全部通过</van-button> <van-button @click="audit('all', 'pass')" color="#1867b0" size="small" style="height: 38px">一键全部通过</van-button>
</div>--> </div>-->
</div> </div>
<div style="position: absolute; bottom: 20px; width: 100%;z-index: 9999"> <div style="position: absolute; bottom: 20px; width: 100%; z-index: 9999">
<div v-if="queryType === 'notAudit'" style="display: flex; justify-content: center"> <div v-if="queryType === 'notAudit'" style="display: flex; justify-content: center">
<van-button @click="audit('many', 'reject')" color="#ff976a" size="small" <van-button
style="height: 38px;border-radius: 10px;margin-right: 20px">拒绝 @click="audit('many', 'reject')"
</van-button> color="#ff976a"
<van-button @click="audit('many', 'pass')" color="#1867b0" size="small" size="small"
style="height: 38px;border-radius: 10px">通过 style="height: 38px; border-radius: 10px; margin-right: 20px"
>
拒绝
</van-button> </van-button>
<van-button @click="audit('many', 'pass')" color="#1867b0" size="small" style="height: 38px; border-radius: 10px">通过</van-button>
</div> </div>
</div> </div>
</van-action-sheet> </van-action-sheet>
<!--审核弹框--> <!--审核弹框-->
<van-dialog v-model:show="auditShow" @confirm="auditDo" title="温馨提示" show-cancel-button> <van-dialog v-model:show="auditShow" @confirm="auditDo" title="温馨提示" show-cancel-button>
<div style="padding-top: 8px; text-align: center; font-size: 14px; color: #646566">{{str}}</div> <div style="padding-top: 8px; text-align: center; font-size: 14px; color: #646566">{{str}}</div>
<van-divider style="margin: 12px 0 1px 0px;"></van-divider> <van-divider style="margin: 12px 0 1px 0px"></van-divider>
<van-field <van-field
v-model="reason" v-model="reason"
rows="2" rows="2"
label="审核意见:" label="审核意见:"
autosize autosize
type="textarea" type="textarea"
maxlength="50" maxlength="50"
placeholder="请输入审核意见" placeholder="请输入审核意见"
show-word-limit show-word-limit
></van-field> ></van-field>
</van-dialog> </van-dialog>
</div> </div>
@@ -397,43 +394,47 @@ layout("/mobile/platform.html"){
<!--# include("/platform/activity/includeJs/activityUtil.js"){} #--> <!--# include("/platform/activity/includeJs/activityUtil.js"){} #-->
const siteTypeUtil = new typeUtil() const siteTypeUtil = new typeUtil()
const vue = new Vue({ const vue = new Vue({
el: '#app', el: "#app",
mixins: [mobileMixins], mixins: [mobileMixins],
data() { data() {
return { return {
desc: '', desc: "",
list: ['a', 'b'], list: ["a", "b"],
result: [], result: [],
reason: '', reason: "",
auditShow: false, auditShow: false,
popupShow: false, popupShow: false,
userShow: false, userShow: false,
userList: [], userList: [],
userClickList: [], userClickList: [],
str: '', str: "",
type: '', type: "",
auditType: '', auditType: "",
queryType: '', queryType: "",
typeList: [], typeList: [],
meetingTimeList: [{text: '全部时间', value: null}, {text: '即将开始', value: 0}, {text: '已结束', value: 1}], meetingTimeList: [
{ text: "全部时间", value: null },
{ text: "即将开始", value: 0 },
{ text: "已结束", value: 1 }
]
} }
}, },
methods: { methods: {
getTime(o, day) { getTime(o, day) {
const week = new Date(day).getDay() const week = new Date(day).getDay()
const arr = ['日', '一', '二', '三', '四', '五', '六'] const arr = ["日", "一", "二", "三", "四", "五", "六"]
return moment(day).format('MM月DD日') + ' 周' + arr[week] + ' ' + o.start_time + '-' + o.end_time return moment(day).format("MM月DD日") + " 周" + arr[week] + " " + o.start_time + "-" + o.end_time
}, },
async getAuditList(o) { async getAuditList(o) {
this.queryType = 'hasAudit' this.queryType = "hasAudit"
const resp = await $.post('/mobile/activity/site/audit/getLeaveUser', { const resp = await $.post("/mobile/activity/site/audit/getLeaveUser", {
siteId: o.id, siteId: o.id,
auditType: 'hasAudit', auditType: "hasAudit"
}) })
if (resp.code === 0) { if (resp.code === 0) {
this.userList = resp.data this.userList = resp.data
if (this.userList.length === 0) { if (this.userList.length === 0) {
vant.Toast('暂无数据') vant.Toast("暂无数据")
return return
} }
this.userList.sort((a, b) => { this.userList.sort((a, b) => {
@@ -443,73 +444,73 @@ layout("/mobile/platform.html"){
} }
}, },
cancelAll() { cancelAll() {
this.$refs.checkboxes.forEach(item => item.toggle(false)) this.$refs.checkboxes.forEach((item) => item.toggle(false))
}, },
allIn() { allIn() {
this.$refs.checkboxes.forEach(item => item.toggle(true)) this.$refs.checkboxes.forEach((item) => item.toggle(true))
}, },
checkAll(i) { checkAll(i) {
this.$refs.checkboxGroup[i].children.forEach(item => item.toggle(true)) this.$refs.checkboxGroup[i].children.forEach((item) => item.toggle(true))
}, },
toggleAll(i) { toggleAll(i) {
this.$refs.checkboxGroup[i].children.forEach(item => item.toggle()) this.$refs.checkboxGroup[i].children.forEach((item) => item.toggle())
}, },
toggle(i) { toggle(i) {
this.$refs.checkboxes[i].toggle(); this.$refs.checkboxes[i].toggle()
}, },
async auditDo() { async auditDo() {
let idList = this.result let idList = this.result
if (this.type === 'all') { if (this.type === "all") {
idList = this.userList.map(o => o.id) idList = this.userList.map((o) => o.id)
} }
const resp = await $.post('/mobile/activity/site/audit/audit', { const resp = await $.post("/mobile/activity/site/audit/audit", {
ids: JSON.stringify(idList), ids: JSON.stringify(idList),
auditOpinion: this.reason, auditOpinion: this.reason,
isPass: this.auditType === 'pass' isPass: this.auditType === "pass"
}) })
if (resp.code === 0) { if (resp.code === 0) {
vant.Toast(resp.msg) vant.Toast(resp.msg)
this.doSearch() this.doSearch()
} else { } else {
vant.Toast('操作失败') vant.Toast("操作失败")
} }
this.userShow = false this.userShow = false
}, },
audit(type, auditType) { audit(type, auditType) {
this.type = type this.type = type
this.auditType = auditType this.auditType = auditType
if (type === 'many' && this.result.length === 0) { if (type === "many" && this.result.length === 0) {
vant.Toast('请先选择人员') vant.Toast("请先选择人员")
return return
} }
this.str = type === 'many' ? '您选择了' + this.result.length + '个人,请确认您的选择' : '您确定要一键全部审核吗?' this.str = type === "many" ? "您选择了" + this.result.length + "个人,请确认您的选择" : "您确定要一键全部审核吗?"
this.reason = auditType === 'pass' ? '同意' : '拒绝' this.reason = auditType === "pass" ? "同意" : "拒绝"
this.auditShow = true this.auditShow = true
}, },
async openView(id, modulename) { async openView(id, modulename) {
this.queryType = 'notAudit' this.queryType = "notAudit"
this.userList = [] this.userList = []
const resp = await $.post('/mobile/activity/site/audit/getLeaveUser', { const resp = await $.post("/mobile/activity/site/audit/getLeaveUser", {
siteId: id, siteId: id,
moduleName: modulename, moduleName: modulename,
auditType: 'canAudit', auditType: "canAudit"
}) })
if (resp.code === 0) { if (resp.code === 0) {
this.userList = resp.data this.userList = resp.data
this.userClickList = [] this.userClickList = []
if (this.userList.length === 0) { if (this.userList.length === 0) {
vant.Toast('暂无预约数据') vant.Toast("暂无预约数据")
} else { } else {
this.userShow = true this.userShow = true
} }
return return
} }
vant.Toast('系统错误,请联系管理员') vant.Toast("系统错误,请联系管理员")
}, },
popClose() { popClose() {
this.$nextTick(function () { this.$nextTick(function () {
if (this.$refs.checkboxes !== undefined) { if (this.$refs.checkboxes !== undefined) {
this.$refs.checkboxes.forEach(item => item.toggle(false)); this.$refs.checkboxes.forEach((item) => item.toggle(false))
} }
}) })
}, },
@@ -521,7 +522,7 @@ layout("/mobile/platform.html"){
}, },
async onLoad() { async onLoad() {
this.loading = true this.loading = true
$.post('/mobile/activity/site/audit/pageData', this.pageForm).then(res => { $.post("/mobile/activity/site/audit/pageData", this.pageForm).then((res) => {
if (res.code === 0) { if (res.code === 0) {
this.tableData = this.tableData.concat(res.data.list) this.tableData = this.tableData.concat(res.data.list)
if (this.tableData.length === res.data.totalCount) { if (this.tableData.length === res.data.totalCount) {
@@ -532,11 +533,11 @@ layout("/mobile/platform.html"){
} }
this.loading = false this.loading = false
}) })
}, }
}, },
async created() { async created() {
this.typeList = await siteTypeUtil.getAllType() this.typeList = await siteTypeUtil.getAllType()
this.typeList.unshift({text: '全部场地类型'}) this.typeList.unshift({ text: "全部场地类型" })
if (this.typeList && this.typeList.length > 0) { if (this.typeList && this.typeList.length > 0) {
this.$set(this.pageForm, "typeId", this.typeList[0].value) this.$set(this.pageForm, "typeId", this.typeList[0].value)
} }
@@ -3,7 +3,6 @@ layout("/mobile/platform.html"){
#--> #-->
<style> <style>
.van-index-bar__sidebar { .van-index-bar__sidebar {
display: none; display: none;
} }
@@ -174,46 +173,30 @@ layout("/mobile/platform.html"){
</style> </style>
<div id="app" v-cloak> <div id="app" v-cloak>
<m-page-loading v-if="mLoading"></m-page-loading> <m-page-loading v-if="mLoading"></m-page-loading>
<!--top栏--> <!--top栏-->
<van-nav-bar <van-nav-bar title="场地预约" left-arrow placeholder fixed @click-left="pjaxReplace('/mobile/index')" safe-area-inset-top></van-nav-bar>
title="场地预约"
left-arrow
placeholder
fixed
@click-left="history.go(-1)"
safe-area-inset-top
></van-nav-bar>
<!--筛选框--> <!--筛选框-->
<div class="search-fixed"> <div class="search-fixed">
<van-search <van-search
v-model="pageForm.searchKeyword" v-model="pageForm.searchKeyword"
shape="round" shape="round"
maxlength="10" maxlength="10"
@search="doSearch" @search="doSearch"
placeholder="请输入场地名称、场地地点进行查询" placeholder="请输入场地名称、场地地点进行查询"
> ></van-search>
</van-search>
<van-dropdown-menu> <van-dropdown-menu>
<van-dropdown-item v-model="pageForm.typeId" :options="typeList" <van-dropdown-item v-model="pageForm.typeId" :options="typeList" @change="doSearch"></van-dropdown-item>
@change="doSearch"></van-dropdown-item>
</van-dropdown-menu> </van-dropdown-menu>
</div> </div>
<!--列表--> <!--列表-->
<div style="margin-top: 116px"> <div style="margin-top: 116px">
<van-list <van-list v-model="loading" :finished="finished" :immediate-check="false" :finished-text="tableData.length>0?'没有更多了':''" @load="onLoad">
v-model="loading"
:finished="finished" :immediate-check="false"
:finished-text="tableData.length>0?'没有更多了':''"
@load="onLoad">
<div class="van-doc-card" v-for="o in tableData"> <div class="van-doc-card" v-for="o in tableData">
<div @click="openView(o)"> <div @click="openView(o)">
<div style="display: flex; justify-content: space-between"> <div style="display: flex; justify-content: space-between">
<div style="width: 74%"> <div style="width: 74%">
<div class="van-ellipsis title"> <div class="van-ellipsis title">
@@ -222,28 +205,31 @@ layout("/mobile/platform.html"){
</div> </div>
<div style="color: grey">{{o.address}}</div> <div style="color: grey">{{o.address}}</div>
</div> </div>
<div style="color: #1867b0;"> <div style="color: #1867b0">{{o.meetingtypename}}</div>
{{o.meetingtypename}}
</div>
</div> </div>
<van-divider></van-divider> <van-divider></van-divider>
<div style="margin-top: 10px"> <div style="margin-top: 10px">
<van-row> <van-row>
<van-col span="24"><span style="color: grey">&emsp;联系人:</span>{{(o.unitname ? o.unitname : <van-col span="24">
'') + ' ' + o.contact_person}} <span style="color: grey">&emsp;联系人:</span>
{{(o.unitname ? o.unitname : '') + ' ' + o.contact_person}}
</van-col> </van-col>
</van-row> </van-row>
<van-row> <van-row>
<van-col span="24"><span style="color: grey">联系方式:</span>{{o.contact_phone}}</van-col> <van-col span="24">
<span style="color: grey">联系方式:</span>
{{o.contact_phone}}
</van-col>
</van-row> </van-row>
<!--<van-row> <!--<van-row>
<van-col span="24"><span style="color: grey">已预约人数:</span>{{o.count}}</van-col> <van-col span="24"><span style="color: grey">已预约人数:</span>{{o.count}}</van-col>
</van-row>--> </van-row>-->
<van-row> <van-row>
<van-col span="24"><span style="color: grey">开放时间:</span><span <van-col span="24">
v-if="o.workday === true">工作日</span> <span style="color: grey">开放时间:</span>
<span v-if="o.workday === true">工作日</span>
{{o.open_time}} {{o.open_time}}
</van-col> </van-col>
</van-row> </van-row>
@@ -251,18 +237,13 @@ layout("/mobile/platform.html"){
</div> </div>
</div> </div>
</van-list> </van-list>
<van-empty <van-empty v-if="mLoading==false&&tableData.length==0" class="custom-image" image="/none.svg" description="暂无数据"></van-empty>
v-if="mLoading==false&&tableData.length==0"
class="custom-image"
image="/none.svg"
description="暂无数据"
></van-empty>
</div> </div>
<van-popup round v-model:show="show" class="pop"> <van-popup round v-model:show="show" class="pop">
<div style="text-align: center;padding: 10px 0; font-size: 20px">爱心母婴室管理规定</div> <div style="text-align: center; padding: 10px 0; font-size: 20px">爱心母婴室管理规定</div>
<div>一、基本原则</div> <div>一、基本原则</div>
<div style="padding-left: 30px;"> <div style="padding-left: 30px">
<p>1.使用对象:有哺乳需求的本校在职女教职工。</p> <p>1.使用对象:有哺乳需求的本校在职女教职工。</p>
<p>2.开放时间:工作日8:00--17:30。</p> <p>2.开放时间:工作日8:00--17:30。</p>
<p>3.使用制度:实行预约登记制。凡有哺乳需求的女教职工提前向校工会提出使用申请,经审核通过并开通权限后即可使用。</p> <p>3.使用制度:实行预约登记制。凡有哺乳需求的女教职工提前向校工会提出使用申请,经审核通过并开通权限后即可使用。</p>
@@ -270,14 +251,14 @@ layout("/mobile/platform.html"){
</div> </div>
<div>二、管理人员</div> <div>二、管理人员</div>
<div style="padding-left: 30px;"> <div style="padding-left: 30px">
<p>1.负责爱心母婴室使用登记管理。</p> <p>1.负责爱心母婴室使用登记管理。</p>
<p>2.定期保养设备,确保正常使用。</p> <p>2.定期保养设备,确保正常使用。</p>
<p>3.保持室内整洁、卫生安全,做好保洁消毒记录。</p> <p>3.保持室内整洁、卫生安全,做好保洁消毒记录。</p>
<p>4.定期收集意见和建议,不断改进服务。</p> <p>4.定期收集意见和建议,不断改进服务。</p>
</div> </div>
<div>三、使用人员</div> <div>三、使用人员</div>
<div style="padding-left: 30px;"> <div style="padding-left: 30px">
<p>1.遵守学校安全管理制度和爱心母婴室管理规定。</p> <p>1.遵守学校安全管理制度和爱心母婴室管理规定。</p>
<p>2.严禁吸烟,安全使用电器,爱护公物,损坏赔偿。</p> <p>2.严禁吸烟,安全使用电器,爱护公物,损坏赔偿。</p>
<p>3.保持室内卫生清洁,勿大声喧哗,不影响楼内工作秩序。</p> <p>3.保持室内卫生清洁,勿大声喧哗,不影响楼内工作秩序。</p>
@@ -285,7 +266,7 @@ layout("/mobile/platform.html"){
<p>5.不得擅自携他人入内,不做和哺乳无关事宜,使用完毕及时离开。</p> <p>5.不得擅自携他人入内,不做和哺乳无关事宜,使用完毕及时离开。</p>
<p>6.欢迎在《爱心母婴室使用意见簿》上留下您宝贵的意见和建议。</p> <p>6.欢迎在《爱心母婴室使用意见簿》上留下您宝贵的意见和建议。</p>
</div> </div>
<br/> <br />
<p>联系人:曾钰媛梦 84894774、15850692181</p> <p>联系人:曾钰媛梦 84894774、15850692181</p>
<van-button color="#246fb4" @click="toReserve" type="primary" style="width: 100%">已知晓并遵守</van-button> <van-button color="#246fb4" @click="toReserve" type="primary" style="width: 100%">已知晓并遵守</van-button>
@@ -296,32 +277,32 @@ layout("/mobile/platform.html"){
<!--# include("/platform/activity/includeJs/activityUtil.js"){} #--> <!--# include("/platform/activity/includeJs/activityUtil.js"){} #-->
const siteTypeUtil = new typeUtil() const siteTypeUtil = new typeUtil()
const vue = new Vue({ const vue = new Vue({
el: '#app', el: "#app",
mixins: [mobileMixins], mixins: [mobileMixins],
data() { data() {
return { return {
list: ['a', 'b'], list: ["a", "b"],
typeList: [], typeList: [],
show: false, show: false,
siteId: '', siteId: ""
} }
}, },
methods: { methods: {
openView(o) { openView(o) {
this.siteId = o.id this.siteId = o.id
if (o.sexlimit === 1 || o.sexlimit === 2) { if (o.sexlimit === 1 || o.sexlimit === 2) {
const sex = o.sexlimit === 1 ? '男' : '女' const sex = o.sexlimit === 1 ? "男" : "女"
if ("${@shiro.getPrincipalProperty('sex')}" === sex) { if ("${@shiro.getPrincipalProperty('sex')}" === sex) {
location.href = '/mobile/activity/site/info/reserve?id=' + o.id location.href = "/mobile/activity/site/info/reserve?id=" + o.id
} else { } else {
vant.Toast('抱歉,该场地仅限' + sex + '性会员预约') vant.Toast("抱歉,该场地仅限" + sex + "性会员预约")
} }
} else { } else {
location.href = '/mobile/activity/site/info/reserve?id=' + o.id location.href = "/mobile/activity/site/info/reserve?id=" + o.id
} }
}, },
toReserve() { toReserve() {
location.href = '/mobile/activity/site/info/reserve?id=' + this.siteId location.href = "/mobile/activity/site/info/reserve?id=" + this.siteId
this.show = false this.show = false
}, },
doSearch() { doSearch() {
@@ -332,7 +313,7 @@ layout("/mobile/platform.html"){
}, },
async onLoad() { async onLoad() {
this.loading = true this.loading = true
$.post('/mobile/activity/site/info/pageData', this.pageForm).then(res => { $.post("/mobile/activity/site/info/pageData", this.pageForm).then((res) => {
if (res.code === 0) { if (res.code === 0) {
this.tableData = this.tableData.concat(res.data.list) this.tableData = this.tableData.concat(res.data.list)
if (this.tableData.length === res.data.totalCount) { if (this.tableData.length === res.data.totalCount) {
@@ -343,11 +324,11 @@ layout("/mobile/platform.html"){
} }
this.loading = false this.loading = false
}) })
}, }
}, },
async created() { async created() {
this.typeList = await siteTypeUtil.getAllType() this.typeList = await siteTypeUtil.getAllType()
this.typeList.unshift({text: '全部场地类型'}) this.typeList.unshift({ text: "全部场地类型" })
if (this.typeList && this.typeList.length > 0) { if (this.typeList && this.typeList.length > 0) {
this.$set(this.pageForm, "typeId", this.typeList[0].value) this.$set(this.pageForm, "typeId", this.typeList[0].value)
} }
@@ -358,4 +339,4 @@ layout("/mobile/platform.html"){
<!--# <!--#
} }
#--> #-->
@@ -3,17 +3,16 @@ layout("/mobile/platform.html"){
#--> #-->
<div id="app"> <div id="app">
<van-nav-bar title="场地预约详细信息" left-arrow placeholder fixed <van-nav-bar title="场地预约详细信息" left-arrow placeholder fixed @click-left="pjaxReplace('/mobile/index')"></van-nav-bar>
@click-left="history.back()"></van-nav-bar>
<site_h5_info :id="id"></site_h5_info> <site_h5_info :id="id"></site_h5_info>
</div> </div>
<script> <script>
const vue = new Vue({ const vue = new Vue({
el: '#app', el: "#app",
mixins: [mobileMixins], mixins: [mobileMixins],
components: { components: {
'site_h5_info': httpVueLoader('/components/activity/site/SiteH5Info.vue') site_h5_info: httpVueLoader("/components/activity/site/SiteH5Info.vue")
}, },
data() { data() {
return { return {
@@ -21,9 +20,7 @@ layout("/mobile/platform.html"){
} }
}, },
methods: {}, methods: {},
created() { created() {}
}
}) })
</script> </script>
@@ -43,11 +43,9 @@ layout("/mobile/platform.html"){
} }
.cell .title { .cell .title {
} }
.cell .content { .cell .content {
} }
.extra { .extra {
@@ -56,38 +54,28 @@ layout("/mobile/platform.html"){
justify-content: flex-end; justify-content: flex-end;
gap: 10px; gap: 10px;
} }
</style> </style>
<div id="app" v-cloak> <div id="app" v-cloak>
<div> <div>
<van-nav-bar title="职工之家我的场地预约" left-arrow placeholder fixed <van-nav-bar title="职工之家我的场地预约" left-arrow placeholder fixed @click-left="pjaxReplace('/mobile/index')"></van-nav-bar>
@click-left="history.back()"></van-nav-bar>
<div class="search-fixed"> <div class="search-fixed">
<van-search <van-search
v-model="pageForm.searchKeyword" v-model="pageForm.searchKeyword"
shape="round" shape="round"
maxlength="10" maxlength="10"
@search="doSearch" @search="doSearch"
placeholder="请输入场地名称进行查询" placeholder="请输入场地名称进行查询"
> ></van-search>
</van-search>
</div> </div>
<div class="table-list"> <div class="table-list">
<van-list v-model="loading" <van-list v-model="loading" :finished="finished" :finished-text="tableData.length>0?'没有更多了':''" @load="pageData">
:finished="finished"
:finished-text="tableData.length>0?'没有更多了':''"
@load="pageData">
<div v-for="item in tableData" :key="item.id" class="table-item"> <div v-for="item in tableData" :key="item.id" class="table-item">
<div> <div>
<div class="header-title"> <div class="header-title">{{item.reserve_cause}}</div>
{{item.reserve_cause}} <van-tag class="header-title-extra" :type="tagType(item.reserve_state)">{{item.state_name}}</van-tag>
</div>
<van-tag class="header-title-extra" :type="tagType(item.reserve_state)">
{{item.state_name}}
</van-tag>
<div class="cell"> <div class="cell">
<div class="title">预约场地:</div> <div class="title">预约场地:</div>
@@ -119,9 +107,7 @@ layout("/mobile/platform.html"){
</div> </div>
<div class="extra"> <div class="extra">
<van-button size="small" type="info" @click="openView(item.id)">查看详情</van-button> <van-button size="small" type="info" @click="openView(item.id)">查看详情</van-button>
<van-button size="small" type="danger" @click="revoke(item)" <van-button size="small" type="danger" @click="revoke(item)" v-if="item.reserve_state===6098">撤销预约</van-button>
v-if="item.reserve_state===6098">撤销预约
</van-button>
</div> </div>
</div> </div>
</div> </div>
@@ -132,56 +118,54 @@ layout("/mobile/platform.html"){
<script> <script>
const vue = new Vue({ const vue = new Vue({
el: '#app', el: "#app",
mixins: [mobileMixins], mixins: [mobileMixins],
data() { data() {
return { return {
tableData: [], tableData: [],
pageDataUrl: '/platform/activity/site/reserve/pageData' pageDataUrl: "/platform/activity/site/reserve/pageData"
} }
}, },
computed: { computed: {
tagType() { tagType() {
return (reserveState) => { return (reserveState) => {
if (reserveState === 6138) { if (reserveState === 6138) {
return 'success'; return "success"
} else if ([6108, 6128].includes(reserveState)) { } else if ([6108, 6128].includes(reserveState)) {
return 'danger'; return "danger"
} }
return 'primary'; return "primary"
}; }
}, }
}, },
methods: { methods: {
async revoke(item) { async revoke(item) {
const {id, site_name, reserve_start_time, reserve_end_time} = item const { id, site_name, reserve_start_time, reserve_end_time } = item
this.$dialog.confirm({ this.$dialog
title: '提示', .confirm({
message: '您确定要撤销' + site_name + '\n' + reserve_start_time + "\n至\n" + reserve_end_time + '\n的预约吗?', title: "提示",
}).then(async () => { message: "您确定要撤销" + site_name + "\n" + reserve_start_time + "\n至\n" + reserve_end_time + "\n的预约吗?"
const loading = this.$toast.loading({ })
message: '提交中...', .then(async () => {
forbidClick: true, const loading = this.$toast.loading({
}); message: "提交中...",
forbidClick: true
})
const { const { code, msg } = await $.post("/platform/activity/site/apply/revoke", { id })
code, loading.clear()
msg if (code === 0) {
} = await $.post('/platform/activity/site/apply/revoke', {id}) this.doSearch()
loading.clear() this.$toast.success(msg)
if (code === 0) { } else {
this.doSearch() this.$toast.fail(msg)
this.$toast.success(msg) }
} else { })
this.$toast.fail(msg) .catch(() => {})
}
}).catch(() => {
})
}, },
openView(id) { openView(id) {
window.location.href = loc() + '/detail?id=' + id window.location.href = loc() + "/detail?id=" + id
} }
}, },
created() { created() {
// this.pageData() // this.pageData()
@@ -191,4 +175,4 @@ layout("/mobile/platform.html"){
<!--# <!--#
} }
#--> #-->
@@ -3,7 +3,6 @@ layout("/mobile/platform.html"){
#--> #-->
<style> <style>
.van-index-bar__sidebar { .van-index-bar__sidebar {
display: none; display: none;
} }
@@ -162,29 +161,20 @@ layout("/mobile/platform.html"){
</style> </style>
<div id="app" v-cloak> <div id="app" v-cloak>
<m-page-loading v-if="mLoading"></m-page-loading> <m-page-loading v-if="mLoading"></m-page-loading>
<!--top栏--> <!--top栏-->
<van-nav-bar <van-nav-bar title="我的预约" left-arrow placeholder fixed @click-left="pjaxReplace('/mobile/index')" safe-area-inset-top></van-nav-bar>
title="我的预约"
left-arrow
placeholder
fixed
@click-left="history.go(-1)"
safe-area-inset-top
></van-nav-bar>
<!--筛选框--> <!--筛选框-->
<div class="search-fixed"> <div class="search-fixed">
<van-search <van-search
v-model="pageForm.searchKeyword" v-model="pageForm.searchKeyword"
shape="round" shape="round"
maxlength="10" maxlength="10"
@search="doSearch" @search="doSearch"
placeholder="请输入场地名称、场地地点进行查询" placeholder="请输入场地名称、场地地点进行查询"
> ></van-search>
</van-search>
<van-dropdown-menu> <van-dropdown-menu>
<van-dropdown-item :title="pageForm.time" ref="item" @open=""> <van-dropdown-item :title="pageForm.time" ref="item" @open="">
<van-cell center title="查询全部"> <van-cell center title="查询全部">
@@ -192,34 +182,28 @@ layout("/mobile/platform.html"){
<van-switch v-model="pageForm.timeSwitch" size="24" active-color="#246fb4"></van-switch> <van-switch v-model="pageForm.timeSwitch" size="24" active-color="#246fb4"></van-switch>
</template> </template>
</van-cell> </van-cell>
<van-datetime-picker v-show="pageForm.timeSwitch === false" <van-datetime-picker
v-model="time" cancel-button-text=" " confirm-button-text=" " v-show="pageForm.timeSwitch === false"
type="year-month" v-model="time"
title="选择年月" cancel-button-text=" "
:formatter="timeFormatter" confirm-button-text=" "
type="year-month"
title="选择年月"
:formatter="timeFormatter"
></van-datetime-picker> ></van-datetime-picker>
<div style="padding: 5px 16px;margin-top: 6px"> <div style="padding: 5px 16px; margin-top: 6px">
<van-button type="danger" color="#246fb4" block round @click="onConfirm" style="height: 36px"> <van-button type="danger" color="#246fb4" block round @click="onConfirm" style="height: 36px">确认</van-button>
确认
</van-button>
</div> </div>
</van-dropdown-item> </van-dropdown-item>
<van-dropdown-item v-model="pageForm.typeId" :options="typeList" <van-dropdown-item v-model="pageForm.typeId" :options="typeList" @change="doSearch"></van-dropdown-item>
@change="doSearch"></van-dropdown-item>
</van-dropdown-menu> </van-dropdown-menu>
</div> </div>
<!--列表--> <!--列表-->
<div style="margin-top: 116px"> <div style="margin-top: 116px">
<van-list <van-list v-model="loading" :finished="finished" :immediate-check="false" :finished-text="tableData.length>0?'没有更多了':''" @load="onLoad">
v-model="loading"
:finished="finished" :immediate-check="false"
:finished-text="tableData.length>0?'没有更多了':''"
@load="onLoad">
<div class="van-doc-card" v-for="o in tableData"> <div class="van-doc-card" v-for="o in tableData">
<div @click="openView(o.id, o.modulename)"> <div @click="openView(o.id, o.modulename)">
<div style="display: flex; justify-content: space-between"> <div style="display: flex; justify-content: space-between">
<div style="width: 74%"> <div style="width: 74%">
<div class="van-ellipsis title"> <div class="van-ellipsis title">
@@ -228,9 +212,7 @@ layout("/mobile/platform.html"){
</div> </div>
<div style="color: grey">{{o.address}}</div> <div style="color: grey">{{o.address}}</div>
</div> </div>
<div style="color: #1867b0;"> <div style="color: #1867b0">{{o.meetingtypename}}</div>
{{o.meetingtypename}}
</div>
</div> </div>
<van-divider></van-divider> <van-divider></van-divider>
@@ -253,8 +235,7 @@ layout("/mobile/platform.html"){
<van-row> <van-row>
<van-col span="24"> <van-col span="24">
<span style="color: grey">审核状态:</span> <span style="color: grey">审核状态:</span>
<span v-if="[0].includes(o.stateaudittype)" <span v-if="[0].includes(o.stateaudittype)" style="color: #e6a23c">{{o.statename}}</span>
style="color: #e6a23c">{{o.statename}}</span>
<span v-if="o.stateaudittype==3" style="color: #67c23a">{{o.statename}}</span> <span v-if="o.stateaudittype==3" style="color: #67c23a">{{o.statename}}</span>
<span v-if="o.stateaudittype==1" style="color: #f56c6c">{{o.statename}}</span> <span v-if="o.stateaudittype==1" style="color: #f56c6c">{{o.statename}}</span>
</van-col> </van-col>
@@ -269,38 +250,44 @@ layout("/mobile/platform.html"){
<div style="display: flex; justify-content: flex-end; margin-top: 4px"> <div style="display: flex; justify-content: flex-end; margin-top: 4px">
<div> <div>
<van-button @click.stop="rollback(o)" class="cus_button" <van-button
type="primary" size="small" color="#1867b0" @click.stop="rollback(o)"
style="margin-right: 8px; width: auto;">撤销预约 class="cus_button"
type="primary"
size="small"
color="#1867b0"
style="margin-right: 8px; width: auto"
>
撤销预约
</van-button> </van-button>
<van-button @click.stop="backOption(o)" class="cus_button" <van-button
type="primary" size="small" color="#1867b0" @click.stop="backOption(o)"
style="margin-right: 8px; width: auto;">反馈意见 class="cus_button"
type="primary"
size="small"
color="#1867b0"
style="margin-right: 8px; width: auto"
>
反馈意见
</van-button> </van-button>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</van-list> </van-list>
<van-empty <van-empty v-if="mLoading==false&&tableData.length==0" class="custom-image" image="/none.svg" description="暂无数据"></van-empty>
v-if="mLoading==false&&tableData.length==0"
class="custom-image"
image="/none.svg"
description="暂无数据"
></van-empty>
</div> </div>
<van-dialog v-model="show" title="反馈意见" show-cancel-button @confirm="backDo"> <van-dialog v-model="show" title="反馈意见" show-cancel-button @confirm="backDo">
<van-field <van-field
v-model="option" v-model="option"
rows="4" rows="4"
label="反馈意见:" label="反馈意见:"
autosize autosize
type="textarea" type="textarea"
maxlength="50" maxlength="50"
placeholder="请输入反馈意见" placeholder="请输入反馈意见"
show-word-limit show-word-limit
></van-field> ></van-field>
</van-dialog> </van-dialog>
</div> </div>
@@ -309,74 +296,77 @@ layout("/mobile/platform.html"){
<!--# include("/platform/activity/includeJs/activityUtil.js"){} #--> <!--# include("/platform/activity/includeJs/activityUtil.js"){} #-->
const siteTypeUtil = new typeUtil() const siteTypeUtil = new typeUtil()
const vue = new Vue({ const vue = new Vue({
el: '#app', el: "#app",
mixins: [mobileMixins], mixins: [mobileMixins],
data() { data() {
return { return {
time: new Date(), time: new Date(),
option: '', option: "",
show: false, show: false,
list: ['a', 'b'], list: ["a", "b"],
typeList: [], typeList: [],
timeList: [], timeList: [],
info: {}, info: {}
} }
}, },
methods: { methods: {
onConfirm() { onConfirm() {
if (this.pageForm.timeSwitch === true) { if (this.pageForm.timeSwitch === true) {
this.timeList = [{text: '全部', value: '全部'}] this.timeList = [{ text: "全部", value: "全部" }]
} else { } else {
this.timeList = [{ this.timeList = [
text: moment(this.time).format('YYYY-MM'), {
value: moment(this.time).format('YYYY-MM') text: moment(this.time).format("YYYY-MM"),
}] value: moment(this.time).format("YYYY-MM")
}
]
} }
this.$set(this.pageForm, "time", this.timeList[0].value) this.$set(this.pageForm, "time", this.timeList[0].value)
this.$refs.item.toggle() this.$refs.item.toggle()
this.doSearch() this.doSearch()
}, },
timeFormatter(type, val) { timeFormatter(type, val) {
if (type === 'year') { if (type === "year") {
return val + `年`; return val + `年`
} }
if (type === 'month') { if (type === "month") {
return val + `月`; return val + `月`
} }
return val; return val
}, },
async rollback(o) { async rollback(o) {
const self = this const self = this
const res = await $.post("/platform/activity/site/reserve/isCanRollBack", {id: o.id}); const res = await $.post("/platform/activity/site/reserve/isCanRollBack", { id: o.id })
if (res === true) { if (res === true) {
vant.Toast('此预约状态下不能进行撤回操作!') vant.Toast("此预约状态下不能进行撤回操作!")
return return
} }
vant.Dialog.confirm({ vant.Dialog.confirm({
title: '温馨提示', title: "温馨提示",
message: '您是否要撤销此预约?', message: "您是否要撤销此预约?"
}).then(async () => { })
const resp = await $.post('/mobile/activity/site/info/rollback', { .then(async () => {
id: o.id const resp = await $.post("/mobile/activity/site/info/rollback", {
id: o.id
})
vant.Toast(resp.msg)
if (resp.code === 0) {
self.doSearch()
}
}) })
vant.Toast(resp.msg) .catch(() => {})
if (resp.code === 0) {
self.doSearch()
}
}).catch(() => {
});
}, },
backOption(o) { backOption(o) {
this.info = o this.info = o
this.option = '' this.option = ""
this.show = true this.show = true
}, },
async backDo() { async backDo() {
if (this.option === '') { if (this.option === "") {
vant.Toast('请填写反馈意见') vant.Toast("请填写反馈意见")
return return
} }
const res = await $.post('/mobile/activity/site/info/backOption', { const res = await $.post("/mobile/activity/site/info/backOption", {
id: this.info.id, id: this.info.id,
option: this.option option: this.option
}) })
@@ -384,13 +374,13 @@ layout("/mobile/platform.html"){
this.doSearch() this.doSearch()
vant.Toast(res.msg) vant.Toast(res.msg)
} else { } else {
vant.Toast('操作失败') vant.Toast("操作失败")
} }
}, },
getTime(o, day) { getTime(o, day) {
const week = new Date(day).getDay() const week = new Date(day).getDay()
const arr = ['日', '一', '二', '三', '四', '五', '六'] const arr = ["日", "一", "二", "三", "四", "五", "六"]
return moment(day).format('MM月DD日') + ' 周' + arr[week] + ' ' + o.start_time + '-' + o.end_time return moment(day).format("MM月DD日") + " 周" + arr[week] + " " + o.start_time + "-" + o.end_time
}, },
doSearch() { doSearch() {
this.pageForm.pageNumber = 1 this.pageForm.pageNumber = 1
@@ -400,7 +390,7 @@ layout("/mobile/platform.html"){
}, },
async onLoad() { async onLoad() {
this.loading = true this.loading = true
$.post('/mobile/activity/site/info/myReserve', this.pageForm).then(res => { $.post("/mobile/activity/site/info/myReserve", this.pageForm).then((res) => {
if (res.code === 0) { if (res.code === 0) {
this.tableData = this.tableData.concat(res.data.list) this.tableData = this.tableData.concat(res.data.list)
if (this.tableData.length === res.data.totalCount) { if (this.tableData.length === res.data.totalCount) {
@@ -411,16 +401,16 @@ layout("/mobile/platform.html"){
} }
this.loading = false this.loading = false
}) })
}, }
}, },
async created() { async created() {
this.typeList = await siteTypeUtil.getAllType() this.typeList = await siteTypeUtil.getAllType()
this.typeList.unshift({text: '全部场地类型'}) this.typeList.unshift({ text: "全部场地类型" })
if (this.typeList && this.typeList.length > 0) { if (this.typeList && this.typeList.length > 0) {
this.$set(this.pageForm, "typeId", this.typeList[0].value) this.$set(this.pageForm, "typeId", this.typeList[0].value)
} }
//this.timeList.unshift({text: moment().format('YYYY-MM'), value: moment().format('YYYY-MM')}) //this.timeList.unshift({text: moment().format('YYYY-MM'), value: moment().format('YYYY-MM')})
this.timeList = [{text: '全部', value: '全部'}] this.timeList = [{ text: "全部", value: "全部" }]
this.$set(this.pageForm, "time", this.timeList[0].value) this.$set(this.pageForm, "time", this.timeList[0].value)
this.$set(this.pageForm, "timeSwitch", true) this.$set(this.pageForm, "timeSwitch", true)
this.onLoad() this.onLoad()
@@ -430,4 +420,4 @@ layout("/mobile/platform.html"){
<!--# <!--#
} }
#--> #-->
@@ -60,7 +60,6 @@ layout("/mobile/platform.html"){
color: grey; color: grey;
} }
.top-calendar { .top-calendar {
height: 70px; height: 70px;
max-height: 70px; max-height: 70px;
@@ -89,7 +88,7 @@ layout("/mobile/platform.html"){
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
color: #FFF; color: #fff;
} }
.left-day-active { .left-day-active {
@@ -97,7 +96,6 @@ layout("/mobile/platform.html"){
} }
.day-info-month { .day-info-month {
} }
.day-info-week { .day-info-week {
@@ -126,36 +124,33 @@ layout("/mobile/platform.html"){
</style> </style>
<div id="app" v-cloak> <div id="app" v-cloak>
<!--top栏--> <!--top栏-->
<van-nav-bar <van-nav-bar :title="site.name" left-arrow placeholder fixed @click-left="pjaxReplace('/mobile/index')" safe-area-inset-top></van-nav-bar>
:title="site.name"
left-arrow
placeholder
fixed
@click-left="history.go(-1)"
safe-area-inset-top
></van-nav-bar>
<div class="top-calendar"> <div class="top-calendar">
<div class="calendar-left"> <div class="calendar-left">
<div class="calendar-left-day" :class="moment(item).unix() == selectDate.unix() ? 'left-day-active':''" <div
@click="dayClick(item)" class="calendar-left-day"
v-for="item in weekList"> :class="moment(item).unix() == selectDate.unix() ? 'left-day-active':''"
<div class="day-info-week"> @click="dayClick(item)"
{{getWeekTextByDate(item)}} v-for="item in weekList"
</div> >
<div class="day-info-month"> <div class="day-info-week">{{getWeekTextByDate(item)}}</div>
{{moment(item).format('MM-DD')}} <div class="day-info-month">{{moment(item).format('MM-DD')}}</div>
</div>
</div> </div>
</div> </div>
<div class="calendar-right"> <div class="calendar-right">
<van-icon size="16" color="white" name="arrow-down" @click="calendarVisible=true"></van-icon> <van-icon size="16" color="white" name="arrow-down" @click="calendarVisible=true"></van-icon>
<van-calendar class="top_pop" v-model="calendarVisible" color="#246fb4" position="top" @confirm="onConfirm" <van-calendar
:default-date="selectDate.toDate()" class="top_pop"
:formatter="calendarFormatter" v-model="calendarVisible"
title="选择开始日期"></van-calendar> color="#246fb4"
position="top"
@confirm="onConfirm"
:default-date="selectDate.toDate()"
:formatter="calendarFormatter"
title="选择开始日期"
></van-calendar>
</div> </div>
</div> </div>
@@ -165,21 +160,20 @@ layout("/mobile/platform.html"){
<td class="time">{{item.start_time + '-' + item.end_time}}</td> <td class="time">{{item.start_time + '-' + item.end_time}}</td>
<td> <td>
<div v-if="isCanRe(item)===3" class="state" style="background-color: #0e78c5;color: #fff3f3"> <div v-if="isCanRe(item)===3" class="state" style="background-color: #0e78c5; color: #fff3f3">已预约</div>
已预约 <div v-if="isCanRe(item) === 2" class="state" style="background-color: #fff4f2; color: #cc5a45">约满</div>
</div> <div @click="chooseTime(item)" v-if="isCanRe(item) === 1" class="state" style="background-color: #e8ffef; color: #52986a">
<div v-if="isCanRe(item) === 2" class="state" style="background-color: #fff4f2; color: #cc5a45">约满 <span
</div> v-if="!times.map(o => o.fullDay).includes(selectDate.format('YYYY-MM-DD') + ' ' + item.start_time + '-' + item.end_time)"
<div @click="chooseTime(item)" v-if="isCanRe(item) === 1" class="state" >
style="background-color: #e8ffef; color: #52986a"> 可预约
<span v-if="!times.map(o => o.fullDay).includes(selectDate.format('YYYY-MM-DD') + ' ' + item.start_time + '-' + item.end_time)">可预约</span> </span>
<span v-else> <span v-else>
<van-icon name="passed" size="26" style="line-height: 36px;position: unset"></van-icon> <van-icon name="passed" size="26" style="line-height: 36px; position: unset"></van-icon>
</span> </span>
</div> </div>
<div v-if="isCanRe(item) === 0" class="state">已过期</div> <div v-if="isCanRe(item) === 0" class="state">已过期</div>
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
@@ -197,82 +191,90 @@ layout("/mobile/platform.html"){
<van-cell title="联系电话">{{phone}}</van-cell> <van-cell title="联系电话">{{phone}}</van-cell>
<van-cell title="预约时间"> <van-cell title="预约时间">
<div v-for="time in times"> <div v-for="time in times">
<van-tag closeable size="medium" type="primary" @close="close(time.fullDay)"> <van-tag closeable size="medium" type="primary" @close="close(time.fullDay)">{{time.fullDay}}</van-tag>
{{time.fullDay}}
</van-tag>
</div> </div>
</van-cell> </van-cell>
<van-cell title="预约地点">{{site.name}}</van-cell> <van-cell title="预约地点">{{site.name}}</van-cell>
<van-field <van-field
v-model="message" v-model="message"
rows="1" rows="1"
autosize autosize
label="预约事由" label="预约事由"
type="textarea" type="textarea"
maxlength="50" maxlength="50"
required required
placeholder="请输入预约事由" placeholder="请输入预约事由"
show-word-limit show-word-limit
:rules="[{required:true,message:'请填写预约事由'}]" :rules="[{required:true,message:'请填写预约事由'}]"
></van-field> ></van-field>
<van-field <van-field
v-model="joinUser" v-model="joinUser"
rows="2" rows="2"
autosize autosize
label="参加人员" label="参加人员"
type="textarea" type="textarea"
maxlength="50" maxlength="50"
placeholder="请输入参加人员" placeholder="请输入参加人员"
show-word-limit show-word-limit
></van-field> ></van-field>
</van-form> </van-form>
<div style="margin: 20px 0px; display: flex; justify-content: space-between; padding: 0px 22px">
<div style="margin: 20px 0px; display: flex; justify-content: space-between;padding: 0px 22px;"> <van-button @click="message = '';show = false" color="#246fb4" style="width: 47%" size="small" plain type="info">关闭</van-button>
<van-button @click="message = '';show = false" color="#246fb4" style="width: 47%" size="small" plain
type="info">关闭
</van-button>
<van-button @click="reserveDo" color="#246fb4" style="width: 47%" size="small" type="info">确认</van-button> <van-button @click="reserveDo" color="#246fb4" style="width: 47%" size="small" type="info">确认</van-button>
</div> </div>
</van-action-sheet> </van-action-sheet>
</div> </div>
<script> <script>
moment.locale('zh_cn'); moment.locale("zh_cn")
function getQueryString(name) { function getQueryString(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i")
var r = window.location.search.substr(1).match(reg); var r = window.location.search.substr(1).match(reg)
if (r != null) return decodeURI(r[2]); if (r != null) return decodeURI(r[2])
return null; return null
} }
<!--# include("/platform/activity/includeJs/activityUtil.js"){} #--> <!--# include("/platform/activity/includeJs/activityUtil.js"){} #-->
const siteTypeUtil = new typeUtil() const siteTypeUtil = new typeUtil()
const vue = new Vue({ const vue = new Vue({
el: '#app', el: "#app",
mixins: [mobileMixins], mixins: [mobileMixins],
data() { data() {
return { return {
person: "${@shiro.getPrincipalProperty('username')}", person: "${@shiro.getPrincipalProperty('username')}",
unit: "${@shiro.getPrincipalProperty('unit').getName()}", unit: "${@shiro.getPrincipalProperty('unit').getName()}",
phone: "${@shiro.getPrincipalProperty('mobile')}", phone: "${@shiro.getPrincipalProperty('mobile')}",
message: '', message: "",
show: false, show: false,
site_id: '', site_id: "",
site: {}, site: {},
timeData: [], timeData: [],
times: [], times: [],
weekList: [], weekList: [],
joinUser: '', joinUser: "",
calendarVisible: false, calendarVisible: false,
selectDate: null, selectDate: null,
//已经预约的记录 //已经预约的记录
alreadyReserveRecord: [], alreadyReserveRecord: [],
holidays: ['2022-06-03', '2022-06-04', '2022-06-05', '2022-09-10', '2022-09-11', '2022-09-12', holidays: [
'2022-10-01', '2022-10-02', '2022-10-03', '2022-10-04', '2022-10-05', '2022-10-06', '2022-10-07',], "2022-06-03",
"2022-06-04",
"2022-06-05",
"2022-09-10",
"2022-09-11",
"2022-09-12",
"2022-10-01",
"2022-10-02",
"2022-10-03",
"2022-10-04",
"2022-10-05",
"2022-10-06",
"2022-10-07"
]
} }
}, },
computed: { computed: {
@@ -281,19 +283,19 @@ layout("/mobile/platform.html"){
const weekNum = moment(date).day() const weekNum = moment(date).day()
switch (weekNum) { switch (weekNum) {
case 0: case 0:
return '周日' return "周日"
case 1: case 1:
return '周一' return "周一"
case 2: case 2:
return '周二' return "周二"
case 3: case 3:
return '周三' return "周三"
case 4: case 4:
return '周四' return "周四"
case 5: case 5:
return '周五' return "周五"
case 6: case 6:
return '周六' return "周六"
} }
} }
}, },
@@ -303,7 +305,7 @@ layout("/mobile/platform.html"){
if (this.site.workday === true) { if (this.site.workday === true) {
let week = day.date.getDay() let week = day.date.getDay()
if (week === 0 || week === 6) { if (week === 0 || week === 6) {
day.type = 'disabled' day.type = "disabled"
} }
} }
return day return day
@@ -313,10 +315,10 @@ layout("/mobile/platform.html"){
methods: { methods: {
close(f) { close(f) {
if (this.times.length === 1) { if (this.times.length === 1) {
vant.Toast('必须保留一个时间段') vant.Toast("必须保留一个时间段")
return return
} }
const index = this.times.findIndex(v => v.fullDay === f) const index = this.times.findIndex((v) => v.fullDay === f)
this.times.splice(index, 1) this.times.splice(index, 1)
}, },
onConfirm(date) { onConfirm(date) {
@@ -330,9 +332,9 @@ layout("/mobile/platform.html"){
wk.push(moment(startDate)) wk.push(moment(startDate))
let count = 1 let count = 1
while (wk.length < 7) { while (wk.length < 7) {
const addDate = moment(startDate).add(count, 'd') const addDate = moment(startDate).add(count, "d")
//这里不是休息日才能加到数组里 //这里不是休息日才能加到数组里
if (addDate.day() !== 0 && addDate.day() !== 6 && !this.holidays.includes(moment(addDate).format('YYYY-MM-DD'))) { if (addDate.day() !== 0 && addDate.day() !== 6 && !this.holidays.includes(moment(addDate).format("YYYY-MM-DD"))) {
wk.push(addDate) wk.push(addDate)
} }
count++ count++
@@ -345,7 +347,7 @@ layout("/mobile/platform.html"){
}, },
reserve() { reserve() {
if (this.times.length === 0) { if (this.times.length === 0) {
vant.Toast('请选择要预约的时段') vant.Toast("请选择要预约的时段")
return return
} }
this.show = true this.show = true
@@ -373,27 +375,27 @@ layout("/mobile/platform.html"){
}, },
chooseTime(item) { chooseTime(item) {
const cloneItem = clone(item) const cloneItem = clone(item)
const map = this.times.map(o => o.fullDay) const map = this.times.map((o) => o.fullDay)
const index = map.indexOf(this.selectDate.format('YYYY-MM-DD') + ' ' + cloneItem.start_time + '-' + cloneItem.end_time) const index = map.indexOf(this.selectDate.format("YYYY-MM-DD") + " " + cloneItem.start_time + "-" + cloneItem.end_time)
if (index > -1) { if (index > -1) {
this.times.splice(index, 1) this.times.splice(index, 1)
} else { } else {
cloneItem.day = this.selectDate.format('YYYY-MM-DD') cloneItem.day = this.selectDate.format("YYYY-MM-DD")
cloneItem.fullDay = cloneItem.day + ' ' + cloneItem.start_time + '-' + cloneItem.end_time cloneItem.fullDay = cloneItem.day + " " + cloneItem.start_time + "-" + cloneItem.end_time
this.times.push(cloneItem) this.times.push(cloneItem)
} }
}, },
isCanRe(item) { isCanRe(item) {
const now = new Date() const now = new Date()
const end = moment().format('YYYY-MM-DD') + ' ' + item.end_time + ':00' const end = moment().format("YYYY-MM-DD") + " " + item.end_time + ":00"
const itemFullTime = this.selectDate.format('YYYY-MM-DD') + " " + item.start_time + "-" + item.end_time const itemFullTime = this.selectDate.format("YYYY-MM-DD") + " " + item.start_time + "-" + item.end_time
if (this.alreadyReserveRecord.includes(itemFullTime)) { if (this.alreadyReserveRecord.includes(itemFullTime)) {
return 3 return 3
} }
if (now.getTime() >= new Date(end).getTime() && this.selectDate.format('YYYY-MM-DD') === moment().format('YYYY-MM-DD')) { if (now.getTime() >= new Date(end).getTime() && this.selectDate.format("YYYY-MM-DD") === moment().format("YYYY-MM-DD")) {
return 0 return 0
} else { } else {
if (this.site.multiple) { if (this.site.multiple) {
@@ -406,7 +408,7 @@ layout("/mobile/platform.html"){
async onLoad() { async onLoad() {
this.loading = true this.loading = true
$.post('/mobile/activity/site/info/getDetail', {id: this.site_id}).then(res => { $.post("/mobile/activity/site/info/getDetail", { id: this.site_id }).then((res) => {
if (res.code === 0) { if (res.code === 0) {
this.site = res.data this.site = res.data
} }
@@ -414,23 +416,23 @@ layout("/mobile/platform.html"){
}) })
}, },
async getReserve() { async getReserve() {
const resp = await $.post('/mobile/activity/site/info/getReserve', { const resp = await $.post("/mobile/activity/site/info/getReserve", {
siteId: this.site_id, siteId: this.site_id,
day: moment(this.selectDate).format('YYYY-MM-DD'), day: moment(this.selectDate).format("YYYY-MM-DD")
}) })
if (resp.code === 0) { if (resp.code === 0) {
resp.data.forEach(item => { resp.data.forEach((item) => {
item.isClick = true item.isClick = true
}) })
this.timeData = resp.data this.timeData = resp.data
} }
}, },
async getMyReservation() { async getMyReservation() {
const resp = await $.post('/mobile/activity/site/info/getMyReservation', { const resp = await $.post("/mobile/activity/site/info/getMyReservation", {
site_id: this.site_id site_id: this.site_id
}) })
if (resp.code === 0) { if (resp.code === 0) {
this.alreadyReserveRecord = resp.data.map(v => v.reserve_day + " " + v.start_time + "-" + v.end_time) this.alreadyReserveRecord = resp.data.map((v) => v.reserve_day + " " + v.start_time + "-" + v.end_time)
} }
}, },
//获取最新的一个工作日设为当前时间 //获取最新的一个工作日设为当前时间
@@ -440,10 +442,10 @@ layout("/mobile/platform.html"){
let selectDate = null let selectDate = null
if (weekNum === 0) { if (weekNum === 0) {
//周日 //周日
selectDate = moment().add(1, 'd') selectDate = moment().add(1, "d")
} else if (weekNum === 6) { } else if (weekNum === 6) {
//周六 //周六
selectDate = moment().add(2, 'd') selectDate = moment().add(2, "d")
} else { } else {
selectDate = moment() selectDate = moment()
} }
@@ -451,13 +453,12 @@ layout("/mobile/platform.html"){
} }
}, },
async created() { async created() {
this.site_id = getQueryString('id') this.site_id = getQueryString("id")
this.selectDate = this.getLatestWorkDay() this.selectDate = this.getLatestWorkDay()
this.setWeekList(this.selectDate) this.setWeekList(this.selectDate)
await this.getReserve() await this.getReserve()
await this.onLoad() await this.onLoad()
await this.getMyReservation() await this.getMyReservation()
} }
}) })
</script> </script>
@@ -3,57 +3,47 @@ layout("/mobile/platform.html"){
#--> #-->
<div id="app"> <div id="app">
<van-nav-bar title="场地预约离退休工作处审核" left-arrow placeholder fixed <van-nav-bar title="场地预约离退休工作处审核" left-arrow placeholder fixed @click-left="pjaxReplace('/mobile/index')"></van-nav-bar>
@click-left="history.back()"></van-nav-bar>
<site_h5_info :id="id"> <site_h5_info :id="id">
<template #audit> <template #audit>
<div class="van-cell-group__title mt10"> <div class="van-cell-group__title mt10">
<div class="van-sidebar-item van-sidebar-item--select"> <div class="van-sidebar-item van-sidebar-item--select">离退休工作处审核</div>
离退休工作处审核
</div>
</div> </div>
<van-form> <van-form>
<van-field readonly <van-field readonly value="${@shiro.getPrincipalProperty('username')}" name="username" label="审核人员"></van-field>
value="${@shiro.getPrincipalProperty('username')}"
name="username" <van-field :value="moment().format('YYYY-MM-DD')" label="审核时间" readonly></van-field>
label="审核人员"
<van-field
v-model="formData.auditOpinion"
rows="1"
required
autosize
label="审核意见"
type="textarea"
placeholder="请输入审核意见"
></van-field> ></van-field>
<van-field :value="moment().format('YYYY-MM-DD')" <!-- <van-field label="签字" required style="flex-flow: column">-->
label="审核时间" <!-- <template #label>-->
readonly></van-field> <!-- <div class="mb10">签&emsp;&emsp;字</div>-->
<!-- </template>-->
<!-- <template #input>-->
<!-- <mobile-sign ref="signature" :my_sign.sync="formData.auditSign"></mobile-sign>-->
<!-- </template>-->
<!-- </van-field>-->
<van-field v-model="formData.auditOpinion" <van-row gutter="20" style="margin-top: 30px; padding: 0 25px">
rows="1"
required
autosize
label="审核意见"
type="textarea"
placeholder="请输入审核意见"
></van-field>
<!-- <van-field label="签字" required style="flex-flow: column">-->
<!-- <template #label>-->
<!-- <div class="mb10">签&emsp;&emsp;字</div>-->
<!-- </template>-->
<!-- <template #input>-->
<!-- <mobile-sign ref="signature" :my_sign.sync="formData.auditSign"></mobile-sign>-->
<!-- </template>-->
<!-- </van-field>-->
<van-row gutter="20" style="margin-top: 30px;padding: 0 25px">
<van-col span="12"> <van-col span="12">
<van-button :color="themeColor" plain block @click="doAudit(false)">拒 绝 <van-button :color="themeColor" plain block @click="doAudit(false)">拒 绝</van-button>
</van-button>
</van-col> </van-col>
<!-- <van-col span="8">--> <!-- <van-col span="8">-->
<!-- <van-button color="red" block plain @click="doAudit(2)">返回修改--> <!-- <van-button color="red" block plain @click="doAudit(2)">返回修改-->
<!-- </van-button>--> <!-- </van-button>-->
<!-- </van-col>--> <!-- </van-col>-->
<van-col span="12"> <van-col span="12">
<van-button :color="themeColor" block @click="doAudit(true)">通 过 <van-button :color="themeColor" block @click="doAudit(true)">通 过</van-button>
</van-button>
</van-col> </van-col>
</van-row> </van-row>
</van-form> </van-form>
@@ -63,11 +53,11 @@ layout("/mobile/platform.html"){
<script> <script>
const vue = new Vue({ const vue = new Vue({
el: '#app', el: "#app",
mixins: [mobileMixins], mixins: [mobileMixins],
components: { components: {
'site_h5_info': httpVueLoader('/components/activity/site/SiteH5Info.vue'), site_h5_info: httpVueLoader("/components/activity/site/SiteH5Info.vue"),
'mobile-sign': httpVueLoader('/components/sign/mobileSign.vue'), "mobile-sign": httpVueLoader("/components/sign/mobileSign.vue")
}, },
data() { data() {
return { return {
@@ -77,41 +67,40 @@ layout("/mobile/platform.html"){
}, },
methods: { methods: {
async doAudit(pass) { async doAudit(pass) {
if (this.formData.auditOpinion == null || this.formData.auditOpinion === '') { if (this.formData.auditOpinion == null || this.formData.auditOpinion === "") {
this.$toast('请填写审核意见') this.$toast("请填写审核意见")
return return
} }
this.$dialog.confirm({ this.$dialog
title: '提示', .confirm({
message: '您确定要' + (pass ? '通过' : '拒绝') + '吗?', title: "提示",
}).then(async () => { message: "您确定要" + (pass ? "通过" : "拒绝") + "吗?"
const loading = this.$toast.loading({
message: '提交中...',
forbidClick: true,
}) })
this.formData.auditPass = pass .then(async () => {
const {data, code, msg} = await $.post('/platform/activity/site/unionProcess/doProcess', const loading = this.$toast.loading({
{ message: "提交中...",
forbidClick: true
})
this.formData.auditPass = pass
const { data, code, msg } = await $.post("/platform/activity/site/unionProcess/doProcess", {
id: this.id, id: this.id,
audit: this.formData, audit: this.formData
}); })
loading.clear() loading.clear()
if (code === 0) { if (code === 0) {
this.$toast.success(msg) this.$toast.success(msg)
setTimeout(() => { setTimeout(() => {
window.history.back() window.history.back()
}, 500) }, 500)
} else { } else {
this.$toast.fail(msg) this.$toast.fail(msg)
} }
}).catch(() => { })
}) .catch(() => {})
} }
}, },
created() { created() {}
}
}) })
</script> </script>
@@ -46,11 +46,9 @@ layout("/mobile/platform.html"){
} }
.cell .title { .cell .title {
} }
.cell .content { .cell .content {
} }
.extra { .extra {
@@ -63,45 +61,34 @@ layout("/mobile/platform.html"){
.van-dropdown-menu__bar .van-dropdown-menu__item { .van-dropdown-menu__bar .van-dropdown-menu__item {
flex: 1; flex: 1;
} }
</style> </style>
<div id="app" v-cloak> <div id="app" v-cloak>
<div> <div>
<van-nav-bar title="场地预约离退休工作处审核" left-arrow placeholder fixed <van-nav-bar title="场地预约离退休工作处审核" left-arrow placeholder fixed @click-left="pjaxReplace('/mobile/index')"></van-nav-bar>
@click-left="history.back()"></van-nav-bar>
<div class="search-fixed"> <div class="search-fixed">
<van-dropdown-menu active-color="rgb(0, 78, 100)"> <van-dropdown-menu active-color="rgb(0, 78, 100)">
<van-dropdown-item :title="pageForm.time" ref="dropItemYearMonth"> <van-dropdown-item :title="pageForm.time" ref="dropItemYearMonth">
<van-datetime-picker <van-datetime-picker
v-model="currentDate" v-model="currentDate"
type="year-month" type="year-month"
:max-date="maxDate" :max-date="maxDate"
title="选择年月" title="选择年月"
@confirm="onConfirmDate" @confirm="onConfirmDate"
@cancel="onCancelDate" @cancel="onCancelDate"
></van-datetime-picker> ></van-datetime-picker>
</van-dropdown-item> </van-dropdown-item>
<van-dropdown-item v-model="pageForm.isAudit" :options="auditOptions" <van-dropdown-item v-model="pageForm.isAudit" :options="auditOptions" @change="doSearch"></van-dropdown-item>
@change="doSearch"></van-dropdown-item>
</van-dropdown-menu> </van-dropdown-menu>
</div> </div>
<div class="table-list"> <div class="table-list">
<van-list v-model="loading" <van-list v-model="loading" :finished="finished" :finished-text="tableData.length>0?'没有更多了':''" @load="pageData">
:finished="finished"
:finished-text="tableData.length>0?'没有更多了':''"
@load="pageData">
<div v-for="item in tableData" :key="item.id" class="table-item"> <div v-for="item in tableData" :key="item.id" class="table-item">
<div> <div>
<div class="header-title"> <div class="header-title">{{item.reserve_cause}}</div>
{{item.reserve_cause}} <van-tag class="header-title-extra" :type="tagType(item.reserve_state)">{{item.state_name}}</van-tag>
</div>
<van-tag class="header-title-extra" :type="tagType(item.reserve_state)">
{{item.state_name}}
</van-tag>
<div class="cell"> <div class="cell">
<div class="title">预约场地:</div> <div class="title">预约场地:</div>
@@ -129,41 +116,36 @@ layout("/mobile/platform.html"){
</div> </div>
<div class="extra"> <div class="extra">
<van-button size="small" type="info" @click="openView(item.id)">查看详情</van-button> <van-button size="small" type="info" @click="openView(item.id)">查看详情</van-button>
<van-button size="small" type="info" @click="openAudit(item.id)" <van-button size="small" type="info" @click="openAudit(item.id)" v-if="item.reserve_state===6090">审核预约</van-button>
v-if="item.reserve_state===6090">审核预约
</van-button>
</div> </div>
</div> </div>
</div> </div>
</van-list> </van-list>
</div> </div>
<van-empty v-if="tableData.length==0" class="custom-image" <van-empty v-if="tableData.length==0" class="custom-image" image="/none.svg" description="暂无数据"></van-empty>
image="/none.svg"
description="暂无数据">
</van-empty>
</div> </div>
</div> </div>
<script> <script>
const vue = new Vue({ const vue = new Vue({
el: '#app', el: "#app",
mixins: [mobileMixins], mixins: [mobileMixins],
data() { data() {
return { return {
tableData: [], tableData: [],
pageForm: { pageForm: {
isAudit: false, isAudit: false,
time: moment().format('YYYY-MM') time: moment().format("YYYY-MM")
// time:moment(moment().format('YYYY-MM')).add(1, 'months').format('YYYY-MM') // time:moment(moment().format('YYYY-MM')).add(1, 'months').format('YYYY-MM')
}, },
pageDataUrl: '/platform/activity/site/retireProcess/pageData', pageDataUrl: "/platform/activity/site/retireProcess/pageData",
maxDate: null, maxDate: null,
currentDate: new Date(), currentDate: new Date(),
auditOptions: [ auditOptions: [
{text: '全部', value: null}, { text: "全部", value: null },
{text: '已审核', value: true}, { text: "已审核", value: true },
{text: '未审核', value: false}, { text: "未审核", value: false }
] ]
} }
}, },
@@ -171,45 +153,43 @@ layout("/mobile/platform.html"){
tagType() { tagType() {
return (reserveState) => { return (reserveState) => {
if (reserveState === 6138) { if (reserveState === 6138) {
return 'success'; return "success"
} else if ([6095, 6128].includes(reserveState)) { } else if ([6095, 6128].includes(reserveState)) {
return 'danger'; return "danger"
} }
return 'primary'; return "primary"
}; }
}, }
}, },
methods: { methods: {
async openAudit(id) { async openAudit(id) {
window.location.href = loc() + '/audit?id=' + id window.location.href = loc() + "/audit?id=" + id
}, },
openView(id) { openView(id) {
window.location.href = '/mobile/activity/site/mine/detail?id=' + id window.location.href = "/mobile/activity/site/mine/detail?id=" + id
}, },
onCancelDate() { onCancelDate() {
this.$refs.dropItemYearMonth.toggle(); this.$refs.dropItemYearMonth.toggle()
}, },
onConfirmDate(val) { onConfirmDate(val) {
this.pageForm.time = moment(val).format('YYYY-MM') this.pageForm.time = moment(val).format("YYYY-MM")
this.$refs.dropItemYearMonth.toggle() this.$refs.dropItemYearMonth.toggle()
this.doSearch() this.doSearch()
} }
}, },
created() { created() {
let maxDate = new Date(); let maxDate = new Date()
maxDate.setMonth(maxDate.getMonth() + 1); maxDate.setMonth(maxDate.getMonth() + 1)
this.maxDate = maxDate this.maxDate = maxDate
// this.pageData() // this.pageData()
} }
}) })
window.addEventListener('pageshow', e => { window.addEventListener("pageshow", (e) => {
if (e.persisted || (window.performance && window.performance.navigation.type === 2)) { if (e.persisted || (window.performance && window.performance.navigation.type === 2)) {
vue.doSearch() vue.doSearch()
} }
}) })
</script> </script>
<!--# <!--#
@@ -3,58 +3,47 @@ layout("/mobile/platform.html"){
#--> #-->
<div id="app"> <div id="app">
<van-nav-bar title="场地预约校工会审核" left-arrow placeholder fixed <van-nav-bar title="场地预约校工会审核" left-arrow placeholder fixed @click-left="pjaxReplace('/mobile/index')"></van-nav-bar>
@click-left="history.back()"></van-nav-bar>
<site_h5_info :id="id"> <site_h5_info :id="id">
<template #audit> <template #audit>
<div class="van-cell-group__title mt10"> <div class="van-cell-group__title mt10">
<div class="van-sidebar-item van-sidebar-item--select"> <div class="van-sidebar-item van-sidebar-item--select">校工会审核</div>
校工会审核
</div>
</div> </div>
<van-form> <van-form>
<van-field readonly <van-field readonly value="${@shiro.getPrincipalProperty('username')}" name="username" label="审核人员"></van-field>
value="${@shiro.getPrincipalProperty('username')}"
name="username" <van-field :value="moment().format('YYYY-MM-DD')" label="审核时间" readonly></van-field>
label="审核人员"
<van-field
v-model="formData.auditOpinion"
rows="1"
required
autosize
label="审核意见"
type="textarea"
placeholder="请输入审核意见"
></van-field> ></van-field>
<van-field :value="moment().format('YYYY-MM-DD')" <!-- <van-field label="签字" required style="flex-flow: column">-->
label="审核时间" <!-- <template #label>-->
readonly></van-field> <!-- <div class="mb10">签&emsp;&emsp;字</div>-->
<!-- </template>-->
<!-- <template #input>-->
<!-- <mobile-sign ref="signature" :my_sign.sync="formData.auditSign"></mobile-sign>-->
<!-- </template>-->
<!-- </van-field>-->
<van-field v-model="formData.auditOpinion" <van-row gutter="20" style="margin-top: 30px; padding: 0 25px">
rows="1"
required
autosize
label="审核意见"
type="textarea"
placeholder="请输入审核意见"
></van-field>
<!-- <van-field label="签字" required style="flex-flow: column">-->
<!-- <template #label>-->
<!-- <div class="mb10">签&emsp;&emsp;字</div>-->
<!-- </template>-->
<!-- <template #input>-->
<!-- <mobile-sign ref="signature" :my_sign.sync="formData.auditSign"></mobile-sign>-->
<!-- </template>-->
<!-- </van-field>-->
<van-row gutter="20" style="margin-top: 30px;padding: 0 25px">
<van-col span="12"> <van-col span="12">
<van-button :color="themeColor" plain block @click="doAudit(false)">拒 绝 <van-button :color="themeColor" plain block @click="doAudit(false)">拒 绝</van-button>
</van-button>
</van-col> </van-col>
<!-- <van-col span="8">--> <!-- <van-col span="8">-->
<!-- <van-button color="red" block plain @click="doAudit(2)">返回修改--> <!-- <van-button color="red" block plain @click="doAudit(2)">返回修改-->
<!-- </van-button>--> <!-- </van-button>-->
<!-- </van-col>--> <!-- </van-col>-->
<van-col span="12"> <van-col span="12">
<van-button :color="themeColor" block @click="doAudit(true)">通 过 <van-button :color="themeColor" block @click="doAudit(true)">通 过</van-button>
</van-button>
</van-col> </van-col>
</van-row> </van-row>
</van-form> </van-form>
@@ -64,11 +53,11 @@ layout("/mobile/platform.html"){
<script> <script>
const vue = new Vue({ const vue = new Vue({
el: '#app', el: "#app",
mixins: [mobileMixins], mixins: [mobileMixins],
components: { components: {
'site_h5_info': httpVueLoader('/components/activity/site/SiteH5Info.vue'), site_h5_info: httpVueLoader("/components/activity/site/SiteH5Info.vue"),
'mobile-sign': httpVueLoader('/components/sign/mobileSign.vue'), "mobile-sign": httpVueLoader("/components/sign/mobileSign.vue")
}, },
data() { data() {
return { return {
@@ -78,40 +67,40 @@ layout("/mobile/platform.html"){
}, },
methods: { methods: {
async doAudit(pass) { async doAudit(pass) {
if (this.formData.auditOpinion == null || this.formData.auditOpinion === '') { if (this.formData.auditOpinion == null || this.formData.auditOpinion === "") {
this.$toast('请填写审核意见') this.$toast("请填写审核意见")
return return
} }
this.$dialog.confirm({ this.$dialog
title: '提示', .confirm({
message: '您确定要' + (pass ? '通过' : '拒绝') + '吗?', title: "提示",
}).then(async () => { message: "您确定要" + (pass ? "通过" : "拒绝") + "吗?"
const loading = this.$toast.loading({
message: '提交中...',
forbidClick: true,
}) })
this.formData.auditPass = pass .then(async () => {
const {data, code, msg} = await $.post('/platform/activity/site/review/doProcess', { const loading = this.$toast.loading({
id: this.id, message: "提交中...",
audit: JSON.stringify(this.formData) forbidClick: true
})
this.formData.auditPass = pass
const { data, code, msg } = await $.post("/platform/activity/site/review/doProcess", {
id: this.id,
audit: JSON.stringify(this.formData)
})
loading.clear()
if (code === 0) {
this.$toast.success(msg)
setTimeout(() => {
window.history.back()
}, 500)
} else {
this.$toast.fail(msg)
}
}) })
loading.clear() .catch(() => {})
if (code === 0) {
this.$toast.success(msg)
setTimeout(() => {
window.history.back()
}, 500)
} else {
this.$toast.fail(msg)
}
}).catch(() => {
})
} }
}, },
created() { created() {}
}
}) })
</script> </script>
@@ -46,11 +46,9 @@ layout("/mobile/platform.html"){
} }
.cell .title { .cell .title {
} }
.cell .content { .cell .content {
} }
.extra { .extra {
@@ -63,46 +61,35 @@ layout("/mobile/platform.html"){
.van-dropdown-menu__bar .van-dropdown-menu__item { .van-dropdown-menu__bar .van-dropdown-menu__item {
flex: 1; flex: 1;
} }
</style> </style>
<div id="app" v-cloak> <div id="app" v-cloak>
<div> <div>
<van-nav-bar title="场地预约校工会审核" left-arrow placeholder fixed <van-nav-bar title="场地预约校工会审核" left-arrow placeholder fixed @click-left="pjaxReplace('/mobile/index')"></van-nav-bar>
@click-left="history.back()"></van-nav-bar>
<div class="search-fixed"> <div class="search-fixed">
<van-dropdown-menu active-color="#1989fa"> <van-dropdown-menu active-color="#1989fa">
<van-dropdown-item :title="pageForm.time" ref="dropItemYearMonth"> <van-dropdown-item :title="pageForm.time" ref="dropItemYearMonth">
<van-datetime-picker <van-datetime-picker
v-model="currentDate" v-model="currentDate"
type="year-month" type="year-month"
:max-date="maxDate" :max-date="maxDate"
title="选择年月" title="选择年月"
@confirm="onConfirmDate" @confirm="onConfirmDate"
@cancel="onCancelDate" @cancel="onCancelDate"
></van-datetime-picker> ></van-datetime-picker>
</van-dropdown-item> </van-dropdown-item>
<van-dropdown-item v-model="pageForm.isAudit" :options="auditOptions" <van-dropdown-item v-model="pageForm.isAudit" :options="auditOptions" @change="doSearch"></van-dropdown-item>
@change="doSearch"></van-dropdown-item>
</van-dropdown-menu> </van-dropdown-menu>
</div> </div>
<div class="table-list"> <div class="table-list">
<van-list v-model="loading" <van-list v-model="loading" :finished="finished" :finished-text="tableData.length>0?'没有更多了':''" @load="pageData">
:finished="finished"
:finished-text="tableData.length>0?'没有更多了':''"
@load="pageData">
<div v-for="item in tableData" :key="item.id" class="table-item"> <div v-for="item in tableData" :key="item.id" class="table-item">
<div> <div>
<div class="header-title"> <div class="header-title">{{item.reserve_cause}}</div>
{{item.reserve_cause}}
</div>
<van-tag class="header-title-extra" :type="tagType(item.reserve_state)"> <van-tag class="header-title-extra" :type="tagType(item.reserve_state)">{{item.state_name}}</van-tag>
{{item.state_name}}
</van-tag>
<div class="cell"> <div class="cell">
<div class="title">预约场地:</div> <div class="title">预约场地:</div>
@@ -134,40 +121,35 @@ layout("/mobile/platform.html"){
</div> </div>
<div class="extra"> <div class="extra">
<van-button size="small" type="info" @click="openView(item.id)">查看详情</van-button> <van-button size="small" type="info" @click="openView(item.id)">查看详情</van-button>
<van-button size="small" type="info" @click="openAudit(item.id)" <van-button size="small" type="info" @click="openAudit(item.id)" v-if="item.reserve_state===6118">审核预约</van-button>
v-if="item.reserve_state===6118">审核预约
</van-button>
</div> </div>
</div> </div>
</div> </div>
</van-list> </van-list>
</div> </div>
<van-empty v-if="tableData.length==0" class="custom-image" <van-empty v-if="tableData.length==0" class="custom-image" image="/none.svg" description="暂无数据"></van-empty>
image="/none.svg"
description="暂无数据">
</van-empty>
</div> </div>
</div> </div>
<script> <script>
const vue = new Vue({ const vue = new Vue({
el: '#app', el: "#app",
mixins: [mobileMixins], mixins: [mobileMixins],
data() { data() {
return { return {
tableData: [], tableData: [],
pageForm: { pageForm: {
isAudit: false, isAudit: false,
time: moment().format('YYYY-MM') time: moment().format("YYYY-MM")
}, },
pageDataUrl: '/platform/activity/site/review/pageData', pageDataUrl: "/platform/activity/site/review/pageData",
maxDate: null, maxDate: null,
currentDate: new Date(), currentDate: new Date(),
auditOptions: [ auditOptions: [
{text: '全部', value: null}, { text: "全部", value: null },
{text: '已审核', value: true}, { text: "已审核", value: true },
{text: '未审核', value: false}, { text: "未审核", value: false }
] ]
} }
}, },
@@ -175,43 +157,42 @@ layout("/mobile/platform.html"){
tagType() { tagType() {
return (reserveState) => { return (reserveState) => {
if (reserveState === 6138) { if (reserveState === 6138) {
return 'success'; return "success"
} else if (reserveState === 6128) { } else if (reserveState === 6128) {
return 'danger'; return "danger"
} }
return 'primary'; return "primary"
}; }
}, }
}, },
methods: { methods: {
async openAudit(id) { async openAudit(id) {
window.location.href = loc() + '/audit?id=' + id window.location.href = loc() + "/audit?id=" + id
}, },
openView(id) { openView(id) {
window.location.href = '/mobile/activity/site/mine/detail?id=' + id window.location.href = "/mobile/activity/site/mine/detail?id=" + id
}, },
onCancelDate() { onCancelDate() {
this.$refs.dropItemYearMonth.toggle(); this.$refs.dropItemYearMonth.toggle()
}, },
onConfirmDate(val) { onConfirmDate(val) {
this.pageForm.time = moment(val).format('YYYY-MM') this.pageForm.time = moment(val).format("YYYY-MM")
this.$refs.dropItemYearMonth.toggle() this.$refs.dropItemYearMonth.toggle()
this.doSearch() this.doSearch()
} }
}, },
created() { created() {
let maxDate = new Date(); let maxDate = new Date()
maxDate.setMonth(maxDate.getMonth() + 1); maxDate.setMonth(maxDate.getMonth() + 1)
this.maxDate = maxDate this.maxDate = maxDate
} }
}) })
window.addEventListener('pageshow', e => { window.addEventListener("pageshow", (e) => {
if (e.persisted || (window.performance && window.performance.navigation.type === 2)) { if (e.persisted || (window.performance && window.performance.navigation.type === 2)) {
vue.doSearch() vue.doSearch()
} }
}) })
</script> </script>
<!--# <!--#
@@ -3,57 +3,47 @@ layout("/mobile/platform.html"){
#--> #-->
<div id="app"> <div id="app">
<van-nav-bar title="场地预约分工会审核" left-arrow placeholder fixed <van-nav-bar title="场地预约分工会审核" left-arrow placeholder fixed @click-left="pjaxReplace('/mobile/index')"></van-nav-bar>
@click-left="history.back()"></van-nav-bar>
<site_h5_info :id="id"> <site_h5_info :id="id">
<template #audit> <template #audit>
<div class="van-cell-group__title mt10"> <div class="van-cell-group__title mt10">
<div class="van-sidebar-item van-sidebar-item--select"> <div class="van-sidebar-item van-sidebar-item--select">分工会审核</div>
分工会审核
</div>
</div> </div>
<van-form> <van-form>
<van-field readonly <van-field readonly value="${@shiro.getPrincipalProperty('username')}" name="username" label="审核人员"></van-field>
value="${@shiro.getPrincipalProperty('username')}"
name="username" <van-field :value="moment().format('YYYY-MM-DD')" label="审核时间" readonly></van-field>
label="审核人员"
<van-field
v-model="formData.auditOpinion"
rows="1"
required
autosize
label="审核意见"
type="textarea"
placeholder="请输入审核意见"
></van-field> ></van-field>
<van-field :value="moment().format('YYYY-MM-DD')" <!-- <van-field label="签字" required style="flex-flow: column">-->
label="审核时间" <!-- <template #label>-->
readonly></van-field> <!-- <div class="mb10">签&emsp;&emsp;字</div>-->
<!-- </template>-->
<!-- <template #input>-->
<!-- <mobile-sign ref="signature" :my_sign.sync="formData.auditSign"></mobile-sign>-->
<!-- </template>-->
<!-- </van-field>-->
<van-field v-model="formData.auditOpinion" <van-row gutter="20" style="margin-top: 30px; padding: 0 25px">
rows="1"
required
autosize
label="审核意见"
type="textarea"
placeholder="请输入审核意见"
></van-field>
<!-- <van-field label="签字" required style="flex-flow: column">-->
<!-- <template #label>-->
<!-- <div class="mb10">签&emsp;&emsp;字</div>-->
<!-- </template>-->
<!-- <template #input>-->
<!-- <mobile-sign ref="signature" :my_sign.sync="formData.auditSign"></mobile-sign>-->
<!-- </template>-->
<!-- </van-field>-->
<van-row gutter="20" style="margin-top: 30px;padding: 0 25px">
<van-col span="12"> <van-col span="12">
<van-button :color="themeColor" plain block @click="doAudit(false)">拒 绝 <van-button :color="themeColor" plain block @click="doAudit(false)">拒 绝</van-button>
</van-button>
</van-col> </van-col>
<!-- <van-col span="8">--> <!-- <van-col span="8">-->
<!-- <van-button color="red" block plain @click="doAudit(2)">返回修改--> <!-- <van-button color="red" block plain @click="doAudit(2)">返回修改-->
<!-- </van-button>--> <!-- </van-button>-->
<!-- </van-col>--> <!-- </van-col>-->
<van-col span="12"> <van-col span="12">
<van-button :color="themeColor" block @click="doAudit(true)">通 过 <van-button :color="themeColor" block @click="doAudit(true)">通 过</van-button>
</van-button>
</van-col> </van-col>
</van-row> </van-row>
</van-form> </van-form>
@@ -63,11 +53,11 @@ layout("/mobile/platform.html"){
<script> <script>
const vue = new Vue({ const vue = new Vue({
el: '#app', el: "#app",
mixins: [mobileMixins], mixins: [mobileMixins],
components: { components: {
'site_h5_info': httpVueLoader('/components/activity/site/SiteH5Info.vue'), site_h5_info: httpVueLoader("/components/activity/site/SiteH5Info.vue"),
'mobile-sign': httpVueLoader('/components/sign/mobileSign.vue'), "mobile-sign": httpVueLoader("/components/sign/mobileSign.vue")
}, },
data() { data() {
return { return {
@@ -77,41 +67,40 @@ layout("/mobile/platform.html"){
}, },
methods: { methods: {
async doAudit(pass) { async doAudit(pass) {
if (this.formData.auditOpinion == null || this.formData.auditOpinion === '') { if (this.formData.auditOpinion == null || this.formData.auditOpinion === "") {
this.$toast('请填写审核意见') this.$toast("请填写审核意见")
return return
} }
this.$dialog.confirm({ this.$dialog
title: '提示', .confirm({
message: '您确定要' + (pass ? '通过' : '拒绝') + '吗?', title: "提示",
}).then(async () => { message: "您确定要" + (pass ? "通过" : "拒绝") + "吗?"
const loading = this.$toast.loading({
message: '提交中...',
forbidClick: true,
}) })
this.formData.auditPass = pass .then(async () => {
const {data, code, msg} = await $.post('/platform/activity/site/unionProcess/doProcess', const loading = this.$toast.loading({
{ message: "提交中...",
forbidClick: true
})
this.formData.auditPass = pass
const { data, code, msg } = await $.post("/platform/activity/site/unionProcess/doProcess", {
id: this.id, id: this.id,
audit: this.formData, audit: this.formData
}); })
loading.clear() loading.clear()
if (code === 0) { if (code === 0) {
this.$toast.success(msg) this.$toast.success(msg)
setTimeout(() => { setTimeout(() => {
window.history.back() window.history.back()
}, 500) }, 500)
} else { } else {
this.$toast.fail(msg) this.$toast.fail(msg)
} }
}).catch(() => { })
}) .catch(() => {})
} }
}, },
created() { created() {}
}
}) })
</script> </script>
@@ -46,11 +46,9 @@ layout("/mobile/platform.html"){
} }
.cell .title { .cell .title {
} }
.cell .content { .cell .content {
} }
.extra { .extra {
@@ -63,45 +61,34 @@ layout("/mobile/platform.html"){
.van-dropdown-menu__bar .van-dropdown-menu__item { .van-dropdown-menu__bar .van-dropdown-menu__item {
flex: 1; flex: 1;
} }
</style> </style>
<div id="app" v-cloak> <div id="app" v-cloak>
<div> <div>
<van-nav-bar title="场地预约分工会审核" left-arrow placeholder fixed <van-nav-bar title="场地预约分工会审核" left-arrow placeholder fixed @click-left="pjaxReplace('/mobile/index')"></van-nav-bar>
@click-left="history.back()"></van-nav-bar>
<div class="search-fixed"> <div class="search-fixed">
<van-dropdown-menu active-color="rgb(0, 78, 100)"> <van-dropdown-menu active-color="rgb(0, 78, 100)">
<van-dropdown-item :title="pageForm.time" ref="dropItemYearMonth"> <van-dropdown-item :title="pageForm.time" ref="dropItemYearMonth">
<van-datetime-picker <van-datetime-picker
v-model="currentDate" v-model="currentDate"
type="year-month" type="year-month"
:max-date="maxDate" :max-date="maxDate"
title="选择年月" title="选择年月"
@confirm="onConfirmDate" @confirm="onConfirmDate"
@cancel="onCancelDate" @cancel="onCancelDate"
></van-datetime-picker> ></van-datetime-picker>
</van-dropdown-item> </van-dropdown-item>
<van-dropdown-item v-model="pageForm.isAudit" :options="auditOptions" <van-dropdown-item v-model="pageForm.isAudit" :options="auditOptions" @change="doSearch"></van-dropdown-item>
@change="doSearch"></van-dropdown-item>
</van-dropdown-menu> </van-dropdown-menu>
</div> </div>
<div class="table-list"> <div class="table-list">
<van-list v-model="loading" <van-list v-model="loading" :finished="finished" :finished-text="tableData.length>0?'没有更多了':''" @load="pageData">
:finished="finished"
:finished-text="tableData.length>0?'没有更多了':''"
@load="pageData">
<div v-for="item in tableData" :key="item.id" class="table-item"> <div v-for="item in tableData" :key="item.id" class="table-item">
<div> <div>
<div class="header-title"> <div class="header-title">{{item.reserve_cause}}</div>
{{item.reserve_cause}} <van-tag class="header-title-extra" :type="tagType(item.reserve_state)">{{item.state_name}}</van-tag>
</div>
<van-tag class="header-title-extra" :type="tagType(item.reserve_state)">
{{item.state_name}}
</van-tag>
<div class="cell"> <div class="cell">
<div class="title">预约场地:</div> <div class="title">预约场地:</div>
@@ -133,40 +120,35 @@ layout("/mobile/platform.html"){
</div> </div>
<div class="extra"> <div class="extra">
<van-button size="small" type="info" @click="openView(item.id)">查看详情</van-button> <van-button size="small" type="info" @click="openView(item.id)">查看详情</van-button>
<van-button size="small" type="info" @click="openAudit(item.id)" <van-button size="small" type="info" @click="openAudit(item.id)" v-if="item.reserve_state===6098">审核预约</van-button>
v-if="item.reserve_state===6098">审核预约
</van-button>
</div> </div>
</div> </div>
</div> </div>
</van-list> </van-list>
</div> </div>
<van-empty v-if="tableData.length==0" class="custom-image" <van-empty v-if="tableData.length==0" class="custom-image" image="/none.svg" description="暂无数据"></van-empty>
image="/none.svg"
description="暂无数据">
</van-empty>
</div> </div>
</div> </div>
<script> <script>
const vue = new Vue({ const vue = new Vue({
el: '#app', el: "#app",
mixins: [mobileMixins], mixins: [mobileMixins],
data() { data() {
return { return {
tableData: [], tableData: [],
pageForm: { pageForm: {
isAudit: false, isAudit: false,
time: moment().format('YYYY-MM') time: moment().format("YYYY-MM")
}, },
pageDataUrl: '/platform/activity/site/unionProcess/pageData', pageDataUrl: "/platform/activity/site/unionProcess/pageData",
maxDate: new Date(), maxDate: new Date(),
currentDate: new Date(), currentDate: new Date(),
auditOptions: [ auditOptions: [
{text: '全部', value: null}, { text: "全部", value: null },
{text: '已审核', value: true}, { text: "已审核", value: true },
{text: '未审核', value: false}, { text: "未审核", value: false }
] ]
} }
}, },
@@ -174,42 +156,40 @@ layout("/mobile/platform.html"){
tagType() { tagType() {
return (reserveState) => { return (reserveState) => {
if (reserveState === 6138) { if (reserveState === 6138) {
return 'success'; return "success"
} else if ([6108, 6128].includes(reserveState)) { } else if ([6108, 6128].includes(reserveState)) {
return 'danger'; return "danger"
} }
return 'primary'; return "primary"
}; }
}, }
}, },
methods: { methods: {
async openAudit(id) { async openAudit(id) {
window.location.href = loc() + '/audit?id=' + id window.location.href = loc() + "/audit?id=" + id
}, },
openView(id) { openView(id) {
window.location.href = '/mobile/activity/site/mine/detail?id=' + id window.location.href = "/mobile/activity/site/mine/detail?id=" + id
}, },
onCancelDate() { onCancelDate() {
this.$refs.dropItemYearMonth.toggle(); this.$refs.dropItemYearMonth.toggle()
}, },
onConfirmDate(val) { onConfirmDate(val) {
this.pageForm.time = moment(val).format('YYYY-MM') this.pageForm.time = moment(val).format("YYYY-MM")
this.$refs.dropItemYearMonth.toggle() this.$refs.dropItemYearMonth.toggle()
this.doSearch() this.doSearch()
} }
}, },
created() { created() {
// this.pageData() // this.pageData()
} }
}) })
window.addEventListener('pageshow', e => { window.addEventListener("pageshow", (e) => {
if (e.persisted || (window.performance && window.performance.navigation.type === 2)) { if (e.persisted || (window.performance && window.performance.navigation.type === 2)) {
vue.doSearch() vue.doSearch()
} }
}) })
</script> </script>
<!--# <!--#
@@ -14,7 +14,8 @@ layout("/mobile/platform.html"){
border-radius: 5px; border-radius: 5px;
} }
.activity_card .van-image, .activity_card .van-image img { .activity_card .van-image,
.activity_card .van-image img {
border-radius: 5px; border-radius: 5px;
} }
@@ -52,55 +53,41 @@ layout("/mobile/platform.html"){
max-width: 80px; max-width: 80px;
text-align: right; text-align: right;
} }
</style> </style>
<div id="app" v-cloak> <div id="app" v-cloak>
<van-nav-bar title="活动列表" left-arrow placeholder fixed <van-nav-bar title="活动列表" left-arrow placeholder fixed @click-left="pjaxReplace('/mobile/index')"></van-nav-bar>
@click-left="history.go(-1)"></van-nav-bar>
<div class="search-fixed"> <div class="search-fixed">
<van-dropdown-menu active-color="#1989fa"> <van-dropdown-menu active-color="#1989fa">
<van-dropdown-item v-model="pageForm.year" :options="yearList" <van-dropdown-item v-model="pageForm.year" :options="yearList" @change="formChange"></van-dropdown-item>
@change="formChange"></van-dropdown-item> <van-dropdown-item v-model="pageForm.activityStatus" :options="activityStatusList" @change="formChange"></van-dropdown-item>
<van-dropdown-item v-model="pageForm.activityStatus" :options="activityStatusList" <van-dropdown-item v-model="pageForm.activityLevel" :options="activityLevelList" @change="formChange"></van-dropdown-item>
@change="formChange"></van-dropdown-item>
<van-dropdown-item v-model="pageForm.activityLevel" :options="activityLevelList"
@change="formChange"></van-dropdown-item>
</van-dropdown-menu> </van-dropdown-menu>
</div> </div>
<div style="margin: 60px auto 80px auto"> <div style="margin: 60px auto 80px auto">
<van-list v-model="loading" :finished="finished" <van-list v-model="loading" :finished="finished" :finished-text="tableData.length>0?'没有更多了':''" @load="pageData">
:finished-text="tableData.length>0?'没有更多了':''"
@load="pageData">
<div v-for="o in tableData" class="list-card" @click="openReg(o)"> <div v-for="o in tableData" class="list-card" @click="openReg(o)">
<div class="activity_card"> <div class="activity_card">
<van-image <van-image fit="cover" width="100%" height="200" :src="FILE_DOMAIN + '/fileStreamPreview?id=' + o.cover"></van-image>
fit="cover"
width="100%"
height="200"
:src="FILE_DOMAIN + '/fileStreamPreview?id=' + o.cover"
></van-image>
<div class="activity_content"> <div class="activity_content">
<div class="activity_name van-ellipsis"> <div class="activity_name van-ellipsis">
<van-icon name="fire" color="red"></van-icon> <van-icon name="fire" color="red"></van-icon>
<div style="margin-left: 10px;width: calc(100% - 26px);text-overflow: ellipsis;overflow: hidden;white-space: nowrap"> <div style="margin-left: 10px; width: calc(100% - 26px); text-overflow: ellipsis; overflow: hidden; white-space: nowrap">
{{o.name}} {{o.name}}
</div> </div>
</div> </div>
<div class="activity_bottom"> <div class="activity_bottom">
<div class="left" style="width: 100%"> <div class="left" style="width: 100%">
<van-icon name="clock" size="1em"></van-icon> <van-icon name="clock" size="1em"></van-icon>
<span style="margin-left: 10px;"> <span style="margin-left: 10px">
报名时间:{{o.applyStartTime}}至{{o.applyEndTime}} 报名时间:{{o.applyStartTime}}至{{o.applyEndTime}}
<!-- {{moment(o.activityStartTime).format('YYYY/MM/DD HH:mm')}} 至--> <!-- {{moment(o.activityStartTime).format('YYYY/MM/DD HH:mm')}} 至-->
<!-- {{moment(o.activityEndTime).format('YYYY/MM/DD HH:mm')}}--> <!-- {{moment(o.activityEndTime).format('YYYY/MM/DD HH:mm')}}-->
</span> </span>
</div> </div>
<!-- <div class="right">--> <!-- <div class="right">-->
<!-- <span v-if="moment(o.applyEndTime).valueOf() > moment().valueOf() && moment().valueOf() > moment(o.applyStartTime).valueOf()"--> <!-- <span v-if="moment(o.applyEndTime).valueOf() > moment().valueOf() && moment().valueOf() > moment(o.applyStartTime).valueOf()"-->
<!-- style="color: forestgreen">--> <!-- style="color: forestgreen">-->
@@ -124,39 +111,37 @@ layout("/mobile/platform.html"){
<div class="activity_bottom"> <div class="activity_bottom">
<div class="left"> <div class="left">
<van-icon name="clock" size="1em"></van-icon> <van-icon name="clock" size="1em"></van-icon>
<span style="margin-left: 10px;"> <span style="margin-left: 10px">
活动时间:{{o.startTime}} 活动时间:{{o.startTime}}
<!-- {{moment(o.activityStartTime).format('YYYY/MM/DD HH:mm')}} 至--> <!-- {{moment(o.activityStartTime).format('YYYY/MM/DD HH:mm')}} 至-->
<!-- {{moment(o.activityEndTime).format('YYYY/MM/DD HH:mm')}}--> <!-- {{moment(o.activityEndTime).format('YYYY/MM/DD HH:mm')}}-->
</span> </span>
</div> </div>
<div class="right"> <div class="right">
<span v-if="moment(o.applyStartTime).valueOf() > moment().valueOf()" <span v-if="moment(o.applyStartTime).valueOf() > moment().valueOf()" style="color: forestgreen">未开始报名</span>
style="color: forestgreen"> <span
未开始报名 v-else-if="moment(o.applyEndTime).valueOf() > moment().valueOf() && moment().valueOf() > moment(o.applyStartTime).valueOf()"
</span> style="color: forestgreen"
<span v-else-if="moment(o.applyEndTime).valueOf() > moment().valueOf() && moment().valueOf() > moment(o.applyStartTime).valueOf()" >
style="color: forestgreen">
报名中 报名中
</span> </span>
<span v-else-if="moment(o.applyEndTime).valueOf() < moment().valueOf() && moment().valueOf() < moment(o.startTime).valueOf()" <span
style="color: #ee1919"> v-else-if="moment(o.applyEndTime).valueOf() < moment().valueOf() && moment().valueOf() < moment(o.startTime).valueOf()"
style="color: #ee1919"
>
报名结束 报名结束
</span> </span>
<span v-else-if="moment(o.startTime).valueOf() < moment().valueOf() && moment().valueOf() < moment(o.endTime).valueOf()" <span
style="color: forestgreen"> v-else-if="moment(o.startTime).valueOf() < moment().valueOf() && moment().valueOf() < moment(o.endTime).valueOf()"
style="color: forestgreen"
>
活动进行中 活动进行中
</span> </span>
<span v-else-if="moment().valueOf() > moment(o.endTime).valueOf()" <span v-else-if="moment().valueOf() > moment(o.endTime).valueOf()" style="color: #ee1919">活动结束</span>
style="color: #ee1919">
活动结束
</span>
</div> </div>
</div> </div>
<!-- <div class="activity_content" style="font-size: 12px; color: #c4bebe;">--> <!-- <div class="activity_content" style="font-size: 12px; color: #c4bebe;">-->
<!-- <div class="left">--> <!-- <div class="left">-->
<!-- <van-icon name="clock" size="1em"></van-icon>--> <!-- <van-icon name="clock" size="1em"></van-icon>-->
@@ -166,48 +151,40 @@ layout("/mobile/platform.html"){
<!-- </span>--> <!-- </span>-->
<!-- </div>--> <!-- </div>-->
<!-- </div>--> <!-- </div>-->
</div> </div>
</div> </div>
</div> </div>
</van-list> </van-list>
</div> </div>
<van-empty v-if="mLoading==false&&tableData.length==0" class="custom-image" image="/none.svg" <van-empty v-if="mLoading==false&&tableData.length==0" class="custom-image" image="/none.svg" description="暂无数据"></van-empty>
description="暂无数据">
</van-empty>
<div> <div>
<van-tabbar v-model="tabBarIndex" :active-color="themeColor"> <van-tabbar v-model="tabBarIndex" :active-color="themeColor">
<van-tabbar-item icon="home-o" url="/mobile/activity/unionActivity">全部活动 <van-tabbar-item icon="home-o" url="/mobile/activity/unionActivity">全部活动</van-tabbar-item>
</van-tabbar-item> <van-tabbar-item icon="friends-o" url="/mobile/activity/myActivity">我的活动</van-tabbar-item>
<van-tabbar-item icon="friends-o" url="/mobile/activity/myActivity">我的活动
</van-tabbar-item>
</van-tabbar> </van-tabbar>
</div> </div>
</div> </div>
<script> <script>
const vue = new Vue({ const vue = new Vue({
el: '#app', el: "#app",
mixins: [mobileMixins], mixins: [mobileMixins],
data() { data() {
return { return {
pageDataUrl: '/mobile/activity/unionActivity/pageData', pageDataUrl: "/mobile/activity/unionActivity/pageData",
pageForm: { pageForm: {
year: '', year: "",
activityStatus: null activityStatus: null
}, },
tabBarIndex: 0, tabBarIndex: 0,
activityLevelList: [], activityLevelList: [],
activityStatusList: [ activityStatusList: [
{text: '全部', value: 1}, { text: "全部", value: 1 },
{text: '未开始', value: 5}, { text: "未开始", value: 5 },
{text: '报名中', value: 2}, { text: "报名中", value: 2 },
{text: '进行中', value: 3}, { text: "进行中", value: 3 },
{text: '已结束', value: 4} { text: "已结束", value: 4 }
] ]
} }
}, },
@@ -219,7 +196,7 @@ layout("/mobile/platform.html"){
}, },
async pageData() { async pageData() {
this.mLoading = true this.mLoading = true
const resp = await $.post('/mobile/activity/unionActivity/pageData', this.pageForm) const resp = await $.post("/mobile/activity/unionActivity/pageData", this.pageForm)
if (resp.code === 0) { if (resp.code === 0) {
if (resp.data.list.length === 0) { if (resp.data.list.length === 0) {
this.tableData = [] this.tableData = []
@@ -239,30 +216,30 @@ layout("/mobile/platform.html"){
this.pageForm.pageNumber++ this.pageForm.pageNumber++
} }
} }
this.loading = false; this.loading = false
this.mLoading = false this.mLoading = false
}, },
//跳转页面 //跳转页面
openReg(o) { openReg(o) {
console.log(o) console.log(o)
if (moment(o.applyStartTime).valueOf() > moment().valueOf()) { if (moment(o.applyStartTime).valueOf() > moment().valueOf()) {
this.$toast('活动未开始报名') this.$toast("活动未开始报名")
return; return
} }
if (o.projectTypeCode === '50004') { if (o.projectTypeCode === "50004") {
window.location.href = '/mobile/activity/Sports/list/activityEventList?id=' + o.id window.location.href = "/mobile/activity/Sports/list/activityEventList?id=" + o.id
} else { } else {
window.location.href = '/mobile/activity/unionActivity/goReg?id=' + o.id + '&signUpMethod=' + o.signUpMethod window.location.href = "/mobile/activity/unionActivity/goReg?id=" + o.id + "&signUpMethod=" + o.signUpMethod
} }
}, },
async init() { async init() {
this.$set(this.pageForm, "activityStatus", 1) this.$set(this.pageForm, "activityStatus", 1)
this.$set(this.pageForm, "year", new Date().getFullYear()) this.$set(this.pageForm, "year", new Date().getFullYear())
const {data} = await $.get("/platform/activity/basic/basic/settings/getActivityTwoLevelType", {code: 40000}) const { data } = await $.get("/platform/activity/basic/basic/settings/getActivityTwoLevelType", { code: 40000 })
this.activityLevelList = [] this.activityLevelList = []
this.activityLevelList.push({value: null, text: "全部类别"}) this.activityLevelList.push({ value: null, text: "全部类别" })
data.forEach(v => { data.forEach((v) => {
this.activityLevelList.push({value: v.code, text: v.name}) this.activityLevelList.push({ value: v.code, text: v.name })
}) })
this.$set(this.pageForm, "activityLevel", this.activityLevelList[0].value) this.$set(this.pageForm, "activityLevel", this.activityLevelList[0].value)
@@ -272,7 +249,7 @@ layout("/mobile/platform.html"){
this.init() this.init()
} }
}) })
window.addEventListener('pageshow', e => { window.addEventListener("pageshow", (e) => {
if (e.persisted || (window.performance && window.performance.navigation.type === 2)) { if (e.persisted || (window.performance && window.performance.navigation.type === 2)) {
vue.init() vue.init()
} }
@@ -12,20 +12,22 @@ layout("/mobile/platform.html"){
</style> </style>
<div id="app" v-cloak> <div id="app" v-cloak>
<van-nav-bar title="签到" left-arrow placeholder fixed @click-left="history.back()"></van-nav-bar> <van-nav-bar title="签到" left-arrow placeholder fixed @click-left="pjaxReplace('/mobile/index')"></van-nav-bar>
<!--#include("/mobile/activity/unionActivity/common/activityInfo.html"){}#--> <!--#include("/mobile/activity/unionActivity/common/activityInfo.html"){}#-->
<div style="margin: 20px 20px 10px 20px" v-if="o.needSign"> <div style="margin: 20px 20px 10px 20px" v-if="o.needSign">
<van-button <van-button
:disabled="moment().valueOf() > moment(o.endTime).valueOf() || moment().valueOf() < moment(o.startTime).valueOf() || isSign" :disabled="moment().valueOf() > moment(o.endTime).valueOf() || moment().valueOf() < moment(o.startTime).valueOf() || isSign"
@click="doSign()" style="border-radius: 10px" block type="info" @click="doSign()"
:color="themeColor"> style="border-radius: 10px"
block
type="info"
:color="themeColor"
>
{{isSign?'签到成功':'立即签到'}} {{isSign?'签到成功':'立即签到'}}
</van-button> </van-button>
</div> </div>
</div> </div>
<script> <script>
@@ -35,26 +37,26 @@ layout("/mobile/platform.html"){
<script> <script>
let geolocation = null let geolocation = null
const vue = new Vue({ const vue = new Vue({
el: '#app', el: "#app",
mixins: [mobileMixins, self_mixin], mixins: [mobileMixins, self_mixin],
data() { data() {
return { return {
activityId: '', activityId: "",
o: {}, o: {},
isSign: null isSign: null
} }
}, },
methods: { methods: {
async getSignStatus() { async getSignStatus() {
const resp = await $.post('/mobile/activity/unionActivity/isSign', {activityId: this.activityId}) const resp = await $.post("/mobile/activity/unionActivity/isSign", { activityId: this.activityId })
if (resp.code === 0) { if (resp.code === 0) {
this.isSign = resp.data this.isSign = resp.data
} }
}, },
async doSign() { async doSign() {
geolocation.getCurrentPosition(async (status, result) => { geolocation.getCurrentPosition(async (status, result) => {
if (status !== 'complete') { if (status !== "complete") {
this.$toast.fail('定位失败!') this.$toast.fail("定位失败!")
return return
} }
console.log(status) console.log(status)
@@ -62,27 +64,30 @@ layout("/mobile/platform.html"){
const lat = result.position.lat const lat = result.position.lat
const lng = result.position.lng const lng = result.position.lng
const params = { const params = {
lat1: lat, lng1: lng, lat2: this.o.location[1], lng2: this.o.location[0] lat1: lat,
lng1: lng,
lat2: this.o.location[1],
lng2: this.o.location[0]
} }
const distance = this.getMapDistance(params) const distance = this.getMapDistance(params)
console.log(distance) console.log(distance)
console.log(this.o.rangeMeter) console.log(this.o.rangeMeter)
if (distance > this.o.rangeMeter) { if (distance > this.o.rangeMeter) {
this.$toast('距离活动打卡点还有' + distance + '米') this.$toast("距离活动打卡点还有" + distance + "米")
return return
} }
const confirm = await this.$dialog.confirm({ const confirm = await this.$dialog.confirm({
title: '提示', title: "提示",
message: '您确认要签到吗?', message: "您确认要签到吗?"
}) })
const loading = this.$toast.loading({ const loading = this.$toast.loading({
message: '签到中...', message: "签到中...",
forbidClick: true, forbidClick: true,
overlay: true, overlay: true,
duration: 0 duration: 0
}) })
if (confirm === 'confirm') { if (confirm === "confirm") {
const resp = await $.post('/mobile/activity/unionActivity/singleSignUp', {activityId: this.activityId}) const resp = await $.post("/mobile/activity/unionActivity/singleSignUp", { activityId: this.activityId })
if (resp.code === 0) { if (resp.code === 0) {
await this.getSignStatus() await this.getSignStatus()
loading.close() loading.close()
@@ -90,8 +95,6 @@ layout("/mobile/platform.html"){
} }
} }
}) })
} }
}, },
created() { created() {
@@ -107,4 +110,4 @@ layout("/mobile/platform.html"){
<!--# <!--#
} }
#--> #-->
@@ -12,45 +12,55 @@ layout("/mobile/platform.html"){
</style> </style>
<div id="app" v-cloak> <div id="app" v-cloak>
<van-nav-bar title="个人报名" left-arrow placeholder fixed <van-nav-bar title="个人报名" left-arrow placeholder fixed @click-left="pjaxReplace('/mobile/index')"></van-nav-bar>
@click-left="history.back()"></van-nav-bar>
<!--#include("/mobile/activity/unionActivity/common/activityInfo.html"){}#--> <!--#include("/mobile/activity/unionActivity/common/activityInfo.html"){}#-->
<div style="margin: 20px 20px 10px 20px" <div
v-if="moment(o.applyStartTime).valueOf() < moment().valueOf() && moment().valueOf() < moment(o.applyEndTime).valueOf()"> style="margin: 20px 20px 10px 20px"
<van-button v-if="!isRegister && !isRegisterFull" @click="doSave()" v-if="moment(o.applyStartTime).valueOf() < moment().valueOf() && moment().valueOf() < moment(o.applyEndTime).valueOf()"
style="border-radius: 10px" block >
type="info" <van-button v-if="!isRegister && !isRegisterFull" @click="doSave()" style="border-radius: 10px" block type="info" :color="themeColor">
:color="themeColor">
立即报名 立即报名
</van-button> </van-button>
<van-button v-else-if="!isRegister && isRegisterFull" @click="doSave()" <van-button
style="border-radius: 10px" block v-else-if="!isRegister && isRegisterFull"
disabled @click="doSave()"
type="info" style="border-radius: 10px"
:color="themeColor"> block
disabled
type="info"
:color="themeColor"
>
名额已满 名额已满
</van-button> </van-button>
<van-button v-else-if="isRegister && moment().valueOf() < moment(o.applyEndTime).valueOf()" <van-button
@click="doCancel" v-else-if="isRegister && moment().valueOf() < moment(o.applyEndTime).valueOf()"
style="border-radius: 10px" block type="info" @click="doCancel"
color="red"> style="border-radius: 10px"
block
type="info"
color="red"
>
取消报名 取消报名
</van-button> </van-button>
</div> </div>
<div style="margin: 20px 20px 10px 20px" <div
v-if="isRegister && moment().valueOf() < moment(o.endTime).valueOf() && moment().valueOf() > moment(o.startTime).valueOf()"> style="margin: 20px 20px 10px 20px"
v-if="isRegister && moment().valueOf() < moment(o.endTime).valueOf() && moment().valueOf() > moment(o.startTime).valueOf()"
>
<van-button <van-button
:disabled="moment().valueOf() > moment(o.endTime).valueOf() || moment().valueOf() < moment(o.startTime).valueOf() || isSign" :disabled="moment().valueOf() > moment(o.endTime).valueOf() || moment().valueOf() < moment(o.startTime).valueOf() || isSign"
@click="doSign()" style="border-radius: 10px" block type="info" @click="doSign()"
:color="themeColor"> style="border-radius: 10px"
block
type="info"
:color="themeColor"
>
{{isSign?'签到成功':'立即签到'}} {{isSign?'签到成功':'立即签到'}}
</van-button> </van-button>
</div> </div>
</div> </div>
<script> <script>
@@ -59,11 +69,11 @@ layout("/mobile/platform.html"){
<script> <script>
const vue = new Vue({ const vue = new Vue({
el: '#app', el: "#app",
mixins: [mobileMixins, self_mixin], mixins: [mobileMixins, self_mixin],
data() { data() {
return { return {
activityId: '', activityId: "",
o: {}, o: {},
tagCloseable: true, tagCloseable: true,
isRegister: false, isRegister: false,
@@ -72,36 +82,35 @@ layout("/mobile/platform.html"){
}, },
methods: { methods: {
async isRegisterForMe() { async isRegisterForMe() {
const resp = await $.get('/mobile/activity/unionActivity/isRegisterForMe', {activityId: this.activityId}) const resp = await $.get("/mobile/activity/unionActivity/isRegisterForMe", { activityId: this.activityId })
if (resp.code === 0) { if (resp.code === 0) {
this.isRegister = resp.data this.isRegister = resp.data
} }
}, },
async doSave() { async doSave() {
let message = '' let message = ""
if (this.o.needSign) { if (this.o.needSign) {
message = '报名后若未参加,将有可能影响到其它活动的报名,同时活动开启了现场签到!' message = "报名后若未参加,将有可能影响到其它活动的报名,同时活动开启了现场签到!"
} }
const confirm = await this.$dialog.confirm({ const confirm = await this.$dialog.confirm({
title: '提示', title: "提示",
message: '您确认要报名吗?' + message, message: "您确认要报名吗?" + message
}) })
if (confirm === 'confirm') { if (confirm === "confirm") {
const loading = this.$toast.loading({ const loading = this.$toast.loading({
message: '报名中...', message: "报名中...",
forbidClick: true, forbidClick: true,
overlay: true, overlay: true,
duration: 0 duration: 0
}) })
await this.getHasRegUserNum() await this.getHasRegUserNum()
const resp = await $.post('/mobile/activity/unionActivity/doSingleRegister', {activityId: this.activityId}) const resp = await $.post("/mobile/activity/unionActivity/doSingleRegister", { activityId: this.activityId })
loading.close() loading.close()
if (resp.code === 0) { if (resp.code === 0) {
this.$toast.success(resp.msg) this.$toast.success(resp.msg)
setTimeout(() => { setTimeout(() => {
window.history.back() window.history.back()
}, 1000) }, 1000)
} else { } else {
this.$toast.fail(resp.msg) this.$toast.fail(resp.msg)
} }
@@ -109,17 +118,17 @@ layout("/mobile/platform.html"){
}, },
async doCancel() { async doCancel() {
const confirm = await this.$dialog.confirm({ const confirm = await this.$dialog.confirm({
title: '提示', title: "提示",
message: '您确认要取消报名吗?', message: "您确认要取消报名吗?"
}) })
const loading = this.$toast.loading({ const loading = this.$toast.loading({
message: '取消中...', message: "取消中...",
forbidClick: true, forbidClick: true,
overlay: true, overlay: true,
duration: 0 duration: 0
}) })
if (confirm === 'confirm') { if (confirm === "confirm") {
const resp = await $.post('/mobile/activity/unionActivity/doSingleCancelRegister', {activityId: this.activityId}) const resp = await $.post("/mobile/activity/unionActivity/doSingleCancelRegister", { activityId: this.activityId })
loading.close() loading.close()
if (resp.code === 0) { if (resp.code === 0) {
this.$toast.success(resp.msg) this.$toast.success(resp.msg)
@@ -132,18 +141,18 @@ layout("/mobile/platform.html"){
} }
}, },
async getSignStatus() { async getSignStatus() {
const resp = await $.post('/mobile/activity/unionActivity/isSign', {activityId: this.activityId}) const resp = await $.post("/mobile/activity/unionActivity/isSign", { activityId: this.activityId })
if (resp.code === 0) { if (resp.code === 0) {
this.isSign = resp.data this.isSign = resp.data
} }
}, },
async doSign() { async doSign() {
const confirm = await this.$dialog.confirm({ const confirm = await this.$dialog.confirm({
title: '提示', title: "提示",
message: '您确认要签到吗?', message: "您确认要签到吗?"
}) })
if (confirm === 'confirm') { if (confirm === "confirm") {
const resp = await $.post('/mobile/activity/unionActivity/singleSignUp', {activityId: this.activityId}) const resp = await $.post("/mobile/activity/unionActivity/singleSignUp", { activityId: this.activityId })
if (resp.code === 0) { if (resp.code === 0) {
await this.getSignStatus() await this.getSignStatus()
this.$toast.success(resp.msg) this.$toast.success(resp.msg)
@@ -168,4 +177,4 @@ layout("/mobile/platform.html"){
<!--# <!--#
} }
#--> #-->
@@ -37,13 +37,12 @@ layout("/mobile/platform.html"){
} }
.van-search__action { .van-search__action {
background-color: #edf0ff background-color: #edf0ff;
} }
</style> </style>
<div id="app" v-cloak> <div id="app" v-cloak>
<van-nav-bar :title="title" @click-left="history.back()" fixed left-arrow <van-nav-bar :title="title" @click-left="pjaxReplace('/mobile/index')" fixed left-arrow placeholder></van-nav-bar>
placeholder></van-nav-bar>
<!--#include("/mobile/activity/unionActivity/common/activityInfo.html"){}#--> <!--#include("/mobile/activity/unionActivity/common/activityInfo.html"){}#-->
@@ -51,47 +50,40 @@ layout("/mobile/platform.html"){
<van-cell class="regCell" title="报名人员"> <van-cell class="regCell" title="报名人员">
<template #label> <template #label>
<div> <div>
<span v-if="o.userNumberLimit===1"> <span v-if="o.userNumberLimit===1">本活动限制总报名人数:({{o.totalUserNumberLimit}})人</span>
本活动限制总报名人数:({{o.totalUserNumberLimit}})人
</span>
<span v-else-if="o.userNumberLimit===2"> <span v-else-if="o.userNumberLimit===2">
当前分工会报名限额 <span style="color: orange">({{o.limitUnion.limitNum}})人</span> 当前分工会报名限额
<span style="color: orange">({{o.limitUnion.limitNum}})人</span>
</span> </span>
</div> </div>
<div class="mt5" v-loading="tagCloseable"> <div class="mt5" v-loading="tagCloseable">
<div v-if="registerList && registerList.length>0"> <div v-if="registerList && registerList.length>0">
<template v-for="item in registerList"> <template v-for="item in registerList">
<van-tag :closeable="tagCloseable" :color="themeColor" <van-tag :closeable="tagCloseable" :color="themeColor" @close="removeRegUser(item)" size="medium" type="primary">
@close="removeRegUser(item)"
size="medium"
type="primary">
{{item.userName}} {{item.userName}}
</van-tag> </van-tag>
</template> </template>
</div> </div>
<div v-else> <div v-else>
<div style="text-align: center;margin-top: 20px;"> <div style="text-align: center; margin-top: 20px">无报名人员</div>
无报名人员
</div>
</div> </div>
</div> </div>
<div class="mt5" style="text-align: right" <div
v-if="moment(o.applyStartTime).valueOf() < moment().valueOf() && moment().valueOf() < moment(o.applyEndTime).valueOf()"> class="mt5"
<van-button :color="themeColor" @click="openUserActionSheet" size="mini" style="text-align: right"
type="info" v-if="tagCloseable">选择报名人员 v-if="moment(o.applyStartTime).valueOf() < moment().valueOf() && moment().valueOf() < moment(o.applyEndTime).valueOf()"
</van-button> >
<van-button :color="themeColor" @click="openUserActionSheet" size="mini" type="info" v-if="tagCloseable">选择报名人员</van-button>
</div> </div>
</template> </template>
</van-cell> </van-cell>
</van-cell-group> </van-cell-group>
<van-action-sheet class="userActionPopup" title="选择报名人员" v-model="userActionSheet"> <van-action-sheet class="userActionPopup" title="选择报名人员" v-model="userActionSheet">
<van-search @search="onSearchUser" placeholder="请输入姓名搜索" show-action <van-search @search="onSearchUser" placeholder="请输入姓名搜索" show-action v-model="searchKey">
v-model="searchKey">
<template #action> <template #action>
<div @click="onSearchUser(searchKey)">搜索</div> <div @click="onSearchUser(searchKey)">搜索</div>
</template> </template>
</van-search> </van-search>
<!-- <div class="van-hairline&#45;&#45;bottom">--> <!-- <div class="van-hairline&#45;&#45;bottom">-->
@@ -101,48 +93,29 @@ layout("/mobile/platform.html"){
<van-loading size="24px" vertical>搜索中...</van-loading> <van-loading size="24px" vertical>搜索中...</van-loading>
</template> </template>
<div class="van-action-sheet__content mt5" <div class="van-action-sheet__content mt5" v-else-if="searchUserList && searchUserList.length>0">
v-else-if="searchUserList && searchUserList.length>0">
<template> <template>
<template v-for="item in searchUserList" <template v-for="item in searchUserList" v-if="!registerList.map(v=>v.id).includes(item.id)">
v-if="!registerList.map(v=>v.id).includes(item.id)"> <button @click="searchUserAdd(item)" class="van-action-sheet__item van-hairline--bottom">
<button @click="searchUserAdd(item)"
class="van-action-sheet__item van-hairline--bottom">
<span class="van-action-sheet__name">{{item.userName}}({{item.loginName}})</span> <span class="van-action-sheet__name">{{item.userName}}({{item.loginName}})</span>
</button> </button>
</template> </template>
<!--<van-empty description="没有更多了" style="position:absolute;height: 70%" <!--<van-empty description="没有更多了" style="position:absolute;height: 70%"
v-else></van-empty>--> v-else></van-empty>-->
</template> </template>
</div> </div>
<van-empty description="暂无数据" style="position:absolute;height: 70%" <van-empty description="暂无数据" style="position: absolute; height: 70%" v-else-if="searchUserList.length===0"></van-empty>
v-else-if="searchUserList.length===0"></van-empty>
</van-action-sheet> </van-action-sheet>
<div
<div style="margin: 20px 20px 10px 20px" style="margin: 20px 20px 10px 20px"
v-if="moment(o.applyStartTime).valueOf() < moment().valueOf() && moment().valueOf() < moment(o.applyEndTime).valueOf()"> v-if="moment(o.applyStartTime).valueOf() < moment().valueOf() && moment().valueOf() < moment(o.applyEndTime).valueOf()"
<van-button :color="themeColor" @click="doSave()" block style="border-radius: 10px" >
type="info" <van-button :color="themeColor" @click="doSave()" block style="border-radius: 10px" type="info" v-if="tagCloseable">提 交</van-button>
v-if="tagCloseable">
提 交
</van-button>
<template v-else="!tagCloseable"> <template v-else="!tagCloseable">
<van-button :color="themeColor" @click="tagCloseable = true" <van-button :color="themeColor" @click="tagCloseable = true" block style="border-radius: 10px" type="info">修 改</van-button>
block style="border-radius: 10px" <van-button @click="doCancel" block color="red" style="border-radius: 10px; margin-top: 10px" type="info">取消报名</van-button>
type="info">
修 改
</van-button>
<van-button
@click="doCancel"
block color="red" style="border-radius: 10px;margin-top: 10px"
type="info">
取消报名
</van-button>
</template> </template>
</div> </div>
<!-- <div style="margin: 20px 20px 10px 20px" v-if="tagCloseable">--> <!-- <div style="margin: 20px 20px 10px 20px" v-if="tagCloseable">-->
@@ -153,26 +126,25 @@ layout("/mobile/platform.html"){
<!-- 立即签到--> <!-- 立即签到-->
<!-- </van-button>--> <!-- </van-button>-->
<!-- </div>--> <!-- </div>-->
</div> </div>
<script> <script>
<!--#include("/mobile/activity/unionActivity/common/initMap.js"){}#--> <!--#include("/mobile/activity/unionActivity/common/initMap.js"){}#-->
const vue = new Vue({ const vue = new Vue({
el: '#app', el: "#app",
mixins: [mobileMixins, self_mixin], mixins: [mobileMixins, self_mixin],
data() { data() {
return { return {
title: "", title: "",
userId: "${@shiro.getPrincipalProperty('id')}", userId: "${@shiro.getPrincipalProperty('id')}",
userName: "${@shiro.getPrincipalProperty('username')}", userName: "${@shiro.getPrincipalProperty('username')}",
activityId: '', activityId: "",
o: {}, o: {},
registerList: [], registerList: [],
addRegisterList: [], addRegisterList: [],
userActionSheet: false, userActionSheet: false,
searchKey: '', searchKey: "",
searchUserList: [], searchUserList: [],
tagCloseable: true, tagCloseable: true,
searchLoading: false searchLoading: false
@@ -181,17 +153,17 @@ layout("/mobile/platform.html"){
methods: { methods: {
async doCancel() { async doCancel() {
const confirm = await this.$dialog.confirm({ const confirm = await this.$dialog.confirm({
title: '提示', title: "提示",
message: '您确认要取消报名吗?', message: "您确认要取消报名吗?"
}) })
const loading = this.$toast.loading({ const loading = this.$toast.loading({
message: '取消中...', message: "取消中...",
forbidClick: true, forbidClick: true,
overlay: true, overlay: true,
duration: 0 duration: 0
}) })
if (confirm === 'confirm') { if (confirm === "confirm") {
const resp = await $.post('/mobile/activity/unionActivity/doSingleCancelRegister', {activityId: this.activityId}) const resp = await $.post("/mobile/activity/unionActivity/doSingleCancelRegister", { activityId: this.activityId })
if (resp.code === 0) { if (resp.code === 0) {
setTimeout(() => { setTimeout(() => {
loading.close() loading.close()
@@ -206,10 +178,10 @@ layout("/mobile/platform.html"){
} }
}, },
async getRegisterUser() { async getRegisterUser() {
const resp = await $.get('/mobile/activity/myActivity/selectRegisterList', {activityId: this.activityId}) const resp = await $.get("/mobile/activity/myActivity/selectRegisterList", { activityId: this.activityId })
if (resp.code === 0) { if (resp.code === 0) {
if (this.o.signUpMethod === 3) { if (this.o.signUpMethod === 3) {
this.registerList = resp.data.filter(v => v.applyUserId === this.userId) this.registerList = resp.data.filter((v) => v.applyUserId === this.userId)
} else { } else {
this.registerList = resp.data this.registerList = resp.data
} }
@@ -220,7 +192,7 @@ layout("/mobile/platform.html"){
} }
}, },
openUserActionSheet() { openUserActionSheet() {
this.searchKey = '' this.searchKey = ""
this.searchUserList = [] this.searchUserList = []
this.userActionSheet = true this.userActionSheet = true
}, },
@@ -230,21 +202,20 @@ layout("/mobile/platform.html"){
return return
} }
this.searchLoading = true this.searchLoading = true
const resp = await $.get('/mobile/activity/unionActivity/searchNoRegisterUser', { const resp = await $.get("/mobile/activity/unionActivity/searchNoRegisterUser", {
activityId: this.activityId, activityId: this.activityId,
searchKey: val searchKey: val
}) })
if (resp.code === 0) { if (resp.code === 0) {
this.searchLoading = false this.searchLoading = false
this.searchUserList = resp.data.list this.searchUserList = resp.data.list
} else { } else {
this.$toast.fail(resp.msg) this.$toast.fail(resp.msg)
} }
}, },
searchUserAdd(item) { searchUserAdd(item) {
const {id, userName} = item const { id, userName } = item
this.registerList.push({id, userName}) this.registerList.push({ id, userName })
this.$toast.success("添加成功") this.$toast.success("添加成功")
}, },
async removeRegUser(item) { async removeRegUser(item) {
@@ -253,46 +224,42 @@ layout("/mobile/platform.html"){
return return
} }
const confirm = await this.$dialog.confirm({ const confirm = await this.$dialog.confirm({
title: '提示', title: "提示",
message: '您确认要移除吗?', message: "您确认要移除吗?"
}) })
if (confirm === 'confirm') { if (confirm === "confirm") {
const index = this.registerList.findIndex(v => v.id === item.id) const index = this.registerList.findIndex((v) => v.id === item.id)
this.registerList.splice(index, 1) this.registerList.splice(index, 1)
} }
}, },
//保存 //保存
async doSave() { async doSave() {
if (this.registerList.length === 0) { if (this.registerList.length === 0) {
this.$toast('请添加报名人员后再提交!') this.$toast("请添加报名人员后再提交!")
return return
} }
if (this.o.signUpMethod === 3) { if (this.o.signUpMethod === 3) {
if (this.registerList.length !== this.o.teamNum) { if (this.registerList.length !== this.o.teamNum) {
vant.Dialog.alert({ vant.Dialog.alert({
title: '温馨提示', title: "温馨提示",
message: '此活动是双人报名模式您需要报名' + this.o.teamNum + '人!', message: "此活动是双人报名模式您需要报名" + this.o.teamNum + "人!"
}).then(() => { }).then(() => {})
});
return return
} }
if (!this.registerList.map(v => v.id).includes(this.userId)) { if (!this.registerList.map((v) => v.id).includes(this.userId)) {
vant.Dialog.alert({ vant.Dialog.alert({
title: '温馨提示', title: "温馨提示",
message: '此活动是组队模式请您找' + this.o.teamNum + '朋友一起报名!', message: "此活动是组队模式请您找" + this.o.teamNum + "朋友一起报名!"
}).then(() => { }).then(() => {})
});
return return
} }
// await this.getRegisterUser() // await this.getRegisterUser()
const resp = await $.get('/mobile/activity/myActivity/selectRegisterList', {activityId: this.activityId}) const resp = await $.get("/mobile/activity/myActivity/selectRegisterList", { activityId: this.activityId })
this.addRegisterList = resp.data this.addRegisterList = resp.data
let arr = [] let arr = []
if (this.addRegisterList && this.addRegisterList.length > 0) { if (this.addRegisterList && this.addRegisterList.length > 0) {
this.addRegisterList.forEach(v => { this.addRegisterList.forEach((v) => {
this.registerList.forEach(r => { this.registerList.forEach((r) => {
if (v.id === r.id && v.applyUserId !== this.userId) { if (v.id === r.id && v.applyUserId !== this.userId) {
arr.push(r.userName) arr.push(r.userName)
} }
@@ -302,11 +269,9 @@ layout("/mobile/platform.html"){
if (arr && arr.length > 0) { if (arr && arr.length > 0) {
vant.Dialog.alert({ vant.Dialog.alert({
title: '温馨提示', title: "温馨提示",
message: '【' + arr.toString() + '】已成功报名您无需再报名!', message: "【" + arr.toString() + "】已成功报名您无需再报名!"
}).then(() => { }).then(() => {})
});
return return
} }
@@ -319,28 +284,27 @@ layout("/mobile/platform.html"){
}); });
return return
}*/ }*/
} }
let message = '' let message = ""
if (this.o.needSign) { if (this.o.needSign) {
message = '此活动开启了签到,需要您活动当天前往签到点位核实活动报名人员后进行签到!' message = "此活动开启了签到,需要您活动当天前往签到点位核实活动报名人员后进行签到!"
} }
const confirm = await this.$dialog.confirm({ const confirm = await this.$dialog.confirm({
title: '提示', title: "提示",
message: message + '您确认要报名吗?', message: message + "您确认要报名吗?"
}) })
if (confirm === 'confirm') { if (confirm === "confirm") {
const loading = this.$toast.loading({ const loading = this.$toast.loading({
message: '报名中...', message: "报名中...",
forbidClick: true, forbidClick: true,
overlay: true, overlay: true,
duration: 0 duration: 0
}) })
const params = { const params = {
activityId: this.activityId, activityId: this.activityId,
personIds: JSON.stringify(this.registerList.map(v => v.id)) personIds: JSON.stringify(this.registerList.map((v) => v.id))
} }
const resp = await $.post('/mobile/activity/unionActivity/doSaveUnionRegister', params) const resp = await $.post("/mobile/activity/unionActivity/doSaveUnionRegister", params)
if (resp.code === 0) { if (resp.code === 0) {
await this.getRegisterUser() await this.getRegisterUser()
@@ -362,14 +326,12 @@ layout("/mobile/platform.html"){
await this.getActivityInfo() await this.getActivityInfo()
await this.getRegisterUser() await this.getRegisterUser()
if (this.o.signUpMethod === 3 && this.registerList.length === 0) { if (this.o.signUpMethod === 3 && this.registerList.length === 0) {
this.registerList.push({id: this.userId, userName: this.userName}) this.registerList.push({ id: this.userId, userName: this.userName })
} }
this.title = (this.o.signUpMethod === 2 ? '分工会报名' : '组队报名') this.title = this.o.signUpMethod === 2 ? "分工会报名" : "组队报名"
if (moment(this.o.applyStartTime).valueOf() < moment().valueOf() && moment().valueOf() > moment(this.o.applyEndTime).valueOf()) { if (moment(this.o.applyStartTime).valueOf() < moment().valueOf() && moment().valueOf() > moment(this.o.applyEndTime).valueOf()) {
this.$toast.fail("不在活动范围内") this.$toast.fail("不在活动范围内")
} }
} }
} }
}) })
@@ -3,7 +3,6 @@ layout("/mobile/platform.html"){
#--> #-->
<style> <style>
.van-index-bar__sidebar { .van-index-bar__sidebar {
display: none; display: none;
} }
@@ -88,55 +87,36 @@ layout("/mobile/platform.html"){
.van-cell-group__title { .van-cell-group__title {
padding: 5px 0 5px 0; padding: 5px 0 5px 0;
} }
</style> </style>
<div id="app" v-cloak> <div id="app" v-cloak>
<m-page-loading v-if="mLoading"></m-page-loading> <m-page-loading v-if="mLoading"></m-page-loading>
<!--top栏--> <!--top栏-->
<van-nav-bar <van-nav-bar title="社团审核" left-arrow placeholder fixed @click-left="pjaxReplace('/mobile/index')" safe-area-inset-top></van-nav-bar>
title="社团审核"
left-arrow
placeholder
fixed
@click-left="history.go(-1)"
safe-area-inset-top
></van-nav-bar>
<!--筛选框--> <!--筛选框-->
<div class="search-fixed"> <div class="search-fixed">
<van-search <van-search
v-model="pageForm.searchKeyword" v-model="pageForm.searchKeyword"
shape="round" shape="round"
maxlength="10" maxlength="10"
@search="doSearch" @search="doSearch"
placeholder="请输入工号或姓名进行查询" placeholder="请输入工号或姓名进行查询"
> ></van-search>
</van-search>
<van-dropdown-menu> <van-dropdown-menu>
<van-dropdown-item v-model="pageForm.radioType" :options="auditOptions" <van-dropdown-item v-model="pageForm.radioType" :options="auditOptions" @change="doSearch"></van-dropdown-item>
@change="doSearch"></van-dropdown-item> <van-dropdown-item v-model="pageForm.clubId" :options="clubOptions" @change="doSearch"></van-dropdown-item>
<van-dropdown-item v-model="pageForm.clubId" :options="clubOptions" <van-dropdown-item v-model="pageForm.userType" :options="userTypeOptions" @change="doSearch"></van-dropdown-item>
@change="doSearch"></van-dropdown-item>
<van-dropdown-item v-model="pageForm.userType" :options="userTypeOptions"
@change="doSearch"></van-dropdown-item>
</van-dropdown-menu> </van-dropdown-menu>
</div> </div>
<!--列表--> <!--列表-->
<div style="margin-top: 116px"> <div style="margin-top: 116px">
<van-list <van-list v-model="loading" :finished="finished" :immediate-check="false" :finished-text="tableData.length>0?'没有更多了':''" @load="onLoad">
v-model="loading"
:finished="finished" :immediate-check="false"
:finished-text="tableData.length>0?'没有更多了':''"
@load="onLoad">
<div class="van-doc-card" v-for="o in tableData"> <div class="van-doc-card" v-for="o in tableData">
<div @click="openView(o.id)"> <div @click="openView(o.id)">
<div style="display: flex; justify-content: space-between"> <div style="display: flex; justify-content: space-between">
<div style="width: 74%"> <div style="width: 74%">
<div class="van-ellipsis title"> <div class="van-ellipsis title">
@@ -144,9 +124,7 @@ layout("/mobile/platform.html"){
<span>{{o.username}}</span> <span>{{o.username}}</span>
</div> </div>
</div> </div>
<div style="color: #1867b0;"> <div style="color: #1867b0"></div>
</div>
</div> </div>
<van-divider></van-divider> <van-divider></van-divider>
@@ -180,14 +158,10 @@ layout("/mobile/platform.html"){
<div style="display: flex; justify-content: flex-end; margin-top: 4px"> <div style="display: flex; justify-content: flex-end; margin-top: 4px">
<div> <div>
<van-button @click.stop="openView(o)" <van-button @click.stop="openView(o)" type="primary" size="small" color="#1867b0" style="margin-right: 8px; width: auto">
type="primary" size="small" color="#1867b0"
style="margin-right: 8px; width: auto;">
查看 查看
</van-button> </van-button>
<van-button @click.stop="openAudit(o)" <van-button @click.stop="openAudit(o)" type="primary" size="small" color="#1867b0" style="margin-right: 8px; width: auto">
type="primary" size="small" color="#1867b0"
style="margin-right: 8px; width: auto;">
审核 审核
</van-button> </van-button>
</div> </div>
@@ -195,47 +169,29 @@ layout("/mobile/platform.html"){
</div> </div>
</div> </div>
</van-list> </van-list>
<van-empty <van-empty v-if="mLoading==false&&tableData.length==0" class="custom-image" image="/none.svg" description="暂无数据"></van-empty>
v-if="mLoading==false&&tableData.length==0"
class="custom-image"
image="/none.svg"
description="暂无数据"
></van-empty>
</div> </div>
<van-popup v-model="infoShow" position="right" :style="{width: '100%', height: '100%' }"> <van-popup v-model="infoShow" position="right" :style="{width: '100%', height: '100%' }">
<van-nav-bar <van-nav-bar title="详细信息" left-arrow placeholder fixed @click-left="infoShow = false" safe-area-inset-top></van-nav-bar>
title="详细信息"
left-arrow
placeholder
fixed
@click-left="infoShow = false"
safe-area-inset-top
></van-nav-bar>
<club-user-apply-info ref="applyInfo" :handle="handle"> <club-user-apply-info ref="applyInfo" :handle="handle">
<template #handle> <template #handle>
<div class="van-cell-group__title"> <div class="van-cell-group__title">
<div class="van-sidebar-item van-sidebar-item--select"> <div class="van-sidebar-item van-sidebar-item--select">社团审核</div>
社团审核
</div>
</div> </div>
<van-form> <van-form>
<van-field <van-field readonly value="${@shiro.getPrincipalProperty('username')}" name="username" label="审核人员"></van-field>
readonly
value="${@shiro.getPrincipalProperty('username')}"
name="username"
label="审核人员"
></van-field>
<van-field v-model="formData.auditTime" label="审核时间" readonly></van-field> <van-field v-model="formData.auditTime" label="审核时间" readonly></van-field>
<van-field v-model="formData.auditOpinion" <van-field
required v-model="formData.auditOpinion"
rows="1" required
autosize rows="1"
label="审核意见" autosize
type="textarea" label="审核意见"
placeholder="请输入审核意见" type="textarea"
placeholder="请输入审核意见"
></van-field> ></van-field>
<van-field label="审核签字" required style="flex-flow: column"> <van-field label="审核签字" required style="flex-flow: column">
@@ -247,27 +203,23 @@ layout("/mobile/platform.html"){
</template> </template>
</van-field> </van-field>
<van-row gutter="20" style="margin-top: 30px;padding: 0 25px"> <van-row gutter="20" style="margin-top: 30px; padding: 0 25px">
<van-col span="12"> <van-col span="12">
<van-button :color="themeColor" plain block @click="doReview(false)">拒 绝 <van-button :color="themeColor" plain block @click="doReview(false)">拒 绝</van-button>
</van-button>
</van-col> </van-col>
<van-col span="12"> <van-col span="12">
<van-button :color="themeColor" block @click="doReview(true)">通 过 <van-button :color="themeColor" block @click="doReview(true)">通 过</van-button>
</van-button>
</van-col> </van-col>
</van-row> </van-row>
</van-form> </van-form>
</template> </template>
</club-user-apply-info> </club-user-apply-info>
</van-popup> </van-popup>
</div> </div>
<script> <script>
const vue = new Vue({ const vue = new Vue({
el: '#app', el: "#app",
mixins: [mobileMixins], mixins: [mobileMixins],
data() { data() {
return { return {
@@ -275,26 +227,26 @@ layout("/mobile/platform.html"){
clubOptions: [], clubOptions: [],
userTypeOptions: [], userTypeOptions: [],
auditOptions: [ auditOptions: [
{text: '全部', value: 1}, { text: "全部", value: 1 },
{text: '已审核', value: 2}, { text: "已审核", value: 2 },
{text: '未审核', value: 3}, { text: "未审核", value: 3 }
], ],
pageForm: { pageForm: {
radioType: 3 radioType: 3
}, },
infoShow: false, infoShow: false,
formData: {}, formData: {}
} }
}, },
components: { components: {
'club-user-apply-info': httpVueLoader('/components/mobile/club/mobileClubUserApplyInfo.vue?v=1.0.1'), "club-user-apply-info": httpVueLoader("/components/mobile/club/mobileClubUserApplyInfo.vue?v=1.0.1"),
'mobile-sign': httpVueLoader('/components/sign/mobileSign.vue'), "mobile-sign": httpVueLoader("/components/sign/mobileSign.vue")
}, },
methods: { methods: {
openAudit(row) { openAudit(row) {
this.formData = { this.formData = {
id: row.id, id: row.id,
auditTime: moment().format('YYYY-MM-DD'), auditTime: moment().format("YYYY-MM-DD"),
username: "${@shiro.getPrincipalProperty('username')}", username: "${@shiro.getPrincipalProperty('username')}",
auditOpinion: null, auditOpinion: null,
auditSign: "" auditSign: ""
@@ -314,11 +266,11 @@ layout("/mobile/platform.html"){
}, },
async doReview(flag) { async doReview(flag) {
if (!this.formData.auditOpinion) { if (!this.formData.auditOpinion) {
vant.Toast('请填写审核意见'); vant.Toast("请填写审核意见")
return return
} }
if (this.$refs.signature.checkNull()) { if (this.$refs.signature.checkNull()) {
vant.Toast('请签字') vant.Toast("请签字")
return return
} }
this.$refs.signature.submitSign() this.$refs.signature.submitSign()
@@ -338,7 +290,7 @@ layout("/mobile/platform.html"){
}, },
async onLoad() { async onLoad() {
this.loading = true this.loading = true
$.post('/platform/sys/club/sh/pageData', this.pageForm).then(res => { $.post("/platform/sys/club/sh/pageData", this.pageForm).then((res) => {
if (res.code === 0) { if (res.code === 0) {
this.tableData = this.tableData.concat(res.data.list) this.tableData = this.tableData.concat(res.data.list)
if (this.tableData.length === res.data.totalCount) { if (this.tableData.length === res.data.totalCount) {
@@ -351,21 +303,21 @@ layout("/mobile/platform.html"){
}) })
}, },
async getMyMangeClub() { async getMyMangeClub() {
const {data} = await $.get("/platform/sys/club/users/getMyMangeClub") const { data } = await $.get("/platform/sys/club/users/getMyMangeClub")
return data return data
}, }
}, },
async created() { async created() {
const data = await this.getMyMangeClub() const data = await this.getMyMangeClub()
data.forEach(item => { data.forEach((item) => {
this.clubOptions.push({text: item.name, value: item.id}) this.clubOptions.push({ text: item.name, value: item.id })
}) })
this.clubOptions.unshift({text: '全部社团'}) this.clubOptions.unshift({ text: "全部社团" })
const userType = await getDictOptions('UserType') const userType = await getDictOptions("UserType")
userType.forEach(item => { userType.forEach((item) => {
this.userTypeOptions.push({text: item.name, value: item.code}) this.userTypeOptions.push({ text: item.name, value: item.code })
}) })
this.userTypeOptions.unshift({text: '人员类型'}) this.userTypeOptions.unshift({ text: "人员类型" })
this.onLoad() this.onLoad()
} }
}) })
+263 -172
View File
@@ -3,7 +3,6 @@ layout("/mobile/platform.html"){
#--> #-->
<style> <style>
.van-index-bar__sidebar { .van-index-bar__sidebar {
display: none; display: none;
} }
@@ -69,7 +68,8 @@ layout("/mobile/platform.html"){
width: 30%; width: 30%;
} }
.van-cell__title, .van-cell__value{ .van-cell__title,
.van-cell__value {
flex: none; flex: none;
} }
@@ -97,52 +97,35 @@ layout("/mobile/platform.html"){
background-color: #0e78c5; background-color: #0e78c5;
color: white; color: white;
} }
</style> </style>
<div id="app" v-cloak> <div id="app" v-cloak>
<m-page-loading v-if="mLoading"></m-page-loading> <m-page-loading v-if="mLoading"></m-page-loading>
<!--top栏--> <!--top栏-->
<van-nav-bar <van-nav-bar title="加入社团" left-arrow placeholder fixed @click-left="pjaxReplace('/mobile/index')" safe-area-inset-top></van-nav-bar>
title="加入社团"
left-arrow
placeholder
fixed
@click-left="history.go(-1)"
safe-area-inset-top
></van-nav-bar>
<!--筛选框--> <!--筛选框-->
<div class="search-fixed"> <div class="search-fixed">
<van-search <van-search
v-model="pageForm.searchKeyword" v-model="pageForm.searchKeyword"
shape="round" shape="round"
maxlength="10" maxlength="10"
@search="doSearch" @search="doSearch"
placeholder="请输入社团名称进行查询" placeholder="请输入社团名称进行查询"
> ></van-search>
</van-search>
<van-dropdown-menu> <van-dropdown-menu>
<van-dropdown-item v-model="pageForm.isjr" :options="clubType" <van-dropdown-item v-model="pageForm.isjr" :options="clubType" @change="doSearch"></van-dropdown-item>
@change="doSearch"></van-dropdown-item> <van-dropdown-item v-model="pageForm.clubType" :options="typeOptions" @change="doSearch"></van-dropdown-item>
<van-dropdown-item v-model="pageForm.clubType" :options="typeOptions"
@change="doSearch"></van-dropdown-item>
</van-dropdown-menu> </van-dropdown-menu>
</div> </div>
<!--列表--> <!--列表-->
<div style="margin-top: 116px"> <div style="margin-top: 116px">
<van-list <van-list v-model="loading" :finished="finished" :immediate-check="false" @load="onLoad" :finished-text="tableData.length>0?'没有更多了':''">
v-model="loading"
:finished="finished" :immediate-check="false" @load="onLoad"
:finished-text="tableData.length>0?'没有更多了':''">
<div class="van-doc-card" v-for="o in tableData"> <div class="van-doc-card" v-for="o in tableData">
<div> <div>
<div style="display: flex; justify-content: space-between"> <div style="display: flex; justify-content: space-between">
<div style="width: 74%"> <div style="width: 74%">
<div class="van-ellipsis title"> <div class="van-ellipsis title">
@@ -151,7 +134,7 @@ layout("/mobile/platform.html"){
</div> </div>
<div style="color: grey">{{o.location}}</div> <div style="color: grey">{{o.location}}</div>
</div> </div>
<div style="color: #1867b0; white-space: nowrap;"> <div style="color: #1867b0; white-space: nowrap">
<span v-if="o.status==1">待社团审核</span> <span v-if="o.status==1">待社团审核</span>
<span v-if="o.status==2" style="color: red">社团拒绝</span> <span v-if="o.status==2" style="color: red">社团拒绝</span>
<span v-if="o.status==3">待校工会审核</span> <span v-if="o.status==3">待校工会审核</span>
@@ -162,14 +145,20 @@ layout("/mobile/platform.html"){
<div style="margin-top: 4px"> <div style="margin-top: 4px">
<van-row> <van-row>
<van-col span="12"><span style="color: grey">联&ensp;系&ensp;人:</span>{{o.fzrname}}</van-col> <van-col span="12">
<span style="color: grey">联&ensp;系&ensp;人:</span>
{{o.fzrname}}
</van-col>
<van-col span="12"> <van-col span="12">
<span style="color: grey">电&emsp;&emsp;话:</span> <span style="color: grey">电&emsp;&emsp;话:</span>
<span>{{o.fzr_mobile}}</span> <span>{{o.fzr_mobile}}</span>
</van-col> </van-col>
</van-row> </van-row>
<van-row> <van-row>
<van-col span="12"><span style="color: grey">会&emsp;&emsp;长:</span>{{o.hz}}</van-col> <van-col span="12">
<span style="color: grey">会&emsp;&emsp;长:</span>
{{o.hz}}
</van-col>
<van-col span="12"> <van-col span="12">
<span style="color: grey">成立时间:</span> <span style="color: grey">成立时间:</span>
<span>{{moment(o.foundTime).format('YYYY-MM-DD')}}</span> <span>{{moment(o.foundTime).format('YYYY-MM-DD')}}</span>
@@ -181,17 +170,27 @@ layout("/mobile/platform.html"){
<div style="display: flex; justify-content: flex-end"> <div style="display: flex; justify-content: flex-end">
<div> <div>
<van-button @click="openInfo(o, 'view')" color="#1867b0" <van-button @click="openInfo(o, 'view')" color="#1867b0" size="small" style="margin-right: 8px" type="primary">
size="small" style="margin-right: 8px" type="primary">
查看 查看
</van-button> </van-button>
<van-button @click="rollback(o)" color="#1867b0" <van-button
size="small" style="margin-right: 8px" type="primary" @click="rollback(o)"
v-if="pageForm.isjr === true && (o.status==1 || o.status==3)">撤销申请 color="#1867b0"
size="small"
style="margin-right: 8px"
type="primary"
v-if="pageForm.isjr === true && (o.status==1 || o.status==3)"
>
撤销申请
</van-button> </van-button>
<van-button @click="openInfo(o, 'join')" <van-button
color="#1867b0" v-if="pageForm.isjr === false" @click="openInfo(o, 'join')"
size="small" style="margin-right: 8px" type="primary"> color="#1867b0"
v-if="pageForm.isjr === false"
size="small"
style="margin-right: 8px"
type="primary"
>
我要加入 我要加入
</van-button> </van-button>
</div> </div>
@@ -199,22 +198,11 @@ layout("/mobile/platform.html"){
</div> </div>
</div> </div>
</van-list> </van-list>
<van-empty <van-empty v-if="mLoading==false&&tableData.length==0" class="custom-image" image="/none.svg" description="暂无数据"></van-empty>
v-if="mLoading==false&&tableData.length==0"
class="custom-image"
image="/none.svg"
description="暂无数据"
></van-empty>
</div> </div>
<van-popup v-model="infoShow" get-container="#app" position="right" :style="{ height: '100%', width: '100%' }"> <van-popup v-model="infoShow" get-container="#app" position="right" :style="{ height: '100%', width: '100%' }">
<van-nav-bar <van-nav-bar title="社团详细信息" left-arrow placeholder fixed @click-left="infoShow = false" safe-area-inset-top></van-nav-bar>
title="社团详细信息"
left-arrow
placeholder
fixed
@click-left="infoShow = false"
safe-area-inset-top></van-nav-bar>
<van-tabs v-model="infoActive"> <van-tabs v-model="infoActive">
<van-tab title="社团信息"> <van-tab title="社团信息">
<van-cell-group inset> <van-cell-group inset>
@@ -237,50 +225,130 @@ layout("/mobile/platform.html"){
<van-tab v-if="viewType === 'join'" title="个人信息"> <van-tab v-if="viewType === 'join'" title="个人信息">
<van-form @submit="needJoin" ref="form" :show-error-message="false"> <van-form @submit="needJoin" ref="form" :show-error-message="false">
<van-cell-group inset class="mt10"> <van-cell-group inset class="mt10">
<van-field readonly v-model="formData.username" name="username" <van-field readonly v-model="formData.username" name="username" label="姓名" :rules="[{ required: true }]"></van-field>
label="姓名" :rules="[{ required: true }]"></van-field> <van-field readonly v-model="formData.sex" name="sex" label="性别" :rules="[{ required: true }]"></van-field>
<van-field readonly v-model="formData.sex" name="sex" <van-field
label="性别" :rules="[{ required: true }]"></van-field> v-model="formData.birthday"
<van-field v-model="formData.birthday" name="birthday" required name="birthday"
@click="showPicker = true" required
placeholder="请填写出生年月" label="出生年月" :rules="[{ required: true }]"> @click="showPicker = true"
</van-field> placeholder="请填写出生年月"
label="出生年月"
:rules="[{ required: true }]"
></van-field>
<van-popup v-model="showPicker" position="bottom"> <van-popup v-model="showPicker" position="bottom">
<van-datetime-picker <van-datetime-picker
type="date" type="date"
title="选择年月日" title="选择年月日"
@confirm="(val) => {formData.birthday = moment(val).format('YYYY-MM-DD'); showPicker = false}" @confirm="(val) => {formData.birthday = moment(val).format('YYYY-MM-DD'); showPicker = false}"
@cancel="showPicker = false" @cancel="showPicker = false"
></van-datetime-picker> ></van-datetime-picker>
</van-popup> </van-popup>
<van-field v-model="formData.birthPlace" name="birthPlace" required <van-field
placeholder="请填写出生地" label="出生地" :rules="[{ required: true }]"></van-field> v-model="formData.birthPlace"
<van-field v-model="formData.education" name="education" required name="birthPlace"
placeholder="请填写文化程度" label="文化程度" :rules="[{ required: true }]"></van-field> required
<van-field v-model="formData.hobby" name="hobby" required placeholder="请填写出生地"
placeholder="请填写爱好" label="爱好" :rules="[{ required: true }]"></van-field> label="出生地"
<van-field v-model="formData.unitName" name="unitName" required :rules="[{ required: true }]"
readonly label="工作部门" :rules="[{ required: true }]"></van-field> ></van-field>
<van-field v-model="formData.position" name="position" required <van-field
placeholder="请填写职务" label="职务" :rules="[{ required: true }]"></van-field> v-model="formData.education"
<van-field v-model="formData.mobile" name="mobile" required name="education"
placeholder="请填写电话" label="电话" :rules="[{ required: true }]"></van-field> required
<van-field v-model="formData.email" name="email" required placeholder="请填写文化程度"
placeholder="请填写电子邮箱" label="电子邮箱" :rules="[{ required: true }]"></van-field> label="文化程度"
<van-field v-model="formData.homeAddress" name="homeAddress" required :rules="[{ required: true }]"
placeholder="请填写家庭住址" label="家庭住址" :rules="[{ required: true }]"></van-field> ></van-field>
<van-field v-model="formData.QQNumber" name="QQNumber" required <van-field
placeholder="请填写QQ" label="QQ" :rules="[{ required: true }]"></van-field> v-model="formData.hobby"
<van-field v-model="formData.bodyHeight" name="bodyHeight" required name="hobby"
placeholder="请填写身高" label="身高" :rules="[{ required: true }]"></van-field> required
<van-field v-model="formData.bodyWeight" name="bodyWeight" required placeholder="请填写爱好"
placeholder="请填写体重" label="体重" :rules="[{ required: true }]"></van-field> label="爱好"
<van-field v-model="formData.health" name="health" required :rules="[{ required: true }]"
placeholder="请填写身体状况" label="身体状况" :rules="[{ required: true }]"></van-field> ></van-field>
<van-field v-model="formData.sport" name="sport" required <van-field
placeholder="请填写经常从事的运动" label="经常从事的运动" :rules="[{ required: true }]"></van-field> v-model="formData.unitName"
<van-field name="medicalHistory" required name="unitName"
placeholder="是否有过特殊病史" label="是否有过特殊病史"> required
readonly
label="工作部门"
:rules="[{ required: true }]"
></van-field>
<van-field
v-model="formData.position"
name="position"
required
placeholder="请填写职务"
label="职务"
:rules="[{ required: true }]"
></van-field>
<van-field
v-model="formData.mobile"
name="mobile"
required
placeholder="请填写电话"
label="电话"
:rules="[{ required: true }]"
></van-field>
<van-field
v-model="formData.email"
name="email"
required
placeholder="请填写电子邮箱"
label="电子邮箱"
:rules="[{ required: true }]"
></van-field>
<van-field
v-model="formData.homeAddress"
name="homeAddress"
required
placeholder="请填写家庭住址"
label="家庭住址"
:rules="[{ required: true }]"
></van-field>
<van-field
v-model="formData.QQNumber"
name="QQNumber"
required
placeholder="请填写QQ"
label="QQ"
:rules="[{ required: true }]"
></van-field>
<van-field
v-model="formData.bodyHeight"
name="bodyHeight"
required
placeholder="请填写身高"
label="身高"
:rules="[{ required: true }]"
></van-field>
<van-field
v-model="formData.bodyWeight"
name="bodyWeight"
required
placeholder="请填写体重"
label="体重"
:rules="[{ required: true }]"
></van-field>
<van-field
v-model="formData.health"
name="health"
required
placeholder="请填写身体状况"
label="身体状况"
:rules="[{ required: true }]"
></van-field>
<van-field
v-model="formData.sport"
name="sport"
required
placeholder="请填写经常从事的运动"
label="经常从事的运动"
:rules="[{ required: true }]"
></van-field>
<van-field name="medicalHistory" required placeholder="是否有过特殊病史" label="是否有过特殊病史">
<template #input> <template #input>
<van-radio-group v-model="formData.medicalHistory" direction="horizontal"> <van-radio-group v-model="formData.medicalHistory" direction="horizontal">
<van-radio :name="true">是</van-radio> <van-radio :name="true">是</van-radio>
@@ -288,8 +356,7 @@ layout("/mobile/platform.html"){
</van-radio-group> </van-radio-group>
</template> </template>
</van-field> </van-field>
<van-field name="joinActivity" required <van-field name="joinActivity" required placeholder="是否愿意参加本协会的活动" label="是否愿意参加本协会的活动">
placeholder="是否愿意参加本协会的活动" label="是否愿意参加本协会的活动">
<template #input> <template #input>
<van-radio-group v-model="formData.joinActivity" direction="horizontal"> <van-radio-group v-model="formData.joinActivity" direction="horizontal">
<van-radio :name="true">是</van-radio> <van-radio :name="true">是</van-radio>
@@ -297,25 +364,30 @@ layout("/mobile/platform.html"){
</van-radio-group> </van-radio-group>
</template> </template>
</van-field> </van-field>
<van-field v-model="formData.otherThing" name="otherThing" <van-field
rows="1" v-model="formData.otherThing"
autosize name="otherThing"
type="textarea" rows="1"
placeholder="是否有特别需要说明的问题(身体或心理)" label="是否有特别需要说明的问题"></van-field> autosize
<van-field v-model="formData.remark" name="remark" type="textarea"
rows="1" placeholder="是否有特别需要说明的问题(身体或心理)"
autosize label="是否有特别需要说明的问题"
type="textarea" ></van-field>
placeholder="备注" label="备注"></van-field> <van-field
<van-field name="photo" label="两寸登记照" required v-model="formData.remark"
style="flex-flow: column" input-align="left"> name="remark"
rows="1"
autosize
type="textarea"
placeholder="备注"
label="备注"
></van-field>
<van-field name="photo" label="两寸登记照" required style="flex-flow: column" input-align="left">
<template #label> <template #label>
<div class="mb10">两寸登记照</div> <div class="mb10">两寸登记照</div>
</template> </template>
<template #input> <template #input>
<vant-file-upload <vant-file-upload :max="1" :files.sync="formData.photo"></vant-file-upload>
:max="1"
:files.sync="formData.photo"></vant-file-upload>
</template> </template>
</van-field> </van-field>
</van-cell-group> </van-cell-group>
@@ -326,12 +398,11 @@ layout("/mobile/platform.html"){
</van-tab> </van-tab>
</van-tabs> </van-tabs>
</van-popup> </van-popup>
</div> </div>
<script> <script>
const vue = new Vue({ const vue = new Vue({
el: '#app', el: "#app",
mixins: [mobileMixins], mixins: [mobileMixins],
data() { data() {
return { return {
@@ -339,20 +410,23 @@ layout("/mobile/platform.html"){
infoActive: 0, infoActive: 0,
clickRow: {}, clickRow: {},
typeOptions: [], typeOptions: [],
clubType: [{text: '未加入', value: false}, {text: '已加入', value: true}], clubType: [
{ text: "未加入", value: false },
{ text: "已加入", value: true }
],
infoShow: false, infoShow: false,
detailData: {}, detailData: {},
viewType: '', viewType: ""
} }
}, },
methods: { methods: {
showCode(type) { showCode(type) {
if(type === 'QQ' && this.clickRow.qqgroupcode) { if (type === "QQ" && this.clickRow.qqgroupcode) {
const ids = JSON.parse(this.clickRow.qqgroupcode).map(o => FILE_DOMAIN + '/fileStreamPreview?id=' + o.id) const ids = JSON.parse(this.clickRow.qqgroupcode).map((o) => FILE_DOMAIN + "/fileStreamPreview?id=" + o.id)
vant.ImagePreview({images: ids}) vant.ImagePreview({ images: ids })
} else if(type === 'weChat' && this.clickRow.wechatgroupcode) { } else if (type === "weChat" && this.clickRow.wechatgroupcode) {
const ids = JSON.parse(this.clickRow.wechatgroupcode).map(o => FILE_DOMAIN + '/fileStreamPreview?id=' + o.id) const ids = JSON.parse(this.clickRow.wechatgroupcode).map((o) => FILE_DOMAIN + "/fileStreamPreview?id=" + o.id)
vant.ImagePreview({images: ids}) vant.ImagePreview({ images: ids })
} }
}, },
doSearch() { doSearch() {
@@ -363,7 +437,7 @@ layout("/mobile/platform.html"){
}, },
async onLoad() { async onLoad() {
this.loading = true this.loading = true
$.post('/platform/sys/club/sq/pageData', this.pageForm).then(res => { $.post("/platform/sys/club/sq/pageData", this.pageForm).then((res) => {
if (res.code === 0) { if (res.code === 0) {
this.tableData = this.tableData.concat(res.data.list) this.tableData = this.tableData.concat(res.data.list)
if (this.tableData.length === res.data.totalCount) { if (this.tableData.length === res.data.totalCount) {
@@ -377,8 +451,8 @@ layout("/mobile/platform.html"){
}, },
openInfo(row, type) { openInfo(row, type) {
this.viewType = type this.viewType = type
this.infoActive = type === 'view' ? 0 : 1 this.infoActive = type === "view" ? 0 : 1
if(type === 'join') { if (type === "join") {
this.formData = { this.formData = {
username: "${@shiro.getPrincipalProperty('username')}", username: "${@shiro.getPrincipalProperty('username')}",
sex: "${@shiro.getPrincipalProperty('sex')}", sex: "${@shiro.getPrincipalProperty('sex')}",
@@ -390,80 +464,97 @@ layout("/mobile/platform.html"){
position: "${@shiro.getPrincipalProperty('position')}", position: "${@shiro.getPrincipalProperty('position')}",
mobile: "${@shiro.getPrincipalProperty('mobile')}", mobile: "${@shiro.getPrincipalProperty('mobile')}",
email: "${@shiro.getPrincipalProperty('email')}", email: "${@shiro.getPrincipalProperty('email')}",
homeAddress: "${@shiro.getPrincipalProperty('homeAddress')}", homeAddress: "${@shiro.getPrincipalProperty('homeAddress')}"
} }
} }
this.clickRow = row this.clickRow = row
$.get("/platform/sys/club/mange/findOne", {id: row.id}, (data) => { $.get(
if (data.code === 0) { "/platform/sys/club/mange/findOne",
this.detailData = data.data { id: row.id },
this.infoShow = true (data) => {
} if (data.code === 0) {
}, "json"); this.detailData = data.data
this.infoShow = true
}
},
"json"
)
}, },
async needJoin() { async needJoin() {
const row = this.clickRow const row = this.clickRow
if(this.formData.medicalHistory === '' || this.formData.medicalHistory === undefined || this.formData.medicalHistory === null) { if (this.formData.medicalHistory === "" || this.formData.medicalHistory === undefined || this.formData.medicalHistory === null) {
vant.Toast('请选择是否有过特殊病史') vant.Toast("请选择是否有过特殊病史")
return return
} }
if(this.formData.joinActivity === '' || this.formData.joinActivity === undefined || this.formData.joinActivity === null) { if (this.formData.joinActivity === "" || this.formData.joinActivity === undefined || this.formData.joinActivity === null) {
vant.Toast('请选择是否愿意参加本协会的活动') vant.Toast("请选择是否愿意参加本协会的活动")
return return
} }
if(this.formData.photo === '' || this.formData.photo === undefined || this.formData.photo === null) { if (this.formData.photo === "" || this.formData.photo === undefined || this.formData.photo === null) {
vant.Toast('请上传两寸登记照') vant.Toast("请上传两寸登记照")
return return
} }
const {code, data} = await $.post('/platform/sys/club/sq/getInClubByCurUser') const { code, data } = await $.post("/platform/sys/club/sq/getInClubByCurUser")
let str = '' let str = ""
if (data && data.length > 0) { if (data && data.length > 0) {
str = '您已经加入了' str = "您已经加入了"
data.forEach((item) => { data.forEach((item) => {
str += '【' + item.name + '】' str += "【" + item.name + "】"
}) })
str += ',' str += ","
} }
str += '请确认是否申请加入【' + row.name + '】?' str += "请确认是否申请加入【" + row.name + "】?"
vant.Dialog.confirm({title: '提示', message: str,}).then(() => { vant.Dialog.confirm({ title: "提示", message: str })
this.formData.clubid = row.id .then(() => {
this.formData.photo = this.formData.photo[0].filepath this.formData.clubid = row.id
$.post("/platform/sys/club/sq/submit", this.formData, (data) => { this.formData.photo = this.formData.photo[0].filepath
if (data.code === 0) { $.post(
vant.Toast(data.msg) "/platform/sys/club/sq/submit",
this.doSearch() this.formData,
this.infoShow = false (data) => {
} else { if (data.code === 0) {
vant.Toast(data.msg) vant.Toast(data.msg)
} this.doSearch()
}, "json"); this.infoShow = false
}).catch(() => { } else {
}); vant.Toast(data.msg)
}
},
"json"
)
})
.catch(() => {})
}, },
rollback(o) { rollback(o) {
vant.Dialog.confirm({title: '提示', message: '请确定是否撤销申请?',}).then(() => { vant.Dialog.confirm({ title: "提示", message: "请确定是否撤销申请?" })
const id = o.id .then(() => {
$.post("/platform/sys/club/sq/revocation", {id}, (data) => { const id = o.id
if (data.code === 0) { $.post(
vant.Toast('撤销申请成功'); "/platform/sys/club/sq/revocation",
this.doSearch(); { id },
} else { (data) => {
vant.Toast(data.msg); if (data.code === 0) {
} vant.Toast("撤销申请成功")
}, "json"); this.doSearch()
}).catch(() => { } else {
}); vant.Toast(data.msg)
}
},
"json"
)
})
.catch(() => {})
} }
}, },
async created() { async created() {
const data = await getClubType() const data = await getClubType()
data.forEach(item => { data.forEach((item) => {
this.typeOptions.push({text: item.name, value: item.code}) this.typeOptions.push({ text: item.name, value: item.code })
}) })
this.typeOptions.unshift({text: '全部类型'}) this.typeOptions.unshift({ text: "全部类型" })
this.$set(this.pageForm, "clubType", this.typeOptions[0].value) this.$set(this.pageForm, "clubType", this.typeOptions[0].value)
this.$set(this.pageForm, "isjr", this.clubType[0].value) this.$set(this.pageForm, "isjr", this.clubType[0].value)
this.pageForm.searchName = 'club.name' this.pageForm.searchName = "club.name"
this.onLoad() this.onLoad()
} }
}) })
@@ -3,7 +3,6 @@ layout("/mobile/platform.html"){
#--> #-->
<style> <style>
.van-index-bar__sidebar { .van-index-bar__sidebar {
display: none; display: none;
} }
@@ -83,51 +82,34 @@ layout("/mobile/platform.html"){
.userPopup .van-cell { .userPopup .van-cell {
padding: 10px 0px; padding: 10px 0px;
} }
</style> </style>
<div id="app" v-cloak> <div id="app" v-cloak>
<m-page-loading v-if="mLoading"></m-page-loading> <m-page-loading v-if="mLoading"></m-page-loading>
<!--top栏--> <!--top栏-->
<van-nav-bar <van-nav-bar @click-left="pjaxReplace('/mobile/index')" fixed left-arrow placeholder safe-area-inset-top title="校工会审核"></van-nav-bar>
@click-left="history.go(-1)"
fixed
left-arrow
placeholder
safe-area-inset-top
title="校工会审核"
></van-nav-bar>
<!--筛选框--> <!--筛选框-->
<div class="search-fixed"> <div class="search-fixed">
<van-search <van-search
@search="doSearch" @search="doSearch"
maxlength="10" maxlength="10"
placeholder="请输入社团名称进行查询" placeholder="请输入社团名称进行查询"
shape="round" shape="round"
v-model="pageForm.searchKeyword" v-model="pageForm.searchKeyword"
> ></van-search>
</van-search>
<van-dropdown-menu> <van-dropdown-menu>
<van-dropdown-item :options="typeOptions" @change="doSearch" <van-dropdown-item :options="typeOptions" @change="doSearch" v-model="pageForm.clubType"></van-dropdown-item>
v-model="pageForm.clubType"></van-dropdown-item>
</van-dropdown-menu> </van-dropdown-menu>
</div> </div>
<!--列表--> <!--列表-->
<div style="margin-top: 116px"> <div style="margin-top: 116px">
<van-list <van-list :finished="finished" :finished-text="tableData.length>0?'没有更多了':''" :immediate-check="false" @load="onLoad" v-model="loading">
:finished="finished"
:finished-text="tableData.length>0?'没有更多了':''" :immediate-check="false" @load="onLoad"
v-model="loading"
>
<div class="van-doc-card" v-for="o in tableData"> <div class="van-doc-card" v-for="o in tableData">
<div @click="openView(o.id)"> <div @click="openView(o.id)">
<div style="display: flex; justify-content: space-between"> <div style="display: flex; justify-content: space-between">
<div style="width: 74%"> <div style="width: 74%">
<div class="van-ellipsis title"> <div class="van-ellipsis title">
@@ -147,19 +129,34 @@ layout("/mobile/platform.html"){
<div style="margin-top: 4px"> <div style="margin-top: 4px">
<van-row> <van-row>
<van-col span="12"><span style="color: grey">联&ensp;系&ensp;人:</span>{{o.fzrname}}</van-col> <van-col span="12">
<van-col span="12"><span style="color: grey">电&emsp;&emsp;话:</span>{{o.fzr_mobile}} <span style="color: grey">联&ensp;系&ensp;人:</span>
{{o.fzrname}}
</van-col>
<van-col span="12">
<span style="color: grey">电&emsp;&emsp;话:</span>
{{o.fzr_mobile}}
</van-col> </van-col>
</van-row> </van-row>
<van-row> <van-row>
<van-col span="12"><span style="color: grey">限定人数:</span>{{o.number}}人</van-col> <van-col span="12">
<van-col span="12"><span style="color: grey">当前人数:</span>{{o.people_num}}</van-col> <span style="color: grey">限定人数:</span>
{{o.number}}人
</van-col>
<van-col span="12">
<span style="color: grey">当前人数:</span>
{{o.people_num}}
</van-col>
</van-row> </van-row>
<van-row> <van-row>
<van-col class="cus_overflow" span="24"> <van-col class="cus_overflow" span="24">
<span style="color: grey">介绍链接:</span> <span style="color: grey">介绍链接:</span>
<span @click.stop="window.open(o.introduce_href.indexOf('http') !== -1 ? o.introduce_href : 'https://' + o.introduce_href)" <span
style="color: #236eb4">{{o.introduce_href}}</span> @click.stop="window.open(o.introduce_href.indexOf('http') !== -1 ? o.introduce_href : 'https://' + o.introduce_href)"
style="color: #236eb4"
>
{{o.introduce_href}}
</span>
</van-col> </van-col>
</van-row> </van-row>
</div> </div>
@@ -168,25 +165,32 @@ layout("/mobile/platform.html"){
<div style="display: flex; justify-content: flex-end"> <div style="display: flex; justify-content: flex-end">
<div> <div>
<van-button @click.stop="getAuditList(o)" class="cus_button" <van-button
color="#1867b0" size="small" style="margin-right: 8px; width: auto;" @click.stop="getAuditList(o)"
type="primary">已审{{o.has_audit}} class="cus_button"
color="#1867b0"
size="small"
style="margin-right: 8px; width: auto"
type="primary"
>
已审{{o.has_audit}}
</van-button> </van-button>
<van-button @click.stop="openView(o)" class="cus_button" <van-button
color="#1867b0" size="small" style="margin-right: 8px; width: auto;" @click.stop="openView(o)"
type="primary">未审{{o.no_audit}} class="cus_button"
color="#1867b0"
size="small"
style="margin-right: 8px; width: auto"
type="primary"
>
未审{{o.no_audit}}
</van-button> </van-button>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</van-list> </van-list>
<van-empty <van-empty class="custom-image" description="暂无数据" image="/none.svg" v-if="mLoading==false&&tableData.length==0"></van-empty>
class="custom-image"
description="暂无数据"
image="/none.svg"
v-if="mLoading==false&&tableData.length==0"
></van-empty>
</div> </div>
<!--审核人员--> <!--审核人员-->
@@ -196,35 +200,50 @@ layout("/mobile/platform.html"){
<div style="display: flex; justify-content: space-between; margin-bottom: 10px"> <div style="display: flex; justify-content: space-between; margin-bottom: 10px">
<div v-if="queryType === 'notAudit'"> <div v-if="queryType === 'notAudit'">
<van-tag @click="checkAll()" plain size="large" type="primary">全选</van-tag> <van-tag @click="checkAll()" plain size="large" type="primary">全选</van-tag>
<van-tag @click="toggleAll()" plain size="large" style="margin-left: 6px" type="primary">反选 <van-tag @click="toggleAll()" plain size="large" style="margin-left: 6px" type="primary">反选</van-tag>
</van-tag>
</div> </div>
</div> </div>
<van-checkbox-group ref="checkboxGroup" v-if="userList !== null" v-model="result"> <van-checkbox-group ref="checkboxGroup" v-if="userList !== null" v-model="result">
<van-cell-group> <van-cell-group>
<van-cell <van-cell :key="obj.id" @click="toggle(index)" class="cus_cell" clickable v-for="(obj, index) in userList">
:key="obj.id" <div>
@click="toggle(index)" class="cus_cell" <span style="color: grey">姓&emsp;&emsp;名:</span>
clickable {{obj.username}}
v-for="(obj, index) in userList"> </div>
<div>
<div><span style="color: grey">姓&emsp;&emsp;名:</span>{{obj.username}}</div> <span style="color: grey">工&emsp;&emsp;号:</span>
<div><span style="color: grey">工&emsp;&emsp;号:</span>{{obj.loginname}}</div> {{obj.loginname}}
<div><span style="color: grey">单&emsp;&emsp;位:</span>{{obj.unitname}}</div> </div>
<div><span style="color: grey">性&emsp;&emsp;别:</span>{{obj.sex}}</div> <div>
<div><span style="color: grey">联系方式:</span>{{obj.mobile}}</div> <span style="color: grey">单&emsp;&emsp;位:</span>
{{obj.unitname}}
</div>
<div>
<span style="color: grey">性&emsp;&emsp;别:</span>
{{obj.sex}}
</div>
<div>
<span style="color: grey">联系方式:</span>
{{obj.mobile}}
</div>
<!--<span style="display: inline-block; width: 86px">{{obj.username}}</span> <!--<span style="display: inline-block; width: 86px">{{obj.username}}</span>
<span class="unit">{{obj.unitname}}</span> <span class="unit">{{obj.unitname}}</span>
<br/> <br/>
<span style="display: inline-block; width: 85px">{{obj.sex}}</span> <span style="display: inline-block; width: 85px">{{obj.sex}}</span>
<span style="display: inline-block; width: 106px">13296575967</span> <span style="display: inline-block; width: 106px">13296575967</span>
<span style="display: inline-block;">{{obj.loginname}}</span>--> <span style="display: inline-block;">{{obj.loginname}}</span>-->
<van-icon class="audit_icon" color="green" <van-icon
name="passed" class="audit_icon"
v-if="queryType === 'hasAudit' && obj.auditstate === true"></van-icon> color="green"
<van-icon class="audit_icon" color="grey" name="passed"
name="close" v-if="queryType === 'hasAudit' && obj.auditstate === true"
v-if="queryType === 'hasAudit' && obj.auditstate === false"></van-icon> ></van-icon>
<van-icon
class="audit_icon"
color="grey"
name="close"
v-if="queryType === 'hasAudit' && obj.auditstate === false"
></van-icon>
<template #right-icon v-if="queryType === 'notAudit'"> <template #right-icon v-if="queryType === 'notAudit'">
<van-checkbox :name="obj.id" ref="checkboxes"></van-checkbox> <van-checkbox :name="obj.id" ref="checkboxes"></van-checkbox>
</template> </template>
@@ -232,22 +251,15 @@ layout("/mobile/platform.html"){
</van-cell-group> </van-cell-group>
</van-checkbox-group> </van-checkbox-group>
<div style="margin-top: 4px; text-align: center" v-else>暂无申请人员</div> <div style="margin-top: 4px; text-align: center" v-else>暂无申请人员</div>
</div> </div>
<div style="display: flex; justify-content: space-evenly; position: fixed; bottom: 56px; width: 95%" <div style="display: flex; justify-content: space-evenly; position: fixed; bottom: 56px; width: 95%" v-if="queryType === 'notAudit'">
v-if="queryType === 'notAudit'"> <van-button @click="audit('many', 'reject')" color="#ff976a" size="small" style="height: 38px">驳回</van-button>
<van-button @click="audit('many', 'reject')" color="#ff976a" size="small" style="height: 38px">驳回 <van-button @click="audit('many', 'pass')" color="#1867b0" size="small" style="height: 38px">通过</van-button>
</van-button>
<van-button @click="audit('many', 'pass')" color="#1867b0" size="small" style="height: 38px">通过
</van-button>
</div> </div>
<div style="display: flex; justify-content: space-evenly; position: fixed; bottom: 10px; width: 95%" <div style="display: flex; justify-content: space-evenly; position: fixed; bottom: 10px; width: 95%" v-if="queryType === 'notAudit'">
v-if="queryType === 'notAudit'"> <van-button @click="audit('all', 'reject')" color="#ff976a" size="small" style="height: 38px">一键全部驳回</van-button>
<van-button @click="audit('all', 'reject')" color="#ff976a" size="small" style="height: 38px">一键全部驳回 <van-button @click="audit('all', 'pass')" color="#1867b0" size="small" style="height: 38px">一键全部通过</van-button>
</van-button>
<van-button @click="audit('all', 'pass')" color="#1867b0" size="small" style="height: 38px">一键全部通过
</van-button>
</div> </div>
</div> </div>
</van-action-sheet> </van-action-sheet>
@@ -255,65 +267,66 @@ layout("/mobile/platform.html"){
<script> <script>
const vue = new Vue({ const vue = new Vue({
el: '#app', el: "#app",
mixins: [mobileMixins], mixins: [mobileMixins],
data() { data() {
return { return {
queryType: '', queryType: "",
result: [], result: [],
userList: [], userList: [],
userShow: false, userShow: false,
clickRow: {}, clickRow: {},
typeOptions: [], typeOptions: []
} }
}, },
methods: { methods: {
async audit(type, auditType) { async audit(type, auditType) {
if (type === 'many' && this.result.length === 0) { if (type === "many" && this.result.length === 0) {
vant.Toast('请先选择人员') vant.Toast("请先选择人员")
return return
} }
const str = type === 'many' ? '您选择了' + this.result.length + '个人,请确认您的选择!' : '您确定要一键全部审核吗?' const str = type === "many" ? "您选择了" + this.result.length + "个人,请确认您的选择!" : "您确定要一键全部审核吗?"
vant.Dialog.confirm({title: '提示', message: str,}).then(async () => { vant.Dialog.confirm({ title: "提示", message: str })
let idList = this.result .then(async () => {
if (type === 'all') { let idList = this.result
idList = this.userList.map(o => o.id) if (type === "all") {
} idList = this.userList.map((o) => o.id)
const resp = await $.post('/platform/sys/club/sh/check', { }
ids: JSON.stringify(idList), const resp = await $.post("/platform/sys/club/sh/check", {
flag: auditType === 'pass', ids: JSON.stringify(idList),
type: 2, flag: auditType === "pass",
type: 2
})
if (resp.code === 0) {
this.doSearch()
}
vant.Toast(resp.msg)
this.userShow = false
}) })
if (resp.code === 0) { .catch(() => {})
this.doSearch()
}
vant.Toast(resp.msg)
this.userShow = false
}).catch(() => {
});
}, },
checkAll() { checkAll() {
this.$refs.checkboxGroup.children.forEach(item => item.toggle(true)) this.$refs.checkboxGroup.children.forEach((item) => item.toggle(true))
}, },
toggleAll() { toggleAll() {
this.$refs.checkboxGroup.children.forEach(item => item.toggle()) this.$refs.checkboxGroup.children.forEach((item) => item.toggle())
}, },
toggle(index) { toggle(index) {
this.$refs.checkboxes[index].toggle(); this.$refs.checkboxes[index].toggle()
}, },
popClose() { popClose() {
this.$nextTick(function () { this.$nextTick(function () {
if (this.$refs.checkboxes !== undefined) { if (this.$refs.checkboxes !== undefined) {
this.$refs.checkboxes.forEach(item => item.toggle(false)); this.$refs.checkboxes.forEach((item) => item.toggle(false))
} }
}) })
}, },
async getAuditList(o) { async getAuditList(o) {
this.queryType = 'hasAudit' this.queryType = "hasAudit"
const resp = await $.post('/platform/sys/club/sh/getClubUser', { const resp = await $.post("/platform/sys/club/sh/getClubUser", {
id: o.id, id: o.id,
auditType: 'hasAudit', auditType: "hasAudit",
type: 2, type: 2
}) })
if (resp.code === 0) { if (resp.code === 0) {
this.userList = resp.data this.userList = resp.data
@@ -324,24 +337,24 @@ layout("/mobile/platform.html"){
} }
}, },
async openView(o) { async openView(o) {
this.queryType = 'notAudit' this.queryType = "notAudit"
this.userList = [] this.userList = []
const resp = await $.post('/platform/sys/club/sh/getClubUser', { const resp = await $.post("/platform/sys/club/sh/getClubUser", {
id: o.id, id: o.id,
auditType: 'notAudit', auditType: "notAudit",
type: 2, type: 2
}) })
if (resp.code === 0) { if (resp.code === 0) {
this.userList = resp.data this.userList = resp.data
this.userClickList = [] this.userClickList = []
if (this.userList.length === 0) { if (this.userList.length === 0) {
vant.Toast('暂无申请人员') vant.Toast("暂无申请人员")
} else { } else {
this.userShow = true this.userShow = true
} }
return return
} }
vant.Toast('系统错误,请联系管理员') vant.Toast("系统错误,请联系管理员")
}, },
doSearch() { doSearch() {
this.pageForm.pageNumber = 1 this.pageForm.pageNumber = 1
@@ -352,7 +365,7 @@ layout("/mobile/platform.html"){
async onLoad() { async onLoad() {
this.loading = true this.loading = true
this.pageForm.type = 2 this.pageForm.type = 2
$.post('/platform/sys/club/sh/getMyClub', this.pageForm).then(res => { $.post("/platform/sys/club/sh/getMyClub", this.pageForm).then((res) => {
if (res.code === 0) { if (res.code === 0) {
this.tableData = this.tableData.concat(res.data.list) this.tableData = this.tableData.concat(res.data.list)
if (this.tableData.length === res.data.totalCount) { if (this.tableData.length === res.data.totalCount) {
@@ -363,14 +376,14 @@ layout("/mobile/platform.html"){
} }
this.loading = false this.loading = false
}) })
}, }
}, },
async created() { async created() {
const data = await getClubType() const data = await getClubType()
data.forEach(item => { data.forEach((item) => {
this.typeOptions.push({text: item.name, value: item.code}) this.typeOptions.push({ text: item.name, value: item.code })
}) })
this.typeOptions.unshift({text: '全部类型'}) this.typeOptions.unshift({ text: "全部类型" })
this.$set(this.pageForm, "clubType", this.typeOptions[0].value) this.$set(this.pageForm, "clubType", this.typeOptions[0].value)
this.onLoad() this.onLoad()
} }
@@ -3,149 +3,208 @@ layout("/mobile/platform.html"){
#--> #-->
<div id="app" v-cloak> <div id="app" v-cloak>
<van-nav-bar title="填写慰问申请" left-arrow placeholder fixed <van-nav-bar title="填写慰问申请" left-arrow placeholder fixed @click-left="pjaxReplace('/mobile/index')"></van-nav-bar>
@click-left="history.back()"></van-nav-bar>
<van-form ref="addForm" :show-error-message="false" input-align="right" style="margin-bottom: 60px"> <van-form ref="addForm" :show-error-message="false" input-align="right" style="margin-bottom: 60px">
<van-cell-group inset class="mt10"> <van-cell-group inset class="mt10">
<van-field readonly value="${@shiro.getPrincipalProperty('username')}" name="manager_name" <van-field readonly value="${@shiro.getPrincipalProperty('username')}" name="manager_name" label="经办人姓名"></van-field>
label="经办人姓名"></van-field> <van-field readonly value="${@shiro.getPrincipalProperty('loginname')}" name="manager_name" label="经办人工号"></van-field>
<van-field readonly value="${@shiro.getPrincipalProperty('loginname')}" name="manager_name" <van-field
label="经办人工号"></van-field> @input="userRemoteMethod"
<van-field @input="userRemoteMethod" name="be_user_name" name="be_user_name"
required required
v-model="formData.be_user_name" label="慰问对象" placeholder="请输入慰问对象" v-model="formData.be_user_name"
:rules="[{ required: true, message: '请填写慰问对象' }]"></van-field> label="慰问对象"
<van-action-sheet v-model="sheetShow" placeholder="请输入慰问对象"
:actions="userList" :rules="[{ required: true, message: '请填写慰问对象' }]"
cancel-text="重新输入姓名或工号查询"
@cancel="userList = []; formData.be_user_name = ''"
:close-on-click-overlay="false"
@select="onUserSelect">
</van-action-sheet>
<van-field readonly :value="formData.apply_time" name="apply_time"
label="申请时间"
></van-field> ></van-field>
<van-action-sheet
v-model="sheetShow"
:actions="userList"
cancel-text="重新输入姓名或工号查询"
@cancel="userList = []; formData.be_user_name = ''"
:close-on-click-overlay="false"
@select="onUserSelect"
></van-action-sheet>
<van-field readonly :value="formData.apply_time" name="apply_time" label="申请时间"></van-field>
<van-field @input="payeeUserRemoteMethod" name="payee_name" <van-field
required :rules="[{ required: true, message: '请选择收款人' }]" @input="payeeUserRemoteMethod"
v-model="formData.payee_name" label="收款人" placeholder="请输入收款人"></van-field> name="payee_name"
<van-action-sheet v-model="payeeSheetShow" required
:actions="payeeUserList" :rules="[{ required: true, message: '请选择收款人' }]"
cancel-text="重新输入姓名或工号查询" v-model="formData.payee_name"
@cancel="payeeUserList = []; formData.payee_name = ''" label="收款人"
:close-on-click-overlay="false" placeholder="请输入收款人"
@select="payeeOnUserSelect"> ></van-field>
</van-action-sheet> <van-action-sheet
v-model="payeeSheetShow"
:actions="payeeUserList"
cancel-text="重新输入姓名或工号查询"
@cancel="payeeUserList = []; formData.payee_name = ''"
:close-on-click-overlay="false"
@select="payeeOnUserSelect"
></van-action-sheet>
<!--<van-field v-model="formData.payee_bank_number" name="payee_bank_number" type="number" <!--<van-field v-model="formData.payee_bank_number" name="payee_bank_number" type="number"
label="收款人银行卡" placeholder="请输入收款人银行卡"></van-field> label="收款人银行卡" placeholder="请输入收款人银行卡"></van-field>
<van-field v-model="formData.payee_bank_name" name="payee_bank_name" <van-field v-model="formData.payee_bank_name" name="payee_bank_name"
label="收款人开户行" placeholder="请输入收款人开户行"></van-field>--> label="收款人开户行" placeholder="请输入收款人开户行"></van-field>-->
<van-field
<van-field readonly clickable name="type" :value="formData.typeName" readonly
required clickable
label="慰问类型" name="type"
@click="showTypePicker = true" placeholder="点击选择慰问类型" :value="formData.typeName"
:rules="[{ required:true, message: '请选择慰问类型'}]"></van-field> required
label="慰问类型"
@click="showTypePicker = true"
placeholder="点击选择慰问类型"
:rules="[{ required:true, message: '请选择慰问类型'}]"
></van-field>
<van-popup v-model:show="showTypePicker" position="bottom" round> <van-popup v-model:show="showTypePicker" position="bottom" round>
<van-picker show-toolbar :columns="typeColumns" @confirm="onTypeConfirm" <van-picker show-toolbar :columns="typeColumns" @confirm="onTypeConfirm" @cancel="showTypePicker = false"></van-picker>
@cancel="showTypePicker = false">
</van-picker>
</van-popup>
<van-field readonly clickable name="way" :value="formData.wayName"
label="慰问方式"
required
placeholder="点击选择慰问方式"
:rules="[{ required:true, message: '请选择慰问方式'}]"></van-field>
<van-popup v-model:show="showWayPicker" position="bottom" round>
<van-picker show-toolbar :columns="wayColumns" @confirm="onWayConfirm"
@cancel="showWayPicker = false">
</van-picker>
</van-popup>
<van-field v-model="formData.money" name="money" type="number" label="慰问金额"
placeholder="请填写慰问金额"
:rules="[{ required:true, message: '请填写慰问金额' }]"></van-field>
<!-- 孩次 -->
<van-field readonly clickable name="type" v-model="formData.birth_child_num"
required v-if="formData.type==='2'"
label="孩次"
@click="showChildPicker = true" placeholder="点击选择孩次"
:rules="[{ required:true, message: '请选择孩次'}]"></van-field>
<van-popup v-model:show="showChildPicker" position="bottom" round>
<van-picker show-toolbar :columns="childColumns" @confirm="onChildConfirm"
@cancel="showChildPicker = false">
</van-picker>
</van-popup> </van-popup>
<van-field <van-field
required readonly
:rules="[{ required:true, message: '请填写慰问时间' }]" clickable
readonly name="way"
clickable :value="formData.wayName"
name="occur_time" label="慰问方式"
:value="formData.occur_time" required
label="慰问时间" placeholder="点击选择慰问方式"
placeholder="点击选择慰问时间" :rules="[{ required:true, message: '请选择慰问方式'}]"
@click="showOccurTime = true"
></van-field> ></van-field>
<van-calendar v-model="showOccurTime" <van-popup v-model:show="showWayPicker" position="bottom" round>
@confirm="onOccurTimeConfirm" <van-picker show-toolbar :columns="wayColumns" @confirm="onWayConfirm" @cancel="showWayPicker = false"></van-picker>
:min-date="minDate" </van-popup>
:max-date="maxDate"
:color="themeColor"></van-calendar> <van-field
v-model="formData.money"
name="money"
type="number"
label="慰问金额"
placeholder="请填写慰问金额"
:rules="[{ required:true, message: '请填写慰问金额' }]"
></van-field>
<!-- 孩次 -->
<van-field
readonly
clickable
name="type"
v-model="formData.birth_child_num"
required
v-if="formData.type==='2'"
label="孩次"
@click="showChildPicker = true"
placeholder="点击选择孩次"
:rules="[{ required:true, message: '请选择孩次'}]"
></van-field>
<van-popup v-model:show="showChildPicker" position="bottom" round>
<van-picker show-toolbar :columns="childColumns" @confirm="onChildConfirm" @cancel="showChildPicker = false"></van-picker>
</van-popup>
<van-field
required
:rules="[{ required:true, message: '请填写慰问时间' }]"
readonly
clickable
name="occur_time"
:value="formData.occur_time"
label="慰问时间"
placeholder="点击选择慰问时间"
@click="showOccurTime = true"
></van-field>
<van-calendar
v-model="showOccurTime"
@confirm="onOccurTimeConfirm"
:min-date="minDate"
:max-date="maxDate"
:color="themeColor"
></van-calendar>
<template v-if="['3','4'].includes(formData.type)"> <template v-if="['3','4'].includes(formData.type)">
<van-field v-model="formData.the_hospital" name="the_hospital" label="治疗医院" <van-field
placeholder="请填写治疗医院" required v-model="formData.the_hospital"
:rules="[{ required:true, message: '请填写治疗医院' }]"></van-field> name="the_hospital"
<van-field v-model="formData.the_hospital_house_num" name="the_hospital_house_num" label="病房号" label="治疗医院"
placeholder="请填写病房号" required placeholder="请填写治疗医院"
:rules="[{ required:true, message: '请填写病房号' }]"></van-field> required
<van-field v-model="formData.the_hospital_house_bed_num" name="the_hospital_house_bed_num" label="床号" :rules="[{ required:true, message: '请填写治疗医院' }]"
placeholder="请填写床号" required ></van-field>
:rules="[{ required:true, message: '请填写床号' }]"></van-field> <van-field
v-model="formData.the_hospital_house_num"
name="the_hospital_house_num"
label="病房号"
placeholder="请填写病房号"
required
:rules="[{ required:true, message: '请填写病房号' }]"
></van-field>
<van-field
v-model="formData.the_hospital_house_bed_num"
name="the_hospital_house_bed_num"
label="床号"
placeholder="请填写床号"
required
:rules="[{ required:true, message: '请填写床号' }]"
></van-field>
</template> </template>
<template v-if="['4'].includes(formData.type)"> <template v-if="['4'].includes(formData.type)">
<van-field v-model="formData.hospital_by" name="hospital_by" label="患病病种" <van-field
placeholder="请填写患病病种" required v-model="formData.hospital_by"
:rules="[{ required:true, message: '请填写患病病种' }]"></van-field> name="hospital_by"
label="患病病种"
placeholder="请填写患病病种"
required
:rules="[{ required:true, message: '请填写患病病种' }]"
></van-field>
</template> </template>
<template v-if="['6'].includes(formData.type)"> <template v-if="['6'].includes(formData.type)">
<van-field v-model="formData.deadImmediateFamily" name="deadImmediateFamily" label="直系亲属" <van-field
placeholder="配偶、父亲、母亲、子女" required v-model="formData.deadImmediateFamily"
:rules="[{ required:true, message: '必填' }]"></van-field> name="deadImmediateFamily"
label="直系亲属"
placeholder="配偶、父亲、母亲、子女"
required
:rules="[{ required:true, message: '必填' }]"
></van-field>
</template> </template>
<!-- <template--> <!-- <template-->
<!-- v-if="['c7175af55693441e8233be4552cef9d5','0872ea0b95aa463fb8d98c46bdf72537'].includes(formData.type)">--> <!-- v-if="['c7175af55693441e8233be4552cef9d5','0872ea0b95aa463fb8d98c46bdf72537'].includes(formData.type)">-->
<!-- <van-field :value="formData.hospital_stay"--> <!-- <van-field :value="formData.hospital_stay"-->
<!-- readonly clickable required--> <!-- readonly clickable required-->
<!-- @click="hospital_stay = true"--> <!-- @click="hospital_stay = true"-->
<!-- name="hospital_stay" label="住院时间"--> <!-- name="hospital_stay" label="住院时间"-->
<!-- placeholder="请选择住院时间"--> <!-- placeholder="请选择住院时间"-->
<!-- :rules="[{ required:true, message: '请选择住院时间' }]"></van-field>--> <!-- :rules="[{ required:true, message: '请选择住院时间' }]"></van-field>-->
<!-- <van-calendar v-model="hospital_stay" type="range" @confirm="onConfirm"--> <!-- <van-calendar v-model="hospital_stay" type="range" @confirm="onConfirm"-->
<!-- :min-date="new Date('1999-01-01')"--> <!-- :min-date="new Date('1999-01-01')"-->
<!-- :color="themeColor"></van-calendar>--> <!-- :color="themeColor"></van-calendar>-->
<!-- <van-field v-model="formData.the_hospital" name="the_hospital" name="type" label="所在医院"--> <!-- <van-field v-model="formData.the_hospital" name="the_hospital" name="type" label="所在医院"-->
<!-- placeholder="请填写所在医院" required--> <!-- placeholder="请填写所在医院" required-->
<!-- :rules="[{ required:true, message: '请填写所在医院' }]"></van-field>--> <!-- :rules="[{ required:true, message: '请填写所在医院' }]"></van-field>-->
<!-- </template>--> <!-- </template>-->
<van-field v-model="formData.remark" name="remark" label="申请事由" style="flex-flow: column" <van-field
required v-model="formData.remark"
:rules="[{ required:true, message: '请填写申请事由' }]" name="remark"
placeholder="请填写申请事由" label="申请事由"
input-align="left" style="flex-flow: column"
rows="3" maxlength="200" type="textarea" show-word-limit autosize> required
:rules="[{ required:true, message: '请填写申请事由' }]"
placeholder="请填写申请事由"
input-align="left"
rows="3"
maxlength="200"
type="textarea"
show-word-limit
autosize
>
<template #label> <template #label>
<div class="mb10">申请事由</div> <div class="mb10">申请事由</div>
</template> </template>
@@ -153,8 +212,7 @@ layout("/mobile/platform.html"){
</van-cell-group> </van-cell-group>
<van-cell-group inset class="mt10" v-if="isUploadFile === true"> <van-cell-group inset class="mt10" v-if="isUploadFile === true">
<van-field name="files" label="附&emsp;&emsp;件" required <van-field name="files" label="附&emsp;&emsp;件" required style="flex-flow: column" input-align="left">
style="flex-flow: column" input-align="left">
<template #label> <template #label>
<div class="mb10">附&emsp;&emsp;件</div> <div class="mb10">附&emsp;&emsp;件</div>
</template> </template>
@@ -162,8 +220,8 @@ layout("/mobile/platform.html"){
<vant-file-upload :files.sync="formData.files"></vant-file-upload> <vant-file-upload :files.sync="formData.files"></vant-file-upload>
</template> </template>
</van-field> </van-field>
<div style="margin: 0 0 7px 15px;" v-if="isUploadFile && uploadFileDesc"> <div style="margin: 0 0 7px 15px" v-if="isUploadFile && uploadFileDesc">
<span style="color:red;">上传附件说明:{{ uploadFileDesc }}</span> <span style="color: red">上传附件说明:{{ uploadFileDesc }}</span>
</div> </div>
</van-cell-group> </van-cell-group>
@@ -179,26 +237,21 @@ layout("/mobile/platform.html"){
</van-cell-group> </van-cell-group>
<div style="margin: 20px 20px 10px 20px"> <div style="margin: 20px 20px 10px 20px">
<van-button @click="onSubmit()" style="border-radius: 10px" block type="info" :color="themeColor"> <van-button @click="onSubmit()" style="border-radius: 10px" block type="info" :color="themeColor">提 交</van-button>
提 交
</van-button>
</div> </div>
</van-form> </van-form>
<div> <div>
<van-tabbar v-model="tarBarActive" style="z-index: 99"> <van-tabbar v-model="tarBarActive" style="z-index: 99">
<van-tabbar-item icon="home-o" replace url="/mobile/condolence/apply/for">慰问申请 <van-tabbar-item icon="home-o" replace url="/mobile/condolence/apply/for">慰问申请</van-tabbar-item>
</van-tabbar-item> <van-tabbar-item icon="manager-o" replace url="/mobile/condolence/apply">慰问记录</van-tabbar-item>
<van-tabbar-item icon="manager-o" replace url="/mobile/condolence/apply">慰问记录
</van-tabbar-item>
</van-tabbar> </van-tabbar>
</div> </div>
</div> </div>
<script> <script>
const vue = new Vue({ const vue = new Vue({
el: '#app', el: "#app",
mixins: [mobileMixins], mixins: [mobileMixins],
data() { data() {
return { return {
@@ -222,34 +275,38 @@ layout("/mobile/platform.html"){
money: 0, money: 0,
isUploadFile: true, isUploadFile: true,
uploadFileDesc: null, uploadFileDesc: null,
showChildPicker:false, showChildPicker: false,
childColumns:[{value:'一孩',text:'一孩'},{value:'二孩',text:'二孩'},{value:'三孩',text:'三孩'}], childColumns: [
{ value: "一孩", text: "一孩" },
{ value: "二孩", text: "二孩" },
{ value: "三孩", text: "三孩" }
]
} }
}, },
watch: { watch: {
"formData.money"(val) { "formData.money"(val) {
if (val > this.money) { if (val > this.money) {
this.$notify({ this.$notify({
title: '警告', title: "警告",
message: '金额超过规定金额' + this.money + "(元)", message: "金额超过规定金额" + this.money + "(元)",
type: 'warning' type: "warning"
}); })
this.$set(this.formData, "money", this.money) this.$set(this.formData, "money", this.money)
} }
} }
}, },
components: { components: {
'mobile-sign': httpVueLoader('/components/sign/mobileSign.vue?v='+new Date().getTime()), "mobile-sign": httpVueLoader("/components/sign/mobileSign.vue?v=" + new Date().getTime())
}, },
methods: { methods: {
onChildConfirm(data){ onChildConfirm(data) {
console.log(data) console.log(data)
this.formData.birth_child_num = data.value this.formData.birth_child_num = data.value
this.showChildPicker = false this.showChildPicker = false
}, },
priceInput() { priceInput() {
let num = 0 let num = 0
this.goods.forEach(v => { this.goods.forEach((v) => {
num += parseFloat(v.price) num += parseFloat(v.price)
}) })
this.$set(this.formData, "money", num) this.$set(this.formData, "money", num)
@@ -259,18 +316,19 @@ layout("/mobile/platform.html"){
this.showOccurTime = false this.showOccurTime = false
}, },
onConfirm(date) { onConfirm(date) {
const [start, end] = date; const [start, end] = date
this.hospital_stay = false; this.hospital_stay = false
this.formData.hospital_stay = moment(start).format('YYYY-MM-DD') + "-" + moment(end).format('YYYY-MM-DD'); this.formData.hospital_stay = moment(start).format("YYYY-MM-DD") + "-" + moment(end).format("YYYY-MM-DD")
this.$set(this.formData, "hospital_stay_1", moment(start).format('YYYY-MM-DD')) this.$set(this.formData, "hospital_stay_1", moment(start).format("YYYY-MM-DD"))
this.$set(this.formData, "hospital_stay_2", moment(end).format('YYYY-MM-DD')) this.$set(this.formData, "hospital_stay_2", moment(end).format("YYYY-MM-DD"))
}, },
async userRemoteMethod(event) { async userRemoteMethod(event) {
if (event) { if (event) {
const arr = await this.queryUser(event) const arr = await this.queryUser(event)
this.userList = arr.map(v => { this.userList = arr.map((v) => {
return { return {
name: v.username + "(" + v.loginname + ")", id: v.id name: v.username + "(" + v.loginname + ")",
id: v.id
} }
}) })
this.sheetShow = true this.sheetShow = true
@@ -279,32 +337,33 @@ layout("/mobile/platform.html"){
async payeeUserRemoteMethod(event) { async payeeUserRemoteMethod(event) {
if (event) { if (event) {
const arr = await this.queryUser(event) const arr = await this.queryUser(event)
this.payeeUserList = arr.map(v => { this.payeeUserList = arr.map((v) => {
return { return {
name: v.username + "(" + v.loginname + ")", id: v.id name: v.username + "(" + v.loginname + ")",
id: v.id
} }
}) })
this.payeeSheetShow = true this.payeeSheetShow = true
} }
}, },
async queryUser(query) { async queryUser(query) {
const {data} = await $.get("/platform/fw/condolence/apply/queryUser", {query}) const { data } = await $.get("/platform/fw/condolence/apply/queryUser", { query })
return data return data
}, },
onUserSelect(u) { onUserSelect(u) {
this.$set(this.formData, 'be_user', u.id) this.$set(this.formData, "be_user", u.id)
this.$set(this.formData, 'be_user_name', u.name) this.$set(this.formData, "be_user_name", u.name)
this.sheetShow = false this.sheetShow = false
}, },
payeeOnUserSelect(u) { payeeOnUserSelect(u) {
this.$set(this.formData, 'payee', u.id) this.$set(this.formData, "payee", u.id)
this.$set(this.formData, 'payee_name', u.name) this.$set(this.formData, "payee_name", u.name)
this.payeeSheetShow = false this.payeeSheetShow = false
}, },
async onTypeConfirm(val) { async onTypeConfirm(val) {
this.$set(this.formData, "typeName", val.text) this.$set(this.formData, "typeName", val.text)
this.$set(this.formData, "type", val.value) this.$set(this.formData, "type", val.value)
const {data, code, msg} = await $.get("/platform/condolence/type/findOne", {id: val.value}) const { data, code, msg } = await $.get("/platform/condolence/type/findOne", { id: val.value })
console.log(data) console.log(data)
this.isUploadFile = data.isUploadFile this.isUploadFile = data.isUploadFile
@@ -312,15 +371,15 @@ layout("/mobile/platform.html"){
this.$set(this, "money", data.money) this.$set(this, "money", data.money)
await this.moneyChange(val.value) await this.moneyChange(val.value)
this.showTypePicker = false; this.showTypePicker = false
}, },
onWayConfirm(val) { onWayConfirm(val) {
this.$set(this.formData, "wayName", val.text) this.$set(this.formData, "wayName", val.text)
this.$set(this.formData, "way", val.value) this.$set(this.formData, "way", val.value)
this.showWayPicker = false; this.showWayPicker = false
}, },
async moneyChange(id) { async moneyChange(id) {
const {data, code, msg} = await $.get("/platform/condolence/type/findOne", {id}) const { data, code, msg } = await $.get("/platform/condolence/type/findOne", { id })
if (data) { if (data) {
this.$set(this.formData, "money", data.money) this.$set(this.formData, "money", data.money)
this.$set(this.formData, "wayName", data.way) this.$set(this.formData, "wayName", data.way)
@@ -329,34 +388,34 @@ layout("/mobile/platform.html"){
}, },
async onSubmit() { async onSubmit() {
if (!this.formData.files) { if (!this.formData.files) {
vant.Toast('请上传附件材料!') vant.Toast("请上传附件材料!")
return return
} }
this.$refs.signature.submitSign() this.$refs.signature.submitSign()
if (this.$refs.signature.checkNull()) { if (this.$refs.signature.checkNull()) {
this.$toast('请签名!') this.$toast("请签名!")
return return
} }
await this.$refs.signature.updateSign() await this.$refs.signature.updateSign()
const formData = clone(this.formData) const formData = clone(this.formData)
formData.mobile = "${@shiro.getPrincipalProperty('mobile')}" formData.mobile = "${@shiro.getPrincipalProperty('mobile')}"
formData.files = JSON.stringify(formData.files) formData.files = JSON.stringify(formData.files)
this.$refs['addForm'].validate().then(async () => { this.$refs["addForm"].validate().then(async () => {
this.$toast.loading('提交中...') this.$toast.loading("提交中...")
const res = await $.post('/platform/fw/condolence/apply/doAdd', { const res = await $.post("/platform/fw/condolence/apply/doAdd", {
data: JSON.stringify(formData), data: JSON.stringify(formData),
sign: formData.sign sign: formData.sign
}) })
if (res.code === 0) { if (res.code === 0) {
this.$toast.success('申请成功'); this.$toast.success("申请成功")
setTimeout(() => { setTimeout(() => {
location.replace('/mobile/condolence/apply') location.replace("/mobile/condolence/apply")
}, 1000) }, 1000)
} else { } else {
this.$toast.fail('申请失败'); this.$toast.fail("申请失败")
} }
}) })
}, }
}, },
mounted() { mounted() {
this.$nextTick(() => { this.$nextTick(() => {
@@ -366,21 +425,20 @@ layout("/mobile/platform.html"){
}) })
}, },
async created() { async created() {
this.formData.apply_time = moment().format('YYYY-MM-DD') this.formData.apply_time = moment().format("YYYY-MM-DD")
this.formData.be_user = "${@shiro.getPrincipalProperty('id')}" this.formData.be_user = "${@shiro.getPrincipalProperty('id')}"
//this.formData.be_user_name = "${@shiro.getPrincipalProperty('username')}" + "(" + "${@shiro.getPrincipalProperty('loginname')}" + ")" //this.formData.be_user_name = "${@shiro.getPrincipalProperty('username')}" + "(" + "${@shiro.getPrincipalProperty('loginname')}" + ")"
const {code, data} = await $.get("/platform/condolence/type/getAll") const { code, data } = await $.get("/platform/condolence/type/getAll")
data.forEach(v => { data.forEach((v) => {
this.typeColumns.push({value: v.id, text: v.name + "(" + v.code + ")"}) this.typeColumns.push({ value: v.id, text: v.name + "(" + v.code + ")" })
}) })
for (let i in condolence.way) { for (let i in condolence.way) {
this.wayColumns.push({value: condolence.way[i], text: condolence.way[i]}) this.wayColumns.push({ value: condolence.way[i], text: condolence.way[i] })
} }
} }
}) })
</script> </script>
<style> <style>
.up_down > .van-cell { .up_down > .van-cell {
flex-flow: column; flex-flow: column;
} }
@@ -389,14 +447,15 @@ layout("/mobile/platform.html"){
width: 100%; width: 100%;
} }
.van-cell, .van-picker button, .submit .van-button--normal { .van-cell,
.van-picker button,
.submit .van-button--normal {
font-size: 16px; font-size: 16px;
} }
.van-divider { .van-divider {
margin: 10px 0; margin: 10px 0;
} }
</style> </style>
<!--# <!--#
} }

Some files were not shown because too many files have changed in this diff Show More