费用报销整改

This commit is contained in:
=
2026-01-30 14:30:32 +08:00
parent ad5ab0caa7
commit 7ff5f74c39
5 changed files with 170 additions and 28 deletions
@@ -77,7 +77,9 @@ public class ActivityReimbursementServiceImpl extends BaseServiceImpl<ActivityRe
ab.isSchoolBudget,
ab.schoolBudgetId,
ab.totalBudgetMoney,
ab.activityMatter
ab.activityMatter,
ab.isUnionUse,
ab.isClubUse
FROM
activity_budget ab
LEFT JOIN wf_process_instance ins ON ins.businessNo = ab.id
@@ -1,6 +1,7 @@
package com.budwk.app.zhgh.dayofficework.outlay.activityBudget.conteoller;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.dev33.satoken.annotation.SaMode;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONObject;
@@ -11,6 +12,7 @@ import com.budwk.app.base.result.Result;
import com.budwk.app.sys.models.Sys_file;
import com.budwk.app.zhgh.dayofficework.outlay.activityBudget.models.ActivityBudget;
import com.budwk.app.zhgh.dayofficework.outlay.activityBudget.service.ActivityBudgetApplyStatisticsService;
import com.budwk.app.zhgh.dayofficework.unionReimburse.model.UnionReimburse;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.nutz.aop.interceptor.ioc.TransAop;
@@ -88,4 +90,13 @@ public class ActivityBudgetAllocationEditController {
Cnd.where("id", "=", id));
return Result.success();
}
@At
@Aop(TransAop.READ_COMMITTED)
@SaCheckPermission("activity.budget.allocationEdit")
@SLog(tag = "管理员设置预算使用范围")
public Result setScope(String id,ActivityBudget budget) {
applyStatisticsService.updateIgnoreNull(budget);
return Result.success();
}
}
@@ -129,6 +129,18 @@ public class ActivityBudget extends BaseModel implements Serializable {
@ColDefine(type = ColType.BOOLEAN)
private Boolean isRepeatReimburse;
@Column
@Comment("是否可用于分工会预算")
@Default("0")
@ColDefine(type = ColType.BOOLEAN)
private Boolean isUnionUse;
@Column
@Comment("是否可用于协会预算")
@Default("0")
@ColDefine(type = ColType.BOOLEAN)
private Boolean isClubUse;
@Column
@Comment("校工会预算")
@ColDefine(type = ColType.VARCHAR,width = 32)
@@ -29,7 +29,8 @@ layout("/layouts/platform.html"){
<el-form-item prop="activityReimbursementMode" label="报销模式"
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<el-radio-group v-model="formData.activityReimbursementMode"
@change="getActivityReimbursementByUser">
@change="getActivityReimbursementByUser"
:disabled="isDailyReimbursementFixed">
<el-radio-button label="activity">活动报销</el-radio-button>
<el-radio-button label="daily">日常报销</el-radio-button>
</el-radio-group>
@@ -93,13 +94,12 @@ 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 budgetOption"
v-for="item in filteredBudgetOption"
:key="item.id"
:label="'预算名称:'+item.activityMatter + ',申报预算:' + item.totalBudgetMoney + ',已使用:'+item.usedBudgetMoney"
:label="getBudgetLabel(item)"
:value="item.id">
</el-option>
</el-select>
@@ -338,7 +338,60 @@ layout("/layouts/platform.html"){
components: {
"info": INFO,
},
computed: {
isDailyReimbursementFixed() {
return !this.hasSchoolLevelRole() &&
this.formData.outlayManageSource === "ACTIVITY_BUDGET_TYPE_ONE";
},
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;
});
}
return this.budgetOption;
}
},
methods: {
hasUnionRole() {
return this.$auth.hasRoleOr([
"UNION_REIMBURSEMENT_MANAGER",
"BRANCH_UNION_CHAIRMAN",
"BRANCH_UNION_WENTI_SPORTS",
"BRANCH_UNION_ADMIN",
"BRANCH_UNION_VICE_CHAIRMAN"
]);
},
hasClubRole() {
return this.$auth.hasRoleOr([
"CLUB_REIMBURSEMENT_MANAGER",
"CLUB_PRESIDENT"
]);
},
hasSchoolLevelRole() {
return this.$auth.hasRoleOr([
"SYSADMIN",
"SCHOOL_UNION_ADMIN",
"SCHOOL_UNION_CHAIRMAN",
"SCHOOL_UNION_VICE_CHAIRMAN"
]);
},
clubIdChange() {
this.$set(this.formData, 'deductionBudgetId', null)
const club = this.clubOption.find(v => v.id === this.formData.clubId)
@@ -352,6 +405,11 @@ layout("/layouts/platform.html"){
this.$set(this.formData, 'declareId', null)
this.$set(this.formData, 'budgets', [])
this.$set(this.formData, 'activityTime', [])
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") {
@@ -369,9 +427,20 @@ layout("/layouts/platform.html"){
}).then(res => {
if (res.code === 0) {
this.budgetOption = res.data
console.log(this.budgetOption)
}
})
},
getBudgetLabel(item) {
if (this.hasSchoolLevelRole()) {
return '预算名称:' + item.activityMatter + ',申报预算:' + item.totalBudgetMoney + ',已使用:' + item.usedBudgetMoney
} else if (this.formData.outlayManageSource === "ACTIVITY_BUDGET_TYPE_ONE" &&
(this.hasUnionRole() || this.hasClubRole())) {
return '预算名称:' + item.activityMatter
} else {
return '预算名称:' + item.activityMatter + ',申报预算:' + item.totalBudgetMoney + ',已使用:' + item.usedBudgetMoney
}
},
// 保存
onSave() {
this.$confirm("您确定保存吗?", "提示", {
@@ -517,34 +586,36 @@ layout("/layouts/platform.html"){
this.$businessTool.getDictOptions("ACTIVITY_BUDGET_TYPE").then(resp => {
this.budgetTypeOption = resp
const budgetTypeCloseOption = []
if (this.$auth.hasRoleOr(["SYSADMIN", "SCHOOL_UNION_ADMIN"])) {
const typeOneOption = resp.find(v => v.code === "ACTIVITY_BUDGET_TYPE_ONE")
if (typeOneOption) {
budgetTypeCloseOption.push(typeOneOption)
}
if (this.$auth.hasRoleOr(["SYSADMIN", "SCHOOL_UNION_ADMIN","SCHOOL_UNION_CHAIRMAN","SCHOOL_UNION_VICE_CHAIRMAN"])) {
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)) {
budgetTypeCloseOption.push(option)
}
})
} else {
if (this.$auth.hasRoleOr(["SCHOOL_REIMBURSEMENT_MANAGER"])) {
this.budgetTypeOption.map(v => {
if (["ACTIVITY_BUDGET_TYPE_ONE"].includes(v.code)) {
budgetTypeCloseOption.push(v)
}
})
}
if (this.$auth.hasRoleOr(["UNION_REIMBURSEMENT_MANAGER", "BRANCH_UNION_CHAIRMAN", "BRANCH_UNION_WENTI_SPORTS"])) {
this.budgetTypeOption.map(v => {
if (["ACTIVITY_BUDGET_TYPE_TWO"].includes(v.code)) {
budgetTypeCloseOption.push(v)
}
})
if (this.$auth.hasRoleOr(["UNION_REIMBURSEMENT_MANAGER", "BRANCH_UNION_CHAIRMAN", "BRANCH_UNION_WENTI_SPORTS","BRANCH_UNION_ADMIN","BRANCH_UNION_VICE_CHAIRMAN"])) {
const typeTwoOption = resp.find(v => v.code === "ACTIVITY_BUDGET_TYPE_TWO")
if (typeTwoOption && !budgetTypeCloseOption.some(existing => existing.code === "ACTIVITY_BUDGET_TYPE_TWO")) {
budgetTypeCloseOption.push(typeTwoOption)
}
}
if (this.$auth.hasRoleOr(["CLUB_REIMBURSEMENT_MANAGER", "CLUB_PRESIDENT"])) {
this.budgetTypeOption.map(v => {
if (["ACTIVITY_BUDGET_TYPE_THREE"].includes(v.code)) {
budgetTypeCloseOption.push(v)
}
})
const typeThreeOption = resp.find(v => v.code === "ACTIVITY_BUDGET_TYPE_THREE")
if (typeThreeOption && !budgetTypeCloseOption.some(existing => existing.code === "ACTIVITY_BUDGET_TYPE_THREE")) {
budgetTypeCloseOption.push(typeThreeOption)
}
}
this.budgetTypeOption = budgetTypeCloseOption
}
})
this.budgetTypeOption = budgetTypeCloseOption
})
},
},
async created() {
@@ -104,7 +104,7 @@ layout("/layouts/platform.html"){
</template>
</el-table-column>
<el-table-column align="center" fixed="right" header-align="center" label="操作"
width="200">
width="250">
<template slot-scope="{row}">
<el-button @click="openView(row)" size="mini" type="primary">
查看
@@ -112,6 +112,9 @@ layout("/layouts/platform.html"){
<el-button @click="openEdit(row)" size="mini" type="primary">
编辑
</el-button>
<el-button v-if="row.outlayManageSource == 'ACTIVITY_BUDGET_TYPE_ONE'" @click="setScope(row)" size="mini" type="primary">
设置范围
</el-button>
<!-- <el-button @click="doDelete(row.id)" size="mini" type="danger"
:disabled="!['superadmin'].includes($store.state.user.loginname)">
删除
@@ -152,6 +155,26 @@ layout("/layouts/platform.html"){
</div>
</activity-budget-info>
</template>
<el-dialog title="设置预算使用范围" :visible.sync="scopeDialogVisible" width="400px">
<el-form :model="scopeForm" label-width="150px">
<el-form-item label="是否用于分工会:">
<el-radio-group v-model="scopeForm.isUnionUse">
<el-radio :label="true"></el-radio>
<el-radio :label="false"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="是否用于协会:">
<el-radio-group v-model="scopeForm.isClubUse">
<el-radio :label="true"></el-radio>
<el-radio :label="false"></el-radio>
</el-radio-group>
</el-form-item>
</el-form>
<div slot="footer">
<el-button @click="scopeDialogVisible = false">取消</el-button>
<el-button type="primary" @click="saveScopeSetting">确定</el-button>
</div>
</el-dialog>
</guava>
</div>
@@ -164,6 +187,8 @@ layout("/layouts/platform.html"){
dicts: ["ACTIVITY_BUDGET_REIMBURSE_TYPE"],
data() {
return {
scopeDialogVisible: false,
scopeForm: {},
declareTotalBudgetMoney: 0,
totalBudgetMoney: 0,
budgetTypeOption: [],
@@ -197,6 +222,27 @@ layout("/layouts/platform.html"){
"activity-budget-info": ACTIVITY_BUDGET_INFO
},
methods: {
setScope(row) {
this.scopeForm = {
id: row.id,
isUnionUse: row.isUnionUse || false,
isClubUse: row.isClubUse || false
};
this.scopeDialogVisible = true;
},
saveScopeSetting() {
this.$axios.post(loc() + "/setScope", this.scopeForm)
.then(resp => {
if (resp.code === 0) {
this.$message.success('设置成功');
this.scopeDialogVisible = false;
this.doSearch();
} else {
this.$message.error(resp.message);
}
});
},
doSubmit() {
this.$refs.formRef.validate((valid) => {
if (valid) {