Merge remote-tracking branch 'origin/main'
This commit is contained in:
@@ -32,6 +32,7 @@ layout("/layouts/platform.html"){
|
||||
|
||||
<el-card class="mt10" shadow="never">
|
||||
<table-tool label="申请列表">
|
||||
<el-button size="small" type="primary" @click="exportRefreshReportZip">导出换届报告Zip</el-button>
|
||||
<el-radio-group v-model="pageForm.approval" size="small" @change="doSearch">
|
||||
<el-radio-button :label="true">已审核</el-radio-button>
|
||||
<el-radio-button :label="false">未审核</el-radio-button>
|
||||
@@ -158,6 +159,9 @@ layout("/layouts/platform.html"){
|
||||
})
|
||||
})
|
||||
},
|
||||
exportRefreshReportZip() {
|
||||
this.$downLoad("/platform/club/infoManage/schoolAuditReport/exportRefreshReportZip", this.pageForm)
|
||||
},
|
||||
async pageData() {
|
||||
const resp = await this.$axios.post("/platform/club/infoManage/schoolAuditReport/pageData", this.pageForm)
|
||||
if (resp.code === 0) {
|
||||
|
||||
+16
-34
@@ -65,7 +65,7 @@ const signForm = {
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="100px">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="danger" size="mini" @click="removeTeamUser(scope.$index)">删除
|
||||
<el-button v-if="!scope.row.id" type="danger" size="mini" @click="removeTeamUser(scope.$index)">删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -74,7 +74,7 @@ const signForm = {
|
||||
<el-row type="flex" justify="end" class="mt20">
|
||||
<el-button @click="dialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="onConfirm" :loading="submitLoading"
|
||||
:disabled="teamUsers.length === 0 ">确认报名
|
||||
:disabled="pendingTeamUsers.length === 0 ">确认报名
|
||||
</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
@@ -88,7 +88,7 @@ const signForm = {
|
||||
dialogVisible: false,
|
||||
viewData: {},
|
||||
id: null,
|
||||
//表格用户(实际上只包含当前用户)
|
||||
// 表格同时展示已报名人员和本次新增人员
|
||||
teamUsers: [],
|
||||
quota: 0, // 报名名额限制
|
||||
signedUsers: [], // 已报名人员列表
|
||||
@@ -97,6 +97,10 @@ const signForm = {
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
// 仅未保存的人员需要参与本次提交和名额校验。
|
||||
pendingTeamUsers() {
|
||||
return this.teamUsers.filter(user => !user.id)
|
||||
},
|
||||
remainingQuota() {
|
||||
// 如果 quota 为 null 或 undefined,显示"不限"
|
||||
if (this.quota == null || this.quota === 0) return "不限"
|
||||
@@ -143,7 +147,7 @@ const signForm = {
|
||||
this.$message.error("请勿重复添加")
|
||||
return
|
||||
}
|
||||
if (this.quota > 0 && (this.signedUsers.length + this.teamUsers.length) >= this.quota) {
|
||||
if (this.quota > 0 && (this.signedUsers.length + this.pendingTeamUsers.length) >= this.quota) {
|
||||
this.$message.error("已达到报名人数上限")
|
||||
return
|
||||
}
|
||||
@@ -164,28 +168,12 @@ const signForm = {
|
||||
if (signedResponse.code === 0) {
|
||||
this.signedUsers = Array.isArray(signedResponse.data) ? signedResponse.data : []
|
||||
|
||||
// 已报名人员必须回显,避免分工会主席无法查看已代报记录。
|
||||
this.teamUsers = this.signedUsers.slice()
|
||||
|
||||
// 检查当前用户是否已报名
|
||||
const currentUser = this.signedUsers.find(user => user.userId === this.$store.state.user.id)
|
||||
this.isSignUp = !!currentUser
|
||||
|
||||
// 显示当前用户信息
|
||||
if (currentUser) {
|
||||
this.teamUsers = this.signedUsers;
|
||||
} else {
|
||||
// 如果当前用户未报名,显示当前用户信息用于报名
|
||||
this.teamUsers = [{
|
||||
userId: this.$store.state.user.id,
|
||||
userName: this.$store.state.user.username,
|
||||
loginName: this.$store.state.user.loginname,
|
||||
unitId: this.$store.state.user?.unit?.id,
|
||||
unitName: this.$store.state.user?.unit?.name,
|
||||
unionId: this.$store.state.user?.union?.id,
|
||||
unionName: this.$store.state.user?.union?.name,
|
||||
sex: this.$store.state.user.sex,
|
||||
mobile: this.$store.state.user.mobile,
|
||||
remark: ''
|
||||
}]
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
this.$message.error("获取用户数据失败")
|
||||
@@ -215,20 +203,14 @@ const signForm = {
|
||||
|
||||
//提交报名
|
||||
async onConfirm() {
|
||||
// 检查是否已报名(仅当当前用户已报名时)
|
||||
if (this.isSignUp && this.teamUsers.some(user => user.userId === this.$store.state.user.id)) {
|
||||
this.$message.warning("您已报名该活动!")
|
||||
return
|
||||
}
|
||||
|
||||
// 检查是否有报名人员
|
||||
if (this.teamUsers.length === 0) {
|
||||
// 检查是否有新增报名人员
|
||||
if (this.pendingTeamUsers.length === 0) {
|
||||
this.$message.warning("请至少添加一名报名人员!")
|
||||
return
|
||||
}
|
||||
|
||||
// 检查名额是否足够
|
||||
if (this.quota > 0 && (this.signedUsers.length + this.teamUsers.length) > this.quota) {
|
||||
if (this.quota > 0 && (this.signedUsers.length + this.pendingTeamUsers.length) > this.quota) {
|
||||
// 添加空值检查
|
||||
const remaining = this.quota ? this.quota - this.signedUsers.length : 0;
|
||||
this.$message.warning('报名人数超过限额!当前还可报名' + remaining + '人');
|
||||
@@ -239,13 +221,13 @@ const signForm = {
|
||||
try {
|
||||
this.submitLoading = true;
|
||||
|
||||
this.$confirm('您确定要为' + this.teamUsers.length + '人报名吗?', "提示", { confirmButtonText: "确定",
|
||||
this.$confirm('您确定要为' + this.pendingTeamUsers.length + '人报名吗?', "提示", { confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(async () => {
|
||||
try {
|
||||
// 构造报名数据数组
|
||||
const signUpDataArray = this.teamUsers.map(user => {
|
||||
const signUpDataArray = this.pendingTeamUsers.map(user => {
|
||||
return {
|
||||
cadreTrainingActId: this.id,
|
||||
userId: user.userId,
|
||||
|
||||
@@ -10,7 +10,7 @@ layout("/layouts/platform.html"){
|
||||
<search @search="doSearch">
|
||||
<search-item label="教代会">
|
||||
<el-select @change="meetingChange" clearable filterable placeholder="所属教代会"
|
||||
v-model="pageForm.sessionId">
|
||||
v-model="pageForm.searchSessionId">
|
||||
<el-option :key="item.id" :label="item.fullName" :value="item.id"
|
||||
v-for="item in sessionOptions"></el-option>
|
||||
</el-select>
|
||||
@@ -277,7 +277,7 @@ layout("/layouts/platform.html"){
|
||||
this.listDelegation()
|
||||
},
|
||||
listDelegation() {
|
||||
this.$axios.post("/platform/proposal/common/listDelegation", {sessionId: this.pageForm.sessionId}).then((res) => {
|
||||
this.$axios.post("/platform/proposal/common/listDelegation", {sessionId: this.pageForm.searchSessionId}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.delegationOptions = res.data
|
||||
}
|
||||
@@ -288,7 +288,7 @@ layout("/layouts/platform.html"){
|
||||
if (res.code === 0) {
|
||||
this.sessionOptions = res.data
|
||||
if (this.sessionOptions) {
|
||||
this.$set(this.pageForm, "sessionId", this.sessionOptions[0].id)
|
||||
this.$set(this.pageForm, "searchSessionId", this.sessionOptions[0].id)
|
||||
this.listDelegation()
|
||||
this.pageData()
|
||||
}
|
||||
|
||||
+3
-3
@@ -10,7 +10,7 @@ layout("/layouts/platform.html"){
|
||||
<search @search="doSearch">
|
||||
<search-item label="教代会">
|
||||
<el-select @change="meetingChange" clearable filterable placeholder="所属教代会"
|
||||
v-model="pageForm.sessionId">
|
||||
v-model="pageForm.searchSessionId">
|
||||
<el-option :key="item.id" :label="item.fullName" :value="item.id"
|
||||
v-for="item in sessionOptions"></el-option>
|
||||
</el-select>
|
||||
@@ -207,7 +207,7 @@ layout("/layouts/platform.html"){
|
||||
this.listDelegation()
|
||||
},
|
||||
listDelegation() {
|
||||
this.$axios.post("/platform/proposal/common/listDelegation", {sessionId: this.pageForm.sessionId}).then((res) => {
|
||||
this.$axios.post("/platform/proposal/common/listDelegation", {sessionId: this.pageForm.searchSessionId}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.delegationOptions = res.data
|
||||
}
|
||||
@@ -218,7 +218,7 @@ layout("/layouts/platform.html"){
|
||||
if (res.code === 0) {
|
||||
this.sessionOptions = res.data
|
||||
if (this.sessionOptions) {
|
||||
this.$set(this.pageForm, "sessionId", this.sessionOptions[0].id)
|
||||
this.$set(this.pageForm, "searchSessionId", this.sessionOptions[0].id)
|
||||
this.listDelegation()
|
||||
this.pageData()
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ layout("/layouts/platform.html"){
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="教代会">
|
||||
<el-select @change="meetingChange" clearable filterable placeholder="所属教代会" v-model="pageForm.sessionId">
|
||||
<el-select @change="meetingChange" clearable filterable placeholder="所属教代会" v-model="pageForm.searchSessionId">
|
||||
<el-option :key="item.id" :label="item.fullName" :value="item.id" v-for="item in sessionOptions"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
@@ -181,7 +181,7 @@ layout("/layouts/platform.html"){
|
||||
this.listDelegation()
|
||||
},
|
||||
listDelegation() {
|
||||
this.$axios.post("/platform/proposal/common/listDelegation", { sessionId: this.pageForm.sessionId }).then((res) => {
|
||||
this.$axios.post("/platform/proposal/common/listDelegation", { sessionId: this.pageForm.searchSessionId }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.delegationOptions = res.data
|
||||
}
|
||||
@@ -192,7 +192,7 @@ layout("/layouts/platform.html"){
|
||||
if (res.code === 0) {
|
||||
this.sessionOptions = res.data
|
||||
if (this.sessionOptions) {
|
||||
this.$set(this.pageForm, "sessionId", this.sessionOptions[0].id)
|
||||
this.$set(this.pageForm, "searchSessionId", this.sessionOptions[0].id)
|
||||
this.listDelegation()
|
||||
this.pageData()
|
||||
}
|
||||
|
||||
+10
-4
@@ -6,7 +6,7 @@ layout("/layouts/platform.html"){
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="教代会">
|
||||
<el-select @change="meetingChange" clearable filterable placeholder="所属教代会" v-model="pageForm.sessionId">
|
||||
<el-select @change="doSearch" clearable filterable placeholder="所属教代会" v-model="pageForm.sessionId">
|
||||
<el-option :key="item.id" :label="item.fullName" :value="item.id" v-for="item in sessionOptions"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
@@ -85,6 +85,7 @@ layout("/layouts/platform.html"){
|
||||
el: "#app",
|
||||
store,
|
||||
mixins: [initTableMixins],
|
||||
|
||||
components: {
|
||||
"proposal-info": PROPOSAL_INFO
|
||||
},
|
||||
@@ -111,11 +112,12 @@ layout("/layouts/platform.html"){
|
||||
jumpForm: {
|
||||
targetTaskName: "",
|
||||
tf_audit: true
|
||||
}
|
||||
},
|
||||
sessionOptions:[],
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.pageData()
|
||||
// 默认届次确定后再加载表格,避免无届次请求覆盖已按届次筛选的结果。
|
||||
this.listOpenSession()
|
||||
},
|
||||
methods: {
|
||||
@@ -173,10 +175,14 @@ layout("/layouts/platform.html"){
|
||||
listOpenSession() {
|
||||
this.$axios.post("/platform/proposal/common/listOpenSession").then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.sessionOptions = res.data
|
||||
this.sessionOptions = res.data || []
|
||||
if (this.sessionOptions && this.sessionOptions.length) {
|
||||
this.$set(this.pageForm, "sessionId", this.sessionOptions[0].id)
|
||||
this.pageData()
|
||||
} else {
|
||||
// 没有开启的教代会时保持空列表,避免发起无届次的全量流程查询。
|
||||
this.tableData = []
|
||||
this.$set(this.pageForm, "totalCount", 0)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user