feat: 移动端-协会审核-退回-拒绝-通过完整流程优化

This commit is contained in:
2026-09-28 14:27:25 +08:00
parent a18f77cd68
commit 3c3e64f2be
5 changed files with 75 additions and 10 deletions
@@ -12,6 +12,7 @@ import com.budwk.app.bpm.service.BpmService;
import com.budwk.app.sys.models.Sys_user;
import com.budwk.app.sys.models.Sys_user_role;
import com.budwk.app.sys.services.SysMsgService;
import com.budwk.app.web.commons.auth.utils.AuthUtil;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.web.controllers.open.commons.service.CommonService;
import com.budwk.app.zhgh.club.model.ClubUser;
@@ -63,6 +64,7 @@ public class ClubUserJoinApplyController {
Sql sql = Sqls.create("""
SELECT
cua.*,
club.clubName,
u.loginname AS loginName,
u.username AS userName,
u.sex,
@@ -74,6 +76,7 @@ public class ClubUserJoinApplyController {
FROM
club_user_apply cua
LEFT JOIN vw_user u ON u.id = cua.userId
LEFT JOIN sys_club club ON club.id = cua.clubId
WHERE cua.id = @id
""").setParam("id", id);
sql.setCallback(Sqls.callback.map());
@@ -87,10 +90,22 @@ public class ClubUserJoinApplyController {
@SaCheckPermission("club.join.apply")
@Aop(TransAop.READ_COMMITTED)
public Result submit(ClubUserApply clubUserApply) {
if (StrUtil.isNotBlank(clubUserApply.getId())) {
ClubUserApply existingApply = dao.fetch(ClubUserApply.class, clubUserApply.getId());
if (existingApply == null || !StrUtil.equals(existingApply.getUserId(), clubUserApply.getUserId())
|| (!AuthUtil.hasRole(RoleConstant.SYSADMIN.name()) && !StrUtil.equals(existingApply.getUserId(), SecurityUtil.getUserId()))) {
return Result.error("申请不存在或无权编辑!");
}
BpmProcessInstance existingInstance = dao.fetch(BpmProcessInstance.class, Cnd.where(BpmProcessInstance::getProcessInstanceBusinessId, "=", existingApply.getId()));
if (existingInstance == null || existingInstance.getProcessInstanceNodeCode() == null
|| !List.of(10, 40, 70).contains(existingInstance.getProcessInstanceNodeCode())) {
return Result.error("当前申请状态不允许编辑提交!");
}
}
Sys_user user = dao.fetch(Sys_user.class, Cnd.where("id", "=", clubUserApply.getUserId()));
if (!user.getMember() && !("劳务派遣一类".equals(user.getPreparedBy()) || "劳务派遣二类".equals(user.getPreparedBy()))) return Result.error("暂无申请加入协会资格!");
ClubUserApply userApply = dao.fetch(ClubUserApply.class, Cnd.where("userId", "=", clubUserApply.getUserId()).and("clubId", "=", clubUserApply.getClubId()).and("mode", "=", 1).desc(ClubUserApply::getApplyDate));
ClubUserApply userApply = dao.fetch(ClubUserApply.class, Cnd.where("userId", "=", clubUserApply.getUserId()).and("clubId", "=", clubUserApply.getClubId()).and("mode", "=", 1).andEX("id", "!=", clubUserApply.getId()).desc(ClubUserApply::getApplyDate));
if (ObjectUtil.isNotEmpty(userApply) && StrUtil.isNotBlank(userApply.getId())) {
BpmProcessInstance processInstance = dao.fetch(BpmProcessInstance.class, Cnd.where(BpmProcessInstance::getProcessInstanceBusinessId, "=", userApply.getId()));
if (!processInstance.getProcessInstanceStatus().equals(BpmProcessInstanceStatusEnum.COMPLETED.name())) {
@@ -203,7 +203,7 @@ layout("/layouts/platform_h5.html"){
<!-- 提交按钮 -->
<div class="submit-btn">
<van-button round block type="info">提交申请</van-button>
<van-button round block type="info" :disabled="formLoading">提交申请</van-button>
</div>
</van-form>
<van-popup :style="{ height: '100%',width: '100%'}" position="right" safe-area-inset-bottom v-model="viewShow">
@@ -227,6 +227,7 @@ layout("/layouts/platform_h5.html"){
data() {
return {
viewShow: false,
formLoading: false,
formData: {
clubId: "",
clubName: "",
@@ -284,6 +285,22 @@ layout("/layouts/platform_h5.html"){
});
},
init() {
const id = GetQueryString("id");
if (id) {
this.formLoading = true;
this.$axios.post("/platform/club/join/apply/info", { id }).then(res => {
if (res.code === 0 && res.data) {
this.formData = { ...this.formData, ...res.data };
this.isAgree = true;
this.formLoading = false;
} else {
this.$toast.fail(res.msg || "申请信息加载失败");
}
}).catch(() => {
this.$toast.fail("申请信息加载失败");
});
return;
}
const user = this.$store.state.user;
this.formData.userId = user.id;
this.formData.userName = user.username;
@@ -298,6 +315,7 @@ layout("/layouts/platform_h5.html"){
this.formData.governmentPosition = user.governmentPosition;
},
doSubmit() {
if (this.formLoading) return;
if (!this.isAgree) {
this.$toast.fail("请先阅读并同意协议");
return;
@@ -309,7 +327,9 @@ layout("/layouts/platform_h5.html"){
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")
this.$pjaxReplace("/platform/h5/club/mine")
} else {
this.$toast.fail(res.msg);
}
});
});
@@ -50,8 +50,8 @@ layout("/layouts/platform_h5.html"){
<van-empty v-else image="/assets/platform/plugins/vant-green/images/nodata/nodata.png" description="暂无数据"></van-empty>
</div>
<van-dialog v-model="auditShow" title="审核意见" show-cancel-button :lazy-render="false" @confirm="doAudit">
<van-field v-model="approvalOpinion" type="textarea" placeholder="请输入审核意见"></van-field>
<van-dialog v-model="auditShow" title="审核意见" show-cancel-button get-container="body" :overlay="true" :overlay-style="{ backgroundColor: 'rgba(0, 0, 0, 0.5)' }" :lazy-render="false" :before-close="beforeAuditClose">
<van-field v-model="approvalOpinion" type="textarea" placeholder="请输入审核意见" :error-message="approvalOpinionError" @input="approvalOpinionError = ''"></van-field>
</van-dialog>
</div>
@@ -64,6 +64,7 @@ layout("/layouts/platform_h5.html"){
return {
auditShow: false,
approvalOpinion: "",
approvalOpinionError: "",
tableLoading: false,
tableFinished: false,
submitting: false,
@@ -92,14 +93,22 @@ layout("/layouts/platform_h5.html"){
this.approvalType = approvalType
this.approvalParam = row.approvalParam
this.approvalOpinion = ""
this.approvalOpinionError = ""
this.auditShow = true
},
async doAudit() {
if (!this.approvalOpinion.trim()) {
this.$toast.fail("请输入审核意见")
this.$nextTick(() => { this.auditShow = true })
async beforeAuditClose(action, done) {
if (action !== 'confirm') {
done()
return
}
if (!this.approvalOpinion.trim()) {
this.approvalOpinionError = "请输入审核意见"
done(false)
return
}
done(await this.doAudit() === true)
},
async doAudit() {
if (this.submitting) return
this.submitting = true
try {
@@ -112,8 +121,8 @@ layout("/layouts/platform_h5.html"){
})
if (resp.code === 0) {
this.$toast.success(resp.msg)
this.auditShow = false
this.doSearch()
return true
} else {
this.$toast(resp.msg)
}
@@ -29,6 +29,24 @@ const clubUserJoin = {
</template>
</van-cell>
</van-cell-group>
<div v-for="nodeTask in viewData.nodeTasks" :key="nodeTask.id">
<van-cell-group :title="nodeTask.nodeName">
<div v-for="task in nodeTask.tasks" :key="task.id">
<van-cell title="审核人">{{ task.actualOwnerLoginName }}-{{ task.actualOwnerUserName }}</van-cell>
<van-cell title="审核时间">{{ task.endOn }}</van-cell>
<van-cell title="审核结果">
<template v-if="task.extVariable">
<van-tag type="success" v-if="task.extVariable.bpmTaskApprovalType === 'PASS'">同意</van-tag>
<van-tag type="danger" v-if="task.extVariable.bpmTaskApprovalType === 'BACK'">退回重新填写</van-tag>
<van-tag type="danger" v-if="task.extVariable.bpmTaskApprovalType === 'REJECT'">拒绝</van-tag>
</template>
</van-cell>
<van-cell title="审核意见">
<div style="white-space: pre-wrap; overflow-wrap: anywhere; text-align: right">{{ task.extVariable && task.extVariable.approvalOpinion }}</div>
</van-cell>
</div>
</van-cell-group>
</div>
</div>
`,
data() {
@@ -81,6 +81,9 @@ layout("/layouts/platform_h5.html"){
}
},
methods: {
openEdit(row) {
this.$pjaxReplace("/platform/h5/club/apply?id=" + encodeURIComponent(row.id))
},
onOpen(row) {
this.viewShow = true
this.$nextTick(() => {