Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ceec8eb095 | ||
|
|
2a305a3f23 |
@@ -1,10 +1,16 @@
|
|||||||
package com.budwk.app.base.utils;
|
package com.budwk.app.base.utils;
|
||||||
|
|
||||||
import cn.hutool.core.io.FileUtil;
|
import cn.hutool.core.io.FileUtil;
|
||||||
|
import com.aspose.cells.FontConfigs;
|
||||||
import com.aspose.cells.PdfSaveOptions;
|
import com.aspose.cells.PdfSaveOptions;
|
||||||
import com.aspose.cells.Workbook;
|
import com.aspose.cells.Workbook;
|
||||||
|
import com.aspose.slides.FontsLoader;
|
||||||
|
import com.aspose.slides.LoadOptions;
|
||||||
import com.aspose.slides.Presentation;
|
import com.aspose.slides.Presentation;
|
||||||
import com.aspose.words.Document;
|
import com.aspose.words.Document;
|
||||||
|
import com.aspose.words.FontSettings;
|
||||||
|
import com.aspose.words.FontSourceBase;
|
||||||
|
import com.aspose.words.MemoryFontSource;
|
||||||
import com.aspose.words.SaveFormat;
|
import com.aspose.words.SaveFormat;
|
||||||
import com.budwk.app.base.exception.BaseException;
|
import com.budwk.app.base.exception.BaseException;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -12,6 +18,8 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 文档转换
|
* 文档转换
|
||||||
@@ -19,6 +27,81 @@ import java.io.IOException;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
public class OfficePlusUtil {
|
public class OfficePlusUtil {
|
||||||
|
|
||||||
|
private static final String DEFAULT_FONT_NAME = "Noto Sans SC";
|
||||||
|
private static final String DEFAULT_FONT_RESOURCE = "/fonts/NotoSansSC-VF.ttf";
|
||||||
|
private static final Object FONT_CONFIG_LOCK = new Object();
|
||||||
|
private static volatile boolean fontConfigured;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 注册系统内置字体,并将其作为 Office 文档缺失字体或缺失字形时的默认回退字体。
|
||||||
|
* 原文档字体在服务器可用时仍优先使用,只有找不到原字体时才使用内置字体。
|
||||||
|
*/
|
||||||
|
private static void configureDefaultFont() {
|
||||||
|
if (fontConfigured) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
synchronized (FONT_CONFIG_LOCK) {
|
||||||
|
if (fontConfigured) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
byte[] fontData = loadDefaultFontData();
|
||||||
|
configureWordFont(fontData);
|
||||||
|
configureExcelFont(fontData);
|
||||||
|
FontsLoader.loadExternalFont(fontData);
|
||||||
|
fontConfigured = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 从 classpath 读取随应用打包的字体,避免依赖线上服务器安装字体。
|
||||||
|
*
|
||||||
|
* @return 默认字体的二进制数据
|
||||||
|
*/
|
||||||
|
private static byte[] loadDefaultFontData() {
|
||||||
|
try (InputStream inputStream = OfficePlusUtil.class.getResourceAsStream(DEFAULT_FONT_RESOURCE)) {
|
||||||
|
if (inputStream == null) {
|
||||||
|
throw new BaseException("系统内置默认字体不存在");
|
||||||
|
}
|
||||||
|
return inputStream.readAllBytes();
|
||||||
|
} catch (IOException e) {
|
||||||
|
log.error("读取系统内置默认字体失败", e);
|
||||||
|
throw new BaseException("读取系统内置默认字体失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 为 Word 转换保留已有字体源并追加内置字体,同时配置缺失字体和缺失字形回退。
|
||||||
|
*
|
||||||
|
* @param fontData 默认字体的二进制数据
|
||||||
|
*/
|
||||||
|
private static void configureWordFont(byte[] fontData) {
|
||||||
|
FontSettings fontSettings = FontSettings.getDefaultInstance();
|
||||||
|
FontSourceBase[] currentSources = fontSettings.getFontsSources();
|
||||||
|
FontSourceBase[] fontSources = Arrays.copyOf(currentSources, currentSources.length + 1);
|
||||||
|
fontSources[currentSources.length] = new MemoryFontSource(fontData);
|
||||||
|
fontSettings.setFontsSources(fontSources);
|
||||||
|
fontSettings.getSubstitutionSettings().getDefaultFontSubstitution().setDefaultFontName(DEFAULT_FONT_NAME);
|
||||||
|
try {
|
||||||
|
fontSettings.getFallbackSettings().loadNotoFallbackSettings();
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("配置 Word 默认字体回退规则失败", e);
|
||||||
|
throw new BaseException("配置 Word 默认字体失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 为 Excel 转换追加内置字体,并将其设置为找不到原字体时的默认字体。
|
||||||
|
*
|
||||||
|
* @param fontData 默认字体的二进制数据
|
||||||
|
*/
|
||||||
|
private static void configureExcelFont(byte[] fontData) {
|
||||||
|
com.aspose.cells.FontSourceBase[] currentSources = FontConfigs.getFontSources();
|
||||||
|
com.aspose.cells.FontSourceBase[] fontSources = Arrays.copyOf(currentSources, currentSources.length + 1);
|
||||||
|
fontSources[currentSources.length] = new com.aspose.cells.MemoryFontSource(fontData);
|
||||||
|
FontConfigs.setFontSources(fontSources);
|
||||||
|
FontConfigs.setDefaultFontName(DEFAULT_FONT_NAME);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 转换
|
* 转换
|
||||||
*
|
*
|
||||||
@@ -47,7 +130,11 @@ public class OfficePlusUtil {
|
|||||||
public static void presentationConvertPdf(String sourcePath, String targetPath) {
|
public static void presentationConvertPdf(String sourcePath, String targetPath) {
|
||||||
Presentation presentation = null;
|
Presentation presentation = null;
|
||||||
try {
|
try {
|
||||||
presentation = new Presentation(sourcePath);
|
configureDefaultFont();
|
||||||
|
LoadOptions loadOptions = new LoadOptions();
|
||||||
|
loadOptions.setDefaultRegularFont(DEFAULT_FONT_NAME);
|
||||||
|
loadOptions.setDefaultAsianFont(DEFAULT_FONT_NAME);
|
||||||
|
presentation = new Presentation(sourcePath, loadOptions);
|
||||||
presentation.save(targetPath, com.aspose.slides.SaveFormat.Pdf);
|
presentation.save(targetPath, com.aspose.slides.SaveFormat.Pdf);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.info("转换pdf报错", e);
|
log.info("转换pdf报错", e);
|
||||||
@@ -68,10 +155,12 @@ public class OfficePlusUtil {
|
|||||||
public static void excelConvertPdf(String sourcePath, String targetPath) {
|
public static void excelConvertPdf(String sourcePath, String targetPath) {
|
||||||
FileOutputStream fileOS = null;
|
FileOutputStream fileOS = null;
|
||||||
try {
|
try {
|
||||||
|
configureDefaultFont();
|
||||||
Workbook wb = new Workbook(sourcePath);
|
Workbook wb = new Workbook(sourcePath);
|
||||||
fileOS = new FileOutputStream(targetPath);
|
fileOS = new FileOutputStream(targetPath);
|
||||||
PdfSaveOptions pdfSaveOptions = new PdfSaveOptions();
|
PdfSaveOptions pdfSaveOptions = new PdfSaveOptions();
|
||||||
pdfSaveOptions.setOnePagePerSheet(true);
|
pdfSaveOptions.setOnePagePerSheet(true);
|
||||||
|
pdfSaveOptions.setDefaultFont(DEFAULT_FONT_NAME);
|
||||||
// for (int i = 0; i < 3; i++) {
|
// for (int i = 0; i < 3; i++) {
|
||||||
// wb.getWorksheets().get(i).getHorizontalPageBreaks().clear();
|
// wb.getWorksheets().get(i).getHorizontalPageBreaks().clear();
|
||||||
// wb.getWorksheets().get(i).getVerticalPageBreaks().clear();
|
// wb.getWorksheets().get(i).getVerticalPageBreaks().clear();
|
||||||
@@ -105,6 +194,7 @@ public class OfficePlusUtil {
|
|||||||
public static void wordConvertPdf(String sourcePath, String targetPath) {
|
public static void wordConvertPdf(String sourcePath, String targetPath) {
|
||||||
FileOutputStream os = null;
|
FileOutputStream os = null;
|
||||||
try {
|
try {
|
||||||
|
configureDefaultFont();
|
||||||
File file = new File(targetPath);
|
File file = new File(targetPath);
|
||||||
os = new FileOutputStream(file);
|
os = new FileOutputStream(file);
|
||||||
Document doc = new Document(sourcePath);
|
Document doc = new Document(sourcePath);
|
||||||
|
|||||||
+94
-21
@@ -4,12 +4,14 @@ package com.budwk.app.zhgh.activity.sports.service.impl;
|
|||||||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||||
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||||
|
import com.budwk.app.base.exception.BaseException;
|
||||||
import com.budwk.app.base.service.impl.BaseServiceImpl;
|
import com.budwk.app.base.service.impl.BaseServiceImpl;
|
||||||
import com.budwk.app.base.utils.CommonDownloadUtil;
|
import com.budwk.app.base.utils.CommonDownloadUtil;
|
||||||
import com.budwk.app.base.utils.DateUtil;
|
import com.budwk.app.base.utils.DateUtil;
|
||||||
import com.budwk.app.sys.models.Sys_home_activity;
|
import com.budwk.app.sys.models.Sys_home_activity;
|
||||||
import com.budwk.app.sys.models.Sys_home_template;
|
import com.budwk.app.sys.models.Sys_home_template;
|
||||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||||
|
import com.budwk.app.zhgh.activity.basic.models.ActivityEvent;
|
||||||
import com.budwk.app.zhgh.activity.basic.models.ActivityBasicUnit;
|
import com.budwk.app.zhgh.activity.basic.models.ActivityBasicUnit;
|
||||||
import com.budwk.app.zhgh.activity.basic.models.ActivityBasicUnion;
|
import com.budwk.app.zhgh.activity.basic.models.ActivityBasicUnion;
|
||||||
import com.budwk.app.zhgh.activity.culture.models.ActivityTissue;
|
import com.budwk.app.zhgh.activity.culture.models.ActivityTissue;
|
||||||
@@ -28,6 +30,7 @@ import org.nutz.dao.entity.Record;
|
|||||||
import org.nutz.dao.sql.Sql;
|
import org.nutz.dao.sql.Sql;
|
||||||
import org.nutz.ioc.aop.Aop;
|
import org.nutz.ioc.aop.Aop;
|
||||||
import org.nutz.ioc.loader.annotation.IocBean;
|
import org.nutz.ioc.loader.annotation.IocBean;
|
||||||
|
import org.nutz.json.Json;
|
||||||
import org.nutz.lang.Lang;
|
import org.nutz.lang.Lang;
|
||||||
import org.nutz.lang.Strings;
|
import org.nutz.lang.Strings;
|
||||||
|
|
||||||
@@ -55,6 +58,7 @@ public class ActivitySportsServiceImpl extends BaseServiceImpl<ActivitySchool> i
|
|||||||
@Override
|
@Override
|
||||||
@Aop(TransAop.READ_COMMITTED)
|
@Aop(TransAop.READ_COMMITTED)
|
||||||
public String doAdd(ActivitySchool activitySchool, ActivitySchoolEvent[] events) {
|
public String doAdd(ActivitySchool activitySchool, ActivitySchoolEvent[] events) {
|
||||||
|
events = validateAndApplySingleEventLimits(events);
|
||||||
ActivityBasicUnit activityBasicUnit = dao().fetch(ActivityBasicUnit.class, Cnd.where("id", "=", SecurityUtil.getUserId()));
|
ActivityBasicUnit activityBasicUnit = dao().fetch(ActivityBasicUnit.class, Cnd.where("id", "=", SecurityUtil.getUserId()));
|
||||||
|
|
||||||
if (activitySchool.getActivityLevel() == 40002) {
|
if (activitySchool.getActivityLevel() == 40002) {
|
||||||
@@ -101,6 +105,7 @@ public class ActivitySportsServiceImpl extends BaseServiceImpl<ActivitySchool> i
|
|||||||
@Override
|
@Override
|
||||||
@Aop(TransAop.READ_COMMITTED)
|
@Aop(TransAop.READ_COMMITTED)
|
||||||
public void doEdit(ActivitySchool activitySchool, ActivitySchoolEvent[] events) {
|
public void doEdit(ActivitySchool activitySchool, ActivitySchoolEvent[] events) {
|
||||||
|
events = validateAndApplySingleEventLimits(events);
|
||||||
ActivitySchool school = dao().fetch(ActivitySchool.class, activitySchool.getId());
|
ActivitySchool school = dao().fetch(ActivitySchool.class, activitySchool.getId());
|
||||||
if (school.getActivityLevel() == 40002) {
|
if (school.getActivityLevel() == 40002) {
|
||||||
school.setBelongUnionId(SecurityUtil.getUnionId());
|
school.setBelongUnionId(SecurityUtil.getUnionId());
|
||||||
@@ -161,6 +166,56 @@ public class ActivitySportsServiceImpl extends BaseServiceImpl<ActivitySchool> i
|
|||||||
dao().insertOrUpdate(sysHomeActivity);
|
dao().insertOrUpdate(sysHomeActivity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验单项人数限制,并在具体单项未设置限制时应用“所有单项”的默认值。
|
||||||
|
*
|
||||||
|
* @param events 页面提交的项目配置,允许包含 eventId 为 allItems 的默认配置
|
||||||
|
* @return 已移除 allItems 临时配置、可直接持久化的项目配置数组
|
||||||
|
*/
|
||||||
|
private ActivitySchoolEvent[] validateAndApplySingleEventLimits(ActivitySchoolEvent[] events) {
|
||||||
|
if (events == null || events.length == 0) {
|
||||||
|
return new ActivitySchoolEvent[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
ActivitySchoolEvent allItems = Arrays.stream(events)
|
||||||
|
.filter(event -> event != null && "allItems".equals(event.getEventId()))
|
||||||
|
.findFirst()
|
||||||
|
.orElse(null);
|
||||||
|
List<ActivitySchoolEvent> result = new ArrayList<>();
|
||||||
|
for (ActivitySchoolEvent event : events) {
|
||||||
|
if (event == null || "allItems".equals(event.getEventId())) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
ActivityEvent activityEvent = dao().fetch(ActivityEvent.class, event.getEventId());
|
||||||
|
if (activityEvent != null && "1".equals(activityEvent.getProjectType())) {
|
||||||
|
applySingleEventDefaultLimit(event, allItems);
|
||||||
|
}
|
||||||
|
result.add(event);
|
||||||
|
}
|
||||||
|
return result.toArray(new ActivitySchoolEvent[0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单项的两个限制必须同时设置;均未设置或均为0时继承“所有单项”的对应值。
|
||||||
|
*/
|
||||||
|
private void applySingleEventDefaultLimit(ActivitySchoolEvent event, ActivitySchoolEvent allItems) {
|
||||||
|
Integer athletesMaxNum = event.getAthletesMaxNum();
|
||||||
|
Integer restrictRegNumber = event.getRestrictRegNumber();
|
||||||
|
if ((athletesMaxNum == null) != (restrictRegNumber == null)) {
|
||||||
|
throw new BaseException("每队(项)运动员最多人数和每人限报项目必须同时设置");
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean useDefault = athletesMaxNum == null || (athletesMaxNum == 0 && restrictRegNumber == 0);
|
||||||
|
if (!useDefault) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (allItems == null || allItems.getAthletesMaxNum() == null || allItems.getRestrictRegNumber() == null) {
|
||||||
|
throw new BaseException("请先设置所有单项的运动员最多人数和每人限报项目");
|
||||||
|
}
|
||||||
|
event.setAthletesMaxNum(allItems.getAthletesMaxNum());
|
||||||
|
event.setRestrictRegNumber(allItems.getRestrictRegNumber());
|
||||||
|
}
|
||||||
|
|
||||||
@Aop(TransAop.READ_COMMITTED)
|
@Aop(TransAop.READ_COMMITTED)
|
||||||
private void addTeam(String schoolId, ActivitySchoolEvent[] events) {
|
private void addTeam(String schoolId, ActivitySchoolEvent[] events) {
|
||||||
if (events.length > 0) {
|
if (events.length > 0) {
|
||||||
@@ -271,33 +326,19 @@ public class ActivitySportsServiceImpl extends BaseServiceImpl<ActivitySchool> i
|
|||||||
WHERE
|
WHERE
|
||||||
app.activityId = @id
|
app.activityId = @id
|
||||||
and app.status = 2
|
and app.status = 2
|
||||||
$cnd
|
and (@filterUnion = 0 or app.activityUnionId = @unionId)
|
||||||
ORDER BY
|
ORDER BY
|
||||||
ev.allName DESC,
|
ev.allName DESC,
|
||||||
u.unionname DESC,
|
u.unionname DESC,
|
||||||
app.`team` asc
|
app.`team` asc
|
||||||
""").setParam("id", id)
|
""").setParam("id", id);
|
||||||
.setVar("cnd", "");
|
// 参数必须声明在原始SQL中;setVar追加的字符串不会再次解析其中的@参数。
|
||||||
if (Strings.isNotBlank(unionId)) {
|
// 未选择分工会时导出整个活动,选择时按报名记录中的活动分工会过滤。
|
||||||
sql.setVar("cnd", "and u.unionid = @unionId");
|
sql.setParam("filterUnion", Strings.isNotBlank(unionId) ? 1 : 0);
|
||||||
sql.setParam("unionId", unionId);
|
sql.setParam("unionId", Strings.isNotBlank(unionId) ? unionId : "");
|
||||||
}
|
|
||||||
List<Record> list = list(sql);
|
List<Record> list = list(sql);
|
||||||
String activityName;
|
|
||||||
if (Lang.isNotEmpty(list)) {
|
|
||||||
activityName = list.get(0).getString("activityName");
|
|
||||||
} else {
|
|
||||||
activityName = "暂无人员";
|
|
||||||
}
|
|
||||||
|
|
||||||
List<ActivitySchoolApply> excels = new ArrayList<>();
|
List<ActivitySchoolApply> excels = new ArrayList<>();
|
||||||
|
list.forEach(record -> excels.add(toActivitySchoolApplyExport(record)));
|
||||||
list.forEach(z -> {
|
|
||||||
ActivitySchoolApply schoolApply = z.toPojo(ActivitySchoolApply.class);
|
|
||||||
String s = schoolApply.getIdentity().stream().map(personType::getName).toList().toString();
|
|
||||||
schoolApply.setSf(s);
|
|
||||||
excels.add(schoolApply);
|
|
||||||
});
|
|
||||||
|
|
||||||
ExportParams exportParams = new ExportParams();
|
ExportParams exportParams = new ExportParams();
|
||||||
exportParams.setType(ExcelType.XSSF);
|
exportParams.setType(ExcelType.XSSF);
|
||||||
@@ -305,10 +346,42 @@ public class ActivitySportsServiceImpl extends BaseServiceImpl<ActivitySchool> i
|
|||||||
CommonDownloadUtil.download(getUnionApplyExportFileName(unionId), workbook, response);
|
CommonDownloadUtil.download(getUnionApplyExportFileName(unionId), workbook, response);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
throw new BaseException("导出报名信息失败:" + e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将原生SQL查询结果转换为报名信息导出对象。
|
||||||
|
* identity 是数据库JSON文本,需要显式转换为身份编码集合,避免 Record.toPojo 自动转换失败导致整表无数据。
|
||||||
|
*
|
||||||
|
* @param record 导出SQL返回的一行报名数据
|
||||||
|
* @return EasyPoi 使用的 ActivitySchoolApply 导出对象
|
||||||
|
*/
|
||||||
|
private ActivitySchoolApply toActivitySchoolApplyExport(Record record) {
|
||||||
|
ActivitySchoolApply schoolApply = new ActivitySchoolApply();
|
||||||
|
schoolApply.setUnionname(record.getString("unionname"));
|
||||||
|
schoolApply.setTeam(record.getString("team"));
|
||||||
|
schoolApply.setAllName(record.getString("allName"));
|
||||||
|
schoolApply.setLoginname(record.getString("loginname"));
|
||||||
|
schoolApply.setUsername(record.getString("username"));
|
||||||
|
schoolApply.setMobile(record.getString("mobile"));
|
||||||
|
schoolApply.setIdCard(record.getString("idCard"));
|
||||||
|
schoolApply.setProfessionalLevel(record.getString("professionalLevel"));
|
||||||
|
schoolApply.setSex(record.getString("sex"));
|
||||||
|
|
||||||
|
String identityJson = record.getString("identity");
|
||||||
|
List<String> identities = Strings.isBlank(identityJson)
|
||||||
|
? new ArrayList<>()
|
||||||
|
: Json.fromJsonAsList(String.class, identityJson);
|
||||||
|
String identityName = identities.stream()
|
||||||
|
.map(personType::getName)
|
||||||
|
.filter(Strings::isNotBlank)
|
||||||
|
.collect(Collectors.joining("、"));
|
||||||
|
schoolApply.setSf(identityName);
|
||||||
|
return schoolApply;
|
||||||
|
}
|
||||||
|
|
||||||
private String getUnionApplyExportFileName(String unionId) {
|
private String getUnionApplyExportFileName(String unionId) {
|
||||||
String unionName = "分工会";
|
String unionName = "分工会";
|
||||||
if (Strings.isNotBlank(unionId)) {
|
if (Strings.isNotBlank(unionId)) {
|
||||||
|
|||||||
+13
-5
@@ -17,7 +17,6 @@ import com.budwk.app.flow.enums.ProcessInstanceStateEnum;
|
|||||||
import com.budwk.app.flow.enums.ProcessSubmitTypeEnum;
|
import com.budwk.app.flow.enums.ProcessSubmitTypeEnum;
|
||||||
import com.budwk.app.flow.service.FlowCommonService;
|
import com.budwk.app.flow.service.FlowCommonService;
|
||||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||||
import com.budwk.app.zhgh.club.model.ClubUser;
|
|
||||||
import com.budwk.app.zhgh.club.model.SysClub;
|
import com.budwk.app.zhgh.club.model.SysClub;
|
||||||
import com.budwk.app.zhgh.club.model.SysClubExamineRegister;
|
import com.budwk.app.zhgh.club.model.SysClubExamineRegister;
|
||||||
import com.budwk.app.zhgh.club.service.SysClubExamineService;
|
import com.budwk.app.zhgh.club.service.SysClubExamineService;
|
||||||
@@ -119,10 +118,7 @@ public class ClubExamineApplyController {
|
|||||||
if(StrUtil.isBlank(clubId)) {
|
if(StrUtil.isBlank(clubId)) {
|
||||||
return Result.error("社团信息为空,请核查");
|
return Result.error("社团信息为空,请核查");
|
||||||
}
|
}
|
||||||
int count = dao.count(ClubUser.class, Cnd.where("clubId", "=", clubId));
|
return Result.success(sysClubExamineService.getClubMemberMoney(clubId));
|
||||||
SysClub club = dao.fetch(SysClub.class, clubId);
|
|
||||||
int money = count * (club.getDue() != null ? Integer.parseInt(club.getDue()) : 0);
|
|
||||||
return Result.success(money);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@At
|
@At
|
||||||
@@ -175,6 +171,10 @@ public class ClubExamineApplyController {
|
|||||||
public Result save(@Param("data") SysClubExamineRegister examineRegister,
|
public Result save(@Param("data") SysClubExamineRegister examineRegister,
|
||||||
@Param("incomeDetailed") String incomeDetailed,
|
@Param("incomeDetailed") String incomeDetailed,
|
||||||
@Param("incomeCensus") String incomeCensus) {
|
@Param("incomeCensus") String incomeCensus) {
|
||||||
|
String validateMessage = sysClubExamineService.validateActivityRequired(examineRegister);
|
||||||
|
if (validateMessage != null) {
|
||||||
|
return Result.error(validateMessage);
|
||||||
|
}
|
||||||
if (StrUtil.isBlank(examineRegister.getId())) {
|
if (StrUtil.isBlank(examineRegister.getId())) {
|
||||||
sysClubExamineService.doAdd(examineRegister, incomeDetailed, incomeCensus);
|
sysClubExamineService.doAdd(examineRegister, incomeDetailed, incomeCensus);
|
||||||
} else {
|
} else {
|
||||||
@@ -190,6 +190,10 @@ public class ClubExamineApplyController {
|
|||||||
public Result submit(@Param("data") SysClubExamineRegister examineRegister,
|
public Result submit(@Param("data") SysClubExamineRegister examineRegister,
|
||||||
@Param("incomeDetailed") String incomeDetailed,
|
@Param("incomeDetailed") String incomeDetailed,
|
||||||
@Param("incomeCensus") String incomeCensus) {
|
@Param("incomeCensus") String incomeCensus) {
|
||||||
|
String validateMessage = sysClubExamineService.validateActivityRequired(examineRegister);
|
||||||
|
if (validateMessage != null) {
|
||||||
|
return Result.error(validateMessage);
|
||||||
|
}
|
||||||
SysClubExamineRegister reg;
|
SysClubExamineRegister reg;
|
||||||
if (StrUtil.isBlank(examineRegister.getId())) {
|
if (StrUtil.isBlank(examineRegister.getId())) {
|
||||||
reg = sysClubExamineService.doAdd(examineRegister, incomeDetailed, incomeCensus);
|
reg = sysClubExamineService.doAdd(examineRegister, incomeDetailed, incomeCensus);
|
||||||
@@ -221,6 +225,10 @@ public class ClubExamineApplyController {
|
|||||||
@Param("incomeDetailed") String incomeDetailed,
|
@Param("incomeDetailed") String incomeDetailed,
|
||||||
@Param("incomeCensus") String incomeCensus,
|
@Param("incomeCensus") String incomeCensus,
|
||||||
@Param("taskId") Long taskId) {
|
@Param("taskId") Long taskId) {
|
||||||
|
String validateMessage = sysClubExamineService.validateActivityRequired(examineRegister);
|
||||||
|
if (validateMessage != null) {
|
||||||
|
return Result.error(validateMessage);
|
||||||
|
}
|
||||||
if (StrUtil.isBlank(examineRegister.getId())) {
|
if (StrUtil.isBlank(examineRegister.getId())) {
|
||||||
sysClubExamineService.doAdd(examineRegister, incomeDetailed, incomeCensus);
|
sysClubExamineService.doAdd(examineRegister, incomeDetailed, incomeCensus);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
+1
-1
@@ -86,7 +86,7 @@ public class ClubExamineMineController {
|
|||||||
//nutMap.setv("schoolName", Globals.MyConfig.getString("AppName"));
|
//nutMap.setv("schoolName", Globals.MyConfig.getString("AppName"));
|
||||||
nutMap.setv("clubName", register.getClubName());
|
nutMap.setv("clubName", register.getClubName());
|
||||||
nutMap.setv("create_time", register.getFoundTime());
|
nutMap.setv("create_time", register.getFoundTime());
|
||||||
nutMap.setv("dues_standard", register.getDue());
|
nutMap.setv("dues_standard", register.getDue() == null ? "--" : register.getDue() + "元/年");
|
||||||
// 生成材料中的年度与列表展示的登记年度保持一致。
|
// 生成材料中的年度与列表展示的登记年度保持一致。
|
||||||
nutMap.setv("year", register.getYear());
|
nutMap.setv("year", register.getYear());
|
||||||
nutMap.setv("registerDate", register.getRegisterDate());
|
nutMap.setv("registerDate", register.getRegisterDate());
|
||||||
|
|||||||
@@ -91,8 +91,8 @@ public class SysClub extends BaseModel {
|
|||||||
|
|
||||||
@Column
|
@Column
|
||||||
@Comment("会费标准")
|
@Comment("会费标准")
|
||||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
@ColDefine(type = ColType.DOUBLE, width = 10, precision = 2)
|
||||||
private String due;
|
private Double due;
|
||||||
|
|
||||||
@Column
|
@Column
|
||||||
@Comment("附件")
|
@Comment("附件")
|
||||||
|
|||||||
@@ -57,8 +57,8 @@ public class SysClubExamineRegister extends BaseModel {
|
|||||||
|
|
||||||
@Column
|
@Column
|
||||||
@Comment("会费标准")
|
@Comment("会费标准")
|
||||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
@ColDefine(type = ColType.DOUBLE, width = 10, precision = 2)
|
||||||
private String due;
|
private Double due;
|
||||||
|
|
||||||
@Column
|
@Column
|
||||||
@Comment("年度活动情况")
|
@Comment("年度活动情况")
|
||||||
|
|||||||
@@ -24,6 +24,21 @@ public interface SysClubExamineService extends BaseService<SysClubExamineRegiste
|
|||||||
|
|
||||||
List<NutMap> getJgUser(@Valid String clubId);
|
List<NutMap> getJgUser(@Valid String clubId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计算指定社团的年度会费收入。
|
||||||
|
*
|
||||||
|
* @param clubId 社团ID,用于查询当前会员数量和社团会费标准
|
||||||
|
* @return 会员数量乘以会费标准后的金额;社团或会费标准为空时返回0
|
||||||
|
*/
|
||||||
|
Double getClubMemberMoney(@Valid String clubId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验考核登记的两组活动明细。
|
||||||
|
* @param examineRegister 页面data参数对应的登记实体,yearActivityList为本年度活动,plans为下一年度计划
|
||||||
|
* @return String类型;通过返回null,否则返回缺失的明细行号及字段提示
|
||||||
|
*/
|
||||||
|
String validateActivityRequired(SysClubExamineRegister examineRegister);
|
||||||
|
|
||||||
SysClubExamineRegister doAdd(SysClubExamineRegister examineRegister, String incomeDetailed, String incomeCensus);
|
SysClubExamineRegister doAdd(SysClubExamineRegister examineRegister, String incomeDetailed, String incomeCensus);
|
||||||
|
|
||||||
SysClubExamineRegister doEdit(SysClubExamineRegister examineRegister, String incomeDetailed, String incomeCensus);
|
SysClubExamineRegister doEdit(SysClubExamineRegister examineRegister, String incomeDetailed, String incomeCensus);
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import com.budwk.app.flow.enums.ProcessInstanceStateEnum;
|
|||||||
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
|
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
|
||||||
import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
||||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||||
|
import com.budwk.app.zhgh.club.model.ClubUser;
|
||||||
import com.budwk.app.zhgh.club.model.SysClub;
|
import com.budwk.app.zhgh.club.model.SysClub;
|
||||||
import com.budwk.app.zhgh.club.model.SysClubExamineRegister;
|
import com.budwk.app.zhgh.club.model.SysClubExamineRegister;
|
||||||
import com.budwk.app.zhgh.club.model.SysClubExamineRegisterDetailed;
|
import com.budwk.app.zhgh.club.model.SysClubExamineRegisterDetailed;
|
||||||
@@ -50,6 +51,15 @@ public class SysClubExamineServiceImpl extends BaseServiceImpl<SysClubExamineReg
|
|||||||
super(dao);
|
super(dao);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Double getClubMemberMoney(String clubId) {
|
||||||
|
int memberCount = dao().count(ClubUser.class, Cnd.where(ClubUser::getClubId, "=", clubId));
|
||||||
|
SysClub club = dao().fetch(SysClub.class, clubId);
|
||||||
|
// 社团或会费标准为空时按0计算,保证考核登记初始化能够正常完成。
|
||||||
|
Double due = club == null || club.getDue() == null ? 0D : club.getDue();
|
||||||
|
return memberCount * due;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<NutMap> getClubUserNum(String clubId, Integer year) {
|
public List<NutMap> getClubUserNum(String clubId, Integer year) {
|
||||||
Date yearStart = DateUtil.parse(year + "-01-01 00:00:00");
|
Date yearStart = DateUtil.parse(year + "-01-01 00:00:00");
|
||||||
@@ -345,6 +355,40 @@ public class SysClubExamineServiceImpl extends BaseServiceImpl<SysClubExamineReg
|
|||||||
return listMap;
|
return listMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 两组明细均至少填写一条;本年度主办单位和获奖情况保持选填。
|
||||||
|
* @param examineRegister data参数绑定的登记实体,包含yearActivityList和plans两组JSON明细
|
||||||
|
* @return 校验通过返回null,否则返回首个缺失字段的行号和名称
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String validateActivityRequired(SysClubExamineRegister examineRegister) {
|
||||||
|
if (examineRegister == null) {
|
||||||
|
return "考核登记信息不能为空";
|
||||||
|
}
|
||||||
|
String message = validateActivityRows(examineRegister.getYearActivityList(), "本年度活动开展情况",
|
||||||
|
new String[]{"activityTime", "activityName", "activityAddress", "joinNum"},
|
||||||
|
new String[]{"活动时间", "活动主题/赛事名称", "活动地点", "参加人数"});
|
||||||
|
return message != null ? message : validateActivityRows(examineRegister.getPlans(), "下一年度活动计划",
|
||||||
|
new String[]{"activityName", "activityUnit", "activityAddress"},
|
||||||
|
new String[]{"活动主题/赛事名称", "活动/赛事主办单位", "活动地点"});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 检查空列表、空行及纯空白字段;数值0按已填写处理,不扩大为人数范围校验。 */
|
||||||
|
private String validateActivityRows(List<JSONObject> rows, String label, String[] fields, String[] names) {
|
||||||
|
if (rows == null || rows.isEmpty()) {
|
||||||
|
return label + "至少填写一条";
|
||||||
|
}
|
||||||
|
for (int i = 0; i < rows.size(); i++) {
|
||||||
|
JSONObject row = rows.get(i);
|
||||||
|
for (int j = 0; j < fields.length; j++) {
|
||||||
|
if (row == null || StrUtil.isBlank(row.getStr(fields[j]))) {
|
||||||
|
return label + "第" + (i + 1) + "条:" + names[j] + "不能为空";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SysClubExamineRegister doAdd(SysClubExamineRegister examineRegister, String incomeDetailed, String incomeCensus) {
|
public SysClubExamineRegister doAdd(SysClubExamineRegister examineRegister, String incomeDetailed, String incomeCensus) {
|
||||||
// JSON转换为实体列表(空值判断避免转换异常)
|
// JSON转换为实体列表(空值判断避免转换异常)
|
||||||
|
|||||||
-3
@@ -606,9 +606,6 @@ public class TourMySignupController {
|
|||||||
if (StrUtil.isBlank(ledger.getMobile())) {
|
if (StrUtil.isBlank(ledger.getMobile())) {
|
||||||
return Result.error("手机号不能为空");
|
return Result.error("手机号不能为空");
|
||||||
}
|
}
|
||||||
if (!ledger.getMobile().matches("^1[3-9]\\d{9}$")) {
|
|
||||||
return Result.error("请输入正确的11位手机号");
|
|
||||||
}
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
-3
@@ -841,9 +841,6 @@ public class TourSignupController {
|
|||||||
if (StrUtil.isBlank(ledger.getMobile())) {
|
if (StrUtil.isBlank(ledger.getMobile())) {
|
||||||
return Result.error("手机号不能为空");
|
return Result.error("手机号不能为空");
|
||||||
}
|
}
|
||||||
if (!ledger.getMobile().matches("^1[3-9]\\d{9}$")) {
|
|
||||||
return Result.error("请输入正确的11位手机号");
|
|
||||||
}
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -735,6 +735,7 @@ public class WelfareListServiceImpl extends BaseServiceImpl<WelfareList> impleme
|
|||||||
entities.add(new ExcelExportEntity("在职状态", "userState", 20));
|
entities.add(new ExcelExportEntity("在职状态", "userState", 20));
|
||||||
entities.add(new ExcelExportEntity("所属工会", "welfareUnionName", 20));
|
entities.add(new ExcelExportEntity("所属工会", "welfareUnionName", 20));
|
||||||
entities.add(new ExcelExportEntity("所属单位", "welfareUnitName", 20));
|
entities.add(new ExcelExportEntity("所属单位", "welfareUnitName", 20));
|
||||||
|
entities.add(new ExcelExportEntity("三级单位", "threeUnitName", 20));
|
||||||
entities.add(new ExcelExportEntity("备注", "remark", 20));
|
entities.add(new ExcelExportEntity("备注", "remark", 20));
|
||||||
|
|
||||||
// 设置导出参数
|
// 设置导出参数
|
||||||
|
|||||||
@@ -0,0 +1,92 @@
|
|||||||
|
This Font Software is licensed under the SIL Open Font License,
|
||||||
|
Version 1.1.
|
||||||
|
|
||||||
|
This license is copied below, and is also available with a FAQ at:
|
||||||
|
http://scripts.sil.org/OFL
|
||||||
|
|
||||||
|
-----------------------------------------------------------
|
||||||
|
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
||||||
|
-----------------------------------------------------------
|
||||||
|
|
||||||
|
PREAMBLE
|
||||||
|
The goals of the Open Font License (OFL) are to stimulate worldwide
|
||||||
|
development of collaborative font projects, to support the font
|
||||||
|
creation efforts of academic and linguistic communities, and to
|
||||||
|
provide a free and open framework in which fonts may be shared and
|
||||||
|
improved in partnership with others.
|
||||||
|
|
||||||
|
The OFL allows the licensed fonts to be used, studied, modified and
|
||||||
|
redistributed freely as long as they are not sold by themselves. The
|
||||||
|
fonts, including any derivative works, can be bundled, embedded,
|
||||||
|
redistributed and/or sold with any software provided that any reserved
|
||||||
|
names are not used by derivative works. The fonts and derivatives,
|
||||||
|
however, cannot be released under any other type of license. The
|
||||||
|
requirement for fonts to remain under this license does not apply to
|
||||||
|
any document created using the fonts or their derivatives.
|
||||||
|
|
||||||
|
DEFINITIONS
|
||||||
|
"Font Software" refers to the set of files released by the Copyright
|
||||||
|
Holder(s) under this license and clearly marked as such. This may
|
||||||
|
include source files, build scripts and documentation.
|
||||||
|
|
||||||
|
"Reserved Font Name" refers to any names specified as such after the
|
||||||
|
copyright statement(s).
|
||||||
|
|
||||||
|
"Original Version" refers to the collection of Font Software
|
||||||
|
components as distributed by the Copyright Holder(s).
|
||||||
|
|
||||||
|
"Modified Version" refers to any derivative made by adding to,
|
||||||
|
deleting, or substituting -- in part or in whole -- any of the
|
||||||
|
components of the Original Version, by changing formats or by porting
|
||||||
|
the Font Software to a new environment.
|
||||||
|
|
||||||
|
"Author" refers to any designer, engineer, programmer, technical
|
||||||
|
writer or other person who contributed to the Font Software.
|
||||||
|
|
||||||
|
PERMISSION & CONDITIONS
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
a copy of the Font Software, to use, study, copy, merge, embed,
|
||||||
|
modify, redistribute, and sell modified and unmodified copies of the
|
||||||
|
Font Software, subject to the following conditions:
|
||||||
|
|
||||||
|
1) Neither the Font Software nor any of its individual components, in
|
||||||
|
Original or Modified Versions, may be sold by itself.
|
||||||
|
|
||||||
|
2) Original or Modified Versions of the Font Software may be bundled,
|
||||||
|
redistributed and/or sold with any software, provided that each copy
|
||||||
|
contains the above copyright notice and this license. These can be
|
||||||
|
included either as stand-alone text files, human-readable headers or
|
||||||
|
in the appropriate machine-readable metadata fields within text or
|
||||||
|
binary files as long as those fields can be easily viewed by the user.
|
||||||
|
|
||||||
|
3) No Modified Version of the Font Software may use the Reserved Font
|
||||||
|
Name(s) unless explicit written permission is granted by the
|
||||||
|
corresponding Copyright Holder. This restriction only applies to the
|
||||||
|
primary font name as presented to the users.
|
||||||
|
|
||||||
|
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
||||||
|
Software shall not be used to promote, endorse or advertise any
|
||||||
|
Modified Version, except to acknowledge the contribution(s) of the
|
||||||
|
Copyright Holder(s) and the Author(s) or with their explicit written
|
||||||
|
permission.
|
||||||
|
|
||||||
|
5) The Font Software, modified or unmodified, in part or in whole,
|
||||||
|
must be distributed entirely under this license, and must not be
|
||||||
|
distributed under any other license. The requirement for fonts to
|
||||||
|
remain under this license does not apply to any document created using
|
||||||
|
the Font Software.
|
||||||
|
|
||||||
|
TERMINATION
|
||||||
|
This license becomes null and void if any of the above conditions are
|
||||||
|
not met.
|
||||||
|
|
||||||
|
DISCLAIMER
|
||||||
|
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
||||||
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
||||||
|
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
||||||
|
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||||
|
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
||||||
|
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
|
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
||||||
|
OTHER DEALINGS IN THE FONT SOFTWARE.
|
||||||
Binary file not shown.
File diff suppressed because one or more lines are too long
@@ -380,7 +380,7 @@
|
|||||||
</el-form>
|
</el-form>
|
||||||
<span slot="footer" class="dialog-footer">
|
<span slot="footer" class="dialog-footer">
|
||||||
<el-button @click="setDialogVisible = false">取消</el-button>
|
<el-button @click="setDialogVisible = false">取消</el-button>
|
||||||
<el-button type="primary" @click="doSetActivityUser" v-loading="settingLoading">确定</el-button>
|
<el-button type="primary" :disabled="settingLoading" @click="doSetActivityUser">确定</el-button>
|
||||||
</span>
|
</span>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
@@ -646,7 +646,7 @@ module.exports = {
|
|||||||
doSearch(showFullLoading = false) {
|
doSearch(showFullLoading = false) {
|
||||||
this.tableKey = new Date().getTime()
|
this.tableKey = new Date().getTime()
|
||||||
this.pageForm.pageNumber = 1
|
this.pageForm.pageNumber = 1
|
||||||
this.pageData(showFullLoading === true)
|
return this.pageData(showFullLoading === true)
|
||||||
},
|
},
|
||||||
async pageData(showFullLoading = false) {
|
async pageData(showFullLoading = false) {
|
||||||
this.tableLoading = true
|
this.tableLoading = true
|
||||||
@@ -679,8 +679,13 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async doSetActivityUser() {
|
doSetActivityUser() {
|
||||||
const valid = await this.$refs.setForm.validate()
|
// 方法级状态保护与整页遮罩共同阻止慢请求期间的重复确认。
|
||||||
|
if (this.settingLoading) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
this.$refs.setForm.validate((valid) => {
|
||||||
if (!valid) {
|
if (!valid) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -690,32 +695,58 @@ module.exports = {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const confirm = await this.$confirm("是否将符合搜索条件的用户设为活动人员?", "提示", {
|
this.$confirm("是否将符合搜索条件的用户设为活动人员?", "提示", {
|
||||||
confirmButtonText: "确定",
|
confirmButtonText: "确定",
|
||||||
cancelButtonText: "取消",
|
cancelButtonText: "取消",
|
||||||
type: "warning"
|
type: "warning"
|
||||||
})
|
}).then(() => {
|
||||||
|
if (this.settingLoading) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if (confirm === "confirm") {
|
|
||||||
this.settingLoading = true
|
this.settingLoading = true
|
||||||
|
const loading = this.$loading({
|
||||||
|
lock: true,
|
||||||
|
text: "正在设置活动人员,请稍候...",
|
||||||
|
spinner: "el-icon-loading",
|
||||||
|
background: "rgba(255, 255, 255, 0.65)"
|
||||||
|
})
|
||||||
const pageForm = this.normalizePageForm(this.pageForm)
|
const pageForm = this.normalizePageForm(this.pageForm)
|
||||||
Object.assign(pageForm, this.formData)
|
Object.assign(pageForm, this.formData)
|
||||||
const resp = await $.post("/platform/activity/basic/scope/doSetActivityUser", {
|
|
||||||
|
$.post("/platform/activity/basic/scope/doSetActivityUser", {
|
||||||
data: JSON.stringify(pageForm)
|
data: JSON.stringify(pageForm)
|
||||||
})
|
}).then((resp) => {
|
||||||
if (resp.code === 0) {
|
if (resp.code !== 0) {
|
||||||
|
// 将后端业务错误转入统一失败分支,直接展示接口返回的真实原因。
|
||||||
|
throw new Error(resp.msg || "设置活动人员失败")
|
||||||
|
}
|
||||||
|
|
||||||
this.setDialogVisible = false
|
this.setDialogVisible = false
|
||||||
await this.getActivityGroup()
|
// 设置成功后等待分组和人员列表刷新完成,再解除整页操作锁定。
|
||||||
this.doSearch()
|
return this.getActivityGroup()
|
||||||
|
.then(() => this.doSearch())
|
||||||
|
.then(() => {
|
||||||
this.$message.success(resp.msg)
|
this.$message.success(resp.msg)
|
||||||
this.formData = this.getDefaultFormData()
|
this.formData = this.getDefaultFormData()
|
||||||
} else {
|
|
||||||
this.$message.error(resp.msg)
|
|
||||||
}
|
|
||||||
this.settingLoading = false
|
|
||||||
this.$emit("update:group_id", resp.data)
|
this.$emit("update:group_id", resp.data)
|
||||||
this.$emit("group_change")
|
this.$emit("group_change")
|
||||||
}
|
})
|
||||||
|
}).then(null, (error) => {
|
||||||
|
// 兼容业务错误、权限异常和网络异常,避免请求失败后页面持续加载。
|
||||||
|
const response = error && error.responseJSON ? error.responseJSON : null
|
||||||
|
const errorMessage = response && response.msg
|
||||||
|
? response.msg
|
||||||
|
: error && error.message
|
||||||
|
? error.message
|
||||||
|
: "设置活动人员失败"
|
||||||
|
this.$message.error(errorMessage)
|
||||||
|
}).always(() => {
|
||||||
|
this.settingLoading = false
|
||||||
|
loading.close()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
},
|
},
|
||||||
async getActivityGroup() {
|
async getActivityGroup() {
|
||||||
const resp = await $.get("/platform/activity/basic/scope/getActivityUserScopeGroup")
|
const resp = await $.get("/platform/activity/basic/scope/getActivityUserScopeGroup")
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ module.exports = {
|
|||||||
*/
|
*/
|
||||||
init() {
|
init() {
|
||||||
this.signatureAddress = origin + "/platform/signature/scanPcCode?id=" + this.id
|
this.signatureAddress = origin + "/platform/signature/scanPcCode?id=" + this.id
|
||||||
|
console.log(this.signatureAddress)
|
||||||
return this.$axios.post("/platform/signature/get")
|
return this.$axios.post("/platform/signature/get")
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (this._isBeingDestroyed || this._isDestroyed) {
|
if (this._isBeingDestroyed || this._isDestroyed) {
|
||||||
|
|||||||
@@ -75,7 +75,7 @@
|
|||||||
|
|
||||||
<!-- 引入 form-create 和 designer -->
|
<!-- 引入 form-create 和 designer -->
|
||||||
<script src="${base!}/assets/platform/plugins/form-create/form-create.min.js"></script>
|
<script src="${base!}/assets/platform/plugins/form-create/form-create.min.js"></script>
|
||||||
<script src="${base!}/assets/platform/plugins/form-create/index.umd.js"></script>
|
<script src="${base!}/assets/platform/plugins/form-create/index.umd.js?v=20261030"></script>
|
||||||
|
|
||||||
<!-- swiper -->
|
<!-- swiper -->
|
||||||
<script src="${base!}/assets/platform/plugins/swiper/swiper-bundle.js"></script>
|
<script src="${base!}/assets/platform/plugins/swiper/swiper-bundle.js"></script>
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ const act = {
|
|||||||
}
|
}
|
||||||
if (act.url === "/platform/activity/apply"
|
if (act.url === "/platform/activity/apply"
|
||||||
&& !this.$auth.hasRoleOr(["SYSADMIN", "SCHOOL_UNION_ADMIN", "BRANCH_UNION_CHAIRMAN", "BRANCH_UNION_WENTI_SPORTS"])) {
|
&& !this.$auth.hasRoleOr(["SYSADMIN", "SCHOOL_UNION_ADMIN", "BRANCH_UNION_CHAIRMAN", "BRANCH_UNION_WENTI_SPORTS"])) {
|
||||||
return this.$message.warning("PC端暂未开放报名,请前往移动端报名!")
|
return this.$message.warning("温馨提示:您没有参加该活动的权限!")
|
||||||
|
|
||||||
}
|
}
|
||||||
window.open(act.url)
|
window.open(act.url)
|
||||||
|
|||||||
@@ -116,6 +116,69 @@ layout("/layouts/v4/baseLayout.html"){
|
|||||||
object-fit: contain;
|
object-fit: contain;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 最新活动的作用域样式会在组件挂载后注入,首屏先固定布局和图片尺寸,避免刷新时放大闪烁。 */
|
||||||
|
#v4-home-app .act-card .activity-section-wrapper,
|
||||||
|
#v4-home-app .act-card .section-act,
|
||||||
|
#v4-home-app .act-card .activity-swiper {
|
||||||
|
width: 100%;
|
||||||
|
min-width: 0;
|
||||||
|
max-width: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
#v4-home-app .act-card .activity-swiper-container {
|
||||||
|
position: relative;
|
||||||
|
width: 100%;
|
||||||
|
min-width: 0;
|
||||||
|
max-width: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 9px 54px 12px;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
#v4-home-app .act-card .activity-swiper .swiper-slide {
|
||||||
|
width: 100%;
|
||||||
|
height: auto;
|
||||||
|
min-width: 0;
|
||||||
|
flex-shrink: 0;
|
||||||
|
margin-right: 18px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#v4-home-app .act-card .activity-swiper .img-box {
|
||||||
|
width: 100%;
|
||||||
|
height: 128px;
|
||||||
|
border-radius: 8px;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
#v4-home-app .act-card .activity-swiper .img-box img {
|
||||||
|
display: block;
|
||||||
|
width: 100% !important;
|
||||||
|
height: 100% !important;
|
||||||
|
max-width: 100% !important;
|
||||||
|
max-height: 128px !important;
|
||||||
|
object-fit: fill !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width: 768px) {
|
||||||
|
#v4-home-app .act-card .activity-swiper .swiper-slide {
|
||||||
|
width: calc((100% - 18px) / 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width: 1024px) {
|
||||||
|
#v4-home-app .act-card .activity-swiper .swiper-slide {
|
||||||
|
width: calc((100% - 54px) / 4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width: 1200px) {
|
||||||
|
#v4-home-app .act-card .activity-swiper .swiper-slide {
|
||||||
|
width: calc((100% - 72px) / 5);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<div class="v4-container" id="v4-home-app">
|
<div class="v4-container" id="v4-home-app">
|
||||||
|
|||||||
@@ -221,8 +221,7 @@ layout("/layouts/platform.html"){
|
|||||||
placeholder="请输入姓名" filterable clearable
|
placeholder="请输入姓名" filterable clearable
|
||||||
style="width: 100%" size="small" v-if="awardsMode==1">
|
style="width: 100%" size="small" v-if="awardsMode==1">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in userList"
|
v-for="item in getSelectableUserList(row)"
|
||||||
:disabled="item.disabled"
|
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
:label="item.username+'('+item.loginname+')'+item.sex"
|
:label="item.username+'('+item.loginname+')'+item.sex"
|
||||||
:value="item.id">
|
:value="item.id">
|
||||||
@@ -721,10 +720,15 @@ layout("/layouts/platform.html"){
|
|||||||
}
|
}
|
||||||
return score;
|
return score;
|
||||||
},
|
},
|
||||||
|
getSelectableUserList(row) {
|
||||||
|
// 其他行已经选择的人员不再显示,当前行人员保留用于姓名正常回显。
|
||||||
|
const selectedUserIds = this.userData
|
||||||
|
.map(item => item.userId)
|
||||||
|
.filter(userId => userId)
|
||||||
|
return this.userList.filter(item => item.id === row.userId || !selectedUserIds.includes(item.id))
|
||||||
|
},
|
||||||
userDetailsChange(val, row) {
|
userDetailsChange(val, row) {
|
||||||
const useridArr = this.userData.map(v => v.userId)
|
|
||||||
this.userList.forEach(v => {
|
this.userList.forEach(v => {
|
||||||
v.disabled = useridArr.includes(v.id)
|
|
||||||
if (row && row.userId === v.id) {
|
if (row && row.userId === v.id) {
|
||||||
const o = {
|
const o = {
|
||||||
unionId: v.unionId,
|
unionId: v.unionId,
|
||||||
|
|||||||
@@ -601,6 +601,8 @@
|
|||||||
eventForm: {
|
eventForm: {
|
||||||
isLeader: false
|
isLeader: false
|
||||||
},
|
},
|
||||||
|
// 独立记录当前编辑项目,避免下拉框切换后丢失切换前项目标识。
|
||||||
|
currentEventId: "",
|
||||||
eventsIds: [],
|
eventsIds: [],
|
||||||
rightChecked: [],
|
rightChecked: [],
|
||||||
checkedEventInfo: [],
|
checkedEventInfo: [],
|
||||||
@@ -778,8 +780,10 @@
|
|||||||
this.checkedEventInfo = this.checkedEvents.map((v) => {
|
this.checkedEventInfo = this.checkedEvents.map((v) => {
|
||||||
v.eventId = v.id
|
v.eventId = v.id
|
||||||
if (v.projectType === "1") {
|
if (v.projectType === "1") {
|
||||||
v.athletesMaxNum = 3
|
// “所有单项”保存默认值,具体单项以0表示尚未个性化设置。
|
||||||
v.restrictRegNumber = 2
|
const isAllItems = v.eventId === "allItems"
|
||||||
|
v.athletesMaxNum = isAllItems ? 3 : 0
|
||||||
|
v.restrictRegNumber = isAllItems ? 2 : 0
|
||||||
v.leanderNum = 0
|
v.leanderNum = 0
|
||||||
v.coachNum = 0
|
v.coachNum = 0
|
||||||
v.applyUserModel = 1
|
v.applyUserModel = 1
|
||||||
@@ -791,7 +795,23 @@
|
|||||||
return v
|
return v
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
cacheCurrentEventForm() {
|
||||||
|
if (!this.currentEventId || !this.eventForm) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const current = clone(this.eventForm)
|
||||||
|
current.checkedEventId = this.currentEventId
|
||||||
|
current.eventId = this.currentEventId
|
||||||
|
|
||||||
|
const index = this.checkedEventInfo.findIndex((item) => item.eventId === this.currentEventId)
|
||||||
|
if (index >= 0) {
|
||||||
|
this.checkedEventInfo.splice(index, 1, current)
|
||||||
|
} else {
|
||||||
|
this.checkedEventInfo.push(current)
|
||||||
|
}
|
||||||
|
},
|
||||||
async eventChange(val) {
|
async eventChange(val) {
|
||||||
|
this.cacheCurrentEventForm()
|
||||||
const data = this.checkedEventInfo.find((v) => v.eventId === val)
|
const data = this.checkedEventInfo.find((v) => v.eventId === val)
|
||||||
const resp = await $.get("/platform/activity/sports/common/getEventData", { id: val })
|
const resp = await $.get("/platform/activity/sports/common/getEventData", { id: val })
|
||||||
await this.$nextTick()
|
await this.$nextTick()
|
||||||
@@ -804,10 +824,10 @@
|
|||||||
projectType: resp.data.projectType,
|
projectType: resp.data.projectType,
|
||||||
leanderNum: 0,
|
leanderNum: 0,
|
||||||
coachNum: 0,
|
coachNum: 0,
|
||||||
athletesMaxNum: resp.data.projectType === 1 ? 3 : null,
|
athletesMaxNum: resp.data.projectType === 1 ? 0 : null,
|
||||||
restrictTotalTeam: 1,
|
restrictTotalTeam: 1,
|
||||||
substituteNum: 0,
|
substituteNum: 0,
|
||||||
restrictRegNumber: resp.data.projectType === 1 ? 2 : null,
|
restrictRegNumber: resp.data.projectType === 1 ? 0 : null,
|
||||||
isLeader: false,
|
isLeader: false,
|
||||||
applyUserModel: 1
|
applyUserModel: 1
|
||||||
}
|
}
|
||||||
@@ -815,33 +835,27 @@
|
|||||||
this.projectType = resp.data.projectType
|
this.projectType = resp.data.projectType
|
||||||
}
|
}
|
||||||
this.$set(this.eventForm, "checkedEventId", val)
|
this.$set(this.eventForm, "checkedEventId", val)
|
||||||
|
this.currentEventId = val
|
||||||
},
|
},
|
||||||
async saveEvent() {
|
saveEvent() {
|
||||||
const data = clone(this.eventForm)
|
const data = clone(this.eventForm)
|
||||||
if (data.checkedEventId === "allItems") {
|
if (data.checkedEventId === "allItems") {
|
||||||
this.checkedEventInfo.forEach((v) => {
|
const allItemsIndex = this.checkedEventInfo.findIndex((v) => v.eventId === "allItems")
|
||||||
if (v.projectType === "1") {
|
if (allItemsIndex >= 0) {
|
||||||
v.applyUserModel = this.eventForm.applyUserModel
|
this.checkedEventInfo.splice(allItemsIndex, 1, data)
|
||||||
v.athletesMaxNum = data.athletesMaxNum
|
|
||||||
v.restrictRegNumber = data.restrictRegNumber
|
|
||||||
v.unionLimit = data.unionLimit
|
|
||||||
}
|
}
|
||||||
})
|
|
||||||
} else {
|
} else {
|
||||||
const info = this.checkedEventInfo.find((v) => v.eventId === data.checkedEventId)
|
const info = this.checkedEventInfo.find((v) => v.eventId === data.checkedEventId)
|
||||||
if (info != null) {
|
if (info != null) {
|
||||||
const index = this.checkedEventInfo.findIndex((v) => v.eventId === data.checkedEventId)
|
const index = this.checkedEventInfo.findIndex((v) => v.eventId === data.checkedEventId)
|
||||||
this.checkedEventInfo.splice(index, 1)
|
this.checkedEventInfo.splice(index, 1)
|
||||||
if (info.projectType === "1") {
|
|
||||||
this.$set(this.eventForm, "athletesMaxNum", data.athletesMaxNum)
|
|
||||||
this.$set(this.eventForm, "restrictRegNumber", data.restrictRegNumber)
|
|
||||||
}
|
|
||||||
this.$set(this.eventForm, "checkedEventId", info.eventId)
|
|
||||||
}
|
}
|
||||||
data.eventId = data.checkedEventId
|
data.eventId = data.checkedEventId
|
||||||
this.checkedEventInfo.push(data)
|
this.checkedEventInfo.push(data)
|
||||||
}
|
}
|
||||||
await this.doSave()
|
this.eventForm = clone(data)
|
||||||
|
this.currentEventId = data.checkedEventId
|
||||||
|
return this.doSave()
|
||||||
},
|
},
|
||||||
prev() {
|
prev() {
|
||||||
this.active--
|
this.active--
|
||||||
@@ -949,6 +963,7 @@
|
|||||||
this.copyTemplateMode = false
|
this.copyTemplateMode = false
|
||||||
this.copyTemplateName = ""
|
this.copyTemplateName = ""
|
||||||
this.pushTodoFlag = false
|
this.pushTodoFlag = false
|
||||||
|
this.currentEventId = ""
|
||||||
this.events = await this.getEvents(2)
|
this.events = await this.getEvents(2)
|
||||||
await this.getActivityGroup()
|
await this.getActivityGroup()
|
||||||
this.active = 0
|
this.active = 0
|
||||||
@@ -1028,6 +1043,7 @@
|
|||||||
async openEdit(row, flag, copyTemplateMode = false) {
|
async openEdit(row, flag, copyTemplateMode = false) {
|
||||||
this.copyTemplateMode = !!copyTemplateMode
|
this.copyTemplateMode = !!copyTemplateMode
|
||||||
this.pushTodoFlag = false
|
this.pushTodoFlag = false
|
||||||
|
this.currentEventId = ""
|
||||||
this.active = flag ? 0 : this.active
|
this.active = flag ? 0 : this.active
|
||||||
await this.getActivityGroup()
|
await this.getActivityGroup()
|
||||||
const { id } = row
|
const { id } = row
|
||||||
@@ -1184,7 +1200,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this.eventForm.checkedEventId == "allItems") {
|
if (this.eventForm.checkedEventId == "allItems") {
|
||||||
events = events.filter((v) => v.projectType == 1 && v.id != "allItems")
|
// “所有单项”配置随具体单项提交,由后端统一校验并补齐继承值。
|
||||||
|
events = events.filter((v) => v.projectType == 1)
|
||||||
} else {
|
} else {
|
||||||
this.$set(this.eventForm, "activityId", this.formData.id)
|
this.$set(this.eventForm, "activityId", this.formData.id)
|
||||||
this.$set(this.eventForm, "eventId", this.eventForm.checkedEventId)
|
this.$set(this.eventForm, "eventId", this.eventForm.checkedEventId)
|
||||||
@@ -1192,9 +1209,10 @@
|
|||||||
this.$set(this.eventForm, "startAgeDate", this.eventForm.ageDate[0])
|
this.$set(this.eventForm, "startAgeDate", this.eventForm.ageDate[0])
|
||||||
this.$set(this.eventForm, "endAgeDate", this.eventForm.ageDate[1])
|
this.$set(this.eventForm, "endAgeDate", this.eventForm.ageDate[1])
|
||||||
}
|
}
|
||||||
events = this.eventForm
|
const allItems = this.checkedEventInfo.find((v) => v.eventId === "allItems")
|
||||||
|
events = allItems ? [clone(allItems), this.eventForm] : [this.eventForm]
|
||||||
if (this.copyTemplateMode) {
|
if (this.copyTemplateMode) {
|
||||||
this.cleanCopyTemplateData(null, [events])
|
this.cleanCopyTemplateData(null, events)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const loading = this.$loading({
|
const loading = this.$loading({
|
||||||
@@ -1215,6 +1233,7 @@
|
|||||||
this.copyTemplateMode = false
|
this.copyTemplateMode = false
|
||||||
}
|
}
|
||||||
await this.openEdit(formData, false)
|
await this.openEdit(formData, false)
|
||||||
|
this.currentEventId = this.eventForm.checkedEventId || ""
|
||||||
this.$message.success(resp.msg)
|
this.$message.success(resp.msg)
|
||||||
} else {
|
} else {
|
||||||
this.$message.error(resp.msg)
|
this.$message.error(resp.msg)
|
||||||
|
|||||||
@@ -1,4 +1,11 @@
|
|||||||
const REGISTER_INFO_COMPONENT = {
|
const REGISTER_INFO_COMPONENT = {
|
||||||
|
// 默认展示换届报告,仅由不需要查看该字段的业务页面显式关闭。
|
||||||
|
props: {
|
||||||
|
hideReplaceReport: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
}
|
||||||
|
},
|
||||||
template: `
|
template: `
|
||||||
<div>
|
<div>
|
||||||
<el-tabs tab-position="top" v-model="activeName">
|
<el-tabs tab-position="top" v-model="activeName">
|
||||||
@@ -36,7 +43,7 @@ const REGISTER_INFO_COMPONENT = {
|
|||||||
{{viewData.createTime}}
|
{{viewData.createTime}}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="会费标准" :span="4">
|
<el-descriptions-item label="会费标准" :span="4">
|
||||||
{{viewData.due}}
|
{{ viewData.due === null || viewData.due === undefined ? "--" : viewData.due + " 元/年" }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item :span="4">
|
<el-descriptions-item :span="4">
|
||||||
<template slot="label">社团介绍</template>
|
<template slot="label">社团介绍</template>
|
||||||
@@ -66,7 +73,7 @@ const REGISTER_INFO_COMPONENT = {
|
|||||||
<template slot="label">其他附件</template>
|
<template slot="label">其他附件</template>
|
||||||
<file-preview :files="viewData.files" complete_result></file-preview>
|
<file-preview :files="viewData.files" complete_result></file-preview>
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item :span="2">
|
<el-descriptions-item :span="2" v-if="!hideReplaceReport">
|
||||||
<template slot="label">换届报告</template>
|
<template slot="label">换届报告</template>
|
||||||
<file-preview :files="viewData.replaceReport" complete_result></file-preview>
|
<file-preview :files="viewData.replaceReport" complete_result></file-preview>
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
|
|||||||
@@ -68,10 +68,12 @@ layout("/layouts/platform.html"){
|
|||||||
</el-steps>
|
</el-steps>
|
||||||
|
|
||||||
<!-- 第一步:基础信息表单 -->
|
<!-- 第一步:基础信息表单 -->
|
||||||
|
<!-- 本表单自行提示首个必填错误,关闭全局校验弹窗增强以免重复提示。 -->
|
||||||
<el-form
|
<el-form
|
||||||
v-show="step === 0"
|
v-show="step === 0"
|
||||||
:model="formData"
|
:model="formData"
|
||||||
ref="baseForm"
|
ref="baseForm"
|
||||||
|
no-auto-enhance
|
||||||
:rules="baseRules"
|
:rules="baseRules"
|
||||||
label-width="150px"
|
label-width="150px"
|
||||||
class="main-form"
|
class="main-form"
|
||||||
@@ -135,7 +137,9 @@ layout("/layouts/platform.html"){
|
|||||||
v-model="formData.due"
|
v-model="formData.due"
|
||||||
placeholder="请输入会费标准"
|
placeholder="请输入会费标准"
|
||||||
readonly
|
readonly
|
||||||
></el-input>
|
>
|
||||||
|
<template slot="append">元/年</template>
|
||||||
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@@ -146,7 +150,7 @@ layout("/layouts/platform.html"){
|
|||||||
<el-form-item
|
<el-form-item
|
||||||
class="is-required"
|
class="is-required"
|
||||||
label="本年度活动开展情况"
|
label="本年度活动开展情况"
|
||||||
prop="yearActivity"
|
prop="yearActivityList"
|
||||||
>
|
>
|
||||||
<span class="tip-text">说明:非赛事活动无需填写赛事举办单位、获奖情况。</span>
|
<span class="tip-text">说明:非赛事活动无需填写赛事举办单位、获奖情况。</span>
|
||||||
<el-table
|
<el-table
|
||||||
@@ -638,6 +642,7 @@ layout("/layouts/platform.html"){
|
|||||||
id: GetQueryString("bizId"),
|
id: GetQueryString("bizId"),
|
||||||
taskId: GetQueryString("taskId"),
|
taskId: GetQueryString("taskId"),
|
||||||
step: 0, // 当前步骤(0-基础信息,1-财务收支,2-成员名单)
|
step: 0, // 当前步骤(0-基础信息,1-财务收支,2-成员名单)
|
||||||
|
formLoading: false,
|
||||||
isRegistered: false, // 是否已登记
|
isRegistered: false, // 是否已登记
|
||||||
currentClubId: "", // 当前选中社团ID
|
currentClubId: "", // 当前选中社团ID
|
||||||
|
|
||||||
@@ -656,7 +661,7 @@ layout("/layouts/platform.html"){
|
|||||||
year: new Date().getFullYear() + "", // 默认当前年度
|
year: new Date().getFullYear() + "", // 默认当前年度
|
||||||
clubId: "",
|
clubId: "",
|
||||||
foundTime: "",
|
foundTime: "",
|
||||||
due: "",
|
due: null,
|
||||||
clubName: "",
|
clubName: "",
|
||||||
yearActivityList: [{}], // 本年度活动列表
|
yearActivityList: [{}], // 本年度活动列表
|
||||||
plans: [{}], // 下年度计划列表
|
plans: [{}], // 下年度计划列表
|
||||||
@@ -671,7 +676,10 @@ layout("/layouts/platform.html"){
|
|||||||
},
|
},
|
||||||
|
|
||||||
// 表单校验规则
|
// 表单校验规则
|
||||||
baseRules: {},
|
baseRules: {
|
||||||
|
yearActivityList: [{validator: this.validateActivityRows, trigger: ['change', 'blur']}],
|
||||||
|
plans: [{validator: this.validateActivityRows, trigger: ['change', 'blur']}]
|
||||||
|
},
|
||||||
financeRules: {},
|
financeRules: {},
|
||||||
memberRules: {}
|
memberRules: {}
|
||||||
};
|
};
|
||||||
@@ -724,6 +732,28 @@ layout("/layouts/platform.html"){
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 在列表级逐行校验,避免嵌套表单项未注册、空数组或纯空白文本绕过必填。
|
||||||
|
validateActivityRows(rule, value, callback) {
|
||||||
|
const currentYear = rule.field === 'yearActivityList';
|
||||||
|
const label = currentYear ? '本年度活动开展情况' : '下一年度活动计划';
|
||||||
|
const fields = currentYear
|
||||||
|
? [['activityTime', '活动时间'], ['activityName', '活动主题/赛事名称'], ['activityAddress', '活动地点'], ['joinNum', '参加人数']]
|
||||||
|
: [['activityName', '活动主题/赛事名称'], ['activityUnit', '活动/赛事主办单位'], ['activityAddress', '活动地点']];
|
||||||
|
if (!Array.isArray(value) || value.length === 0) {
|
||||||
|
callback(new Error(label + '至少填写一条'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
for (let i = 0; i < value.length; i++) {
|
||||||
|
for (const field of fields) {
|
||||||
|
const content = value[i] && value[i][field[0]];
|
||||||
|
if (content === null || content === undefined || String(content).trim() === '') {
|
||||||
|
callback(new Error(label + '第' + (i + 1) + '条:' + field[1] + '不能为空'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
callback();
|
||||||
|
},
|
||||||
/************************ 通用工具方法 ************************/
|
/************************ 通用工具方法 ************************/
|
||||||
// 格式化数字(保留2位小数,空值显示0)
|
// 格式化数字(保留2位小数,空值显示0)
|
||||||
formatNumber(num) {
|
formatNumber(num) {
|
||||||
@@ -1110,7 +1140,7 @@ layout("/layouts/platform.html"){
|
|||||||
if (!val) return;
|
if (!val) return;
|
||||||
const club = this.clubOptions.find(item => item.id === val);
|
const club = this.clubOptions.find(item => item.id === val);
|
||||||
// 更新社团基础信息
|
// 更新社团基础信息
|
||||||
this.formData.due = club?.due || "";
|
this.formData.due = club && club.due !== null && club.due !== undefined ? club.due : null;
|
||||||
this.formData.foundTime = club?.foundTime
|
this.formData.foundTime = club?.foundTime
|
||||||
? this.$moment(club.foundTime).format("YYYY-MM-DD")
|
? this.$moment(club.foundTime).format("YYYY-MM-DD")
|
||||||
: this.$moment().format("YYYY-MM-DD");
|
: this.$moment().format("YYYY-MM-DD");
|
||||||
@@ -1161,73 +1191,63 @@ layout("/layouts/platform.html"){
|
|||||||
// 步骤前进
|
// 步骤前进
|
||||||
this.step++;
|
this.step++;
|
||||||
},
|
},
|
||||||
// 保存
|
// 三个操作共用基础信息校验,失败时返回第一步展示行号和必填字段。
|
||||||
async handleSave() {
|
validateBaseBeforeAction(action) {
|
||||||
try {
|
if (this.formLoading) return;
|
||||||
this.recalculateCensus();
|
this.$refs.baseForm.validate((valid, fields) => {
|
||||||
const resp = await this.$axios.post("/platform/club/examine/apply/save", {
|
if (!valid) {
|
||||||
data: JSON.stringify(this.formData),
|
this.step = 0;
|
||||||
incomeDetailed: JSON.stringify(this.financeData.incomeDetailed),
|
const firstError = Object.values(fields || {}).flat()[0];
|
||||||
incomeCensus: JSON.stringify(this.financeData.incomeCensus)
|
this.$message.warning('温馨提示:' + (firstError ? firstError.message : '请补全基础信息必填项'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
action();
|
||||||
});
|
});
|
||||||
if (resp.code === 0) {
|
|
||||||
this.$message.success(resp.msg);
|
|
||||||
commonUtil.pjaxPush('/platform/club/examine/mine');
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
this.handleError(error, "保存失败");
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
// 提交(新增)
|
// 仅接收本页三个固定操作的接口后缀;data为登记实体JSON,另两项为财务数组JSON。
|
||||||
async handleSubmit() {
|
// 接口返回{code,msg,data},code为0时保存成功,否则展示后端校验提示。
|
||||||
try {
|
requestExamineAction(action) {
|
||||||
|
if (this.formLoading) return;
|
||||||
this.recalculateCensus();
|
this.recalculateCensus();
|
||||||
await this.$confirm("确定要提交此申请吗?", "提示", {
|
const params = {
|
||||||
confirmButtonText: "确定",
|
|
||||||
cancelButtonText: "取消",
|
|
||||||
type: "info"
|
|
||||||
});
|
|
||||||
const resp = await this.$axios.post("/platform/club/examine/apply/submit", {
|
|
||||||
data: JSON.stringify(this.formData),
|
data: JSON.stringify(this.formData),
|
||||||
incomeDetailed: JSON.stringify(this.financeData.incomeDetailed),
|
incomeDetailed: JSON.stringify(this.financeData.incomeDetailed),
|
||||||
incomeCensus: JSON.stringify(this.financeData.incomeCensus)
|
incomeCensus: JSON.stringify(this.financeData.incomeCensus)
|
||||||
});
|
};
|
||||||
|
if (action === 'submitAgain') params.taskId = this.taskId;
|
||||||
|
this.formLoading = true;
|
||||||
|
return this.$axios.post('/platform/club/examine/apply/' + action, params)
|
||||||
|
.then((resp) => {
|
||||||
if (resp.code === 0) {
|
if (resp.code === 0) {
|
||||||
this.$message.success(resp.msg);
|
this.$message.success(resp.msg);
|
||||||
commonUtil.pjaxPush('/platform/club/examine/mine');
|
commonUtil.pjaxPush('/platform/club/examine/mine');
|
||||||
} else {
|
} else {
|
||||||
this.$message.warning(resp.msg);
|
this.$message.warning(resp.msg);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
})
|
||||||
if (error !== "cancel") {
|
.catch(() => {
|
||||||
this.handleError(error, "提交失败");
|
// 后端校验和网络异常已由全局axios拦截器提示,此处仅结束失败请求,避免再次弹窗。
|
||||||
}
|
})
|
||||||
}
|
.finally(() => {
|
||||||
|
this.formLoading = false;
|
||||||
|
});
|
||||||
},
|
},
|
||||||
// 提交(任务处理)
|
handleSave() {
|
||||||
async handleFinishTask() {
|
this.validateBaseBeforeAction(() => this.requestExamineAction('save'));
|
||||||
try {
|
},
|
||||||
this.recalculateCensus();
|
handleSubmit() {
|
||||||
await this.$confirm("您确定要提交吗?", "提示", {
|
this.validateBaseBeforeAction(() => {
|
||||||
confirmButtonText: "确定",
|
this.$confirm('确定要提交此申请吗?', '提示', {
|
||||||
cancelButtonText: "取消",
|
confirmButtonText: '确定', cancelButtonText: '取消', type: 'info'
|
||||||
type: "warning"
|
}).then(() => this.requestExamineAction('submit')).catch(() => {});
|
||||||
});
|
});
|
||||||
const resp = await this.$axios.post('/platform/club/examine/apply/submitAgain', {
|
},
|
||||||
data: JSON.stringify(this.formData),
|
handleFinishTask() {
|
||||||
incomeDetailed: JSON.stringify(this.financeData.incomeDetailed),
|
this.validateBaseBeforeAction(() => {
|
||||||
incomeCensus: JSON.stringify(this.financeData.incomeCensus),
|
this.$confirm('您确定要提交吗?', '提示', {
|
||||||
taskId: this.taskId
|
confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning'
|
||||||
|
}).then(() => this.requestExamineAction('submitAgain')).catch(() => {});
|
||||||
});
|
});
|
||||||
if (resp.code === 0) {
|
|
||||||
this.$message.success(resp.msg);
|
|
||||||
commonUtil.pjaxPush('/platform/club/examine/mine');
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
if (error !== "cancel") {
|
|
||||||
this.handleError(error, "提交失败");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
<el-descriptions v-if="viewData" :column="3" border class="table_fixed">
|
<el-descriptions v-if="viewData" :column="3" border class="table_fixed">
|
||||||
<el-descriptions-item label="社团名称">{{ viewData.clubName }}</el-descriptions-item>
|
<el-descriptions-item label="社团名称">{{ viewData.clubName }}</el-descriptions-item>
|
||||||
<el-descriptions-item label="成立时间">{{ viewData.foundTime }} </el-descriptions-item>
|
<el-descriptions-item label="成立时间">{{ viewData.foundTime }} </el-descriptions-item>
|
||||||
<el-descriptions-item label="会费标准">{{ viewData.due }}</el-descriptions-item>
|
<el-descriptions-item label="会费标准">{{ viewData.due === null || viewData.due === undefined ? "--" : viewData.due + " 元/年" }}</el-descriptions-item>
|
||||||
<el-descriptions-item span="3">
|
<el-descriptions-item span="3">
|
||||||
<template slot="label">工作总结</template>
|
<template slot="label">工作总结</template>
|
||||||
<file-preview :files="viewData.summaryFiles" complete_result></file-preview>
|
<file-preview :files="viewData.summaryFiles" complete_result></file-preview>
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ layout("/layouts/platform.html"){
|
|||||||
<el-descriptions-item label="联系人邮箱">{{viewData.concatPersonEmail}}</el-descriptions-item>
|
<el-descriptions-item label="联系人邮箱">{{viewData.concatPersonEmail}}</el-descriptions-item>
|
||||||
<el-descriptions-item>
|
<el-descriptions-item>
|
||||||
<template slot="label">会费标准</template>
|
<template slot="label">会费标准</template>
|
||||||
{{viewData.due}}
|
{{ viewData.due === null || viewData.due === undefined ? "--" : viewData.due + " 元/年" }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item :span="2">
|
<el-descriptions-item :span="2">
|
||||||
<template slot="label">当前人数</template>
|
<template slot="label">当前人数</template>
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ layout("/layouts/platform.html"){
|
|||||||
<el-descriptions-item label="社团编码">{{viewData.clubCode}}</el-descriptions-item>
|
<el-descriptions-item label="社团编码">{{viewData.clubCode}}</el-descriptions-item>
|
||||||
<el-descriptions-item label="社团类型">{{viewData.typeName}}</el-descriptions-item>
|
<el-descriptions-item label="社团类型">{{viewData.typeName}}</el-descriptions-item>
|
||||||
<el-descriptions-item label="发起人">{{viewData.sponsorName}}</el-descriptions-item>
|
<el-descriptions-item label="发起人">{{viewData.sponsorName}}</el-descriptions-item>
|
||||||
<el-descriptions-item label="会费标准">{{viewData.due}}</el-descriptions-item>
|
<el-descriptions-item label="会费标准">{{ viewData.due === null || viewData.due === undefined ? "--" : viewData.due + " 元/年" }}</el-descriptions-item>
|
||||||
<el-descriptions-item label="当前人数">{{viewData.currentPeopleNum}}</el-descriptions-item>
|
<el-descriptions-item label="当前人数">{{viewData.currentPeopleNum}}</el-descriptions-item>
|
||||||
<el-descriptions-item span="2">
|
<el-descriptions-item span="2">
|
||||||
<template slot="label">社团介绍</template>
|
<template slot="label">社团介绍</template>
|
||||||
|
|||||||
@@ -24,7 +24,13 @@ const CLUB_FORM_TEMPLATE = {
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="会费标准" prop="due">
|
<el-form-item label="会费标准" prop="due">
|
||||||
<el-input placeholder="请填写会费标准" v-model="formData.due">
|
<el-input
|
||||||
|
min="0"
|
||||||
|
placeholder="请填写会费标准"
|
||||||
|
step="0.01"
|
||||||
|
type="number"
|
||||||
|
v-model.number="formData.due"
|
||||||
|
>
|
||||||
<template slot="append">元/年</template>
|
<template slot="append">元/年</template>
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -156,12 +162,15 @@ const CLUB_FORM_TEMPLATE = {
|
|||||||
return {
|
return {
|
||||||
formData: {
|
formData: {
|
||||||
clubName: "",
|
clubName: "",
|
||||||
clubType: ""
|
clubType: "",
|
||||||
|
due: null
|
||||||
},
|
},
|
||||||
formRules: {
|
formRules: {
|
||||||
clubName: [{ required: true, message: "请填写社团名称", trigger: ["blur", "change"] }],
|
clubName: [{ required: true, message: "请填写社团名称", trigger: ["blur", "change"] }],
|
||||||
clubCode: [{ required: false, message: "请填写社团编码", trigger: ["blur", "change"] }],
|
clubCode: [{ required: false, message: "请填写社团编码", trigger: ["blur", "change"] }],
|
||||||
clubType: [{ required: true, message: "请选择社团类型", trigger: ["blur", "change"] }],
|
clubType: [{ required: true, message: "请选择社团类型", trigger: ["blur", "change"] }],
|
||||||
|
// 会费标准只保存数字,单位“元/年”由页面统一展示。
|
||||||
|
due: [{ type: "number", min: 0, message: "会费标准必须为不小于0的数字", trigger: ["blur", "change"] }],
|
||||||
//concatPerson: [{ required: true, message: "请选择社团联系人", trigger: ["blur", "change"] }],
|
//concatPerson: [{ required: true, message: "请选择社团联系人", trigger: ["blur", "change"] }],
|
||||||
foundTime: [{ required: true, message: "请选择成立时间", trigger: ["blur", "change"] }]
|
foundTime: [{ required: true, message: "请选择成立时间", trigger: ["blur", "change"] }]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ layout("/layouts/platform.html"){
|
|||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<template #public>
|
<template #public>
|
||||||
<register-info ref="registerInfoRef">
|
<register-info ref="registerInfoRef" :hide-replace-report="true">
|
||||||
<div v-if="showApprovalForm">
|
<div v-if="showApprovalForm">
|
||||||
<div class="process-title">
|
<div class="process-title">
|
||||||
{{formData.taskName}}
|
{{formData.taskName}}
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ layout("/layouts/platform.html"){
|
|||||||
<el-option v-for="item in organizationTypeOptions" :key="item.code" :label="item.name" :value="item.code"></el-option>
|
<el-option v-for="item in organizationTypeOptions" :key="item.code" :label="item.name" :value="item.code"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="所属工会" prop="unionId" :required="formData.organizationType !== 'schoolUnion'">
|
<el-form-item label="所属工会" prop="unionId">
|
||||||
<el-select v-model="formData.unionId" clearable filterable placeholder="请选择所属工会" style="width: 100%" :disabled="isUnionDisabled()">
|
<el-select v-model="formData.unionId" clearable filterable placeholder="请选择所属工会" style="width: 100%" :disabled="isUnionDisabled()">
|
||||||
<el-option v-for="item in unionOptions" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
<el-option v-for="item in unionOptions" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
@@ -255,9 +255,7 @@ layout("/layouts/platform.html"){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
const validatePeople = (rule, value, callback) => {
|
const validatePeople = (rule, value, callback) => {
|
||||||
if (value === null || value === undefined || value === "") {
|
if (!value || value <= 0) {
|
||||||
callback(new Error("必填"))
|
|
||||||
} else if (!value || value <= 0) {
|
|
||||||
callback(new Error("人数必须大于0"))
|
callback(new Error("人数必须大于0"))
|
||||||
} else if (this.batchForm.minGroupPeople && this.batchForm.maxGroupPeople
|
} else if (this.batchForm.minGroupPeople && this.batchForm.maxGroupPeople
|
||||||
&& this.batchForm.minGroupPeople > this.batchForm.maxGroupPeople) {
|
&& this.batchForm.minGroupPeople > this.batchForm.maxGroupPeople) {
|
||||||
@@ -319,15 +317,15 @@ layout("/layouts/platform.html"){
|
|||||||
},
|
},
|
||||||
batchRules: {
|
batchRules: {
|
||||||
lineId: [{ required: true, message: "必填", trigger: ["blur", "change"] }],
|
lineId: [{ required: true, message: "必填", trigger: ["blur", "change"] }],
|
||||||
signupStartTime: [{ required: true, validator: validateBatchTime, trigger: ["blur", "change"] }],
|
signupStartTime: [{ validator: validateBatchTime, trigger: ["blur", "change"] }],
|
||||||
signupEndTime: [{ required: true, validator: validateBatchTime, trigger: ["blur", "change"] }],
|
signupEndTime: [{ validator: validateBatchTime, trigger: ["blur", "change"] }],
|
||||||
travelStartTime: [{ required: true, validator: validateBatchTime, trigger: ["blur", "change"] }],
|
travelStartTime: [{ validator: validateBatchTime, trigger: ["blur", "change"] }],
|
||||||
travelEndTime: [{ required: true, validator: validateBatchTime, trigger: ["blur", "change"] }],
|
travelEndTime: [{ validator: validateBatchTime, trigger: ["blur", "change"] }],
|
||||||
contactName: [{ required: true, message: "必填", trigger: ["blur", "change"] }],
|
contactName: [{ required: true, message: "必填", trigger: ["blur", "change"] }],
|
||||||
contactPhone: [{ required: true, validator: validateMobile, trigger: ["blur", "change"] }],
|
contactPhone: [{ validator: validateMobile, trigger: ["blur", "change"] }],
|
||||||
minGroupPeople: [{ required: true, validator: validatePeople, trigger: ["blur", "change"] }],
|
minGroupPeople: [{ validator: validatePeople, trigger: ["blur", "change"] }],
|
||||||
maxGroupPeople: [{ required: true, validator: validatePeople, trigger: ["blur", "change"] }],
|
maxGroupPeople: [{ validator: validatePeople, trigger: ["blur", "change"] }],
|
||||||
estimatedCost: [{ required: true, validator: validateMoney, trigger: ["blur", "change"] }]
|
estimatedCost: [{ validator: validateMoney, trigger: ["blur", "change"] }]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -216,7 +216,7 @@ layout("/layouts/platform.html"){
|
|||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="身份证号" prop="idCard" :rules="requiredRules" required>
|
<el-form-item label="身份证号">
|
||||||
<el-input v-model="signupForm.idCard" readonly></el-input>
|
<el-input v-model="signupForm.idCard" readonly></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@@ -233,8 +233,8 @@ layout("/layouts/platform.html"){
|
|||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="手机号" prop="mobile" :rules="mobileRules" required>
|
<el-form-item label="手机号" required>
|
||||||
<el-input v-model="signupForm.mobile" maxlength="11" placeholder="请输入手机号"></el-input>
|
<el-input v-model="signupForm.mobile" maxlength="30" placeholder="请输入手机号"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@@ -325,17 +325,17 @@ layout("/layouts/platform.html"){
|
|||||||
<el-form :model="directRelativeForm" label-width="110px" ref="directRelativeForm">
|
<el-form :model="directRelativeForm" label-width="110px" ref="directRelativeForm">
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="亲属姓名" prop="relativeName" :rules="requiredRules" required>
|
<el-form-item label="亲属姓名">
|
||||||
<el-input v-model="directRelativeForm.relativeName" maxlength="100" placeholder="请输入亲属姓名"></el-input>
|
<el-input v-model="directRelativeForm.relativeName" maxlength="100" placeholder="请输入亲属姓名"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="所在单位" prop="unitName" :rules="requiredRules" required>
|
<el-form-item label="所在单位">
|
||||||
<el-input v-model="directRelativeForm.unitName" maxlength="100" placeholder="请输入所在单位"></el-input>
|
<el-input v-model="directRelativeForm.unitName" maxlength="100" placeholder="请输入所在单位"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="亲属关系" prop="relationshipCode" :rules="requiredRules" required>
|
<el-form-item label="亲属关系">
|
||||||
<el-select v-model="directRelativeForm.relationshipCode" clearable placeholder="请选择亲属关系" style="width: 100%" @change="directRelativeChange">
|
<el-select v-model="directRelativeForm.relationshipCode" clearable placeholder="请选择亲属关系" style="width: 100%" @change="directRelativeChange">
|
||||||
<el-option v-for="item in directRelativeOptions" :key="item.code" :label="item.name" :value="item.code"></el-option>
|
<el-option v-for="item in directRelativeOptions" :key="item.code" :label="item.name" :value="item.code"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
@@ -344,12 +344,12 @@ layout("/layouts/platform.html"){
|
|||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="线路名称" prop="lineName" :rules="requiredRules" required>
|
<el-form-item label="线路名称">
|
||||||
<el-input v-model="directRelativeForm.lineName" maxlength="100" placeholder="请输入线路名称"></el-input>
|
<el-input v-model="directRelativeForm.lineName" maxlength="100" placeholder="请输入线路名称"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="出行开始日期" prop="travelStartTime" :rules="requiredRules" required>
|
<el-form-item label="出行开始日期">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="directRelativeForm.travelStartTime"
|
v-model="directRelativeForm.travelStartTime"
|
||||||
type="date"
|
type="date"
|
||||||
@@ -360,7 +360,7 @@ layout("/layouts/platform.html"){
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="出行结束日期" prop="travelEndTime" :rules="requiredRules" required>
|
<el-form-item label="出行结束日期">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="directRelativeForm.travelEndTime"
|
v-model="directRelativeForm.travelEndTime"
|
||||||
type="date"
|
type="date"
|
||||||
@@ -379,48 +379,34 @@ layout("/layouts/platform.html"){
|
|||||||
<div class="tour-actions">
|
<div class="tour-actions">
|
||||||
<el-button size="medium" type="primary" icon="el-icon-plus" :disabled="!signupForm.hasFamily" @click="addFamily">增加一条</el-button>
|
<el-button size="medium" type="primary" icon="el-icon-plus" :disabled="!signupForm.hasFamily" @click="addFamily">增加一条</el-button>
|
||||||
</div>
|
</div>
|
||||||
<el-form :model="{ rows: familyData }" ref="familyForm" label-width="0">
|
<el-table :data="familyData" border :size="tableSize" empty-text="暂无亲属信息">
|
||||||
<el-table class="tour-family-table" :data="familyData" border :size="tableSize" empty-text="暂无亲属信息">
|
|
||||||
<el-table-column label="序号" type="index" width="70" align="center" header-align="center"></el-table-column>
|
<el-table-column label="序号" type="index" width="70" align="center" header-align="center"></el-table-column>
|
||||||
<el-table-column label="家属姓名" min-width="130" align="center" header-align="center">
|
<el-table-column label="家属姓名" min-width="130" align="center" header-align="center">
|
||||||
<template slot="header"><span style="color: #f56c6c">*</span> 家属姓名</template>
|
<template slot-scope="{row}">
|
||||||
<template slot-scope="{row, $index}">
|
|
||||||
<el-form-item :prop="'rows.' + $index + '.familyName'" :rules="requiredRules">
|
|
||||||
<el-input v-model="row.familyName" maxlength="100" placeholder="请输入"></el-input>
|
<el-input v-model="row.familyName" maxlength="100" placeholder="请输入"></el-input>
|
||||||
</el-form-item>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="性别" width="110" align="center" header-align="center">
|
<el-table-column label="性别" width="110" align="center" header-align="center">
|
||||||
<template slot="header"><span style="color: #f56c6c">*</span> 性别</template>
|
<template slot-scope="{row}">
|
||||||
<template slot-scope="{row, $index}">
|
|
||||||
<el-form-item :prop="'rows.' + $index + '.gender'" :rules="requiredRules">
|
|
||||||
<el-select v-model="row.gender" clearable placeholder="请选择">
|
<el-select v-model="row.gender" clearable placeholder="请选择">
|
||||||
<el-option label="男" value="男"></el-option>
|
<el-option label="男" value="男"></el-option>
|
||||||
<el-option label="女" value="女"></el-option>
|
<el-option label="女" value="女"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="身份证号码" min-width="180" align="center" header-align="center">
|
<el-table-column label="身份证号码" min-width="180" align="center" header-align="center">
|
||||||
<template slot-scope="{row, $index}">
|
<template slot-scope="{row}">
|
||||||
<el-form-item :prop="'rows.' + $index + '.idCard'" :rules="[{ required: familyContactRequired(row), validator: validateFamilyIdCard, trigger: ['blur', 'change'] }]">
|
|
||||||
<el-input v-model="row.idCard" maxlength="18" :placeholder="familyContactRequired(row) ? '16岁及以上必填' : '选填'" @blur="normalizeFamilyIdCard(row)"></el-input>
|
<el-input v-model="row.idCard" maxlength="18" :placeholder="familyContactRequired(row) ? '16岁及以上必填' : '选填'" @blur="normalizeFamilyIdCard(row)"></el-input>
|
||||||
</el-form-item>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="手机号" min-width="150" align="center" header-align="center">
|
<el-table-column label="手机号" min-width="150" align="center" header-align="center">
|
||||||
<template slot-scope="{row, $index}">
|
<template slot-scope="{row}">
|
||||||
<el-form-item :prop="'rows.' + $index + '.mobile'" :rules="[{ required: familyContactRequired(row), message: '必填', trigger: ['blur', 'change'] }]">
|
|
||||||
<el-input v-model="row.mobile" maxlength="30" :placeholder="familyContactRequired(row) ? '16岁及以上必填' : '选填'"></el-input>
|
<el-input v-model="row.mobile" maxlength="30" :placeholder="familyContactRequired(row) ? '16岁及以上必填' : '选填'"></el-input>
|
||||||
</el-form-item>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="年龄" width="110" align="center" header-align="center">
|
<el-table-column label="年龄" width="110" align="center" header-align="center">
|
||||||
<template slot="header"><span style="color: #f56c6c">*</span> 年龄</template>
|
<template slot-scope="{row}">
|
||||||
<template slot-scope="{row, $index}">
|
|
||||||
<el-form-item :prop="'rows.' + $index + '.age'" :rules="requiredRules">
|
|
||||||
<el-input-number v-model="row.age" :min="0" :max="120" :precision="0" controls-position="right" style="width: 100%"></el-input-number>
|
<el-input-number v-model="row.age" :min="0" :max="120" :precision="0" controls-position="right" style="width: 100%"></el-input-number>
|
||||||
</el-form-item>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column v-if="fillBedInfo" label="床型" min-width="120" align="center" header-align="center">
|
<el-table-column v-if="fillBedInfo" label="床型" min-width="120" align="center" header-align="center">
|
||||||
@@ -441,13 +427,10 @@ layout("/layouts/platform.html"){
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="关系" width="120" align="center" header-align="center">
|
<el-table-column label="关系" width="120" align="center" header-align="center">
|
||||||
<template slot="header"><span style="color: #f56c6c">*</span> 关系</template>
|
<template slot-scope="{row}">
|
||||||
<template slot-scope="{row, $index}">
|
|
||||||
<el-form-item :prop="'rows.' + $index + '.relationship'" :rules="requiredRules">
|
|
||||||
<el-select v-model="row.relationship" clearable placeholder="请选择">
|
<el-select v-model="row.relationship" clearable placeholder="请选择">
|
||||||
<el-option v-for="item in familyRelationshipOptions" :key="item.code" :label="item.name" :value="item.name"></el-option>
|
<el-option v-for="item in familyRelationshipOptions" :key="item.code" :label="item.name" :value="item.name"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" width="90" align="center" header-align="center" fixed="right">
|
<el-table-column label="操作" width="90" align="center" header-align="center" fixed="right">
|
||||||
@@ -456,8 +439,6 @@ layout("/layouts/platform.html"){
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<div v-if="familyValidationAttempted && familyData.length === 0" class="el-form-item__error" style="position: static">必填</div>
|
|
||||||
</el-form>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<span slot="footer" class="dialog-footer">
|
<span slot="footer" class="dialog-footer">
|
||||||
@@ -539,10 +520,6 @@ layout("/layouts/platform.html"){
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
/* 覆盖全局表格 div 文字颜色,保留输入组件下方校验提示的红色。 */
|
|
||||||
.tour-family-table.el-table td.el-table__cell .el-form-item__error {
|
|
||||||
color: #f56c6c;
|
|
||||||
}
|
|
||||||
.tour-section {
|
.tour-section {
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
padding: 0 2px;
|
padding: 0 2px;
|
||||||
@@ -786,12 +763,6 @@ layout("/layouts/platform.html"){
|
|||||||
fillBedInfo: true,
|
fillBedInfo: true,
|
||||||
signupForm: {},
|
signupForm: {},
|
||||||
familyData: [],
|
familyData: [],
|
||||||
familyValidationAttempted: false,
|
|
||||||
requiredRules: [{ required: true, message: "必填", trigger: ["blur", "change"] }],
|
|
||||||
mobileRules: [
|
|
||||||
{ required: true, message: "必填", trigger: ["blur", "change"] },
|
|
||||||
{ pattern: /^1[3-9]\d{9}$/, message: "请输入正确的11位手机号", trigger: ["blur", "change"] }
|
|
||||||
],
|
|
||||||
bedTypeOptions: [],
|
bedTypeOptions: [],
|
||||||
familyRelationshipOptions: [],
|
familyRelationshipOptions: [],
|
||||||
directRelativeOptions: [],
|
directRelativeOptions: [],
|
||||||
@@ -1190,11 +1161,6 @@ layout("/layouts/platform.html"){
|
|||||||
this.signupForm.hasFamily = true
|
this.signupForm.hasFamily = true
|
||||||
}
|
}
|
||||||
this.signupVisible = true
|
this.signupVisible = true
|
||||||
this.$nextTick(() => {
|
|
||||||
;[this.$refs.signupForm, this.$refs.directRelativeForm, this.$refs.familyForm].forEach(form => {
|
|
||||||
if (form) form.clearValidate()
|
|
||||||
})
|
|
||||||
})
|
|
||||||
} else {
|
} else {
|
||||||
this.$message.warning(res.msg || "查询失败")
|
this.$message.warning(res.msg || "查询失败")
|
||||||
}
|
}
|
||||||
@@ -1265,22 +1231,29 @@ layout("/layouts/platform.html"){
|
|||||||
this.signupForm.hasFamily = false
|
this.signupForm.hasFamily = false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 家属表格按行校验,缺失项显示在对应输入组件下方。
|
|
||||||
validateFamilies() {
|
validateFamilies() {
|
||||||
if (!this.allowFamily || !this.signupForm.hasFamily) return true
|
if (!this.allowFamily || !this.signupForm.hasFamily) return true
|
||||||
this.familyValidationAttempted = true
|
if (this.familyData.length === 0) {
|
||||||
if (this.familyData.length === 0) return false
|
this.$message.warning("请添加亲属信息")
|
||||||
return new Promise(resolve => this.$refs.familyForm.validate(valid => resolve(valid)))
|
return false
|
||||||
},
|
|
||||||
// 未满16岁的家属允许不填身份证,已填写时仍检查格式。
|
|
||||||
validateFamilyIdCard(rule, value, callback) {
|
|
||||||
if (!value) {
|
|
||||||
callback(rule.required ? new Error("必填") : undefined)
|
|
||||||
} else if (!this.isValidIdCard(value)) {
|
|
||||||
callback(new Error("请输入正确的身份证号码"))
|
|
||||||
} else {
|
|
||||||
callback()
|
|
||||||
}
|
}
|
||||||
|
const invalidBase = this.familyData.some(item => !item.familyName || item.age === null || item.age === undefined
|
||||||
|
|| !item.gender || !item.relationship)
|
||||||
|
if (invalidBase) {
|
||||||
|
this.$message.warning("请完善亲属姓名、年龄、性别和与本人关系")
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
const invalidContact = this.familyData.some(item => this.familyContactRequired(item) && (!item.idCard || !item.mobile))
|
||||||
|
if (invalidContact) {
|
||||||
|
this.$message.warning("年满16周岁的亲属必须填写身份证号码和手机号")
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
const invalidIdCard = this.familyData.some(item => item.idCard && !this.isValidIdCard(item.idCard))
|
||||||
|
if (invalidIdCard) {
|
||||||
|
this.$message.warning("请输入正确的身份证号码")
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return true
|
||||||
},
|
},
|
||||||
familyContactRequired(family) {
|
familyContactRequired(family) {
|
||||||
return family && family.age !== null && family.age !== undefined && Number(family.age) >= 16
|
return family && family.age !== null && family.age !== undefined && Number(family.age) >= 16
|
||||||
@@ -1296,17 +1269,39 @@ layout("/layouts/platform.html"){
|
|||||||
},
|
},
|
||||||
validateDirectRelative() {
|
validateDirectRelative() {
|
||||||
if (!this.isDirectFamilyLine(this.signupForm)) return true
|
if (!this.isDirectFamilyLine(this.signupForm)) return true
|
||||||
return new Promise(resolve => this.$refs.directRelativeForm.validate(valid => resolve(valid)))
|
if (!this.directRelativeForm.relativeName) {
|
||||||
|
this.$message.warning("请输入亲属姓名")
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if (!this.directRelativeForm.unitName) {
|
||||||
|
this.$message.warning("请输入亲属所在单位")
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if (!this.directRelativeForm.relationshipCode) {
|
||||||
|
this.$message.warning("请选择亲属关系")
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if (!this.directRelativeForm.lineName) {
|
||||||
|
this.$message.warning("请输入直系亲属线路名称")
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if (!this.directRelativeForm.travelStartTime) {
|
||||||
|
this.$message.warning("请选择出行开始日期")
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if (!this.directRelativeForm.travelEndTime) {
|
||||||
|
this.$message.warning("请选择出行结束日期")
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return true
|
||||||
},
|
},
|
||||||
async submitSignup() {
|
submitSignup() {
|
||||||
if (this.signupLoading) return
|
if (!this.signupForm.idCard || !this.signupForm.mobile) {
|
||||||
// 同时校验各区域,一次展示所有字段错误,通过后才提交报名。
|
this.$message.warning("请完善报名人身份证号码和手机号")
|
||||||
const results = await Promise.all([
|
return
|
||||||
new Promise(resolve => this.$refs.signupForm.validate(valid => resolve(valid))),
|
}
|
||||||
this.validateFamilies(),
|
if (!this.validateFamilies()) return
|
||||||
this.validateDirectRelative()
|
if (!this.validateDirectRelative()) return
|
||||||
])
|
|
||||||
if (results.some(valid => !valid)) return
|
|
||||||
const families = this.allowFamily && this.signupForm.hasFamily ? this.familyData : []
|
const families = this.allowFamily && this.signupForm.hasFamily ? this.familyData : []
|
||||||
const form = Object.assign({}, this.signupForm, {
|
const form = Object.assign({}, this.signupForm, {
|
||||||
families: JSON.stringify(families),
|
families: JSON.stringify(families),
|
||||||
@@ -1357,7 +1352,6 @@ layout("/layouts/platform.html"){
|
|||||||
}).catch(() => {})
|
}).catch(() => {})
|
||||||
},
|
},
|
||||||
destroySignup() {
|
destroySignup() {
|
||||||
this.familyValidationAttempted = false
|
|
||||||
this.signupForm = {}
|
this.signupForm = {}
|
||||||
this.familyData = []
|
this.familyData = []
|
||||||
this.directRelativeForm = {}
|
this.directRelativeForm = {}
|
||||||
|
|||||||
@@ -182,7 +182,7 @@ layout("/layouts/platform.html"){
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col v-if="formData.outProvinceRatioType === '固定人数'" :span="12">
|
<el-col v-if="formData.outProvinceRatioType === '固定人数'" :span="12">
|
||||||
<el-form-item label="固定人数" prop="outProvinceFixedPeople" :required="formData.outProvinceRatioType === '固定人数'">
|
<el-form-item label="固定人数" prop="outProvinceFixedPeople">
|
||||||
<el-input-number v-model="formData.outProvinceFixedPeople" :controls="false" :min="0" :precision="0" placeholder="请输入固定人数" style="width: 100%"></el-input-number>
|
<el-input-number v-model="formData.outProvinceFixedPeople" :controls="false" :min="0" :precision="0" placeholder="请输入固定人数" style="width: 100%"></el-input-number>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@@ -366,9 +366,7 @@ layout("/layouts/platform.html"){
|
|||||||
}
|
}
|
||||||
const checkOutProvinceFixedPeople = (rule, value, callback) => {
|
const checkOutProvinceFixedPeople = (rule, value, callback) => {
|
||||||
if (this.formData.outProvinceRatioType === "固定人数"
|
if (this.formData.outProvinceRatioType === "固定人数"
|
||||||
&& (value === null || value === undefined || value === "")) {
|
&& (value === null || value === undefined || value === "" || value < 0)) {
|
||||||
callback(new Error("必填"))
|
|
||||||
} else if (this.formData.outProvinceRatioType === "固定人数" && value < 0) {
|
|
||||||
callback(new Error("固定人数必须大于等于0"))
|
callback(new Error("固定人数必须大于等于0"))
|
||||||
} else {
|
} else {
|
||||||
callback()
|
callback()
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ layout("/layouts/platform.html"){
|
|||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="身份证号" prop="idCard" :rules="requiredRules" required>
|
<el-form-item label="身份证号">
|
||||||
<el-input v-model="signupForm.idCard" readonly></el-input>
|
<el-input v-model="signupForm.idCard" readonly></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@@ -130,8 +130,8 @@ layout("/layouts/platform.html"){
|
|||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="手机号" prop="mobile" :rules="mobileRules" required>
|
<el-form-item label="手机号" required>
|
||||||
<el-input v-model="signupForm.mobile" maxlength="11" placeholder="请输入手机号"></el-input>
|
<el-input v-model="signupForm.mobile" maxlength="30" placeholder="请输入手机号"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@@ -222,17 +222,17 @@ layout("/layouts/platform.html"){
|
|||||||
<el-form :model="directRelativeForm" label-width="110px" ref="directRelativeForm">
|
<el-form :model="directRelativeForm" label-width="110px" ref="directRelativeForm">
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="亲属姓名" prop="relativeName" :rules="requiredRules" required>
|
<el-form-item label="亲属姓名">
|
||||||
<el-input v-model="directRelativeForm.relativeName" maxlength="100" placeholder="请输入亲属姓名"></el-input>
|
<el-input v-model="directRelativeForm.relativeName" maxlength="100" placeholder="请输入亲属姓名"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="所在单位" prop="unitName" :rules="requiredRules" required>
|
<el-form-item label="所在单位">
|
||||||
<el-input v-model="directRelativeForm.unitName" maxlength="100" placeholder="请输入所在单位"></el-input>
|
<el-input v-model="directRelativeForm.unitName" maxlength="100" placeholder="请输入所在单位"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="亲属关系" prop="relationshipCode" :rules="requiredRules" required>
|
<el-form-item label="亲属关系">
|
||||||
<el-select v-model="directRelativeForm.relationshipCode" clearable placeholder="请选择亲属关系" style="width: 100%" @change="directRelativeChange">
|
<el-select v-model="directRelativeForm.relationshipCode" clearable placeholder="请选择亲属关系" style="width: 100%" @change="directRelativeChange">
|
||||||
<el-option v-for="item in directRelativeOptions" :key="item.code" :label="item.name" :value="item.code"></el-option>
|
<el-option v-for="item in directRelativeOptions" :key="item.code" :label="item.name" :value="item.code"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
@@ -241,12 +241,12 @@ layout("/layouts/platform.html"){
|
|||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="线路名称" prop="lineName" :rules="requiredRules" required>
|
<el-form-item label="线路名称">
|
||||||
<el-input v-model="directRelativeForm.lineName" maxlength="100" placeholder="请输入线路名称"></el-input>
|
<el-input v-model="directRelativeForm.lineName" maxlength="100" placeholder="请输入线路名称"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="出行开始日期" prop="travelStartTime" :rules="requiredRules" required>
|
<el-form-item label="出行开始日期">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="directRelativeForm.travelStartTime"
|
v-model="directRelativeForm.travelStartTime"
|
||||||
type="date"
|
type="date"
|
||||||
@@ -257,7 +257,7 @@ layout("/layouts/platform.html"){
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="出行结束日期" prop="travelEndTime" :rules="requiredRules" required>
|
<el-form-item label="出行结束日期">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="directRelativeForm.travelEndTime"
|
v-model="directRelativeForm.travelEndTime"
|
||||||
type="date"
|
type="date"
|
||||||
@@ -276,48 +276,34 @@ layout("/layouts/platform.html"){
|
|||||||
<div class="tour-signup-actions">
|
<div class="tour-signup-actions">
|
||||||
<el-button size="medium" type="primary" icon="el-icon-plus" :disabled="!signupForm.hasFamily" @click="addFamily">增加一条</el-button>
|
<el-button size="medium" type="primary" icon="el-icon-plus" :disabled="!signupForm.hasFamily" @click="addFamily">增加一条</el-button>
|
||||||
</div>
|
</div>
|
||||||
<el-form :model="{ rows: familyData }" ref="familyForm" label-width="0">
|
<el-table :data="familyData" border :size="tableSize" empty-text="暂无亲属信息">
|
||||||
<el-table class="tour-family-table" :data="familyData" border :size="tableSize" empty-text="暂无亲属信息">
|
|
||||||
<el-table-column label="序号" type="index" width="70" align="center" header-align="center"></el-table-column>
|
<el-table-column label="序号" type="index" width="70" align="center" header-align="center"></el-table-column>
|
||||||
<el-table-column label="家属姓名" min-width="130" align="center" header-align="center">
|
<el-table-column label="家属姓名" min-width="130" align="center" header-align="center">
|
||||||
<template slot="header"><span style="color: #f56c6c">*</span> 家属姓名</template>
|
<template slot-scope="{row}">
|
||||||
<template slot-scope="{row, $index}">
|
|
||||||
<el-form-item :prop="'rows.' + $index + '.familyName'" :rules="requiredRules">
|
|
||||||
<el-input v-model="row.familyName" maxlength="100" placeholder="请输入"></el-input>
|
<el-input v-model="row.familyName" maxlength="100" placeholder="请输入"></el-input>
|
||||||
</el-form-item>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="性别" width="110" align="center" header-align="center">
|
<el-table-column label="性别" width="110" align="center" header-align="center">
|
||||||
<template slot="header"><span style="color: #f56c6c">*</span> 性别</template>
|
<template slot-scope="{row}">
|
||||||
<template slot-scope="{row, $index}">
|
|
||||||
<el-form-item :prop="'rows.' + $index + '.gender'" :rules="requiredRules">
|
|
||||||
<el-select v-model="row.gender" clearable placeholder="请选择">
|
<el-select v-model="row.gender" clearable placeholder="请选择">
|
||||||
<el-option label="男" value="男"></el-option>
|
<el-option label="男" value="男"></el-option>
|
||||||
<el-option label="女" value="女"></el-option>
|
<el-option label="女" value="女"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="身份证号码" min-width="180" align="center" header-align="center">
|
<el-table-column label="身份证号码" min-width="180" align="center" header-align="center">
|
||||||
<template slot-scope="{row, $index}">
|
<template slot-scope="{row}">
|
||||||
<el-form-item :prop="'rows.' + $index + '.idCard'" :rules="[{ required: familyContactRequired(row), validator: validateFamilyIdCard, trigger: ['blur', 'change'] }]">
|
|
||||||
<el-input v-model="row.idCard" maxlength="18" :placeholder="familyContactRequired(row) ? '16岁及以上必填' : '选填'" @blur="normalizeFamilyIdCard(row)"></el-input>
|
<el-input v-model="row.idCard" maxlength="18" :placeholder="familyContactRequired(row) ? '16岁及以上必填' : '选填'" @blur="normalizeFamilyIdCard(row)"></el-input>
|
||||||
</el-form-item>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="手机号" min-width="150" align="center" header-align="center">
|
<el-table-column label="手机号" min-width="150" align="center" header-align="center">
|
||||||
<template slot-scope="{row, $index}">
|
<template slot-scope="{row}">
|
||||||
<el-form-item :prop="'rows.' + $index + '.mobile'" :rules="[{ required: familyContactRequired(row), message: '必填', trigger: ['blur', 'change'] }]">
|
|
||||||
<el-input v-model="row.mobile" maxlength="30" :placeholder="familyContactRequired(row) ? '16岁及以上必填' : '选填'"></el-input>
|
<el-input v-model="row.mobile" maxlength="30" :placeholder="familyContactRequired(row) ? '16岁及以上必填' : '选填'"></el-input>
|
||||||
</el-form-item>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="年龄" width="110" align="center" header-align="center">
|
<el-table-column label="年龄" width="110" align="center" header-align="center">
|
||||||
<template slot="header"><span style="color: #f56c6c">*</span> 年龄</template>
|
<template slot-scope="{row}">
|
||||||
<template slot-scope="{row, $index}">
|
|
||||||
<el-form-item :prop="'rows.' + $index + '.age'" :rules="requiredRules">
|
|
||||||
<el-input-number v-model="row.age" :min="0" :max="120" :precision="0" controls-position="right" style="width: 100%"></el-input-number>
|
<el-input-number v-model="row.age" :min="0" :max="120" :precision="0" controls-position="right" style="width: 100%"></el-input-number>
|
||||||
</el-form-item>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column v-if="fillBedInfo" label="床型" min-width="120" align="center" header-align="center">
|
<el-table-column v-if="fillBedInfo" label="床型" min-width="120" align="center" header-align="center">
|
||||||
@@ -350,13 +336,10 @@ layout("/layouts/platform.html"){
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
-->
|
-->
|
||||||
<el-table-column label="关系" width="120" align="center" header-align="center">
|
<el-table-column label="关系" width="120" align="center" header-align="center">
|
||||||
<template slot="header"><span style="color: #f56c6c">*</span> 关系</template>
|
<template slot-scope="{row}">
|
||||||
<template slot-scope="{row, $index}">
|
|
||||||
<el-form-item :prop="'rows.' + $index + '.relationship'" :rules="requiredRules">
|
|
||||||
<el-select v-model="row.relationship" clearable placeholder="请选择">
|
<el-select v-model="row.relationship" clearable placeholder="请选择">
|
||||||
<el-option v-for="item in familyRelationshipOptions" :key="item.code" :label="item.name" :value="item.name"></el-option>
|
<el-option v-for="item in familyRelationshipOptions" :key="item.code" :label="item.name" :value="item.name"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" width="90" align="center" header-align="center" fixed="right">
|
<el-table-column label="操作" width="90" align="center" header-align="center" fixed="right">
|
||||||
@@ -365,8 +348,6 @@ layout("/layouts/platform.html"){
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<div v-if="familyValidationAttempted && familyData.length === 0" class="el-form-item__error" style="position: static">必填</div>
|
|
||||||
</el-form>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<span slot="footer" class="dialog-footer">
|
<span slot="footer" class="dialog-footer">
|
||||||
@@ -408,10 +389,6 @@ layout("/layouts/platform.html"){
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
/* 覆盖全局表格 div 文字颜色,保留输入组件下方校验提示的红色。 */
|
|
||||||
.tour-family-table.el-table td.el-table__cell .el-form-item__error {
|
|
||||||
color: #f56c6c;
|
|
||||||
}
|
|
||||||
.tour-signup-title {
|
.tour-signup-title {
|
||||||
border-left: 4px solid #0079c2;
|
border-left: 4px solid #0079c2;
|
||||||
color: #0079c2;
|
color: #0079c2;
|
||||||
@@ -512,12 +489,6 @@ layout("/layouts/platform.html"){
|
|||||||
fillBedInfo: true,
|
fillBedInfo: true,
|
||||||
signupForm: {},
|
signupForm: {},
|
||||||
familyData: [],
|
familyData: [],
|
||||||
familyValidationAttempted: false,
|
|
||||||
requiredRules: [{ required: true, message: "必填", trigger: ["blur", "change"] }],
|
|
||||||
mobileRules: [
|
|
||||||
{ required: true, message: "必填", trigger: ["blur", "change"] },
|
|
||||||
{ pattern: /^1[3-9]\d{9}$/, message: "请输入正确的11位手机号", trigger: ["blur", "change"] }
|
|
||||||
],
|
|
||||||
bedTypeOptions: [],
|
bedTypeOptions: [],
|
||||||
familyRelationshipOptions: [],
|
familyRelationshipOptions: [],
|
||||||
directRelativeOptions: [],
|
directRelativeOptions: [],
|
||||||
@@ -820,11 +791,6 @@ layout("/layouts/platform.html"){
|
|||||||
this.signupForm.hasFamily = true
|
this.signupForm.hasFamily = true
|
||||||
}
|
}
|
||||||
this.signupVisible = true
|
this.signupVisible = true
|
||||||
this.$nextTick(() => {
|
|
||||||
;[this.$refs.signupForm, this.$refs.directRelativeForm, this.$refs.familyForm].forEach(form => {
|
|
||||||
if (form) form.clearValidate()
|
|
||||||
})
|
|
||||||
})
|
|
||||||
} else {
|
} else {
|
||||||
this.$message.warning(res.msg || "查询失败")
|
this.$message.warning(res.msg || "查询失败")
|
||||||
}
|
}
|
||||||
@@ -881,22 +847,29 @@ layout("/layouts/platform.html"){
|
|||||||
this.signupForm.hasFamily = false
|
this.signupForm.hasFamily = false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 家属表格按行校验,缺失项显示在对应输入组件下方。
|
|
||||||
validateFamilies() {
|
validateFamilies() {
|
||||||
if (!this.allowFamily || !this.signupForm.hasFamily) return true
|
if (!this.allowFamily || !this.signupForm.hasFamily) return true
|
||||||
this.familyValidationAttempted = true
|
if (this.familyData.length === 0) {
|
||||||
if (this.familyData.length === 0) return false
|
this.$message.warning("请添加亲属信息")
|
||||||
return new Promise(resolve => this.$refs.familyForm.validate(valid => resolve(valid)))
|
return false
|
||||||
},
|
|
||||||
// 未满16岁的家属允许不填身份证,已填写时仍检查格式。
|
|
||||||
validateFamilyIdCard(rule, value, callback) {
|
|
||||||
if (!value) {
|
|
||||||
callback(rule.required ? new Error("必填") : undefined)
|
|
||||||
} else if (!this.isValidIdCard(value)) {
|
|
||||||
callback(new Error("请输入正确的身份证号码"))
|
|
||||||
} else {
|
|
||||||
callback()
|
|
||||||
}
|
}
|
||||||
|
const invalidBase = this.familyData.some(item => !item.familyName || item.age === null || item.age === undefined
|
||||||
|
|| !item.gender || !item.relationship)
|
||||||
|
if (invalidBase) {
|
||||||
|
this.$message.warning("请完善亲属姓名、年龄、性别和与本人关系")
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
const invalidContact = this.familyData.some(item => this.familyContactRequired(item) && (!item.idCard || !item.mobile))
|
||||||
|
if (invalidContact) {
|
||||||
|
this.$message.warning("年满16周岁的亲属必须填写身份证号码和手机号")
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
const invalidIdCard = this.familyData.some(item => item.idCard && !this.isValidIdCard(item.idCard))
|
||||||
|
if (invalidIdCard) {
|
||||||
|
this.$message.warning("请输入正确的身份证号码")
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return true
|
||||||
},
|
},
|
||||||
familyContactRequired(family) {
|
familyContactRequired(family) {
|
||||||
return family && family.age !== null && family.age !== undefined && Number(family.age) >= 16
|
return family && family.age !== null && family.age !== undefined && Number(family.age) >= 16
|
||||||
@@ -912,17 +885,39 @@ layout("/layouts/platform.html"){
|
|||||||
},
|
},
|
||||||
validateDirectRelative() {
|
validateDirectRelative() {
|
||||||
if (!this.isDirectFamilyLine(this.signupForm)) return true
|
if (!this.isDirectFamilyLine(this.signupForm)) return true
|
||||||
return new Promise(resolve => this.$refs.directRelativeForm.validate(valid => resolve(valid)))
|
if (!this.directRelativeForm.relativeName) {
|
||||||
|
this.$message.warning("请输入亲属姓名")
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if (!this.directRelativeForm.unitName) {
|
||||||
|
this.$message.warning("请输入亲属所在单位")
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if (!this.directRelativeForm.relationshipCode) {
|
||||||
|
this.$message.warning("请选择亲属关系")
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if (!this.directRelativeForm.lineName) {
|
||||||
|
this.$message.warning("请输入直系亲属线路名称")
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if (!this.directRelativeForm.travelStartTime) {
|
||||||
|
this.$message.warning("请选择出行开始日期")
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if (!this.directRelativeForm.travelEndTime) {
|
||||||
|
this.$message.warning("请选择出行结束日期")
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return true
|
||||||
},
|
},
|
||||||
async submitSignup() {
|
submitSignup() {
|
||||||
if (this.signupLoading) return
|
if (!this.signupForm.idCard || !this.signupForm.mobile) {
|
||||||
// 同时校验各区域,一次展示所有字段错误,通过后才提交报名。
|
this.$message.warning("请完善报名人身份证号码和手机号")
|
||||||
const results = await Promise.all([
|
return
|
||||||
new Promise(resolve => this.$refs.signupForm.validate(valid => resolve(valid))),
|
}
|
||||||
this.validateFamilies(),
|
if (!this.validateFamilies()) return
|
||||||
this.validateDirectRelative()
|
if (!this.validateDirectRelative()) return
|
||||||
])
|
|
||||||
if (results.some(valid => !valid)) return
|
|
||||||
const families = this.allowFamily && this.signupForm.hasFamily ? this.familyData : []
|
const families = this.allowFamily && this.signupForm.hasFamily ? this.familyData : []
|
||||||
const form = Object.assign({}, this.signupForm, {
|
const form = Object.assign({}, this.signupForm, {
|
||||||
families: JSON.stringify(families),
|
families: JSON.stringify(families),
|
||||||
@@ -971,7 +966,6 @@ layout("/layouts/platform.html"){
|
|||||||
}).catch(() => {})
|
}).catch(() => {})
|
||||||
},
|
},
|
||||||
destroySignup() {
|
destroySignup() {
|
||||||
this.familyValidationAttempted = false
|
|
||||||
this.signupForm = {}
|
this.signupForm = {}
|
||||||
this.familyData = []
|
this.familyData = []
|
||||||
this.directRelativeForm = {}
|
this.directRelativeForm = {}
|
||||||
|
|||||||
@@ -138,14 +138,14 @@ layout("/layouts/platform.html"){
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="联系人手机" prop="contactPhone" required>
|
<el-form-item label="联系人手机" prop="contactPhone">
|
||||||
<el-input v-model="formData.contactPhone" maxlength="30" placeholder="请输入联系人手机"></el-input>
|
<el-input v-model="formData.contactPhone" maxlength="30" placeholder="请输入联系人手机"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="邮箱" prop="email" required>
|
<el-form-item label="邮箱" prop="email">
|
||||||
<el-input v-model="formData.email" maxlength="100" placeholder="请输入邮箱"></el-input>
|
<el-input v-model="formData.email" maxlength="100" placeholder="请输入邮箱"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@@ -221,8 +221,8 @@ layout("/layouts/platform.html"){
|
|||||||
agencyName: [{ required: true, message: "必填", trigger: ["blur", "change"] }],
|
agencyName: [{ required: true, message: "必填", trigger: ["blur", "change"] }],
|
||||||
agencyCode: [{ required: true, message: "必填", trigger: ["blur", "change"] }],
|
agencyCode: [{ required: true, message: "必填", trigger: ["blur", "change"] }],
|
||||||
contactName: [{ required: true, message: "必填", trigger: ["blur", "change"] }],
|
contactName: [{ required: true, message: "必填", trigger: ["blur", "change"] }],
|
||||||
contactPhone: [{ required: true, validator: validateMobile, trigger: ["blur", "change"] }],
|
contactPhone: [{ validator: validateMobile, trigger: ["blur", "change"] }],
|
||||||
email: [{ required: true, validator: validateEmail, trigger: ["blur", "change"] }]
|
email: [{ validator: validateEmail, trigger: ["blur", "change"] }]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -41,30 +41,6 @@ layout("/layouts/platform.html"){
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
.qsv-online-answer-header {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
gap: 16px;
|
|
||||||
padding-right: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.qsv-online-quiz-timer {
|
|
||||||
flex-shrink: 0;
|
|
||||||
color: #e6a23c;
|
|
||||||
font-weight: 600;
|
|
||||||
}
|
|
||||||
|
|
||||||
.qsv-online-description {
|
|
||||||
line-height: 1.8;
|
|
||||||
overflow-wrap: break-word;
|
|
||||||
}
|
|
||||||
|
|
||||||
.qsv-online-description img {
|
|
||||||
max-width: 100%;
|
|
||||||
height: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.qsv-online-preview-title {
|
.qsv-online-preview-title {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
@@ -114,33 +90,6 @@ layout("/layouts/platform.html"){
|
|||||||
min-width: 72px;
|
min-width: 72px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.qsv-online-result-score {
|
|
||||||
color: #409eff;
|
|
||||||
font-size: 28px;
|
|
||||||
font-weight: 700;
|
|
||||||
}
|
|
||||||
|
|
||||||
.qsv-online-result-tags {
|
|
||||||
margin-bottom: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.qsv-online-result-option {
|
|
||||||
color: #303133;
|
|
||||||
}
|
|
||||||
|
|
||||||
.qsv-online-result-option.is-correct {
|
|
||||||
color: #67c23a;
|
|
||||||
}
|
|
||||||
|
|
||||||
.qsv-online-subject-result {
|
|
||||||
margin-top: 12px;
|
|
||||||
color: #f56c6c;
|
|
||||||
}
|
|
||||||
|
|
||||||
.qsv-online-subject-result.is-correct {
|
|
||||||
color: #67c23a;
|
|
||||||
}
|
|
||||||
|
|
||||||
.qsv-online-option-fill {
|
.qsv-online-option-fill {
|
||||||
width: 520px;
|
width: 520px;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
@@ -546,22 +495,8 @@ layout("/layouts/platform.html"){
|
|||||||
size="1145px"
|
size="1145px"
|
||||||
custom-class="qsv-online-drawer"
|
custom-class="qsv-online-drawer"
|
||||||
append-to-body
|
append-to-body
|
||||||
@close="stopAnswerTimers">
|
@closed="stopVoteCountdown">
|
||||||
<div slot="title" class="qsv-online-answer-header">
|
|
||||||
<span>{{answerDialog.title}}</span>
|
|
||||||
<span v-if="answerDialog.activity.category === 'QUIZ' && answerDialog.activity.timeLimit > 0 && !answerDialog.readonly" class="qsv-online-quiz-timer">
|
|
||||||
<i class="el-icon-time"></i> 剩余时间:{{quizRemainingText}}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div class="qsv-online-preview-body" v-loading="answerDialog.loading">
|
<div class="qsv-online-preview-body" v-loading="answerDialog.loading">
|
||||||
<div v-if="answerDialog.activity.description" class="qsv-online-subject">
|
|
||||||
<div class="qsv-online-subject-title">说明</div>
|
|
||||||
<div class="qsv-online-description" v-html="answerDialog.activity.description"></div>
|
|
||||||
</div>
|
|
||||||
<div v-if="showQuizResult" class="qsv-online-subject">
|
|
||||||
<div class="qsv-online-subject-title">{{answerDialog.activity.title}}</div>
|
|
||||||
<div class="qsv-online-result-score">总分:{{quizTotalScore}} 分</div>
|
|
||||||
</div>
|
|
||||||
<div v-if="isVoteActivity" class="qsv-online-vote">
|
<div v-if="isVoteActivity" class="qsv-online-vote">
|
||||||
<div class="qsv-online-vote-header">
|
<div class="qsv-online-vote-header">
|
||||||
<h2 class="qsv-online-vote-title">{{answerDialog.activity.title}}</h2>
|
<h2 class="qsv-online-vote-title">{{answerDialog.activity.title}}</h2>
|
||||||
@@ -638,11 +573,6 @@ layout("/layouts/platform.html"){
|
|||||||
</div>
|
</div>
|
||||||
<el-empty v-if="!isVoteActivity && visibleSubjects.length === 0 && !answerDialog.loading" description="暂无题目"></el-empty>
|
<el-empty v-if="!isVoteActivity && visibleSubjects.length === 0 && !answerDialog.loading" description="暂无题目"></el-empty>
|
||||||
<div v-if="!isVoteActivity" v-for="(subject, index) in visibleSubjects" :key="subject.id" class="qsv-online-subject">
|
<div v-if="!isVoteActivity" v-for="(subject, index) in visibleSubjects" :key="subject.id" class="qsv-online-subject">
|
||||||
<div v-if="showQuizResult" class="qsv-online-result-tags">
|
|
||||||
<el-tag v-if="subject.type === 'radio'" size="small">单选</el-tag>
|
|
||||||
<el-tag v-else-if="subject.type === 'checkbox'" size="small">多选</el-tag>
|
|
||||||
<el-tag v-if="subject.score !== undefined && subject.score !== null" size="small">{{subject.score}}分</el-tag>
|
|
||||||
</div>
|
|
||||||
<div class="qsv-online-subject-title">
|
<div class="qsv-online-subject-title">
|
||||||
<span v-if="answerDialog.showIndex" class="qsv-online-subject-index">{{index + 1}}.</span>
|
<span v-if="answerDialog.showIndex" class="qsv-online-subject-index">{{index + 1}}.</span>
|
||||||
<span>{{subject.title}}</span>
|
<span>{{subject.title}}</span>
|
||||||
@@ -655,7 +585,7 @@ layout("/layouts/platform.html"){
|
|||||||
:value="getRadioValue(subject)"
|
:value="getRadioValue(subject)"
|
||||||
@input="setRadioValue(subject, $event)">
|
@input="setRadioValue(subject, $event)">
|
||||||
<template v-for="option in subject.options">
|
<template v-for="option in subject.options">
|
||||||
<el-radio :key="option.id" :label="option.id"><span :class="{ 'qsv-online-result-option': showQuizResult, 'is-correct': showQuizResult && option.isCorrect }">{{option.text}}<span v-if="showQuizResult && option.isCorrect">(正确答案)</span></span></el-radio>
|
<el-radio :key="option.id" :label="option.id">{{option.text}}</el-radio>
|
||||||
<el-input
|
<el-input
|
||||||
v-if="isOptionFillVisible(subject, option)"
|
v-if="isOptionFillVisible(subject, option)"
|
||||||
:key="option.id + '-fill'"
|
:key="option.id + '-fill'"
|
||||||
@@ -674,7 +604,7 @@ layout("/layouts/platform.html"){
|
|||||||
:disabled="answerDialog.readonly"
|
:disabled="answerDialog.readonly"
|
||||||
@change="onCheckboxChange(subject)">
|
@change="onCheckboxChange(subject)">
|
||||||
<template v-for="option in subject.options">
|
<template v-for="option in subject.options">
|
||||||
<el-checkbox :key="option.id" :label="option.id"><span :class="{ 'qsv-online-result-option': showQuizResult, 'is-correct': showQuizResult && option.isCorrect }">{{option.text}}<span v-if="showQuizResult && option.isCorrect">(正确答案)</span></span></el-checkbox>
|
<el-checkbox :key="option.id" :label="option.id">{{option.text}}</el-checkbox>
|
||||||
<el-input
|
<el-input
|
||||||
v-if="isOptionFillVisible(subject, option)"
|
v-if="isOptionFillVisible(subject, option)"
|
||||||
:key="option.id + '-fill'"
|
:key="option.id + '-fill'"
|
||||||
@@ -693,10 +623,6 @@ layout("/layouts/platform.html"){
|
|||||||
:readonly="answerDialog.readonly"
|
:readonly="answerDialog.readonly"
|
||||||
v-model="subject.userFillContent"
|
v-model="subject.userFillContent"
|
||||||
:placeholder="'请输入' + subject.title"></el-input>
|
:placeholder="'请输入' + subject.title"></el-input>
|
||||||
<div v-if="showQuizResult && getSubjectResult(subject)" class="qsv-online-subject-result" :class="{ 'is-correct': getSubjectResult(subject).isCorrect }">
|
|
||||||
<i :class="getSubjectResult(subject).isCorrect ? 'el-icon-circle-check' : 'el-icon-circle-close'"></i>
|
|
||||||
{{getSubjectResult(subject).isCorrect ? '回答正确' : '回答错误'}},得分:{{getSubjectResult(subject).score || 0}} 分
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="qsv-online-footer">
|
<div class="qsv-online-footer">
|
||||||
@@ -783,10 +709,6 @@ layout("/layouts/platform.html"){
|
|||||||
minutes: 0,
|
minutes: 0,
|
||||||
seconds: 0
|
seconds: 0
|
||||||
},
|
},
|
||||||
quizTimer: null,
|
|
||||||
quizStartedAt: 0,
|
|
||||||
quizElapsedSeconds: 0,
|
|
||||||
quizExpired: false,
|
|
||||||
voteTimer: null,
|
voteTimer: null,
|
||||||
voteRankVisible: false,
|
voteRankVisible: false,
|
||||||
voteDetailVisible: false,
|
voteDetailVisible: false,
|
||||||
@@ -795,21 +717,6 @@ layout("/layouts/platform.html"){
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
// 仅已完成的计分答题显示成绩和正确答案,普通调查与投票保持原有展示。
|
|
||||||
showQuizResult() {
|
|
||||||
return this.answerDialog.activity.category === "QUIZ" && !!this.answerDialog.answerRecord.isFinish
|
|
||||||
},
|
|
||||||
quizRemainingSeconds() {
|
|
||||||
return Math.max(0, Number(this.answerDialog.activity.timeLimit || 0) * 60 - this.answerDialog.quizElapsedSeconds)
|
|
||||||
},
|
|
||||||
quizRemainingText() {
|
|
||||||
const seconds = this.quizRemainingSeconds
|
|
||||||
return Math.floor(seconds / 60) + '分' + String(seconds % 60).padStart(2, '0') + '秒'
|
|
||||||
},
|
|
||||||
quizTotalScore() {
|
|
||||||
const answers = this.answerDialog.answerRecord.extJson || {}
|
|
||||||
return Object.keys(answers).reduce((total, id) => total + Number(answers[id].score || 0), 0)
|
|
||||||
},
|
|
||||||
visibleSubjects() {
|
visibleSubjects() {
|
||||||
return this.answerDialog.subjects.filter((subject) => {
|
return this.answerDialog.subjects.filter((subject) => {
|
||||||
return this.isSubjectVisible(subject)
|
return this.isSubjectVisible(subject)
|
||||||
@@ -955,10 +862,6 @@ layout("/layouts/platform.html"){
|
|||||||
this.$message.warning(unavailableMessage)
|
this.$message.warning(unavailableMessage)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.stopAnswerTimers()
|
|
||||||
this.answerDialog.quizStartedAt = 0
|
|
||||||
this.answerDialog.quizElapsedSeconds = 0
|
|
||||||
this.answerDialog.quizExpired = false
|
|
||||||
this.answerDialog.visible = true
|
this.answerDialog.visible = true
|
||||||
this.answerDialog.loading = true
|
this.answerDialog.loading = true
|
||||||
this.answerDialog.readonly = row.actionType === "view"
|
this.answerDialog.readonly = row.actionType === "view"
|
||||||
@@ -1005,7 +908,6 @@ layout("/layouts/platform.html"){
|
|||||||
this.answerDialog.answerRecord = res.data || {}
|
this.answerDialog.answerRecord = res.data || {}
|
||||||
this.answerDialog.readonly = !!this.answerDialog.answerRecord.isFinish
|
this.answerDialog.readonly = !!this.answerDialog.answerRecord.isFinish
|
||||||
this.initAnswer()
|
this.initAnswer()
|
||||||
this.startQuizTimer()
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -1026,10 +928,6 @@ layout("/layouts/platform.html"){
|
|||||||
this.clearHiddenSubjectAnswers()
|
this.clearHiddenSubjectAnswers()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getSubjectResult(subject) {
|
|
||||||
const answers = this.answerDialog.answerRecord.extJson || {}
|
|
||||||
return answers[subject.id]
|
|
||||||
},
|
|
||||||
getRadioValue(subject) {
|
getRadioValue(subject) {
|
||||||
return subject.userSelectOptionIds && subject.userSelectOptionIds.length > 0
|
return subject.userSelectOptionIds && subject.userSelectOptionIds.length > 0
|
||||||
? subject.userSelectOptionIds[0]
|
? subject.userSelectOptionIds[0]
|
||||||
@@ -1087,43 +985,6 @@ layout("/layouts/platform.html"){
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 使用实际经过时间计时,避免切换浏览器标签后定时器节流导致倒计时变慢。
|
|
||||||
startQuizTimer() {
|
|
||||||
this.stopQuizTimer()
|
|
||||||
if (!this.answerDialog.visible || this.answerDialog.readonly || this.answerDialog.activity.category !== "QUIZ") return
|
|
||||||
this.answerDialog.quizStartedAt = Date.now()
|
|
||||||
this.answerDialog.quizElapsedSeconds = 0
|
|
||||||
this.answerDialog.quizExpired = false
|
|
||||||
this.answerDialog.quizTimer = setInterval(() => this.updateQuizTimer(), 1000)
|
|
||||||
},
|
|
||||||
updateQuizTimer() {
|
|
||||||
if (!this.answerDialog.quizStartedAt || this.answerDialog.readonly || !this.answerDialog.visible) return
|
|
||||||
this.answerDialog.quizElapsedSeconds = Math.floor((Date.now() - this.answerDialog.quizStartedAt) / 1000)
|
|
||||||
if (Number(this.answerDialog.activity.timeLimit) > 0 && this.quizRemainingSeconds === 0
|
|
||||||
&& !this.answerDialog.quizExpired && !this.answerDialog.submitLoading) {
|
|
||||||
this.answerDialog.quizExpired = true
|
|
||||||
this.stopQuizTimer()
|
|
||||||
// 与手机端一致:超时提示重新答题,不自动提交未完成的答卷。
|
|
||||||
this.$alert("答题时间到,请重新进入答题", "提示", {
|
|
||||||
confirmButtonText: "确定",
|
|
||||||
showClose: false,
|
|
||||||
closeOnClickModal: false,
|
|
||||||
closeOnPressEscape: false
|
|
||||||
}).then(() => {
|
|
||||||
this.answerDialog.visible = false
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
stopQuizTimer() {
|
|
||||||
if (this.answerDialog.quizTimer) {
|
|
||||||
clearInterval(this.answerDialog.quizTimer)
|
|
||||||
this.answerDialog.quizTimer = null
|
|
||||||
}
|
|
||||||
},
|
|
||||||
stopAnswerTimers() {
|
|
||||||
this.stopQuizTimer()
|
|
||||||
this.stopVoteCountdown()
|
|
||||||
},
|
|
||||||
startVoteCountdown() {
|
startVoteCountdown() {
|
||||||
this.stopVoteCountdown()
|
this.stopVoteCountdown()
|
||||||
this.updateVoteCountdown()
|
this.updateVoteCountdown()
|
||||||
@@ -1335,8 +1196,6 @@ layout("/layouts/platform.html"){
|
|||||||
return true
|
return true
|
||||||
},
|
},
|
||||||
submitAnswer() {
|
submitAnswer() {
|
||||||
this.updateQuizTimer()
|
|
||||||
if (this.answerDialog.readonly || this.answerDialog.quizExpired || this.answerDialog.submitLoading) return
|
|
||||||
if (!this.validateAnswer()) {
|
if (!this.validateAnswer()) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -1345,14 +1204,11 @@ layout("/layouts/platform.html"){
|
|||||||
cancelButtonText: "取消",
|
cancelButtonText: "取消",
|
||||||
type: "warning"
|
type: "warning"
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.updateQuizTimer()
|
|
||||||
if (!this.answerDialog.visible || this.answerDialog.readonly || this.answerDialog.quizExpired || this.answerDialog.submitLoading) return
|
|
||||||
this.answerDialog.submitLoading = true
|
this.answerDialog.submitLoading = true
|
||||||
$.post("/platform/qsv/online/submitAnswer", {
|
$.post("/platform/qsv/online/submitAnswer", {
|
||||||
answer: JSON.stringify({
|
answer: JSON.stringify({
|
||||||
activityId: this.answerDialog.activity.id,
|
activityId: this.answerDialog.activity.id,
|
||||||
answerRecordId: this.answerDialog.answerRecordId,
|
answerRecordId: this.answerDialog.answerRecordId,
|
||||||
answerTime: this.answerDialog.quizElapsedSeconds,
|
|
||||||
subjects: this.submitSubjects.map((subject) => {
|
subjects: this.submitSubjects.map((subject) => {
|
||||||
return {
|
return {
|
||||||
id: subject.id,
|
id: subject.id,
|
||||||
@@ -1365,14 +1221,7 @@ layout("/layouts/platform.html"){
|
|||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
this.$message.success(res.msg)
|
this.$message.success(res.msg)
|
||||||
if (this.answerDialog.activity.category === "QUIZ") {
|
|
||||||
// 提交后读取服务端判题结果,直接展示成绩并防止重复提交。
|
|
||||||
this.answerDialog.readonly = true
|
|
||||||
this.stopQuizTimer()
|
|
||||||
this.loadAnswerRecord()
|
|
||||||
} else {
|
|
||||||
this.answerDialog.visible = false
|
this.answerDialog.visible = false
|
||||||
}
|
|
||||||
this.pageData()
|
this.pageData()
|
||||||
} else {
|
} else {
|
||||||
this.$message.error(res.msg)
|
this.$message.error(res.msg)
|
||||||
@@ -1388,7 +1237,7 @@ layout("/layouts/platform.html"){
|
|||||||
this.openAnswerFromUrl()
|
this.openAnswerFromUrl()
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
this.stopAnswerTimers()
|
this.stopVoteCountdown()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ const filterUser = {
|
|||||||
</search-item>
|
</search-item>
|
||||||
|
|
||||||
<search-item label="所属单位">
|
<search-item label="所属单位">
|
||||||
<el-select clearable filterable
|
<el-select @change="unitChange" clearable filterable
|
||||||
placeholder="请选择所属单位" style="width: 100%"
|
placeholder="请选择所属单位" style="width: 100%"
|
||||||
v-model="pageForm.unitId">
|
v-model="pageForm.unitId">
|
||||||
<el-option
|
<el-option
|
||||||
@@ -74,6 +74,17 @@ const filterUser = {
|
|||||||
</el-select>
|
</el-select>
|
||||||
</search-item>
|
</search-item>
|
||||||
|
|
||||||
|
<search-item label="三级单位">
|
||||||
|
<el-select clearable filterable placeholder="请先选择所属单位" style="width: 100%"
|
||||||
|
v-model="pageForm.threeUnitId">
|
||||||
|
<el-option
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.id"
|
||||||
|
v-for="item in threeUnitOptions">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</search-item>
|
||||||
|
|
||||||
<search-item label="人员类型:">
|
<search-item label="人员类型:">
|
||||||
<dict-select clearable code="USER_PERSON_TYPE"
|
<dict-select clearable code="USER_PERSON_TYPE"
|
||||||
@@ -83,6 +94,13 @@ const filterUser = {
|
|||||||
v-model="pageForm.personTypes"></dict-select>
|
v-model="pageForm.personTypes"></dict-select>
|
||||||
</search-item>
|
</search-item>
|
||||||
|
|
||||||
|
<search-item label="人员属性:">
|
||||||
|
<dict-select clearable code="USER_ATTRIBUTE"
|
||||||
|
multiple
|
||||||
|
collapse-tags
|
||||||
|
placeholder="请选择人员属性"
|
||||||
|
v-model="pageForm.userAttributes"></dict-select>
|
||||||
|
</search-item>
|
||||||
|
|
||||||
<search-item label="在职状态:">
|
<search-item label="在职状态:">
|
||||||
<dict-select clearable code="USER_STATE"
|
<dict-select clearable code="USER_STATE"
|
||||||
@@ -151,11 +169,14 @@ const filterUser = {
|
|||||||
userStates: [],
|
userStates: [],
|
||||||
personTypes: [],
|
personTypes: [],
|
||||||
preparedBys: [],
|
preparedBys: [],
|
||||||
unitId: null
|
userAttributes: [],
|
||||||
|
unitId: null,
|
||||||
|
threeUnitId: null
|
||||||
},
|
},
|
||||||
sexOptions: ["男", "女"],
|
sexOptions: ["男", "女"],
|
||||||
unionOptions: [],
|
unionOptions: [],
|
||||||
unitOptions: [],
|
unitOptions: [],
|
||||||
|
threeUnitOptions: [],
|
||||||
tableColumns: [
|
tableColumns: [
|
||||||
{ prop: "loginname", label: "工号" },
|
{ prop: "loginname", label: "工号" },
|
||||||
{ prop: "username", label: "姓名" },
|
{ prop: "username", label: "姓名" },
|
||||||
@@ -164,7 +185,8 @@ const filterUser = {
|
|||||||
{ prop: "personType", label: "人员类型", sortable: true },
|
{ prop: "personType", label: "人员类型", sortable: true },
|
||||||
{ prop: "userState", label: "在职状态", sortable: true },
|
{ prop: "userState", label: "在职状态", sortable: true },
|
||||||
{ prop: "unionName", label: "所属工会", sortable: true },
|
{ prop: "unionName", label: "所属工会", sortable: true },
|
||||||
{ prop: "unitName", label: "所属单位", sortable: true }
|
{ prop: "unitName", label: "所属单位", sortable: true },
|
||||||
|
{ prop: "threeUnitName", label: "三级单位", sortable: true }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -186,12 +208,35 @@ const filterUser = {
|
|||||||
this.$set(this.pageForm, "birthMonths", [])
|
this.$set(this.pageForm, "birthMonths", [])
|
||||||
this.$set(this.pageForm, "unionId", null)
|
this.$set(this.pageForm, "unionId", null)
|
||||||
this.$set(this.pageForm, "unitId", null)
|
this.$set(this.pageForm, "unitId", null)
|
||||||
|
this.$set(this.pageForm, "threeUnitId", null)
|
||||||
|
this.threeUnitOptions = []
|
||||||
this.$set(this.pageForm, "personTypes", [])
|
this.$set(this.pageForm, "personTypes", [])
|
||||||
this.$set(this.pageForm, "preparedBys", [])
|
this.$set(this.pageForm, "preparedBys", [])
|
||||||
|
this.$set(this.pageForm, "userAttributes", [])
|
||||||
this.$set(this.pageForm, "userStates", [])
|
this.$set(this.pageForm, "userStates", [])
|
||||||
this.$set(this.pageForm, "isMember", null)
|
this.$set(this.pageForm, "isMember", null)
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 所属单位改变后,仅加载该单位直属的三级单位,避免跨单位筛选。
|
||||||
|
unitChange(unitId) {
|
||||||
|
this.$set(this.pageForm, "threeUnitId", null)
|
||||||
|
this.threeUnitOptions = []
|
||||||
|
if (!unitId) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.$axios.post("/platform/sys/unit/child", { pid: unitId })
|
||||||
|
.then((res) => {
|
||||||
|
if (res.code === 0) {
|
||||||
|
this.threeUnitOptions = res.data || []
|
||||||
|
} else {
|
||||||
|
this.$message.error(res.msg || "三级单位查询失败")
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
this.$message.error("三级单位查询失败,请稍后重试")
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
pageData() {
|
pageData() {
|
||||||
this.tableLoading = true
|
this.tableLoading = true
|
||||||
this.$axios
|
this.$axios
|
||||||
|
|||||||
@@ -65,6 +65,10 @@ layout("/layouts/platform.html"){
|
|||||||
<dict-select v-model="pageForm.aidFundMemberUserType" placeholder="请选择人员分类" @change="doSearch"
|
<dict-select v-model="pageForm.aidFundMemberUserType" placeholder="请选择人员分类" @change="doSearch"
|
||||||
code="AIDFUND_MEMBER_USER_TYPE"></dict-select>
|
code="AIDFUND_MEMBER_USER_TYPE"></dict-select>
|
||||||
</search-item>
|
</search-item>
|
||||||
|
<search-item label="人员属性">
|
||||||
|
<dict-select v-model="pageForm.userAttribute" placeholder="请选择人员属性" @change="doSearch"
|
||||||
|
code="USER_ATTRIBUTE"></dict-select>
|
||||||
|
</search-item>
|
||||||
</search>
|
</search>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ const addUser = {
|
|||||||
</search-item>
|
</search-item>
|
||||||
|
|
||||||
<search-item label="所属单位">
|
<search-item label="所属单位">
|
||||||
<el-select clearable
|
<el-select @change="unitChange" clearable
|
||||||
filterable
|
filterable
|
||||||
placeholder="请选择所属单位" style="width: 100%"
|
placeholder="请选择所属单位" style="width: 100%"
|
||||||
v-model="pageForm.unitId">
|
v-model="pageForm.unitId">
|
||||||
@@ -76,6 +76,17 @@ const addUser = {
|
|||||||
</el-select>
|
</el-select>
|
||||||
</search-item>
|
</search-item>
|
||||||
|
|
||||||
|
<search-item label="三级单位">
|
||||||
|
<el-select clearable filterable placeholder="请先选择所属单位" style="width: 100%"
|
||||||
|
v-model="pageForm.threeUnitId">
|
||||||
|
<el-option
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.id"
|
||||||
|
v-for="item in threeUnitOptions">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</search-item>
|
||||||
|
|
||||||
<search-item label="人员类型:">
|
<search-item label="人员类型:">
|
||||||
<dict-select clearable code="USER_PERSON_TYPE"
|
<dict-select clearable code="USER_PERSON_TYPE"
|
||||||
@@ -85,6 +96,13 @@ const addUser = {
|
|||||||
v-model="pageForm.personTypes"></dict-select>
|
v-model="pageForm.personTypes"></dict-select>
|
||||||
</search-item>
|
</search-item>
|
||||||
|
|
||||||
|
<search-item label="人员属性:">
|
||||||
|
<dict-select clearable code="USER_ATTRIBUTE"
|
||||||
|
multiple
|
||||||
|
collapse-tags
|
||||||
|
placeholder="请选择人员属性"
|
||||||
|
v-model="pageForm.userAttributes"></dict-select>
|
||||||
|
</search-item>
|
||||||
|
|
||||||
<search-item label="在职状态:">
|
<search-item label="在职状态:">
|
||||||
<dict-select clearable code="USER_STATE"
|
<dict-select clearable code="USER_STATE"
|
||||||
@@ -153,7 +171,9 @@ const addUser = {
|
|||||||
birthMonths: [],
|
birthMonths: [],
|
||||||
unionId: null,
|
unionId: null,
|
||||||
unitId: null,
|
unitId: null,
|
||||||
|
threeUnitId: null,
|
||||||
personTypes: [],
|
personTypes: [],
|
||||||
|
userAttributes: [],
|
||||||
preparedBys: [],
|
preparedBys: [],
|
||||||
userStates: [],
|
userStates: [],
|
||||||
isMember: null
|
isMember: null
|
||||||
@@ -161,6 +181,7 @@ const addUser = {
|
|||||||
sexOptions: ["男", "女"],
|
sexOptions: ["男", "女"],
|
||||||
unionOptions: [],
|
unionOptions: [],
|
||||||
unitOptions: [],
|
unitOptions: [],
|
||||||
|
threeUnitOptions: [],
|
||||||
tableColumns: [
|
tableColumns: [
|
||||||
{ prop: "loginname", label: "工号" },
|
{ prop: "loginname", label: "工号" },
|
||||||
{ prop: "username", label: "姓名" },
|
{ prop: "username", label: "姓名" },
|
||||||
@@ -169,7 +190,8 @@ const addUser = {
|
|||||||
{ prop: "personType", label: "人员类型", sortable: true },
|
{ prop: "personType", label: "人员类型", sortable: true },
|
||||||
{ prop: "userState", label: "在职状态", sortable: true },
|
{ prop: "userState", label: "在职状态", sortable: true },
|
||||||
{ prop: "unionName", label: "所属工会", sortable: true },
|
{ prop: "unionName", label: "所属工会", sortable: true },
|
||||||
{ prop: "unitName", label: "所属单位", sortable: true }
|
{ prop: "unitName", label: "所属单位", sortable: true },
|
||||||
|
{ prop: "threeUnitName", label: "三级单位", sortable: true }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -191,7 +213,10 @@ const addUser = {
|
|||||||
this.$set(this.pageForm, "birthMonths", [])
|
this.$set(this.pageForm, "birthMonths", [])
|
||||||
this.$set(this.pageForm, "unionId", null)
|
this.$set(this.pageForm, "unionId", null)
|
||||||
this.$set(this.pageForm, "unitId", null)
|
this.$set(this.pageForm, "unitId", null)
|
||||||
|
this.$set(this.pageForm, "threeUnitId", null)
|
||||||
|
this.$set(this, "threeUnitOptions", [])
|
||||||
this.$set(this.pageForm, "personTypes", [])
|
this.$set(this.pageForm, "personTypes", [])
|
||||||
|
this.$set(this.pageForm, "userAttributes", [])
|
||||||
this.$set(this.pageForm, "preparedBys", [])
|
this.$set(this.pageForm, "preparedBys", [])
|
||||||
this.$set(this.pageForm, "userStates", [])
|
this.$set(this.pageForm, "userStates", [])
|
||||||
this.$set(this.pageForm, "isMember", null)
|
this.$set(this.pageForm, "isMember", null)
|
||||||
@@ -199,6 +224,7 @@ const addUser = {
|
|||||||
|
|
||||||
async unionIdChange(val) {
|
async unionIdChange(val) {
|
||||||
this.$set(this.pageForm, "unitId", null)
|
this.$set(this.pageForm, "unitId", null)
|
||||||
|
this.unitChange(null)
|
||||||
if (val) {
|
if (val) {
|
||||||
this.$set(this, "unitOptions", await this.$businessTool.listUnit(val))
|
this.$set(this, "unitOptions", await this.$businessTool.listUnit(val))
|
||||||
} else {
|
} else {
|
||||||
@@ -206,6 +232,26 @@ const addUser = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 所属单位改变后,仅加载该单位直属的三级单位,避免跨单位筛选。
|
||||||
|
unitChange(unitId) {
|
||||||
|
this.$set(this.pageForm, "threeUnitId", null)
|
||||||
|
this.$set(this, "threeUnitOptions", [])
|
||||||
|
if (!unitId) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.$axios.post("/platform/sys/unit/child", { pid: unitId })
|
||||||
|
.then((res) => {
|
||||||
|
if (res.code === 0) {
|
||||||
|
this.$set(this, "threeUnitOptions", res.data || [])
|
||||||
|
} else {
|
||||||
|
this.$message.error(res.msg || "三级单位查询失败")
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
this.$message.error("三级单位查询失败,请稍后重试")
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
pageData() {
|
pageData() {
|
||||||
this.tableLoading = true
|
this.tableLoading = true
|
||||||
this.$axios
|
this.$axios
|
||||||
|
|||||||
@@ -81,12 +81,26 @@ layout("/layouts/platform.html"){
|
|||||||
collapse-tags
|
collapse-tags
|
||||||
placeholder="请选择所属单位"
|
placeholder="请选择所属单位"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
|
@change="unitIdsChange"
|
||||||
v-model="pageForm.unitIds"
|
v-model="pageForm.unitIds"
|
||||||
>
|
>
|
||||||
<el-option :key="item.id" :label="item.name" :value="item.id" v-for="item in unitOptions"></el-option>
|
<el-option :key="item.id" :label="item.name" :value="item.id" v-for="item in unitOptions"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</search-item>
|
</search-item>
|
||||||
|
|
||||||
|
<search-item label="三级单位">
|
||||||
|
<el-select
|
||||||
|
clearable
|
||||||
|
filterable
|
||||||
|
multiple
|
||||||
|
collapse-tags
|
||||||
|
placeholder="请先选择所属单位"
|
||||||
|
style="width: 100%"
|
||||||
|
v-model="pageForm.threeUnitIds"
|
||||||
|
>
|
||||||
|
<el-option :key="item.id" :label="item.name" :value="item.id" v-for="item in threeUnitOptions"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</search-item>
|
||||||
|
|
||||||
<search-item label="人员类型:">
|
<search-item label="人员类型:">
|
||||||
<dict-select
|
<dict-select
|
||||||
@@ -114,6 +128,10 @@ layout("/layouts/platform.html"){
|
|||||||
<dict-select v-model="pageForm.aidFundMemberUserType" placeholder="请选择人员分类" @change="doSearch"
|
<dict-select v-model="pageForm.aidFundMemberUserType" placeholder="请选择人员分类" @change="doSearch"
|
||||||
code="AIDFUND_MEMBER_USER_TYPE"></dict-select>
|
code="AIDFUND_MEMBER_USER_TYPE"></dict-select>
|
||||||
</search-item>
|
</search-item>
|
||||||
|
<search-item label="人员属性">
|
||||||
|
<dict-select v-model="pageForm.userAttributes" placeholder="请选择人员属性" @change="doSearch"
|
||||||
|
code="USER_ATTRIBUTE" clearable multiple collapse-tags></dict-select>
|
||||||
|
</search-item>
|
||||||
|
|
||||||
<!-- <search-item label="所选福利:">-->
|
<!-- <search-item label="所选福利:">-->
|
||||||
<!-- <el-select clearable placeholder="请选择所选福利" style="width: 100%" v-model="pageForm.optionId">-->
|
<!-- <el-select clearable placeholder="请选择所选福利" style="width: 100%" v-model="pageForm.optionId">-->
|
||||||
@@ -265,6 +283,7 @@ layout("/layouts/platform.html"){
|
|||||||
},
|
},
|
||||||
unionOptions: [],
|
unionOptions: [],
|
||||||
unitOptions: [],
|
unitOptions: [],
|
||||||
|
threeUnitOptions: [],
|
||||||
sexOptions: ["男", "女"],
|
sexOptions: ["男", "女"],
|
||||||
projectSelectOptions: [],
|
projectSelectOptions: [],
|
||||||
tableColumns: [
|
tableColumns: [
|
||||||
@@ -276,6 +295,7 @@ layout("/layouts/platform.html"){
|
|||||||
{ prop: "userState", label: "在职状态", sortable: true },
|
{ prop: "userState", label: "在职状态", sortable: true },
|
||||||
{ prop: "welfareUnionName", label: "所属工会", sortable: true },
|
{ prop: "welfareUnionName", label: "所属工会", sortable: true },
|
||||||
{ prop: "welfareUnitName", label: "所属单位", sortable: true },
|
{ prop: "welfareUnitName", label: "所属单位", sortable: true },
|
||||||
|
{ prop: "threeUnitName", label: "三级单位", sortable: true },
|
||||||
{ prop: "remark", label: "备注", sortable: true }
|
{ prop: "remark", label: "备注", sortable: true }
|
||||||
],
|
],
|
||||||
|
|
||||||
@@ -403,6 +423,32 @@ layout("/layouts/platform.html"){
|
|||||||
this.doSearch()
|
this.doSearch()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
// 根据已选所属单位查询直属三级单位,筛选项只保留当前所属单位范围内的数据。
|
||||||
|
async unitIdsChange(unitIds) {
|
||||||
|
this.$set(this.pageForm, "threeUnitIds", [])
|
||||||
|
this.$set(this, "threeUnitOptions", [])
|
||||||
|
if (!unitIds || unitIds.length === 0) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
const responses = await Promise.all(unitIds.map((unitId) => this.$axios.post("/platform/sys/unit/child", { pid: unitId })))
|
||||||
|
const failedResponse = responses.find((res) => res.code !== 0)
|
||||||
|
if (failedResponse) {
|
||||||
|
this.$message.error(failedResponse.msg || "三级单位查询失败")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const optionMap = {}
|
||||||
|
responses.forEach((res) => {
|
||||||
|
const options = res.data || []
|
||||||
|
options.forEach((item) => {
|
||||||
|
optionMap[item.id] = item
|
||||||
|
})
|
||||||
|
})
|
||||||
|
this.$set(this, "threeUnitOptions", Object.keys(optionMap).map((id) => optionMap[id]))
|
||||||
|
} catch (e) {
|
||||||
|
this.$message.error("三级单位查询失败,请稍后重试")
|
||||||
|
}
|
||||||
|
},
|
||||||
pageData() {
|
pageData() {
|
||||||
this.tableLoading = true
|
this.tableLoading = true
|
||||||
this.$axios
|
this.$axios
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ layout("/layouts/platform_h5.html"){
|
|||||||
<van-cell title="会长">{{ clubDetail.clubLeader || '--' }}</van-cell>
|
<van-cell title="会长">{{ clubDetail.clubLeader || '--' }}</van-cell>
|
||||||
<van-cell title="秘书长">{{ clubDetail.clubSecretary || '--' }}</van-cell>
|
<van-cell title="秘书长">{{ clubDetail.clubSecretary || '--' }}</van-cell>
|
||||||
<van-cell title="当前人数">{{ clubDetail.currentPeopleNum || 0 }} 人</van-cell>
|
<van-cell title="当前人数">{{ clubDetail.currentPeopleNum || 0 }} 人</van-cell>
|
||||||
<van-cell title="会费标准">{{ clubDetail.due || '--' }}</van-cell>
|
<van-cell title="会费标准">{{ clubDetail.due === null || clubDetail.due === undefined ? '--' : clubDetail.due + ' 元/年' }}</van-cell>
|
||||||
<van-cell title="社团介绍" class="club-user-join-info-long-cell"><div v-if="hasClubContent(clubDetail.introduce)" v-html="clubDetail.introduce"></div><span v-else>暂无</span></van-cell>
|
<van-cell title="社团介绍" class="club-user-join-info-long-cell"><div v-if="hasClubContent(clubDetail.introduce)" v-html="clubDetail.introduce"></div><span v-else>暂无</span></van-cell>
|
||||||
<van-cell title="社团宗旨" class="club-user-join-info-long-cell"><div v-if="hasClubContent(clubDetail.purpose)" v-html="clubDetail.purpose"></div><span v-else>暂无</span></van-cell>
|
<van-cell title="社团宗旨" class="club-user-join-info-long-cell"><div v-if="hasClubContent(clubDetail.purpose)" v-html="clubDetail.purpose"></div><span v-else>暂无</span></van-cell>
|
||||||
<van-cell title="社团章程" class="club-user-join-info-long-cell"><file-preview v-if="clubDetail.rulesFile && clubDetail.rulesFile.length" :files="clubDetail.rulesFile" complete_result></file-preview><span v-else>暂无</span></van-cell>
|
<van-cell title="社团章程" class="club-user-join-info-long-cell"><file-preview v-if="clubDetail.rulesFile && clubDetail.rulesFile.length" :files="clubDetail.rulesFile" complete_result></file-preview><span v-else>暂无</span></van-cell>
|
||||||
|
|||||||
@@ -16,11 +16,6 @@ layout("/layouts/platform_h5.html"){
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="quiz-card-scroll" v-if="!answerRecord.isFinish">
|
<div class="quiz-card-scroll" v-if="!answerRecord.isFinish">
|
||||||
<van-collapse v-if="activity.description" v-model="descriptionPanels" class="quiz-description" @change="adaptDescriptionToMobile">
|
|
||||||
<van-collapse-item title="说明" name="description" :value="descriptionPanels.length ? '收起' : '展开'">
|
|
||||||
<div ref="descriptionContent" class="quiz-description-content" v-html="activity.description"></div>
|
|
||||||
</van-collapse-item>
|
|
||||||
</van-collapse>
|
|
||||||
<div v-for="(subject, index) in subjects" :key="index" class="subject">
|
<div v-for="(subject, index) in subjects" :key="index" class="subject">
|
||||||
<p>{{index+1}}、{{ subject.title }}</p>
|
<p>{{index+1}}、{{ subject.title }}</p>
|
||||||
<div class="tag">
|
<div class="tag">
|
||||||
@@ -70,7 +65,6 @@ layout("/layouts/platform_h5.html"){
|
|||||||
H5JumpTo: GetQueryString("H5JumpTo"),
|
H5JumpTo: GetQueryString("H5JumpTo"),
|
||||||
subjects: [],
|
subjects: [],
|
||||||
activity: {},
|
activity: {},
|
||||||
descriptionPanels: [],
|
|
||||||
isFinished: false,
|
isFinished: false,
|
||||||
answerRecord: {},
|
answerRecord: {},
|
||||||
answerRecordId: null,
|
answerRecordId: null,
|
||||||
@@ -106,28 +100,6 @@ layout("/layouts/platform_h5.html"){
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 按原有字号层次缩小大字,不覆盖富文本颜色、字重、对齐等样式。
|
|
||||||
adaptDescriptionToMobile() {
|
|
||||||
this.$nextTick(() => {
|
|
||||||
const content = this.$refs.descriptionContent
|
|
||||||
if (!content || !this.descriptionPanels.length || content.dataset.mobileAdapted) return
|
|
||||||
// 先读取全部字号,避免父元素缩放后影响子元素的继承字号计算。
|
|
||||||
const sizes = [content, ...content.querySelectorAll('*')].map(element => ({
|
|
||||||
element,
|
|
||||||
size: parseFloat(window.getComputedStyle(element).fontSize)
|
|
||||||
}))
|
|
||||||
const maxSize = sizes.reduce((max, item) => Math.max(max, item.size || 0), 0)
|
|
||||||
if (maxSize > 22) {
|
|
||||||
const ratio = 8 / (maxSize - 14)
|
|
||||||
sizes.forEach(({ element, size }) => {
|
|
||||||
if (!Number.isFinite(size)) return
|
|
||||||
const mobileSize = size > 14 ? 14 + (size - 14) * ratio : size
|
|
||||||
element.style.setProperty('font-size', mobileSize + 'px', 'important')
|
|
||||||
})
|
|
||||||
}
|
|
||||||
content.dataset.mobileAdapted = 'true'
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getCategoryPageTitle(category, defaultTitle) {
|
getCategoryPageTitle(category, defaultTitle) {
|
||||||
const titleMap = {
|
const titleMap = {
|
||||||
QUIZ: "在线答题",
|
QUIZ: "在线答题",
|
||||||
@@ -440,25 +412,6 @@ layout("/layouts/platform_h5.html"){
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
.quiz-description {
|
|
||||||
margin-bottom: 14px;
|
|
||||||
border-radius: 8px;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
.quiz-description-content {
|
|
||||||
color: #303133;
|
|
||||||
line-height: 1.8;
|
|
||||||
overflow-wrap: break-word;
|
|
||||||
overflow-x: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/deep/ .quiz-description-content img {
|
|
||||||
max-width: 100%;
|
|
||||||
height: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.subject {
|
.subject {
|
||||||
background: #fff;
|
background: #fff;
|
||||||
padding: 15px;
|
padding: 15px;
|
||||||
|
|||||||
@@ -276,22 +276,8 @@ layout("/layouts/platform_h5.html"){
|
|||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 导航栏参与弹层布局,正文独立滚动,避免固定导航遮住首张卡片。 */
|
|
||||||
.tour-record-popup {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
overflow: hidden;
|
|
||||||
padding-top: env(safe-area-inset-top);
|
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tour-record-popup > .van-nav-bar {
|
|
||||||
flex-shrink: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tour-popup-body {
|
.tour-popup-body {
|
||||||
flex: 1;
|
height: calc(100vh - 46px);
|
||||||
min-height: 0;
|
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
padding: 10px 12px 76px;
|
padding: 10px 12px 76px;
|
||||||
background: #f4f6f8;
|
background: #f4f6f8;
|
||||||
@@ -608,7 +594,7 @@ layout("/layouts/platform_h5.html"){
|
|||||||
}
|
}
|
||||||
|
|
||||||
.tour-popup-body {
|
.tour-popup-body {
|
||||||
padding: 12px 12px calc(82px + env(safe-area-inset-bottom));
|
padding: 12px 12px 82px;
|
||||||
background-color: #f3f7fd;
|
background-color: #f3f7fd;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -630,12 +616,6 @@ layout("/layouts/platform_h5.html"){
|
|||||||
box-shadow: 0 -6px 18px rgba(38, 66, 103, .08);
|
box-shadow: 0 -6px 18px rgba(38, 66, 103, .08);
|
||||||
}
|
}
|
||||||
|
|
||||||
.tour-bottom-bar .tour-cancel-button {
|
|
||||||
border: 0;
|
|
||||||
color: #65748a;
|
|
||||||
background-color: #f0f2f5;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 列表页结构与提案校工会预审核保持一致,业务字段及操作条件继续沿用疗休养逻辑。 */
|
/* 列表页结构与提案校工会预审核保持一致,业务字段及操作条件继续沿用疗休养逻辑。 */
|
||||||
.tour-my-page .van-nav-bar {
|
.tour-my-page .van-nav-bar {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
@@ -937,8 +917,8 @@ layout("/layouts/platform_h5.html"){
|
|||||||
</div>
|
</div>
|
||||||
</van-popup>
|
</van-popup>
|
||||||
|
|
||||||
<van-popup v-model="detailVisible" class="tour-record-popup" position="right" :style="{ width: '100%', height: '100%' }" :close-on-click-overlay="false">
|
<van-popup v-model="detailVisible" position="right" :style="{ width: '100%', height: '100%' }" :close-on-click-overlay="false">
|
||||||
<van-nav-bar title="报名详情" left-text="返回" left-arrow @click-left="closeHistoryPopup('detail')"></van-nav-bar>
|
<van-nav-bar title="报名详情" left-text="返回" left-arrow @click-left="closeHistoryPopup('detail')" fixed placeholder></van-nav-bar>
|
||||||
<div class="tour-popup-body">
|
<div class="tour-popup-body">
|
||||||
<div class="tour-section">
|
<div class="tour-section">
|
||||||
<div class="tour-section-title">教职工信息</div>
|
<div class="tour-section-title">教职工信息</div>
|
||||||
@@ -946,7 +926,6 @@ layout("/layouts/platform_h5.html"){
|
|||||||
<van-cell title="姓名" :value="detail.userName || ''"></van-cell>
|
<van-cell title="姓名" :value="detail.userName || ''"></van-cell>
|
||||||
<van-cell title="性别" :value="detail.gender || ''"></van-cell>
|
<van-cell title="性别" :value="detail.gender || ''"></van-cell>
|
||||||
<van-cell title="身份证号" :value="detail.idCard || ''"></van-cell>
|
<van-cell title="身份证号" :value="detail.idCard || ''"></van-cell>
|
||||||
<van-cell title="手机号" :value="detail.mobile || ''"></van-cell>
|
|
||||||
<van-cell title="所在单位" :value="detail.unitName || ''"></van-cell>
|
<van-cell title="所在单位" :value="detail.unitName || ''"></van-cell>
|
||||||
<van-cell title="所在工会" :value="detail.unionName || ''"></van-cell>
|
<van-cell title="所在工会" :value="detail.unionName || ''"></van-cell>
|
||||||
</div>
|
</div>
|
||||||
@@ -993,15 +972,14 @@ layout("/layouts/platform_h5.html"){
|
|||||||
</div>
|
</div>
|
||||||
</van-popup>
|
</van-popup>
|
||||||
|
|
||||||
<van-popup v-model="signupVisible" class="tour-record-popup" position="right" :style="{ width: '100%', height: '100%' }" :close-on-click-overlay="false" @closed="destroySignup">
|
<van-popup v-model="signupVisible" position="right" :style="{ width: '100%', height: '100%' }" :close-on-click-overlay="false" @closed="destroySignup">
|
||||||
<van-nav-bar title="修改报名" left-text="返回" left-arrow @click-left="closeHistoryPopup('signup')"></van-nav-bar>
|
<van-nav-bar title="修改报名" left-text="返回" left-arrow @click-left="closeHistoryPopup('signup')" fixed placeholder></van-nav-bar>
|
||||||
<div class="tour-popup-body">
|
<div class="tour-popup-body">
|
||||||
<div class="tour-section">
|
<div class="tour-section">
|
||||||
<div class="tour-section-title">教职工信息</div>
|
<div class="tour-section-title">教职工信息</div>
|
||||||
<van-field label="姓名" readonly v-model="signupForm.userName"></van-field>
|
<van-field label="姓名" readonly v-model="signupForm.userName"></van-field>
|
||||||
<van-field label="工号" readonly v-model="signupForm.jobNo"></van-field>
|
<van-field label="工号" readonly v-model="signupForm.jobNo"></van-field>
|
||||||
<van-field required label="身份证号" v-model="signupForm.idCard" maxlength="30" placeholder="请填写身份证号"></van-field>
|
<van-field label="身份证号" v-model="signupForm.idCard" maxlength="30" placeholder="请填写身份证号"></van-field>
|
||||||
<van-field required label="手机号" v-model="signupForm.mobile" type="tel" maxlength="11" placeholder="请填写手机号"></van-field>
|
|
||||||
<van-field label="所在工会" readonly v-model="signupForm.unionName"></van-field>
|
<van-field label="所在工会" readonly v-model="signupForm.unionName"></van-field>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -1029,12 +1007,12 @@ layout("/layouts/platform_h5.html"){
|
|||||||
|
|
||||||
<div v-if="isDirectFamilyLine(signupForm)" class="tour-section">
|
<div v-if="isDirectFamilyLine(signupForm)" class="tour-section">
|
||||||
<div class="tour-section-title">直系亲属线路</div>
|
<div class="tour-section-title">直系亲属线路</div>
|
||||||
<van-field required label="亲属姓名" v-model="directRelativeForm.relativeName" maxlength="100" placeholder="请输入亲属姓名"></van-field>
|
<van-field label="亲属姓名" v-model="directRelativeForm.relativeName" maxlength="100" placeholder="请输入亲属姓名"></van-field>
|
||||||
<van-field required label="所在单位" v-model="directRelativeForm.unitName" maxlength="100" placeholder="请输入所在单位"></van-field>
|
<van-field label="所在单位" v-model="directRelativeForm.unitName" maxlength="100" placeholder="请输入所在单位"></van-field>
|
||||||
<van-field required readonly clickable is-link label="亲属关系" v-model="directRelativeForm.relationshipName" placeholder="请选择亲属关系" @click="openDirectRelativePicker"></van-field>
|
<van-field readonly clickable is-link label="亲属关系" v-model="directRelativeForm.relationshipName" placeholder="请选择亲属关系" @click="openDirectRelativePicker"></van-field>
|
||||||
<van-field required label="线路名称" v-model="directRelativeForm.lineName" maxlength="100" placeholder="请输入线路名称"></van-field>
|
<van-field label="线路名称" v-model="directRelativeForm.lineName" maxlength="100" placeholder="请输入线路名称"></van-field>
|
||||||
<van-field required label="出行开始" v-model="directRelativeForm.travelStartTime" type="date" placeholder="请选择出行开始日期"></van-field>
|
<van-field label="出行开始" v-model="directRelativeForm.travelStartTime" type="date" placeholder="请选择出行开始日期"></van-field>
|
||||||
<van-field required label="出行结束" v-model="directRelativeForm.travelEndTime" type="date" placeholder="请选择出行结束日期"></van-field>
|
<van-field label="出行结束" v-model="directRelativeForm.travelEndTime" type="date" placeholder="请选择出行结束日期"></van-field>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="allowFamily && !isDirectFamilyLine(signupForm)" class="tour-section">
|
<div v-if="allowFamily && !isDirectFamilyLine(signupForm)" class="tour-section">
|
||||||
@@ -1076,7 +1054,7 @@ layout("/layouts/platform_h5.html"){
|
|||||||
:title="familyTabTitle(family, familyIndex)">
|
:title="familyTabTitle(family, familyIndex)">
|
||||||
<div class="tour-family-form">
|
<div class="tour-family-form">
|
||||||
<van-field required label="姓名" v-model="family.familyName" maxlength="100" placeholder="请填写姓名"></van-field>
|
<van-field required label="姓名" v-model="family.familyName" maxlength="100" placeholder="请填写姓名"></van-field>
|
||||||
<van-field required label="年龄" v-model.number="family.age" type="number" :formatter="formatFamilyAge" placeholder="请填写年龄"></van-field>
|
<van-field required label="年龄" v-model.number="family.age" type="digit" placeholder="请填写年龄"></van-field>
|
||||||
<van-field required label="性别">
|
<van-field required label="性别">
|
||||||
<template #input>
|
<template #input>
|
||||||
<van-radio-group v-model="family.gender" direction="horizontal">
|
<van-radio-group v-model="family.gender" direction="horizontal">
|
||||||
@@ -1087,7 +1065,7 @@ layout("/layouts/platform_h5.html"){
|
|||||||
</van-field>
|
</van-field>
|
||||||
<van-field :required="familyContactRequired(family)" label="身份证号码" v-model="family.idCard" maxlength="18" placeholder="请填写身份证号码" @blur="normalizeFamilyIdCard(family)"></van-field>
|
<van-field :required="familyContactRequired(family)" label="身份证号码" v-model="family.idCard" maxlength="18" placeholder="请填写身份证号码" @blur="normalizeFamilyIdCard(family)"></van-field>
|
||||||
<van-field :required="familyContactRequired(family)" label="手机号" v-model="family.mobile" type="tel" maxlength="30" placeholder="请填写手机号"></van-field>
|
<van-field :required="familyContactRequired(family)" label="手机号" v-model="family.mobile" type="tel" maxlength="30" placeholder="请填写手机号"></van-field>
|
||||||
<van-field required readonly clickable is-link label="与本人关系" v-model="family.relationship" placeholder="请选择关系" @click="openRelationshipPicker(familyIndex)"></van-field>
|
<van-field required readonly clickable is-link label="与本人关系" v-model="family.relationship" placeholder="请选择关系" @click="openRelationshipPicker"></van-field>
|
||||||
<van-field v-if="fillBedInfo" readonly clickable is-link label="床型" v-model="family.bedType" placeholder="请选择房型" @click="openBedPicker('family')"></van-field>
|
<van-field v-if="fillBedInfo" readonly clickable is-link label="床型" v-model="family.bedType" placeholder="请选择房型" @click="openBedPicker('family')"></van-field>
|
||||||
<van-field v-if="fillBedInfo" label="床位" v-model="family.bedInfo" maxlength="100" placeholder="请输入床位数量"></van-field>
|
<van-field v-if="fillBedInfo" label="床位" v-model="family.bedInfo" maxlength="100" placeholder="请输入床位数量"></van-field>
|
||||||
<van-field v-if="fillBedInfo" label="意向拼床人" v-model="family.intendedRoommate" maxlength="100" placeholder="请输入意向拼床人"></van-field>
|
<van-field v-if="fillBedInfo" label="意向拼床人" v-model="family.intendedRoommate" maxlength="100" placeholder="请输入意向拼床人"></van-field>
|
||||||
@@ -1109,8 +1087,8 @@ layout("/layouts/platform_h5.html"){
|
|||||||
<div v-else class="tour-family-empty">暂无亲属,请按需添加</div>
|
<div v-else class="tour-family-empty">暂无亲属,请按需添加</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="tour-bottom-bar tour-h5-fixed-bar">
|
<div class="tour-bottom-bar">
|
||||||
<van-button v-if="signupForm.id" class="tour-cancel-button" type="default" block round :loading="cancelLoading" @click="cancelSignup">取消报名</van-button>
|
<van-button v-if="signupForm.id" type="danger" plain block round :loading="cancelLoading" @click="cancelSignup">取消报名</van-button>
|
||||||
<van-button type="info" block round :loading="signupLoading" @click="submitSignup">提交</van-button>
|
<van-button type="info" block round :loading="signupLoading" @click="submitSignup">提交</van-button>
|
||||||
</div>
|
</div>
|
||||||
</van-popup>
|
</van-popup>
|
||||||
@@ -1464,7 +1442,6 @@ layout("/layouts/platform_h5.html"){
|
|||||||
userName: "",
|
userName: "",
|
||||||
gender: "",
|
gender: "",
|
||||||
idCard: "",
|
idCard: "",
|
||||||
mobile: "",
|
|
||||||
unitId: "",
|
unitId: "",
|
||||||
unitName: "",
|
unitName: "",
|
||||||
unionId: "",
|
unionId: "",
|
||||||
@@ -1624,11 +1601,6 @@ layout("/layouts/platform_h5.html"){
|
|||||||
isBlankValue(value) {
|
isBlankValue(value) {
|
||||||
return value === undefined || value === null || !String(value).trim()
|
return value === undefined || value === null || !String(value).trim()
|
||||||
},
|
},
|
||||||
// 与 Web 端一致,亲属年龄限定为 0~120 岁整数,清空时保留必填状态。
|
|
||||||
formatFamilyAge(value) {
|
|
||||||
const age = parseInt(value, 10)
|
|
||||||
return Number.isNaN(age) ? "" : String(Math.min(120, Math.max(0, age)))
|
|
||||||
},
|
|
||||||
// 年满16周岁的亲属才强制填写身份证号码和手机号。
|
// 年满16周岁的亲属才强制填写身份证号码和手机号。
|
||||||
familyContactRequired(family) {
|
familyContactRequired(family) {
|
||||||
return family && !this.isBlankValue(family.age) && Number(family.age) >= 16
|
return family && !this.isBlankValue(family.age) && Number(family.age) >= 16
|
||||||
|
|||||||
@@ -307,9 +307,9 @@ layout("/layouts/platform_tour_signup_h5.html"){
|
|||||||
|
|
||||||
<div v-if="isDirectFamilyLine(signupForm)" class="tour-apply-card">
|
<div v-if="isDirectFamilyLine(signupForm)" class="tour-apply-card">
|
||||||
<div class="tour-apply-title">直系亲属线路</div>
|
<div class="tour-apply-title">直系亲属线路</div>
|
||||||
<van-field required label="亲属姓名" v-model="directRelativeForm.relativeName" maxlength="100" placeholder="请输入亲属姓名"></van-field>
|
<van-field label="亲属姓名" v-model="directRelativeForm.relativeName" maxlength="100" placeholder="请输入亲属姓名"></van-field>
|
||||||
<van-field required label="所在单位" v-model="directRelativeForm.unitName" maxlength="100" placeholder="请输入所在单位"></van-field>
|
<van-field label="所在单位" v-model="directRelativeForm.unitName" maxlength="100" placeholder="请输入所在单位"></van-field>
|
||||||
<van-field required
|
<van-field
|
||||||
label="亲属关系"
|
label="亲属关系"
|
||||||
readonly
|
readonly
|
||||||
clickable
|
clickable
|
||||||
@@ -318,9 +318,9 @@ layout("/layouts/platform_tour_signup_h5.html"){
|
|||||||
v-model="directRelativeForm.relationshipName"
|
v-model="directRelativeForm.relationshipName"
|
||||||
@click="openDirectRelativePicker">
|
@click="openDirectRelativePicker">
|
||||||
</van-field>
|
</van-field>
|
||||||
<van-field required label="线路名称" v-model="directRelativeForm.lineName" maxlength="100" placeholder="请输入线路名称"></van-field>
|
<van-field label="线路名称" v-model="directRelativeForm.lineName" maxlength="100" placeholder="请输入线路名称"></van-field>
|
||||||
<van-field required label="出行开始" v-model="directRelativeForm.travelStartTime" type="date" placeholder="请选择出行开始日期"></van-field>
|
<van-field label="出行开始" v-model="directRelativeForm.travelStartTime" type="date" placeholder="请选择出行开始日期"></van-field>
|
||||||
<van-field required label="出行结束" v-model="directRelativeForm.travelEndTime" type="date" placeholder="请选择出行结束日期"></van-field>
|
<van-field label="出行结束" v-model="directRelativeForm.travelEndTime" type="date" placeholder="请选择出行结束日期"></van-field>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="tour-apply-card">
|
<div class="tour-apply-card">
|
||||||
@@ -365,7 +365,7 @@ layout("/layouts/platform_tour_signup_h5.html"){
|
|||||||
:title="familyTabTitle(family, familyIndex)">
|
:title="familyTabTitle(family, familyIndex)">
|
||||||
<div class="tour-family-form">
|
<div class="tour-family-form">
|
||||||
<van-field required label="姓名" v-model="family.familyName" maxlength="100" placeholder="请填写姓名"></van-field>
|
<van-field required label="姓名" v-model="family.familyName" maxlength="100" placeholder="请填写姓名"></van-field>
|
||||||
<van-field required label="年龄" v-model.number="family.age" type="number" :formatter="formatFamilyAge" placeholder="请填写年龄"></van-field>
|
<van-field required label="年龄" v-model.number="family.age" type="digit" placeholder="请填写年龄"></van-field>
|
||||||
<van-field required label="性别">
|
<van-field required label="性别">
|
||||||
<template #input>
|
<template #input>
|
||||||
<van-radio-group v-model="family.gender" direction="horizontal">
|
<van-radio-group v-model="family.gender" direction="horizontal">
|
||||||
@@ -753,11 +753,6 @@ layout("/layouts/platform_tour_signup_h5.html"){
|
|||||||
isBlankValue(value) {
|
isBlankValue(value) {
|
||||||
return value === undefined || value === null || !String(value).trim()
|
return value === undefined || value === null || !String(value).trim()
|
||||||
},
|
},
|
||||||
// 与 Web 端一致,亲属年龄限定为 0~120 岁整数,清空时保留必填状态。
|
|
||||||
formatFamilyAge(value) {
|
|
||||||
const age = parseInt(value, 10)
|
|
||||||
return Number.isNaN(age) ? "" : String(Math.min(120, Math.max(0, age)))
|
|
||||||
},
|
|
||||||
// 年满16周岁的亲属才强制填写身份证号码和手机号。
|
// 年满16周岁的亲属才强制填写身份证号码和手机号。
|
||||||
familyContactRequired(family) {
|
familyContactRequired(family) {
|
||||||
return family && !this.isBlankValue(family.age) && Number(family.age) >= 16
|
return family && !this.isBlankValue(family.age) && Number(family.age) >= 16
|
||||||
|
|||||||
Reference in New Issue
Block a user