feat: 经费预算管理2

This commit is contained in:
2026-11-05 19:39:22 +08:00
parent e7fbf4021e
commit 1ddfa7e609
2 changed files with 15 additions and 6 deletions
@@ -131,8 +131,8 @@ public class OutlayAnnualAllocateService extends BaseServiceImpl<OutlayManageUni
BigDecimal calculated = null;
if ("base".equals(type)) {
if (old == null) return Result.error("请先生成基础经费记录");
memberCount = old.getInt("memberCount");
if (confirmed) {
memberCount = old.getInt("memberCount");
standard = new BigDecimal(old.get("standard").toString());
}
if (memberCount == null || memberCount < 0 || !moneyValid(standard)) return Result.error("人数和标准不正确");
@@ -3,6 +3,9 @@ layout("/layouts/platform.html"){
#-->
<style>
<!--#include("../fixedListLayout.css"){}#-->
.fund-log-dialog .el-dialog { width: 94%; max-width: 1800px; height: 86vh; display: flex; flex-direction: column; }
.fund-log-dialog .el-dialog__body { padding: 16px 24px 24px; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.fund-log-dialog .el-pagination { margin-top: 16px; text-align: right; flex: 0 0 auto; }
.fund-edit-dialog .el-dialog { max-width: calc(100vw - 32px); }
.fund-edit-dialog .el-dialog__body { padding: 20px 28px; max-height: 65vh; overflow-y: auto; }
.fund-edit-dialog .el-dialog__footer { padding: 16px 28px; border-top: 1px solid #ebeef5; }
@@ -102,7 +105,7 @@ layout("/layouts/platform.html"){
<el-form-item label="分工会"><el-select v-model="form.unionId" filterable :disabled="!isNew"><el-option v-for="u in unionList" :key="u.id" :value="u.id" :label="u.name"></el-option></el-select></el-form-item>
<div class="fund-edit-section">金额核算</div>
<template v-if="tab==='base'">
<el-form-item label="统计人数"><el-input-number v-model="form.memberCount" :min="0" :max="99999999" :precision="0" :disabled="form.status===1"></el-input-number></el-form-item>
<el-form-item label="统计人数"><el-input :value="form.memberCount" readonly><template slot="append">人</template></el-input></el-form-item>
<el-form-item label="人均标准(元/年)"><el-input-number v-model="form.standard" :min="0" :max="99999999.99" :precision="2" :disabled="form.status===1"></el-input-number></el-form-item>
<el-form-item label="计算金额(元)"><span class="fund-edit-calculated">{{calculated}} <small>元</small></span><div class="fund-edit-hint">统计人数 × 人均年度标准</div></el-form-item>
</template>
@@ -116,8 +119,8 @@ layout("/layouts/platform.html"){
</el-form>
<span slot="footer"><el-button @click="editVisible=false" :disabled="busy">取消</el-button><el-button type="primary" :loading="busy" @click="save">{{form.status===1?'保存调整':'保存'}}</el-button></span>
</el-dialog>
<el-dialog title="经费操作记录" :visible.sync="logsVisible" width="900px">
<el-table :data="logs" border v-loading="logsLoading">
<el-dialog title="经费操作记录" :visible.sync="logsVisible" width="94%" top="4vh" class="fund-log-dialog">
<el-table :data="logs" height="100%" style="flex: 1; min-height: 0;" border v-loading="logsLoading">
<el-table-column prop="action" label="操作" width="100"></el-table-column>
<el-table-column prop="operatorName" label="操作人" width="100"></el-table-column>
<el-table-column label="时间" width="165"><template slot-scope="{row}">{{time(row.createdAt)}}</template></el-table-column>
@@ -196,7 +199,8 @@ layout("/layouts/platform.html"){
edit(row) {
this.isNew=false
this.originalAllocateMoney=Number(row.allocateMoney)
this.form=Object.assign({},row,{year:String(row.year), status:Number(row.status), memberCount:Number(row.memberCount), standard:Number(row.standard), allocateMoney:Number(row.allocateMoney)})
this.form=Object.assign({},row,{year:String(row.year), status:Number(row.status), allocateMoney:Number(row.allocateMoney)})
if (this.tab==='base') Object.assign(this.form,{memberCount:Number(row.memberCount),standard:Number(row.standard)})
this.editVisible=true
},
async addSpecial() {
@@ -207,9 +211,14 @@ layout("/layouts/platform.html"){
async save() {
if (!this.form.year || !this.form.unionId || this.form.allocateMoney==null) { this.$message.warning('请填写年度、分工会和金额'); return }
if (this.busy) return
if (!Number.isFinite(this.form.allocateMoney) || this.form.allocateMoney<0) { this.$message.warning('请输入有效的下拨金额'); return }
if (this.tab==='base' && (!Number.isFinite(this.form.standard) || this.form.standard<0)) { this.$message.warning('请输入有效的人均标准'); return }
if (this.remarkRequired && !(this.form.remark || '').trim()) { this.$message.warning('请填写金额调整原因'); return }
this.busy=true
try { await this.request('save',Object.assign({},this.form,{type:this.tab})); this.$message.success('保存成功'); this.editVisible=false; this.doSearch() }
const payload={type:this.tab,id:this.form.id,year:this.form.year,unionId:this.form.unionId,allocateMoney:this.form.allocateMoney,remark:this.form.remark,version:this.form.version}
if (this.tab==='base') payload.standard=this.form.standard
else payload.projectName=this.form.projectName
try { await this.request('save',payload); this.$message.success('保存成功'); this.editVisible=false; this.doSearch() }
catch(e) {} finally { this.busy=false }
},
async batchConfirm() {