Merge remote-tracking branch 'refs/remotes/origin/fix_协会、活动整改' into release_20261030问题整改

This commit is contained in:
2026-10-31 08:45:37 +08:00
26 changed files with 649 additions and 173 deletions
@@ -75,7 +75,7 @@
<!-- 引入 form-create 和 designer -->
<script src="${base!}/assets/platform/plugins/form-create/form-create.min.js"></script>
<script src="${base!}/assets/platform/plugins/form-create/index.umd.js"></script>
<script src="${base!}/assets/platform/plugins/form-create/index.umd.js?v=20261030"></script>
<!-- swiper -->
<script src="${base!}/assets/platform/plugins/swiper/swiper-bundle.js"></script>
@@ -139,7 +139,7 @@ const act = {
}
if (act.url === "/platform/activity/apply"
&& !this.$auth.hasRoleOr(["SYSADMIN", "SCHOOL_UNION_ADMIN", "BRANCH_UNION_CHAIRMAN", "BRANCH_UNION_WENTI_SPORTS"])) {
return this.$message.warning("PC端暂未开放报名,请前往移动端报名!")
return this.$message.warning("温馨提示:您没有参加该活动的权限!")
}
window.open(act.url)
@@ -116,6 +116,69 @@ layout("/layouts/v4/baseLayout.html"){
object-fit: contain;
}
/* 最新活动的作用域样式会在组件挂载后注入,首屏先固定布局和图片尺寸,避免刷新时放大闪烁。 */
#v4-home-app .act-card .activity-section-wrapper,
#v4-home-app .act-card .section-act,
#v4-home-app .act-card .activity-swiper {
width: 100%;
min-width: 0;
max-width: 100%;
box-sizing: border-box;
overflow: hidden;
}
#v4-home-app .act-card .activity-swiper-container {
position: relative;
width: 100%;
min-width: 0;
max-width: 100%;
box-sizing: border-box;
padding: 9px 54px 12px;
overflow: hidden;
}
#v4-home-app .act-card .activity-swiper .swiper-slide {
width: 100%;
height: auto;
min-width: 0;
flex-shrink: 0;
margin-right: 18px;
}
#v4-home-app .act-card .activity-swiper .img-box {
width: 100%;
height: 128px;
border-radius: 8px;
overflow: hidden;
}
#v4-home-app .act-card .activity-swiper .img-box img {
display: block;
width: 100% !important;
height: 100% !important;
max-width: 100% !important;
max-height: 128px !important;
object-fit: fill !important;
}
@media (min-width: 768px) {
#v4-home-app .act-card .activity-swiper .swiper-slide {
width: calc((100% - 18px) / 2);
}
}
@media (min-width: 1024px) {
#v4-home-app .act-card .activity-swiper .swiper-slide {
width: calc((100% - 54px) / 4);
}
}
@media (min-width: 1200px) {
#v4-home-app .act-card .activity-swiper .swiper-slide {
width: calc((100% - 72px) / 5);
}
}
</style>
<div class="v4-container" id="v4-home-app">
@@ -221,8 +221,7 @@ layout("/layouts/platform.html"){
placeholder="请输入姓名" filterable clearable
style="width: 100%" size="small" v-if="awardsMode==1">
<el-option
v-for="item in userList"
:disabled="item.disabled"
v-for="item in getSelectableUserList(row)"
:key="item.id"
:label="item.username+'('+item.loginname+')'+item.sex"
:value="item.id">
@@ -721,10 +720,15 @@ layout("/layouts/platform.html"){
}
return score;
},
getSelectableUserList(row) {
// 其他行已经选择的人员不再显示,当前行人员保留用于姓名正常回显。
const selectedUserIds = this.userData
.map(item => item.userId)
.filter(userId => userId)
return this.userList.filter(item => item.id === row.userId || !selectedUserIds.includes(item.id))
},
userDetailsChange(val, row) {
const useridArr = this.userData.map(v => v.userId)
this.userList.forEach(v => {
v.disabled = useridArr.includes(v.id)
if (row && row.userId === v.id) {
const o = {
unionId: v.unionId,
@@ -601,6 +601,8 @@
eventForm: {
isLeader: false
},
// 独立记录当前编辑项目,避免下拉框切换后丢失切换前项目标识。
currentEventId: "",
eventsIds: [],
rightChecked: [],
checkedEventInfo: [],
@@ -778,8 +780,10 @@
this.checkedEventInfo = this.checkedEvents.map((v) => {
v.eventId = v.id
if (v.projectType === "1") {
v.athletesMaxNum = 3
v.restrictRegNumber = 2
// “所有单项”保存默认值,具体单项以0表示尚未个性化设置。
const isAllItems = v.eventId === "allItems"
v.athletesMaxNum = isAllItems ? 3 : 0
v.restrictRegNumber = isAllItems ? 2 : 0
v.leanderNum = 0
v.coachNum = 0
v.applyUserModel = 1
@@ -791,7 +795,23 @@
return v
})
},
cacheCurrentEventForm() {
if (!this.currentEventId || !this.eventForm) {
return
}
const current = clone(this.eventForm)
current.checkedEventId = this.currentEventId
current.eventId = this.currentEventId
const index = this.checkedEventInfo.findIndex((item) => item.eventId === this.currentEventId)
if (index >= 0) {
this.checkedEventInfo.splice(index, 1, current)
} else {
this.checkedEventInfo.push(current)
}
},
async eventChange(val) {
this.cacheCurrentEventForm()
const data = this.checkedEventInfo.find((v) => v.eventId === val)
const resp = await $.get("/platform/activity/sports/common/getEventData", { id: val })
await this.$nextTick()
@@ -804,10 +824,10 @@
projectType: resp.data.projectType,
leanderNum: 0,
coachNum: 0,
athletesMaxNum: resp.data.projectType === 1 ? 3 : null,
athletesMaxNum: resp.data.projectType === 1 ? 0 : null,
restrictTotalTeam: 1,
substituteNum: 0,
restrictRegNumber: resp.data.projectType === 1 ? 2 : null,
restrictRegNumber: resp.data.projectType === 1 ? 0 : null,
isLeader: false,
applyUserModel: 1
}
@@ -815,33 +835,27 @@
this.projectType = resp.data.projectType
}
this.$set(this.eventForm, "checkedEventId", val)
this.currentEventId = val
},
async saveEvent() {
saveEvent() {
const data = clone(this.eventForm)
if (data.checkedEventId === "allItems") {
this.checkedEventInfo.forEach((v) => {
if (v.projectType === "1") {
v.applyUserModel = this.eventForm.applyUserModel
v.athletesMaxNum = data.athletesMaxNum
v.restrictRegNumber = data.restrictRegNumber
v.unionLimit = data.unionLimit
}
})
const allItemsIndex = this.checkedEventInfo.findIndex((v) => v.eventId === "allItems")
if (allItemsIndex >= 0) {
this.checkedEventInfo.splice(allItemsIndex, 1, data)
}
} else {
const info = this.checkedEventInfo.find((v) => v.eventId === data.checkedEventId)
if (info != null) {
const index = this.checkedEventInfo.findIndex((v) => v.eventId === data.checkedEventId)
this.checkedEventInfo.splice(index, 1)
if (info.projectType === "1") {
this.$set(this.eventForm, "athletesMaxNum", data.athletesMaxNum)
this.$set(this.eventForm, "restrictRegNumber", data.restrictRegNumber)
}
this.$set(this.eventForm, "checkedEventId", info.eventId)
}
data.eventId = data.checkedEventId
this.checkedEventInfo.push(data)
}
await this.doSave()
this.eventForm = clone(data)
this.currentEventId = data.checkedEventId
return this.doSave()
},
prev() {
this.active--
@@ -949,6 +963,7 @@
this.copyTemplateMode = false
this.copyTemplateName = ""
this.pushTodoFlag = false
this.currentEventId = ""
this.events = await this.getEvents(2)
await this.getActivityGroup()
this.active = 0
@@ -1028,6 +1043,7 @@
async openEdit(row, flag, copyTemplateMode = false) {
this.copyTemplateMode = !!copyTemplateMode
this.pushTodoFlag = false
this.currentEventId = ""
this.active = flag ? 0 : this.active
await this.getActivityGroup()
const { id } = row
@@ -1184,7 +1200,8 @@
}
if (this.eventForm.checkedEventId == "allItems") {
events = events.filter((v) => v.projectType == 1 && v.id != "allItems")
// “所有单项”配置随具体单项提交,由后端统一校验并补齐继承值。
events = events.filter((v) => v.projectType == 1)
} else {
this.$set(this.eventForm, "activityId", this.formData.id)
this.$set(this.eventForm, "eventId", this.eventForm.checkedEventId)
@@ -1192,9 +1209,10 @@
this.$set(this.eventForm, "startAgeDate", this.eventForm.ageDate[0])
this.$set(this.eventForm, "endAgeDate", this.eventForm.ageDate[1])
}
events = this.eventForm
const allItems = this.checkedEventInfo.find((v) => v.eventId === "allItems")
events = allItems ? [clone(allItems), this.eventForm] : [this.eventForm]
if (this.copyTemplateMode) {
this.cleanCopyTemplateData(null, [events])
this.cleanCopyTemplateData(null, events)
}
}
const loading = this.$loading({
@@ -1215,6 +1233,7 @@
this.copyTemplateMode = false
}
await this.openEdit(formData, false)
this.currentEventId = this.eventForm.checkedEventId || ""
this.$message.success(resp.msg)
} else {
this.$message.error(resp.msg)
@@ -1,4 +1,11 @@
const REGISTER_INFO_COMPONENT = {
// 默认展示换届报告,仅由不需要查看该字段的业务页面显式关闭。
props: {
hideReplaceReport: {
type: Boolean,
default: false
}
},
template: `
<div>
<el-tabs tab-position="top" v-model="activeName">
@@ -36,7 +43,7 @@ const REGISTER_INFO_COMPONENT = {
{{viewData.createTime}}
</el-descriptions-item>
<el-descriptions-item label="会费标准" :span="4">
{{viewData.due}}
{{ viewData.due === null || viewData.due === undefined ? "--" : viewData.due + " 元/年" }}
</el-descriptions-item>
<el-descriptions-item :span="4">
<template slot="label">社团介绍</template>
@@ -66,7 +73,7 @@ const REGISTER_INFO_COMPONENT = {
<template slot="label">其他附件</template>
<file-preview :files="viewData.files" complete_result></file-preview>
</el-descriptions-item>
<el-descriptions-item :span="2">
<el-descriptions-item :span="2" v-if="!hideReplaceReport">
<template slot="label">换届报告</template>
<file-preview :files="viewData.replaceReport" complete_result></file-preview>
</el-descriptions-item>
@@ -68,10 +68,12 @@ layout("/layouts/platform.html"){
</el-steps>
<!-- 第一步:基础信息表单 -->
<!-- 本表单自行提示首个必填错误,关闭全局校验弹窗增强以免重复提示。 -->
<el-form
v-show="step === 0"
:model="formData"
ref="baseForm"
no-auto-enhance
:rules="baseRules"
label-width="150px"
class="main-form"
@@ -135,7 +137,9 @@ layout("/layouts/platform.html"){
v-model="formData.due"
placeholder="请输入会费标准"
readonly
></el-input>
>
<template slot="append">元/年</template>
</el-input>
</el-form-item>
</el-col>
</el-row>
@@ -146,7 +150,7 @@ layout("/layouts/platform.html"){
<el-form-item
class="is-required"
label="本年度活动开展情况"
prop="yearActivity"
prop="yearActivityList"
>
<span class="tip-text">说明:非赛事活动无需填写赛事举办单位、获奖情况。</span>
<el-table
@@ -638,6 +642,7 @@ layout("/layouts/platform.html"){
id: GetQueryString("bizId"),
taskId: GetQueryString("taskId"),
step: 0, // 当前步骤(0-基础信息,1-财务收支,2-成员名单)
formLoading: false,
isRegistered: false, // 是否已登记
currentClubId: "", // 当前选中社团ID
@@ -656,7 +661,7 @@ layout("/layouts/platform.html"){
year: new Date().getFullYear() + "", // 默认当前年度
clubId: "",
foundTime: "",
due: "",
due: null,
clubName: "",
yearActivityList: [{}], // 本年度活动列表
plans: [{}], // 下年度计划列表
@@ -671,7 +676,10 @@ layout("/layouts/platform.html"){
},
// 表单校验规则
baseRules: {},
baseRules: {
yearActivityList: [{validator: this.validateActivityRows, trigger: ['change', 'blur']}],
plans: [{validator: this.validateActivityRows, trigger: ['change', 'blur']}]
},
financeRules: {},
memberRules: {}
};
@@ -724,6 +732,28 @@ layout("/layouts/platform.html"){
}
},
methods: {
// 在列表级逐行校验,避免嵌套表单项未注册、空数组或纯空白文本绕过必填。
validateActivityRows(rule, value, callback) {
const currentYear = rule.field === 'yearActivityList';
const label = currentYear ? '本年度活动开展情况' : '下一年度活动计划';
const fields = currentYear
? [['activityTime', '活动时间'], ['activityName', '活动主题/赛事名称'], ['activityAddress', '活动地点'], ['joinNum', '参加人数']]
: [['activityName', '活动主题/赛事名称'], ['activityUnit', '活动/赛事主办单位'], ['activityAddress', '活动地点']];
if (!Array.isArray(value) || value.length === 0) {
callback(new Error(label + '至少填写一条'));
return;
}
for (let i = 0; i < value.length; i++) {
for (const field of fields) {
const content = value[i] && value[i][field[0]];
if (content === null || content === undefined || String(content).trim() === '') {
callback(new Error(label + '第' + (i + 1) + '条:' + field[1] + '不能为空'));
return;
}
}
}
callback();
},
/************************ 通用工具方法 ************************/
// 格式化数字(保留2位小数,空值显示0)
formatNumber(num) {
@@ -1110,7 +1140,7 @@ layout("/layouts/platform.html"){
if (!val) return;
const club = this.clubOptions.find(item => item.id === val);
// 更新社团基础信息
this.formData.due = club?.due || "";
this.formData.due = club && club.due !== null && club.due !== undefined ? club.due : null;
this.formData.foundTime = club?.foundTime
? this.$moment(club.foundTime).format("YYYY-MM-DD")
: this.$moment().format("YYYY-MM-DD");
@@ -1161,73 +1191,63 @@ layout("/layouts/platform.html"){
// 步骤前进
this.step++;
},
// 保存
async handleSave() {
try {
this.recalculateCensus();
const resp = await this.$axios.post("/platform/club/examine/apply/save", {
data: JSON.stringify(this.formData),
incomeDetailed: JSON.stringify(this.financeData.incomeDetailed),
incomeCensus: JSON.stringify(this.financeData.incomeCensus)
});
if (resp.code === 0) {
this.$message.success(resp.msg);
commonUtil.pjaxPush('/platform/club/examine/mine');
// 三个操作共用基础信息校验,失败时返回第一步展示行号和必填字段。
validateBaseBeforeAction(action) {
if (this.formLoading) return;
this.$refs.baseForm.validate((valid, fields) => {
if (!valid) {
this.step = 0;
const firstError = Object.values(fields || {}).flat()[0];
this.$message.warning('温馨提示:' + (firstError ? firstError.message : '请补全基础信息必填项'));
return;
}
} catch (error) {
this.handleError(error, "保存失败");
}
action();
});
},
// 提交(新增)
async handleSubmit() {
try {
this.recalculateCensus();
await this.$confirm("确定要提交此申请吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "info"
// 仅接收本页三个固定操作的接口后缀;data为登记实体JSON,另两项为财务数组JSON。
// 接口返回{code,msg,data},code为0时保存成功,否则展示后端校验提示。
requestExamineAction(action) {
if (this.formLoading) return;
this.recalculateCensus();
const params = {
data: JSON.stringify(this.formData),
incomeDetailed: JSON.stringify(this.financeData.incomeDetailed),
incomeCensus: JSON.stringify(this.financeData.incomeCensus)
};
if (action === 'submitAgain') params.taskId = this.taskId;
this.formLoading = true;
return this.$axios.post('/platform/club/examine/apply/' + action, params)
.then((resp) => {
if (resp.code === 0) {
this.$message.success(resp.msg);
commonUtil.pjaxPush('/platform/club/examine/mine');
} else {
this.$message.warning(resp.msg);
}
})
.catch(() => {
// 后端校验和网络异常已由全局axios拦截器提示,此处仅结束失败请求,避免再次弹窗。
})
.finally(() => {
this.formLoading = false;
});
const resp = await this.$axios.post("/platform/club/examine/apply/submit", {
data: JSON.stringify(this.formData),
incomeDetailed: JSON.stringify(this.financeData.incomeDetailed),
incomeCensus: JSON.stringify(this.financeData.incomeCensus)
});
if (resp.code === 0) {
this.$message.success(resp.msg);
commonUtil.pjaxPush('/platform/club/examine/mine');
} else {
this.$message.warning(resp.msg);
}
} catch (error) {
if (error !== "cancel") {
this.handleError(error, "提交失败");
}
}
},
// 提交(任务处理)
async handleFinishTask() {
try {
this.recalculateCensus();
await this.$confirm("您确定要提交吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
});
const resp = await this.$axios.post('/platform/club/examine/apply/submitAgain', {
data: JSON.stringify(this.formData),
incomeDetailed: JSON.stringify(this.financeData.incomeDetailed),
incomeCensus: JSON.stringify(this.financeData.incomeCensus),
taskId: this.taskId
});
if (resp.code === 0) {
this.$message.success(resp.msg);
commonUtil.pjaxPush('/platform/club/examine/mine');
}
} catch (error) {
if (error !== "cancel") {
this.handleError(error, "提交失败");
}
}
handleSave() {
this.validateBaseBeforeAction(() => this.requestExamineAction('save'));
},
handleSubmit() {
this.validateBaseBeforeAction(() => {
this.$confirm('确定要提交此申请吗?', '提示', {
confirmButtonText: '确定', cancelButtonText: '取消', type: 'info'
}).then(() => this.requestExamineAction('submit')).catch(() => {});
});
},
handleFinishTask() {
this.validateBaseBeforeAction(() => {
this.$confirm('您确定要提交吗?', '提示', {
confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning'
}).then(() => this.requestExamineAction('submitAgain')).catch(() => {});
});
}
}
});
@@ -10,7 +10,7 @@
<el-descriptions v-if="viewData" :column="3" border class="table_fixed">
<el-descriptions-item label="社团名称">{{ viewData.clubName }}</el-descriptions-item>
<el-descriptions-item label="成立时间">{{ viewData.foundTime }} </el-descriptions-item>
<el-descriptions-item label="会费标准">{{ viewData.due }}</el-descriptions-item>
<el-descriptions-item label="会费标准">{{ viewData.due === null || viewData.due === undefined ? "--" : viewData.due + " 元/年" }}</el-descriptions-item>
<el-descriptions-item span="3">
<template slot="label">工作总结</template>
<file-preview :files="viewData.summaryFiles" complete_result></file-preview>
@@ -73,7 +73,7 @@ layout("/layouts/platform.html"){
<el-descriptions-item label="联系人邮箱">{{viewData.concatPersonEmail}}</el-descriptions-item>
<el-descriptions-item>
<template slot="label">会费标准</template>
{{viewData.due}}
{{ viewData.due === null || viewData.due === undefined ? "--" : viewData.due + " 元/年" }}
</el-descriptions-item>
<el-descriptions-item :span="2">
<template slot="label">当前人数</template>
@@ -63,7 +63,7 @@ layout("/layouts/platform.html"){
<el-descriptions-item label="社团编码">{{viewData.clubCode}}</el-descriptions-item>
<el-descriptions-item label="社团类型">{{viewData.typeName}}</el-descriptions-item>
<el-descriptions-item label="发起人">{{viewData.sponsorName}}</el-descriptions-item>
<el-descriptions-item label="会费标准">{{viewData.due}}</el-descriptions-item>
<el-descriptions-item label="会费标准">{{ viewData.due === null || viewData.due === undefined ? "--" : viewData.due + " 元/年" }}</el-descriptions-item>
<el-descriptions-item label="当前人数">{{viewData.currentPeopleNum}}</el-descriptions-item>
<el-descriptions-item span="2">
<template slot="label">社团介绍</template>
@@ -24,7 +24,13 @@ const CLUB_FORM_TEMPLATE = {
</el-col>
<el-col :span="12">
<el-form-item label="会费标准" prop="due">
<el-input placeholder="请填写会费标准" v-model="formData.due">
<el-input
min="0"
placeholder="请填写会费标准"
step="0.01"
type="number"
v-model.number="formData.due"
>
<template slot="append">元/年</template>
</el-input>
</el-form-item>
@@ -156,12 +162,15 @@ const CLUB_FORM_TEMPLATE = {
return {
formData: {
clubName: "",
clubType: ""
clubType: "",
due: null
},
formRules: {
clubName: [{ required: true, message: "请填写社团名称", trigger: ["blur", "change"] }],
clubCode: [{ required: false, message: "请填写社团编码", trigger: ["blur", "change"] }],
clubType: [{ required: true, message: "请选择社团类型", trigger: ["blur", "change"] }],
// 会费标准只保存数字,单位“元/年”由页面统一展示。
due: [{ type: "number", min: 0, message: "会费标准必须为不小于0的数字", trigger: ["blur", "change"] }],
//concatPerson: [{ required: true, message: "请选择社团联系人", trigger: ["blur", "change"] }],
foundTime: [{ required: true, message: "请选择成立时间", trigger: ["blur", "change"] }]
}
@@ -73,7 +73,7 @@ layout("/layouts/platform.html"){
</el-card>
<template #public>
<register-info ref="registerInfoRef">
<register-info ref="registerInfoRef" :hide-replace-report="true">
<div v-if="showApprovalForm">
<div class="process-title">
{{formData.taskName}}
@@ -77,7 +77,7 @@ layout("/layouts/platform_h5.html"){
<van-cell title="会长">{{ clubDetail.clubLeader || '--' }}</van-cell>
<van-cell title="秘书长">{{ clubDetail.clubSecretary || '--' }}</van-cell>
<van-cell title="当前人数">{{ clubDetail.currentPeopleNum || 0 }} 人</van-cell>
<van-cell title="会费标准">{{ clubDetail.due || '--' }}</van-cell>
<van-cell title="会费标准">{{ clubDetail.due === null || clubDetail.due === undefined ? '--' : clubDetail.due + ' 元/年' }}</van-cell>
<van-cell title="社团介绍" class="club-user-join-info-long-cell"><div v-if="hasClubContent(clubDetail.introduce)" v-html="clubDetail.introduce"></div><span v-else>暂无</span></van-cell>
<van-cell title="社团宗旨" class="club-user-join-info-long-cell"><div v-if="hasClubContent(clubDetail.purpose)" v-html="clubDetail.purpose"></div><span v-else>暂无</span></van-cell>
<van-cell title="社团章程" class="club-user-join-info-long-cell"><file-preview v-if="clubDetail.rulesFile && clubDetail.rulesFile.length" :files="clubDetail.rulesFile" complete_result></file-preview><span v-else>暂无</span></van-cell>