体育活动
This commit is contained in:
@@ -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>
|
||||
|
||||
|
||||
@@ -210,8 +210,9 @@ const ACTIVITY_CULTURE_AUDIT_ACTIVITY = {
|
||||
}
|
||||
},
|
||||
openAudit(row) {
|
||||
this.$refs.guava.edit()
|
||||
this.$refs.editInfo.findOne(row.id)
|
||||
this.$refs.guava.edit(()=>{
|
||||
this.$refs.editInfo.findOne(row.id)
|
||||
})
|
||||
this.formData = {
|
||||
id: row.id,
|
||||
username: this.$store.state.user.username,
|
||||
@@ -220,8 +221,9 @@ const ACTIVITY_CULTURE_AUDIT_ACTIVITY = {
|
||||
},
|
||||
openView(row) {
|
||||
const { id } = row
|
||||
this.$refs.guava.view()
|
||||
this.$refs.infoActivity.findOne(id)
|
||||
this.$refs.guava.view(()=>{
|
||||
this.$refs.infoActivity.findOne(id)
|
||||
})
|
||||
},
|
||||
pageData() {
|
||||
this.tableLoading = true
|
||||
|
||||
@@ -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="是否用于报名">
|
||||
|
||||
@@ -42,8 +42,8 @@ const singleSignUp = {
|
||||
</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,47 @@ const singleSignUp = {
|
||||
</div>
|
||||
<!-- 分工会报名-->
|
||||
<div v-else-if="viewData.signUpMethod===3">
|
||||
<div class="process-title">选择报名人员
|
||||
<span v-if="viewData.userNumberLimit===2">
|
||||
,报名人数 <span style="color: red">
|
||||
{{viewData.unionTeamNum}}</span>人
|
||||
</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>
|
||||
|
||||
<!-- 表单填写-->
|
||||
@@ -242,6 +282,17 @@ 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() {
|
||||
@@ -300,14 +351,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.viewData.teamNum && this.teamUsers.length > this.viewData.teamNum) {
|
||||
this.$message.warning("您选择的人数大于" + this.viewData.teamNum + "人,请重新选择!")
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
let formData = {
|
||||
@@ -368,7 +419,7 @@ const singleSignUp = {
|
||||
this.$message.warning("请添加报名人员后再提交!")
|
||||
return
|
||||
}
|
||||
if (this.teamUsers.length > this.viewData.teamNum) {
|
||||
if (this.viewData.teamNum && this.teamUsers.length > this.viewData.teamNum) {
|
||||
this.$message.warning("您选择的人数大于" + this.viewData.teamNum + "人,请重新选择!")
|
||||
return
|
||||
}
|
||||
@@ -420,7 +471,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
|
||||
@@ -439,7 +493,7 @@ const singleSignUp = {
|
||||
this.$message.error("请勿重复添加")
|
||||
return
|
||||
}
|
||||
if (this.teamUsers.length >= this.viewData.teamNum) {
|
||||
if (this.viewData.teamNum && this.teamUsers.length >= this.viewData.teamNum) {
|
||||
this.$message.error("已满员")
|
||||
return
|
||||
}
|
||||
@@ -457,11 +511,22 @@ 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.userNumberLimit === 1) {
|
||||
} else if (this.viewData.userNumberLimit === 2) {
|
||||
//分工会人数限制
|
||||
const union = this.viewData.unionUserNumberLimit.find(v => v.id === this.$store.state.user.union.id)
|
||||
this.viewData.unionTeamNum = union.limitNum
|
||||
}
|
||||
if (this.viewData.signUpMethod === 3) {
|
||||
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()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -90,6 +90,17 @@ var ACTIVITY_SPORTS_APPLY_USER = {
|
||||
{{activityTableData.athleteMaxNum-applyUserTableData.filter(v=>v.identity.includes('1')).length}}人;
|
||||
替补还可以报{{activityTableData.substituteNum-applyUserTableData.filter(v=>v.identity.includes('5')).length}}人(非必需)】
|
||||
</el-divider>
|
||||
<div style="padding-left: 10px">
|
||||
<el-tooltip class="item"
|
||||
content="系统中查询不到的人可以点击添加"
|
||||
effect="dark"
|
||||
placement="top">
|
||||
<el-button
|
||||
:disabled="(activityTableData.restrictMaxNum-applyUserTableData.length)<=0"
|
||||
@click="openAddUser" circle icon="el-icon-plus"
|
||||
type="danger"></el-button>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
</div>
|
||||
<el-button @click="setUserRole('4')"
|
||||
icon="el-icon-check"
|
||||
@@ -229,6 +240,89 @@ var ACTIVITY_SPORTS_APPLY_USER = {
|
||||
</el-card>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
<el-dialog
|
||||
:append-to-body="true"
|
||||
:visible.sync="addUserDialogVisible"
|
||||
title="添加人员"
|
||||
width="40%"
|
||||
>
|
||||
<el-form :model="formData" label-width="100px" ref="lsryform">
|
||||
<el-form-item label="所在队伍" prop="teamId"
|
||||
:rules="{required: true, message: '请选择所在队伍', trigger: 'blur'}">
|
||||
<el-select clearable disabled placeholder="请选择所在队伍" style="width: 100%"
|
||||
v-model="formData.teamId">
|
||||
<el-option
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
v-for="item in teamList">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="姓名" prop="userId" :rules="{required: true, message: '请输入工号或者姓名查询', trigger: 'blur'}">
|
||||
<el-select
|
||||
:remote-method="querySearchAsync"
|
||||
@change="addUserChange"
|
||||
filterable
|
||||
placeholder="请输入工号或者下姓名查询"
|
||||
remote
|
||||
reserve-keyword
|
||||
style="width: 100%"
|
||||
v-model="formData.userId">
|
||||
<el-option
|
||||
:key="item.id"
|
||||
:label="item.username+'-'+item.loginname"
|
||||
:value="item.id"
|
||||
v-for="item in lsUserList">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="工号" prop="loginname" :rules="{required: true, message: '请填写工号', trigger: 'blur'}">
|
||||
<el-input disabled maxlength="50" placeholder="请填写工号"
|
||||
type="text" v-model="formData.loginname"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="性别" prop="sex" :rules="{required: true, message: '性别', trigger: 'blur'}">
|
||||
<el-radio-group v-model="formData.sex">
|
||||
<el-radio :label="'男'" border>男</el-radio>
|
||||
<el-radio :label="'女'" border>女</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="出生年月" prop="birthday" :rules="{required: true, message: '选择出生年月', trigger: 'blur'}">
|
||||
<el-date-picker
|
||||
style="width: 100%"
|
||||
v-model="formData.birthday"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="选择出生年月">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="电话" prop="mobile">
|
||||
<el-input maxlength="50" placeholder="请填写电话" type="text"
|
||||
v-model="formData.mobile"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="身份证号" prop="idcard">
|
||||
<el-input maxlength="30" placeholder="请填写身份证号" type="text"
|
||||
v-model="formData.idcard"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="所在单位" prop="unitId" :rules="{required: true, message: '请选择所在单位', trigger: 'blur'}">
|
||||
<el-select clearable filterable placeholder="请选择所在单位" style="width: 100%"
|
||||
v-model="formData.unitId">
|
||||
<el-option
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
v-for="item in unitOptions">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<span class="dialog-footer" slot="footer">
|
||||
<el-button @click="addUserDialogVisible = false">取 消</el-button>
|
||||
<el-button @click="doAddUser" type="primary">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
`,
|
||||
store,
|
||||
@@ -253,10 +347,104 @@ var ACTIVITY_SPORTS_APPLY_USER = {
|
||||
applyUserTabLoading: false,
|
||||
selection: [],
|
||||
//全部可报名的人员
|
||||
userList: []
|
||||
userList: [],
|
||||
|
||||
addUserDialogVisible: false,
|
||||
lsUserList:[],
|
||||
unitOptions:[]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
doAddUser(){
|
||||
this.$refs["lsryform"].validate(async (valid) => {
|
||||
if (valid) {
|
||||
const birthDate = moment(this.formData.birthday);
|
||||
const age = this.$moment().diff(birthDate, 'years');
|
||||
const data = {
|
||||
isAddUser: true,
|
||||
age: age,
|
||||
unitname: this.unitOptions.find(x => x.id === this.formData.unitId).name,
|
||||
...this.formData
|
||||
}
|
||||
//如果添加的人不在数据库
|
||||
const user = this.lsUserList.find(l => l.id === this.formData.userId)
|
||||
if (!user) {
|
||||
const newUser = this.leftApplyUserList.find(a => a.id === this.formData.userId)
|
||||
if (newUser) {
|
||||
this.notifyWarning('该用户已存在左侧选择框内,请从左侧选择框内选择!')
|
||||
return
|
||||
}
|
||||
}
|
||||
this.applyUserList.push(data)
|
||||
this.flushApplyUser(this.applyUserList)
|
||||
this.sortApplyUserTableData()
|
||||
|
||||
this.$notify.success({title: '成功', message: '已添加'});
|
||||
this.addUserDialogVisible = false
|
||||
} else {
|
||||
this.$notify.error({title: '错误', message: '存在未填写的的必填项'});
|
||||
}
|
||||
})
|
||||
},
|
||||
async addUserChange(val) {
|
||||
const user = this.lsUserList.find(l => l.id === val)
|
||||
/* let loginname = "GHLS" + moment().format('YYYY') + "001"
|
||||
//如果数据库找不到此人
|
||||
if (!user) {
|
||||
const lsryUser = await this.getGhLsRy()
|
||||
//如果有临时人员
|
||||
if (lsryUser) {
|
||||
let str = lsryUser.loginname;
|
||||
let prefix = "GHLS";
|
||||
// 找到"GHLS"在字符串中首次出现的位置
|
||||
let index = str.indexOf(prefix);
|
||||
// 如果"GHLS"确实存在于字符串中,并且不是在字符串开头
|
||||
if (index !== -1 && index + prefix.length < str.length) {
|
||||
loginname = prefix + (Number(str.slice(index + prefix.length)) + 1);
|
||||
}
|
||||
|
||||
}
|
||||
}*/
|
||||
this.$set(this.formData, 'eventId', this.eventData.eventId)
|
||||
this.$set(this.formData, 'activityId', this.activityTableData.activityId)
|
||||
this.$set(this.formData, 'team', this.applyFromData.teamName)
|
||||
this.$set(this.formData, 'teamId', this.applyFromData.teamId)
|
||||
this.$set(this.formData, 'userId', user ? user.id : null)
|
||||
this.$set(this.formData, 'loginname', user ? user.loginname : null)
|
||||
this.$set(this.formData, 'username', user ? user.username : null)
|
||||
this.$set(this.formData, 'unitId', user ? user.unitId : null)
|
||||
this.$set(this.formData, 'sex', user ? user.sex : null)
|
||||
this.$set(this.formData, 'idcard', user ? user.idCard : null)
|
||||
this.$set(this.formData, 'mobile', user ? user.mobile : null)
|
||||
this.$set(this.formData, 'birthday', user ? user.birthday : null)
|
||||
this.$set(this.formData, 'awardsMode', this.activityTableData.eveProjectType)
|
||||
this.$set(this.formData, 'status', 2)
|
||||
},
|
||||
async querySearchAsync(queryString) {
|
||||
const leftApplyUserList = this.leftApplyUserList.map(m => m.loginname)
|
||||
const rightApplyUserList = this.rightApplyUserList.map(m => m.loginname)
|
||||
const loginnames = leftApplyUserList.concat(rightApplyUserList)
|
||||
const {code, data} = await $.get("/platform/activity/apply/getSysUser", {
|
||||
loginnames: JSON.stringify(loginnames),
|
||||
queryString: queryString
|
||||
})
|
||||
if (code === 0) {
|
||||
this.lsUserList = data
|
||||
} else {
|
||||
this.lsUserList = []
|
||||
}
|
||||
},
|
||||
openAddUser() {
|
||||
this.formData = {
|
||||
teamName: this.applyFromData.teamName,
|
||||
teamId: this.applyFromData.teamId,
|
||||
identity: ['1']
|
||||
}
|
||||
this.addUserDialogVisible = true
|
||||
if (this.$refs['lsryform']) {
|
||||
this.$refs['lsryform'].resetFields()
|
||||
}
|
||||
},
|
||||
async openUniteApply(data) {
|
||||
this.activityTableData = data
|
||||
//固定模式
|
||||
@@ -299,7 +487,7 @@ 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} = resp.data
|
||||
this.activityData = activity
|
||||
this.eventData = getEvent
|
||||
this.teamList = team
|
||||
@@ -332,7 +520,16 @@ var ACTIVITY_SPORTS_APPLY_USER = {
|
||||
let message = null
|
||||
|
||||
if (flag) {
|
||||
const { athletesMaxNum, restrictGirlNum, restrictBoyNum, leanderNum, coachNum, deputyDirectorNum, substituteNum, projectType } =
|
||||
const {
|
||||
athletesMaxNum,
|
||||
restrictGirlNum,
|
||||
restrictBoyNum,
|
||||
leanderNum,
|
||||
coachNum,
|
||||
deputyDirectorNum,
|
||||
substituteNum,
|
||||
projectType
|
||||
} =
|
||||
this.eventData
|
||||
|
||||
const applyUserList = clone(this.applyUserList)
|
||||
@@ -388,7 +585,7 @@ var ACTIVITY_SPORTS_APPLY_USER = {
|
||||
message = teamName + "女运动员至少设置" + restrictGirlNum + "人"
|
||||
break
|
||||
}
|
||||
const manYdyNum = teamApplyData[i].filter((v) => v.sex === "女" && v.identity.includes("1")).length
|
||||
const manYdyNum = teamApplyData[i].filter((v) => v.sex === "男" && v.identity.includes("1")).length
|
||||
if (restrictBoyNum > 0 && manYdyNum < restrictBoyNum) {
|
||||
msgFlag = false
|
||||
message = teamName + "男运动员至少设置" + restrictBoyNum + "人"
|
||||
@@ -397,7 +594,7 @@ var ACTIVITY_SPORTS_APPLY_USER = {
|
||||
}
|
||||
}
|
||||
if (!msgFlag && !this.activityTableData.isLeader) {
|
||||
this.$notify.warning({ title: "警告", message: message })
|
||||
this.$notify.warning({title: "警告", message: message})
|
||||
return
|
||||
}
|
||||
}
|
||||
@@ -406,7 +603,7 @@ var ACTIVITY_SPORTS_APPLY_USER = {
|
||||
if (!flag) {
|
||||
msg = "确定要保存吗?"
|
||||
}
|
||||
const confirm = await this.$confirm(msg, "提示", { type: "warning" })
|
||||
const confirm = await this.$confirm(msg, "提示", {type: "warning"})
|
||||
if (confirm === "confirm") {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
@@ -432,10 +629,10 @@ var ACTIVITY_SPORTS_APPLY_USER = {
|
||||
},
|
||||
//点击添加运动员操作
|
||||
async applyUser() {
|
||||
const { isManGirlNum, restrictGirlNum, restrictBoyNum } = this.eventData
|
||||
const {isManGirlNum, restrictGirlNum, restrictBoyNum} = this.eventData
|
||||
|
||||
if (!this.rightApplyUserList.length) {
|
||||
this.$notify.warning({ title: "警告", message: "请在右侧列表中选择人员" })
|
||||
this.$notify.warning({title: "警告", message: "请在右侧列表中选择人员"})
|
||||
return
|
||||
}
|
||||
|
||||
@@ -492,7 +689,7 @@ var ACTIVITY_SPORTS_APPLY_USER = {
|
||||
}
|
||||
}
|
||||
|
||||
const resp = await this.$axios.post(loc() + "/getActivityData", { activityId: this.activityData.id })
|
||||
const resp = await this.$axios.post(loc() + "/getActivityData", {activityId: this.activityData.id})
|
||||
const aa = resp.data.filter((v) => {
|
||||
return this.rightApplyUserList.includes(v.userId)
|
||||
})
|
||||
@@ -586,7 +783,7 @@ var ACTIVITY_SPORTS_APPLY_USER = {
|
||||
this.$refs.multipleTable.clearSelection()
|
||||
},
|
||||
changeTeam(command) {
|
||||
const { item } = command
|
||||
const {item} = command
|
||||
if (!this.selection.length) {
|
||||
this.$notify({
|
||||
title: "警告",
|
||||
@@ -616,7 +813,7 @@ var ACTIVITY_SPORTS_APPLY_USER = {
|
||||
this.$refs.multipleTable.clearSelection()
|
||||
},
|
||||
async findUserOne(id) {
|
||||
const { data } = await this.$axios.post(loc() + "/findUserOne", { id })
|
||||
const {data} = await this.$axios.post(loc() + "/findUserOne", {id})
|
||||
return data
|
||||
},
|
||||
async delApplyUser(index, row, num) {
|
||||
@@ -666,6 +863,7 @@ var ACTIVITY_SPORTS_APPLY_USER = {
|
||||
getTransProp(user) {
|
||||
return {
|
||||
id: user.id,
|
||||
loginname: user.loginname,
|
||||
name: user.username + "(" + (user.sex ? user.sex : "") + "-" + user.loginname + ")"
|
||||
}
|
||||
},
|
||||
@@ -681,5 +879,8 @@ var ACTIVITY_SPORTS_APPLY_USER = {
|
||||
this.userList = []
|
||||
}
|
||||
},
|
||||
async created() {}
|
||||
async created() {
|
||||
this.unitOptions = await this.$businessTool.listUnit()
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -261,7 +261,7 @@ layout("/layouts/platform.html"){
|
||||
</template>
|
||||
|
||||
<template #public>
|
||||
<activity-sports-delete-user @flip="flip"
|
||||
<activity-sports-delete-user @flush="doSearch"
|
||||
ref="activityDeleteUser"></activity-sports-delete-user>
|
||||
</template>
|
||||
</guava>
|
||||
|
||||
@@ -270,7 +270,7 @@ let ACTIVITY_SPORTS_ADD_ACTIVITY = {
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item prop="files" label="封面图" v-if="formData.applyWay.includes(1)">
|
||||
<el-form-item prop="files" label="封面图" >
|
||||
<file-upload
|
||||
:value.sync="formData.image"
|
||||
:upload_number="1"
|
||||
|
||||
@@ -146,6 +146,7 @@ layout("/layouts/platform.html"){
|
||||
.then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
this.$store.dispatch("pjaxRoute", "/platform/warmthCondolence/mine")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
+2
-2
@@ -129,13 +129,13 @@ layout("/layouts/platform.html"){
|
||||
}
|
||||
})
|
||||
},
|
||||
doDelete(id) {
|
||||
doDelete(row) {
|
||||
this.$confirm("您确定要删除吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.$axios.post("/platform/warmthCondolenceNotice/delete", { id: id }).then((res) => {
|
||||
this.$axios.post("/platform/warmthCondolenceNotice/delete", { id: row.id }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
this.doSearch()
|
||||
|
||||
@@ -191,8 +191,8 @@ layout("/layouts/platform_h5.html"){
|
||||
<van-icon name="location-o"></van-icon>
|
||||
报名方式:
|
||||
<span v-if="viewData.signUpMethod===1" style="color: var(--color-primary)">个人报名</span>
|
||||
<span v-if="viewData.signUpMethod===2" style="color: var(--color-primary)">分工会报名</span>
|
||||
<span v-if="viewData.signUpMethod===3" style="color: var(--color-primary)">组队报名</span>
|
||||
<span v-if="viewData.signUpMethod===2" style="color: var(--color-primary)">组队报名</span>
|
||||
<span v-if="viewData.signUpMethod===3" style="color: var(--color-primary)">分工会报名</span>
|
||||
</div>
|
||||
<div class="info-item" v-if="viewData.signUpMethod==3">
|
||||
<van-icon name="location-o"></van-icon>
|
||||
@@ -277,6 +277,51 @@ layout("/layouts/platform_h5.html"){
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 分工会报名-->
|
||||
<div v-else-if="viewData.signUpMethod===3" class="block">
|
||||
<div class="notice-title left-tag-title">选择报名人员
|
||||
<span v-if="viewData.userNumberLimit===2">
|
||||
,报名人数 <span style="color: red">
|
||||
{{viewData.unionTeamNum}}</span>人
|
||||
</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>
|
||||
|
||||
<div class="form-create-h5" v-if="isCustomForm">
|
||||
<div class="notice-title left-tag-title">填写报名信息</div>
|
||||
<form-create :value.sync="dynamicFormData" v-model="fapi" :rule="formCreateRule"
|
||||
@@ -362,11 +407,22 @@ layout("/layouts/platform_h5.html"){
|
||||
this.$axios.post("/platform/activity/culture/infoManage/activityInfo", {id: this.id}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.viewData = res.data
|
||||
//总人数限制
|
||||
if (this.viewData.userNumberLimit === 1) {
|
||||
} else if (this.viewData.userNumberLimit === 2) {
|
||||
//分工会人数限制
|
||||
const union = this.viewData.unionUserNumberLimit.find(v => v.id === this.$store.state.user.union.id)
|
||||
this.viewData.unionTeamNum = union.limitNum
|
||||
}
|
||||
if (this.viewData.signUpMethod === 3) {
|
||||
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()
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -382,6 +438,17 @@ layout("/layouts/platform_h5.html"){
|
||||
}
|
||||
})
|
||||
},
|
||||
//查询报名人员
|
||||
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) {
|
||||
@@ -467,7 +534,7 @@ layout("/layouts/platform_h5.html"){
|
||||
})
|
||||
return
|
||||
}
|
||||
if (this.teamUsers.length > this.viewData.teamNum) {
|
||||
if (this.viewData.teamNum && this.teamUsers.length > this.viewData.teamNum) {
|
||||
this.$dialog
|
||||
.alert({
|
||||
title: "提示",
|
||||
@@ -499,7 +566,11 @@ layout("/layouts/platform_h5.html"){
|
||||
this.$axios.post("/platform/activity/culture/applyUser/signUp", formData).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$toast.success(res.msg)
|
||||
this.listTeamUser()
|
||||
if (this.viewData.signUpMethod === 3) {
|
||||
this.listTeamUserUnion()
|
||||
} else {
|
||||
this.listTeamUser()
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
@@ -568,7 +639,7 @@ layout("/layouts/platform_h5.html"){
|
||||
})
|
||||
return
|
||||
}
|
||||
if (this.teamUsers.length > this.viewData.teamNum) {
|
||||
if (this.viewData.teamNum && this.teamUsers.length > this.viewData.teamNum) {
|
||||
this.$dialog
|
||||
.alert({
|
||||
title: "提示",
|
||||
@@ -601,7 +672,11 @@ layout("/layouts/platform_h5.html"){
|
||||
this.$axios.post("/platform/activity/culture/applyUser/signUp", formData).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$toast.success(res.msg)
|
||||
this.listTeamUser()
|
||||
if (this.viewData.signUpMethod === 3) {
|
||||
this.listTeamUserUnion()
|
||||
} else {
|
||||
this.listTeamUser()
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
@@ -618,7 +693,11 @@ layout("/layouts/platform_h5.html"){
|
||||
this.$axios.post("/platform/activity/culture/applyUser/cancelSignUp", {activityId: this.id}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$toast.success(res.msg)
|
||||
this.listTeamUser()
|
||||
if (this.viewData.signUpMethod === 3) {
|
||||
this.listTeamUserUnion()
|
||||
} else {
|
||||
this.listTeamUser()
|
||||
}
|
||||
this.fapi.resetFields()
|
||||
}
|
||||
})
|
||||
@@ -628,7 +707,10 @@ layout("/layouts/platform_h5.html"){
|
||||
//查询队友信息
|
||||
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
|
||||
@@ -663,7 +745,7 @@ layout("/layouts/platform_h5.html"){
|
||||
})
|
||||
return
|
||||
}
|
||||
if (this.teamUsers.length >= this.viewData.teamNum) {
|
||||
if (this.viewData.teamNum && this.teamUsers.length >= this.viewData.teamNum) {
|
||||
this.$dialog
|
||||
.alert({
|
||||
title: "提示",
|
||||
|
||||
@@ -8,7 +8,8 @@ layout("/layouts/platform_h5.html"){
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<van-nav-bar title="活动列表" @click-left="()=>this.$pjaxReplace('/platform/home')" left-arrow left-text="返回" placeholder fixed></van-nav-bar>
|
||||
<van-nav-bar title="活动列表" @click-left="()=>this.$pjaxReplace('/platform/home')" left-arrow left-text="返回"
|
||||
placeholder fixed></van-nav-bar>
|
||||
<van-sticky offset-top="46px">
|
||||
<van-dropdown-menu>
|
||||
<year-van-dropdown-item :num="5" @change="pageData" v-model="pageForm.year"></year-van-dropdown-item>
|
||||
@@ -81,10 +82,11 @@ layout("/layouts/platform_h5.html"){
|
||||
|
||||
<script>
|
||||
<!--#include("eventNotification.js"){}#-->
|
||||
new Vue({
|
||||
const vue = new Vue({
|
||||
el: "#app",
|
||||
data() {
|
||||
return {
|
||||
activityId: GetQueryString("activityId"),
|
||||
tableData: [],
|
||||
finished: false,
|
||||
loading: false,
|
||||
@@ -119,18 +121,20 @@ layout("/layouts/platform_h5.html"){
|
||||
this.viewData = row
|
||||
this.$refs.eventNotification.viewShow = true
|
||||
},
|
||||
pageData() {
|
||||
async pageData() {
|
||||
this.loading = true
|
||||
this.$axios.post("/platform/h5/activity/apply/activityData", this.pageForm).then((res) => {
|
||||
this.tableData = res.data
|
||||
|
||||
this.finished = true
|
||||
this.loading = false
|
||||
})
|
||||
const res = await this.$axios.post("/platform/h5/activity/apply/activityData", this.pageForm)
|
||||
this.tableData = res.data
|
||||
this.finished = true
|
||||
this.loading = false
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.pageData()
|
||||
async created() {
|
||||
await this.pageData()
|
||||
if (this.activityId) {
|
||||
const activity = this.tableData.find(v => v.id === this.activityId)
|
||||
this.openView(activity)
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -5,16 +5,17 @@ layout("/layouts/platform_h5.html"){
|
||||
<div id="app" v-cloak>
|
||||
<van-sticky>
|
||||
<van-nav-bar
|
||||
@click-left="()=>this.$pjaxReplace('/platform/h5/activity/apply/applyUser')"
|
||||
left-arrow
|
||||
left-text="返回"
|
||||
placeholder
|
||||
title="项目列表"
|
||||
@click-left="()=>this.$pjaxReplace('/platform/h5/activity/apply/applyUser')"
|
||||
left-arrow
|
||||
left-text="返回"
|
||||
placeholder
|
||||
title="项目列表"
|
||||
></van-nav-bar>
|
||||
</van-sticky>
|
||||
|
||||
<div>
|
||||
<van-list :finished="finished" @load="pageData" finished-text="没有更多了" v-if="tableData.length>0" v-model="loading">
|
||||
<van-list :finished="finished" @load="pageData" finished-text="没有更多了" v-if="tableData.length>0"
|
||||
v-model="loading">
|
||||
<div class="table-list">
|
||||
<div :key="row.id" class="table-card" v-for="row in tableData">
|
||||
<van-image :src="row.image" fit="cover" height="200" v-if="row.image" width="100%"></van-image>
|
||||
@@ -25,11 +26,16 @@ layout("/layouts/platform_h5.html"){
|
||||
</div>
|
||||
</template>
|
||||
<template #right-icon>
|
||||
<div style="display: flex; justify-content: flex-end" v-if="row.status">
|
||||
<div style="display: flex; justify-content: flex-end" v-if="row.status&&row.applyWay.length===1&&row.applyWay.includes(1)">
|
||||
<van-tag type="primary" v-if="row.status===1">待审核</van-tag>
|
||||
<van-tag type="success" v-if="row.status===2">已成功报名</van-tag>
|
||||
<van-tag type="danger" v-if="row.status===3">审核不通过</van-tag>
|
||||
</div>
|
||||
<div style="display: flex; justify-content: flex-end" v-else>
|
||||
<van-tag type="primary" v-if="row.status2===0">待审核</van-tag>
|
||||
<van-tag type="success" v-if="row.status2===2">已成功报名</van-tag>
|
||||
<van-tag type="danger" v-if="row.status2===3">审核不通过</van-tag>
|
||||
</div>
|
||||
</template>
|
||||
</van-cell>
|
||||
<van-cell title="可报队数" v-if="row.eveProjectType==='2'">
|
||||
@@ -54,31 +60,54 @@ layout("/layouts/platform_h5.html"){
|
||||
<span v-else>0人</span>
|
||||
</template>
|
||||
</van-cell>
|
||||
<van-cell title="已报名人员" v-if="JSON.parse(row.applyWay).length===1">
|
||||
<van-cell title="已报名人员"
|
||||
v-if="row.userApplyNames&&row.applyWay.length===1&&row.applyWay.includes(1)">
|
||||
<template #right-icon>
|
||||
<span @click="openApplyUser(row)" v-if="row.userApplyNames">{{ row.userApplyNames}}</span>
|
||||
<span v-else>暂无</span>
|
||||
</template>
|
||||
</van-cell>
|
||||
<!--<van-cell class="table-card-footer">
|
||||
<template>
|
||||
<van-button :loading="subLoading" @click="openView(row)" round
|
||||
<van-cell class="table-card-footer">
|
||||
<div v-if="row.applyWay.length===1&&row.applyWay.includes(1)">
|
||||
<van-button :loading="subLoading" @click="signUpUser(row)" round
|
||||
size="small"
|
||||
type="primary">
|
||||
报名
|
||||
type="primary" v-if="activityData.applyWay.includes(1)&&row.userApply===0">
|
||||
报 名
|
||||
</van-button>
|
||||
</template>
|
||||
</van-cell>-->
|
||||
<van-button :loading="subLoading" @click="cancelApply(row)" round
|
||||
size="small"
|
||||
color="#dd6363"
|
||||
type="primary" v-if="activityData.applyWay.includes(1)&&row.userApply>0">
|
||||
取消报名
|
||||
</van-button>
|
||||
</div>
|
||||
<div>
|
||||
<van-button :loading="subLoading" @click="signUpUser(row)" round
|
||||
size="small"
|
||||
type="primary" v-if="activityData.applyWay.includes(1)&&row.userApply2===0">
|
||||
报 名
|
||||
</van-button>
|
||||
<van-button :loading="subLoading" @click="cancelApply(row)" round
|
||||
size="small"
|
||||
color="#dd6363"
|
||||
type="primary" v-if="activityData.applyWay.includes(1)&&row.userApply2>0">
|
||||
取消报名
|
||||
</van-button>
|
||||
</div>
|
||||
|
||||
</van-cell>
|
||||
</div>
|
||||
</div>
|
||||
</van-list>
|
||||
<van-empty image="/assets/platform/plugins/vant-green/images/nodata/nodata.png" description="暂无数据" v-else></van-empty>
|
||||
<van-empty image="/assets/platform/plugins/vant-green/images/nodata/nodata.png" description="暂无数据"
|
||||
v-else></van-empty>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
new Vue({
|
||||
const vue = new Vue({
|
||||
el: "#app",
|
||||
store,
|
||||
data() {
|
||||
return {
|
||||
tableData: [],
|
||||
@@ -90,16 +119,75 @@ layout("/layouts/platform_h5.html"){
|
||||
pageSize: 5,
|
||||
totalCount: 0
|
||||
},
|
||||
subLoading: false
|
||||
subLoading: false,
|
||||
activityData: {}
|
||||
}
|
||||
},
|
||||
components: {},
|
||||
methods: {
|
||||
openApplyUser() {},
|
||||
openView(row) {},
|
||||
openApplyUser() {
|
||||
},
|
||||
cancelApply(row) {
|
||||
this.$dialog.confirm({
|
||||
title: "提示",
|
||||
message: "确认要取消报名吗?"
|
||||
}).then(() => {
|
||||
if (row.applyUser !== this.$store.state.user.id) {
|
||||
this.$dialog.alert({
|
||||
title: '温馨提示',
|
||||
message: "报名人不是您,请联系报名人取消!",
|
||||
}).then(() => {
|
||||
})
|
||||
return;
|
||||
}
|
||||
this.$axios.post("/platform/h5/activity/apply/cancelApply", {
|
||||
activityId: row.activityId,
|
||||
eventId: row.eventId,
|
||||
schoolEventId: row.id
|
||||
}).then(resp => {
|
||||
if (resp.code === 0) {
|
||||
this.doSearch()
|
||||
this.$dialog.alert({
|
||||
title: '温馨提示',
|
||||
message: resp.msg,
|
||||
}).then(() => {
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
signUpUser(row) {
|
||||
this.$dialog.confirm({
|
||||
title: "提示",
|
||||
message: "确认要报名吗?"
|
||||
}).then(async () => {
|
||||
const teamList = await this.listTeamList(row)
|
||||
if (teamList.length > 0 ) {
|
||||
row.teamId = teamList[0].id
|
||||
}
|
||||
this.$axios.post("/platform/h5/activity/apply/signUpUser", {
|
||||
activityId: row.activityId,
|
||||
teamId: row.teamId,
|
||||
eventId: row.eventId,
|
||||
schoolEventId: row.id
|
||||
}).then(resp => {
|
||||
if (resp.code === 0) {
|
||||
this.doSearch()
|
||||
this.$dialog.alert({
|
||||
title: '温馨提示',
|
||||
message: resp.msg,
|
||||
}).then(() => {
|
||||
// on close
|
||||
});
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
openView(row) {
|
||||
},
|
||||
pageData() {
|
||||
this.loading = true
|
||||
this.$axios.post("/platform/h5/activity/apply/pageData", { data: JSON.stringify(this.pageForm) }).then((res) => {
|
||||
this.$axios.post("/platform/h5/activity/apply/pageData", {data: JSON.stringify(this.pageForm)}).then((res) => {
|
||||
this.tableData = this.tableData.concat(res.data.list)
|
||||
if (this.tableData.length === res.data.totalCount) {
|
||||
this.finished = true
|
||||
@@ -110,9 +198,25 @@ layout("/layouts/platform_h5.html"){
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
async listTeamList(row) {
|
||||
const resp = await this.$axios.post("/platform/h5/activity/apply/listTeamList", {
|
||||
activityId: row.activityId,
|
||||
eventId: row.eventId,
|
||||
})
|
||||
if (resp.code === 0) {
|
||||
return resp.data
|
||||
}
|
||||
},
|
||||
doSearch() {
|
||||
this.tableKey = new Date().getTime()
|
||||
this.pageForm.pageNumber = 1
|
||||
this.pageForm.totalCount = 0
|
||||
this.tableData = []
|
||||
this.pageData()
|
||||
},
|
||||
findOneActivity() {
|
||||
this.$axios.post("/platform/h5/activity/apply/findOneActivity", { activityId: this.pageForm.activityId }).then((res) => {
|
||||
if (res.code === 200) {
|
||||
this.$axios.post("/platform/h5/activity/apply/findOneActivity", {activityId: this.pageForm.activityId}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.activityData = res.data
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user