Showing
21 changed files
with
2528 additions
and
435 deletions
| 1 | import request from '@/utils/request' | 1 | import request from '@/utils/request' |
| 2 | import { praseStrEmpty } from "@/utils/FedEx"; | 2 | import { praseStrEmpty } from "@/utils/FedEx"; |
| 3 | 3 | ||
| 4 | +// // 修改用户 | ||
| 5 | +// export function updateUser(data) { | ||
| 6 | +// return request({ | ||
| 7 | +// url: '/system/user', | ||
| 8 | +// method: 'put', | ||
| 9 | +// data: data | ||
| 10 | +// }) | ||
| 11 | +// } | ||
| 12 | + | ||
| 13 | +// // 导出用户 | ||
| 14 | +// export function exportUser(query) { | ||
| 15 | +// return request({ | ||
| 16 | +// url: '/system/user/export', | ||
| 17 | +// method: 'get', | ||
| 18 | +// params: query | ||
| 19 | +// }) | ||
| 20 | +// } | ||
| 21 | + | ||
| 22 | +// // 用户密码重置 | ||
| 23 | +// export function resetUserPwd(userId, password) { | ||
| 24 | +// const data = { | ||
| 25 | +// userId, | ||
| 26 | +// password | ||
| 27 | +// } | ||
| 28 | +// return request({ | ||
| 29 | +// url: '/system/user/resetPwd', | ||
| 30 | +// method: 'put', | ||
| 31 | +// data: data | ||
| 32 | +// }) | ||
| 33 | +// } | ||
| 34 | + | ||
| 35 | +// // 用户状态修改 | ||
| 36 | +// export function changeUserStatus(userId, status) { | ||
| 37 | +// const data = { | ||
| 38 | +// userId, | ||
| 39 | +// status | ||
| 40 | +// } | ||
| 41 | +// return request({ | ||
| 42 | +// url: '/system/user/changeStatus', | ||
| 43 | +// method: 'put', | ||
| 44 | +// data: data | ||
| 45 | +// }) | ||
| 46 | +// } | ||
| 47 | + | ||
| 48 | +// // 查询用户个人信息 | ||
| 49 | +// export function getUserProfile() { | ||
| 50 | +// return request({ | ||
| 51 | +// url: '/system/user/profile', | ||
| 52 | +// method: 'get' | ||
| 53 | +// }) | ||
| 54 | +// } | ||
| 55 | + | ||
| 56 | +// // 修改用户个人信息 | ||
| 57 | +// export function updateUserProfile(data) { | ||
| 58 | +// return request({ | ||
| 59 | +// url: '/system/user/profile', | ||
| 60 | +// method: 'put', | ||
| 61 | +// data: data | ||
| 62 | +// }) | ||
| 63 | +// } | ||
| 64 | + | ||
| 65 | +// // 用户密码重置 | ||
| 66 | +// export function updateUserPwd(oldPassword, newPassword) { | ||
| 67 | +// const data = { | ||
| 68 | +// oldPassword, | ||
| 69 | +// newPassword | ||
| 70 | +// } | ||
| 71 | +// return request({ | ||
| 72 | +// url: '/system/user/profile/updatePwd', | ||
| 73 | +// method: 'put', | ||
| 74 | +// params: data | ||
| 75 | +// }) | ||
| 76 | +// } | ||
| 77 | + | ||
| 78 | +// // 用户头像上传 | ||
| 79 | +// export function uploadAvatar(data) { | ||
| 80 | +// return request({ | ||
| 81 | +// url: '/system/user/profile/avatar', | ||
| 82 | +// method: 'post', | ||
| 83 | +// data: data | ||
| 84 | +// }) | ||
| 85 | +// } | ||
| 86 | + | ||
| 87 | +// // 下载用户导入模板 | ||
| 88 | +// export function importTemplate() { | ||
| 89 | +// return request({ | ||
| 90 | +// url: '/system/user/importTemplate', | ||
| 91 | +// method: 'get' | ||
| 92 | +// }) | ||
| 93 | +// } | ||
| 94 | + | ||
| 4 | // 查询用户列表 | 95 | // 查询用户列表 |
| 5 | -export function listUser(query) { | 96 | +export function listUser(data) { |
| 6 | return request({ | 97 | return request({ |
| 7 | - url: '/system/user/list', | 98 | + url: '/sysUser/getUserList', |
| 8 | - method: 'get', | 99 | + method: 'post', |
| 9 | - params: query | 100 | + data: data |
| 10 | }) | 101 | }) |
| 11 | } | 102 | } |
| 12 | 103 | ||
| 13 | // 查询用户详细 | 104 | // 查询用户详细 |
| 14 | -export function getUser(userId) { | 105 | +export function detailUser(userId) { |
| 15 | return request({ | 106 | return request({ |
| 16 | - url: '/system/user/' + praseStrEmpty(userId), | 107 | + url: '/sysUser/detailUser?id=' + praseStrEmpty(userId), |
| 17 | method: 'get' | 108 | method: 'get' |
| 18 | }) | 109 | }) |
| 19 | } | 110 | } |
| 20 | 111 | ||
| 21 | // 新增用户 | 112 | // 新增用户 |
| 22 | -export function addUser(data) { | 113 | +export function addOrUpdateUser(data) { |
| 23 | return request({ | 114 | return request({ |
| 24 | - url: '/system/user', | 115 | + url: '/sysUser/addOrUpdateUser', |
| 25 | method: 'post', | 116 | method: 'post', |
| 26 | data: data | 117 | data: data |
| 27 | }) | 118 | }) |
| 28 | } | 119 | } |
| 29 | 120 | ||
| 30 | -// 修改用户 | 121 | +// 修改用户状态 |
| 31 | -export function updateUser(data) { | 122 | +export function updateUserStatus(data) { |
| 32 | return request({ | 123 | return request({ |
| 33 | - url: '/system/user', | 124 | + url: '/sysUser/updateUserStatus', |
| 34 | - method: 'put', | 125 | + method: 'post', |
| 35 | data: data | 126 | data: data |
| 36 | }) | 127 | }) |
| 37 | } | 128 | } |
| 38 | 129 | ||
| 39 | -// 删除用户 | 130 | +//菜单信息 |
| 40 | -export function delUser(userId) { | 131 | +export function getAllAuth() { |
| 41 | return request({ | 132 | return request({ |
| 42 | - url: '/system/user/' + userId, | 133 | + url: '/sysMenu/getAllAuth', |
| 43 | - method: 'delete' | 134 | + method: 'get' |
| 44 | }) | 135 | }) |
| 45 | } | 136 | } |
| 46 | 137 | ||
| 47 | -// 导出用户 | 138 | +//菜单开启关闭 |
| 48 | -export function exportUser(query) { | 139 | +export function updateStatus(data) { |
| 49 | return request({ | 140 | return request({ |
| 50 | - url: '/system/user/export', | 141 | + url: '/sysMenu/updateStatus', |
| 51 | - method: 'get', | 142 | + method: 'post', |
| 52 | - params: query | 143 | + data: data |
| 53 | }) | 144 | }) |
| 54 | } | 145 | } |
| 55 | 146 | ||
| 56 | -// 用户密码重置 | 147 | +//角色列表 |
| 57 | -export function resetUserPwd(userId, password) { | 148 | +export function getRoleList(data) { |
| 58 | - const data = { | ||
| 59 | - userId, | ||
| 60 | - password | ||
| 61 | - } | ||
| 62 | return request({ | 149 | return request({ |
| 63 | - url: '/system/user/resetPwd', | 150 | + url: '/role/getRoleList', |
| 64 | - method: 'put', | 151 | + method: 'post', |
| 65 | data: data | 152 | data: data |
| 66 | }) | 153 | }) |
| 67 | } | 154 | } |
| 68 | 155 | ||
| 69 | -// 用户状态修改 | 156 | +//角色详情 |
| 70 | -export function changeUserStatus(userId, status) { | 157 | +export function detailRole(id) { |
| 71 | - const data = { | ||
| 72 | - userId, | ||
| 73 | - status | ||
| 74 | - } | ||
| 75 | return request({ | 158 | return request({ |
| 76 | - url: '/system/user/changeStatus', | 159 | + url: '/role/detailRole?id=' + id, |
| 77 | - method: 'put', | 160 | + method: 'get', |
| 78 | - data: data | ||
| 79 | }) | 161 | }) |
| 80 | } | 162 | } |
| 81 | 163 | ||
| 82 | -// 查询用户个人信息 | 164 | +//新增修改角色 |
| 83 | -export function getUserProfile() { | 165 | +export function addOrUpdateRole(data) { |
| 84 | return request({ | 166 | return request({ |
| 85 | - url: '/system/user/profile', | 167 | + url: '/role/addOrUpdateRole', |
| 86 | - method: 'get' | 168 | + method: 'post', |
| 169 | + data: data | ||
| 87 | }) | 170 | }) |
| 88 | } | 171 | } |
| 89 | 172 | ||
| 90 | -// 修改用户个人信息 | 173 | +//角色状态修改 |
| 91 | -export function updateUserProfile(data) { | 174 | +export function updateRoleStatus(data) { |
| 92 | return request({ | 175 | return request({ |
| 93 | - url: '/system/user/profile', | 176 | + url: '/role/updateRoleStatus', |
| 94 | - method: 'put', | 177 | + method: 'post', |
| 95 | data: data | 178 | data: data |
| 96 | }) | 179 | }) |
| 97 | } | 180 | } |
| 98 | 181 | ||
| 99 | -// 用户密码重置 | 182 | +//口岸列表 |
| 100 | -export function updateUserPwd(oldPassword, newPassword) { | 183 | +export function portNameList() { |
| 101 | - const data = { | ||
| 102 | - oldPassword, | ||
| 103 | - newPassword | ||
| 104 | - } | ||
| 105 | return request({ | 184 | return request({ |
| 106 | - url: '/system/user/profile/updatePwd', | 185 | + url: '/dictionary/port', |
| 107 | - method: 'put', | 186 | + method: 'get', |
| 108 | - params: data | ||
| 109 | }) | 187 | }) |
| 110 | } | 188 | } |
| 111 | 189 | ||
| 112 | -// 用户头像上传 | 190 | +//口岸变更 |
| 113 | -export function uploadAvatar(data) { | 191 | +export function changeCurrentPort(data) { |
| 114 | return request({ | 192 | return request({ |
| 115 | - url: '/system/user/profile/avatar', | 193 | + url: '/sysUser/changeCurrentPort', |
| 116 | method: 'post', | 194 | method: 'post', |
| 117 | data: data | 195 | data: data |
| 118 | }) | 196 | }) |
| 119 | -} | 197 | +} |
| 120 | - | ||
| 121 | -// 下载用户导入模板 | ||
| 122 | -export function importTemplate() { | ||
| 123 | - return request({ | ||
| 124 | - url: '/system/user/importTemplate', | ||
| 125 | - method: 'get' | ||
| 126 | - }) | ||
| 127 | -} | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -3,26 +3,44 @@ | ... | @@ -3,26 +3,44 @@ |
| 3 | * Copyright (c) 2019 FedEx | 3 | * Copyright (c) 2019 FedEx |
| 4 | */ | 4 | */ |
| 5 | 5 | ||
| 6 | -import store from '@/store' | 6 | + import store from '@/store' |
| 7 | 7 | ||
| 8 | -export default { | 8 | + export default { |
| 9 | - inserted(el, binding, vnode) { | 9 | + inserted(el, binding, vnode) { |
| 10 | - const { value } = binding | 10 | + const { value } = binding |
| 11 | - const all_permission = "*:*:*"; | 11 | + const all_permission = "*:*:*"; |
| 12 | - const permissions = store.getters && store.getters.permissions | 12 | + const permissions = store.getters && store.getters.permissions |
| 13 | - | 13 | + |
| 14 | - if (value && value instanceof Array && value.length > 0) { | 14 | + if (value && value instanceof Array && value.length > 0) { |
| 15 | - const permissionFlag = value | 15 | + const permissionFlag = value |
| 16 | - | 16 | + |
| 17 | - const hasPermissions = permissions.some(permission => { | 17 | + const hasPermissions = permissions.some(permission => { |
| 18 | - return all_permission === permission || permissionFlag.includes(permission) | 18 | + return all_permission === permission || permissionFlag.includes(permission) |
| 19 | - }) | 19 | + }) |
| 20 | - | 20 | + |
| 21 | - if (!hasPermissions) { | 21 | + if (!hasPermissions) { |
| 22 | - el.parentNode && el.parentNode.removeChild(el) | 22 | + el.parentNode && el.parentNode.removeChild(el) |
| 23 | + } | ||
| 24 | + } else { | ||
| 25 | + throw new Error(`请设置操作权限标签值`) | ||
| 23 | } | 26 | } |
| 24 | - } else { | 27 | + }, |
| 25 | - throw new Error(`请设置操作权限标签值`) | 28 | + |
| 29 | + //路由权限处理 | ||
| 30 | + routerPer(router){ | ||
| 31 | + const permissions = store.getters && store.getters.permissions | ||
| 32 | + let newRouter = []; | ||
| 33 | + router.forEach(item => { | ||
| 34 | + permissions.forEach(per=>{ | ||
| 35 | + if(item.meta.permissions == per){ | ||
| 36 | + newRouter.push(item) | ||
| 37 | + } | ||
| 38 | + }) | ||
| 39 | + if(item.children && item.children.length){ | ||
| 40 | + item.children = this.routerPer(item.children) | ||
| 41 | + } | ||
| 42 | + }); | ||
| 43 | + return newRouter | ||
| 26 | } | 44 | } |
| 27 | } | 45 | } |
| 28 | -} | 46 | + |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -6,7 +6,6 @@ | ... | @@ -6,7 +6,6 @@ |
| 6 | class="hamburger-container" | 6 | class="hamburger-container" |
| 7 | @toggleClick="toggleSideBar" | 7 | @toggleClick="toggleSideBar" |
| 8 | /> | 8 | /> |
| 9 | - | ||
| 10 | <breadcrumb | 9 | <breadcrumb |
| 11 | id="breadcrumb-container" | 10 | id="breadcrumb-container" |
| 12 | class="breadcrumb-container" | 11 | class="breadcrumb-container" |
| ... | @@ -16,7 +15,20 @@ | ... | @@ -16,7 +15,20 @@ |
| 16 | 15 | ||
| 17 | <div class="right-menu"> | 16 | <div class="right-menu"> |
| 18 | <template v-if="device !== 'mobile'"> </template> | 17 | <template v-if="device !== 'mobile'"> </template> |
| 19 | - | 18 | + <el-select |
| 19 | + v-model="portName" | ||
| 20 | + size="mini" | ||
| 21 | + style="width: 120px; top: -17px; right: 7px" | ||
| 22 | + placeholder="选择口岸" | ||
| 23 | + > | ||
| 24 | + <el-option | ||
| 25 | + v-for="item in portNameList" | ||
| 26 | + :label="item" | ||
| 27 | + :value="item" | ||
| 28 | + :key="item" | ||
| 29 | + > | ||
| 30 | + </el-option> | ||
| 31 | + </el-select> | ||
| 20 | <el-dropdown | 32 | <el-dropdown |
| 21 | class="avatar-container right-menu-item hover-effect" | 33 | class="avatar-container right-menu-item hover-effect" |
| 22 | trigger="click" | 34 | trigger="click" |
| ... | @@ -25,8 +37,7 @@ | ... | @@ -25,8 +37,7 @@ |
| 25 | <img :src="avatar" class="user-avatar" /> | 37 | <img :src="avatar" class="user-avatar" /> |
| 26 | </div> | 38 | </div> |
| 27 | <el-dropdown-menu slot="dropdown"> | 39 | <el-dropdown-menu slot="dropdown"> |
| 28 | - <!-- <el-dropdown-item @click.native.stop="drawer = true">个人中心</el-dropdown-item> --> | 40 | + <el-dropdown-item @click.native="logout"> |
| 29 | - <el-dropdown-item @click.native="logout"> | ||
| 30 | <span>退出登录</span> | 41 | <span>退出登录</span> |
| 31 | </el-dropdown-item> | 42 | </el-dropdown-item> |
| 32 | </el-dropdown-menu> | 43 | </el-dropdown-menu> |
| ... | @@ -35,13 +46,12 @@ | ... | @@ -35,13 +46,12 @@ |
| 35 | v-model="locale" | 46 | v-model="locale" |
| 36 | size="mini" | 47 | size="mini" |
| 37 | @change="local" | 48 | @change="local" |
| 38 | - style="width: 75px;top:-17px;right:7px" | 49 | + style="width: 75px; top: -17px; right: 7px" |
| 39 | > | 50 | > |
| 40 | <el-option label="中文" value="zh"> </el-option> | 51 | <el-option label="中文" value="zh"> </el-option> |
| 41 | <el-option label="英文" value="en"> </el-option> | 52 | <el-option label="英文" value="en"> </el-option> |
| 42 | </el-select> | 53 | </el-select> |
| 43 | </div> | 54 | </div> |
| 44 | - <Profile :drawer="drawer" @drawerHandleClose="drawerHandleClose"></Profile> | ||
| 45 | </div> | 55 | </div> |
| 46 | </template> | 56 | </template> |
| 47 | 57 | ||
| ... | @@ -50,21 +60,22 @@ import { mapGetters } from "vuex"; | ... | @@ -50,21 +60,22 @@ import { mapGetters } from "vuex"; |
| 50 | import Breadcrumb from "@/components/Breadcrumb"; | 60 | import Breadcrumb from "@/components/Breadcrumb"; |
| 51 | import TopNav from "@/components/TopNav"; | 61 | import TopNav from "@/components/TopNav"; |
| 52 | import Hamburger from "@/components/Hamburger"; | 62 | import Hamburger from "@/components/Hamburger"; |
| 53 | -import Profile from "@/views/systemConfig/userConfig/profile/index"; | ||
| 54 | 63 | ||
| 55 | export default { | 64 | export default { |
| 56 | components: { | 65 | components: { |
| 57 | Breadcrumb, | 66 | Breadcrumb, |
| 58 | TopNav, | 67 | TopNav, |
| 59 | Hamburger, | 68 | Hamburger, |
| 60 | - Profile, | ||
| 61 | }, | 69 | }, |
| 62 | data() { | 70 | data() { |
| 63 | return { | 71 | return { |
| 64 | - drawer: false, | 72 | + portNameList: [], |
| 65 | locale: "zh", | 73 | locale: "zh", |
| 66 | }; | 74 | }; |
| 67 | }, | 75 | }, |
| 76 | + created() { | ||
| 77 | + this.portNameList = this.$store.state.user.portNames; | ||
| 78 | + }, | ||
| 68 | computed: { | 79 | computed: { |
| 69 | ...mapGetters(["sidebar", "avatar", "device"]), | 80 | ...mapGetters(["sidebar", "avatar", "device"]), |
| 70 | setting: { | 81 | setting: { |
| ... | @@ -83,6 +94,32 @@ export default { | ... | @@ -83,6 +94,32 @@ export default { |
| 83 | return this.$store.state.settings.topNav; | 94 | return this.$store.state.settings.topNav; |
| 84 | }, | 95 | }, |
| 85 | }, | 96 | }, |
| 97 | + //切换口岸 | ||
| 98 | + portName: { | ||
| 99 | + get() { | ||
| 100 | + return this.$store.state.user.activePortName; | ||
| 101 | + }, | ||
| 102 | + set(val) { | ||
| 103 | + this.$store | ||
| 104 | + .dispatch("changePort", val) | ||
| 105 | + .then((res) => { | ||
| 106 | + if (res.code === 200) { | ||
| 107 | + location.reload(); | ||
| 108 | + } else { | ||
| 109 | + this.$confirm(res.msg, "提示", { | ||
| 110 | + type: "warning", | ||
| 111 | + }).then(()=>{ | ||
| 112 | + location.reload(); | ||
| 113 | + }).catch(()=>{ | ||
| 114 | + location.reload(); | ||
| 115 | + }); | ||
| 116 | + } | ||
| 117 | + }) | ||
| 118 | + .catch((err) => { | ||
| 119 | + console.log(err); | ||
| 120 | + }); | ||
| 121 | + }, | ||
| 122 | + }, | ||
| 86 | }, | 123 | }, |
| 87 | methods: { | 124 | methods: { |
| 88 | toggleSideBar() { | 125 | toggleSideBar() { |
| ... | @@ -100,9 +137,6 @@ export default { | ... | @@ -100,9 +137,6 @@ export default { |
| 100 | }); | 137 | }); |
| 101 | }); | 138 | }); |
| 102 | }, | 139 | }, |
| 103 | - drawerHandleClose(val) { | ||
| 104 | - this.drawer = val; | ||
| 105 | - }, | ||
| 106 | local(val) { | 140 | local(val) { |
| 107 | this.$i18n.locale = val; //此处val为 zh 或者 en | 141 | this.$i18n.locale = val; //此处val为 zh 或者 en |
| 108 | }, | 142 | }, | ... | ... |
| ... | @@ -2,14 +2,15 @@ import { constantRoutes } from '@/router' | ... | @@ -2,14 +2,15 @@ import { constantRoutes } from '@/router' |
| 2 | import { getRouters } from '@/api/menu' | 2 | import { getRouters } from '@/api/menu' |
| 3 | import Layout from '@/layout/index' | 3 | import Layout from '@/layout/index' |
| 4 | import ParentView from '@/components/ParentView'; | 4 | import ParentView from '@/components/ParentView'; |
| 5 | - | 5 | +import hasPermi from '../../directive/permission/hasPermi'; |
| 6 | const permission = { | 6 | const permission = { |
| 7 | state: { | 7 | state: { |
| 8 | routes: [], | 8 | routes: [], |
| 9 | addRoutes: [], | 9 | addRoutes: [], |
| 10 | defaultRoutes: [], | 10 | defaultRoutes: [], |
| 11 | topbarRouters: [], | 11 | topbarRouters: [], |
| 12 | - sidebarRouters: [] | 12 | + sidebarRouters: [], |
| 13 | + filghtAllData: {} | ||
| 13 | }, | 14 | }, |
| 14 | mutations: { | 15 | mutations: { |
| 15 | SET_ROUTES: (state, routes) => { | 16 | SET_ROUTES: (state, routes) => { |
| ... | @@ -23,13 +24,20 @@ const permission = { | ... | @@ -23,13 +24,20 @@ const permission = { |
| 23 | // 顶部导航菜单默认添加统计报表栏指向首页 | 24 | // 顶部导航菜单默认添加统计报表栏指向首页 |
| 24 | const index = [{ | 25 | const index = [{ |
| 25 | path: 'index', | 26 | path: 'index', |
| 26 | - meta: { title: '统计报表', icon: 'dashboard'} | 27 | + meta: { title: '首页', icon: 'home' } |
| 27 | }] | 28 | }] |
| 28 | state.topbarRouters = routes.concat(index); | 29 | state.topbarRouters = routes.concat(index); |
| 29 | }, | 30 | }, |
| 30 | SET_SIDEBAR_ROUTERS: (state, routes) => { | 31 | SET_SIDEBAR_ROUTERS: (state, routes) => { |
| 31 | state.sidebarRouters = routes | 32 | state.sidebarRouters = routes |
| 32 | }, | 33 | }, |
| 34 | + SET_FILGHTALL: (state, data) => { | ||
| 35 | + let name = data.name; | ||
| 36 | + state.filghtAllData[name] = data.data; | ||
| 37 | + }, | ||
| 38 | + REMOVE_FILGHTALL: (state, name) => { | ||
| 39 | + delete state.filghtAllData[name] | ||
| 40 | + } | ||
| 33 | }, | 41 | }, |
| 34 | actions: { | 42 | actions: { |
| 35 | // 生成路由 | 43 | // 生成路由 |
| ... | @@ -37,6 +45,7 @@ const permission = { | ... | @@ -37,6 +45,7 @@ const permission = { |
| 37 | return new Promise(resolve => { | 45 | return new Promise(resolve => { |
| 38 | // 向后端请求路由数据 | 46 | // 向后端请求路由数据 |
| 39 | getRouters().then(res => { | 47 | getRouters().then(res => { |
| 48 | + res.data = hasPermi.routerPer(res.data); | ||
| 40 | const sdata = JSON.parse(JSON.stringify(res.data)) | 49 | const sdata = JSON.parse(JSON.stringify(res.data)) |
| 41 | const rdata = JSON.parse(JSON.stringify(res.data)) | 50 | const rdata = JSON.parse(JSON.stringify(res.data)) |
| 42 | const sidebarRoutes = filterAsyncRouter(sdata) | 51 | const sidebarRoutes = filterAsyncRouter(sdata) | ... | ... |
| 1 | import { login, logout, getInfo } from '@/api/login' | 1 | import { login, logout, getInfo } from '@/api/login' |
| 2 | +import { changeCurrentPort } from "@/api/system/user.js"; | ||
| 2 | import { getToken, setToken, removeToken } from '@/utils/auth' | 3 | import { getToken, setToken, removeToken } from '@/utils/auth' |
| 3 | 4 | ||
| 4 | const user = { | 5 | const user = { |
| ... | @@ -6,6 +7,8 @@ const user = { | ... | @@ -6,6 +7,8 @@ const user = { |
| 6 | token: getToken(), | 7 | token: getToken(), |
| 7 | name: '', | 8 | name: '', |
| 8 | avatar: '', | 9 | avatar: '', |
| 10 | + activePortName: '', | ||
| 11 | + portNames:[], | ||
| 9 | roles: [], | 12 | roles: [], |
| 10 | permissions: [] | 13 | permissions: [] |
| 11 | }, | 14 | }, |
| ... | @@ -20,6 +23,13 @@ const user = { | ... | @@ -20,6 +23,13 @@ const user = { |
| 20 | SET_AVATAR: (state, avatar) => { | 23 | SET_AVATAR: (state, avatar) => { |
| 21 | state.avatar = avatar | 24 | state.avatar = avatar |
| 22 | }, | 25 | }, |
| 26 | + SET_ACTIVEPORTNAME: (state, activePortName) => { | ||
| 27 | + state.activePortName = activePortName | ||
| 28 | + sessionStorage.setItem('portName', activePortName) | ||
| 29 | + }, | ||
| 30 | + SET_PORTNAMES:(state,portNames)=>{ | ||
| 31 | + state.portNames = portNames | ||
| 32 | + }, | ||
| 23 | SET_ROLES: (state, roles) => { | 33 | SET_ROLES: (state, roles) => { |
| 24 | state.roles = roles | 34 | state.roles = roles |
| 25 | }, | 35 | }, |
| ... | @@ -29,6 +39,7 @@ const user = { | ... | @@ -29,6 +39,7 @@ const user = { |
| 29 | }, | 39 | }, |
| 30 | 40 | ||
| 31 | actions: { | 41 | actions: { |
| 42 | + | ||
| 32 | // 登录 | 43 | // 登录 |
| 33 | Login({ commit }, userInfo) { | 44 | Login({ commit }, userInfo) { |
| 34 | const username = userInfo.username.trim() | 45 | const username = userInfo.username.trim() |
| ... | @@ -36,7 +47,7 @@ const user = { | ... | @@ -36,7 +47,7 @@ const user = { |
| 36 | const rememberMe = userInfo.rememberMe | 47 | const rememberMe = userInfo.rememberMe |
| 37 | 48 | ||
| 38 | return new Promise((resolve, reject) => { | 49 | return new Promise((resolve, reject) => { |
| 39 | - login(username, password,rememberMe).then(res => { | 50 | + login(username, password, rememberMe).then(res => { |
| 40 | setToken(res.data) | 51 | setToken(res.data) |
| 41 | commit('SET_TOKEN', res.data) | 52 | commit('SET_TOKEN', res.data) |
| 42 | resolve() | 53 | resolve() |
| ... | @@ -52,6 +63,7 @@ const user = { | ... | @@ -52,6 +63,7 @@ const user = { |
| 52 | getInfo().then(res => { | 63 | getInfo().then(res => { |
| 53 | const user = res.data.user | 64 | const user = res.data.user |
| 54 | const avatar = user.avatar == "" ? require("@/assets/images/profile.jpg") : process.env.VUE_APP_BASE_API + user.avatar; | 65 | const avatar = user.avatar == "" ? require("@/assets/images/profile.jpg") : process.env.VUE_APP_BASE_API + user.avatar; |
| 66 | + let ports = user.portName.split(','); | ||
| 55 | if (res.data.roles && res.data.roles.length > 0) { // 验证返回的roles是否是一个非空数组 | 67 | if (res.data.roles && res.data.roles.length > 0) { // 验证返回的roles是否是一个非空数组 |
| 56 | commit('SET_ROLES', res.data.roles) | 68 | commit('SET_ROLES', res.data.roles) |
| 57 | commit('SET_PERMISSIONS', res.data.permissions) | 69 | commit('SET_PERMISSIONS', res.data.permissions) |
| ... | @@ -60,6 +72,14 @@ const user = { | ... | @@ -60,6 +72,14 @@ const user = { |
| 60 | } | 72 | } |
| 61 | commit('SET_NAME', user.userName) | 73 | commit('SET_NAME', user.userName) |
| 62 | commit('SET_AVATAR', avatar) | 74 | commit('SET_AVATAR', avatar) |
| 75 | + commit('SET_PORTNAMES',ports) | ||
| 76 | + //口岸选择 | ||
| 77 | + if (sessionStorage.getItem('portName')) { | ||
| 78 | + commit('SET_ACTIVEPORTNAME', sessionStorage.getItem('portName')) | ||
| 79 | + } else { | ||
| 80 | + commit('SET_ACTIVEPORTNAME', "PVG") | ||
| 81 | + } | ||
| 82 | + | ||
| 63 | resolve(res) | 83 | resolve(res) |
| 64 | }).catch(error => { | 84 | }).catch(error => { |
| 65 | reject(error) | 85 | reject(error) |
| ... | @@ -67,11 +87,25 @@ const user = { | ... | @@ -67,11 +87,25 @@ const user = { |
| 67 | }) | 87 | }) |
| 68 | }, | 88 | }, |
| 69 | 89 | ||
| 90 | + //切换口岸 | ||
| 91 | + changePort({ commit }, portName) { | ||
| 92 | + return new Promise((resolve, reject) => { | ||
| 93 | + changeCurrentPort({ portName: portName }).then(res=>{ | ||
| 94 | + if(res.code === 200){ | ||
| 95 | + commit('SET_ACTIVEPORTNAME',portName) | ||
| 96 | + } | ||
| 97 | + resolve(res) | ||
| 98 | + }).catch(err=>{ | ||
| 99 | + reject(err) | ||
| 100 | + }) | ||
| 101 | + }) | ||
| 102 | + }, | ||
| 103 | + | ||
| 70 | // 退出系统 | 104 | // 退出系统 |
| 71 | LogOut({ commit, state }) { | 105 | LogOut({ commit, state }) { |
| 72 | return new Promise((resolve, reject) => { | 106 | return new Promise((resolve, reject) => { |
| 73 | logout(state.token).then(() => { | 107 | logout(state.token).then(() => { |
| 74 | - | 108 | + // window.location.href = "https://sso.secure.fedex.com/logout";//wsso系统跳转 |
| 75 | commit('SET_TOKEN', '') | 109 | commit('SET_TOKEN', '') |
| 76 | commit('SET_ROLES', []) | 110 | commit('SET_ROLES', []) |
| 77 | commit('SET_PERMISSIONS', []) | 111 | commit('SET_PERMISSIONS', []) |
| ... | @@ -86,6 +120,7 @@ const user = { | ... | @@ -86,6 +120,7 @@ const user = { |
| 86 | // 前端 登出 | 120 | // 前端 登出 |
| 87 | FedLogOut({ commit }) { | 121 | FedLogOut({ commit }) { |
| 88 | return new Promise(resolve => { | 122 | return new Promise(resolve => { |
| 123 | + // window.location.href = "https://sso.secure.fedex.com/logout";//wsso系统跳转 | ||
| 89 | commit('SET_TOKEN', '') | 124 | commit('SET_TOKEN', '') |
| 90 | removeToken() | 125 | removeToken() |
| 91 | resolve() | 126 | resolve() | ... | ... |
| ... | @@ -17,5 +17,6 @@ export function setToken(token) { | ... | @@ -17,5 +17,6 @@ export function setToken(token) { |
| 17 | export function removeToken() { | 17 | export function removeToken() { |
| 18 | //return Cookies.remove(TokenKey) | 18 | //return Cookies.remove(TokenKey) |
| 19 | // return localStorage.removeItem(TokenKey) | 19 | // return localStorage.removeItem(TokenKey) |
| 20 | + sessionStorage.removeItem('portName') | ||
| 20 | return sessionStorage.removeItem(TokenKey) | 21 | return sessionStorage.removeItem(TokenKey) |
| 21 | } | 22 | } | ... | ... |
| ... | @@ -280,6 +280,7 @@ | ... | @@ -280,6 +280,7 @@ |
| 280 | <el-button | 280 | <el-button |
| 281 | :type="downLoadingTip.downloading ? 'warning' : 'primary'" | 281 | :type="downLoadingTip.downloading ? 'warning' : 'primary'" |
| 282 | size="mini" | 282 | size="mini" |
| 283 | + v-hasPermi="['allocation:cargo:export']" | ||
| 283 | @click="xlsx(0)" | 284 | @click="xlsx(0)" |
| 284 | :loading="downLoadingTip.downloading" | 285 | :loading="downLoadingTip.downloading" |
| 285 | :disabled="tableData.length <= 0" | 286 | :disabled="tableData.length <= 0" |
| ... | @@ -290,6 +291,7 @@ | ... | @@ -290,6 +291,7 @@ |
| 290 | <el-button | 291 | <el-button |
| 291 | :type="downLoadingTip.downloading ? 'warning' : 'primary'" | 292 | :type="downLoadingTip.downloading ? 'warning' : 'primary'" |
| 292 | size="mini" | 293 | size="mini" |
| 294 | + v-hasPermi="['allocation:cargo:export']" | ||
| 293 | @click="xlsx(1)" | 295 | @click="xlsx(1)" |
| 294 | :loading="downLoadingTip.downloading" | 296 | :loading="downLoadingTip.downloading" |
| 295 | :disabled="tableData.length <= 0" | 297 | :disabled="tableData.length <= 0" |
| ... | @@ -300,6 +302,7 @@ | ... | @@ -300,6 +302,7 @@ |
| 300 | <el-button | 302 | <el-button |
| 301 | type="primary" | 303 | type="primary" |
| 302 | size="mini" | 304 | size="mini" |
| 305 | + v-hasPermi="['allocation:cargo:allocation']" | ||
| 303 | @click="addFit" | 306 | @click="addFit" |
| 304 | :disabled="tableSelection.length <= 0" | 307 | :disabled="tableSelection.length <= 0" |
| 305 | >添加到航班</el-button | 308 | >添加到航班</el-button | ... | ... |
| ... | @@ -36,6 +36,7 @@ | ... | @@ -36,6 +36,7 @@ |
| 36 | type="primary" | 36 | type="primary" |
| 37 | icon="el-icon-plus" | 37 | icon="el-icon-plus" |
| 38 | size="mini" | 38 | size="mini" |
| 39 | + v-hasPermi="['allocation:alloc:add']" | ||
| 39 | @click="$router.push({ name: 'FlightAllocConfigAdd', params: { handle: 'add' } })" | 40 | @click="$router.push({ name: 'FlightAllocConfigAdd', params: { handle: 'add' } })" |
| 40 | >添加</el-button | 41 | >添加</el-button |
| 41 | > | 42 | > |
| ... | @@ -76,6 +77,7 @@ | ... | @@ -76,6 +77,7 @@ |
| 76 | type="text" | 77 | type="text" |
| 77 | size="mini" | 78 | size="mini" |
| 78 | icon="el-icon-edit" | 79 | icon="el-icon-edit" |
| 80 | + v-hasPermi="['allocation:alloc:update']" | ||
| 79 | @click="handleClick(scope.row.id, 'update')" | 81 | @click="handleClick(scope.row.id, 'update')" |
| 80 | >修改</el-button | 82 | >修改</el-button |
| 81 | > | 83 | > |
| ... | @@ -83,6 +85,7 @@ | ... | @@ -83,6 +85,7 @@ |
| 83 | type="text" | 85 | type="text" |
| 84 | size="mini" | 86 | size="mini" |
| 85 | icon="el-icon-delete" | 87 | icon="el-icon-delete" |
| 88 | + v-hasPermi="['allocation:alloc:delete']" | ||
| 86 | @click="del(scope.row.id, scope.row.status)" | 89 | @click="del(scope.row.id, scope.row.status)" |
| 87 | >删除</el-button | 90 | >删除</el-button |
| 88 | > | 91 | > |
| ... | @@ -90,6 +93,7 @@ | ... | @@ -90,6 +93,7 @@ |
| 90 | type="text" | 93 | type="text" |
| 91 | size="mini" | 94 | size="mini" |
| 92 | icon="el-icon-video-pause" | 95 | icon="el-icon-video-pause" |
| 96 | + v-hasPermi="['allocation:alloc:openClose']" | ||
| 93 | @click="changeStatus(scope.row.id, 3)" | 97 | @click="changeStatus(scope.row.id, 3)" |
| 94 | v-if="scope.row.status == '1'" | 98 | v-if="scope.row.status == '1'" |
| 95 | >停用</el-button | 99 | >停用</el-button |
| ... | @@ -98,6 +102,7 @@ | ... | @@ -98,6 +102,7 @@ |
| 98 | type="text" | 102 | type="text" |
| 99 | size="mini" | 103 | size="mini" |
| 100 | icon="el-icon-video-play" | 104 | icon="el-icon-video-play" |
| 105 | + v-hasPermi="['allocation:alloc:openClose']" | ||
| 101 | @click="changeStatus(scope.row.id, 1)" | 106 | @click="changeStatus(scope.row.id, 1)" |
| 102 | v-else | 107 | v-else |
| 103 | >启用</el-button | 108 | >启用</el-button | ... | ... |
| 1 | <template> | 1 | <template> |
| 2 | <div> | 2 | <div> |
| 3 | - <el-form class="form-header" :model="queryParams" ref="queryForm" size="medium" :inline="true" label-position="right" label-width="auto"> | 3 | + <el-form |
| 4 | - | 4 | + class="form-header" |
| 5 | + :model="queryParams" | ||
| 6 | + ref="queryForm" | ||
| 7 | + size="medium" | ||
| 8 | + :inline="true" | ||
| 9 | + label-position="right" | ||
| 10 | + label-width="auto" | ||
| 11 | + > | ||
| 5 | <el-form-item label="原航班"> | 12 | <el-form-item label="原航班"> |
| 6 | - <el-input type="text" v-model="upCase" placeholder="请输入原航班" clearable></el-input> | 13 | + <el-input |
| 14 | + type="text" | ||
| 15 | + v-model="upCase" | ||
| 16 | + placeholder="请输入原航班" | ||
| 17 | + clearable | ||
| 18 | + ></el-input> | ||
| 7 | <!-- <el-input v-model="upCase" placeholder="请输入原航班" clearable size="small" /> --> | 19 | <!-- <el-input v-model="upCase" placeholder="请输入原航班" clearable size="small" /> --> |
| 8 | </el-form-item> | 20 | </el-form-item> |
| 9 | <el-form-item label="状态" prop="status"> | 21 | <el-form-item label="状态" prop="status"> |
| 10 | <el-select v-model="queryParams.status" placeholder="请选择" clearable> | 22 | <el-select v-model="queryParams.status" placeholder="请选择" clearable> |
| 11 | - <el-option v-for="dict in statusList" :key="dict.id" :label="dict.name" :value="dict.id" /> | 23 | + <el-option |
| 24 | + v-for="dict in statusList" | ||
| 25 | + :key="dict.id" | ||
| 26 | + :label="dict.name" | ||
| 27 | + :value="dict.id" | ||
| 28 | + /> | ||
| 12 | </el-select> | 29 | </el-select> |
| 13 | - | ||
| 14 | </el-form-item> | 30 | </el-form-item> |
| 15 | 31 | ||
| 16 | <el-form-item> | 32 | <el-form-item> |
| 17 | - <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">查询原航班配置</el-button> | 33 | + <el-button |
| 34 | + type="primary" | ||
| 35 | + icon="el-icon-search" | ||
| 36 | + size="mini" | ||
| 37 | + @click="handleQuery" | ||
| 38 | + >查询原航班配置</el-button | ||
| 39 | + > | ||
| 18 | </el-form-item> | 40 | </el-form-item> |
| 19 | <br /> | 41 | <br /> |
| 20 | <el-form-item label="日期" prop="flightDate"> | 42 | <el-form-item label="日期" prop="flightDate"> |
| 21 | - | 43 | + <el-date-picker |
| 22 | - <el-date-picker value-format="yyyy-MM-dd" v-model="queryParams.flightDate" type="date" placeholder="选择日期"> | 44 | + value-format="yyyy-MM-dd" |
| 45 | + v-model="queryParams.flightDate" | ||
| 46 | + type="date" | ||
| 47 | + placeholder="选择日期" | ||
| 48 | + > | ||
| 23 | </el-date-picker> | 49 | </el-date-picker> |
| 24 | </el-form-item> | 50 | </el-form-item> |
| 25 | 51 | ||
| 26 | <el-form-item> | 52 | <el-form-item> |
| 27 | - <el-button type="primary" icon="el-icon-search" size="mini" @click="findSourceFlightAndFlightDate">查询实际配载航班 | 53 | + <el-button |
| 28 | - </el-button>  | 54 | + type="primary" |
| 29 | - <span style="color: #ff4949;">注:原航班+日期查询该日期的航班实际情况</span> | 55 | + icon="el-icon-search" |
| 56 | + size="mini" | ||
| 57 | + @click="findSourceFlightAndFlightDate" | ||
| 58 | + >查询实际配载航班 </el-button | ||
| 59 | + >  | ||
| 60 | + <span style="color:#ff4949">注:原航班+日期查询该日期的航班实际情况</span> | ||
| 30 | </el-form-item> | 61 | </el-form-item> |
| 31 | <br /> | 62 | <br /> |
| 32 | <el-form-item> | 63 | <el-form-item> |
| 33 | - <el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd">添加规则</el-button> | 64 | + <el-button |
| 34 | - <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> | 65 | + type="primary" |
| 66 | + icon="el-icon-plus" | ||
| 67 | + size="mini" | ||
| 68 | + v-hasPermi="['allocation:rand:add']" | ||
| 69 | + @click="handleAdd" | ||
| 70 | + >添加规则</el-button | ||
| 71 | + > | ||
| 72 | + <el-button icon="el-icon-refresh" size="mini" @click="resetQuery" | ||
| 73 | + >重置</el-button | ||
| 74 | + > | ||
| 35 | </el-form-item> | 75 | </el-form-item> |
| 36 | </el-form> | 76 | </el-form> |
| 37 | 77 | ||
| 38 | - | 78 | + <el-table |
| 39 | - <el-table v-loading="loading" height="550" :data="sourceFlightRulesList" highlight-current-row border stripe> | 79 | + v-loading="loading" |
| 80 | + height="550" | ||
| 81 | + size="small" | ||
| 82 | + :data="sourceFlightRulesList" | ||
| 83 | + highlight-current-row | ||
| 84 | + border | ||
| 85 | + stripe | ||
| 86 | + > | ||
| 40 | <el-table-column type="index" label="序号" align="center"> | 87 | <el-table-column type="index" label="序号" align="center"> |
| 41 | <template slot-scope="scope">{{ scope.$index + 1 }}</template> | 88 | <template slot-scope="scope">{{ scope.$index + 1 }}</template> |
| 42 | </el-table-column> | 89 | </el-table-column> |
| 43 | <el-table-column label="原航班" align="center" prop="sourceFlightNo" /> | 90 | <el-table-column label="原航班" align="center" prop="sourceFlightNo" /> |
| 44 | - <el-table-column label="配载航班排序" align="center" prop="flightRank" width="280" /> | 91 | + <el-table-column |
| 92 | + label="配载航班排序" | ||
| 93 | + align="center" | ||
| 94 | + prop="flightRank" | ||
| 95 | + width="280" | ||
| 96 | + /> | ||
| 45 | <!-- <el-table-column label="优先级" align="center" prop="priority" /> --> | 97 | <!-- <el-table-column label="优先级" align="center" prop="priority" /> --> |
| 46 | - <el-table-column label="周期" align="center" prop="dayOfWeek" width="180" /> | 98 | + <el-table-column |
| 47 | - <el-table-column label="状态" align="center" prop="status" :formatter="statusFormat" /> | 99 | + label="周期" |
| 48 | - <el-table-column label="开始时间" align="center" prop="startDate" width="100" /> | 100 | + align="center" |
| 49 | - <el-table-column label="结束时间" align="center" prop="endDate" width="100" /> | 101 | + prop="dayOfWeek" |
| 50 | - <el-table-column label="最后修改人" align="center" prop="updateUserName" width="100" /> | 102 | + width="180" |
| 51 | - <el-table-column label="最后修改时间" align="center" prop="updateTime" width="100" /> | 103 | + /> |
| 52 | - <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="180" fixed="right"> | 104 | + <el-table-column |
| 105 | + label="状态" | ||
| 106 | + align="center" | ||
| 107 | + prop="status" | ||
| 108 | + :formatter="statusFormat" | ||
| 109 | + /> | ||
| 110 | + <el-table-column | ||
| 111 | + label="开始时间" | ||
| 112 | + align="center" | ||
| 113 | + prop="startDate" | ||
| 114 | + width="100" | ||
| 115 | + /> | ||
| 116 | + <el-table-column | ||
| 117 | + label="结束时间" | ||
| 118 | + align="center" | ||
| 119 | + prop="endDate" | ||
| 120 | + width="100" | ||
| 121 | + /> | ||
| 122 | + <el-table-column | ||
| 123 | + label="最后修改人" | ||
| 124 | + align="center" | ||
| 125 | + prop="updateUserName" | ||
| 126 | + width="100" | ||
| 127 | + /> | ||
| 128 | + <el-table-column | ||
| 129 | + label="最后修改时间" | ||
| 130 | + align="center" | ||
| 131 | + prop="updateTime" | ||
| 132 | + width="100" | ||
| 133 | + /> | ||
| 134 | + <el-table-column | ||
| 135 | + label="操作" | ||
| 136 | + align="center" | ||
| 137 | + class-name="small-padding fixed-width" | ||
| 138 | + width="180" | ||
| 139 | + fixed="right" | ||
| 140 | + > | ||
| 53 | <template slot-scope="scope"> | 141 | <template slot-scope="scope"> |
| 54 | - <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">修改</el-button> | 142 | + <el-button |
| 55 | - <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDeleteorPlayorpause(scope.row,0,'删除')"> | 143 | + size="mini" |
| 56 | - 删除</el-button> | 144 | + type="text" |
| 57 | - <el-button size="mini" type="text" icon="el-icon-video-play" v-if="scope.row.status == '3'" | 145 | + icon="el-icon-edit" |
| 58 | - @click="handleDeleteorPlayorpause(scope.row,1,'启用')">启用</el-button> | 146 | + v-hasPermi="['allocation:rand:update']" |
| 59 | - <el-button size="mini" type="text" icon="el-icon-video-pause" v-if="scope.row.status != '3'" | 147 | + @click="handleUpdate(scope.row)" |
| 60 | - @click="handleDeleteorPlayorpause(scope.row,3,'停用')">停用</el-button> | 148 | + >修改</el-button |
| 149 | + > | ||
| 150 | + <el-button | ||
| 151 | + size="mini" | ||
| 152 | + type="text" | ||
| 153 | + icon="el-icon-delete" | ||
| 154 | + v-hasPermi="['allocation:rand:delete']" | ||
| 155 | + @click="handleDeleteorPlayorpause(scope.row, 0, '删除')" | ||
| 156 | + > | ||
| 157 | + 删除</el-button | ||
| 158 | + > | ||
| 159 | + <el-button | ||
| 160 | + size="mini" | ||
| 161 | + type="text" | ||
| 162 | + icon="el-icon-video-play" | ||
| 163 | + v-if="scope.row.status == '3'" | ||
| 164 | + v-hasPermi="['allocation:rand:openClose']" | ||
| 165 | + @click="handleDeleteorPlayorpause(scope.row, 1, '启用')" | ||
| 166 | + >启用</el-button | ||
| 167 | + > | ||
| 168 | + <el-button | ||
| 169 | + size="mini" | ||
| 170 | + type="text" | ||
| 171 | + icon="el-icon-video-pause" | ||
| 172 | + v-if="scope.row.status != '3'" | ||
| 173 | + v-hasPermi="['allocation:rand:openClose']" | ||
| 174 | + @click="handleDeleteorPlayorpause(scope.row, 3, '停用')" | ||
| 175 | + >停用</el-button | ||
| 176 | + > | ||
| 61 | </template> | 177 | </template> |
| 62 | </el-table-column> | 178 | </el-table-column> |
| 63 | </el-table> | 179 | </el-table> |
| 64 | 180 | ||
| 65 | - <pagination v-show="total>0" :total="total" layout=" prev, pager, next, jumper, sizes,total" | 181 | + <pagination |
| 66 | - :page.sync="queryParams.pageNum" :limit.sync="queryParams.limit" @pagination="findSourceFlightRules" /> | 182 | + v-show="total > 0" |
| 67 | - | 183 | + :total="total" |
| 184 | + layout=" prev, pager, next, jumper, sizes,total" | ||
| 185 | + :page.sync="queryParams.pageNum" | ||
| 186 | + :limit.sync="queryParams.limit" | ||
| 187 | + @pagination="findSourceFlightRules" | ||
| 188 | + /> | ||
| 68 | 189 | ||
| 69 | <!-- 查看目的航班对话框 --> | 190 | <!-- 查看目的航班对话框 --> |
| 70 | - <el-dialog title="实际配载航班" :visible.sync="openFlightDate" width="70%" :close-on-click-modal="false" :append-to-body="true"> | 191 | + <el-dialog |
| 192 | + title="实际配载航班" | ||
| 193 | + :visible.sync="openFlightDate" | ||
| 194 | + width="70%" | ||
| 195 | + :close-on-click-modal="false" | ||
| 196 | + :append-to-body="true" | ||
| 197 | + > | ||
| 71 | <el-table v-loading="loadingFlightDate" :data="sourceFlightAndFlightDate"> | 198 | <el-table v-loading="loadingFlightDate" :data="sourceFlightAndFlightDate"> |
| 72 | <el-table-column type="index" label="序号" align="center"> | 199 | <el-table-column type="index" label="序号" align="center"> |
| 73 | <template slot-scope="scope">{{ scope.$index + 1 }}</template> | 200 | <template slot-scope="scope">{{ scope.$index + 1 }}</template> |
| 74 | </el-table-column> | 201 | </el-table-column> |
| 75 | - <el-table-column label="原航班" align="center" prop="sourceFlightNo"/> | 202 | + <el-table-column label="原航班" align="center" prop="sourceFlightNo" /> |
| 76 | - <el-table-column label="实际配载航班" align="center" prop="actualFlight" width="280" /> | 203 | + <el-table-column |
| 204 | + label="实际配载航班" | ||
| 205 | + align="center" | ||
| 206 | + prop="actualFlight" | ||
| 207 | + width="280" | ||
| 208 | + /> | ||
| 77 | <el-table-column label="航班日期" align="center" prop="flightDate" /> | 209 | <el-table-column label="航班日期" align="center" prop="flightDate" /> |
| 78 | - <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="200"> | 210 | + <el-table-column |
| 211 | + label="操作" | ||
| 212 | + align="center" | ||
| 213 | + class-name="small-padding fixed-width" | ||
| 214 | + width="200" | ||
| 215 | + > | ||
| 79 | <template slot-scope="scope"> | 216 | <template slot-scope="scope"> |
| 80 | - <el-button size="mini" type="text" icon="el-icon-edit" | 217 | + <el-button |
| 81 | - @click="handleClick(scope.row.actualFlight, 'detail')">查看配置维度</el-button> | 218 | + size="mini" |
| 219 | + type="text" | ||
| 220 | + icon="el-icon-edit" | ||
| 221 | + @click="handleClick(scope.row.actualFlight, 'detail')" | ||
| 222 | + >查看配置维度</el-button | ||
| 223 | + > | ||
| 82 | </template> | 224 | </template> |
| 83 | </el-table-column> | 225 | </el-table-column> |
| 84 | </el-table> | 226 | </el-table> |
| ... | @@ -87,50 +229,110 @@ | ... | @@ -87,50 +229,110 @@ |
| 87 | </div> | 229 | </div> |
| 88 | </el-dialog> | 230 | </el-dialog> |
| 89 | 231 | ||
| 90 | - | ||
| 91 | <!-- 添加或修改对话框 --> | 232 | <!-- 添加或修改对话框 --> |
| 92 | - <el-dialog :title="title" :visible.sync="open" width="55%" :append-to-body="true" :close-on-click-modal="false"> | 233 | + <el-dialog |
| 93 | - <el-form ref="form" :model="form" :rules="rules" label-position="right" label-width="auto"> | 234 | + :title="title" |
| 235 | + :visible.sync="open" | ||
| 236 | + width="55%" | ||
| 237 | + :append-to-body="true" | ||
| 238 | + :close-on-click-modal="false" | ||
| 239 | + > | ||
| 240 | + <el-form | ||
| 241 | + ref="form" | ||
| 242 | + :model="form" | ||
| 243 | + :rules="rules" | ||
| 244 | + label-position="right" | ||
| 245 | + label-width="auto" | ||
| 246 | + > | ||
| 94 | <el-row> | 247 | <el-row> |
| 95 | - <el-col :span="10"> | 248 | + <el-col :span="8"> |
| 96 | <el-form-item label="原航班" prop="sourceFlightNo"> | 249 | <el-form-item label="原航班" prop="sourceFlightNo"> |
| 97 | - <el-input v-model="form.sourceFlightNo" placeholder="请输入原航班号" maxlength="10"/> | 250 | + <el-input |
| 251 | + v-model="form.sourceFlightNo" | ||
| 252 | + placeholder="请输入原航班号" | ||
| 253 | + maxlength="10" | ||
| 254 | + /> | ||
| 255 | + </el-form-item> | ||
| 256 | + </el-col> | ||
| 257 | + | ||
| 258 | + <el-col :span="8"> | ||
| 259 | + <el-form-item label="口岸" prop="portName"> | ||
| 260 | + <el-select | ||
| 261 | + :disabled="true" | ||
| 262 | + v-model="form.portName" | ||
| 263 | + size="mini" | ||
| 264 | + placeholder="选择口岸" | ||
| 265 | + > | ||
| 266 | + <el-option | ||
| 267 | + v-for="item in portNameList" | ||
| 268 | + :label="item" | ||
| 269 | + :value="item" | ||
| 270 | + :key="item" | ||
| 271 | + > | ||
| 272 | + </el-option> | ||
| 273 | + </el-select> | ||
| 98 | </el-form-item> | 274 | </el-form-item> |
| 99 | </el-col> | 275 | </el-col> |
| 100 | </el-row> | 276 | </el-row> |
| 101 | <el-row> | 277 | <el-row> |
| 102 | <el-col :span="8"> | 278 | <el-col :span="8"> |
| 103 | <el-form-item label="有效开始时间" prop="startDate"> | 279 | <el-form-item label="有效开始时间" prop="startDate"> |
| 104 | - <el-date-picker clearable size="small" :picker-options="pickerOptionsStart" v-model="form.startDate" | 280 | + <el-date-picker |
| 105 | - type="date" value-format="yyyy-MM-dd" placeholder="选择开始时间"> | 281 | + clearable |
| 282 | + size="small" | ||
| 283 | + :picker-options="pickerOptionsStart" | ||
| 284 | + v-model="form.startDate" | ||
| 285 | + type="date" | ||
| 286 | + value-format="yyyy-MM-dd" | ||
| 287 | + placeholder="选择开始时间" | ||
| 288 | + > | ||
| 106 | </el-date-picker> | 289 | </el-date-picker> |
| 107 | </el-form-item> | 290 | </el-form-item> |
| 108 | </el-col> | 291 | </el-col> |
| 109 | <el-col :span="12"> | 292 | <el-col :span="12"> |
| 110 | <el-form-item label="有效结束时间" prop="endDate"> | 293 | <el-form-item label="有效结束时间" prop="endDate"> |
| 111 | - <el-date-picker clearable size="small" :picker-options="pickerOptionsEnd" v-model="form.endDate" | 294 | + <el-date-picker |
| 112 | - type="date" value-format="yyyy-MM-dd" placeholder="选择结束时间"> | 295 | + clearable |
| 296 | + size="small" | ||
| 297 | + :picker-options="pickerOptionsEnd" | ||
| 298 | + v-model="form.endDate" | ||
| 299 | + type="date" | ||
| 300 | + value-format="yyyy-MM-dd" | ||
| 301 | + placeholder="选择结束时间" | ||
| 302 | + > | ||
| 113 | </el-date-picker> | 303 | </el-date-picker> |
| 114 | </el-form-item> | 304 | </el-form-item> |
| 115 | </el-col> | 305 | </el-col> |
| 116 | 306 | ||
| 117 | - <el-col :span="24" style="margin-bottom: 5%;"> | 307 | + <el-col :span="24" style="margin-bottom: 5%"> |
| 118 | - <span style="color: #ff4949;margin-left: 10%;">提示:配载航班之间请用分号分隔【符号不区分中英文】,例:CA1053;C7433</span><br /> | 308 | + <span style="color: #ff4949; margin-left: 10%" |
| 119 | - <span style="color: #ff4949;margin-left: 10%;">提示:如果需要设置配载航班延迟或提前可以直接在目的航斑后加减【+-】天数。如:CA1053+1;CZ433-1</span> | 309 | + >提示:配载航班之间请用分号分隔【符号不区分中英文】,例:CA1053;C7433</span |
| 310 | + ><br /> | ||
| 311 | + <span style="color: #ff4949; margin-left: 10%" | ||
| 312 | + >提示:如果需要设置配载航班延迟或提前可以直接在目的航斑后加减【+-】天数。如:CA1053+1;CZ433-1</span | ||
| 313 | + > | ||
| 120 | </el-col> | 314 | </el-col> |
| 121 | <el-col :span="24"> | 315 | <el-col :span="24"> |
| 122 | <el-form-item label="配载航班" prop="flightRank"> | 316 | <el-form-item label="配载航班" prop="flightRank"> |
| 123 | - <el-input type="textarea" v-model="form.flightRank" :rows="4"></el-input> | 317 | + <el-input |
| 318 | + type="textarea" | ||
| 319 | + v-model="form.flightRank" | ||
| 320 | + :rows="4" | ||
| 321 | + ></el-input> | ||
| 124 | </el-form-item> | 322 | </el-form-item> |
| 125 | </el-col> | 323 | </el-col> |
| 126 | <el-col :span="24"> | 324 | <el-col :span="24"> |
| 127 | <el-form-item label="周期段"> | 325 | <el-form-item label="周期段"> |
| 128 | <el-checkbox-group v-model="dayOfWeek"> | 326 | <el-checkbox-group v-model="dayOfWeek"> |
| 129 | - <el-checkbox v-for="item in dayOfWeekList" :key="item" :label="item" :name="item"></el-checkbox> | 327 | + <el-checkbox |
| 328 | + v-for="item in dayOfWeekList" | ||
| 329 | + :key="item" | ||
| 330 | + :label="item" | ||
| 331 | + :name="item" | ||
| 332 | + ></el-checkbox> | ||
| 130 | </el-checkbox-group> | 333 | </el-checkbox-group> |
| 131 | </el-form-item> | 334 | </el-form-item> |
| 132 | </el-col> | 335 | </el-col> |
| 133 | - | ||
| 134 | </el-row> | 336 | </el-row> |
| 135 | </el-form> | 337 | </el-form> |
| 136 | <div slot="footer" class="dialog-footer"> | 338 | <div slot="footer" class="dialog-footer"> |
| ... | @@ -141,298 +343,323 @@ | ... | @@ -141,298 +343,323 @@ |
| 141 | </div> | 343 | </div> |
| 142 | </template> | 344 | </template> |
| 143 | <script> | 345 | <script> |
| 144 | - import { | 346 | +import { |
| 145 | - findSourceFlightRulesApi, | 347 | + findSourceFlightRulesApi, |
| 146 | - sourceFlightRulesSaveApi, | 348 | + sourceFlightRulesSaveApi, |
| 147 | - delOrEnableORDisableApi, | 349 | + delOrEnableORDisableApi, |
| 148 | - findSourceFlightAndFlightDateApi | 350 | + findSourceFlightAndFlightDateApi, |
| 149 | - } from "@/api/sourceFlightRules"; | 351 | +} from "@/api/sourceFlightRules"; |
| 150 | - export default { | 352 | +export default { |
| 151 | - name: "FlightRandConfig", | 353 | + name: "FlightRandConfig", |
| 152 | - data() { | 354 | + data() { |
| 153 | - return { | 355 | + return { |
| 154 | - // data 中设定 | 356 | + portNameList: [], |
| 155 | - pickerOptionsStart: { | 357 | + // data 中设定 |
| 156 | - disabledDate: time => { | 358 | + pickerOptionsStart: { |
| 157 | - let endDateVal = this.form.endDate; | 359 | + disabledDate: (time) => { |
| 158 | - if (endDateVal) { | 360 | + let endDateVal = this.form.endDate; |
| 159 | - return time.getTime() > new Date(endDateVal).getTime() || time.getTime() < new Date().getTime() - 24 * | 361 | + if (endDateVal) { |
| 160 | - 60 * 60 * 1000; | 362 | + return ( |
| 161 | - } else { | 363 | + time.getTime() > new Date(endDateVal).getTime() || |
| 162 | - return time.getTime() < new Date().getTime() - 24 * 60 * 60 * 1000; | 364 | + time.getTime() < new Date().getTime() - 24 * 60 * 60 * 1000 |
| 163 | - } | 365 | + ); |
| 366 | + } else { | ||
| 367 | + return time.getTime() < new Date().getTime() - 24 * 60 * 60 * 1000; | ||
| 164 | } | 368 | } |
| 165 | }, | 369 | }, |
| 166 | - pickerOptionsEnd: { | 370 | + }, |
| 167 | - disabledDate: time => { | 371 | + pickerOptionsEnd: { |
| 168 | - let beginDateVal = this.form.startDate; | 372 | + disabledDate: (time) => { |
| 169 | - if (beginDateVal) { | 373 | + let beginDateVal = this.form.startDate; |
| 170 | - return time.getTime() < new Date(beginDateVal).getTime(); | 374 | + if (beginDateVal) { |
| 171 | - } else { | 375 | + return time.getTime() < new Date(beginDateVal).getTime(); |
| 172 | - return time.getTime() < new Date().getTime() - 24 * 60 * 60 * 1000; | 376 | + } else { |
| 173 | - } | 377 | + return time.getTime() < new Date().getTime() - 24 * 60 * 60 * 1000; |
| 174 | } | 378 | } |
| 175 | }, | 379 | }, |
| 380 | + }, | ||
| 176 | 381 | ||
| 177 | - //周期段 | 382 | + //周期段 |
| 178 | - dayOfWeekList: ['D1', 'D2', 'D3', 'D4', 'D5', 'D6', 'D7'], | 383 | + dayOfWeekList: ["D1", "D2", "D3", "D4", "D5", "D6", "D7"], |
| 179 | - // 遮罩层 | 384 | + // 遮罩层 |
| 180 | - loading: false, | 385 | + loading: false, |
| 181 | - // 遮罩层 | 386 | + // 遮罩层 |
| 182 | - loadingFlightDate: false, | 387 | + loadingFlightDate: false, |
| 183 | - // 弹出层标题 | 388 | + // 弹出层标题 |
| 184 | - title: "", | 389 | + title: "", |
| 185 | - // 总条数 | 390 | + // 总条数 |
| 186 | - total: 0, | 391 | + total: 0, |
| 187 | - // 原航班规则数据 | 392 | + // 原航班规则数据 |
| 188 | - sourceFlightRulesList: [], | 393 | + sourceFlightRulesList: [], |
| 189 | - //目的航班数据 | 394 | + //目的航班数据 |
| 190 | - sourceFlightAndFlightDate: [], | 395 | + sourceFlightAndFlightDate: [], |
| 191 | - statusList: [{ | 396 | + statusList: [ |
| 192 | - 'id': 1, | 397 | + { |
| 193 | - 'name': '有效' | 398 | + id: 1, |
| 194 | - }, { | 399 | + name: "有效", |
| 195 | - 'id': 3, | ||
| 196 | - 'name': '停用' | ||
| 197 | - }], | ||
| 198 | - // 新增修改查看规则弹出层 | ||
| 199 | - open: false, | ||
| 200 | - // 是否显示查看目的航班弹出层 | ||
| 201 | - openFlightDate: false, | ||
| 202 | - // 查询参数 | ||
| 203 | - queryParams: { | ||
| 204 | - start: 0, //当前条数【代表第几条数据 +1开始】 | ||
| 205 | - pageNum: 1, | ||
| 206 | - limit: 20, //一页显示多少条数据 | ||
| 207 | - sourceFlightNo: undefined, //原航班号 | ||
| 208 | - status: undefined, //状态 | ||
| 209 | - flightDate: undefined //日期 | ||
| 210 | }, | 400 | }, |
| 211 | - dayOfWeek: [], | 401 | + { |
| 212 | - // 表单参数 | 402 | + id: 3, |
| 213 | - form: { | 403 | + name: "停用", |
| 214 | - dayOfWeek: [] | ||
| 215 | }, | 404 | }, |
| 216 | - // 表单校验 | 405 | + ], |
| 217 | - rules: { | 406 | + // 新增修改查看规则弹出层 |
| 218 | - sourceFlightNo: [{ | 407 | + open: false, |
| 408 | + // 是否显示查看目的航班弹出层 | ||
| 409 | + openFlightDate: false, | ||
| 410 | + // 查询参数 | ||
| 411 | + queryParams: { | ||
| 412 | + portName: undefined, | ||
| 413 | + start: 0, //当前条数【代表第几条数据 +1开始】 | ||
| 414 | + pageNum: 1, | ||
| 415 | + limit: 20, //一页显示多少条数据 | ||
| 416 | + sourceFlightNo: undefined, //原航班号 | ||
| 417 | + status: undefined, //状态 | ||
| 418 | + flightDate: undefined, //日期 | ||
| 419 | + }, | ||
| 420 | + dayOfWeek: [], | ||
| 421 | + // 表单参数 | ||
| 422 | + form: { | ||
| 423 | + dayOfWeek: [], | ||
| 424 | + }, | ||
| 425 | + // 表单校验 | ||
| 426 | + rules: { | ||
| 427 | + sourceFlightNo: [ | ||
| 428 | + { | ||
| 219 | required: true, | 429 | required: true, |
| 220 | message: "ACCS原航班号不能为空", | 430 | message: "ACCS原航班号不能为空", |
| 221 | - trigger: "blur" | 431 | + trigger: "blur", |
| 222 | - }], | 432 | + }, |
| 223 | - flightRank: [{ | 433 | + ], |
| 434 | + flightRank: [ | ||
| 435 | + { | ||
| 224 | required: true, | 436 | required: true, |
| 225 | message: "配载航班不能为空", | 437 | message: "配载航班不能为空", |
| 226 | - trigger: "blur" | 438 | + trigger: "blur", |
| 227 | - }], | ||
| 228 | - } | ||
| 229 | - }; | ||
| 230 | - }, | ||
| 231 | - created() { | ||
| 232 | - this.findSourceFlightRules(); | ||
| 233 | - }, | ||
| 234 | - methods: { | ||
| 235 | - //跳转到查看,修改页面 | ||
| 236 | - handleClick(flightiId, handle) { | ||
| 237 | - this.openFlightDate = false | ||
| 238 | - this.$router.push({ | ||
| 239 | - name: "FlightAllocConfigInfo", | ||
| 240 | - params: { | ||
| 241 | - handle: handle, | ||
| 242 | - id: flightiId | ||
| 243 | }, | 439 | }, |
| 244 | - }); | 440 | + ], |
| 245 | - | ||
| 246 | }, | 441 | }, |
| 247 | - /** 查询原航班顺位规则*/ | 442 | + }; |
| 248 | - findSourceFlightRules() { | 443 | + }, |
| 249 | - this.loading = true; | 444 | + created() { |
| 250 | - if (this.queryParams.pageNum > 1) { | 445 | + this.queryParams.portName = this.$store.state.user.activePortName; |
| 251 | - this.queryParams.start = (this.queryParams.pageNum - 1) * this.queryParams.limit | 446 | + this.findSourceFlightRules(); |
| 447 | + this.portNameList = this.$store.state.user.portNames; | ||
| 448 | + this.form.portName = this.$store.state.user.activePortName; | ||
| 449 | + }, | ||
| 450 | + activated(){ | ||
| 451 | + this.queryParams.portName = this.$store.state.user.activePortName; | ||
| 452 | + this.findSourceFlightRules(); | ||
| 453 | + this.portNameList = this.$store.state.user.portNames; | ||
| 454 | + this.form.portName = this.$store.state.user.activePortName; | ||
| 455 | + }, | ||
| 456 | + watch:{ | ||
| 457 | + open(val,oldVal){ | ||
| 458 | + if(val){ | ||
| 459 | + this.queryParams.portName = this.$store.state.user.activePortName; | ||
| 460 | + this.form.portName = this.$store.state.user.activePortName; | ||
| 461 | + } | ||
| 462 | + } | ||
| 463 | + }, | ||
| 464 | + methods: { | ||
| 465 | + //跳转到查看,修改页面 | ||
| 466 | + handleClick(flightiId, handle) { | ||
| 467 | + this.openFlightDate = false; | ||
| 468 | + this.$router.push({ | ||
| 469 | + name: "FlightAllocConfigInfo", | ||
| 470 | + params: { | ||
| 471 | + handle: handle, | ||
| 472 | + id: flightiId, | ||
| 473 | + }, | ||
| 474 | + }); | ||
| 475 | + }, | ||
| 476 | + /** 查询原航班顺位规则*/ | ||
| 477 | + findSourceFlightRules() { | ||
| 478 | + this.loading = true; | ||
| 479 | + if (this.queryParams.pageNum > 1) { | ||
| 480 | + this.queryParams.start = | ||
| 481 | + (this.queryParams.pageNum - 1) * this.queryParams.limit; | ||
| 482 | + } else { | ||
| 483 | + this.queryParams.start = 0; | ||
| 484 | + } | ||
| 485 | + findSourceFlightRulesApi(this.queryParams).then((response) => { | ||
| 486 | + if (response.code == 200) { | ||
| 487 | + this.sourceFlightRulesList = response.data.list; | ||
| 488 | + this.total = response.data.totalCount; | ||
| 489 | + this.loading = false; | ||
| 252 | } else { | 490 | } else { |
| 253 | - this.queryParams.start = 0; | 491 | + this.msgError(response.msg); |
| 254 | } | 492 | } |
| 255 | - findSourceFlightRulesApi(this.queryParams).then(response => { | 493 | + }); |
| 256 | - if (response.code == 200) { | 494 | + }, |
| 257 | - this.sourceFlightRulesList = response.data.list; | 495 | + /** 新增按钮操作 */ |
| 258 | - this.total = response.data.totalCount; | 496 | + handleAdd() { |
| 259 | - this.loading = false; | 497 | + this.form = {}; |
| 260 | - } else { | 498 | + this.open = true; |
| 261 | - this.msgError(response.msg); | 499 | + this.title = "添加原航班顺位规则"; |
| 262 | - } | 500 | + this.form.id = -1; |
| 263 | - | 501 | + this.dayOfWeek = []; |
| 502 | + // this.form.portName = this.$store.state.user.activePortName; | ||
| 503 | + }, | ||
| 504 | + /** 修改按钮操作 */ | ||
| 505 | + handleUpdate(row) { | ||
| 506 | + this.form = {}; | ||
| 507 | + this.dayOfWeek = []; | ||
| 508 | + this.open = true; | ||
| 509 | + this.title = "修改原航班顺位规则"; | ||
| 510 | + this.form = JSON.parse(JSON.stringify(row)); | ||
| 511 | + this.dayOfWeek = this.form.dayOfWeek | ||
| 512 | + ? this.form.dayOfWeek.split(";") | ||
| 513 | + : []; | ||
| 514 | + //this.form.dayOfWeek = this.form.dayOfWeek ? this.form.dayOfWeek.split(";") : []; | ||
| 515 | + }, | ||
| 516 | + /** 删除 启用 停用按钮操作 */ | ||
| 517 | + handleDeleteorPlayorpause(row, status, statusText) { | ||
| 518 | + //删除前需要停用 | ||
| 519 | + if (status === 0 && row.status != "3") { | ||
| 520 | + this.$message({ | ||
| 521 | + message: "请停用后删除", | ||
| 522 | + type: "warning", | ||
| 264 | }); | 523 | }); |
| 265 | - | 524 | + return; |
| 266 | - }, | 525 | + } |
| 267 | - /** 新增按钮操作 */ | 526 | + |
| 268 | - handleAdd() { | 527 | + this.$confirm("是否确认" + statusText + "此数据项?", "警告", { |
| 269 | - this.form = {}; | 528 | + confirmButtonText: "确定", |
| 270 | - this.open = true; | 529 | + cancelButtonText: "取消", |
| 271 | - this.title = "添加原航班顺位规则"; | 530 | + type: "warning", |
| 272 | - this.form.id = -1; | 531 | + }) |
| 273 | - this.dayOfWeek = []; | 532 | + .then(() => { |
| 274 | - | ||
| 275 | - }, | ||
| 276 | - /** 修改按钮操作 */ | ||
| 277 | - handleUpdate(row) { | ||
| 278 | - | ||
| 279 | - this.form = {}; | ||
| 280 | - this.dayOfWeek = []; | ||
| 281 | - this.open = true; | ||
| 282 | - this.title = "修改原航班顺位规则"; | ||
| 283 | - this.form = JSON.parse(JSON.stringify(row)); | ||
| 284 | - this.dayOfWeek = this.form.dayOfWeek ? this.form.dayOfWeek.split(";") : []; | ||
| 285 | - //this.form.dayOfWeek = this.form.dayOfWeek ? this.form.dayOfWeek.split(";") : []; | ||
| 286 | - | ||
| 287 | - }, | ||
| 288 | - /** 删除 启用 停用按钮操作 */ | ||
| 289 | - handleDeleteorPlayorpause(row, status, statusText) { | ||
| 290 | - //删除前需要停用 | ||
| 291 | - if (status === 0 && row.status != '3') { | ||
| 292 | - this.$message({ | ||
| 293 | - message: '请停用后删除', | ||
| 294 | - type: 'warning' | ||
| 295 | - }); | ||
| 296 | - return; | ||
| 297 | - } | ||
| 298 | - | ||
| 299 | - this.$confirm('是否确认' + statusText + '此数据项?', "警告", { | ||
| 300 | - confirmButtonText: "确定", | ||
| 301 | - cancelButtonText: "取消", | ||
| 302 | - type: "warning" | ||
| 303 | - }).then(function() { | ||
| 304 | - | ||
| 305 | let disable = { | 533 | let disable = { |
| 306 | id: row.id, | 534 | id: row.id, |
| 307 | - status: status | 535 | + status: status, |
| 308 | }; | 536 | }; |
| 309 | 537 | ||
| 310 | return delOrEnableORDisableApi(disable); | 538 | return delOrEnableORDisableApi(disable); |
| 311 | - }).then(response => { | 539 | + }) |
| 540 | + .then((response) => { | ||
| 312 | if (response.code == 200) { | 541 | if (response.code == 200) { |
| 313 | this.findSourceFlightRules(); | 542 | this.findSourceFlightRules(); |
| 314 | this.msgSuccess(statusText + "成功"); | 543 | this.msgSuccess(statusText + "成功"); |
| 315 | } else { | 544 | } else { |
| 316 | this.msgError(response.msg); | 545 | this.msgError(response.msg); |
| 317 | } | 546 | } |
| 318 | - | 547 | + }) |
| 319 | - }).catch(function() {}); | 548 | + .catch(() => {}); |
| 320 | - }, | 549 | + }, |
| 321 | - /** 提交按钮 */ | 550 | + /** 提交按钮 */ |
| 322 | - submitForm: function() { | 551 | + submitForm: function () { |
| 323 | - this.$refs["form"].validate(valid => { | 552 | + this.$refs["form"].validate((valid) => { |
| 324 | - if (valid) { | 553 | + if (valid) { |
| 325 | - this.form.dayOfWeek = this.dayOfWeek.sort(); | 554 | + this.form.dayOfWeek = this.dayOfWeek.sort(); |
| 326 | - let formdata = JSON.parse(JSON.stringify(this.form)); | 555 | + let formdata = JSON.parse(JSON.stringify(this.form)); |
| 327 | - formdata.sourceFlightNo=formdata.sourceFlightNo.trim().toUpperCase(); | 556 | + formdata.sourceFlightNo = formdata.sourceFlightNo |
| 328 | - formdata.flightRank=formdata.flightRank.trim().toUpperCase(); | 557 | + .trim() |
| 329 | - if (formdata.startDate === undefined || formdata.startDate == null) { | 558 | + .toUpperCase(); |
| 330 | - formdata.startDate = ""; | 559 | + formdata.flightRank = formdata.flightRank.trim().toUpperCase(); |
| 331 | - } | 560 | + if (formdata.startDate === undefined || formdata.startDate == null) { |
| 332 | - if (formdata.endDate === undefined || formdata.endDate == null) { | 561 | + formdata.startDate = ""; |
| 333 | - formdata.endDate = ""; | ||
| 334 | - } | ||
| 335 | - //处理数据 | ||
| 336 | - sourceFlightRulesSaveApi(formdata).then(response => { | ||
| 337 | - if (response.code === 200) { | ||
| 338 | - this.msgSuccess("保存成功"); | ||
| 339 | - this.open = false; | ||
| 340 | - this.findSourceFlightRules(); | ||
| 341 | - } else { | ||
| 342 | - this.msgError(response.msg); | ||
| 343 | - } | ||
| 344 | - }); | ||
| 345 | - | ||
| 346 | } | 562 | } |
| 347 | - }); | 563 | + if (formdata.endDate === undefined || formdata.endDate == null) { |
| 348 | - }, | 564 | + formdata.endDate = ""; |
| 349 | - // 表单重置 | ||
| 350 | - reset() { | ||
| 351 | - this.form = { | ||
| 352 | - | ||
| 353 | - dayOfWeek: [] | ||
| 354 | - | ||
| 355 | - }; | ||
| 356 | - this.resetForm("form"); | ||
| 357 | - }, | ||
| 358 | - /** 查询目的航班*/ | ||
| 359 | - findSourceFlightAndFlightDate() { | ||
| 360 | - //校验原航班号非空 | ||
| 361 | - if (this.queryParams.sourceFlightNo === null || this.queryParams.sourceFlightNo === undefined || this | ||
| 362 | - .queryParams.sourceFlightNo.trim() === '') { | ||
| 363 | - this.$message.warning("ACCS原航班号为空"); | ||
| 364 | - return | ||
| 365 | - } | ||
| 366 | - //校验原日期非空 | ||
| 367 | - if (this.queryParams.flightDate === null || this.queryParams.flightDate === undefined) { | ||
| 368 | - this.$message.warning("日期为空"); | ||
| 369 | - return | ||
| 370 | - } | ||
| 371 | - this.openFlightDate = true; | ||
| 372 | - this.loadingFlightDate = true; | ||
| 373 | - this.sourceFlightAndFlightDate = []; | ||
| 374 | - findSourceFlightAndFlightDateApi(this.queryParams).then(response => { | ||
| 375 | - if (response.code === 200) { | ||
| 376 | - this.sourceFlightAndFlightDate = response.data; | ||
| 377 | - this.loadingFlightDate = false; | ||
| 378 | - } else { | ||
| 379 | - this.msgError(response.msg); | ||
| 380 | } | 565 | } |
| 381 | - | 566 | + //处理数据 |
| 382 | - }); | 567 | + sourceFlightRulesSaveApi(formdata).then((response) => { |
| 383 | - | 568 | + if (response.code === 200) { |
| 384 | - | 569 | + this.msgSuccess("保存成功"); |
| 385 | - }, | 570 | + this.open = false; |
| 386 | - // 目的航班弹出框返回 | 571 | + this.findSourceFlightRules(); |
| 387 | - cancelFlightDate() { | 572 | + } else { |
| 388 | - this.openFlightDate = false; | 573 | + this.msgError(response.msg); |
| 389 | - this.findSourceFlightRules(); | 574 | + } |
| 390 | - }, | 575 | + }); |
| 391 | - // 取消按钮 | ||
| 392 | - cancel() { | ||
| 393 | - this.open = false; | ||
| 394 | - this.findSourceFlightRules(); | ||
| 395 | - //this.reset(); | ||
| 396 | - }, | ||
| 397 | - // 状态字典翻译 | ||
| 398 | - statusFormat(row) { | ||
| 399 | - | ||
| 400 | - if (row.status === '1') { | ||
| 401 | - return '有效' | ||
| 402 | - } else if (row.status === '0') { | ||
| 403 | - return '执行中' | ||
| 404 | - } else if (row.status === '3') { | ||
| 405 | - return '停用' | ||
| 406 | } | 576 | } |
| 407 | - return row.status; | 577 | + }); |
| 408 | - }, | ||
| 409 | - /** 重置按钮操作 */ | ||
| 410 | - resetQuery() { | ||
| 411 | - this.queryParams.sourceFlightNo = undefined | ||
| 412 | - this.resetForm("queryForm"); | ||
| 413 | - this.handleQuery(); | ||
| 414 | - }, | ||
| 415 | - /** 搜索按钮操作 */ | ||
| 416 | - handleQuery() { | ||
| 417 | - this.queryParams.pageNum = 1; | ||
| 418 | - this.queryParams.start = 0; | ||
| 419 | - this.findSourceFlightRules(); | ||
| 420 | - }, | ||
| 421 | - | ||
| 422 | }, | 578 | }, |
| 423 | - computed: { | 579 | + // 表单重置 |
| 424 | - upCase: { | 580 | + reset() { |
| 425 | - get: function() { | 581 | + this.form = { |
| 426 | - return this.queryParams.sourceFlightNo; | 582 | + dayOfWeek: [], |
| 427 | - }, | 583 | + }; |
| 428 | - set: function(val) { | 584 | + this.resetForm("form"); |
| 429 | - this.queryParams.sourceFlightNo = val.toUpperCase(); | 585 | + }, |
| 430 | - }, | 586 | + /** 查询目的航班*/ |
| 587 | + findSourceFlightAndFlightDate() { | ||
| 588 | + //校验原航班号非空 | ||
| 589 | + if ( | ||
| 590 | + this.queryParams.sourceFlightNo === null || | ||
| 591 | + this.queryParams.sourceFlightNo === undefined || | ||
| 592 | + this.queryParams.sourceFlightNo.trim() === "" | ||
| 593 | + ) { | ||
| 594 | + this.$message.warning("ACCS原航班号为空"); | ||
| 595 | + return; | ||
| 596 | + } | ||
| 597 | + //校验原日期非空 | ||
| 598 | + if ( | ||
| 599 | + this.queryParams.flightDate === null || | ||
| 600 | + this.queryParams.flightDate === undefined | ||
| 601 | + ) { | ||
| 602 | + this.$message.warning("日期为空"); | ||
| 603 | + return; | ||
| 604 | + } | ||
| 605 | + this.openFlightDate = true; | ||
| 606 | + this.loadingFlightDate = true; | ||
| 607 | + this.sourceFlightAndFlightDate = []; | ||
| 608 | + findSourceFlightAndFlightDateApi(this.queryParams).then((response) => { | ||
| 609 | + if (response.code === 200) { | ||
| 610 | + this.sourceFlightAndFlightDate = response.data; | ||
| 611 | + this.loadingFlightDate = false; | ||
| 612 | + } else { | ||
| 613 | + this.msgError(response.msg); | ||
| 614 | + } | ||
| 615 | + }); | ||
| 616 | + }, | ||
| 617 | + // 目的航班弹出框返回 | ||
| 618 | + cancelFlightDate() { | ||
| 619 | + this.openFlightDate = false; | ||
| 620 | + this.findSourceFlightRules(); | ||
| 621 | + }, | ||
| 622 | + // 取消按钮 | ||
| 623 | + cancel() { | ||
| 624 | + this.open = false; | ||
| 625 | + this.findSourceFlightRules(); | ||
| 626 | + //this.reset(); | ||
| 627 | + }, | ||
| 628 | + // 状态字典翻译 | ||
| 629 | + statusFormat(row) { | ||
| 630 | + if (row.status === "1") { | ||
| 631 | + return "有效"; | ||
| 632 | + } else if (row.status === "0") { | ||
| 633 | + return "执行中"; | ||
| 634 | + } else if (row.status === "3") { | ||
| 635 | + return "停用"; | ||
| 636 | + } | ||
| 637 | + return row.status; | ||
| 638 | + }, | ||
| 639 | + /** 重置按钮操作 */ | ||
| 640 | + resetQuery() { | ||
| 641 | + this.queryParams.sourceFlightNo = undefined; | ||
| 642 | + this.resetForm("queryForm"); | ||
| 643 | + this.handleQuery(); | ||
| 644 | + }, | ||
| 645 | + /** 搜索按钮操作 */ | ||
| 646 | + handleQuery() { | ||
| 647 | + this.queryParams.pageNum = 1; | ||
| 648 | + this.queryParams.start = 0; | ||
| 649 | + this.findSourceFlightRules(); | ||
| 650 | + }, | ||
| 651 | + }, | ||
| 652 | + computed: { | ||
| 653 | + upCase: { | ||
| 654 | + get: function () { | ||
| 655 | + return this.queryParams.sourceFlightNo; | ||
| 656 | + }, | ||
| 657 | + set: function (val) { | ||
| 658 | + this.queryParams.sourceFlightNo = val.toUpperCase(); | ||
| 431 | }, | 659 | }, |
| 432 | }, | 660 | }, |
| 433 | - }; | 661 | + }, |
| 662 | +}; | ||
| 434 | </script> | 663 | </script> |
| 435 | <style> | 664 | <style> |
| 436 | - | ||
| 437 | - | ||
| 438 | </style> | 665 | </style> | ... | ... |
| ... | @@ -102,6 +102,7 @@ | ... | @@ -102,6 +102,7 @@ |
| 102 | :loading="downLoadingTip.downloading" | 102 | :loading="downLoadingTip.downloading" |
| 103 | icon="el-icon-download" | 103 | icon="el-icon-download" |
| 104 | size="mini" | 104 | size="mini" |
| 105 | + v-hasPermi="['base:caExport:export']" | ||
| 105 | >{{ | 106 | >{{ |
| 106 | downLoadingTip.downloading ? downLoadingTip.tip : "导出" | 107 | downLoadingTip.downloading ? downLoadingTip.tip : "导出" |
| 107 | }}</el-button | 108 | }}</el-button | ... | ... |
| ... | @@ -4,12 +4,12 @@ | ... | @@ -4,12 +4,12 @@ |
| 4 | <el-form-item> | 4 | <el-form-item> |
| 5 | <el-upload action="/caPreReviewImport/importFlight" name="file" :http-request="uploadExcel" | 5 | <el-upload action="/caPreReviewImport/importFlight" name="file" :http-request="uploadExcel" |
| 6 | :on-remove="handleRemove" :limit="1" :on-exceed="handleExceed" :file-list="fileList" accept=".xlsx" | 6 | :on-remove="handleRemove" :limit="1" :on-exceed="handleExceed" :file-list="fileList" accept=".xlsx" |
| 7 | - class="upload-demo"> | 7 | + class="upload-demo" v-hasPermi="['base:caImport:import']"> |
| 8 | <el-button type="primary">点击上传</el-button> | 8 | <el-button type="primary">点击上传</el-button> |
| 9 | </el-upload> | 9 | </el-upload> |
| 10 | </el-form-item> | 10 | </el-form-item> |
| 11 | <el-form-item> | 11 | <el-form-item> |
| 12 | - <el-button type="primary" @click="downloadTempleate">下载模板</el-button> | 12 | + <el-button type="primary" @click="downloadTempleate" v-hasPermi="['base:caImport:download']">下载模板</el-button> |
| 13 | </el-form-item> | 13 | </el-form-item> |
| 14 | </el-form> | 14 | </el-form> |
| 15 | <div style="font-size: 12px; font-weight: 700"> | 15 | <div style="font-size: 12px; font-weight: 700"> | ... | ... |
| ... | @@ -23,12 +23,13 @@ | ... | @@ -23,12 +23,13 @@ |
| 23 | :file-list="fileList" | 23 | :file-list="fileList" |
| 24 | accept=".xlsx" | 24 | accept=".xlsx" |
| 25 | class="upload-demo" | 25 | class="upload-demo" |
| 26 | + v-hasPermi="['base:flightImport:importFlight']" | ||
| 26 | > | 27 | > |
| 27 | <el-button type="primary">点击上传</el-button> | 28 | <el-button type="primary">点击上传</el-button> |
| 28 | </el-upload> | 29 | </el-upload> |
| 29 | </el-form-item> | 30 | </el-form-item> |
| 30 | <el-form-item> | 31 | <el-form-item> |
| 31 | - <el-button type="primary" @click="downloadTempleate" | 32 | + <el-button type="primary" @click="downloadTempleate" v-hasPermi="['base:flightImport:exportExcel']" |
| 32 | >下载模板</el-button | 33 | >下载模板</el-button |
| 33 | > | 34 | > |
| 34 | </el-form-item> | 35 | </el-form-item> | ... | ... |
| ... | @@ -50,11 +50,11 @@ | ... | @@ -50,11 +50,11 @@ |
| 50 | 50 | ||
| 51 | <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> | 51 | <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> |
| 52 | <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> | 52 | <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> |
| 53 | - <el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button> | 53 | + <el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['base:flightInfo:add']">新增</el-button> |
| 54 | - <el-button type="danger" icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete">删除 | 54 | + <el-button type="danger" icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete" v-hasPermi="['base:flightInfo:delete']">删除 |
| 55 | </el-button> | 55 | </el-button> |
| 56 | - <el-button type="primary" icon="el-icon-circle-check" size="mini" @click="handleFlightStatus('flightStatus10')">自动配舱开启</el-button> | 56 | + <el-button type="primary" icon="el-icon-circle-check" size="mini" @click="handleFlightStatus('flightStatus10')" v-hasPermi="['base:flightInfo:open']">自动配舱开启</el-button> |
| 57 | - <el-button type="primary" icon="el-icon-circle-close" size="mini" @click="handleFlightStatus('flightStatus80')">自动配舱关闭</el-button> | 57 | + <el-button type="primary" icon="el-icon-circle-close" size="mini" @click="handleFlightStatus('flightStatus80')" v-hasPermi="['base:flightInfo:close']">自动配舱关闭</el-button> |
| 58 | 58 | ||
| 59 | </el-form> | 59 | </el-form> |
| 60 | <!-- <el-row :gutter="10" class="mb8"> | 60 | <!-- <el-row :gutter="10" class="mb8"> |
| ... | @@ -112,9 +112,9 @@ | ... | @@ -112,9 +112,9 @@ |
| 112 | <el-table-column label="最后修改时间" align="center" prop="lastModifyTime" width="120" /> | 112 | <el-table-column label="最后修改时间" align="center" prop="lastModifyTime" width="120" /> |
| 113 | 113 | ||
| 114 | <el-table-column v-if="findAllFltDatList.length>0" label="操作" align="center" | 114 | <el-table-column v-if="findAllFltDatList.length>0" label="操作" align="center" |
| 115 | - class-name="small-padding fixed-width" width="130" fixed="right"> | 115 | + class-name="small-padding fixed-width" width="130" fixed="right" style="top:0!important"> |
| 116 | <template slot-scope="scope"> | 116 | <template slot-scope="scope"> |
| 117 | - <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">修改</el-button> | 117 | + <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['base:flightInfo:update']">修改</el-button> |
| 118 | <!-- <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row,'删除')"> | 118 | <!-- <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row,'删除')"> |
| 119 | 删除</el-button> --> | 119 | 删除</el-button> --> |
| 120 | </template> | 120 | </template> | ... | ... |
| ... | @@ -216,10 +216,10 @@ | ... | @@ -216,10 +216,10 @@ |
| 216 | @click="select(0)" | 216 | @click="select(0)" |
| 217 | >查询</el-button | 217 | >查询</el-button |
| 218 | > | 218 | > |
| 219 | - <el-button :type="downLoadingTip.downloading?'warning':'primary'" size="small" @click="xlse(0)" :disabled="tableData.length==0" :loading="downLoadingTip.downloading" | 219 | + <el-button :type="downLoadingTip.downloading?'warning':'primary'" size="small" @click="xlse(0)" :disabled="tableData.length==0" :loading="downLoadingTip.downloading" v-hasPermi="['base:cargo:export']" |
| 220 | >{{downLoadingTip.downloading?downLoadingTip.tip:"导出本页查询结果"}}</el-button | 220 | >{{downLoadingTip.downloading?downLoadingTip.tip:"导出本页查询结果"}}</el-button |
| 221 | > | 221 | > |
| 222 | - <el-button :type="downLoadingTip.downloading?'warning':'primary'" size="small" @click="xlse(1)" :disabled="tableData.length==0" :loading="downLoadingTip.downloading" | 222 | + <el-button :type="downLoadingTip.downloading?'warning':'primary'" size="small" @click="xlse(1)" :disabled="tableData.length==0" :loading="downLoadingTip.downloading" v-hasPermi="['base:cargo:export']" |
| 223 | >{{downLoadingTip.downloading?downLoadingTip.tip:"导出全部查询结果"}}</el-button | 223 | >{{downLoadingTip.downloading?downLoadingTip.tip:"导出全部查询结果"}}</el-button |
| 224 | > | 224 | > |
| 225 | <span style="marginLeft:20px;color:#ffba00">全部导出上限80000条数据</span> | 225 | <span style="marginLeft:20px;color:#ffba00">全部导出上限80000条数据</span> |
| ... | @@ -706,7 +706,7 @@ export default { | ... | @@ -706,7 +706,7 @@ export default { |
| 706 | limitSize: 100, //无限制-1 | 706 | limitSize: 100, //无限制-1 |
| 707 | page:1, | 707 | page:1, |
| 708 | progress:0, | 708 | progress:0, |
| 709 | - formShow:false, | 709 | + formShow:true, |
| 710 | }; | 710 | }; |
| 711 | }, | 711 | }, |
| 712 | created() { | 712 | created() { | ... | ... |
src/views/systemConfig/menuConfig/drawer.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <div class="menuDrawer"> | ||
| 3 | + <el-dialog | ||
| 4 | + :title="drawerTitle" | ||
| 5 | + width="50%" | ||
| 6 | + :visible.sync="dialogVisible" | ||
| 7 | + :close-on-click-modal="false" | ||
| 8 | + :append-to-body="true" | ||
| 9 | + > | ||
| 10 | + <el-form | ||
| 11 | + ref="userForm" | ||
| 12 | + :model="menuForm" | ||
| 13 | + :disabled="menuFormDisabled" | ||
| 14 | + :rules="rules" | ||
| 15 | + label-width="auto" | ||
| 16 | + style="margin: 10px" | ||
| 17 | + > | ||
| 18 | + <el-row> | ||
| 19 | + <el-col :span="12"> | ||
| 20 | + <el-form-item label="菜单名称" prop=""> | ||
| 21 | + <!-- <el-input | ||
| 22 | + placeholder="请输入权限名" | ||
| 23 | + :disabled="menuFormDisabled" | ||
| 24 | + v-model="menuData.userName" | ||
| 25 | + size="mini" | ||
| 26 | + ></el-input> --> | ||
| 27 | + </el-form-item> | ||
| 28 | + </el-col> | ||
| 29 | + <el-col :span="12"> | ||
| 30 | + <el-form-item label="菜单路由" prop=""> | ||
| 31 | + <!-- <el-input | ||
| 32 | + placeholder="请输入权限名" | ||
| 33 | + :disabled="menuFormDisabled" | ||
| 34 | + v-model="menuData.userName" | ||
| 35 | + size="mini" | ||
| 36 | + ></el-input> --> | ||
| 37 | + </el-form-item> | ||
| 38 | + </el-col> | ||
| 39 | + <el-col :span="12"> | ||
| 40 | + <el-form-item label="组件名称" prop=""> | ||
| 41 | + <!-- <el-input | ||
| 42 | + placeholder="请输入权限名" | ||
| 43 | + :disabled="menuFormDisabled" | ||
| 44 | + v-model="menuData.userName" | ||
| 45 | + size="mini" | ||
| 46 | + ></el-input> --> | ||
| 47 | + </el-form-item> | ||
| 48 | + </el-col> | ||
| 49 | + <el-col :span="24"> | ||
| 50 | + <el-form-item label="菜单状态" prop=""> | ||
| 51 | + <el-switch | ||
| 52 | + v-model="menuData.menuStatus" | ||
| 53 | + active-color="#13ce66" | ||
| 54 | + inactive-color="#ff4949" | ||
| 55 | + :disabled="menuFormDisabled" | ||
| 56 | + ></el-switch> | ||
| 57 | + </el-form-item> | ||
| 58 | + </el-col> | ||
| 59 | + <el-col :span="24"> | ||
| 60 | + <el-form-item label="图标选择" prop=""> | ||
| 61 | + <iconSelect @selected="selected"></iconSelect> | ||
| 62 | + </el-form-item> | ||
| 63 | + </el-col> | ||
| 64 | + <el-col :span="24"> | ||
| 65 | + <el-form-item label="权限设置" prop=""> | ||
| 66 | + <el-col :span="6"> | ||
| 67 | + <el-radio label="页面" size="medium"></el-radio> | ||
| 68 | + </el-col> | ||
| 69 | + <el-col :span="6"> | ||
| 70 | + <el-radio label="按钮" size="medium"></el-radio> | ||
| 71 | + </el-col> | ||
| 72 | + <el-col :span="24"> | ||
| 73 | + <el-card shadow="never"> | ||
| 74 | + <el-input placeholder=""></el-input> | ||
| 75 | + </el-card> | ||
| 76 | + </el-col> | ||
| 77 | + </el-form-item> | ||
| 78 | + </el-col> | ||
| 79 | + </el-row> | ||
| 80 | + </el-form> | ||
| 81 | + | ||
| 82 | + <div slot="footer"> | ||
| 83 | + <el-button @click="handleClose">取 消</el-button> | ||
| 84 | + <el-button type="primary" @click="submit">确 定</el-button> | ||
| 85 | + </div> | ||
| 86 | + </el-dialog> | ||
| 87 | + </div> | ||
| 88 | +</template> | ||
| 89 | + | ||
| 90 | +<script> | ||
| 91 | +import iconSelect from "@/components/IconSelect"; | ||
| 92 | +export default { | ||
| 93 | + components: { | ||
| 94 | + iconSelect, | ||
| 95 | + }, | ||
| 96 | + props: { | ||
| 97 | + drawerTitle: { | ||
| 98 | + type: String, | ||
| 99 | + default: "", | ||
| 100 | + }, | ||
| 101 | + menuFormDisabled: { | ||
| 102 | + type: Boolean, | ||
| 103 | + default: false, | ||
| 104 | + }, | ||
| 105 | + dialogVisible: { | ||
| 106 | + type: Boolean, | ||
| 107 | + default: false, | ||
| 108 | + }, | ||
| 109 | + menuData: { | ||
| 110 | + type: Object, | ||
| 111 | + default: null, | ||
| 112 | + }, | ||
| 113 | + }, | ||
| 114 | + data() { | ||
| 115 | + return { | ||
| 116 | + menuForm: {}, | ||
| 117 | + rules:{} | ||
| 118 | + }; | ||
| 119 | + }, | ||
| 120 | + updated() { | ||
| 121 | + this.menuForm = this.menuData; | ||
| 122 | + }, | ||
| 123 | + methods: { | ||
| 124 | + handleClose() { | ||
| 125 | + this.$emit("handleClose", false); | ||
| 126 | + }, | ||
| 127 | + selected(val) { | ||
| 128 | + console.log(val); | ||
| 129 | + }, | ||
| 130 | + submit() {}, | ||
| 131 | + }, | ||
| 132 | +}; | ||
| 133 | +</script> | ||
| 134 | + | ||
| 135 | +<style> | ||
| 136 | +</style> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
src/views/systemConfig/menuConfig/index.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <div> | ||
| 3 | + <el-form ref="selectionUserForm" label-width="auto" style="margin: 20px"> | ||
| 4 | + <el-row :gutter="50"> </el-row> | ||
| 5 | + </el-form> | ||
| 6 | + <!-- <div style="margin:20px"> | ||
| 7 | + <el-button type="primary" icon="el-icon-plus" size="mini" @click="addMenu" | ||
| 8 | + >新增菜单</el-button | ||
| 9 | + > | ||
| 10 | + </div> --> | ||
| 11 | + <el-table | ||
| 12 | + :data="data" | ||
| 13 | + row-key="id" | ||
| 14 | + fit | ||
| 15 | + border | ||
| 16 | + stripe | ||
| 17 | + highlightCurrentRow | ||
| 18 | + v-loading="loading" | ||
| 19 | + default-expand-all | ||
| 20 | + :tree-props="{ children: 'children', hasChildren: 'hasChildren' }" | ||
| 21 | + > | ||
| 22 | + <el-table-column | ||
| 23 | + v-for="(item, index) in tableHeader" | ||
| 24 | + :prop="item.value" | ||
| 25 | + :label="item.name" | ||
| 26 | + :key="index" | ||
| 27 | + :align="item.align" | ||
| 28 | + header-align="center" | ||
| 29 | + showOverflowTooltip | ||
| 30 | + :width="item.width" | ||
| 31 | + :formatter="formatter" | ||
| 32 | + > | ||
| 33 | + </el-table-column> | ||
| 34 | + <el-table-column | ||
| 35 | + header-align="center" | ||
| 36 | + align="center" | ||
| 37 | + label="操作" | ||
| 38 | + width="auto" | ||
| 39 | + > | ||
| 40 | + <template slot-scope="scope"> | ||
| 41 | + <!-- <el-button type="success" size="mini" @click="buttonClick(scope)">修改</el-button> | ||
| 42 | + <el-button type="primary" size="mini" @click="buttonClick(scope)" | ||
| 43 | + >查看</el-button | ||
| 44 | + > --> | ||
| 45 | + <el-button | ||
| 46 | + :type="scope.row.status == 1 ? 'warning' : 'primary'" | ||
| 47 | + v-hasPermi="['system:menu:openClose']" | ||
| 48 | + size="mini" | ||
| 49 | + @click="menuStatus(scope)" | ||
| 50 | + v-if="scope.row.menuType == 'C'" | ||
| 51 | + >{{ scope.row.status == 1 ? "停用菜单" : "启用菜单" }}</el-button | ||
| 52 | + > | ||
| 53 | + <el-button | ||
| 54 | + type="danger" | ||
| 55 | + size="mini" | ||
| 56 | + v-hasPermi="['system:menu:delete']" | ||
| 57 | + @click="removeMenu(scope)" | ||
| 58 | + v-if="scope.row.menuType == 'C'" | ||
| 59 | + >删除菜单</el-button | ||
| 60 | + > | ||
| 61 | + </template> | ||
| 62 | + </el-table-column> | ||
| 63 | + </el-table> | ||
| 64 | + | ||
| 65 | + <!-- <Tables | ||
| 66 | + ref="newTable" | ||
| 67 | + :data="data" | ||
| 68 | + :headerData="tableHeader" | ||
| 69 | + size="medium" | ||
| 70 | + rowKey="id" | ||
| 71 | + :defaultExpandAll="true" | ||
| 72 | + height="auto" | ||
| 73 | + @tableSelect="tableSelect" | ||
| 74 | + @tableSelectAll="tableSelectAll" | ||
| 75 | + @SelectChange="SelectChange" | ||
| 76 | + > | ||
| 77 | + <el-table-column | ||
| 78 | + header-align="center" | ||
| 79 | + align="center" | ||
| 80 | + label="操作" | ||
| 81 | + width="auto" | ||
| 82 | + > | ||
| 83 | + <template slot-scope="scope"> | ||
| 84 | + <el-button type="primary" size="mini" @click="menuStatus(scope)">{{ | ||
| 85 | + scope.menuStatus == 0 ? "停用" : "启用" | ||
| 86 | + }}</el-button> | ||
| 87 | + <el-button type="danger" size="mini" @click="removeMenu(scope)" | ||
| 88 | + >删除菜单</el-button | ||
| 89 | + > | ||
| 90 | + </template> | ||
| 91 | + </el-table-column> | ||
| 92 | + </Tables> --> | ||
| 93 | + <!-- <Drawer | ||
| 94 | + :dialogVisible="drawer" | ||
| 95 | + :drawerTitle="drawerTitle" | ||
| 96 | + :menuFormDisabled="menuFormDisabled" | ||
| 97 | + :menuData="menuData" | ||
| 98 | + @handleClose="handleClose" | ||
| 99 | + ></Drawer> --> | ||
| 100 | + </div> | ||
| 101 | +</template> | ||
| 102 | + | ||
| 103 | +<script> | ||
| 104 | +import { getAllAuth, updateStatus } from "@/api/system/user.js"; | ||
| 105 | +import dictLabels from "@/assets/languages/dictLabels.js"; | ||
| 106 | +import Drawer from "./drawer.vue"; | ||
| 107 | +import { MessageBox } from "element-ui"; | ||
| 108 | +export default { | ||
| 109 | + name:"menuConfig", | ||
| 110 | + components: { | ||
| 111 | + Drawer, | ||
| 112 | + }, | ||
| 113 | + data() { | ||
| 114 | + return { | ||
| 115 | + drawer: false, | ||
| 116 | + menuFormDisabled: false, | ||
| 117 | + loading:false, | ||
| 118 | + drawerTitle: "", | ||
| 119 | + menuData: {}, | ||
| 120 | + data: [], | ||
| 121 | + tableHeader: [ | ||
| 122 | + { | ||
| 123 | + type: "", | ||
| 124 | + name: "菜单名", | ||
| 125 | + value: "title", | ||
| 126 | + width: "200", | ||
| 127 | + align: "left", | ||
| 128 | + sorTable: false, | ||
| 129 | + }, | ||
| 130 | + { | ||
| 131 | + type: "", | ||
| 132 | + name: "菜单类型", | ||
| 133 | + value: "menuType", | ||
| 134 | + width: "100", | ||
| 135 | + align: "center", | ||
| 136 | + sortable: false, | ||
| 137 | + }, | ||
| 138 | + { | ||
| 139 | + type: "", | ||
| 140 | + name: "权限标识", | ||
| 141 | + value: "permissionKey", | ||
| 142 | + width: "auto", | ||
| 143 | + align: "left", | ||
| 144 | + sortable: false, | ||
| 145 | + }, | ||
| 146 | + { | ||
| 147 | + type: "", | ||
| 148 | + name: "菜单状态", | ||
| 149 | + value: "status", | ||
| 150 | + width: "100", | ||
| 151 | + align: "center", | ||
| 152 | + sorTable: false, | ||
| 153 | + }, | ||
| 154 | + { | ||
| 155 | + type: "", | ||
| 156 | + name: "菜单路由", | ||
| 157 | + value: "path", | ||
| 158 | + width: "auto", | ||
| 159 | + align: "left", | ||
| 160 | + sorTable: false, | ||
| 161 | + }, | ||
| 162 | + ], | ||
| 163 | + }; | ||
| 164 | + }, | ||
| 165 | + created() { | ||
| 166 | + this.menuAll(); | ||
| 167 | + }, | ||
| 168 | + methods: { | ||
| 169 | + addMenu() { | ||
| 170 | + this.menuData = {}; | ||
| 171 | + this.drawer = true; | ||
| 172 | + this.drawerTitle = "新增菜单"; | ||
| 173 | + this.menuFormDisabled = false; | ||
| 174 | + }, | ||
| 175 | + | ||
| 176 | + //关闭 | ||
| 177 | + handleClose(val) { | ||
| 178 | + this.drawer = val; | ||
| 179 | + }, | ||
| 180 | + | ||
| 181 | + buttonClick(row) { | ||
| 182 | + this.menuData = row.row; | ||
| 183 | + this.drawer = true; | ||
| 184 | + this.drawerTitle = "查看/修改"; | ||
| 185 | + this.menuFormDisabled = true; | ||
| 186 | + }, | ||
| 187 | + | ||
| 188 | + //表格数据 | ||
| 189 | + menuAll() { | ||
| 190 | + this.loading = true; | ||
| 191 | + getAllAuth().then((res) => { | ||
| 192 | + this.loading = false; | ||
| 193 | + if (res.code === 200) { | ||
| 194 | + res.data.length > 0 | ||
| 195 | + ? (this.data = res.data) | ||
| 196 | + : this.$message({ | ||
| 197 | + message: "数据为空", | ||
| 198 | + type: "warning", | ||
| 199 | + }); | ||
| 200 | + } else { | ||
| 201 | + this.$message({ | ||
| 202 | + message: res.msg, | ||
| 203 | + type: "warning", | ||
| 204 | + }); | ||
| 205 | + } | ||
| 206 | + }).catch(()=>{ | ||
| 207 | + this.loading = false; | ||
| 208 | + }); | ||
| 209 | + }, | ||
| 210 | + | ||
| 211 | + //菜单状态改变 | ||
| 212 | + statusUpdate(data) { | ||
| 213 | + updateStatus(data) | ||
| 214 | + .then((res) => { | ||
| 215 | + if (res.code === 200) { | ||
| 216 | + this.menuAll(); | ||
| 217 | + this.$message({ | ||
| 218 | + message: "操作成功", | ||
| 219 | + type: "success", | ||
| 220 | + }); | ||
| 221 | + location.reload() | ||
| 222 | + } else { | ||
| 223 | + this.$message({ | ||
| 224 | + message: res.msg, | ||
| 225 | + type: "warning", | ||
| 226 | + }); | ||
| 227 | + } | ||
| 228 | + }) | ||
| 229 | + .catch((err) => { | ||
| 230 | + console.log(err); | ||
| 231 | + }); | ||
| 232 | + }, | ||
| 233 | + | ||
| 234 | + //菜单开启关闭 | ||
| 235 | + menuStatus(row) { | ||
| 236 | + MessageBox.confirm( | ||
| 237 | + row.row.status == 1 ? "是否要关闭此菜单" : "是否要启用此菜单", | ||
| 238 | + "提示", | ||
| 239 | + { | ||
| 240 | + confirmButtonText: "确定", | ||
| 241 | + cancelButtonText: "取消", | ||
| 242 | + type: "warning", | ||
| 243 | + } | ||
| 244 | + ) | ||
| 245 | + .then(() => { | ||
| 246 | + let data = {}; | ||
| 247 | + data.id = row.row.id; | ||
| 248 | + data.status = row.row.status == 1 ? "2" : "1"; | ||
| 249 | + this.statusUpdate(data); | ||
| 250 | + }) | ||
| 251 | + .catch(() => {}); | ||
| 252 | + }, | ||
| 253 | + | ||
| 254 | + //菜单删除 | ||
| 255 | + removeMenu(row) { | ||
| 256 | + MessageBox.confirm("是否要删除此菜单", "提示", { | ||
| 257 | + confirmButtonText: "确定删除", | ||
| 258 | + cancelButtonText: "取消", | ||
| 259 | + type: "warning", | ||
| 260 | + }) | ||
| 261 | + .then(() => { | ||
| 262 | + let data = {}; | ||
| 263 | + data.id = row.row.id; | ||
| 264 | + data.status = "0"; | ||
| 265 | + this.statusUpdate(data); | ||
| 266 | + }) | ||
| 267 | + .catch(() => {}); | ||
| 268 | + }, | ||
| 269 | + | ||
| 270 | + formatter(row, column, cellValue, index) { | ||
| 271 | + if (dictLabels[column.property]) { | ||
| 272 | + if (dictLabels[column.property][cellValue]) { | ||
| 273 | + return dictLabels[column.property][cellValue]; | ||
| 274 | + } | ||
| 275 | + } | ||
| 276 | + return cellValue; | ||
| 277 | + }, | ||
| 278 | + }, | ||
| 279 | +}; | ||
| 280 | +</script> | ||
| 281 | + | ||
| 282 | +<style> | ||
| 283 | +</style> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
src/views/systemConfig/roleConfig/drawer.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <div class="roleDrawer"> | ||
| 3 | + <el-drawer | ||
| 4 | + :title="drawerTitle" | ||
| 5 | + :visible.sync="drawer" | ||
| 6 | + direction="rtl" | ||
| 7 | + size="40%" | ||
| 8 | + destroy-on-close | ||
| 9 | + :close-on-click-modal="false" | ||
| 10 | + :wrapperClosable="false" | ||
| 11 | + :show-close="false" | ||
| 12 | + > | ||
| 13 | + <el-form | ||
| 14 | + ref="roleForm" | ||
| 15 | + :model="roleForm" | ||
| 16 | + label-width="auto" | ||
| 17 | + :rules="rules" | ||
| 18 | + size="mini" | ||
| 19 | + style="margin: 10px" | ||
| 20 | + > | ||
| 21 | + <el-row :gutter="10"> | ||
| 22 | + <el-col :span="12"> | ||
| 23 | + <el-form-item label="角色名:" prop="name"> | ||
| 24 | + <el-input | ||
| 25 | + placeholder="请输入角色名" | ||
| 26 | + v-model.trim="roleForm.name" | ||
| 27 | + :disabled="roleFormDisabled" | ||
| 28 | + v-if="!roleFormDisabled" | ||
| 29 | + ></el-input> | ||
| 30 | + <div v-else>{{ roleData.name }}</div> | ||
| 31 | + </el-form-item> | ||
| 32 | + </el-col> | ||
| 33 | + <el-col :span="24"> | ||
| 34 | + <el-form-item label="角色描述:" prop="remark"> | ||
| 35 | + <el-input | ||
| 36 | + v-model="roleForm.remark" | ||
| 37 | + type="textarea" | ||
| 38 | + placeholder="请输入角色描述" | ||
| 39 | + :disabled="roleFormDisabled" | ||
| 40 | + v-if="!roleFormDisabled" | ||
| 41 | + ></el-input> | ||
| 42 | + <div v-else>{{ roleData.remark }}</div> | ||
| 43 | + </el-form-item> | ||
| 44 | + </el-col> | ||
| 45 | + <!-- <el-col :span="24"> | ||
| 46 | + <el-form-item label="角色状态:" prop="valid"> | ||
| 47 | + <el-switch | ||
| 48 | + v-model="roleForm.valid" | ||
| 49 | + :active-value="1" | ||
| 50 | + :inactive-value="2" | ||
| 51 | + active-color="#13ce66" | ||
| 52 | + inactive-color="#ff4949" | ||
| 53 | + :disabled="roleFormDisabled" | ||
| 54 | + ></el-switch> | ||
| 55 | + </el-form-item> | ||
| 56 | + </el-col> --> | ||
| 57 | + <el-col :span="24"> | ||
| 58 | + <el-form-item label="角色权限:" prop="menuIdList"> | ||
| 59 | + <el-tree | ||
| 60 | + ref="tree" | ||
| 61 | + :data="treeData" | ||
| 62 | + node-key="id" | ||
| 63 | + :props="defaultProps" | ||
| 64 | + :show-checkbox="true" | ||
| 65 | + :default-checked-keys="roleData.menuIds" | ||
| 66 | + check-strictly | ||
| 67 | + accordion | ||
| 68 | + > | ||
| 69 | + </el-tree> | ||
| 70 | + </el-form-item> | ||
| 71 | + </el-col> | ||
| 72 | + </el-row> | ||
| 73 | + <el-form-item> | ||
| 74 | + <el-button | ||
| 75 | + type="primary" | ||
| 76 | + v-if="!roleFormDisabled" | ||
| 77 | + size="mini" | ||
| 78 | + :loading="loading" | ||
| 79 | + @click="submit" | ||
| 80 | + >提交</el-button | ||
| 81 | + > | ||
| 82 | + <el-button type="primary" size="mini" @click="handleClose" | ||
| 83 | + >取消</el-button | ||
| 84 | + > | ||
| 85 | + </el-form-item> | ||
| 86 | + </el-form> | ||
| 87 | + </el-drawer> | ||
| 88 | + </div> | ||
| 89 | +</template> | ||
| 90 | + | ||
| 91 | +<script> | ||
| 92 | +import { getAllAuth, addOrUpdateRole } from "@/api/system/user.js"; | ||
| 93 | +export default { | ||
| 94 | + props: { | ||
| 95 | + drawerTitle: { | ||
| 96 | + type: String, | ||
| 97 | + default: "", | ||
| 98 | + }, | ||
| 99 | + roleFormDisabled: { | ||
| 100 | + type: Boolean, | ||
| 101 | + default: false, | ||
| 102 | + }, | ||
| 103 | + drawer: { | ||
| 104 | + type: Boolean, | ||
| 105 | + default: false, | ||
| 106 | + }, | ||
| 107 | + roleData: { | ||
| 108 | + type: Object, | ||
| 109 | + default: null, | ||
| 110 | + }, | ||
| 111 | + }, | ||
| 112 | + data() { | ||
| 113 | + return { | ||
| 114 | + roleForm: { | ||
| 115 | + name: null, | ||
| 116 | + }, | ||
| 117 | + treeData: [], | ||
| 118 | + loading: false, | ||
| 119 | + defaultProps: { | ||
| 120 | + children: "children", | ||
| 121 | + label: "title", | ||
| 122 | + }, | ||
| 123 | + rules: { | ||
| 124 | + name: [ | ||
| 125 | + { | ||
| 126 | + required: true, | ||
| 127 | + message: "角色名不能为空", | ||
| 128 | + trigger: "blur", | ||
| 129 | + }, | ||
| 130 | + ], | ||
| 131 | + }, | ||
| 132 | + }; | ||
| 133 | + }, | ||
| 134 | + created() { | ||
| 135 | + //权限列表 | ||
| 136 | + getAllAuth() | ||
| 137 | + .then((res) => { | ||
| 138 | + if (res.code === 200) { | ||
| 139 | + this.treeData = res.data; | ||
| 140 | + } else { | ||
| 141 | + this.$message({ | ||
| 142 | + message: res.msg, | ||
| 143 | + type: "warning", | ||
| 144 | + }); | ||
| 145 | + } | ||
| 146 | + }) | ||
| 147 | + .catch((err) => { | ||
| 148 | + console.log(err); | ||
| 149 | + }); | ||
| 150 | + }, | ||
| 151 | + watch:{ | ||
| 152 | + roleFormDisabled(){ | ||
| 153 | + this.treeData = this.treeDisabled(this.treeData) | ||
| 154 | + }, | ||
| 155 | + drawer(){ | ||
| 156 | + this.roleForm = this.roleData; | ||
| 157 | + } | ||
| 158 | + }, | ||
| 159 | + methods: { | ||
| 160 | + //关闭 | ||
| 161 | + handleClose() { | ||
| 162 | + this.$emit("handleClose", false); | ||
| 163 | + }, | ||
| 164 | + | ||
| 165 | + //提交 | ||
| 166 | + submit() { | ||
| 167 | + let formData = {}; | ||
| 168 | + this.loading = true; | ||
| 169 | + formData.menuIdList = this.$refs.tree.getCheckedKeys(); | ||
| 170 | + this.roleData ? (formData.id = this.roleData.id) : ""; | ||
| 171 | + formData.remark = this.roleForm.remark; | ||
| 172 | + formData.valid = this.roleForm.valid; | ||
| 173 | + formData.name = this.roleForm.name; | ||
| 174 | + addOrUpdateRole(formData) | ||
| 175 | + .then((res) => { | ||
| 176 | + if (res.code === 200) { | ||
| 177 | + this.$message({ | ||
| 178 | + message: "操作成功", | ||
| 179 | + type: "success", | ||
| 180 | + }); | ||
| 181 | + this.loading = false; | ||
| 182 | + this.$emit("handleClose", false); | ||
| 183 | + } else { | ||
| 184 | + this.$message({ | ||
| 185 | + message: res.msg, | ||
| 186 | + type: "warning", | ||
| 187 | + }); | ||
| 188 | + } | ||
| 189 | + }) | ||
| 190 | + .catch((err) => { | ||
| 191 | + console.log(err); | ||
| 192 | + }); | ||
| 193 | + }, | ||
| 194 | + | ||
| 195 | + //权限结构禁用 | ||
| 196 | + treeDisabled(val) { | ||
| 197 | + let data = []; | ||
| 198 | + val.forEach((item) => { | ||
| 199 | + item.disabled = this.roleFormDisabled; | ||
| 200 | + data.push(item) | ||
| 201 | + if (item.children && item.children.length) { | ||
| 202 | + item.children = this.treeDisabled(item.children) | ||
| 203 | + } | ||
| 204 | + }); | ||
| 205 | + return data; | ||
| 206 | + }, | ||
| 207 | + }, | ||
| 208 | +}; | ||
| 209 | +</script> | ||
| 210 | + | ||
| 211 | +<style> | ||
| 212 | +</style> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 1 | <template> | 1 | <template> |
| 2 | - <div></div> | 2 | + <div class="roleConfig"> |
| 3 | + <el-form ref="selectionRoleForm" label-width="auto" style="margin: 20px"> | ||
| 4 | + <el-row :gutter="50"> | ||
| 5 | + <el-col :span="6"> | ||
| 6 | + <el-form-item label="角色名称"> | ||
| 7 | + <el-input | ||
| 8 | + v-model="formData.name" | ||
| 9 | + placeholder="请输入角色名称" | ||
| 10 | + ></el-input> | ||
| 11 | + </el-form-item> | ||
| 12 | + </el-col> | ||
| 13 | + <el-col :span="6"> | ||
| 14 | + <el-form-item label="创建时间"> | ||
| 15 | + <el-date-picker | ||
| 16 | + v-model="createTime" | ||
| 17 | + type="daterange" | ||
| 18 | + range-separator="至" | ||
| 19 | + start-placeholder="开始日期" | ||
| 20 | + end-placeholder="结束日期" | ||
| 21 | + > | ||
| 22 | + </el-date-picker> | ||
| 23 | + </el-form-item> | ||
| 24 | + </el-col> | ||
| 25 | + <el-col :span="6"> | ||
| 26 | + <el-form-item label="状态"> | ||
| 27 | + <el-select v-model="formData.valid" placeholder="角色状态"> | ||
| 28 | + <el-option label="开启" value="1"> </el-option> | ||
| 29 | + <el-option label="关闭" value="1"> </el-option> | ||
| 30 | + </el-select> | ||
| 31 | + </el-form-item> | ||
| 32 | + </el-col> | ||
| 33 | + </el-row> | ||
| 34 | + </el-form> | ||
| 35 | + <div style="margin: 0 20px"> | ||
| 36 | + <el-button | ||
| 37 | + type="primary" | ||
| 38 | + icon="el-icon-search" | ||
| 39 | + size="mini" | ||
| 40 | + :loading="tableLoading" | ||
| 41 | + @click="selectRoleList" | ||
| 42 | + >搜索</el-button | ||
| 43 | + > | ||
| 44 | + <el-button type="primary" icon="el-icon-plus" size="mini" @click="addRole" v-hasPermi="['system:role:add']" | ||
| 45 | + >新增角色</el-button | ||
| 46 | + > | ||
| 47 | + </div> | ||
| 48 | + <Tables | ||
| 49 | + :data="data" | ||
| 50 | + :headerData="tableHeader" | ||
| 51 | + :infoData="tableHeader" | ||
| 52 | + :totalCount="total" | ||
| 53 | + :limitSize="formData.size" | ||
| 54 | + :page="formData.page" | ||
| 55 | + :loading="tableLoading" | ||
| 56 | + height="600" | ||
| 57 | + @currentChange="currentChange" | ||
| 58 | + > | ||
| 59 | + <template> | ||
| 60 | + <el-table-column header-align="center" align="center" label="操作"> | ||
| 61 | + <template slot-scope="scope"> | ||
| 62 | + <el-button type="primary" size="mini" @click="buttonClick(scope, 0)" | ||
| 63 | + >查看</el-button | ||
| 64 | + > | ||
| 65 | + <el-button type="primary" size="mini" @click="buttonClick(scope, 1)" v-hasPermi="['system:role:update']" | ||
| 66 | + >修改</el-button | ||
| 67 | + > | ||
| 68 | + <el-button | ||
| 69 | + :type="scope.row.valid == 1 ? 'warning' : 'primary'" | ||
| 70 | + size="mini" | ||
| 71 | + v-hasPermi="['system:role:openClose']" | ||
| 72 | + @click="roleStatus(scope)" | ||
| 73 | + >{{ scope.row.valid == 1 ? "停用" : "启用" }}</el-button | ||
| 74 | + > | ||
| 75 | + <el-button type="danger" size="mini" @click="removeRole(scope)" v-hasPermi="['system:role:delete']" | ||
| 76 | + >删除角色</el-button | ||
| 77 | + > | ||
| 78 | + </template> | ||
| 79 | + </el-table-column> | ||
| 80 | + </template> | ||
| 81 | + </Tables> | ||
| 82 | + <Drawer | ||
| 83 | + :drawer="drawer" | ||
| 84 | + :drawerTitle="drawerTitle" | ||
| 85 | + :roleFormDisabled="roleFormDisabled" | ||
| 86 | + :roleData="roleData" | ||
| 87 | + @handleClose="handleClose" | ||
| 88 | + ></Drawer> | ||
| 89 | + </div> | ||
| 3 | </template> | 90 | </template> |
| 4 | 91 | ||
| 5 | <script> | 92 | <script> |
| 93 | +import Drawer from "./drawer.vue"; | ||
| 94 | +import { MessageBox } from "element-ui"; | ||
| 95 | +import { | ||
| 96 | + getRoleList, | ||
| 97 | + detailRole, | ||
| 98 | + updateRoleStatus, | ||
| 99 | +} from "@/api/system/user.js"; | ||
| 6 | export default { | 100 | export default { |
| 101 | + name:"RoleConfig", | ||
| 102 | + components: { | ||
| 103 | + Drawer, | ||
| 104 | + }, | ||
| 105 | + data() { | ||
| 106 | + return { | ||
| 107 | + formData: { | ||
| 108 | + page: 1, | ||
| 109 | + size: 20, | ||
| 110 | + valid: null, | ||
| 111 | + createStart: null, | ||
| 112 | + createEnd: null, | ||
| 113 | + name: null, | ||
| 114 | + }, //查询条件 | ||
| 115 | + data: [], //表格数据 | ||
| 116 | + tableHeader: [ | ||
| 117 | + { | ||
| 118 | + type: "index", | ||
| 119 | + name: "", | ||
| 120 | + value: "", | ||
| 121 | + width: "", | ||
| 122 | + align: "center", | ||
| 123 | + sorTable: false, | ||
| 124 | + disabled:true | ||
| 125 | + }, | ||
| 126 | + { | ||
| 127 | + type: "", | ||
| 128 | + name: "角色名称", | ||
| 129 | + value: "name", | ||
| 130 | + width: "150px", | ||
| 131 | + align: "center", | ||
| 132 | + sorTable: false, | ||
| 133 | + disabled:true | ||
| 134 | + }, | ||
| 135 | + { | ||
| 136 | + type: "", | ||
| 137 | + name: "角色状态", | ||
| 138 | + value: "valid", | ||
| 139 | + width: "150px", | ||
| 140 | + align: "center", | ||
| 141 | + sorTable: false, | ||
| 142 | + disabled:true | ||
| 143 | + }, | ||
| 144 | + { | ||
| 145 | + type: "", | ||
| 146 | + name: "创建人", | ||
| 147 | + value: "remark", | ||
| 148 | + width: "150px", | ||
| 149 | + align: "center", | ||
| 150 | + sorTable: false, | ||
| 151 | + disabled:true | ||
| 152 | + }, | ||
| 153 | + { | ||
| 154 | + type: "", | ||
| 155 | + name: "创建时间", | ||
| 156 | + value: "createTime", | ||
| 157 | + width: "150px", | ||
| 158 | + align: "center", | ||
| 159 | + sorTable: false, | ||
| 160 | + disabled:true | ||
| 161 | + }, | ||
| 162 | + { | ||
| 163 | + type: "", | ||
| 164 | + name: "修改时间", | ||
| 165 | + value: "updateTime", | ||
| 166 | + width: "150px", | ||
| 167 | + align: "center", | ||
| 168 | + sorTable: false, | ||
| 169 | + disabled:true | ||
| 170 | + }, | ||
| 171 | + { | ||
| 172 | + type: "", | ||
| 173 | + name: "备注", | ||
| 174 | + value: "remark", | ||
| 175 | + width: "400px", | ||
| 176 | + align: "center", | ||
| 177 | + sorTable: false, | ||
| 178 | + disabled:true | ||
| 179 | + }, | ||
| 180 | + ], //表头数据 | ||
| 181 | + roleData: {}, //角色详情 | ||
| 182 | + createTime: [], | ||
| 183 | + drawer: false, | ||
| 184 | + drawerTitle: "", | ||
| 185 | + roleFormDisabled: false, | ||
| 186 | + tableLoading: false, | ||
| 187 | + total: 0, | ||
| 188 | + }; | ||
| 189 | + }, | ||
| 190 | + created() { | ||
| 191 | + this.selectRoleList(); | ||
| 192 | + }, | ||
| 193 | + methods: { | ||
| 194 | + //角色列表 | ||
| 195 | + selectRoleList() { | ||
| 196 | + this.tableLoading = true; | ||
| 197 | + if (this.createTime.length > 0) { | ||
| 198 | + this.formData.createStart = this.createTime[0]; | ||
| 199 | + this.formData.createEnd = this.createTime[1]; | ||
| 200 | + } | ||
| 7 | 201 | ||
| 8 | -} | 202 | + getRoleList(this.formData) |
| 203 | + .then((res) => { | ||
| 204 | + this.tableLoading = false; | ||
| 205 | + if (res.code === 200) { | ||
| 206 | + this.data = res.data.list; | ||
| 207 | + this.total = res.data.total; | ||
| 208 | + } else { | ||
| 209 | + this.$message({ | ||
| 210 | + message: res.msg, | ||
| 211 | + type: "warning", | ||
| 212 | + }); | ||
| 213 | + } | ||
| 214 | + }) | ||
| 215 | + .catch((err) => { | ||
| 216 | + this.tableLoading = false; | ||
| 217 | + console.log(err); | ||
| 218 | + }); | ||
| 219 | + }, | ||
| 220 | + | ||
| 221 | + //角色详情 | ||
| 222 | + roleDetail(id) { | ||
| 223 | + detailRole(id) | ||
| 224 | + .then((res) => { | ||
| 225 | + if (res.code === 200) { | ||
| 226 | + this.roleData = res.data; | ||
| 227 | + } else { | ||
| 228 | + this.$message({ | ||
| 229 | + message: res.msg, | ||
| 230 | + type: "warning", | ||
| 231 | + }); | ||
| 232 | + } | ||
| 233 | + }) | ||
| 234 | + .catch((err) => { | ||
| 235 | + console.log(err); | ||
| 236 | + }); | ||
| 237 | + }, | ||
| 238 | + | ||
| 239 | + //新增角色 | ||
| 240 | + addRole() { | ||
| 241 | + this.roleData = {}; | ||
| 242 | + this.drawer = true; | ||
| 243 | + this.roleFormDisabled = false; | ||
| 244 | + this.drawerTitle = "新增角色"; | ||
| 245 | + }, | ||
| 246 | + | ||
| 247 | + //修改查看角色 | ||
| 248 | + buttonClick(row, status) { | ||
| 249 | + this.roleDetail(row.row.id); | ||
| 250 | + this.roleData = row.row; | ||
| 251 | + this.drawer = true; | ||
| 252 | + status == 0 | ||
| 253 | + ? (this.roleFormDisabled = true) | ||
| 254 | + : (this.roleFormDisabled = false); | ||
| 255 | + this.drawerTitle = "查看/修改角色"; | ||
| 256 | + }, | ||
| 257 | + | ||
| 258 | + //修改角色状态 | ||
| 259 | + roleStatus(row) { | ||
| 260 | + let msg = ""; | ||
| 261 | + let status = {}; | ||
| 262 | + status.id = row.row.id; | ||
| 263 | + row.row.valid == 1 | ||
| 264 | + ? ((msg = "是否关闭此角色"), (status.valid = 2)) | ||
| 265 | + : ((msg = "是否启用此角色"), (status.valid = 1)); | ||
| 266 | + MessageBox.confirm(msg, "注意", { | ||
| 267 | + confirmButtonText: "确定", | ||
| 268 | + cancelButtonText: "取消", | ||
| 269 | + type: "warning", | ||
| 270 | + }) | ||
| 271 | + .then(() => { | ||
| 272 | + updateRoleStatus(status).then((res) => { | ||
| 273 | + if (res.code === 200) { | ||
| 274 | + this.$message({ | ||
| 275 | + message: "操作成功", | ||
| 276 | + type: "success", | ||
| 277 | + }); | ||
| 278 | + this.selectRoleList(); | ||
| 279 | + } else { | ||
| 280 | + this.$message({ | ||
| 281 | + message: res.msg, | ||
| 282 | + type: "warning", | ||
| 283 | + }); | ||
| 284 | + } | ||
| 285 | + }); | ||
| 286 | + }) | ||
| 287 | + .catch(() => []); | ||
| 288 | + }, | ||
| 289 | + | ||
| 290 | + //删除角色 | ||
| 291 | + removeRole(row) { | ||
| 292 | + MessageBox.confirm( | ||
| 293 | + "如删除此角色,角色下所有用户将从中被剔除,可能会对用户操作造成影响!", | ||
| 294 | + "注意", | ||
| 295 | + { | ||
| 296 | + confirmButtonText: "确定", | ||
| 297 | + cancelButtonText: "取消", | ||
| 298 | + type: "warning", | ||
| 299 | + } | ||
| 300 | + ) | ||
| 301 | + .then(() => { | ||
| 302 | + updateRoleStatus({ | ||
| 303 | + id: row.row.id, | ||
| 304 | + valid: 0, | ||
| 305 | + confirmDel: false, | ||
| 306 | + }).then((res) => { | ||
| 307 | + if (res.code === 200) { | ||
| 308 | + this.$message({ | ||
| 309 | + message: "删除成功", | ||
| 310 | + type: "success", | ||
| 311 | + }); | ||
| 312 | + this.selectRoleList(); | ||
| 313 | + } else if (res.code === 202) { | ||
| 314 | + MessageBox.confirm(res.msg, "注意", { | ||
| 315 | + confirmButtonText: "确定", | ||
| 316 | + cancelButtonText: "取消", | ||
| 317 | + type: "warning", | ||
| 318 | + }) | ||
| 319 | + .then(() => { | ||
| 320 | + updateRoleStatus({ | ||
| 321 | + id: row.row.id, | ||
| 322 | + valid: 0, | ||
| 323 | + confirmDel: true, | ||
| 324 | + }).then((res) => { | ||
| 325 | + if (res.code === 200) { | ||
| 326 | + this.$message({ | ||
| 327 | + message: "操作成功", | ||
| 328 | + type: "success", | ||
| 329 | + }); | ||
| 330 | + this.selectRoleList(); | ||
| 331 | + } | ||
| 332 | + }); | ||
| 333 | + }) | ||
| 334 | + .catch(() => {}); | ||
| 335 | + } else { | ||
| 336 | + this.$message({ | ||
| 337 | + message: res.msg, | ||
| 338 | + type: "warning", | ||
| 339 | + }); | ||
| 340 | + } | ||
| 341 | + }); | ||
| 342 | + }) | ||
| 343 | + .catch(() => []); | ||
| 344 | + }, | ||
| 345 | + | ||
| 346 | + handleClose(val) { | ||
| 347 | + this.drawer = val; | ||
| 348 | + this.selectRoleList(); | ||
| 349 | + }, | ||
| 350 | + currentChange(val) { | ||
| 351 | + this.formData.page = val.page; | ||
| 352 | + this.selectRoleList(); | ||
| 353 | + }, | ||
| 354 | + }, | ||
| 355 | +}; | ||
| 9 | </script> | 356 | </script> |
| 10 | 357 | ||
| 11 | <style> | 358 | <style> |
| 12 | - | ||
| 13 | </style> | 359 | </style> |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
src/views/systemConfig/userConfig/drawer.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <div class="userDrawer"> | ||
| 3 | + <el-drawer | ||
| 4 | + :data="userData" | ||
| 5 | + :title="drawerTitle" | ||
| 6 | + :visible.sync="drawer" | ||
| 7 | + direction="rtl" | ||
| 8 | + size="40%" | ||
| 9 | + :close-on-click-modal="false" | ||
| 10 | + :wrapperClosable="false" | ||
| 11 | + :show-close="false" | ||
| 12 | + > | ||
| 13 | + <el-form | ||
| 14 | + ref="userForm" | ||
| 15 | + :model="userForm" | ||
| 16 | + label-width="auto" | ||
| 17 | + :rules="rules" | ||
| 18 | + style="margin: 10px" | ||
| 19 | + > | ||
| 20 | + <el-row :gutter="10"> | ||
| 21 | + <el-col :span="12"> | ||
| 22 | + <el-form-item label="员工号:" prop="loginName"> | ||
| 23 | + <el-input | ||
| 24 | + placeholder="请输入员工号" | ||
| 25 | + v-model.trim="userForm.loginName" | ||
| 26 | + v-if="!userFormDisabled" | ||
| 27 | + :disabled="drawerTitle != '新增用户'" | ||
| 28 | + size="mini" | ||
| 29 | + ></el-input> | ||
| 30 | + <div v-else>{{ userForm.loginName }}</div> | ||
| 31 | + </el-form-item> | ||
| 32 | + </el-col> | ||
| 33 | + <el-col :span="12"> | ||
| 34 | + <el-form-item label="用户姓名:" prop="username"> | ||
| 35 | + <el-input | ||
| 36 | + placeholder="请输入用户姓名" | ||
| 37 | + :disabled="userFormDisabled" | ||
| 38 | + v-model.trim="userForm.username" | ||
| 39 | + v-if="!userFormDisabled" | ||
| 40 | + size="mini" | ||
| 41 | + ></el-input> | ||
| 42 | + <div v-else>{{ userForm.username }}</div> | ||
| 43 | + </el-form-item> | ||
| 44 | + </el-col> | ||
| 45 | + <el-col :span="24"> | ||
| 46 | + <el-alert | ||
| 47 | + title="注意:员工号一但设置就无法更改,请谨慎填写!" | ||
| 48 | + type="warning" | ||
| 49 | + show-icon | ||
| 50 | + size="mini" | ||
| 51 | + :closable="false" | ||
| 52 | + style="width: 400px" | ||
| 53 | + > | ||
| 54 | + </el-alert> | ||
| 55 | + </el-col> | ||
| 56 | + <el-col :span="12"> | ||
| 57 | + <el-form-item label="手机号:" prop="phone"> | ||
| 58 | + <el-input | ||
| 59 | + placeholder="请输入手机号" | ||
| 60 | + type="phone" | ||
| 61 | + v-model.trim="userForm.phone" | ||
| 62 | + :disabled="userFormDisabled" | ||
| 63 | + v-if="!userFormDisabled" | ||
| 64 | + size="mini" | ||
| 65 | + ></el-input> | ||
| 66 | + <div v-else>{{ userForm.phone }}</div> | ||
| 67 | + </el-form-item> | ||
| 68 | + </el-col> | ||
| 69 | + <el-col :span="12"> | ||
| 70 | + <el-form-item label="电子邮箱:" prop="email"> | ||
| 71 | + <el-input | ||
| 72 | + placeholder="请输入电子邮箱" | ||
| 73 | + type="email" | ||
| 74 | + v-model.trim="userForm.email" | ||
| 75 | + :disabled="userFormDisabled" | ||
| 76 | + v-if="!userFormDisabled" | ||
| 77 | + size="mini" | ||
| 78 | + ></el-input> | ||
| 79 | + <div v-else>{{ userForm.email }}</div> | ||
| 80 | + </el-form-item> | ||
| 81 | + </el-col> | ||
| 82 | + <!-- <el-col :span="12" v-if="drawerTitle == '新增用户'"> | ||
| 83 | + <el-form-item label="密码:"> | ||
| 84 | + <el-input | ||
| 85 | + placeholder="请输入密码" | ||
| 86 | + :disabled="userFormDisabled" | ||
| 87 | + type="password" | ||
| 88 | + size="mini" | ||
| 89 | + ></el-input> | ||
| 90 | + </el-form-item> | ||
| 91 | + </el-col> | ||
| 92 | + <el-col :span="12" v-if="drawerTitle == '新增用户'"> | ||
| 93 | + <el-form-item label="确认密码:"> | ||
| 94 | + <el-input | ||
| 95 | + placeholder="请确认密码" | ||
| 96 | + :disabled="userFormDisabled" | ||
| 97 | + type="password" | ||
| 98 | + size="mini" | ||
| 99 | + ></el-input> | ||
| 100 | + </el-form-item> | ||
| 101 | + </el-col> --> | ||
| 102 | + <el-col :span="24"> | ||
| 103 | + <el-form-item | ||
| 104 | + label="所属口岸:" | ||
| 105 | + prop="portName" | ||
| 106 | + > | ||
| 107 | + <!-- <el-checkbox-group v-model="port" :disabled="userFormDisabled"> | ||
| 108 | + <el-checkbox | ||
| 109 | + v-for="item in portNameList" | ||
| 110 | + :label="item.englishName" | ||
| 111 | + :key="item.id" | ||
| 112 | + >{{ item.englishName }}</el-checkbox | ||
| 113 | + > | ||
| 114 | + </el-checkbox-group> --> | ||
| 115 | + <el-select | ||
| 116 | + placeholder="不限" | ||
| 117 | + v-model="port" | ||
| 118 | + :disabled="userFormDisabled" | ||
| 119 | + size="mini" | ||
| 120 | + style="width: 100%" | ||
| 121 | + multiple | ||
| 122 | + clearable | ||
| 123 | + > | ||
| 124 | + <el-option | ||
| 125 | + v-for="item in portNameList" | ||
| 126 | + :label="item.englishName" | ||
| 127 | + :value="item.englishName" | ||
| 128 | + :key="item.id" | ||
| 129 | + > | ||
| 130 | + </el-option> | ||
| 131 | + </el-select> | ||
| 132 | + </el-form-item> | ||
| 133 | + </el-col> | ||
| 134 | + <el-col :span="24"> | ||
| 135 | + <el-form-item label="所属角色:" prop="roleIds"> | ||
| 136 | + <el-checkbox-group | ||
| 137 | + v-model="roleid" | ||
| 138 | + :disabled="userFormDisabled" | ||
| 139 | + @change="change" | ||
| 140 | + > | ||
| 141 | + <el-checkbox | ||
| 142 | + v-for="item in roleList" | ||
| 143 | + :label="item.id" | ||
| 144 | + :key="item.id" | ||
| 145 | + >{{ item.name }}</el-checkbox | ||
| 146 | + > | ||
| 147 | + </el-checkbox-group> | ||
| 148 | + </el-form-item> | ||
| 149 | + </el-col> | ||
| 150 | + <el-col :span="24"> | ||
| 151 | + <el-form-item label="备注:" prop="remark"> | ||
| 152 | + <el-input | ||
| 153 | + type="textarea" | ||
| 154 | + v-model="userForm.remark" | ||
| 155 | + placeholder="备注" | ||
| 156 | + :disabled="userFormDisabled" | ||
| 157 | + v-if="!userFormDisabled" | ||
| 158 | + size="mini" | ||
| 159 | + ></el-input> | ||
| 160 | + <div v-else>{{ userForm.remark }}</div> | ||
| 161 | + </el-form-item> | ||
| 162 | + </el-col> | ||
| 163 | + </el-row> | ||
| 164 | + <el-form-item> | ||
| 165 | + <el-button | ||
| 166 | + type="primary" | ||
| 167 | + size="mini" | ||
| 168 | + v-if="!userFormDisabled" | ||
| 169 | + :loading="loading" | ||
| 170 | + @click="submit" | ||
| 171 | + >提交</el-button | ||
| 172 | + > | ||
| 173 | + <el-button type="primary" size="mini" @click="handleClose" | ||
| 174 | + >取消</el-button | ||
| 175 | + > | ||
| 176 | + </el-form-item> | ||
| 177 | + </el-form> | ||
| 178 | + </el-drawer> | ||
| 179 | + </div> | ||
| 180 | +</template> | ||
| 181 | + | ||
| 182 | +<script> | ||
| 183 | +import { | ||
| 184 | + getRoleList, | ||
| 185 | + addOrUpdateUser, | ||
| 186 | + portNameList, | ||
| 187 | +} from "@/api/system/user.js"; | ||
| 188 | +export default { | ||
| 189 | + props: { | ||
| 190 | + drawerTitle: { | ||
| 191 | + type: String, | ||
| 192 | + default: "", | ||
| 193 | + }, | ||
| 194 | + userFormDisabled: { | ||
| 195 | + type: Boolean, | ||
| 196 | + default: false, | ||
| 197 | + }, | ||
| 198 | + drawer: { | ||
| 199 | + type: Boolean, | ||
| 200 | + default: false, | ||
| 201 | + }, | ||
| 202 | + userData: { | ||
| 203 | + type: Object, | ||
| 204 | + default: null, | ||
| 205 | + }, | ||
| 206 | + }, | ||
| 207 | + data() { | ||
| 208 | + return { | ||
| 209 | + userForm: { | ||
| 210 | + roleIds: [], | ||
| 211 | + }, | ||
| 212 | + roleList: [], | ||
| 213 | + portNameList: [], | ||
| 214 | + port: [], | ||
| 215 | + roleid: [], | ||
| 216 | + ImageUploadUrl: "", | ||
| 217 | + dialogVisible: false, | ||
| 218 | + loading: false, | ||
| 219 | + rules: { | ||
| 220 | + loginName: [ | ||
| 221 | + { | ||
| 222 | + required: true, | ||
| 223 | + message: "角色名不能为空", | ||
| 224 | + trigger: "blur", | ||
| 225 | + }, | ||
| 226 | + ], | ||
| 227 | + username: [ | ||
| 228 | + { | ||
| 229 | + required: true, | ||
| 230 | + message: "角色名不能为空", | ||
| 231 | + trigger: "blur", | ||
| 232 | + }, | ||
| 233 | + ], | ||
| 234 | + portName: [ | ||
| 235 | + { | ||
| 236 | + required: true, | ||
| 237 | + message: "所属口岸不能为空", | ||
| 238 | + trigger: "blur", | ||
| 239 | + }, | ||
| 240 | + ], | ||
| 241 | + }, | ||
| 242 | + }; | ||
| 243 | + }, | ||
| 244 | + created() { | ||
| 245 | + this.selectRoleList(); | ||
| 246 | + }, | ||
| 247 | + watch:{ | ||
| 248 | + drawer(val,oldVal){ | ||
| 249 | + if(val){ | ||
| 250 | + this.userForm = this.userData; | ||
| 251 | + if (this.userData.roleIds) { | ||
| 252 | + this.roleid = this.userData.roleIds; | ||
| 253 | + } | ||
| 254 | + if (this.userData.portName) { | ||
| 255 | + this.port = this.userData.portName; | ||
| 256 | + } | ||
| 257 | + } | ||
| 258 | + } | ||
| 259 | + }, | ||
| 260 | + methods: { | ||
| 261 | + change(val){ | ||
| 262 | + this.roleid = val; | ||
| 263 | + }, | ||
| 264 | + selectRoleList() { | ||
| 265 | + //角色列表 | ||
| 266 | + getRoleList({ size: null, page: null }) | ||
| 267 | + .then((res) => { | ||
| 268 | + if (res.code === 200) { | ||
| 269 | + this.roleList = res.data.list; | ||
| 270 | + } else { | ||
| 271 | + this.$message({ | ||
| 272 | + message: res.msg, | ||
| 273 | + type: "warning", | ||
| 274 | + }); | ||
| 275 | + } | ||
| 276 | + }) | ||
| 277 | + .catch((err) => { | ||
| 278 | + console.log(err); | ||
| 279 | + }); | ||
| 280 | + //获取口岸 | ||
| 281 | + // this.portNameList = this.$store.state.user.portNames; | ||
| 282 | + portNameList() | ||
| 283 | + .then((res) => { | ||
| 284 | + if (res.code === 200) { | ||
| 285 | + this.portNameList = res.data; | ||
| 286 | + } else { | ||
| 287 | + this.$message({ | ||
| 288 | + message: res.msg, | ||
| 289 | + type: "warning", | ||
| 290 | + }); | ||
| 291 | + } | ||
| 292 | + }) | ||
| 293 | + .catch((err) => { | ||
| 294 | + console.log(err); | ||
| 295 | + }); | ||
| 296 | + }, | ||
| 297 | + | ||
| 298 | + //关闭 | ||
| 299 | + handleClose() { | ||
| 300 | + this.roleid = []; | ||
| 301 | + this.port = []; | ||
| 302 | + this.userForm = { | ||
| 303 | + roleIds: [], | ||
| 304 | + }; | ||
| 305 | + this.$emit("handleClose", false); | ||
| 306 | + }, | ||
| 307 | + | ||
| 308 | + //提交 | ||
| 309 | + submit() { | ||
| 310 | + this.loading = true; | ||
| 311 | + this.userData.isValid ? "" : (this.userForm.isValid = 1); | ||
| 312 | + this.userForm.roleIds = this.roleid; | ||
| 313 | + this.userForm.portName = this.port.join(","); | ||
| 314 | + addOrUpdateUser(this.userForm) | ||
| 315 | + .then((res) => { | ||
| 316 | + this.loading = false; | ||
| 317 | + if (res.code === 200) { | ||
| 318 | + this.$message({ | ||
| 319 | + message: "操作成功", | ||
| 320 | + type: "success", | ||
| 321 | + }); | ||
| 322 | + this.$emit("handleClose", false); | ||
| 323 | + } else { | ||
| 324 | + this.$message({ | ||
| 325 | + message: res.msg, | ||
| 326 | + type: "warning", | ||
| 327 | + }); | ||
| 328 | + } | ||
| 329 | + }) | ||
| 330 | + .catch((err) => { | ||
| 331 | + this.loading = false; | ||
| 332 | + console.log(err); | ||
| 333 | + }); | ||
| 334 | + }, | ||
| 335 | + }, | ||
| 336 | +}; | ||
| 337 | +</script> | ||
| 338 | + | ||
| 339 | +<style> | ||
| 340 | +</style> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 1 | <template> | 1 | <template> |
| 2 | - <div></div> | 2 | + <div> |
| 3 | + <el-form ref="selectionUserForm" label-width="auto" style="margin: 20px"> | ||
| 4 | + <el-row :gutter="50"> | ||
| 5 | + <el-col :span="6"> | ||
| 6 | + <el-form-item label="用户姓名"> | ||
| 7 | + <el-input | ||
| 8 | + placeholder="请输入用户名称" | ||
| 9 | + v-model="formData.username" | ||
| 10 | + ></el-input> | ||
| 11 | + </el-form-item> | ||
| 12 | + </el-col> | ||
| 13 | + <el-col :span="6"> | ||
| 14 | + <el-form-item label="手机号码"> | ||
| 15 | + <el-input | ||
| 16 | + placeholder="请输入用户名称" | ||
| 17 | + v-model="formData.phone" | ||
| 18 | + ></el-input> | ||
| 19 | + </el-form-item> | ||
| 20 | + </el-col> | ||
| 21 | + <el-col :span="6"> | ||
| 22 | + <el-form-item label="状态"> | ||
| 23 | + <el-select placeholder="用户状态" v-model="formData.isValid"> | ||
| 24 | + <el-option label="开启" value="1"> </el-option> | ||
| 25 | + <el-option label="关闭" value="2"> </el-option> | ||
| 26 | + </el-select> | ||
| 27 | + </el-form-item> | ||
| 28 | + </el-col> | ||
| 29 | + </el-row> | ||
| 30 | + </el-form> | ||
| 31 | + <div style="marginLeft: 20px"> | ||
| 32 | + <el-button | ||
| 33 | + type="primary" | ||
| 34 | + icon="el-icon-search" | ||
| 35 | + size="mini" | ||
| 36 | + :loading="loading" | ||
| 37 | + @click="selectUser" | ||
| 38 | + >搜索</el-button | ||
| 39 | + > | ||
| 40 | + <el-button type="primary" icon="el-icon-plus" size="mini" @click="addUser" v-hasPermi="['system:user:add']" | ||
| 41 | + >新增用户</el-button | ||
| 42 | + > | ||
| 43 | + </div> | ||
| 44 | + <Tables | ||
| 45 | + :data="data" | ||
| 46 | + :headerData="tableHeader" | ||
| 47 | + :limitSize="formData.size" | ||
| 48 | + :totalCount="total" | ||
| 49 | + :loading="loading" | ||
| 50 | + :page="formData.page" | ||
| 51 | + height="600" | ||
| 52 | + @currentChange="currentChange" | ||
| 53 | + > | ||
| 54 | + <template> | ||
| 55 | + <el-table-column | ||
| 56 | + header-align="center" | ||
| 57 | + align="center" | ||
| 58 | + width="auto" | ||
| 59 | + label="操作" | ||
| 60 | + > | ||
| 61 | + <template slot-scope="scope"> | ||
| 62 | + <el-button type="primary" size="mini" @click="buttonClick(scope, 0)" | ||
| 63 | + >查看</el-button | ||
| 64 | + > | ||
| 65 | + <el-button type="primary" size="mini" @click="buttonClick(scope, 1)" v-hasPermi="['system:user:update']" | ||
| 66 | + >修改</el-button | ||
| 67 | + > | ||
| 68 | + <!-- <el-button type="primary" size="mini" @click="passwordShow = !passwordShow" | ||
| 69 | + >修改密码</el-button | ||
| 70 | + > --> | ||
| 71 | + <el-button | ||
| 72 | + :type="scope.row.isValid == 1 ? 'warning' : 'primary'" | ||
| 73 | + size="mini" | ||
| 74 | + v-hasPermi="['system:user:openClose']" | ||
| 75 | + @click="userStatus(scope)" | ||
| 76 | + >{{ scope.row.isValid == 1 ? "停用" : "启用" }}</el-button | ||
| 77 | + > | ||
| 78 | + <el-button type="danger" size="mini" @click="removeUser(scope)" v-hasPermi="['system:user:delete']" | ||
| 79 | + >删除用户</el-button | ||
| 80 | + > | ||
| 81 | + </template> | ||
| 82 | + </el-table-column> | ||
| 83 | + </template> | ||
| 84 | + </Tables> | ||
| 85 | + <Drawer | ||
| 86 | + :drawer="drawer" | ||
| 87 | + :drawerTitle="drawerTitle" | ||
| 88 | + :userFormDisabled="userFormDisabled" | ||
| 89 | + :userData="userData" | ||
| 90 | + @handleClose="handleClose" | ||
| 91 | + ></Drawer> | ||
| 92 | + | ||
| 93 | + <!-- <el-dialog | ||
| 94 | + title="修改密码" | ||
| 95 | + :visible.sync="passwordShow" | ||
| 96 | + width="30%" | ||
| 97 | + :close-on-click-modal="false" | ||
| 98 | + :append-to-body="true" | ||
| 99 | + > | ||
| 100 | + <el-form label-width="auto"> | ||
| 101 | + <el-row :gutter="10"> | ||
| 102 | + <el-col :span="24"> | ||
| 103 | + <el-form-item label="旧密码:"> | ||
| 104 | + <el-input placeholder="请输入旧密码" type="password"></el-input> | ||
| 105 | + </el-form-item> | ||
| 106 | + </el-col> | ||
| 107 | + <el-col :span="24"> | ||
| 108 | + <el-form-item label="新密码:"> | ||
| 109 | + <el-input placeholder="请输入新密码" type="password"></el-input> | ||
| 110 | + </el-form-item> | ||
| 111 | + </el-col> | ||
| 112 | + <el-col :span="24"> | ||
| 113 | + <el-form-item label="确认新密码:"> | ||
| 114 | + <el-input placeholder="请确认新密码" type="password"></el-input> | ||
| 115 | + </el-form-item> | ||
| 116 | + </el-col> | ||
| 117 | + </el-row> | ||
| 118 | + <div class="dialogFoot"> | ||
| 119 | + <el-button @click="passwordShow = false">取 消</el-button> | ||
| 120 | + <el-button type="primary" @click="passwordShow = false">确 定</el-button> | ||
| 121 | + </div> | ||
| 122 | + </el-form> | ||
| 123 | + </el-dialog> --> | ||
| 124 | + </div> | ||
| 3 | </template> | 125 | </template> |
| 4 | 126 | ||
| 5 | <script> | 127 | <script> |
| 128 | +import Drawer from "./drawer.vue"; | ||
| 129 | +import { MessageBox } from "element-ui"; | ||
| 130 | +import { listUser, detailUser, updateUserStatus } from "@/api/system/user.js"; | ||
| 6 | export default { | 131 | export default { |
| 132 | + name: "UserConfig", | ||
| 133 | + components: { | ||
| 134 | + Drawer, | ||
| 135 | + }, | ||
| 136 | + data() { | ||
| 137 | + return { | ||
| 138 | + formData: { | ||
| 139 | + page: 1, | ||
| 140 | + size: 20, | ||
| 141 | + isValid: null, | ||
| 142 | + username: null, | ||
| 143 | + phone: null, | ||
| 144 | + }, //查询条件 | ||
| 145 | + tableHeader: [ | ||
| 146 | + { | ||
| 147 | + type: "index", | ||
| 148 | + name: "", | ||
| 149 | + value: "", | ||
| 150 | + width: "", | ||
| 151 | + align: "center", | ||
| 152 | + sorTable: false, | ||
| 153 | + disabled:true | ||
| 154 | + }, | ||
| 155 | + { | ||
| 156 | + type: "", | ||
| 157 | + name: "员工号", | ||
| 158 | + value: "loginName", | ||
| 159 | + width: "150px", | ||
| 160 | + align: "center", | ||
| 161 | + sorTable: false, | ||
| 162 | + disabled:true | ||
| 163 | + }, | ||
| 164 | + { | ||
| 165 | + type: "", | ||
| 166 | + name: "用户姓名", | ||
| 167 | + value: "username", | ||
| 168 | + width: "150px", | ||
| 169 | + align: "center", | ||
| 170 | + sorTable: false, | ||
| 171 | + disabled:true | ||
| 172 | + }, | ||
| 173 | + { | ||
| 174 | + type: "", | ||
| 175 | + name: "所属口岸", | ||
| 176 | + value: "portName", | ||
| 177 | + width: "150px", | ||
| 178 | + align: "center", | ||
| 179 | + sortable: false, | ||
| 180 | + disabled:true | ||
| 181 | + }, | ||
| 182 | + { | ||
| 183 | + type: "", | ||
| 184 | + name: "所属角色", | ||
| 185 | + value: "roleNames", | ||
| 186 | + width: "150px", | ||
| 187 | + align: "center", | ||
| 188 | + sorTable: false, | ||
| 189 | + disabled:true | ||
| 190 | + }, | ||
| 191 | + { | ||
| 192 | + type: "", | ||
| 193 | + name: "电子邮箱", | ||
| 194 | + value: "email", | ||
| 195 | + width: "150px", | ||
| 196 | + align: "center", | ||
| 197 | + sorTable: false, | ||
| 198 | + disabled:true | ||
| 199 | + }, | ||
| 200 | + { | ||
| 201 | + type: "", | ||
| 202 | + name: "用户状态", | ||
| 203 | + value: "isValid", | ||
| 204 | + width: "100px", | ||
| 205 | + align: "center", | ||
| 206 | + sorTable: false, | ||
| 207 | + disabled:true | ||
| 208 | + }, | ||
| 209 | + { | ||
| 210 | + type: "", | ||
| 211 | + name: "修改时间", | ||
| 212 | + value: "updateTime", | ||
| 213 | + width: "150px", | ||
| 214 | + align: "center", | ||
| 215 | + sorTable: false, | ||
| 216 | + disabled:true | ||
| 217 | + }, | ||
| 218 | + { | ||
| 219 | + type: "", | ||
| 220 | + name: "备注", | ||
| 221 | + value: "remark", | ||
| 222 | + width: "150px", | ||
| 223 | + align: "center", | ||
| 224 | + sorTable: false, | ||
| 225 | + disabled:true | ||
| 226 | + }, | ||
| 227 | + ], //表头数据 | ||
| 228 | + userData: {}, //用户详情 | ||
| 229 | + data: [], //用户列表 | ||
| 230 | + drawer: false, | ||
| 231 | + userFormDisabled: false, | ||
| 232 | + passwordShow: false, | ||
| 233 | + drawerTitle: "", | ||
| 234 | + total: 0, | ||
| 235 | + loading: false, | ||
| 236 | + }; | ||
| 237 | + }, | ||
| 238 | + created() { | ||
| 239 | + this.selectUser(); | ||
| 240 | + }, | ||
| 241 | + methods: { | ||
| 242 | + //用户列表 | ||
| 243 | + selectUser() { | ||
| 244 | + this.loading = true; | ||
| 245 | + listUser(this.formData) | ||
| 246 | + .then((res) => { | ||
| 247 | + this.loading = false; | ||
| 248 | + if (res.code === 200) { | ||
| 249 | + this.data = res.data.list; | ||
| 250 | + this.total = res.data.total; | ||
| 251 | + this.formData.page = res.data.page; | ||
| 252 | + } else { | ||
| 253 | + this.$message({ | ||
| 254 | + message: res.msg, | ||
| 255 | + type: "warning", | ||
| 256 | + }); | ||
| 257 | + } | ||
| 258 | + }) | ||
| 259 | + .catch((err) => { | ||
| 260 | + this.loading = false; | ||
| 261 | + console.log(err); | ||
| 262 | + }); | ||
| 263 | + }, | ||
| 264 | + | ||
| 265 | + //用户详情 | ||
| 266 | + userDetail(id) { | ||
| 267 | + detailUser(id) | ||
| 268 | + .then((res) => { | ||
| 269 | + if (res.code === 200) { | ||
| 270 | + this.userData = res.data; | ||
| 271 | + this.userData.portName | ||
| 272 | + ?this.userData.portName=this.userData.portName.split(",") | ||
| 273 | + : ''; | ||
| 274 | + } else { | ||
| 275 | + this.$message({ | ||
| 276 | + message: res.msg, | ||
| 277 | + type: "warning", | ||
| 278 | + }); | ||
| 279 | + } | ||
| 280 | + }) | ||
| 281 | + .catch((err) => { | ||
| 282 | + console.log(err); | ||
| 283 | + }); | ||
| 284 | + }, | ||
| 285 | + | ||
| 286 | + //新增用户 | ||
| 287 | + addUser() { | ||
| 288 | + this.userData = {}; | ||
| 289 | + this.drawer = true; | ||
| 290 | + this.drawerTitle = "新增用户"; | ||
| 291 | + this.userFormDisabled = false; | ||
| 292 | + }, | ||
| 293 | + | ||
| 294 | + //查询修改用户 | ||
| 295 | + buttonClick(row, status) { | ||
| 296 | + this.userDetail(row.row.id); | ||
| 297 | + this.userData = row.row; | ||
| 298 | + this.drawer = true; | ||
| 299 | + this.drawerTitle = "查看/修改用户"; | ||
| 300 | + status == 0 | ||
| 301 | + ? (this.userFormDisabled = true) | ||
| 302 | + : (this.userFormDisabled = false); | ||
| 303 | + }, | ||
| 7 | 304 | ||
| 8 | -} | 305 | + //修改用户状态 |
| 306 | + userStatus(row) { | ||
| 307 | + let msg = ""; | ||
| 308 | + let nowValid = 1; | ||
| 309 | + row.row.isValid == 1 | ||
| 310 | + ? ((msg = "是否要停用此用户"), (nowValid = 2)) | ||
| 311 | + : ((msg = "是否要启用此用户"), (nowValid = 1)); | ||
| 312 | + MessageBox.confirm(msg, "提示", { | ||
| 313 | + confirmButtonText: "确定", | ||
| 314 | + cancelButtonText: "取消", | ||
| 315 | + type: "warning", | ||
| 316 | + }) | ||
| 317 | + .then(() => { | ||
| 318 | + updateUserStatus({ id: row.row.id, isValid: nowValid }).then( | ||
| 319 | + (res) => { | ||
| 320 | + if (res.code === 200) { | ||
| 321 | + this.$message({ | ||
| 322 | + message: "操作成功", | ||
| 323 | + type: "success", | ||
| 324 | + }); | ||
| 325 | + this.selectUser(); | ||
| 326 | + } else { | ||
| 327 | + this.$message({ | ||
| 328 | + message: res.msg, | ||
| 329 | + type: "warning", | ||
| 330 | + }); | ||
| 331 | + } | ||
| 332 | + } | ||
| 333 | + ); | ||
| 334 | + }) | ||
| 335 | + .catch((err) => { | ||
| 336 | + console.log(err); | ||
| 337 | + }) | ||
| 338 | + .catch(() => []); | ||
| 339 | + }, | ||
| 340 | + | ||
| 341 | + //删除用户 | ||
| 342 | + removeUser(row) { | ||
| 343 | + MessageBox.confirm("是否要删除此用户", "提示", { | ||
| 344 | + confirmButtonText: "确定删除", | ||
| 345 | + cancelButtonText: "取消", | ||
| 346 | + type: "warning", | ||
| 347 | + }) | ||
| 348 | + .then(() => { | ||
| 349 | + updateUserStatus({ id: row.row.id, isValid: 0 }).then((res) => { | ||
| 350 | + if (res.code === 200) { | ||
| 351 | + this.$message({ | ||
| 352 | + message: "操作成功", | ||
| 353 | + type: "success", | ||
| 354 | + }); | ||
| 355 | + this.selectUser(); | ||
| 356 | + } else { | ||
| 357 | + this.$message({ | ||
| 358 | + message: res.msg, | ||
| 359 | + type: "warning", | ||
| 360 | + }); | ||
| 361 | + } | ||
| 362 | + }); | ||
| 363 | + }) | ||
| 364 | + .catch((err) => { | ||
| 365 | + console.log(err); | ||
| 366 | + }) | ||
| 367 | + .catch(() => []); | ||
| 368 | + }, | ||
| 369 | + | ||
| 370 | + handleClose(val) { | ||
| 371 | + this.drawer = val; | ||
| 372 | + this.userData = {}; | ||
| 373 | + this.selectUser(); | ||
| 374 | + }, | ||
| 375 | + | ||
| 376 | + currentChange(val) { | ||
| 377 | + this.formData.page = val.page; | ||
| 378 | + this.selectUser(); | ||
| 379 | + }, | ||
| 380 | + }, | ||
| 381 | +}; | ||
| 9 | </script> | 382 | </script> |
| 10 | 383 | ||
| 11 | <style> | 384 | <style> |
| 12 | - | ||
| 13 | </style> | 385 | </style> |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
-
Please register or login to post a comment