diff --git a/src/main/java/com/budwk/app/zhgh/activity/declarereimbursement/declare/controller/ActivityDeclareMineController.java b/src/main/java/com/budwk/app/zhgh/activity/declarereimbursement/declare/controller/ActivityDeclareMineController.java index 54d0158..ab89cfd 100644 --- a/src/main/java/com/budwk/app/zhgh/activity/declarereimbursement/declare/controller/ActivityDeclareMineController.java +++ b/src/main/java/com/budwk/app/zhgh/activity/declarereimbursement/declare/controller/ActivityDeclareMineController.java @@ -189,6 +189,9 @@ public class ActivityDeclareMineController { sql.setCallback(Sqls.callback.map()); dao.execute(sql); NutMap info = (NutMap) sql.getResult(); + if (Lang.isEmpty(info)) { + throw new RuntimeException("暂时无法导出!"); + } String activityContent = info.getString("activityContent"); info.put("activityContent", sysOfficeTemplateUtil.convertRichTextToDocText(activityContent)); diff --git a/src/main/java/com/budwk/app/zhgh/activity/declarereimbursement/reimbursement/controller/ActivityReimbursementApplyController.java b/src/main/java/com/budwk/app/zhgh/activity/declarereimbursement/reimbursement/controller/ActivityReimbursementApplyController.java index 7ad3436..5b0d0ef 100644 --- a/src/main/java/com/budwk/app/zhgh/activity/declarereimbursement/reimbursement/controller/ActivityReimbursementApplyController.java +++ b/src/main/java/com/budwk/app/zhgh/activity/declarereimbursement/reimbursement/controller/ActivityReimbursementApplyController.java @@ -144,6 +144,7 @@ public class ActivityReimbursementApplyController { args.set(FlowConst.FORM_DATA, activityReimbursementInfo); args.set("outlayManageSource", activityReimbursementInfo.getOutlayManageSource()); args.set("actualMoney", activityReimbursementInfo.getActualMoney()); + args.set("next", activityReimbursementInfo.getReimbursementIdentity()); ProcessInstance instance = flowEngine.startProcessInstanceByKey("HDBX", activityReimbursementInfo.getId(), SecurityUtil.getUserId(), args); // 自动完成第一个申请任务 diff --git a/src/main/java/com/budwk/app/zhgh/activity/declarereimbursement/reimbursement/controller/ActivityReimbursementMineController.java b/src/main/java/com/budwk/app/zhgh/activity/declarereimbursement/reimbursement/controller/ActivityReimbursementMineController.java index 2cee04b..52979b9 100644 --- a/src/main/java/com/budwk/app/zhgh/activity/declarereimbursement/reimbursement/controller/ActivityReimbursementMineController.java +++ b/src/main/java/com/budwk/app/zhgh/activity/declarereimbursement/reimbursement/controller/ActivityReimbursementMineController.java @@ -34,9 +34,11 @@ import org.nutz.dao.Cnd; import org.nutz.dao.Dao; import org.nutz.dao.Sqls; import org.nutz.dao.sql.Sql; +import org.nutz.dao.util.cri.SqlExpressionGroup; import org.nutz.ioc.aop.Aop; import org.nutz.ioc.loader.annotation.Inject; import org.nutz.ioc.loader.annotation.IocBean; +import org.nutz.lang.Lang; import org.nutz.lang.util.NutMap; import org.nutz.mvc.annotation.At; import org.nutz.mvc.annotation.Ok; @@ -125,14 +127,29 @@ public class ActivityReimbursementMineController { $condition """); Cnd cnd = Cnd.NEW(); - pageParam.buildSearch(cnd, "info."); - if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_MEMBER_ADMIN.name())) { - if (AuthUtil.hasRole(RoleConstant.BRANCH_UNION_CHAIRMAN.name())) { - cnd.and("info.unionId", "=", SecurityUtil.getUnionId()); - } else { - cnd.and("info.userId", "=", SecurityUtil.getUserId()); - } + SqlExpressionGroup group = new SqlExpressionGroup(); + if (AuthUtil.hasPermission("activityReimbursement.apply.schoolHas")){ + group.or("info.reimbursementIdentity","=","school"); } + if (AuthUtil.hasPermission("activityReimbursement.apply.unionHas")){ + SqlExpressionGroup unionGroup = new SqlExpressionGroup(); + unionGroup.and("info.unionId", "=", SecurityUtil.getUnionId()); + unionGroup.and("info.reimbursementIdentity","=","union"); + group.or(unionGroup); + } + if (AuthUtil.hasPermission("activityReimbursement.apply.clubHas")){ + SqlExpressionGroup clubGroup = new SqlExpressionGroup(); + clubGroup.and("info.clubId", "in", SecurityUtil.getClubIds()); + clubGroup.and("info.reimbursementIdentity","=","club"); + group.or(clubGroup); + } + if (Lang.isNotEmpty(group)){ + cnd.and(group); + }else{ + cnd.and("info.userId", "=", SecurityUtil.getUserId()); + } + + cnd.andEX("info.clubId", "=", pageParam.getClubId()); cnd.andEX("YEAR(info.applyTime)", "=", pageParam.getYear()); if (StrUtil.isAllBlank(pageParam.getPageOrderName(), pageParam.getPageOrderBy())) { cnd.desc("info.applyTime"); diff --git a/src/main/java/com/budwk/app/zhgh/activity/declarereimbursement/reimbursement/models/ActivityReimbursementInfo.java b/src/main/java/com/budwk/app/zhgh/activity/declarereimbursement/reimbursement/models/ActivityReimbursementInfo.java index 48051c0..d9f2571 100644 --- a/src/main/java/com/budwk/app/zhgh/activity/declarereimbursement/reimbursement/models/ActivityReimbursementInfo.java +++ b/src/main/java/com/budwk/app/zhgh/activity/declarereimbursement/reimbursement/models/ActivityReimbursementInfo.java @@ -36,6 +36,11 @@ public class ActivityReimbursementInfo extends ActivityDeclareInfo { @ColDefine(type = ColType.VARCHAR, width = 32) private String declareId; + @Column + @Comment("报销身份(school/union/club)") + @ColDefine(type = ColType.VARCHAR, width = 30) + private String reimbursementIdentity; + @Column @Comment("报销模式") @ColDefine(type = ColType.VARCHAR, width = 30) diff --git a/src/main/resources/views/platform/zhgh/activity/declarereimbursement/reimbursement/apply/index.html b/src/main/resources/views/platform/zhgh/activity/declarereimbursement/reimbursement/apply/index.html index 1a1efd1..1a8e551 100644 --- a/src/main/resources/views/platform/zhgh/activity/declarereimbursement/reimbursement/apply/index.html +++ b/src/main/resources/views/platform/zhgh/activity/declarereimbursement/reimbursement/apply/index.html @@ -13,8 +13,18 @@ layout("/layouts/platform.html"){ - - + + + + + {{i.name}} + + + + + @@ -37,7 +47,8 @@ layout("/layouts/platform.html"){ + v-if="['ACTIVITY_BUDGET_TYPE_THREE'].includes(formData.outlayManageSource) +||formData.reimbursementIdentity==='club'"> - - + @@ -327,6 +334,7 @@ layout("/layouts/platform.html"){ }, activityOptions: [], + reimbursementIdentityOption: [], declareDialogVisible: false, @@ -347,20 +355,21 @@ layout("/layouts/platform.html"){ filteredBudgetOption() { if (this.hasSchoolLevelRole()) { return this.budgetOption; - } else if (this.formData.outlayManageSource === "ACTIVITY_BUDGET_TYPE_ONE" && - (this.hasUnionRole() || this.hasClubRole())) { - return this.budgetOption.filter(item => { - if (this.hasUnionRole() && this.hasClubRole()) { - return item.isUnionUse === true || item.isClubUse === true; - } - else if (this.hasUnionRole()) { - return item.isUnionUse === true; - } - else if (this.hasClubRole()) { - return item.isClubUse === true; - } - return true; - }); + } else if (this.formData.outlayManageSource === "ACTIVITY_BUDGET_TYPE_ONE") { + if (this.hasUnionRole() || this.hasClubRole()) { + return this.budgetOption.filter(item => { + if (this.hasUnionRole() && this.hasClubRole()) { + return item.isUnionUse === true || item.isClubUse === true; + } else if (this.hasUnionRole()) { + return item.isUnionUse === true; + } else if (this.hasClubRole()) { + return item.isClubUse === true; + } + return true; + }); + } + }else{ + return this.budgetOption; } return []; } @@ -385,6 +394,14 @@ layout("/layouts/platform.html"){ this.getBudgetByYear() this.getActivityReimbursementByUser() }, + reimbursementIdentityChange(val) { + this.$set(this.formData, "unionId", this.$store.state.user.union.id) + if (val === "school") { + this.$set(this.formData, "declareUnitName", "校工会") + } else if (val === "union") { + this.$set(this.formData, "declareUnitName", this.$store.state.user.union.name) + } + }, outlayManageSourceChange(val) { this.$set(this.formData, 'clubId', null) this.$set(this.formData, 'deductionBudgetId', null) @@ -395,13 +412,6 @@ layout("/layouts/platform.html"){ if (val === "ACTIVITY_BUDGET_TYPE_ONE" && !this.hasSchoolLevelRole()) { this.$set(this.formData, 'activityReimbursementMode', 'daily') } - - if (val === "ACTIVITY_BUDGET_TYPE_ONE") { - this.$set(this.formData, "declareUnitName", "校工会") - } else if (val === "ACTIVITY_BUDGET_TYPE_TWO") { - this.$set(this.formData, "unionId", this.$store.state.user.union.id) - this.$set(this.formData, "declareUnitName", this.$store.state.user.union.name) - } this.getBudgetByYear() this.getActivityReimbursementByUser() }, @@ -429,6 +439,14 @@ layout("/layouts/platform.html"){ }, // 保存 onSave() { + if (this.formData.reimbursementIdentity === 'union' && this.formData.outlayManageSource === "ACTIVITY_BUDGET_TYPE_THREE") { + this.$message.error("报销身份如果是分工会,不能报销协会经费!") + return + } + if (this.formData.reimbursementIdentity === 'club' && this.formData.outlayManageSource === "ACTIVITY_BUDGET_TYPE_TWO") { + this.$message.error("报销身份如果是协会,不能报销分工会经费!") + return + } this.$confirm("您确定保存吗?", "提示", { confirmButtonText: "确定", cancelButtonText: "取消", @@ -455,6 +473,15 @@ layout("/layouts/platform.html"){ this.$message.error("请填写费用!") return } + if (this.formData.reimbursementIdentity === 'union' && this.formData.outlayManageSource === "ACTIVITY_BUDGET_TYPE_THREE") { + this.$message.error("报销身份如果是分工会,不能报销协会经费!") + return + } + if (this.formData.reimbursementIdentity === 'club' && this.formData.outlayManageSource === "ACTIVITY_BUDGET_TYPE_TWO") { + this.$message.error("报销身份如果是协会,不能报销分工会经费!") + return + } + this.$confirm("您确定要提交吗?", "提示", { confirmButtonText: "确定", cancelButtonText: "取消", @@ -578,7 +605,7 @@ layout("/layouts/platform.html"){ } if (this.$auth.hasPermission('activityReimbursement.apply.schoolHas')) { - const allCodes = [ "ACTIVITY_BUDGET_TYPE_TWO", "ACTIVITY_BUDGET_TYPE_THREE"] + const allCodes = ["ACTIVITY_BUDGET_TYPE_TWO", "ACTIVITY_BUDGET_TYPE_THREE"] allCodes.forEach(code => { const option = resp.find(v => v.code === code) if (option && !budgetTypeCloseOption.some(existing => existing.code === code)) { @@ -603,10 +630,22 @@ layout("/layouts/platform.html"){ this.budgetTypeOption = budgetTypeCloseOption }) }, + initReimbursementIdentity() { + if (this.$auth.hasPermission('activityReimbursement.apply.schoolHas')) { + this.reimbursementIdentityOption.push({name: "校工会", code: "school"}) + } + if (this.$auth.hasPermission('activityReimbursement.apply.unionHas')) { + this.reimbursementIdentityOption.push({name: "分工会", code: "union"}) + } + if (this.$auth.hasPermission('activityReimbursement.apply.clubHas')) { + this.reimbursementIdentityOption.push({name: "协会", code: "club"}) + } + } }, async created() { this.clubOption = await this.$businessTool.listCLubByRole() this.initBudgetType() + this.initReimbursementIdentity() if (this.bizId) { this.findOne() }