This commit is contained in:
2026-04-25 18:13:53 +08:00
parent e3be4cbd6e
commit 924f99dcdf
11 changed files with 434 additions and 154 deletions
@@ -38,7 +38,7 @@ layout("/layouts/platform.html"){
<div class="search-item-label">活动项目</div>
<div class="search-item-option">
<el-select v-model="pageForm.eventId" placeholder="请选择活动项目" filterable clearable
style="width: 100%" @change="doSearchS">
style="width: 100%" @change="doSearch">
<el-option
v-for="item in events"
:key="item.eventId"
@@ -49,6 +49,51 @@ layout("/layouts/platform.html"){
</div>
</div>
<div class="search-item">
<div class="search-item-label">男子女子</div>
<div class="search-item-option">
<el-select v-model="pageForm.isMenWomen" placeholder="请选择男子女子" clearable
style="width: 100%" @change="doSearch">
<el-option
v-for="item in menWomenList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">项目类型</div>
<div class="search-item-option">
<el-select v-model="pageForm.projectType" placeholder="请选择项目类型" clearable
style="width: 100%" @change="doSearch">
<el-option
v-for="item in projectTypeList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">比赛组别</div>
<div class="search-item-option">
<el-select v-model="pageForm.competitionCategory" placeholder="请选择比赛组别" filterable clearable
style="width: 100%" @change="doSearch">
<el-option
v-for="item in groupList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</div>
</div>
</div>
</el-card>
@@ -125,7 +170,7 @@ layout("/layouts/platform.html"){
</template>
<template #edit_func>
<el-button type="primary" @click="openAdd" v-if="awardsMode==1">临时获奖人员添加</el-button>
<el-button type="primary" @click="openAdd">临时获奖人员添加</el-button>
<el-button type="primary" @click="doAdd">确 定</el-button>
</template>
@@ -431,11 +476,14 @@ layout("/layouts/platform.html"){
return {
userOptions: [],
groupList: [
{value: 1, name: "甲组"},
{value: 2, name: "乙组"},
{value: 3, name: "丙组"},
{value: 4, name: "丁组"}
groupList: [],
menWomenList: [
{id: 1, name: "男子"},
{id: 2, name: "女子"}
],
projectTypeList: [
{id: "1", name: "单项"},
{id: "2", name: "团体"}
],
dialogVisible: false,
viewData: [],
@@ -465,7 +513,9 @@ layout("/layouts/platform.html"){
{name: "第八名", id: 8}],
sexList: [{sex: "男", id: 1}, {sex: "女", id: 2}],
pageForm: {
isMenWomen: [],
isMenWomen: "",
projectType: "",
competitionCategory: "",
year: new Date().getFullYear() + "",
},
formRules: {
@@ -511,7 +561,7 @@ layout("/layouts/platform.html"){
},
async unitChange() {
const unit = this.unitOptions.find(v => v.id === this.formData.unitId)
this.$set(this.formData, "unionId", unit.id)
this.$set(this.formData, "unionId", unit.unionId)
this.$set(this.formData, "unionname", unit.unionName)
this.$set(this.formData, "unitname", unit.name)
},
@@ -545,8 +595,14 @@ layout("/layouts/platform.html"){
pageForm.identity = JSON.stringify(this.formData.identity)
const resp = await this.$axios.post(loc() + "/doAddUser", pageForm)
if (resp.code === 0) {
await this.userChange()
this.userDetailsChange()
if (this.awardsMode == 2) {
this.unionList = await this.getUnionList({activityId: this.activityId, eventId: this.eventId})
this.userData = await this.getUnionData({activityId: this.activityId, eventId: this.eventId})
await this.unionDetailsChange()
} else {
await this.userChange()
this.userDetailsChange()
}
this.dialogVisible = false
} else {
this.notifyWarning(resp.msg)
@@ -554,21 +610,24 @@ layout("/layouts/platform.html"){
}
})
},
async yearChange() {
yearChange() {
this.activityList = []
this.events = []
this.$set(this.pageForm, "activityId", "")
this.$set(this.pageForm, "eventId", "")
const {data} = await this.$axios.post("/platform/activity/score/statistics/getActivitys", {year: this.pageForm.year})
this.activityList = data
if (data.length > 0) {
this.pageForm.activityId = this.activityList[0].id
}
await this.doSearchS()
this.$axios.post("/platform/activity/score/statistics/getActivitys", {year: this.pageForm.year}).then((res) => {
const data = res.data
this.activityList = data
if (data.length > 0) {
this.pageForm.activityId = this.activityList[0].id
}
this.doSearchS()
})
},
async changeActivit() {
const resp = await this.$axios.post("/platform/activity/apply/getEvents", {activityId: this.pageForm.activityId})
this.events = resp.data
changeActivit() {
return this.$axios.post("/platform/activity/apply/getEvents", {activityId: this.pageForm.activityId}).then((resp) => {
this.events = resp.data
})
},
async doAdd() {
@@ -802,25 +861,34 @@ layout("/layouts/platform.html"){
},
async getActivitys() {
const {data} = await this.$axios.post("/platform/activity/score/statistics/getActivitys", {year: this.pageForm.year})
return data;
getActivitys() {
return this.$axios.post("/platform/activity/score/statistics/getActivitys", {year: this.pageForm.year}).then((res) => {
return res.data
})
},
async doSearchS() {
this.doSearch()
await this.changeActivit()
focusGroup() {
this.$axios.post("/platform/activity/basic/event/focusGroup").then((resp) => {
if (resp.code === 0) {
this.groupList = resp.data
} else {
this.notifyWarning(resp.msg)
}
})
},
doSearchS() {
this.$set(this.pageForm, "eventId", "")
this.changeActivit().then(() => {
this.doSearch()
})
},
doSearch() {
this.pageForm.pageNumber = 1
this.pageData()
},
pageData() {
this.tabLoading = true
this.tableLoading = true
const pageForm = clone(this.pageForm)
pageForm.isMenWomen = JSON.stringify(pageForm.isMenWomen)
this.$axios.post("/platform/activity/results/input/pageData", pageForm).then(resp => {
this.tabLoading = false
if (resp.code == 0) {
this.tableData = resp.data.list;
this.pageForm.totalCount = resp.data.totalCount;
@@ -830,20 +898,16 @@ layout("/layouts/platform.html"){
type: 'error'
});
}
}).finally(() => {
this.tableLoading = false
})
},
},
async created() {
created() {
this.focusGroup()
this.yearChange()
// this.pageData()
this.activityList = await this.getActivitys()
if (this.activityList.length) {
this.pageForm.activityId = this.activityList[0].id
}
await this.changeActivit()
this.pageData()
}
})
</script>
@@ -29,6 +29,7 @@ var ACTIVITY_SPORTS_APPLY_USER = {
<div class="transfer">
<el-select :clearable="false"
@change="flushApplyUser(applyUserList)"
:disabled="!allowMoreTeam"
placeholder="队伍"
size="small"
v-if="activityTableData.eveProjectType=='2'"
@@ -128,7 +129,7 @@ var ACTIVITY_SPORTS_APPLY_USER = {
</el-button>
<el-dropdown @command="changeTeam"
v-if="activityTableData.eveProjectType==2&&teamList.length>1">
v-if="allowMoreTeam&&activityTableData.eveProjectType==2&&teamList.length>1">
<el-button size="small" type="primary">
修改小队<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
@@ -354,6 +355,7 @@ var ACTIVITY_SPORTS_APPLY_USER = {
eventList: [],
eventData: {},
teamList: [],
allowMoreTeam: false,
applyFromData: {},
leftApplyUserList: [],
@@ -486,9 +488,10 @@ var ACTIVITY_SPORTS_APPLY_USER = {
isMenWomenTwo: data.isMenWomen
})
if (resp.code === 0) {
const {users, awardsModeT, awardsModeG, team, activity, getEvent} = resp.data
const {users, awardsModeT, awardsModeG, team, activity, getEvent, allowMoreTeam} = resp.data
this.activityData = activity
this.eventData = getEvent
this.allowMoreTeam = allowMoreTeam === true
this.teamList = team
if (this.teamList && this.teamList.length > 0) {
this.applyFromData.teamName = this.teamList[0].name
@@ -878,6 +881,7 @@ var ACTIVITY_SPORTS_APPLY_USER = {
},
uniteApplyReset() {
this.teamList = []
this.allowMoreTeam = false
this.eventData = {}
this.activityData = {}
this.applyFromData = {}
@@ -191,6 +191,19 @@ let ACTIVITY_SPORTS_ADD_ACTIVITY = {
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item prop="moreTeamUnionIds" label="报多队工会">
<el-select v-model="formData.moreTeamUnionIds" placeholder="请选择报多队工会" filterable clearable multiple
style="width: 100%">
<el-option
v-for="item in unionOptions"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
@@ -433,7 +446,7 @@ let ACTIVITY_SPORTS_ADD_ACTIVITY = {
</el-col>
<el-col :span="8" v-if="formData.applyType===1||(formData.applyType===2&&projectType==='2')">
<el-form-item label="最多创建几队(如需修改,请先删掉项目,在重新添加项目后,再修改队数)" prop="restrictTotalTeam"
<el-form-item label="最多创建几队" prop="restrictTotalTeam"
 class="restrictTotalTeam">
<el-input-number style="width: 100%" v-model="eventForm.restrictTotalTeam"
placeholder="请填写最多创建几队" controls-position="right" :precision="0"
@@ -585,7 +598,7 @@ let ACTIVITY_SPORTS_ADD_ACTIVITY = {
},
data() {
return {
formData: { applyWay: [] },
formData: { applyWay: [], moreTeamUnionIds: [] },
unionUserNumOneKeyRatio: null,
summaryCount: 0,
unionUserNumCalc: [{ startNum: 1, endNum: 1, resultNum: 1 }],
@@ -601,6 +614,7 @@ let ACTIVITY_SPORTS_ADD_ACTIVITY = {
checkedEvents: [],
unitOptions: [],
clubOptions: [],
unionOptions: [],
planList: [],
events: [],
projectType: "",
@@ -953,6 +967,7 @@ let ACTIVITY_SPORTS_ADD_ACTIVITY = {
applyWay: [2],
eventsIds: [],
unitJointly: [],
moreTeamUnionIds: [],
applyType: 2,
activityCode: data,
activityLevel: 40001
@@ -985,6 +1000,11 @@ let ACTIVITY_SPORTS_ADD_ACTIVITY = {
v.unitSponsor = JSON.parse(v.unitSponsor)
v.undertakeUnit = JSON.parse(v.undertakeUnit)
v.unitJointly = JSON.parse(v.unitJointly)
if (v.moreTeamUnionIds && !Array.isArray(v.moreTeamUnionIds)) {
this.$set(v, "moreTeamUnionIds", JSON.parse(v.moreTeamUnionIds))
} else if (!v.moreTeamUnionIds) {
this.$set(v, "moreTeamUnionIds", [])
}
v.activityGroupId = parseInt(v.activityGroupId)
v.activityLevel = parseInt(v.activityLevel)
this.formData = clone(v)
@@ -1013,7 +1033,15 @@ let ACTIVITY_SPORTS_ADD_ACTIVITY = {
}
}
},
async doOperate() {
confirmReduceTeam(resp, submit) {
this.$confirm(resp.msg, "提示", { type: "warning" })
.then(() => {
submit()
})
.catch(() => {
})
},
doOperate(forceReduceTeam) {
const method = this.formData.id ? "/doEdit" : "/doAdd"
const formData = clone(this.formData)
const events = clone(this.checkedEventInfo)
@@ -1030,16 +1058,23 @@ let ACTIVITY_SPORTS_ADD_ACTIVITY = {
spinner: "el-icon-loading",
background: "rgba(0,0,0,.45)"
})
const resp = await this.$axios.post(base + "/platform/activity/sports/info/mange" + method, {
return this.$axios.post(base + "/platform/activity/sports/info/mange" + method, {
data: JSON.stringify(formData),
events: JSON.stringify(events)
events: JSON.stringify(events),
forceReduceTeam: forceReduceTeam === true
}).then((resp) => {
if (resp.code === 0) {
this.$emit("flip")
} else if (resp.code === 2) {
this.confirmReduceTeam(resp, () => {
this.doOperate(true)
})
} else {
this.$notify.error({ title: "错误", message: resp.msg })
}
}).finally(() => {
loading.close()
})
if (resp.code === 0) {
this.$emit("flip")
} else {
this.$notify.error({ title: "错误", message: resp.msg })
}
loading.close()
},
async operate() {
const deleteEventIds = this.eventsIds.filter((v) => !this.formData.eventsIds.includes(v))
@@ -1060,7 +1095,7 @@ let ACTIVITY_SPORTS_ADD_ACTIVITY = {
await this.doOperate()
}
},
async doSave() {
doSave(forceReduceTeam) {
let url = this.formData.id ? "/doEdit" : "/doAdd"
this.checkedEventInfo.forEach((v) => {
@@ -1115,19 +1150,27 @@ let ACTIVITY_SPORTS_ADD_ACTIVITY = {
background: "rgba(0,0,0,.45)"
})
const resp = await this.$axios.post("/platform/activity/sports/info/mange" + url, {
return this.$axios.post("/platform/activity/sports/info/mange" + url, {
data: JSON.stringify(formData),
events: JSON.stringify(events)
events: JSON.stringify(events),
forceReduceTeam: forceReduceTeam === true
}).then((resp) => {
if (resp.code === 0) {
this.$emit("flush")
if (!this.formData.id) formData.id = resp.data
return this.openEdit(formData, false).then(() => {
this.$message.success(resp.msg)
})
} else if (resp.code === 2) {
this.confirmReduceTeam(resp, () => {
this.doSave(true)
})
} else {
this.$message.error(resp.msg)
}
}).finally(() => {
loading.close()
})
if (resp.code === 0) {
this.$emit("flush")
if (!this.formData.id) formData.id = resp.data
await this.openEdit(formData, false)
this.$message.success(resp.msg)
} else {
this.$message.error(resp.msg)
}
loading.close()
},
examineTrans(formData) {
const { unitJointly, unitSponsor, time, applyTime, applyWay, image } = formData
@@ -1197,12 +1240,14 @@ let ACTIVITY_SPORTS_ADD_ACTIVITY = {
]*/
}
},
async created() {
this.clubOptions = await this.getClubsByRole()
this.clubOptions.map((v) => {
v.name = v.clubName
created() {
Promise.all([this.getClubsByRole(), this.$businessTool.listUnit(), this.$businessTool.listUnion()]).then(([clubs, units, unions]) => {
this.clubOptions = clubs
this.clubOptions.map((v) => {
v.name = v.clubName
})
this.unionOptions = unions
this.unitOptions = this.clubOptions.concat(units)
})
const units = await this.$businessTool.listUnit()
this.unitOptions = this.clubOptions.concat(units)
}
}
@@ -150,6 +150,15 @@ var ACTIVITY_SPORTS_INFO = {
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="年龄限制范围 ">
<span v-if="app.startAgeDate&&app.endAgeDate">
{{ app.startAgeDate }} - {{ app.endAgeDate }}
</span>
<span v-else>暂无</span>
</el-form-item>
</el-col>
<el-col :span="8" v-if="app.projectType==2">
<el-form-item label="领队人数 ">
{{ app.leanderNum | money }} 人