feat: 移动端-协会审核-退回-拒绝-通过完整流程优化
This commit is contained in:
+16
-1
@@ -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;
|
||||||
import com.budwk.app.sys.models.Sys_user_role;
|
import com.budwk.app.sys.models.Sys_user_role;
|
||||||
import com.budwk.app.sys.services.SysMsgService;
|
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.commons.auth.utils.SecurityUtil;
|
||||||
import com.budwk.app.web.controllers.open.commons.service.CommonService;
|
import com.budwk.app.web.controllers.open.commons.service.CommonService;
|
||||||
import com.budwk.app.zhgh.club.model.ClubUser;
|
import com.budwk.app.zhgh.club.model.ClubUser;
|
||||||
@@ -63,6 +64,7 @@ public class ClubUserJoinApplyController {
|
|||||||
Sql sql = Sqls.create("""
|
Sql sql = Sqls.create("""
|
||||||
SELECT
|
SELECT
|
||||||
cua.*,
|
cua.*,
|
||||||
|
club.clubName,
|
||||||
u.loginname AS loginName,
|
u.loginname AS loginName,
|
||||||
u.username AS userName,
|
u.username AS userName,
|
||||||
u.sex,
|
u.sex,
|
||||||
@@ -74,6 +76,7 @@ public class ClubUserJoinApplyController {
|
|||||||
FROM
|
FROM
|
||||||
club_user_apply cua
|
club_user_apply cua
|
||||||
LEFT JOIN vw_user u ON u.id = cua.userId
|
LEFT JOIN vw_user u ON u.id = cua.userId
|
||||||
|
LEFT JOIN sys_club club ON club.id = cua.clubId
|
||||||
WHERE cua.id = @id
|
WHERE cua.id = @id
|
||||||
""").setParam("id", id);
|
""").setParam("id", id);
|
||||||
sql.setCallback(Sqls.callback.map());
|
sql.setCallback(Sqls.callback.map());
|
||||||
@@ -87,10 +90,22 @@ public class ClubUserJoinApplyController {
|
|||||||
@SaCheckPermission("club.join.apply")
|
@SaCheckPermission("club.join.apply")
|
||||||
@Aop(TransAop.READ_COMMITTED)
|
@Aop(TransAop.READ_COMMITTED)
|
||||||
public Result submit(ClubUserApply clubUserApply) {
|
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()));
|
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("暂无申请加入协会资格!");
|
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())) {
|
if (ObjectUtil.isNotEmpty(userApply) && StrUtil.isNotBlank(userApply.getId())) {
|
||||||
BpmProcessInstance processInstance = dao.fetch(BpmProcessInstance.class, Cnd.where(BpmProcessInstance::getProcessInstanceBusinessId, "=", userApply.getId()));
|
BpmProcessInstance processInstance = dao.fetch(BpmProcessInstance.class, Cnd.where(BpmProcessInstance::getProcessInstanceBusinessId, "=", userApply.getId()));
|
||||||
if (!processInstance.getProcessInstanceStatus().equals(BpmProcessInstanceStatusEnum.COMPLETED.name())) {
|
if (!processInstance.getProcessInstanceStatus().equals(BpmProcessInstanceStatusEnum.COMPLETED.name())) {
|
||||||
|
|||||||
@@ -203,7 +203,7 @@ layout("/layouts/platform_h5.html"){
|
|||||||
|
|
||||||
<!-- 提交按钮 -->
|
<!-- 提交按钮 -->
|
||||||
<div class="submit-btn">
|
<div class="submit-btn">
|
||||||
<van-button round block type="info">提交申请</van-button>
|
<van-button round block type="info" :disabled="formLoading">提交申请</van-button>
|
||||||
</div>
|
</div>
|
||||||
</van-form>
|
</van-form>
|
||||||
<van-popup :style="{ height: '100%',width: '100%'}" position="right" safe-area-inset-bottom v-model="viewShow">
|
<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() {
|
data() {
|
||||||
return {
|
return {
|
||||||
viewShow: false,
|
viewShow: false,
|
||||||
|
formLoading: false,
|
||||||
formData: {
|
formData: {
|
||||||
clubId: "",
|
clubId: "",
|
||||||
clubName: "",
|
clubName: "",
|
||||||
@@ -284,6 +285,22 @@ layout("/layouts/platform_h5.html"){
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
init() {
|
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;
|
const user = this.$store.state.user;
|
||||||
this.formData.userId = user.id;
|
this.formData.userId = user.id;
|
||||||
this.formData.userName = user.username;
|
this.formData.userName = user.username;
|
||||||
@@ -298,6 +315,7 @@ layout("/layouts/platform_h5.html"){
|
|||||||
this.formData.governmentPosition = user.governmentPosition;
|
this.formData.governmentPosition = user.governmentPosition;
|
||||||
},
|
},
|
||||||
doSubmit() {
|
doSubmit() {
|
||||||
|
if (this.formLoading) return;
|
||||||
if (!this.isAgree) {
|
if (!this.isAgree) {
|
||||||
this.$toast.fail("请先阅读并同意协议");
|
this.$toast.fail("请先阅读并同意协议");
|
||||||
return;
|
return;
|
||||||
@@ -309,7 +327,9 @@ layout("/layouts/platform_h5.html"){
|
|||||||
this.$axios.post("/platform/club/join/apply/submit", this.formData).then(res => {
|
this.$axios.post("/platform/club/join/apply/submit", this.formData).then(res => {
|
||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
this.$toast(res.msg);
|
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>
|
<van-empty v-else image="/assets/platform/plugins/vant-green/images/nodata/nodata.png" description="暂无数据"></van-empty>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<van-dialog v-model="auditShow" title="审核意见" show-cancel-button :lazy-render="false" @confirm="doAudit">
|
<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="请输入审核意见"></van-field>
|
<van-field v-model="approvalOpinion" type="textarea" placeholder="请输入审核意见" :error-message="approvalOpinionError" @input="approvalOpinionError = ''"></van-field>
|
||||||
</van-dialog>
|
</van-dialog>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -64,6 +64,7 @@ layout("/layouts/platform_h5.html"){
|
|||||||
return {
|
return {
|
||||||
auditShow: false,
|
auditShow: false,
|
||||||
approvalOpinion: "",
|
approvalOpinion: "",
|
||||||
|
approvalOpinionError: "",
|
||||||
tableLoading: false,
|
tableLoading: false,
|
||||||
tableFinished: false,
|
tableFinished: false,
|
||||||
submitting: false,
|
submitting: false,
|
||||||
@@ -92,14 +93,22 @@ layout("/layouts/platform_h5.html"){
|
|||||||
this.approvalType = approvalType
|
this.approvalType = approvalType
|
||||||
this.approvalParam = row.approvalParam
|
this.approvalParam = row.approvalParam
|
||||||
this.approvalOpinion = ""
|
this.approvalOpinion = ""
|
||||||
|
this.approvalOpinionError = ""
|
||||||
this.auditShow = true
|
this.auditShow = true
|
||||||
},
|
},
|
||||||
async doAudit() {
|
async beforeAuditClose(action, done) {
|
||||||
if (!this.approvalOpinion.trim()) {
|
if (action !== 'confirm') {
|
||||||
this.$toast.fail("请输入审核意见")
|
done()
|
||||||
this.$nextTick(() => { this.auditShow = true })
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if (!this.approvalOpinion.trim()) {
|
||||||
|
this.approvalOpinionError = "请输入审核意见"
|
||||||
|
done(false)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
done(await this.doAudit() === true)
|
||||||
|
},
|
||||||
|
async doAudit() {
|
||||||
if (this.submitting) return
|
if (this.submitting) return
|
||||||
this.submitting = true
|
this.submitting = true
|
||||||
try {
|
try {
|
||||||
@@ -112,8 +121,8 @@ layout("/layouts/platform_h5.html"){
|
|||||||
})
|
})
|
||||||
if (resp.code === 0) {
|
if (resp.code === 0) {
|
||||||
this.$toast.success(resp.msg)
|
this.$toast.success(resp.msg)
|
||||||
this.auditShow = false
|
|
||||||
this.doSearch()
|
this.doSearch()
|
||||||
|
return true
|
||||||
} else {
|
} else {
|
||||||
this.$toast(resp.msg)
|
this.$toast(resp.msg)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,6 +29,24 @@ const clubUserJoin = {
|
|||||||
</template>
|
</template>
|
||||||
</van-cell>
|
</van-cell>
|
||||||
</van-cell-group>
|
</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>
|
</div>
|
||||||
`,
|
`,
|
||||||
data() {
|
data() {
|
||||||
|
|||||||
@@ -81,6 +81,9 @@ layout("/layouts/platform_h5.html"){
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
openEdit(row) {
|
||||||
|
this.$pjaxReplace("/platform/h5/club/apply?id=" + encodeURIComponent(row.id))
|
||||||
|
},
|
||||||
onOpen(row) {
|
onOpen(row) {
|
||||||
this.viewShow = true
|
this.viewShow = true
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user