Merge branch 'master' of http://192.168.0.105:10010/r/zhba_enterprises
| | |
| | | import router from '@/router/router'; |
| | | import {serialize} from '@/util/util'; |
| | | import {getToken} from '@/util/auth'; |
| | | import {Message} from 'element-ui'; |
| | | // import { Message } from 'element-ui'; |
| | | import { MessageBox } from 'element-ui'; |
| | | import website from '@/config/website'; |
| | | import {Base64} from 'js-base64'; |
| | | import NProgress from 'nprogress'; |
| | | import 'nprogress/nprogress.css'; |
| | | |
| | | //默认超时时间 |
| | | axios.defaults.timeout = 10000; |
| | | axios.defaults.timeout = 60000; |
| | | //返回其他状态码 |
| | | axios.defaults.validateStatus = function (status) { |
| | | return status >= 200 && status <= 500; |
| | |
| | | if (status === 401) store.dispatch('FedLogOut').then(() => router.push({path: '/login'})); |
| | | // 如果请求为非200否者默认统一处理 |
| | | if (status !== 200) { |
| | | Message({ |
| | | message: message, |
| | | type: 'error' |
| | | }); |
| | | // Message({ |
| | | // message: message, |
| | | // type: 'error' |
| | | // }); |
| | | MessageBox.alert(message); |
| | | // alert(message); |
| | | return Promise.reject(new Error(message)) |
| | | } |
| | | return res; |
| | |
| | | component: () => |
| | | import( /* webpackChunkName: "views" */ '@/views/resource/uploadNotification') |
| | | }] |
| | | }, { |
| | | path: '/trainExam', |
| | | component: Layout, |
| | | children: [{ |
| | | path: 'check', |
| | | name: '培训考试审核', |
| | | meta: { |
| | | i18n: 'index', |
| | | }, |
| | | component: () => |
| | | import ( /* webpackChunkName: "views" */ '@/views/trainExam/index') |
| | | }, { |
| | | path: 'query', |
| | | name: '培训申请查询', |
| | | meta: { |
| | | i18n: 'index', |
| | | }, |
| | | component: () => |
| | | import ( /* webpackChunkName: "views" */ '@/views/trainExam/index') |
| | | }] |
| | | } |
| | | ] |
| | |
| | | icon="el-icon-upload2" |
| | | v-if="permission.securityGuard_import" |
| | | @click="handleImport1" |
| | | >批量导入 |
| | | >保安员批量导入 |
| | | </el-button> |
| | | <el-button |
| | | type="success" |
| | |
| | | |
| | | export default { |
| | | data() { |
| | | const validatePass = (rule, value, callback) => { |
| | | if (value === "") { |
| | | callback(new Error("请输入密码")); |
| | | } else { |
| | | callback(); |
| | | } |
| | | }; |
| | | const validatePass2 = (rule, value, callback) => { |
| | | if (value === "") { |
| | | callback(new Error("请再次输入密码")); |
| | | } else if (value !== this.form.password) { |
| | | callback(new Error("两次输入密码不一致!")); |
| | | } else { |
| | | callback(); |
| | | } |
| | | }; |
| | | const validatePassNumber = (rule, value, callback) => { |
| | | var test = /^[0-9]*$/gm; |
| | | if (!test.test(value)) { |
| | | callback(new Error("请输入数字")); |
| | | } else { |
| | | callback(); |
| | | } |
| | | }; |
| | | // const validatePass = (rule, value, callback) => { |
| | | // if (value === "") { |
| | | // callback(new Error("请输入密码")); |
| | | // } else { |
| | | // callback(); |
| | | // } |
| | | // }; |
| | | // const validatePass2 = (rule, value, callback) => { |
| | | // if (value === "") { |
| | | // callback(new Error("请再次输入密码")); |
| | | // } else if (value !== this.form.password) { |
| | | // callback(new Error("两次输入密码不一致!")); |
| | | // } else { |
| | | // callback(); |
| | | // } |
| | | // }; |
| | | // const validatePassNumber = (rule, value, callback) => { |
| | | // var test = /^[0-9]*$/gm; |
| | | // if (!test.test(value)) { |
| | | // callback(new Error("请输入数字")); |
| | | // } else { |
| | | // callback(); |
| | | // } |
| | | // }; |
| | | const validatePassCardid = (rule, value, callback) => { |
| | | var test = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/g; |
| | | if (!test.test(value) && value.length < 17) { |
| | |
| | | ], |
| | | }, |
| | | { |
| | | label: "登录账号", |
| | | prop: "account", |
| | | editDisabled: true, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入登录账号", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | // disabled: true, |
| | | }, |
| | | { |
| | | label: "密码", |
| | | prop: "password", |
| | | type: "password", |
| | | hide: true, |
| | | editDisplay: false, |
| | | viewDisplay: false, |
| | | rules: [ |
| | | { required: true, validator: validatePass, trigger: "blur" }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "确认密码", |
| | | prop: "password2", |
| | | type: "password", |
| | | hide: true, |
| | | editDisplay: false, |
| | | viewDisplay: false, |
| | | rules: [ |
| | | { required: true, validator: validatePass2, trigger: "blur" }, |
| | | ], |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "详细信息", |
| | | prop: "detailInfo", |
| | | labelWidth: "110", |
| | | icon: "el-icon-s-order", |
| | | column: [ |
| | | { |
| | | label: "姓名", |
| | | prop: "realName", |
| | | rules: [ |
| | |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "昵称", |
| | | prop: "name", |
| | | // { |
| | | // label: "登录账号", |
| | | // prop: "account", |
| | | // editDisabled: true, |
| | | // rules: [ |
| | | // { |
| | | // required: true, |
| | | // message: "请输入登录账号", |
| | | // trigger: "blur", |
| | | // }, |
| | | // ], |
| | | // // disabled: true, |
| | | // }, |
| | | // { |
| | | // label: "密码", |
| | | // prop: "password", |
| | | // type: "password", |
| | | // hide: true, |
| | | // editDisplay: false, |
| | | // viewDisplay: false, |
| | | // rules: [ |
| | | // { required: true, validator: validatePass, trigger: "blur" }, |
| | | // ], |
| | | // }, |
| | | // { |
| | | // label: "确认密码", |
| | | // prop: "password2", |
| | | // type: "password", |
| | | // hide: true, |
| | | // editDisplay: false, |
| | | // viewDisplay: false, |
| | | // rules: [ |
| | | // { required: true, validator: validatePass2, trigger: "blur" }, |
| | | // ], |
| | | // }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "详细信息", |
| | | prop: "detailInfo", |
| | | labelWidth: "110", |
| | | icon: "el-icon-s-order", |
| | | column: [ |
| | | { |
| | | label: "身份证号", |
| | | prop: "cardid", |
| | | hide: true, |
| | | overHidden: true, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入身份证号", |
| | | trigger: "blur", |
| | | }, |
| | | { |
| | | required: true, |
| | | validator: validatePassCardid, |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "手机号码", |
| | | prop: "phone", |
| | | overHidden: true, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入手机号", |
| | | trigger: "blur", |
| | | }, |
| | | { |
| | | required: true, |
| | | validator: validatePassPhone, |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | // { |
| | | // label: "昵称", |
| | | // prop: "name", |
| | | // }, |
| | | { |
| | | label: "个人照片", |
| | | type: "upload", |
| | |
| | | label: "保安员证编号", |
| | | prop: "securitynumber", |
| | | hide: true, |
| | | }, |
| | | { |
| | | label: "身份证号", |
| | | prop: "cardid", |
| | | hide: true, |
| | | overHidden: true, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入身份证号", |
| | | trigger: "blur", |
| | | }, |
| | | { |
| | | required: true, |
| | | validator: validatePassCardid, |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "手机号码", |
| | | prop: "phone", |
| | | overHidden: true, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入手机号", |
| | | trigger: "blur", |
| | | }, |
| | | { |
| | | required: true, |
| | | validator: validatePassPhone, |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "电子邮箱", |
| | |
| | | @click="handleImport" |
| | | >实操成绩导入 |
| | | </el-button> |
| | | <el-button |
| | | type="warning" |
| | | size="small" |
| | | plain |
| | | icon="el-icon-download" |
| | | v-if="permission.trainExam_performance_export" |
| | | @click="handleExport" |
| | | >成绩导出 |
| | | </el-button> |
| | | </template> |
| | | |
| | | <template slot-scope="{ type, size, row }" slot="menu"> |
| | |
| | | import { getList, update, updateAbsent } from "@/api/examapi/performance"; |
| | | import { mapGetters } from "vuex"; |
| | | import { getRoleDetail } from "@/api/system/role"; |
| | | import Qs from 'qs'; |
| | | export default { |
| | | data() { |
| | | var validatePass = (rule, value, callback) => { |
| | |
| | | addBtn: false, |
| | | selection: false, |
| | | // 导出按钮 |
| | | excelBtn: true, |
| | | excelBtnText: "成绩导出", |
| | | // excelBtn: true, |
| | | // excelBtnText: "成绩导出", |
| | | viewBtn: true, |
| | | // title: '成绩', |
| | | align: "center", |
| | |
| | | menu: true, |
| | | menuWidth: 215, |
| | | labelWidth: 120, |
| | | |
| | | column: [ |
| | | { |
| | | label: "考试时间", |
| | | prop: "examDate", |
| | | type: "date", |
| | | hide: true, |
| | | format: "yyyy-MM-dd", |
| | | valueFormat: "yyyy-MM-dd", |
| | | width: 140, |
| | | slot: true, |
| | | search: true, |
| | | searchSpan: 4, |
| | | // 表单新增时是否禁止 |
| | | addDisabled: false, |
| | | // 表单新增时是否可见 |
| | | addDisplay: false, |
| | | // 表单新增时是否为查看模式 |
| | | addDetail: false, |
| | | // 表单编辑时是否禁止 |
| | | editDisabled: false, |
| | | // 表单编辑时是否可见 |
| | | editDisplay: false, |
| | | // 表单编辑时是否为查看模式 |
| | | editDetail: false, |
| | | viewDisplay: false, |
| | | }, |
| | | { |
| | | label: "考试名称", |
| | | prop: "examName", |
| | | search: true, |
| | | searchSpan: 4, |
| | | searchSpan: 5, |
| | | slot: true, |
| | | viewDisplay: true, |
| | | // 表单新增时是否禁止 |
| | |
| | | refreshChange() { |
| | | this.questionBankOnLoad(this.questionBankPage, this.questionBankQuery); |
| | | }, |
| | | //成绩导出 |
| | | handleExport() { |
| | | this.$confirm("是否导出成绩数据?", "提示", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }).then(() => { |
| | | //获取查询条件 |
| | | console.log(this.questionBankSearch,456); |
| | | var data = { |
| | | account: this.questionBankSearch.account, |
| | | companyName: this.questionBankSearch.companyName, |
| | | examDate: this.questionBankSearch.examDate, |
| | | isExam: this.questionBankSearch.isExam, |
| | | qualified: this.questionBankSearch.qualified, |
| | | securityName: this.questionBankSearch.securityName, |
| | | examName: this.questionBankSearch.examName, |
| | | }; |
| | | //导出 |
| | | if ( |
| | | this.userInfo.role_name == "保安公司管理员" || |
| | | this.userInfo.role_name == "保安" |
| | | ) { |
| | | //如果是保安公司管理员 |
| | | data["deptId"] = this.userInfo.dept_id; |
| | | } |
| | | if (this.userInfo.role_name == "培训公司管理员") { |
| | | //如果是培训公司管理员 |
| | | data["trainUnitId"] = this.userInfo.dept_id; |
| | | } |
| | | data["examType"] = 2; |
| | | //序列号url形式,用&拼接 |
| | | data = Qs.stringify(data); |
| | | window.open( |
| | | `/api/examScore/export-examScore?` + data |
| | | ); |
| | | }); |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | |
| | | }} |
| | | </template> |
| | | |
| | | <!-- 自定义按钮 --> |
| | | <template slot="menuLeft"> |
| | | <el-button |
| | | type="warning" |
| | | size="small" |
| | | plain |
| | | icon="el-icon-download" |
| | | v-if="permission.trainExam_singleperformance_export" |
| | | @click="handleExport" |
| | | >成绩导出 |
| | | </el-button> |
| | | </template> |
| | | <template slot-scope="{ row }" slot="menu"> |
| | | <el-button |
| | | type="text" |
| | |
| | | import { getList, update } from "@/api/examapi/performance"; |
| | | import { mapGetters } from "vuex"; |
| | | import { getRoleDetail } from "@/api/system/role"; |
| | | |
| | | import Qs from 'qs'; |
| | | export default { |
| | | data() { |
| | | var validatePass = (rule, value, callback) => { |
| | |
| | | addBtn: false, |
| | | selection: false, |
| | | // 导出按钮 |
| | | excelBtn: true, |
| | | excelBtnText: "成绩导出", |
| | | // excelBtn: true, |
| | | // excelBtnText: "成绩导出", |
| | | viewBtn: false, |
| | | // title: '成绩', |
| | | |
| | | align: "center", |
| | | height: "auto", |
| | | calcHeight: 80, |
| | |
| | | labelWidth: 120, |
| | | column: [ |
| | | { |
| | | label: "考试时间", |
| | | prop: "examDate", |
| | | type: "date", |
| | | hide: true, |
| | | format: "yyyy-MM-dd", |
| | | valueFormat: "yyyy-MM-dd", |
| | | width: 140, |
| | | slot: true, |
| | | search: true, |
| | | searchSpan: 4, |
| | | // 表单新增时是否禁止 |
| | | addDisabled: false, |
| | | // 表单新增时是否可见 |
| | | addDisplay: false, |
| | | // 表单新增时是否为查看模式 |
| | | addDetail: false, |
| | | // 表单编辑时是否禁止 |
| | | editDisabled: false, |
| | | // 表单编辑时是否可见 |
| | | editDisplay: false, |
| | | // 表单编辑时是否为查看模式 |
| | | editDetail: false, |
| | | viewDisplay: false, |
| | | }, |
| | | { |
| | | label: "考试名称", |
| | | prop: "examName", |
| | | search: true, |
| | | searchSpan: 4, |
| | | searchSpan: 5, |
| | | slot: true, |
| | | viewDisplay: false, |
| | | // 表单新增时是否禁止 |
| | |
| | | refreshChange() { |
| | | this.questionBankOnLoad(this.questionBankPage, this.questionBankQuery); |
| | | }, |
| | | //成绩导出 |
| | | handleExport() { |
| | | this.$confirm("是否导出成绩数据?", "提示", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }).then(() => { |
| | | //获取查询条件 |
| | | // console.log(this.questionBankSearch,456); |
| | | var data = { |
| | | account: this.questionBankSearch.account, |
| | | companyName: this.questionBankSearch.companyName, |
| | | examDate: this.questionBankSearch.examDate, |
| | | isExam: this.questionBankSearch.isExam, |
| | | qualified: this.questionBankSearch.qualified, |
| | | securityName: this.questionBankSearch.securityName, |
| | | examName: this.questionBankSearch.examName, |
| | | }; |
| | | //导出 |
| | | if ( |
| | | this.userInfo.role_name == "保安公司管理员" || |
| | | this.userInfo.role_name == "保安" |
| | | ) { |
| | | //如果是保安公司管理员 |
| | | data["deptId"] = this.userInfo.dept_id; |
| | | } |
| | | if (this.userInfo.role_name == "培训公司管理员") { |
| | | //如果是培训公司管理员 |
| | | data["trainUnitId"] = this.userInfo.dept_id; |
| | | } |
| | | data["examType"] = 2; |
| | | //序列号url形式,用&拼接 |
| | | data = Qs.stringify(data); |
| | | window.open( |
| | | `/api/examScore/export-examScore?` + data |
| | | ); |
| | | }); |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |