This commit is contained in:
@jyuhsin
2025-07-02 19:30:15 +08:00
parent 56cbae8ec2
commit 63bd4e0157
8 changed files with 333 additions and 179 deletions
@@ -68,7 +68,6 @@ public class ClubUserJoinApplyController {
u.sex,
u.unitName,
u.unionName,
u.governmentPosition,
u.technicalTitle,
u.education,
u.academicDegree
@@ -39,7 +39,6 @@ public class ClubUserJoinCommonController {
u.mobile,
u.unitName,
u.unionName,
u.governmentPosition,
u.technicalTitle,
u.education,
u.academicDegree
@@ -110,8 +110,6 @@ public class ClubUserApplyController {
left join club_user cu on club.id=cu.clubId
where
cu.userId=@userId
and isNormal = true
and cu.status in (1, 3, 5)
group by cu.clubId
""").setParam("userId", id);
List<NutMap> list = sysClubService.listMap(sql);
@@ -0,0 +1,27 @@
package com.budwk.app.zhgh.club.h5controller;
import cn.dev33.satoken.annotation.SaCheckPermission;
import io.swagger.annotations.Api;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
/**
* @ClassName H5ClubMineController
* @Author JyuHsin
* @Date 2025/7/2 19:19
* @Version 1.0
* @Description TODO
*/
@IocBean
@At("/platform/h5/club/mine")
@Ok("json:full")
@Api("h5申请入会")
public class H5ClubMineController {
@At("")
@Ok("beetl:/platform/zhghh5/club/mine/index.html")
@SaCheckPermission("h5.club.mine")
public void index() {
}
}
@@ -71,8 +71,10 @@ public class SysClubServiceImpl extends BaseServiceImpl<SysClub> implements SysC
FROM
sys_club club
LEFT JOIN sys_user u on club.concatPerson = u.id
LEFT JOIN bpm_process_instance ins ON ins.processInstanceBusinessId = club.id
$condition
""").setParam("userId", SecurityUtil.getUserId());
cnd.and("ins.processInstanceStatus", "=", BpmProcessInstanceStatusEnum.COMPLETED);
sql.setCondition(cnd);
return listPageVO(pageForm, sql, ClubCommonPageVo.class);
}
@@ -93,9 +93,11 @@ layout("/layouts/platform.html"){
await this.doHandle("doSave")
},
async doSubmit() {
let valid = await this.$refs.clubFormRef.$refs.form.validate()
if (!valid) return
await this.doHandle("doSubmit")
this.$refs.clubFormRef.$refs.form.validate().then(() => {
this.doHandle("doSubmit")
}).catch(() => {
this.$message.warning({ title: "警告", message: "存在必填项未填写!" })
})
},
async doHandle(type) {
let formData = {}
@@ -151,7 +153,6 @@ layout("/layouts/platform.html"){
}
} catch (e) {
console.log(e)
this.$message.warning({ title: "警告", message: "存在必填项未填写!" })
}
},
async userRemoteMethod(query) {
@@ -2,67 +2,199 @@
layout("/layouts/platform_h5.html"){
#-->
<style></style>
<style scoped>
#app {
background-color: #f7f8fa;
height: 100vh;
overflow-y: auto;
}
<div id="app" v-cloak>
<van-sticky>
<van-nav-bar title="申请入会" left-text="返回" left-arrow @click-left="$pjaxReplace('/platform/h5/home')"></van-nav-bar>
<van-dropdown-menu>
<van-dropdown-item v-model="pageForm.hasJoin" :options="clubType" @change="doSearch"></van-dropdown-item>
<van-dropdown-item v-model="pageForm.clubType" :options="typeOptions" @change="doSearch"></van-dropdown-item>
</van-dropdown-menu>
</van-sticky>
.form-container {
padding: 0 16px;
font-family: "PingFang SC", sans-serif;
}
<div>
<van-list v-if="tableData.length>0" v-model="tableLoading" :finished="tableFinished" finished-text="没有更多了" @load="pageData">
<div class="table-list">
<div class="table-card" v-for="row in tableData" :key="row.id">
<van-cell>
<template slot="title">
<div class="flex-align">
<span class="font-size3 bold">{{row.clubName}}</span>
</div>
</template>
</van-cell>
<van-cell title="联系人" :value="row.concatPersonName"></van-cell>
<van-cell title="联系方式" :value="row.concatPersonMobile"></van-cell>
<van-cell title="会长" :value="row.clubLeader"></van-cell>
<van-cell title="成立时间" :value="row.foundTime ? row.foundTime : '暂无'"></van-cell>
<van-cell v-if="row.status" title="审核状态">
<span v-if="row.status == 1">待协会审核</span>
<span v-else-if="row.status == 2">协会不通过</span>
<span v-else-if="row.status == 3">待校工会审核</span>
<span v-else-if="row.status == 4">校工会不通过</span>
<span v-else-if="row.status == 5">审核通过</span>
</van-cell>
<van-cell class="table-card-footer">
<!--<van-button size="small" @click="openInfo(row)">查看</van-button>-->
<van-button v-if="pageForm.hasJoin === true && row.status == 1" size="small" @click="rollback(row)" type="danger">
撤销加入申请
</van-button>
<van-button v-if="pageForm.hasJoin === false" size="small" @click="needJoin(row)" type="info">我要加入</van-button>
<van-button
v-if="pageForm.hasJoin === true && row.status==5 && row.exitStatus"
size="small"
@click="cancelExitClub(row)"
type="danger"
>
撤销退会申请
</van-button>
<van-button
v-if="pageForm.hasJoin === true && row.status==5 && !row.exitStatus"
size="small"
@click="exitClub(row)"
type="info"
>
我要退会
</van-button>
</van-cell>
</div>
</div>
</van-list>
<van-empty v-else image="/assets/platform/plugins/vant-green/images/nodata/nodata.png" description="暂无数据"></van-empty>
</div>
/* 分段标题样式 */
.form-section {
border-radius: 12px;
overflow: hidden;
}
/* 协会选择字段样式 */
.club-field .van-field__label {
width: 90px !important;
}
.club-field .van-cell__value {
color: #333;
}
/* 弹出选择器样式 */
.picker-style {
background-color: #f5f5f5;
border-top-left-radius: 12px;
border-top-right-radius: 12px;
}
/* 输入文本区域样式 */
.van-field__control {
font-size: 14px;
color: #333;
}
.van-field__control input,
.van-field__control textarea {
font-size: 14px;
color: #333;
border-radius: 6px;
padding: 8px 12px;
background-color: #f9f9f9;
}
/* 同意条款样式 */
.agree-section {
padding: 16px;
background-color: #fff;
border-radius: 12px;
margin-top: 16px;
}
.agree-section .van-checkbox__label {
font-size: 13px;
line-height: 1.5;
color: #666;
}
/* 提交按钮样式 */
.submit-btn {
margin: 20px 16px 30px;
background: linear-gradient(to right, #4a90e2, #5ab1ef);
border-radius: 24px;
overflow: hidden;
}
.submit-btn .van-button {
height: 48px;
font-size: 16px;
font-weight: bold;
}
.van-cell-group__title {
font-weight: bold;
}
.more-text .van-field__label{
width: 100%;
}
.more-text {
display: inline-block;
}
</style>
<div id="app">
<!-- 导航栏 -->
<van-nav-bar title="文体协会会员申请" left-arrow @click-left="historyBack"></van-nav-bar>
<!-- 表单容器 -->
<van-form @submit="doSubmit" ref="formRef" class="form-container">
<!-- 协会信息 -->
<van-cell-group title="协会信息" class="form-section">
<van-field
:rules="[{ required: true }]"
v-model="formData.clubName"
label="协会"
placeholder="请选择协会"
required
is-link
readonly
@click="showClubPopup = true"
class="club-field"
></van-field>
<van-popup v-model:show="showClubPopup" position="bottom">
<van-picker
show-toolbar
:columns="clubOptions.map(i => i.clubName)"
@confirm="onClubConfirm"
@cancel="showClubPopup = false"
class="picker-style"
></van-picker>
</van-popup>
</van-cell-group>
<!-- 基本信息 -->
<van-cell-group title="基本信息" class="form-section">
<van-field label="姓名" :rules="[{ required: true }]" v-model="formData.userName" readonly required></van-field>
<van-field label="工号" :rules="[{ required: true }]" v-model="formData.loginName" readonly required></van-field>
<van-field label="性别" :rules="[{ required: true }]" v-model="formData.sex" readonly required></van-field>
<van-field label="出生年月" v-model="formData.birthday" readonly placeholder="读取信息中心数据"></van-field>
<van-field label="联系电话" v-model="formData.mobile" placeholder="请输入联系电话"></van-field>
<van-field label="电子信箱" v-model="formData.email" placeholder="请输入电子信箱"></van-field>
</van-cell-group>
<!-- 工作信息 -->
<van-cell-group title="工作信息" class="form-section">
<van-field label="分工会" v-model="formData.unionName" readonly></van-field>
<van-field label="单位" v-model="formData.unitName" readonly></van-field>
<van-field label="职务" v-model="formData.governmentPosition" readonly placeholder="读取信息中心数据"></van-field>
<van-field label="职称" v-model="formData.technicalTitle" readonly placeholder="读取信息中心数据"></van-field>
<van-field label="学历" v-model="formData.education" readonly placeholder="读取信息中心数据"></van-field>
<van-field label="学位" v-model="formData.academicDegree" readonly placeholder="读取信息中心数据"></van-field>
</van-cell-group>
<!-- 其他信息 -->
<van-cell-group title="其他信息" class="form-section">
<van-field
class="more-text"
v-model="formData.sameTimeJoinOtherClubSituation"
label="同时参加其他协会情况"
type="textarea"
rows="4"
autosize
placeholder="请填写同时参加其他协会情况"
></van-field>
<van-field
class="more-text"
v-model="formData.awardsExperience"
label="文化、体育方面的活动经历、获奖情况"
type="textarea"
rows="4"
autosize
placeholder="请填写相关经历及获奖情况"
></van-field>
</van-cell-group>
<!-- 照片上传 -->
<van-cell-group title="照片" class="form-section">
<van-field class="more-text" name="avatar" label="">
<template #input>
<h5-file-upload
slot="input"
:value.sync="formData.avatar"
:upload_number="1"
upload_mode="image"
upload_result_category="interval"
upload_result_type="url"
complete_result
></h5-file-upload>
</template>
</van-field>
</van-cell-group>
<!-- 电子签名 -->
<van-cell-group title="电子签名" class="form-section">
<van-field class="more-text" name="signature" label="">
<template #input>
<h5-signature v-model="formData.signature" slot="input"></h5-signature>
</template>
</van-field>
</van-cell-group>
<!-- 同意条款 -->
<van-cell-group class="agree-section form-section">
<van-checkbox v-model="isAgree" shape="square">
注:本人已仔细阅读并愿意遵守所参加本校教职工文体协会的章程和规定,自愿加入所报名协会。
</van-checkbox>
</van-cell-group>
<!-- 提交按钮 -->
<div class="submit-btn">
<van-button round block type="info">提交申请</van-button>
</div>
</van-form>
</div>
<script>
@@ -72,126 +204,89 @@ layout("/layouts/platform_h5.html"){
components: {},
data() {
return {
pageForm: {
pageNumber: 1,
pageSize: 10,
totalCount: 0,
searchKeyword: ""
formData: {
clubId: "",
clubName: "",
userName: "",
loginName: "",
sex: "",
birthday: "",
mobile: "",
email: "",
unionName: "",
unitName: "",
governmentPosition: "",
technicalTitle: "",
education: "",
academicDegree: "",
sameTimeJoinOtherClubSituation: "",
awardsExperience: "",
avatar: [],
signature: ""
},
tableData: [],
tableLoading: false,
tableFinished: false,
clubType: [
{ text: "未加入", value: false },
{ text: "已加入", value: true }
],
typeOptions: []
clubOptions: [],
showClubPopup: false,
isAgree: false
}
},
methods: {
async cancelExitClub(row) {
const confirm = await this.$dialog.confirm({
onClubConfirm(value, index) {
this.formData.clubId = this.clubOptions[index].id;
this.formData.clubName = value;
this.showClubPopup = false;
// 检查是否已申请该协会
this.checkApplyClub(this.formData.clubId);
},
checkApplyClub(clubId) {
this.$axios.post("/platform/club/join/apply/checkApplyClub", { clubId }).then(res => {
if (res.code === 0 && res.data) {
this.$toast.warning("您已申请加入该协会,请勿重复申请");
this.formData.clubId = "";
this.formData.clubName = "";
}
});
},
listClub() {
this.$axios.post("/platform/club/common/listClub").then(res => {
if (res.code === 0) {
this.clubOptions = res.data;
}
});
},
init() {
const user = this.$store.state.user;
this.formData.userId = user.id;
this.formData.userName = user.username;
this.formData.loginName = user.loginname;
this.formData.unitName = user.unit ? user.unit.name : null;
this.formData.unionName = user.union ? user.union.name : null;
this.formData.sex = user.sex;
this.formData.education = user.education;
this.formData.technicalTitle = user.technicalTitle;
this.formData.governmentPosition = user.governmentPosition;
},
doSubmit() {
if (!this.isAgree) {
this.$toast.fail("请先阅读并同意协议");
return;
}
this.$dialog.confirm({
title: "提示",
message: "您确定要撤销申请吗?"
})
if (confirm === "confirm") {
const resp = await this.$axios.post("/platform/club/applyJoin/apply/cancelExitClub", { id: row.id })
if (resp.code === 0) {
this.$toast.success(resp.msg)
await this.doSearch()
} else {
this.$toast(resp.msg)
}
}
},
async exitClub(row) {
const confirm = await this.$dialog.confirm({
title: "提示",
message: "您确定要申请退会吗?"
})
if (confirm === "confirm") {
const resp = await this.$axios.post("/platform/club/applyJoin/apply/exitClub", { id: row.id })
if (resp.code === 0) {
this.$toast.success(resp.msg)
await this.doSearch()
} else {
this.$toast(resp.msg)
}
}
},
async rollback(row) {
const confirm = await this.$dialog.confirm({
title: "提示",
message: "您确认要撤销申请吗?"
})
if (confirm === "confirm") {
const resp = await this.$axios.post("/platform/club/applyJoin/apply/revocation", { id: row.id })
if (resp.code === 0) {
this.$toast.success(resp.msg)
await this.doSearch()
} else {
this.$toast(resp.msg)
}
}
},
async needJoin(row) {
const { code, data, msg } = await this.$axios.post("/platform/club/applyJoin/apply/getInClubByCurUser")
if (code !== 0) {
this.$toast(msg)
return
}
let str = "您还没有参加协会"
if (data && data.length > 0) {
str = "您已经加入了"
data.forEach((item) => {
str += "【" + item.clubName + "】"
})
}
str += ",请确认是否申请加入【" + row.clubName + "】?"
const confirm = await this.$dialog.confirm({
title: "提示",
message: str
})
if (confirm === "confirm") {
const resp = await this.$axios.post("/platform/club/applyJoin/apply/submit", { id: row.id })
if (resp.code === 0) {
this.$toast.success(resp.msg)
await this.doSearch()
} else {
this.$toast(resp.msg)
}
}
},
pageData() {
this.tableLoading = true
this.$axios.post("/platform/club/applyJoin/apply/pageData", this.pageForm).then((resp) => {
this.tableData = this.tableData.concat(resp.data.list)
this.pageForm.totalCount = resp.data.totalCount
if (this.tableData.length >= this.pageForm.totalCount) {
this.tableFinished = true
} else {
this.pageForm.pageNumber++
}
this.tableLoading = false
})
},
doSearch() {
this.pageForm.pageNumber = 1
this.pageForm.totalCount = 0
this.tableData = []
this.pageData()
message: "您确定要提交申请吗?"
}).then(() => {
this.$axios.post("/platform/club/join/apply/submit", this.formData).then(res => {
if (res.code === 0) {
this.$toast(res.msg);
this.$pjaxReplace("/platform/club/join/mine")
}
});
});
}
},
created() {
this.$businessTool.getDictOptions("CLUB_REGISTER_TYPE").then((data) => {
data.forEach((item) => {
this.typeOptions.push({ text: item.name, value: item.code })
})
this.typeOptions.unshift({ text: "全部类型" })
})
this.$set(this.pageForm, "hasJoin", this.clubType[0].value)
this.pageData()
this.listClub();
this.init();
}
})
</script>
@@ -0,0 +1,33 @@
<!--#
layout("/layouts/platform_h5.html"){
#-->
<style scoped>
</style>
<div id="app">
</div>
<script>
const vue = new Vue({
el: "#app",
store,
components: {},
data() {
return {
}
},
methods: {
},
created() {
}
})
</script>
<!--#
}
#-->