From fe0c2d838e1657dbe3efdf4dfd083cee6cf80de1 Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Mon, 13 Sep 2021 19:20:26 +0800
Subject: [PATCH] 考试报名,培训报名修改
---
src/views/applyexam/index.vue | 603 +++++++-------
src/views/trainingRegistration/data.js | 331 ++++++++
src/views/exam/startexam.vue | 6
src/views/trainingRegistration/index.vue | 1330 +++++++++++++++++++++++---------
src/views/applydetailed/index.vue | 17
src/views/companyApply/index.vue | 81 +
6 files changed, 1,620 insertions(+), 748 deletions(-)
diff --git a/src/views/applydetailed/index.vue b/src/views/applydetailed/index.vue
index e813954..55532da 100644
--- a/src/views/applydetailed/index.vue
+++ b/src/views/applydetailed/index.vue
@@ -34,17 +34,25 @@
type="warning"
size="small"
plain
- icon="el-icon-download"
+ icon="el-icon-position"
+ @click="handleImport"
+ >报名清册生成
+ </el-button>
+ <el-button
+ type="warning"
+ size="small"
+ plain
+ icon="el-icon-receiving"
@click="handleExport"
- >清册打印
+ >报名清册打印
</el-button>
<el-button
type="success"
size="small"
plain
- icon="el-icon-receiving"
+ icon="el-icon-upload2"
@click="handleImport"
- >清册导入
+ >报名清册附件上传
</el-button>
</template>
@@ -118,6 +126,7 @@
menu: true,
// 导出按钮
// excelBtn: true,
+ // excelBtnText:"报名清册生成",
viewBtn: false,
// title: '题库',
diff --git a/src/views/applyexam/index.vue b/src/views/applyexam/index.vue
index bf9a8f8..ca1296b 100644
--- a/src/views/applyexam/index.vue
+++ b/src/views/applyexam/index.vue
@@ -75,7 +75,7 @@
plain
icon="el-icon-folder-checked"
v-if="permission.applyexam_import"
- @click="handleImport"
+ @click="handleImport"
>批量报名
</el-button>
</template>
@@ -103,7 +103,7 @@
:type="type"
size="small"
icon="el-icon-receiving"
- v-if="permission.applyexam_print && row.candidateNo!=''"
+ v-if="permission.applyexam_print && row.candidateNo != ''"
@click="handlePrint(row)"
>准考证打印
</el-button>
@@ -181,6 +181,7 @@
import { mapState } from "vuex";
import { mapGetters } from "vuex";
import { getRoleDetail } from "@/api/system/role";
+import { getUserDetails } from "@/api/experience/experience"
var DIC = {
applyStatus: [
{
@@ -197,6 +198,9 @@
export default {
data() {
return {
+ obj:{
+ userId:''
+ },
dialogFormVisible: false,
dialogExamFormVisible: false,
examPersission: false,
@@ -302,15 +306,15 @@
{
label: "考试人数",
prop: "number",
- type: 'number',
+ type: "number",
span: 12,
- precision:0,
- step:50,
- mock:{
- type:'number',
- max:1000,
- min:0,
- precision:0
+ precision: 0,
+ step: 50,
+ mock: {
+ type: "number",
+ max: 1000,
+ min: 0,
+ precision: 0,
},
rules: [
{
@@ -321,22 +325,22 @@
],
minRows: 0,
maxRows: 1000,
- value:50,
+ value: 50,
},
{
label: "序号开始",
prop: "serialStart",
span: 6,
- value:1,
- mock:{
- type:'number',
- max:1000,
- min:1,
- precision:0
+ value: 1,
+ mock: {
+ type: "number",
+ max: 1000,
+ min: 1,
+ precision: 0,
},
minRows: 1,
maxRows: 1000,
- type:"number",
+ type: "number",
rules: [
{
required: true,
@@ -349,16 +353,16 @@
label: "序号结束",
prop: "serialEnd",
span: 6,
- value:50,
- mock:{
- type:'number',
- max:1000,
- min:1,
- precision:0
+ value: 50,
+ mock: {
+ type: "number",
+ max: 1000,
+ min: 1,
+ precision: 0,
},
minRows: 1,
maxRows: 1000,
- type:"number",
+ type: "number",
rules: [
{
required: true,
@@ -427,7 +431,8 @@
// 操作栏多余按钮去除
delBtn: false,
editBtn: false,
- addBtn: false,
+ addBtn: true,
+ addBtnText: "报名信息新增",
selection: false,
menu: true,
// 导出按钮
@@ -450,13 +455,55 @@
defaultExpandAll: true,
// 操作栏宽度
menuWidth: 250,
-
column: [
+ {
+ label: "报名时间",
+ prop: "releaseTimeRange",
+ type: "date",
+ format: "yyyy-MM-dd",
+ valueFormat: "yyyy-MM-dd",
+ searchRange: true,
+ searchSpan: 5,
+ hide: true,
+ addDisplay: false,
+ editDisplay: false,
+ viewDisplay: false,
+ search: true,
+ rules: [
+ {
+ required: true,
+ message: "请输入时间",
+ trigger: "blur",
+ },
+ ],
+ },
+ {
+ label: "保安公司名称",
+ searchLabelWidth: "110",
+ labelWidth: 110,
+ cascaderItem: ["userId"],
+ prop: "deptId",
+ type: "tree",
+ hide: true,
+ viewDisabled:false,
+ viewDisplay:false,
+ dicUrl:
+ "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697",
+ props: {
+ label: "title",
+ value: "id",
+ },
+ slot: true,
+ searchSpan: 4,
+ search: false,
+ width: 260,
+ },
{
label: "保安姓名",
prop: "userId",
type: "tree",
- dicUrl: "",
+ dicUrl:
+ "/api/blade-user/security-apply-tree?examType=1&deptId={{key}}",
hide: true,
slot: true,
searchSpan: 4,
@@ -475,7 +522,7 @@
// 表单编辑时是否为查看模式
editDetail: false,
props: {
- label: "title",
+ label: "name",
value: "id",
},
rules: [
@@ -522,107 +569,17 @@
prop: "age",
slot: true,
// 表单新增时是否禁止
- addDisabled: false,
+ addDisabled: true,
// 表单新增时是否可见
- addDisplay: false,
- // 表单新增时是否为查看模式
- addDetail: false,
- // 表单编辑时是否禁止
- editDisabled: false,
- // 表单编辑时是否可见
- editDisplay: false,
- // 表单编辑时是否为查看模式
- editDetail: false,
+ addDisplay: true,
viewDisplay: true,
- },
- // {
- // label: "考试名称",
- // prop: "examName",
- // type: "tree",
- // dicUrl: "/api/exampaper/page-tree?examType=1",
- // // 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,
- searchSpan: 6,
- // 表单新增时是否禁止
- 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,
+ search: true,
+ searchSpan: 5,
// 表单新增时是否禁止
addDisabled: false,
// 表单新增时是否可见
@@ -645,21 +602,14 @@
width: 150,
},
{
- label: "报考证件",
- prop: "applyCard",
- slot: true,
+ label: "身份证号",
+ prop: "cardid",
+ searchSpan: 5,
// 表单新增时是否禁止
- addDisabled: false,
+ addDisabled: true,
// 表单新增时是否可见
- addDisplay: false,
- // 表单新增时是否为查看模式
- addDetail: false,
- // 表单编辑时是否禁止
- editDisabled: false,
- // 表单编辑时是否可见
- editDisplay: true,
- // 表单编辑时是否为查看模式
- editDetail: false,
+ addDisplay: true,
+ hide:true,
rules: [
{
required: true,
@@ -667,23 +617,108 @@
trigger: "blur",
},
],
+ width: 150,
+ },
+ {
+ label: "性别",
+ prop: "sex",
+ type: "select",
+ // 表单新增时是否禁止
+ addDisabled: true,
+ // 表单新增时是否可见
+ addDisplay: true,
+ dicData: [
+ {
+ label: "男",
+ value: 1,
+ },
+ {
+ label: "女",
+ value: 2,
+ },
+ {
+ label: "未知",
+ value: 3,
+ },
+ {
+ label: " ",
+ value: -1,
+ },
+ ],
+ display: false,
+ },
+
+ {
+ label: "籍贯",
+ prop: "nativePlace",
+ // 表单新增时是否禁止
+ addDisabled: true,
+ // 表单新增时是否可见
+ addDisplay: true,
+ },
+ {
+ label: "联系电话",
+ prop: "phone",
+ // 表单新增时是否禁止
+ addDisabled: true,
+ // 表单新增时是否可见
+ addDisplay: true,
+ },
+ {
+ label: "保安公司名称",
+ labelWidth: "110",
+ addDisplay: false,
+ prop: "deptName",
+ width: 260,
},
// {
- // label: "试卷分数",
- // prop: "paperScore",
- // slot: true,
- // // 表单新增时是否禁止
- // addDisabled: false,
- // // 表单新增时是否可见
- // addDisplay: false,
- // // 表单新增时是否为查看模式
- // addDetail: false,
- // // 表单编辑时是否禁止
- // editDisabled: true,
- // // 表单编辑时是否可见
- // editDisplay: true,
- // // 表单编辑时是否为查看模式
- // editDetail: false
+ // 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: "applyCard",
+ // slot: true,
+ // // 表单新增时是否禁止
+ // addDisabled: false,
+ // // 表单新增时是否可见
+ // addDisplay: false,
+ // // 表单新增时是否为查看模式
+ // addDetail: false,
+ // // 表单编辑时是否禁止
+ // editDisabled: false,
+ // // 表单编辑时是否可见
+ // editDisplay: true,
+ // // 表单编辑时是否为查看模式
+ // editDetail: false,
+ // rules: [
+ // {
+ // required: true,
+ // message: "请选择准考证号",
+ // trigger: "blur",
+ // },
+ // ],
// },
{
label: "报名时间",
@@ -729,105 +764,39 @@
width: 150,
},
- // {
- // 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: 150,
- // },
-
- // {
- // label: "审查状态",
- // prop: "examinationType",
- // slot: true,
- // searchSpan: 5,
- // // 表单新增时是否禁止
- // addDisabled: false,
- // // 表单新增时是否可见
- // addDisplay: false,
- // // 表单新增时是否为查看模式
- // addDetail: false,
- // // 表单编辑时是否禁止
- // editDisabled: false,
- // // 表单编辑时是否可见
- // editDisplay: true,
- // // 表单编辑时是否为查看模式
- // editDetail: false,
- // dicData: [
- // {
- // label: "正常",
- // value: "1",
- // },
- // {
- // label: "异常",
- // value: "2",
- // },
- // ],
- // search: true,
- // type: "select",
- // },
- // {
- // label: "审查明细",
- // prop: "examinationMx",
- // slot: true,
- // // 表单新增时是否禁止
- // addDisabled: false,
- // // 表单新增时是否可见
- // addDisplay: false,
- // // 表单新增时是否为查看模式
- // addDetail: false,
- // // 表单编辑时是否禁止
- // editDisabled: false,
- // // 表单编辑时是否可见
- // editDisplay: true,
- // // 表单编辑时是否为查看模式
- // editDetail: false,
- // overHidden: true,
- // width: 150,
- // },
- // {
- // label: "报名状态",
- // search: true,
- // type: "select",
- // searchSpan: 4,
- // prop: "applyStatus",
- // searchValue: 2,
- // dicData: [{
- // label: '全部',
- // value: 0,
- // },
- // {
- // label: '已报名',
- // value: 2,
- // },
- // {
- // label: '已取消',
- // value: 4,
- // }
- // ],
- // props: {
- // label: "label",
- // value: "value"
- // },
- // editDisplay: false,
- // addDisplay: false,
- // width: 100,
- // },
+ {
+ label: "报名状态",
+ prop: "applyStatus",
+ search: true,
+ searchSpan: 4,
+ type: "select",
+ // 表单新增时是否禁止
+ addDisabled: false,
+ // 表单新增时是否可见
+ addDisplay: false,
+ // 表单新增时是否为查看模式
+ addDetail: false,
+ // 表单编辑时是否禁止
+ editDisabled: true,
+ // 表单编辑时是否可见
+ editDisplay: true,
+ // 表单编辑时是否为查看模式
+ editDetail: false,
+ dicData: [
+ {
+ label: "全部",
+ value: 1,
+ },
+ {
+ label: "已报名",
+ value: 2,
+ },
+ {
+ label: "已取消",
+ value: 4,
+ },
+ ],
+ },
],
},
questionBankSearch: {},
@@ -844,24 +813,18 @@
},
watch: {
- "form.examname": {
+ "obj.userId": {
// 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
- );
- }
+ if(val){
+ //查询用户信息
+ getUserDetails(this.userId).then((res)=>{
+ var data = res.data.data;
+ this.obj.cardid = data.cardid;
+ this.obj.age = data.age;
+ this.obj.nativeplace = data.nativeplace;
+ this.obj.phone = data.phone;
+ })
}
},
immediate: true,
@@ -874,17 +837,19 @@
this.examPersission = true;
}
- this.questionBankSearch['applyStatus'] = 2;
+ this.questionBankSearch["applyStatus"] = 2;
},
mounted() {},
computed: {
...mapState({
userInfo: (state) => state.user.userInfo,
}),
+
...mapGetters(["userInfo", "permission"]),
+
permissionList() {
return {
- addBtn: this.vaildData(null, false),
+ addBtn: this.vaildData(this.permission.applyexam_add, false),
viewBtn: this.vaildData(this.permission.applyexam_view, false),
delBtn: this.vaildData(null, false),
editBtn: this.vaildData(null, false),
@@ -896,6 +861,10 @@
ids.push(ele.id);
});
return ids.join(",");
+ },
+ userId() {
+ var d = this.obj.userId + "";
+ return d;
},
},
methods: {
@@ -918,27 +887,46 @@
var roleIds = this.userInfo.role_id.split(",");
roleIds.forEach((roleId) => {
getRoleDetail(roleId).then((res) => {
- var roleAlias = res.data.data.roleAlias;
- if (
- roleAlias == "保安公司管理员" ||
- roleAlias == "保安"
- ) {
- //如果是保安公司管理员
- params["deptId"] = that.userInfo.dept_id;
- }
- 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();
- });
- })
- })
+ var roleAlias = res.data.data.roleAlias;
+ if (roleAlias == "保安公司管理员" || roleAlias == "保安") {
+ //如果是保安公司管理员
+ params["deptId"] = that.userInfo.dept_id;
+ }
+
+ // const { releaseTimeRange } = this.questionBankSearch;
+ const { releaseTimeRange } = this.questionBankQuery;
+
+ var values;
+
+ // console.log(releaseTimeRange, 123);
+ if (releaseTimeRange) {
+ values = {
+ ...params,
+ beginTime: releaseTimeRange[0],
+ overTime: releaseTimeRange[1],
+ ...this.questionBankQuery,
+ };
+ values.releaseTimeRange = null;
+ } else {
+ values = {
+ ...params,
+ ...this.questionBankQuery,
+ };
+ }
+ getApplyList(
+ page.currentPage,
+ page.pageSize,
+ // Object.assign(values, this.questionBankQuery)
+ values
+ ).then((res) => {
+ const data = res.data.data;
+ this.questionBankPage.total = data.total;
+ this.questionBankData = data.records;
+ this.questionBankLoading = false;
+ this.questionBankSelectionClear();
+ });
+ });
+ });
},
questionBankSelectionClear() {
this.questionBankSelectionList = [];
@@ -954,7 +942,9 @@
done();
},
questionBankSearchReset() {
- this.questionBankQuery = {};
+ this.questionBankQuery = {
+ applyStatus:1,
+ };
this.questionBankOnLoad(this.questionBankPage);
},
questionBankCurrentChange(currentPage) {
@@ -967,11 +957,8 @@
// 新增
questionBankRowSave(row, done, loading) {
// debugger;
- addApply({
- userId: row.userId,
- examId: row.examName,
- applyTime: row.applyTime,
- }).then(
+ console.log(row,11111);
+ addApply(row).then(
(res) => {
this.questionBankOnLoad(this.questionBankPage);
if (res.data.data == 201) {
@@ -1011,24 +998,24 @@
var that = this;
row.startTime = row.startTime + ":00";
row.endTime = row.endTime + ":00";
- if(row.number!=((row.serialEnd-row.serialStart)+1)){
- this.$message({
- type: "error",
- message: "考试人数与序号不匹配!",
- });
- done();
- return;
+ if (row.number != row.serialEnd - row.serialStart + 1) {
+ this.$message({
+ type: "error",
+ message: "考试人数与序号不匹配!",
+ });
+ done();
+ return;
}
var s = new Date(row.startTime);
var e = new Date(row.endTime);
- if(s>e){
+ if (s > e) {
this.$message({
- type: "error",
- message: "截止时间不能早于考试考试开始时间!",
- });
- done();
- return;
+ type: "error",
+ message: "截止时间不能早于考试考试开始时间!",
+ });
+ done();
+ return;
}
addExam(Object.assign(row, this.questionBankSearch)).then(
() => {
diff --git a/src/views/companyApply/index.vue b/src/views/companyApply/index.vue
index 6627bc6..4415aec 100644
--- a/src/views/companyApply/index.vue
+++ b/src/views/companyApply/index.vue
@@ -32,6 +32,7 @@
<!-- 自定义按钮 -->
<template slot="menuLeft">
<el-button
+ style="display:none"
type="primary"
size="small"
plain
@@ -153,7 +154,7 @@
index: true,
stripe: true,
viewBtn: false,
- addBtn: false,
+ addBtn: true,
selection: true,
excelBtn: false,
menuWidth: 230,
@@ -241,15 +242,13 @@
// 操作栏多余按钮去除
delBtn: false,
editBtn: false,
- addBtn: false,
+ addBtn: true,
selection: true,
menu: true,
// 导出按钮
// excelBtn: true,
viewBtn: false,
-
- // title: '题库',
-
+ addBtnText:"报名信息新增",
align: "center",
height: "auto",
calcHeight: 80,
@@ -267,12 +266,34 @@
column: [
{
- label: "姓名",
+ label: "保安公司名称",
+ searchLabelWidth: "110",
+ // prop: "deptName",
+ prop: "deptId",
+ type: "tree",
+ hide:true,
+ dicUrl:
+ "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697",
+ props: {
+ label: "title",
+ value: "id",
+ },
+ slot: true,
+ searchSpan: 4,
+ search: false,
+ width: 260,
+ },
+ {
+ label: "保安员",
prop: "realName",
search: true,
searchSpan: 4,
- searchLabelWidth: 50,
- display: false,
+ searchLabelWidth: 100,
+ },
+ {
+ label: "身份证号",
+ prop: "cardid",
+ width:150,
},
{
label: "性别",
@@ -302,36 +323,13 @@
{
label: "籍贯",
prop: "nativeplace",
- display: false,
},
{
label: "联系电话",
prop: "phone",
- display: false,
},
- {
- label: "入职时间",
- prop: "rtime",
- display: false,
- },
- {
- label: "保安公司名称",
- searchLabelWidth: "110",
- // prop: "deptName",
- prop: "deptId",
- type: "tree",
- dicUrl:
- "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697",
- props: {
- label: "title",
- value: "id",
- },
- slot: true,
- searchSpan: 4,
- display: false,
- search: false,
- width: 260,
- },
+
+
{
label: "是否持证",
prop: "hold",
@@ -350,6 +348,21 @@
trigger: "blur",
},
],
+ },
+ {
+ label: "保安公司名称",
+ searchLabelWidth: "110",
+ prop: "deptName",
+ // prop: "deptId",
+ type: "tree",
+ // dicUrl:
+ // "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697",
+ // props: {
+ // label: "title",
+ // value: "id",
+ // },
+ search: false,
+ width: 260,
},
{
label: "在职状态",
@@ -443,7 +456,7 @@
...mapGetters(["userInfo", "permission"]),
permissionList() {
return {
- addBtn: this.vaildData(null, false),
+ addBtn: this.vaildData(this.permission.company_add, false),
viewBtn: this.vaildData(null, false),
delBtn: this.vaildData(null, false),
editBtn: this.vaildData(null, false),
diff --git a/src/views/exam/startexam.vue b/src/views/exam/startexam.vue
index fc874e2..4462384 100644
--- a/src/views/exam/startexam.vue
+++ b/src/views/exam/startexam.vue
@@ -76,7 +76,7 @@
class="start-kaoshi"
v-if="permission.startexam_applyPapers"
@click="startExam(row)"
- >报名清册
+ >报名清册详情
</el-button>
</template>
</avue-crud>
@@ -281,8 +281,8 @@
display: false,
},
{
- label: "备注",
- prop: "remark",
+ label: "报名人数",
+ prop: "num",
span: 24,
slot: true,
// 表单新增时是否禁止
diff --git a/src/views/trainingRegistration/data.js b/src/views/trainingRegistration/data.js
index c05d907..40fa65e 100644
--- a/src/views/trainingRegistration/data.js
+++ b/src/views/trainingRegistration/data.js
@@ -18,7 +18,7 @@
var w = 160,
s = 12;
-export var column = [{
+export var column1 = [{
label: "培训公司名称",
prop: "trainingUnitId",
dicUrl: "/api/blade-system/dept/lazy-tree-type?parentId=1418458374477549569",
@@ -211,4 +211,333 @@
// width: 160
// }
+]
+
+
+export var column = [{
+ label: "报名时间",
+ prop: "releaseTimeRange",
+ type: "date",
+ format: "yyyy-MM-dd",
+ valueFormat: "yyyy-MM-dd",
+ searchRange: true,
+ searchSpan: 5,
+ hide: true,
+ addDisplay: false,
+ editDisplay: false,
+ viewDisplay: false,
+ search: true,
+ rules: [{
+ required: true,
+ message: "请输入时间",
+ trigger: "blur",
+ }, ],
+ },
+ {
+ label: "保安公司名称",
+ searchLabelWidth: "110",
+ labelWidth: 110,
+ cascaderItem: ["userId"],
+ prop: "deptId",
+ type: "tree",
+ hide: true,
+ viewDisabled: false,
+ viewDisplay: false,
+ dicUrl: "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697",
+ props: {
+ label: "title",
+ value: "id",
+ },
+ slot: true,
+ searchSpan: 4,
+ search: false,
+ width: 260,
+ },
+ {
+ label: "保安姓名",
+ prop: "userId",
+ type: "tree",
+ dicUrl: "/api/blade-user/security-apply-tree?examType=1&deptId={{key}}",
+ hide: true,
+ slot: true,
+ searchSpan: 4,
+ // 表单新增时是否禁止
+ addDisabled: false,
+ // 表单新增时是否可见
+ addDisplay: true,
+ // 表单新增时是否为查看模式
+ addDetail: false,
+ // 表单编辑时是否禁止
+ editDisabled: true,
+ viewDisabled: false,
+ // 表单编辑时是否可见
+ editDisplay: true,
+ viewDisplay: false,
+ // 表单编辑时是否为查看模式
+ editDetail: false,
+ props: {
+ label: "name",
+ value: "id",
+ },
+ rules: [{
+ required: true,
+ message: "请选择保安姓名",
+ trigger: "blur",
+ }, ],
+ width: 80,
+ },
+ {
+ label: "保安姓名",
+ prop: "realName",
+ searchSpan: 4,
+ search: true,
+ // 表单新增时是否禁止
+ 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: "age",
+ slot: true,
+ // 表单新增时是否禁止
+ addDisabled: true,
+ // 表单新增时是否可见
+ addDisplay: true,
+ viewDisplay: true,
+ },
+ {
+ label: "身份证号",
+ prop: "idCardNo",
+ slot: true,
+ search: true,
+ searchSpan: 5,
+ // 表单新增时是否禁止
+ addDisabled: false,
+ // 表单新增时是否可见
+ addDisplay: false,
+ // 表单新增时是否为查看模式
+ addDetail: false,
+ // 表单编辑时是否禁止
+ editDisabled: false,
+ // 表单编辑时是否可见
+ editDisplay: true,
+ // 表单编辑时是否为查看模式
+ editDetail: false,
+ rules: [{
+ required: true,
+ message: "请选择准考证号",
+ trigger: "blur",
+ }, ],
+ width: 150,
+ },
+ {
+ label: "身份证号",
+ prop: "cardid",
+ searchSpan: 5,
+ // 表单新增时是否禁止
+ addDisabled: true,
+ // 表单新增时是否可见
+ addDisplay: true,
+ hide: true,
+ rules: [{
+ required: true,
+ message: "请选择准考证号",
+ trigger: "blur",
+ }, ],
+ width: 150,
+ },
+ {
+ label: "性别",
+ prop: "sex",
+ type: "select",
+ // 表单新增时是否禁止
+ addDisabled: true,
+ // 表单新增时是否可见
+ addDisplay: true,
+ dicData: [{
+ label: "男",
+ value: 1,
+ },
+ {
+ label: "女",
+ value: 2,
+ },
+ {
+ label: "未知",
+ value: 3,
+ },
+ {
+ label: " ",
+ value: -1,
+ },
+ ],
+ display: false,
+ },
+
+ {
+ label: "籍贯",
+ prop: "nativePlace",
+ // 表单新增时是否禁止
+ addDisabled: true,
+ // 表单新增时是否可见
+ addDisplay: true,
+ },
+ {
+ label: "联系电话",
+ prop: "phone",
+ // 表单新增时是否禁止
+ addDisabled: true,
+ // 表单新增时是否可见
+ addDisplay: true,
+ },
+ {
+ label: "保安公司名称",
+ labelWidth: "110",
+ addDisplay: false,
+ prop: "deptName",
+ width: 260,
+ },
+ // {
+ // 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: "applyCard",
+ // slot: true,
+ // // 表单新增时是否禁止
+ // addDisabled: false,
+ // // 表单新增时是否可见
+ // addDisplay: false,
+ // // 表单新增时是否为查看模式
+ // addDetail: false,
+ // // 表单编辑时是否禁止
+ // editDisabled: false,
+ // // 表单编辑时是否可见
+ // editDisplay: true,
+ // // 表单编辑时是否为查看模式
+ // editDetail: false,
+ // rules: [
+ // {
+ // required: true,
+ // message: "请选择准考证号",
+ // trigger: "blur",
+ // },
+ // ],
+ // },
+ {
+ label: "报名时间",
+ prop: "applyTime",
+ type: "datetime",
+ // span: 24,
+ format: "yyyy-MM-dd HH:mm:ss",
+ valueFormat: "yyyy-MM-dd HH:mm:ss",
+ // 表单新增时是否禁止
+ addDisabled: true,
+ // 表单新增时是否可见
+ addDisplay: false,
+ // 表单新增时是否为查看模式
+ 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: 150,
+ },
+ {
+ label: "报名状态",
+ prop: "applyStatus",
+ search: true,
+ searchSpan: 4,
+ type: "select",
+ // 表单新增时是否禁止
+ addDisabled: false,
+ // 表单新增时是否可见
+ addDisplay: false,
+ // 表单新增时是否为查看模式
+ addDetail: false,
+ // 表单编辑时是否禁止
+ editDisabled: true,
+ // 表单编辑时是否可见
+ editDisplay: true,
+ // 表单编辑时是否为查看模式
+ editDetail: false,
+ dicData: [{
+ label: "全部",
+ value: 1,
+ },
+ {
+ label: "已报名",
+ value: 2,
+ },
+ {
+ label: "已取消",
+ value: 4,
+ },
+ ],
+ },
]
\ No newline at end of file
diff --git a/src/views/trainingRegistration/index.vue b/src/views/trainingRegistration/index.vue
index 372c962..ddebd9c 100644
--- a/src/views/trainingRegistration/index.vue
+++ b/src/views/trainingRegistration/index.vue
@@ -1,125 +1,178 @@
+/*
+ * @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>
- <basic-container>
- <avue-crud
- :option="option"
- :table-loading="loading"
- :data="data"
- :page.sync="page"
- :search.sync="search"
- ref="crud"
- @row-del="rowDel"
- v-model="form"
- :permission="permissionList"
- @row-update="rowUpdate"
- @row-save="rowSave"
- :before-open="beforeOpen"
- @filter="filterChange"
- @search-change="searchChange"
- @search-reset="searchReset"
- @selection-change="selectionChange"
- @current-change="currentChange"
- @size-change="sizeChange"
- @refresh-change="refreshChange"
- @on-load="onLoad"
- >
- <template slot="menuLeft">
- <el-button
- style="display: none"
- type="danger"
- size="small"
- plain
- icon="el-icon-delete"
- @click="handleDelete"
- >删 除
- </el-button>
- <el-button
- type="primary"
- size="small"
- plain
- icon="el-icon-folder-checked"
- @click="handleBatchExam"
- v-if="permission.trainingRegistration_exam"
- >考试申请
- </el-button>
- <el-button
- type="primary"
- size="small"
- plain
- icon="el-icon-folder-checked"
- v-if="permission.trainingRegistration_import"
- @click="handleImport"
- >批量导入
- </el-button>
- </template>
- <template slot-scope="{ type, size, row }" slot="menu">
- <el-button
- icon="el-icon-refresh-right"
- @click="revoke(row)"
- :size="size"
- :type="type"
- v-if="permission.trainingRegistration_cancel"
- :disabled="row.cancel==2"
- >取消报名</el-button
- >
- <el-button
- :type="type"
- size="small"
- icon="el-icon-receiving"
- v-if="permission.trainingRegistration_print"
- :disabled="row.candidateNo == '' || row.cancel==2"
- @click="handlePrint(row)"
- >准考证打印
- </el-button>
- <el-button
- icon="el-icon-folder-checked"
- style="display: none"
- @click="affirmApply(row)"
- :size="size"
- :type="type"
- >确认报名</el-button
- >
- </template>
- </avue-crud>
+ <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="danger"
+ size="mini"
+ icon="el-icon-delete"
+ plain
+ @click="handleDelete">新增
+ </el-button>
+ <el-button type="danger"
+ size="mini"
+ icon="el-icon-delete"
+ plain
+ @click="handleDelete">删除
+ </el-button>
+ <el-button type="danger"
+ size="mini"
+ icon="el-icon-delete"
+ plain
+ @click="handleDelete">导出
+ </el-button>
+ </template> -->
- <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>
+ <!-- <template slot="menuLeft">
+ <el-button type="danger"
+ size="small"
+ icon="el-icon-delete"
+ @click="questionBankHandleDelete">删 除
+ </el-button>
+ </template> -->
+ <!-- 自定义按钮 -->
+ <template slot="menuLeft">
+ <el-button
+ type="primary"
+ style="display:none"
+ size="small"
+ plain
+ icon="el-icon-folder-checked"
+ @click="handleBatchExam"
+ v-if="permission.applyexam_exam"
+ >生成考试
+ </el-button>
+ <!-- v-if="examPersission" -->
+ <el-button
+ style="display:none"
+ type="primary"
+ size="small"
+ plain
+ icon="el-icon-folder-checked"
+ v-if="permission.applyexam_import"
+ @click="handleImport"
+ >批量报名
+ </el-button>
+ </template>
- <el-dialog
- title="考试申请"
- append-to-body
- :visible.sync="dialogExamFormVisible"
- width="1000px"
- @close="closeDialog"
- >
- <avue-form
- ref="formExamApply"
- v-model="examApply"
- :option="optionExamApply"
- @reset-change="emptytChange"
- @submit="submitExamApply"
- ></avue-form>
- </el-dialog>
- </basic-container>
+ <template slot-scope="{ type, row }" slot="menu">
+ <el-button
+ :type="type"
+ size="small"
+ icon="el-icon-refresh-left"
+ v-if="permission.applyexam_cancel"
+ :disabled="row.cancel == 2"
+ @click="handleCancel(row)"
+ >取消报名
+ </el-button>
+ <el-button
+ style="display: none"
+ :type="type"
+ size="small"
+ icon="el-icon-folder-checked"
+ :disabled="row.cancel == 2"
+ @click="handleAudit(row)"
+ >审核
+ </el-button>
+ <el-button
+ :type="type"
+ size="small"
+ icon="el-icon-receiving"
+ v-if="permission.applyexam_print && row.candidateNo != ''"
+ @click="handlePrint(row)"
+ >准考证打印
+ </el-button>
+ </template>
+
+ <template slot-scope="{ row }" slot="age">
+ {{ row.age == -1 ? "" : row.age }}
+ </template>
+ </avue-crud>
+
+ <el-dialog
+ title="考试资格审核"
+ :visible.sync="dialogFormVisible"
+ modal-append-to-body="false"
+ append-to-body="true"
+ :close-on-click-model="true"
+ >
+ <avue-form
+ ref="formAudit"
+ v-model="Audit"
+ :option="optionAudit"
+ @reset-change="emptytChange"
+ @submit="submit"
+ ></avue-form>
+ </el-dialog>
+
+ <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>
+
+ <el-dialog
+ title="考试生成"
+ append-to-body
+ :visible.sync="dialogExamFormVisible"
+ width="900px"
+ @close="closeDialog"
+ >
+ <avue-form
+ ref="formExamApply"
+ v-model="examApply"
+ :option="optionExamApply"
+ @reset-change="emptytChange"
+ @submit="submitExamApply"
+ ></avue-form>
+ </el-dialog>
+ </div>
+ </el-card>
+ </el-col>
+ </el-row>
</template>
<script>
-import { column } from "./data";
import {
getdata,
adddata,
@@ -128,15 +181,102 @@
cancelTrain,
addExam,
} from "@/api/trainingRegistration/trainingRegistration";
+import { mapState } from "vuex";
import { mapGetters } from "vuex";
import { getRoleDetail } from "@/api/system/role";
+import { getUserDetails } from "@/api/experience/experience"
+
export default {
data() {
return {
- loading: true,
- excelBox: false,
+ obj:{
+ userId:''
+ },
+ dialogFormVisible: false,
dialogExamFormVisible: false,
- search:{},
+ examPersission: false,
+ applyExport: false,
+ excelBox: false,
+ Audit: {},
+ 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/apply/import-apply",
+ },
+ {
+ label: "模板下载",
+ prop: "excelTemplate",
+ formslot: true,
+ span: 24,
+ },
+ ],
+ },
+ optionAudit: {
+ height: "auto",
+ calcHeight: 30,
+ dialogWidth: 1000,
+ tip: false,
+ searchShow: true,
+ searchMenuSpan: 6,
+ border: true, //liu
+ index: true,
+ stripe: true,
+ viewBtn: true,
+ addBtn: true,
+ selection: true,
+ excelBtn: false,
+ menuWidth: 230,
+ dialogClickModal: false,
+ column: [
+ {
+ label: "审核状态",
+ search: true,
+ searchSpan: 5,
+ span: 24,
+ prop: "auditStatus",
+ slot: true,
+ editDisplay: false,
+ addDisplay: false,
+ type: "select",
+ rules: [
+ {
+ required: true,
+ message: "请选择审核类型",
+ trigger: "blur",
+ },
+ ],
+ dicData: [
+ {
+ label: "审核通过",
+ value: 2,
+ },
+ {
+ label: "不通过",
+ value: 3,
+ },
+ ],
+ },
+ {
+ label: "审核明细",
+ span: 24,
+ type: "textarea",
+ prop: "auditDetail",
+ },
+ ],
+ },
optionExamApply: {
height: "auto",
filterBtn: true,
@@ -149,7 +289,7 @@
index: true,
stripe: true,
viewBtn: true,
- selection: false,
+ selection: true,
excelBtn: false,
menuWidth: 380,
dialogClickModal: false,
@@ -157,15 +297,15 @@
{
label: "考试人数",
prop: "number",
- type: 'number',
+ type: "number",
span: 12,
- precision:0,
- step:50,
- mock:{
- type:'number',
- max:1000,
- min:0,
- precision:0
+ precision: 0,
+ step: 50,
+ mock: {
+ type: "number",
+ max: 1000,
+ min: 0,
+ precision: 0,
},
rules: [
{
@@ -176,22 +316,22 @@
],
minRows: 0,
maxRows: 1000,
- value:50,
+ value: 50,
},
{
label: "序号开始",
prop: "serialStart",
span: 6,
- value:1,
- mock:{
- type:'number',
- max:1000,
- min:1,
- precision:0
+ value: 1,
+ mock: {
+ type: "number",
+ max: 1000,
+ min: 1,
+ precision: 0,
},
minRows: 1,
maxRows: 1000,
- type:"number",
+ type: "number",
rules: [
{
required: true,
@@ -204,16 +344,16 @@
label: "序号结束",
prop: "serialEnd",
span: 6,
- value:50,
- mock:{
- type:'number',
- max:1000,
- min:1,
- precision:0
+ value: 50,
+ mock: {
+ type: "number",
+ max: 1000,
+ min: 1,
+ precision: 0,
},
minRows: 1,
maxRows: 1000,
- type:"number",
+ type: "number",
rules: [
{
required: true,
@@ -278,80 +418,489 @@
},
],
},
- excelForm: {},
- excelOption: {
- submitBtn: false,
- emptyBtn: false,
+ questionBankOption: {
+ // 操作栏多余按钮去除
+ delBtn: false,
+ editBtn: false,
+ addBtn: true,
+ addBtnText: "报名新增",
+ selection: false,
+ menu: true,
+ // 导出按钮
+ // excelBtn: true,
+ viewBtn: true,
+
+ // title: '题库',
+
+ align: "center",
+ height: "auto",
+ calcHeight: 80,
+ tip: false,
+ searchShow: true,
+ searchMenuSpan: 4,
+ index: true,
+ indexLabel: "#",
+ //dialogType: 'drawer',
+ dialogClickModal: false,
+ //tree 默认展开
+ defaultExpandAll: true,
+ // 操作栏宽度
+ menuWidth: 250,
column: [
{
- label: "模板上传",
- prop: "excelFile",
- type: "upload",
- drag: true,
- loadText: "模板上传中,请稍等",
- span: 24,
- propsHttp: {
- res: "data",
- },
- tip: "请上传 .xls,.xlsx 标准格式文件",
- action: "/api/trainingRegistration/import-trainingRegistration",
+ label: "报名时间",
+ prop: "releaseTimeRange",
+ type: "date",
+ format: "yyyy-MM-dd",
+ valueFormat: "yyyy-MM-dd",
+ searchRange: true,
+ searchSpan: 5,
+ hide: true,
+ addDisplay: false,
+ editDisplay: false,
+ viewDisplay: false,
+ search: true,
+ rules: [
+ {
+ required: true,
+ message: "请输入时间",
+ trigger: "blur",
+ },
+ ],
},
{
- label: "模板下载",
- prop: "excelTemplate",
- formslot: true,
- span: 24,
+ label: "保安单位名称",
+ searchLabelWidth: "110",
+ labelWidth: 110,
+ cascaderItem: ["userId"],
+ prop: "deptId",
+ type: "tree",
+ hide: true,
+ viewDisabled:false,
+ viewDisplay:false,
+ dicUrl:
+ "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697",
+ props: {
+ label: "title",
+ value: "id",
+ },
+ slot: true,
+ searchSpan: 4,
+ search: false,
+ width: 260,
+ rules: [
+ {
+ required: true,
+ message: "保安单位",
+ trigger: "blur",
+ },
+ ],
+ },
+ {
+ label: "保安姓名",
+ prop: "userId",
+ type: "tree",
+ dicUrl:
+ "/api/blade-user/security-apply-tree?examType=2&deptId={{key}}",
+ hide: true,
+ slot: true,
+ searchSpan: 4,
+ // 表单新增时是否禁止
+ addDisabled: false,
+ // 表单新增时是否可见
+ addDisplay: true,
+ // 表单新增时是否为查看模式
+ addDetail: false,
+ // 表单编辑时是否禁止
+ editDisabled: true,
+ viewDisabled: false,
+ // 表单编辑时是否可见
+ editDisplay: true,
+ viewDisplay: false,
+ // 表单编辑时是否为查看模式
+ editDetail: false,
+ props: {
+ label: "name",
+ value: "id",
+ },
+ rules: [
+ {
+ required: true,
+ message: "请选择保安姓名",
+ trigger: "blur",
+ },
+ ],
+ width: 80,
+ },
+ {
+ label: "培训机构名称",
+ prop: "trainingUnitId",
+ type: "select",
+ labelWidth:110,
+ dicUrl:
+ "/api/information/train-unit-tree",
+ hide: true,
+ slot: true,
+ searchSpan: 4,
+ // 表单新增时是否禁止
+ addDisabled: false,
+ // 表单新增时是否可见
+ addDisplay: true,
+ // 表单新增时是否为查看模式
+ addDetail: false,
+ // 表单编辑时是否禁止
+ editDisabled: true,
+ viewDisabled: false,
+ // 表单编辑时是否可见
+ editDisplay: true,
+ viewDisplay: false,
+ // 表单编辑时是否为查看模式
+ editDetail: false,
+ props: {
+ label: "deptName",
+ value: "departmentid",
+ },
+ rules: [
+ {
+ required: true,
+ message: "请选择保安姓名",
+ trigger: "blur",
+ },
+ ],
+ width: 80,
+ },
+ {
+ label: "保安姓名",
+ prop: "realName",
+ searchSpan: 4,
+ search: true,
+ // 表单新增时是否禁止
+ 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: "age",
+ slot: true,
+ // 表单新增时是否禁止
+ addDisabled: true,
+ // 表单新增时是否可见
+ addDisplay: true,
+ viewDisplay: true,
+ },
+ {
+ label: "身份证号",
+ prop: "idCardNo",
+ slot: true,
+ search: true,
+ searchSpan: 5,
+ // 表单新增时是否禁止
+ addDisabled: false,
+ // 表单新增时是否可见
+ addDisplay: false,
+ // 表单新增时是否为查看模式
+ addDetail: false,
+ // 表单编辑时是否禁止
+ editDisabled: false,
+ // 表单编辑时是否可见
+ editDisplay: true,
+ // 表单编辑时是否为查看模式
+ editDetail: false,
+ rules: [
+ {
+ required: true,
+ message: "请选择准考证号",
+ trigger: "blur",
+ },
+ ],
+ width: 150,
+ },
+ {
+ label: "身份证号",
+ prop: "cardid",
+ searchSpan: 5,
+ // 表单新增时是否禁止
+ addDisabled: true,
+ // 表单新增时是否可见
+ addDisplay: true,
+ hide:true,
+ rules: [
+ {
+ required: true,
+ message: "请选择准考证号",
+ trigger: "blur",
+ },
+ ],
+ width: 150,
+ },
+ {
+ label: "性别",
+ prop: "sex",
+ type: "select",
+ // 表单新增时是否禁止
+ addDisabled: true,
+ // 表单新增时是否可见
+ addDisplay: true,
+ dicData: [
+ {
+ label: "男",
+ value: 1,
+ },
+ {
+ label: "女",
+ value: 2,
+ },
+ {
+ label: "未知",
+ value: 3,
+ },
+ {
+ label: " ",
+ value: -1,
+ },
+ ],
+ display: false,
+ },
+
+ {
+ label: "籍贯",
+ prop: "nativePlace",
+ // 表单新增时是否禁止
+ addDisabled: true,
+ // 表单新增时是否可见
+ addDisplay: true,
+ },
+ {
+ label: "联系电话",
+ prop: "phone",
+ // 表单新增时是否禁止
+ addDisabled: true,
+ // 表单新增时是否可见
+ addDisplay: true,
+ },
+ {
+ label: "所属保安单位",
+ labelWidth: "110",
+ addDisplay: false,
+ prop: "deptName",
+ width: 260,
+ },
+ // {
+ // 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: "applyCard",
+ // slot: true,
+ // // 表单新增时是否禁止
+ // addDisabled: false,
+ // // 表单新增时是否可见
+ // addDisplay: false,
+ // // 表单新增时是否为查看模式
+ // addDetail: false,
+ // // 表单编辑时是否禁止
+ // editDisabled: false,
+ // // 表单编辑时是否可见
+ // editDisplay: true,
+ // // 表单编辑时是否为查看模式
+ // editDetail: false,
+ // rules: [
+ // {
+ // required: true,
+ // message: "请选择准考证号",
+ // trigger: "blur",
+ // },
+ // ],
+ // },
+ {
+ label: "报名时间",
+ prop: "trainingTime",
+ type: "datetime",
+ // span: 24,
+ format: "yyyy-MM-dd HH:mm:ss",
+ valueFormat: "yyyy-MM-dd HH:mm:ss",
+ // 表单新增时是否禁止
+ addDisabled: true,
+ // 表单新增时是否可见
+ addDisplay: false,
+ // 表单新增时是否为查看模式
+ 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: 150,
+ },
+ {
+ label: "报名状态",
+ prop: "cancel",
+ search: true,
+ searchSpan: 4,
+ type: "select",
+ // 表单新增时是否禁止
+ addDisabled: false,
+ // 表单新增时是否可见
+ addDisplay: false,
+ // 表单新增时是否为查看模式
+ addDetail: false,
+ // 表单编辑时是否禁止
+ editDisabled: true,
+ // 表单编辑时是否可见
+ editDisplay: true,
+ // 表单编辑时是否为查看模式
+ editDetail: false,
+ dicData: [
+ {
+ label: "全部",
+ value: 11,
+ },
+ {
+ label: "已报名",
+ value: 1,
+ },
+ {
+ label: "已取消",
+ value: 2,
+ },
+ ],
},
],
},
- selectionList: [],
- page: {
+ questionBankSearch: {},
+ questionBankLoading: true,
+ questionBankData: [],
+ questionBankPage: {
pageSize: 10,
currentPage: 1,
- total: 0,
+ total: 16,
},
- query: {},
- data: [],
- option: {
- // card: true,
- tip: false,
- // searchSize: "mini",
- searchMenuSpan: 6,
- height: 583,
- index: true,
- labelWidth: "120",
- menuWidth: 200,
- align: "center",
- selection: false,
- column: column,
- delBtn: false,
- editBtn: false,
- addBtn: false,
- },
+ questionBankQuery: {},
+ questionBankSelectionList: [],
};
},
+
+ watch: {
+ "obj.userId": {
+ // form是表单或者表格绑定的数据集,v-model='form'
+ handler(val) {
+ if(val){
+ //查询用户信息
+ getUserDetails(this.userId).then((res)=>{
+ var data = res.data.data;
+ this.obj.cardid = data.cardid;
+ this.obj.age = data.age;
+ this.obj.nativeplace = data.nativeplace;
+ this.obj.phone = data.phone;
+ })
+ }
+ },
+ immediate: true,
+ },
+ },
+ created() {
+ console.log(this.userInfo);
+
+ if (this.userInfo.role_name.indexOf("ksxtadmin") != -1) {
+ this.examPersission = true;
+ }
+
+ this.questionBankSearch["cancel"] = 1;
+ },
+ mounted() {},
computed: {
+ ...mapState({
+ userInfo: (state) => state.user.userInfo,
+ }),
+
+ ...mapGetters(["userInfo", "permission"]),
+
+ permissionList() {
+ return {
+ addBtn: this.vaildData(this.permission.applyexam_add, false),
+ viewBtn: this.vaildData(this.permission.applyexam_view, false),
+ delBtn: this.vaildData(null, false),
+ editBtn: this.vaildData(null, false),
+ };
+ },
ids() {
let ids = [];
- this.selectionList.forEach((ele) => {
+ this.questionBankSelectionList.forEach((ele) => {
ids.push(ele.id);
});
return ids.join(",");
},
- ...mapGetters(["userInfo", "permission"]),
- permissionList() {
- return {
- addBtn: this.vaildData(this.permission.notice_add, false),
- viewBtn: this.vaildData(this.permission.notice_view, false),
- delBtn: this.vaildData(this.permission.notice_delete, false),
- editBtn: this.vaildData(this.permission.notice_edit, false),
- };
+ userId() {
+ var d = this.obj.userId + "";
+ return d;
},
-
- },
- created(){
- this.search['cancel'] = 1;
- this.search['auditStatus'] = 4;
},
methods: {
//准考证查看
@@ -363,19 +912,90 @@
query: obj,
});
},
- sizeChange(val) {
- this.page.pageSize = val;
- this.getData();
- },
- currentChange(val) {
- this.page.currentPage = val;
- this.getData();
- },
- rowSave(form, done, loading) {
+ questionBankOnLoad(page, params = {}) {
+ params = this.questionBankSearch;
+ this.questionBankLoading = false;
+ this.loading = true;
+ //判断角色,如果是保安公司管理员或保安,只能查看当前公司的报名信息
var that = this;
- adddata(form).then(
+ //获取当前登录人员的角色信息
+ var roleIds = this.userInfo.role_id.split(",");
+ roleIds.forEach((roleId) => {
+ getRoleDetail(roleId).then((res) => {
+ var roleAlias = res.data.data.roleAlias;
+ if (roleAlias == "保安公司管理员" || roleAlias == "保安") {
+ //如果是保安公司管理员
+ params["deptId"] = that.userInfo.dept_id;
+ }
+
+ // const { releaseTimeRange } = this.questionBankSearch;
+ const { releaseTimeRange } = this.questionBankQuery;
+
+ var values;
+
+ // console.log(releaseTimeRange, 123);
+ if (releaseTimeRange) {
+ values = {
+ ...params,
+ beginTime: releaseTimeRange[0],
+ overTime: releaseTimeRange[1],
+ ...this.questionBankQuery,
+ };
+ values.releaseTimeRange = null;
+ } else {
+ values = {
+ ...params,
+ ...this.questionBankQuery,
+ };
+ }
+ getdata(
+ page.currentPage,
+ page.pageSize,
+ // Object.assign(values, this.questionBankQuery)
+ values
+ ).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 = {
+ cancel:11,
+ };
+ this.questionBankOnLoad(this.questionBankPage);
+ },
+ questionBankCurrentChange(currentPage) {
+ this.questionBankPage.currentPage = currentPage;
+ },
+ questionBankSizeChange(pageSize) {
+ this.questionBankPage.pageSize = pageSize;
+ },
+
+ // 新增
+ questionBankRowSave(row, done, loading) {
+ // debugger;
+ console.log(row,11111);
+ adddata(row).then(
(res) => {
- this.onLoad(this.page);
+ this.questionBankOnLoad(this.questionBankPage);
if (res.data.data == 201) {
this.$message({
type: "warning",
@@ -400,180 +1020,11 @@
}
);
},
- searchChange(params, done) {
- this.query = params;
- this.page.currentPage = 1;
- this.onLoad(this.page, params);
- done();
- },
- searchReset() {
- this.query = {};
- this.onLoad(this.page);
- },
- rowUpdate(row, index, done, loading) {
- update(row).then(
- () => {
- this.onLoad(this.page);
- this.$message({
- type: "success",
- message: "操作成功!",
- });
- done();
- },
- (error) => {
- window.console.log(error);
- loading();
- }
- );
- },
- //确认报名
- affirmApply(row, done, loading) {
- this.$confirm("确认报名?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- }).then(() => {
- row.cancel = 3;
- update(row).then(
- () => {
- this.onLoad(this.page);
- this.$message({
- type: "success",
- message: "确认报名成功!",
- });
- done();
- },
- (error) => {
- window.console.log(error);
- loading();
- }
- );
- });
- },
- revoke(row, done, loading) {
- this.$confirm("确定取消报名?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- }).then(() => {
- row.cancel = 2;
- cancelTrain(row).then(
- () => {
- this.onLoad(this.page);
- this.$message({
- type: "success",
- message: "取消报名成功!",
- });
- done();
- },
- (error) => {
- window.console.log(error);
- loading();
- }
- );
- });
- },
- rowDel(row) {
- this.$confirm("确定将选择数据删除?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(() => {
- return remove(row.id);
- })
- .then(() => {
- this.onLoad(this.page);
- this.$message({
- type: "success",
- message: "操作成功!",
- });
- });
- },
- selectionChange(list) {
- this.selectionList = list;
- },
- handleDelete() {
- if (this.selectionList.length === 0) {
- this.$message.warning("请选择至少一条数据");
- return;
- }
- this.$confirm("确定将选择数据删除?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(() => {
- return remove(this.ids);
- })
- .then(() => {
- this.onLoad(this.page);
- this.$message({
- type: "success",
- message: "操作成功!",
- });
- this.$refs.crudrec.toggleSelection();
- });
- },
- refreshChange() {
- this.onLoad(this.page, this.query);
- },
- onLoad(page, params = {}) {
- this.loading = true;
- //判断角色,如果是保安公司管理员或保安,只能查看当前公司的考试成绩
- var that = this;
- //获取当前登录人员的角色信息
- var roleIds = this.userInfo.role_id.split(",");
- params = this.search;
- roleIds.forEach((roleId) => {
- getRoleDetail(roleId).then((res) => {
- var roleAlias = res.data.data.roleAlias;
- if (
- roleAlias == "保安公司管理员" ||
- roleAlias == "保安"
- ) {
- //如果是保安公司管理员
- params["deptId"] = that.userInfo.dept_id;
- }
- if (
- roleAlias == "培训公司管理员"
- ) {
- //如果是培训公司管理员
- params["trainingUnitId"] = that.userInfo.dept_id;
- }
- getdata(
- page.currentPage,
- page.pageSize,
- Object.assign(params, this.query)
- ).then((res) => {
- // console.log(res);
- const data = res.data.data;
- this.page.total = data.total;
- this.data = data.records;
- console.log(this.data);
- this.loading = false;
- });
- })
- })
- },
- handleImport() {
- this.excelBox = true;
- },
-
- handleTemplate() {
- window.open(`/api/trainingRegistration/export-template`);
- },
- uploadAfter(res, done, loading, column) {
- window.console.log(column);
- this.excelBox = false;
- this.refreshChange();
- done();
- },
//生成考试弹窗
handleBatchExam() {
this.dialogExamFormVisible = true;
- if (this.selectionList.length === 0) {
+ if (this.questionBankSelectionList.length === 0) {
this.ids = "";
}
},
@@ -582,35 +1033,34 @@
var that = this;
row.startTime = row.startTime + ":00";
row.endTime = row.endTime + ":00";
- if(row.number!=((row.serialEnd-row.serialStart)+1)){
- this.$message({
- type: "error",
- message: "考试人数与序号不匹配!",
- });
- done();
- return;
+ if (row.number != row.serialEnd - row.serialStart + 1) {
+ this.$message({
+ type: "error",
+ message: "考试人数与序号不匹配!",
+ });
+ done();
+ return;
}
var s = new Date(row.startTime);
var e = new Date(row.endTime);
- if(s>e){
+ if (s > e) {
this.$message({
- type: "error",
- message: "截止时间不能早于考试考试开始时间!",
- });
- done();
- return;
+ type: "error",
+ message: "截止时间不能早于考试考试开始时间!",
+ });
+ done();
+ return;
}
-
- addExam(Object.assign(row, this.search)).then(
+ addExam(Object.assign(row, this.questionBankSearch)).then(
() => {
- this.onLoad(this.page);
- that.$refs.formExamApply.resetFields();
- that.dialogExamFormVisible = false;
+ this.questionBankOnLoad(this.questionBankPage);
this.$message({
type: "success",
- message: "操作成功",
+ message: "操作成功!",
});
+ that.$refs.formExamApply.resetFields();
+ that.dialogExamFormVisible = false;
done();
},
(error) => {
@@ -623,9 +1073,93 @@
closeDialog() {
this.$refs.formExamApply.resetFields();
},
+
+ questionBankRowDel(row) {
+ this.$confirm("确定将选择数据删除?", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ })
+ .then(() => {
+ return remove(row.id);
+ })
+ .then(() => {
+ this.questionBankOnLoad(this.questionBankPage);
+ this.$message({
+ type: "success",
+ message: "操作成功!",
+ });
+ });
+ },
+
+ //取消报名
+ handleCancel(row) {
+ this.$confirm("确定取消报名?", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ })
+ .then(() => {
+ row.cancel = 2;
+ row['isExam'] = 1;
+ return cancelTrain(row);
+ })
+ .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();
+ });
+ },
+ handleAudit(row) {
+ this.dialogFormVisible = true;
+ this.Audit = row;
+ },
+
+ handleImport() {
+ this.excelBox = true;
+ },
+
+ handleTemplate() {
+ window.open(`/api/apply/export-template`);
+ },
+ uploadAfter(res, done, loading, column) {
+ window.console.log(column);
+ this.excelBox = false;
+ this.refreshChange();
+ done();
+ },
+
+ refreshChange() {
+ this.questionBankOnLoad(this.page, this.query);
+ },
},
};
</script>
-<style>
+<style lang="scss" scoped>
</style>
--
Gitblit v1.9.3