Files
2026-09-08 19:49:21 +08:00

222 lines
9.8 KiB
HTML

<!--#
layout("/layouts/platform.html"){
#-->
<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="选择年度"
type="year" style="width: 100%"
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 type="primary" size="small" @click="exportSignUser"
:disabled="!pageForm.activityId">
导出报名人员
</el-button>
<el-button type="primary" size="small" @click="exportUserPhoto"
:disabled="!pageForm.activityId">
导出人员照片
</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="交友联谊人员" prop="courseName" align="center"
header-align="center"
show-overflow-tooltip></el-table-column>
<el-table-column label="联谊类型" prop="courseType" sortable align="center"
header-align="center"
show-overflow-tooltip></el-table-column>
<el-table-column :label="trainType + '地点'" prop="courseLocation" sortable
align="center"
header-align="center" show-overflow-tooltip></el-table-column>
<el-table-column label="负责人" prop="courseInstructor" sortable align="center"
header-align="center"
show-overflow-tooltip></el-table-column>
<el-table-column label="最多报名人数" prop="coursePeopleNumber" sortable align="center"
header-align="center"
show-overflow-tooltip></el-table-column>
<el-table-column label="已报名人数" prop="registerNum" sortable align="center"
header-align="center"
show-overflow-tooltip>
<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/fellowship/statistics/include_view.html"){}#-->
</template>
</guava>
<el-dialog title="查看" top="3%" :visible.sync="viewDialog" custom-class="ViewDialogClass"
:close-on-click-modal="false" width="50%">
<el-descriptions :column="3" border class="table_fixed">
<el-descriptions-item :label="item.columnName"
:span="index === (mobileColumnsValue.length - 2) ? 3: 1"
v-if="item.columnFormType !== 'FILE'"
v-for="(item,index) in mobileColumnsValue">
{{ item.columnValue }}
</el-descriptions-item>
<el-descriptions-item v-else :label="item.columnName">
<file-upload v-if="picList && picList.length > 0"
:files="picList"
:view="true"></file-upload>
<span v-else>暂无</span>
</el-descriptions-item>
</el-descriptions>
</el-dialog>
</div>
<script>
var vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
picList: [],
viewDialog: false,
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: 'sex'},
{label: '出生年月', prop: 'birthday'},
{label: '手机号', prop: 'mobile'},
{label: '单位', prop: 'unitname'},
{label: '分工会', prop: 'unionname'},
{label: '报名时间', prop: 'signUpTime'},
],
userSignInfo: {},
trainType: '交友联谊',
trainTypeList: [],
mobileColumnsValue: [],
}
},
methods: {
exportUserPhoto() {
window.open(loc() + '/exportUserPhoto?activityId=' + this.pageForm.activityId)
},
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.$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
},
openViewUser(row) {
if (row.mobileColumnsValue) {
const mobileColumnsValue = JSON.parse(row.mobileColumnsValue)
this.mobileColumnsValue = mobileColumnsValue
let picArray = []
mobileColumnsValue.forEach(item => {
if (item.columnFormType === 'FILE' && item.columnValue) {
item.columnValue.forEach(pic => {
picArray.push(pic)
})
}
})
this.picList = picArray
this.viewDialog = true
}
},
},
async created() {
this.trainTypeList = await getDictOptions("fellowshipType")
await this.initData()
await this.pageData()
}
})
</script>
<!--#
}
#-->