Commit d8907953 by peijy

公开招聘 报名

parent fb3f0036
# 页面标题
VUE_APP_TITLE = 智慧校园管理系统
VUE_APP_TITLE = 网络数字信息化校园管理系统
# 开发环境配置
ENV = 'development'
......
# 页面标题
VUE_APP_TITLE = 智慧校园管理系统
VUE_APP_TITLE = 网络数字信息化校园管理系统
# 生产环境配置
ENV = 'production'
......
# 页面标题
VUE_APP_TITLE = 智慧校园管理系统
VUE_APP_TITLE = 网络数字信息化校园管理系统
NODE_ENV = production
......
import request from "@/utils/request";
/**
* 考试管理 接口
* */
// 查询考试列表
export function getExaList(queryParams) {
return request({
url: '/ /list',
method: 'get',
params: queryParams,
})
}
// 新增考试
export function addExamination(postForm) {
return request({
url: '/schoolExam/add',
method: 'post',
data: postForm
})
}
// 查询详情
export function getDetailInfo(id) {
return request({
url: '/schoolExam/queryOne/' + id,
method: 'get'
})
}
// 修改考试
export function updateExamination(postForm) {
return request({
url: '/schoolExam/edit',
method: 'put',
data: postForm
})
}
// 删除考试
export function deleteExa(ids) {
return request({
url: '/schoolExam/remove/' + ids,
method: 'delete'
})
}
// 导入考试
export function importDataSchedule(file) {
return request({
url: '/schoolExam/importData',
method: 'post',
data: file
})
}
// 下载模板
export function examTemplate() {
return request({
url: '/schoolExam/importTemplate',
method: 'get',
})
}
// 学生成绩列表
export function scoreList(examId, query) {
return request({
url: '/schoolExamDetail/list/' + examId,
method: 'get',
params: query,
})
}
// 查看学生成绩详情
export function scoreDetail(id) {
return request({
url: '/schoolExamDetail/queryOne/' + id,
method: 'get',
})
}
// 新增学生成绩
export function addScore(examId, data) {
// const data={examId,data};
return request({
url: '/schoolExamDetail/add/' + examId,
method: 'post',
data: data,
})
}
// 修改学生成绩
export function updateScore(data) {
return request({
url: '/schoolExamDetail/edit',
method: 'put',
data: data,
})
}
// 删除学生成绩
export function delScore(id) {
return request({
url: '/schoolExamDetail/remove/' + id,
method: 'delete',
})
}
/** 初中学校管理 */
// 查询初中学校列表
export function listSchool(query) {
return request({
url: '/juniorHighSchool/list',
method: 'get',
params: query
})
}
// 查询初中学校详细
export function getSchool(id) {
return request({
url: '/juniorHighSchool/getInfo/' + id,
method: 'get'
})
}
// 新增初中学校
export function addSchool(data) {
return request({
url: '/juniorHighSchool/add',
method: 'post',
data: data
})
}
// 修改初中学校
export function updateSchool(data) {
return request({
url: '/juniorHighSchool/edit',
method: 'put',
data: data
})
}
// 删除初中学校
export function delSchool(id) {
return request({
url: '/juniorHighSchool/delete/' + id,
method: 'delete'
})
}
// 测试项目
// 查询
export function listProject(query) {
return request({
url: '/schoolRecruitProject/list',
method: 'get',
params: query
})
}
// 信息审核查询测试项目
export function getProjectList(examId, query) {
return request({
url: '/schoolRecruitProject/getProjectList/' + examId,
method: 'get',
params: query
})
}
// 查询详细
export function getProject(id) {
return request({
url: '/schoolRecruitProject/getInfo/' + id,
method: 'get'
})
}
// 新增
export function addProject(data) {
return request({
url: '/schoolRecruitProject/add',
method: 'post',
data: data
})
}
// 修改
export function updateProject(data) {
return request({
url: '/schoolRecruitProject/edit',
method: 'put',
data: data
})
}
// 删除
export function delProject(id) {
return request({
url: '/schoolRecruitProject/' + id,
method: 'delete'
})
}
// 考生账号管理
// 考生账号管理查询学校艺术生信息列表
export function listStudent(query) {
return request({
url: '/recruitStudent/list',
method: 'get',
params: query
})
}
// 查询账号管理详细
export function getInfo(id) {
return request({
url: '/recruitStudent/getInfo/' + id,
method: 'get'
})
}
// 重置密码
export function resetPwd(id, password) {
const data = {
id,
password
}
console.log(data, 215);
return request({
url: '/recruitStudent/resetPwd',
method: 'put',
data: data
})
}
// 考试管理
// 查询考试管理列表
export function listExam(query) {
return request({
url: '/recruitExam/list',
method: 'get',
params: query
})
}
// 查询考试管理详细
export function getExam(id) {
return request({
url: '/recruitExam/getInfo/' + id,
method: 'get'
})
}
// 新增-保存
export function addExam(data) {
return request({
url: '/recruitExam/add',
method: 'post',
data: data
})
}
// 新增-发布
export function addPub(data) {
return request({
url: '/recruitExam/addPub',
method: 'post',
data: data
})
}
// 考试信息发布
export function editPub(data) {
return request({
url: '/recruitExam/editPub',
method: 'put',
data: data
})
}
// 修改的保存
export function edit(data) {
return request({
url: '/recruitExam/edit',
method: 'put',
data: data
})
}
// 修改的发布
export function updateExam(data) {
return request({
url: '/recruitExam/editPub',
method: 'put',
data: data
})
}
// 删除
export function delExam(id) {
return request({
url: '/recruitExam/delete/' + id,
method: 'delete'
})
}
// 身份证号获取信息
export function getPerInfo(idCard) {
return request({
url: `/school/student/queryAllInfoByidCard/${idCard}`,
method: 'get'
})
}
// 报名阶段信息审核 查询
export function checkList(id, query) {
return request({
url: '/recruitExam/checkList/' + id,
method: 'get',
params: query
})
}
// 报名阶段信息审核修改
export function updateRelation(id, data) {
return request({
url: '/recruitStudent/edit/' + id,
method: 'put',
data: data
})
}
// 查询学校艺术生信息详细
export function getStudent(id, examId) {
return request({
url: '/recruitStudent/getStuInfo/' + id + '/' + examId,
method: 'get',
// data: data
})
}
// 考场分配查询列表
export function addressList(id, query) {
return request({
url: '/recruitExam/addressList/' + id,
method: 'get',
params: query
})
}
// 考场分配 成绩管理 获取详情
export function getAddressInfo(id) {
return request({
url: '/artRelation/getAddressInfo/' + id,
method: 'get',
})
}
// 考场分配 成绩管理修改
export function handleEdit(data) {
return request({
url: '/artRelation/edit',
method: 'put',
data: data
})
}
// 考场分配发布
export function addressEnd(id) {
return request({
url: '/recruitExam/addressEnd/' + id,
method: 'put',
// data: data
})
}
// *** 成绩管理查询列表
export function scoreManageList(id, query) {
return request({
url: '/recruitExam/scoreList/' + id,
method: 'get',
params: query
})
}
// *** 成绩管理查发布
export function scoreEnd(id) {
return request({
url: '/recruitExam/scoreEnd/' + id,
method: 'put',
})
}
//导入教育局信息
export function importData(file, id) {
return request({
url: '/eduArtStudent/importData/' + id,
method: 'post',
params: file
})
}
// 文件上传方法
export function commonUpload(file, callback = null) {
return request({
url: '/common/upload',
method: 'post',
data: file,
onUploadProgress: progress => {
callback && callback(progress)
}
})
}
// 通过
export function pass(examId, studentIds) {
return request({
url: `/recruitExam/pass/${examId}/${studentIds}`,
method: 'put',
// data: file,
})
}
// 退回修改
export function back(examId, studentIds) {
return request({
url: `/recruitExam/back/${examId}/${studentIds}`,
method: 'put',
// data: file,
})
}
// 驳回
export function reject(examId, studentIds) {
return request({
url: `/recruitExam/reject/${examId}/${studentIds}`,
method: 'put',
// data: file,
})
}
// 单个通过
export function passOne(examId, studentIds) {
return request({
url: `/recruitExam/passOne/${examId}/${studentIds}`,
method: 'put',
// data: file,
})
}
// 单个退回修改
export function backOne(examId, studentIds) {
return request({
url: `/recruitExam/backOne/${examId}/${studentIds}`,
method: 'put',
// data: file,
})
}
// 单个驳回
export function rejectOne(examId, studentIds) {
return request({
url: `/recruitExam/rejectOne/${examId}/${studentIds}`,
method: 'put',
// data: file,
})
}
// 结束
export function checkEnd(examId) {
return request({
url: `/recruitExam/checkEnd/${examId}`,
method: 'put',
// data: file,
}).then(() => {
})
}
......@@ -41,7 +41,8 @@ export default {
},
data() {
return {
title: process.env.VUE_APP_TITLE,
// title: process.env.VUE_APP_TITLE,
title:'信息化校园管理系统',
logo: logoImg
}
}
......
......@@ -9,7 +9,7 @@
</div>
<app-main/>
<div class="footer">
<div class="pullright">© 2021 zhimin Copyright</div>
<!-- <div class="pullright">© 2021 zhimin Copyright</div>-->
</div>
<right-panel>
<settings/>
......
......@@ -12,6 +12,8 @@ import classAdviser from "@/router/routerMenus/classAdviser";
import officialWork from "@/router/routerMenus/officialWork";
import othersManage from "@/router/routerMenus/othersManage";
import examinationManage from "@/router/routerMenus/examinationManage";
import openRecruitment from "@/router/routerMenus/openRecruitment";
Vue.use(Router);
/* Layout */
import Layout from "@/layout";
......@@ -275,6 +277,8 @@ export const dynamicRoutes = [
...othersManage,
// 考务管理
...examinationManage,
//公开招聘
...openRecruitment,
];
// 防止连续点击多次路由报错
......
import Layout from '@/layout'
export default [
{
path: '/recruitment',
component: Layout,
hidden: true,
permissions: ['childrenHealth:earlyChildhoodSyndrome:archivesManagement:birthday:index'],
children: [
{
path: 'examManage/registeProcess',
component: () => import('@/views/smartSchool/openRecruitment/examManage/components/registeProcess'),
name: 'registeProcess',
meta: {
title: '报名流程'
}
},
{
path: 'examManage',
component: () => import('@/views/smartSchool/openRecruitment/examManage/index'),
name: 'examManage',
meta: {
title: '报名管理'
}
}
]
},
]
......@@ -184,8 +184,11 @@
<el-image :src="indexCalendarImg" style="width: 100%; height: 270px" />
</div>
<div style="position: absolute; width: 100%">
<!-- <div style="font-family: PingFang SC; color: #ffffff; font-size: 16px; margin-top: 20px; margin-left: 20px">-->
<!-- {{ user.userName }}, 欢迎登录智慧校园管理系统!-->
<!-- </div>-->
<div style="font-family: PingFang SC; color: #ffffff; font-size: 16px; margin-top: 20px; margin-left: 20px">
{{ user.userName }}, 欢迎登录智慧校园管理系统!
{{ user.userName }}, 欢迎登录网络数字信息化校园管理系统!
</div>
<div style="font-size: small; margin-top: 8px; color: #96c4f5; margin-left: 20px">
上次登录时间:{{ user.loginDate }}
......
......@@ -29,7 +29,9 @@
</div>
<div class="login-card-right">
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form">
<h3 class="title">智慧校园管理系统</h3>
<!-- <h3 class="title">智慧校园管理系统</h3>-->
<h3 class="title">网络数字信息化校园管理系统</h3>
<el-form-item prop="phonenumber">
<el-input
v-model="loginForm.phonenumber"
......@@ -87,7 +89,7 @@
</div>
<!-- 底部 -->
<div class="el-login-footer">
<span>© 2021 zhimin Copyright </span>
<!-- <span>© 2021 zhimin Copyright </span>-->
</div>
</div>
</template>
......
......@@ -25,7 +25,8 @@
</div>
<div class="login-card-right">
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form">
<h3 class="title">智慧校园管理系统</h3>
<!-- <h3 class="title">智慧校园管理系统</h3>-->
<h3 class="title">网络数字信息化校园管理系统</h3>
<el-form-item prop="phonenumber">
<el-input v-model="loginForm.phonenumber" type="text" auto-complete="off" placeholder="手机号码">
<svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" />
......@@ -67,7 +68,7 @@
</div>
<!-- 底部 -->
<div class="el-login-footer">
<span>© 2021 zhimin Copyright </span>
<!-- <span>© 2021 zhimin Copyright </span>-->
</div>
</div>
</template>
......
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="姓名" prop="studentName">
<el-input v-model="queryParams.studentName" placeholder="请输入姓名" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="账号" prop="idCard">
<el-input v-model="queryParams.idCard" placeholder="请输入账号" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<!-- <el-form-item label="身份证号" prop="idCard">
<el-input
v-model="queryParams.idCard"
placeholder="请输入身份证号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="学籍号" prop="studentNumber">
<el-input
v-model="queryParams.studentNumber"
placeholder="请输入学籍号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="初中学校id" prop="juniorId">
<el-input
v-model="queryParams.juniorId"
placeholder="请输入初中学校id"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="测试项目id" prop="testId">
<el-input
v-model="queryParams.testId"
placeholder="请输入测试项目id"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="身高" prop="height">
<el-input
v-model="queryParams.height"
placeholder="请输入身高"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="体重" prop="weight">
<el-input
v-model="queryParams.weight"
placeholder="请输入体重"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="联系方式1" prop="telephone1">
<el-input
v-model="queryParams.telephone1"
placeholder="请输入联系方式1"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="联系方式2" prop="telephone2">
<el-input
v-model="queryParams.telephone2"
placeholder="请输入联系方式2"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="照片" prop="photo">
<el-input
v-model="queryParams.photo"
placeholder="请输入照片"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="手机号" prop="phoneNumber">
<el-input
v-model="queryParams.phoneNumber"
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="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['system:student:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:student:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:student: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="['system:student:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> -->
<el-table v-loading="loading" :data="studentList" @selection-change="handleSelectionChange">
<el-table-column type="index" width="55" align="center" />
<!-- <el-table-column label="${comment}" align="center" prop="id" /> -->
<el-table-column label="姓名" align="center" prop="studentName" />
<!--
<el-table-column label="学籍号" align="center" prop="studentNumber" /> -->
<!-- <el-table-column label="初中学校id" align="center" prop="juniorId" />
<el-table-column label="测试项目id" align="center" prop="testId" /> -->
<!-- <el-table-column label="性别" align="center" prop="sex" />
<el-table-column label="身高" align="center" prop="height" />
<el-table-column label="体重" align="center" prop="weight" />
<el-table-column label="联系方式1" align="center" prop="telephone1" />
<el-table-column label="联系方式2" align="center" prop="telephone2" />
<el-table-column label="照片" align="center" prop="photo" /> -->
<el-table-column label="手机号" align="center" prop="phoneNumber" />
<el-table-column label="身份证号" align="center" prop="idCard" />
<!-- <el-table-column label="密码" align="center" prop="password" /> -->
<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-view" @click="handleView(scope.row)"
v-hasPermi="['system:student:edit']">查看</el-button>
<el-button size="mini" type="text" icon="el-icon-refresh" @click="handleResetPwd(scope.row)"
v-hasPermi="['system:student: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" />
<!-- 添加或修改学校艺术生信息对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="姓名" prop="studentName">
<el-input v-model="form.studentName" placeholder="请输入姓名" readOnly />
</el-form-item>
<el-form-item label="身份证号" prop="idCard">
<el-input v-model="form.idCard" placeholder="请输入身份证号" readOnly/>
</el-form-item>
<el-form-item label="学籍号" prop="studentNumber">
<el-input v-model="form.studentNumber" placeholder="请输入学籍号" readOnly/>
</el-form-item>
<!-- <el-form-item label="初中学校id" prop="juniorId">
<el-input v-model="form.juniorId" placeholder="请输入初中学校id" />
</el-form-item>
<el-form-item label="测试项目id" prop="testId">
<el-input v-model="form.testId" placeholder="请输入测试项目id" />
</el-form-item> -->
<el-form-item label="身高" prop="height">
<el-input v-model="form.height" placeholder="请输入身高" readOnly/>
</el-form-item>
<el-form-item label="体重" prop="weight">
<el-input v-model="form.weight" placeholder="请输入体重" readOnly/>
</el-form-item>
<el-form-item label="联系方式1" prop="telephone1">
<el-input v-model="form.telephone1" placeholder="请输入联系方式1" readOnly />
</el-form-item>
<el-form-item label="联系方式2" prop="telephone2">
<el-input v-model="form.telephone2" placeholder="请输入联系方式2" readOnly/>
</el-form-item>
<!-- <el-form-item label="照片" prop="photo">
<el-input v-model="form.photo" placeholder="请输入照片" />
</el-form-item> -->
<el-form-item label="手机号" prop="phoneNumber">
<el-input v-model="form.phoneNumber" placeholder="请输入手机号" readOnly/>
</el-form-item>
<!-- <el-form-item label="密码" prop="password">
<el-input v-model="form.password" type="textarea" placeholder="请输入内容" />
</el-form-item> -->
<!-- <el-form-item label="${comment}" prop="delFlag">
<el-input v-model="form.delFlag" placeholder="请输入${comment}" />
</el-form-item> -->
</el-form>
<div slot="footer" class="dialog-footer">
<!-- <el-button type="primary" @click="submitForm">确 定</el-button> -->
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listStudent, getInfo, resetPwd } from "@/api/smartSchool/openRecruitment";
export default {
name: "Student",
data() {
return {
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 学校艺术生信息表格数据
studentList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
studentName: null,
idCard: null,
studentNumber: null,
juniorId: null,
testId: null,
sex: null,
height: null,
weight: null,
telephone1: null,
telephone2: null,
photo: null,
phoneNumber: null,
password: null,
},
// 表单参数
form: {},
// 表单校验
rules: {
delFlag: [
{ required: true, message: "$comment不能为空", trigger: "blur" }
]
}
};
},
created() {
this.getList();
},
methods: {
/** 查询学校艺术生信息列表 */
getList() {
this.loading = true;
listStudent(this.queryParams).then(response => {
this.studentList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
id: null,
studentName: null,
idCard: null,
studentNumber: null,
juniorId: null,
testId: null,
sex: null,
height: null,
weight: null,
telephone1: null,
telephone2: null,
photo: null,
phoneNumber: null,
password: null,
createTime: null,
createBy: null,
updateTime: null,
updateBy: null,
delFlag: 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
// getStudent(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) {
// updateStudent(this.form).then(response => {
// this.$modal.msgSuccess("修改成功");
// this.open = false;
// this.getList();
// });
// } else {
// addStudent(this.form).then(response => {
// this.$modal.msgSuccess("新增成功");
// this.open = false;
// this.getList();
// });
// }
// }
// });
// },
/** 查看按钮操作 */
handleView(row) {
this.reset();
const id = row.id
getInfo(id).then(response => {
this.form = response.data;
this.open = true;
this.isFullbg = "fullbg"
this.title = "查看";
// this.form.eduStudentName = row.eduStudentName
// this.form.infoIdCard = row.infoIdCard
// this.form.eduStudentNumber = row.eduStudentNumber
// this.form.eduSchoolName = row.eduSchoolName
// this.form.eduProject = row.eduProject
// this.form.eduSex = row.eduSex
});
},
/** 重置密码按钮操作 */
handleResetPwd(row) {
this.$prompt('请输入"' + row.studentName + '"的新密码', "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
closeOnClickModal: false,
inputPattern: /^(?=.*[A-Za-z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{6,20}$/,
inputErrorMessage: "用户密码长度为 6 到 20 个字符,且必须包含字母、数字以及特殊符号"
}).then(({value}) => {
resetPwd(row.id, value).then(response => {
this.$modal.msgSuccess("修改成功,新密码是:" + value);
});
}).catch(() => {
});
},
// /** 删除按钮操作 */
// handleDelete(row) {
// const ids = row.id || this.ids;
// this.$modal.confirm('是否确认删除学校艺术生信息编号为"' + ids + '"的数据项?').then(function () {
// return delStudent(ids);
// }).then(() => {
// this.getList();
// this.$modal.msgSuccess("删除成功");
// }).catch(() => { });
// },
}
};
</script>
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" inline v-show="showSearch" label-width="100px">
<el-form-item label="匹配状态" prop="matchStatus">
<el-select v-model="queryParams.matchStatus" @keyup.enter.native="handleQuery" clearable
placeholder="请选择匹配状态">
<el-option v-for="dict in dict.type.match_status" :key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select>
<!-- <el-input v-model="queryParams.submit" placeholder="请输入匹配状态" clearable @keyup.enter.native="handleQuery" />
-->
</el-form-item>
<el-form-item label="审核状态" prop="auditStatus">
<el-select v-model="queryParams.auditStatus" @keyup.enter.native="handleQuery" clearable
placeholder="请选择审核状态">
<el-option v-for="dict in dict.type.audit_status" :key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select>
</el-form-item>
<el-form-item label="姓名" prop="studentName">
<el-input v-model="queryParams.studentName" placeholder="请输入学生姓名" clearable
@keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="身份证号码" prop="infoIdCard">
<el-input v-model="queryParams.infoIdCard" placeholder="请输入身份证号码" clearable
@keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item>
<el-button type="primary" plain icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button plain icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row>
<el-button type="primary" plain icon="el-icon-upload" size="mini" v-if="status == '1'" @click="handleUpload">
导入教育局信息
</el-button>
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">导出报名信息</el-button>
<el-button type="success" plain icon="el-icon-success" size="mini" v-if="status == '1'" @click="handlePass"
:disabled="multiple">通过
</el-button>
<el-button type="danger" plain icon="el-icon-back" size="mini" v-if="status == '1'" @click="handleBack"
:disabled="multiple">退回修改
</el-button>
<el-button type="danger" icon="el-icon-s-release" size="mini" v-if="status == '1'" @click="handleReject"
:disabled="multiple">驳回
</el-button>
<el-button type="info" icon="el-icon-finished" size="mini" v-if="status == '1'" @click="handleFinished">结束
</el-button>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<!-- <el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
v-hasPermi="['system:relation:add']">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate"
v-hasPermi="['system:relation:edit']">修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete"
v-hasPermi="['system:relation: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="['system:relation:export']">导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> -->
<el-table :cell-style="setRowStyle" v-loading="loading" :data="relationList"
@selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center"/>
<el-table-column type="index" label="序号" width="55" align="center"/>
<el-table-column label="头像" align="center" width="100" prop="photo">
<template slot-scope="scope">
<ListImage :image-url="isEmptyAvatar(scope.row.photo, scope.row.sex)"></ListImage>
</template>
</el-table-column>
<el-table-column label="身份证号码" align="center" min-width="180" prop="infoIdCard"/>
<el-table-column label="匹配状态" min-width="110" align="center" prop="matchStatus">
<template slot-scope="scope">
<dict-tag v-if="scope.row.matchStatus == '1'" style="color:#47bb02; font-weight: bold"
:options="dict.type.match_status"
:value="scope.row.matchStatus"/>
<dict-tag v-else style="color:red; font-weight: bold" :options="dict.type.match_status"
:value="scope.row.matchStatus"/>
</template>
</el-table-column>
<el-table-column label="审核状态" align="center" min-width="80" max-width="100" prop="auditStatus">
<template slot-scope="scope">
<dict-tag :options="dict.type.audit_status" :value="scope.row.auditStatus"/>
</template>
</el-table-column>
<el-table-column label="姓名" align="center" prop="studentName"/>
<el-table-column label="学籍号" align="center" prop="studentNumber"/>
<el-table-column label="初中学校" align="center" prop="schoolName"/>
<el-table-column label="测试项目" align="center" prop="project" min-width="100" max-width="120"/>
<el-table-column label="性别" align="center" prop="sex">
<template slot-scope="scope">
<dict-tag :options="dict.type.sys_user_sex" :value="scope.row.sex"/>
</template>
</el-table-column>
<!-- 教育局信息 -->
<el-table-column label="姓名" align="center" width="120px" prop="eduStudentName"/>
<el-table-column label="学籍号" align="center" prop="eduStudentNumber"/>
<el-table-column label="初中学校" width="100" align="center" prop="eduSchoolName"/>
<el-table-column label="测试项目" align="type" prop="eduProject" width="100"/>
<!-- <el-table-column label="身份证号" align="type" prop="eduIdCard" width="80" v-if="0" /> -->
<el-table-column label="性别" align="center" prop="eduSex">
<template slot-scope="scope">
<dict-tag :options="dict.type.sys_user_sex" :value="scope.row.eduSex"/>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" min-width="230"
max-width="300">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit"
v-if="scope.row.auditStatus == '3' && status == '1' &&scope.row.matchStatus != '2' "
@click="handleUpdate(scope.row)" v-hasPermi="['system:relation:edit']">修改
</el-button>
<el-button size="mini" type="text" icon="el-icon-success"
v-if="scope.row.auditStatus == '3'&&scope.row.matchStatus != '0'&&scope.row.matchStatus != '2' && status == '1'"
@click="handlePassOne(scope.row)" v-hasPermi="['system:relation:remove']">通过
</el-button>
<el-button size="mini" type="text" icon="el-icon-back" v-if="scope.row.auditStatus == '3' && status == '1'"
@click="handleBackOne(scope.row)" v-hasPermi="['system:relation:edit']">退回修改
</el-button>
<el-button size="mini" type="text" icon="el-icon-s-release"
v-if="scope.row.auditStatus == '3' && status == '1'"
@click="handleRejectOne(scope.row)" v-hasPermi="['system:relation:remove']">驳回
</el-button>
<el-button size="mini" type="text" icon="el-icon-view" @click="handleView(scope.row)"
v-if="scope.row.auditStatus != '3' && scope.row.auditStatus != null"
v-hasPermi="['system:relation:edit']">查看
</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" /> -->
<!-- 添加或修改【请填写功能名称】对话框 -->
<el-dialog :visible.sync="open" width="1200px" append-to-body @close="cancel">
<div style="display:flex ;width: 950px;">
<div>
<!-- 个人信息 -->
<div style="display:flex ;width:650px;margin: 18px 0 0 0;">
<div style="width:320px">
<div style="font-size: 18px; text-align: center">学生报名信息</div>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="姓名" prop="studentName">
<el-input v-model="form.studentName" placeholder="请输入学生姓名" :readOnly="isHandle"/>
</el-form-item>
<el-form-item label="身份证号" prop="idCard">
<el-input v-model="form.idCard" placeholder="请输入身份证号" @change="searchInfo" readOnly/>
</el-form-item>
<el-form-item label="学籍号" prop="studentNumber">
<el-input v-model="form.studentNumber" placeholder="请输入学籍号" :readOnly="isHandle"/>
</el-form-item>
<el-form-item label="初中学校" prop="schoolName" v-show="!isHandle">
<el-input v-model="form.schoolName" placeholder="请输入初中学校"
@click.native="selectSchool(a = false)"/>
</el-form-item>
<el-form-item label="测试项目" prop="project" v-show="!isHandle">
<el-input v-model="form.project" placeholder="请选择测试项目" readonly
@click.native="selectProjectList(a = false)"/>
</el-form-item>
<el-form-item label="初中学校" prop="schoolName" v-show="isHandle">
<el-input v-model="form.schoolName" placeholder="请输入初中学校" readOnly/>
</el-form-item>
<el-form-item label="测试项目" prop="project" v-show="isHandle">
<el-input v-model="form.project" placeholder="请选择测试项目" readOnly/>
</el-form-item>
<el-form-item label="性别:" prop="sex">
<el-select v-model="form.sex" placeholder="请选择学生性别" :disabled="isHandle">
<el-option v-for="dict in dict.type.sys_user_sex" :key="dict.value" :label="dict.label"
:value="dict.value">
{{ dict.label }}
</el-option>
</el-select>
</el-form-item>
<el-form-item label="联系方式1" prop="telephone1">
<el-input v-model="form.telephone1" placeholder="请输入联系方式" :readOnly="isHandle"/>
</el-form-item>
</el-form>
</div>
<!-- 照片 -->
<div style="width:320px;padding: 0 0 0 20px;">
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item>
<el-upload v-loading="uploadLoading" class="avatar-uploader" action="#" accept="image/*"
:disabled="isHandle" :show-file-list="false" :on-success="handleAvatarSuccess"
:before-upload="beforeAvatarUpload" :http-request="uploadImage">
<img v-if="form.photo" :src="baseUrl + form.photo" class="avatar" alt=""/>
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
<div slot="error">
<img :src="isEmptyAvatar(form.photo, form.sex)"
style="width: 178px; height: 178px; border-radius: 50%" alt="">
</div>
</el-form-item>
<el-form-item label="身高" prop="height">
<el-input v-model="form.height" placeholder="请输入身高" :readOnly="isHandle"/>
</el-form-item>
<el-form-item label="体重" prop="weight">
<el-input v-model="form.weight" placeholder="请输入体重" :readOnly="isHandle"/>
</el-form-item>
<el-form-item label="联系方式2" prop="telephone2">
<el-input v-model="form.telephone2" placeholder="请输入联系方式" :readOnly="isHandle"/>
</el-form-item>
</el-form>
</div>
</div>
<div slot="footer" v-if="!isHandle" style="text-align: center;">
<el-button type="primary" @click="submitForm">保 存</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
<div slot="footer" v-if="isHandle" class="dialog-footer"
style="z-index: 10;top: 0;position: relative;left: 0;">
<el-button @click="cancel" style="pointer-events: auto;">取 消</el-button>
</div>
</div>
<!-- 教育局信息 -->
<div style="width:350px;padding:0 0 0 20px;">
<div style="font-size: 18px;text-align: center">教育局信息</div>
<el-form ref="form" :model="form" :rules="rules" label-width="80px" style="margin:18px 0 0 0 ;">
<el-form-item label="姓名" prop="eduStudentName">
<el-input v-model="form.eduStudentName" placeholder="请输入学生姓名"/>
</el-form-item>
<el-form-item label="身份证号" prop="eduIdCard">
<el-input v-model="form.eduIdCard" readOnly placeholder="请输入身份证号"/>
</el-form-item>
<el-form-item label="学籍号" prop="eduStudentNumber">
<el-input v-model="form.eduStudentNumber" placeholder="请输入学籍号"/>
</el-form-item>
<el-form-item label="初中学校" prop="eduSchoolName" v-show="!isHandle">
<el-input v-model="form.eduSchoolName" placeholder="请输入初中学校"
@click.native="selectSchool(a = true)"/>
</el-form-item>
<el-form-item label="测试项目" prop="eduProject" v-show="!isHandle">
<el-input v-model="form.eduProject" placeholder="请选择测试项目" readonly
@click.native="selectProjectList(a = true)"/>
</el-form-item>
<el-form-item label="初中学校" prop="eduSchoolName" v-show="isHandle">
<el-input v-model="form.eduSchoolName" placeholder="请输入初中学校" readOnly/>
</el-form-item>
<el-form-item label="测试项目" prop="eduProject" v-show="isHandle">
<el-input v-model="form.eduProject" placeholder="请选择测试项目" readOnly/>
</el-form-item>
<el-form-item label="性别:" prop="eduSex">
<el-select v-model="form.eduSex" placeholder="请选择学生性别" :disabled="isHandle">
<el-option v-for="dict in dict.type.sys_user_sex" :key="dict.value" :label="dict.label"
:value="dict.value">
{{ dict.label }}
</el-option>
</el-select>
</el-form-item>
</el-form>
</div>
</div>
</el-dialog>
<!--导入文件对话框 -->
<el-dialog :title="title" :visible.sync="uploadOpen" width="520px" append-to-body inline @close="cancel">
<el-form ref="uploadForm" :model="form" :rules="rules" label-width="70px">
<el-form-item prop="dataUrl">
<el-upload ref="upload" :limit="1" accept=".xlsx, .xls" :headers="upload.headers"
:action="upload.url + '?updateSupport=' + upload.updateSupport" :disabled="upload.isUploading"
:on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
<div class="el-upload__tip text-center" slot="tip">
<!--<div class="el-upload__tip" slot="tip">-->
<!-- <el-checkbox v-model="upload.updateSupport"/>-->
<!-- 是否更新已经存在的用户数据-->
<!--</div>-->
<span>仅允许导入xls、xlsx格式文件。</span>
<el-link type="primary" :underline="false" style="font-size: 12px; vertical-align: baseline"
@click="importTemplate">下载模板
</el-link>
</div>
</el-upload>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitFileForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
<!--选择学校 -->
<el-dialog title="选择学校" :visible.sync="schoolOpen" width="650px" append-to-body style="padding: 0 0 0 0">
<el-form :model="searchParams" ref="queryForm" size="small" inline v-show="showSearch" label-width="100px">
<el-form-item label="学校名称" prop="schoolName">
<el-input v-model="searchParams.schoolName" placeholder="请输入学校名称" clearable
@keyup.enter.native="searchProject"/>
</el-form-item>
<el-form-item>
<el-button type="primary" plain icon="el-icon-search" size="mini" @click="searchSchool">搜索</el-button>
<el-button plain icon="el-icon-refresh" size="mini" @click="resetSearch">重置</el-button>
</el-form-item>
</el-form>
<el-table style="width:560px;margin:0 25px 0 25px" ref="schoolSelect" max-height="250" v-loading="loading"
:data="schoolList" size="small" highlight-current-row @row-click="schoolChange"
@selection-change="schoolSelect"
@select-all="selectAll">
<el-table-column type="selection" width="55" align="center"/>
<el-table-column label="学校名称" align="center" prop="schoolName"/>
<el-table-column label="学校代码" align="center" prop="schoolCode"/>
<!-- <el-table-column prop="deptName" label="部门" align="center">
</el-table-column> -->
</el-table>
<div style="text-align: center; margin: 35px 0 0 0">
<el-button type="primary" @click="confirmSchool" size="small" style="margin: 0 10px 0 0">确 定
</el-button>
<el-button @click="close" size="small" style="margin: 0 30px 0 10px">取 消
</el-button>
</div>
</el-dialog>
<!--选择项目 -->
<el-dialog title="选择项目" :visible.sync="projectOpen" width="650px" append-to-body style="padding: 0 0 0 0">
<el-form :model="searchParams" ref="queryForm" size="small" inline v-show="showSearch" label-width="100px">
<el-form-item label="项目名称" prop="project">
<el-input v-model="searchParams.project" placeholder="请输入学校名称" clearable
@keyup.enter.native="searchProject"/>
</el-form-item>
<el-form-item>
<el-button type="primary" plain icon="el-icon-search" size="mini" @click="searchProject">搜索</el-button>
<el-button plain icon="el-icon-refresh" size="mini" @click="resetSearch">重置</el-button>
</el-form-item>
</el-form>
<el-table style="width:560px;margin:0 25px 0 25px" ref="projectSelect" max-height="250" v-loading="loading"
:data="projectList" size="small" highlight-current-row @row-click="projectChange"
@selection-change="projectSelect" @select-all="selectAll">
<el-table-column type="selection" width="55" align="center"/>
<el-table-column label="项目名称" align="center" prop="project"/>
</el-table>
<div style="text-align: center; margin: 35px 0 0 0">
<el-button type="primary" @click="confirmProject" size="small" style="margin: 0 10px 0 0">确 定
</el-button>
<el-button @click="close" size="small" style="margin: 0 30px 0 10px">取 消
</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
pass,
back,
reject,
checkEnd,
checkList,
getStudent,
delRelation,
addRelation,
updateRelation,
commonUpload,
getProjectList,
listSchool,
getPerInfo,
rejectOne,
backOne,
passOne
} from "@/api/smartSchool/openRecruitment";
import {getToken} from "@/utils/auth";
import {Gender, Nations} from "@/enums/common";
export default {
name: "Relation",
props: ['examId'],
dicts: ["match_status", 'sys_user_sex', "registration_status", 'audit_status'],
baseUrl: process.env.VUE_APP_BASE_API,
created() {
// this.getList();
// this.getTestList()
// this.getStatus()
},
data() {
return {
baseUrl: [process.env.VUE_APP_BASE_API],
// 学校id
schoolId: null,
// 学校名称
schoolName: null,
// 项目id
testId: null,
// 项目名称
project: null,
// 遮罩层
loading: true,
//
isEdu: null,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 【请填写功能名称】表格数据
relationList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 是否修改
isHandle: false,
// 选择项目弹窗
projectOpen: false,
// 图片上传遮罩层
uploadLoading: false,
// 图片路径
imageUrl: undefined,
// 是否查看
// isFullbg: false,
// 导入对话框
uploadOpen: false,
// 选择学校
schoolOpen: false,
// 导出
// exportType: '',
//考试状态
status: null,
//个人信息审核状态状态
auditStatus: null,
//学校列表
schoolList: null,
// 测试项目
projectList: null,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
examId: null,
studentId: null,
auditStatus: null,
matchStatus: null,
infoIdCard: null,
submit: null,
examNumber: null,
inGroup: null,
examDate: null,
examTime: null,
examAddress: null,
score: null,
result: null,
passScore: null,
step: null
},
// 查询参数
searchParams: {},
// 用户导入参数
upload: {
// 是否显示弹出层(学生导入)
open: false,
// 是否禁用上传
// isUploading: false,
// 是否更新已经存在的用户数据
updateSupport: 0,
// 设置上传的请求头部
headers: {Authorization: "Bearer " + getToken()},
// 上传的地址
url: process.env.VUE_APP_BASE_API + `/eduArtStudent/importData/${this.examId}`,
},
// 表单参数
form: {
eduStudentName: undefined
},
// 表单校验
rules: {
sex: [
{required: true, message: "性别不能为空", trigger: "blur"}
],
project: [
{required: true, message: "测试项目不能为空", trigger: "blur"}
],
schoolName: [
{required: true, message: "初中学校不能为空", trigger: "blur"}
],
studentNumber: [
{required: true, message: "学籍号不能为空", trigger: "blur"}
],
idCard: [
{required: true, message: "身份证号不能为空", trigger: "blur"}
],
studentName: [
{required: true, message: "学生姓名不能为空", trigger: "blur"}
],
telephone1: [
{required: true, message: "联系电话1不能为空", trigger: "blur"}
],
height: [
{required: true, message: "身高不能为空", trigger: "blur"}
],
weight: [
{required: true, message: "体重不能为空", trigger: "blur"}
],
telephone2: [
{required: true, message: "联系电话2不能为空", trigger: "blur"}
],
eduSex: [
{required: true, message: "性别不能为空", trigger: "blur"}
],
eduProject: [
{required: true, message: "测试项目不能为空", trigger: "blur"}
],
eduSchoolName: [
{required: true, message: "初中学校不能为空", trigger: "blur"}
],
eduStudentNumber: [
{required: true, message: "学籍号不能为空", trigger: "blur"}
],
eduStudentName: [
{required: true, message: "学生姓名不能为空", trigger: "blur"}
],
}
};
},
methods: {
/** 查询【请填写功能名称】列表 */
getList() {
this.loading = true;
checkList(this.examId, this.queryParams).then(response => {
this.relationList = response.rows;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.uploadOpen = false;
this.schoolOpen = false;
this.projectOpen = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
id: null,
examId: null,
studentId: null,
auditStatus: "0",
matchStatus: "0",
infoIdCard: null,
submit: null,
examNumber: null,
inGroup: null,
examDate: null,
examTime: null,
examAddress: null,
score: null,
result: null,
passScore: null,
createTime: null,
createBy: null,
updateTime: null,
updateBy: null,
delFlag: null,
step: null,
photo: '',
};
this.imageUrl = ''
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 重置选择按钮操作 */
resetSearch() {
this.searchParams = {}
this.searchSchool()
this.searchProject()
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.studentId)
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 导入按钮操作 */
handleUpload(row) {
this.reset();
this.title = "导入"
this.uploadOpen = true
},
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true;
// console.log(event, file, fileList);
},
// 文件上传成功处理
handleFileSuccess(response, file, fileList) {
this.uploadOpen = false
this.upload.isUploading = false
this.$refs.upload.clearFiles()
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + '</div>', '导入结果', {dangerouslyUseHTMLString: true})
this.getList()
},
// 通过
handlePass(row) {
const examId = this.examId
const id = row.studentId || this.ids
let msg = ''
this.$modal.confirm('是否确认通过审核?').then(function () {
return pass(examId, id).then(res => {
msg = res.msg
// this.$modal.msgSuccess(res.msg);
});
}).then(() => {
this.getList();
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + msg + '</div>', '通过结果', {dangerouslyUseHTMLString: true})
// this.$modal.msgSuccess("审核通过");
}).catch(() => {
});
},
// 退回修改
handleBack(row) {
const examId = this.examId
const id = row.studentId || this.ids
let msg = ''
this.$modal.confirm('是否确认退回修改数据?').then(function () {
return back(examId, id).then(res => {
// this.$modal.msgSuccess(res.msg);
msg = res.msg
});
;
}).then(() => {
this.getList();
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + msg + '</div>', '退回修改结果', {dangerouslyUseHTMLString: true})
}).catch(() => {
});
},
// 驳回
handleReject(row) {
const examId = this.examId
const id = row.studentId || this.ids
let msg = ''
this.$modal.confirm('是否确认驳回?').then(function () {
return reject(examId, id).then(res => {
// this.$modal.msgSuccess(res.msg);
// this.getList();
msg = res.msg
});
;
}).then(() => {
this.getList();
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + msg + '</div>', '驳回结果', {dangerouslyUseHTMLString: true})
// this.$modal.msgSuccess("驳回成功");
}).catch(() => {
});
},
// 通过
handlePassOne(row) {
const examId = this.examId
const id = row.studentId || this.ids
// let msg = ''
this.$modal.confirm('是否确认通过审核?').then(function () {
return passOne(examId, id)
}).then(() => {
this.getList();
// this.$modal.msgSuccess(msg);
this.$modal.msgSuccess("审核通过");
}).catch(() => {
});
},
// 退回修改
handleBackOne(row) {
const examId = this.examId
const id = row.studentId || this.ids
this.$modal.confirm('是否确认退回修改该数据?').then(function () {
return backOne(examId, id)
}).then(() => {
this.getList();
this.$modal.msgSuccess("退回修改成功");
}).catch(() => {
});
},
// 驳回
handleRejectOne(row) {
const examId = this.examId
const id = row.studentId || this.ids
this.$modal.confirm('是否确认驳回?').then(function () {
return rejectOne(examId, id)
}).then(() => {
this.getList();
this.$modal.msgSuccess("驳回成功");
}).catch(() => {
});
},
// 结束
handleFinished(row) {
const examId = this.examId
this.$confirm('是否确认结束该流程?').then(function () {
return checkEnd(examId);
}).then(() => {
this.getList();
this.$modal.msgSuccess("结束成功");
this.$emit("sendStatus")
}).catch(() => {
});
},
// 提交上传文件
submitFileForm() {
this.$refs.upload.submit();
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.isHandle = false
// this.isFullbg = " "
this.title = "添加";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.isHandle = false
this.reset();
const id = row.studentId
getStudent(id, this.examId).then(response => {
this.form = response.data;
this.imageUrl = this.isEmptyAvatar(this.form.photo, this.form.sex);
this.open = true;
this.title = "修改";
// this.form.eduStudentName = row.eduStudentName
this.$set(this.form, 'eduStudentName', row.eduStudentName)
this.$set(this.form, 'eduIdCard', row.eduIdCard)
// this.$set(this.form,'idCard',row.idCard)
this.$set(this.form, 'eduStudentNumber', row.eduStudentNumber)
this.$set(this.form, 'eduSchoolName', row.eduSchoolName)
this.$set(this.form, 'eduProject', row.eduProject)
this.$set(this.form, 'eduSex', row.eduSex)
// this.form.eduIdCard = row.eduIdCard
// this.form.idCard = row.infoIdCard
// this.form.eduStudentNumber = row.eduStudentNumber
// this.form.eduSchoolName = row.eduSchoolName
// this.form.eduProject = row.eduProject
// this.form.edusex = row.eduSex
});
},
// 获取状态
getStatus(statu) {
this.getList();
// 获取测试项目
// getProjectList().then(response => {
// this.projectList = response.rows;
// });
this.status = statu
},
/** 查看按钮操作 */
handleView(row) {
this.reset();
this.isHandle = true
const id = row.studentId
getStudent(id, this.examId).then(response => {
this.form = response.data;
this.imageUrl = this.isEmptyAvatar(this.form.photo, this.form.sex);
this.open = true;
// this.isFullbg = "fullbg"
this.title = "查看";
this.form.eduStudentName = row.eduStudentName
this.form.idCard = row.infoIdCard
this.form.eduIdCard = row.eduIdCard
this.form.eduStudentNumber = row.eduStudentNumber
this.form.eduSchoolName = row.eduSchoolName
this.form.eduProject = row.eduProject
this.form.eduSex = row.eduSex
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
// this.form.eduSex = this.form.edusex
if (valid) {
if (this.form.id != null) {
// this.form.eduIdCard = this.form.idCard
updateRelation(this.examId, this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addRelation(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
// 获取个人信息
searchInfo() {
getPerInfo(this.form.idCard).then(res => {
// this.form.studentName = res.data.studentName
this.form.sex = res.data.sex
// this.$nextTick(() => {
// this.$refs.form.clearValidate(['classAlias'])
// })
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除编号为"' + ids + '"的数据项?').then(function () {
return delRelation(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {
});
},
/** 导出按钮操作 */
handleExport() {
this.download(`/artStudent/export/${this.examId}`, {
...this.queryParams
}, `报名信息${Date.now()}.xlsx`)
},
// 下载模板
importTemplate() {
this.download(
"/eduArtStudent/importTemplate",
{},
`导入教育局信息内模板_${Date.now()}.xlsx`
);
},
// 上传图片
uploadImage(file) {
const fileData = file.file
const formData = new FormData()
formData.append('file', fileData)
this.uploadLoading = true
commonUpload(formData)
.then(response => {
this.uploadLoading = false
this.$modal.msgSuccess('上传成功')
this.imageUrl = this.pev + response.url
console.log(response, 591);
this.form.photo = response.fileName
})
.catch(error => {
this.uploadLoading = false
})
},
// 移除图片
handleRemove() {
this.imageUrl = undefined
},
// 上传前格式和图片大小限制
beforeAvatarUpload(file) {
const type = file.type === 'image/jpeg' || 'image/jpg' || 'image/webp' || 'image/png'
const isLt2M = file.size / 1024 / 1024 < 2
if (!type) {
this.$message.error('图片格式不正确!(只能包含jpg,png,webp,JPEG)')
}
if (!isLt2M) {
this.$message.error('上传图片大小不能超过 2MB!')
}
return type && isLt2M
},
// 上传成功回调
handleAvatarSuccess(res, file) {
this.imageUrl = res.data.url
this.commonUpload(file)
},
handleExceed(files, fileList) {
this.$message.warning(`当前限制选择 1 个文件`);
},
/** 判断学生头像是否为空 */
isEmptyAvatar(imageUrl, sex) {
if (!imageUrl) {
let url = null;
if (Gender.MALE === sex) {
url = require('@/assets/images/boy.png');
} else {
url = require('@/assets/images/girl.png');
}
return url
} else
return this.baseUrl + imageUrl;
},
// 设置单元格样式
setRowStyle(row, column, rowIndex, columnIndex) {
if (row.columnIndex == "6") {
if (row.row.studentName != row.row.eduStudentName) {
return 'color: red;background-color: #D9EDF7'
}
}
if (row.columnIndex == "7") {
if (row.row.studentNumber != row.row.eduStudentNumber) {
return 'color: red;background-color: #D9EDF7'
}
}
if (row.columnIndex == "8") {
if (row.row.schoolName != row.row.eduSchoolName) {
return 'color: red;background-color: #D9EDF7'
}
}
if (row.columnIndex == "9") {
if (row.row.project != row.row.eduProject) {
return 'color: red;background-color: #D9EDF7'
}
}
if (row.columnIndex == "10") {
if (row.row.sex != row.row.eduSex) {
return 'color: red;background-color: #D9EDF7'
}
}
if (row.columnIndex == "11") {
if (row.row.studentName != row.row.eduStudentName) {
return 'color: red;background-color: #F4CE98'
}
}
if (row.columnIndex == "12") {
if (row.row.studentNumber != row.row.eduStudentNumber) {
return 'color: red;background-color: #F4CE98'
}
}
if (row.columnIndex == "13") {
if (row.row.schoolName != row.row.eduSchoolName) {
return 'color: red;background-color: #F4CE98'
}
}
if (row.columnIndex == "14") {
if (row.row.project != row.row.eduProject) {
return 'color: red;background-color: #F4CE98'
}
}
if (row.columnIndex == "15") {
if (row.row.sex != row.row.eduSex) {
return 'color: red;background-color: #F4CE98'
}
}
if (row.columnIndex == "6" || row.columnIndex == "7" || row.columnIndex == "8" || row.columnIndex == "9" || row.columnIndex == "10") {
return 'background-color: #D9EDF7'
}
if (row.columnIndex == "11" || row.columnIndex == "12" || row.columnIndex == "13" || row.columnIndex == "14" || row.columnIndex == "15") {
return 'background-color: #F4CE98'
}
// } else {
// return 'color: red'
// }
},
// 关闭弹窗
close() {
this.schoolOpen = false;
this.projectOpen = false;
},
// 选择学校
selectSchool(a) {
this.isEdu = a
this.schoolOpen = true
// listSchool().then(response => {
// this.schoolList = response.rows;
// });
this.searchSchool()
},
// 搜索学校
searchSchool() {
this.loading = true;
listSchool(this.searchParams).then(response => {
this.schoolList = response.rows;
this.loading = false;
});
},
// 选择测试项目
selectProjectList(a) {
this.isEdu = a
this.projectOpen = true
// getProjectList(this.examId).then(response => {
// this.projectList = response.rows;
// });
this.searchProject()
},
// 搜索项目
searchProject() {
this.loading = true;
getProjectList(this.examId, this.searchParams).then(response => {
this.projectList = response.rows;
this.loading = false;
});
},
//学校多选
schoolSelect(selection) {
if (selection.length > 1) {
let del_row = selection.shift();
this.$refs.schoolSelect.toggleRowSelection(del_row, false);
}
if (selection.length > 0) {
this.schoolId = selection[0].id;
this.schoolName = selection[0].schoolName
}
},
//测试项目
projectSelect(selection) {
if (selection.length > 1) {
let del_row = selection.shift();
this.$refs.projectSelect.toggleRowSelection(del_row, false);
}
if (selection.length > 0) {
this.testId = selection[0].id;
this.project = selection[0].project
}
},
// 点击全部复选框时触发
selectAll(selection) {
this.$refs.schoolSelect.clearSelection() //清除勾选
this.$refs.projectSelect.clearSelection() //清除勾选
},
//项目单选
projectChange(row) {
this.testId = row.id;
this.project = row.project
this.$refs.projectSelect.toggleRowSelection(row)
},
//学校单选
schoolChange(row) {
this.schoolId = row.id;
this.schoolName = row.schoolName
this.$refs.schoolSelect.toggleRowSelection(row)
},
// 确认学校
confirmSchool() {
if (this.isEdu) {
this.form.eduJuniorId = this.schoolId
this.form.eduSchoolName = this.schoolName
this.$nextTick(() => {
this.$refs.form.clearValidate();
})
} else {
this.form.juniorId = this.schoolId
this.form.schoolName = this.schoolName
this.$nextTick(() => {
this.$refs.form.clearValidate();
})
}
this.close()
},
// 确认项目
confirmProject() {
if (this.isEdu) {
this.form.eduTestId = this.testId
this.form.eduProject = this.project
this.$nextTick(() => {
this.$refs.form.clearValidate();
})
} else {
this.form.testId = this.testId
this.form.project = this.project
this.$nextTick(() => {
this.$refs.form.clearValidate();
})
}
this.close()
}
}
};
</script>
<style scoped>
.fullbg {
background-color: rgb(201, 201, 201);
left: 0;
opacity: 0.2;
position: absolute;
top: 0;
z-index: 1;
filter: alpha(opacity=50);
width: 1000px;
height: 800px;
}
.avatar-uploader .el-upload {
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
}
.avatar-uploader .el-upload:hover {
border-color: #409EFF;
}
.avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 178px;
height: 178px;
line-height: 178px;
text-align: center;
}
.avatar {
width: 178px;
height: 178px;
display: block;
}
</style>
<template>
<div class="app-container" style="width:80% ;">
<el-card>
<el-row :gutter="10" class="mb8">
<el-col :span="24">
<el-button v-if="this.status == '0'" style="float:right ;" type="primary" @click="publish">发布
</el-button>
</el-col>
</el-row>
<el-form ref="form" :model="form" :rules="rules" label-width="110px">
<el-form-item label="考试名称" prop="examName">
<el-input v-model="form.examName" placeholder="请输入考试名称" :readOnly="isHandle"/>
</el-form-item>
<el-row :gutter="25">
<el-col :span="12">
<el-form-item label="年度" prop="examYear">
<el-date-picker style="width:100%;" v-model="form.examYear" type="year" value-format="yyyy"
placeholder="选择年度" :readonly="isHandle">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="报名截止时间" prop="deadline">
<el-date-picker clearable style="width:100%;" v-model="form.deadline" type="datetime"
value-format="yyyy-MM-dd HH:mm"
format="yyyy-MM-dd HH:mm" placeholder="请选择报名截止时间" :readonly="isHandle">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="考试开始时间" prop="startTime">
<el-date-picker
v-model="form.startTime"
type="date"
style="width: 100%"
:readonly="isHandle"
placeholder="选择日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="考试结束时间" prop="endTime">
<el-date-picker
v-model="form.endTime"
type="date"
:picker-options="pickerOptionsEnd"
style="width: 100%"
:readonly="isHandle"
placeholder="选择日期">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<!-- <el-form-item label="考试结束时间" prop="endTime">
<el-date-picker clearable v-model="form.endTime" type="date" value-format="yyyy-MM-dd" placeholder="请选择考试结束时间">
</el-date-picker>
</el-form-item> -->
<el-form-item label="测试项目" prop="projectName" v-if="!isHandle">
<!-- <el-select v-model="form.projectIdList" multiple placeholder="请选择测试项目" style="width: 100%"
:disabled="isHandle">
<el-option v-for="item in projectList" :key="item.id" :label="item.project"
:value="item.id"></el-option>
</el-select> -->
<el-input v-model="form.projectName" placeholder="请选择测试项目" @click.native="selectProjectList"/>
</el-form-item>
<el-form-item label="测试项目" prop="projectName" v-if="isHandle">
<!-- <el-select v-model="form.projectIdList" multiple placeholder="请选择测试项目" style="width: 100%"
:disabled="isHandle">
<el-option v-for="item in projectList" :key="item.id" :label="item.project"
:value="item.id"></el-option>
</el-select> -->
<el-input v-model="form.projectName" placeholder="请选择测试项目" readOnly/>
</el-form-item>
<!-- <el-form-item label="考试安排" prop="examArrange">
<el-input v-model="form.examArrange" type="textarea" :autosize="{ minRows: 3, maxRows: 5 }"
placeholder="请输入内容" />
</el-form-item> -->
<div v-if="!isHandle">
<el-form-item label="考试安排" prop="examArrange">
<Editor v-model="form.examArrange" :min-height="150"></Editor>
</el-form-item>
<el-form-item label="考试注意事项" prop="notice">
<Editor v-model="form.notice" :min-height="150"></Editor>
</el-form-item>
</div>
<div v-if="isHandle">
<el-form ref="form" :model="form" :rules="rules" label-width="110px">
<el-form-item label="考试安排" prop="examArrange">
<Editor v-model="form.examArrange" :min-height="150" readOnly></Editor>
</el-form-item>
<el-form-item label="考试注意事项" prop="notice">
<Editor v-model="form.notice" :min-height="150" readOnly></Editor>
</el-form-item>
</el-form>
</div>
</el-form>
<el-dialog title="测试项目" :visible.sync="openSelect" width="800px" append-to-body @close="DialogClose">
<el-table ref="examInfo-table-project" key="b" @row-click="rowClick" size="small" height="400px"
:data="projectList" @selection-change="handleSelectionChange" :row-key="getRowId">
<el-table-column type="selection" width="55" reserve-selection align="center"/>
<el-table-column label="序号" min-width="100" type="index" align="center"/>
<el-table-column label="项目名称" min-width="100" align="center" prop="project"/>
<el-table-column label="项目类型" min-width="100" align="center" prop="type">
<template slot-scope="scope">
<dict-tag :options="dict.type.professional_category" :value="scope.row.type"></dict-tag>
</template>
</el-table-column>
<el-table-column label="项目创建时间" min-width="100" align="center" prop="createTime"/>
</el-table>
<div slot="footer">
<el-button type="primary" @click="selectConfirm">确 定</el-button>
<el-button @click="selectClose">取 消</el-button>
</div>
</el-dialog>
</el-card>
</div>
</template>
<script>
import {getExam, editPub, listProject} from "@/api/smartSchool/openRecruitment";
export default {
name: "Exam",
dicts: ['professional_category', 'registration_status'],
props: ['examId'],
created() {
// this.getList();
// this.getTestList()
},
data() {
return {
isFirst: true,
pickerOptionsEnd: {
disabledDate: (time) => {
return new Date(time) < new Date(this.form.startTime)
},
},
tableSelection: [],
projectIdList: null,
projectName: null,
status: null,
// 遮罩层
loading: true,
//
openSelect: false,
// 是否修改
isHandle: false,
// 测试项目
projectList: [],
// 表单参数
form: {},
// 表单校验
rules: {
// delFlag: [
// { required: true, message: "$comment不能为空", trigger: "blur" }
// ],
examName: [
{required: true, message: "考试名称不能为空", trigger: "blur"}
],
examYear: [
{required: true, message: "考试年度不能为空", trigger: "blur"}
],
deadline: [
{required: true, message: "报名截止时间不能为空", trigger: "blur"}
],
startTime: [
{required: true, message: "开始时间不能为空", trigger: "blur"}
],
endTime: [
{required: true, message: "结束时间不能为空", trigger: "blur"}
],
type: [
{required: true, message: "测试项目不能为空", trigger: "blur"}
],
examArrange: [
{required: true, message: "考试安排不能为空", trigger: "blur"}
],
notice: [
{required: true, message: "考试注意事项不能为空", trigger: "blur"}
],
projectName: [
{required: true, message: "测试项目不能为空", trigger: "blur"}
],
}
};
},
methods: {
/** 查询列表 */
getList() {
// this.loading = false;
this.loading = true;
getExam(this.examId).then(response => {
this.form = response.data;
this.form.examYear = this.form.examYear + ''
this.loading = false;
});
},
/** 发布按钮 */
publish() {
this.$refs["form"].validate(valid => {
if (valid) {
editPub(this.form).then(response => {
this.$modal.msgSuccess("发布成功");
this.$emit("sendStatus")
});
}
});
},
// 获取当前考试信息
getStatus(statu) {
this.getList();
listProject().then(response => {
this.projectList = response.rows;
});
this.status = statu
if (this.status != '0') {
this.isHandle = true
}
},
/** 查询所有的测试项目列表 */
getTestList() {
this.loading = true;
listProject().then(response => {
this.projectList = response.rows;
this.loading = false;
});
},
/** ************************************ 开 始 *********************************** */
/**测试项目列表弹框--确定按钮*/
selectConfirm() {
this.form.projectIdList = this.tableSelection.map(item => item.id);
let projectName = this.tableSelection.map(item => item.project);
// this.$set(this.form, 'projectName', '')
this.$set(this.form, 'projectName', projectName.join(','))
this.$nextTick(() => {
this.$refs['examInfo-table-project'].clearSelection()
})
// this.$nextTick(() => {
// this.$refs.form.clearValidate();
// })
this.openSelect = false;
},
rowClick(row) {
this.$refs['examInfo-table-project'].toggleRowSelection(row)
},
/** 多选框选中数据发生改变*/
handleSelectionChange(selection) {
this.tableSelection = selection
this.ids = selection.map(item => item.id)
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 点击测试项目触发*/
selectProjectList() {
this.openSelect = true
this.getTestList() //获取所有项目列表
this.form.projectIdList.map(item => {
this.projectList.map(itemData => {
if (itemData.id == item) {
this.$nextTick(() => {
this.$refs["examInfo-table-project"].toggleRowSelection(itemData, true)
})
}
});
});
},
DialogClose() {
this.$refs["examInfo-table-project"].clearSelection()
},
/** ************************************ 结束 *********************************** */
selectClose() {
this.openSelect = false
},
getRowId(row) {
return row.id; // row-key绑定的必须为唯一值
},
}
};
</script>
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="姓名" prop="studentName">
<el-input v-model="queryParams.studentName" placeholder="请输入姓名" clearable
@keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="身份证号码" label-width="100px" prop="idCard">
<el-input v-model="queryParams.idCard" placeholder="请输入身份证号码" clearable
@keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="测试项目" prop="project">
<el-input v-model="queryParams.project" 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="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
v-hasPermi="['system:relation:add']">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate"
v-hasPermi="['system:relation:edit']">修改</el-button>
</el-col> -->
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-upload" size="mini" v-if="status == '2'" @click="handleUpload"
v-hasPermi="['system:relation: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="['system:relation:export']">导出
</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="primary" plain size="mini" @click="publish" v-if="status == '2'"
v-hasPermi="['system:exam:add']">发布
</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="relationList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center"/>
<el-table-column label="序号" type="index" width="55" align="center"/>
<el-table-column label="头像" align="center" min-width="100" prop="photo">
<template slot-scope="scope">
<ListImage :image-url="isEmptyAvatar(scope.row.photo, scope.row.sex)"></ListImage>
</template>
</el-table-column>
<el-table-column label="身份证号码" align="center" prop="idCard" min-width="180"/>
<el-table-column label="姓名" align="center" min-width="88" prop="studentName"/>
<el-table-column label="学籍号" align="center" min-width="180" prop="studentNumber"/>
<el-table-column label="初中学校" key="juniorSchool" min-width="130" align="center" prop="schoolName"/>
<el-table-column label="测试项目" align="type" prop="project" min-width="100">
</el-table-column>
<el-table-column label="性别" align="center" prop="sex" min-width="80">
<template slot-scope="scope">
<dict-tag :options="dict.type.sys_user_sex" :value="scope.row.sex"/>
</template>
</el-table-column>
<el-table-column label="准考证号" align="center" prop="examNumber" min-width="180"/>
<el-table-column label="分组" align="center" min-width="100" prop="inGroup"/>
<el-table-column label="考试日期" align="center" prop="examDate" min-width="100">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.examDate, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="考试时间" align="center" min-width="100" prop="examTime"/>
<el-table-column label="考试地点" align="center" min-width="150" prop="examAddress"/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="100">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" v-if="status == '2'" @click="handleUpdate(scope.row)">
修改
</el-button>
<el-button size="mini" type="text" icon="el-icon-view" @click="handleView(scope.row)"
v-if="status == '3'||status == '4'">查看
</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"/>
<!-- 添加或修改【请填写功能名称】对话框 -->
<el-dialog :title="title" :visible.sync="open" width="1000px">
<el-row :gutter="30">
<el-col :span="9">
<!-- 个人信息 -->
<div style="font-size: 20px;text-align: center"><b>报名信息</b></div>
<br/><br/>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="姓名:" prop="studentName">
<el-input v-model="form.studentName" placeholder="请输入学生姓名" readOnly/>
</el-form-item>
<el-form-item label="性别:">
<el-select ref="sexSelect" v-model="form.sex" style="width: 100%" placeholder="请选择学生性别" disabled>
<el-option v-for="dict in dict.type.sys_user_sex" :key="dict.value" :label="dict.label"
:value="dict.value">
{{ dict.label }}
</el-option>
</el-select>
</el-form-item>
<el-form-item label="测试项目:" prop="project">
<el-input v-model="form.project" placeholder="请选择测试项目" readOnly/>
</el-form-item>
<el-form-item label="身份证号:" prop="idCard">
<el-input v-model="form.idCard" placeholder="请输入身份证号" readOnly/>
</el-form-item>
<el-form-item label="学籍号:" prop="studentNumber">
<el-input v-model="form.studentNumber" placeholder="请输入学籍号" readOnly/>
</el-form-item>
<el-form-item label="初中学校:" prop="schoolName">
<el-input v-model="form.schoolName" placeholder="请输入初中学校" readOnly/>
</el-form-item>
<el-form-item label="身高:" prop="height">
<el-input v-model="form.height" placeholder="请输入身高" readOnly>
<template slot="suffix">CM</template>
</el-input>
</el-form-item>
<el-form-item label="体重:" prop="weight">
<el-input v-model="form.weight" placeholder="请输入体重" readOnly>
<template slot="suffix">KG</template>
</el-input>
</el-form-item>
<el-form-item label="联系方式1:" prop="telephone1">
<el-input v-model="form.telephone1" placeholder="请输入联系方式" readOnly/>
</el-form-item>
<el-form-item label="联系方式2:" prop="telephone2">
<el-input v-model="form.telephone2" placeholder="请输入联系方式" readOnly/>
</el-form-item>
</el-form>
</el-col>
<el-col :span="6">
<!-- 照片 -->
<el-form ref="form" :model="form" :rules="rules" label-width="0px">
<br/><br/><br/><br/>
<el-form-item>
<el-image :src="isEmptyAvatar(form.photo, form.sex)" fit="fill"
style=" display: block; margin: auto; width: 200px; height: 200px;" alt="学生照片加载失败"/>
</el-form-item>
</el-form>
</el-col>
<el-col :span="9">
<!-- 分配考场信息 -->
<div style="font-size: 20px;text-align: center"><b>考场信息</b></div>
<br/><br/>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="准考证号" prop="examNumber">
<el-input v-model="form.examNumber" :readOnly="isHandle"/>
</el-form-item>
<el-form-item label="分组" prop="inGroup">
<el-input v-model="form.inGroup" :readOnly="isHandle"/>
</el-form-item>
<el-form-item label="考试日期" prop="examDate">
<el-date-picker :disabled="isHandle" style="width: 100%" v-model="form.examDate" type="date"
placeholder="选择日期">
</el-date-picker>
</el-form-item>
<el-form-item label="考试时间" prop="examTime">
<el-time-select :disabled="isHandle" style="width: 100%" v-model="form.examTime" :picker-options="{
start: '08:30',
step: '00:15',
end: '18:30'
}" placeholder="选择时间">
</el-time-select>
</el-form-item>
<el-form-item label="考试地点" prop="examAddress">
<el-input v-model="form.examAddress" :readOnly="isHandle"/>
</el-form-item>
</el-form>
</el-col>
</el-row>
<div slot="footer">
<el-button v-show="!isHandle" type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel">{{ isHandle ? '退 出' : '取 消' }}</el-button>
</div>
</el-dialog>
<!--导入文件对话框 -->
<el-dialog :title="title" :visible.sync="uploadOpen" width="520px" append-to-body inline @close="cancel">
<el-form ref="uploadForm" :model="form" :rules="rules" label-width="70px">
<el-form-item label="文 件:" prop="dataUrl">
<el-upload ref="upload" :limit="1" accept=".xlsx, .xls" :headers="upload.headers"
:action="upload.url + '?updateSupport=' + upload.updateSupport" :disabled="upload.isUploading"
:on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
<div class="el-upload__tip text-center" slot="tip">
<!--<div class="el-upload__tip" slot="tip">-->
<!-- <el-checkbox v-model="upload.updateSupport"/>-->
<!-- 是否更新已经存在的用户数据-->
<!--</div>-->
<span>仅允许导入xlsxlsx格式文件。</span>
<!-- <el-link type="primary" :underline="false" style="font-size: 12px; vertical-align: baseline"
@click="importTemplate">下载模板
</el-link> -->
</div>
</el-upload>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitFileForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
getAddressInfo,
delRelation,
addRelation,
handleEdit,
addressEnd,
addressList,
listProject
} from "@/api/smartSchool/openRecruitment";
import {getToken} from "@/utils/auth";
import {Gender, Nations} from "@/enums/common";
export default {
name: "Relation",
dicts: ['professional_category', 'sys_user_sex', 'registration_status'],
props: ['examId'],
data() {
return {
baseUrl: [process.env.VUE_APP_BASE_API],
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 测试项目
// projectList: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 【请填写功能名称】表格数据
relationList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
//考试状态
status: null,
open: false,
// 是否修改
isHandle: false,
// 导入对话框
uploadOpen: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
examId: null,
studentId: null,
auditStatus: null,
matchStatus: null,
infoIdCard: null,
projectIdList: null,
submit: null,
examNumber: null,
inGroup: null,
examDate: null,
examTime: null,
examAddress: null,
score: null,
result: null,
passScore: null,
step: null
},
// 用户导入参数
upload: {
// 是否显示弹出层(学生导入)
open: false,
// 是否禁用上传
// isUploading: false,
// 是否更新已经存在的用户数据
updateSupport: 0,
// 设置上传的请求头部
headers: {Authorization: "Bearer " + getToken()},
// 上传的地址
url: process.env.VUE_APP_BASE_API + `/artExam/importAddressData/${this.examId}`,
},
// 表单参数
form: {},
// 表单校验
rules: {
examTime: [
{required: true, message: "考试时间不能为空", trigger: "blur"}
],
examDate: [
{required: true, message: "考试日期不能为空", trigger: "blur"}
],
inGroup: [
{required: true, message: "分组不能为空", trigger: "blur"}
],
examNumber: [
{required: true, message: "准考证号不能为空", trigger: "blur"}
],
examAddress: [
{required: true, message: "考试地点不能为空", trigger: "blur"}
],
}
};
},
created() {
// this.getList();
// this.getTestList();
},
methods: {
/** 查询【请填写功能名称】列表 */
getList() {
this.loading = true;
addressList(this.examId, this.queryParams).then(response => {
this.relationList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.uploadOpen = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
id: null,
examId: null,
studentId: null,
auditStatus: "0",
matchStatus: "0",
infoIdCard: null,
submit: null,
examNumber: null,
inGroup: null,
examDate: null,
examTime: null,
examAddress: null,
score: null,
result: null,
passScore: null,
createTime: null,
createBy: null,
updateTime: null,
updateBy: null,
delFlag: null,
step: null
};
this.resetForm("form");
},
// 获取状态
getStatus(statu) {
this.getList();
this.status = statu
},
/** 搜索按钮操作 */
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.isHandle = false
this.title = "添加";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.isHandle = false
this.reset();
const id = row.id || this.ids
getAddressInfo(id).then(response => {
this.form = response.data;
this.imageUrl = this.isEmptyAvatar(this.form.photo, this.form.sex);
this.open = true;
this.title = "修改";
});
},
/** 查看按钮操作 */
handleView(row) {
this.reset();
this.isHandle = true
const id = row.id || this.ids
getAddressInfo(id).then(response => {
this.form = response.data;
this.imageUrl = this.isEmptyAvatar(this.form.photo, this.form.sex);
this.open = true;
this.title = "考试信息查看";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
handleEdit(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addRelation(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 delRelation(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {
});
},
/** 判断学生头像是否为空 */
isEmptyAvatar(imageUrl, sex) {
if (!imageUrl) {
let url = null;
if (Gender.MALE === sex) {
url = require('@/assets/images/boy.png');
} else {
url = require('@/assets/images/girl.png');
}
return url
} else
return this.baseUrl + imageUrl;
},
/** 导出按钮操作 */
handleExport() {
this.download(`/artExam/exportAddress/${this.examId}`, {
...this.queryParams
}, `考场分配${Date.now()}.xlsx`)
},
/** 导入按钮操作 */
handleUpload(row) {
this.reset();
this.title = "导入"
this.uploadOpen = true
},
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true;
// console.log(event, file, fileList);
},
// 文件上传成功处理
handleFileSuccess(response, file, fileList) {
this.uploadOpen = false
this.upload.isUploading = false
this.$refs.upload.clearFiles()
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + '</div>', '导入结果', {dangerouslyUseHTMLString: true})
this.getList()
},
// 提交上传文件
submitFileForm() {
this.$refs.upload.submit();
},
// 下载模板
// importTemplate() {
// this.download(
// "/eduArtStudent/importTemplate",
// {},
// `导入教育局信息内模板_${new Date().getTime()}.xlsx`
// );
// },
publish() {
const examId = this.examId
this.$confirm('是否确认发布?').then(function () {
return addressEnd(examId)
}).then(() => {
this.getList();
this.$modal.msgSuccess("发布成功");
this.$emit("sendStatus")
}).catch(() => {
});
// addressEnd(this.form).then(response => {
// this.$modal.msgSuccess("发布成功");
// });
},
}
};
</script>
<style scoped>
.fullbg {
background-color: rgb(201, 201, 201);
left: 0;
opacity: 0.2;
position: absolute;
top: 0;
z-index: 1;
filter: alpha(opacity=50);
width: 1000px;
height: 800px;
}
.avatar-uploader .el-upload {
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
}
.avatar-uploader .el-upload:hover {
border-color: #409EFF;
}
.avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 178px;
height: 178px;
line-height: 178px;
text-align: center;
}
.avatar {
width: 178px;
height: 178px;
display: block;
}
.el-form-item {
margin-bottom: 10px;
}
</style>
<template>
<div class="">
<!-- <el-tabs tab-position="left" style="height: 200px;"> -->
<el-tabs tab-position="left" v-model="activeTab" :before-leave="back">
<el-tab-pane label="考试信息" :disabled="disable" name="0">
<examInfo ref="examInfo" :examId="id" @sendStatus="sendStatus"></examInfo>
</el-tab-pane>
<el-tab-pane label="报名阶段(信息审核)" :disabled="disable1" name="1">
<InfoReview ref="InfoReview" :examId="id" @sendStatus="sendStatus"></InfoReview>
</el-tab-pane>
<el-tab-pane label="考场分配" :disabled="disable2" name="2">
<examRoomAllocate ref="examRoomAllocate" :examId="id" @sendStatus="sendStatus"/>
</el-tab-pane>
<el-tab-pane label="成绩管理" :disabled="disable3" name="3">
<scoreManage ref="scoreManage" :examId="id" @sendStatus="sendStatus"/>
</el-tab-pane>
<el-tab-pane label="返回列表" name="4">
</el-tab-pane>
</el-tabs>
</div>
</template>
<script>
import examInfo from "../components/examInfo.vue";
import InfoReview from "../components/InfoReview.vue";
import examRoomAllocate from "../components/examRoomAllocate.vue";
import scoreManage from "../components/scoreManage.vue";
import { getExam, listProject } from "@/api/smartSchool/openRecruitment";
export default {
name: '',
components: {
examInfo,
InfoReview,
examRoomAllocate,
scoreManage
},
created() {
this.id = this.$route.query.id
this.handleTab(this.$route.query.index)
this.sendStatus()
},
data() {
return {
id: null,
status: null,
activeTab: '0',
disable: true,
disable1: true,
disable2: true,
disable3: true,
statu: null,
// 测试项目
projectList: [],
}
},
methods: {
/** 设置activeTab */
handleTab(status) {
this.activeTab = status
if (status == '4') {
this.activeTab = '3'
}
switch (status) {
case '0':
this.disable = false;
break;
case '1':
this.disable = this.disable1 = false
break;
case '2':
this.disable = this.disable1 = this.disable2 = false
break;
case '3':
this.disable = this.disable1 = this.disable2 = this.disable3 = false
break;
case '4':
this.disable = this.disable1 = this.disable2 = this.disable3 = false
break;
}
},
// 发送状态
sendStatus() {
getExam(this.id).then(res => {
this.statu = res.data.status
this.isSearch(this.statu)
this.handleTab(this.statu)
});
// console.log(this.$refs.examInfo, 95);
// this.$refs.scoreManage.getStatus(statu)
},
// 判断状态
isSearch(index) {
switch (index) {
case '0':
this.$refs.examInfo.getStatus(this.statu)
break;
case '1':
this.$refs.InfoReview.getStatus(this.statu)
break;
case '2':
this.$refs.examRoomAllocate.getStatus(this.statu)
break;
case '3':
this.$refs.scoreManage.getStatus(this.statu)
break;
case '4':
this.$refs.scoreManage.getStatus(this.statu)
break;
default: return;
}
},
// 跳转
back(activeName) {
this.isSearch(activeName)
if (activeName == '4') {
// this.$router.go(-1)
this.$store.dispatch("tagsView/delView", this.$route);
this.$router.replace({
path: '/recruitment/examManage', })
}
},
},
}
</script>
<style scoped></style>
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="姓名" prop="studentName">
<el-input v-model="queryParams.studentName" placeholder="请输入姓名" clearable
@keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="身份证号码" label-width="100px" prop="idCard">
<el-input v-model="queryParams.idCard" placeholder="请输入身份证号码" clearable
@keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="测试项目" prop="project">
<el-input v-model="queryParams.project" placeholder="请输入测试项目" clearable
@keyup.enter.native="handleQuery"/>
<!-- <el-select v-model="form.projectIdList" style="width: 100%" placeholder="请选择测试项目">
<el-option v-for="dict in dict.type.professional_category" :key="dict.value" :label="dict.label"
:value="dict.value">
</el-option>
</el-select> -->
</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-button type="primary" plain size="mini" @click="publish" v-hasPermi="['system:exam:add']"
v-if="status == '3'">发布
</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<!-- <el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
v-hasPermi="['system:relation:add']">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate"
v-hasPermi="['system:relation:edit']">修改</el-button>
</el-col> -->
<el-col :span="1.5">
<el-button type="success" plain icon="el-icon-upload" size="mini" @click="handleUpload" v-if="status == '3'"
v-hasPermi="['system:relation: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="['system:relation:export']">导出
</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="relationList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center"/>
<el-table-column type="index" label="序号" width="55" align="center"/>
<el-table-column label="头像" align="center" width="100" prop="photo">
<template slot-scope="scope">
<ListImage :image-url="isEmptyAvatar(scope.row.photo, scope.row.sex)"></ListImage>
</template>
</el-table-column>
<el-table-column label="身份证号码" align="center" prop="idCard" width="165"/>
<el-table-column label="姓名" align="center" prop="studentName" min-width="80" max-width="120"/>
<el-table-column label="学籍号" align="center" prop="studentNumber" width="100"/>
<el-table-column key="juniorSchool" width="130" align="center" prop="schoolName" label="初中学校"/>
<el-table-column label="测试项目" align="type" prop="project" width="80">
<!-- <template slot-scope="scope">
<dict-tag :options="dict.type.professional_category" :value="scope.row.sex" />
</template> -->
</el-table-column>
<el-table-column label="性别" align="center" prop="sex" width="80">
<template slot-scope="scope">
<dict-tag :options="dict.type.sys_user_sex" :value="scope.row.sex"/>
</template>
</el-table-column>
<el-table-column label="准考证号" align="center" prop="examNumber" min-width="100" max-width="120"/>
<el-table-column label="分组" align="center" prop="inGroup" min-width="100" max-width="120"/>
<el-table-column label="考试日期" align="center" prop="examDate" width="120">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.examDate, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="考试时间" align="center" prop="examTime" width="80"/>
<el-table-column label="考试地点" align="center" prop="examAddress"/>
<el-table-column label="成绩" align="center" prop="score"/>
<el-table-column label="结果" align="center" prop="result"/>
<el-table-column label="资格线" align="center" prop="passScore"/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="100">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-if="status == '3'"
v-hasPermi="['system:relation:edit']">修改
</el-button>
<el-button size="mini" type="text" icon="el-icon-view" @click="handleView(scope.row)"
v-hasPermi="['system:relation: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"/>
<el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body>
<el-row :gutter="20">
<el-col :span="9">
<!-- 个人信息 -->
<div style="font-size: 20px; text-align: center"><b>学生报名信息</b></div>
<br/>
<el-form ref="form" :model="form" :rules="rules" label-width="90px">
<el-form-item label="姓名" prop="studentName">
<el-input v-model="form.studentName" placeholder="请输入学生姓名" readOnly/>
</el-form-item>
<el-form-item label="身份证号" prop="idCard">
<el-input v-model="form.idCard" placeholder="请输入身份证号" readOnly/>
</el-form-item>
<el-form-item label="学籍号" prop="studentNumber">
<el-input v-model="form.studentNumber" placeholder="请输入学籍号" readOnly/>
</el-form-item>
<el-form-item label="初中学校" prop="schoolName">
<el-input v-model="form.schoolName" placeholder="请输入初中学校" readOnly/>
</el-form-item>
<el-form-item label="测试项目" prop="project">
<el-input v-model="form.project" placeholder="请选择测试项目" readOnly/>
</el-form-item>
<el-form-item label="性别:">
<el-select v-model="form.sex" style="width: 100%" placeholder="请选择学生性别" disabled>
<el-option v-for="dict in dict.type.sys_user_sex" :key="dict.value" :label="dict.label"
:value="dict.value">
{{ dict.label }}
</el-option>
</el-select>
</el-form-item>
<el-form-item label="身高" prop="height">
<el-input v-model="form.height" placeholder="请输入身高" readOnly>
<template slot="suffix">CM</template>
</el-input>
</el-form-item>
<el-form-item label="体重" prop="weight">
<el-input v-model="form.weight" placeholder="请输入体重" readOnly>
<template slot="suffix">KG</template>
</el-input>
</el-form-item>
<el-form-item label="联系方式1" prop="telephone1">
<el-input v-model="form.telephone1" placeholder="请输入联系方式" readOnly/>
</el-form-item>
<el-form-item label="联系方式2" prop="telephone2">
<el-input v-model="form.telephone2" placeholder="请输入联系方式" readOnly/>
</el-form-item>
</el-form>
</el-col>
<el-col :span="6">
<!-- 照片 -->
<el-form ref="form" :model="form" :rules="rules" label-width="0px">
<el-form-item>
<br/>
<el-image :src="isEmptyAvatar(form.photo, form.sex)"
style="display: block; margin: auto; width: 200px; height: 200px;" alt="照片加载失败"/>
</el-form-item>
</el-form>
</el-col>
<el-col :span="9">
<!-- 分配考场信息 -->
<div style="font-size: 20px; text-align: center"><b>考场信息</b></div>
<br/>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="准考证号" prop="examNumber">
<el-input v-model="form.examNumber" readOnly/>
</el-form-item>
<el-form-item label="分组" prop="inGroup">
<el-input v-model="form.inGroup" readOnly/>
</el-form-item>
<el-form-item label="考试日期" prop="examDate">
<el-date-picker disabled v-model="form.examDate" style="width: 100%" type="date" placeholder="选择日期">
</el-date-picker>
</el-form-item>
<el-form-item label="考试时间" prop="examTime">
<el-time-select disabled v-model="form.examTime" style="width: 100%" :picker-options="{
start: '08:30',
step: '00:15',
end: '18:30'
}" placeholder="选择时间">
</el-time-select>
</el-form-item>
<el-form-item label="考试地点" prop="examAddress">
<el-input v-model="form.examAddress" readOnly/>
</el-form-item>
<br/>
<!-- 成绩信息 -->
<div style="font-size: 20px; text-align: center"><b>成绩信息</b></div>
<br/>
<el-form-item label="成绩" prop="score">
<el-input v-model="form.score" :readOnly="isHandle"/>
</el-form-item>
<el-form-item label="结果" prop="result">
<el-input v-model="form.result" :readOnly="isHandle"/>
</el-form-item>
<el-form-item label="资格线" prop="passScore">
<el-input v-model="form.passScore" :readOnly="isHandle"/>
</el-form-item>
</el-form>
</el-col>
</el-row>
<div slot="footer">
<el-button v-show="!isHandle" type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel">{{ isHandle ? '退 出' : '取 消' }}</el-button>
</div>
</el-dialog>
<!-- 导入 -->
<el-dialog :title="title" :visible.sync="uploadOpen" width="520px" append-to-body inline @close="cancel">
<el-form ref="uploadForm" :model="form" :rules="rules" label-width="70px">
<el-form-item label="文 件:" prop="dataUrl">
<el-upload ref="upload" :limit="1" accept=".xlsx, .xls" :headers="upload.headers"
:action="upload.url + '?updateSupport=' + upload.updateSupport" :disabled="upload.isUploading"
:on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
<div class="el-upload__tip text-center" slot="tip">
<!--<div class="el-upload__tip" slot="tip">-->
<!-- <el-checkbox v-model="upload.updateSupport"/>-->
<!-- 是否更新已经存在的用户数据-->
<!--</div>-->
<span>仅允许导入xlsxlsx格式文件。</span>
<!-- <el-link type="primary" :underline="false" style="font-size: 12px; vertical-align: baseline"
@click="importTemplate">下载模板
</el-link> -->
</div>
</el-upload>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitFileForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
scoreManageList,
delRelation,
addRelation,
handleEdit,
scoreEnd,
getAddressInfo
} from "@/api/smartSchool/openRecruitment";
import {getToken} from "@/utils/auth";
import {Gender, Nations} from "@/enums/common";
export default {
name: "Relation",
dicts: ['professional_category', 'sys_user_sex', 'registration_status'],
props: ['examId'],
data() {
return {
baseUrl: [process.env.VUE_APP_BASE_API],
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
//考试状态
status: null,
// 【请填写功能名称】表格数据
relationList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 导入对话框
uploadOpen: false,
// 是否修改
isHandle: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
examId: null,
studentId: null,
auditStatus: null,
matchStatus: null,
infoIdCard: null,
submit: null,
examNumber: null,
group: null,
examDate: null,
examTime: null,
examAddress: null,
score: null,
result: null,
passScore: null,
step: null
},
// 用户导入参数
upload: {
// 是否显示弹出层(学生导入)
open: false,
// 是否禁用上传
isUploading: false,
// 是否更新已经存在的用户数据
updateSupport: 0,
// 设置上传的请求头部
headers: {Authorization: "Bearer " + getToken()},
// 上传的地址
url: process.env.VUE_APP_BASE_API + `/artExam/importScoreData/${this.examId}`,
},
// 表单参数
form: {},
// 表单校验
rules: {
passScore: [
{required: true, message: "资格线不能为空", trigger: "blur"}
],
result: [
{required: true, message: "结果不能为空", trigger: "blur"}
],
score: [
{required: true, message: "成绩不能为空", trigger: "blur"}
],
}
};
},
created() {
// this.getList();
},
methods: {
/** 查询【请填写功能名称】列表 */
getList() {
this.loading = true;
scoreManageList(this.examId, this.queryParams).then(response => {
this.relationList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 获取状态
getStatus(statu) {
this.getList();
this.status = statu
},
// 取消按钮
cancel() {
this.open = false;
this.uploadOpen = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
id: null,
examId: null,
studentId: null,
auditStatus: "0",
matchStatus: "0",
infoIdCard: null,
submit: null,
examNumber: null,
group: null,
examDate: null,
examTime: null,
examAddress: null,
score: null,
result: null,
passScore: null,
createTime: null,
createBy: null,
updateTime: null,
updateBy: null,
delFlag: null,
step: 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.open = true;
this.title = "添加";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.isHandle = false
this.reset();
const id = row.id || this.ids
// const id = 1
getAddressInfo(id).then(response => {
this.form = response.data;
this.imageUrl = this.isEmptyAvatar(this.form.photo, this.form.sex);
this.open = true;
this.title = "修改";
});
},
/** 查看按钮操作 */
handleView(row) {
this.reset();
this.isHandle = true
const id = row.id || this.ids
getAddressInfo(id).then(response => {
this.form = response.data;
console.log(this.form, 414);
this.imageUrl = this.isEmptyAvatar(this.form.photo, this.form.sex);
this.open = true;
this.title = "查看";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
handleEdit(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addRelation(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 delRelation(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {
});
},
/** 导入按钮操作 */
handleUpload(row) {
this.reset();
this.title = "导入"
this.uploadOpen = true
},
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true;
// console.log(event, file, fileList);
},
// 文件上传成功处理
handleFileSuccess(response, file, fileList) {
this.uploadOpen = false
this.upload.isUploading = false
this.$refs.upload.clearFiles()
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + '</div>', '导入结果', {dangerouslyUseHTMLString: true})
this.getList()
},
// 提交上传文件
submitFileForm() {
this.$refs.upload.submit();
},
// 下载模板
// importTemplate() {
// this.download(
// "/eduArtStudent/importTemplate",
// {},
// `导入教育局信息内模板_${new Date().getTime()}.xlsx`
// );
// },
/** 导出按钮操作 */
handleExport() {
this.download(`/artExam/exportScore/${this.examId}`, {
...this.queryParams
}, `成绩管理${Date.now()}.xlsx`)
},
publish() {
const examId = this.examId
this.$confirm('是否确认发布?').then(function () {
return scoreEnd(examId)
}).then(() => {
this.getList();
this.$modal.msgSuccess("发布成功");
this.$emit("sendStatus")
this.$router.go(-1)
}).catch(() => {
});
},
/** 判断学生头像是否为空 */
isEmptyAvatar(imageUrl, sex) {
if (!imageUrl) {
let url = null;
if (Gender.MALE === sex) {
url = require('@/assets/images/boy.png');
} else {
url = require('@/assets/images/girl.png');
}
return url
} else
return this.baseUrl + imageUrl;
},
}
};
</script>
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="考试名称" prop="examName">
<el-input v-model="queryParams.examName" placeholder="请输入考试名称" clearable
@keyup.enter.native="handleQuery"/>
</el-form-item>
<!-- <el-form-item label="年度" prop="examYear">
<el-input
v-model="queryParams.examYear"
placeholder="请输入年度"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="报名截止时间" prop="deadline">
<el-date-picker clearable
v-model="queryParams.deadline"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择报名截止时间">
</el-date-picker>
</el-form-item>
<el-form-item label="考试开始时间" prop="startTime">
<el-date-picker clearable
v-model="queryParams.startTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择考试开始时间">
</el-date-picker>
</el-form-item>
<el-form-item label="考试结束时间" prop="endTime">
<el-date-picker clearable
v-model="queryParams.endTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择考试结束时间">
</el-date-picker>
</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="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">新增
</el-button>
</el-col>
<!-- <el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:exam:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:exam: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="['system:exam:export']"
>导出</el-button>
</el-col> -->
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="examList" @selection-change="handleSelectionChange">
<el-table-column label="序号" type="index" width="55" align="center"/>
<el-table-column label="考试名称" align="center" show-overflow-tooltip prop="examName" min-width="150"/>
<el-table-column label="年度" align="center" prop="examYear" min-width="80"/>
<el-table-column label="报名截止时间" align="center" prop="deadline" min-width="120">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.deadline, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="考试开始时间" align="center" prop="startTime" min-width="100">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.startTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="考试结束时间" align="center" prop="endTime" min-width="100">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.endTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="status" min-width="100">
<template slot-scope="scope">
<el-link type="primary" :underline="false" @click="registration(scope.row)">
<dict-tag :options="dict.type.registration_status" :value="scope.row.status"></dict-tag>
</el-link>
</template>
</el-table-column>
<el-table-column label="操作" align="center" min-width="120" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button size="mini" type="text" v-show="scope.row.status == '0'" icon="el-icon-edit"
@click="handleUpdate(scope.row)">修改
</el-button>
<el-button size="mini" type="text" v-show="scope.row.status == '0'" icon="el-icon-delete"
@click="handleDelete(scope.row)">删除
</el-button>
<el-button size="mini" type="text" icon="el-icon-view" v-show="scope.row.status != '0'"
@click="handleView(scope.row)">查看
</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"/>
<el-dialog :title="title" :visible.sync="open" width="850px" append-to-body @close="bigDialogClose">
<el-form ref="form" :model="form" :rules="rules" label-width="110px" class="mr10">
<el-form-item label="考试名称" prop="examName">
<el-input v-model="form.examName" placeholder="请输入考试名称" :readOnly="isHandle"/>
</el-form-item>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="年度" prop="examYear">
<el-date-picker style="width:100%;" :readonly="isHandle" v-model="form.examYear" type="year"
value-format="yyyy" placeholder="选择年度">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="报名截止时间" prop="deadline">
<el-date-picker style="width:100%;" clearable v-model="form.deadline" type="datetime"
value-format="yyyy-MM-dd HH:mm"
format="yyyy-MM-dd HH:mm" placeholder="请选择报名截止时间" :readonly="isHandle">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="考试开始时间" prop="startTime">
<el-date-picker
v-model="form.startTime"
:readonly="isHandle"
type="date"
style="width: 100%"
placeholder="选择日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="考试结束时间" prop="endTime">
<el-date-picker
v-model="form.endTime"
type="date"
:readonly="isHandle"
:picker-options="pickerOptionsEnd"
style="width: 100%"
placeholder="选择日期">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<!-- <el-form-item label="测试项目" prop="projectName" v-if="!isHandle">-->
<!-- <el-input v-model="form.projectName" placeholder="请选择测试项目" @click.native="selectProjectList"/>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="测试项目" prop="projectName" v-if="isHandle">-->
<!-- <el-input v-model="form.projectName" placeholder="请选择测试项目" readOnly/>-->
<!-- </el-form-item>-->
<el-form-item label="测试项目" prop="projectName">
<el-input v-model="form.projectName" :readonly="isHandle" @click.native="selectProjectList"
placeholder="请选择测试项目"/>
</el-form-item>
<div v-if="!isHandle">
<el-form-item label="考试安排" prop="examArrange">
<Editor v-model="form.examArrange" :min-height="150"></Editor>
</el-form-item>
<el-form-item label="注意事项" prop="notice">
<Editor v-model="form.notice" :min-height="150"></Editor>
</el-form-item>
</div>
</el-form>
<div v-if="isHandle">
<el-form :model="form" :rules="rules" label-width="110px">
<el-form-item label="考试安排">
<Editor v-model="form.examArrange" :min-height="150" readOnly></Editor>
</el-form-item>
<el-form-item label="考试注意事项">
<Editor v-model="form.notice" :min-height="150" readOnly></Editor>
</el-form-item>
</el-form>
</div>
<div slot="footer" class="dialog-footer" style="text-align:center ;">
<el-button type="primary" @click="submitForm" v-if="!isHandle"> </el-button>
<el-button @click="publish" type="success" style="margin-left:26px ;" v-if="!isHandle"> </el-button>
<el-button @click="cancel" style="margin-left:26px ;"> </el-button>
</div>
</el-dialog>
<el-dialog title="测试项目" :visible.sync="openSelect" width="800px" append-to-body>
<el-table ref="table-project" @row-click="rowClick" size="small" height="400px" :data="projectList"
@selection-change="handleSelectionChange" :row-key="getRowId">
<el-table-column type="selection" width="55" reserve-selection align="center"/>
<el-table-column label="序号" min-width="100" type="index" align="center"/>
<el-table-column label="项目名称" min-width="100" align="center" prop="project"/>
<el-table-column label="项目类型" min-width="100" align="center" prop="type">
<template slot-scope="scope">
<dict-tag :options="dict.type.professional_category" :value="scope.row.type"></dict-tag>
</template>
</el-table-column>
<el-table-column label="项目创建时间" min-width="100" align="center" prop="createTime"/>
</el-table>
<div slot="footer">
<el-button type="primary" @click="selectConfirm"> </el-button>
<el-button @click="selectClose"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
listExam,
getExam,
delExam,
addExam,
updateExam,
addPub,
listProject,
edit
} from "@/api/smartSchool/openRecruitment";
export default {
name: "Exam",
dicts: ['professional_category', 'registration_status'],
data() {
return {
isFirst: true,
handle: undefined,
tableSelection: [],
openSelect: false,
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 【请填写功能名称】表格数据
examList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 是否修改
isHandle: false,
// 测试项目
projectList: [],
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
examName: null,
// examYear: null,
// deadline: null,
// startTime: null,
// endTime: null,
// examArrange: null,
// notice: null,
// status: null,
},
pickerOptionsEnd: {
disabledDate: (time) => {
return new Date(time) < new Date(this.form.startTime)
},
},
// 表单参数
form: {},
// 表单校验
rules: {
examName: [
{required: true, message: "考试名称不能为空", trigger: "blur"}
],
examYear: [
{required: true, message: "考试年度不能为空", trigger: "blur"}
],
deadline: [
{required: true, message: "报名截止时间不能为空", trigger: "blur"}
],
// time: [
// {required: true, message: "考试时间不能为空", trigger: "change"}
// ],
type: [
{required: true, message: "测试项目不能为空", trigger: "blur"}
],
projectName: [
{required: true, message: "测试项目不能为空", trigger: "blur"}
],
startTime: [
{required: true, message: "开始时间不能为空", trigger: "blur"}
],
endTime: [
{required: true, message: "结束时间不能为空", trigger: "blur"}
],
examArrange: [
{required: true, message: "考试安排不能为空", trigger: "blur"}
],
notice: [
{required: true, message: "考试注意事项不能为空", trigger: "blur"}
],
}
};
},
created() {
this.getList();
this.getTestList()
},
methods: {
/** 查询【请填写功能名称】列表 */
getList() {
// this.loading = false;
this.loading = true;
listExam(this.queryParams).then(response => {
this.examList = response.rows;
this.total = response.total;
this.loading = false;
});
},
getRowId(row) {
return row.id; // row-key绑定的必须为唯一值
},
selectClose() {
this.openSelect = false
},
rowClick(row) {
this.$refs["table-project"].toggleRowSelection(row)
},
/**测试项目列表弹框--确定按钮*/
selectConfirm() {
this.form.projectIdList = this.tableSelection.map(item => item.id);
let projectName = this.tableSelection.map(item => item.project);
this.$set(this.form, 'projectName', projectName.join(','))
this.$nextTick(() => {
this.$refs["form"].validateField('projectName');
})
this.openSelect = false;
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
id: null,
examName: null,
examYear: null,
deadline: null,
time: null,
startTime: null,
endTime: null,
examArrange: null,
notice: null,
status: "0",
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.tableSelection = selection
this.ids = selection.map(item => item.id)
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.isHandle = false
this.handle = "add"
this.title = "考试新增";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.handle = "edit"
this.isHandle = false
this.reset();
const id = row.id || this.ids
getExam(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "考试编辑";
this.form.examYear = this.form.examYear + ''
});
},
/** 查看按钮操作 */
handleView(row) {
this.isHandle = true
this.reset();
const id = row.id || this.ids
getExam(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "查看";
this.form.examYear = this.form.examYear.toString()
});
},
/** 查询所有的测试项目列表 */
getTestList() {
this.loading = true;
listProject().then(response => {
this.projectList = response.rows;
this.loading = false;
});
},
bigDialogClose() {
this.isFirst = true
console.log(this.isFirst, 'isFirst')
},
/** 点击测试项目触发*/
selectProjectList() {
if (this.isHandle) return
this.openSelect = true
this.getTestList() //获取所有项目列表
if (this.handle == 'add' && this.isFirst) {
this.isFirst = false
this.$nextTick(() => {
this.$refs["table-project"].clearSelection()
})
}
if (this.handle == 'edit') {
this.form.projectIdList.map(item => {
this.projectList.map(itemData => {
if (itemData.id == item) {
this.$nextTick(() => {
this.$refs["table-project"].toggleRowSelection(itemData, true)
})
}
});
});
}
},
/** 保存按钮 */
submitForm() {
this.$refs['form'].validate(valid => {
if (valid) {
if (this.form.id != null) {
edit(this.form).then(response => {
this.$modal.msgSuccess("保存修改成功");
this.open = false;
this.getList();
});
} else {
addExam(this.form).then(response => {
this.$modal.msgSuccess("保存新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 发布按钮 */
publish() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateExam(this.form).then(response => {
this.$modal.msgSuccess("发布修改成功");
this.open = false;
this.getList();
this.$emit("sendStatus")
});
} else {
addPub(this.form).then(response => {
this.$modal.msgSuccess("发布新增成功");
this.open = false;
this.getList();
this.$emit("sendStatus")
});
}
}
});
},
/** 报名流程按钮 */
registration(row) {
this.$router.push({
path: '/recruitment/examManage/registeProcess',
query: {
id: row.id,
index: row.status
}
})
}
,
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除编号为"' + ids + '"的数据项?').then(function () {
return delExam(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {
});
}
,
/** 导出按钮操作 */
handleExport() {
this.download('system/exam/export', {
...this.queryParams
}, `考试管理${Date.now()}.xlsx`)
}
}
};
</script>
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<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="schoolCode">
<el-input
v-model="queryParams.schoolCode"
placeholder="请输入学校代码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="排序" prop="order">
<el-input
v-model="queryParams.order"
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="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['system:school:add']"
>新增</el-button>
</el-col>
<!-- <el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:school:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:school: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="['system:school:export']"
>导出</el-button>
</el-col> -->
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="schoolList" @selection-change="handleSelectionChange">
<el-table-column type="index" width="55" align="center" />
<!-- <el-table-column label="${comment}" align="center" prop="id" /> -->
<el-table-column label="学校名称" align="center" prop="schoolName" />
<el-table-column label="学校代码" align="center" prop="schoolCode" />
<!-- <el-table-column label="排序" align="center" prop="order" /> -->
<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-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:school:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:school: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"
/> -->
<!-- 添加或修改初中学校对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="学校名称" prop="schoolName">
<el-input v-model="form.schoolName" placeholder="请输入学校名称" />
</el-form-item>
<el-form-item label="学校代码" prop="schoolCode">
<el-input v-model="form.schoolCode" placeholder="请输入学校代码" />
</el-form-item>
<el-form-item label="排序" prop="schoolOrder">
<!-- <el-input-number v-model="form.schoolOrder" label="排序"></el-input-number> -->
<el-input-number v-model="form.schoolOrder" :min="1" :max="999" label="排序"></el-input-number>
</el-form-item>
<!-- <el-form-item label="排序" prop="schoolOrder">
<el-input v-model="form.schoolOrder" placeholder="请输入排序" />
</el-form-item> -->
<!-- <el-form-item label="${comment}" prop="delFlag">
<el-input v-model="form.delFlag" placeholder="请输入${comment}" />
</el-form-item> -->
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listSchool, getSchool, delSchool, addSchool, updateSchool } from "@/api/smartSchool/examinationManage";
export default {
name: "School",
data() {
return {
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 初中学校表格数据
schoolList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
schoolName: null,
schoolCode: null,
order: null,
},
// 表单参数
form: {},
// 表单校验
rules: {
schoolName: [
{ required: true, message: "学校名称不能为空", trigger: "blur" }
],
schoolCode: [
{ required: true, message: "学校代码不能为空", trigger: "blur" }
],
schoolOrder: [
{ required: true, message: "排序不能为空", trigger: "blur" }
]
}
};
},
created() {
this.getList();
},
methods: {
/** 查询初中学校列表 */
getList() {
// this.loading = false;
this.loading = true;
listSchool(this.queryParams).then(response => {
this.schoolList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
id: null,
schoolName: null,
schoolCode: null,
order: null,
createTime: null,
createBy: null,
updateTime: null,
updateBy: null,
delFlag: null,
schoolOrder: 1,
};
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
getSchool(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) {
updateSchool(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addSchool(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 delSchool(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('system/school/export', {
...this.queryParams
}, `school_${new Date().getTime()}.xlsx`)
}
}
};
</script>
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<!-- <el-form-item label="测试项目" prop="project">
<el-input
v-model="queryParams.project"
placeholder="请输入测试项目"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item> -->
<el-form-item label="测试项目" prop="project">
<el-input v-model="queryParams.project" 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="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
v-hasPermi="['system:project:add']">新增</el-button>
</el-col>
<!-- <el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:project:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:project: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="['system:project:export']"
>导出</el-button>
</el-col> -->
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="projectList" @selection-change="handleSelectionChange">
<el-table-column type="index" width="55" align="center" />
<!-- <el-table-column label="${comment}" align="center" prop="id" /> -->
<el-table-column label="类别" align="center" prop="type">
<template slot-scope="scope">
<dict-tag :options="dict.type.zp_category" :value="scope.row.type" />
</template>
</el-table-column>
<el-table-column label="考试项目" align="center" prop="project" />
<!-- <el-table-column label="排序" align="center" prop="order" /> -->
<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-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['system:project:edit']">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['system:project: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" /> -->
<!-- 添加或修改examination对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="类别" prop="type">
<el-select v-model="form.type" style="width: 100%" placeholder="请选择类别">
<el-option v-for="dict in dict.type.zp_category" :key="dict.value" :label="dict.label"
:value="dict.value">
</el-option>
</el-select>
<!-- <el-input v-model="form.delFlag" placeholder="请选择类别" /> -->
</el-form-item>
<el-form-item label="考试项目" prop="project">
<el-input v-model="form.project" placeholder="请输入考试项目" />
</el-form-item>
<el-form-item label="排序" prop="schoolOrder">
<el-input-number v-model="form.schoolOrder" :min="1" :max="999" label="排序"></el-input-number>
</el-form-item>
<!-- <el-form-item label="排序" prop="schoolOrder">
<el-input v-model="form.schoolOrder" placeholder="请输入排序" />
</el-form-item> -->
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listProject, getProject, delProject, addProject, updateProject } from "@/api/smartSchool/openRecruitment";
export default {
dicts: ['zp_category'],
name: "Project",
data() {
return {
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// examination表格数据
projectList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
type: null,
project: null,
order: null,
},
// 表单参数
form: {
},
// 表单校验
rules: {
type: [
{ required: true, message: "类别不能为空", trigger: "blur" }
],
project: [
{ required: true, message: "考试项目不能为空", trigger: "blur" }
],
schoolOrder: [
{ required: true, message: "排序不能为空", trigger: "blur" }
]
}
};
},
created() {
this.getList();
},
methods: {
/** 查询examination列表 */
getList() {
// this.loading = false;
this.loading = true;
listProject(this.queryParams).then(response => {
this.projectList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
id: null,
type: null,
project: null,
order: null,
createTime: null,
createBy: null,
updateTime: null,
updateBy: null,
delFlag: null,
schoolOrder: 1,
};
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 = "添加";
// this.form.schoolOrder = 1
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getProject(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) {
updateProject(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addProject(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 delProject(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => { });
},
/** 导出按钮操作 */
handleExport() {
this.download('system/project/export', {
...this.queryParams
}, `project_${Date.now()}.xlsx`)
}
}
};
</script>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment