first commit

This commit is contained in:
2026-09-20 15:46:34 +08:00
parent 72fb5eae10
commit e558339dcc
3340 changed files with 671310 additions and 251 deletions
@@ -0,0 +1,227 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.el-icon-arrow-left, .el-icon-arrow-right {
font-size: 28px;
font-weight: bolder;
}
</style>
<div id="app" v-cloak>
<guava ref="guava">
<el-card shadow="never">
<div class="search">
<div class="search-item">
<div class="search-item-label">年度:</div>
<div class="search-item-option">
<el-date-picker
:clearable="false"
@change="yearChange"
placeholder="选择年度"
style="width: 100%" type="year"
v-model="pageForm.year"
value-format="yyyy">
</el-date-picker>
</div>
</div>
<div class="search-item">
<div class="search-item-label">活动:</div>
<div class="search-item-option">
<el-select @change="activityChange" style="width: 100%"
v-model="pageForm.activityId">
<el-option :label="item.activityName"
:value="item.id"
v-for="item in activityList"
></el-option>
</el-select>
</div>
</div>
<div class="search-query">
<el-button @click="doSearch" icon="el-icon-search" type="primary">搜索</el-button>
</div>
</div>
</el-card>
<el-card class="mt10" shadow="never">
<table-tool :app="this" :label="trainType">
<template #func>
<el-button :disabled="!pageForm.activityId" @click="exportSignUser" size="small"
type="primary">
导出报名人员
</el-button>
</template>
</table-tool>
<el-table :data="tableData" :size="tableSize">
<el-table-column :index="indexMethod" align="center" header-align="center"
label="序号" type="index"
width="80px"></el-table-column>
<el-table-column :label="trainType" align="center" header-align="center"
prop="courseName"
show-overflow-tooltip></el-table-column>
<el-table-column align="center" header-align="center" label="类型" prop="courseType"
show-overflow-tooltip
sortable></el-table-column>
<el-table-column :label="trainType + '地点'" align="center" header-align="center"
prop="courseLocation"
show-overflow-tooltip sortable></el-table-column>
<el-table-column align="center" header-align="center" label="负责人"
prop="courseInstructor"
show-overflow-tooltip
sortable></el-table-column>
<el-table-column align="center" header-align="center" label="最多报名人数"
prop="coursePeopleNumber"
show-overflow-tooltip
sortable></el-table-column>
<el-table-column align="center" header-align="center" label="已报名人数"
prop="registerNum"
show-overflow-tooltip
sortable>
<template scope="{row}">
<el-link @click="openView(row.id)" type="primary">
{{row.registerNum + row.courseReservedNumber}}
</el-link>
</template>
</el-table-column>
<el-table-column label="操作" width="150px">
<template scope="{row}">
<el-button @click="openView(row.id)" size="mini" type="primary">查看
</el-button>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
<template #view>
<!--#include("/platform/trainSingUp/statistics/include_view.html"){}#-->
</template>
</guava>
<el-dialog
:visible.sync="messageDialogVisible"
title="发送消息"
width="30%">
<el-input
:rows="4"
placeholder="请输入内容"
type="textarea"
v-model="messageForm.messageText">
</el-input>
<span class="dialog-footer" slot="footer">
<el-button @click="messageDialogVisible = false">关 闭</el-button>
<el-button @click="doMessage" type="primary">发 送</el-button>
</span>
</el-dialog>
</div>
<script>
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
activityList: [],
pageForm: {
year: new Date().getFullYear().toString(),
activityId: null
},
tableColumns: [
{label: '培训班', prop: 'courseName'},
{label: '类型', prop: 'courseType', sortable: true},
{label: '地点', prop: 'courseLocation'},
{label: '教师', prop: 'courseInstructor', sortable: true},
{label: '最多报名人数', prop: 'coursePeopleNumber', sortable: true},
{label: '已报名人数', prop: 'registerNum', sortable: true},
],
registerUserTableData: [],
registerUserTableColumns: [
{label: '姓名', prop: 'username'},
{label: '工号', prop: 'loginname'},
{label: '单位', prop: 'unitname'},
{label: '分工会', prop: 'unionname'},
{label: '报名时间', prop: 'signUpTime'},
],
userSignInfo: {},
trainType: '培训班',
trainTypeList: [],
messageForm: {messageText: ""},
messageDialogVisible: false,
}
},
methods: {
async doMessage() {
if (!this.messageForm.messageText) {
this.$message.error("请输入内容")
return
}
const confirm = await this.$confirm('确定要发送消息吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
if (confirm === "confirm") {
const resp = await $.post(loc() + '/sendMessage', {
courseId: this.messageForm.courseId,
messageText: this.messageForm.messageText
})
if (resp.code === 0) {
this.$message.success(resp.msg)
this.messageDialogVisible = false
}
}
},
openMessage() {
this.messageForm.messageText = ""
this.messageDialogVisible = true
},
activityChange(val) {
const activity = this.activityList.find(o => o.id === val)
const type = this.trainTypeList.find(o => o.code === activity.trainType)
this.trainType = type ? type.name : '培训班'
},
exportSignUser() {
window.open(loc() + '/exportSignUser?activityId=' + this.pageForm.activityId)
},
async yearChange() {
this.pageForm.activityId = null
await this.getActivityList()
await this.doSearch()
},
async getActivityList() {
const resp = await $.get(loc() + '/activityList', {year: this.pageForm.year})
this.activityList = resp.data
if (this.activityList && this.activityList.length > 0) {
this.pageForm.activityId = this.activityList[0].id
const type = this.trainTypeList.find(o => o.code === this.activityList[0].trainType)
this.trainType = type ? type.name : '培训班'
}
},
async initData() {
await this.getActivityList()
},
async openView(courseId) {
this.messageForm.courseId = courseId
this.$refs.guava.view()
const resp_register = await $.get(loc() + '/registerUserList', {courseId})
this.registerUserTableData = resp_register.data
const resp_signInfo = await $.get(loc() + '/getSignInfo', {courseId})
this.userSignInfo = resp_signInfo.data
}
},
async created() {
this.trainTypeList = await getDictOptions("trainSignUpType")
await this.initData()
await this.pageData()
}
})
</script>
<!--#
}
#-->