| | |
| | | :table-loading="loading" |
| | | :data="data" |
| | | :page.sync="page" |
| | | :search.sync="search" |
| | | ref="crud" |
| | | @row-del="rowDel" |
| | | v-model="form" |
| | |
| | | :size="size" |
| | | :type="type" |
| | | v-if="permission.trainingRegistration_cancel" |
| | | :disabled="row.cancel==2" |
| | | >取消报名</el-button |
| | | > |
| | | <el-button |
| | |
| | | size="small" |
| | | icon="el-icon-receiving" |
| | | v-if="permission.trainingRegistration_print" |
| | | :disabled="row.candidateNo == ''" |
| | | :disabled="row.candidateNo == '' || row.cancel==2" |
| | | @click="handlePrint(row)" |
| | | >准考证打印 |
| | | </el-button> |
| | |
| | | addExam, |
| | | } from "@/api/trainingRegistration/trainingRegistration"; |
| | | import { mapGetters } from "vuex"; |
| | | import { getRoleDetail } from "@/api/system/role"; |
| | | export default { |
| | | data() { |
| | | return { |
| | | loading: true, |
| | | excelBox: false, |
| | | dialogExamFormVisible: false, |
| | | search:{}, |
| | | optionExamApply: { |
| | | height: "auto", |
| | | filterBtn: true, |
| | |
| | | editBtn: this.vaildData(this.permission.notice_edit, false), |
| | | }; |
| | | }, |
| | | |
| | | }, |
| | | created(){ |
| | | this.search['cancel'] = 1; |
| | | this.search['auditStatus'] = 4; |
| | | }, |
| | | methods: { |
| | | //准考证查看 |
| | |
| | | }); |
| | | }, |
| | | sizeChange(val) { |
| | | this.page1.currentPage = 1; |
| | | this.page1.pageSize = val; |
| | | this.page.pageSize = val; |
| | | this.getData(); |
| | | // this.$message.success("行数" + val); |
| | | }, |
| | | currentChange(val) { |
| | | this.page1.currentPage = val; |
| | | this.page.currentPage = val; |
| | | this.getData(); |
| | | // this.$message.success("页码" + val); |
| | | }, |
| | | rowSave(form, done, loading) { |
| | | var that = this; |
| | |
| | | this.onLoad(this.page); |
| | | }, |
| | | rowUpdate(row, index, done, loading) { |
| | | // console.log(row); |
| | | |
| | | update(row).then( |
| | | () => { |
| | | this.onLoad(this.page); |
| | |
| | | this.onLoad(this.page, this.query); |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | // params['cancel'] = 111; |
| | | this.loading = true; |
| | | 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 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; |
| | |
| | | //生成考试 |
| | | submitExamApply(row, done, loading) { |
| | | var that = this; |
| | | var startTime = row.startTime + ":00"; |
| | | var endTime = row.endTime + ":00"; |
| | | row.startTime = row.startTime + ":00"; |
| | | row.endTime = row.endTime + ":00"; |
| | | if(row.number!=((row.serialEnd-row.serialStart)+1)){ |
| | | this.$message({ |
| | | type: "error", |
| | | message: "考试人数也序号不匹配!", |
| | | message: "考试人数与序号不匹配!", |
| | | }); |
| | | done(); |
| | | return; |
| | | } |
| | | |
| | | var s = new Date(startTime); |
| | | var e = new Date(endTime); |
| | | var s = new Date(row.startTime); |
| | | var e = new Date(row.endTime); |
| | | if(s>e){ |
| | | this.$message({ |
| | | type: "error", |
| | |
| | | return; |
| | | } |
| | | |
| | | addExam(this.ids, null, startTime,row.number, endTime,row.serialStart,row.serialEnd).then( |
| | | addExam(Object.assign(row, this.search)).then( |
| | | () => { |
| | | this.onLoad(this.page); |
| | | |
| | | that.$refs.formExamApply.resetFields(); |
| | | that.dialogExamFormVisible = false; |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功", |
| | | }); |
| | | done(); |
| | | }, |
| | | (error) => { |
| | |
| | | closeDialog() { |
| | | this.$refs.formExamApply.resetFields(); |
| | | }, |
| | | }, |
| | | mounted() { |
| | | // this.Ourdata = data; |
| | | // this.getData(); |
| | | // this.onLoad(this.page); |
| | | // var dept_id = JSON.parse( |
| | | // window.localStorage.getItem("saber-userInfo") |
| | | // ).content.dept_id; |
| | | }, |
| | | }; |
| | | </script> |