体检管理:添加确认统计报表

This commit is contained in:
2026-04-28 15:05:42 +08:00
parent 1e20367c38
commit ef903b11df
8 changed files with 309 additions and 4 deletions
@@ -0,0 +1,165 @@
<!--#
layout("/layouts/platform.html"){
#-->
<div class="platform" id="app" v-cloak>
<guava ref="guava">
<el-card shadow="never">
<search @search="doSearch">
<search-item label="年度">
<el-date-picker
clearable
@change="yearChange"
placeholder="选择年"
style="width: 100%;"
type="year"
v-model="pageForm.year"
value-format="yyyy">
</el-date-picker>
</search-item>
<search-item label="体检项目">
<el-select @change="doSearch"
clearable
style="width: 100%;"
v-model="pageForm.projectId">
<el-option :key="item.id" :label="item.name" :value="item.id"
v-for="item in projectOptions"></el-option>
</el-select>
</search-item>
<search-item label="所属工会">
<el-select placeholder="请选择所属工会"
v-model="pageForm.unionId"
style="width: 100%;"
:clearable="clearable"
filterable
@change="doSearch">
<el-option v-for="item in unions"
:label="item.name"
:value="item.id"
:key="item.id"></el-option>
</el-select>
</search-item>
</search>
</el-card>
<el-card class="mt10" shadow="never">
<table-tool label="工会确认情况统计"></table-tool>
<el-table :data="tableData"
:size="tableSize"
@sort-change="pageOrder"
class="vi-table"
ref="table"
row-key="unionId"
style="width: 100%"
v-loading="tableLoading">
<el-table-column label="序号" type="index" width="80px" :index="indexMethod" align="center" header-align="center"></el-table-column>
<el-table-column
v-for="column in tableColumns"
:key="column.prop"
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
align="center"
header-align="center"
min-width="120px"
show-overflow-tooltip>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</guava>
</div>
<script>
new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
clearable: false,
tableData: [],
unions: [],
projectOptions: [],
pageForm: {
year: moment().format('YYYY'),
projectId: '',
unionId: '',
pageNumber: 1,
pageSize: 10,
totalCount: 0
},
tableColumns: [
{prop: 'unionName', label: '工会名称'},
{prop: 'totalCount', label: '体检总人数'},
{prop: 'confirmedCount', label: '已确认总人数'},
{prop: 'unconfirmedCount', label: '未确认总人数'},
{prop: 'completeStatus', label: '确认完成状态'}
],
}
},
methods: {
yearChange() {
// 年度切换后重新加载该年度下的体检项目,并默认定位到第一条可用项目。
return this.$axios.post('/platform/healthCheckup/project/mange/getHealthCheckupProject', {year: this.pageForm.year}).then((resp) => {
if (resp.code === 0) {
this.projectOptions = resp.data || []
if (this.projectOptions.length > 0) {
this.$set(this.pageForm, 'projectId', this.projectOptions[0].id)
} else {
this.$set(this.pageForm, 'projectId', '')
}
this.doSearch()
} else {
this.notifyError(resp.msg)
}
})
},
pageData() {
if (!this.pageForm.year || !this.pageForm.projectId) {
this.tableData = []
this.pageForm.totalCount = 0
return Promise.resolve()
}
this.tableLoading = true
return this.$axios.post(loc() + '/pageData', this.pageForm).then((resp) => {
if (resp.code === 0) {
this.tableData = resp.data.list || []
this.pageForm.totalCount = resp.data.totalCount || 0
this.$nextTick(function () {
if (this.$refs.table) {
this.$refs.table.doLayout()
}
})
} else {
this.notifyError(resp.msg)
}
}).finally(() => {
this.tableLoading = false
})
},
doSearch() {
this.pageForm.pageNumber = 1
return this.pageData()
},
async init() {
if (this.$auth.hasRoleOr(['SYSADMIN', 'SCHOOL_UNION_ADMIN'])) {
this.unions = await this.$businessTool.listUnion()
this.clearable = true
} else {
// 普通工会管理员只查询本人所属工会,避免跨工会查看统计数据。
this.unions = await this.$businessTool.listUnion(this.$store.state.user.union.id)
if (this.unions && this.unions.length > 0) {
this.$set(this.pageForm, 'unionId', this.unions[0].id)
}
}
await this.yearChange()
}
},
created() {
this.init()
}
})
</script>
<!--#
}
#-->