Author SHA1 Message Date
c-zhouhf1 637fe6f838 整改民主管理测试---芳姐 2026-10-31 18:04:30 +08:00
c-zhouhf1 4f85bb08e2 经费提案整改 2026-10-30 15:50:53 +08:00
31 changed files with 784 additions and 591 deletions
@@ -19,6 +19,7 @@ RoleConstant {
SCHOOL_UNION_ADMIN("校工会管理员"), SCHOOL_UNION_ADMIN("校工会管理员"),
SCHOOL_UNION_CHAIRMAN("校工会主席"), SCHOOL_UNION_CHAIRMAN("校工会主席"),
SCHOOL_UNION_VICE_CHAIRMAN("校工会副主席"), SCHOOL_UNION_VICE_CHAIRMAN("校工会副主席"),
SCHOOL_UNION_FINANCE("校工会财务"),
SCHOOL_OFFICE_DIRECTOR("校工会办公室主任"), SCHOOL_OFFICE_DIRECTOR("校工会办公室主任"),
SCHOOL_UNION_WELFARE_ADMIN("校工会福利管理员"), SCHOOL_UNION_WELFARE_ADMIN("校工会福利管理员"),
SCHOOL_UNION_MEMBER_ADMIN("校工会会员管理员"), SCHOOL_UNION_MEMBER_ADMIN("校工会会员管理员"),
@@ -0,0 +1,54 @@
package com.budwk.app.flow.handler;
import com.budwk.app.base.constant.RoleConstant;
import com.budwk.app.flow.engine.AssignmentHandler;
import com.budwk.app.flow.engine.core.Execution;
import com.budwk.app.flow.engine.core.ServiceContext;
import com.budwk.app.flow.engine.model.TaskModel;
import org.nutz.dao.Dao;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import java.util.List;
/**
* 为流程任务分配拥有校工会财务角色的用户。
*/
public class FlowSchoolUnionFinanceHandler implements AssignmentHandler {
/**
* 按校工会财务角色查询参与者,并去除重复的用户 ID。
*
* @param model 当前流程任务模型,无需额外传入人员参数
* @param execution 当前流程执行上下文,无需额外传入业务参数
* @return 用户 ID 列表;未配置角色或角色用户时返回空列表
*/
@Override
public List<String> assign(TaskModel model, Execution execution) {
Dao dao = ServiceContext.find(Dao.class);
Sql sql = Sqls.create("""
SELECT
userRole.userId
FROM
`sys_user_role` userRole
LEFT JOIN sys_role role ON role.id = userRole.roleId
WHERE
role.`code` = @roleCode
GROUP BY
userRole.userId
""").setParam("roleCode", RoleConstant.SCHOOL_UNION_FINANCE.name());
sql.setCallback(Sqls.callback.strList());
dao.execute(sql);
return sql.getList(String.class);
}
/**
* 返回流程设计器中展示的参与者处理类名称。
*
* @return 流程设计器下拉选项名称
*/
@Override
public String getMessage() {
return "获取校工会财务";
}
}
@@ -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;
} }
@@ -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;
} }
@@ -229,14 +229,18 @@ public class ProposalMineController {
} }
/**
* 删除当前用户可删除的提案。
*
* @param id 提案 ID;仅允许删除本人未发起流程或退回发起节点的提案
* @return Result,成功时返回成功结果,不满足删除条件时返回原因
*/
@At @At
@SaCheckPermission("proposal.mine") @SaCheckPermission("proposal.mine")
@Aop(TransAop.READ_COMMITTED) @Aop(TransAop.READ_COMMITTED)
@SLog(tag = "提案管理系统-我的提案", msg = "删除提案") @SLog(tag = "提案管理系统-我的提案", msg = "删除提案")
public Result delete(@Valid String id) { public Result delete(@Valid String id) {
dao.delete(ProposalInfo.class, id); return proposalCommonService.deleteMine(id, SecurityUtil.getUserId());
flowEngine.processInstanceService().deleteProcessInstanceByBusinessKey(id);
return Result.success();
} }
@At @At
@@ -3,6 +3,7 @@ package com.budwk.app.zhgh.democratic.proposal.service.common;
import com.budwk.app.base.service.BaseService; import com.budwk.app.base.service.BaseService;
import com.budwk.app.base.param.PageForm; import com.budwk.app.base.param.PageForm;
import com.budwk.app.base.param.ExportTableColumns; import com.budwk.app.base.param.ExportTableColumns;
import com.budwk.app.base.result.Result;
import com.budwk.app.zhgh.democratic.proposal.models.ProposalInfo; import com.budwk.app.zhgh.democratic.proposal.models.ProposalInfo;
import com.budwk.app.zhgh.democratic.proposal.models.ProposalUndertake; import com.budwk.app.zhgh.democratic.proposal.models.ProposalUndertake;
import com.budwk.app.zhgh.democratic.proposal.param.ProposalQueryComprehensiveParam; import com.budwk.app.zhgh.democratic.proposal.param.ProposalQueryComprehensiveParam;
@@ -19,6 +20,15 @@ import java.util.Set;
public interface ProposalCommonService extends BaseService<ProposalInfo> { public interface ProposalCommonService extends BaseService<ProposalInfo> {
/**
* 删除当前用户尚未发起流程或已退回发起节点的提案。
*
* @param id 待删除的提案 ID
* @param userId 当前登录用户 ID,用于核对提案创建人
* @return Result,删除成功返回 success;提案不存在、非本人或流程不允许删除时返回错误信息
*/
Result deleteMine(String id, String userId);
/** /**
* 按页面允许的字段白名单添加排序条件,避免前端字段直接进入SQL。 * 按页面允许的字段白名单添加排序条件,避免前端字段直接进入SQL。
* *
@@ -17,6 +17,7 @@ import com.budwk.app.base.exception.BaseException;
import com.budwk.app.base.param.ExportTableColumns; import com.budwk.app.base.param.ExportTableColumns;
import com.budwk.app.base.param.PageForm; import com.budwk.app.base.param.PageForm;
import com.budwk.app.base.page.Pagination; import com.budwk.app.base.page.Pagination;
import com.budwk.app.base.result.Result;
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.PageUtil; import com.budwk.app.base.utils.PageUtil;
@@ -52,6 +53,7 @@ import com.deepoove.poi.config.Configure;
import com.deepoove.poi.plugin.table.LoopRowTableRenderPolicy; import com.deepoove.poi.plugin.table.LoopRowTableRenderPolicy;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.ddr.poi.html.HtmlRenderPolicy; import org.ddr.poi.html.HtmlRenderPolicy;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
import org.nutz.dao.Dao; import org.nutz.dao.Dao;
import org.nutz.dao.FieldFilter; import org.nutz.dao.FieldFilter;
@@ -62,6 +64,7 @@ import org.nutz.dao.util.cri.SqlExpressionGroup;
import org.nutz.dao.util.cri.Static; import org.nutz.dao.util.cri.Static;
import org.nutz.ioc.loader.annotation.Inject; import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean; import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.ioc.aop.Aop;
import org.nutz.json.Json; 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;
@@ -184,6 +187,45 @@ public class ProposalCommonServiceImpl extends BaseServiceImpl<ProposalInfo> imp
super(dao); super(dao);
} }
/**
* 仅允许创建人删除草稿或退回发起节点的提案,并清理其 WF 流程。
*
* @param id 待删除的提案 ID
* @param userId 当前登录用户 ID,用于核对提案创建人
* @return Result,删除成功返回 success;提案不存在、非本人或流程不允许删除时返回错误信息
*/
@Override
@Aop(TransAop.READ_COMMITTED)
public Result deleteMine(String id, String userId) {
if (StrUtil.isBlank(id) || StrUtil.isBlank(userId)) {
return Result.error("提案不存在或无权删除");
}
ProposalInfo proposal = dao().fetch(ProposalInfo.class, id);
if (proposal == null || !Objects.equals(proposal.getCreatedBy(), userId)) {
return Result.error("提案不存在或无权删除");
}
List<ProcessInstance> instances = dao().query(ProcessInstance.class,
Cnd.where(ProcessInstance::getBusinessNo, "=", id));
// 一个提案出现多个流程实例时无法安全判断当前节点,拒绝删除并保留数据。
if (instances.size() > 1) {
return Result.error("提案流程数据异常,无法删除");
}
if (!instances.isEmpty()) {
ProcessInstance instance = instances.get(0);
List<ProcessTask> tasks = flowEngine.processTaskService().getDoingTaskList(instance.getId(), null);
// 存在并行任务时,只有所有活动任务均位于发起节点才允许删除。
if (!Objects.equals(instance.getState(), ProcessInstanceStateEnum.DOING.getCode())
|| tasks.isEmpty() || tasks.stream().anyMatch(task -> !Objects.equals(task.getTaskName(), "startTask"))) {
return Result.error("仅未提交或退回发起节点的提案可以删除");
}
}
dao().delete(ProposalInfo.class, id);
flowEngine.processInstanceService().deleteProcessInstanceByBusinessKey(id);
return Result.success();
}
/** /**
* 分页查询提案综合列表。 * 分页查询提案综合列表。
* 普通查询不关联历史任务表;仅在 origins 包含 answer 且 commonKeyword 非空时, * 普通查询不关联历史任务表;仅在 origins 包含 answer 且 commonKeyword 非空时,
@@ -101,7 +101,7 @@ public class TeacherCongressInstitutionUserServiceImpl extends BaseServiceImpl<T
if (identity.equals("主任")) { if (identity.equals("主任")) {
sysRole = sysRoleService.getByCode(RoleConstant.TEACHER_CONGRESS_PREPARATION_LEADERSHIP_GROUP_DIRECTOR); sysRole = sysRoleService.getByCode(RoleConstant.TEACHER_CONGRESS_PREPARATION_LEADERSHIP_GROUP_DIRECTOR);
} else if (identity.equals("成员")) { } else if (identity.equals("委员")) {
sysRole = sysRoleService.getByCode(RoleConstant.TEACHER_CONGRESS_PREPARATION_LEADERSHIP_GROUP_MEMBER); sysRole = sysRoleService.getByCode(RoleConstant.TEACHER_CONGRESS_PREPARATION_LEADERSHIP_GROUP_MEMBER);
} }
if (sysRole == null) { if (sysRole == null) {
@@ -148,7 +148,7 @@ public class TeacherCongressInstitutionUserServiceImpl extends BaseServiceImpl<T
if (institutionUser.getIdentity().equals("主任")) { if (institutionUser.getIdentity().equals("主任")) {
sysRole = sysRoleService.getByCode(RoleConstant.TEACHER_CONGRESS_PREPARATION_LEADERSHIP_GROUP_DIRECTOR); sysRole = sysRoleService.getByCode(RoleConstant.TEACHER_CONGRESS_PREPARATION_LEADERSHIP_GROUP_DIRECTOR);
} else if (institutionUser.getIdentity().equals("成员")) { } else if (institutionUser.getIdentity().equals("委员")) {
sysRole = sysRoleService.getByCode(RoleConstant.TEACHER_CONGRESS_PREPARATION_LEADERSHIP_GROUP_MEMBER); sysRole = sysRoleService.getByCode(RoleConstant.TEACHER_CONGRESS_PREPARATION_LEADERSHIP_GROUP_MEMBER);
} }
if (sysRole == null) { if (sysRole == 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));
// 设置导出参数 // 设置导出参数
+3 -3
View File
@@ -5,7 +5,7 @@ nutz:
ignore: ^(.+[.])(jsp|png|gif|jpg|js|css|jspx|jpeg|html|mp3|mp4|ico|svg|vue)$ ignore: ^(.+[.])(jsp|png|gif|jpg|js|css|jspx|jpeg|html|mp3|mp4|ico|svg|vue)$
exclusions: /favicon/*,/assets/*,/druid/*,/upload/*,/components/* exclusions: /favicon/*,/assets/*,/druid/*,/upload/*,/components/*
server: server:
port: 8081 port: 80
host: 0.0.0.0 host: 0.0.0.0
jetty: jetty:
@@ -21,7 +21,7 @@ jetty:
#结合ftp使用,或用nginx代理ftp路径 #结合ftp使用,或用nginx代理ftp路径
#staticPath: /Users/wizzer/temp/files #staticPath: /Users/wizzer/temp/files
#开发模式静态资源 #开发模式静态资源
staticPathLocal: D:/myProject/zhgh_cqgmy/src/main/resources/static staticPathLocal: E:/projects/zhgh_cqgmy/src/main/resources/static
security: security:
tokenName: saToken tokenName: saToken
@@ -87,7 +87,7 @@ xsssql:
beetl: beetl:
RESOURCE: RESOURCE:
#本地路径,开发时设置本地路径,便于调试 #本地路径,开发时设置本地路径,便于调试
rootLocal: D:/myProject/zhgh_cqgmy/src/main/resources/views/ rootLocal: E:/projects/zhgh_cqgmy/src/main/resources/views/
root: views/ root: views/
DELIMITER_STATEMENT_START: "<!--#" DELIMITER_STATEMENT_START: "<!--#"
DELIMITER_STATEMENT_END: "#-->" DELIMITER_STATEMENT_END: "#-->"
@@ -10,7 +10,7 @@
:finished="tableFinished" :finished="tableFinished"
finished-text="没有更多了" finished-text="没有更多了"
@load="onLoad"> @load="onLoad">
<div class="table-list-container"> <div class="table-list-container" @click="showOverflowText">
<div v-for="(row, index) in tableData" :key="index" class="table-list-item" <div v-for="(row, index) in tableData" :key="index" class="table-list-item"
:data-row-id="row && row.id ? row.id : ''"> :data-row-id="row && row.id ? row.id : ''">
<slot name="header" :index="index" :row="row"> <slot name="header" :index="index" :row="row">
@@ -36,6 +36,12 @@
</div> </div>
</div> </div>
</van-list> </van-list>
<van-popover ref="overflowPopover" :value="overflowVisible" :style="overflowAnchorStyle"
:placement="overflowPlacement" get-container="body" @input="onOverflowInput"
@opened="positionOverflow">
<div class="table-list-overflow-content">{{ overflowText }}</div>
<template #reference><span></span></template>
</van-popover>
</van-pull-refresh> </van-pull-refresh>
</template> </template>
<script> <script>
@@ -90,10 +96,138 @@ module.exports = {
tableLoading: false, tableLoading: false,
tableFinished: false, tableFinished: false,
tableRefreshing: false, tableRefreshing: false,
localPageForm: {...this.page_form} localPageForm: {...this.page_form},
overflowVisible: false,
overflowText: "",
overflowTarget: null,
overflowPlacement: "top",
overflowAnchorStyle: {}
} }
}, },
methods: { methods: {
// 只响应真正被截断的纯文字,保留卡片内按钮和业务插槽原有的点击行为。
showOverflowText(event) {
const target = event.target
if (!target || !target.closest) return
const card = target.closest(".table-list-item")
if (!card || target.closest(".item-actions, a, button, input, textarea, select, [role=button], [tabindex], [onclick]")) return
if (target.children.length || !target.textContent.trim() || this.hasOverflowClickHandler(target, card)) return
const style = window.getComputedStyle(target)
if (style.textOverflow !== "ellipsis" || (target.scrollWidth <= target.clientWidth && target.scrollHeight <= target.clientHeight)) return
const rect = target.getBoundingClientRect()
this.overflowTarget = target
this.overflowText = target.textContent.trim()
this.overflowPlacement = rect.top < 180 ? "bottom" : "top"
this.overflowAnchorStyle = {
position: "fixed",
display: "block",
pointerEvents: "none",
left: rect.left + "px",
top: rect.top + "px",
width: rect.width + "px",
height: rect.height + "px"
}
if (!this.overflowVisible) this.bindOverflowListeners()
this.overflowVisible = true
this.$nextTick(() => {
const instance = this.$refs.overflowPopover
if (instance) instance.updateLocation()
setTimeout(() => this.positionOverflow(), 50)
setTimeout(() => this.positionOverflow(), 350)
})
},
// 检查文字及其卡片内的祖先节点,避免干扰已有 Vue 点击事件。
hasOverflowClickHandler(target, card) {
const ancestors = []
let element = target
while (element && element !== card.parentElement) {
ancestors.push(element)
element = element.parentElement
}
const visit = (node) => {
if (!node) return false
const events = node.data ? [node.data.on, node.data.nativeOn] : []
if (ancestors.includes(node.elm) && events.some((handlers) => handlers &&
Object.keys(handlers).some((key) => /^[~!&]*(click|touchstart|pointerdown|mousedown)$/.test(key)))) return true
if (node.componentInstance && visit(node.componentInstance._vnode)) return true
return Array.isArray(node.children) && node.children.some((child) => visit(child))
}
return visit(this._vnode)
},
// Vant 的弹层挂在 body;校正窗口边缘的位置,避免完整文字被屏幕裁掉。
positionOverflow() {
const instance = this.$refs.overflowPopover
const popup = instance && instance.$refs.popover && instance.$refs.popover.$el
if (!this.overflowVisible || !this.overflowTarget || !popup) return
const rect = popup.getBoundingClientRect()
const anchor = this.overflowTarget.getBoundingClientRect()
if (!rect.width || !rect.height) return
const margin = 8
const left = Math.max(margin, Math.min(rect.left, window.innerWidth - rect.width - margin))
let top = rect.top
if (top < margin) top = anchor.bottom + 8
if (top + rect.height > window.innerHeight - margin) top = anchor.top - rect.height - 8
top = Math.max(margin, Math.min(top, window.innerHeight - rect.height - margin))
popup.style.left = (parseFloat(popup.style.left) || 0) + left - rect.left + "px"
popup.style.top = (parseFloat(popup.style.top) || 0) + top - rect.top + "px"
const arrow = popup.querySelector(".van-popover__arrow")
if (arrow) {
arrow.style.left = Math.max(12, Math.min(anchor.left + anchor.width / 2 - left, rect.width - 12)) + "px"
}
},
onOverflowInput(visible) {
this.overflowVisible = visible
if (!visible) {
this.overflowTarget = null
this.unbindOverflowListeners()
}
},
// 监听只在气泡打开时存在,PJAX 替换页面前也会关闭气泡并注销。
bindOverflowListeners() {
document.addEventListener("click", this.closeOverflowOnClick)
window.addEventListener("scroll", this.closeOverflowOnMove, true)
window.addEventListener("resize", this.closeOverflowOnMove)
window.addEventListener("transitionend", this.onOverflowAnimationEnd)
window.addEventListener("animationend", this.onOverflowAnimationEnd)
$(document).on("pjax:send", this.closeOverflowForNavigation)
},
unbindOverflowListeners() {
document.removeEventListener("click", this.closeOverflowOnClick)
window.removeEventListener("scroll", this.closeOverflowOnMove, true)
window.removeEventListener("resize", this.closeOverflowOnMove)
window.removeEventListener("transitionend", this.onOverflowAnimationEnd)
window.removeEventListener("animationend", this.onOverflowAnimationEnd)
$(document).off("pjax:send", this.closeOverflowForNavigation)
},
closeOverflowForNavigation() {
this.onOverflowInput(false)
},
// Vant 会在动画结束时重新计算定位,随后再次限制气泡的屏幕边界。
onOverflowAnimationEnd() {
if (this.overflowVisible) setTimeout(() => this.positionOverflow(), 0)
},
// 滚动或改变屏幕尺寸时关闭气泡,避免气泡脱离原文字位置。
closeOverflowOnMove(event) {
if (event && event.target && event.target.closest && event.target.closest(".table-list-overflow-content")) return
this.onOverflowInput(false)
},
closeOverflowOnClick(event) {
if (!this.overflowVisible) return
if (this.overflowTarget && this.overflowTarget.contains(event.target)) return
if (event.target.closest && event.target.closest(".table-list-overflow-content")) return
this.onOverflowInput(false)
},
/** /**
* 获取当前列表快照。 * 获取当前列表快照。
* 返回值包含已加载记录、分页参数和加载完成状态,供业务页面在进入详情前暂存列表现场。 * 返回值包含已加载记录、分页参数和加载完成状态,供业务页面在进入详情前暂存列表现场。
@@ -186,10 +320,28 @@ module.exports = {
}, },
mounted() { mounted() {
this.$emit("ready") this.$emit("ready")
},
beforeDestroy() {
this.unbindOverflowListeners()
} }
} }
</script> </script>
<style>
/* Vant 将气泡挂到 body,控制宽高并允许长文本在气泡内滚动。 */
.table-list-overflow-content {
max-width: min(240px, calc(100vw - 48px));
max-height: 160px;
padding: 10px 12px;
overflow-y: auto;
color: #253247;
font-size: 13px;
line-height: 1.55;
white-space: pre-wrap;
overflow-wrap: anywhere;
}
</style>
<style scoped> <style scoped>
.table-list-container { .table-list-container {
padding: 0; padding: 0;
@@ -706,7 +706,7 @@
Vue.component("year-van-dropdown-item", httpVueLoader("/components/plugins/vantMore/yearVanDropDownItem.vue?v=" + h5ComponentVersion)) Vue.component("year-van-dropdown-item", httpVueLoader("/components/plugins/vantMore/yearVanDropDownItem.vue?v=" + h5ComponentVersion))
Vue.component("van-text-dialog", httpVueLoader("/components/plugins/vantMore/vantTextDialog.vue?v=" + h5ComponentVersion)) Vue.component("van-text-dialog", httpVueLoader("/components/plugins/vantMore/vantTextDialog.vue?v=" + h5ComponentVersion))
Vue.component("enum-tag", httpVueLoader("/components/plugins/sysEnum/EnumTag.vue?v=" + h5ComponentVersion)) Vue.component("enum-tag", httpVueLoader("/components/plugins/sysEnum/EnumTag.vue?v=" + h5ComponentVersion))
Vue.component("table-list", httpVueLoader("/components/plugins/h5/TableList.vue?v=" + h5ComponentVersion)) Vue.component("table-list", httpVueLoader("/components/plugins/h5/TableList.vue?v=" + h5ComponentVersion + "_overflow1"))
Vue.component("table-column", httpVueLoader("/components/plugins/h5/TableColumn.vue?v=" + h5ComponentVersion)) Vue.component("table-column", httpVueLoader("/components/plugins/h5/TableColumn.vue?v=" + h5ComponentVersion))
Vue.component("file-preview", httpVueLoader("/components/plugins/sysFilePreview/H5Index.vue?v=" + h5ComponentVersion)) Vue.component("file-preview", httpVueLoader("/components/plugins/sysFilePreview/H5Index.vue?v=" + h5ComponentVersion))
</script> </script>
@@ -100,7 +100,7 @@ layout("/layouts/platform.html"){
size="mini" type="danger">删除 size="mini" type="danger">删除
</el-button> </el-button>
<el-button @click="doExportDeclare(row)" size="mini" type="primary">申请表导出</el-button> <el-button v-if="row.instanceState === 20" @click="doExportDeclare(row)" size="mini" type="primary">申请表导出</el-button>
<el-button v-if="row.instanceState === 20" @click="doExportReimbursement(row)" size="mini" <el-button v-if="row.instanceState === 20" @click="doExportReimbursement(row)" size="mini"
type="primary">报销凭证导出 type="primary">报销凭证导出
</el-button> </el-button>
@@ -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>
@@ -21,14 +21,29 @@ const PROPOSAL_INFO = {
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="提案类别"> <el-descriptions-item label="提案类别">
{{viewData.typeName}} {{viewData.typeName}}
</el-descriptions-item><!-- </el-descriptions-item>
<!-- 提案方式和联系电话来自提案详情,未填写时显示占位符。 -->
<el-descriptions-item label="提案方式">
<dict-tag v-if="viewData.source" :options="dict.type.PROPOSAL_SOURCE"
:value="viewData.source"></dict-tag>
<span v-else>--</span>
</el-descriptions-item>
<el-descriptions-item label="联系电话">{{ viewData.mobile || '--' }}</el-descriptions-item><!--
<el-descriptions-item label="建议承办单位"> <el-descriptions-item label="建议承办单位">
{{viewData.suggestUnits}} {{viewData.suggestUnits}}
</el-descriptions-item>--> </el-descriptions-item>-->
<el-descriptions-item label="立案结果" :span="2"> <!-- 立案结果和类型尚未填写时仍显示字段,并以双横线表示空值。 -->
<dict-tag :options="dict.type.PROPOSAL_CASE_FILING_RESULT" <el-descriptions-item label="立案结果">
<dict-tag v-if="viewData.caseFilingResult" :options="dict.type.PROPOSAL_CASE_FILING_RESULT"
:value="viewData.caseFilingResult"></dict-tag> :value="viewData.caseFilingResult"></dict-tag>
<span v-else>--</span>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="立案类型">
<dict-tag v-if="viewData.caseFilingType" :options="dict.type.PROPOSAL_CASE_FILING_TYPE"
:value="viewData.caseFilingType"></dict-tag>
<span v-else>--</span>
</el-descriptions-item>
<el-descriptions-item></el-descriptions-item>
<!--<el-descriptions-item label="调研情况" :span="3"> <!--<el-descriptions-item label="调研情况" :span="3">
<div class="text-left">{{viewData.researchFindings}}</div> <div class="text-left">{{viewData.researchFindings}}</div>
</el-descriptions-item>--> </el-descriptions-item>-->
@@ -82,18 +97,22 @@ const PROPOSAL_INFO = {
{{row.commissionerName}}({{row.commissionerLoginName}}) {{row.commissionerName}}({{row.commissionerLoginName}})
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="立案结果" prop="caseFilingType"> <!-- 委员意见分别展示立案结果和类型,未填写时显示双横线。 -->
<el-table-column label="立案结果" prop="caseFilingResult">
<template slot-scope="{row}"> <template slot-scope="{row}">
<div style="display: flex;justify-content: center"> <div style="display: flex;justify-content: center">
<dict-tag :options="dict.type.PROPOSAL_CASE_FILING_RESULT" <dict-tag v-if="row.caseFilingResult" :options="dict.type.PROPOSAL_CASE_FILING_RESULT"
:value="row.caseFilingResult"></dict-tag> :value="row.caseFilingResult"></dict-tag>
<!-- 普通提案/重点提案暂不展示,历史数据仍保留。 --> <span v-else>--</span>
<template v-if="false"> </div>
(
<dict-tag :options="dict.type.PROPOSAL_CASE_FILING_TYPE"
:value="row.caseFilingType"></dict-tag>
)
</template> </template>
</el-table-column>
<el-table-column label="立案类型" prop="caseFilingType">
<template slot-scope="{row}">
<div style="display: flex;justify-content: center">
<dict-tag v-if="row.caseFilingType" :options="dict.type.PROPOSAL_CASE_FILING_TYPE"
:value="row.caseFilingType"></dict-tag>
<span v-else>--</span>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
@@ -162,7 +181,8 @@ const PROPOSAL_INFO = {
<el-descriptions-item label="办理用户">{{ task.taskFormData.userName <el-descriptions-item label="办理用户">{{ task.taskFormData.userName
}}({{task.taskFormData.loginName}}) }}({{task.taskFormData.loginName}})
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="办理时间" :span="2">{{ task.finishTime }}</el-descriptions-item> <el-descriptions-item label="办理时间" :span="2">{{ task.finishTime }}
</el-descriptions-item>
<el-descriptions-item label="附议人" :span="3" v-if="task.taskName === 'invite'"> <el-descriptions-item label="附议人" :span="3" v-if="task.taskName === 'invite'">
<el-table v-loading="tableLoading" :data="task?.taskFormData?.seconder"> <el-table v-loading="tableLoading" :data="task?.taskFormData?.seconder">
<el-table-column label="姓名" prop="userName"></el-table-column> <el-table-column label="姓名" prop="userName"></el-table-column>
@@ -183,22 +203,27 @@ const PROPOSAL_INFO = {
}}({{task.taskFormData.loginName}}) }}({{task.taskFormData.loginName}})
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="办理时间">{{ task.finishTime }}</el-descriptions-item> <el-descriptions-item label="办理时间">{{ task.finishTime }}</el-descriptions-item>
<!-- 立案节点分别展示流程记录中的结果与类型,空值显示双横线。 -->
<el-descriptions-item label="立案结果"> <el-descriptions-item label="立案结果">
<div style="display: flex;justify-content: center"> <div style="display: flex;justify-content: center">
<dict-tag :options="dict.type.PROPOSAL_CASE_FILING_RESULT" <dict-tag v-if="task.ext.tf_caseFilingResult"
:options="dict.type.PROPOSAL_CASE_FILING_RESULT"
:value="task.ext.tf_caseFilingResult"></dict-tag> :value="task.ext.tf_caseFilingResult"></dict-tag>
<span v-else>--</span>
<!-- 普通提案/重点提案暂不展示,历史流程变量仍保留。 --> </div>
<template v-if="false"> </el-descriptions-item>
( <el-descriptions-item label="立案类型">
<dict-tag :options="dict.type.PROPOSAL_CASE_FILING_TYPE" <div style="display: flex;justify-content: center">
<dict-tag v-if="task.ext.tf_caseFilingType"
:options="dict.type.PROPOSAL_CASE_FILING_TYPE"
:value="task.ext.tf_caseFilingType"></dict-tag> :value="task.ext.tf_caseFilingType"></dict-tag>
) <span v-else>--</span>
</template>
</div> </div>
</el-descriptions-item> </el-descriptions-item>
<template v-if="['CONFIRM_FILING','SUGGESTION'].includes(task.ext.tf_caseFilingResult)"> <template v-if="['CONFIRM_FILING','SUGGESTION'].includes(task.ext.tf_caseFilingResult)">
<el-descriptions-item v-if="task.ext.tf_caseFilingResult === 'SUGGESTION'" label="承办单位" :span="3">{{task?.ext?.tf_masterUnitNameStr || task?.ext?.tf_slaveUnitNameStr}} <el-descriptions-item v-if="task.ext.tf_caseFilingResult === 'SUGGESTION'"
label="承办单位" :span="3">{{task?.ext?.tf_masterUnitNameStr ||
task?.ext?.tf_slaveUnitNameStr}}
</el-descriptions-item> </el-descriptions-item>
<template v-else> <template v-else>
<el-descriptions-item label="主办单位" :span="3">{{task?.ext?.tf_masterUnitNameStr}} <el-descriptions-item label="主办单位" :span="3">{{task?.ext?.tf_masterUnitNameStr}}
@@ -214,7 +239,8 @@ const PROPOSAL_INFO = {
<el-descriptions border class="flow-task-form" :column="3" :key="task.id" v-else> <el-descriptions border class="flow-task-form" :column="3" :key="task.id" v-else>
<el-descriptions-item label="承办单位" <el-descriptions-item label="承办单位"
v-if="['opinion_unit_reply','unit_reply','two_unit_reply','opinion_master_reply','master_reply','slave_reply'].includes(task.taskName)" :span="3"> v-if="['opinion_unit_reply','unit_reply','two_unit_reply','opinion_master_reply','master_reply','slave_reply'].includes(task.taskName)"
:span="3">
{{task.ext.underTakeName}} {{task.ext.underTakeName}}
</el-descriptions-item> </el-descriptions-item>
@@ -223,7 +249,8 @@ const PROPOSAL_INFO = {
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="办理时间">{{ task.finishTime }}</el-descriptions-item> <el-descriptions-item label="办理时间">{{ task.finishTime }}</el-descriptions-item>
<el-descriptions-item label="办理评价" v-if="['feedback'].includes(task.taskName)" :span="3"> <el-descriptions-item label="办理评价" v-if="['feedback'].includes(task.taskName)"
:span="3">
<dict-tag :options="dict.type.PROPOSAL_FEEDBACK" <dict-tag :options="dict.type.PROPOSAL_FEEDBACK"
:value="task.ext.tf_feedback"></dict-tag> :value="task.ext.tf_feedback"></dict-tag>
</el-descriptions-item> </el-descriptions-item>
@@ -243,7 +270,7 @@ const PROPOSAL_INFO = {
<snaker-chart ref="snakerChartRef"></snaker-chart> <snaker-chart ref="snakerChartRef"></snaker-chart>
</div> </div>
`, `,
dicts: ["PROPOSAL_TYPE", "PROPOSAL_CASE_FILING_RESULT", "PROPOSAL_CASE_FILING_TYPE", "PROCESS_TASK_SUBMIT_TYPE", "PROPOSAL_FEEDBACK"], dicts: ["PROPOSAL_TYPE", "PROPOSAL_SOURCE", "PROPOSAL_CASE_FILING_RESULT", "PROPOSAL_CASE_FILING_TYPE", "PROCESS_TASK_SUBMIT_TYPE", "PROPOSAL_FEEDBACK"],
props: { props: {
hide_slave: false hide_slave: false
}, },
@@ -60,7 +60,10 @@ const USER_COMPONENT = {
}, },
filterUnit(query, item) { filterUnit(query, item) {
return item.username.indexOf(query) > -1 // 按姓名或工号筛选人员,字段为空时按空字符串处理。
const username = item.username || ""
const loginname = item.loginname || ""
return username.indexOf(query) > -1 || loginname.indexOf(query) > -1
} }
} }
} }
@@ -23,9 +23,9 @@ layout("/layouts/platform.html"){
</el-card> </el-card>
<el-card shadow="never"> <el-card shadow="never">
<table-tool :columns.sync="tableColumns"> <table-tool :columns.sync="tableColumns">
<el-button class="ml5" icon="el-icon-upload2" type="primary" size="small" <!-- <el-button class="ml5" icon="el-icon-upload2" type="primary" size="small"
@click="openImport">导入提案 @click="openImport">导入提案
</el-button> </el-button>-->
</table-tool> </table-tool>
<el-table v-loading="tableLoading" :data="tableData" @sort-change="pageOrder" header-align="center" style="width: 100%" row-key="id"> <el-table v-loading="tableLoading" :data="tableData" @sort-change="pageOrder" header-align="center" style="width: 100%" row-key="id">
<el-table-column label="序号" width="50" type="index" :index="indexMethod" fixed="left"></el-table-column> <el-table-column label="序号" width="50" type="index" :index="indexMethod" fixed="left"></el-table-column>
@@ -76,8 +76,7 @@ layout("/layouts/platform.html"){
<el-button v-if="row.canRevoke" size="mini" type="danger" @click="openRevoke(row)"> <el-button v-if="row.canRevoke" size="mini" type="danger" @click="openRevoke(row)">
撤回 撤回
</el-button> </el-button>
<!-- v-if="row.taskKey === 'startTask' || !row.instanceId"--> <el-button v-if="row.taskKey === 'startTask' || !row.instanceId" size="mini" type="danger" @click="del(row.id)">
<el-button size="mini" type="danger" @click="del(row.id)">
删除 删除
</el-button> </el-button>
</template> </template>
@@ -8,7 +8,7 @@ layout("/layouts/platform.html"){
<custom-card> <custom-card>
<snaker-start slot="header" label="撰写提案" define_key="JDHTA_NC"> <snaker-start slot="header" label="撰写提案" define_key="JDHTA_NC">
<template slot="header-right-label"> <template slot="header-right-label">
<el-link type="primary" @click="openImport" v-if="!formData.id" style="margin-right: 15px">导入提案</el-link> <!-- <el-link type="primary" @click="openImport" v-if="!formData.id" style="margin-right: 15px">导入提案</el-link>-->
</template> </template>
</snaker-start> </snaker-start>
<el-form :model="formData" :rules="formRules" label-width="120px" ref="addForm"> <el-form :model="formData" :rules="formRules" label-width="120px" ref="addForm">
@@ -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
@@ -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
@@ -9,26 +9,30 @@ const PROPOSAL_INFO = {
<van-cell-group :border="false"> <van-cell-group :border="false">
<van-cell title="提案编号">{{ viewData.code || '--' }}</van-cell> <van-cell title="提案编号">{{ viewData.code || '--' }}</van-cell>
<van-cell title="提案名称">{{ viewData.name || '--' }}</van-cell> <van-cell title="提案名称">{{ viewData.name || '--' }}</van-cell>
<van-cell title="立案结果" v-if="viewData.caseFilingResult">
<dict-tag :options="dict.type.PROPOSAL_CASE_FILING_RESULT" <van-cell title="提案类别">{{ viewData.typeName || '--' }}</van-cell>
:value="viewData.caseFilingResult"></dict-tag>
</van-cell>
<van-cell title="立案类型" v-if="viewData.caseFilingType">
<dict-tag :options="dict.type.PROPOSAL_CASE_FILING_TYPE"
:value="viewData.caseFilingType"></dict-tag>
</van-cell>
<van-cell title="提案类型">{{ viewData.typeName || '--' }}</van-cell>
<van-cell title="提案方式">{{ getDictText(dict.type.PROPOSAL_SOURCE, viewData.source) }} <van-cell title="提案方式">{{ getDictText(dict.type.PROPOSAL_SOURCE, viewData.source) }}
</van-cell> </van-cell>
<van-cell title="代表姓名">{{ viewData.createUserName || '--' }}</van-cell> <van-cell title="提案人">{{ viewData.createUserName || '--' }}</van-cell>
<van-cell title="所属教代会">{{ viewData.sessionName || viewData.fullName || '--' }}</van-cell> <van-cell title="教代会届次">{{ viewData.sessionName || viewData.fullName || '--' }}</van-cell>
<van-cell :title="viewData.committeeName ? '所属委员会' : '所属代表团'"> <van-cell :title="viewData.committeeName ? '委员会名称' : '代表团名称'">
{{ viewData.committeeName || viewData.delegationName || '--' }} {{ viewData.committeeName || viewData.delegationName || '--' }}
</van-cell> </van-cell>
<van-cell title="单位">{{ viewData.unitName || '--' }}</van-cell> <van-cell title="提案人单位">{{ viewData.unitName || '--' }}</van-cell>
<van-cell title="联系电话">{{ viewData.mobile || '--' }}</van-cell> <van-cell title="联系电话">{{ viewData.mobile || '--' }}</van-cell>
<van-cell title="提案时间">{{ viewData.createTime || '--' }}</van-cell> <van-cell title="提案时间">{{ viewData.createTime || '--' }}</van-cell>
<van-cell title="案由" class="proposal-view-long-cell"> <!-- 立案结果和类型尚未填写时仍显示字段,并以双横线表示空值。 -->
<van-cell title="立案结果">
<dict-tag v-if="viewData.caseFilingResult" :options="dict.type.PROPOSAL_CASE_FILING_RESULT"
:value="viewData.caseFilingResult"></dict-tag>
<span v-else>--</span>
</van-cell>
<van-cell title="立案类型">
<dict-tag v-if="viewData.caseFilingType" :options="dict.type.PROPOSAL_CASE_FILING_TYPE"
:value="viewData.caseFilingType"></dict-tag>
<span v-else>--</span>
</van-cell>
<van-cell title="提案案由" class="proposal-view-long-cell">
<div class="proposal-view-rich-value" v-html="viewData.brief || '--'"></div> <div class="proposal-view-rich-value" v-html="viewData.brief || '--'"></div>
</van-cell> </van-cell>
<van-cell title="建议措施" class="proposal-view-long-cell"> <van-cell title="建议措施" class="proposal-view-long-cell">
@@ -48,7 +52,7 @@ const PROPOSAL_INFO = {
:key="merge.id" :key="merge.id"
class="proposal-view-merge-cell" class="proposal-view-merge-cell"
:title="(index + 1) + '. ' + merge.name" :title="(index + 1) + '. ' + merge.name"
:label="'提案编号:' + merge.code + '|提案人:' + merge.createUserName + '|类别:' + merge.typeName + '|代表团:' + merge.delegationName" :label="'提案编号:' + merge.code + '|提案人:' + merge.createUserName + '|提案类别:' + merge.typeName + '|代表团:' + merge.delegationName"
is-link is-link
@click="openView(merge)"> @click="openView(merge)">
</van-cell> </van-cell>
@@ -66,13 +70,16 @@ const PROPOSAL_INFO = {
<template v-if="opinion.commissionerLoginName">({{ opinion.commissionerLoginName }}) <template v-if="opinion.commissionerLoginName">({{ opinion.commissionerLoginName }})
</template> </template>
</van-cell> </van-cell>
<!-- 委员意见分别展示立案结果和类型,未填写时显示双横线。 -->
<van-cell title="立案结果"> <van-cell title="立案结果">
<dict-tag :options="dict.type.PROPOSAL_CASE_FILING_RESULT" <dict-tag v-if="opinion.caseFilingResult" :options="dict.type.PROPOSAL_CASE_FILING_RESULT"
:value="opinion.caseFilingResult"></dict-tag> :value="opinion.caseFilingResult"></dict-tag>
<span v-else>--</span>
</van-cell> </van-cell>
<van-cell title="立案类型" v-if="opinion.caseFilingType"> <van-cell title="立案类型">
<dict-tag :options="dict.type.PROPOSAL_CASE_FILING_TYPE" <dict-tag v-if="opinion.caseFilingType" :options="dict.type.PROPOSAL_CASE_FILING_TYPE"
:value="opinion.caseFilingType"></dict-tag> :value="opinion.caseFilingType"></dict-tag>
<span v-else>--</span>
</van-cell> </van-cell>
<van-cell title="意见" v-if="opinion.opinionText" class="proposal-view-long-cell"> <van-cell title="意见" v-if="opinion.opinionText" class="proposal-view-long-cell">
<div class="proposal-view-rich-value">{{ opinion.opinionText }}</div> <div class="proposal-view-rich-value">{{ opinion.opinionText }}</div>
@@ -158,13 +165,18 @@ const PROPOSAL_INFO = {
|| '--' }}) || '--' }})
</van-cell> </van-cell>
<van-cell title="办理时间">{{ selectedTask.finishTime || '--' }}</van-cell> <van-cell title="办理时间">{{ selectedTask.finishTime || '--' }}</van-cell>
<!-- 立案节点分别展示流程记录中的结果与类型,空值显示双横线。 -->
<van-cell title="立案结果"> <van-cell title="立案结果">
<dict-tag :options="dict.type.PROPOSAL_CASE_FILING_RESULT" <dict-tag v-if="selectedTask.ext.tf_caseFilingResult"
:options="dict.type.PROPOSAL_CASE_FILING_RESULT"
:value="selectedTask.ext.tf_caseFilingResult"></dict-tag> :value="selectedTask.ext.tf_caseFilingResult"></dict-tag>
<span v-else>--</span>
</van-cell> </van-cell>
<van-cell title="立案类型" v-if="selectedTask.ext.tf_caseFilingType"> <van-cell title="立案类型">
<dict-tag :options="dict.type.PROPOSAL_CASE_FILING_TYPE" <dict-tag v-if="selectedTask.ext.tf_caseFilingType"
:options="dict.type.PROPOSAL_CASE_FILING_TYPE"
:value="selectedTask.ext.tf_caseFilingType"></dict-tag> :value="selectedTask.ext.tf_caseFilingType"></dict-tag>
<span v-else>--</span>
</van-cell> </van-cell>
<template <template
v-if="['CONFIRM_FILING', 'SUGGESTION'].includes(selectedTask.ext.tf_caseFilingResult)"> v-if="['CONFIRM_FILING', 'SUGGESTION'].includes(selectedTask.ext.tf_caseFilingResult)">
@@ -187,7 +199,7 @@ const PROPOSAL_INFO = {
</template> </template>
<template v-else> <template v-else>
<van-cell title="办理单位" <van-cell title="承办单位"
v-if="['opinion_unit_reply', 'unit_reply', 'two_unit_reply', 'opinion_master_reply', 'master_reply', 'slave_reply'].includes(selectedTask.taskName)"> v-if="['opinion_unit_reply', 'unit_reply', 'two_unit_reply', 'opinion_master_reply', 'master_reply', 'slave_reply'].includes(selectedTask.taskName)">
{{ selectedTask.ext.underTakeName || '--' }} {{ selectedTask.ext.underTakeName || '--' }}
</van-cell> </van-cell>