This commit is contained in:
2025-09-04 09:40:50 +08:00
parent 5441b1d785
commit 53e6c4bc52
35 changed files with 1924 additions and 1266 deletions
@@ -2,10 +2,11 @@ const ACTIVITY_CULTURE_APPLY_ACTIVITY = {
template: /*language=HTML*/ `
<div>
<template>
<el-card shadow="never" style="min-height: calc(100vh - 70px);position: relative">
<el-card shadow="never">
<snaker-start slot="header" label="文化活动申报" define_key="WHHD"
v-if="activity_type===40002||activity_type===40003"></snaker-start>
<el-form :model="formData" :rules="formRules" label-suffix="" label-width="170px"
ref="addForm" v-loading="formLoading">
<el-tabs tab-position="top" v-model="activeName">
<el-tab-pane label="活动基础信息" name="1">
<div class="mt20">
@@ -84,20 +85,20 @@ const ACTIVITY_CULTURE_APPLY_ACTIVITY = {
</el-form-item>
</el-col>
<!-- <el-col :span="12"-->
<!-- v-if="formData.isEnrollSystem === true">-->
<!-- <el-form-item label="活动计划时间" prop="plannedDate">-->
<!-- <el-date-picker-->
<!-- @change="plannedDateChange"-->
<!-- end-placeholder="结束日期"-->
<!-- range-separator="-"-->
<!-- start-placeholder="开始日期"-->
<!-- style="width: 100%"-->
<!-- type="daterange"-->
<!-- v-model="formData.plannedDate" value-format="yyyy-MM-dd">-->
<!-- </el-date-picker>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :span="12"-->
<!-- v-if="formData.isEnrollSystem === true">-->
<!-- <el-form-item label="活动计划时间" prop="plannedDate">-->
<!-- <el-date-picker-->
<!-- @change="plannedDateChange"-->
<!-- end-placeholder="结束日期"-->
<!-- range-separator="-"-->
<!-- start-placeholder="开始日期"-->
<!-- style="width: 100%"-->
<!-- type="daterange"-->
<!-- v-model="formData.plannedDate" value-format="yyyy-MM-dd">-->
<!-- </el-date-picker>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<el-col :span="12">
<el-form-item label="实际活动时间" prop="time">
@@ -181,7 +182,9 @@ const ACTIVITY_CULTURE_APPLY_ACTIVITY = {
<el-form-item label="报名人数限制" prop="userNumberLimit">
<el-radio-group v-model="formData.userNumberLimit" size="small">
<el-radio border :label="1">总人数限制</el-radio>
<el-radio border :label="2" v-if="activity_type===40001">分工会人数限制</el-radio>
<el-radio border :label="2" v-if="activity_type===40001">
分工会人数限制
</el-radio>
<el-radio border :label="null">不限制</el-radio>
</el-radio-group>
</el-form-item>
@@ -472,15 +475,12 @@ const ACTIVITY_CULTURE_APPLY_ACTIVITY = {
</el-alert>
</el-tab-pane>
</el-tabs>
<div style="padding: 20px;text-align: center;">
<el-button @click="operation" style="width: 300px" type="primary" :disabled="formLoading">
确 定
</el-button>
</div>
</el-form>
<el-row type="flex" justify="end" class="mt20">
<el-button type="primary" plain @click="onSave">保存</el-button>
<el-button type="primary" @click="onSubmit" v-if="!taskId">提交</el-button>
<el-button type="primary" @click="onFinishTask" v-else>提交</el-button>
</el-row>
</el-card>
<drawer-user-scope
@@ -489,7 +489,8 @@ const ACTIVITY_CULTURE_APPLY_ACTIVITY = {
:group_id.sync="formData.groupId"
></drawer-user-scope>
<el-dialog :append-to-body="true" :close-on-click-modal="false" :visible.sync="userDialogVisible" title="添加人员" width="40%">
<el-dialog :append-to-body="true" :close-on-click-modal="false" :visible.sync="userDialogVisible"
title="添加人员" width="40%">
<el-form :model="formData" label-width="100px">
<el-form-item label="参加人员" prop="userId">
@@ -522,25 +523,27 @@ const ACTIVITY_CULTURE_APPLY_ACTIVITY = {
`,
props: {
activity_type: {
value: { type: Object, default: "" }
value: {type: Object, default: ""}
}
},
mixins: [initTableMixins],
data() {
return {
bizId: GetQueryString("bizId"),
taskId: GetQueryString("taskId"),
activeName: "1",
pageForm: {
year: new Date().getFullYear() + ""
},
formRules: {
groupId: [{ required: true, message: "必填", trigger: ["blur", "change"] }],
name: [{ required: true, message: "必填", trigger: ["blur", "change"] }],
type: [{ required: true, message: "必填", trigger: ["blur", "change"] }],
projectTypeCode: [{ required: true, message: "必填", trigger: ["blur", "change"] }],
address: [{ required: true, message: "必填", trigger: ["blur", "change"] }],
plannedDate: [{ required: true, message: "必填", trigger: ["blur", "change"] }],
time: [{ required: true, message: "必填", trigger: ["blur", "change"] }],
cover: [{ required: true, message: "必填", trigger: ["blur", "change"] }]
groupId: [{required: true, message: "必填", trigger: ["blur", "change"]}],
name: [{required: true, message: "必填", trigger: ["blur", "change"]}],
type: [{required: true, message: "必填", trigger: ["blur", "change"]}],
projectTypeCode: [{required: true, message: "必填", trigger: ["blur", "change"]}],
address: [{required: true, message: "必填", trigger: ["blur", "change"]}],
plannedDate: [{required: true, message: "必填", trigger: ["blur", "change"]}],
time: [{required: true, message: "必填", trigger: ["blur", "change"]}],
cover: [{required: true, message: "必填", trigger: ["blur", "change"]}]
},
projectTypeList: [],
@@ -557,12 +560,12 @@ const ACTIVITY_CULTURE_APPLY_ACTIVITY = {
selectLoading: false,
userColumns: [
{ prop: "userName", label: "姓名" },
{ prop: "loginName", label: "工号" },
{ prop: "sex", label: "性别" },
{ prop: "mobile", label: "联系方式" },
{ prop: "unitName", label: "所属单位" },
{ prop: "unionName", label: "所属工会" }
{prop: "userName", label: "姓名"},
{prop: "loginName", label: "工号"},
{prop: "sex", label: "性别"},
{prop: "mobile", label: "联系方式"},
{prop: "unitName", label: "所属单位"},
{prop: "unionName", label: "所属工会"}
]
}
},
@@ -584,10 +587,50 @@ const ACTIVITY_CULTURE_APPLY_ACTIVITY = {
}
},
methods: {
// 保存
onSave() {
this.$confirm("您确定保存吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
const formData = JSON.parse(JSON.stringify(this.formData))
formData.activity_type = this.activity_type
const {time, applyTime2, plannedDate} = formData
if (applyTime2 && applyTime2.length) {
formData.applyStartTime = applyTime2[0]
formData.applyEndTime = applyTime2[1]
formData.applyTime2 = null
}
if (time && time.length) {
formData.startTime = formData.time[0]
formData.endTime = formData.time[1]
formData.time = null
}
if (plannedDate && plannedDate.length) {
formData.startPlannedDate = formData.plannedDate[0]
formData.endPlannedDate = formData.plannedDate[1]
formData.plannedDate = null
}
this.$axios.post('/platform/activity/culture/applyActivity/save', {data: JSON.stringify(this.formData)}).then(res => {
if (res.code === 0) {
this.$message.success("保存成功")
if (this.activity_type === 40002) {
window.location.href = "/platform/activity/culture/infoManage/union"
} else if (this.activity_type === 40003) {
window.location.href = "/platform/activity/culture/infoManage/club"
} else {
window.location.href = "/platform/activity/culture/infoManage/school"
}
}
})
})
},
async remoteMethod(query) {
if (query) {
this.selectLoading = true
const { data } = await this.$axios.post("/platform/activity/culture/applyActivity/findUser", {
const {data} = await this.$axios.post("/platform/activity/culture/applyActivity/findUser", {
serachWord: query,
activity_type: this.activity_type
})
@@ -624,7 +667,7 @@ const ACTIVITY_CULTURE_APPLY_ACTIVITY = {
this.formLoading = true
const formData = JSON.parse(JSON.stringify(this.formData))
formData.activity_type = this.activity_type
const { time, applyTime2, plannedDate } = formData
const {time, applyTime2, plannedDate} = formData
if (applyTime2 && applyTime2.length) {
formData.applyStartTime = applyTime2[0]
formData.applyEndTime = applyTime2[1]
@@ -715,28 +758,28 @@ const ACTIVITY_CULTURE_APPLY_ACTIVITY = {
this.$set(this.formData, "mobile", id ? userList.find((v) => v.id === id).mobile : null)
},
async getActivityTwoLevelType(code) {
const { data } = await this.$axios.post("/platform/activity/basic/settings/getActivityTwoLevelType", { code: code })
const {data} = await this.$axios.post("/platform/activity/basic/settings/getActivityTwoLevelType", {code: code})
return data
},
async getActivityGroup() {
const { data } = await this.$axios.post("/platform/activity/basic/scope/getActivityUserScopeGroup")
const {data} = await this.$axios.post("/platform/activity/basic/scope/getActivityUserScopeGroup")
this.activityGroupList = data
},
async generateActivityCode() {
const { data } = await this.$axios.post("/platform/activity/sports/common/generateActivityCode", { activity_type: this.activity_type })
const {data} = await this.$axios.post("/platform/activity/sports/common/generateActivityCode", {activity_type: this.activity_type})
return data
},
async getUnionData() {
const { data } = await this.$axios.post("/platform/activity/culture/applyActivity/getUnionData", {
const {data} = await this.$axios.post("/platform/activity/culture/applyActivity/getUnionData", {
activityScopeGroupId: this.formData.groupId
})
return data
},
init(id) {
if (id){
if (id) {
this.activeName = "1"
this.findOne(id)
}else{
} else {
this.formData = {
time: [],
applyTime2: [],
@@ -762,11 +805,11 @@ const ACTIVITY_CULTURE_APPLY_ACTIVITY = {
}
},
async queryUserByIds(ids) {
const { data } = await this.$axios.post("/platform/activity/culture/applyActivity/queryUserByIds", { ids: JSON.stringify(ids) })
const {data} = await this.$axios.post("/platform/activity/culture/applyActivity/queryUserByIds", {ids: JSON.stringify(ids)})
return data
},
async findOne(id) {
const { data, code, msg } = await this.$axios.post("/platform/activity/culture/infoManage/findOne", { id })
const {data, code, msg} = await this.$axios.post("/platform/activity/culture/infoManage/findOne", {id})
if (code === 0) {
if (data.userId) {
const user = await this.queryUserByIds([data.userId])
@@ -34,8 +34,8 @@ const ACTIVITY_CULTURE_APPLY_USER = {
<el-card class="mt10" shadow="never">
<table-tool label="活动列表">
<el-radio-group v-model="pageForm.isEnrolled" @change="doSearch" size="mini" class="ml10">
<el-radio-button :label="false">未报名</el-radio-button>
<el-radio-button :label="true">已报名</el-radio-button>
<el-radio-button :label="false">未报名</el-radio-button>
</el-radio-group>
</table-tool>
@@ -17,7 +17,7 @@ const ACTIVITY_CULTURE_INFO_ACTIVITY = {
<el-descriptions-item label="活动编号">
{{ viewData.activityCode }}
</el-descriptions-item>
<el-descriptions-item label="活动编号">
<el-descriptions-item label="活动项目类型">
{{ viewData.projectTypeName }}({{ viewData.projectTypeCode }})
</el-descriptions-item>
<el-descriptions-item label="活动类型" :span="2">
@@ -42,8 +42,8 @@ const ACTIVITY_CULTURE_INFO_ACTIVITY = {
</el-descriptions-item>
<el-descriptions-item label="报名方式">
<span v-if="viewData.signUpMethod===1">个人报名</span>
<span v-else-if="viewData.signUpMethod===2">分工会报名</span>
<span v-else-if="viewData.signUpMethod===3">组队报名</span>
<span v-else-if="viewData.signUpMethod===2">组队报名</span>
<span v-else-if="viewData.signUpMethod===3">分工会报名</span>
<span v-else-if="!viewData.signUpMethod">无需报名</span>
</el-descriptions-item>
<el-descriptions-item label="是否用于报名">
@@ -153,7 +153,43 @@ const singleSignUp = {
</div>
<!-- 分工会报名-->
<div v-else-if="viewData.signUpMethod===3">
<div class="process-title">选择报名人员,报名人数 <span style="color: red">{{viewData.teamNum}}</span>人
</div>
<el-select
v-if="inApplyTime"
v-model="searchTeammateUserId"
filterable
clearable
remote
reserve-keyword
placeholder="请输入关键词"
:remote-method="queryTeammate">
<el-option
v-for="item in teammateOptions"
:key="item.userId"
:label="item.userName + '(' + item.loginName + ')'"
:value="item.userId">
</el-option>
</el-select>
<el-button v-if="inApplyTime" class="ml5" type="primary" icon="el-icon-plus"
@click="addTeamUser">添加
</el-button>
<el-table :data="teamUsers" class="mt10">
<el-table-column label="序号" type="index" width="60px"></el-table-column>
<el-table-column prop="userName" label="姓名"></el-table-column>
<el-table-column prop="loginName" label="工号"></el-table-column>
<el-table-column prop="sex" label="性别"></el-table-column>
<el-table-column prop="unitName" label="单位"></el-table-column>
<el-table-column prop="mobile" label="手机号"></el-table-column>
<el-table-column label="操作" width="100px"
v-if="inApplyTime">
<template slot-scope="scope">
<el-button type="danger" size="mini" @click="removeTeamUser(scope.$index)">删除
</el-button>
</template>
</el-table-column>
</el-table>
</div>
<!-- 表单填写-->
@@ -243,6 +279,18 @@ const singleSignUp = {
})
},
//查询报名人员
listTeamUserUnion() {
this.$axios.post("/platform/activity/culture/applyUser/listTeamUserUnion", {activityId: this.id}).then((res) => {
if (res.code === 0) {
this.isSignUp = res.data.length > 0
this.teamUsers = res.data
this.defaultAddSelf()
this.customFormInit()
}
})
},
//表单回显
customFormInit() {
if (this.teamUsers && this.teamUsers.length > 0) {
@@ -300,14 +348,14 @@ const singleSignUp = {
//分工会
if (this.viewData.signUpMethod === 3) {
// if (this.teamUsers.length === 0) {
// this.$message.warning("请添加报名人员后再提交!")
// return
// }
// if (this.teamUsers.length > this.viewData.teamNum) {
// this.$message.warning("您选择的人数大于" + this.viewData.teamNum + "人,请重新选择!")
// return
// }
if (this.teamUsers.length === 0) {
this.$message.warning("请添加报名人员后再提交!")
return
}
if (this.teamUsers.length > this.viewData.teamNum) {
this.$message.warning("您选择的人数大于" + this.viewData.teamNum + "人,请重新选择!")
return
}
}
let formData = {
@@ -420,7 +468,10 @@ const singleSignUp = {
//查询队友信息
queryTeammate(val) {
if (val) {
this.$axios.post("/platform/activity/culture/applyUser/queryTeammate", {keyword: val}).then((res) => {
this.$axios.post("/platform/activity/culture/applyUser/queryTeammate", {
keyword: val,
signUpMethod: this.viewData.signUpMethod
}).then((res) => {
if (res.code === 0) {
res.data.map(v => v.applyUserId = this.$store.state.user.id)
this.teammateOptions = res.data
@@ -457,11 +508,18 @@ const singleSignUp = {
this.$axios.post("/platform/activity/culture/infoManage/activityInfo", {id: this.id}).then((res) => {
if (res.code === 0) {
this.viewData = res.data
if (this.viewData.signUpMethod === 3) {
const union = this.viewData.unionUserNumberLimit.find(v => v.id === this.$store.state.user.union.id)
this.viewData.teamNum = union.limitNum
this.listTeamUserUnion()
}else{
this.listTeamUser()
}
if (this.viewData.formConfig) {
this.formCreateRule = formCreate.parseJson(this.viewData.formConfig.rule)
this.formCreateOption = formCreate.parseJson(this.viewData.formConfig.options)
}
this.listTeamUser()
}
})
}
@@ -117,8 +117,8 @@ const ACTIVITY_CULTURE_USER_STATISTICS = {
{ prop: "loginName", label: "工号", width: 180, fixed: "left" },
{ prop: "sex", label: "性别", width: 70 },
{ prop: "mobile", label: "联系方式", width: 180 },
{ prop: "unitName", label: "所属单位", width: 200 },
{ prop: "unionName", label: "所属工会", width: 200 },
{ prop: "unitName", label: "所属单位", width: 200 },
{ prop: "applyDateTime", label: "报名时间", width: 180 },
{ prop: "applyUserUserName", label: "报名人", width: 180 }
],
@@ -56,6 +56,19 @@ layout("/layouts/platform.html"){
v-for="item in unionOptions"></el-option>
</el-select>
</search-item>
<search-item label="活动项目" v-if="unionLeaderCoach">
<el-select
@change="doSearch"
clearable
filterable
placeholder="请选择活动项目"
v-model="pageForm.eventId"
>
<el-option :key="item.eventId" :label="item.allName"
:value="item.eventId" v-for="item in eventList"></el-option>
</el-select>
</search-item>
</search>
</el-card>
@@ -136,45 +149,28 @@ layout("/layouts/platform.html"){
<el-card class="mt10" shadow="never">
<table-tool label="活动项目信息">
<div class="search-item-option">
<el-select
@change="doSearch"
clearable
filterable
placeholder="请选择组别"
style="width: 100%; margin-bottom: 5px; margin-left: 10px"
v-if="unionLeaderCoach"
v-model="pageForm.groupName"
>
<el-option :key="item.id" :label="item.name" :value="item.name"
v-for="item in groupList"></el-option>
</el-select>
</div>
<!-- <div class="search-item-option">
<el-select
@change="doSearch"
clearable
filterable
placeholder="请选择组别"
style="width: 100%; margin-bottom: 5px; margin-left: 10px"
v-if="unionLeaderCoach"
v-model="pageForm.groupName"
>
<el-option :key="item.id" :label="item.name" :value="item.name"
v-for="item in groupList"></el-option>
</el-select>
</div>-->
<div class="search-item-option">
<el-select
@change="doSearch"
clearable
filterable
placeholder="请选择活动项目"
style="width: 100%; margin-bottom: 5px; margin-left: 10px"
v-if="unionLeaderCoach"
v-model="pageForm.eventId"
>
<el-option :key="item.eventId" :label="item.allName"
:value="item.eventId" v-for="item in eventList"></el-option>
</el-select>
</div>
<div class="mr10 ml20" v-if="unionLeaderCoach">
<div v-if="unionLeaderCoach">
领队:
<span style="color: #419bf8">{{leaderData.username?leaderData.username:'暂无'}}</span>
&emsp13; 教练:
<span
style="color: #419bf8">{{coachData.username ?coachData.username:'暂无'}}</span>
</div>
<div>
<el-button @click="openLeaderCoach" size="medium" type="primary"
v-if="unionLeaderCoach">设置领队/教练
<span style="color: #419bf8">{{coachData.username ?coachData.username:'暂无'}}</span>
<el-button @click="openLeaderCoach" size="medium" type="primary">设置领队/教练
</el-button>
</div>
</table-tool>
@@ -418,9 +418,10 @@ layout("/layouts/platform.html"){
return v.id === this.pageForm.id
})
await this.getEventsByActivityId()
this.pageForm.activityName = activity.length > 0 ? activity[0].name : null
this.pageForm.applyType = activity[0].applyType
if (activity.length>0){
this.pageForm.activityName = activity.length > 0 ? activity[0].name : null
this.pageForm.applyType = activity[0].applyType
}
const resp = await this.$axios.post(loc() + "/pageData", this.pageForm)
this.tabLoading = false
if (resp.code === 0) {