协会整改
This commit is contained in:
@@ -22,8 +22,9 @@ layout("/layouts/platform.html"){
|
||||
width: 80px;
|
||||
}
|
||||
/* 财务明细表格高度 */
|
||||
.finance-table {
|
||||
.finance-table >>> .el-table__body-wrapper {
|
||||
max-height: 600px;
|
||||
overflow-y: auto !important;
|
||||
}
|
||||
/* 统计表格高度 */
|
||||
.stat-table {
|
||||
@@ -725,7 +726,12 @@ layout("/layouts/platform.html"){
|
||||
},
|
||||
// 计算年度结余
|
||||
calcSurplus(row) {
|
||||
const total = (row.lastYearSurplus || 0) + (row.income || 0) + (row.allocate || 0) + (row.support || 0) - (row.totalExpend || 0);
|
||||
const lastYearSurplusVal = this.lastYearSurplus !== null ? this.lastYearSurplus : (row.lastYearSurplus || 0);
|
||||
const income = row.income || 0;
|
||||
const allocate = row.allocate || 0;
|
||||
const support = row.support || 0;
|
||||
const totalExpend = row.totalExpend || 0;
|
||||
const total = Number(lastYearSurplusVal) + Number(income) + Number(allocate) + Number(support) - Number(totalExpend);
|
||||
return this.formatNumber(total);
|
||||
},
|
||||
// 表单校验通用方法
|
||||
@@ -783,13 +789,43 @@ layout("/layouts/platform.html"){
|
||||
this.formData = data;
|
||||
// 初始化财务数据
|
||||
this.financeData.incomeCensus = data.incomeCensus || [{ lastYearSurplus: 0, income: 0, allocate: 0, support: 0, totalExpend: 0, surplus: 0 }];
|
||||
this.financeData.incomeDetailed = data.detailedList || [];
|
||||
|
||||
// 从统计数据中提取去年年度结余
|
||||
if (this.financeData.incomeCensus && this.financeData.incomeCensus.length > 0) {
|
||||
this.lastYearSurplus = this.financeData.incomeCensus[0].lastYearSurplus || 0;
|
||||
}
|
||||
|
||||
if (data.detailedList && data.detailedList.length > 0) {
|
||||
this.financeData.incomeDetailed = this.sortIncomeDetailed(data.detailedList);
|
||||
} else {
|
||||
this.financeData.incomeDetailed = [];
|
||||
}
|
||||
// 初始化成员数据
|
||||
await this.fetchClubUserNum(data.clubId);
|
||||
await this.fetchMemberList(data.clubId);
|
||||
// 检查是否已登记
|
||||
await this.checkIsRegistered();
|
||||
},
|
||||
sortIncomeDetailed(list) {
|
||||
const defaultContents = [new Date().getFullYear() - 1 + "年度结余", "会费收入", "校工会拨款"];
|
||||
const defaultItems = [];
|
||||
const customItems = [];
|
||||
|
||||
list.forEach(item => {
|
||||
if (item.content && defaultContents.includes(item.content)) {
|
||||
defaultItems.push(item);
|
||||
} else {
|
||||
customItems.push(item);
|
||||
}
|
||||
});
|
||||
|
||||
// 按默认顺序排列前三条
|
||||
const sortedDefaults = defaultContents.map(content =>
|
||||
defaultItems.find(item => item.content === content)
|
||||
).filter(item => item !== undefined);
|
||||
|
||||
return [...sortedDefaults, ...customItems];
|
||||
},
|
||||
// 获取社团成员数量
|
||||
async fetchClubUserNum(clubId) {
|
||||
const resp = await this.$axios.post("/platform/club/examine/apply/getClubUserNum", {
|
||||
@@ -830,6 +866,11 @@ layout("/layouts/platform.html"){
|
||||
year: this.formData.year
|
||||
});
|
||||
this.lastYearSurplus = resp.data || 0;
|
||||
|
||||
// 同步更新到统计表格
|
||||
if (this.financeData.incomeCensus && this.financeData.incomeCensus.length > 0) {
|
||||
this.financeData.incomeCensus[0].lastYearSurplus = this.lastYearSurplus;
|
||||
}
|
||||
},
|
||||
// 获取上年度社团数据
|
||||
async fetchLastClubData() {
|
||||
@@ -897,22 +938,25 @@ layout("/layouts/platform.html"){
|
||||
},
|
||||
// 删除财务明细项
|
||||
deleteFinanceItem(row, index) {
|
||||
// 扣除对应统计金额
|
||||
this.financeData.incomeCensus[0].income = (this.financeData.incomeCensus[0].income || 0) - (Number(row.income) || 0);
|
||||
this.financeData.incomeCensus[0].support = (this.financeData.incomeCensus[0].support || 0) - (Number(row.income) || 0);
|
||||
this.financeData.incomeCensus[0].totalExpend = (this.financeData.incomeCensus[0].totalExpend || 0) - (Number(row.expend) || 0);
|
||||
// 根据收支类型扣除对应统计金额
|
||||
const income = Number(row.income) || 0;
|
||||
const expend = Number(row.expend) || 0;
|
||||
|
||||
if (row.incomeType === "会费收入") {
|
||||
this.financeData.incomeCensus[0].income = (this.financeData.incomeCensus[0].income || 0) - income;
|
||||
} else if (row.incomeType === "校工会拨款") {
|
||||
this.financeData.incomeCensus[0].allocate = (this.financeData.incomeCensus[0].allocate || 0) - income;
|
||||
} else if (row.incomeType === "社会赞助") {
|
||||
this.financeData.incomeCensus[0].support = (this.financeData.incomeCensus[0].support || 0) - income;
|
||||
} else if (row.incomeType === "支出") {
|
||||
this.financeData.incomeCensus[0].totalExpend = (this.financeData.incomeCensus[0].totalExpend || 0) - expend;
|
||||
}
|
||||
|
||||
// 删除明细项
|
||||
this.financeData.incomeDetailed.splice(index, 1);
|
||||
// 清空统计数据
|
||||
if (this.financeData.incomeDetailed.length === 0) {
|
||||
this.financeData.incomeCensus = [{
|
||||
income: this.dueIncome,
|
||||
allocate: this.unionAllocate,
|
||||
support: 0,
|
||||
totalExpend: 0,
|
||||
surplus: 0
|
||||
}];
|
||||
}
|
||||
|
||||
// 重新计算统计数据,确保准确性
|
||||
this.recalculateCensus();
|
||||
},
|
||||
// 收支类型变化处理
|
||||
handleIncomeTypeChange(row) {
|
||||
@@ -933,27 +977,31 @@ layout("/layouts/platform.html"){
|
||||
// 年初余额输入处理
|
||||
handleQcMoneyInput(row) {
|
||||
this.lastYearSurplus = Number(row.qcMoney) || 0;
|
||||
// 同步更新到统计表格
|
||||
if (this.financeData.incomeCensus && this.financeData.incomeCensus.length > 0) {
|
||||
this.financeData.incomeCensus[0].lastYearSurplus = this.lastYearSurplus;
|
||||
}
|
||||
// 更新后强制重新计算统计数据
|
||||
this.$forceUpdate();
|
||||
},
|
||||
// 收入输入处理
|
||||
handleIncomeInput(row) {
|
||||
// 计算总收入
|
||||
let totalIncome = 0;
|
||||
this.financeData.incomeDetailed.forEach(item => {
|
||||
totalIncome += Number(item.income) || 0;
|
||||
});
|
||||
this.financeData.incomeCensus[0].income = totalIncome;
|
||||
// 按类型更新对应统计
|
||||
if (row.incomeType === "社会赞助") this.calcSupportTotal();
|
||||
if (row.incomeType === "校工会拨款") this.calcAllocateTotal();
|
||||
if (row.incomeType === "会费收入") this.calcDueIncomeTotal();
|
||||
if (row.incomeType === "社会赞助") {
|
||||
this.calcSupportTotal();
|
||||
} else if (row.incomeType === "校工会拨款") {
|
||||
this.calcAllocateTotal();
|
||||
} else if (row.incomeType === "会费收入") {
|
||||
this.calcDueIncomeTotal();
|
||||
}
|
||||
// 重新计算所有统计数据,确保一致性
|
||||
this.recalculateCensus();
|
||||
},
|
||||
// 支出输入处理
|
||||
handleExpendInput: function() {
|
||||
let totalExpend = 0;
|
||||
this.financeData.incomeDetailed.forEach(item => {
|
||||
totalExpend += Number(item.expend) || 0;
|
||||
});
|
||||
this.financeData.incomeCensus[0].totalExpend = totalExpend;
|
||||
this.calcExpendTotal();
|
||||
// 重新计算所有统计数据,确保一致性
|
||||
this.recalculateCensus();
|
||||
},
|
||||
// 计算校工会拨款合计
|
||||
calcAllocateTotal() {
|
||||
@@ -984,6 +1032,43 @@ layout("/layouts/platform.html"){
|
||||
.reduce((sum, item) => sum + (Number(item.expend) || 0), 0);
|
||||
this.financeData.incomeCensus[0].totalExpend = total;
|
||||
},
|
||||
// 重新计算所有统计数据
|
||||
recalculateCensus() {
|
||||
// 计算会费收入总额
|
||||
const dueIncomeTotal = this.financeData.incomeDetailed
|
||||
.filter(item => item.incomeType === "会费收入")
|
||||
.reduce((sum, item) => sum + (Number(item.income) || 0), 0);
|
||||
|
||||
// 计算校工会拨款总额
|
||||
const allocateTotal = this.financeData.incomeDetailed
|
||||
.filter(item => item.incomeType === "校工会拨款")
|
||||
.reduce((sum, item) => sum + (Number(item.income) || 0), 0);
|
||||
|
||||
// 计算社会赞助总额
|
||||
const supportTotal = this.financeData.incomeDetailed
|
||||
.filter(item => item.incomeType === "社会赞助")
|
||||
.reduce((sum, item) => sum + (Number(item.income) || 0), 0);
|
||||
|
||||
// 计算总支出
|
||||
const totalExpend = this.financeData.incomeDetailed
|
||||
.filter(item => item.incomeType === "支出")
|
||||
.reduce((sum, item) => sum + (Number(item.expend) || 0), 0);
|
||||
|
||||
// 更新统计数据
|
||||
this.financeData.incomeCensus[0].income = dueIncomeTotal;
|
||||
this.financeData.incomeCensus[0].allocate = allocateTotal;
|
||||
this.financeData.incomeCensus[0].support = supportTotal;
|
||||
this.financeData.incomeCensus[0].totalExpend = totalExpend;
|
||||
// 确保去年年度结余不丢失
|
||||
this.financeData.incomeCensus[0].lastYearSurplus = this.lastYearSurplus;
|
||||
|
||||
// 同步更新全局变量
|
||||
this.dueIncome = dueIncomeTotal;
|
||||
this.unionAllocate = allocateTotal;
|
||||
|
||||
// 强制更新视图,确保年度结余重新计算
|
||||
this.$forceUpdate();
|
||||
},
|
||||
|
||||
/************************ 事件处理方法 ************************/
|
||||
// 年度变化处理
|
||||
|
||||
@@ -73,6 +73,10 @@ layout("/layouts/platform.html"){
|
||||
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
|
||||
<user-opinion-textarea v-model="formData.tf_opinion"></user-opinion-textarea>
|
||||
</el-form-item>
|
||||
<el-form-item label="电子签名" prop="tf_userSign"
|
||||
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
|
||||
<pc-signature v-model="formData.tf_userSign"></pc-signature>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row type="flex" justify="end">
|
||||
<el-button @click="$refs.guava.index()" size="small">取消</el-button>
|
||||
@@ -124,22 +128,27 @@ layout("/layouts/platform.html"){
|
||||
})
|
||||
},
|
||||
handleTaskAction(val) {
|
||||
this.$confirm("您确定要提交吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.$axios.post("/flow/common/executeTask", {
|
||||
data: JSON.stringify({
|
||||
...this.formData,
|
||||
submitType: val
|
||||
this.$refs.formRef.validate((valid) => {
|
||||
if (!valid) {
|
||||
return
|
||||
}
|
||||
this.$confirm("您确定要提交吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.$axios.post("/flow/common/executeTask", {
|
||||
data: JSON.stringify({
|
||||
...this.formData,
|
||||
submitType: val
|
||||
})
|
||||
}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$refs.guava.index()
|
||||
this.$message.success(res.msg)
|
||||
this.doSearch()
|
||||
}
|
||||
})
|
||||
}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$refs.guava.index()
|
||||
this.$message.success(res.msg)
|
||||
this.doSearch()
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
@@ -50,11 +50,13 @@ layout("/layouts/platform.html"){
|
||||
<enum-tag :value="row.instanceState" name="ProcessInstanceStateEnum" label_key="message" size="small"></enum-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="300">
|
||||
<el-table-column label="操作" width="420">
|
||||
<template v-slot="{row}">
|
||||
<el-button @click="openView(row)" size="mini" type="primary">查看</el-button>
|
||||
<el-button v-if="row.taskState === 10" @click="onAudit(row)" size="mini" type="primary">审核</el-button>
|
||||
<el-button v-if="row.canRevoke" @click="onRevoke(row)" size="mini" type="danger">撤回</el-button>
|
||||
<el-button @click="doExportPlan(row)" size="mini" type="primary">导出活动计划</el-button>
|
||||
<el-button @click="doExportActivity(row)" size="mini" type="primary">导出活动开展情况</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -73,6 +75,10 @@ layout("/layouts/platform.html"){
|
||||
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
|
||||
<user-opinion-textarea v-model="formData.tf_opinion"></user-opinion-textarea>
|
||||
</el-form-item>
|
||||
<el-form-item label="电子签名" prop="tf_userSign"
|
||||
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
|
||||
<pc-signature v-model="formData.tf_userSign"></pc-signature>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row type="flex" justify="end">
|
||||
<el-button @click="$refs.guava.index()" size="small">取消</el-button>
|
||||
@@ -124,22 +130,27 @@ layout("/layouts/platform.html"){
|
||||
})
|
||||
},
|
||||
handleTaskAction(val) {
|
||||
this.$confirm("您确定要提交吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.$axios.post("/flow/common/executeTask", {
|
||||
data: JSON.stringify({
|
||||
...this.formData,
|
||||
submitType: val
|
||||
this.$refs.formRef.validate((valid) => {
|
||||
if (!valid) {
|
||||
return
|
||||
}
|
||||
this.$confirm("您确定要提交吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.$axios.post("/flow/common/executeTask", {
|
||||
data: JSON.stringify({
|
||||
...this.formData,
|
||||
submitType: val
|
||||
})
|
||||
}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$refs.guava.index()
|
||||
this.$message.success(res.msg)
|
||||
this.doSearch()
|
||||
}
|
||||
})
|
||||
}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$refs.guava.index()
|
||||
this.$message.success(res.msg)
|
||||
this.doSearch()
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
@@ -157,6 +168,12 @@ layout("/layouts/platform.html"){
|
||||
})
|
||||
})
|
||||
},
|
||||
doExportPlan(row) {
|
||||
this.$downLoad("/platform/club/examine/schoolLeaderAudit/doExportPlan", { id: row.id })
|
||||
},
|
||||
doExportActivity(row) {
|
||||
this.$downLoad("/platform/club/examine/schoolLeaderAudit/doExportActivity", { id: row.id })
|
||||
},
|
||||
async pageData() {
|
||||
let form = clone(this.pageForm)
|
||||
if (form.isAudit === null) {
|
||||
|
||||
Reference in New Issue
Block a user