bug整改

This commit is contained in:
2026-04-25 11:41:14 +08:00
parent 14a150a335
commit 9b92c29197
11 changed files with 486 additions and 28 deletions
@@ -249,24 +249,24 @@ layout("/layouts/platform.html"){
async getActivityBudgetType() {
const data = await this.$businessTool.getDictOptions("ACTIVITY_BUDGET_TYPE")
let budgetTypeOption = []
if (this.$auth.hasRoleOr(['SYSADMIN'])) {
if (this.$auth.hasPermission(['activity.budget.apply.system'])) {
this.budgetTypeOption = data
} else {
if (this.$auth.hasRoleOr(['SCHOOL_UNION_ADMIN'])) {
if (this.$auth.hasPermission(['activity.budget.apply.schoolAdmin'])) {
data.map(v => {
if (["ACTIVITY_BUDGET_TYPE_ONE"].includes(v.code)) {
budgetTypeOption.push(v)
}
})
}
if (this.$auth.hasRoleOr(['BRANCH_UNION_ADMIN', 'BRANCH_UNION_CHAIRMAN'])) {
if (this.$auth.hasPermission(['activity.budget.apply.branchAdmin'])) {
data.map(v => {
if (["ACTIVITY_BUDGET_TYPE_TWO"].includes(v.code)) {
budgetTypeOption.push(v)
}
})
}
if (this.$auth.hasRoleOr(['CLUB_PRESIDENT'])) {
if (this.$auth.hasPermission(['activity.budget.apply.clubPresident'])) {
data.map(v => {
if (["ACTIVITY_BUDGET_TYPE_THREE"].includes(v.code)) {
budgetTypeOption.push(v)
@@ -98,13 +98,54 @@ layout("/layouts/platform.html"){
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
<el-dialog title="一键分配所有工会额度" :visible.sync="batchAllocateDialogVisible" width="500px">
<el-dialog title="一键分配所有工会额度" :visible.sync="batchAllocateDialogVisible" width="700px">
<el-form :model="batchAllocateForm" label-width="120px">
<el-form-item label="统一分配额度">
<el-form-item label="分配模式">
<el-radio-group v-model="batchAllocateForm.allocateMode">
<el-radio label="uniform">统一分配</el-radio>
<el-radio label="import">导入分配</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="统一分配额度" v-if="batchAllocateForm.allocateMode === 'uniform'">
<el-input-number v-model="batchAllocateForm.allocateMoney" :min="0" :precision="2"
style="width: 100%" placeholder="请输入每个工会的分配额度">
</el-input-number>
</el-form-item>
<template v-else>
<el-form-item label="导入模板">
<el-button type="primary" plain icon="el-icon-download" @click="downloadImportTemplate">下载模板</el-button>
<div class="text-secondary mt5">请按模板填写工会编码和分配额度,导入后将按工会逐条分配。</div>
</el-form-item>
<el-form-item label="上传文件">
<el-upload
name="file"
ref="importUploadRef"
:limit="1"
action="/platform/outlay/outlayManage/unionAllocate/readImportExcel"
:on-success="onImportSuccess"
:on-remove="onImportRemove"
:before-upload="beforeImportUpload"
:file-list="importFileList"
drag>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将Excel文件拖到此处,或<em>点击上传</em></div>
</el-upload>
</el-form-item>
<el-form-item label="导入预览" v-if="batchAllocateForm.importPreviewList.length > 0">
<el-table :data="batchAllocateForm.importPreviewList" border size="mini" max-height="260">
<el-table-column type="index" label="序号" width="60"></el-table-column>
<el-table-column prop="unionCode" label="工会编码" min-width="120"></el-table-column>
<el-table-column prop="unionName" label="工会名称" min-width="160"></el-table-column>
<el-table-column prop="allocateMoney" label="分配额度" min-width="120"></el-table-column>
<el-table-column prop="errMsg" label="校验结果" min-width="180">
<template slot-scope="{row}">
<span class="text-danger" v-if="row.errMsg">{{row.errMsg}}</span>
<span class="text-success" v-else>通过</span>
</template>
</el-table-column>
</el-table>
</el-form-item>
</template>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="batchAllocateDialogVisible = false">取 消</el-button>
@@ -137,8 +178,11 @@ layout("/layouts/platform.html"){
quarterlyList: [],
batchAllocateDialogVisible: false,
batchAllocateForm: {
allocateMoney: 0
}
allocateMode: "uniform",
allocateMoney: 0,
importPreviewList: []
},
importFileList: []
}
},
methods: {
@@ -201,22 +245,100 @@ layout("/layouts/platform.html"){
this.$message.warning('当前没有可分配的工会记录,请先生成季度记录')
return
}
this.batchAllocateForm = {
allocateMoney: 0
const quarter = this.$moment().quarter()
const openDialog = () => {
this.resetBatchAllocateForm()
this.batchAllocateDialogVisible = true
}
this.batchAllocateDialogVisible = true
this.$axios.post("/platform/outlay/outlayManage/unionAllocate/hasAllocated", {
quarterly: quarter,
year: this.pageForm.year
}).then((resp) => {
if (resp.code !== 0) {
return
}
if (resp.data) {
this.$confirm('温馨提示:当前季度已分配过额度,再次分配将覆盖本季度原有分配结果,是否继续?', '温馨提示', {
confirmButtonText: '继续',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
openDialog()
}).catch(() => {
})
} else {
openDialog()
}
})
},
resetBatchAllocateForm() {
this.batchAllocateForm = {
allocateMode: "uniform",
allocateMoney: 0,
importPreviewList: []
}
this.importFileList = []
},
downloadImportTemplate() {
this.$downLoad("/platform/outlay/outlayManage/unionAllocate/downloadImportTemplate")
},
beforeImportUpload(file) {
const suffix = file.name.split(".").pop()
if (["xls", "xlsx"].indexOf(suffix) === -1) {
this.$message.warning("请上传xls或xlsx格式文件")
return false
}
return true
},
onImportSuccess(resp, file, fileList) {
this.importFileList = fileList.slice(-1)
if (resp.code === 0) {
this.$set(this.batchAllocateForm, "importPreviewList", resp.data || [])
} else {
this.$message.error(resp.msg)
this.importFileList = []
this.$set(this.batchAllocateForm, "importPreviewList", [])
}
},
onImportRemove() {
this.importFileList = []
this.$set(this.batchAllocateForm, "importPreviewList", [])
},
doBatchAllocate() {
if (!this.batchAllocateForm.allocateMoney || this.batchAllocateForm.allocateMoney <= 0) {
this.$message.warning('请输入有效的分配额度')
const quarter = this.$moment().quarter()
if (this.batchAllocateForm.allocateMode === "uniform") {
if (!this.batchAllocateForm.allocateMoney || this.batchAllocateForm.allocateMoney <= 0) {
this.$message.warning('请输入有效的分配额度')
return
}
this.formLoading = true
this.$axios.post("/platform/outlay/outlayManage/unionAllocate/doBatchAllocate", {
allocateMoney: this.batchAllocateForm.allocateMoney,
quarterly: quarter,
year: this.pageForm.year
}).then((resp) => {
if (resp.code === 0) {
this.$message.success(resp.msg)
this.batchAllocateDialogVisible = false
this.doSearch()
}
}).finally(() => {
this.formLoading = false
})
return
}
if (this.batchAllocateForm.importPreviewList.length === 0) {
this.$message.warning("请先上传导入文件")
return
}
const hasErrorRow = this.batchAllocateForm.importPreviewList.some((item) => item.errMsg)
if (hasErrorRow) {
this.$message.warning("导入数据存在校验未通过的记录,请修正后重新上传")
return
}
const quarter = this.$moment().quarter()
this.formLoading = true
this.$axios.post("/platform/outlay/outlayManage/unionAllocate/doBatchAllocate", {
allocateMoney: this.batchAllocateForm.allocateMoney,
this.$axios.post("/platform/outlay/outlayManage/unionAllocate/doImportAllocate", {
data: JSON.stringify(this.batchAllocateForm.importPreviewList),
quarterly: quarter,
year: this.pageForm.year
}).then((resp) => {
@@ -294,7 +294,8 @@ layout("/layouts/platform.html"){
<el-card class="box-card" style="height: 92vh" shadow="never">
<el-result icon="warning" title="温馨提醒" subTitle="">
<template slot="extra">
抱歉,当前时间不能申请,可申请时间为{{time}}。
<span v-if="blockMessage">{{blockMessage}}</span>
<span v-else>抱歉,当前时间不能申请,可申请时间为{{time}}。</span>
</template>
</el-result>
</el-card>
@@ -312,6 +313,7 @@ layout("/layouts/platform.html"){
taskId: GetQueryString("taskId"),
isShow: false,
time: '',
blockMessage: '',
formData: {
id: GetQueryString("bizId"),
mode: '1',
@@ -602,7 +604,14 @@ layout("/layouts/platform.html"){
async getIsCanPlay() {
this.$axios.post('/platform/difficultHelp/apply/getIsCanPlay').then(res => {
if (res.code === 0) {
this.isShow = res.data.result
// 新增申请进入页面时,优先校验当前登录人本年度是否已经申请过,已申请则直接拦截新增。
if (!this.bizId && res.data.hasCurrentYearApply) {
this.isShow = false
this.$set(this, 'blockMessage', '抱歉,您本年度已申请困难帮扶,不能重复申请。')
} else {
this.isShow = res.data.result
this.$set(this, 'blockMessage', '')
}
this.$set(this, 'time', res.data.time);
if (res.data.applyCount !== null && res.data.applyCount !== undefined && res.data.applyCount !== 0) {
this.$set(this.formData, 'applyCount', res.data.applyCount)
@@ -159,7 +159,7 @@ layout("/layouts/platform.html"){
{ prop: "subsidyStandards", label: "困难类型", sortable: true },
{ prop: "applyTime", label: "申请时间", sortable: true },
{ prop: "applyCount", label: "申请次数", sortable: true },
{ prop: "taskName", label: "当前节点" },
{ prop: "curTaskName", label: "当前节点" },
{ prop: "instanceState", label: "流程状态" }
],
unions: [],
@@ -48,8 +48,9 @@ layout("/layouts/platform.html"){
<el-radio-button label="false">未审核</el-radio-button>
</el-radio-group>
</table-tool>
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder"
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder" @selection-change="handleSelectionChange"
ref="table" row-key="id" style="width: 100%">
<el-table-column type="selection" width="45"></el-table-column>
<el-table-column :index="indexMethod" header-align="center" label="序号"
type="index" width="60px"></el-table-column>
<el-table-column
@@ -130,14 +131,15 @@ layout("/layouts/platform.html"){
{ prop: "subsidyStandards", label: "困难类型", sortable: true },
{ prop: "applyTime", label: "申请时间", sortable: true },
{ prop: "applyCount", label: "申请次数", sortable: true },
{ prop: "taskName", label: "当前节点" },
{ prop: "curTaskName", label: "当前节点" },
{ prop: "instanceState", label: "流程状态" }
],
unions: [],
units: [],
formData: {},
showApprovalForm: false
showApprovalForm: false,
selectData: [],
}
},
components: {
@@ -155,13 +157,17 @@ layout("/layouts/platform.html"){
this.$message.warning('没有待审核的数据!');
return;
}
const message = '确定要一键审核这 ' + this.tableData.length + ' 条记录吗?';
if (this.selectData.length === 0) {
this.$message.warning('请勾选待审核数据!');
return;
}
const message = '确定要一键审核这 ' + this.selectData.length + ' 条记录吗?';
this.$confirm(message, '批量审核确认', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.batchApprove(this.tableData);
this.batchApprove(this.selectData);
}).catch(() => {
});
@@ -279,6 +285,9 @@ layout("/layouts/platform.html"){
this.units = await this.$businessTool.listUnit(this.$store.state.user.union.id)
}
},
handleSelectionChange: function (val) {
this.selectData = val
},
},
async created() {
this.pageData()