From 8e2a42e4a2da78f9cda9fa3e7732a0ef72f0c906 Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Fri, 12 Nov 2021 09:29:02 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.105:10010/r/zhba_enterprises
---
src/views/trainingRegistration/index.vue | 308 +++++++++++++++++++++++++++++---------------------
1 files changed, 178 insertions(+), 130 deletions(-)
diff --git a/src/views/trainingRegistration/index.vue b/src/views/trainingRegistration/index.vue
index 6e0b2c5..b288021 100644
--- a/src/views/trainingRegistration/index.vue
+++ b/src/views/trainingRegistration/index.vue
@@ -58,7 +58,7 @@
:size="size"
:type="type"
v-if="permission.trainingRegistration_cancel"
- :disabled="row.cancel==2"
+ :disabled="row.cancel == 2"
>取消报名</el-button
>
<el-button
@@ -66,7 +66,7 @@
size="small"
icon="el-icon-receiving"
v-if="permission.trainingRegistration_print"
- :disabled="row.candidateNo == '' || row.cancel==2"
+ :disabled="row.candidateNo == '' || row.cancel == 2"
@click="handlePrint(row)"
>准考证打印
</el-button>
@@ -133,10 +133,14 @@
export default {
data() {
return {
+ choiceName: [],
loading: true,
excelBox: false,
dialogExamFormVisible: false,
- search:{},
+ search: {},
+ examApply: {
+ number: 0,
+ },
optionExamApply: {
height: "auto",
filterBtn: true,
@@ -155,75 +159,59 @@
dialogClickModal: false,
column: [
{
- label: "考试人数",
+ label: "所选保安人数",
prop: "number",
- type: 'number',
- span: 12,
- precision:0,
- step:50,
- mock:{
- type:'number',
- max:1000,
- min:0,
- precision:0
- },
- rules: [
- {
- required: true,
- message: "请输入考试人数",
- trigger: "blur",
- },
- ],
- minRows: 0,
- maxRows: 1000,
- value:50,
+ span: 24,
+ value: 0,
+ disabled: true,
+ labelWidth: 110,
},
+ // {
+ // label: "序号开始",
+ // prop: "serialStart",
+ // span: 12,
+ // value: 1,
+ // mock: {
+ // type: "number",
+ // max: 1000,
+ // min: 1,
+ // precision: 0,
+ // },
+ // minRows: 1,
+ // maxRows: 1000,
+ // type: "number",
+ // rules: [
+ // {
+ // required: true,
+ // message: "请输入序号",
+ // trigger: "blur",
+ // },
+ // ],
+ // },
+ // {
+ // label: "序号结束",
+ // prop: "serialEnd",
+ // span: 12,
+ // value: 50,
+ // mock: {
+ // type: "number",
+ // max: 1000,
+ // min: 1,
+ // precision: 0,
+ // },
+ // minRows: 1,
+ // maxRows: 1000,
+ // type: "number",
+ // rules: [
+ // {
+ // required: true,
+ // message: "请输入序号",
+ // trigger: "blur",
+ // },
+ // ],
+ // },
{
- label: "序号开始",
- prop: "serialStart",
- span: 6,
- value:1,
- mock:{
- type:'number',
- max:1000,
- min:1,
- precision:0
- },
- minRows: 1,
- maxRows: 1000,
- type:"number",
- rules: [
- {
- required: true,
- message: "请输入序号",
- trigger: "blur",
- },
- ],
- },
- {
- label: "序号结束",
- prop: "serialEnd",
- span: 6,
- value:50,
- mock:{
- type:'number',
- max:1000,
- min:1,
- precision:0
- },
- minRows: 1,
- maxRows: 1000,
- type:"number",
- rules: [
- {
- required: true,
- message: "请输入序号",
- trigger: "blur",
- },
- ],
- },
- {
- label: "考试时间",
+ label: "考试开始时间",
prop: "startTime",
type: "datetime",
format: "yyyy-MM-dd HH:mm",
@@ -248,9 +236,10 @@
},
],
span: 12,
+ labelWidth: 110,
},
{
- label: "截止时间",
+ label: "考试开始截止时间",
prop: "endTime",
type: "datetime",
format: "yyyy-MM-dd HH:mm",
@@ -275,6 +264,7 @@
},
],
span: 12,
+ labelWidth: 140,
},
],
},
@@ -314,15 +304,24 @@
data: [],
option: {
// card: true,
- tip: false,
+ // tip: false,
// searchSize: "mini",
searchMenuSpan: 6,
- height: 583,
- index: true,
+ height: 563,
+ index: false,
+ selectable: (row, index) => {
+ console.log(row, index);
+ if (row.auditStatus == 4 && row.cancel == 1) {
+ return true;
+ } else {
+ return false;
+ }
+ },
labelWidth: "120",
menuWidth: 200,
align: "center",
- selection: false,
+ reserveSelection: true,
+ selection: true,
column: column,
delBtn: false,
editBtn: false,
@@ -347,11 +346,21 @@
editBtn: this.vaildData(this.permission.notice_edit, false),
};
},
-
},
- created(){
- this.search['cancel'] = 1;
- this.search['auditStatus'] = 4;
+ created() {
+ this.search["cancel"] = 1;
+ this.search["auditStatus"] = 4;
+ },
+ mounted() {
+ // if (window.name == "baoming") {
+ // let old = JSON.parse(window.localStorage.getItem("baoming"));
+ // this.choiceName = old;
+ // console.log(old);
+ // console.log("刷新");
+ // } else {
+ // window.name = "baoming";
+ // console.log("不刷新");
+ // }
},
methods: {
//准考证查看
@@ -365,11 +374,11 @@
},
sizeChange(val) {
this.page.pageSize = val;
- this.getData();
+ // this.getData();
},
currentChange(val) {
this.page.currentPage = val;
- this.getData();
+ // this.getData();
},
rowSave(form, done, loading) {
var that = this;
@@ -491,7 +500,18 @@
});
},
selectionChange(list) {
- this.selectionList = list;
+ // this.selectionList = list;
+ this.choiceName = [];
+ // console.log(window.name);
+ for (let k in list) {
+ this.choiceName.push({
+ label: list[k].realName,
+ value: list[k].id,
+ });
+ }
+
+ // window.localStorage.setItem("baoming", JSON.stringify(this.choiceName));
+ // console.log(this.choiceName);
},
handleDelete() {
if (this.selectionList.length === 0) {
@@ -527,34 +547,30 @@
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;
- });
- })
- })
+ var roleAlias = res.data.data.roleAlias;
+ if (roleAlias == "保安公司管理员" || roleAlias == "保安") {
+ //如果是保安公司管理员
+ params["deptId"] = that.userInfo.dept_id;
+ }
+ if (roleAlias == "培训公司管理员") {
+ //如果是培训公司管理员
+ params["trainingUnitId"] = that.userInfo.dept_id;
+ }
+ params["isExam"] = 1;
+ 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;
@@ -572,37 +588,68 @@
//生成考试弹窗
handleBatchExam() {
- this.dialogExamFormVisible = true;
- if (this.selectionList.length === 0) {
- this.ids = "";
+ if (this.choiceName.length == 0) {
+ this.$message({
+ message: "未选择保安员",
+ type: "warning",
+ });
+ return;
}
+ this.dialogExamFormVisible = true;
+ this.examApply.number = this.choiceName.length;
+
+ // if (this.selectionList.length === 0) {
+ // this.ids = "";
+ // }
},
//生成考试
submitExamApply(row, done, loading) {
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) {
+ // this.$message({
+ // type: "error",
+ // message: "考试开始截止时间不能早于考试考试开始时间!",
+ // });
+ // done();
+ // return;
+ // }
+
+ if (that.userInfo.role_name == "培训公司管理员") {
+ //如果是培训公司管理员
+ row["trainingUnitId"] = that.userInfo.dept_id;
}
- var s = new Date(row.startTime);
- var e = new Date(row.endTime);
- if(s>e){
- this.$message({
- type: "error",
- message: "截止时间不能早于考试考试开始时间!",
- });
- done();
- return;
+ // row["number"] = row.serialEnd - row.serialStart + 1;
+ // //创建人
+ row["creator"] = this.userInfo.Id;
+ let cho = this.choiceName;
+ let str = "";
+ for (let k in cho) {
+ str += cho[k].value;
+ if (k != cho.length - 1) {
+ str += ",";
+ }
}
-
- addExam(Object.assign(row, this.search)).then(
+ row["ids"] = str;
+ //提交申请
+ let overData = Object.assign(row);
+ console.log(overData, "overData");
+ // done();
+ // return;
+ addExam(overData).then(
() => {
this.onLoad(this.page);
that.$refs.formExamApply.resetFields();
@@ -611,6 +658,7 @@
type: "success",
message: "操作成功",
});
+ this.$refs.crud.toggleSelection();
done();
},
(error) => {
--
Gitblit v1.9.3