From 05150461ca543e3eff7f869a24f4813e47bd4d8c Mon Sep 17 00:00:00 2001
From: liuyg <376836862@qq.com>
Date: Tue, 03 Aug 2021 14:59:50 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.105:10010/r/zhba_enterprises
---
src/api/exam/answer.js | 167 ++--
src/views/exam/examination.vue | 20
src/views/applyexam/index.vue | 118 +++
src/api/examapi/applyexam.js | 66 +
src/router/views/index.js | 142 ++-
src/views/exam/startexam.vue | 166 ++++-
src/views/securityGuard/securityGuard.vue | 18
public/papers.html | 11
src/views/trainApply/index.vue | 584 +++++++++++++++++
src/styles/element-ui.scss | 7
src/views/applydetailed/index.vue | 652 +++++++++++++++++++
11 files changed, 1,711 insertions(+), 240 deletions(-)
diff --git a/public/papers.html b/public/papers.html
index 09d177a..93b2421 100644
--- a/public/papers.html
+++ b/public/papers.html
@@ -38,6 +38,11 @@
width: 140px;
height: 190px;
}
+
+ .my-picture {
+ width: 150px;
+ /* height: 200px; */
+ }
</style>
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
@@ -113,8 +118,10 @@
return null;
};
var id = JSON.parse(getData("data")).id;
+ var examType = JSON.parse(getData("data")).examType;
+ // console.log(JSON.parse(getData("data")), 111);
- axios.get('http://192.168.0.114:81/apply/getApplyInfo?id=' + id).then(function(res) {
+ axios.get('http://192.168.0.114:81/apply/getApplyInfo?id=' + id + "&applyExamType=" + examType).then(function(res) {
var data = res.data.data;
var str = `<span class="title">${data.examName}</span>
<span class="title">准考证信息</span>
@@ -125,7 +132,7 @@
<td width="150px">身份证号</td>
<td width="150px">${data.idCardNo}</td>
<td rowspan="4" align="center" width="150px"">
- 照片
+ <img class="my-picture" src="${data.myPicture}" />
</td>
</tr>
diff --git a/src/api/exam/answer.js b/src/api/exam/answer.js
index 42de680..3a33bb7 100644
--- a/src/api/exam/answer.js
+++ b/src/api/exam/answer.js
@@ -3,122 +3,123 @@
const baseAnswerUrl = '/api/exam/v1/answer/'
export function fetchAnswerList(query) {
- return request({
- url: baseAnswerUrl + 'answerList',
- method: 'get',
- params: query
- })
+ return request({
+ url: baseAnswerUrl + 'answerList',
+ method: 'get',
+ params: query
+ })
}
export function getAnswer(id) {
- return request({
- url: baseAnswerUrl + id,
- method: 'get'
- })
+ return request({
+ url: baseAnswerUrl + id,
+ method: 'get'
+ })
}
export function getAnswerInfo(id, query) {
- return request({
- url: baseAnswerUrl + id + '/info',
- method: 'get',
- params: query
- })
+ return request({
+ url: baseAnswerUrl + id + '/info',
+ method: 'get',
+ params: query
+ })
}
export function getAnswerListInfo(id, query) {
- return request({
- url: baseAnswerUrl + 'record/' + id + '/answerListInfo',
- method: 'get',
- params: query
- })
+ return request({
+ url: baseAnswerUrl + 'record/' + id + '/answerListInfo',
+ method: 'get',
+ params: query
+ })
}
export function addAnswer(obj) {
- return request({
- url: baseAnswerUrl,
- method: 'post',
- data: obj
- })
+ return request({
+ url: baseAnswerUrl,
+ method: 'post',
+ data: obj
+ })
}
export function putAnswer(obj) {
- return request({
- url: baseAnswerUrl,
- method: 'put',
- data: obj
- })
+ return request({
+ url: baseAnswerUrl,
+ method: 'put',
+ data: obj
+ })
}
export function delAnswer(id) {
- return request({
- url: baseAnswerUrl + id,
- method: 'delete'
- })
+ return request({
+ url: baseAnswerUrl + id,
+ method: 'delete'
+ })
}
export function save(obj) {
- return request({
- url: baseAnswerUrl + 'save',
- method: 'post',
- data: obj
- })
+ return request({
+ url: baseAnswerUrl + 'save',
+ method: 'post',
+ data: obj
+ })
}
export const saveAndNext = (params) => {
- return request({
- url: '/api/examScore/saveExamScore',
- method: 'post',
- data: {
- // "allGrade": 0,
- "allScore": 200,
- "candidateNo": params.securityId + ' ',
- "company": params.company,
- "examName": params.examName,
- "examResultVOS": params.examResultVOS,
- "examTime": params.examTime,
- "examType": Number(params.examType),
- "learnGrade": 0,
- "papersId": Number(params.papersId),
- "securityName": params.securityName
- }
- })
+ return request({
+ url: '/api/examScore/saveExamScore',
+ method: 'post',
+ data: {
+ // "allGrade": 0,
+ // "allScore": 200,
+ "userId": params.userId,
+ "candidateNo": params.securityId + ' ',
+ "company": params.company,
+ "examName": params.examName,
+ "examResultVOS": params.examResultVOS,
+ "examTime": params.examTime,
+ "examType": Number(params.examType),
+ "learnGrade": 0,
+ "papersId": Number(params.papersId),
+ "securityName": params.securityName
+ }
+ })
}
export function anonymousUserSaveAndNext(obj, nextType, nextSubjectId, nextSubjectType) {
- let url = baseAnswerUrl + 'anonymousUser/saveAndNext?nextType=' + nextType
- if (nextSubjectId !== undefined) {
- url += '&nextSubjectId=' + nextSubjectId
- }
- if (nextSubjectType !== undefined) {
- url += '&nextSubjectType=' + nextSubjectType
- }
- return request({
- url: url,
- method: 'post',
- data: obj
- })
+ let url = baseAnswerUrl + 'anonymousUser/saveAndNext?nextType=' + nextType
+ if (nextSubjectId !== undefined) {
+ url += '&nextSubjectId=' + nextSubjectId
+ }
+ if (nextSubjectType !== undefined) {
+ url += '&nextSubjectType=' + nextSubjectType
+ }
+ return request({
+ url: url,
+ method: 'post',
+ data: obj
+ })
}
export function submit(obj) {
- return request({
- url: baseAnswerUrl + 'submit',
- method: 'post',
- data: obj
- })
+ return request({
+ url: baseAnswerUrl + 'submit',
+ method: 'post',
+ data: obj
+ })
}
export function anonymousUserSubmit(obj) {
- return request({
- url: baseAnswerUrl + 'anonymousUser/submit',
- method: 'post',
- data: obj
- })
+ return request({
+ url: baseAnswerUrl + 'anonymousUser/submit',
+ method: 'post',
+ data: obj
+ })
}
export function anonymousUserSubmitAll(obj, examinationId, identifier) {
- return request({
- url: baseAnswerUrl + 'anonymousUser/submitAll/' + examinationId + '?identifier=' + identifier,
- method: 'post',
- data: obj
- })
-}
+ return request({
+ url: baseAnswerUrl + 'anonymousUser/submitAll/' + examinationId + '?identifier=' + identifier,
+ method: 'post',
+ data: obj
+ })
+}
\ No newline at end of file
diff --git a/src/api/examapi/applyexam.js b/src/api/examapi/applyexam.js
index 08c81f2..c2f48aa 100644
--- a/src/api/examapi/applyexam.js
+++ b/src/api/examapi/applyexam.js
@@ -2,46 +2,54 @@
export const getApplyList = (current, size, params) => {
- return request({
- url: '/api/apply/page',
- method: 'get',
- params: {
- ...params,
- current,
- size
- }
- })
+ return request({
+ url: '/api/apply/page',
+ method: 'get',
+ params: {
+ ...params,
+ current,
+ size
+ }
+ })
}
export const addApply = (row) => {
- return request({
- url: '/api/apply/submit',
- method: 'post',
- data: row
- })
+ return request({
+ url: '/api/apply/submit',
+ method: 'post',
+ data: row
+ })
+}
+
+export const updateApply = (row) => {
+ return request({
+ url: '/api/apply/submit',
+ method: 'post',
+ data: row
+ })
}
export const remove = (ids) => {
- return request({
- url: '/api/apply/remove',
- method: 'post',
- params: {
- ids,
- }
- })
+ return request({
+ url: '/api/apply/remove',
+ method: 'post',
+ params: {
+ ids,
+ }
+ })
}
export const getMenu = (id) => {
- return request({
- url: '/api/apply/detail',
- method: 'get',
- params: {
- id,
- }
- })
-}
+ return request({
+ url: '/api/apply/detail',
+ method: 'get',
+ params: {
+ id,
+ }
+ })
+}
\ No newline at end of file
diff --git a/src/router/views/index.js b/src/router/views/index.js
index b031e53..390b2eb 100644
--- a/src/router/views/index.js
+++ b/src/router/views/index.js
@@ -661,59 +661,89 @@
import ( /* webpackChunkName: "views" */ '@/views/trainExam/index')
}]
},
- {
- path: '/applyexam',
- redirect: '/applyexam/index',
- component: Layout,
- children: [{
- path: 'index',
- name: '报名考试',
- meta: {
- i18n: 'index',
- },
- component: () =>
- import( /* webpackChunkName: "views" */ '@/views/applyexam/index')
- }]
- },
- {
- path: '/startexam',
- redirect: '/startexam/index',
- component: Layout,
- children: [{
- path: 'index',
- name: '开始考试',
- meta: {
- i18n: 'index',
- },
- component: () =>
- import( /* webpackChunkName: "views" */ '@/views/startexam/index')
- }]
- },
- {
- path: '/titleDetails',
- component: () =>
- import( /* webpackChunkName: "views" */ '@/views/exam/topicDetails')
- },
- {
- path: '',
- component: Layout,
- children: [{
- path: '/exam/subjects/:id',
- component: () => import('@/views/exam/examSubjects'),
- name: '题目管理',
- title: '题目管理',
- noCache: true
- }]
- },
- {
- path: '',
- component: Layout,
- children: [{
- path: '/startexam/:id',
- component: () => import('@/views/startexam/index'),
- name: '开始考试',
- title: '开始考试',
- noCache: true
- }]
- },
-]
+ {
+ path: '/applyexam',
+ redirect: '/applyexam/index',
+ component: Layout,
+ children: [{
+ path: 'index',
+ name: '报名考试',
+ meta: {
+ i18n: 'index',
+ },
+ component: () =>
+ import ( /* webpackChunkName: "views" */ '@/views/applyexam/index')
+ }]
+ },
+ {
+ path: '/applydetailed',
+ redirect: '/applydetailed/index',
+ component: Layout,
+ children: [{
+ path: 'index',
+ name: '报名清册',
+ meta: {
+ i18n: 'index',
+ },
+ component: () =>
+ import ( /* webpackChunkName: "views" */ '@/views/applydetailed/index')
+ }]
+ },
+ {
+ path: '/trainApply',
+ redirect: '/trainApply/index',
+ component: Layout,
+ children: [{
+ path: 'index',
+ name: '报名清册',
+ meta: {
+ i18n: 'index',
+ },
+ component: () =>
+ import ( /* webpackChunkName: "views" */ '@/views/trainApply/index')
+ }]
+ },
+ {
+ path: '/startexam',
+ redirect: '/startexam/index',
+ component: Layout,
+ children: [{
+ path: 'index',
+ name: '开始考试',
+ meta: {
+ i18n: 'index',
+ },
+ component: () =>
+ import ( /* webpackChunkName: "views" */ '@/views/startexam/index')
+ }]
+ },
+ {
+ path: '/titleDetails',
+ component: () =>
+ import ( /* webpackChunkName: "views" */ '@/views/exam/topicDetails')
+ },
+ {
+ path: '',
+ component: Layout,
+ children: [{
+ path: '/exam/subjects/:id',
+ component: () =>
+ import ('@/views/exam/examSubjects'),
+ name: '题目管理',
+ title: '题目管理',
+ noCache: true
+ }]
+ },
+ {
+ path: '',
+ component: Layout,
+ children: [{
+ path: '/startexam/:id',
+ component: () =>
+ import ('@/views/startexam/index'),
+ name: '开始考试',
+ title: '开始考试',
+ noCache: true
+ }]
+ },
+]
\ No newline at end of file
diff --git a/src/styles/element-ui.scss b/src/styles/element-ui.scss
index 0283869..f29c9bb 100644
--- a/src/styles/element-ui.scss
+++ b/src/styles/element-ui.scss
@@ -181,7 +181,12 @@
.morpheus-box-apply-exam .el-card.is-never-shadow.avue-crud__search {
width: calc(100% - 390px) !important;
- left: 300px !important;
+ left: 120px !important;
+}
+
+.morpheus-box-apply-exam-1 .el-card.is-never-shadow.avue-crud__search {
+ width: calc(100% - 390px) !important;
+ left: 220px !important;
}
.avue-form {
diff --git a/src/views/applydetailed/index.vue b/src/views/applydetailed/index.vue
new file mode 100644
index 0000000..82ec0d1
--- /dev/null
+++ b/src/views/applydetailed/index.vue
@@ -0,0 +1,652 @@
+/*
+ * @Author: Morpheus
+ * @Date: 2021-07-05 16:31:54
+ * @Last Modified by: Morpheus
+ * @Last Modified time: 2021-07-19 19:39:45
+ * menu-name 报名考试
+ */
+<template>
+ <el-row class="morpheus-box-apply-exam-1">
+ <el-col :span="24" class="hasButOne">
+ <el-card>
+ <div class="exam-card-body">
+
+ <avue-crud v-model="obj"
+ class="company-box"
+ :option="questionBankOption"
+ :search.sync="questionBankSearch"
+ :table-loading="questionBankLoading"
+ :data="questionBankData"
+ ref="questionBankCrud"
+ :page.sync="questionBankPage"
+ @on-load="questionBankOnLoad"
+ @selection-change="questionBankSelectionChange"
+ @search-change="questionBankSearchChange"
+ @search-reset="questionBankSearchReset"
+ @current-change="questionBankCurrentChange"
+ @size-change="questionBankSizeChange"
+ @row-save="questionBankRowSave"
+ @row-del="questionBankRowDel">
+
+ <!-- 自定义按钮 -->
+ <template slot="menuLeft">
+ <el-button
+ type="warning"
+ size="small"
+ plain
+ icon="el-icon-download"
+ @click="handleExport"
+ >导出
+ </el-button>
+ <el-button
+ type="success"
+ size="small"
+ plain
+ icon="el-icon-upload2"
+ @click="handleImport"
+ >导入
+ </el-button>
+ </template>
+
+ <template slot-scope="{ type,row }" slot="menu">
+ <el-button
+ :type="type"
+ size="small"
+ icon="el-icon-receiving"
+ :disabled="row.applyStatus==4"
+ @click="handlePrint(row)"
+ >准考证打印
+ </el-button>
+ </template>
+
+ </avue-crud>
+
+ <el-dialog
+ title="清册数据导入"
+ append-to-body
+ :visible.sync="excelBox"
+ width="555px"
+ >
+ <avue-form
+ :option="excelOption"
+ v-model="excelForm"
+ :upload-after="uploadAfter"
+ >
+ <template slot="excelTemplate">
+ <el-button type="primary" @click="handleTemplate">
+ 点击下载<i class="el-icon-download el-icon--right"></i>
+ </el-button>
+ </template>
+ </avue-form>
+ </el-dialog>
+
+ </div>
+
+ </el-card>
+ </el-col>
+ </el-row>
+</template>
+
+<script>
+
+import {
+ getApplyList,
+ addApply,
+ remove
+} from "@/api/examapi/applyexam";
+import { mapState } from 'vuex'
+
+
+var DIC = {
+ applyStatus: [{
+ label: '已报名',
+ value: 2
+ }, {
+ label: '已取消',
+ value: 4
+ }]
+}
+
+export default {
+ data () {
+
+ return {
+ obj: {
+ name: '张三',
+ },
+ excelBox: false,
+ questionBankOption: {
+ // 操作栏多余按钮去除
+ delBtn: false,
+ editBtn: false,
+ addBtn: false,
+ selection: true,
+ menu: true,
+ // 导出按钮
+ // excelBtn: true,
+ viewBtn: false,
+
+ // title: '题库',
+
+ align: 'center',
+ height: 'auto',
+ calcHeight: 80,
+ tip: false,
+ searchShow: true,
+ searchMenuSpan: 4,
+ index: true,
+ indexLabel: '序号',
+ //dialogType: 'drawer',
+ dialogClickModal: false,
+ // 操作栏宽度
+ menuWidth: 200,
+
+ column: [
+ {
+ label: "保安姓名",
+ prop: "userId",
+ type: 'tree',
+ dicUrl: '',
+ search: true,
+ hide:true,
+ slot: true,
+ // 表单新增时是否禁止
+ addDisabled: false,
+ // 表单新增时是否可见
+ addDisplay: true,
+ // 表单新增时是否为查看模式
+ addDetail: false,
+ // 表单编辑时是否禁止
+ editDisabled: true,
+ // 表单编辑时是否可见
+ editDisplay: true,
+ // 表单编辑时是否为查看模式
+ editDetail: false,
+ props: {
+ label: "title",
+ value: "id",
+ },
+ rules: [{
+ required: true,
+ message: "请选择保安姓名",
+ trigger: "blur"
+ }]
+ },
+ {
+ label: "保安姓名",
+ prop: "name",
+ // 表单新增时是否禁止
+ addDisabled: false,
+ // 表单新增时是否可见
+ addDisplay: false,
+ // 表单新增时是否为查看模式
+ addDetail: false,
+ // 表单编辑时是否禁止
+ editDisabled: false,
+ // 表单编辑时是否可见
+ editDisplay: false,
+ // 表单编辑时是否为查看模式
+ editDetail: false,
+ viewDisplay:true,
+ props: {
+ label: "title",
+ value: "id",
+ },
+ rules: [{
+ required: true,
+ message: "请选择保安姓名",
+ trigger: "blur"
+ }]
+ },
+ {
+ label: "考试名称",
+ prop: "examName",
+ type: 'tree',
+ dicUrl: '/api/exampaper/page-tree',
+ // search: true,
+ slot: true,
+ // 表单新增时是否禁止
+ addDisabled: false,
+ // 表单新增时是否可见
+ addDisplay: true,
+ // 表单新增时是否为查看模式
+ addDetail: false,
+ // 表单编辑时是否禁止
+ editDisabled: true,
+ // 表单编辑时是否可见
+ editDisplay: true,
+ // 表单编辑时是否为查看模式
+ editDetail: false,
+ props: {
+ label: "examName",
+ value: "id",
+ },
+ rules: [{
+ required: true,
+ message: "请选择试卷名称",
+ trigger: "blur"
+ }],
+ width: 220
+ },
+ {
+ label: "所属公司",
+ prop: "deptName",
+ search: true,
+ slot: true,
+ // 表单新增时是否禁止
+ addDisabled: false,
+ // 表单新增时是否可见
+ addDisplay: false,
+ // 表单新增时是否为查看模式
+ addDetail: false,
+ // 表单编辑时是否禁止
+ editDisabled: true,
+ // 表单编辑时是否可见
+ editDisplay: true,
+ // 表单编辑时是否为查看模式
+ editDetail: false,
+ rules: [{
+ required: true,
+ message: "请选择所属公司",
+ trigger: "blur"
+ }],
+ width: 220
+ },
+ {
+ label: "准考证号",
+ prop: "candidateNo",
+ slot: true,
+ // 表单新增时是否禁止
+ addDisabled: false,
+ // 表单新增时是否可见
+ addDisplay: false,
+ // 表单新增时是否为查看模式
+ addDetail: false,
+ // 表单编辑时是否禁止
+ editDisabled: false,
+ // 表单编辑时是否可见
+ editDisplay: true,
+ // 表单编辑时是否为查看模式
+ editDetail: false,
+ rules: [{
+ required: true,
+ message: "请选择准考证号",
+ trigger: "blur"
+ }],
+ width:100
+ },
+ {
+ label: "身份证号",
+ prop: "idCardNo",
+ slot: true,
+ // 表单新增时是否禁止
+ addDisabled: false,
+ // 表单新增时是否可见
+ addDisplay: false,
+ // 表单新增时是否为查看模式
+ addDetail: false,
+ // 表单编辑时是否禁止
+ editDisabled: false,
+ // 表单编辑时是否可见
+ editDisplay: true,
+ // 表单编辑时是否为查看模式
+ editDetail: false,
+ rules: [{
+ required: true,
+ message: "请选择准考证号",
+ trigger: "blur"
+ }],
+ width: 200
+ },
+ {
+ label: "报考证件",
+ prop: "applyCard",
+ slot: true,
+ // 表单新增时是否禁止
+ addDisabled: false,
+ // 表单新增时是否可见
+ addDisplay: false,
+ // 表单新增时是否为查看模式
+ addDetail: false,
+ // 表单编辑时是否禁止
+ editDisabled: false,
+ // 表单编辑时是否可见
+ editDisplay: true,
+ // 表单编辑时是否为查看模式
+ editDetail: false,
+ rules: [{
+ required: true,
+ message: "请选择准考证号",
+ trigger: "blur"
+ }],
+ },
+ // {
+ // label: "试卷分数",
+ // prop: "paperScore",
+ // slot: true,
+ // // 表单新增时是否禁止
+ // addDisabled: false,
+ // // 表单新增时是否可见
+ // addDisplay: false,
+ // // 表单新增时是否为查看模式
+ // addDetail: false,
+ // // 表单编辑时是否禁止
+ // editDisabled: true,
+ // // 表单编辑时是否可见
+ // editDisplay: true,
+ // // 表单编辑时是否为查看模式
+ // editDetail: false
+ // },
+ {
+ label: "报名时间",
+ prop: "applyTime",
+ type: "datetime",
+ // span: 24,
+ format: 'yyyy-MM-dd HH:mm:ss',
+ valueFormat: 'yyyy-MM-dd HH:mm:ss',
+ // 表单新增时是否禁止
+ addDisabled: true,
+ // 表单新增时是否可见
+ addDisplay: true,
+ // 表单新增时是否为查看模式
+ addDetail: false,
+ // 表单编辑时是否禁止
+ editDisabled: true,
+ // 表单编辑时是否可见
+ editDisplay: true,
+ // 表单编辑时是否为查看模式
+ editDetail: false,
+ value: (new Date().getFullYear() + '-' + (new Date().getMonth() + 1 < 10
+ ? "0" + (new Date().getMonth() + 1)
+ : new Date().getMonth() + 1) + '-' + (new Date().getDate() < 10
+ ? "0" + new Date().getDate()
+ : new Date().getDate()) + ' ' + (new Date().getHours() < 10
+ ? "0" + new Date().getHours()
+ : new Date().getHours()) + ':' + (new Date().getMinutes() < 10
+ ? "0" + new Date().getMinutes()
+ : new Date().getMinutes()) + ':' + (new Date().getSeconds() < 10
+ ? "0" + new Date().getSeconds()
+ : new Date().getSeconds())),
+
+ width: 160
+ },
+ {
+ label: "考试时间",
+ prop: "examTime",
+ type: "datetime",
+ // span: 24,
+ format: 'yyyy-MM-dd HH:mm:ss',
+ valueFormat: 'yyyy-MM-dd HH:mm:ss',
+ // 表单新增时是否禁止
+ addDisabled: false,
+ // 表单新增时是否可见
+ addDisplay: false,
+ // 表单新增时是否为查看模式
+ addDetail: false,
+ // 表单编辑时是否禁止
+ editDisabled: false,
+ // 表单编辑时是否可见
+ editDisplay: true,
+ // 表单编辑时是否为查看模式
+ editDetail: false,
+ width: 160
+ },{
+ label: "报名状态",
+ prop: "applyStatus",
+ slot: true,
+ // 表单新增时是否禁止
+ addDisabled: false,
+ // 表单新增时是否可见
+ addDisplay: false,
+ // 表单新增时是否为查看模式
+ addDetail: false,
+ // 表单编辑时是否禁止
+ editDisabled: false,
+ // 表单编辑时是否可见
+ editDisplay: true,
+ // 表单编辑时是否为查看模式
+ editDetail: false,
+ dicData:DIC.applyStatus,
+ search:true,
+ type:"select"
+ },
+ ]
+ },
+ questionBankSearch: {},
+ questionBankLoading: true,
+ questionBankData: [
+
+ ],
+ questionBankPage: {
+ pageSize: 10,
+ currentPage: 1,
+ total: 16
+ },
+ questionBankQuery: {},
+ questionBankSelectionList: [],
+ excelForm: {},
+ excelOption: {
+ submitBtn: false,
+ emptyBtn: false,
+ column: [
+ {
+ label: "模板上传",
+ prop: "excelFile",
+ type: "upload",
+ drag: true,
+ loadText: "模板上传中,请稍等",
+ span: 24,
+ propsHttp: {
+ res: "data",
+ },
+ tip: "请上传 .xls,.xlsx 标准格式文件",
+ action: "/api/blade-user/import-user",
+ },
+ {
+ label: "模板下载",
+ prop: "excelTemplate",
+ formslot: true,
+ span: 24,
+ },
+ ],
+ },
+ }
+ },
+
+ watch: {
+ "form.examname": {
+ // form是表单或者表格绑定的数据集,v-model='form'
+ handler (val) {
+ if (val) {
+ //地址截取,从县/区开始截取,并且取从县区第一个出现的位置开始
+ var address = val.formattedAddress.toString();
+ if (address.search("县") != -1) {
+ this.form.address = address.substring(
+ address.indexOf("县") + 1,
+ address.length
+ );
+ }
+ if (address.search("区") != -1) {
+ this.form.address = address.substring(
+ address.indexOf("区") + 1,
+ address.length
+ );
+ }
+ }
+ },
+ immediate: true,
+ },
+ },
+ created () {
+
+ console.log(this.userInfo)
+
+ if (this.userInfo.role_name.indexOf('ksxtadmin') != -1) {
+
+ this.questionBankOption.column[0].dicUrl = "/api/blade-system/dept/lazy-tree-user?parentId="
+ } else {
+ this.questionBankOption.column[0].dicUrl = "/api/blade-system/dept/lazy-tree-user?parentId=" + this.userInfo.dept_id
+
+ }
+
+
+
+
+
+ },
+ mounted() {
+ var flag = false,
+ i = 0,
+ ind = null;
+ this.$store.state.tags.tagList.forEach((item, index) => {
+ if (item.label == "报名清册") {
+ if (flag == false) {
+ ind = index;
+ flag = true;
+ }
+ i++;
+ }
+ });
+ if (i > 1) {
+ this.$store.state.tags.tagList.splice(ind, 1);
+ }
+ },
+ computed: {
+ ...mapState({
+ userInfo: state => state.user.userInfo
+ }),
+ ids () {
+ let ids = [];
+ this.questionBankSelectionList.forEach(ele => {
+ ids.push(ele.id);
+ });
+ return ids.join(",");
+ },
+ },
+ methods: {
+ //准考证查看
+ handlePrint(row) {
+ var obj = row;
+ obj["name"] = "准考证信息";
+ this.$router.push({
+ path: `/applyexam/papers`,
+ query: obj,
+ });
+ },
+ questionBankOnLoad (page, params = {}) {
+ // debugger;
+ params['examId'] = this.$route.query.id;
+ this.questionBankLoading = false;
+ getApplyList(page.currentPage, page.pageSize, Object.assign(params, this.questionBankQuery)).then(res => {
+ const data = res.data.data;
+ this.questionBankPage.total = data.total;
+ this.questionBankData = data.records;
+ this.questionBankLoading = false;
+ this.questionBankSelectionClear();
+ });
+ },
+ questionBankSelectionClear () {
+ this.questionBankSelectionList = [];
+ this.$refs.questionBankCrud.toggleSelection();
+ },
+ questionBankSelectionChange (list) {
+ this.questionBankSelectionList = list;
+ },
+ questionBankSearchChange (params, done) {
+ this.questionBankQuery = params;
+ this.questionBankPage.currentPage = 1;
+ this.questionBankOnLoad(this.questionBankPage, params);
+ done();
+ },
+ questionBankSearchReset () {
+ this.questionBankQuery = {};
+ this.questionBankOnLoad(this.questionBankPage);
+ },
+ questionBankCurrentChange (currentPage) {
+ this.questionBankPage.currentPage = currentPage;
+ },
+ questionBankSizeChange (pageSize) {
+ this.questionBankPage.pageSize = pageSize;
+ },
+
+ // 新增
+ questionBankRowSave (row, done, loading) {
+
+ addApply({ userId: row.name, examId: row.examName, applyTime: row.applyTime }).then(() => {
+ this.questionBankOnLoad(this.questionBankPage);
+ this.$message({
+ type: "success",
+ message: "操作成功!"
+ });
+ done();
+ }, error => {
+ window.console.log(error);
+ loading();
+ });
+ },
+
+ questionBankRowDel (row) {
+ this.$confirm("确定将选择数据删除?", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning"
+ })
+ .then(() => {
+ return remove(row.id);
+ })
+ .then(() => {
+ this.questionBankOnLoad(this.questionBankPage);
+ this.$message({
+ type: "success",
+ message: "操作成功!"
+ });
+ });
+ },
+
+ questionBankHandleDelete () {
+ if (this.questionBankSelectionList.length === 0) {
+ this.$message.warning("请选择至少一条数据");
+ return;
+ }
+ this.$confirm("确定将选择数据删除?", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning"
+ })
+ .then(() => {
+ return remove(this.ids);
+ })
+ .then(() => {
+ this.questionBankOnLoad(this.questionBankPage);
+ this.$message({
+ type: "success",
+ message: "操作成功!"
+ });
+ this.$refs.questionBankCrud.toggleSelection();
+ });
+ },
+
+ //导出数据
+ handleExport() {
+ this.$confirm("是否导出清册数据?", "提示", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ }).then(() => {
+ window.open(`/api/apply/export-apply?examId=${this.$route.query.id}`);
+ });
+ },
+ handleImport() {
+ this.excelBox = true;
+ },
+ handleTemplate() {
+ window.open(
+ `/api/blade-user/export-template`
+ );
+ },
+ }
+}
+</script>
+
+<style lang="scss" scoped>
+</style>
diff --git a/src/views/applyexam/index.vue b/src/views/applyexam/index.vue
index 02e65dd..469d25a 100644
--- a/src/views/applyexam/index.vue
+++ b/src/views/applyexam/index.vue
@@ -50,19 +50,28 @@
</el-button>
</template> -->
- <template slot="menuLeft">
+ <!-- <template slot="menuLeft">
<el-button type="danger"
size="small"
icon="el-icon-delete"
@click="questionBankHandleDelete">删 除
</el-button>
- </template>
+ </template> -->
<template slot-scope="{ type,row }" slot="menu">
<el-button
:type="type"
size="small"
+ icon="el-icon-refresh-left"
+ :disabled="row.applyStatus==4"
+ @click="handleCancel(row)"
+ >取消报名
+ </el-button>
+ <el-button
+ :type="type"
+ size="small"
icon="el-icon-receiving"
+ :disabled="row.applyStatus==4"
@click="handlePrint(row)"
>准考证打印
</el-button>
@@ -82,10 +91,21 @@
import {
getApplyList,
addApply,
+ updateApply,
remove
} from "@/api/examapi/applyexam";
import { mapState } from 'vuex'
+
+var DIC = {
+ applyStatus: [{
+ label: '已报名',
+ value: 2
+ }, {
+ label: '已取消',
+ value: 4
+ }]
+}
@@ -93,18 +113,15 @@
data () {
return {
- obj: {
- name: '张三',
- },
questionBankOption: {
// 操作栏多余按钮去除
- delBtn: true,
+ delBtn: false,
editBtn: false,
addBtn: true,
selection: true,
menu: true,
// 导出按钮
- excelBtn: true,
+ // excelBtn: true,
viewBtn: false,
// title: '题库',
@@ -119,16 +136,19 @@
indexLabel: '序号',
//dialogType: 'drawer',
dialogClickModal: false,
+ //tree 默认展开
+ defaultExpandAll:true,
// 操作栏宽度
menuWidth: 200,
column: [
{
label: "保安姓名",
- prop: "name",
+ prop: "userId",
type: 'tree',
dicUrl: '',
search: true,
+ hide:true,
slot: true,
// 表单新增时是否禁止
addDisabled: false,
@@ -153,7 +173,33 @@
}]
},
{
- label: "试卷名称",
+ label: "保安姓名",
+ prop: "name",
+ // 表单新增时是否禁止
+ addDisabled: false,
+ // 表单新增时是否可见
+ addDisplay: false,
+ // 表单新增时是否为查看模式
+ addDetail: false,
+ // 表单编辑时是否禁止
+ editDisabled: false,
+ // 表单编辑时是否可见
+ editDisplay: false,
+ // 表单编辑时是否为查看模式
+ editDetail: false,
+ viewDisplay:true,
+ props: {
+ label: "title",
+ value: "id",
+ },
+ rules: [{
+ required: true,
+ message: "请选择保安姓名",
+ trigger: "blur"
+ }]
+ },
+ {
+ label: "考试名称",
prop: "examName",
type: 'tree',
dicUrl: '/api/exampaper/page-tree',
@@ -226,7 +272,8 @@
required: true,
message: "请选择准考证号",
trigger: "blur"
- }]
+ }],
+ width: 100
},
{
label: "身份证号",
@@ -300,7 +347,7 @@
// 表单新增时是否禁止
addDisabled: true,
// 表单新增时是否可见
- addDisplay: true,
+ addDisplay: false,
// 表单新增时是否为查看模式
addDetail: false,
// 表单编辑时是否禁止
@@ -321,7 +368,7 @@
? "0" + new Date().getSeconds()
: new Date().getSeconds())),
- width: 180
+ width: 160
},
{
label: "考试时间",
@@ -342,8 +389,27 @@
editDisplay: true,
// 表单编辑时是否为查看模式
editDetail: false,
- width: 180
- }
+ width: 160
+ },{
+ label: "报名状态",
+ prop: "applyStatus",
+ slot: true,
+ // 表单新增时是否禁止
+ addDisabled: false,
+ // 表单新增时是否可见
+ addDisplay: false,
+ // 表单新增时是否为查看模式
+ addDetail: false,
+ // 表单编辑时是否禁止
+ editDisabled: false,
+ // 表单编辑时是否可见
+ editDisplay: true,
+ // 表单编辑时是否为查看模式
+ editDetail: false,
+ dicData:DIC.applyStatus,
+ search:true,
+ type:"select"
+ },
]
},
questionBankSearch: {},
@@ -461,8 +527,8 @@
// 新增
questionBankRowSave (row, done, loading) {
-
- addApply({ userId: row.name, examId: row.examName, applyTime: row.applyTime }).then(() => {
+ // debugger;
+ addApply({ userId: row.userId, examId: row.examName, applyTime: row.applyTime }).then(() => {
this.questionBankOnLoad(this.questionBankPage);
this.$message({
type: "success",
@@ -493,6 +559,26 @@
});
},
+ //取消报名
+ handleCancel(row){
+ this.$confirm("确定取消报名?", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning"
+ })
+ .then(() => {
+ row.applyStatus = 4;
+ return updateApply(row);
+ })
+ .then(() => {
+ this.questionBankOnLoad(this.questionBankPage);
+ this.$message({
+ type: "success",
+ message: "操作成功!"
+ });
+ });
+ },
+
questionBankHandleDelete () {
if (this.questionBankSelectionList.length === 0) {
this.$message.warning("请选择至少一条数据");
diff --git a/src/views/exam/examination.vue b/src/views/exam/examination.vue
index c06b14d..0589ab6 100644
--- a/src/views/exam/examination.vue
+++ b/src/views/exam/examination.vue
@@ -165,26 +165,6 @@
}]
},
{
- label: "试卷分数",
- prop: "totalScore",
- slot: true,
- // 表单新增时是否禁止
- addDisabled: false,
- // 表单新增时是否可见
- addDisplay: true,
- // 表单新增时是否为查看模式
- addDetail: false,
- // 表单编辑时是否禁止
- editDisabled: false,
- // 表单编辑时是否可见
- editDisplay: true,
- // 表单编辑时是否为查看模式
- editDetail: false,
-
- rules: [{ validator: validatePass, required: true, trigger: 'blur' }],
- width: 100
- },
- {
label: "考试时间",
prop: "examTime",
type: "daterange",
diff --git a/src/views/exam/startexam.vue b/src/views/exam/startexam.vue
index ebd62f0..37abb00 100644
--- a/src/views/exam/startexam.vue
+++ b/src/views/exam/startexam.vue
@@ -6,7 +6,7 @@
* menu-name 考试管理
*/
<template>
- <el-row class="morpheus-box-exam">
+ <el-row class="morpheus-box-paper">
<el-col :span="24">
<el-card>
@@ -25,7 +25,10 @@
@search-change="questionBankSearchChange"
@search-reset="questionBankSearchReset"
@current-change="questionBankCurrentChange"
- @size-change="questionBankSizeChange">
+ @size-change="questionBankSizeChange"
+ @row-save="questionBankRowSave"
+ @row-update="questionBankRowUpdate"
+ @row-del="questionBankRowDel">
<!-- 自定义按钮 -->
<!-- <template slot="menuLeft">
@@ -49,6 +52,14 @@
</el-button>
</template> -->
+ <template slot="menuLeft">
+ <el-button type="danger"
+ size="small"
+ icon="el-icon-delete"
+ @click="questionBankHandleDelete">删 除
+ </el-button>
+ </template>
+
<template slot-scope="{row}"
slot="examStatus">
<el-tag>{{row.examStatus == 0 ? '已发布' : '草稿'}}</el-tag>
@@ -59,10 +70,10 @@
<el-button type="text"
size="mini"
- icon="icon-kaoshi"
+ icon="el-icon-collection"
class="start-kaoshi"
- @click="startExam(row)">开始考试
+ @click="startExam(row)">报名清册
</el-button>
</template>
@@ -78,6 +89,9 @@
<script>
import {
getList,
+ add,
+ remove,
+ update
} from "@/api/examapi/examination";
@@ -102,10 +116,10 @@
form: {},
questionBankOption: {
// 操作栏多余按钮去除
- delBtn: false,
- editBtn: false,
- addBtn: false,
- selection: false,
+ delBtn: true,
+ editBtn: true,
+ addBtn: true,
+ selection: true,
menu: true,
// 导出按钮
excelBtn: false,
@@ -124,13 +138,13 @@
//dialogType: 'drawer',
dialogClickModal: false,
// 操作栏宽度
- menuWidth: 246,
+ menuWidth: 280,
labelWidth: 140,
column: [
{
- label: "试卷名称",
+ label: "考试名称",
prop: "examName",
search: true,
searchSpan: 5,
@@ -153,26 +167,26 @@
trigger: "blur"
}]
},
- {
- label: "试卷分数",
- prop: "totalScore",
- slot: true,
- // 表单新增时是否禁止
- addDisabled: false,
- // 表单新增时是否可见
- addDisplay: true,
- // 表单新增时是否为查看模式
- addDetail: false,
- // 表单编辑时是否禁止
- editDisabled: false,
- // 表单编辑时是否可见
- editDisplay: true,
- // 表单编辑时是否为查看模式
- editDetail: false,
+ // {
+ // label: "试卷分数",
+ // prop: "totalScore",
+ // slot: true,
+ // // 表单新增时是否禁止
+ // addDisabled: false,
+ // // 表单新增时是否可见
+ // addDisplay: true,
+ // // 表单新增时是否为查看模式
+ // addDetail: false,
+ // // 表单编辑时是否禁止
+ // editDisabled: false,
+ // // 表单编辑时是否可见
+ // editDisplay: true,
+ // // 表单编辑时是否为查看模式
+ // editDetail: false,
- rules: [{ validator: validatePass, required: true, trigger: 'blur' }],
- width: 100
- },
+ // rules: [{ validator: validatePass, required: true, trigger: 'blur' }],
+ // width: 100
+ // },
{
label: "考试时间",
prop: "examTime",
@@ -374,11 +388,97 @@
},
startExam (row) {
- this.$router.push({
- path: `/startexam/${row.id}`,
- query: row
+ //正式考试
+ if(row.examType==1){
+ this.$router.push({
+ path: `/applydetailed`,
+ query: row
+ })
+ }
+
+ //模拟考试
+ if(row.examType==2){
+ this.$router.push({
+ path: `/trainApply`,
+ query: row
+ })
+ }
+ },
+ // 新增
+ questionBankRowSave (row, done, loading) {
+ row.startTime = row.examTime[0]
+ row.endTime = row.examTime[1]
+ row.examTime = JSON.stringify(row.examTime)
+ add(row).then(() => {
+ this.questionBankOnLoad(this.questionBankPage);
+ this.$message({
+ type: "success",
+ message: "操作成功!"
+ });
+ done();
+ }, error => {
+ window.console.log(error);
+ loading();
+ });
+ },
+ questionBankRowUpdate (row, index, done, loading) {
+ if (Array.isArray(row.examTime) != true) {
+ row.examTime = row.examTime.split(",")
+ }
+ row.startTime = row.examTime[0]
+ row.endTime = row.examTime[1]
+ row.examTime = JSON.stringify(row.examTime)
+ update(row).then(() => {
+ this.questionBankOnLoad(this.questionBankPage);
+ this.$message({
+ type: "success",
+ message: "操作成功!"
+ });
+ done();
+ }, error => {
+ window.console.log(error);
+ loading();
+ });
+ },
+ questionBankRowDel (row) {
+ this.$confirm("确定将选择数据删除?", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning"
})
- }
+ .then(() => {
+ return remove(row.id);
+ })
+ .then(() => {
+ this.questionBankOnLoad(this.questionBankPage);
+ this.$message({
+ type: "success",
+ message: "操作成功!"
+ });
+ });
+ },
+ questionBankHandleDelete () {
+ if (this.questionBankSelectionList.length === 0) {
+ this.$message.warning("请选择至少一条数据");
+ return;
+ }
+ this.$confirm("确定将选择数据删除?", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning"
+ })
+ .then(() => {
+ return remove(this.ids);
+ })
+ .then(() => {
+ this.questionBankOnLoad(this.questionBankPage);
+ this.$message({
+ type: "success",
+ message: "操作成功!"
+ });
+ this.$refs.questionBankCrud.toggleSelection();
+ });
+ },
}
}
</script>
diff --git a/src/views/securityGuard/securityGuard.vue b/src/views/securityGuard/securityGuard.vue
index 044ae20..c0a1274 100644
--- a/src/views/securityGuard/securityGuard.vue
+++ b/src/views/securityGuard/securityGuard.vue
@@ -408,6 +408,24 @@
],
},
{
+ label: '个人照片',
+ type: 'upload',
+ listType: 'picture-img',
+ propsHttp: {
+ res: 'data',
+ url: 'link',
+ },
+ canvasOption: {
+ text: ' ',
+ ratio: 0.1
+ },
+ action: '/api/blade-resource/oss/endpoint/put-file',
+ tip: '只能上传jpg/png个人头像,且不超过500kb',
+ span: 12,
+ row: true,
+ prop: 'myPicture'
+ },
+ {
label: "编号",
prop: "code",
},
diff --git a/src/views/trainApply/index.vue b/src/views/trainApply/index.vue
new file mode 100644
index 0000000..429e3e8
--- /dev/null
+++ b/src/views/trainApply/index.vue
@@ -0,0 +1,584 @@
+/*
+ * @Author: Morpheus
+ * @Date: 2021-07-05 16:31:54
+ * @Last Modified by: Morpheus
+ * @Last Modified time: 2021-07-19 19:39:45
+ * menu-name 报名考试
+ */
+<template>
+ <el-row class="morpheus-box-apply-exam">
+ <el-col :span="24" class="hasButOne">
+ <el-card>
+ <div class="exam-card-body">
+
+ <avue-crud v-model="obj"
+ class="company-box"
+ :option="questionBankOption"
+ :search.sync="questionBankSearch"
+ :table-loading="questionBankLoading"
+ :data="questionBankData"
+ ref="questionBankCrud"
+ :page.sync="questionBankPage"
+ @on-load="questionBankOnLoad"
+ @selection-change="questionBankSelectionChange"
+ @search-change="questionBankSearchChange"
+ @search-reset="questionBankSearchReset"
+ @current-change="questionBankCurrentChange"
+ @size-change="questionBankSizeChange"
+ @row-save="questionBankRowSave"
+ @row-del="questionBankRowDel">
+
+ <!-- 自定义按钮 -->
+ <template slot="menuLeft">
+ <el-button
+ type="warning"
+ size="small"
+ plain
+ icon="el-icon-download"
+ @click="handleExport"
+ >导出
+ </el-button>
+ </template>
+
+ <template slot-scope="{ type,row }" slot="menu">
+ <el-button
+ :type="type"
+ size="small"
+ icon="el-icon-receiving"
+ :disabled="row.cancel==2"
+ @click="handlePrint(row)"
+ >准考证打印
+ </el-button>
+ </template>
+
+ </avue-crud>
+
+ </div>
+
+ </el-card>
+ </el-col>
+ </el-row>
+</template>
+
+<script>
+
+import {getdata,adddata,remove} from "@/api/trainingRegistration/trainingRegistration";
+
+import { mapState } from 'vuex'
+
+var DIC = {
+ cancel: [{
+ label: '已报名',
+ value: 1
+ }, {
+ label: '已取消',
+ value: 2
+ }]
+}
+
+
+
+export default {
+ data () {
+
+ return {
+ questionBankOption: {
+ // 操作栏多余按钮去除
+ delBtn: false,
+ editBtn: false,
+ addBtn: false,
+ selection: true,
+ menu: true,
+ // 导出按钮
+ // excelBtn: true,
+ viewBtn: false,
+
+ // title: '题库',
+
+ align: 'center',
+ height: 'auto',
+ calcHeight: 80,
+ tip: false,
+ searchShow: true,
+ searchMenuSpan: 4,
+ index: true,
+ indexLabel: '序号',
+ //dialogType: 'drawer',
+ dialogClickModal: false,
+ // 操作栏宽度
+ menuWidth: 200,
+
+ column: [
+ {
+ label: "保安姓名",
+ prop: "userId",
+ type: 'tree',
+ dicUrl: '',
+ search: true,
+ hide:true,
+ slot: true,
+ // 表单新增时是否禁止
+ addDisabled: false,
+ // 表单新增时是否可见
+ addDisplay: true,
+ // 表单新增时是否为查看模式
+ addDetail: false,
+ // 表单编辑时是否禁止
+ editDisabled: true,
+ // 表单编辑时是否可见
+ editDisplay: true,
+ // 表单编辑时是否为查看模式
+ editDetail: false,
+ props: {
+ label: "title",
+ value: "id",
+ },
+ rules: [{
+ required: true,
+ message: "请选择保安姓名",
+ trigger: "blur"
+ }]
+ },
+ {
+ label: "保安姓名",
+ prop: "realName",
+ // 表单新增时是否禁止
+ addDisabled: false,
+ // 表单新增时是否可见
+ addDisplay: false,
+ // 表单新增时是否为查看模式
+ addDetail: false,
+ // 表单编辑时是否禁止
+ editDisabled: false,
+ // 表单编辑时是否可见
+ editDisplay: false,
+ // 表单编辑时是否为查看模式
+ editDetail: false,
+ viewDisplay:true,
+ props: {
+ label: "title",
+ value: "id",
+ },
+ rules: [{
+ required: true,
+ message: "请选择保安姓名",
+ trigger: "blur"
+ }]
+ },
+ {
+ label: "考试名称",
+ prop: "trainExamName",
+ type: 'tree',
+ dicUrl: '/api/exampaper/page-tree',
+ // search: true,
+ slot: true,
+ // 表单新增时是否禁止
+ addDisabled: false,
+ // 表单新增时是否可见
+ addDisplay: true,
+ // 表单新增时是否为查看模式
+ addDetail: false,
+ // 表单编辑时是否禁止
+ editDisabled: true,
+ // 表单编辑时是否可见
+ editDisplay: true,
+ // 表单编辑时是否为查看模式
+ editDetail: false,
+ props: {
+ label: "examName",
+ value: "id",
+ },
+ rules: [{
+ required: true,
+ message: "请选择试卷名称",
+ trigger: "blur"
+ }],
+ width: 220
+ },
+ {
+ label: "所属公司",
+ prop: "deptName",
+ search: true,
+ slot: true,
+ // 表单新增时是否禁止
+ addDisabled: false,
+ // 表单新增时是否可见
+ addDisplay: false,
+ // 表单新增时是否为查看模式
+ addDetail: false,
+ // 表单编辑时是否禁止
+ editDisabled: true,
+ // 表单编辑时是否可见
+ editDisplay: true,
+ // 表单编辑时是否为查看模式
+ editDetail: false,
+ rules: [{
+ required: true,
+ message: "请选择所属公司",
+ trigger: "blur"
+ }],
+ width: 220
+ },
+ {
+ label: "准考证号",
+ prop: "candidateNo",
+ slot: true,
+ // 表单新增时是否禁止
+ addDisabled: false,
+ // 表单新增时是否可见
+ addDisplay: false,
+ // 表单新增时是否为查看模式
+ addDetail: false,
+ // 表单编辑时是否禁止
+ editDisabled: false,
+ // 表单编辑时是否可见
+ editDisplay: true,
+ // 表单编辑时是否为查看模式
+ editDetail: false,
+ rules: [{
+ required: true,
+ message: "请选择准考证号",
+ trigger: "blur"
+ }]
+ },
+ {
+ label: "身份证号",
+ prop: "idCardNo",
+ slot: true,
+ // 表单新增时是否禁止
+ addDisabled: false,
+ // 表单新增时是否可见
+ addDisplay: false,
+ // 表单新增时是否为查看模式
+ addDetail: false,
+ // 表单编辑时是否禁止
+ editDisabled: false,
+ // 表单编辑时是否可见
+ editDisplay: true,
+ // 表单编辑时是否为查看模式
+ editDetail: false,
+ rules: [{
+ required: true,
+ message: "请选择准考证号",
+ trigger: "blur"
+ }],
+ width: 200
+ },
+ {
+ label: "报考证件",
+ prop: "applyCard",
+ slot: true,
+ // 表单新增时是否禁止
+ addDisabled: false,
+ // 表单新增时是否可见
+ addDisplay: false,
+ // 表单新增时是否为查看模式
+ addDetail: false,
+ // 表单编辑时是否禁止
+ editDisabled: false,
+ // 表单编辑时是否可见
+ editDisplay: true,
+ // 表单编辑时是否为查看模式
+ editDetail: false,
+ rules: [{
+ required: true,
+ message: "请选择准考证号",
+ trigger: "blur"
+ }],
+ },
+ // {
+ // label: "试卷分数",
+ // prop: "paperScore",
+ // slot: true,
+ // // 表单新增时是否禁止
+ // addDisabled: false,
+ // // 表单新增时是否可见
+ // addDisplay: false,
+ // // 表单新增时是否为查看模式
+ // addDetail: false,
+ // // 表单编辑时是否禁止
+ // editDisabled: true,
+ // // 表单编辑时是否可见
+ // editDisplay: true,
+ // // 表单编辑时是否为查看模式
+ // editDetail: false
+ // },
+ {
+ label: "报名时间",
+ prop: "trainingTime",
+ type: "datetime",
+ // span: 24,
+ format: 'yyyy-MM-dd HH:mm:ss',
+ valueFormat: 'yyyy-MM-dd HH:mm:ss',
+ // 表单新增时是否禁止
+ addDisabled: true,
+ // 表单新增时是否可见
+ addDisplay: true,
+ // 表单新增时是否为查看模式
+ addDetail: false,
+ // 表单编辑时是否禁止
+ editDisabled: true,
+ // 表单编辑时是否可见
+ editDisplay: true,
+ // 表单编辑时是否为查看模式
+ editDetail: false,
+ value: (new Date().getFullYear() + '-' + (new Date().getMonth() + 1 < 10
+ ? "0" + (new Date().getMonth() + 1)
+ : new Date().getMonth() + 1) + '-' + (new Date().getDate() < 10
+ ? "0" + new Date().getDate()
+ : new Date().getDate()) + ' ' + (new Date().getHours() < 10
+ ? "0" + new Date().getHours()
+ : new Date().getHours()) + ':' + (new Date().getMinutes() < 10
+ ? "0" + new Date().getMinutes()
+ : new Date().getMinutes()) + ':' + (new Date().getSeconds() < 10
+ ? "0" + new Date().getSeconds()
+ : new Date().getSeconds())),
+
+ width: 160
+ },
+ {
+ label: "考试时间",
+ prop: "trainExamTime",
+ type: "datetime",
+ // span: 24,
+ format: 'yyyy-MM-dd HH:mm:ss',
+ valueFormat: 'yyyy-MM-dd HH:mm:ss',
+ // 表单新增时是否禁止
+ addDisabled: false,
+ // 表单新增时是否可见
+ addDisplay: false,
+ // 表单新增时是否为查看模式
+ addDetail: false,
+ // 表单编辑时是否禁止
+ editDisabled: false,
+ // 表单编辑时是否可见
+ editDisplay: true,
+ // 表单编辑时是否为查看模式
+ editDetail: false,
+ width: 160
+ },{
+ label: "报名状态",
+ prop: "cancel",
+ slot: true,
+ // 表单新增时是否禁止
+ addDisabled: false,
+ // 表单新增时是否可见
+ addDisplay: false,
+ // 表单新增时是否为查看模式
+ addDetail: false,
+ // 表单编辑时是否禁止
+ editDisabled: false,
+ // 表单编辑时是否可见
+ editDisplay: true,
+ // 表单编辑时是否为查看模式
+ editDetail: false,
+ dicData:DIC.cancel,
+ search:true,
+ type:"select"
+ },
+ ]
+ },
+ questionBankSearch: {},
+ questionBankLoading: true,
+ questionBankData: [
+
+ ],
+ questionBankPage: {
+ pageSize: 10,
+ currentPage: 1,
+ total: 16
+ },
+ questionBankQuery: {},
+ questionBankSelectionList: [],
+ }
+ },
+
+ watch: {
+ "form.examname": {
+ // form是表单或者表格绑定的数据集,v-model='form'
+ handler (val) {
+ if (val) {
+ //地址截取,从县/区开始截取,并且取从县区第一个出现的位置开始
+ var address = val.formattedAddress.toString();
+ if (address.search("县") != -1) {
+ this.form.address = address.substring(
+ address.indexOf("县") + 1,
+ address.length
+ );
+ }
+ if (address.search("区") != -1) {
+ this.form.address = address.substring(
+ address.indexOf("区") + 1,
+ address.length
+ );
+ }
+ }
+ },
+ immediate: true,
+ },
+ },
+ created () {
+
+ console.log(this.userInfo)
+
+ if (this.userInfo.role_name.indexOf('ksxtadmin') != -1) {
+
+ this.questionBankOption.column[0].dicUrl = "/api/blade-system/dept/lazy-tree-user?parentId="
+ } else {
+ this.questionBankOption.column[0].dicUrl = "/api/blade-system/dept/lazy-tree-user?parentId=" + this.userInfo.dept_id
+
+ }
+
+
+
+
+
+ },
+ mounted() {
+ var flag = false,
+ i = 0,
+ ind = null;
+ this.$store.state.tags.tagList.forEach((item, index) => {
+ if (item.label == "报名清册") {
+ if (flag == false) {
+ ind = index;
+ flag = true;
+ }
+ i++;
+ }
+ });
+ if (i > 1) {
+ this.$store.state.tags.tagList.splice(ind, 1);
+ }
+ },
+ computed: {
+ ...mapState({
+ userInfo: state => state.user.userInfo
+ }),
+ ids () {
+ let ids = [];
+ this.questionBankSelectionList.forEach(ele => {
+ ids.push(ele.id);
+ });
+ return ids.join(",");
+ },
+ },
+ methods: {
+ //准考证查看
+ handlePrint(row) {
+ var obj = row;
+ obj["name"] = "准考证信息";
+ this.$router.push({
+ path: `/applyexam/papers`,
+ query: obj,
+ });
+ },
+ questionBankOnLoad (page, params = {}) {
+ // debugger;
+ params['examId'] = this.$route.query.id;
+ this.questionBankLoading = false;
+ getdata(page.currentPage, page.pageSize, Object.assign(params, this.questionBankQuery)).then(res => {
+ const data = res.data.data;
+ this.questionBankPage.total = data.total;
+ this.questionBankData = data.records;
+ this.questionBankLoading = false;
+ this.questionBankSelectionClear();
+ });
+ },
+ questionBankSelectionClear () {
+ this.questionBankSelectionList = [];
+ this.$refs.questionBankCrud.toggleSelection();
+ },
+ questionBankSelectionChange (list) {
+ this.questionBankSelectionList = list;
+ },
+ questionBankSearchChange (params, done) {
+ this.questionBankQuery = params;
+ this.questionBankPage.currentPage = 1;
+ this.questionBankOnLoad(this.questionBankPage, params);
+ done();
+ },
+ questionBankSearchReset () {
+ this.questionBankQuery = {};
+ this.questionBankOnLoad(this.questionBankPage);
+ },
+ questionBankCurrentChange (currentPage) {
+ this.questionBankPage.currentPage = currentPage;
+ },
+ questionBankSizeChange (pageSize) {
+ this.questionBankPage.pageSize = pageSize;
+ },
+
+ // 新增
+ questionBankRowSave (row, done, loading) {
+
+ adddata({ userId: row.name, examId: row.examName, applyTime: row.applyTime }).then(() => {
+ this.questionBankOnLoad(this.questionBankPage);
+ this.$message({
+ type: "success",
+ message: "操作成功!"
+ });
+ done();
+ }, error => {
+ window.console.log(error);
+ loading();
+ });
+ },
+
+ questionBankRowDel (row) {
+ this.$confirm("确定将选择数据删除?", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning"
+ })
+ .then(() => {
+ return remove(row.id);
+ })
+ .then(() => {
+ this.questionBankOnLoad(this.questionBankPage);
+ this.$message({
+ type: "success",
+ message: "操作成功!"
+ });
+ });
+ },
+
+ questionBankHandleDelete () {
+ if (this.questionBankSelectionList.length === 0) {
+ this.$message.warning("请选择至少一条数据");
+ return;
+ }
+ this.$confirm("确定将选择数据删除?", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning"
+ })
+ .then(() => {
+ return remove(this.ids);
+ })
+ .then(() => {
+ this.questionBankOnLoad(this.questionBankPage);
+ this.$message({
+ type: "success",
+ message: "操作成功!"
+ });
+ this.$refs.questionBankCrud.toggleSelection();
+ });
+ },
+
+ //导出数据
+ handleExport() {
+ this.$confirm("是否导出清册数据?", "提示", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ }).then(() => {
+ window.open(`/api/trainingRegistration/export-apply?examId=${this.$route.query.id}`);
+ });
+ },
+ }
+}
+</script>
+
+<style lang="scss" scoped>
+</style>
--
Gitblit v1.9.3