This commit is contained in:
JyuHsin
2026-02-04 17:58:05 +08:00
5 changed files with 106 additions and 41 deletions
@@ -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));
@@ -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);
// 自动完成第一个申请任务
@@ -35,9 +35,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;
@@ -126,14 +128,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");
@@ -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)
@@ -13,8 +13,18 @@ layout("/layouts/platform.html"){
<el-form :model="formData" ref="formRef" :rules="formRules" label-width="0" label-suffix=""
class="flow-task-form">
<el-descriptions :column="2" border>
<el-descriptions-item label="经费类型">
<el-descriptions-item label="报销身份" :span="2">
<el-form-item label="报销身份" prop="reimbursementIdentity"
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<el-radio-group v-model="formData.reimbursementIdentity"
@change="reimbursementIdentityChange" :disabled="taskId">
<el-radio border :label="i.code" :key="i.code" v-for="i in reimbursementIdentityOption">
{{i.name}}
</el-radio>
</el-radio-group>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="经费类型" :span="2">
<el-form-item label="经费类型" prop="outlayManageSource"
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<el-radio-group v-model="formData.outlayManageSource" @change="outlayManageSourceChange">
@@ -37,7 +47,8 @@ layout("/layouts/platform.html"){
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="所属协会"
v-if="['ACTIVITY_BUDGET_TYPE_THREE'].includes(formData.outlayManageSource)">
v-if="['ACTIVITY_BUDGET_TYPE_THREE'].includes(formData.outlayManageSource)
||formData.reimbursementIdentity==='club'">
<el-form-item label="所属协会" prop="clubId"
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<el-select
@@ -94,7 +105,7 @@ layout("/layouts/platform.html"){
<el-descriptions-item label="扣款预算">
<el-form-item prop="deductionBudgetId" label="扣款预算"
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<el-select v-model="formData.deductionBudgetId" style="width: 100%;"
<el-select v-model="formData.deductionBudgetId" style="width: 100%;"
filterable placeholder="选择扣款预算">
<el-option
v-for="item in filteredBudgetOption"
@@ -105,11 +116,11 @@ layout("/layouts/platform.html"){
</el-select>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item
v-if="formData.activityReimbursementMode!=='activity'
&&
['ACTIVITY_BUDGET_TYPE_THREE'].includes(formData.outlayManageSource)"></el-descriptions-item>
<el-descriptions-item v-if="formData.activityReimbursementMode!=='activity'
&&
!['ACTIVITY_BUDGET_TYPE_THREE'].includes(formData.outlayManageSource)
&&formData.reimbursementIdentity!=='club'"></el-descriptions-item>
<template v-if="formData.activityReimbursementMode==='activity'">
<el-descriptions-item label="实际活动时间">
@@ -143,10 +154,6 @@ layout("/layouts/platform.html"){
</el-date-picker>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item
v-if="formData.activityReimbursementMode==='activity'
&&
['ACTIVITY_BUDGET_TYPE_THREE'].includes(formData.outlayManageSource)"></el-descriptions-item>
</template>
<el-descriptions-item label="费用" :span="2">
@@ -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()
}