352 lines
11 KiB
Vue
352 lines
11 KiB
Vue
![]() |
<template>
|
||
|
<div class="app-container">
|
||
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="110px">
|
||
|
<el-form-item label="学生姓名" prop="stuName">
|
||
|
<el-input
|
||
|
v-model="queryParams.stuName"
|
||
|
placeholder="请输入学生姓名"
|
||
|
clearable
|
||
|
@keyup.enter.native="handleQuery"
|
||
|
/>
|
||
|
</el-form-item>
|
||
|
<el-form-item label="学生性别" prop="stuGender">
|
||
|
<el-select
|
||
|
v-model="queryParams.stuGender"
|
||
|
placeholder="内容类型"
|
||
|
clearable
|
||
|
style="width: 125px">
|
||
|
<el-option
|
||
|
v-for="dict in dict.type.sys_user_sex"
|
||
|
:key="dict.value"
|
||
|
:label="dict.label"
|
||
|
:value="dict.value"
|
||
|
/>
|
||
|
</el-select>
|
||
|
</el-form-item>
|
||
|
<el-form-item label="学生专业" prop="stuMajor">
|
||
|
<el-input
|
||
|
v-model="queryParams.stuMajor"
|
||
|
placeholder="请输入学生专业"
|
||
|
clearable
|
||
|
@keyup.enter.native="handleQuery"
|
||
|
/>
|
||
|
</el-form-item>
|
||
|
<el-form-item label="学生手机号" prop="stuNumber">
|
||
|
<el-input
|
||
|
v-model="queryParams.stuNumber"
|
||
|
placeholder="请输入学生手机号"
|
||
|
clearable
|
||
|
@keyup.enter.native="handleQuery"
|
||
|
/>
|
||
|
</el-form-item>
|
||
|
<el-form-item label="学校及院系名称" prop="schoolName">
|
||
|
<el-input
|
||
|
v-model="queryParams.schoolName"
|
||
|
placeholder="请输入学校及院系名称"
|
||
|
clearable
|
||
|
@keyup.enter.native="handleQuery"
|
||
|
/>
|
||
|
</el-form-item>
|
||
|
<el-form-item label="大赛类型" prop="">
|
||
|
<el-select
|
||
|
v-model="queryParams.competitionType"
|
||
|
placeholder="内容类型"
|
||
|
clearable
|
||
|
style="width: 125px">
|
||
|
<el-option
|
||
|
v-for="dict in dict.type.competition_type"
|
||
|
:key="dict.value"
|
||
|
:label="dict.label"
|
||
|
:value="dict.value"
|
||
|
/>
|
||
|
</el-select>
|
||
|
</el-form-item>
|
||
|
<el-form-item label="所属赛区" prop="division">
|
||
|
<el-input
|
||
|
v-model="queryParams.division"
|
||
|
placeholder="请输入所属赛区"
|
||
|
clearable
|
||
|
@keyup.enter.native="handleQuery"
|
||
|
/>
|
||
|
</el-form-item>
|
||
|
<el-form-item label="团队名称" prop="teamName">
|
||
|
<el-input
|
||
|
v-model="queryParams.teamName"
|
||
|
placeholder="请输入团队名称"
|
||
|
clearable
|
||
|
@keyup.enter.native="handleQuery"
|
||
|
/>
|
||
|
</el-form-item>
|
||
|
<el-form-item label="老师名称" prop="teachName">
|
||
|
<el-input
|
||
|
v-model="queryParams.teachName"
|
||
|
placeholder="请输入团队名称"
|
||
|
clearable
|
||
|
@keyup.enter.native="handleQuery"
|
||
|
/>
|
||
|
</el-form-item>
|
||
|
<el-form-item label="大赛名称" prop="competitionName">
|
||
|
<el-input
|
||
|
v-model="queryParams.competitionName"
|
||
|
placeholder="请输入团队名称"
|
||
|
clearable
|
||
|
@keyup.enter.native="handleQuery"
|
||
|
/>
|
||
|
</el-form-item>
|
||
|
<el-form-item>
|
||
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||
|
</el-form-item>
|
||
|
</el-form>
|
||
|
|
||
|
<el-row :gutter="10" class="mb8">
|
||
|
<el-col :span="1.5">
|
||
|
<el-button
|
||
|
type="danger"
|
||
|
plain
|
||
|
icon="el-icon-delete"
|
||
|
size="mini"
|
||
|
:disabled="multiple"
|
||
|
@click="handleDelete"
|
||
|
v-hasPermi="['registrationStudentInfo:registrationStudentInfo:remove']"
|
||
|
>删除</el-button>
|
||
|
</el-col>
|
||
|
<el-col :span="1.5">
|
||
|
<el-button
|
||
|
type="warning"
|
||
|
plain
|
||
|
icon="el-icon-download"
|
||
|
size="mini"
|
||
|
@click="handleExport"
|
||
|
v-hasPermi="['registrationStudentInfo:registrationStudentInfo:export']"
|
||
|
>导出</el-button>
|
||
|
</el-col>
|
||
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||
|
</el-row>
|
||
|
|
||
|
<el-table v-loading="loading" :data="HitRegistrationStudentInfoList" @selection-change="handleSelectionChange">
|
||
|
<el-table-column type="selection" width="55" align="center" />
|
||
|
<el-table-column label="比赛名称" align="center" prop="competitionName" />
|
||
|
<el-table-column label="学生姓名" align="center" prop="stuName" />
|
||
|
<el-table-column label="学生性别" align="center" prop="stuGender">
|
||
|
<template slot-scope="scope">
|
||
|
<dict-tag :options="dict.type.sys_user_sex" :value="scope.row.stuGender"/>
|
||
|
</template>
|
||
|
</el-table-column>
|
||
|
<el-table-column label="学生专业" align="center" prop="stuMajor" />
|
||
|
<el-table-column label="学生手机号" align="center" prop="stuNumber" />
|
||
|
<el-table-column label="学校及院系名称" align="center" prop="schoolName" />
|
||
|
<el-table-column label="所属赛区" align="center" prop="division" />
|
||
|
<el-table-column label="团队名称" align="center" prop="teamName" />
|
||
|
<el-table-column label="领队教师" align="center" prop="leaderIds" />
|
||
|
<el-table-column label="指导老师" align="center" prop="guideIds" />
|
||
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||
|
<template slot-scope="scope">
|
||
|
<el-button
|
||
|
size="mini"
|
||
|
type="text"
|
||
|
icon="el-icon-delete"
|
||
|
@click="handleDelete(scope.row)"
|
||
|
v-hasPermi="['registrationStudentInfo:registrationStudentInfo:remove']"
|
||
|
>删除</el-button>
|
||
|
</template>
|
||
|
</el-table-column>
|
||
|
</el-table>
|
||
|
|
||
|
<pagination
|
||
|
v-show="total>0"
|
||
|
:total="total"
|
||
|
:page.sync="queryParams.pageNum"
|
||
|
:limit.sync="queryParams.pageSize"
|
||
|
@pagination="getList"
|
||
|
/>
|
||
|
|
||
|
</div>
|
||
|
</template>
|
||
|
|
||
|
<script>
|
||
|
import { listHitRegistrationStudentInfo, getHitRegistrationStudentInfo, delHitRegistrationStudentInfo, addHitRegistrationStudentInfo, updateHitRegistrationStudentInfo } from "@/api/hit/registrationStudentInfo";
|
||
|
|
||
|
export default {
|
||
|
name: "HitRegistrationStudentInfo",
|
||
|
dicts: ['sys_user_sex', 'competition_type'],
|
||
|
data() {
|
||
|
return {
|
||
|
// 遮罩层
|
||
|
loading: true,
|
||
|
// 选中数组
|
||
|
ids: [],
|
||
|
// 非单个禁用
|
||
|
single: true,
|
||
|
// 非多个禁用
|
||
|
multiple: true,
|
||
|
// 显示搜索条件
|
||
|
showSearch: true,
|
||
|
// 总条数
|
||
|
total: 0,
|
||
|
// 报名信息表格数据
|
||
|
HitRegistrationStudentInfoList: [],
|
||
|
// 弹出层标题
|
||
|
title: "",
|
||
|
// 是否显示弹出层
|
||
|
open: false,
|
||
|
// 查询参数
|
||
|
queryParams: {
|
||
|
pageNum: 1,
|
||
|
pageSize: 10,
|
||
|
competitionName: null,
|
||
|
stuName: null,
|
||
|
stuGender: null,
|
||
|
stuMajor: null,
|
||
|
stuNumber: null,
|
||
|
schoolName: null,
|
||
|
division: null,
|
||
|
teamName: null,
|
||
|
leaderIds: null,
|
||
|
guideIds: null,
|
||
|
teachName:null,
|
||
|
},
|
||
|
// 表单参数
|
||
|
form: {},
|
||
|
// 表单校验
|
||
|
rules: {
|
||
|
competitionId: [
|
||
|
{ required: true, message: "大赛ID不能为空", trigger: "blur" }
|
||
|
],
|
||
|
stuName: [
|
||
|
{ required: true, message: "学生姓名不能为空", trigger: "blur" }
|
||
|
],
|
||
|
stuGender: [
|
||
|
{ required: true, message: "学生性别不能为空", trigger: "blur" }
|
||
|
],
|
||
|
stuMajor: [
|
||
|
{ required: true, message: "学生专业不能为空", trigger: "blur" }
|
||
|
],
|
||
|
stuNumber: [
|
||
|
{ required: true, message: "学生手机号不能为空", trigger: "blur" }
|
||
|
],
|
||
|
schoolName: [
|
||
|
{ required: true, message: "学校及院系名称不能为空", trigger: "blur" }
|
||
|
],
|
||
|
division: [
|
||
|
{ required: true, message: "所属赛区不能为空", trigger: "blur" }
|
||
|
],
|
||
|
delFlag: [
|
||
|
{ required: true, message: "逻辑删除0未删除1真删除不能为空", trigger: "blur" }
|
||
|
],
|
||
|
}
|
||
|
};
|
||
|
},
|
||
|
created() {
|
||
|
this.getList();
|
||
|
},
|
||
|
methods: {
|
||
|
/** 查询报名信息列表 */
|
||
|
getList() {
|
||
|
this.loading = true;
|
||
|
listHitRegistrationStudentInfo(this.queryParams).then(response => {
|
||
|
this.HitRegistrationStudentInfoList = response.rows;
|
||
|
this.total = response.total;
|
||
|
this.loading = false;
|
||
|
});
|
||
|
},
|
||
|
// 取消按钮
|
||
|
cancel() {
|
||
|
this.open = false;
|
||
|
this.reset();
|
||
|
},
|
||
|
// 表单重置
|
||
|
reset() {
|
||
|
this.form = {
|
||
|
id: null,
|
||
|
competitionId: null,
|
||
|
stuName: null,
|
||
|
stuGender: null,
|
||
|
stuMajor: null,
|
||
|
stuNumber: null,
|
||
|
schoolName: null,
|
||
|
division: null,
|
||
|
teamName: null,
|
||
|
leaderIds: null,
|
||
|
guideIds: null,
|
||
|
remark: null,
|
||
|
delFlag: null,
|
||
|
createTime: null,
|
||
|
createBy: null,
|
||
|
updateTime: null,
|
||
|
updateBy: null
|
||
|
};
|
||
|
this.resetForm("form");
|
||
|
},
|
||
|
/** 搜索按钮操作 */
|
||
|
handleQuery() {
|
||
|
this.queryParams.pageNum = 1;
|
||
|
this.getList();
|
||
|
},
|
||
|
/** 重置按钮操作 */
|
||
|
resetQuery() {
|
||
|
this.resetForm("queryForm");
|
||
|
this.handleQuery();
|
||
|
},
|
||
|
// 多选框选中数据
|
||
|
handleSelectionChange(selection) {
|
||
|
this.ids = selection.map(item => item.id)
|
||
|
this.single = selection.length!==1
|
||
|
this.multiple = !selection.length
|
||
|
},
|
||
|
/** 新增按钮操作 */
|
||
|
handleAdd() {
|
||
|
this.reset();
|
||
|
this.open = true;
|
||
|
this.title = "添加报名信息";
|
||
|
},
|
||
|
/** 修改按钮操作 */
|
||
|
handleUpdate(row) {
|
||
|
this.reset();
|
||
|
const id = row.id || this.ids
|
||
|
getHitRegistrationStudentInfo(id).then(response => {
|
||
|
this.form = response.data;
|
||
|
this.open = true;
|
||
|
this.title = "修改报名信息";
|
||
|
});
|
||
|
},
|
||
|
/** 提交按钮 */
|
||
|
submitForm() {
|
||
|
this.$refs["form"].validate(valid => {
|
||
|
if (valid) {
|
||
|
if (this.form.id != null) {
|
||
|
updateHitRegistrationStudentInfo(this.form).then(response => {
|
||
|
this.$modal.msgSuccess("修改成功");
|
||
|
this.open = false;
|
||
|
this.getList();
|
||
|
});
|
||
|
} else {
|
||
|
addHitRegistrationStudentInfo(this.form).then(response => {
|
||
|
this.$modal.msgSuccess("新增成功");
|
||
|
this.open = false;
|
||
|
this.getList();
|
||
|
});
|
||
|
}
|
||
|
}
|
||
|
});
|
||
|
},
|
||
|
/** 删除按钮操作 */
|
||
|
handleDelete(row) {
|
||
|
const ids = row.id || this.ids;
|
||
|
this.$modal.confirm('是否确认删除报名信息编号为"' + ids + '"的数据项?').then(function() {
|
||
|
return delHitRegistrationStudentInfo(ids);
|
||
|
}).then(() => {
|
||
|
this.getList();
|
||
|
this.$modal.msgSuccess("删除成功");
|
||
|
}).catch(() => {});
|
||
|
},
|
||
|
/** 导出按钮操作 */
|
||
|
handleExport() {
|
||
|
this.download('registrationStudentInfo/registrationStudentInfo/export', {
|
||
|
...this.queryParams
|
||
|
}, `HitRegistrationStudentInfo_${new Date().getTime()}.xlsx`)
|
||
|
}
|
||
|
}
|
||
|
};
|
||
|
</script>
|