This commit is contained in:
2025-04-03 20:04:55 +08:00
parent 22163439a5
commit 8b845877d7
3 changed files with 253 additions and 66 deletions
@@ -14,6 +14,7 @@ import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.activity.models.*;
import io.v.nutz.zhgh.mobile.activity.Sports.service.MobileActivityApplyService;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.nutz.dao.Chain;
import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
@@ -63,6 +64,7 @@ public class mobileActivityListController {
@RequiresAuthentication
public Object doActivity(@Param(value = "activityId", required = false) String activityId,
@Param(value = "eventId", required = false) String eventId,
@Param(value = "applyUserSign", required = false) String applyUserSign,
@Param(value = "teamId", required = false) String teamId,
@Param(value = "teamName", required = false) String teamName) {
@@ -92,6 +94,7 @@ public class mobileActivityListController {
schoolApply.setLoginname(user.getLoginname());
schoolApply.setUsername(user.getUsername());
schoolApply.setBirthday(user.getBirthday());
schoolApply.setApplyUserSign(applyUserSign);
baseService.insert(schoolApply);
return null;
}
@@ -173,6 +176,7 @@ public class mobileActivityListController {
IF (sum(apply.`status`=2) IS NULL, 0, sum(apply.`status`=2)) AS successUserApply,
count(apply.id) userApply,
apply.applyUser,
apply.applyUserSign,
(SELECT ast.`name` FROM activity_school_apply app LEFT JOIN activity_school_team ast ON ast.id = app.teamId WHERE app.eventId = ase.eventId AND app.activityId = ase.activityId AND app.userId = @userId) activityTeamName,
(select GROUP_CONCAT(username) FROM activity_school_apply WHERE status=2 and eventId = ase.eventId
AND activityId = ase.activityId AND applyUser AND (applyUser=@userId or userId=@userId)) userApplyNames,
@@ -283,7 +287,8 @@ public class mobileActivityListController {
activityUnionName unionName,
activityUnionId unionId,
eventId,
applyUser
applyUser,
applyUserSign
FROM
activity_school_apply
$condition
@@ -302,5 +307,16 @@ public class mobileActivityListController {
return null;
}
@At
@ViReturn
@RequiresAuthentication
public Object doSign(String activityId, String eventId,String applyUserSign) {
mobileActivityApplyService.update(Chain.make("applyUserSign",applyUserSign),
Cnd.where("activityId", "=", activityId)
.and("eventId", "=", eventId)
.and("userId", "=", ShiroUtil.getUserId()));
return null;
}
}
@@ -100,15 +100,13 @@
<div v-html="viewData.precautions"></div>
</el-form-item>
</el-col>
</template>
<template v-if="viewData.applyWay.includes(3)">
<el-col :span="24">
<el-form-item label="活动通知 ">
<div v-html="viewData.eventNotification"></div>
</el-form-item>
</el-col>
</template>
</el-row>
</el-form>
</el-tab-pane>
@@ -89,20 +89,20 @@ layout("/mobile/platform.html"){
<span v-else>暂无</span>
</van-col>
</van-row>-->
<van-row class="info" v-if="o.restrictBoyNum>0">
<van-col span="24">
<span>最少报男运动员:</span>
<span>
{{o.restrictBoyNum}}人</span>
</van-col>
</van-row>
<van-row class="info" v-if="o.restrictGirlNum>0">
<van-col span="24">
<span>最少报女运动员:</span>
<span>
{{o.restrictGirlNum}}人</span>
</van-col>
</van-row>
<!-- <van-row class="info" v-if="o.restrictBoyNum>0">
<van-col span="24">
<span>最少报男运动员:</span>
<span>
{{o.restrictBoyNum}}人</span>
</van-col>
</van-row>
<van-row class="info" v-if="o.restrictGirlNum>0">
<van-col span="24">
<span>最少报女运动员:</span>
<span>
{{o.restrictGirlNum}}人</span>
</van-col>
</van-row>-->
<van-row class="info" v-if="o.projectType==2">
<van-col span="24">
@@ -133,14 +133,16 @@ layout("/mobile/platform.html"){
<van-row class="info">
<van-col span="24">
<span>已报名总人数:</span>
<span
v-if="o.successUserApply>0&&o.applyType!==3">{{ o.successUserApply }}人</span>
<span v-else-if="JSON.parse(o.applyWay).length===2&&o.applyWay.includes(1)">{{
o.totalApplyNum
}}人</span>
<span
v-else-if="o.totalApplyNum>0&&o.applyType===3">{{ o.totalApplyNum }}人</span>
<span v-else>0人</span>
<!-- <span
v-if="o.successUserApply>0&&o.applyType!==3">{{ o.successUserApply }}人</span>
<span v-else-if="JSON.parse(o.applyWay).length===2&&o.applyWay.includes(1)">{{
o.totalApplyNum
}}人</span>
<span
v-else-if="o.totalApplyNum>0&&o.applyType===3">{{ o.totalApplyNum }}人</span>
<span v-else>0人</span>-->
<span>{{o.totalApplyNum}}</span>
</van-col>
</van-row>
@@ -162,9 +164,18 @@ layout("/mobile/platform.html"){
<img v-if="o.userApply==0&&o.applyWay.includes(1)"
@click="openActivity(o)"
src="/assets/mobile/svg/activity/wbm.svg" />
<img v-if="o.userApply>0&&o.applyWay.includes(1)"
<img v-if="o.userApply>0&&o.applyWay.includes(1)&&o.applyUser===userId"
@click="openActivity(o)"
src="/assets/mobile/svg/activity/qxbm.svg" />
<van-button style="border-radius: 10px" block size="small"
type="info"
@click="openSign(o)"
v-if="o.userApply>0
&&o.applyWay.includes(1)
&&o.applyUser!==userId
&&o.isSign&&!o.applyUserSign">
签 字
</van-button>
</div>
</van-col>
</van-row>
@@ -188,6 +199,14 @@ layout("/mobile/platform.html"){
v-model="unitName"></van-field>
<van-field label="所属工会" readonly
v-model="unionName"></van-field>
<van-field label="签字" readonly v-if="activityData.isSign&&isView">
<template #input>
<van-image
:src="APP_DOMAIN + '/file_server/fileStreamPreview?id=' + formData.applyUserSign"
width="100" height="50" v-if="formData.applyUserSign"></van-image>
<span v-else>暂无</span>
</template>
</van-field>
</div>
<template
@@ -202,6 +221,15 @@ layout("/mobile/platform.html"){
<van-field label="性别" readonly v-model="item.sex"></van-field>
<van-field label="所在单位" readonly v-model="item.unitName"></van-field>
<van-field label="所属工会" readonly v-model="item.unionName"></van-field>
<van-field label="签字" readonly v-if="activityData.isSign&&isView">
<template #input>
<van-image
:src="APP_DOMAIN + '/file_server/fileStreamPreview?id=' + formData.applyUserSign"
width="100" height="50"></van-image>
<span v-else>暂无</span>
</template>
</van-field>
</div>
</template>
@@ -217,28 +245,36 @@ layout("/mobile/platform.html"){
签字
</div>
<div class="van-card-body">
<mobile-sign ref="signature" :my_sign.sync="applyUserSign"
<mobile-sign ref="signature" :my_sign.sync="formData.applyUserSign"
:is_value_base64="false"></mobile-sign>
</div>
</div>
<div style="margin: 20px 20px 10px 20px" v-if="!isView">
<van-button @click="openUserActionSheet" style="border-radius: 10px" block
type="info">
添加队友
</van-button>
</div>
<div style="display: flex;justify-content: center" v-if="!isView">
<van-radio-group v-model="formData.isCy" direction="horizontal" v-if="activityData.isSign">
<van-radio-group v-model="formData.isCy" direction="horizontal"
v-if="activityData.isSign">
<van-radio name="1"></van-radio>
<span style="color: red" @click="fxgzsActionPopup=true">自愿参赛责任及风险告知书</span>
<span style="color: red"
@click="fxgzsActionPopup=true">自愿参赛责任及风险告知书</span>
</van-radio-group>
</div>
<div style="margin: 20px 20px 10px 20px" v-if="!isView">
<van-button @click="doTeamSignUp()" style="border-radius: 10px" block
type="info">
提 交
</van-button>
<van-row gutter="20">
<van-col span="12">
<van-button @click="openUserActionSheet" style="border-radius: 10px" block
type="info">
添加队友
</van-button>
</van-col>
<van-col span="12">
<van-button @click="doTeamSignUp()" style="border-radius: 10px" block
type="info">
提 交
</van-button>
</van-col>
</van-row>
</div>
</van-action-sheet>
@@ -277,30 +313,103 @@ layout("/mobile/platform.html"){
</div>
<van-empty v-else image="search" description="请输入姓名或者工号搜索"></van-empty>
</van-action-sheet>
<van-action-sheet v-model="fxgzsActionPopup" title="自愿参赛责任及风险告知书">
<div v-html="activityData.precautions"></div>
</van-action-sheet>
<van-dialog
@confirm="doActivityConfirm"
show-cancel-button
title="您确定要报名此活动吗?"
v-model="activityDialog"
@cancel="activityDialog = false"
:before-close="onBeforeClose"
>
<van-radio-group v-model="formData.teamId" v-if="projectType==2">
<van-cell-group>
<template v-for="i in teams">
<van-cell :title="i.name" clickable>
<template #right-icon>
<van-radio :name="i.id"></van-radio>
</template>
</van-cell>
</template>
</van-cell-group>
</van-radio-group>
</van-dialog>
<van-action-sheet v-model="signActionPopup" title="签字">
<div class="van-card-header">
签字
</div>
<div class="van-card-body">
<mobile-sign ref="signature" :my_sign.sync="formData.applyUserSign"
:is_value_base64="false"></mobile-sign>
</div>
<div style="display: flex;justify-content: center;padding-bottom: 10px">
<van-radio-group v-model="formData.isCy" direction="horizontal">
<van-radio name="1"></van-radio>
<span style="color: red"
@click="fxgzsActionPopup=true">自愿参赛责任及风险告知书</span>
</van-radio-group>
</div>
<van-row gutter="20">
<van-col span="24">
<van-button @click="doSign()" style="border-radius: 10px" block
type="info">
提 交
</van-button>
</van-col>
</van-row>
</van-action-sheet>
<van-action-sheet v-model="activityDialog" :close-on-click-overlay="false"
:style="{ height: '100%',width:'100%' ,'overflow-y':'visible'}"
title="项目报名">
<div class="van-card-header">
本人信息
</div>
<div class="van-card-body">
<van-field label="姓名" readonly
v-model="userName"></van-field>
<van-field label="工号" readonly
v-model="loginName"></van-field>
<van-field label="性别" readonly v-model="sex"></van-field>
<van-field label="所在单位" readonly
v-model="unitName"></van-field>
<van-field label="所属工会" readonly
v-model="unionName"></van-field>
<van-radio-group v-model="formData.teamId" v-if="projectType==2">
<van-cell-group>
<template v-for="i in teams">
<van-cell :title="i.name" clickable>
<template #right-icon>
<van-radio :name="i.id"></van-radio>
</template>
</van-cell>
</template>
</van-cell-group>
</van-radio-group>
</div>
<div class="van-card-header">
签字
</div>
<div class="van-card-body">
<mobile-sign ref="signature" :my_sign.sync="formData.applyUserSign"
:is_value_base64="false"></mobile-sign>
</div>
<div style="display: flex;justify-content: center;padding-bottom: 10px">
<van-radio-group v-model="formData.isCy" direction="horizontal">
<van-radio name="1"></van-radio>
<span style="color: red"
@click="fxgzsActionPopup=true">自愿参赛责任及风险告知书</span>
</van-radio-group>
</div>
<van-row gutter="20">
<van-col span="24">
<van-button @click="doActivityConfirm()" style="border-radius: 10px" block
type="info">
提 交
</van-button>
</van-col>
</van-row>
</van-action-sheet>
<!-- <van-dialog
@confirm="doActivityConfirm"
show-cancel-button
title="您确定要报名此活动吗?"
v-model="activityDialog"
@cancel="activityDialog = false"
:before-close="onBeforeClose"
>
</van-dialog>-->
<van-empty v-if="mLoading==false&&tableData.length==0" class="custom-image" image="/none.svg"
description="暂无数据"></van-empty>
@@ -312,6 +421,7 @@ layout("/mobile/platform.html"){
mixins: [mobileMixins],
data() {
return {
userId: "${@shiro.getPrincipalProperty('id')}",
userName: "${@shiro.getPrincipalProperty('username')}",
loginName: "${@shiro.getPrincipalProperty('loginname')}",
sex: "${@shiro.getPrincipalProperty('sex')}",
@@ -365,20 +475,65 @@ layout("/mobile/platform.html"){
addRegisterList: [],
isView: false,
activityData: {},
applyUserSign: "",
fxgzsActionPopup:false,
fxgzsActionPopup: false,
signActionPopup: false
}
},
methods: {
doSign() {
if (this.activityData.isSign && !this.formData.applyUserSign) {
this.$dialog.alert({
title: "温馨提示",
message: "请签字后再提交!"
}).then(() => {
})
return
}
if (this.activityData.isSign && !this.formData.isCy) {
this.$dialog.alert({
title: "温馨提示",
message: "请先阅读自愿参赛责任及风险告知书!"
}).then(() => {
})
return
}
this.$dialog.confirm({
title: "提示",
message: "您确认要提交吗?"
}).then(() => {
$.post("/mobile/activity/Sports/list/doSign", {
applyUserSign: this.formData.applyUserSign,
activityId: this.activityData.activityId,
eventId: this.activityData.eventId
}).then(resp => {
if (resp.code === 0) {
this.$toast.success("提交成功!")
window.location.reload()
} else {
this.$toast.fail(resp.msg)
}
})
})
},
openSign(row) {
this.activityData = row
this.signActionPopup = true
},
async openApplyUser(item) {
this.isView = true
this.activityData = item
this.formData.activityId = item.activityId
const resp = await this.selectRegisterList()
if (resp) {
const selfInfo = resp.find(v => v.id === "${@shiro.getPrincipalProperty('id')}" && v.eventId === item.eventId)
if (selfInfo) {
this.registerList = resp.filter(v => v.eventId == item.eventId && v.applyUser === selfInfo.applyUser)
this.registerList = resp.filter(v => v.eventId === item.eventId && v.applyUser === selfInfo.applyUser)
this.formData.applyUserSign = selfInfo.applyUserSign
}
this.teamSignUpShow = true
}
@@ -391,7 +546,7 @@ layout("/mobile/platform.html"){
},
async doTeamSignUp() {
if (this.activityData.isSign && !this.applyUserSign) {
if (this.activityData.isSign && !this.formData.applyUserSign) {
this.$dialog.alert({
title: "温馨提示",
message: "请签字后再提交!"
@@ -475,7 +630,7 @@ layout("/mobile/platform.html"){
teamId: this.formData.teamId,
teamName: this.formData.teamName,
userIds: JSON.stringify(userIds),
applyUserSign: this.applyUserSign
applyUserSign: this.formData.applyUserSign
})
await this.onRefresh()
@@ -558,6 +713,24 @@ layout("/mobile/platform.html"){
return done(false)
},
async doActivityConfirm() {
if (this.activityData.isSign && !this.formData.applyUserSign) {
this.$dialog.alert({
title: "温馨提示",
message: "请签字后再提交!"
}).then(() => {
})
return
}
if (this.activityData.isSign && !this.formData.isCy) {
this.$dialog.alert({
title: "温馨提示",
message: "请先阅读自愿参赛责任及风险告知书!"
}).then(() => {
})
return
}
if (this.formData.teamId == null && this.projectType == 2) {
this.$toast("请选择报名的小队")
return