| | |
| | | #张凤 |
| | | VUE_APP_BASE_API = 'http://192.168.0.70:8085/api' |
| | | |
| | | #线上 |
| | | #VUE_APP_BASE_API = 'http://121.239.169.30:8086/api' |
| | | |
| | | # 路由懒加载 |
| | | VUE_CLI_BABEL_TRANSPILE_MODULES = true |
对比新文件 |
| | |
| | | import request from '@/utils/request' |
| | | |
| | | // 数据分页 |
| | | export function getExamPage(query) { |
| | | return request({ |
| | | url: '/exam/apply/page/list', |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
| | | |
| | | // 获取数据 |
| | | export function getExamApply(id) { |
| | | return request({ |
| | | url: '/exam/apply/get/' + id, |
| | | method: 'get' |
| | | }) |
| | | } |
| | | |
| | | // 根据机构查询考点 |
| | | export function getExamSite(id) { |
| | | return request({ |
| | | url: '/exam/site/select/' + id, |
| | | method: 'get' |
| | | }) |
| | | } |
| | | |
| | | // 新增数据 |
| | | export function addExamApply(data) { |
| | | return request({ |
| | | url: '/exam/apply/add', |
| | | method: 'post', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | // 修改数据 |
| | | export function editExamApply(data) { |
| | | return request({ |
| | | url: '/exam/apply/mod', |
| | | method: 'post', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | // 删除数据 |
| | | export function delExamApply(ids) { |
| | | return request({ |
| | | url: '/exam/apply/del/batch/' + ids, |
| | | method: 'delete' |
| | | }) |
| | | } |
| | |
| | | let matched = this.$route.matched.filter(item => item.meta && item.meta.title) |
| | | const first = matched[0] |
| | | |
| | | if (!this.isDashboard(first)) { |
| | | matched = [{ path: '/index', meta: { title: '首页' }}].concat(matched) |
| | | } |
| | | // if (!this.isDashboard(first)) { |
| | | // matched = [{ path: '/index', meta: { title: '首页' }}].concat(matched) |
| | | // } |
| | | |
| | | this.levelList = matched.filter(item => item.meta && item.meta.title && item.meta.breadcrumb !== false) |
| | | }, |
| | |
| | | <template> |
| | | <div class="sidebar-logo-container" :class="{'collapse':collapse}" :style="{ backgroundColor: sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground }"> |
| | | <transition name="sidebarLogoFade"> |
| | | <router-link v-if="collapse" key="collapse" class="sidebar-logo-link" to="/"> |
| | | <router-link v-if="collapse" key="collapse" class="sidebar-logo-link" :to="indexPage"> |
| | | <img v-if="logo" :src="logo" class="sidebar-logo" /> |
| | | <h1 v-else class="sidebar-title" :style="{ color: sideTheme === 'theme-dark' ? variables.logoTitleColor : variables.logoLightTitleColor }">{{ title }} </h1> |
| | | </router-link> |
| | | <router-link v-else key="expand" class="sidebar-logo-link" to="/"> |
| | | <router-link v-else key="expand" class="sidebar-logo-link" :to="indexPage"> |
| | | <img v-if="logo" :src="logo" class="sidebar-logo" /> |
| | | <h1 class="sidebar-title" :style="{ color: sideTheme === 'theme-dark' ? variables.logoTitleColor : variables.logoLightTitleColor }">{{ title }} </h1> |
| | | </router-link> |
| | |
| | | |
| | | <script> |
| | | import logoImg from '@/assets/logo/logo.png' |
| | | import {mapState} from "vuex"; |
| | | import variables from '@/assets/styles/variables.scss' |
| | | |
| | | export default { |
| | |
| | | }, |
| | | sideTheme() { |
| | | return this.$store.state.settings.sideTheme |
| | | } |
| | | }, |
| | | ...mapState({ |
| | | indexPage: state => state.permission.indexPage |
| | | }) |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | <script> |
| | | import ScrollPane from './ScrollPane' |
| | | import path from 'path' |
| | | import {mapState} from "vuex"; |
| | | |
| | | export default { |
| | | components: { ScrollPane }, |
| | |
| | | }, |
| | | theme() { |
| | | return this.$store.state.settings.theme; |
| | | } |
| | | }, |
| | | ...mapState({ |
| | | indexPage: state => state.permission.indexPage |
| | | }) |
| | | }, |
| | | watch: { |
| | | $route() { |
| | |
| | | }; |
| | | }, |
| | | isAffix(tag) { |
| | | if (tag.fullPath == this.indexPage) { |
| | | return true |
| | | } else { |
| | | return tag.meta && tag.meta.affix |
| | | } |
| | | }, |
| | | isFirstView() { |
| | | try { |
| | |
| | | // to reload home page |
| | | this.$router.replace({ path: '/redirect' + view.fullPath }) |
| | | } else { |
| | | this.$router.push('/') |
| | | this.$router.push(this.indexPage) |
| | | } |
| | | } |
| | | }, |
| | |
| | | store.dispatch('GenerateRoutes').then(accessRoutes => { |
| | | // 根据roles权限生成可访问的路由表 |
| | | router.addRoutes(accessRoutes) // 动态添加可访问路由表 |
| | | next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 |
| | | // next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 |
| | | let path = ''; |
| | | if (accessRoutes[0].path === '/') { |
| | | path = accessRoutes[0].path + accessRoutes[0].children[0].path; //获取第一路由路径 |
| | | } else { |
| | | path = accessRoutes[0].path + '/' + accessRoutes[0].children[0].path; //获取第一路由路径 |
| | | } |
| | | |
| | | if (accessRoutes[0].children[0].query !== undefined) { //如果当前路由存在路由参数,则带入 |
| | | let query = JSON.parse(accessRoutes[0].children[0].query); |
| | | let temp = ''; |
| | | for (var val in query) { |
| | | if (temp.length == 0) { |
| | | temp = "?"; |
| | | } else { |
| | | temp = temp + "&"; |
| | | } |
| | | temp = temp + val + "=" + query[val]; |
| | | } |
| | | path = path + temp; |
| | | } |
| | | var temp = {...to, replace: true}; |
| | | var curPath = temp.path; |
| | | if (from.path == '/login' || curPath == "/" ) { |
| | | next({path, replace: true}) // hack方法 确保addRoutes已完成 |
| | | } else { |
| | | next(temp) // hack方法 确保addRoutes已完成 |
| | | } |
| | | }) |
| | | }).catch(err => { |
| | | store.dispatch('LogOut').then(() => { |
| | |
| | | }, |
| | | // 关闭指定tab页签 |
| | | closePage(obj) { |
| | | let indexPage = store.state.permission.indexPage; |
| | | if (obj === undefined) { |
| | | return store.dispatch('tagsView/delView', router.currentRoute).then(({ visitedViews }) => { |
| | | const latestView = visitedViews.slice(-1)[0] |
| | | if (latestView) { |
| | | return router.push(latestView.fullPath) |
| | | } |
| | | return router.push('/'); |
| | | return store.dispatch('tagsView/delView', router.currentRoute).then(({ lastPath }) => { |
| | | return router.push(lastPath || indexPage); |
| | | }); |
| | | } |
| | | return store.dispatch('tagsView/delView', obj); |
| | |
| | | component: () => import('@/views/error/401'), |
| | | hidden: true |
| | | }, |
| | | { |
| | | path: '', |
| | | component: Layout, |
| | | // { |
| | | // path: '', |
| | | // component: Layout, |
| | | // redirect: '/notCoalMine/nPeopleManage/index', |
| | | hidden: true, |
| | | children: [ |
| | | // hidden: true, |
| | | // children: [ |
| | | // { |
| | | // path: 'index', |
| | | // component: () => import('@/views/index'), |
| | | // name: 'Index', |
| | | // meta: { title: '人员管理', icon: 'peoples', affix: true } |
| | | // } |
| | | ] |
| | | }, |
| | | // ] |
| | | // }, |
| | | { |
| | | path: '/user', |
| | | component: Layout, |
| | |
| | | name: state => state.user.name, |
| | | introduction: state => state.user.introduction, |
| | | roles: state => state.user.roles, |
| | | userInfo: state => state.user.userInfo, |
| | | permissions: state => state.user.permissions, |
| | | permission_routes: state => state.permission.routes, |
| | | topbarRouters:state => state.permission.topbarRouters, |
| | |
| | | addRoutes: [], |
| | | defaultRoutes: [], |
| | | topbarRouters: [], |
| | | sidebarRouters: [] |
| | | sidebarRouters: [], |
| | | indexPage: '' |
| | | }, |
| | | mutations: { |
| | | SET_ROUTES: (state, routes) => { |
| | |
| | | SET_SIDEBAR_ROUTERS: (state, routes) => { |
| | | state.sidebarRouters = routes |
| | | }, |
| | | SET_INDEX_PAGE: (state, routes) => { |
| | | state.indexPage = routes |
| | | } |
| | | }, |
| | | actions: { |
| | | // 生成路由 |
| | |
| | | getRouters().then(res => { |
| | | const sdata = JSON.parse(JSON.stringify(res.data)) |
| | | const rdata = JSON.parse(JSON.stringify(res.data)) |
| | | let indexdata = res.data[0].path + "/" + res.data[0].children[0].path |
| | | if (res.data[0].children[0].query !== undefined) { //如果当前路由存在路由参数,则带入 |
| | | let query = JSON.parse(res.data[0].children[0].query); |
| | | let temp = ''; |
| | | for (var val in query) { |
| | | if (temp.length == 0) { |
| | | temp = "?"; |
| | | } else { |
| | | temp = temp + "&"; |
| | | } |
| | | temp = temp + val + "=" + query[val]; |
| | | } |
| | | indexdata = indexdata + temp; |
| | | } |
| | | const sidebarRoutes = filterAsyncRouter(sdata) |
| | | const rewriteRoutes = filterAsyncRouter(rdata, false, true) |
| | | const asyncRoutes = filterDynamicRoutes(dynamicRoutes); |
| | |
| | | commit('SET_SIDEBAR_ROUTERS', constantRoutes.concat(sidebarRoutes)) |
| | | commit('SET_DEFAULT_ROUTES', sidebarRoutes) |
| | | commit('SET_TOPBAR_ROUTES', sidebarRoutes) |
| | | commit('SET_INDEX_PAGE', indexdata) |
| | | resolve(rewriteRoutes) |
| | | }) |
| | | }) |
| | |
| | | name: '', |
| | | avatar: '', |
| | | roles: [], |
| | | permissions: [] |
| | | permissions: [], |
| | | userInfo: {} |
| | | }, |
| | | |
| | | mutations: { |
| | | SET_USER: (state, user) => { |
| | | state.userInfo = user |
| | | }, |
| | | SET_TOKEN: (state, token) => { |
| | | state.token = token |
| | | }, |
| | |
| | | return new Promise((resolve, reject) => { |
| | | getInfo().then(res => { |
| | | const user = res.user |
| | | commit('SET_USER', user) |
| | | const avatar = (user.avatar == "" || user.avatar == null) ? require("@/assets/images/profile.jpg") : process.env.VUE_APP_BASE_API + user.avatar; |
| | | if (res.roles && res.roles.length > 0) { // 验证返回的roles是否是一个非空数组 |
| | | commit('SET_ROLES', res.roles) |
| | |
| | | MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', { confirmButtonText: '重新登录', cancelButtonText: '取消', type: 'warning' }).then(() => { |
| | | isRelogin.show = false; |
| | | store.dispatch('LogOut').then(() => { |
| | | location.href = '/index'; |
| | | // location.href = '/index'; |
| | | let indexUrl = this.$store.state.permission.indexPage |
| | | location.href = indexUrl; |
| | | }) |
| | | }).catch(() => { |
| | | isRelogin.show = false; |
| | |
| | | } |
| | | this.loading = false; |
| | | }, |
| | | openUpload(){ |
| | | this.$message.error('请联系开发人员规范导入') |
| | | }, |
| | | openDialog(data,type){ |
| | | this.$refs.reviewerDialog.openDialog(data,type) |
| | | }, |
对比新文件 |
| | |
| | | <template> |
| | | <el-dialog |
| | | :title="title" |
| | | :visible.sync="open" |
| | | append-to-body |
| | | width="50%" |
| | | :before-close="handleClose" |
| | | > |
| | | <el-form ref="ruleForm" :model="form" :rules="rules" label-position="right" label-width="150px" style="padding-right: 50px" element-loading-text="保存中..."> |
| | | <el-form-item label="考试批次全称:" prop="examName"> |
| | | <el-input v-model.trim="form.examName" type="textarea" :readonly="disable"/> |
| | | </el-form-item> |
| | | <el-form-item label="类别:" prop="isCm"> |
| | | <el-radio-group v-model="form.isCm" style="width: 100%;" :disabled="disable || !isAdmin" @change="clearOptions"> |
| | | <el-radio :label="0">非煤</el-radio> |
| | | <el-radio :label="1">煤矿</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | <el-form-item label="机构:" prop="institutionId"> |
| | | <el-select v-model="form.institutionId" placeholder="请选择所属机构" style="width: 100%" :disabled="disable" @focus="getSections"> |
| | | <el-option |
| | | v-for="item in sectionOptions" |
| | | :key="item.institutionId" |
| | | :label="item.institutionName" |
| | | :value="item.institutionId" |
| | | :disabled="disable" |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="考试点:" prop="siteId"> |
| | | <el-select v-model="form.siteId" placeholder="请选择考试点" style="width: 100%" :disabled="disable" @focus="getSites"> |
| | | <el-option |
| | | v-for="item in siteOptions" |
| | | :key="item.siteId" |
| | | :label="item.siteName" |
| | | :value="item.siteId" |
| | | :disabled="disable" |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="考试人数:" prop="examNum"> |
| | | <el-input v-model.trim="form.examNum" type="number" :readonly="disable"/> |
| | | </el-form-item> |
| | | <el-form-item label="正考日期" prop="zkTimeRange"> |
| | | <el-date-picker |
| | | v-model="form.zkTimeRange" |
| | | value-format="yyyy-MM-dd HH:mm:ss" |
| | | type="datetimerange" |
| | | range-separator="-" |
| | | start-placeholder="开始日期" |
| | | end-placeholder="结束日期" |
| | | :disabled="disable" |
| | | ></el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item label="补考日期" prop="bkTimeRange"> |
| | | <el-date-picker |
| | | v-model="form.bkTimeRange" |
| | | value-format="yyyy-MM-dd HH:mm:ss" |
| | | type="datetimerange" |
| | | range-separator="-" |
| | | start-placeholder="开始日期" |
| | | end-placeholder="结束日期" |
| | | :disabled="disable" |
| | | ></el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item label="实操日期" prop="scTimeRange"> |
| | | <el-date-picker |
| | | v-model="form.scTimeRange" |
| | | value-format="yyyy-MM-dd HH:mm:ss" |
| | | type="datetimerange" |
| | | range-separator="-" |
| | | start-placeholder="开始日期" |
| | | end-placeholder="结束日期" |
| | | :disabled="disable" |
| | | ></el-date-picker> |
| | | </el-form-item> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="机构联系人:" prop="institutionContacts"> |
| | | <el-input v-model.trim="form.institutionContacts" :readonly="disable"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="联系电话:" prop="institutionContactsPhone"> |
| | | <el-input v-model.trim="form.institutionContactsPhone" :readonly="disable"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="考试点联系人:" prop="siteContacts"> |
| | | <el-input v-model.trim="form.siteContacts" :readonly="disable"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="联系电话:" prop="siteContactsPhone"> |
| | | <el-input v-model.trim="form.siteContactsPhone" :readonly="disable"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="handleClose">取消</el-button> |
| | | <el-button v-if="disable == false" type="primary" @click="submit">提交</el-button> |
| | | <el-button v-else type="primary" @click="handleClose">确定</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script > |
| | | import {addExamApply, editExamApply, getExamSite} from "@/api/commonMod/examApply"; |
| | | import {getTrainPage} from "@/api/coalMine/placeManage/train"; |
| | | import store from "@/store"; |
| | | |
| | | export default { |
| | | name: 'examApplyDialog', |
| | | components: { |
| | | }, |
| | | props: ['typeList'], |
| | | data() { |
| | | return { |
| | | disable: false, |
| | | title: '新增申报', |
| | | open: false, |
| | | form:{}, |
| | | sectionOptions: [], |
| | | siteOptions: [], |
| | | rules:{ |
| | | examName:[{ required: true, message: '请填写考试批次全称', trigger: 'blur' }], |
| | | isCm: [{ required: true, message: '请选择类别', trigger: 'blur' }], |
| | | institutionId: [{ required: true, message: '请选择机构', trigger: 'blur' }], |
| | | siteId: [{ required: true, message: '请选择考试点', trigger: 'blur' }], |
| | | examNum: [{ required: true, message: '请填写考试人数', trigger: 'blur' }], |
| | | zkTimeRange: [{ required: true, message: '请选择正考时间', trigger: 'blur' }], |
| | | bkTimeRange: [{ required: true, message: '请选择补考时间', trigger: 'blur' }], |
| | | scTimeRange: [{ required: true, message: '请选择实操时间', trigger: 'blur' }], |
| | | siteContacts: [{ required: true, message: '请填写考试点联系人', trigger: 'blur' }], |
| | | siteContactsPhone: [{ required: true, message: '请填写考试点联系人电话', trigger: 'blur' }], |
| | | institutionContacts: [{ required: true, message: '请填写机构联系人', trigger: 'blur' }], |
| | | institutionContactsPhone: [{ required: true, message: '请填写机构联系人电话', trigger: 'blur' }] |
| | | }, |
| | | isAdmin: false |
| | | } |
| | | }, |
| | | created() { |
| | | |
| | | }, |
| | | methods: { |
| | | openDialog (val,type) { |
| | | const t = this |
| | | const roles = store.getters && store.getters.roles |
| | | if(roles.includes('admin')){ |
| | | t.isAdmin = true |
| | | }else{ |
| | | t.isAdmin = false |
| | | } |
| | | if(roles.includes('company')){ |
| | | t.form.isCm = 0 |
| | | } |
| | | if(roles.includes('mk')){ |
| | | t.form.isCm = 1 |
| | | } |
| | | const userInfo = store.getters && store.getters.userInfo |
| | | if(userInfo.institutions && userInfo.institutions.length>0){ |
| | | t.sectionOptions = userInfo.institutions |
| | | t.form.institutionId = userInfo.institutions[0].institutionId |
| | | } |
| | | t.open = true |
| | | t.reset() |
| | | if(type == 'add'){ |
| | | t.title = '新增申报' |
| | | t.disable = false |
| | | }else{ |
| | | if(type == 'edit'){ |
| | | t.title = '编辑' |
| | | t.disable = false |
| | | }else{ |
| | | t.title = '查看' |
| | | t.disable = true |
| | | } |
| | | if(val){ |
| | | for(let i in val){ |
| | | if(t.isValidKey(i,this.form)){ |
| | | t.form[i] = val[i] |
| | | } |
| | | } |
| | | } |
| | | |
| | | t.form.zkTimeRange=[val.examStartTime,val.examEndTime] |
| | | t.form.bkTimeRange=[val.resitStartTime,val.resitEndTime] |
| | | t.form.scTimeRange=[val.operationStartTime,val.operationEndTime] |
| | | t.getSectionList() |
| | | t.getSiteList() |
| | | t.form.institutionId = val.institutionId.toString() |
| | | t.form.siteId = val.siteId |
| | | console.log(t.form,t.sectionOptions,t.siteOptions,666) |
| | | } |
| | | }, |
| | | isValidKey(key,obj){ |
| | | return key in obj |
| | | }, |
| | | |
| | | handleClose() { |
| | | this.open = false; |
| | | this.resetForm(); |
| | | }, |
| | | |
| | | getSections(){ |
| | | if(this.form.isCm == 0 || this.form.isCm == 1){ |
| | | this.getSectionList() |
| | | }else{ |
| | | this.$message({ |
| | | message: '请先选择类别', |
| | | type: 'warning' |
| | | }) |
| | | } |
| | | }, |
| | | |
| | | async getSectionList() { |
| | | this.loading = true; |
| | | const param = { |
| | | isCm: this.form.isCm, |
| | | pageNum: 1, |
| | | pageSize: 999 |
| | | } |
| | | const res = await getTrainPage(param); |
| | | if(res.code == 200) { |
| | | this.sectionOptions = res.rows; |
| | | }else { |
| | | this.$message({ |
| | | message: res.msg, |
| | | type: 'warning' |
| | | }) |
| | | } |
| | | this.loading = false; |
| | | }, |
| | | |
| | | |
| | | getSites(){ |
| | | if(this.form.institutionId){ |
| | | this.getSiteList() |
| | | }else{ |
| | | this.$message({ |
| | | message: '请先选择所属机构', |
| | | type: 'warning' |
| | | }) |
| | | } |
| | | }, |
| | | |
| | | async getSiteList() { |
| | | this.loading = true; |
| | | const res = await getExamSite(this.form.institutionId); |
| | | if(res.code == 200) { |
| | | this.siteOptions = res.data; |
| | | }else { |
| | | this.$message({ |
| | | message: res.msg, |
| | | type: 'warning' |
| | | }) |
| | | } |
| | | this.loading = false; |
| | | }, |
| | | |
| | | clearOptions() { |
| | | this.form.institutionId = null |
| | | this.form.siteId = null |
| | | this.getSectionList() |
| | | }, |
| | | |
| | | // 表单重置 |
| | | reset() { |
| | | this.form = { |
| | | applyId: null, |
| | | examName: '', |
| | | isCm: null, |
| | | institutionId: null, |
| | | siteId: null, |
| | | examNum: null, |
| | | zkTimeRange: [], |
| | | examStartTime: '', |
| | | examEndTime: '', |
| | | bkTimeRange: [], |
| | | resitStartTime: '', |
| | | resitEndTime: '', |
| | | scTimeRange: [], |
| | | operationStartTime: '', |
| | | operationEndTime: '', |
| | | siteContacts: '', |
| | | siteContactsPhone: '', |
| | | institutionContacts: '', |
| | | institutionContactsPhone: '' |
| | | } |
| | | this.sectionOptions = [] |
| | | this.siteOptions = [] |
| | | }, |
| | | |
| | | async submit(){ |
| | | this.$refs["ruleForm"].validate(async(valid) =>{ |
| | | if(valid) { |
| | | this.form.examStartTime = this.form.zkTimeRange[0] |
| | | this.form.examEndTime = this.form.zkTimeRange[1] |
| | | this.form.resitStartTime = this.form.bkTimeRange[0] |
| | | this.form.resitEndTime = this.form.bkTimeRange[1] |
| | | this.form.operationStartTime = this.form.scTimeRange[0] |
| | | this.form.operationEndTime = this.form.scTimeRange[1] |
| | | if(this.title == '新增申报'){ |
| | | const {applyId,zkTimeRange,bkTimeRange,scTimeRange,...data} = this.form |
| | | const res= await addExamApply(data) |
| | | if(res.code == 200){ |
| | | this.$message({ |
| | | type:'success', |
| | | message: res.msg |
| | | }) |
| | | this.open = false |
| | | this.$emit('getList') |
| | | }else{ |
| | | this.$message({ |
| | | type:'warning', |
| | | message: res.msg |
| | | }) |
| | | } |
| | | }else{ |
| | | const {zkTimeRange,bkTimeRange,scTimeRange,...data} = this.form |
| | | const res= await editExamApply(data) |
| | | if(res.code == 200){ |
| | | this.$message({ |
| | | type:'success', |
| | | message: res.msg |
| | | }) |
| | | this.open = false |
| | | this.$emit('getList') |
| | | }else{ |
| | | this.$message({ |
| | | type:'warning', |
| | | message: res.msg |
| | | }) |
| | | } |
| | | } |
| | | }else{ |
| | | this.$message({ |
| | | type:'warning', |
| | | message:'请完善必填信息' |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | } |
| | | } |
| | | |
| | | </script> |
| | | <style scoped> |
| | | |
| | | </style> |
对比新文件 |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px"> |
| | | <el-form-item prop="isCm"> |
| | | <el-radio-group v-model="queryParams.isCm" @change="changeType"> |
| | | <el-radio-button :label="2">全部</el-radio-button> |
| | | <el-radio-button :label="1">煤矿</el-radio-button> |
| | | <el-radio-button :label="0">非煤</el-radio-button> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | <el-form-item label="时间范围" prop="timeRange"> |
| | | <el-date-picker |
| | | v-model="queryParams.timeRange" |
| | | value-format="yyyy-MM-dd HH:mm" |
| | | type="datetimerange" |
| | | range-separator="-" |
| | | start-placeholder="开始日期" |
| | | end-placeholder="结束日期" |
| | | ></el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item label="所属区域" prop="districtId"> |
| | | <el-select v-model="queryParams.districtId" placeholder="请选择" style="width: 100%;"> |
| | | <el-option |
| | | v-for="item in areaList" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.id"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> |
| | | <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | |
| | | <el-row :gutter="10" class="mb8"> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="primary" |
| | | plain |
| | | size="mini" |
| | | @click="openExamApply({},'add')" |
| | | v-hasPermi="['system:experts:add']" |
| | | >新增考试计划</el-button> |
| | | </el-col> |
| | | <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
| | | </el-row> |
| | | <el-table v-loading="loading" :data="dataList"> |
| | | <el-table-column label="序号" align="center" type="index"/> |
| | | <el-table-column label="机构名称" align="center" prop="institutionName" /> |
| | | <el-table-column label="考试点名称" align="center" prop="siteName" /> |
| | | <el-table-column label="考试批次全称" align="center" prop="examName" /> |
| | | <el-table-column label="考试人数" align="center" prop="examNum" /> |
| | | <el-table-column label="计划正考时间" align="center"> |
| | | <template #default="scope"> |
| | | {{scope.row.examStartTime.substring(0,16) + '--' + scope.row.examEndTime.substring(0,16)}} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="计划补考时间" align="center"> |
| | | <template #default="scope"> |
| | | {{scope.row.resitStartTime.substring(0,16) + '--' + scope.row.resitEndTime.substring(0,16)}} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="实操时间" align="center"> |
| | | <template #default="scope"> |
| | | {{scope.row.operationStartTime.substring(0,16) + '--' + scope.row.operationEndTime.substring(0,16)}} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="培训机构联系人" align="center"> |
| | | <template #default="scope"> |
| | | {{scope.row.institutionContacts + '(' + scope.row.institutionContactsPhone + ')'}} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="考试点联系人" align="center"> |
| | | <template #default="scope"> |
| | | {{scope.row.siteContacts + '(' + scope.row.siteContactsPhone + ')'}} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="提交时间" align="center" prop="updateTime" /> |
| | | <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
| | | <template #default="scope"> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-view" |
| | | @click="openExamApply(scope.row,'view')" |
| | | >查看详情</el-button> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-edit" |
| | | @click="openExamApply(scope.row,'edit')" |
| | | v-hasPermi="['system:experts:remove']" |
| | | >编辑</el-button> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | style="color: red" |
| | | icon="el-icon-delete" |
| | | @click="handleDelete(scope.row)" |
| | | v-hasPermi="['system:experts:remove']" |
| | | >删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <pagination |
| | | v-show="total>0" |
| | | :total="total" |
| | | :page.sync="queryParams.pageNum" |
| | | :limit.sync="queryParams.pageSize" |
| | | @pagination="getList" |
| | | /> |
| | | <examApply-dialog ref="examApplyDialog" @getList="getList" :typeList="typeList"></examApply-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | import examApplyDialog from "@/views/commonMod/examApply/components/examApplyDialog"; |
| | | import {getOperatePage} from "@/api/coalMine/operateType"; |
| | | import {delExamApply, getExamPage} from "@/api/commonMod/examApply"; |
| | | import {getAreaList} from "@/api/coalMine/placeManage/train"; |
| | | export default { |
| | | name: "examApply", |
| | | dicts: [], |
| | | components: { |
| | | examApplyDialog |
| | | }, |
| | | data() { |
| | | return { |
| | | violationDialog: '', |
| | | loading: false, |
| | | showSearch: true, |
| | | dataList: [], |
| | | total: 0, |
| | | typeList: [], |
| | | areaList: [], |
| | | queryParams: { |
| | | districtId: null, |
| | | isCm: 2, |
| | | examStartTime: '', |
| | | examEndTime: '', |
| | | pageNum: 1, |
| | | pageSize: 10 |
| | | } |
| | | }; |
| | | }, |
| | | created() { |
| | | this.getList() |
| | | this.getTypeList() |
| | | this.getArea() |
| | | }, |
| | | methods: { |
| | | async getList(){ |
| | | const t = this |
| | | t.loading = true |
| | | const res = await getExamPage(t.queryParams) |
| | | if(res.code == 200){ |
| | | t.dataList = res.rows |
| | | t.total = res.total |
| | | }else{ |
| | | t.$message({ |
| | | message: res.msg, |
| | | type: 'warning' |
| | | }) |
| | | } |
| | | t.loading = false |
| | | }, |
| | | async getTypeList() { |
| | | this.loading = true; |
| | | const res = await getOperatePage({name: ''}) |
| | | if(res.code == 200){ |
| | | this.typeList = this.handleTree(res.data, "id"); |
| | | }else{ |
| | | this.$message({ |
| | | type: 'warning', |
| | | message: res.msg |
| | | }); |
| | | } |
| | | this.loading = false; |
| | | }, |
| | | async getArea() { |
| | | const res = await getAreaList(); |
| | | if(res.code == 200) { |
| | | this.areaList = res.data; |
| | | } |
| | | }, |
| | | handleDelete(row){ |
| | | this.$confirm('此操作将永久删除该条数据, 是否继续?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(async () => { |
| | | const res = await delExamApply([row.applyId]) |
| | | if(res.code == 200){ |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '删除成功!' |
| | | }); |
| | | await this.getList() |
| | | }else{ |
| | | this.$message({ |
| | | type: 'warning', |
| | | message: res.msg |
| | | }); |
| | | } |
| | | }).catch(() => { |
| | | |
| | | }); |
| | | }, |
| | | handleQuery(){ |
| | | this.queryParams.pageNum = 1 |
| | | this.getList() |
| | | }, |
| | | resetQuery(){ |
| | | this.queryParams = { |
| | | name: '', |
| | | idCard:'', |
| | | dept: '', |
| | | operateTypeId: null, |
| | | isCm: 2, |
| | | pageNum: 1, |
| | | pageSize: 10 |
| | | } |
| | | this.getList() |
| | | }, |
| | | changeType(){ |
| | | this.queryParams.pageNum = 1 |
| | | this.getList() |
| | | }, |
| | | openExamApply(data,type){ |
| | | this.$refs.examApplyDialog.openDialog(data,type); |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | |
| | | <h6>对不起,您没有访问权限,请不要进行非法操作!您可以返回主页面</h6> |
| | | <ul class="list-unstyled"> |
| | | <li class="link-type"> |
| | | <router-link to="/"> |
| | | <router-link :to="indexPage"> |
| | | 回首页 |
| | | </router-link> |
| | | </li> |
| | |
| | | |
| | | <script> |
| | | import errGif from '@/assets/401_images/401.gif' |
| | | import {mapState} from "vuex"; |
| | | |
| | | export default { |
| | | name: 'Page401', |
| | |
| | | return { |
| | | errGif: errGif + '?' + +new Date() |
| | | } |
| | | },computed: { |
| | | ...mapState({ |
| | | indexPage: state => state.permission.indexPage |
| | | }) |
| | | }, |
| | | methods: { |
| | | back() { |
| | |
| | | type="password" |
| | | auto-complete="off" |
| | | placeholder="密码" |
| | | show-password |
| | | @keyup.enter.native="handleLogin" |
| | | > |
| | | <svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon" /> |
| | |
| | | watch: { |
| | | $route: { |
| | | handler: function(route) { |
| | | // this.redirect = route.query && route.query.redirect; |
| | | this.redirect = '/notCoalMine/nPeopleManage' |
| | | console.log(route,'route') |
| | | this.redirect = route.query && route.query.redirect; |
| | | // this.redirect = '/notCoalMine/nPeopleManage' |
| | | }, |
| | | immediate: true |
| | | } |
| | |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="用户名称" prop="userName"> |
| | | <el-form-item label="用户名" prop="userName"> |
| | | <el-input |
| | | v-model="queryParams.userName" |
| | | placeholder="请输入用户名称" |
| | | placeholder="请输入用户名" |
| | | clearable |
| | | style="width: 240px;" |
| | | @keyup.enter.native="handleQuery" |
| | |
| | | <el-table ref="tables" v-loading="loading" :data="list" @selection-change="handleSelectionChange" :default-sort="defaultSort" @sort-change="handleSortChange"> |
| | | <el-table-column type="selection" width="55" align="center" /> |
| | | <el-table-column label="访问编号" align="center" prop="infoId" /> |
| | | <el-table-column label="用户名称" align="center" prop="userName" :show-overflow-tooltip="true" sortable="custom" :sort-orders="['descending', 'ascending']" /> |
| | | <el-table-column label="用户名" align="center" prop="userName" :show-overflow-tooltip="true" sortable="custom" :sort-orders="['descending', 'ascending']" /> |
| | | <el-table-column label="登录地址" align="center" prop="ipaddr" width="130" :show-overflow-tooltip="true" /> |
| | | <el-table-column label="登录地点" align="center" prop="loginLocation" :show-overflow-tooltip="true" /> |
| | | <el-table-column label="浏览器" align="center" prop="browser" :show-overflow-tooltip="true" /> |
| | |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="用户名称" prop="userName"> |
| | | <el-form-item label="用户名" prop="userName"> |
| | | <el-input |
| | | v-model="queryParams.userName" |
| | | placeholder="请输入用户名称" |
| | | placeholder="请输入用户名" |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | |
| | | <script> |
| | | // import {getExpertTypes,addExpertInfo,uploadFile} from '@/api/system/form' |
| | | // import { verifySimplePhone, verifyIdCard } from "@/utils/validate"; |
| | | import { getToken } from "@/utils/auth"; |
| | | import axios from "axios"; |
| | | export default { |
| | | name: "nCertificateDialog", |
| | |
| | | return key in obj |
| | | }, |
| | | |
| | | async getExpertsType(){ |
| | | const res = await getExpertTypes() |
| | | if(res.code == 200){ |
| | | this.expertsType = res.data |
| | | }else{ |
| | | this.$message({ |
| | | type: 'warning', |
| | | message: res.msg |
| | | }); |
| | | } |
| | | }, |
| | | // async getExpertsType(){ |
| | | // const res = await getExpertTypes() |
| | | // if(res.code == 200){ |
| | | // this.expertsType = res.data |
| | | // }else{ |
| | | // this.$message({ |
| | | // type: 'warning', |
| | | // message: res.msg |
| | | // }); |
| | | // } |
| | | // }, |
| | | avatorChange(file, fileList) { |
| | | this.fileList = fileList; |
| | | }, |
| | |
| | | <script> |
| | | export default { |
| | | created() { |
| | | console.log(this.$store,'rout') |
| | | const { params, query } = this.$route |
| | | const { path } = params |
| | | this.$router.replace({ path: '/' + path, query }) |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"> |
| | | <el-form-item label="用户名称" prop="userName"> |
| | | <el-form-item label="用户名" prop="userName"> |
| | | <el-input |
| | | v-model="queryParams.userName" |
| | | placeholder="请输入用户名称" |
| | | placeholder="请输入用户名" |
| | | clearable |
| | | style="width: 240px" |
| | | @keyup.enter.native="handleQuery" |
| | |
| | | |
| | | <el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange"> |
| | | <el-table-column type="selection" width="55" align="center" /> |
| | | <el-table-column label="用户名称" prop="userName" :show-overflow-tooltip="true" /> |
| | | <el-table-column label="用户昵称" prop="nickName" :show-overflow-tooltip="true" /> |
| | | <el-table-column label="用户名" prop="userName" :show-overflow-tooltip="true" /> |
| | | <el-table-column label="真实姓名" prop="nickName" :show-overflow-tooltip="true" /> |
| | | <el-table-column label="邮箱" prop="email" :show-overflow-tooltip="true" /> |
| | | <el-table-column label="手机" prop="phonenumber" :show-overflow-tooltip="true" /> |
| | | <el-table-column label="状态" align="center" prop="status"> |
| | |
| | | <!-- 授权用户 --> |
| | | <el-dialog title="选择用户" :visible.sync="visible" width="800px" top="5vh" append-to-body> |
| | | <el-form :model="queryParams" ref="queryForm" size="small" :inline="true"> |
| | | <el-form-item label="用户名称" prop="userName"> |
| | | <el-form-item label="用户名" prop="userName"> |
| | | <el-input |
| | | v-model="queryParams.userName" |
| | | placeholder="请输入用户名称" |
| | | placeholder="请输入用户名" |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | |
| | | <el-row> |
| | | <el-table @row-click="clickRow" ref="table" :data="userList" @selection-change="handleSelectionChange" height="260px"> |
| | | <el-table-column type="selection" width="55"></el-table-column> |
| | | <el-table-column label="用户名称" prop="userName" :show-overflow-tooltip="true" /> |
| | | <el-table-column label="用户昵称" prop="nickName" :show-overflow-tooltip="true" /> |
| | | <el-table-column label="用户名" prop="userName" :show-overflow-tooltip="true" /> |
| | | <el-table-column label="真实姓名" prop="nickName" :show-overflow-tooltip="true" /> |
| | | <el-table-column label="邮箱" prop="email" :show-overflow-tooltip="true" /> |
| | | <el-table-column label="手机" prop="phonenumber" :show-overflow-tooltip="true" /> |
| | | <el-table-column label="状态" align="center" prop="status"> |
| | |
| | | <el-form ref="form" :model="form" label-width="80px"> |
| | | <el-row> |
| | | <el-col :span="8" :offset="2"> |
| | | <el-form-item label="用户昵称" prop="nickName"> |
| | | <el-form-item label="真实姓名" prop="nickName"> |
| | | <el-input v-model="form.nickName" disabled /> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | <!--用户数据--> |
| | | <el-col :span="20" :xs="24"> |
| | | <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> |
| | | <el-form-item label="用户名称" prop="userName"> |
| | | <el-form-item label="用户名" prop="userName"> |
| | | <el-input |
| | | v-model="queryParams.userName" |
| | | placeholder="请输入用户名称" |
| | | placeholder="请输入用户名" |
| | | clearable |
| | | style="width: 240px" |
| | | @keyup.enter.native="handleQuery" |
| | |
| | | <el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange"> |
| | | <el-table-column type="selection" width="50" align="center" /> |
| | | <el-table-column label="用户编号" align="center" key="userId" prop="userId" v-if="columns[0].visible" /> |
| | | <el-table-column label="用户名称" align="center" key="userName" prop="userName" v-if="columns[1].visible" :show-overflow-tooltip="true" /> |
| | | <el-table-column label="用户昵称" align="center" key="nickName" prop="nickName" v-if="columns[2].visible" :show-overflow-tooltip="true" /> |
| | | <el-table-column label="部门" align="center" key="deptName" prop="dept.deptName" v-if="columns[3].visible" :show-overflow-tooltip="true" /> |
| | | <el-table-column label="真实姓名" align="center" key="nickName" prop="nickName" v-if="columns[2].visible" :show-overflow-tooltip="true" /> |
| | | <el-table-column label="用户名" align="center" key="userName" prop="userName" v-if="columns[1].visible" :show-overflow-tooltip="true" /> |
| | | <el-table-column label="手机号码" align="center" key="phonenumber" prop="phonenumber" v-if="columns[4].visible" width="120" /> |
| | | <el-table-column label="部门" align="center" key="deptName" prop="dept.deptName" v-if="columns[3].visible" :show-overflow-tooltip="true" /> |
| | | <el-table-column label="状态" align="center" key="status" v-if="columns[5].visible"> |
| | | <template slot-scope="scope"> |
| | | <el-switch |
| | |
| | | </el-row> |
| | | |
| | | <!-- 添加或修改用户配置对话框 --> |
| | | <el-dialog :title="title" :visible.sync="open" width="600px" append-to-body> |
| | | <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body> |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="80px"> |
| | | <el-row> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="用户昵称" prop="nickName"> |
| | | <el-input v-model="form.nickName" placeholder="请输入用户昵称" maxlength="30" /> |
| | | <el-form-item label="真实姓名" prop="nickName"> |
| | | <el-input v-model="form.nickName" placeholder="请输入真实姓名" maxlength="30" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <!-- <el-col :span="12">--> |
| | | <!-- <el-form-item label="归属部门" prop="deptId">--> |
| | | <!-- <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门" />--> |
| | | <!-- </el-form-item>--> |
| | | <!-- </el-col>--> |
| | | </el-row> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <el-form-item v-if="form.userId == undefined" label="用户名" prop="userName"> |
| | | <el-input v-model="form.userName" placeholder="请输入用户名" maxlength="30" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="归属部门" prop="deptId"> |
| | | <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门" /> |
| | | <el-form-item v-if="form.userId == undefined" label="用户密码" prop="password"> |
| | | <el-input v-model="form.password" placeholder="请输入用户密码" type="password" maxlength="20" show-password/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="手机号码" prop="phonenumber"> |
| | | <el-input v-model="form.phonenumber" placeholder="请输入手机号码" maxlength="11" /> |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <el-form-item v-if="form.userId == undefined" label="用户名称" prop="userName"> |
| | | <el-input v-model="form.userName" placeholder="请输入用户名称" maxlength="30" /> |
| | | <el-form-item label="身份证号"> |
| | | <el-input v-model="form.idCard" placeholder="请输入身份证号" maxlength="18"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item v-if="form.userId == undefined" label="用户密码" prop="password"> |
| | | <el-input v-model="form.password" placeholder="请输入用户密码" type="password" maxlength="20" show-password/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="用户性别"> |
| | | <el-select v-model="form.sex" placeholder="请选择性别"> |
| | | <el-select v-model="form.sex" placeholder="请选择性别" style="width: 100%"> |
| | | <el-option |
| | | v-for="dict in dict.type.sys_user_sex" |
| | | :key="dict.value" |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="状态"> |
| | | <el-radio-group v-model="form.status"> |
| | | <el-radio |
| | | v-for="dict in dict.type.sys_normal_disable" |
| | | :key="dict.value" |
| | | :label="dict.value" |
| | | >{{dict.label}}</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-row :gutter="20"> |
| | | <!-- <el-col :span="12">--> |
| | | <!-- <el-form-item label="岗位">--> |
| | | <!-- <el-select v-model="form.postIds" multiple placeholder="请选择岗位">--> |
| | | <!-- <el-option--> |
| | | <!-- v-for="item in postOptions"--> |
| | | <!-- :key="item.postId"--> |
| | | <!-- :label="item.postName"--> |
| | | <!-- :value="item.postId"--> |
| | | <!-- :disabled="item.status == 1"--> |
| | | <!-- ></el-option>--> |
| | | <!-- </el-select>--> |
| | | <!-- </el-form-item>--> |
| | | <!-- </el-col>--> |
| | | <el-col :span="12"> |
| | | <el-form-item label="岗位"> |
| | | <el-select v-model="form.postIds" multiple placeholder="请选择岗位"> |
| | | <el-option |
| | | v-for="item in postOptions" |
| | | :key="item.postId" |
| | | :label="item.postName" |
| | | :value="item.postId" |
| | | :disabled="item.status == 1" |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="角色"> |
| | | <el-select v-model="form.roleIds" multiple placeholder="请选择角色"> |
| | | <el-form-item label="角色" prop="roleIds"> |
| | | <el-select v-model="form.roleIds" multiple placeholder="请选择角色" style="width: 100%" @change="getSections"> |
| | | <el-option |
| | | v-for="item in roleOptions" |
| | | :key="item.roleId" |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12" v-if="showInstitutuion"> |
| | | <el-form-item label="所属机构" prop="institutionIds"> |
| | | <el-select v-model="form.institutionIds" multiple placeholder="请选择所属机构" style="width: 100%"> |
| | | <el-option |
| | | v-for="item in sectionOptions" |
| | | :key="item.institutionId" |
| | | :label="item.institutionName" |
| | | :value="item.institutionId" |
| | | :disabled="item.status == 1" |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="所属地区"> |
| | | <el-select v-model="form.districtId" placeholder="请选择" style="width: 100%;"> |
| | | <el-option |
| | | v-for="item in areaList" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.id"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="状态"> |
| | | <el-radio-group v-model="form.status" style="width: 100%;"> |
| | | <el-radio |
| | | v-for="dict in dict.type.sys_normal_disable" |
| | | :key="dict.value" |
| | | :label="dict.value" |
| | | >{{dict.label}}</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="备注"> |
| | | <el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input> |
| | |
| | | import { getToken } from "@/utils/auth"; |
| | | import Treeselect from "@riophae/vue-treeselect"; |
| | | import "@riophae/vue-treeselect/dist/vue-treeselect.css"; |
| | | import {getAreaList, getTrainPage} from "@/api/coalMine/placeManage/train"; |
| | | |
| | | export default { |
| | | name: "User", |
| | |
| | | dateRange: [], |
| | | // 岗位选项 |
| | | postOptions: [], |
| | | sectionOptions: [], |
| | | areaList: [], |
| | | // 角色选项 |
| | | roleOptions: [], |
| | | // 表单参数 |
| | |
| | | status: undefined, |
| | | deptId: undefined |
| | | }, |
| | | showInstitutuion: false, |
| | | // 列信息 |
| | | columns: [ |
| | | { key: 0, label: `用户编号`, visible: true }, |
| | | { key: 1, label: `用户名称`, visible: true }, |
| | | { key: 2, label: `用户昵称`, visible: true }, |
| | | { key: 1, label: `用户名`, visible: true }, |
| | | { key: 2, label: `真实姓名`, visible: true }, |
| | | { key: 3, label: `部门`, visible: true }, |
| | | { key: 4, label: `手机号码`, visible: true }, |
| | | { key: 5, label: `状态`, visible: true }, |
| | |
| | | // 表单校验 |
| | | rules: { |
| | | userName: [ |
| | | { required: true, message: "用户名称不能为空", trigger: "blur" }, |
| | | { min: 2, max: 20, message: '用户名称长度必须介于 2 和 20 之间', trigger: 'blur' } |
| | | { required: true, message: "用户名不能为空", trigger: "blur" }, |
| | | { min: 2, max: 20, message: '用户名长度必须介于 2 和 20 之间', trigger: 'blur' } |
| | | ], |
| | | nickName: [ |
| | | { required: true, message: "用户昵称不能为空", trigger: "blur" } |
| | | { required: true, message: "真实姓名不能为空", trigger: "blur" } |
| | | ], |
| | | roleIds: [ |
| | | { required: true, message: "角色不能为空", trigger: "blur" } |
| | | ], |
| | | institutionIds: [ |
| | | { required: true, message: "所属机构不能为空", trigger: "blur" } |
| | | ], |
| | | password: [ |
| | | { required: true, message: "用户密码不能为空", trigger: "blur" }, |
| | |
| | | created() { |
| | | this.getList(); |
| | | this.getDeptTree(); |
| | | this.getConfigKey("sys.user.initPassword").then(response => { |
| | | this.initPassword = response.msg; |
| | | }); |
| | | this.getArea() |
| | | // this.getConfigKey("sys.user.initPassword").then(response => { |
| | | // console.log(response,55) |
| | | // this.initPassword = response.msg; |
| | | // }) |
| | | }, |
| | | methods: { |
| | | /** 查询用户列表 */ |
| | | getList() { |
| | | this.loading = true; |
| | | listUser(this.addDateRange(this.queryParams, this.dateRange)).then(response => { |
| | | this.userList = response.rows; |
| | | this.total = response.total; |
| | | this.userList = response.rows |
| | | this.total = response.total |
| | | this.loading = false; |
| | | } |
| | | ); |
| | |
| | | nickName: undefined, |
| | | password: undefined, |
| | | phonenumber: undefined, |
| | | idCard: undefined, |
| | | email: undefined, |
| | | sex: undefined, |
| | | status: "0", |
| | | remark: undefined, |
| | | postIds: [], |
| | | roleIds: [] |
| | | roleIds: [], |
| | | institutionIds: [] |
| | | }; |
| | | this.resetForm("form"); |
| | | }, |
| | |
| | | this.$refs.tree.setCurrentKey(null); |
| | | this.handleQuery(); |
| | | }, |
| | | getSections(val){ |
| | | this.sectionOptions = [] |
| | | if(val.indexOf(100)>-1 && val.indexOf(102)>-1){ |
| | | this.getSectionList() |
| | | this.showInstitutuion = true |
| | | }else if(val.indexOf(100)>-1 && val.indexOf(102) == -1){ |
| | | this.getSectionList(0) |
| | | this.showInstitutuion = true |
| | | }else if(val.indexOf(100) == -1 && val.indexOf(102) > -1){ |
| | | this.getSectionList(1) |
| | | this.showInstitutuion = true |
| | | }else{ |
| | | this.sectionOptions = [] |
| | | this.showInstitutuion = false |
| | | } |
| | | }, |
| | | |
| | | async getSectionList(type) { |
| | | this.loading = true; |
| | | const param = { |
| | | isCm: type, |
| | | pageNum: 1, |
| | | pageSize: 999 |
| | | } |
| | | const res = await getTrainPage(param); |
| | | if(res.code == 200) { |
| | | this.sectionOptions = res.rows; |
| | | }else { |
| | | this.$message({ |
| | | message: res.msg, |
| | | type: 'warning' |
| | | }) |
| | | } |
| | | this.loading = false; |
| | | }, |
| | | |
| | | async getArea() { |
| | | const res = await getAreaList(); |
| | | if(res.code == 200) { |
| | | this.areaList = res.data; |
| | | } |
| | | }, |
| | | |
| | | // 多选框选中数据 |
| | | handleSelectionChange(selection) { |
| | | this.ids = selection.map(item => item.userId); |
| | |
| | | this.roleOptions = response.roles; |
| | | this.open = true; |
| | | this.title = "添加用户"; |
| | | this.form.password = this.initPassword; |
| | | // this.form.password = this.initPassword; |
| | | }); |
| | | }, |
| | | /** 修改按钮操作 */ |
| | |
| | | this.open = true; |
| | | this.title = "修改用户"; |
| | | this.form.password = ""; |
| | | if(response.roleIds.indexOf(100)>-1 || response.roleIds.indexOf(102)>-1){ |
| | | this.getSectionList() |
| | | this.showInstitutuion = true |
| | | this.form.institutionIds = response.data.institutions.map(i=>i.institutionId.toString()) |
| | | } |
| | | }); |
| | | }, |
| | | /** 重置密码按钮操作 */ |
| | |
| | | submitForm: function() { |
| | | this.$refs["form"].validate(valid => { |
| | | if (valid) { |
| | | console.log(this.form,'form') |
| | | if (this.form.userId != undefined) { |
| | | updateUser(this.form).then(response => { |
| | | this.$modal.msgSuccess("修改成功"); |
| | |
| | | }); |
| | | } else { |
| | | addUser(this.form).then(response => { |
| | | this.$modal.msgSuccess("新增成功"); |
| | | this.open = false; |
| | | this.getList(); |
| | | this.$modal.msgSuccess("新增成功") |
| | | this.open = false |
| | | this.getList() |
| | | }); |
| | | } |
| | | } |
| | |
| | | </div> |
| | | <ul class="list-group list-group-striped"> |
| | | <li class="list-group-item"> |
| | | <svg-icon icon-class="user" />用户名称 |
| | | <svg-icon icon-class="user" />用户名 |
| | | <div class="pull-right">{{ user.userName }}</div> |
| | | </li> |
| | | <li class="list-group-item"> |
| | |
| | | <template> |
| | | <el-form ref="form" :model="user" :rules="rules" label-width="80px"> |
| | | <el-form-item label="用户昵称" prop="nickName"> |
| | | <el-form-item label="真实姓名" prop="nickName"> |
| | | <el-input v-model="user.nickName" maxlength="30" /> |
| | | </el-form-item> |
| | | <el-form-item label="手机号码" prop="phonenumber"> |
| | |
| | | // 表单校验 |
| | | rules: { |
| | | nickName: [ |
| | | { required: true, message: "用户昵称不能为空", trigger: "blur" } |
| | | { required: true, message: "真实姓名不能为空", trigger: "blur" } |
| | | ], |
| | | email: [ |
| | | { required: true, message: "邮箱地址不能为空", trigger: "blur" }, |