commit
This commit is contained in:
@@ -259,6 +259,25 @@
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</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>
|
||||
<groupId>org.nutz</groupId>
|
||||
<artifactId>nutzboot-starter-test-junit4</artifactId>
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
package io.v.nutz.base.utils;
|
||||
|
||||
import com.deepoove.poi.data.PictureRenderData;
|
||||
import com.deepoove.poi.data.PictureType;
|
||||
import io.v.nutz.base.service.BaseService;
|
||||
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.SysUserRoleService;
|
||||
import io.v.nutz.sys.services.SysUserService;
|
||||
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.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.entity.Record;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.dao.util.Daos;
|
||||
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.HttpServletRequest;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -48,6 +49,9 @@ public class Vi {
|
||||
@Inject
|
||||
private SysUserRoleService sysUserRoleService;
|
||||
|
||||
@Inject
|
||||
private static FtpService ftpService;
|
||||
|
||||
/**
|
||||
* @return 当前登录用户的福利单位
|
||||
*/
|
||||
@@ -191,9 +195,16 @@ public class Vi {
|
||||
}
|
||||
|
||||
public static PictureRenderData getImg(String base64) throws IOException {
|
||||
String s = base64.split(",")[1];
|
||||
byte[] bytes = Base64.getDecoder().decode(s);
|
||||
return new PictureRenderData(70, 30, ".png", bytes);
|
||||
if (base64.startsWith(base64)) {
|
||||
String s = base64.split(",")[1];
|
||||
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) {
|
||||
@@ -250,8 +261,6 @@ public class Vi {
|
||||
});
|
||||
}
|
||||
|
||||
@Inject
|
||||
private FtpService ftpService;
|
||||
|
||||
public void deleteSysFiles(List<Sys_file> files) {
|
||||
try {
|
||||
|
||||
@@ -85,8 +85,9 @@ public class SysAppController {
|
||||
List<LoglevelProperty> list = (List) entry.getValue();
|
||||
for (LoglevelProperty property : list) {
|
||||
NutMap nutMap = NutMap.NEW().addv("hostName", property.getHostName()).addv("hostAddress", property.getHostAddress());
|
||||
if (!hostList.contains(nutMap))
|
||||
if (!hostList.contains(nutMap)) {
|
||||
hostList.add(nutMap);
|
||||
}
|
||||
if (Strings.isBlank(hostName) || (Strings.isNotBlank(hostName) && property.getHostName().equals(hostName))) {
|
||||
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
|
||||
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.SocketOpenOfficeConnection;
|
||||
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_log;
|
||||
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.utils.ShiroUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.coobird.thumbnailator.Thumbnails;
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresAuthentication;
|
||||
import org.jsoup.Jsoup;
|
||||
import org.nutz.boot.starter.ftp.FtpService;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
@@ -40,7 +42,10 @@ import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Base64;
|
||||
import java.util.List;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* @FileName io.v.nutz.web.commons.controller.FilePreviewController
|
||||
@@ -58,6 +63,8 @@ public class FileServerController {
|
||||
@Inject
|
||||
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<>() {{
|
||||
add("JPG");
|
||||
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.date.DateUtil;
|
||||
import cn.hutool.core.io.IoUtil;
|
||||
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.nutz.boot.starter.ftp.FtpService;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.integration.jedis.RedisService;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
@@ -28,6 +28,9 @@ import java.io.InputStream;
|
||||
@At("/signature")
|
||||
public class SignatureController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
|
||||
@Inject
|
||||
private RedisService redisService;
|
||||
|
||||
@@ -65,8 +68,18 @@ public class SignatureController {
|
||||
String replaceData = base64.replaceAll("data:image/png;base64,", "");
|
||||
|
||||
try (InputStream is = new ByteArrayInputStream(Base64.decode(replaceData))) {
|
||||
ftpService.upload(todayPath, fileName, is);
|
||||
redisService.setex(prefix + ":" + id, 60 * 10, fullPath);
|
||||
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);
|
||||
redisService.setex(prefix + ":" + id, 60 * 10, fullPath);
|
||||
} else {
|
||||
throw new RuntimeException("上传文件失败");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
return Result.error("签字数据上传失败");
|
||||
}
|
||||
@@ -111,9 +124,18 @@ public class SignatureController {
|
||||
String replaceData = data.replaceAll("data:image/png;base64,", "");
|
||||
|
||||
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) {
|
||||
e.printStackTrace();
|
||||
return Result.error("签字数据上传失败");
|
||||
}
|
||||
|
||||
|
||||
@@ -45,6 +45,8 @@ import org.springframework.util.StringUtils;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.*;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
import java.util.concurrent.locks.Lock;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
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_role> userRoles = new ArrayList<>();
|
||||
List<Sys_user_role> userRoles = new CopyOnWriteArrayList<>();
|
||||
|
||||
// 创建一个固定大小的线程池 可以根据服务器性能调整线程池大小
|
||||
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)) {
|
||||
user = UserMode.initUser(u);
|
||||
needInitUserList.add(user);
|
||||
@@ -233,35 +235,36 @@ public class SourceUserServiceImpl extends ViServiceImpl<UserSource> implements
|
||||
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<>();
|
||||
if (user == null) {
|
||||
userChangeTypes.add(UserChangeType.NEW);
|
||||
return userChangeTypes;
|
||||
}
|
||||
if (!StringUtils.isEmpty(source.getUnitid()) && !source.getUnitid().equals(user.getUnitid())) {
|
||||
userChangeTypes.add(UserChangeType.UNIT_CHANGE);
|
||||
}
|
||||
if (!StringUtils.isEmpty(user.getUserState()) && StrUtil.isNotEmpty(source.getUserState()) && !source.getUserState().equals(user.getUserState())) {
|
||||
for (UserChangeType value : UserChangeType.values()) {
|
||||
if (value.getDescription().equals(source.getUserState())) {
|
||||
userChangeTypes.add(value);
|
||||
} else {
|
||||
if ("add".equals(sourceType)) {
|
||||
return userChangeTypes;
|
||||
}
|
||||
if (!StringUtils.isEmpty(source.getUnitid()) && !source.getUnitid().equals(user.getUnitid())) {
|
||||
userChangeTypes.add(UserChangeType.UNIT_CHANGE);
|
||||
}
|
||||
if (StrUtil.isNotBlank(user.getUserState()) && StrUtil.isNotEmpty(source.getUserState()) && !source.getUserState().equals(user.getUserState())) {
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -300,53 +303,51 @@ public class SourceUserServiceImpl extends ViServiceImpl<UserSource> implements
|
||||
* @param filterColumnDao 部分更新传递(部分更新存在过滤字段)
|
||||
*/
|
||||
private void massUpdatesAsync(List<Sys_user> needDoUpdateList, Boolean isPart, AtomicReference<Dao> filterColumnDao) {
|
||||
// 根据服务器性能和任务特性动态确定线程池大小;通常,线程池大小为CPU核心数的2倍
|
||||
// 创建一个CPU核心数的2倍的线程池
|
||||
int numberOfThreads = Runtime.getRuntime().availableProcessors() * 2;
|
||||
ExecutorService executorService = Executors.newFixedThreadPool(numberOfThreads);
|
||||
ExecutorCompletionService<Void> ecs = new ExecutorCompletionService<>(executorService);
|
||||
|
||||
// 每批处理的数据量
|
||||
int batchSize = 100;
|
||||
|
||||
int batchSize = 200;
|
||||
// 共享锁
|
||||
Lock lock = new ReentrantLock();
|
||||
try {
|
||||
// 将sources分成若干批
|
||||
for (int i = 0; i < needDoUpdateList.size(); i += batchSize) {
|
||||
final int end = Math.min(i + batchSize, needDoUpdateList.size());
|
||||
List<Sys_user> batch = needDoUpdateList.subList(i, end);
|
||||
|
||||
// 提交任务给线程池执行
|
||||
ecs.submit(() -> {
|
||||
Dao daoToUse = isPart ? filterColumnDao.get() : dao();
|
||||
// 执行数据库更新操作
|
||||
synchronized (daoToUse) {
|
||||
lock.lock();
|
||||
try {
|
||||
daoToUse.updateIgnoreNull(batch);
|
||||
} finally {
|
||||
lock.unlock();
|
||||
}
|
||||
return null; // CompletionService需要一个返回值,这里返回null
|
||||
return null;
|
||||
});
|
||||
}
|
||||
|
||||
// 等待所有任务完成
|
||||
for (int i = 0; i < needDoUpdateList.size(); i += batchSize) {
|
||||
try {
|
||||
Future<Void> future = ecs.take();
|
||||
future.get(); // 等待任务完成
|
||||
future.get();
|
||||
} catch (InterruptedException | ExecutionException e) {
|
||||
Thread.currentThread().interrupt(); // 恢复中断状态
|
||||
throw new RuntimeException(e);
|
||||
Thread.currentThread().interrupt();
|
||||
throw new RuntimeException("Error during batch update", e);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("Error in massUpdatesAsync", e);
|
||||
throw new RuntimeException("Error in massUpdatesAsync", e);
|
||||
} finally {
|
||||
// 关闭线程池
|
||||
executorService.shutdown();
|
||||
try {
|
||||
// 设置合理的超时时间,防止无限期阻塞
|
||||
if (!executorService.awaitTermination(10, TimeUnit.SECONDS)) {
|
||||
executorService.shutdownNow(); // 如果超时,强制关闭
|
||||
executorService.shutdownNow();
|
||||
}
|
||||
} catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt(); // 恢复中断状态
|
||||
Thread.currentThread().interrupt();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
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.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.utils.Vi;
|
||||
import io.v.nutz.sys.models.Sys_club_user;
|
||||
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.RequiresAuthentication;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.dao.util.cri.Static;
|
||||
@@ -23,8 +23,6 @@ import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
@@ -44,6 +42,8 @@ public class FundsApplyController {
|
||||
@Inject
|
||||
private Vi vi;
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private ActivityBxService activityBxService;
|
||||
@Inject("ActivityTissue")
|
||||
private ViService<ActivityTissue> tissueViService;
|
||||
@@ -85,6 +85,7 @@ public class FundsApplyController {
|
||||
*/
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions(value = {"sys.jf.Funds.apply","sys.jf.Funds.apply2"},logical = Logical.OR)
|
||||
public Object generateProjectCode(String activity_type) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
int year = Calendar.getInstance().get(Calendar.YEAR);
|
||||
@@ -104,13 +105,28 @@ public class FundsApplyController {
|
||||
|
||||
@At
|
||||
@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){
|
||||
List<ActivityBx> query = activityBxService.query(Cnd.where("payeeId", "=", payeeId).desc("apply_time"));
|
||||
return query.stream().map(v -> {
|
||||
NutMap map = new NutMap();
|
||||
return map.addv("activity_card_number", v.getActivity_card_number()).addv("activity_card_name", v.getActivity_card_name());
|
||||
}).collect(Collectors.toList());
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
JT.bankName,
|
||||
JT.bankCardNum
|
||||
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));
|
||||
if (Lang.isNotEmpty(sys_user_role)) {
|
||||
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()));
|
||||
}
|
||||
} else {
|
||||
nodeName = "校工会负责人拒绝";
|
||||
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.COMPLETE_SCHOOL_FZR_TASK.exec(aid.getId(), new NutMap().addv("option", nodeName), null);
|
||||
|
||||
+1
-1
@@ -2,8 +2,8 @@ package io.v.nutz.zhgh.jf.controller.activitybx;
|
||||
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
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.zhgh.jf.service.ActivityBxService;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
|
||||
@@ -1,19 +1,22 @@
|
||||
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 io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.utils.DateUtil;
|
||||
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.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_user;
|
||||
import io.v.nutz.sys.models.Sys_user_role;
|
||||
import io.v.nutz.sys.services.SysSignatureService;
|
||||
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.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Cnd;
|
||||
@@ -73,13 +76,37 @@ public class ApplyController {
|
||||
@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 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) {
|
||||
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) {
|
||||
// 校工会活动
|
||||
activityBx.setState_id("1020");
|
||||
loginNames.add("8333300107");
|
||||
loginNames.add("1019911404");
|
||||
} else if (activityBx.getActivity_type() == 40002) {
|
||||
// 分工会活动
|
||||
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)) {
|
||||
@@ -87,6 +114,7 @@ public class ApplyController {
|
||||
loginNames.add(user.getLoginname());
|
||||
}
|
||||
} 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()));
|
||||
if (Lang.isNotEmpty(sys_user_role)) {
|
||||
Sys_user user = activityBxService.dao().fetch(Sys_user.class, sys_user_role.getUserId());
|
||||
@@ -96,8 +124,8 @@ public class ApplyController {
|
||||
} else {
|
||||
activityBx.setState_id("1010");
|
||||
}
|
||||
activityBx.setApply_time(DateUtil.getDateTime());
|
||||
activityBx.setUser_id(ShiroUtil.getPrincipalProperty("id").toString());
|
||||
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());
|
||||
}
|
||||
@@ -125,14 +153,29 @@ public class ApplyController {
|
||||
@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 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));
|
||||
if (activityBx.getActivity_type() == 40001) {
|
||||
activityBx.setState_id("1020");
|
||||
loginNames.add("1019911404");
|
||||
} else if (activityBx.getActivity_type() == 40002) {
|
||||
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) {
|
||||
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 {
|
||||
activityBx.setState_id("1010");
|
||||
}
|
||||
@@ -141,20 +184,50 @@ public class ApplyController {
|
||||
if (Strings.isNotBlank(sign)) {
|
||||
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);
|
||||
|
||||
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 (activityBx.getActivity_type() == 40001) {
|
||||
//// FundsToHandler.CREATE_SCHOOL_FZR_TASK.exec(activityBx.getId(),NutMap.NEW().addv("userId",ShiroUtil.getUserId()),loginNames);
|
||||
// } else if (activityBx.getActivity_type() == 40002) {
|
||||
// FundsToHandler.CREATE_UNION_TASK.exec(activityBx.getId(),NutMap.NEW().addv("userId",ShiroUtil.getUserId()),List.of("1019971597"));
|
||||
// } else if (activityBx.getActivity_type() == 40003) {
|
||||
//// FundsToHandler.CREATE_CLUB_TASK.exec(activityBx.getId(),NutMap.NEW().addv("userId",ShiroUtil.getUserId()),loginNames);
|
||||
// }
|
||||
if ("999".equals(activityBx.getState_id())) {
|
||||
|
||||
if (activityBx.getActivity_type() == 40001) {
|
||||
FundsToHandler.CREATE_SCHOOL_FZR_TASK.exec(activityBx.getId(),NutMap.NEW().addv("userId",ShiroUtil.getUserId()),loginNames);
|
||||
} else if (activityBx.getActivity_type() == 40002) {
|
||||
FundsToHandler.CREATE_UNION_TASK.exec(activityBx.getId(),NutMap.NEW().addv("userId",ShiroUtil.getUserId()),List.of("1019971597"));
|
||||
} else if (activityBx.getActivity_type() == 40003) {
|
||||
FundsToHandler.CREATE_CLUB_TASK.exec(activityBx.getId(),NutMap.NEW().addv("userId",ShiroUtil.getUserId()),loginNames);
|
||||
}
|
||||
}
|
||||
|
||||
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 = "";
|
||||
if (flag) {
|
||||
////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"));
|
||||
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("1019911404"));
|
||||
nodeName = "校工会负责人审核";
|
||||
} else {
|
||||
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 = "协会审核拒绝";
|
||||
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.utils.DateUtil;
|
||||
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.services.SysSignatureService;
|
||||
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.nutz.dao.Cnd;
|
||||
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.utils.DateUtil;
|
||||
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.services.SysSignatureService;
|
||||
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.nutz.dao.Cnd;
|
||||
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.utils.DateUtil;
|
||||
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.sys.models.Sys_signature;
|
||||
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.web.commons.utils.ShiroUtil;
|
||||
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.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.Lang;
|
||||
import org.nutz.lang.Strings;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
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));
|
||||
// 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, Cnd.where("loginname","=","8333300107"));
|
||||
//msgApi.sendWxMsg("活动申报", "", "text", aid.getUser_name() + "申报了一条活动【" + aid.getActivity_name() + "】,请前往智慧工会进行审核。", List.of(user.getLoginname()), null);
|
||||
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);
|
||||
FundsToHandler.CREATE_SCHOOL_FZR_TASK.exec(id, null, List.of(user.getLoginname()));
|
||||
// }
|
||||
} else {
|
||||
nodeName = "基层工会主席拒绝";
|
||||
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.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.util.StrUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import cn.wizzer.framework.base.service.BaseService;
|
||||
import com.deepoove.poi.XWPFTemplate;
|
||||
import com.deepoove.poi.config.Configure;
|
||||
import com.deepoove.poi.data.PictureRenderData;
|
||||
import com.deepoove.poi.policy.HackLoopTableRenderPolicy;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.model.Goods;
|
||||
import io.v.nutz.base.utils.DateUtil;
|
||||
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.sys.models.Sys_signature;
|
||||
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.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
import org.nutz.trans.Trans;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
@@ -44,6 +44,7 @@ import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.Base64;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
@@ -142,20 +143,6 @@ public class ReimbursementCon {
|
||||
$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();
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin")) {
|
||||
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.unionid", "=", unionId);
|
||||
Vi.cndPlus(cnd, "bx.apply_type", "=", apply_type);
|
||||
sql.setCondition(cnd);
|
||||
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("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")) {
|
||||
one.setv("jfName", "校工会");
|
||||
} else if (one.getString("activity_type").equals("40002")) {
|
||||
@@ -251,7 +242,6 @@ public class ReimbursementCon {
|
||||
BigDecimal priceBigDecimal = new BigDecimal(price);
|
||||
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("two", money_int >= 100000 ? (money_int / 100000) % 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("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);
|
||||
one.setv("eight", decimalPart1.movePointRight(1).intValueExact());
|
||||
one.setv("nine", decimalPart2.movePointRight(1).intValueExact());
|
||||
// 提取小数部分的各个位上的数值
|
||||
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);
|
||||
|
||||
|
||||
/*基层工会主席签字*/
|
||||
@@ -308,7 +304,9 @@ public class ReimbursementCon {
|
||||
|
||||
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");
|
||||
response.addHeader("Content-Type", "application/octet-stream");
|
||||
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;
|
||||
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.deepoove.poi.XWPFTemplate;
|
||||
import com.deepoove.poi.config.Configure;
|
||||
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.utils.Html2Text;
|
||||
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.web.commons.base.Globals;
|
||||
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.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Sqls;
|
||||
@@ -137,7 +138,11 @@ public class ReimbursementViewCon {
|
||||
NutMap nutMap = activityBxService.queryOne(id);
|
||||
nutMap.setv("activity_content", Html2Text.toPlainText(nutMap.getString("activity_content")));
|
||||
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++) {
|
||||
goods.get(i).put("ranking", i + 1);
|
||||
|
||||
@@ -151,7 +151,7 @@ public class UnionCon {
|
||||
String nodeName = "";
|
||||
if (nutMap.getBoolean("flag")) {
|
||||
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) {
|
||||
@@ -161,12 +161,11 @@ public class UnionCon {
|
||||
activityTissue.setType(aid.getActivity_type());
|
||||
activityTissue.setActivityCode(aid.getProjectCode());
|
||||
activityTissue.setName(aid.getActivity_name());
|
||||
activityTissue.setUserId(ShiroUtil.getUserId());
|
||||
activityTissue.setUserId(aid.getUser_id());
|
||||
activityTissue.setStartPlannedDate(aid.getStartPlannedDate());
|
||||
activityTissue.setEndPlannedDate(aid.getEndPlannedDate());
|
||||
activityTissue.setStartTime(aid.getStartTime());
|
||||
activityTissue.setEndTime(aid.getEndTime());
|
||||
activityTissue.setUserId(ShiroUtil.getUserId());
|
||||
activityTissue.setAddress(aid.getAddress());
|
||||
if (aid.getActivity_type() == 40002) {
|
||||
activityTissue.setUnionId(user.getUnionid());
|
||||
@@ -180,7 +179,7 @@ public class UnionCon {
|
||||
nodeName = "审核通过";
|
||||
} else {
|
||||
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);
|
||||
}
|
||||
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.entity.ImportParams;
|
||||
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.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.IocBean;
|
||||
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.PageUtil;
|
||||
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.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zhgh.jf.service.jfClubService;
|
||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||
import org.apache.shiro.authz.annotation.RequiresAuthentication;
|
||||
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.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.jf_club;
|
||||
import io.v.nutz.zhgh.jf.model.jf_school;
|
||||
import io.v.nutz.zhgh.jf.model.jf_yjgh;
|
||||
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.nutz.dao.Cnd;
|
||||
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.result.Result;
|
||||
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.model.jf_club;
|
||||
import io.v.nutz.zhgh.jf.model.jf_use;
|
||||
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 org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.shiro.authz.annotation.RequiresAuthentication;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
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.page.Pagination;
|
||||
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.services.SysUserService;
|
||||
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.RequiresPermissions;
|
||||
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.page.Pagination;
|
||||
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_user;
|
||||
import io.v.nutz.web.commons.utils.DocConverter;
|
||||
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.RequiresPermissions;
|
||||
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.utils.DateUtil;
|
||||
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_use;
|
||||
import io.v.nutz.zhgh.jf.model.jf_yjgh;
|
||||
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.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
|
||||
+54
-21
@@ -1,15 +1,17 @@
|
||||
package io.v.nutz.zhgh.jf.controller.reimbursement;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
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.model.ActivityBx;
|
||||
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.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.util.cri.SqlExpressionGroup;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
@@ -18,15 +20,17 @@ import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @Author zzr
|
||||
* @name:ActivityReimbursementApplyController
|
||||
* @Date 2024/4/26 14:58
|
||||
* @注释 活动报销,报销申请
|
||||
* 校工会活动——>校工会负责人(姜学军)审核——>校工会主席审核——>流程结束
|
||||
* 基层工会活动——>基层工会主席审核——>校工会负责人(姜学军)审核——>校工会主席审核——>流程结束
|
||||
* 协会活动——>协会负责人审核——>校工会负责人(姜学军)审核——>校工会主席审核——>流程结束
|
||||
* 校工会活动——>校工会负责人(姜学军)审核——>校工会主席审核——>流程结束
|
||||
* 基层工会活动——>基层工会主席审核——>校工会负责人(姜学军)审核——>校工会主席审核——>流程结束
|
||||
* 协会活动——>协会负责人审核——>校工会负责人(姜学军)审核——>校工会主席审核——>流程结束
|
||||
*/
|
||||
@IocBean
|
||||
@Ok("json:full")
|
||||
@@ -39,63 +43,92 @@ public class ActivityReimbursementApplyController {
|
||||
@At("")
|
||||
@Ok("beetl:/platform/jf/reimbursement/apply.html")
|
||||
@RequiresPermissions("sys.jf.reimbursement.apply")
|
||||
public void index() {}
|
||||
public void index() {
|
||||
}
|
||||
|
||||
|
||||
@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){
|
||||
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()));
|
||||
|
||||
switch (activityBx.getActivity_type()){
|
||||
switch (activityBx.getActivity_type()) {
|
||||
case 40001 -> activityBx.setReimbursement_state_id(1020);
|
||||
case 40002 -> activityBx.setReimbursement_state_id(1010);
|
||||
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());
|
||||
|
||||
if (StrUtil.isNotBlank(activityBx.getId()) && count>0){
|
||||
if (StrUtil.isNotBlank(activityBx.getId()) && count > 0) {
|
||||
activityBx.setFiles(null);
|
||||
activityBx.setActivity_content(null);
|
||||
activityBxService.updateIgnoreNull(activityBx);
|
||||
} else {
|
||||
activityBxService.doAdd(activityBx);
|
||||
// activityBxService.doAdd(activityBx);
|
||||
}
|
||||
|
||||
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) {
|
||||
//校工会申请,校工会负责人审核
|
||||
ReimbursementToHandler.CREATE_SCHOOL_DIRECTOR_TASK.exec(activityBx.getId(), map);
|
||||
} 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) {
|
||||
//协会
|
||||
ReimbursementToHandler.CREATE_CLUB_TASK.exec(activityBx.getId(),map);
|
||||
ReimbursementToHandler.CREATE_CLUB_TASK.exec(activityBx.getId(), map);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("sys.jf.reimbursement.apply")
|
||||
public Object getActivityReimbursementByUser(){
|
||||
public Object getActivityReimbursementByUser() {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("state_id", "=", 1060);
|
||||
cnd.andEX("`year`","=",DateUtil.thisYear());
|
||||
cnd.and(Cnd.exps("reimbursement_state_id","is",null).or("reimbursement_state_id","=",""));
|
||||
cnd.and(Cnd.exps("reimbursement_state_id","is",null).or("reimbursement_state_id","=",""));
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin")){
|
||||
cnd.and("user_id","=",ShiroUtil.getUserId());
|
||||
cnd.andEX("`year`", "=", DateUtil.thisYear());
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.or("reimbursement_state_id", "in", List.of(1005, 1015, 1025, 1045));
|
||||
seg.or("reimbursement_union_audit_id", "is", null);
|
||||
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);
|
||||
}
|
||||
@@ -104,7 +137,7 @@ public class ActivityReimbursementApplyController {
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("sys.jf.reimbursement.apply")
|
||||
public Object findOne(String id){
|
||||
public Object findOne(String id) {
|
||||
return activityBxService.queryOne(id);
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -2,9 +2,7 @@ package io.v.nutz.zhgh.jf.controller.reimbursement;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.wizzer.framework.base.Result;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.utils.Vi;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zhgh.jf.service.ActivityBxService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
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.Param;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
|
||||
+4
-5
@@ -3,18 +3,17 @@ package io.v.nutz.zhgh.jf.controller.reimbursement;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
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.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.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.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Chain;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
|
||||
+14
-19
@@ -5,19 +5,17 @@ import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
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.query.PageForm;
|
||||
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.model.ActivityBx;
|
||||
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.poi.ss.usermodel.Workbook;
|
||||
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.dao.Chain;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.dao.util.cri.SqlExpressionGroup;
|
||||
@@ -33,7 +30,6 @@ import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.Lang;
|
||||
import org.nutz.lang.Strings;
|
||||
import org.nutz.lang.random.R;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
@@ -44,7 +40,6 @@ import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -106,15 +101,15 @@ public class ActivityReimbursementMineController {
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin,wyh02,H10,xghng")) {
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) {
|
||||
SqlExpressionGroup group2 = new SqlExpressionGroup();
|
||||
// if (ShiroUtil.hasAnyRoles("gh01,H04")) {
|
||||
// group2.or("u.unionid", "=", vi.getUnionId());
|
||||
// } else if (ShiroUtil.hasRole("H02")) {
|
||||
// group2.or("scu.clubid", "=", vi.getClubId());
|
||||
// } else {
|
||||
// }
|
||||
group2.or("act.user_id", "=", ShiroUtil.getUserId());
|
||||
if (ShiroUtil.hasAnyRoles("gh01,H04")) {
|
||||
group2.or("u.unionid", "=", vi.getUnionId());
|
||||
} else if (ShiroUtil.hasRole("H02")) {
|
||||
group2.or("scu.clubid", "=", vi.getClubId());
|
||||
} else {
|
||||
group2.or("act.user_id", "=", ShiroUtil.getUserId());
|
||||
}
|
||||
cnd.and(group2);
|
||||
}
|
||||
|
||||
|
||||
+3
-5
@@ -2,17 +2,15 @@ package io.v.nutz.zhgh.jf.controller.reimbursement;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
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.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.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.nutz.dao.Chain;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
|
||||
+3
-4
@@ -2,13 +2,12 @@ package io.v.nutz.zhgh.jf.controller.reimbursement;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
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.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.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.nutz.dao.Chain;
|
||||
import org.nutz.dao.Cnd;
|
||||
|
||||
+1
-4
@@ -2,11 +2,9 @@ package io.v.nutz.zhgh.jf.controller.reimbursement;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
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.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.nutz.dao.Cnd;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
@@ -18,7 +16,6 @@ import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
|
||||
+5
-6
@@ -2,17 +2,16 @@ package io.v.nutz.zhgh.jf.controller.reimbursement;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
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.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.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.nutz.dao.Chain;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
@@ -65,7 +64,7 @@ public class ActivityReimbursementUnionChairmanController {
|
||||
//1已审核;2未审核;0全部
|
||||
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);
|
||||
} else {
|
||||
cnd.and("u.unionid","=", Vi.getUnionId());
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package io.v.nutz.zhgh.jf.controller.school;
|
||||
|
||||
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.utils.DateUtil;
|
||||
import io.v.nutz.zhgh.jf.model.CostsSet;
|
||||
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.nutz.dao.Chain;
|
||||
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.entity.ImportParams;
|
||||
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.services.SysUnionService;
|
||||
import io.v.nutz.zhgh.jf.model.jf_yjgh;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
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.web.commons.utils.ShiroUtil;
|
||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||
import org.apache.shiro.authz.annotation.RequiresAuthentication;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.dao.Chain;
|
||||
import org.nutz.dao.Cnd;
|
||||
|
||||
@@ -3,14 +3,13 @@ package io.v.nutz.zhgh.jf.controller.yjgh;
|
||||
import cn.wizzer.framework.base.Result;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
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.utils.DateUtil;
|
||||
import io.v.nutz.zhgh.jf.model.CostsSet;
|
||||
import io.v.nutz.zhgh.jf.model.jf_yjgh;
|
||||
import io.v.nutz.zhgh.jf.service.CostsSetService;
|
||||
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.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Chain;
|
||||
|
||||
@@ -1,32 +1,20 @@
|
||||
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.ViResource;
|
||||
import io.v.nutz.sys.models.Sys_user_role;
|
||||
import io.v.nutz.sys.models.User;
|
||||
import io.v.nutz.sys.services.SysLocalProcessService;
|
||||
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.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.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.impl.CondolenceServiceImpl;
|
||||
import lombok.Getter;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -50,7 +38,7 @@ public enum ReimbursementToHandler {
|
||||
User user = dao.fetch(User.class, Cnd.where("id", "=", userId));
|
||||
|
||||
localProcessService.startProcess(
|
||||
user.getUnionname() + "(" + user.getUsername() + ")【活动报销】申请",
|
||||
"【活动报销】" + user.getUnionname() + "(" + user.getUsername() + ")",
|
||||
"activity_reimbursement@" + reimbursementId,
|
||||
"",
|
||||
userId,
|
||||
@@ -209,7 +197,7 @@ public enum ReimbursementToHandler {
|
||||
"activity_reimbursement_school_director_audit",
|
||||
"校工会负责人审核",
|
||||
ShiroUtil.getUserId(),
|
||||
List.of("8333300107"),
|
||||
List.of("1019911404"),
|
||||
"/platform/jf/reimbursement/schoolDirector",
|
||||
"/platform/jf/reimbursement/schoolDirector",
|
||||
"/platform/jf/reimbursement/schoolDirector",
|
||||
|
||||
@@ -405,6 +405,36 @@ public class ActivityBx {
|
||||
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
|
||||
@Comment("单据号")
|
||||
@Prev({
|
||||
|
||||
@@ -3,7 +3,6 @@ package io.v.nutz.zhgh.jf.model;
|
||||
import lombok.Data;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
import org.nutz.integration.json4excel.annotation.J4EIgnore;
|
||||
|
||||
/**
|
||||
* TODO
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
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.zhgh.jf.model.ActivityBx;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
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.util.StrUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.deepoove.poi.XWPFTemplate;
|
||||
import com.deepoove.poi.config.Configure;
|
||||
import com.deepoove.poi.data.PictureRenderData;
|
||||
import com.deepoove.poi.policy.HackLoopTableRenderPolicy;
|
||||
import io.v.nutz.zhgh.activity.models.ActivityTissue;
|
||||
import io.v.nutz.base.utils.DateUtil;
|
||||
import io.v.nutz.base.model.Audit;
|
||||
import io.v.nutz.base.service.impl.ViServiceImpl;
|
||||
import io.v.nutz.base.utils.Html2Text;
|
||||
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.ActivityFile;
|
||||
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.dao.Cnd;
|
||||
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.util.NutMap;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.Base64;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
@@ -68,11 +65,12 @@ public class ActivityBxServiceImpl extends ViServiceImpl<ActivityBx> implements
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public void doEdit(ActivityBx activityBx) {
|
||||
|
||||
activityBx.getGoods().forEach(v -> {
|
||||
/*activityBx.getGoods().forEach(v -> {
|
||||
v.setReid(activityBx.getId());
|
||||
});
|
||||
dao().clear(Goods.class,Cnd.where("reid","=",activityBx.getId()));
|
||||
insert(activityBx.getGoods());
|
||||
insert(activityBx.getGoods());*/
|
||||
update(activityBx);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -130,7 +128,7 @@ public class ActivityBxServiceImpl extends ViServiceImpl<ActivityBx> implements
|
||||
sql.setCallback(Sqls.callback.map());
|
||||
dao().execute(sql);
|
||||
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) {
|
||||
return null;
|
||||
@@ -172,7 +170,9 @@ public class ActivityBxServiceImpl extends ViServiceImpl<ActivityBx> implements
|
||||
NutMap nutMap = queryOne(id);
|
||||
nutMap.setv("activity_content", Html2Text.toPlainText(nutMap.getString("activity_content")));
|
||||
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++) {
|
||||
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"))) {
|
||||
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));
|
||||
|
||||
String budgets = one.getString("budgets");
|
||||
List<NutMap> goods = JSONUtil.parseArray(budgets).toList(NutMap.class);
|
||||
|
||||
one.put("goods",goods);
|
||||
|
||||
switch (one.getString("activity_type")) {
|
||||
case "40001" -> one.setv("jfName", "校工会");
|
||||
case "40002" -> 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;
|
||||
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("two", money_int >= 100000 ? (money_int / 100000) % 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("six", money_int >= 10 ? (money_int / 10) % 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") + "】报销凭证";
|
||||
|
||||
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");
|
||||
// response.addHeader("Content-Type", "application/octet-stream");
|
||||
// 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;
|
||||
|
||||
import io.v.nutz.base.service.impl.ViServiceImpl;
|
||||
import io.v.nutz.zhgh.jf.model.jf_club;
|
||||
import io.v.nutz.zhgh.jf.service.jfClubService;
|
||||
import io.v.nutz.base.service.impl.ViServiceImpl;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
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.service.jfYjghService;
|
||||
import io.v.nutz.base.service.impl.ViServiceImpl;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
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.zhgh.jf.model.jf_club;
|
||||
|
||||
public interface jfClubService extends ViService<jf_club> {
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
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.zhgh.jf.model.jf_yjgh;
|
||||
|
||||
public interface jfYjghService extends ViService<jf_yjgh> {
|
||||
}
|
||||
|
||||
@@ -411,7 +411,7 @@ public class WelfareCommonController {
|
||||
@Excel(name = "身份证号", width = 20d)
|
||||
private String idcard;
|
||||
|
||||
/* @Excel(name = "人员类型", width = 20d)
|
||||
/* @Excel(name = "人员性质", width = 20d)
|
||||
private String personType;
|
||||
|
||||
@Excel(name = "在职状态", width = 20d)
|
||||
@@ -465,7 +465,7 @@ public class WelfareCommonController {
|
||||
|
||||
ExportParams exportParams = new ExportParams();
|
||||
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin,SchoolUnionAdmin,SchoolUnionMemberAdmin,SchoolUnionWelfareAdmin")) {
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) {
|
||||
cnd.and("vwl.unionid", "=", Vi.getUnionId());
|
||||
exportParams.setTitle(Vi.getUnion().getUnionname() + "名单");
|
||||
}
|
||||
@@ -541,7 +541,7 @@ public class WelfareCommonController {
|
||||
cnd.andEX("personType", "in", personTypes);
|
||||
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.asc("unionname");
|
||||
@@ -572,7 +572,7 @@ public class WelfareCommonController {
|
||||
entityList.add(new ExcelExportEntity("工号", "loginname", 20));
|
||||
entityList.add(new ExcelExportEntity("姓名", "username", 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("所属单位", "unitname", 50));
|
||||
|
||||
|
||||
@@ -4,11 +4,13 @@ import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||
import cn.afterturn.easypoi.excel.ExcelImportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
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.params.ExcelExportEntity;
|
||||
import cn.afterturn.easypoi.excel.export.ExcelExportService;
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.wizzer.framework.base.Result;
|
||||
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.entity.Record;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.dao.util.cri.SqlExpressionGroup;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
@@ -91,8 +94,7 @@ public class WelfareListController {
|
||||
@Param(value = "projectId", required = false) String projectId,
|
||||
@Param(value = "optionId", required = false) String optionId,
|
||||
@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("""
|
||||
SELECT
|
||||
CASE
|
||||
@@ -115,10 +117,10 @@ public class WelfareListController {
|
||||
GROUP_CONCAT( DISTINCT wuso.optionName, '(', wus.selectNum, '份)' ) AS gist_list
|
||||
FROM
|
||||
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
|
||||
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
|
||||
$condition
|
||||
""");
|
||||
@@ -143,11 +145,12 @@ public class WelfareListController {
|
||||
|
||||
cnd.andEX("wl.sex", "in", pageParam.getSex());
|
||||
|
||||
cnd.andEX("wcn.courierNumber","=",courierNumber);
|
||||
cnd.andEX("wcn.courierNumber", "=", courierNumber);
|
||||
|
||||
cnd.groupBy("wl.id");
|
||||
cnd.asc("wl.unitCode");
|
||||
cnd.asc("wl.loginname");
|
||||
cnd.asc("wl.unitid");
|
||||
cnd.asc("wl.userSortNum");
|
||||
cnd.desc("wl.id");
|
||||
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin")) {
|
||||
cnd.and("wl.unionid", "=", Vi.getUnionId());
|
||||
@@ -242,9 +245,17 @@ public class WelfareListController {
|
||||
NutMap editData = Json.fromJson(NutMap.class, editWelfareData);
|
||||
List<NutMap> optionList = Json.fromJsonAsList(NutMap.class, welfareOptions);
|
||||
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,
|
||||
Cnd.where("welfareId", "=", editData.getString("projectId"))
|
||||
.and("selectUserId", "=", editData.getString("userId")));
|
||||
String finalSign = sign;
|
||||
List<WelfareUserSelection> userSelections = optionList.stream().map(v -> {
|
||||
WelfareUserSelection selection = new WelfareUserSelection();
|
||||
selection.setSelectTime(new Date());
|
||||
@@ -254,6 +265,7 @@ public class WelfareListController {
|
||||
selection.setReceiveAddress(editData.getString("receiveAddress"));
|
||||
selection.setSubjectId(v.getString("subjectId"));
|
||||
selection.setSelectNum(v.getInt("selectNum"));
|
||||
selection.setUserSign(finalSign);
|
||||
return selection;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
@@ -318,7 +330,7 @@ public class WelfareListController {
|
||||
""");
|
||||
cnd.and("wpus.welfareId", "=", projectId);
|
||||
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin,SchoolUnionWelfareAdmin")) {
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) {
|
||||
cnd.and("u.unionId", "=", Vi.getUnionId());
|
||||
}
|
||||
|
||||
@@ -484,7 +496,7 @@ public class WelfareListController {
|
||||
it.`name` unitname,
|
||||
wpus.selectNum
|
||||
FROM
|
||||
welfare_project_user_selection_copy wpus
|
||||
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
|
||||
@@ -492,7 +504,7 @@ public class WelfareListController {
|
||||
WHERE
|
||||
wpus.welfareId = @welfareId
|
||||
AND wpus.selectOptionId = @selectOptionId and wpus.selectNum!=0
|
||||
|
||||
|
||||
""").setParam("welfareId", projectId).setParam("selectOptionId", optionId);
|
||||
|
||||
// GROUP BY wpus.selectUserId,wpus.selectOptionId ORDER BY un.unioncode
|
||||
@@ -557,8 +569,77 @@ public class WelfareListController {
|
||||
} catch (IOException e) {
|
||||
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();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+8
-11
@@ -96,18 +96,13 @@ public class WelfareMemberAdjustmentController {
|
||||
mcr_state.stateColor mcrStateColor
|
||||
FROM
|
||||
`user` u
|
||||
|
||||
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 member_change_record_latest mcr on mcr.userId = u.id
|
||||
|
||||
LEFT JOIN audit_state state ON wmar.stateId = state.stateId
|
||||
|
||||
LEFT JOIN audit_state mcr_state ON mcr_state.stateId = mcr.stateId
|
||||
$condition
|
||||
""")
|
||||
""")
|
||||
.setParam("recordMode", MemberChangeRecordMode.WELFARE_MEMBER.getCode())
|
||||
.setParam("changeUnitAuditing", MemberChangeApplyState.SCHOOL_UNION)
|
||||
.setParam("changeUnitError", MemberChangeApplyState.SCHOOL_UNION_FAIL);
|
||||
@@ -120,7 +115,7 @@ public class WelfareMemberAdjustmentController {
|
||||
cnd.andEX("u.unionGroupId", "=", pageParam.getUnionGroupId());
|
||||
|
||||
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin,SchoolUnionAdmin,SchoolUnionMemberAdmin,SchoolUnionWelfareAdmin")) {
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) {
|
||||
if (ShiroUtil.hasAnyRoles("H04,gh12")) {
|
||||
cnd.and("u.unionId", "=", Vi.getUnionId());
|
||||
} else if (ShiroUtil.hasRole("ghxzzz")) {
|
||||
@@ -163,8 +158,10 @@ public class WelfareMemberAdjustmentController {
|
||||
WelfareFeature.Condition.judgmentAuthority(cnd, "u");
|
||||
|
||||
cnd.and(pageForm);
|
||||
cnd.desc("u.threeUnitId");
|
||||
cnd.asc("u.loginname");
|
||||
cnd.desc("his.changeTime");
|
||||
cnd.asc("u.unitid");
|
||||
cnd.asc("COALESCE(u.userSortNum, 999999)");
|
||||
cnd.desc("u.id");
|
||||
|
||||
pageParam.participate(cnd, "u");
|
||||
|
||||
@@ -221,7 +218,7 @@ public class WelfareMemberAdjustmentController {
|
||||
}
|
||||
}
|
||||
cnd.andEX("u.unionGroupId", "=", pageParam.getUnionGroupId());
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin,SchoolUnionAdmin,SchoolUnionMemberAdmin,SchoolUnionWelfareAdmin")) {
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) {
|
||||
if (ShiroUtil.hasAnyRoles("H04,gh12")) {
|
||||
cnd.and("u.unionId", "=", Vi.getUnionId());
|
||||
} else if (ShiroUtil.hasRole("ghxzzz")) {
|
||||
@@ -307,7 +304,7 @@ public class WelfareMemberAdjustmentController {
|
||||
@ViReturn
|
||||
@RequiresPermissions("welfare.member.adjustment")
|
||||
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()));
|
||||
return null;
|
||||
}
|
||||
|
||||
+1
-1
@@ -75,7 +75,7 @@ public class WelfareMemberChangeApplyAuditController {
|
||||
wun.welfareUnitId realWelfareUnitId,
|
||||
wun.welfareUnitCode realWelfareUnitCode,
|
||||
wun.welfareUnitName realWelfareUnitName,
|
||||
u.mobile,
|
||||
u.mobile AS MMobile,
|
||||
state.stateName,
|
||||
state.stateColor,
|
||||
originUnit.unitcode originUnitCode,
|
||||
|
||||
@@ -95,7 +95,9 @@ public class WelfareMemberMangeController {
|
||||
}
|
||||
pageParam.participate(cnd);
|
||||
cnd.and(pageForm);
|
||||
cnd.asc("loginname");
|
||||
cnd.asc("unitid");
|
||||
cnd.asc("COALESCE(userSortNum, 999999)");
|
||||
cnd.desc("id");
|
||||
sql.setCondition(cnd);
|
||||
return welfareMemberService.list(pageForm, sql);
|
||||
}
|
||||
@@ -178,7 +180,7 @@ public class WelfareMemberMangeController {
|
||||
if (member != null && member) {
|
||||
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());
|
||||
}
|
||||
|
||||
@@ -257,7 +259,7 @@ public class WelfareMemberMangeController {
|
||||
List<WelfareMemberTemp> memberImportList = ExcelImportUtil.importExcel(file.getFile(), WelfareMemberTemp.class, new ImportParams());
|
||||
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin,SchoolUnionAdmin,SchoolUnionMemberAdmin,SchoolUnionWelfareAdmin")) {
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) {
|
||||
cnd.and("unionid", "=", Vi.getUnionId());
|
||||
}
|
||||
cnd.andEX("unionid", "=", unionId);
|
||||
@@ -339,7 +341,7 @@ public class WelfareMemberMangeController {
|
||||
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");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin,SchoolUnionWelfareAdmin")) {
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) {
|
||||
cnd.andEX("unionid", "=", Vi.getUnionId());
|
||||
}
|
||||
sql.setCondition(cnd);
|
||||
@@ -349,7 +351,7 @@ public class WelfareMemberMangeController {
|
||||
exportEntities.add(new ExcelExportEntity("工号","loginname",20));
|
||||
exportEntities.add(new ExcelExportEntity("姓名","username",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("分工会","unionname",20));
|
||||
exportEntities.add(new ExcelExportEntity("单位","unitname",50));
|
||||
|
||||
@@ -86,7 +86,8 @@ public class WelfareMineController {
|
||||
sql.setParam("selectUserId", ShiroUtil.getUserId());
|
||||
Cnd cnd = Cnd.NEW();
|
||||
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.desc("wp.choiceTimeStart");
|
||||
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.utils.MsgApi;
|
||||
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.task.services.TaskPlatformService;
|
||||
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.trans.Trans;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@@ -235,9 +235,11 @@ public class WelfareProjectMangeController {
|
||||
dao.update(project);
|
||||
|
||||
}
|
||||
if (project.getIsPushHome() != 0) {
|
||||
mobileHomeService.handle(project, "welfare", "/mobile/welfare/list/receive?projectId=" + project.getId(), project.getIsPushHome());
|
||||
}
|
||||
// if (project.getIsPushHome() != 0) {
|
||||
// mobileHomeService.handle(project, "welfare", "/mobile/welfare/list/receive?projectId=" + project.getId(), project.getIsPushHome());
|
||||
// }
|
||||
Sys_home_activity sysHomeActivity = project.covertToSysHomeActivity();
|
||||
dao.insertOrUpdate(sysHomeActivity);
|
||||
});
|
||||
return null;
|
||||
}
|
||||
@@ -290,8 +292,7 @@ public class WelfareProjectMangeController {
|
||||
public Object sendMsgToNotWelfareUsers(String projectId, String sendMsgValue) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
u.loginname,
|
||||
u.username
|
||||
u.loginname as userId
|
||||
FROM
|
||||
welfare_list wl
|
||||
left join sys_user u on u.id = wl.userId
|
||||
@@ -308,13 +309,7 @@ public class WelfareProjectMangeController {
|
||||
""");
|
||||
sql.setParam("projectId", projectId);
|
||||
List<NutMap> userList = listService.listMap(sql);
|
||||
|
||||
// for (NutMap map : userList) {
|
||||
// msgApi.sendMsg(sendMsgValue, "", "", "", "4", new ArrayList<>() {{
|
||||
// add(NutMap.NEW().addv("userId", map.getString("loginname")));
|
||||
// }});
|
||||
// }
|
||||
|
||||
// msgApi.sendMsg(sendMsgValue, "福利选择链接", "", "https://zhgh.jiangnan.edu.cn/mobile/welfare/list/receive?projectId=4fa233704ddb41bc8e34e966efeda0a4", "4", userList);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -55,22 +55,21 @@ public class WelfareUserChooseController {
|
||||
@ViReturn
|
||||
@RequiresPermissions("welfare.user.choose")
|
||||
public Object pageData(PageForm pageForm, Integer year) {
|
||||
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
wp.*,
|
||||
CASE
|
||||
WHEN wus.selectUserId IS NOT NULL THEN 1
|
||||
ELSE 0
|
||||
END AS isChoose,
|
||||
wus.selectTime,
|
||||
GROUP_CONCAT(DISTINCT wuso.optionName ,'(',wus.selectNum,'份)') AS gist_list,
|
||||
wus.receiveAddress
|
||||
wp.*,
|
||||
CASE
|
||||
WHEN wus.selectUserId IS NOT NULL THEN 1
|
||||
ELSE 0
|
||||
END AS isChoose,
|
||||
wus.selectTime,
|
||||
GROUP_CONCAT(DISTINCT wuso.optionName ,'(',wus.selectNum,'份)') AS gist_list,
|
||||
wus.receiveAddress
|
||||
FROM
|
||||
welfare_project wp
|
||||
LEFT JOIN welfare_project_user_selection wus ON wp.id = wus.welfareId AND wus.selectUserId = @selectUserId
|
||||
LEFT 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
|
||||
welfare_project wp
|
||||
LEFT JOIN welfare_project_user_selection wus ON wp.id = wus.welfareId AND wus.selectUserId = @selectUserId
|
||||
INNER JOIN welfare_list wl ON wp.id = wl.projectId AND wl.userId = @selectUserId
|
||||
LEFT JOIN welfare_project_subject_option wuso ON wus.selectOptionId = wuso.id
|
||||
$condition
|
||||
""");
|
||||
sql.setParam("selectUserId", ShiroUtil.getUserId());
|
||||
|
||||
+1
-1
@@ -201,7 +201,7 @@ public class WelfareCheckPersonalController {
|
||||
exportEntities.add(new ExcelExportEntity("姓名", "username", 20));
|
||||
exportEntities.add(new ExcelExportEntity("性别", "sex", 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("所在单位", "unitname", 20));
|
||||
exportEntities.add(new ExcelExportEntity("核对情况", "isfinish", 20));
|
||||
|
||||
+13
-14
@@ -131,7 +131,7 @@ public class WelfareMemberCheckUnionController {
|
||||
/* if (!ShiroUtil.hasAnyRoles("sysadmin,A06,flwyh01")) {
|
||||
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")) {
|
||||
cnd.and("u.unionId", "=", Vi.getUnionId());
|
||||
} else if (ShiroUtil.hasRole("ghxzzz")) {
|
||||
@@ -166,9 +166,9 @@ public class WelfareMemberCheckUnionController {
|
||||
|
||||
cnd.and(pageForm);
|
||||
cnd.desc("his.changeTime");
|
||||
cnd.asc("u.userState");
|
||||
cnd.asc("u.unitid");
|
||||
cnd.asc("u.loginname");
|
||||
cnd.asc("COALESCE(u.userSortNum, 999999)");
|
||||
cnd.desc("u.id");
|
||||
|
||||
if (Lang.isNotEmpty(changeTypes)) {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
@@ -227,9 +227,9 @@ public class WelfareMemberCheckUnionController {
|
||||
@ViReturn
|
||||
@RequiresPermissions("welfare.member.check.union")
|
||||
public Object doSubmitChangeUser(MemberChangeRecord memberChangeRecord) {
|
||||
if (Objects.equals(memberChangeRecord.getType(), UserChangeType.NEW.getCode())) {
|
||||
/*if (Objects.equals(memberChangeRecord.getType(), UserChangeType.NEW.getCode())) {
|
||||
return Result.error("您已经入职,可以选择恢复功能入会!");
|
||||
}
|
||||
}*/
|
||||
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");
|
||||
|
||||
@@ -239,21 +239,21 @@ public class WelfareMemberCheckUnionController {
|
||||
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.setCurrentUnionId(null);
|
||||
}
|
||||
}*/
|
||||
|
||||
Sql userSql = Sqls.fetchString("select userState from sys_user where id = @userId");
|
||||
userSql.setParam("userId", memberChangeRecord.getUserId());
|
||||
dao.execute(userSql);
|
||||
String userState = StrUtil.blankToDefault(userSql.getString(), "");
|
||||
|
||||
if (memberChangeRecord.getType() == UserChangeType.ON_DUTY.getCode()) {
|
||||
if (userState.equals(UserChangeType.ON_DUTY.getDescription())) {
|
||||
return Result.error("该用户当前的状态已经是" + UserChangeType.ON_DUTY.getDescription() + ",您无需变更!");
|
||||
}
|
||||
}
|
||||
// if (memberChangeRecord.getType() == UserChangeType.WORK.getCode()) {
|
||||
// if (userState.equals(UserChangeType.WORK.getDescription())) {
|
||||
// return Result.error("该用户当前的状态已经是" + UserChangeType.WORK.getDescription() + ",您无需变更!");
|
||||
// }
|
||||
// }
|
||||
if (memberChangeRecord.getType() == UserChangeType.RESIGN.getCode()) {
|
||||
if (userState.equals(UserChangeType.RESIGN.getDescription())) {
|
||||
return Result.error("该用户当前的状态已经是" + UserChangeType.RESIGN.getDescription() + ",您无需变更!");
|
||||
@@ -265,7 +265,6 @@ public class WelfareMemberCheckUnionController {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
memberChangeRecord.setRecordMode(MemberChangeRecordMode.WELFARE_MEMBER.getCode());
|
||||
memberChangeRecord.setApplyOrigin(MemberChangeOrigin.UNION.getCode());
|
||||
memberChangeRecord = MemberChangeAuditHandle.CREATE.next(memberChangeRecord, null);
|
||||
@@ -310,7 +309,7 @@ public class WelfareMemberCheckUnionController {
|
||||
public Object doWelfareMember(String[] userIds, String taskId,
|
||||
@Param(value = "threeUnitId", required = false) String threeUnitId,
|
||||
@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()));
|
||||
return null;
|
||||
}
|
||||
|
||||
+143
-43
@@ -3,23 +3,22 @@ package io.v.nutz.zhgh.welfare.controller.statistics;
|
||||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
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.params.ExcelExportEntity;
|
||||
import cn.afterturn.easypoi.excel.export.ExcelExportService;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
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.ViTool;
|
||||
import io.v.nutz.sys.models.SysUnionGroup;
|
||||
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.utils.ShiroUtil;
|
||||
import io.v.nutz.zhgh.welfare.mode.WelfareUnitMode;
|
||||
import io.v.nutz.zhgh.welfare.model.WelfareList;
|
||||
import io.v.nutz.zhgh.welfare.model.WelfareProject;
|
||||
import io.v.nutz.zhgh.welfare.model.WelfareUserSelection;
|
||||
import io.v.nutz.zhgh.welfare.model.*;
|
||||
import io.v.nutz.zhgh.welfare.service.WelfareSingleService;
|
||||
import lombok.Data;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -32,11 +31,11 @@ import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.dao.util.cri.SqlExpressionGroup;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.json.Json;
|
||||
import org.nutz.lang.Lang;
|
||||
import org.nutz.lang.Strings;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
@@ -48,10 +47,7 @@ import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipOutputStream;
|
||||
@@ -74,6 +70,8 @@ public class WelfareSingleController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private OfficeTemplateUtil officeTemplateUtil;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/welfare/statistics/single.html")
|
||||
@@ -94,8 +92,10 @@ public class WelfareSingleController {
|
||||
public Object pageData(@Param(value = "projectId", required = false) String projectId,
|
||||
@Param(value = "month", required = false) String month,
|
||||
@Param(value = "welfareUnitCode", required = false) String welfareUnitCode,
|
||||
@Param(value = "unionGroupId", required = false) String unionGroupId) {
|
||||
return welfareSingleService.pageData(projectId, month, welfareUnitCode, unionGroupId);
|
||||
@Param(value = "unionGroupId", required = false) String 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 = "unionGroupId", required = false) String unionGroupId,
|
||||
@Param(value = "isThreeUnit", required = false) Boolean isThreeUnit,
|
||||
@Param(value = "personType", required = false) String personType,
|
||||
HttpServletResponse response) {
|
||||
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() : "") + "统计名单";
|
||||
}
|
||||
}
|
||||
WelfareProject project = dao.fetch(WelfareProject.class, projectId);
|
||||
WelfareProjectSubject subject = dao.fetch(WelfareProjectSubject.class, Cnd.where("projectId", "=", projectId));
|
||||
List<WelfareProjectSubjectOption> subjectOptions = dao.query(WelfareProjectSubjectOption.class, Cnd.where("subjectId", "=", subject.getId()).asc("optionSort"));
|
||||
|
||||
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);
|
||||
List<ExcelExportEntity> entityList = new ArrayList<>();
|
||||
List<NutMap> labelList = dataMap.getAsList("tableColumn", NutMap.class);
|
||||
List<NutMap> list = dataMap.getAsList("tableList", NutMap.class);
|
||||
Map<String, List<NutMap>> welfareUnitGroups = list.stream().collect(Collectors.groupingBy(v -> v.getString("unionname")));
|
||||
|
||||
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);
|
||||
welfareUnitGroups.forEach((welfareUnitName, welfareUnitList) -> {
|
||||
NutMap welfareUnitMap = NutMap.NEW();
|
||||
welfareUnitMap.addv("name", welfareUnitName);
|
||||
for (int i = 0; i < subjectOptions.size(); i++) {
|
||||
int finalI = i;
|
||||
int sum = welfareUnitList.stream().filter(v -> v.getString("selectOptionId").equals(subjectOptions.get(finalI).getId())).mapToInt(x -> x.getInt("selectNum")).sum();
|
||||
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"));
|
||||
labelList.add(1, NutMap.NEW().addv("label", "福利单位编码").addv("prop", "welfareUnitCode"));
|
||||
labelList.forEach(v -> {
|
||||
entityList.add(new ExcelExportEntity(v.getString("label"), v.getString("prop"), 20));
|
||||
String welfareUnitId = welfareUnitList.stream().findFirst().map(v -> v.getString("welfareUnitId")).orElse(null);
|
||||
|
||||
long welfareMemberCount = 0;
|
||||
|
||||
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 {
|
||||
ViTool.excelResponse(response, "汇总表.xls");
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(title, ""), entityList, list);
|
||||
ViTool.excelResponse(response, personType + "发放清单.xlsx");
|
||||
TemplateExportParams templateExportParams = new TemplateExportParams();
|
||||
//开启横向遍历
|
||||
templateExportParams.setColForEach(true);
|
||||
templateExportParams.setTemplateUrl("E:\\env\\福利导出模板.xlsx");
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(templateExportParams, data);
|
||||
workbook.write(response.getOutputStream());
|
||||
} catch (IOException e) {
|
||||
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,
|
||||
wpso.optionName
|
||||
FROM
|
||||
welfare_project_user_selection_copy wpus
|
||||
welfare_project_user_selection wpus
|
||||
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_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_unit dw on dw.id = wl.welfareSecondLevelUnitId
|
||||
$condition
|
||||
@@ -724,7 +824,7 @@ public class WelfareSingleController {
|
||||
exportEntities.add(new ExcelExportEntity("姓名", "username", 20));
|
||||
exportEntities.add(new ExcelExportEntity("电话号码", "mobile", 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("所在单位", "unitname", 50));
|
||||
exportEntities.add(new ExcelExportEntity("选择份数", "selectNum", 20));
|
||||
|
||||
@@ -29,7 +29,7 @@ public interface WelfareFeature {
|
||||
* @return
|
||||
*/
|
||||
static boolean judgmentAuthority() {
|
||||
return ShiroUtil.hasAnyRoles("sysadmin,SchoolUnionWelfareAdmin,SchoolUnionAdmin,SchoolUnionMemberAdmin");
|
||||
return ShiroUtil.hasAnyRoles("sysadmin,A06");
|
||||
}
|
||||
|
||||
interface Condition {
|
||||
|
||||
@@ -58,7 +58,7 @@ public class WelfareList {
|
||||
private Boolean isAutoSelect;
|
||||
|
||||
@Column
|
||||
@Comment("人员类型")
|
||||
@Comment("人员性质")
|
||||
@ColDefine(type = ColType.VARCHAR)
|
||||
private String personType;
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package io.v.nutz.zhgh.welfare.model;
|
||||
|
||||
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.welfare.mode.WelfareNoticePushMode;
|
||||
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.interceptor.annotation.PrevInsert;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@@ -26,7 +29,10 @@ import java.util.List;
|
||||
@Accessors(chain = true)
|
||||
@Table("welfare_project")
|
||||
@Comment("福利项目")
|
||||
public class WelfareProject extends ViBaseModel {
|
||||
public class WelfareProject extends ViBaseModel implements Serializable, SysHomeConvert {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Column
|
||||
@Name
|
||||
@Comment("ID")
|
||||
@@ -215,4 +221,20 @@ public class WelfareProject extends ViBaseModel {
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
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
|
||||
* @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);
|
||||
|
||||
@@ -149,6 +149,8 @@ public class WelfareListServiceImpl extends ViServiceImpl<WelfareList> implement
|
||||
list.setUserId(user.getString("id"));
|
||||
list.setWelfareUnitId(user.getString(field));
|
||||
list.setWelfareSecondLevelUnitId(user.getString("unitid"));
|
||||
list.setUserState(user.getString("userState"));
|
||||
list.setPersonType(user.getString("personType"));
|
||||
lists.add(list);
|
||||
}
|
||||
dao().insert(lists);
|
||||
|
||||
@@ -119,7 +119,7 @@ public class WelfareSingleServiceImpl extends ViServiceImpl<WelfareProject> impl
|
||||
sys_union un
|
||||
$condition
|
||||
""");
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin,SchoolUnionAdmin,SchoolUnionMemberAdmin,SchoolUnionWelfareAdmin")) {
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) {
|
||||
if (ShiroUtil.hasAnyRoles("H04,gh12")) {
|
||||
cnd.and("un.id", "=", Vi.getUnionId());
|
||||
}
|
||||
@@ -184,10 +184,11 @@ public class WelfareSingleServiceImpl extends ViServiceImpl<WelfareProject> impl
|
||||
wpus.selectUserId,
|
||||
wl.welfareUnitId as unionId
|
||||
FROM
|
||||
`welfare_project_user_selection_copy` wpus
|
||||
LEFT JOIN welfare_list wl on wl.userId = wpus.selectUserId
|
||||
`welfare_project_user_selection` wpus
|
||||
LEFT JOIN welfare_list wl on wl.userId = wpus.selectUserId AND wpus.welfareId = wl.projectId
|
||||
$condition
|
||||
""");
|
||||
cnd.groupBy("wpus.id");
|
||||
sql.setCondition(cnd);
|
||||
return listMap(sql);
|
||||
}
|
||||
@@ -199,7 +200,7 @@ public class WelfareSingleServiceImpl extends ViServiceImpl<WelfareProject> impl
|
||||
* @return
|
||||
*/
|
||||
@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");
|
||||
Sql welfareUnitSql = Sqls.create("""
|
||||
SELECT
|
||||
@@ -210,8 +211,8 @@ public class WelfareSingleServiceImpl extends ViServiceImpl<WelfareProject> impl
|
||||
""");
|
||||
CndPlus cnd = CndPlus.create();
|
||||
|
||||
if(!ShiroUtil.hasAnyRoles("sysadmin,SchoolUnionAdmin,SchoolUnionWelfareAdmin")){
|
||||
cnd.and("unit.welfareUnitId","=",Vi.getUnionId());
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin,A06,SchoolUnionWelfareAdmin")) {
|
||||
cnd.and("unit.welfareUnitId", "=", Vi.getUnionId());
|
||||
}
|
||||
|
||||
|
||||
@@ -476,7 +477,7 @@ public class WelfareSingleServiceImpl extends ViServiceImpl<WelfareProject> impl
|
||||
welfare_project_user_selection wpus
|
||||
LEFT JOIN `user` u ON u.id = wpus.selectUserId
|
||||
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
|
||||
$monthCnd
|
||||
""").setParam("welfareId", projectId);
|
||||
@@ -530,14 +531,6 @@ public class WelfareSingleServiceImpl extends ViServiceImpl<WelfareProject> impl
|
||||
* 未领取人员信息
|
||||
*
|
||||
* @param projectId
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* @param welfareUnitCode
|
||||
* @return
|
||||
*/
|
||||
@@ -658,27 +651,51 @@ public class WelfareSingleServiceImpl extends ViServiceImpl<WelfareProject> impl
|
||||
optionSql.setParam("projectId", projectId);
|
||||
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("""
|
||||
SELECT
|
||||
vwl.loginname,
|
||||
vwl.username,
|
||||
vwl.unionid,
|
||||
vwl.unionname,
|
||||
u.loginname,
|
||||
u.username,
|
||||
vwl.welfareUnitId as unionid,
|
||||
gh.unionname as unionname,
|
||||
vwl.welfareSecondLevelUnitId as unitid,
|
||||
dw.`name` as unitname,
|
||||
wpus.userSign,
|
||||
wpus.selectOptionId,
|
||||
wpus.selectNum
|
||||
wpus.selectNum\s
|
||||
FROM
|
||||
view_welfare_list vwl
|
||||
LEFT JOIN welfare_project_user_selection wpus ON wpus.selectUserId = vwl.id
|
||||
AND wpus.welfareId = @projectId
|
||||
welfare_list vwl
|
||||
LEFT join sys_user u on u.id = vwl.userId
|
||||
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
|
||||
projectId = @projectId
|
||||
AND vwl.unionid = @unionId
|
||||
AND vwl.welfareUnitId = @unionId
|
||||
order by vwl.welfareUnitId,vwl.welfareSecondLevelUnitId
|
||||
""");
|
||||
|
||||
sql.setParam("projectId", projectId);
|
||||
sql.setParam("unionId", welfareUnitId);
|
||||
List<NutMap> list = listMap(sql);
|
||||
list.forEach(l->{
|
||||
list.forEach(l -> {
|
||||
if (StrUtil.isNotBlank(l.getString("userSign"))) {
|
||||
try {
|
||||
ByteArrayOutputStream signOs = new ByteArrayOutputStream();
|
||||
@@ -698,6 +715,10 @@ public class WelfareSingleServiceImpl extends ViServiceImpl<WelfareProject> impl
|
||||
List<ExcelExportEntity> exportEntities = new ArrayList<>();
|
||||
exportEntities.add(new ExcelExportEntity("序号", "no", 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) {
|
||||
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 userMap = list.stream().filter(x -> x.getString("loginname").equals(v)).findFirst().get();
|
||||
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"));
|
||||
for (NutMap option : options) {
|
||||
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>
|
||||
<div>
|
||||
<el-card shadow="never">
|
||||
<div class="btn-group tool-button mt5">
|
||||
<el-date-picker
|
||||
v-model="page_form.year"
|
||||
type="year"
|
||||
value-format="yyyy" style="width: 150px"
|
||||
placeholder="选择年" @change="$emit('search')">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
<div class="btn-group tool-button mt5">
|
||||
<el-input placeholder="请输入内容" clearable v-model="page_form.searchKeyword"
|
||||
@keyup.enter.native="$emit('search')">
|
||||
<el-select v-model="page_form.searchName" slot="prepend" placeholder="查询类型"
|
||||
style="width: 120px;">
|
||||
<el-option label="姓名" value="username"></el-option>
|
||||
<el-option label="工号" value="loginname"></el-option>
|
||||
</el-select>
|
||||
</el-input>
|
||||
</div>
|
||||
<div>
|
||||
<el-card shadow="never">
|
||||
<div class="btn-group tool-button mt5">
|
||||
<el-date-picker
|
||||
v-model="page_form.year"
|
||||
type="year"
|
||||
value-format="yyyy"
|
||||
style="width: 150px"
|
||||
placeholder="选择年"
|
||||
@change="$emit('search')"
|
||||
></el-date-picker>
|
||||
</div>
|
||||
<div class="btn-group tool-button mt5">
|
||||
<el-input placeholder="请输入内容" clearable v-model="page_form.searchKeyword" @keyup.enter.native="$emit('search')">
|
||||
<el-select v-model="page_form.searchName" slot="prepend" placeholder="查询类型" style="width: 120px">
|
||||
<el-option label="姓名" value="username"></el-option>
|
||||
<el-option label="工号" value="loginname"></el-option>
|
||||
</el-select>
|
||||
</el-input>
|
||||
</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">
|
||||
<el-button type="primary" icon="el-icon-search" @click="$emit('search')"></el-button>
|
||||
</div>
|
||||
<!-- <div class="pull-right offscreen-right mt5" v-if="has_add">
|
||||
<el-button icon="el-icon-edit" @click="$emit('openAdd')">申请活动报销</el-button>
|
||||
</div>-->
|
||||
|
||||
<!-- <div class="pull-right offscreen-right mt5" v-if="has_add">
|
||||
<el-button icon="el-icon-edit" @click="$emit('openAdd')">申请活动报销</el-button>
|
||||
</div>-->
|
||||
|
||||
<div class="pull-right offscreen-right mt5" v-if="has_sh">
|
||||
<el-radio-group v-model="page_form.isAudit" @change="$emit('search')">
|
||||
<el-radio-button :label="1">全部</el-radio-button>
|
||||
<el-radio-button :label="2">已审核</el-radio-button>
|
||||
<el-radio-button :label="3">未审核</el-radio-button>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
|
||||
</el-card>
|
||||
</div>
|
||||
<div class="pull-right offscreen-right mt5" v-if="has_sh">
|
||||
<el-radio-group v-model="page_form.isAudit" @change="$emit('search')">
|
||||
<el-radio-button :label="1">全部</el-radio-button>
|
||||
<el-radio-button :label="2">已审核</el-radio-button>
|
||||
<el-radio-button :label="3">未审核</el-radio-button>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
module.exports = {
|
||||
props: {
|
||||
page_form: '',
|
||||
has_add: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
props: {
|
||||
page_form: "",
|
||||
has_add: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
has_sh: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
has_type: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
has_sh: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
data() {
|
||||
return {}
|
||||
},
|
||||
has_type: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {}
|
||||
},
|
||||
watch: {},
|
||||
methods: {},
|
||||
async created() {
|
||||
|
||||
}
|
||||
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>
|
||||
<div>
|
||||
<div ref="editorDom"></div>
|
||||
<input type="file" style="display: none;">
|
||||
</div>
|
||||
<div>
|
||||
<div ref="editorRef"></div>
|
||||
<input type="file" style="display: none" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
<script src="/assets/platform/plugins/jquery/jquery-1.11.1.min.js"></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 {
|
||||
constructor(editor) {
|
||||
const $elem = wangEditor.$(
|
||||
`<div class="w-e-menu" data-title="上传word">
|
||||
word
|
||||
</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()
|
||||
clickHandler() {
|
||||
const fileInputId = this.editor.textElemId + "input-file"
|
||||
const existingInput = document.getElementById(fileInputId)
|
||||
if (existingInput) {
|
||||
existingInput.remove()
|
||||
}
|
||||
}).catch(error => {
|
||||
console.log(error)
|
||||
_this.clearInputFile()
|
||||
alert('上传word失败,请联系管理员!')
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
clearInputFile() {
|
||||
const obj = document.getElementById('fileInput');
|
||||
obj.outerHTML = obj.outerHTML
|
||||
}
|
||||
|
||||
tryChangeActive() {
|
||||
this.active()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
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('图片上传失败')
|
||||
const input = document.createElement("input")
|
||||
input.type = "file"
|
||||
input.accept = "application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document"
|
||||
input.id = fileInputId
|
||||
input.style.display = "none"
|
||||
input.addEventListener("change", (event) => {
|
||||
const files = event.target.files
|
||||
if (!files || files.length === 0) {
|
||||
return
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
}
|
||||
//粘贴过滤
|
||||
this.editor.config.pasteFilterStyle = false
|
||||
//高度
|
||||
this.editor.config.height = this.height
|
||||
//菜单
|
||||
this.editor.config.menus = this.menus
|
||||
this.editor.create()
|
||||
},
|
||||
isEmptyEditor() {
|
||||
const children = this.editor.$textElem.children()
|
||||
for (let i = 0; i < children.elems.length; i++) {
|
||||
const node = children.elems[i]
|
||||
if (node && node.nodeType === Node.TEXT_NODE && node.textContent.trim().length !== '') {
|
||||
return false
|
||||
}
|
||||
if (node && node.nodeType === Node.ELEMENT_NODE && node.tagName.toLowerCase() === 'p' && node.innerText.trim() !== '') {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
},
|
||||
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
|
||||
let loading = null
|
||||
if (window.ELEMENT) {
|
||||
loading = ELEMENT.Loading.service({
|
||||
lock: true,
|
||||
text: "文件读取中",
|
||||
spinner: "el-icon-loading",
|
||||
background: "rgba(0, 0, 0, 0.7)"
|
||||
})
|
||||
} else if (window.vant) {
|
||||
loading = vant.Toast.loading({
|
||||
message: "文件读取中",
|
||||
forbidClick: true,
|
||||
overlay: true,
|
||||
duration: 0
|
||||
})
|
||||
}
|
||||
|
||||
const formData = new FormData()
|
||||
formData.append("file", files[0])
|
||||
|
||||
axios
|
||||
.post("/file_server/convertHtml", formData, {
|
||||
headers: { "Content-Type": "multipart/form-data", "x-requested-with": "XMLHttpRequest" }
|
||||
})
|
||||
.then((response) => {
|
||||
loading.close()
|
||||
if (response.data.code === 0) {
|
||||
this.editor.txt.html(response.data.data)
|
||||
} else {
|
||||
if (window.ELEMENT) {
|
||||
ELEMENT.Message.error(response.data.msg)
|
||||
} else if (window.vant) {
|
||||
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>
|
||||
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
<style scoped></style>
|
||||
|
||||
@@ -1,166 +1,156 @@
|
||||
<template>
|
||||
<div style="width: 100%">
|
||||
<van-image :src="imageUrl" v-if="!signDrawingBoardShow"
|
||||
style="width: 100%;height: 150px;border: 1px dashed"></van-image>
|
||||
<div style="text-align: right">
|
||||
<van-button plain type="danger" hairline size="small" @click="openSignDrawingBoard">
|
||||
打开签字版
|
||||
</van-button>
|
||||
<div style="width: 100%">
|
||||
<van-image :src="imageUrl" v-if="!signDrawingBoardShow" style="width: 100%; height: 150px; border: 1px dashed"></van-image>
|
||||
<div style="text-align: right">
|
||||
<van-button plain type="danger" hairline size="small" @click="openSignDrawingBoard" native-type="button">打开签字版</van-button>
|
||||
</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" native-type="button">清空重签</van-button>
|
||||
<van-button plain type="primary" hairline size="small" @click="confirm" native-type="button">确定</van-button>
|
||||
</div>
|
||||
</van-popup>
|
||||
</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>
|
||||
|
||||
<script>
|
||||
|
||||
module.exports = {
|
||||
props: {
|
||||
my_sign: {
|
||||
type: String
|
||||
},
|
||||
value: {
|
||||
type: String
|
||||
},
|
||||
is_value_base64: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
prefix: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
signDrawingBoardShow: false,
|
||||
signData: null,
|
||||
imageUrl: "",
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
value:{
|
||||
handler:function (val){
|
||||
if(val){
|
||||
this.getImageUrl(val)
|
||||
props: {
|
||||
my_sign: {
|
||||
type: String
|
||||
},
|
||||
value: {
|
||||
type: String
|
||||
},
|
||||
is_value_base64: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
prefix: {
|
||||
type: String,
|
||||
default: ""
|
||||
}
|
||||
},
|
||||
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)
|
||||
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() {
|
||||
$("#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) {
|
||||
if (this.is_value_base64) {
|
||||
this.imageUrl = value
|
||||
} else {
|
||||
this.imageUrl = '/signature/getSignData?path=' + value
|
||||
}
|
||||
created() {
|
||||
this.getMySign()
|
||||
},
|
||||
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)
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getMySign()
|
||||
},
|
||||
async mounted() {
|
||||
|
||||
}
|
||||
async mounted() {}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<style scoped>
|
||||
.clearBtn {
|
||||
position: absolute !important;
|
||||
bottom: 5px;
|
||||
right: 5px;
|
||||
color: red;
|
||||
z-index: 99;
|
||||
position: absolute !important;
|
||||
bottom: 5px;
|
||||
right: 5px;
|
||||
color: red;
|
||||
z-index: 99;
|
||||
}
|
||||
|
||||
#canvas {
|
||||
height: calc(60vh - 100px);
|
||||
width: 100vw;
|
||||
height: calc(60vh - 100px);
|
||||
width: 100vw;
|
||||
}
|
||||
|
||||
.button-extra {
|
||||
height: 100px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 0 20px;
|
||||
height: 100px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 0 20px;
|
||||
}
|
||||
|
||||
.button-extra button {
|
||||
width: 40%;
|
||||
width: 40%;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
@@ -1,203 +1,201 @@
|
||||
<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-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>
|
||||
<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-collapse-transition>
|
||||
|
||||
<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>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
window.signatureInterval = null
|
||||
|
||||
module.exports = {
|
||||
name: "Signature",
|
||||
props: {
|
||||
scan_title: {
|
||||
type: String,
|
||||
default: '扫描下方二维码进行签字'
|
||||
name: "Signature",
|
||||
props: {
|
||||
scan_title: {
|
||||
type: String,
|
||||
default: "扫描下方二维码进行签字"
|
||||
},
|
||||
prefix: {
|
||||
type: String,
|
||||
default: "DEFAULT"
|
||||
},
|
||||
qz: {
|
||||
type: String,
|
||||
default: ""
|
||||
},
|
||||
value: {
|
||||
type: String,
|
||||
default: ""
|
||||
},
|
||||
is_value_base64: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
},
|
||||
prefix: {
|
||||
type: String,
|
||||
default: 'DEFAULT'
|
||||
model: {
|
||||
prop: "qz",
|
||||
event: "change"
|
||||
},
|
||||
qz: {
|
||||
type: String,
|
||||
default: ''
|
||||
data() {
|
||||
return {
|
||||
showQrCode: false,
|
||||
loading: true,
|
||||
postAddress: "",
|
||||
imageUrl: ""
|
||||
}
|
||||
},
|
||||
value: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
is_value_base64: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
},
|
||||
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
|
||||
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://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: {
|
||||
'qz': {
|
||||
handler(s) {
|
||||
this.loading = !s
|
||||
if (!s) {
|
||||
const qz = this.getSignature()
|
||||
if (!qz) {
|
||||
this.$emit("change", '')
|
||||
this.$emit("update:qz", '')
|
||||
this.startRequest()
|
||||
} else {
|
||||
this.qz = qz
|
||||
this.$emit("change", qz)
|
||||
this.$emit("update:qz", qz)
|
||||
}
|
||||
} else {
|
||||
this.qz = s
|
||||
this.showQrCode = false
|
||||
},
|
||||
created() {
|
||||
this.getMySign()
|
||||
},
|
||||
watch: {
|
||||
qz: {
|
||||
handler(s) {
|
||||
this.loading = !s
|
||||
if (!s) {
|
||||
const qz = this.getSignature()
|
||||
if (!qz) {
|
||||
this.$emit("change", "")
|
||||
this.$emit("update:qz", "")
|
||||
this.startRequest()
|
||||
} else {
|
||||
this.qz = qz
|
||||
this.$emit("change", qz)
|
||||
this.$emit("update:qz", qz)
|
||||
}
|
||||
} else {
|
||||
this.qz = s
|
||||
this.showQrCode = false
|
||||
}
|
||||
},
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
immediate: true
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
.el-card__body {
|
||||
position: relative !important;
|
||||
position: relative !important;
|
||||
}
|
||||
|
||||
.signature-body {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
min-height: 160px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
min-height: 160px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.qr-code-div {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
left: 0;
|
||||
top: 0;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
z-index: 999;
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
left: 0;
|
||||
top: 0;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
z-index: 999;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -24,57 +24,47 @@ layout("/mobile/platform.html"){
|
||||
.list-card .van-cell__value {
|
||||
flex: 2;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<van-nav-bar :title="title" @click-left="history.back()" fixed left-arrow
|
||||
placeholder></van-nav-bar>
|
||||
<van-nav-bar :title="title" @click-left="pjaxReplace('/mobile/index')" fixed left-arrow placeholder></van-nav-bar>
|
||||
|
||||
<div class="search-fixed">
|
||||
<van-dropdown-menu active-color="#1989fa">
|
||||
<!-- <van-dropdown-item v-model="pageForm.isMenWomen" @change="yearChange"
|
||||
:options="sexList"></van-dropdown-item>-->
|
||||
<van-dropdown-item v-model="pageForm.groupName" @change="yearChange"
|
||||
:options="groupList"></van-dropdown-item>
|
||||
<van-dropdown-item :options="eventList" @change="yearChange"
|
||||
v-model="pageForm.eventId"></van-dropdown-item>
|
||||
<van-dropdown-item :options="auditList" @change="yearChange"
|
||||
v-model="pageForm.isAudit"></van-dropdown-item>
|
||||
<van-dropdown-item v-model="pageForm.groupName" @change="yearChange" :options="groupList"></van-dropdown-item>
|
||||
<van-dropdown-item :options="eventList" @change="yearChange" v-model="pageForm.eventId"></van-dropdown-item>
|
||||
<van-dropdown-item :options="auditList" @change="yearChange" v-model="pageForm.isAudit"></van-dropdown-item>
|
||||
</van-dropdown-menu>
|
||||
</div>
|
||||
|
||||
|
||||
<div style="margin: 60px auto 0 auto">
|
||||
<van-list :finished="finished" :finished-text="tableData.length>0?'没有更多了':''"
|
||||
v-model="loading"
|
||||
@load="pageData">
|
||||
<van-list :finished="finished" :finished-text="tableData.length>0?'没有更多了':''" v-model="loading" @load="pageData">
|
||||
<div v-for="o in tableData" class="list-card">
|
||||
<van-cell-group inset>
|
||||
<image class="register-icon" src="/assets/mobile/svg/activity/wbm.svg"
|
||||
@click="openActivity(o)"
|
||||
v-if="o.userApply==0&&o.applyWay.includes(1)"></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>
|
||||
<image
|
||||
class="register-icon"
|
||||
src="/assets/mobile/svg/activity/wbm.svg"
|
||||
@click="openActivity(o)"
|
||||
v-if="o.userApply==0&&o.applyWay.includes(1)"
|
||||
></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="项目名称">
|
||||
<span :style="{color:themeColor}" class="van-ellipsis"
|
||||
style="font-size: 16px;">
|
||||
{{o.allName}}
|
||||
</span>
|
||||
<span :style="{color:themeColor}" class="van-ellipsis" style="font-size: 16px">{{o.allName}}</span>
|
||||
</van-cell>
|
||||
<van-cell :border="false" title="项目类型">{{o.projectType==1?'单项':'团体'}}</van-cell>
|
||||
<van-cell :border="false" title="您报队伍">
|
||||
{{o.activityTeamName?o.activityTeamName:'暂无'}}
|
||||
</van-cell>
|
||||
<van-cell :border="false" title="您报队伍">{{o.activityTeamName?o.activityTeamName:'暂无'}}</van-cell>
|
||||
<van-cell :border="false" title="年龄限制" v-if="o.projectType==1">
|
||||
<span v-if="o.startAgeDate!=null">{{o.startAgeDate}}至{{o.endAgeDate}}</span>
|
||||
<span v-else>暂无</span>
|
||||
</van-cell>
|
||||
<van-cell :border="false" title="可报队数" v-if="o.projectType==2">
|
||||
{{o.restrictTotalTeam}}队
|
||||
</van-cell>
|
||||
<van-cell :border="false" title="可报队数" v-if="o.projectType==2">{{o.restrictTotalTeam}}队</van-cell>
|
||||
<van-cell :border="false" title="每队可报人数" v-if="o.applyUserModel===1">
|
||||
<span v-if="o.athletesMaxNum">{{o.athletesMaxNum}}人</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>0人</span>
|
||||
</van-cell>
|
||||
|
||||
</van-cell-group>
|
||||
</div>
|
||||
</van-list>
|
||||
</div>
|
||||
|
||||
<van-dialog @confirm="doActivityConfirm" show-cancel-button title="您确定要报名此活动吗?"
|
||||
v-model="activityDialog"
|
||||
@cancel="activityDialog = false" :before-close="onBeforeClose">
|
||||
<van-dialog
|
||||
@confirm="doActivityConfirm"
|
||||
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-cell-group>
|
||||
<template v-for="i in teams">
|
||||
@@ -105,21 +99,16 @@ layout("/mobile/platform.html"){
|
||||
</template>
|
||||
</van-cell>
|
||||
</template>
|
||||
|
||||
</van-cell-group>
|
||||
</van-radio-group>
|
||||
</van-dialog>
|
||||
|
||||
<van-empty v-if="mLoading==false&&tableData.length==0" class="custom-image" image="/none.svg"
|
||||
description="暂无数据">
|
||||
</van-empty>
|
||||
|
||||
|
||||
<van-empty v-if="mLoading==false&&tableData.length==0" class="custom-image" image="/none.svg" description="暂无数据"></van-empty>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
el: "#app",
|
||||
mixins: [mobileMixins],
|
||||
data() {
|
||||
return {
|
||||
@@ -139,27 +128,27 @@ layout("/mobile/platform.html"){
|
||||
events: [],
|
||||
eventList: [],
|
||||
groupList: [
|
||||
{text: '按组别', value: null},
|
||||
{text: '甲组', value: '甲组'},
|
||||
{text: '乙组', value: '乙组'},
|
||||
{text: '丙组', value: '丙组'},
|
||||
{text: '丁组', value: '丁组'},
|
||||
{ text: "按组别", value: null },
|
||||
{ text: "甲组", value: "甲组" },
|
||||
{ text: "乙组", value: "乙组" },
|
||||
{ text: "丙组", value: "丙组" },
|
||||
{ text: "丁组", value: "丁组" }
|
||||
],
|
||||
sexList: [
|
||||
{text: '按性别', value: 1},
|
||||
{text: '男子', value: 2},
|
||||
{text: '女子', value: 3},
|
||||
{text: '团体', value: 4},
|
||||
{ text: "按性别", value: 1 },
|
||||
{ text: "男子", value: 2 },
|
||||
{ text: "女子", value: 3 },
|
||||
{ text: "团体", value: 4 }
|
||||
],
|
||||
auditList: [
|
||||
{text: '全部', value: null},
|
||||
{text: '已报名', value: "true"},
|
||||
{text: '未报名', value: "false"},
|
||||
{ text: "全部", value: null },
|
||||
{ text: "已报名", value: "true" },
|
||||
{ text: "未报名", value: "false" }
|
||||
],
|
||||
teams: [],
|
||||
yearOption: [],
|
||||
pageForm: {
|
||||
year: '',
|
||||
year: "",
|
||||
isMenWomen: "1"
|
||||
}
|
||||
}
|
||||
@@ -173,14 +162,14 @@ layout("/mobile/platform.html"){
|
||||
this.$toast("请选择报名的小队")
|
||||
return
|
||||
} else {
|
||||
const {data} = await $.post("/mobile/activity/Sports/list/getTeamUserData", {
|
||||
const { data } = await $.post("/mobile/activity/Sports/list/getTeamUserData", {
|
||||
teamId: this.formData.teamId,
|
||||
activityId: this.formData.activityId,
|
||||
eventId: this.formData.eventId,
|
||||
applyType: this.applyType
|
||||
})
|
||||
const nv = data.filter(v => v.sex === '女')
|
||||
const nan = data.filter(v => v.sex === '男')
|
||||
const nv = data.filter((v) => v.sex === "女")
|
||||
const nan = data.filter((v) => v.sex === "男")
|
||||
let title = this.projectType === 1 ? "项目" : "小队"
|
||||
/* if (this.applyType !== 3) {
|
||||
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
|
||||
}
|
||||
}*/
|
||||
if (this.athletesMaxNum && (data.length >= this.athletesMaxNum)) {
|
||||
if (this.athletesMaxNum && data.length >= this.athletesMaxNum) {
|
||||
this.$toast("该" + title + "人员已报满!")
|
||||
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 this.onRefresh()
|
||||
@@ -222,7 +211,7 @@ layout("/mobile/platform.html"){
|
||||
this.applyType = applyType
|
||||
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) {
|
||||
this.$toast("您不在报名人员内!")
|
||||
return
|
||||
@@ -238,10 +227,10 @@ layout("/mobile/platform.html"){
|
||||
}*/
|
||||
if (userApply == 1) {
|
||||
const confirm = await vant.Dialog.confirm({
|
||||
title: '提示',
|
||||
message: '确定取消此次报名吗?',
|
||||
title: "提示",
|
||||
message: "确定取消此次报名吗?"
|
||||
})
|
||||
if (confirm === 'confirm') {
|
||||
if (confirm === "confirm") {
|
||||
await $.get("/platform/activity/apply/doDeleteApply", {
|
||||
userId: "${@shiro.getPrincipalProperty('id')}",
|
||||
activityId: activityId,
|
||||
@@ -253,16 +242,11 @@ layout("/mobile/platform.html"){
|
||||
return
|
||||
}
|
||||
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
|
||||
const {
|
||||
athletesMaxNum,
|
||||
startAgeDate,
|
||||
endAgeDate,
|
||||
isMenWomen,
|
||||
restrictBoyNum,
|
||||
restrictGirlNum
|
||||
} = this.events.find(v => v.id == eventId)
|
||||
const { athletesMaxNum, startAgeDate, endAgeDate, isMenWomen, restrictBoyNum, restrictGirlNum } = this.events.find(
|
||||
(v) => v.id == eventId
|
||||
)
|
||||
if (isMenWomen) {
|
||||
this.restrictBoyNum = athletesMaxNum
|
||||
this.restrictGirlNum = athletesMaxNum
|
||||
@@ -272,24 +256,24 @@ layout("/mobile/platform.html"){
|
||||
}
|
||||
this.athletesMaxNum = athletesMaxNum
|
||||
if (projectType == 1) {
|
||||
if (isMenWomen != null && isMenWomen === 1 && "${@shiro.getPrincipalProperty('sex')}" != '男') {
|
||||
if (isMenWomen != null && isMenWomen === 1 && "${@shiro.getPrincipalProperty('sex')}" != "男") {
|
||||
this.$toast("此项目只能男性老师才能报名!")
|
||||
return
|
||||
}
|
||||
if (isMenWomen != null && isMenWomen === 2 && "${@shiro.getPrincipalProperty('sex')}" != '女') {
|
||||
if (isMenWomen != null && isMenWomen === 2 && "${@shiro.getPrincipalProperty('sex')}" != "女") {
|
||||
this.$toast("此项目只能女性老师才能报名!")
|
||||
return
|
||||
}
|
||||
if (restrictRegNumber > 0) {
|
||||
const {data} = await $.post("/platform/activity/apply/getActivityData", {activityId})
|
||||
const userApplyNum = data.filter(v => v.userId == "${@shiro.getPrincipalProperty('id')}").length
|
||||
const { data } = await $.post("/platform/activity/apply/getActivityData", { activityId })
|
||||
const userApplyNum = data.filter((v) => v.userId == "${@shiro.getPrincipalProperty('id')}").length
|
||||
if (userApplyNum >= restrictRegNumber) {
|
||||
this.$toast('单项项目,每人限报' + restrictRegNumber + '个!团体项目除外')
|
||||
this.$toast("单项项目,每人限报" + restrictRegNumber + "个!团体项目除外")
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
const {data} = await $.post("/mobile/activity/Sports/list/getTeamUserData", {
|
||||
const { data } = await $.post("/mobile/activity/Sports/list/getTeamUserData", {
|
||||
activityId: this.formData.activityId,
|
||||
applyType: applyType,
|
||||
eventId: eventId
|
||||
@@ -303,18 +287,15 @@ layout("/mobile/platform.html"){
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
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
|
||||
if (data.length >= limit.limitCount) {
|
||||
this.$toast("此项目报名人数已满!此项目只需报" + limit.limitCount + "人")
|
||||
return
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (startAgeDate != null) {
|
||||
const birthday = moment("${@shiro.getPrincipalProperty('birthday')}").valueOf()
|
||||
if (birthday < moment(startAgeDate).valueOf() || birthday > moment(endAgeDate).valueOf()) {
|
||||
@@ -322,27 +303,24 @@ layout("/mobile/platform.html"){
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
if (isMenWomen != null && isMenWomen == 1 && "${@shiro.getPrincipalProperty('sex')}" != '男') {
|
||||
if (isMenWomen != null && isMenWomen == 1 && "${@shiro.getPrincipalProperty('sex')}" != "男") {
|
||||
this.$toast("此项目只能男性老师才能报名!")
|
||||
return
|
||||
}
|
||||
if (isMenWomen != null && isMenWomen == 2 && "${@shiro.getPrincipalProperty('sex')}" != '女') {
|
||||
if (isMenWomen != null && isMenWomen == 2 && "${@shiro.getPrincipalProperty('sex')}" != "女") {
|
||||
this.$toast("此项目只能女性老师才能报名!")
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
if (projectType == 2) {
|
||||
const {data} = await $.get("/platform/activity/apply/getActivityTeamId", {
|
||||
const { data } = await $.get("/platform/activity/apply/getActivityTeamId", {
|
||||
activityId: activityId,
|
||||
eventId: eventId
|
||||
})
|
||||
this.teams = data
|
||||
if (data.length && data.length > 0) this.$set(this.formData, "teamId", data[0].id)
|
||||
|
||||
}
|
||||
this.activityDialog = true
|
||||
},
|
||||
@@ -355,7 +333,7 @@ layout("/mobile/platform.html"){
|
||||
async pageData() {
|
||||
this.loading = true
|
||||
|
||||
const {data} = await $.get('/platform/activity/apply/pageData', this.pageForm)
|
||||
const { data } = await $.get("/platform/activity/apply/pageData", this.pageForm)
|
||||
setTimeout(() => {
|
||||
this.tableData = this.tableData.concat(data.list)
|
||||
if (this.tableData.length === data.totalCount) {
|
||||
@@ -366,31 +344,26 @@ layout("/mobile/platform.html"){
|
||||
this.loading = false
|
||||
this.pageForm.totalCount = data.totalCount
|
||||
}, 300)
|
||||
|
||||
}
|
||||
,
|
||||
},
|
||||
async created() {
|
||||
const id = GetQueryString('id')
|
||||
const applyType = GetQueryString('applyType')
|
||||
const id = GetQueryString("id")
|
||||
const applyType = GetQueryString("applyType")
|
||||
this.pageForm.activityId = id
|
||||
this.pageForm.applyType = applyType
|
||||
const data = await $.post("/platform/activity/apply/getEvents", {activityId: id})
|
||||
data.forEach(v => {
|
||||
this.eventList.push({value: v.eventId, text: v.allName})
|
||||
const data = await $.post("/platform/activity/apply/getEvents", { activityId: id })
|
||||
data.forEach((v) => {
|
||||
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, "isMenWomen", 1)
|
||||
this.$set(this.pageForm, "groupName", null)
|
||||
this.$set(this.pageForm, "isAudit", null)
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
#-->
|
||||
|
||||
@@ -18,14 +18,12 @@ layout("/mobile/platform.html"){
|
||||
</style>
|
||||
<div id="app" v-cloak>
|
||||
<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">
|
||||
<van-dropdown-menu active-color="#1989fa">
|
||||
<van-dropdown-item v-model="pageForm.year" :options="yearList"
|
||||
@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.year" :options="yearList" @change="getActivityData"></van-dropdown-item>
|
||||
<van-dropdown-item v-model="pageForm.isActivity" :options="activityList" @change="getActivityData"></van-dropdown-item>
|
||||
</van-dropdown-menu>
|
||||
</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)">
|
||||
<van-cell-group inset>
|
||||
<van-cell :border="false" title="活动名称">
|
||||
<span class="van-ellipsis" style="font-size: 16px;" :style="{color:themeColor}">
|
||||
{{o.NAME}}
|
||||
</span>
|
||||
<span class="van-ellipsis" style="font-size: 16px" :style="{color:themeColor}">{{o.NAME}}</span>
|
||||
</van-cell>
|
||||
<van-cell :border="false" title="活动地址">{{o.address}}</van-cell>
|
||||
<van-cell :border="false" title="报名时间">
|
||||
<span style="font-size: 12px">
|
||||
{{moment(o.applyStartTime).format('YYYY/MM/DD HH:mm')}} 至
|
||||
{{moment(o.applyEndTime).format('YYYY/MM/DD HH:mm')}}
|
||||
{{moment(o.applyStartTime).format('YYYY/MM/DD HH:mm')}} 至 {{moment(o.applyEndTime).format('YYYY/MM/DD HH:mm')}}
|
||||
</span>
|
||||
</van-cell>
|
||||
<van-cell :border="false" title="活动时间">
|
||||
<span style="font-size: 12px">
|
||||
{{moment(o.startTime).format('YYYY/MM/DD HH:mm')}} 至
|
||||
{{moment(o.endTime).format('YYYY/MM/DD HH:mm')}}
|
||||
{{moment(o.startTime).format('YYYY/MM/DD HH:mm')}} 至 {{moment(o.endTime).format('YYYY/MM/DD HH:mm')}}
|
||||
</span>
|
||||
</van-cell>
|
||||
<van-cell :border="false" title="活动状态">
|
||||
<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 type="success" v-else-if="moment(o.startTime).valueOf() < moment().valueOf() && moment().valueOf() < moment(o.endTime).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
|
||||
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-cell>
|
||||
</van-cell-group>
|
||||
@@ -62,27 +66,24 @@ layout("/mobile/platform.html"){
|
||||
</van-list>
|
||||
</div>
|
||||
|
||||
<van-empty v-if="mLoading==false&&tableData.length==0" class="custom-image" image="/none.svg"
|
||||
description="暂无数据">
|
||||
</van-empty>
|
||||
|
||||
<van-empty v-if="mLoading==false&&tableData.length==0" class="custom-image" image="/none.svg" description="暂无数据"></van-empty>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
el: "#app",
|
||||
mixins: [mobileMixins],
|
||||
data() {
|
||||
return {
|
||||
activityList: [
|
||||
{text: '全部', value: 1},
|
||||
{text: '未开始', value: 5},
|
||||
{text: '报名中', value: 2},
|
||||
{text: '进行中', value: 4},
|
||||
{text: '已结束', value: 3},
|
||||
{ text: "全部", value: 1 },
|
||||
{ text: "未开始", value: 5 },
|
||||
{ text: "报名中", value: 2 },
|
||||
{ text: "进行中", value: 4 },
|
||||
{ text: "已结束", value: 3 }
|
||||
],
|
||||
pageForm: {
|
||||
year: '',
|
||||
year: "",
|
||||
isActivity: "1"
|
||||
}
|
||||
}
|
||||
@@ -94,7 +95,7 @@ layout("/mobile/platform.html"){
|
||||
this.pageData()
|
||||
},
|
||||
async getActivityData() {
|
||||
const {data} = await $.post("/platform/activity/apply/activityData", {
|
||||
const { data } = await $.post("/platform/activity/apply/activityData", {
|
||||
year: this.pageForm.year,
|
||||
isActivity: this.pageForm.isActivity
|
||||
})
|
||||
@@ -105,7 +106,7 @@ layout("/mobile/platform.html"){
|
||||
this.$toast("活动已结束,暂不能报名")
|
||||
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() {
|
||||
@@ -114,12 +115,10 @@ layout("/mobile/platform.html"){
|
||||
this.$set(this.pageForm, "isActivity", 1)
|
||||
await this.getActivityData()
|
||||
this.mLoading = false
|
||||
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
|
||||
@@ -20,20 +20,19 @@ layout("/mobile/platform.html"){
|
||||
</style>
|
||||
|
||||
<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>
|
||||
|
||||
<div style="margin: 20px auto 0 auto">
|
||||
<div v-for="o in tableData" class="list-card">
|
||||
<van-cell-group inset>
|
||||
<image class="register-icon" src="/assets/mobile/svg/activity/ybm.svg"
|
||||
@click="openActivity(o)"
|
||||
v-if="o.userApply>0&&o.applyWay.includes(1)"></image>
|
||||
<image
|
||||
class="register-icon"
|
||||
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="项目名称">
|
||||
<span class="van-ellipsis" style="font-size: 16px;"
|
||||
:style="{color:themeColor}">
|
||||
{{o.allName}}
|
||||
</span>
|
||||
<span class="van-ellipsis" style="font-size: 16px" :style="{color:themeColor}">{{o.allName}}</span>
|
||||
</van-cell>
|
||||
<van-cell :border="false" title="项目类型">{{o.projectType==1?'单项':'团体'}}</van-cell>
|
||||
<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==2">{{o.restrictGirlNum+o.restrictBoyNum}}人</span>
|
||||
<span v-else>暂无</span>
|
||||
|
||||
</van-cell>
|
||||
<van-cell :border="false" title="已报名人数">
|
||||
<span v-if="o.applyNum>0&&o.applyType!=3">{{o.applyNum}}人</span>
|
||||
@@ -57,24 +55,22 @@ layout("/mobile/platform.html"){
|
||||
</van-cell-group>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
el: "#app",
|
||||
mixins: [mobileMixins],
|
||||
data() {
|
||||
return {
|
||||
activityId: '',
|
||||
activityId: "",
|
||||
o: {},
|
||||
projectInfo: null
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
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) {
|
||||
this.o = resp.data
|
||||
this.$nextTick(() => {
|
||||
@@ -83,36 +79,26 @@ layout("/mobile/platform.html"){
|
||||
}
|
||||
},
|
||||
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) {
|
||||
this.projectInfo = resp.data
|
||||
}
|
||||
},
|
||||
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) {
|
||||
this.tableData = resp.data.list
|
||||
}
|
||||
},
|
||||
async openActivity(o) {
|
||||
const {
|
||||
applyType,
|
||||
eventId,
|
||||
activityId,
|
||||
projectType,
|
||||
userApply,
|
||||
applyNum,
|
||||
name,
|
||||
activityGroupId,
|
||||
restrictRegNumber
|
||||
} = o
|
||||
const { applyType, eventId, activityId, projectType, userApply, applyNum, name, activityGroupId, restrictRegNumber } = o
|
||||
const confirm = await vant.Dialog.confirm({
|
||||
title: '提示',
|
||||
message: '确定取消此次报名吗?',
|
||||
title: "提示",
|
||||
message: "确定取消此次报名吗?"
|
||||
})
|
||||
if (confirm === 'confirm') {
|
||||
if (confirm === "confirm") {
|
||||
const loading = this.$toast.loading({
|
||||
message: '取消中...',
|
||||
message: "取消中...",
|
||||
forbidClick: true,
|
||||
overlay: true,
|
||||
duration: 0
|
||||
@@ -124,20 +110,18 @@ layout("/mobile/platform.html"){
|
||||
})
|
||||
loading.close()
|
||||
if (resp.code === 0) {
|
||||
this.$toast.success('取消成功')
|
||||
this.$toast.success("取消成功")
|
||||
this.getHasRegEventProject()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
created() {
|
||||
const id = GetQueryString("id")
|
||||
if (id) {
|
||||
this.$set(this.pageForm, 'isAudit', 'true')
|
||||
this.$set(this.pageForm, 'activityId', id)
|
||||
this.$set(this.pageForm, 'pageSize', 100)
|
||||
this.$set(this.pageForm, "isAudit", "true")
|
||||
this.$set(this.pageForm, "activityId", id)
|
||||
this.$set(this.pageForm, "pageSize", 100)
|
||||
this.activityId = id
|
||||
this.getActivityInfo()
|
||||
this.getHasRegEventProject()
|
||||
@@ -147,4 +131,4 @@ layout("/mobile/platform.html"){
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
#-->
|
||||
|
||||
@@ -7,7 +7,6 @@ layout("/mobile/platform.html"){
|
||||
background: #ececec;
|
||||
}
|
||||
|
||||
|
||||
.tips .content {
|
||||
height: calc(80vh - 49px);
|
||||
overflow-y: scroll;
|
||||
@@ -15,7 +14,12 @@ layout("/mobile/platform.html"){
|
||||
/*padding: 5px*/
|
||||
}
|
||||
|
||||
.tips .content h1, h2, h3, h4, h5, h6 {
|
||||
.tips .content h1,
|
||||
h2,
|
||||
h3,
|
||||
h4,
|
||||
h5,
|
||||
h6 {
|
||||
font-weight: unset;
|
||||
margin: 10px;
|
||||
}
|
||||
@@ -58,7 +62,6 @@ layout("/mobile/platform.html"){
|
||||
/*border-left: none;*/
|
||||
}
|
||||
|
||||
|
||||
.table-container table td {
|
||||
/*background-color: #f2f2f2;*/
|
||||
}
|
||||
@@ -81,180 +84,188 @@ layout("/mobile/platform.html"){
|
||||
.siteUsageTabs .van-tabs__line {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<div>
|
||||
<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="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-tab :title="k" v-for="(v,k) in allSiteUsageInfo" :item="k">
|
||||
<template #title>
|
||||
<svg t="1702637676312" class="icon" 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
|
||||
t="1702637676312"
|
||||
class="icon"
|
||||
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>
|
||||
{{k}}
|
||||
</template>
|
||||
<div class="table-container">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<td>开始时间</td>
|
||||
<td>结束时间</td>
|
||||
<td>联系人</td>
|
||||
<td>联系人部门</td>
|
||||
<td>活动名称</td>
|
||||
<td>活动性质</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>开始时间</td>
|
||||
<td>结束时间</td>
|
||||
<td>联系人</td>
|
||||
<td>联系人部门</td>
|
||||
<td>活动名称</td>
|
||||
<td>活动性质</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="item in v" :key="item.id">
|
||||
<td>{{item.reserve_start_time}}</td>
|
||||
<td>{{item.reserve_end_time}}</td>
|
||||
<td>{{item.reserve_person_username}}</td>
|
||||
<td>{{item.reserve_person_unitname}}</td>
|
||||
<td>{{item.reserve_activity}}</td>
|
||||
<td>{{item.activity_nature}}</td>
|
||||
</tr>
|
||||
<tr v-for="item in v" :key="item.id">
|
||||
<td>{{item.reserve_start_time}}</td>
|
||||
<td>{{item.reserve_end_time}}</td>
|
||||
<td>{{item.reserve_person_username}}</td>
|
||||
<td>{{item.reserve_person_unitname}}</td>
|
||||
<td>{{item.reserve_activity}}</td>
|
||||
<td>{{item.activity_nature}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</van-tab>
|
||||
</van-tabs>
|
||||
|
||||
<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-form @submit="onSubmit">
|
||||
<van-cell-group class="">
|
||||
<van-field v-model="formData.reserve_activity"
|
||||
name="reserve_activity"
|
||||
rows="1"
|
||||
autosize
|
||||
type="textarea"
|
||||
:rules="[{ required: true, message: '请填写' }]"
|
||||
placeholder="请填写活动名称"
|
||||
required
|
||||
label="活动名称"></van-field>
|
||||
<van-field
|
||||
v-model="formData.reserve_activity"
|
||||
name="reserve_activity"
|
||||
rows="1"
|
||||
autosize
|
||||
type="textarea"
|
||||
:rules="[{ required: true, message: '请填写' }]"
|
||||
placeholder="请填写活动名称"
|
||||
required
|
||||
label="活动名称"
|
||||
></van-field>
|
||||
|
||||
<van-field readonly
|
||||
clickable
|
||||
name="activity_nature"
|
||||
:value="formData.activity_nature"
|
||||
label="活动性质"
|
||||
placeholder="点击选择活动性质"
|
||||
:rules="[{ required: true, message: '请选择' }]"
|
||||
required
|
||||
@click="showSiteNaturePicker = true"
|
||||
>
|
||||
</van-field>
|
||||
<van-field
|
||||
readonly
|
||||
clickable
|
||||
name="activity_nature"
|
||||
:value="formData.activity_nature"
|
||||
label="活动性质"
|
||||
placeholder="点击选择活动性质"
|
||||
:rules="[{ required: true, message: '请选择' }]"
|
||||
required
|
||||
@click="showSiteNaturePicker = true"
|
||||
></van-field>
|
||||
|
||||
<van-field v-model="formData.reserve_join_user_num"
|
||||
name="reserve_join_user_num"
|
||||
rows="1"
|
||||
autosize
|
||||
type="textarea"
|
||||
:rules="[{ required: true, message: '请填写' }]"
|
||||
placeholder="请填写活动人数"
|
||||
required
|
||||
label="活动人数"></van-field>
|
||||
<van-field
|
||||
v-model="formData.reserve_join_user_num"
|
||||
name="reserve_join_user_num"
|
||||
rows="1"
|
||||
autosize
|
||||
type="textarea"
|
||||
:rules="[{ required: true, message: '请填写' }]"
|
||||
placeholder="请填写活动人数"
|
||||
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"
|
||||
name="site_responsible_person"
|
||||
rows="1"
|
||||
autosize
|
||||
type="textarea"
|
||||
:rules="[{ required: true, message: '请填写' }]"
|
||||
placeholder="请填写活动现场负责人"
|
||||
required
|
||||
label="现场负责人"></van-field>
|
||||
<van-field readonly :value="formData.reserve_person_username" name="reserve_person_username" label="联系人"></van-field>
|
||||
<van-field readonly :value="formData.reserve_person_loginname" name="reserve_person_loginname" label="联系人工号"></van-field>
|
||||
<van-field readonly :value="formData.reserve_person_sex" name="reserve_person_sex" label="联系人性别"></van-field>
|
||||
<van-field readonly :value="formData.reserve_person_phone" name="reserve_person_phone" label="联系电话"></van-field>
|
||||
<van-field readonly :value="formData.reserve_person_unitname" name="reserve_person_unitname" label="申请部门"></van-field>
|
||||
<van-field readonly :value="formData.reserve_person_unionname" name="reserve_person_unionname" 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"
|
||||
label="联系人"></van-field>
|
||||
<van-field readonly :value="formData.reserve_person_loginname" name="reserve_person_loginname"
|
||||
label="联系人工号"></van-field>
|
||||
<van-field readonly :value="formData.reserve_person_sex" name="reserve_person_sex"
|
||||
label="联系人性别"></van-field>
|
||||
<van-field readonly :value="formData.reserve_person_phone" name="reserve_person_phone"
|
||||
label="联系电话"></van-field>
|
||||
<van-field readonly :value="formData.reserve_person_unitname" name="reserve_person_unitname"
|
||||
label="申请部门"></van-field>
|
||||
<van-field readonly :value="formData.reserve_person_unionname" name="reserve_person_unionname"
|
||||
label="申请工会"></van-field>
|
||||
<van-field
|
||||
readonly
|
||||
clickable
|
||||
name="selectList"
|
||||
:value="selectList"
|
||||
label="使用设备"
|
||||
placeholder="点击选择使用设备"
|
||||
@click="showSiteEquipmentPicker = true"
|
||||
></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
|
||||
clickable
|
||||
label="预约开始时间"
|
||||
:value="formData.reserve_start_time"
|
||||
name="reserve_start_time"
|
||||
:rules="[{ required: true, message: '请选择' }]"
|
||||
placeholder="请选择预约开始时间"
|
||||
required
|
||||
@click="startTimePicker = true"
|
||||
></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
|
||||
clickable
|
||||
name="selectList"
|
||||
:value="selectList"
|
||||
label="使用设备"
|
||||
placeholder="点击选择使用设备"
|
||||
@click="showSiteEquipmentPicker = true"
|
||||
>
|
||||
</van-field>
|
||||
|
||||
<van-field readonly clickable
|
||||
label="预约开始时间"
|
||||
:value="formData.reserve_start_time"
|
||||
name="reserve_start_time"
|
||||
:rules="[{ required: true, message: '请选择' }]"
|
||||
placeholder="请选择预约开始时间"
|
||||
required
|
||||
@click="startTimePicker = true">
|
||||
</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-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>
|
||||
|
||||
<div style="margin: 16px;">
|
||||
<div style="margin: 16px">
|
||||
<van-button round block type="info" native-type="submit">提交</van-button>
|
||||
</div>
|
||||
|
||||
</van-form>
|
||||
|
||||
<!--<van-popup v-model="showTips" :style="{ height: '80%',width:'90%' }" round>
|
||||
@@ -320,33 +331,28 @@ layout("/mobile/platform.html"){
|
||||
</van-popup>-->
|
||||
<van-popup v-model="startTimePicker" position="bottom">
|
||||
<van-datetime-picker
|
||||
v-model="startTime"
|
||||
type="datetime"
|
||||
title="选择预约开始时间"
|
||||
@confirm="onStartTimeConfirm"
|
||||
@cancel="startTimePicker = false"
|
||||
:min-date="startMinDate"
|
||||
v-model="startTime"
|
||||
type="datetime"
|
||||
title="选择预约开始时间"
|
||||
@confirm="onStartTimeConfirm"
|
||||
@cancel="startTimePicker = false"
|
||||
:min-date="startMinDate"
|
||||
></van-datetime-picker>
|
||||
</van-popup>
|
||||
<van-popup v-model="endTimePicker" position="bottom">
|
||||
<van-datetime-picker
|
||||
v-model="endTime"
|
||||
type="datetime"
|
||||
title="选择预约结束时间"
|
||||
@confirm="onEndTimeConfirm"
|
||||
@cancel="endTimePicker = false"
|
||||
:min-date="endMinDate"
|
||||
v-model="endTime"
|
||||
type="datetime"
|
||||
title="选择预约结束时间"
|
||||
@confirm="onEndTimeConfirm"
|
||||
@cancel="endTimePicker = false"
|
||||
:min-date="endMinDate"
|
||||
></van-datetime-picker>
|
||||
</van-popup>
|
||||
<van-popup v-model="showSitePicker" position="bottom">
|
||||
<van-picker
|
||||
title="请选择需要预约的场地"
|
||||
show-toolbar
|
||||
:columns="siteColumns"
|
||||
@confirm="onSiteConfirm"
|
||||
@cancel="showSitePicker = false">
|
||||
<van-picker title="请选择需要预约的场地" show-toolbar :columns="siteColumns" @confirm="onSiteConfirm" @cancel="showSitePicker = false">
|
||||
<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>
|
||||
</template>
|
||||
@@ -354,37 +360,37 @@ layout("/mobile/platform.html"){
|
||||
</van-popup>
|
||||
<van-popup v-model="showSiteNaturePicker" position="bottom">
|
||||
<van-picker
|
||||
title="请选择活动性质"
|
||||
show-toolbar
|
||||
:columns="siteNatureColumns"
|
||||
@confirm="onsiteNatureConfirm"
|
||||
@cancel="showSiteNaturePicker = false">
|
||||
title="请选择活动性质"
|
||||
show-toolbar
|
||||
:columns="siteNatureColumns"
|
||||
@confirm="onsiteNatureConfirm"
|
||||
@cancel="showSiteNaturePicker = false"
|
||||
>
|
||||
<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>
|
||||
</template>
|
||||
</van-picker>
|
||||
</van-popup>
|
||||
|
||||
<!-- <van-popup v-model="showSiteEquipmentPicker" position="bottom">-->
|
||||
<!-- <van-picker-->
|
||||
<!-- title="请选择使用设备"-->
|
||||
<!-- show-toolbar-->
|
||||
<!-- :columns="siteEquipmentColumns"-->
|
||||
<!-- @confirm="onsiteEquipmentConfirm"-->
|
||||
<!-- @cancel="showSiteEquipmentPicker = false">-->
|
||||
<!-- <template #option="option">-->
|
||||
<!-- <div style="display: flex; flex-direction: column; align-items: center;">-->
|
||||
<!-- <div>{{ option.name }}</div>-->
|
||||
<!-- </div>-->
|
||||
<!-- </template>-->
|
||||
<!-- </van-picker>-->
|
||||
<!-- </van-popup>-->
|
||||
|
||||
<!-- <van-popup v-model="showSiteEquipmentPicker" position="bottom">-->
|
||||
<!-- <van-picker-->
|
||||
<!-- title="请选择使用设备"-->
|
||||
<!-- show-toolbar-->
|
||||
<!-- :columns="siteEquipmentColumns"-->
|
||||
<!-- @confirm="onsiteEquipmentConfirm"-->
|
||||
<!-- @cancel="showSiteEquipmentPicker = false">-->
|
||||
<!-- <template #option="option">-->
|
||||
<!-- <div style="display: flex; flex-direction: column; align-items: center;">-->
|
||||
<!-- <div>{{ option.name }}</div>-->
|
||||
<!-- </div>-->
|
||||
<!-- </template>-->
|
||||
<!-- </van-picker>-->
|
||||
<!-- </van-popup>-->
|
||||
|
||||
<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>
|
||||
<div style="border: none; color: #000" size="normal">确认</div>
|
||||
<van-button style="border: none; color: #6398fb" @click="checkedChange" size="normal">确认</van-button>
|
||||
@@ -402,7 +408,7 @@ layout("/mobile/platform.html"){
|
||||
|
||||
<script>
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
el: "#app",
|
||||
mixins: [mobileMixins],
|
||||
data() {
|
||||
return {
|
||||
@@ -416,156 +422,155 @@ layout("/mobile/platform.html"){
|
||||
startTime: null,
|
||||
endTime: null,
|
||||
siteColumns: [],
|
||||
siteNatureColumns:[{name:'测试',id:'测试'}],
|
||||
siteEquipmentColumns:[],
|
||||
siteNatureColumns: [{ name: "测试", id: "测试" }],
|
||||
siteEquipmentColumns: [],
|
||||
showSiteUsage: false,
|
||||
allSiteUsageInfo: {},
|
||||
tabActive: null,
|
||||
startMinDate: moment().add(2, 'days').toDate(),
|
||||
endMinDate: moment().add(2, 'days').add(30, 'minute').toDate(),
|
||||
selectList:[],
|
||||
selectEquipmentList:[]
|
||||
startMinDate: moment().add(2, "days").toDate(),
|
||||
endMinDate: moment().add(2, "days").add(30, "minute").toDate(),
|
||||
selectList: [],
|
||||
selectEquipmentList: []
|
||||
// endMaxDate: moment().add(2, 'days').toDate()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
checkedChange(){
|
||||
this.selectList = this.selectEquipmentList.map(v=>{return v.equipmentName})
|
||||
this.formData.equipment_ids = this.selectEquipmentList.map(v=> {return v.id})
|
||||
checkedChange() {
|
||||
this.selectList = this.selectEquipmentList.map((v) => {
|
||||
return v.equipmentName
|
||||
})
|
||||
this.formData.equipment_ids = this.selectEquipmentList.map((v) => {
|
||||
return v.id
|
||||
})
|
||||
this.showSiteEquipmentPicker = false
|
||||
},
|
||||
async onSubmit(values) {
|
||||
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,
|
||||
endTime: this.formData.reserve_end_time,
|
||||
siteId: this.formData.site_id
|
||||
})
|
||||
if (resp.code === 1) {
|
||||
this.$toast(resp.msg)
|
||||
this.formData.reserve_start_time = ''
|
||||
this.formData.reserve_end_time = ''
|
||||
this.formData.reserve_start_time = ""
|
||||
this.formData.reserve_end_time = ""
|
||||
return
|
||||
}
|
||||
|
||||
const {site_name, reserve_start_time, reserve_end_time} = this.formData
|
||||
this.$dialog.confirm({
|
||||
title: '提示',
|
||||
message: '您确定要提交' + site_name + '\n' + reserve_start_time + "\n至\n" + reserve_end_time + '\n的预约吗?',
|
||||
}).then(async () => {
|
||||
const loading = this.$toast.loading({
|
||||
message: '提交中...',
|
||||
forbidClick: true,
|
||||
});
|
||||
const {
|
||||
data,
|
||||
code,
|
||||
msg
|
||||
} = await $.post('/platform/activity/site/apply/insert', {"siteReserve": JSON.stringify(this.formData)})
|
||||
loading.clear()
|
||||
if (code === 0) {
|
||||
this.$toast.success(msg)
|
||||
setTimeout(() => {
|
||||
location.href = '/mobile/activity/site/mine'
|
||||
}, 500)
|
||||
} else {
|
||||
this.$toast.fail(msg)
|
||||
}
|
||||
}).catch(() => {
|
||||
})
|
||||
const { site_name, reserve_start_time, reserve_end_time } = this.formData
|
||||
this.$dialog
|
||||
.confirm({
|
||||
title: "提示",
|
||||
message: "您确定要提交" + site_name + "\n" + reserve_start_time + "\n至\n" + reserve_end_time + "\n的预约吗?"
|
||||
})
|
||||
.then(async () => {
|
||||
const loading = this.$toast.loading({
|
||||
message: "提交中...",
|
||||
forbidClick: true
|
||||
})
|
||||
const { data, code, msg } = await $.post("/platform/activity/site/apply/insert", {
|
||||
siteReserve: JSON.stringify(this.formData)
|
||||
})
|
||||
loading.clear()
|
||||
if (code === 0) {
|
||||
this.$toast.success(msg)
|
||||
setTimeout(() => {
|
||||
location.href = "/mobile/activity/site/mine"
|
||||
}, 500)
|
||||
} else {
|
||||
this.$toast.fail(msg)
|
||||
}
|
||||
})
|
||||
.catch(() => {})
|
||||
},
|
||||
onStartTimeConfirm(time) {
|
||||
const hours = time.getHours();
|
||||
const minutes = time.getMinutes();
|
||||
const hours = time.getHours()
|
||||
const minutes = time.getMinutes()
|
||||
const day = time.getDay()
|
||||
|
||||
if (day === 0 || day === 6) {
|
||||
this.$toast('周六周日预约不了喔')
|
||||
this.$toast("周六周日预约不了喔")
|
||||
return
|
||||
}
|
||||
|
||||
if (hours < 8 || (hours === 8 && minutes < 30)) {
|
||||
this.$toast('请预约上午8点半之后的时间')
|
||||
this.$toast("请预约上午8点半之后的时间")
|
||||
return
|
||||
}
|
||||
this.formData.reserve_start_time = moment(time).format('YYYY-MM-DD HH:mm:ss');
|
||||
this.startTimePicker = false;
|
||||
this.formData.reserve_start_time = moment(time).format("YYYY-MM-DD HH:mm:ss")
|
||||
this.startTimePicker = false
|
||||
},
|
||||
onEndTimeConfirm(time) {
|
||||
if (!this.formData.reserve_start_time) {
|
||||
this.$toast('请先选择预约开始时间')
|
||||
this.$toast("请先选择预约开始时间")
|
||||
return
|
||||
}
|
||||
|
||||
const day = time.getDay()
|
||||
const hours = time.getHours();
|
||||
const minutes = time.getMinutes();
|
||||
const hours = time.getHours()
|
||||
const minutes = time.getMinutes()
|
||||
|
||||
if (day === 0 || day === 6) {
|
||||
this.$toast('周六周日预约不了喔')
|
||||
this.$toast("周六周日预约不了喔")
|
||||
return
|
||||
}
|
||||
|
||||
if (hours > 17 || (hours >= 17 && minutes > 0)) {
|
||||
this.$toast('结束时间不能超过下午5点')
|
||||
this.$toast("结束时间不能超过下午5点")
|
||||
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) {
|
||||
this.$toast('不能跨天预约喔')
|
||||
this.$toast("不能跨天预约喔")
|
||||
return
|
||||
}
|
||||
|
||||
this.formData.reserve_end_time = moment(time).format('YYYY-MM-DD HH:mm:ss');
|
||||
this.endTimePicker = false;
|
||||
this.formData.reserve_end_time = moment(time).format("YYYY-MM-DD HH:mm:ss")
|
||||
this.endTimePicker = false
|
||||
},
|
||||
onSiteConfirm(value, index) {
|
||||
this.$set(this.formData, 'site_name', value.name)
|
||||
this.$set(this.formData, 'site_id', value.id)
|
||||
this.$set(this.formData, "site_name", value.name)
|
||||
this.$set(this.formData, "site_id", value.id)
|
||||
this.showSitePicker = false
|
||||
this.listSiteEquipment(value.id)
|
||||
},
|
||||
async listSite() {
|
||||
const {data} = await $.get(loc() + '/listSite')
|
||||
const { data } = await $.get(loc() + "/listSite")
|
||||
this.siteColumns = data
|
||||
},
|
||||
onsiteNatureConfirm(value, index){
|
||||
this.$set(this.formData, 'activity_nature', value.name)
|
||||
onsiteNatureConfirm(value, index) {
|
||||
this.$set(this.formData, "activity_nature", value.name)
|
||||
// this.$set(this.formData, 'site_id', value.id)
|
||||
this.showSiteNaturePicker = false
|
||||
},
|
||||
async listSiteNature(){
|
||||
|
||||
},
|
||||
onsiteEquipmentConfirm(value, index){
|
||||
|
||||
},
|
||||
async listSiteEquipment(siteId){
|
||||
const {data} = await $.get('/platform/activity/site/apply/getSiteEquipmentList',{siteId:siteId})
|
||||
async listSiteNature() {},
|
||||
onsiteEquipmentConfirm(value, index) {},
|
||||
async listSiteEquipment(siteId) {
|
||||
const { data } = await $.get("/platform/activity/site/apply/getSiteEquipmentList", { siteId: siteId })
|
||||
this.siteEquipmentColumns = data
|
||||
},
|
||||
async 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_username', data.reserve_person_username)
|
||||
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_phone', data.reserve_person_phone)
|
||||
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_unionid', data.reserve_person_unionid)
|
||||
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_username", data.reserve_person_username)
|
||||
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_phone", data.reserve_person_phone)
|
||||
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_unionid", data.reserve_person_unionid)
|
||||
},
|
||||
async init() {
|
||||
const id = GetQueryString('id')
|
||||
const id = GetQueryString("id")
|
||||
if (id) {
|
||||
|
||||
} else {
|
||||
await this.applyUserInfo()
|
||||
}
|
||||
},
|
||||
async allSiteUsage() {
|
||||
const {data} = await $.get('/platform/activity/site/apply/allSiteUsage')
|
||||
const { data } = await $.get("/platform/activity/site/apply/allSiteUsage")
|
||||
this.allSiteUsageInfo = data
|
||||
}
|
||||
},
|
||||
|
||||
@@ -3,8 +3,8 @@ layout("/mobile/platform.html"){
|
||||
#-->
|
||||
|
||||
<style>
|
||||
|
||||
.van-hairline--top-bottom::after, .van-hairline-unset--top-bottom::after {
|
||||
.van-hairline--top-bottom::after,
|
||||
.van-hairline-unset--top-bottom::after {
|
||||
border: 0;
|
||||
}
|
||||
|
||||
@@ -185,48 +185,32 @@ layout("/mobile/platform.html"){
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
|
||||
<m-page-loading v-if="mLoading"></m-page-loading>
|
||||
|
||||
<!--top栏-->
|
||||
<van-nav-bar
|
||||
title="场地预约审核"
|
||||
left-arrow
|
||||
placeholder
|
||||
fixed
|
||||
@click-left="history.go(-1)"
|
||||
safe-area-inset-top
|
||||
></van-nav-bar>
|
||||
<van-nav-bar title="场地预约审核" left-arrow placeholder fixed @click-left="pjaxReplace('/mobile/index')" safe-area-inset-top></van-nav-bar>
|
||||
|
||||
<!--筛选框-->
|
||||
<div class="search-fixed">
|
||||
<van-search
|
||||
v-model="pageForm.searchKeyword"
|
||||
shape="round"
|
||||
maxlength="10"
|
||||
@search="doSearch"
|
||||
placeholder="请输入场地名称、场地地点进行查询"
|
||||
>
|
||||
</van-search>
|
||||
v-model="pageForm.searchKeyword"
|
||||
shape="round"
|
||||
maxlength="10"
|
||||
@search="doSearch"
|
||||
placeholder="请输入场地名称、场地地点进行查询"
|
||||
></van-search>
|
||||
<van-dropdown-menu>
|
||||
<!--<van-dropdown-item v-model="pageForm.meetingTime" :options="meetingTimeList"
|
||||
@change="doSearch"></van-dropdown-item>-->
|
||||
<van-dropdown-item v-model="pageForm.typeId" :options="typeList"
|
||||
@change="doSearch"></van-dropdown-item>
|
||||
<van-dropdown-item v-model="pageForm.typeId" :options="typeList" @change="doSearch"></van-dropdown-item>
|
||||
</van-dropdown-menu>
|
||||
</div>
|
||||
|
||||
<!--列表-->
|
||||
<div style="margin-top: 116px">
|
||||
<van-list
|
||||
v-model="loading"
|
||||
:finished="finished" :immediate-check="false"
|
||||
:finished-text="tableData.length>0?'没有更多了':''"
|
||||
@load="onLoad">
|
||||
|
||||
<van-list 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 @click="openView(o.id, o.modulename)">
|
||||
|
||||
<div style="display: flex; justify-content: space-between">
|
||||
<div style="width: 74%">
|
||||
<div class="van-ellipsis title">
|
||||
@@ -235,21 +219,23 @@ layout("/mobile/platform.html"){
|
||||
</div>
|
||||
<div style="color: grey">{{o.address}}</div>
|
||||
</div>
|
||||
<div style="color: #1867b0;">
|
||||
{{o.meetingtypename}}
|
||||
</div>
|
||||
<div style="color: #1867b0">{{o.meetingtypename}}</div>
|
||||
</div>
|
||||
|
||||
<van-divider></van-divider>
|
||||
|
||||
<div style="margin-top: 10px">
|
||||
<van-row>
|
||||
<van-col span="12"><span style="color: grey"> 联系人:</span>{{o.unitname ? (o.unitname +
|
||||
'') : '' + '' + o.contact_person}}
|
||||
<van-col span="12">
|
||||
<span style="color: grey"> 联系人:</span>
|
||||
{{o.unitname ? (o.unitname + '') : '' + '' + o.contact_person}}
|
||||
</van-col>
|
||||
</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>
|
||||
</div>
|
||||
|
||||
@@ -263,25 +249,32 @@ layout("/mobile/platform.html"){
|
||||
|
||||
<div style="display: flex; justify-content: flex-end; margin-top: 4px">
|
||||
<div>
|
||||
<van-button @click.stop="getAuditList(o)" class="cus_button"
|
||||
type="primary" size="small" color="#1867b0"
|
||||
style="margin-right: 8px; width: auto;">已审{{o.audit}}
|
||||
<van-button
|
||||
@click.stop="getAuditList(o)"
|
||||
class="cus_button"
|
||||
type="primary"
|
||||
size="small"
|
||||
color="#1867b0"
|
||||
style="margin-right: 8px; width: auto"
|
||||
>
|
||||
已审{{o.audit}}
|
||||
</van-button>
|
||||
<van-button @click.stop="openView(o.id, o.modulename)" class="cus_button"
|
||||
type="primary" size="small" color="#1867b0"
|
||||
style="margin-right: 8px; width: auto;">未审{{o.no_audit}}
|
||||
<van-button
|
||||
@click.stop="openView(o.id, o.modulename)"
|
||||
class="cus_button"
|
||||
type="primary"
|
||||
size="small"
|
||||
color="#1867b0"
|
||||
style="margin-right: 8px; width: auto"
|
||||
>
|
||||
未审{{o.no_audit}}
|
||||
</van-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</van-list>
|
||||
<van-empty
|
||||
v-if="mLoading==false&&tableData.length==0"
|
||||
class="custom-image"
|
||||
image="/none.svg"
|
||||
description="暂无数据"
|
||||
></van-empty>
|
||||
<van-empty v-if="mLoading==false&&tableData.length==0" class="custom-image" image="/none.svg" description="暂无数据"></van-empty>
|
||||
</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-action-sheet v-model:show="userShow" :title="queryType === 'notAudit' ? '预约列表' : '预约列表'"
|
||||
class="userPopup" @close="popClose">
|
||||
<van-action-sheet v-model:show="userShow" :title="queryType === 'notAudit' ? '预约列表' : '预约列表'" class="userPopup" @close="popClose">
|
||||
<div :class="queryType == 'notAudit' ? 'content' : 'no_content'">
|
||||
<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>
|
||||
<van-tag color="#1867b0" style="margin-right: 10px" @click="cancelAll" size="large" type="primary">取消选中</van-tag>
|
||||
<van-tag color="#1867b0" @click="allIn" size="large" type="primary">全选</van-tag>
|
||||
</div>
|
||||
<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>
|
||||
</div>
|
||||
<div style="width: 94%; display: flex">
|
||||
<div style="color: grey;">预约时间:</div>
|
||||
<div style="color: grey">预约时间:</div>
|
||||
<div>
|
||||
<div v-for="(d,index) in item.concat_day.split(',')">{{getTime(item, d)}}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="width: 94%;">
|
||||
<span style="color: grey">参加人员:</span><span>{{item.joinUser}}</span>
|
||||
<div style="width: 94%">
|
||||
<span style="color: grey">参加人员:</span>
|
||||
<span>{{item.joinUser}}</span>
|
||||
</div>
|
||||
<div style="width: 94%;">
|
||||
<span style="color: grey">预约事由:</span><span>{{item.reserve_cause}}</span>
|
||||
<div style="width: 94%">
|
||||
<span style="color: grey">预约事由:</span>
|
||||
<span>{{item.reserve_cause}}</span>
|
||||
</div>
|
||||
<div style="width: 94%;">
|
||||
<span style="color: grey">审核状态:</span><span>{{item.stateName}}</span>
|
||||
<div style="width: 94%">
|
||||
<span style="color: grey">审核状态:</span>
|
||||
<span>{{item.stateName}}</span>
|
||||
</div>
|
||||
<!--<div v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('xghng')||@shiro.hasRole('A06')}"
|
||||
style="width: 94%;">
|
||||
@@ -340,17 +333,19 @@ layout("/mobile/platform.html"){
|
||||
</div>
|
||||
<van-checkbox-group v-model="result" ref="checkboxGroup">
|
||||
<van-cell-group>
|
||||
<van-cell
|
||||
clickable class="cus_cell"
|
||||
:key="item.id"
|
||||
@click="toggle(i)">
|
||||
|
||||
<van-icon class="audit_icon" color="green"
|
||||
v-if="queryType === 'hasAudit' && item.auditState == true"
|
||||
name="passed"></van-icon>
|
||||
<van-icon class="audit_icon" color="grey"
|
||||
v-if="queryType === 'hasAudit' && item.auditState == false"
|
||||
name="close"></van-icon>
|
||||
<van-cell clickable class="cus_cell" :key="item.id" @click="toggle(i)">
|
||||
<van-icon
|
||||
class="audit_icon"
|
||||
color="green"
|
||||
v-if="queryType === 'hasAudit' && item.auditState == true"
|
||||
name="passed"
|
||||
></van-icon>
|
||||
<van-icon
|
||||
class="audit_icon"
|
||||
color="grey"
|
||||
v-if="queryType === 'hasAudit' && item.auditState == false"
|
||||
name="close"
|
||||
></van-icon>
|
||||
<template #right-icon v-if="queryType === 'notAudit'">
|
||||
<van-checkbox :name="item.id" ref="checkboxes"></van-checkbox>
|
||||
</template>
|
||||
@@ -363,32 +358,34 @@ layout("/mobile/platform.html"){
|
||||
<van-button @click="audit('all', 'pass')" color="#1867b0" size="small" style="height: 38px">一键全部通过</van-button>
|
||||
</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">
|
||||
<van-button @click="audit('many', 'reject')" color="#ff976a" size="small"
|
||||
style="height: 38px;border-radius: 10px;margin-right: 20px">拒绝
|
||||
</van-button>
|
||||
<van-button @click="audit('many', 'pass')" color="#1867b0" size="small"
|
||||
style="height: 38px;border-radius: 10px">通过
|
||||
<van-button
|
||||
@click="audit('many', 'reject')"
|
||||
color="#ff976a"
|
||||
size="small"
|
||||
style="height: 38px; border-radius: 10px; margin-right: 20px"
|
||||
>
|
||||
拒绝
|
||||
</van-button>
|
||||
<van-button @click="audit('many', 'pass')" color="#1867b0" size="small" style="height: 38px; border-radius: 10px">通过</van-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</van-action-sheet>
|
||||
|
||||
<!--审核弹框-->
|
||||
<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>
|
||||
<van-divider style="margin: 12px 0 1px 0px;"></van-divider>
|
||||
<van-divider style="margin: 12px 0 1px 0px"></van-divider>
|
||||
<van-field
|
||||
v-model="reason"
|
||||
rows="2"
|
||||
label="审核意见:"
|
||||
autosize
|
||||
type="textarea"
|
||||
maxlength="50"
|
||||
placeholder="请输入审核意见"
|
||||
show-word-limit
|
||||
v-model="reason"
|
||||
rows="2"
|
||||
label="审核意见:"
|
||||
autosize
|
||||
type="textarea"
|
||||
maxlength="50"
|
||||
placeholder="请输入审核意见"
|
||||
show-word-limit
|
||||
></van-field>
|
||||
</van-dialog>
|
||||
</div>
|
||||
@@ -397,43 +394,47 @@ layout("/mobile/platform.html"){
|
||||
<!--# include("/platform/activity/includeJs/activityUtil.js"){} #-->
|
||||
const siteTypeUtil = new typeUtil()
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
el: "#app",
|
||||
mixins: [mobileMixins],
|
||||
data() {
|
||||
return {
|
||||
desc: '',
|
||||
list: ['a', 'b'],
|
||||
desc: "",
|
||||
list: ["a", "b"],
|
||||
result: [],
|
||||
reason: '',
|
||||
reason: "",
|
||||
auditShow: false,
|
||||
popupShow: false,
|
||||
userShow: false,
|
||||
userList: [],
|
||||
userClickList: [],
|
||||
str: '',
|
||||
type: '',
|
||||
auditType: '',
|
||||
queryType: '',
|
||||
str: "",
|
||||
type: "",
|
||||
auditType: "",
|
||||
queryType: "",
|
||||
typeList: [],
|
||||
meetingTimeList: [{text: '全部时间', value: null}, {text: '即将开始', value: 0}, {text: '已结束', value: 1}],
|
||||
meetingTimeList: [
|
||||
{ text: "全部时间", value: null },
|
||||
{ text: "即将开始", value: 0 },
|
||||
{ text: "已结束", value: 1 }
|
||||
]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getTime(o, day) {
|
||||
const week = new Date(day).getDay()
|
||||
const arr = ['日', '一', '二', '三', '四', '五', '六']
|
||||
return moment(day).format('MM月DD日') + ' 周' + arr[week] + ' ' + o.start_time + '-' + o.end_time
|
||||
const arr = ["日", "一", "二", "三", "四", "五", "六"]
|
||||
return moment(day).format("MM月DD日") + " 周" + arr[week] + " " + o.start_time + "-" + o.end_time
|
||||
},
|
||||
async getAuditList(o) {
|
||||
this.queryType = 'hasAudit'
|
||||
const resp = await $.post('/mobile/activity/site/audit/getLeaveUser', {
|
||||
this.queryType = "hasAudit"
|
||||
const resp = await $.post("/mobile/activity/site/audit/getLeaveUser", {
|
||||
siteId: o.id,
|
||||
auditType: 'hasAudit',
|
||||
auditType: "hasAudit"
|
||||
})
|
||||
if (resp.code === 0) {
|
||||
this.userList = resp.data
|
||||
if (this.userList.length === 0) {
|
||||
vant.Toast('暂无数据')
|
||||
vant.Toast("暂无数据")
|
||||
return
|
||||
}
|
||||
this.userList.sort((a, b) => {
|
||||
@@ -443,73 +444,73 @@ layout("/mobile/platform.html"){
|
||||
}
|
||||
},
|
||||
cancelAll() {
|
||||
this.$refs.checkboxes.forEach(item => item.toggle(false))
|
||||
this.$refs.checkboxes.forEach((item) => item.toggle(false))
|
||||
},
|
||||
allIn() {
|
||||
this.$refs.checkboxes.forEach(item => item.toggle(true))
|
||||
this.$refs.checkboxes.forEach((item) => item.toggle(true))
|
||||
},
|
||||
checkAll(i) {
|
||||
this.$refs.checkboxGroup[i].children.forEach(item => item.toggle(true))
|
||||
this.$refs.checkboxGroup[i].children.forEach((item) => item.toggle(true))
|
||||
},
|
||||
toggleAll(i) {
|
||||
this.$refs.checkboxGroup[i].children.forEach(item => item.toggle())
|
||||
this.$refs.checkboxGroup[i].children.forEach((item) => item.toggle())
|
||||
},
|
||||
toggle(i) {
|
||||
this.$refs.checkboxes[i].toggle();
|
||||
this.$refs.checkboxes[i].toggle()
|
||||
},
|
||||
async auditDo() {
|
||||
let idList = this.result
|
||||
if (this.type === 'all') {
|
||||
idList = this.userList.map(o => o.id)
|
||||
if (this.type === "all") {
|
||||
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),
|
||||
auditOpinion: this.reason,
|
||||
isPass: this.auditType === 'pass'
|
||||
isPass: this.auditType === "pass"
|
||||
})
|
||||
if (resp.code === 0) {
|
||||
vant.Toast(resp.msg)
|
||||
this.doSearch()
|
||||
} else {
|
||||
vant.Toast('操作失败')
|
||||
vant.Toast("操作失败")
|
||||
}
|
||||
this.userShow = false
|
||||
},
|
||||
audit(type, auditType) {
|
||||
this.type = type
|
||||
this.auditType = auditType
|
||||
if (type === 'many' && this.result.length === 0) {
|
||||
vant.Toast('请先选择人员')
|
||||
if (type === "many" && this.result.length === 0) {
|
||||
vant.Toast("请先选择人员")
|
||||
return
|
||||
}
|
||||
this.str = type === 'many' ? '您选择了' + this.result.length + '个人,请确认您的选择' : '您确定要一键全部审核吗?'
|
||||
this.reason = auditType === 'pass' ? '同意' : '拒绝'
|
||||
this.str = type === "many" ? "您选择了" + this.result.length + "个人,请确认您的选择" : "您确定要一键全部审核吗?"
|
||||
this.reason = auditType === "pass" ? "同意" : "拒绝"
|
||||
this.auditShow = true
|
||||
},
|
||||
async openView(id, modulename) {
|
||||
this.queryType = 'notAudit'
|
||||
this.queryType = "notAudit"
|
||||
this.userList = []
|
||||
const resp = await $.post('/mobile/activity/site/audit/getLeaveUser', {
|
||||
const resp = await $.post("/mobile/activity/site/audit/getLeaveUser", {
|
||||
siteId: id,
|
||||
moduleName: modulename,
|
||||
auditType: 'canAudit',
|
||||
auditType: "canAudit"
|
||||
})
|
||||
if (resp.code === 0) {
|
||||
this.userList = resp.data
|
||||
this.userClickList = []
|
||||
if (this.userList.length === 0) {
|
||||
vant.Toast('暂无预约数据')
|
||||
vant.Toast("暂无预约数据")
|
||||
} else {
|
||||
this.userShow = true
|
||||
}
|
||||
return
|
||||
}
|
||||
vant.Toast('系统错误,请联系管理员')
|
||||
vant.Toast("系统错误,请联系管理员")
|
||||
},
|
||||
popClose() {
|
||||
this.$nextTick(function () {
|
||||
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() {
|
||||
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) {
|
||||
this.tableData = this.tableData.concat(res.data.list)
|
||||
if (this.tableData.length === res.data.totalCount) {
|
||||
@@ -532,11 +533,11 @@ layout("/mobile/platform.html"){
|
||||
}
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.typeList = await siteTypeUtil.getAllType()
|
||||
this.typeList.unshift({text: '全部场地类型'})
|
||||
this.typeList.unshift({ text: "全部场地类型" })
|
||||
if (this.typeList && this.typeList.length > 0) {
|
||||
this.$set(this.pageForm, "typeId", this.typeList[0].value)
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ layout("/mobile/platform.html"){
|
||||
#-->
|
||||
|
||||
<style>
|
||||
|
||||
.van-index-bar__sidebar {
|
||||
display: none;
|
||||
}
|
||||
@@ -174,46 +173,30 @@ layout("/mobile/platform.html"){
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
|
||||
<m-page-loading v-if="mLoading"></m-page-loading>
|
||||
|
||||
<!--top栏-->
|
||||
<van-nav-bar
|
||||
title="场地预约"
|
||||
left-arrow
|
||||
placeholder
|
||||
fixed
|
||||
@click-left="history.go(-1)"
|
||||
safe-area-inset-top
|
||||
></van-nav-bar>
|
||||
<van-nav-bar title="场地预约" left-arrow placeholder fixed @click-left="pjaxReplace('/mobile/index')" safe-area-inset-top></van-nav-bar>
|
||||
|
||||
<!--筛选框-->
|
||||
<div class="search-fixed">
|
||||
<van-search
|
||||
v-model="pageForm.searchKeyword"
|
||||
shape="round"
|
||||
maxlength="10"
|
||||
@search="doSearch"
|
||||
placeholder="请输入场地名称、场地地点进行查询"
|
||||
>
|
||||
</van-search>
|
||||
v-model="pageForm.searchKeyword"
|
||||
shape="round"
|
||||
maxlength="10"
|
||||
@search="doSearch"
|
||||
placeholder="请输入场地名称、场地地点进行查询"
|
||||
></van-search>
|
||||
<van-dropdown-menu>
|
||||
<van-dropdown-item v-model="pageForm.typeId" :options="typeList"
|
||||
@change="doSearch"></van-dropdown-item>
|
||||
<van-dropdown-item v-model="pageForm.typeId" :options="typeList" @change="doSearch"></van-dropdown-item>
|
||||
</van-dropdown-menu>
|
||||
</div>
|
||||
|
||||
<!--列表-->
|
||||
<div style="margin-top: 116px">
|
||||
<van-list
|
||||
v-model="loading"
|
||||
:finished="finished" :immediate-check="false"
|
||||
:finished-text="tableData.length>0?'没有更多了':''"
|
||||
@load="onLoad">
|
||||
|
||||
<van-list 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 @click="openView(o)">
|
||||
|
||||
<div style="display: flex; justify-content: space-between">
|
||||
<div style="width: 74%">
|
||||
<div class="van-ellipsis title">
|
||||
@@ -222,28 +205,31 @@ layout("/mobile/platform.html"){
|
||||
</div>
|
||||
<div style="color: grey">{{o.address}}</div>
|
||||
</div>
|
||||
<div style="color: #1867b0;">
|
||||
{{o.meetingtypename}}
|
||||
</div>
|
||||
<div style="color: #1867b0">{{o.meetingtypename}}</div>
|
||||
</div>
|
||||
|
||||
<van-divider></van-divider>
|
||||
|
||||
<div style="margin-top: 10px">
|
||||
<van-row>
|
||||
<van-col span="24"><span style="color: grey"> 联系人:</span>{{(o.unitname ? o.unitname :
|
||||
'') + ' ' + o.contact_person}}
|
||||
<van-col span="24">
|
||||
<span style="color: grey"> 联系人:</span>
|
||||
{{(o.unitname ? o.unitname : '') + ' ' + o.contact_person}}
|
||||
</van-col>
|
||||
</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-col span="24"><span style="color: grey">已预约人数:</span>{{o.count}}</van-col>
|
||||
</van-row>-->
|
||||
<van-row>
|
||||
<van-col span="24"><span style="color: grey">开放时间:</span><span
|
||||
v-if="o.workday === true">工作日</span>
|
||||
<van-col span="24">
|
||||
<span style="color: grey">开放时间:</span>
|
||||
<span v-if="o.workday === true">工作日</span>
|
||||
{{o.open_time}}
|
||||
</van-col>
|
||||
</van-row>
|
||||
@@ -251,18 +237,13 @@ layout("/mobile/platform.html"){
|
||||
</div>
|
||||
</div>
|
||||
</van-list>
|
||||
<van-empty
|
||||
v-if="mLoading==false&&tableData.length==0"
|
||||
class="custom-image"
|
||||
image="/none.svg"
|
||||
description="暂无数据"
|
||||
></van-empty>
|
||||
<van-empty v-if="mLoading==false&&tableData.length==0" class="custom-image" image="/none.svg" description="暂无数据"></van-empty>
|
||||
</div>
|
||||
|
||||
<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 style="padding-left: 30px;">
|
||||
<div style="padding-left: 30px">
|
||||
<p>1.使用对象:有哺乳需求的本校在职女教职工。</p>
|
||||
<p>2.开放时间:工作日8:00--17:30。</p>
|
||||
<p>3.使用制度:实行预约登记制。凡有哺乳需求的女教职工提前向校工会提出使用申请,经审核通过并开通权限后即可使用。</p>
|
||||
@@ -270,14 +251,14 @@ layout("/mobile/platform.html"){
|
||||
</div>
|
||||
|
||||
<div>二、管理人员</div>
|
||||
<div style="padding-left: 30px;">
|
||||
<div style="padding-left: 30px">
|
||||
<p>1.负责爱心母婴室使用登记管理。</p>
|
||||
<p>2.定期保养设备,确保正常使用。</p>
|
||||
<p>3.保持室内整洁、卫生安全,做好保洁消毒记录。</p>
|
||||
<p>4.定期收集意见和建议,不断改进服务。</p>
|
||||
</div>
|
||||
<div>三、使用人员</div>
|
||||
<div style="padding-left: 30px;">
|
||||
<div style="padding-left: 30px">
|
||||
<p>1.遵守学校安全管理制度和爱心母婴室管理规定。</p>
|
||||
<p>2.严禁吸烟,安全使用电器,爱护公物,损坏赔偿。</p>
|
||||
<p>3.保持室内卫生清洁,勿大声喧哗,不影响楼内工作秩序。</p>
|
||||
@@ -285,7 +266,7 @@ layout("/mobile/platform.html"){
|
||||
<p>5.不得擅自携他人入内,不做和哺乳无关事宜,使用完毕及时离开。</p>
|
||||
<p>6.欢迎在《爱心母婴室使用意见簿》上留下您宝贵的意见和建议。</p>
|
||||
</div>
|
||||
<br/>
|
||||
<br />
|
||||
<p>联系人:曾钰媛梦 84894774、15850692181</p>
|
||||
|
||||
<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"){} #-->
|
||||
const siteTypeUtil = new typeUtil()
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
el: "#app",
|
||||
mixins: [mobileMixins],
|
||||
data() {
|
||||
return {
|
||||
list: ['a', 'b'],
|
||||
list: ["a", "b"],
|
||||
typeList: [],
|
||||
show: false,
|
||||
siteId: '',
|
||||
siteId: ""
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
openView(o) {
|
||||
this.siteId = o.id
|
||||
if (o.sexlimit === 1 || o.sexlimit === 2) {
|
||||
const sex = o.sexlimit === 1 ? '男' : '女'
|
||||
const sex = o.sexlimit === 1 ? "男" : "女"
|
||||
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 {
|
||||
vant.Toast('抱歉,该场地仅限' + sex + '性会员预约')
|
||||
vant.Toast("抱歉,该场地仅限" + sex + "性会员预约")
|
||||
}
|
||||
} else {
|
||||
location.href = '/mobile/activity/site/info/reserve?id=' + o.id
|
||||
location.href = "/mobile/activity/site/info/reserve?id=" + o.id
|
||||
}
|
||||
},
|
||||
toReserve() {
|
||||
location.href = '/mobile/activity/site/info/reserve?id=' + this.siteId
|
||||
location.href = "/mobile/activity/site/info/reserve?id=" + this.siteId
|
||||
this.show = false
|
||||
},
|
||||
doSearch() {
|
||||
@@ -332,7 +313,7 @@ layout("/mobile/platform.html"){
|
||||
},
|
||||
async onLoad() {
|
||||
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) {
|
||||
this.tableData = this.tableData.concat(res.data.list)
|
||||
if (this.tableData.length === res.data.totalCount) {
|
||||
@@ -343,11 +324,11 @@ layout("/mobile/platform.html"){
|
||||
}
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.typeList = await siteTypeUtil.getAllType()
|
||||
this.typeList.unshift({text: '全部场地类型'})
|
||||
this.typeList.unshift({ text: "全部场地类型" })
|
||||
if (this.typeList && this.typeList.length > 0) {
|
||||
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">
|
||||
<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>
|
||||
<site_h5_info :id="id"></site_h5_info>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
el: "#app",
|
||||
mixins: [mobileMixins],
|
||||
components: {
|
||||
'site_h5_info': httpVueLoader('/components/activity/site/SiteH5Info.vue')
|
||||
site_h5_info: httpVueLoader("/components/activity/site/SiteH5Info.vue")
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -21,9 +20,7 @@ layout("/mobile/platform.html"){
|
||||
}
|
||||
},
|
||||
methods: {},
|
||||
created() {
|
||||
|
||||
}
|
||||
created() {}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
@@ -43,11 +43,9 @@ layout("/mobile/platform.html"){
|
||||
}
|
||||
|
||||
.cell .title {
|
||||
|
||||
}
|
||||
|
||||
.cell .content {
|
||||
|
||||
}
|
||||
|
||||
.extra {
|
||||
@@ -56,38 +54,28 @@ layout("/mobile/platform.html"){
|
||||
justify-content: flex-end;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<div>
|
||||
<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">
|
||||
<van-search
|
||||
v-model="pageForm.searchKeyword"
|
||||
shape="round"
|
||||
maxlength="10"
|
||||
@search="doSearch"
|
||||
placeholder="请输入场地名称进行查询"
|
||||
>
|
||||
</van-search>
|
||||
v-model="pageForm.searchKeyword"
|
||||
shape="round"
|
||||
maxlength="10"
|
||||
@search="doSearch"
|
||||
placeholder="请输入场地名称进行查询"
|
||||
></van-search>
|
||||
</div>
|
||||
|
||||
<div class="table-list">
|
||||
<van-list v-model="loading"
|
||||
:finished="finished"
|
||||
:finished-text="tableData.length>0?'没有更多了':''"
|
||||
@load="pageData">
|
||||
<van-list v-model="loading" :finished="finished" :finished-text="tableData.length>0?'没有更多了':''" @load="pageData">
|
||||
<div v-for="item in tableData" :key="item.id" class="table-item">
|
||||
<div>
|
||||
<div class="header-title">
|
||||
{{item.reserve_cause}}
|
||||
</div>
|
||||
<van-tag class="header-title-extra" :type="tagType(item.reserve_state)">
|
||||
{{item.state_name}}
|
||||
</van-tag>
|
||||
<div class="header-title">{{item.reserve_cause}}</div>
|
||||
<van-tag class="header-title-extra" :type="tagType(item.reserve_state)">{{item.state_name}}</van-tag>
|
||||
|
||||
<div class="cell">
|
||||
<div class="title">预约场地:</div>
|
||||
@@ -119,9 +107,7 @@ layout("/mobile/platform.html"){
|
||||
</div>
|
||||
<div class="extra">
|
||||
<van-button size="small" type="info" @click="openView(item.id)">查看详情</van-button>
|
||||
<van-button size="small" type="danger" @click="revoke(item)"
|
||||
v-if="item.reserve_state===6098">撤销预约
|
||||
</van-button>
|
||||
<van-button size="small" type="danger" @click="revoke(item)" v-if="item.reserve_state===6098">撤销预约</van-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -132,56 +118,54 @@ layout("/mobile/platform.html"){
|
||||
|
||||
<script>
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
el: "#app",
|
||||
mixins: [mobileMixins],
|
||||
data() {
|
||||
return {
|
||||
tableData: [],
|
||||
pageDataUrl: '/platform/activity/site/reserve/pageData'
|
||||
pageDataUrl: "/platform/activity/site/reserve/pageData"
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
tagType() {
|
||||
return (reserveState) => {
|
||||
if (reserveState === 6138) {
|
||||
return 'success';
|
||||
return "success"
|
||||
} else if ([6108, 6128].includes(reserveState)) {
|
||||
return 'danger';
|
||||
return "danger"
|
||||
}
|
||||
return 'primary';
|
||||
};
|
||||
},
|
||||
return "primary"
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async revoke(item) {
|
||||
const {id, site_name, reserve_start_time, reserve_end_time} = item
|
||||
this.$dialog.confirm({
|
||||
title: '提示',
|
||||
message: '您确定要撤销' + site_name + '\n' + reserve_start_time + "\n至\n" + reserve_end_time + '\n的预约吗?',
|
||||
}).then(async () => {
|
||||
const loading = this.$toast.loading({
|
||||
message: '提交中...',
|
||||
forbidClick: true,
|
||||
});
|
||||
const { id, site_name, reserve_start_time, reserve_end_time } = item
|
||||
this.$dialog
|
||||
.confirm({
|
||||
title: "提示",
|
||||
message: "您确定要撤销" + site_name + "\n" + reserve_start_time + "\n至\n" + reserve_end_time + "\n的预约吗?"
|
||||
})
|
||||
.then(async () => {
|
||||
const loading = this.$toast.loading({
|
||||
message: "提交中...",
|
||||
forbidClick: true
|
||||
})
|
||||
|
||||
const {
|
||||
code,
|
||||
msg
|
||||
} = await $.post('/platform/activity/site/apply/revoke', {id})
|
||||
loading.clear()
|
||||
if (code === 0) {
|
||||
this.doSearch()
|
||||
this.$toast.success(msg)
|
||||
} else {
|
||||
this.$toast.fail(msg)
|
||||
}
|
||||
}).catch(() => {
|
||||
})
|
||||
const { code, msg } = await $.post("/platform/activity/site/apply/revoke", { id })
|
||||
loading.clear()
|
||||
if (code === 0) {
|
||||
this.doSearch()
|
||||
this.$toast.success(msg)
|
||||
} else {
|
||||
this.$toast.fail(msg)
|
||||
}
|
||||
})
|
||||
.catch(() => {})
|
||||
},
|
||||
openView(id) {
|
||||
window.location.href = loc() + '/detail?id=' + id
|
||||
window.location.href = loc() + "/detail?id=" + id
|
||||
}
|
||||
|
||||
},
|
||||
created() {
|
||||
// this.pageData()
|
||||
@@ -191,4 +175,4 @@ layout("/mobile/platform.html"){
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
#-->
|
||||
|
||||
@@ -3,7 +3,6 @@ layout("/mobile/platform.html"){
|
||||
#-->
|
||||
|
||||
<style>
|
||||
|
||||
.van-index-bar__sidebar {
|
||||
display: none;
|
||||
}
|
||||
@@ -162,29 +161,20 @@ layout("/mobile/platform.html"){
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
|
||||
<m-page-loading v-if="mLoading"></m-page-loading>
|
||||
|
||||
<!--top栏-->
|
||||
<van-nav-bar
|
||||
title="我的预约"
|
||||
left-arrow
|
||||
placeholder
|
||||
fixed
|
||||
@click-left="history.go(-1)"
|
||||
safe-area-inset-top
|
||||
></van-nav-bar>
|
||||
<van-nav-bar title="我的预约" left-arrow placeholder fixed @click-left="pjaxReplace('/mobile/index')" safe-area-inset-top></van-nav-bar>
|
||||
|
||||
<!--筛选框-->
|
||||
<div class="search-fixed">
|
||||
<van-search
|
||||
v-model="pageForm.searchKeyword"
|
||||
shape="round"
|
||||
maxlength="10"
|
||||
@search="doSearch"
|
||||
placeholder="请输入场地名称、场地地点进行查询"
|
||||
>
|
||||
</van-search>
|
||||
v-model="pageForm.searchKeyword"
|
||||
shape="round"
|
||||
maxlength="10"
|
||||
@search="doSearch"
|
||||
placeholder="请输入场地名称、场地地点进行查询"
|
||||
></van-search>
|
||||
<van-dropdown-menu>
|
||||
<van-dropdown-item :title="pageForm.time" ref="item" @open="">
|
||||
<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>
|
||||
</template>
|
||||
</van-cell>
|
||||
<van-datetime-picker v-show="pageForm.timeSwitch === false"
|
||||
v-model="time" cancel-button-text=" " confirm-button-text=" "
|
||||
type="year-month"
|
||||
title="选择年月"
|
||||
:formatter="timeFormatter"
|
||||
<van-datetime-picker
|
||||
v-show="pageForm.timeSwitch === false"
|
||||
v-model="time"
|
||||
cancel-button-text=" "
|
||||
confirm-button-text=" "
|
||||
type="year-month"
|
||||
title="选择年月"
|
||||
:formatter="timeFormatter"
|
||||
></van-datetime-picker>
|
||||
<div style="padding: 5px 16px;margin-top: 6px">
|
||||
<van-button type="danger" color="#246fb4" block round @click="onConfirm" style="height: 36px">
|
||||
确认
|
||||
</van-button>
|
||||
<div style="padding: 5px 16px; margin-top: 6px">
|
||||
<van-button type="danger" color="#246fb4" block round @click="onConfirm" style="height: 36px">确认</van-button>
|
||||
</div>
|
||||
</van-dropdown-item>
|
||||
<van-dropdown-item v-model="pageForm.typeId" :options="typeList"
|
||||
@change="doSearch"></van-dropdown-item>
|
||||
<van-dropdown-item v-model="pageForm.typeId" :options="typeList" @change="doSearch"></van-dropdown-item>
|
||||
</van-dropdown-menu>
|
||||
</div>
|
||||
|
||||
<!--列表-->
|
||||
<div style="margin-top: 116px">
|
||||
<van-list
|
||||
v-model="loading"
|
||||
:finished="finished" :immediate-check="false"
|
||||
:finished-text="tableData.length>0?'没有更多了':''"
|
||||
@load="onLoad">
|
||||
|
||||
<van-list 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 @click="openView(o.id, o.modulename)">
|
||||
|
||||
<div style="display: flex; justify-content: space-between">
|
||||
<div style="width: 74%">
|
||||
<div class="van-ellipsis title">
|
||||
@@ -228,9 +212,7 @@ layout("/mobile/platform.html"){
|
||||
</div>
|
||||
<div style="color: grey">{{o.address}}</div>
|
||||
</div>
|
||||
<div style="color: #1867b0;">
|
||||
{{o.meetingtypename}}
|
||||
</div>
|
||||
<div style="color: #1867b0">{{o.meetingtypename}}</div>
|
||||
</div>
|
||||
|
||||
<van-divider></van-divider>
|
||||
@@ -253,8 +235,7 @@ layout("/mobile/platform.html"){
|
||||
<van-row>
|
||||
<van-col span="24">
|
||||
<span style="color: grey">审核状态:</span>
|
||||
<span v-if="[0].includes(o.stateaudittype)"
|
||||
style="color: #e6a23c">{{o.statename}}</span>
|
||||
<span v-if="[0].includes(o.stateaudittype)" style="color: #e6a23c">{{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>
|
||||
</van-col>
|
||||
@@ -269,38 +250,44 @@ layout("/mobile/platform.html"){
|
||||
|
||||
<div style="display: flex; justify-content: flex-end; margin-top: 4px">
|
||||
<div>
|
||||
<van-button @click.stop="rollback(o)" class="cus_button"
|
||||
type="primary" size="small" color="#1867b0"
|
||||
style="margin-right: 8px; width: auto;">撤销预约
|
||||
<van-button
|
||||
@click.stop="rollback(o)"
|
||||
class="cus_button"
|
||||
type="primary"
|
||||
size="small"
|
||||
color="#1867b0"
|
||||
style="margin-right: 8px; width: auto"
|
||||
>
|
||||
撤销预约
|
||||
</van-button>
|
||||
<van-button @click.stop="backOption(o)" class="cus_button"
|
||||
type="primary" size="small" color="#1867b0"
|
||||
style="margin-right: 8px; width: auto;">反馈意见
|
||||
<van-button
|
||||
@click.stop="backOption(o)"
|
||||
class="cus_button"
|
||||
type="primary"
|
||||
size="small"
|
||||
color="#1867b0"
|
||||
style="margin-right: 8px; width: auto"
|
||||
>
|
||||
反馈意见
|
||||
</van-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</van-list>
|
||||
<van-empty
|
||||
v-if="mLoading==false&&tableData.length==0"
|
||||
class="custom-image"
|
||||
image="/none.svg"
|
||||
description="暂无数据"
|
||||
></van-empty>
|
||||
<van-empty v-if="mLoading==false&&tableData.length==0" class="custom-image" image="/none.svg" description="暂无数据"></van-empty>
|
||||
</div>
|
||||
|
||||
|
||||
<van-dialog v-model="show" title="反馈意见" show-cancel-button @confirm="backDo">
|
||||
<van-field
|
||||
v-model="option"
|
||||
rows="4"
|
||||
label="反馈意见:"
|
||||
autosize
|
||||
type="textarea"
|
||||
maxlength="50"
|
||||
placeholder="请输入反馈意见"
|
||||
show-word-limit
|
||||
v-model="option"
|
||||
rows="4"
|
||||
label="反馈意见:"
|
||||
autosize
|
||||
type="textarea"
|
||||
maxlength="50"
|
||||
placeholder="请输入反馈意见"
|
||||
show-word-limit
|
||||
></van-field>
|
||||
</van-dialog>
|
||||
</div>
|
||||
@@ -309,74 +296,77 @@ layout("/mobile/platform.html"){
|
||||
<!--# include("/platform/activity/includeJs/activityUtil.js"){} #-->
|
||||
const siteTypeUtil = new typeUtil()
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
el: "#app",
|
||||
mixins: [mobileMixins],
|
||||
data() {
|
||||
return {
|
||||
time: new Date(),
|
||||
option: '',
|
||||
option: "",
|
||||
show: false,
|
||||
list: ['a', 'b'],
|
||||
list: ["a", "b"],
|
||||
typeList: [],
|
||||
timeList: [],
|
||||
info: {},
|
||||
info: {}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onConfirm() {
|
||||
if (this.pageForm.timeSwitch === true) {
|
||||
this.timeList = [{text: '全部', value: '全部'}]
|
||||
this.timeList = [{ text: "全部", value: "全部" }]
|
||||
} else {
|
||||
this.timeList = [{
|
||||
text: moment(this.time).format('YYYY-MM'),
|
||||
value: moment(this.time).format('YYYY-MM')
|
||||
}]
|
||||
this.timeList = [
|
||||
{
|
||||
text: moment(this.time).format("YYYY-MM"),
|
||||
value: moment(this.time).format("YYYY-MM")
|
||||
}
|
||||
]
|
||||
}
|
||||
this.$set(this.pageForm, "time", this.timeList[0].value)
|
||||
this.$refs.item.toggle()
|
||||
this.doSearch()
|
||||
},
|
||||
timeFormatter(type, val) {
|
||||
if (type === 'year') {
|
||||
return val + `年`;
|
||||
if (type === "year") {
|
||||
return val + `年`
|
||||
}
|
||||
if (type === 'month') {
|
||||
return val + `月`;
|
||||
if (type === "month") {
|
||||
return val + `月`
|
||||
}
|
||||
return val;
|
||||
return val
|
||||
},
|
||||
async rollback(o) {
|
||||
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) {
|
||||
vant.Toast('此预约状态下不能进行撤回操作!')
|
||||
vant.Toast("此预约状态下不能进行撤回操作!")
|
||||
return
|
||||
}
|
||||
vant.Dialog.confirm({
|
||||
title: '温馨提示',
|
||||
message: '您是否要撤销此预约?',
|
||||
}).then(async () => {
|
||||
const resp = await $.post('/mobile/activity/site/info/rollback', {
|
||||
id: o.id
|
||||
title: "温馨提示",
|
||||
message: "您是否要撤销此预约?"
|
||||
})
|
||||
.then(async () => {
|
||||
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)
|
||||
if (resp.code === 0) {
|
||||
self.doSearch()
|
||||
}
|
||||
}).catch(() => {
|
||||
});
|
||||
.catch(() => {})
|
||||
},
|
||||
backOption(o) {
|
||||
this.info = o
|
||||
this.option = ''
|
||||
this.option = ""
|
||||
this.show = true
|
||||
},
|
||||
async backDo() {
|
||||
if (this.option === '') {
|
||||
vant.Toast('请填写反馈意见')
|
||||
if (this.option === "") {
|
||||
vant.Toast("请填写反馈意见")
|
||||
return
|
||||
}
|
||||
const res = await $.post('/mobile/activity/site/info/backOption', {
|
||||
const res = await $.post("/mobile/activity/site/info/backOption", {
|
||||
id: this.info.id,
|
||||
option: this.option
|
||||
})
|
||||
@@ -384,13 +374,13 @@ layout("/mobile/platform.html"){
|
||||
this.doSearch()
|
||||
vant.Toast(res.msg)
|
||||
} else {
|
||||
vant.Toast('操作失败')
|
||||
vant.Toast("操作失败")
|
||||
}
|
||||
},
|
||||
getTime(o, day) {
|
||||
const week = new Date(day).getDay()
|
||||
const arr = ['日', '一', '二', '三', '四', '五', '六']
|
||||
return moment(day).format('MM月DD日') + ' 周' + arr[week] + ' ' + o.start_time + '-' + o.end_time
|
||||
const arr = ["日", "一", "二", "三", "四", "五", "六"]
|
||||
return moment(day).format("MM月DD日") + " 周" + arr[week] + " " + o.start_time + "-" + o.end_time
|
||||
},
|
||||
doSearch() {
|
||||
this.pageForm.pageNumber = 1
|
||||
@@ -400,7 +390,7 @@ layout("/mobile/platform.html"){
|
||||
},
|
||||
async onLoad() {
|
||||
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) {
|
||||
this.tableData = this.tableData.concat(res.data.list)
|
||||
if (this.tableData.length === res.data.totalCount) {
|
||||
@@ -411,16 +401,16 @@ layout("/mobile/platform.html"){
|
||||
}
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.typeList = await siteTypeUtil.getAllType()
|
||||
this.typeList.unshift({text: '全部场地类型'})
|
||||
this.typeList.unshift({ text: "全部场地类型" })
|
||||
if (this.typeList && this.typeList.length > 0) {
|
||||
this.$set(this.pageForm, "typeId", this.typeList[0].value)
|
||||
}
|
||||
//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, "timeSwitch", true)
|
||||
this.onLoad()
|
||||
@@ -430,4 +420,4 @@ layout("/mobile/platform.html"){
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
#-->
|
||||
|
||||
@@ -60,7 +60,6 @@ layout("/mobile/platform.html"){
|
||||
color: grey;
|
||||
}
|
||||
|
||||
|
||||
.top-calendar {
|
||||
height: 70px;
|
||||
max-height: 70px;
|
||||
@@ -89,7 +88,7 @@ layout("/mobile/platform.html"){
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
color: #FFF;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.left-day-active {
|
||||
@@ -97,7 +96,6 @@ layout("/mobile/platform.html"){
|
||||
}
|
||||
|
||||
.day-info-month {
|
||||
|
||||
}
|
||||
|
||||
.day-info-week {
|
||||
@@ -126,36 +124,33 @@ layout("/mobile/platform.html"){
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
|
||||
<!--top栏-->
|
||||
<van-nav-bar
|
||||
:title="site.name"
|
||||
left-arrow
|
||||
placeholder
|
||||
fixed
|
||||
@click-left="history.go(-1)"
|
||||
safe-area-inset-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>
|
||||
|
||||
<div class="top-calendar">
|
||||
<div class="calendar-left">
|
||||
<div class="calendar-left-day" :class="moment(item).unix() == selectDate.unix() ? 'left-day-active':''"
|
||||
@click="dayClick(item)"
|
||||
v-for="item in weekList">
|
||||
<div class="day-info-week">
|
||||
{{getWeekTextByDate(item)}}
|
||||
</div>
|
||||
<div class="day-info-month">
|
||||
{{moment(item).format('MM-DD')}}
|
||||
</div>
|
||||
<div
|
||||
class="calendar-left-day"
|
||||
:class="moment(item).unix() == selectDate.unix() ? 'left-day-active':''"
|
||||
@click="dayClick(item)"
|
||||
v-for="item in weekList"
|
||||
>
|
||||
<div class="day-info-week">{{getWeekTextByDate(item)}}</div>
|
||||
<div class="day-info-month">{{moment(item).format('MM-DD')}}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="calendar-right">
|
||||
<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"
|
||||
:default-date="selectDate.toDate()"
|
||||
:formatter="calendarFormatter"
|
||||
title="选择开始日期"></van-calendar>
|
||||
<van-calendar
|
||||
class="top_pop"
|
||||
v-model="calendarVisible"
|
||||
color="#246fb4"
|
||||
position="top"
|
||||
@confirm="onConfirm"
|
||||
:default-date="selectDate.toDate()"
|
||||
:formatter="calendarFormatter"
|
||||
title="选择开始日期"
|
||||
></van-calendar>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -165,21 +160,20 @@ layout("/mobile/platform.html"){
|
||||
<td class="time">{{item.start_time + '-' + item.end_time}}</td>
|
||||
|
||||
<td>
|
||||
<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 @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>
|
||||
<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 @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 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>
|
||||
</div>
|
||||
<div v-if="isCanRe(item) === 0" class="state">已过期</div>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
@@ -197,82 +191,90 @@ layout("/mobile/platform.html"){
|
||||
<van-cell title="联系电话">{{phone}}</van-cell>
|
||||
<van-cell title="预约时间">
|
||||
<div v-for="time in times">
|
||||
<van-tag closeable size="medium" type="primary" @close="close(time.fullDay)">
|
||||
{{time.fullDay}}
|
||||
</van-tag>
|
||||
<van-tag closeable size="medium" type="primary" @close="close(time.fullDay)">{{time.fullDay}}</van-tag>
|
||||
</div>
|
||||
</van-cell>
|
||||
<van-cell title="预约地点">{{site.name}}</van-cell>
|
||||
|
||||
<van-field
|
||||
v-model="message"
|
||||
rows="1"
|
||||
autosize
|
||||
label="预约事由"
|
||||
type="textarea"
|
||||
maxlength="50"
|
||||
required
|
||||
placeholder="请输入预约事由"
|
||||
show-word-limit
|
||||
:rules="[{required:true,message:'请填写预约事由'}]"
|
||||
v-model="message"
|
||||
rows="1"
|
||||
autosize
|
||||
label="预约事由"
|
||||
type="textarea"
|
||||
maxlength="50"
|
||||
required
|
||||
placeholder="请输入预约事由"
|
||||
show-word-limit
|
||||
:rules="[{required:true,message:'请填写预约事由'}]"
|
||||
></van-field>
|
||||
|
||||
<van-field
|
||||
v-model="joinUser"
|
||||
rows="2"
|
||||
autosize
|
||||
label="参加人员"
|
||||
type="textarea"
|
||||
maxlength="50"
|
||||
placeholder="请输入参加人员"
|
||||
show-word-limit
|
||||
v-model="joinUser"
|
||||
rows="2"
|
||||
autosize
|
||||
label="参加人员"
|
||||
type="textarea"
|
||||
maxlength="50"
|
||||
placeholder="请输入参加人员"
|
||||
show-word-limit
|
||||
></van-field>
|
||||
</van-form>
|
||||
|
||||
|
||||
<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>
|
||||
<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="reserveDo" color="#246fb4" style="width: 47%" size="small" type="info">确认</van-button>
|
||||
</div>
|
||||
</van-action-sheet>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
moment.locale('zh_cn');
|
||||
moment.locale("zh_cn")
|
||||
|
||||
function getQueryString(name) {
|
||||
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
|
||||
var r = window.location.search.substr(1).match(reg);
|
||||
if (r != null) return decodeURI(r[2]);
|
||||
return null;
|
||||
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i")
|
||||
var r = window.location.search.substr(1).match(reg)
|
||||
if (r != null) return decodeURI(r[2])
|
||||
return null
|
||||
}
|
||||
|
||||
<!--# include("/platform/activity/includeJs/activityUtil.js"){} #-->
|
||||
const siteTypeUtil = new typeUtil()
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
el: "#app",
|
||||
mixins: [mobileMixins],
|
||||
data() {
|
||||
return {
|
||||
person: "${@shiro.getPrincipalProperty('username')}",
|
||||
unit: "${@shiro.getPrincipalProperty('unit').getName()}",
|
||||
phone: "${@shiro.getPrincipalProperty('mobile')}",
|
||||
message: '',
|
||||
message: "",
|
||||
show: false,
|
||||
site_id: '',
|
||||
site_id: "",
|
||||
site: {},
|
||||
timeData: [],
|
||||
times: [],
|
||||
weekList: [],
|
||||
joinUser: '',
|
||||
joinUser: "",
|
||||
calendarVisible: false,
|
||||
selectDate: null,
|
||||
//已经预约的记录
|
||||
alreadyReserveRecord: [],
|
||||
holidays: ['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',],
|
||||
holidays: [
|
||||
"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: {
|
||||
@@ -281,19 +283,19 @@ layout("/mobile/platform.html"){
|
||||
const weekNum = moment(date).day()
|
||||
switch (weekNum) {
|
||||
case 0:
|
||||
return '周日'
|
||||
return "周日"
|
||||
case 1:
|
||||
return '周一'
|
||||
return "周一"
|
||||
case 2:
|
||||
return '周二'
|
||||
return "周二"
|
||||
case 3:
|
||||
return '周三'
|
||||
return "周三"
|
||||
case 4:
|
||||
return '周四'
|
||||
return "周四"
|
||||
case 5:
|
||||
return '周五'
|
||||
return "周五"
|
||||
case 6:
|
||||
return '周六'
|
||||
return "周六"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -303,7 +305,7 @@ layout("/mobile/platform.html"){
|
||||
if (this.site.workday === true) {
|
||||
let week = day.date.getDay()
|
||||
if (week === 0 || week === 6) {
|
||||
day.type = 'disabled'
|
||||
day.type = "disabled"
|
||||
}
|
||||
}
|
||||
return day
|
||||
@@ -313,10 +315,10 @@ layout("/mobile/platform.html"){
|
||||
methods: {
|
||||
close(f) {
|
||||
if (this.times.length === 1) {
|
||||
vant.Toast('必须保留一个时间段')
|
||||
vant.Toast("必须保留一个时间段")
|
||||
return
|
||||
}
|
||||
const index = this.times.findIndex(v => v.fullDay === f)
|
||||
const index = this.times.findIndex((v) => v.fullDay === f)
|
||||
this.times.splice(index, 1)
|
||||
},
|
||||
onConfirm(date) {
|
||||
@@ -330,9 +332,9 @@ layout("/mobile/platform.html"){
|
||||
wk.push(moment(startDate))
|
||||
let count = 1
|
||||
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)
|
||||
}
|
||||
count++
|
||||
@@ -345,7 +347,7 @@ layout("/mobile/platform.html"){
|
||||
},
|
||||
reserve() {
|
||||
if (this.times.length === 0) {
|
||||
vant.Toast('请选择要预约的时段')
|
||||
vant.Toast("请选择要预约的时段")
|
||||
return
|
||||
}
|
||||
this.show = true
|
||||
@@ -373,27 +375,27 @@ layout("/mobile/platform.html"){
|
||||
},
|
||||
chooseTime(item) {
|
||||
const cloneItem = clone(item)
|
||||
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 map = this.times.map((o) => o.fullDay)
|
||||
const index = map.indexOf(this.selectDate.format("YYYY-MM-DD") + " " + cloneItem.start_time + "-" + cloneItem.end_time)
|
||||
if (index > -1) {
|
||||
this.times.splice(index, 1)
|
||||
} else {
|
||||
cloneItem.day = this.selectDate.format('YYYY-MM-DD')
|
||||
cloneItem.fullDay = cloneItem.day + ' ' + cloneItem.start_time + '-' + cloneItem.end_time
|
||||
cloneItem.day = this.selectDate.format("YYYY-MM-DD")
|
||||
cloneItem.fullDay = cloneItem.day + " " + cloneItem.start_time + "-" + cloneItem.end_time
|
||||
this.times.push(cloneItem)
|
||||
}
|
||||
},
|
||||
isCanRe(item) {
|
||||
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)) {
|
||||
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
|
||||
} else {
|
||||
if (this.site.multiple) {
|
||||
@@ -406,7 +408,7 @@ layout("/mobile/platform.html"){
|
||||
|
||||
async onLoad() {
|
||||
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) {
|
||||
this.site = res.data
|
||||
}
|
||||
@@ -414,23 +416,23 @@ layout("/mobile/platform.html"){
|
||||
})
|
||||
},
|
||||
async getReserve() {
|
||||
const resp = await $.post('/mobile/activity/site/info/getReserve', {
|
||||
const resp = await $.post("/mobile/activity/site/info/getReserve", {
|
||||
siteId: this.site_id,
|
||||
day: moment(this.selectDate).format('YYYY-MM-DD'),
|
||||
day: moment(this.selectDate).format("YYYY-MM-DD")
|
||||
})
|
||||
if (resp.code === 0) {
|
||||
resp.data.forEach(item => {
|
||||
resp.data.forEach((item) => {
|
||||
item.isClick = true
|
||||
})
|
||||
this.timeData = resp.data
|
||||
}
|
||||
},
|
||||
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
|
||||
})
|
||||
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
|
||||
if (weekNum === 0) {
|
||||
//周日
|
||||
selectDate = moment().add(1, 'd')
|
||||
selectDate = moment().add(1, "d")
|
||||
} else if (weekNum === 6) {
|
||||
//周六
|
||||
selectDate = moment().add(2, 'd')
|
||||
selectDate = moment().add(2, "d")
|
||||
} else {
|
||||
selectDate = moment()
|
||||
}
|
||||
@@ -451,13 +453,12 @@ layout("/mobile/platform.html"){
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.site_id = getQueryString('id')
|
||||
this.site_id = getQueryString("id")
|
||||
this.selectDate = this.getLatestWorkDay()
|
||||
this.setWeekList(this.selectDate)
|
||||
await this.getReserve()
|
||||
await this.onLoad()
|
||||
await this.getMyReservation()
|
||||
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -3,57 +3,47 @@ layout("/mobile/platform.html"){
|
||||
#-->
|
||||
|
||||
<div id="app">
|
||||
<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>
|
||||
|
||||
<site_h5_info :id="id">
|
||||
<template #audit>
|
||||
<div class="van-cell-group__title mt10">
|
||||
<div class="van-sidebar-item van-sidebar-item--select">
|
||||
离退休工作处审核
|
||||
</div>
|
||||
<div class="van-sidebar-item van-sidebar-item--select">离退休工作处审核</div>
|
||||
</div>
|
||||
<van-form>
|
||||
<van-field readonly
|
||||
value="${@shiro.getPrincipalProperty('username')}"
|
||||
name="username"
|
||||
label="审核人员"
|
||||
<van-field readonly value="${@shiro.getPrincipalProperty('username')}" name="username" label="审核人员"></van-field>
|
||||
|
||||
<van-field :value="moment().format('YYYY-MM-DD')" label="审核时间" readonly></van-field>
|
||||
|
||||
<van-field
|
||||
v-model="formData.auditOpinion"
|
||||
rows="1"
|
||||
required
|
||||
autosize
|
||||
label="审核意见"
|
||||
type="textarea"
|
||||
placeholder="请输入审核意见"
|
||||
></van-field>
|
||||
|
||||
<van-field :value="moment().format('YYYY-MM-DD')"
|
||||
label="审核时间"
|
||||
readonly></van-field>
|
||||
<!-- <van-field label="签字" required style="flex-flow: column">-->
|
||||
<!-- <template #label>-->
|
||||
<!-- <div class="mb10">签  字</div>-->
|
||||
<!-- </template>-->
|
||||
<!-- <template #input>-->
|
||||
<!-- <mobile-sign ref="signature" :my_sign.sync="formData.auditSign"></mobile-sign>-->
|
||||
<!-- </template>-->
|
||||
<!-- </van-field>-->
|
||||
|
||||
<van-field v-model="formData.auditOpinion"
|
||||
rows="1"
|
||||
required
|
||||
autosize
|
||||
label="审核意见"
|
||||
type="textarea"
|
||||
placeholder="请输入审核意见"
|
||||
></van-field>
|
||||
|
||||
<!-- <van-field label="签字" required style="flex-flow: column">-->
|
||||
<!-- <template #label>-->
|
||||
<!-- <div class="mb10">签  字</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-row gutter="20" style="margin-top: 30px; padding: 0 25px">
|
||||
<van-col span="12">
|
||||
<van-button :color="themeColor" plain block @click="doAudit(false)">拒 绝
|
||||
</van-button>
|
||||
<van-button :color="themeColor" plain block @click="doAudit(false)">拒 绝</van-button>
|
||||
</van-col>
|
||||
<!-- <van-col span="8">-->
|
||||
<!-- <van-button color="red" block plain @click="doAudit(2)">返回修改-->
|
||||
<!-- </van-button>-->
|
||||
<!-- </van-col>-->
|
||||
<van-col span="12">
|
||||
<van-button :color="themeColor" block @click="doAudit(true)">通 过
|
||||
</van-button>
|
||||
<van-button :color="themeColor" block @click="doAudit(true)">通 过</van-button>
|
||||
</van-col>
|
||||
</van-row>
|
||||
</van-form>
|
||||
@@ -63,11 +53,11 @@ layout("/mobile/platform.html"){
|
||||
|
||||
<script>
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
el: "#app",
|
||||
mixins: [mobileMixins],
|
||||
components: {
|
||||
'site_h5_info': httpVueLoader('/components/activity/site/SiteH5Info.vue'),
|
||||
'mobile-sign': httpVueLoader('/components/sign/mobileSign.vue'),
|
||||
site_h5_info: httpVueLoader("/components/activity/site/SiteH5Info.vue"),
|
||||
"mobile-sign": httpVueLoader("/components/sign/mobileSign.vue")
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -77,41 +67,40 @@ layout("/mobile/platform.html"){
|
||||
},
|
||||
methods: {
|
||||
async doAudit(pass) {
|
||||
if (this.formData.auditOpinion == null || this.formData.auditOpinion === '') {
|
||||
this.$toast('请填写审核意见')
|
||||
if (this.formData.auditOpinion == null || this.formData.auditOpinion === "") {
|
||||
this.$toast("请填写审核意见")
|
||||
return
|
||||
}
|
||||
|
||||
this.$dialog.confirm({
|
||||
title: '提示',
|
||||
message: '您确定要' + (pass ? '通过' : '拒绝') + '吗?',
|
||||
}).then(async () => {
|
||||
const loading = this.$toast.loading({
|
||||
message: '提交中...',
|
||||
forbidClick: true,
|
||||
this.$dialog
|
||||
.confirm({
|
||||
title: "提示",
|
||||
message: "您确定要" + (pass ? "通过" : "拒绝") + "吗?"
|
||||
})
|
||||
this.formData.auditPass = pass
|
||||
const {data, code, msg} = await $.post('/platform/activity/site/unionProcess/doProcess',
|
||||
{
|
||||
.then(async () => {
|
||||
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,
|
||||
audit: this.formData,
|
||||
});
|
||||
loading.clear()
|
||||
if (code === 0) {
|
||||
this.$toast.success(msg)
|
||||
setTimeout(() => {
|
||||
window.history.back()
|
||||
}, 500)
|
||||
} else {
|
||||
this.$toast.fail(msg)
|
||||
}
|
||||
}).catch(() => {
|
||||
})
|
||||
audit: this.formData
|
||||
})
|
||||
loading.clear()
|
||||
if (code === 0) {
|
||||
this.$toast.success(msg)
|
||||
setTimeout(() => {
|
||||
window.history.back()
|
||||
}, 500)
|
||||
} else {
|
||||
this.$toast.fail(msg)
|
||||
}
|
||||
})
|
||||
.catch(() => {})
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
||||
}
|
||||
created() {}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
@@ -46,11 +46,9 @@ layout("/mobile/platform.html"){
|
||||
}
|
||||
|
||||
.cell .title {
|
||||
|
||||
}
|
||||
|
||||
.cell .content {
|
||||
|
||||
}
|
||||
|
||||
.extra {
|
||||
@@ -63,45 +61,34 @@ layout("/mobile/platform.html"){
|
||||
.van-dropdown-menu__bar .van-dropdown-menu__item {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<div>
|
||||
<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">
|
||||
<van-dropdown-menu active-color="rgb(0, 78, 100)">
|
||||
<van-dropdown-item :title="pageForm.time" ref="dropItemYearMonth">
|
||||
<van-datetime-picker
|
||||
v-model="currentDate"
|
||||
type="year-month"
|
||||
:max-date="maxDate"
|
||||
title="选择年月"
|
||||
@confirm="onConfirmDate"
|
||||
@cancel="onCancelDate"
|
||||
v-model="currentDate"
|
||||
type="year-month"
|
||||
:max-date="maxDate"
|
||||
title="选择年月"
|
||||
@confirm="onConfirmDate"
|
||||
@cancel="onCancelDate"
|
||||
></van-datetime-picker>
|
||||
|
||||
</van-dropdown-item>
|
||||
<van-dropdown-item v-model="pageForm.isAudit" :options="auditOptions"
|
||||
@change="doSearch"></van-dropdown-item>
|
||||
<van-dropdown-item v-model="pageForm.isAudit" :options="auditOptions" @change="doSearch"></van-dropdown-item>
|
||||
</van-dropdown-menu>
|
||||
</div>
|
||||
|
||||
<div class="table-list">
|
||||
<van-list v-model="loading"
|
||||
:finished="finished"
|
||||
:finished-text="tableData.length>0?'没有更多了':''"
|
||||
@load="pageData">
|
||||
<van-list v-model="loading" :finished="finished" :finished-text="tableData.length>0?'没有更多了':''" @load="pageData">
|
||||
<div v-for="item in tableData" :key="item.id" class="table-item">
|
||||
<div>
|
||||
<div class="header-title">
|
||||
{{item.reserve_cause}}
|
||||
</div>
|
||||
<van-tag class="header-title-extra" :type="tagType(item.reserve_state)">
|
||||
{{item.state_name}}
|
||||
</van-tag>
|
||||
<div class="header-title">{{item.reserve_cause}}</div>
|
||||
<van-tag class="header-title-extra" :type="tagType(item.reserve_state)">{{item.state_name}}</van-tag>
|
||||
|
||||
<div class="cell">
|
||||
<div class="title">预约场地:</div>
|
||||
@@ -129,41 +116,36 @@ layout("/mobile/platform.html"){
|
||||
</div>
|
||||
<div class="extra">
|
||||
<van-button size="small" type="info" @click="openView(item.id)">查看详情</van-button>
|
||||
<van-button size="small" type="info" @click="openAudit(item.id)"
|
||||
v-if="item.reserve_state===6090">审核预约
|
||||
</van-button>
|
||||
<van-button size="small" type="info" @click="openAudit(item.id)" v-if="item.reserve_state===6090">审核预约</van-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</van-list>
|
||||
</div>
|
||||
|
||||
<van-empty v-if="tableData.length==0" class="custom-image"
|
||||
image="/none.svg"
|
||||
description="暂无数据">
|
||||
</van-empty>
|
||||
<van-empty v-if="tableData.length==0" class="custom-image" image="/none.svg" description="暂无数据"></van-empty>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
el: "#app",
|
||||
mixins: [mobileMixins],
|
||||
data() {
|
||||
return {
|
||||
tableData: [],
|
||||
pageForm: {
|
||||
isAudit: false,
|
||||
time: moment().format('YYYY-MM')
|
||||
time: moment().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,
|
||||
currentDate: new Date(),
|
||||
auditOptions: [
|
||||
{text: '全部', value: null},
|
||||
{text: '已审核', value: true},
|
||||
{text: '未审核', value: false},
|
||||
{ text: "全部", value: null },
|
||||
{ text: "已审核", value: true },
|
||||
{ text: "未审核", value: false }
|
||||
]
|
||||
}
|
||||
},
|
||||
@@ -171,45 +153,43 @@ layout("/mobile/platform.html"){
|
||||
tagType() {
|
||||
return (reserveState) => {
|
||||
if (reserveState === 6138) {
|
||||
return 'success';
|
||||
return "success"
|
||||
} else if ([6095, 6128].includes(reserveState)) {
|
||||
return 'danger';
|
||||
return "danger"
|
||||
}
|
||||
return 'primary';
|
||||
};
|
||||
},
|
||||
return "primary"
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async openAudit(id) {
|
||||
window.location.href = loc() + '/audit?id=' + id
|
||||
window.location.href = loc() + "/audit?id=" + id
|
||||
},
|
||||
openView(id) {
|
||||
window.location.href = '/mobile/activity/site/mine/detail?id=' + id
|
||||
window.location.href = "/mobile/activity/site/mine/detail?id=" + id
|
||||
},
|
||||
onCancelDate() {
|
||||
this.$refs.dropItemYearMonth.toggle();
|
||||
this.$refs.dropItemYearMonth.toggle()
|
||||
},
|
||||
onConfirmDate(val) {
|
||||
this.pageForm.time = moment(val).format('YYYY-MM')
|
||||
this.pageForm.time = moment(val).format("YYYY-MM")
|
||||
this.$refs.dropItemYearMonth.toggle()
|
||||
this.doSearch()
|
||||
}
|
||||
|
||||
},
|
||||
created() {
|
||||
let maxDate = new Date();
|
||||
maxDate.setMonth(maxDate.getMonth() + 1);
|
||||
let maxDate = new Date()
|
||||
maxDate.setMonth(maxDate.getMonth() + 1)
|
||||
this.maxDate = maxDate
|
||||
// this.pageData()
|
||||
}
|
||||
})
|
||||
|
||||
window.addEventListener('pageshow', e => {
|
||||
window.addEventListener("pageshow", (e) => {
|
||||
if (e.persisted || (window.performance && window.performance.navigation.type === 2)) {
|
||||
vue.doSearch()
|
||||
}
|
||||
})
|
||||
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
|
||||
@@ -3,58 +3,47 @@ layout("/mobile/platform.html"){
|
||||
#-->
|
||||
|
||||
<div id="app">
|
||||
<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>
|
||||
|
||||
<site_h5_info :id="id">
|
||||
<template #audit>
|
||||
<div class="van-cell-group__title mt10">
|
||||
<div class="van-sidebar-item van-sidebar-item--select">
|
||||
校工会审核
|
||||
</div>
|
||||
<div class="van-sidebar-item van-sidebar-item--select">校工会审核</div>
|
||||
</div>
|
||||
<van-form>
|
||||
<van-field readonly
|
||||
value="${@shiro.getPrincipalProperty('username')}"
|
||||
name="username"
|
||||
label="审核人员"
|
||||
<van-field readonly value="${@shiro.getPrincipalProperty('username')}" name="username" label="审核人员"></van-field>
|
||||
|
||||
<van-field :value="moment().format('YYYY-MM-DD')" label="审核时间" readonly></van-field>
|
||||
|
||||
<van-field
|
||||
v-model="formData.auditOpinion"
|
||||
rows="1"
|
||||
required
|
||||
autosize
|
||||
label="审核意见"
|
||||
type="textarea"
|
||||
placeholder="请输入审核意见"
|
||||
></van-field>
|
||||
|
||||
<van-field :value="moment().format('YYYY-MM-DD')"
|
||||
label="审核时间"
|
||||
readonly></van-field>
|
||||
<!-- <van-field label="签字" required style="flex-flow: column">-->
|
||||
<!-- <template #label>-->
|
||||
<!-- <div class="mb10">签  字</div>-->
|
||||
<!-- </template>-->
|
||||
<!-- <template #input>-->
|
||||
<!-- <mobile-sign ref="signature" :my_sign.sync="formData.auditSign"></mobile-sign>-->
|
||||
<!-- </template>-->
|
||||
<!-- </van-field>-->
|
||||
|
||||
<van-field v-model="formData.auditOpinion"
|
||||
rows="1"
|
||||
required
|
||||
autosize
|
||||
label="审核意见"
|
||||
type="textarea"
|
||||
placeholder="请输入审核意见"
|
||||
></van-field>
|
||||
|
||||
<!-- <van-field label="签字" required style="flex-flow: column">-->
|
||||
<!-- <template #label>-->
|
||||
<!-- <div class="mb10">签  字</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-row gutter="20" style="margin-top: 30px; padding: 0 25px">
|
||||
<van-col span="12">
|
||||
<van-button :color="themeColor" plain block @click="doAudit(false)">拒 绝
|
||||
</van-button>
|
||||
<van-button :color="themeColor" plain block @click="doAudit(false)">拒 绝</van-button>
|
||||
</van-col>
|
||||
<!-- <van-col span="8">-->
|
||||
<!-- <van-button color="red" block plain @click="doAudit(2)">返回修改-->
|
||||
<!-- </van-button>-->
|
||||
<!-- </van-col>-->
|
||||
<van-col span="12">
|
||||
<van-button :color="themeColor" block @click="doAudit(true)">通 过
|
||||
</van-button>
|
||||
<van-button :color="themeColor" block @click="doAudit(true)">通 过</van-button>
|
||||
</van-col>
|
||||
</van-row>
|
||||
</van-form>
|
||||
@@ -64,11 +53,11 @@ layout("/mobile/platform.html"){
|
||||
|
||||
<script>
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
el: "#app",
|
||||
mixins: [mobileMixins],
|
||||
components: {
|
||||
'site_h5_info': httpVueLoader('/components/activity/site/SiteH5Info.vue'),
|
||||
'mobile-sign': httpVueLoader('/components/sign/mobileSign.vue'),
|
||||
site_h5_info: httpVueLoader("/components/activity/site/SiteH5Info.vue"),
|
||||
"mobile-sign": httpVueLoader("/components/sign/mobileSign.vue")
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -78,40 +67,40 @@ layout("/mobile/platform.html"){
|
||||
},
|
||||
methods: {
|
||||
async doAudit(pass) {
|
||||
if (this.formData.auditOpinion == null || this.formData.auditOpinion === '') {
|
||||
this.$toast('请填写审核意见')
|
||||
if (this.formData.auditOpinion == null || this.formData.auditOpinion === "") {
|
||||
this.$toast("请填写审核意见")
|
||||
return
|
||||
}
|
||||
|
||||
this.$dialog.confirm({
|
||||
title: '提示',
|
||||
message: '您确定要' + (pass ? '通过' : '拒绝') + '吗?',
|
||||
}).then(async () => {
|
||||
const loading = this.$toast.loading({
|
||||
message: '提交中...',
|
||||
forbidClick: true,
|
||||
this.$dialog
|
||||
.confirm({
|
||||
title: "提示",
|
||||
message: "您确定要" + (pass ? "通过" : "拒绝") + "吗?"
|
||||
})
|
||||
this.formData.auditPass = pass
|
||||
const {data, code, msg} = await $.post('/platform/activity/site/review/doProcess', {
|
||||
id: this.id,
|
||||
audit: JSON.stringify(this.formData)
|
||||
.then(async () => {
|
||||
const loading = this.$toast.loading({
|
||||
message: "提交中...",
|
||||
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()
|
||||
if (code === 0) {
|
||||
this.$toast.success(msg)
|
||||
setTimeout(() => {
|
||||
window.history.back()
|
||||
}, 500)
|
||||
} else {
|
||||
this.$toast.fail(msg)
|
||||
}
|
||||
}).catch(() => {
|
||||
})
|
||||
.catch(() => {})
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
||||
}
|
||||
created() {}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
@@ -46,11 +46,9 @@ layout("/mobile/platform.html"){
|
||||
}
|
||||
|
||||
.cell .title {
|
||||
|
||||
}
|
||||
|
||||
.cell .content {
|
||||
|
||||
}
|
||||
|
||||
.extra {
|
||||
@@ -63,46 +61,35 @@ layout("/mobile/platform.html"){
|
||||
.van-dropdown-menu__bar .van-dropdown-menu__item {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<div>
|
||||
<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">
|
||||
<van-dropdown-menu active-color="#1989fa">
|
||||
<van-dropdown-item :title="pageForm.time" ref="dropItemYearMonth">
|
||||
<van-datetime-picker
|
||||
v-model="currentDate"
|
||||
type="year-month"
|
||||
:max-date="maxDate"
|
||||
title="选择年月"
|
||||
@confirm="onConfirmDate"
|
||||
@cancel="onCancelDate"
|
||||
v-model="currentDate"
|
||||
type="year-month"
|
||||
:max-date="maxDate"
|
||||
title="选择年月"
|
||||
@confirm="onConfirmDate"
|
||||
@cancel="onCancelDate"
|
||||
></van-datetime-picker>
|
||||
|
||||
</van-dropdown-item>
|
||||
<van-dropdown-item v-model="pageForm.isAudit" :options="auditOptions"
|
||||
@change="doSearch"></van-dropdown-item>
|
||||
<van-dropdown-item v-model="pageForm.isAudit" :options="auditOptions" @change="doSearch"></van-dropdown-item>
|
||||
</van-dropdown-menu>
|
||||
</div>
|
||||
|
||||
<div class="table-list">
|
||||
<van-list v-model="loading"
|
||||
:finished="finished"
|
||||
:finished-text="tableData.length>0?'没有更多了':''"
|
||||
@load="pageData">
|
||||
<van-list v-model="loading" :finished="finished" :finished-text="tableData.length>0?'没有更多了':''" @load="pageData">
|
||||
<div v-for="item in tableData" :key="item.id" class="table-item">
|
||||
<div>
|
||||
<div class="header-title">
|
||||
{{item.reserve_cause}}
|
||||
</div>
|
||||
<div class="header-title">{{item.reserve_cause}}</div>
|
||||
|
||||
<van-tag class="header-title-extra" :type="tagType(item.reserve_state)">
|
||||
{{item.state_name}}
|
||||
</van-tag>
|
||||
<van-tag class="header-title-extra" :type="tagType(item.reserve_state)">{{item.state_name}}</van-tag>
|
||||
|
||||
<div class="cell">
|
||||
<div class="title">预约场地:</div>
|
||||
@@ -134,40 +121,35 @@ layout("/mobile/platform.html"){
|
||||
</div>
|
||||
<div class="extra">
|
||||
<van-button size="small" type="info" @click="openView(item.id)">查看详情</van-button>
|
||||
<van-button size="small" type="info" @click="openAudit(item.id)"
|
||||
v-if="item.reserve_state===6118">审核预约
|
||||
</van-button>
|
||||
<van-button size="small" type="info" @click="openAudit(item.id)" v-if="item.reserve_state===6118">审核预约</van-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</van-list>
|
||||
</div>
|
||||
|
||||
<van-empty v-if="tableData.length==0" class="custom-image"
|
||||
image="/none.svg"
|
||||
description="暂无数据">
|
||||
</van-empty>
|
||||
<van-empty v-if="tableData.length==0" class="custom-image" image="/none.svg" description="暂无数据"></van-empty>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
el: "#app",
|
||||
mixins: [mobileMixins],
|
||||
data() {
|
||||
return {
|
||||
tableData: [],
|
||||
pageForm: {
|
||||
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,
|
||||
currentDate: new Date(),
|
||||
auditOptions: [
|
||||
{text: '全部', value: null},
|
||||
{text: '已审核', value: true},
|
||||
{text: '未审核', value: false},
|
||||
{ text: "全部", value: null },
|
||||
{ text: "已审核", value: true },
|
||||
{ text: "未审核", value: false }
|
||||
]
|
||||
}
|
||||
},
|
||||
@@ -175,43 +157,42 @@ layout("/mobile/platform.html"){
|
||||
tagType() {
|
||||
return (reserveState) => {
|
||||
if (reserveState === 6138) {
|
||||
return 'success';
|
||||
return "success"
|
||||
} else if (reserveState === 6128) {
|
||||
return 'danger';
|
||||
return "danger"
|
||||
}
|
||||
return 'primary';
|
||||
};
|
||||
},
|
||||
return "primary"
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async openAudit(id) {
|
||||
window.location.href = loc() + '/audit?id=' + id
|
||||
window.location.href = loc() + "/audit?id=" + id
|
||||
},
|
||||
openView(id) {
|
||||
window.location.href = '/mobile/activity/site/mine/detail?id=' + id
|
||||
window.location.href = "/mobile/activity/site/mine/detail?id=" + id
|
||||
},
|
||||
onCancelDate() {
|
||||
this.$refs.dropItemYearMonth.toggle();
|
||||
this.$refs.dropItemYearMonth.toggle()
|
||||
},
|
||||
onConfirmDate(val) {
|
||||
this.pageForm.time = moment(val).format('YYYY-MM')
|
||||
this.pageForm.time = moment(val).format("YYYY-MM")
|
||||
this.$refs.dropItemYearMonth.toggle()
|
||||
this.doSearch()
|
||||
}
|
||||
},
|
||||
created() {
|
||||
let maxDate = new Date();
|
||||
maxDate.setMonth(maxDate.getMonth() + 1);
|
||||
let maxDate = new Date()
|
||||
maxDate.setMonth(maxDate.getMonth() + 1)
|
||||
this.maxDate = maxDate
|
||||
}
|
||||
})
|
||||
|
||||
window.addEventListener('pageshow', e => {
|
||||
window.addEventListener("pageshow", (e) => {
|
||||
if (e.persisted || (window.performance && window.performance.navigation.type === 2)) {
|
||||
vue.doSearch()
|
||||
}
|
||||
})
|
||||
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
|
||||
@@ -3,57 +3,47 @@ layout("/mobile/platform.html"){
|
||||
#-->
|
||||
|
||||
<div id="app">
|
||||
<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>
|
||||
|
||||
<site_h5_info :id="id">
|
||||
<template #audit>
|
||||
<div class="van-cell-group__title mt10">
|
||||
<div class="van-sidebar-item van-sidebar-item--select">
|
||||
分工会审核
|
||||
</div>
|
||||
<div class="van-sidebar-item van-sidebar-item--select">分工会审核</div>
|
||||
</div>
|
||||
<van-form>
|
||||
<van-field readonly
|
||||
value="${@shiro.getPrincipalProperty('username')}"
|
||||
name="username"
|
||||
label="审核人员"
|
||||
<van-field readonly value="${@shiro.getPrincipalProperty('username')}" name="username" label="审核人员"></van-field>
|
||||
|
||||
<van-field :value="moment().format('YYYY-MM-DD')" label="审核时间" readonly></van-field>
|
||||
|
||||
<van-field
|
||||
v-model="formData.auditOpinion"
|
||||
rows="1"
|
||||
required
|
||||
autosize
|
||||
label="审核意见"
|
||||
type="textarea"
|
||||
placeholder="请输入审核意见"
|
||||
></van-field>
|
||||
|
||||
<van-field :value="moment().format('YYYY-MM-DD')"
|
||||
label="审核时间"
|
||||
readonly></van-field>
|
||||
<!-- <van-field label="签字" required style="flex-flow: column">-->
|
||||
<!-- <template #label>-->
|
||||
<!-- <div class="mb10">签  字</div>-->
|
||||
<!-- </template>-->
|
||||
<!-- <template #input>-->
|
||||
<!-- <mobile-sign ref="signature" :my_sign.sync="formData.auditSign"></mobile-sign>-->
|
||||
<!-- </template>-->
|
||||
<!-- </van-field>-->
|
||||
|
||||
<van-field v-model="formData.auditOpinion"
|
||||
rows="1"
|
||||
required
|
||||
autosize
|
||||
label="审核意见"
|
||||
type="textarea"
|
||||
placeholder="请输入审核意见"
|
||||
></van-field>
|
||||
|
||||
<!-- <van-field label="签字" required style="flex-flow: column">-->
|
||||
<!-- <template #label>-->
|
||||
<!-- <div class="mb10">签  字</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-row gutter="20" style="margin-top: 30px; padding: 0 25px">
|
||||
<van-col span="12">
|
||||
<van-button :color="themeColor" plain block @click="doAudit(false)">拒 绝
|
||||
</van-button>
|
||||
<van-button :color="themeColor" plain block @click="doAudit(false)">拒 绝</van-button>
|
||||
</van-col>
|
||||
<!-- <van-col span="8">-->
|
||||
<!-- <van-button color="red" block plain @click="doAudit(2)">返回修改-->
|
||||
<!-- </van-button>-->
|
||||
<!-- </van-col>-->
|
||||
<van-col span="12">
|
||||
<van-button :color="themeColor" block @click="doAudit(true)">通 过
|
||||
</van-button>
|
||||
<van-button :color="themeColor" block @click="doAudit(true)">通 过</van-button>
|
||||
</van-col>
|
||||
</van-row>
|
||||
</van-form>
|
||||
@@ -63,11 +53,11 @@ layout("/mobile/platform.html"){
|
||||
|
||||
<script>
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
el: "#app",
|
||||
mixins: [mobileMixins],
|
||||
components: {
|
||||
'site_h5_info': httpVueLoader('/components/activity/site/SiteH5Info.vue'),
|
||||
'mobile-sign': httpVueLoader('/components/sign/mobileSign.vue'),
|
||||
site_h5_info: httpVueLoader("/components/activity/site/SiteH5Info.vue"),
|
||||
"mobile-sign": httpVueLoader("/components/sign/mobileSign.vue")
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -77,41 +67,40 @@ layout("/mobile/platform.html"){
|
||||
},
|
||||
methods: {
|
||||
async doAudit(pass) {
|
||||
if (this.formData.auditOpinion == null || this.formData.auditOpinion === '') {
|
||||
this.$toast('请填写审核意见')
|
||||
if (this.formData.auditOpinion == null || this.formData.auditOpinion === "") {
|
||||
this.$toast("请填写审核意见")
|
||||
return
|
||||
}
|
||||
|
||||
this.$dialog.confirm({
|
||||
title: '提示',
|
||||
message: '您确定要' + (pass ? '通过' : '拒绝') + '吗?',
|
||||
}).then(async () => {
|
||||
const loading = this.$toast.loading({
|
||||
message: '提交中...',
|
||||
forbidClick: true,
|
||||
this.$dialog
|
||||
.confirm({
|
||||
title: "提示",
|
||||
message: "您确定要" + (pass ? "通过" : "拒绝") + "吗?"
|
||||
})
|
||||
this.formData.auditPass = pass
|
||||
const {data, code, msg} = await $.post('/platform/activity/site/unionProcess/doProcess',
|
||||
{
|
||||
.then(async () => {
|
||||
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,
|
||||
audit: this.formData,
|
||||
});
|
||||
loading.clear()
|
||||
if (code === 0) {
|
||||
this.$toast.success(msg)
|
||||
setTimeout(() => {
|
||||
window.history.back()
|
||||
}, 500)
|
||||
} else {
|
||||
this.$toast.fail(msg)
|
||||
}
|
||||
}).catch(() => {
|
||||
})
|
||||
audit: this.formData
|
||||
})
|
||||
loading.clear()
|
||||
if (code === 0) {
|
||||
this.$toast.success(msg)
|
||||
setTimeout(() => {
|
||||
window.history.back()
|
||||
}, 500)
|
||||
} else {
|
||||
this.$toast.fail(msg)
|
||||
}
|
||||
})
|
||||
.catch(() => {})
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
||||
}
|
||||
created() {}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
@@ -46,11 +46,9 @@ layout("/mobile/platform.html"){
|
||||
}
|
||||
|
||||
.cell .title {
|
||||
|
||||
}
|
||||
|
||||
.cell .content {
|
||||
|
||||
}
|
||||
|
||||
.extra {
|
||||
@@ -63,45 +61,34 @@ layout("/mobile/platform.html"){
|
||||
.van-dropdown-menu__bar .van-dropdown-menu__item {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<div>
|
||||
<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">
|
||||
<van-dropdown-menu active-color="rgb(0, 78, 100)">
|
||||
<van-dropdown-item :title="pageForm.time" ref="dropItemYearMonth">
|
||||
<van-datetime-picker
|
||||
v-model="currentDate"
|
||||
type="year-month"
|
||||
:max-date="maxDate"
|
||||
title="选择年月"
|
||||
@confirm="onConfirmDate"
|
||||
@cancel="onCancelDate"
|
||||
v-model="currentDate"
|
||||
type="year-month"
|
||||
:max-date="maxDate"
|
||||
title="选择年月"
|
||||
@confirm="onConfirmDate"
|
||||
@cancel="onCancelDate"
|
||||
></van-datetime-picker>
|
||||
|
||||
</van-dropdown-item>
|
||||
<van-dropdown-item v-model="pageForm.isAudit" :options="auditOptions"
|
||||
@change="doSearch"></van-dropdown-item>
|
||||
<van-dropdown-item v-model="pageForm.isAudit" :options="auditOptions" @change="doSearch"></van-dropdown-item>
|
||||
</van-dropdown-menu>
|
||||
</div>
|
||||
|
||||
<div class="table-list">
|
||||
<van-list v-model="loading"
|
||||
:finished="finished"
|
||||
:finished-text="tableData.length>0?'没有更多了':''"
|
||||
@load="pageData">
|
||||
<van-list v-model="loading" :finished="finished" :finished-text="tableData.length>0?'没有更多了':''" @load="pageData">
|
||||
<div v-for="item in tableData" :key="item.id" class="table-item">
|
||||
<div>
|
||||
<div class="header-title">
|
||||
{{item.reserve_cause}}
|
||||
</div>
|
||||
<van-tag class="header-title-extra" :type="tagType(item.reserve_state)">
|
||||
{{item.state_name}}
|
||||
</van-tag>
|
||||
<div class="header-title">{{item.reserve_cause}}</div>
|
||||
<van-tag class="header-title-extra" :type="tagType(item.reserve_state)">{{item.state_name}}</van-tag>
|
||||
|
||||
<div class="cell">
|
||||
<div class="title">预约场地:</div>
|
||||
@@ -133,40 +120,35 @@ layout("/mobile/platform.html"){
|
||||
</div>
|
||||
<div class="extra">
|
||||
<van-button size="small" type="info" @click="openView(item.id)">查看详情</van-button>
|
||||
<van-button size="small" type="info" @click="openAudit(item.id)"
|
||||
v-if="item.reserve_state===6098">审核预约
|
||||
</van-button>
|
||||
<van-button size="small" type="info" @click="openAudit(item.id)" v-if="item.reserve_state===6098">审核预约</van-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</van-list>
|
||||
</div>
|
||||
|
||||
<van-empty v-if="tableData.length==0" class="custom-image"
|
||||
image="/none.svg"
|
||||
description="暂无数据">
|
||||
</van-empty>
|
||||
<van-empty v-if="tableData.length==0" class="custom-image" image="/none.svg" description="暂无数据"></van-empty>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
el: "#app",
|
||||
mixins: [mobileMixins],
|
||||
data() {
|
||||
return {
|
||||
tableData: [],
|
||||
pageForm: {
|
||||
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(),
|
||||
currentDate: new Date(),
|
||||
auditOptions: [
|
||||
{text: '全部', value: null},
|
||||
{text: '已审核', value: true},
|
||||
{text: '未审核', value: false},
|
||||
{ text: "全部", value: null },
|
||||
{ text: "已审核", value: true },
|
||||
{ text: "未审核", value: false }
|
||||
]
|
||||
}
|
||||
},
|
||||
@@ -174,42 +156,40 @@ layout("/mobile/platform.html"){
|
||||
tagType() {
|
||||
return (reserveState) => {
|
||||
if (reserveState === 6138) {
|
||||
return 'success';
|
||||
return "success"
|
||||
} else if ([6108, 6128].includes(reserveState)) {
|
||||
return 'danger';
|
||||
return "danger"
|
||||
}
|
||||
return 'primary';
|
||||
};
|
||||
},
|
||||
return "primary"
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async openAudit(id) {
|
||||
window.location.href = loc() + '/audit?id=' + id
|
||||
window.location.href = loc() + "/audit?id=" + id
|
||||
},
|
||||
openView(id) {
|
||||
window.location.href = '/mobile/activity/site/mine/detail?id=' + id
|
||||
window.location.href = "/mobile/activity/site/mine/detail?id=" + id
|
||||
},
|
||||
onCancelDate() {
|
||||
this.$refs.dropItemYearMonth.toggle();
|
||||
this.$refs.dropItemYearMonth.toggle()
|
||||
},
|
||||
onConfirmDate(val) {
|
||||
this.pageForm.time = moment(val).format('YYYY-MM')
|
||||
this.pageForm.time = moment(val).format("YYYY-MM")
|
||||
this.$refs.dropItemYearMonth.toggle()
|
||||
this.doSearch()
|
||||
}
|
||||
|
||||
},
|
||||
created() {
|
||||
// this.pageData()
|
||||
}
|
||||
})
|
||||
|
||||
window.addEventListener('pageshow', e => {
|
||||
window.addEventListener("pageshow", (e) => {
|
||||
if (e.persisted || (window.performance && window.performance.navigation.type === 2)) {
|
||||
vue.doSearch()
|
||||
}
|
||||
})
|
||||
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
|
||||
@@ -14,7 +14,8 @@ layout("/mobile/platform.html"){
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
.activity_card .van-image, .activity_card .van-image img {
|
||||
.activity_card .van-image,
|
||||
.activity_card .van-image img {
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
@@ -52,55 +53,41 @@ layout("/mobile/platform.html"){
|
||||
max-width: 80px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<van-nav-bar title="活动列表" left-arrow placeholder fixed
|
||||
@click-left="history.go(-1)"></van-nav-bar>
|
||||
<van-nav-bar title="活动列表" left-arrow placeholder fixed @click-left="pjaxReplace('/mobile/index')"></van-nav-bar>
|
||||
|
||||
<div class="search-fixed">
|
||||
<van-dropdown-menu active-color="#1989fa">
|
||||
<van-dropdown-item v-model="pageForm.year" :options="yearList"
|
||||
@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.activityLevel" :options="activityLevelList"
|
||||
@change="formChange"></van-dropdown-item>
|
||||
<van-dropdown-item v-model="pageForm.year" :options="yearList" @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.activityLevel" :options="activityLevelList" @change="formChange"></van-dropdown-item>
|
||||
</van-dropdown-menu>
|
||||
</div>
|
||||
|
||||
<div style="margin: 60px auto 80px auto">
|
||||
<van-list v-model="loading" :finished="finished"
|
||||
:finished-text="tableData.length>0?'没有更多了':''"
|
||||
@load="pageData">
|
||||
<van-list v-model="loading" :finished="finished" :finished-text="tableData.length>0?'没有更多了':''" @load="pageData">
|
||||
<div v-for="o in tableData" class="list-card" @click="openReg(o)">
|
||||
|
||||
<div class="activity_card">
|
||||
<van-image
|
||||
fit="cover"
|
||||
width="100%"
|
||||
height="200"
|
||||
:src="FILE_DOMAIN + '/fileStreamPreview?id=' + o.cover"
|
||||
></van-image>
|
||||
<van-image fit="cover" width="100%" height="200" :src="FILE_DOMAIN + '/fileStreamPreview?id=' + o.cover"></van-image>
|
||||
<div class="activity_content">
|
||||
<div class="activity_name van-ellipsis">
|
||||
<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}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="activity_bottom">
|
||||
<div class="left" style="width: 100%">
|
||||
<van-icon name="clock" size="1em"></van-icon>
|
||||
<span style="margin-left: 10px;">
|
||||
报名时间:{{o.applyStartTime}}至{{o.applyEndTime}}
|
||||
<span style="margin-left: 10px">
|
||||
报名时间:{{o.applyStartTime}}至{{o.applyEndTime}}
|
||||
<!-- {{moment(o.activityStartTime).format('YYYY/MM/DD HH:mm')}} 至-->
|
||||
<!-- {{moment(o.activityEndTime).format('YYYY/MM/DD HH:mm')}}-->
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- <div class="right">-->
|
||||
<!-- <span v-if="moment(o.applyEndTime).valueOf() > moment().valueOf() && moment().valueOf() > moment(o.applyStartTime).valueOf()"-->
|
||||
<!-- style="color: forestgreen">-->
|
||||
@@ -124,39 +111,37 @@ layout("/mobile/platform.html"){
|
||||
<div class="activity_bottom">
|
||||
<div class="left">
|
||||
<van-icon name="clock" size="1em"></van-icon>
|
||||
<span style="margin-left: 10px;">
|
||||
<span style="margin-left: 10px">
|
||||
活动时间:{{o.startTime}}
|
||||
<!-- {{moment(o.activityStartTime).format('YYYY/MM/DD HH:mm')}} 至-->
|
||||
<!-- {{moment(o.activityEndTime).format('YYYY/MM/DD HH:mm')}}-->
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="right">
|
||||
<span v-if="moment(o.applyStartTime).valueOf() > moment().valueOf()"
|
||||
style="color: forestgreen">
|
||||
未开始报名
|
||||
</span>
|
||||
<span v-else-if="moment(o.applyEndTime).valueOf() > moment().valueOf() && moment().valueOf() > moment(o.applyStartTime).valueOf()"
|
||||
style="color: forestgreen">
|
||||
<span v-if="moment(o.applyStartTime).valueOf() > moment().valueOf()" style="color: forestgreen">未开始报名</span>
|
||||
<span
|
||||
v-else-if="moment(o.applyEndTime).valueOf() > moment().valueOf() && moment().valueOf() > moment(o.applyStartTime).valueOf()"
|
||||
style="color: forestgreen"
|
||||
>
|
||||
报名中
|
||||
</span>
|
||||
<span v-else-if="moment(o.applyEndTime).valueOf() < moment().valueOf() && moment().valueOf() < moment(o.startTime).valueOf()"
|
||||
style="color: #ee1919">
|
||||
<span
|
||||
v-else-if="moment(o.applyEndTime).valueOf() < moment().valueOf() && moment().valueOf() < moment(o.startTime).valueOf()"
|
||||
style="color: #ee1919"
|
||||
>
|
||||
报名结束
|
||||
</span>
|
||||
<span v-else-if="moment(o.startTime).valueOf() < moment().valueOf() && moment().valueOf() < moment(o.endTime).valueOf()"
|
||||
style="color: forestgreen">
|
||||
<span
|
||||
v-else-if="moment(o.startTime).valueOf() < moment().valueOf() && moment().valueOf() < moment(o.endTime).valueOf()"
|
||||
style="color: forestgreen"
|
||||
>
|
||||
活动进行中
|
||||
</span>
|
||||
<span v-else-if="moment().valueOf() > moment(o.endTime).valueOf()"
|
||||
style="color: #ee1919">
|
||||
活动结束
|
||||
</span>
|
||||
<span v-else-if="moment().valueOf() > moment(o.endTime).valueOf()" style="color: #ee1919">活动结束</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- <div class="activity_content" style="font-size: 12px; color: #c4bebe;">-->
|
||||
<!-- <div class="left">-->
|
||||
<!-- <van-icon name="clock" size="1em"></van-icon>-->
|
||||
@@ -166,48 +151,40 @@ layout("/mobile/platform.html"){
|
||||
<!-- </span>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</van-list>
|
||||
</div>
|
||||
|
||||
<van-empty v-if="mLoading==false&&tableData.length==0" class="custom-image" image="/none.svg"
|
||||
description="暂无数据">
|
||||
</van-empty>
|
||||
<van-empty v-if="mLoading==false&&tableData.length==0" class="custom-image" image="/none.svg" description="暂无数据"></van-empty>
|
||||
|
||||
<div>
|
||||
<van-tabbar v-model="tabBarIndex" :active-color="themeColor">
|
||||
<van-tabbar-item icon="home-o" url="/mobile/activity/unionActivity">全部活动
|
||||
</van-tabbar-item>
|
||||
<van-tabbar-item icon="friends-o" url="/mobile/activity/myActivity">我的活动
|
||||
</van-tabbar-item>
|
||||
<van-tabbar-item icon="home-o" url="/mobile/activity/unionActivity">全部活动</van-tabbar-item>
|
||||
<van-tabbar-item icon="friends-o" url="/mobile/activity/myActivity">我的活动</van-tabbar-item>
|
||||
</van-tabbar>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<script>
|
||||
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
el: "#app",
|
||||
mixins: [mobileMixins],
|
||||
data() {
|
||||
return {
|
||||
pageDataUrl: '/mobile/activity/unionActivity/pageData',
|
||||
pageDataUrl: "/mobile/activity/unionActivity/pageData",
|
||||
pageForm: {
|
||||
year: '',
|
||||
year: "",
|
||||
activityStatus: null
|
||||
},
|
||||
tabBarIndex: 0,
|
||||
activityLevelList: [],
|
||||
activityStatusList: [
|
||||
{text: '全部', value: 1},
|
||||
{text: '未开始', value: 5},
|
||||
{text: '报名中', value: 2},
|
||||
{text: '进行中', value: 3},
|
||||
{text: '已结束', value: 4}
|
||||
{ text: "全部", value: 1 },
|
||||
{ text: "未开始", value: 5 },
|
||||
{ text: "报名中", value: 2 },
|
||||
{ text: "进行中", value: 3 },
|
||||
{ text: "已结束", value: 4 }
|
||||
]
|
||||
}
|
||||
},
|
||||
@@ -219,7 +196,7 @@ layout("/mobile/platform.html"){
|
||||
},
|
||||
async pageData() {
|
||||
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.data.list.length === 0) {
|
||||
this.tableData = []
|
||||
@@ -239,30 +216,30 @@ layout("/mobile/platform.html"){
|
||||
this.pageForm.pageNumber++
|
||||
}
|
||||
}
|
||||
this.loading = false;
|
||||
this.loading = false
|
||||
this.mLoading = false
|
||||
},
|
||||
//跳转页面
|
||||
openReg(o) {
|
||||
console.log(o)
|
||||
if (moment(o.applyStartTime).valueOf() > moment().valueOf()) {
|
||||
this.$toast('活动未开始报名')
|
||||
return;
|
||||
this.$toast("活动未开始报名")
|
||||
return
|
||||
}
|
||||
if (o.projectTypeCode === '50004') {
|
||||
window.location.href = '/mobile/activity/Sports/list/activityEventList?id=' + o.id
|
||||
if (o.projectTypeCode === "50004") {
|
||||
window.location.href = "/mobile/activity/Sports/list/activityEventList?id=" + o.id
|
||||
} 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() {
|
||||
this.$set(this.pageForm, "activityStatus", 1)
|
||||
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.push({value: null, text: "全部类别"})
|
||||
data.forEach(v => {
|
||||
this.activityLevelList.push({value: v.code, text: v.name})
|
||||
this.activityLevelList.push({ value: null, text: "全部类别" })
|
||||
data.forEach((v) => {
|
||||
this.activityLevelList.push({ value: v.code, text: v.name })
|
||||
})
|
||||
|
||||
this.$set(this.pageForm, "activityLevel", this.activityLevelList[0].value)
|
||||
@@ -272,7 +249,7 @@ layout("/mobile/platform.html"){
|
||||
this.init()
|
||||
}
|
||||
})
|
||||
window.addEventListener('pageshow', e => {
|
||||
window.addEventListener("pageshow", (e) => {
|
||||
if (e.persisted || (window.performance && window.performance.navigation.type === 2)) {
|
||||
vue.init()
|
||||
}
|
||||
|
||||
@@ -12,20 +12,22 @@ layout("/mobile/platform.html"){
|
||||
</style>
|
||||
|
||||
<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"){}#-->
|
||||
|
||||
<div style="margin: 20px 20px 10px 20px" v-if="o.needSign">
|
||||
<van-button
|
||||
:disabled="moment().valueOf() > moment(o.endTime).valueOf() || moment().valueOf() < moment(o.startTime).valueOf() || isSign"
|
||||
@click="doSign()" style="border-radius: 10px" block type="info"
|
||||
:color="themeColor">
|
||||
:disabled="moment().valueOf() > moment(o.endTime).valueOf() || moment().valueOf() < moment(o.startTime).valueOf() || isSign"
|
||||
@click="doSign()"
|
||||
style="border-radius: 10px"
|
||||
block
|
||||
type="info"
|
||||
:color="themeColor"
|
||||
>
|
||||
{{isSign?'签到成功':'立即签到'}}
|
||||
</van-button>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
@@ -35,26 +37,26 @@ layout("/mobile/platform.html"){
|
||||
<script>
|
||||
let geolocation = null
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
el: "#app",
|
||||
mixins: [mobileMixins, self_mixin],
|
||||
data() {
|
||||
return {
|
||||
activityId: '',
|
||||
activityId: "",
|
||||
o: {},
|
||||
isSign: null
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
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) {
|
||||
this.isSign = resp.data
|
||||
}
|
||||
},
|
||||
async doSign() {
|
||||
geolocation.getCurrentPosition(async (status, result) => {
|
||||
if (status !== 'complete') {
|
||||
this.$toast.fail('定位失败!')
|
||||
if (status !== "complete") {
|
||||
this.$toast.fail("定位失败!")
|
||||
return
|
||||
}
|
||||
console.log(status)
|
||||
@@ -62,27 +64,30 @@ layout("/mobile/platform.html"){
|
||||
const lat = result.position.lat
|
||||
const lng = result.position.lng
|
||||
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)
|
||||
console.log(distance)
|
||||
console.log(this.o.rangeMeter)
|
||||
if (distance > this.o.rangeMeter) {
|
||||
this.$toast('距离活动打卡点还有' + distance + '米')
|
||||
this.$toast("距离活动打卡点还有" + distance + "米")
|
||||
return
|
||||
}
|
||||
const confirm = await this.$dialog.confirm({
|
||||
title: '提示',
|
||||
message: '您确认要签到吗?',
|
||||
title: "提示",
|
||||
message: "您确认要签到吗?"
|
||||
})
|
||||
const loading = this.$toast.loading({
|
||||
message: '签到中...',
|
||||
message: "签到中...",
|
||||
forbidClick: true,
|
||||
overlay: true,
|
||||
duration: 0
|
||||
})
|
||||
if (confirm === 'confirm') {
|
||||
const resp = await $.post('/mobile/activity/unionActivity/singleSignUp', {activityId: this.activityId})
|
||||
if (confirm === "confirm") {
|
||||
const resp = await $.post("/mobile/activity/unionActivity/singleSignUp", { activityId: this.activityId })
|
||||
if (resp.code === 0) {
|
||||
await this.getSignStatus()
|
||||
loading.close()
|
||||
@@ -90,8 +95,6 @@ layout("/mobile/platform.html"){
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
},
|
||||
created() {
|
||||
@@ -107,4 +110,4 @@ layout("/mobile/platform.html"){
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
#-->
|
||||
|
||||
@@ -12,45 +12,55 @@ layout("/mobile/platform.html"){
|
||||
</style>
|
||||
|
||||
<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"){}#-->
|
||||
|
||||
<div style="margin: 20px 20px 10px 20px"
|
||||
v-if="moment(o.applyStartTime).valueOf() < moment().valueOf() && moment().valueOf() < moment(o.applyEndTime).valueOf()">
|
||||
<van-button v-if="!isRegister && !isRegisterFull" @click="doSave()"
|
||||
style="border-radius: 10px" block
|
||||
type="info"
|
||||
:color="themeColor">
|
||||
<div
|
||||
style="margin: 20px 20px 10px 20px"
|
||||
v-if="moment(o.applyStartTime).valueOf() < moment().valueOf() && moment().valueOf() < moment(o.applyEndTime).valueOf()"
|
||||
>
|
||||
<van-button v-if="!isRegister && !isRegisterFull" @click="doSave()" style="border-radius: 10px" block type="info" :color="themeColor">
|
||||
立即报名
|
||||
</van-button>
|
||||
<van-button v-else-if="!isRegister && isRegisterFull" @click="doSave()"
|
||||
style="border-radius: 10px" block
|
||||
disabled
|
||||
type="info"
|
||||
:color="themeColor">
|
||||
<van-button
|
||||
v-else-if="!isRegister && isRegisterFull"
|
||||
@click="doSave()"
|
||||
style="border-radius: 10px"
|
||||
block
|
||||
disabled
|
||||
type="info"
|
||||
:color="themeColor"
|
||||
>
|
||||
名额已满
|
||||
</van-button>
|
||||
<van-button v-else-if="isRegister && moment().valueOf() < moment(o.applyEndTime).valueOf()"
|
||||
@click="doCancel"
|
||||
style="border-radius: 10px" block type="info"
|
||||
color="red">
|
||||
<van-button
|
||||
v-else-if="isRegister && moment().valueOf() < moment(o.applyEndTime).valueOf()"
|
||||
@click="doCancel"
|
||||
style="border-radius: 10px"
|
||||
block
|
||||
type="info"
|
||||
color="red"
|
||||
>
|
||||
取消报名
|
||||
</van-button>
|
||||
</div>
|
||||
|
||||
<div style="margin: 20px 20px 10px 20px"
|
||||
v-if="isRegister && moment().valueOf() < moment(o.endTime).valueOf() && moment().valueOf() > moment(o.startTime).valueOf()">
|
||||
<div
|
||||
style="margin: 20px 20px 10px 20px"
|
||||
v-if="isRegister && moment().valueOf() < moment(o.endTime).valueOf() && moment().valueOf() > moment(o.startTime).valueOf()"
|
||||
>
|
||||
<van-button
|
||||
:disabled="moment().valueOf() > moment(o.endTime).valueOf() || moment().valueOf() < moment(o.startTime).valueOf() || isSign"
|
||||
@click="doSign()" style="border-radius: 10px" block type="info"
|
||||
:color="themeColor">
|
||||
:disabled="moment().valueOf() > moment(o.endTime).valueOf() || moment().valueOf() < moment(o.startTime).valueOf() || isSign"
|
||||
@click="doSign()"
|
||||
style="border-radius: 10px"
|
||||
block
|
||||
type="info"
|
||||
:color="themeColor"
|
||||
>
|
||||
{{isSign?'签到成功':'立即签到'}}
|
||||
</van-button>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
@@ -59,11 +69,11 @@ layout("/mobile/platform.html"){
|
||||
|
||||
<script>
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
el: "#app",
|
||||
mixins: [mobileMixins, self_mixin],
|
||||
data() {
|
||||
return {
|
||||
activityId: '',
|
||||
activityId: "",
|
||||
o: {},
|
||||
tagCloseable: true,
|
||||
isRegister: false,
|
||||
@@ -72,36 +82,35 @@ layout("/mobile/platform.html"){
|
||||
},
|
||||
methods: {
|
||||
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) {
|
||||
this.isRegister = resp.data
|
||||
}
|
||||
},
|
||||
async doSave() {
|
||||
let message = ''
|
||||
let message = ""
|
||||
if (this.o.needSign) {
|
||||
message = '报名后若未参加,将有可能影响到其它活动的报名,同时活动开启了现场签到!'
|
||||
message = "报名后若未参加,将有可能影响到其它活动的报名,同时活动开启了现场签到!"
|
||||
}
|
||||
const confirm = await this.$dialog.confirm({
|
||||
title: '提示',
|
||||
message: '您确认要报名吗?' + message,
|
||||
title: "提示",
|
||||
message: "您确认要报名吗?" + message
|
||||
})
|
||||
if (confirm === 'confirm') {
|
||||
if (confirm === "confirm") {
|
||||
const loading = this.$toast.loading({
|
||||
message: '报名中...',
|
||||
message: "报名中...",
|
||||
forbidClick: true,
|
||||
overlay: true,
|
||||
duration: 0
|
||||
})
|
||||
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()
|
||||
if (resp.code === 0) {
|
||||
this.$toast.success(resp.msg)
|
||||
setTimeout(() => {
|
||||
window.history.back()
|
||||
}, 1000)
|
||||
|
||||
} else {
|
||||
this.$toast.fail(resp.msg)
|
||||
}
|
||||
@@ -109,17 +118,17 @@ layout("/mobile/platform.html"){
|
||||
},
|
||||
async doCancel() {
|
||||
const confirm = await this.$dialog.confirm({
|
||||
title: '提示',
|
||||
message: '您确认要取消报名吗?',
|
||||
title: "提示",
|
||||
message: "您确认要取消报名吗?"
|
||||
})
|
||||
const loading = this.$toast.loading({
|
||||
message: '取消中...',
|
||||
message: "取消中...",
|
||||
forbidClick: true,
|
||||
overlay: true,
|
||||
duration: 0
|
||||
})
|
||||
if (confirm === 'confirm') {
|
||||
const resp = await $.post('/mobile/activity/unionActivity/doSingleCancelRegister', {activityId: this.activityId})
|
||||
if (confirm === "confirm") {
|
||||
const resp = await $.post("/mobile/activity/unionActivity/doSingleCancelRegister", { activityId: this.activityId })
|
||||
loading.close()
|
||||
if (resp.code === 0) {
|
||||
this.$toast.success(resp.msg)
|
||||
@@ -132,18 +141,18 @@ layout("/mobile/platform.html"){
|
||||
}
|
||||
},
|
||||
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) {
|
||||
this.isSign = resp.data
|
||||
}
|
||||
},
|
||||
async doSign() {
|
||||
const confirm = await this.$dialog.confirm({
|
||||
title: '提示',
|
||||
message: '您确认要签到吗?',
|
||||
title: "提示",
|
||||
message: "您确认要签到吗?"
|
||||
})
|
||||
if (confirm === 'confirm') {
|
||||
const resp = await $.post('/mobile/activity/unionActivity/singleSignUp', {activityId: this.activityId})
|
||||
if (confirm === "confirm") {
|
||||
const resp = await $.post("/mobile/activity/unionActivity/singleSignUp", { activityId: this.activityId })
|
||||
if (resp.code === 0) {
|
||||
await this.getSignStatus()
|
||||
this.$toast.success(resp.msg)
|
||||
@@ -168,4 +177,4 @@ layout("/mobile/platform.html"){
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
#-->
|
||||
|
||||
@@ -37,13 +37,12 @@ layout("/mobile/platform.html"){
|
||||
}
|
||||
|
||||
.van-search__action {
|
||||
background-color: #edf0ff
|
||||
background-color: #edf0ff;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<van-nav-bar :title="title" @click-left="history.back()" fixed left-arrow
|
||||
placeholder></van-nav-bar>
|
||||
<van-nav-bar :title="title" @click-left="pjaxReplace('/mobile/index')" fixed left-arrow placeholder></van-nav-bar>
|
||||
|
||||
<!--#include("/mobile/activity/unionActivity/common/activityInfo.html"){}#-->
|
||||
|
||||
@@ -51,47 +50,40 @@ layout("/mobile/platform.html"){
|
||||
<van-cell class="regCell" title="报名人员">
|
||||
<template #label>
|
||||
<div>
|
||||
<span v-if="o.userNumberLimit===1">
|
||||
本活动限制总报名人数:({{o.totalUserNumberLimit}})人
|
||||
</span>
|
||||
<span v-if="o.userNumberLimit===1">本活动限制总报名人数:({{o.totalUserNumberLimit}})人</span>
|
||||
<span v-else-if="o.userNumberLimit===2">
|
||||
当前分工会报名限额 <span style="color: orange">({{o.limitUnion.limitNum}})人</span>
|
||||
当前分工会报名限额
|
||||
<span style="color: orange">({{o.limitUnion.limitNum}})人</span>
|
||||
</span>
|
||||
</div>
|
||||
<div class="mt5" v-loading="tagCloseable">
|
||||
<div v-if="registerList && registerList.length>0">
|
||||
<template v-for="item in registerList">
|
||||
<van-tag :closeable="tagCloseable" :color="themeColor"
|
||||
@close="removeRegUser(item)"
|
||||
size="medium"
|
||||
type="primary">
|
||||
<van-tag :closeable="tagCloseable" :color="themeColor" @close="removeRegUser(item)" size="medium" type="primary">
|
||||
{{item.userName}}
|
||||
</van-tag>
|
||||
</template>
|
||||
</div>
|
||||
<div v-else>
|
||||
<div style="text-align: center;margin-top: 20px;">
|
||||
无报名人员
|
||||
</div>
|
||||
<div style="text-align: center; margin-top: 20px">无报名人员</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt5" style="text-align: right"
|
||||
v-if="moment(o.applyStartTime).valueOf() < moment().valueOf() && moment().valueOf() < moment(o.applyEndTime).valueOf()">
|
||||
<van-button :color="themeColor" @click="openUserActionSheet" size="mini"
|
||||
type="info" v-if="tagCloseable">选择报名人员
|
||||
</van-button>
|
||||
<div
|
||||
class="mt5"
|
||||
style="text-align: right"
|
||||
v-if="moment(o.applyStartTime).valueOf() < moment().valueOf() && moment().valueOf() < moment(o.applyEndTime).valueOf()"
|
||||
>
|
||||
<van-button :color="themeColor" @click="openUserActionSheet" size="mini" type="info" v-if="tagCloseable">选择报名人员</van-button>
|
||||
</div>
|
||||
</template>
|
||||
</van-cell>
|
||||
</van-cell-group>
|
||||
|
||||
<van-action-sheet class="userActionPopup" title="选择报名人员" v-model="userActionSheet">
|
||||
<van-search @search="onSearchUser" placeholder="请输入姓名搜索" show-action
|
||||
v-model="searchKey">
|
||||
<van-search @search="onSearchUser" placeholder="请输入姓名搜索" show-action v-model="searchKey">
|
||||
<template #action>
|
||||
<div @click="onSearchUser(searchKey)">搜索</div>
|
||||
</template>
|
||||
|
||||
</van-search>
|
||||
|
||||
<!-- <div class="van-hairline--bottom">-->
|
||||
@@ -101,48 +93,29 @@ layout("/mobile/platform.html"){
|
||||
<van-loading size="24px" vertical>搜索中...</van-loading>
|
||||
</template>
|
||||
|
||||
<div class="van-action-sheet__content mt5"
|
||||
v-else-if="searchUserList && searchUserList.length>0">
|
||||
|
||||
<div class="van-action-sheet__content mt5" v-else-if="searchUserList && searchUserList.length>0">
|
||||
<template>
|
||||
<template v-for="item in searchUserList"
|
||||
v-if="!registerList.map(v=>v.id).includes(item.id)">
|
||||
<button @click="searchUserAdd(item)"
|
||||
class="van-action-sheet__item van-hairline--bottom">
|
||||
<template v-for="item in searchUserList" v-if="!registerList.map(v=>v.id).includes(item.id)">
|
||||
<button @click="searchUserAdd(item)" class="van-action-sheet__item van-hairline--bottom">
|
||||
<span class="van-action-sheet__name">{{item.userName}}({{item.loginName}})</span>
|
||||
</button>
|
||||
</template>
|
||||
<!--<van-empty description="没有更多了" style="position:absolute;height: 70%"
|
||||
v-else></van-empty>-->
|
||||
</template>
|
||||
|
||||
</div>
|
||||
<van-empty description="暂无数据" style="position:absolute;height: 70%"
|
||||
v-else-if="searchUserList.length===0"></van-empty>
|
||||
<van-empty description="暂无数据" style="position: absolute; height: 70%" v-else-if="searchUserList.length===0"></van-empty>
|
||||
</van-action-sheet>
|
||||
|
||||
|
||||
<div style="margin: 20px 20px 10px 20px"
|
||||
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"
|
||||
v-if="tagCloseable">
|
||||
提 交
|
||||
</van-button>
|
||||
<div
|
||||
style="margin: 20px 20px 10px 20px"
|
||||
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" v-if="tagCloseable">提 交</van-button>
|
||||
<template v-else="!tagCloseable">
|
||||
<van-button :color="themeColor" @click="tagCloseable = true"
|
||||
block style="border-radius: 10px"
|
||||
type="info">
|
||||
修 改
|
||||
</van-button>
|
||||
<van-button
|
||||
@click="doCancel"
|
||||
block color="red" style="border-radius: 10px;margin-top: 10px"
|
||||
type="info">
|
||||
取消报名
|
||||
</van-button>
|
||||
<van-button :color="themeColor" @click="tagCloseable = true" block style="border-radius: 10px" type="info">修 改</van-button>
|
||||
<van-button @click="doCancel" block color="red" style="border-radius: 10px; margin-top: 10px" type="info">取消报名</van-button>
|
||||
</template>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- <div style="margin: 20px 20px 10px 20px" v-if="tagCloseable">-->
|
||||
@@ -153,26 +126,25 @@ layout("/mobile/platform.html"){
|
||||
<!-- 立即签到-->
|
||||
<!-- </van-button>-->
|
||||
<!-- </div>-->
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
<!--#include("/mobile/activity/unionActivity/common/initMap.js"){}#-->
|
||||
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
el: "#app",
|
||||
mixins: [mobileMixins, self_mixin],
|
||||
data() {
|
||||
return {
|
||||
title: "",
|
||||
userId: "${@shiro.getPrincipalProperty('id')}",
|
||||
userName: "${@shiro.getPrincipalProperty('username')}",
|
||||
activityId: '',
|
||||
activityId: "",
|
||||
o: {},
|
||||
registerList: [],
|
||||
addRegisterList: [],
|
||||
userActionSheet: false,
|
||||
searchKey: '',
|
||||
searchKey: "",
|
||||
searchUserList: [],
|
||||
tagCloseable: true,
|
||||
searchLoading: false
|
||||
@@ -181,17 +153,17 @@ layout("/mobile/platform.html"){
|
||||
methods: {
|
||||
async doCancel() {
|
||||
const confirm = await this.$dialog.confirm({
|
||||
title: '提示',
|
||||
message: '您确认要取消报名吗?',
|
||||
title: "提示",
|
||||
message: "您确认要取消报名吗?"
|
||||
})
|
||||
const loading = this.$toast.loading({
|
||||
message: '取消中...',
|
||||
message: "取消中...",
|
||||
forbidClick: true,
|
||||
overlay: true,
|
||||
duration: 0
|
||||
})
|
||||
if (confirm === 'confirm') {
|
||||
const resp = await $.post('/mobile/activity/unionActivity/doSingleCancelRegister', {activityId: this.activityId})
|
||||
if (confirm === "confirm") {
|
||||
const resp = await $.post("/mobile/activity/unionActivity/doSingleCancelRegister", { activityId: this.activityId })
|
||||
if (resp.code === 0) {
|
||||
setTimeout(() => {
|
||||
loading.close()
|
||||
@@ -206,10 +178,10 @@ layout("/mobile/platform.html"){
|
||||
}
|
||||
},
|
||||
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 (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 {
|
||||
this.registerList = resp.data
|
||||
}
|
||||
@@ -220,7 +192,7 @@ layout("/mobile/platform.html"){
|
||||
}
|
||||
},
|
||||
openUserActionSheet() {
|
||||
this.searchKey = ''
|
||||
this.searchKey = ""
|
||||
this.searchUserList = []
|
||||
this.userActionSheet = true
|
||||
},
|
||||
@@ -230,21 +202,20 @@ layout("/mobile/platform.html"){
|
||||
return
|
||||
}
|
||||
this.searchLoading = true
|
||||
const resp = await $.get('/mobile/activity/unionActivity/searchNoRegisterUser', {
|
||||
const resp = await $.get("/mobile/activity/unionActivity/searchNoRegisterUser", {
|
||||
activityId: this.activityId,
|
||||
searchKey: val
|
||||
})
|
||||
if (resp.code === 0) {
|
||||
this.searchLoading = false
|
||||
this.searchUserList = resp.data.list
|
||||
|
||||
} else {
|
||||
this.$toast.fail(resp.msg)
|
||||
}
|
||||
},
|
||||
searchUserAdd(item) {
|
||||
const {id, userName} = item
|
||||
this.registerList.push({id, userName})
|
||||
const { id, userName } = item
|
||||
this.registerList.push({ id, userName })
|
||||
this.$toast.success("添加成功")
|
||||
},
|
||||
async removeRegUser(item) {
|
||||
@@ -253,46 +224,42 @@ layout("/mobile/platform.html"){
|
||||
return
|
||||
}
|
||||
const confirm = await this.$dialog.confirm({
|
||||
title: '提示',
|
||||
message: '您确认要移除吗?',
|
||||
title: "提示",
|
||||
message: "您确认要移除吗?"
|
||||
})
|
||||
if (confirm === 'confirm') {
|
||||
const index = this.registerList.findIndex(v => v.id === item.id)
|
||||
if (confirm === "confirm") {
|
||||
const index = this.registerList.findIndex((v) => v.id === item.id)
|
||||
this.registerList.splice(index, 1)
|
||||
}
|
||||
},
|
||||
//保存
|
||||
async doSave() {
|
||||
if (this.registerList.length === 0) {
|
||||
this.$toast('请添加报名人员后再提交!')
|
||||
this.$toast("请添加报名人员后再提交!")
|
||||
return
|
||||
}
|
||||
if (this.o.signUpMethod === 3) {
|
||||
if (this.registerList.length !== this.o.teamNum) {
|
||||
vant.Dialog.alert({
|
||||
title: '温馨提示',
|
||||
message: '此活动是双人报名模式您需要报名' + this.o.teamNum + '人!',
|
||||
}).then(() => {
|
||||
|
||||
});
|
||||
title: "温馨提示",
|
||||
message: "此活动是双人报名模式您需要报名" + this.o.teamNum + "人!"
|
||||
}).then(() => {})
|
||||
return
|
||||
}
|
||||
if (!this.registerList.map(v => v.id).includes(this.userId)) {
|
||||
if (!this.registerList.map((v) => v.id).includes(this.userId)) {
|
||||
vant.Dialog.alert({
|
||||
title: '温馨提示',
|
||||
message: '此活动是组队模式请您找' + this.o.teamNum + '朋友一起报名!',
|
||||
}).then(() => {
|
||||
|
||||
});
|
||||
title: "温馨提示",
|
||||
message: "此活动是组队模式请您找" + this.o.teamNum + "朋友一起报名!"
|
||||
}).then(() => {})
|
||||
return
|
||||
}
|
||||
// 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
|
||||
let arr = []
|
||||
if (this.addRegisterList && this.addRegisterList.length > 0) {
|
||||
this.addRegisterList.forEach(v => {
|
||||
this.registerList.forEach(r => {
|
||||
this.addRegisterList.forEach((v) => {
|
||||
this.registerList.forEach((r) => {
|
||||
if (v.id === r.id && v.applyUserId !== this.userId) {
|
||||
arr.push(r.userName)
|
||||
}
|
||||
@@ -302,11 +269,9 @@ layout("/mobile/platform.html"){
|
||||
|
||||
if (arr && arr.length > 0) {
|
||||
vant.Dialog.alert({
|
||||
title: '温馨提示',
|
||||
message: '【' + arr.toString() + '】已成功报名您无需再报名!',
|
||||
}).then(() => {
|
||||
|
||||
});
|
||||
title: "温馨提示",
|
||||
message: "【" + arr.toString() + "】已成功报名您无需再报名!"
|
||||
}).then(() => {})
|
||||
return
|
||||
}
|
||||
|
||||
@@ -319,28 +284,27 @@ layout("/mobile/platform.html"){
|
||||
});
|
||||
return
|
||||
}*/
|
||||
|
||||
}
|
||||
let message = ''
|
||||
let message = ""
|
||||
if (this.o.needSign) {
|
||||
message = '此活动开启了签到,需要您活动当天前往签到点位核实活动报名人员后进行签到!'
|
||||
message = "此活动开启了签到,需要您活动当天前往签到点位核实活动报名人员后进行签到!"
|
||||
}
|
||||
const confirm = await this.$dialog.confirm({
|
||||
title: '提示',
|
||||
message: message + '您确认要报名吗?',
|
||||
title: "提示",
|
||||
message: message + "您确认要报名吗?"
|
||||
})
|
||||
if (confirm === 'confirm') {
|
||||
if (confirm === "confirm") {
|
||||
const loading = this.$toast.loading({
|
||||
message: '报名中...',
|
||||
message: "报名中...",
|
||||
forbidClick: true,
|
||||
overlay: true,
|
||||
duration: 0
|
||||
})
|
||||
const params = {
|
||||
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) {
|
||||
await this.getRegisterUser()
|
||||
@@ -362,14 +326,12 @@ layout("/mobile/platform.html"){
|
||||
await this.getActivityInfo()
|
||||
await this.getRegisterUser()
|
||||
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()) {
|
||||
this.$toast.fail("不在活动范围内")
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -3,7 +3,6 @@ layout("/mobile/platform.html"){
|
||||
#-->
|
||||
|
||||
<style>
|
||||
|
||||
.van-index-bar__sidebar {
|
||||
display: none;
|
||||
}
|
||||
@@ -88,55 +87,36 @@ layout("/mobile/platform.html"){
|
||||
.van-cell-group__title {
|
||||
padding: 5px 0 5px 0;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
|
||||
<m-page-loading v-if="mLoading"></m-page-loading>
|
||||
|
||||
<!--top栏-->
|
||||
<van-nav-bar
|
||||
title="社团审核"
|
||||
left-arrow
|
||||
placeholder
|
||||
fixed
|
||||
@click-left="history.go(-1)"
|
||||
safe-area-inset-top
|
||||
></van-nav-bar>
|
||||
<van-nav-bar title="社团审核" left-arrow placeholder fixed @click-left="pjaxReplace('/mobile/index')" safe-area-inset-top></van-nav-bar>
|
||||
|
||||
<!--筛选框-->
|
||||
<div class="search-fixed">
|
||||
<van-search
|
||||
v-model="pageForm.searchKeyword"
|
||||
shape="round"
|
||||
maxlength="10"
|
||||
@search="doSearch"
|
||||
placeholder="请输入工号或姓名进行查询"
|
||||
>
|
||||
</van-search>
|
||||
v-model="pageForm.searchKeyword"
|
||||
shape="round"
|
||||
maxlength="10"
|
||||
@search="doSearch"
|
||||
placeholder="请输入工号或姓名进行查询"
|
||||
></van-search>
|
||||
|
||||
<van-dropdown-menu>
|
||||
<van-dropdown-item v-model="pageForm.radioType" :options="auditOptions"
|
||||
@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.userType" :options="userTypeOptions"
|
||||
@change="doSearch"></van-dropdown-item>
|
||||
<van-dropdown-item v-model="pageForm.radioType" :options="auditOptions" @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.userType" :options="userTypeOptions" @change="doSearch"></van-dropdown-item>
|
||||
</van-dropdown-menu>
|
||||
</div>
|
||||
|
||||
<!--列表-->
|
||||
<div style="margin-top: 116px">
|
||||
<van-list
|
||||
v-model="loading"
|
||||
:finished="finished" :immediate-check="false"
|
||||
:finished-text="tableData.length>0?'没有更多了':''"
|
||||
@load="onLoad">
|
||||
|
||||
<van-list 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 @click="openView(o.id)">
|
||||
|
||||
<div style="display: flex; justify-content: space-between">
|
||||
<div style="width: 74%">
|
||||
<div class="van-ellipsis title">
|
||||
@@ -144,9 +124,7 @@ layout("/mobile/platform.html"){
|
||||
<span>{{o.username}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div style="color: #1867b0;">
|
||||
|
||||
</div>
|
||||
<div style="color: #1867b0"></div>
|
||||
</div>
|
||||
|
||||
<van-divider></van-divider>
|
||||
@@ -180,14 +158,10 @@ layout("/mobile/platform.html"){
|
||||
|
||||
<div style="display: flex; justify-content: flex-end; margin-top: 4px">
|
||||
<div>
|
||||
<van-button @click.stop="openView(o)"
|
||||
type="primary" size="small" color="#1867b0"
|
||||
style="margin-right: 8px; width: auto;">
|
||||
<van-button @click.stop="openView(o)" type="primary" size="small" color="#1867b0" style="margin-right: 8px; width: auto">
|
||||
查看
|
||||
</van-button>
|
||||
<van-button @click.stop="openAudit(o)"
|
||||
type="primary" size="small" color="#1867b0"
|
||||
style="margin-right: 8px; width: auto;">
|
||||
<van-button @click.stop="openAudit(o)" type="primary" size="small" color="#1867b0" style="margin-right: 8px; width: auto">
|
||||
审核
|
||||
</van-button>
|
||||
</div>
|
||||
@@ -195,47 +169,29 @@ layout("/mobile/platform.html"){
|
||||
</div>
|
||||
</div>
|
||||
</van-list>
|
||||
<van-empty
|
||||
v-if="mLoading==false&&tableData.length==0"
|
||||
class="custom-image"
|
||||
image="/none.svg"
|
||||
description="暂无数据"
|
||||
></van-empty>
|
||||
<van-empty v-if="mLoading==false&&tableData.length==0" class="custom-image" image="/none.svg" description="暂无数据"></van-empty>
|
||||
</div>
|
||||
|
||||
<van-popup v-model="infoShow" position="right" :style="{width: '100%', height: '100%' }">
|
||||
<van-nav-bar
|
||||
title="详细信息"
|
||||
left-arrow
|
||||
placeholder
|
||||
fixed
|
||||
@click-left="infoShow = false"
|
||||
safe-area-inset-top
|
||||
></van-nav-bar>
|
||||
<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">
|
||||
<template #handle>
|
||||
<div class="van-cell-group__title">
|
||||
<div class="van-sidebar-item van-sidebar-item--select">
|
||||
社团审核
|
||||
</div>
|
||||
<div class="van-sidebar-item van-sidebar-item--select">社团审核</div>
|
||||
</div>
|
||||
<van-form>
|
||||
<van-field
|
||||
readonly
|
||||
value="${@shiro.getPrincipalProperty('username')}"
|
||||
name="username"
|
||||
label="审核人员"
|
||||
></van-field>
|
||||
<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.auditOpinion"
|
||||
required
|
||||
rows="1"
|
||||
autosize
|
||||
label="审核意见"
|
||||
type="textarea"
|
||||
placeholder="请输入审核意见"
|
||||
<van-field
|
||||
v-model="formData.auditOpinion"
|
||||
required
|
||||
rows="1"
|
||||
autosize
|
||||
label="审核意见"
|
||||
type="textarea"
|
||||
placeholder="请输入审核意见"
|
||||
></van-field>
|
||||
|
||||
<van-field label="审核签字" required style="flex-flow: column">
|
||||
@@ -247,27 +203,23 @@ layout("/mobile/platform.html"){
|
||||
</template>
|
||||
</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-button :color="themeColor" plain block @click="doReview(false)">拒 绝
|
||||
</van-button>
|
||||
<van-button :color="themeColor" plain block @click="doReview(false)">拒 绝</van-button>
|
||||
</van-col>
|
||||
<van-col span="12">
|
||||
<van-button :color="themeColor" block @click="doReview(true)">通 过
|
||||
</van-button>
|
||||
<van-button :color="themeColor" block @click="doReview(true)">通 过</van-button>
|
||||
</van-col>
|
||||
</van-row>
|
||||
|
||||
</van-form>
|
||||
</template>
|
||||
</club-user-apply-info>
|
||||
</van-popup>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
el: "#app",
|
||||
mixins: [mobileMixins],
|
||||
data() {
|
||||
return {
|
||||
@@ -275,26 +227,26 @@ layout("/mobile/platform.html"){
|
||||
clubOptions: [],
|
||||
userTypeOptions: [],
|
||||
auditOptions: [
|
||||
{text: '全部', value: 1},
|
||||
{text: '已审核', value: 2},
|
||||
{text: '未审核', value: 3},
|
||||
{ text: "全部", value: 1 },
|
||||
{ text: "已审核", value: 2 },
|
||||
{ text: "未审核", value: 3 }
|
||||
],
|
||||
pageForm: {
|
||||
radioType: 3
|
||||
},
|
||||
infoShow: false,
|
||||
formData: {},
|
||||
formData: {}
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'club-user-apply-info': httpVueLoader('/components/mobile/club/mobileClubUserApplyInfo.vue?v=1.0.1'),
|
||||
'mobile-sign': httpVueLoader('/components/sign/mobileSign.vue'),
|
||||
"club-user-apply-info": httpVueLoader("/components/mobile/club/mobileClubUserApplyInfo.vue?v=1.0.1"),
|
||||
"mobile-sign": httpVueLoader("/components/sign/mobileSign.vue")
|
||||
},
|
||||
methods: {
|
||||
openAudit(row) {
|
||||
this.formData = {
|
||||
id: row.id,
|
||||
auditTime: moment().format('YYYY-MM-DD'),
|
||||
auditTime: moment().format("YYYY-MM-DD"),
|
||||
username: "${@shiro.getPrincipalProperty('username')}",
|
||||
auditOpinion: null,
|
||||
auditSign: ""
|
||||
@@ -314,11 +266,11 @@ layout("/mobile/platform.html"){
|
||||
},
|
||||
async doReview(flag) {
|
||||
if (!this.formData.auditOpinion) {
|
||||
vant.Toast('请填写审核意见');
|
||||
vant.Toast("请填写审核意见")
|
||||
return
|
||||
}
|
||||
if (this.$refs.signature.checkNull()) {
|
||||
vant.Toast('请签字')
|
||||
vant.Toast("请签字")
|
||||
return
|
||||
}
|
||||
this.$refs.signature.submitSign()
|
||||
@@ -338,7 +290,7 @@ layout("/mobile/platform.html"){
|
||||
},
|
||||
async onLoad() {
|
||||
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) {
|
||||
this.tableData = this.tableData.concat(res.data.list)
|
||||
if (this.tableData.length === res.data.totalCount) {
|
||||
@@ -351,21 +303,21 @@ layout("/mobile/platform.html"){
|
||||
})
|
||||
},
|
||||
async getMyMangeClub() {
|
||||
const {data} = await $.get("/platform/sys/club/users/getMyMangeClub")
|
||||
const { data } = await $.get("/platform/sys/club/users/getMyMangeClub")
|
||||
return data
|
||||
},
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
const data = await this.getMyMangeClub()
|
||||
data.forEach(item => {
|
||||
this.clubOptions.push({text: item.name, value: item.id})
|
||||
data.forEach((item) => {
|
||||
this.clubOptions.push({ text: item.name, value: item.id })
|
||||
})
|
||||
this.clubOptions.unshift({text: '全部社团'})
|
||||
const userType = await getDictOptions('UserType')
|
||||
userType.forEach(item => {
|
||||
this.userTypeOptions.push({text: item.name, value: item.code})
|
||||
this.clubOptions.unshift({ text: "全部社团" })
|
||||
const userType = await getDictOptions("UserType")
|
||||
userType.forEach((item) => {
|
||||
this.userTypeOptions.push({ text: item.name, value: item.code })
|
||||
})
|
||||
this.userTypeOptions.unshift({text: '人员类型'})
|
||||
this.userTypeOptions.unshift({ text: "人员类型" })
|
||||
this.onLoad()
|
||||
}
|
||||
})
|
||||
|
||||
@@ -3,7 +3,6 @@ layout("/mobile/platform.html"){
|
||||
#-->
|
||||
|
||||
<style>
|
||||
|
||||
.van-index-bar__sidebar {
|
||||
display: none;
|
||||
}
|
||||
@@ -69,7 +68,8 @@ layout("/mobile/platform.html"){
|
||||
width: 30%;
|
||||
}
|
||||
|
||||
.van-cell__title, .van-cell__value{
|
||||
.van-cell__title,
|
||||
.van-cell__value {
|
||||
flex: none;
|
||||
}
|
||||
|
||||
@@ -97,52 +97,35 @@ layout("/mobile/platform.html"){
|
||||
background-color: #0e78c5;
|
||||
color: white;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
|
||||
<m-page-loading v-if="mLoading"></m-page-loading>
|
||||
|
||||
<!--top栏-->
|
||||
<van-nav-bar
|
||||
title="加入社团"
|
||||
left-arrow
|
||||
placeholder
|
||||
fixed
|
||||
@click-left="history.go(-1)"
|
||||
safe-area-inset-top
|
||||
></van-nav-bar>
|
||||
<van-nav-bar title="加入社团" left-arrow placeholder fixed @click-left="pjaxReplace('/mobile/index')" safe-area-inset-top></van-nav-bar>
|
||||
|
||||
<!--筛选框-->
|
||||
<div class="search-fixed">
|
||||
<van-search
|
||||
v-model="pageForm.searchKeyword"
|
||||
shape="round"
|
||||
maxlength="10"
|
||||
@search="doSearch"
|
||||
placeholder="请输入社团名称进行查询"
|
||||
>
|
||||
</van-search>
|
||||
v-model="pageForm.searchKeyword"
|
||||
shape="round"
|
||||
maxlength="10"
|
||||
@search="doSearch"
|
||||
placeholder="请输入社团名称进行查询"
|
||||
></van-search>
|
||||
|
||||
<van-dropdown-menu>
|
||||
<van-dropdown-item v-model="pageForm.isjr" :options="clubType"
|
||||
@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.isjr" :options="clubType" @change="doSearch"></van-dropdown-item>
|
||||
<van-dropdown-item v-model="pageForm.clubType" :options="typeOptions" @change="doSearch"></van-dropdown-item>
|
||||
</van-dropdown-menu>
|
||||
</div>
|
||||
|
||||
<!--列表-->
|
||||
<div style="margin-top: 116px">
|
||||
<van-list
|
||||
v-model="loading"
|
||||
:finished="finished" :immediate-check="false" @load="onLoad"
|
||||
:finished-text="tableData.length>0?'没有更多了':''">
|
||||
|
||||
<van-list 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>
|
||||
|
||||
<div style="display: flex; justify-content: space-between">
|
||||
<div style="width: 74%">
|
||||
<div class="van-ellipsis title">
|
||||
@@ -151,7 +134,7 @@ layout("/mobile/platform.html"){
|
||||
</div>
|
||||
<div style="color: grey">{{o.location}}</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==2" style="color: red">社团拒绝</span>
|
||||
<span v-if="o.status==3">待校工会审核</span>
|
||||
@@ -162,14 +145,20 @@ layout("/mobile/platform.html"){
|
||||
|
||||
<div style="margin-top: 4px">
|
||||
<van-row>
|
||||
<van-col span="12"><span style="color: grey">联 系 人:</span>{{o.fzrname}}</van-col>
|
||||
<van-col span="12">
|
||||
<span style="color: grey">联 系 人:</span>
|
||||
{{o.fzrname}}
|
||||
</van-col>
|
||||
<van-col span="12">
|
||||
<span style="color: grey">电  话:</span>
|
||||
<span>{{o.fzr_mobile}}</span>
|
||||
</van-col>
|
||||
</van-row>
|
||||
<van-row>
|
||||
<van-col span="12"><span style="color: grey">会  长:</span>{{o.hz}}</van-col>
|
||||
<van-col span="12">
|
||||
<span style="color: grey">会  长:</span>
|
||||
{{o.hz}}
|
||||
</van-col>
|
||||
<van-col span="12">
|
||||
<span style="color: grey">成立时间:</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>
|
||||
<van-button @click="openInfo(o, 'view')" color="#1867b0"
|
||||
size="small" style="margin-right: 8px" type="primary">
|
||||
<van-button @click="openInfo(o, 'view')" color="#1867b0" size="small" style="margin-right: 8px" type="primary">
|
||||
查看
|
||||
</van-button>
|
||||
<van-button @click="rollback(o)" color="#1867b0"
|
||||
size="small" style="margin-right: 8px" type="primary"
|
||||
v-if="pageForm.isjr === true && (o.status==1 || o.status==3)">撤销申请
|
||||
<van-button
|
||||
@click="rollback(o)"
|
||||
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 @click="openInfo(o, 'join')"
|
||||
color="#1867b0" v-if="pageForm.isjr === false"
|
||||
size="small" style="margin-right: 8px" type="primary">
|
||||
<van-button
|
||||
@click="openInfo(o, 'join')"
|
||||
color="#1867b0"
|
||||
v-if="pageForm.isjr === false"
|
||||
size="small"
|
||||
style="margin-right: 8px"
|
||||
type="primary"
|
||||
>
|
||||
我要加入
|
||||
</van-button>
|
||||
</div>
|
||||
@@ -199,22 +198,11 @@ layout("/mobile/platform.html"){
|
||||
</div>
|
||||
</div>
|
||||
</van-list>
|
||||
<van-empty
|
||||
v-if="mLoading==false&&tableData.length==0"
|
||||
class="custom-image"
|
||||
image="/none.svg"
|
||||
description="暂无数据"
|
||||
></van-empty>
|
||||
<van-empty v-if="mLoading==false&&tableData.length==0" class="custom-image" image="/none.svg" description="暂无数据"></van-empty>
|
||||
</div>
|
||||
|
||||
<van-popup v-model="infoShow" get-container="#app" position="right" :style="{ height: '100%', width: '100%' }">
|
||||
<van-nav-bar
|
||||
title="社团详细信息"
|
||||
left-arrow
|
||||
placeholder
|
||||
fixed
|
||||
@click-left="infoShow = false"
|
||||
safe-area-inset-top></van-nav-bar>
|
||||
<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-tab title="社团信息">
|
||||
<van-cell-group inset>
|
||||
@@ -237,50 +225,130 @@ layout("/mobile/platform.html"){
|
||||
<van-tab v-if="viewType === 'join'" title="个人信息">
|
||||
<van-form @submit="needJoin" ref="form" :show-error-message="false">
|
||||
<van-cell-group inset class="mt10">
|
||||
<van-field readonly v-model="formData.username" name="username"
|
||||
label="姓名" :rules="[{ required: true }]"></van-field>
|
||||
<van-field readonly v-model="formData.sex" name="sex"
|
||||
label="性别" :rules="[{ required: true }]"></van-field>
|
||||
<van-field v-model="formData.birthday" name="birthday" required
|
||||
@click="showPicker = true"
|
||||
placeholder="请填写出生年月" label="出生年月" :rules="[{ required: true }]">
|
||||
</van-field>
|
||||
<van-field readonly v-model="formData.username" name="username" label="姓名" :rules="[{ required: true }]"></van-field>
|
||||
<van-field readonly v-model="formData.sex" name="sex" label="性别" :rules="[{ required: true }]"></van-field>
|
||||
<van-field
|
||||
v-model="formData.birthday"
|
||||
name="birthday"
|
||||
required
|
||||
@click="showPicker = true"
|
||||
placeholder="请填写出生年月"
|
||||
label="出生年月"
|
||||
:rules="[{ required: true }]"
|
||||
></van-field>
|
||||
<van-popup v-model="showPicker" position="bottom">
|
||||
<van-datetime-picker
|
||||
type="date"
|
||||
title="选择年月日"
|
||||
@confirm="(val) => {formData.birthday = moment(val).format('YYYY-MM-DD'); showPicker = false}"
|
||||
@cancel="showPicker = false"
|
||||
type="date"
|
||||
title="选择年月日"
|
||||
@confirm="(val) => {formData.birthday = moment(val).format('YYYY-MM-DD'); showPicker = false}"
|
||||
@cancel="showPicker = false"
|
||||
></van-datetime-picker>
|
||||
</van-popup>
|
||||
<van-field v-model="formData.birthPlace" name="birthPlace" required
|
||||
placeholder="请填写出生地" label="出生地" :rules="[{ required: true }]"></van-field>
|
||||
<van-field v-model="formData.education" name="education" required
|
||||
placeholder="请填写文化程度" label="文化程度" :rules="[{ required: true }]"></van-field>
|
||||
<van-field v-model="formData.hobby" name="hobby" required
|
||||
placeholder="请填写爱好" label="爱好" :rules="[{ required: true }]"></van-field>
|
||||
<van-field v-model="formData.unitName" name="unitName" 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="是否有过特殊病史">
|
||||
<van-field
|
||||
v-model="formData.birthPlace"
|
||||
name="birthPlace"
|
||||
required
|
||||
placeholder="请填写出生地"
|
||||
label="出生地"
|
||||
:rules="[{ required: true }]"
|
||||
></van-field>
|
||||
<van-field
|
||||
v-model="formData.education"
|
||||
name="education"
|
||||
required
|
||||
placeholder="请填写文化程度"
|
||||
label="文化程度"
|
||||
:rules="[{ required: true }]"
|
||||
></van-field>
|
||||
<van-field
|
||||
v-model="formData.hobby"
|
||||
name="hobby"
|
||||
required
|
||||
placeholder="请填写爱好"
|
||||
label="爱好"
|
||||
:rules="[{ required: true }]"
|
||||
></van-field>
|
||||
<van-field
|
||||
v-model="formData.unitName"
|
||||
name="unitName"
|
||||
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>
|
||||
<van-radio-group v-model="formData.medicalHistory" direction="horizontal">
|
||||
<van-radio :name="true">是</van-radio>
|
||||
@@ -288,8 +356,7 @@ layout("/mobile/platform.html"){
|
||||
</van-radio-group>
|
||||
</template>
|
||||
</van-field>
|
||||
<van-field name="joinActivity" required
|
||||
placeholder="是否愿意参加本协会的活动" label="是否愿意参加本协会的活动">
|
||||
<van-field name="joinActivity" required placeholder="是否愿意参加本协会的活动" label="是否愿意参加本协会的活动">
|
||||
<template #input>
|
||||
<van-radio-group v-model="formData.joinActivity" direction="horizontal">
|
||||
<van-radio :name="true">是</van-radio>
|
||||
@@ -297,25 +364,30 @@ layout("/mobile/platform.html"){
|
||||
</van-radio-group>
|
||||
</template>
|
||||
</van-field>
|
||||
<van-field v-model="formData.otherThing" name="otherThing"
|
||||
rows="1"
|
||||
autosize
|
||||
type="textarea"
|
||||
placeholder="是否有特别需要说明的问题(身体或心理)" label="是否有特别需要说明的问题"></van-field>
|
||||
<van-field v-model="formData.remark" name="remark"
|
||||
rows="1"
|
||||
autosize
|
||||
type="textarea"
|
||||
placeholder="备注" label="备注"></van-field>
|
||||
<van-field name="photo" label="两寸登记照" required
|
||||
style="flex-flow: column" input-align="left">
|
||||
<van-field
|
||||
v-model="formData.otherThing"
|
||||
name="otherThing"
|
||||
rows="1"
|
||||
autosize
|
||||
type="textarea"
|
||||
placeholder="是否有特别需要说明的问题(身体或心理)"
|
||||
label="是否有特别需要说明的问题"
|
||||
></van-field>
|
||||
<van-field
|
||||
v-model="formData.remark"
|
||||
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>
|
||||
<div class="mb10">两寸登记照</div>
|
||||
</template>
|
||||
<template #input>
|
||||
<vant-file-upload
|
||||
:max="1"
|
||||
:files.sync="formData.photo"></vant-file-upload>
|
||||
<vant-file-upload :max="1" :files.sync="formData.photo"></vant-file-upload>
|
||||
</template>
|
||||
</van-field>
|
||||
</van-cell-group>
|
||||
@@ -326,12 +398,11 @@ layout("/mobile/platform.html"){
|
||||
</van-tab>
|
||||
</van-tabs>
|
||||
</van-popup>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
el: "#app",
|
||||
mixins: [mobileMixins],
|
||||
data() {
|
||||
return {
|
||||
@@ -339,20 +410,23 @@ layout("/mobile/platform.html"){
|
||||
infoActive: 0,
|
||||
clickRow: {},
|
||||
typeOptions: [],
|
||||
clubType: [{text: '未加入', value: false}, {text: '已加入', value: true}],
|
||||
clubType: [
|
||||
{ text: "未加入", value: false },
|
||||
{ text: "已加入", value: true }
|
||||
],
|
||||
infoShow: false,
|
||||
detailData: {},
|
||||
viewType: '',
|
||||
viewType: ""
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
showCode(type) {
|
||||
if(type === 'QQ' && this.clickRow.qqgroupcode) {
|
||||
const ids = JSON.parse(this.clickRow.qqgroupcode).map(o => FILE_DOMAIN + '/fileStreamPreview?id=' + o.id)
|
||||
vant.ImagePreview({images: ids})
|
||||
} else if(type === 'weChat' && this.clickRow.wechatgroupcode) {
|
||||
const ids = JSON.parse(this.clickRow.wechatgroupcode).map(o => FILE_DOMAIN + '/fileStreamPreview?id=' + o.id)
|
||||
vant.ImagePreview({images: ids})
|
||||
if (type === "QQ" && this.clickRow.qqgroupcode) {
|
||||
const ids = JSON.parse(this.clickRow.qqgroupcode).map((o) => FILE_DOMAIN + "/fileStreamPreview?id=" + o.id)
|
||||
vant.ImagePreview({ images: ids })
|
||||
} else if (type === "weChat" && this.clickRow.wechatgroupcode) {
|
||||
const ids = JSON.parse(this.clickRow.wechatgroupcode).map((o) => FILE_DOMAIN + "/fileStreamPreview?id=" + o.id)
|
||||
vant.ImagePreview({ images: ids })
|
||||
}
|
||||
},
|
||||
doSearch() {
|
||||
@@ -363,7 +437,7 @@ layout("/mobile/platform.html"){
|
||||
},
|
||||
async onLoad() {
|
||||
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) {
|
||||
this.tableData = this.tableData.concat(res.data.list)
|
||||
if (this.tableData.length === res.data.totalCount) {
|
||||
@@ -377,8 +451,8 @@ layout("/mobile/platform.html"){
|
||||
},
|
||||
openInfo(row, type) {
|
||||
this.viewType = type
|
||||
this.infoActive = type === 'view' ? 0 : 1
|
||||
if(type === 'join') {
|
||||
this.infoActive = type === "view" ? 0 : 1
|
||||
if (type === "join") {
|
||||
this.formData = {
|
||||
username: "${@shiro.getPrincipalProperty('username')}",
|
||||
sex: "${@shiro.getPrincipalProperty('sex')}",
|
||||
@@ -390,80 +464,97 @@ layout("/mobile/platform.html"){
|
||||
position: "${@shiro.getPrincipalProperty('position')}",
|
||||
mobile: "${@shiro.getPrincipalProperty('mobile')}",
|
||||
email: "${@shiro.getPrincipalProperty('email')}",
|
||||
homeAddress: "${@shiro.getPrincipalProperty('homeAddress')}",
|
||||
homeAddress: "${@shiro.getPrincipalProperty('homeAddress')}"
|
||||
}
|
||||
}
|
||||
this.clickRow = row
|
||||
$.get("/platform/sys/club/mange/findOne", {id: row.id}, (data) => {
|
||||
if (data.code === 0) {
|
||||
this.detailData = data.data
|
||||
this.infoShow = true
|
||||
}
|
||||
}, "json");
|
||||
$.get(
|
||||
"/platform/sys/club/mange/findOne",
|
||||
{ id: row.id },
|
||||
(data) => {
|
||||
if (data.code === 0) {
|
||||
this.detailData = data.data
|
||||
this.infoShow = true
|
||||
}
|
||||
},
|
||||
"json"
|
||||
)
|
||||
},
|
||||
async needJoin() {
|
||||
const row = this.clickRow
|
||||
if(this.formData.medicalHistory === '' || this.formData.medicalHistory === undefined || this.formData.medicalHistory === null) {
|
||||
vant.Toast('请选择是否有过特殊病史')
|
||||
if (this.formData.medicalHistory === "" || this.formData.medicalHistory === undefined || this.formData.medicalHistory === null) {
|
||||
vant.Toast("请选择是否有过特殊病史")
|
||||
return
|
||||
}
|
||||
if(this.formData.joinActivity === '' || this.formData.joinActivity === undefined || this.formData.joinActivity === null) {
|
||||
vant.Toast('请选择是否愿意参加本协会的活动')
|
||||
if (this.formData.joinActivity === "" || this.formData.joinActivity === undefined || this.formData.joinActivity === null) {
|
||||
vant.Toast("请选择是否愿意参加本协会的活动")
|
||||
return
|
||||
}
|
||||
if(this.formData.photo === '' || this.formData.photo === undefined || this.formData.photo === null) {
|
||||
vant.Toast('请上传两寸登记照')
|
||||
if (this.formData.photo === "" || this.formData.photo === undefined || this.formData.photo === null) {
|
||||
vant.Toast("请上传两寸登记照")
|
||||
return
|
||||
}
|
||||
const {code, data} = await $.post('/platform/sys/club/sq/getInClubByCurUser')
|
||||
let str = ''
|
||||
const { code, data } = await $.post("/platform/sys/club/sq/getInClubByCurUser")
|
||||
let str = ""
|
||||
if (data && data.length > 0) {
|
||||
str = '您已经加入了'
|
||||
str = "您已经加入了"
|
||||
data.forEach((item) => {
|
||||
str += '【' + item.name + '】'
|
||||
str += "【" + item.name + "】"
|
||||
})
|
||||
str += ','
|
||||
str += ","
|
||||
}
|
||||
str += '请确认是否申请加入【' + row.name + '】?'
|
||||
vant.Dialog.confirm({title: '提示', message: str,}).then(() => {
|
||||
this.formData.clubid = row.id
|
||||
this.formData.photo = this.formData.photo[0].filepath
|
||||
$.post("/platform/sys/club/sq/submit", this.formData, (data) => {
|
||||
if (data.code === 0) {
|
||||
vant.Toast(data.msg)
|
||||
this.doSearch()
|
||||
this.infoShow = false
|
||||
} else {
|
||||
vant.Toast(data.msg)
|
||||
}
|
||||
}, "json");
|
||||
}).catch(() => {
|
||||
});
|
||||
str += "请确认是否申请加入【" + row.name + "】?"
|
||||
vant.Dialog.confirm({ title: "提示", message: str })
|
||||
.then(() => {
|
||||
this.formData.clubid = row.id
|
||||
this.formData.photo = this.formData.photo[0].filepath
|
||||
$.post(
|
||||
"/platform/sys/club/sq/submit",
|
||||
this.formData,
|
||||
(data) => {
|
||||
if (data.code === 0) {
|
||||
vant.Toast(data.msg)
|
||||
this.doSearch()
|
||||
this.infoShow = false
|
||||
} else {
|
||||
vant.Toast(data.msg)
|
||||
}
|
||||
},
|
||||
"json"
|
||||
)
|
||||
})
|
||||
.catch(() => {})
|
||||
},
|
||||
rollback(o) {
|
||||
vant.Dialog.confirm({title: '提示', message: '请确定是否撤销申请?',}).then(() => {
|
||||
const id = o.id
|
||||
$.post("/platform/sys/club/sq/revocation", {id}, (data) => {
|
||||
if (data.code === 0) {
|
||||
vant.Toast('撤销申请成功');
|
||||
this.doSearch();
|
||||
} else {
|
||||
vant.Toast(data.msg);
|
||||
}
|
||||
}, "json");
|
||||
}).catch(() => {
|
||||
});
|
||||
vant.Dialog.confirm({ title: "提示", message: "请确定是否撤销申请?" })
|
||||
.then(() => {
|
||||
const id = o.id
|
||||
$.post(
|
||||
"/platform/sys/club/sq/revocation",
|
||||
{ id },
|
||||
(data) => {
|
||||
if (data.code === 0) {
|
||||
vant.Toast("撤销申请成功")
|
||||
this.doSearch()
|
||||
} else {
|
||||
vant.Toast(data.msg)
|
||||
}
|
||||
},
|
||||
"json"
|
||||
)
|
||||
})
|
||||
.catch(() => {})
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
const data = await getClubType()
|
||||
data.forEach(item => {
|
||||
this.typeOptions.push({text: item.name, value: item.code})
|
||||
data.forEach((item) => {
|
||||
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, "isjr", this.clubType[0].value)
|
||||
this.pageForm.searchName = 'club.name'
|
||||
this.pageForm.searchName = "club.name"
|
||||
this.onLoad()
|
||||
}
|
||||
})
|
||||
|
||||
@@ -3,7 +3,6 @@ layout("/mobile/platform.html"){
|
||||
#-->
|
||||
|
||||
<style>
|
||||
|
||||
.van-index-bar__sidebar {
|
||||
display: none;
|
||||
}
|
||||
@@ -83,51 +82,34 @@ layout("/mobile/platform.html"){
|
||||
.userPopup .van-cell {
|
||||
padding: 10px 0px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
|
||||
<m-page-loading v-if="mLoading"></m-page-loading>
|
||||
|
||||
<!--top栏-->
|
||||
<van-nav-bar
|
||||
@click-left="history.go(-1)"
|
||||
fixed
|
||||
left-arrow
|
||||
placeholder
|
||||
safe-area-inset-top
|
||||
title="校工会审核"
|
||||
></van-nav-bar>
|
||||
<van-nav-bar @click-left="pjaxReplace('/mobile/index')" fixed left-arrow placeholder safe-area-inset-top title="校工会审核"></van-nav-bar>
|
||||
|
||||
<!--筛选框-->
|
||||
<div class="search-fixed">
|
||||
<van-search
|
||||
@search="doSearch"
|
||||
maxlength="10"
|
||||
placeholder="请输入社团名称进行查询"
|
||||
shape="round"
|
||||
v-model="pageForm.searchKeyword"
|
||||
>
|
||||
</van-search>
|
||||
@search="doSearch"
|
||||
maxlength="10"
|
||||
placeholder="请输入社团名称进行查询"
|
||||
shape="round"
|
||||
v-model="pageForm.searchKeyword"
|
||||
></van-search>
|
||||
|
||||
<van-dropdown-menu>
|
||||
<van-dropdown-item :options="typeOptions" @change="doSearch"
|
||||
v-model="pageForm.clubType"></van-dropdown-item>
|
||||
<van-dropdown-item :options="typeOptions" @change="doSearch" v-model="pageForm.clubType"></van-dropdown-item>
|
||||
</van-dropdown-menu>
|
||||
</div>
|
||||
|
||||
<!--列表-->
|
||||
<div style="margin-top: 116px">
|
||||
<van-list
|
||||
:finished="finished"
|
||||
:finished-text="tableData.length>0?'没有更多了':''" :immediate-check="false" @load="onLoad"
|
||||
v-model="loading"
|
||||
>
|
||||
|
||||
<van-list :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 @click="openView(o.id)">
|
||||
|
||||
<div style="display: flex; justify-content: space-between">
|
||||
<div style="width: 74%">
|
||||
<div class="van-ellipsis title">
|
||||
@@ -147,19 +129,34 @@ layout("/mobile/platform.html"){
|
||||
|
||||
<div style="margin-top: 4px">
|
||||
<van-row>
|
||||
<van-col span="12"><span style="color: grey">联 系 人:</span>{{o.fzrname}}</van-col>
|
||||
<van-col span="12"><span style="color: grey">电  话:</span>{{o.fzr_mobile}}
|
||||
<van-col span="12">
|
||||
<span style="color: grey">联 系 人:</span>
|
||||
{{o.fzrname}}
|
||||
</van-col>
|
||||
<van-col span="12">
|
||||
<span style="color: grey">电  话:</span>
|
||||
{{o.fzr_mobile}}
|
||||
</van-col>
|
||||
</van-row>
|
||||
<van-row>
|
||||
<van-col span="12"><span style="color: grey">限定人数:</span>{{o.number}}人</van-col>
|
||||
<van-col span="12"><span style="color: grey">当前人数:</span>{{o.people_num}}</van-col>
|
||||
<van-col span="12">
|
||||
<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-col class="cus_overflow" span="24">
|
||||
<span style="color: grey">介绍链接:</span>
|
||||
<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>
|
||||
<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-row>
|
||||
</div>
|
||||
@@ -168,25 +165,32 @@ layout("/mobile/platform.html"){
|
||||
|
||||
<div style="display: flex; justify-content: flex-end">
|
||||
<div>
|
||||
<van-button @click.stop="getAuditList(o)" class="cus_button"
|
||||
color="#1867b0" size="small" style="margin-right: 8px; width: auto;"
|
||||
type="primary">已审{{o.has_audit}}
|
||||
<van-button
|
||||
@click.stop="getAuditList(o)"
|
||||
class="cus_button"
|
||||
color="#1867b0"
|
||||
size="small"
|
||||
style="margin-right: 8px; width: auto"
|
||||
type="primary"
|
||||
>
|
||||
已审{{o.has_audit}}
|
||||
</van-button>
|
||||
<van-button @click.stop="openView(o)" class="cus_button"
|
||||
color="#1867b0" size="small" style="margin-right: 8px; width: auto;"
|
||||
type="primary">未审{{o.no_audit}}
|
||||
<van-button
|
||||
@click.stop="openView(o)"
|
||||
class="cus_button"
|
||||
color="#1867b0"
|
||||
size="small"
|
||||
style="margin-right: 8px; width: auto"
|
||||
type="primary"
|
||||
>
|
||||
未审{{o.no_audit}}
|
||||
</van-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</van-list>
|
||||
<van-empty
|
||||
class="custom-image"
|
||||
description="暂无数据"
|
||||
image="/none.svg"
|
||||
v-if="mLoading==false&&tableData.length==0"
|
||||
></van-empty>
|
||||
<van-empty class="custom-image" description="暂无数据" image="/none.svg" v-if="mLoading==false&&tableData.length==0"></van-empty>
|
||||
</div>
|
||||
|
||||
<!--审核人员-->
|
||||
@@ -196,35 +200,50 @@ layout("/mobile/platform.html"){
|
||||
<div style="display: flex; justify-content: space-between; margin-bottom: 10px">
|
||||
<div v-if="queryType === 'notAudit'">
|
||||
<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>
|
||||
<van-tag @click="toggleAll()" plain size="large" style="margin-left: 6px" type="primary">反选</van-tag>
|
||||
</div>
|
||||
</div>
|
||||
<van-checkbox-group ref="checkboxGroup" v-if="userList !== null" v-model="result">
|
||||
<van-cell-group>
|
||||
<van-cell
|
||||
:key="obj.id"
|
||||
@click="toggle(index)" class="cus_cell"
|
||||
clickable
|
||||
v-for="(obj, index) in userList">
|
||||
|
||||
<div><span style="color: grey">姓  名:</span>{{obj.username}}</div>
|
||||
<div><span style="color: grey">工  号:</span>{{obj.loginname}}</div>
|
||||
<div><span style="color: grey">单  位:</span>{{obj.unitname}}</div>
|
||||
<div><span style="color: grey">性  别:</span>{{obj.sex}}</div>
|
||||
<div><span style="color: grey">联系方式:</span>{{obj.mobile}}</div>
|
||||
<van-cell :key="obj.id" @click="toggle(index)" class="cus_cell" clickable v-for="(obj, index) in userList">
|
||||
<div>
|
||||
<span style="color: grey">姓  名:</span>
|
||||
{{obj.username}}
|
||||
</div>
|
||||
<div>
|
||||
<span style="color: grey">工  号:</span>
|
||||
{{obj.loginname}}
|
||||
</div>
|
||||
<div>
|
||||
<span style="color: grey">单  位:</span>
|
||||
{{obj.unitname}}
|
||||
</div>
|
||||
<div>
|
||||
<span style="color: grey">性  别:</span>
|
||||
{{obj.sex}}
|
||||
</div>
|
||||
<div>
|
||||
<span style="color: grey">联系方式:</span>
|
||||
{{obj.mobile}}
|
||||
</div>
|
||||
<!--<span style="display: inline-block; width: 86px">{{obj.username}}</span>
|
||||
<span class="unit">{{obj.unitname}}</span>
|
||||
<br/>
|
||||
<span style="display: inline-block; width: 85px">{{obj.sex}}</span>
|
||||
<span style="display: inline-block; width: 106px">13296575967</span>
|
||||
<span style="display: inline-block;">{{obj.loginname}}</span>-->
|
||||
<van-icon class="audit_icon" color="green"
|
||||
name="passed"
|
||||
v-if="queryType === 'hasAudit' && obj.auditstate === true"></van-icon>
|
||||
<van-icon class="audit_icon" color="grey"
|
||||
name="close"
|
||||
v-if="queryType === 'hasAudit' && obj.auditstate === false"></van-icon>
|
||||
<van-icon
|
||||
class="audit_icon"
|
||||
color="green"
|
||||
name="passed"
|
||||
v-if="queryType === 'hasAudit' && obj.auditstate === true"
|
||||
></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'">
|
||||
<van-checkbox :name="obj.id" ref="checkboxes"></van-checkbox>
|
||||
</template>
|
||||
@@ -232,22 +251,15 @@ layout("/mobile/platform.html"){
|
||||
</van-cell-group>
|
||||
</van-checkbox-group>
|
||||
<div style="margin-top: 4px; text-align: center" v-else>暂无申请人员</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div style="display: flex; justify-content: space-evenly; position: fixed; bottom: 56px; width: 95%"
|
||||
v-if="queryType === 'notAudit'">
|
||||
<van-button @click="audit('many', 'reject')" color="#ff976a" size="small" style="height: 38px">驳回
|
||||
</van-button>
|
||||
<van-button @click="audit('many', 'pass')" color="#1867b0" size="small" style="height: 38px">通过
|
||||
</van-button>
|
||||
<div style="display: flex; justify-content: space-evenly; position: fixed; bottom: 56px; width: 95%" v-if="queryType === 'notAudit'">
|
||||
<van-button @click="audit('many', 'reject')" color="#ff976a" size="small" style="height: 38px">驳回</van-button>
|
||||
<van-button @click="audit('many', 'pass')" color="#1867b0" size="small" style="height: 38px">通过</van-button>
|
||||
</div>
|
||||
<div style="display: flex; justify-content: space-evenly; position: fixed; bottom: 10px; width: 95%"
|
||||
v-if="queryType === 'notAudit'">
|
||||
<van-button @click="audit('all', 'reject')" color="#ff976a" size="small" style="height: 38px">一键全部驳回
|
||||
</van-button>
|
||||
<van-button @click="audit('all', 'pass')" color="#1867b0" size="small" style="height: 38px">一键全部通过
|
||||
</van-button>
|
||||
<div style="display: flex; justify-content: space-evenly; position: fixed; bottom: 10px; width: 95%" v-if="queryType === 'notAudit'">
|
||||
<van-button @click="audit('all', 'reject')" color="#ff976a" size="small" style="height: 38px">一键全部驳回</van-button>
|
||||
<van-button @click="audit('all', 'pass')" color="#1867b0" size="small" style="height: 38px">一键全部通过</van-button>
|
||||
</div>
|
||||
</div>
|
||||
</van-action-sheet>
|
||||
@@ -255,65 +267,66 @@ layout("/mobile/platform.html"){
|
||||
|
||||
<script>
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
el: "#app",
|
||||
mixins: [mobileMixins],
|
||||
data() {
|
||||
return {
|
||||
queryType: '',
|
||||
queryType: "",
|
||||
result: [],
|
||||
userList: [],
|
||||
userShow: false,
|
||||
clickRow: {},
|
||||
typeOptions: [],
|
||||
typeOptions: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async audit(type, auditType) {
|
||||
if (type === 'many' && this.result.length === 0) {
|
||||
vant.Toast('请先选择人员')
|
||||
if (type === "many" && this.result.length === 0) {
|
||||
vant.Toast("请先选择人员")
|
||||
return
|
||||
}
|
||||
const str = type === 'many' ? '您选择了' + this.result.length + '个人,请确认您的选择!' : '您确定要一键全部审核吗?'
|
||||
vant.Dialog.confirm({title: '提示', message: str,}).then(async () => {
|
||||
let idList = this.result
|
||||
if (type === 'all') {
|
||||
idList = this.userList.map(o => o.id)
|
||||
}
|
||||
const resp = await $.post('/platform/sys/club/sh/check', {
|
||||
ids: JSON.stringify(idList),
|
||||
flag: auditType === 'pass',
|
||||
type: 2,
|
||||
const str = type === "many" ? "您选择了" + this.result.length + "个人,请确认您的选择!" : "您确定要一键全部审核吗?"
|
||||
vant.Dialog.confirm({ title: "提示", message: str })
|
||||
.then(async () => {
|
||||
let idList = this.result
|
||||
if (type === "all") {
|
||||
idList = this.userList.map((o) => o.id)
|
||||
}
|
||||
const resp = await $.post("/platform/sys/club/sh/check", {
|
||||
ids: JSON.stringify(idList),
|
||||
flag: auditType === "pass",
|
||||
type: 2
|
||||
})
|
||||
if (resp.code === 0) {
|
||||
this.doSearch()
|
||||
}
|
||||
vant.Toast(resp.msg)
|
||||
this.userShow = false
|
||||
})
|
||||
if (resp.code === 0) {
|
||||
this.doSearch()
|
||||
}
|
||||
vant.Toast(resp.msg)
|
||||
this.userShow = false
|
||||
}).catch(() => {
|
||||
});
|
||||
.catch(() => {})
|
||||
},
|
||||
checkAll() {
|
||||
this.$refs.checkboxGroup.children.forEach(item => item.toggle(true))
|
||||
this.$refs.checkboxGroup.children.forEach((item) => item.toggle(true))
|
||||
},
|
||||
toggleAll() {
|
||||
this.$refs.checkboxGroup.children.forEach(item => item.toggle())
|
||||
this.$refs.checkboxGroup.children.forEach((item) => item.toggle())
|
||||
},
|
||||
toggle(index) {
|
||||
this.$refs.checkboxes[index].toggle();
|
||||
this.$refs.checkboxes[index].toggle()
|
||||
},
|
||||
popClose() {
|
||||
this.$nextTick(function () {
|
||||
if (this.$refs.checkboxes !== undefined) {
|
||||
this.$refs.checkboxes.forEach(item => item.toggle(false));
|
||||
this.$refs.checkboxes.forEach((item) => item.toggle(false))
|
||||
}
|
||||
})
|
||||
},
|
||||
async getAuditList(o) {
|
||||
this.queryType = 'hasAudit'
|
||||
const resp = await $.post('/platform/sys/club/sh/getClubUser', {
|
||||
this.queryType = "hasAudit"
|
||||
const resp = await $.post("/platform/sys/club/sh/getClubUser", {
|
||||
id: o.id,
|
||||
auditType: 'hasAudit',
|
||||
type: 2,
|
||||
auditType: "hasAudit",
|
||||
type: 2
|
||||
})
|
||||
if (resp.code === 0) {
|
||||
this.userList = resp.data
|
||||
@@ -324,24 +337,24 @@ layout("/mobile/platform.html"){
|
||||
}
|
||||
},
|
||||
async openView(o) {
|
||||
this.queryType = 'notAudit'
|
||||
this.queryType = "notAudit"
|
||||
this.userList = []
|
||||
const resp = await $.post('/platform/sys/club/sh/getClubUser', {
|
||||
const resp = await $.post("/platform/sys/club/sh/getClubUser", {
|
||||
id: o.id,
|
||||
auditType: 'notAudit',
|
||||
type: 2,
|
||||
auditType: "notAudit",
|
||||
type: 2
|
||||
})
|
||||
if (resp.code === 0) {
|
||||
this.userList = resp.data
|
||||
this.userClickList = []
|
||||
if (this.userList.length === 0) {
|
||||
vant.Toast('暂无申请人员')
|
||||
vant.Toast("暂无申请人员")
|
||||
} else {
|
||||
this.userShow = true
|
||||
}
|
||||
return
|
||||
}
|
||||
vant.Toast('系统错误,请联系管理员')
|
||||
vant.Toast("系统错误,请联系管理员")
|
||||
},
|
||||
doSearch() {
|
||||
this.pageForm.pageNumber = 1
|
||||
@@ -352,7 +365,7 @@ layout("/mobile/platform.html"){
|
||||
async onLoad() {
|
||||
this.loading = true
|
||||
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) {
|
||||
this.tableData = this.tableData.concat(res.data.list)
|
||||
if (this.tableData.length === res.data.totalCount) {
|
||||
@@ -363,14 +376,14 @@ layout("/mobile/platform.html"){
|
||||
}
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
const data = await getClubType()
|
||||
data.forEach(item => {
|
||||
this.typeOptions.push({text: item.name, value: item.code})
|
||||
data.forEach((item) => {
|
||||
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.onLoad()
|
||||
}
|
||||
|
||||
@@ -3,149 +3,208 @@ layout("/mobile/platform.html"){
|
||||
#-->
|
||||
|
||||
<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>
|
||||
<van-form ref="addForm" :show-error-message="false" input-align="right" style="margin-bottom: 60px">
|
||||
<van-cell-group inset class="mt10">
|
||||
<van-field readonly value="${@shiro.getPrincipalProperty('username')}" name="manager_name"
|
||||
label="经办人姓名"></van-field>
|
||||
<van-field readonly value="${@shiro.getPrincipalProperty('loginname')}" name="manager_name"
|
||||
label="经办人工号"></van-field>
|
||||
<van-field @input="userRemoteMethod" name="be_user_name"
|
||||
required
|
||||
v-model="formData.be_user_name" label="慰问对象" placeholder="请输入慰问对象"
|
||||
:rules="[{ required: true, message: '请填写慰问对象' }]"></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 readonly value="${@shiro.getPrincipalProperty('username')}" name="manager_name" label="经办人姓名"></van-field>
|
||||
<van-field readonly value="${@shiro.getPrincipalProperty('loginname')}" name="manager_name" label="经办人工号"></van-field>
|
||||
<van-field
|
||||
@input="userRemoteMethod"
|
||||
name="be_user_name"
|
||||
required
|
||||
v-model="formData.be_user_name"
|
||||
label="慰问对象"
|
||||
placeholder="请输入慰问对象"
|
||||
:rules="[{ required: true, message: '请填写慰问对象' }]"
|
||||
></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"
|
||||
required :rules="[{ required: true, message: '请选择收款人' }]"
|
||||
v-model="formData.payee_name" label="收款人" placeholder="请输入收款人"></van-field>
|
||||
<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
|
||||
@input="payeeUserRemoteMethod"
|
||||
name="payee_name"
|
||||
required
|
||||
:rules="[{ required: true, message: '请选择收款人' }]"
|
||||
v-model="formData.payee_name"
|
||||
label="收款人"
|
||||
placeholder="请输入收款人"
|
||||
></van-field>
|
||||
<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"
|
||||
label="收款人银行卡" placeholder="请输入收款人银行卡"></van-field>
|
||||
<van-field v-model="formData.payee_bank_name" name="payee_bank_name"
|
||||
label="收款人开户行" placeholder="请输入收款人开户行"></van-field>-->
|
||||
|
||||
|
||||
<van-field readonly clickable name="type" :value="formData.typeName"
|
||||
required
|
||||
label="慰问类型"
|
||||
@click="showTypePicker = true" placeholder="点击选择慰问类型"
|
||||
:rules="[{ required:true, message: '请选择慰问类型'}]"></van-field>
|
||||
<van-field
|
||||
readonly
|
||||
clickable
|
||||
name="type"
|
||||
:value="formData.typeName"
|
||||
required
|
||||
label="慰问类型"
|
||||
@click="showTypePicker = true"
|
||||
placeholder="点击选择慰问类型"
|
||||
:rules="[{ required:true, message: '请选择慰问类型'}]"
|
||||
></van-field>
|
||||
<van-popup v-model:show="showTypePicker" position="bottom" round>
|
||||
<van-picker show-toolbar :columns="typeColumns" @confirm="onTypeConfirm"
|
||||
@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-picker show-toolbar :columns="typeColumns" @confirm="onTypeConfirm" @cancel="showTypePicker = 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"
|
||||
readonly
|
||||
clickable
|
||||
name="way"
|
||||
:value="formData.wayName"
|
||||
label="慰问方式"
|
||||
required
|
||||
placeholder="点击选择慰问方式"
|
||||
:rules="[{ required:true, message: '请选择慰问方式'}]"
|
||||
></van-field>
|
||||
<van-calendar v-model="showOccurTime"
|
||||
@confirm="onOccurTimeConfirm"
|
||||
:min-date="minDate"
|
||||
:max-date="maxDate"
|
||||
:color="themeColor"></van-calendar>
|
||||
<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-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)">
|
||||
<van-field v-model="formData.the_hospital" name="the_hospital" label="治疗医院"
|
||||
placeholder="请填写治疗医院" required
|
||||
: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>
|
||||
<van-field
|
||||
v-model="formData.the_hospital"
|
||||
name="the_hospital"
|
||||
label="治疗医院"
|
||||
placeholder="请填写治疗医院"
|
||||
required
|
||||
: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 v-if="['4'].includes(formData.type)">
|
||||
<van-field v-model="formData.hospital_by" name="hospital_by" label="患病病种"
|
||||
placeholder="请填写患病病种" required
|
||||
:rules="[{ required:true, message: '请填写患病病种' }]"></van-field>
|
||||
<van-field
|
||||
v-model="formData.hospital_by"
|
||||
name="hospital_by"
|
||||
label="患病病种"
|
||||
placeholder="请填写患病病种"
|
||||
required
|
||||
:rules="[{ required:true, message: '请填写患病病种' }]"
|
||||
></van-field>
|
||||
</template>
|
||||
|
||||
<template v-if="['6'].includes(formData.type)">
|
||||
<van-field v-model="formData.deadImmediateFamily" name="deadImmediateFamily" label="直系亲属"
|
||||
placeholder="配偶、父亲、母亲、子女" required
|
||||
:rules="[{ required:true, message: '必填' }]"></van-field>
|
||||
<van-field
|
||||
v-model="formData.deadImmediateFamily"
|
||||
name="deadImmediateFamily"
|
||||
label="直系亲属"
|
||||
placeholder="配偶、父亲、母亲、子女"
|
||||
required
|
||||
:rules="[{ required:true, message: '必填' }]"
|
||||
></van-field>
|
||||
</template>
|
||||
|
||||
<!-- <template-->
|
||||
<!-- v-if="['c7175af55693441e8233be4552cef9d5','0872ea0b95aa463fb8d98c46bdf72537'].includes(formData.type)">-->
|
||||
<!-- <van-field :value="formData.hospital_stay"-->
|
||||
<!-- readonly clickable required-->
|
||||
<!-- @click="hospital_stay = true"-->
|
||||
<!-- name="hospital_stay" label="住院时间"-->
|
||||
<!-- placeholder="请选择住院时间"-->
|
||||
<!-- :rules="[{ required:true, message: '请选择住院时间' }]"></van-field>-->
|
||||
<!-- <van-calendar v-model="hospital_stay" type="range" @confirm="onConfirm"-->
|
||||
<!-- :min-date="new Date('1999-01-01')"-->
|
||||
<!-- :color="themeColor"></van-calendar>-->
|
||||
<!-- <template-->
|
||||
<!-- v-if="['c7175af55693441e8233be4552cef9d5','0872ea0b95aa463fb8d98c46bdf72537'].includes(formData.type)">-->
|
||||
<!-- <van-field :value="formData.hospital_stay"-->
|
||||
<!-- readonly clickable required-->
|
||||
<!-- @click="hospital_stay = true"-->
|
||||
<!-- name="hospital_stay" label="住院时间"-->
|
||||
<!-- placeholder="请选择住院时间"-->
|
||||
<!-- :rules="[{ required:true, message: '请选择住院时间' }]"></van-field>-->
|
||||
<!-- <van-calendar v-model="hospital_stay" type="range" @confirm="onConfirm"-->
|
||||
<!-- :min-date="new Date('1999-01-01')"-->
|
||||
<!-- :color="themeColor"></van-calendar>-->
|
||||
|
||||
<!-- <van-field v-model="formData.the_hospital" name="the_hospital" name="type" label="所在医院"-->
|
||||
<!-- placeholder="请填写所在医院" required-->
|
||||
<!-- :rules="[{ required:true, message: '请填写所在医院' }]"></van-field>-->
|
||||
<!-- </template>-->
|
||||
<!-- <van-field v-model="formData.the_hospital" name="the_hospital" name="type" label="所在医院"-->
|
||||
<!-- placeholder="请填写所在医院" required-->
|
||||
<!-- :rules="[{ required:true, message: '请填写所在医院' }]"></van-field>-->
|
||||
<!-- </template>-->
|
||||
|
||||
<van-field v-model="formData.remark" name="remark" label="申请事由" style="flex-flow: column"
|
||||
required
|
||||
:rules="[{ required:true, message: '请填写申请事由' }]"
|
||||
placeholder="请填写申请事由"
|
||||
input-align="left"
|
||||
rows="3" maxlength="200" type="textarea" show-word-limit autosize>
|
||||
<van-field
|
||||
v-model="formData.remark"
|
||||
name="remark"
|
||||
label="申请事由"
|
||||
style="flex-flow: column"
|
||||
required
|
||||
:rules="[{ required:true, message: '请填写申请事由' }]"
|
||||
placeholder="请填写申请事由"
|
||||
input-align="left"
|
||||
rows="3"
|
||||
maxlength="200"
|
||||
type="textarea"
|
||||
show-word-limit
|
||||
autosize
|
||||
>
|
||||
<template #label>
|
||||
<div class="mb10">申请事由</div>
|
||||
</template>
|
||||
@@ -153,8 +212,7 @@ layout("/mobile/platform.html"){
|
||||
</van-cell-group>
|
||||
|
||||
<van-cell-group inset class="mt10" v-if="isUploadFile === true">
|
||||
<van-field name="files" label="附  件" required
|
||||
style="flex-flow: column" input-align="left">
|
||||
<van-field name="files" label="附  件" required style="flex-flow: column" input-align="left">
|
||||
<template #label>
|
||||
<div class="mb10">附  件</div>
|
||||
</template>
|
||||
@@ -162,8 +220,8 @@ layout("/mobile/platform.html"){
|
||||
<vant-file-upload :files.sync="formData.files"></vant-file-upload>
|
||||
</template>
|
||||
</van-field>
|
||||
<div style="margin: 0 0 7px 15px;" v-if="isUploadFile && uploadFileDesc">
|
||||
<span style="color:red;">上传附件说明:{{ uploadFileDesc }}</span>
|
||||
<div style="margin: 0 0 7px 15px" v-if="isUploadFile && uploadFileDesc">
|
||||
<span style="color: red">上传附件说明:{{ uploadFileDesc }}</span>
|
||||
</div>
|
||||
</van-cell-group>
|
||||
|
||||
@@ -179,26 +237,21 @@ layout("/mobile/platform.html"){
|
||||
</van-cell-group>
|
||||
|
||||
<div style="margin: 20px 20px 10px 20px">
|
||||
<van-button @click="onSubmit()" style="border-radius: 10px" block type="info" :color="themeColor">
|
||||
提 交
|
||||
</van-button>
|
||||
<van-button @click="onSubmit()" style="border-radius: 10px" block type="info" :color="themeColor">提 交</van-button>
|
||||
</div>
|
||||
</van-form>
|
||||
|
||||
<div>
|
||||
<van-tabbar v-model="tarBarActive" style="z-index: 99">
|
||||
<van-tabbar-item icon="home-o" replace url="/mobile/condolence/apply/for">慰问申请
|
||||
</van-tabbar-item>
|
||||
<van-tabbar-item icon="manager-o" replace url="/mobile/condolence/apply">慰问记录
|
||||
</van-tabbar-item>
|
||||
<van-tabbar-item icon="home-o" replace url="/mobile/condolence/apply/for">慰问申请</van-tabbar-item>
|
||||
<van-tabbar-item icon="manager-o" replace url="/mobile/condolence/apply">慰问记录</van-tabbar-item>
|
||||
</van-tabbar>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
el: "#app",
|
||||
mixins: [mobileMixins],
|
||||
data() {
|
||||
return {
|
||||
@@ -222,34 +275,38 @@ layout("/mobile/platform.html"){
|
||||
money: 0,
|
||||
isUploadFile: true,
|
||||
uploadFileDesc: null,
|
||||
showChildPicker:false,
|
||||
childColumns:[{value:'一孩',text:'一孩'},{value:'二孩',text:'二孩'},{value:'三孩',text:'三孩'}],
|
||||
showChildPicker: false,
|
||||
childColumns: [
|
||||
{ value: "一孩", text: "一孩" },
|
||||
{ value: "二孩", text: "二孩" },
|
||||
{ value: "三孩", text: "三孩" }
|
||||
]
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
"formData.money"(val) {
|
||||
if (val > this.money) {
|
||||
this.$notify({
|
||||
title: '警告',
|
||||
message: '金额超过规定金额' + this.money + "(元)",
|
||||
type: 'warning'
|
||||
});
|
||||
title: "警告",
|
||||
message: "金额超过规定金额" + this.money + "(元)",
|
||||
type: "warning"
|
||||
})
|
||||
this.$set(this.formData, "money", this.money)
|
||||
}
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'mobile-sign': httpVueLoader('/components/sign/mobileSign.vue?v='+new Date().getTime()),
|
||||
"mobile-sign": httpVueLoader("/components/sign/mobileSign.vue?v=" + new Date().getTime())
|
||||
},
|
||||
methods: {
|
||||
onChildConfirm(data){
|
||||
onChildConfirm(data) {
|
||||
console.log(data)
|
||||
this.formData.birth_child_num = data.value
|
||||
this.showChildPicker = false
|
||||
},
|
||||
priceInput() {
|
||||
let num = 0
|
||||
this.goods.forEach(v => {
|
||||
this.goods.forEach((v) => {
|
||||
num += parseFloat(v.price)
|
||||
})
|
||||
this.$set(this.formData, "money", num)
|
||||
@@ -259,18 +316,19 @@ layout("/mobile/platform.html"){
|
||||
this.showOccurTime = false
|
||||
},
|
||||
onConfirm(date) {
|
||||
const [start, end] = date;
|
||||
this.hospital_stay = false;
|
||||
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_2", moment(end).format('YYYY-MM-DD'))
|
||||
const [start, end] = date
|
||||
this.hospital_stay = false
|
||||
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_2", moment(end).format("YYYY-MM-DD"))
|
||||
},
|
||||
async userRemoteMethod(event) {
|
||||
if (event) {
|
||||
const arr = await this.queryUser(event)
|
||||
this.userList = arr.map(v => {
|
||||
this.userList = arr.map((v) => {
|
||||
return {
|
||||
name: v.username + "(" + v.loginname + ")", id: v.id
|
||||
name: v.username + "(" + v.loginname + ")",
|
||||
id: v.id
|
||||
}
|
||||
})
|
||||
this.sheetShow = true
|
||||
@@ -279,32 +337,33 @@ layout("/mobile/platform.html"){
|
||||
async payeeUserRemoteMethod(event) {
|
||||
if (event) {
|
||||
const arr = await this.queryUser(event)
|
||||
this.payeeUserList = arr.map(v => {
|
||||
this.payeeUserList = arr.map((v) => {
|
||||
return {
|
||||
name: v.username + "(" + v.loginname + ")", id: v.id
|
||||
name: v.username + "(" + v.loginname + ")",
|
||||
id: v.id
|
||||
}
|
||||
})
|
||||
this.payeeSheetShow = true
|
||||
}
|
||||
},
|
||||
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
|
||||
},
|
||||
onUserSelect(u) {
|
||||
this.$set(this.formData, 'be_user', u.id)
|
||||
this.$set(this.formData, 'be_user_name', u.name)
|
||||
this.$set(this.formData, "be_user", u.id)
|
||||
this.$set(this.formData, "be_user_name", u.name)
|
||||
this.sheetShow = false
|
||||
},
|
||||
payeeOnUserSelect(u) {
|
||||
this.$set(this.formData, 'payee', u.id)
|
||||
this.$set(this.formData, 'payee_name', u.name)
|
||||
this.$set(this.formData, "payee", u.id)
|
||||
this.$set(this.formData, "payee_name", u.name)
|
||||
this.payeeSheetShow = false
|
||||
},
|
||||
async onTypeConfirm(val) {
|
||||
this.$set(this.formData, "typeName", val.text)
|
||||
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)
|
||||
|
||||
this.isUploadFile = data.isUploadFile
|
||||
@@ -312,15 +371,15 @@ layout("/mobile/platform.html"){
|
||||
|
||||
this.$set(this, "money", data.money)
|
||||
await this.moneyChange(val.value)
|
||||
this.showTypePicker = false;
|
||||
this.showTypePicker = false
|
||||
},
|
||||
onWayConfirm(val) {
|
||||
this.$set(this.formData, "wayName", val.text)
|
||||
this.$set(this.formData, "way", val.value)
|
||||
this.showWayPicker = false;
|
||||
this.showWayPicker = false
|
||||
},
|
||||
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) {
|
||||
this.$set(this.formData, "money", data.money)
|
||||
this.$set(this.formData, "wayName", data.way)
|
||||
@@ -329,34 +388,34 @@ layout("/mobile/platform.html"){
|
||||
},
|
||||
async onSubmit() {
|
||||
if (!this.formData.files) {
|
||||
vant.Toast('请上传附件材料!')
|
||||
vant.Toast("请上传附件材料!")
|
||||
return
|
||||
}
|
||||
this.$refs.signature.submitSign()
|
||||
if (this.$refs.signature.checkNull()) {
|
||||
this.$toast('请签名!')
|
||||
this.$toast("请签名!")
|
||||
return
|
||||
}
|
||||
await this.$refs.signature.updateSign()
|
||||
const formData = clone(this.formData)
|
||||
formData.mobile = "${@shiro.getPrincipalProperty('mobile')}"
|
||||
formData.files = JSON.stringify(formData.files)
|
||||
this.$refs['addForm'].validate().then(async () => {
|
||||
this.$toast.loading('提交中...')
|
||||
const res = await $.post('/platform/fw/condolence/apply/doAdd', {
|
||||
this.$refs["addForm"].validate().then(async () => {
|
||||
this.$toast.loading("提交中...")
|
||||
const res = await $.post("/platform/fw/condolence/apply/doAdd", {
|
||||
data: JSON.stringify(formData),
|
||||
sign: formData.sign
|
||||
})
|
||||
if (res.code === 0) {
|
||||
this.$toast.success('申请成功');
|
||||
this.$toast.success("申请成功")
|
||||
setTimeout(() => {
|
||||
location.replace('/mobile/condolence/apply')
|
||||
location.replace("/mobile/condolence/apply")
|
||||
}, 1000)
|
||||
} else {
|
||||
this.$toast.fail('申请失败');
|
||||
this.$toast.fail("申请失败")
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
@@ -366,21 +425,20 @@ layout("/mobile/platform.html"){
|
||||
})
|
||||
},
|
||||
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_name = "${@shiro.getPrincipalProperty('username')}" + "(" + "${@shiro.getPrincipalProperty('loginname')}" + ")"
|
||||
const {code, data} = await $.get("/platform/condolence/type/getAll")
|
||||
data.forEach(v => {
|
||||
this.typeColumns.push({value: v.id, text: v.name + "(" + v.code + ")"})
|
||||
const { code, data } = await $.get("/platform/condolence/type/getAll")
|
||||
data.forEach((v) => {
|
||||
this.typeColumns.push({ value: v.id, text: v.name + "(" + v.code + ")" })
|
||||
})
|
||||
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>
|
||||
<style>
|
||||
|
||||
.up_down > .van-cell {
|
||||
flex-flow: column;
|
||||
}
|
||||
@@ -389,14 +447,15 @@ layout("/mobile/platform.html"){
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.van-cell, .van-picker button, .submit .van-button--normal {
|
||||
.van-cell,
|
||||
.van-picker button,
|
||||
.submit .van-button--normal {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.van-divider {
|
||||
margin: 10px 0;
|
||||
}
|
||||
|
||||
</style>
|
||||
<!--#
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user