Showing
30 changed files
with
1996 additions
and
368 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 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 120 | - | ||
| 121 | -// 下载用户导入模板 | ||
| 122 | -export function importTemplate() { | ||
| 123 | - return request({ | ||
| 124 | - url: '/system/user/importTemplate', | ||
| 125 | - method: 'get' | ||
| 126 | - }) | ||
| 127 | -} | ... | ... |
| 1 | let ductLabels = { | 1 | let ductLabels = { |
| 2 | - "cargoRulesStatus":{ | 2 | + "cargoRulesStatus": { |
| 3 | - "1":"手动", | 3 | + "1": "手动", |
| 4 | - "2":"自动" | 4 | + "2": "自动" |
| 5 | + }, | ||
| 6 | + "menuType": { | ||
| 7 | + "M": "菜单", | ||
| 8 | + "C": "菜单", | ||
| 9 | + "B": "按钮" | ||
| 10 | + }, | ||
| 11 | + "status": { | ||
| 12 | + "1": "启用", | ||
| 13 | + "2": "停用", | ||
| 14 | + }, | ||
| 15 | + "valid": { | ||
| 16 | + "1": "启用", | ||
| 17 | + "2": "关闭", | ||
| 18 | + }, | ||
| 19 | + "isValid": { | ||
| 20 | + "1": "启用", | ||
| 21 | + "2": "关闭", | ||
| 22 | + }, | ||
| 23 | + "ticketToPiece": { | ||
| 24 | + "1": "是", | ||
| 25 | + "0": "否", | ||
| 26 | + }, | ||
| 27 | + "needRequired": { | ||
| 28 | + "1": "是", | ||
| 29 | + "0": "否", | ||
| 30 | + }, | ||
| 31 | + "highLowPriceFlg": { | ||
| 32 | + "1": "启用", | ||
| 33 | + "0": "未开启", | ||
| 5 | } | 34 | } |
| 35 | + | ||
| 6 | } | 36 | } |
| 7 | 37 | ||
| 8 | export default ductLabels; | 38 | export default ductLabels; |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
This diff is collapsed. Click to expand it.
src/components/Table/info.vue
deleted
100644 → 0
| 1 | -<template> | ||
| 2 | - <div class="tableInfo"> | ||
| 3 | - <el-dropdown trigger="click" :hide-on-click="false"> | ||
| 4 | - <el-button | ||
| 5 | - type="primary" | ||
| 6 | - icon="el-icon-edit" | ||
| 7 | - size="medium" | ||
| 8 | - circle | ||
| 9 | - ></el-button> | ||
| 10 | - <el-dropdown-menu slot="dropdown"> | ||
| 11 | - <el-checkbox-group v-model="checkList"> | ||
| 12 | - <el-dropdown-item | ||
| 13 | - v-for="(item, index) in infoData" | ||
| 14 | - :key="index" | ||
| 15 | - v-if="!item.type" | ||
| 16 | - class="dropItem" | ||
| 17 | - > | ||
| 18 | - <el-checkbox | ||
| 19 | - :label="item.name" | ||
| 20 | - :checked="true" | ||
| 21 | - @change="checkChange" | ||
| 22 | - ></el-checkbox> | ||
| 23 | - <span class="itemRight"> | ||
| 24 | - <i class="el-icon-caret-top" @click.stop="top(index)"></i> | ||
| 25 | - <i class="el-icon-caret-bottom" @click.stop="bottom(index)"></i> | ||
| 26 | - </span> | ||
| 27 | - </el-dropdown-item> | ||
| 28 | - </el-checkbox-group> | ||
| 29 | - </el-dropdown-menu> | ||
| 30 | - </el-dropdown> | ||
| 31 | - </div> | ||
| 32 | -</template> | ||
| 33 | - | ||
| 34 | -<script> | ||
| 35 | -export default { | ||
| 36 | - props: { infoData: { type: Array, default: null } }, | ||
| 37 | - inheritAttrs: false, | ||
| 38 | - data() { | ||
| 39 | - return { | ||
| 40 | - checkList: [], | ||
| 41 | - }; | ||
| 42 | - }, | ||
| 43 | - methods: { | ||
| 44 | - checkChange(val) { | ||
| 45 | - this.$emit("checkChange", { type: val }); | ||
| 46 | - }, | ||
| 47 | - top(val) { | ||
| 48 | - this.$emit("top", val); | ||
| 49 | - }, | ||
| 50 | - bottom(val) { | ||
| 51 | - this.$emit("bottom", val); | ||
| 52 | - }, | ||
| 53 | - }, | ||
| 54 | - created() {}, | ||
| 55 | -}; | ||
| 56 | -</script> | ||
| 57 | - | ||
| 58 | -<style scope lang="scss"> | ||
| 59 | -.itemRight { | ||
| 60 | - display: -webkit-inline-box; | ||
| 61 | - display: -ms-inline-flexbox; | ||
| 62 | - display: inline-flex; | ||
| 63 | - -webkit-box-orient: vertical; | ||
| 64 | - -webkit-box-direction: normal; | ||
| 65 | - -ms-flex-direction: column; | ||
| 66 | - flex-direction: column; | ||
| 67 | - -webkit-box-align: center; | ||
| 68 | - -ms-flex-align: center; | ||
| 69 | - align-items: center; | ||
| 70 | - height: 34px; | ||
| 71 | - width: 24px; | ||
| 72 | - vertical-align: middle; | ||
| 73 | - cursor: pointer; | ||
| 74 | - overflow: initial; | ||
| 75 | - position: relative; | ||
| 76 | - .el-icon-caret-bottom, | ||
| 77 | - .el-icon-caret-top { | ||
| 78 | - width: 0; | ||
| 79 | - height: 0; | ||
| 80 | - border: solid 5px transparent; | ||
| 81 | - position: absolute; | ||
| 82 | - left: 10px; | ||
| 83 | - } | ||
| 84 | - .el-icon-caret-bottom { | ||
| 85 | - bottom: 12px; | ||
| 86 | - } | ||
| 87 | - .el-icon-caret-top { | ||
| 88 | - top: 5px; | ||
| 89 | - } | ||
| 90 | -} | ||
| 91 | -.dropItem { | ||
| 92 | - display: flex; | ||
| 93 | - justify-content: space-between; | ||
| 94 | -} | ||
| 95 | -</style> | ||
| 96 | - | ||
| 97 | -<style> | ||
| 98 | -.tableInfo { | ||
| 99 | - position: fixed; | ||
| 100 | - right: 30px; | ||
| 101 | - bottom: 40px; | ||
| 102 | - z-index: 99999999; | ||
| 103 | -} | ||
| 104 | -</style> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
src/components/Table/item.vue
deleted
100644 → 0
| 1 | -<script> | ||
| 2 | -export default { | ||
| 3 | - name: "Item", | ||
| 4 | - inheritAttrs: false, | ||
| 5 | - props: { | ||
| 6 | - dom: { | ||
| 7 | - type: Object, | ||
| 8 | - default: null, | ||
| 9 | - }, | ||
| 10 | - }, | ||
| 11 | - render() { | ||
| 12 | - let newDom = []; | ||
| 13 | - newDom.push(this.dom); | ||
| 14 | - return newDom; | ||
| 15 | - }, | ||
| 16 | - methods: { | ||
| 17 | - change(val){ | ||
| 18 | - this.$emit('change',val) | ||
| 19 | - } | ||
| 20 | - }, | ||
| 21 | -}; | ||
| 22 | -</script> |
| ... | @@ -3,9 +3,9 @@ | ... | @@ -3,9 +3,9 @@ |
| 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 = "*:*:*"; |
| ... | @@ -24,5 +24,23 @@ export default { | ... | @@ -24,5 +24,23 @@ export default { |
| 24 | } else { | 24 | } else { |
| 25 | throw new Error(`请设置操作权限标签值`) | 25 | throw new Error(`请设置操作权限标签值`) |
| 26 | } | 26 | } |
| 27 | + }, | ||
| 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) | ||
| 27 | } | 41 | } |
| 28 | -} | 42 | + }); |
| 43 | + return newRouter | ||
| 44 | + } | ||
| 45 | + } | ||
| 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,31 +15,43 @@ | ... | @@ -16,31 +15,43 @@ |
| 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" |
| 23 | > | 35 | > |
| 24 | - <div class="avatar-wrapper"> | 36 | + <div class="userName-wrapper"> |
| 25 | - <img :src="avatar" class="user-avatar"> | 37 | + <!-- <img :src="avatar" class="user-avatar" /> --> |
| 38 | + <span><i class="el-icon-user-solid" style="color:#1890ff"></i>欢迎!{{userName}}</span> | ||
| 26 | </div> | 39 | </div> |
| 27 | <el-dropdown-menu slot="dropdown"> | 40 | <el-dropdown-menu slot="dropdown"> |
| 28 | - <router-link to="/user/profile"> | ||
| 29 | - </router-link> | ||
| 30 | <el-dropdown-item @click.native="logout"> | 41 | <el-dropdown-item @click.native="logout"> |
| 31 | <span>退出登录</span> | 42 | <span>退出登录</span> |
| 32 | </el-dropdown-item> | 43 | </el-dropdown-item> |
| 33 | </el-dropdown-menu> | 44 | </el-dropdown-menu> |
| 34 | </el-dropdown> | 45 | </el-dropdown> |
| 35 | - <el-select | 46 | + <!-- <el-select |
| 36 | v-model="locale" | 47 | v-model="locale" |
| 37 | size="mini" | 48 | size="mini" |
| 38 | @change="local" | 49 | @change="local" |
| 39 | - style="width: 75px;top:-17px;right:7px" | 50 | + style="width: 75px; top: -17px; right: 7px" |
| 40 | > | 51 | > |
| 41 | <el-option label="中文" value="zh"> </el-option> | 52 | <el-option label="中文" value="zh"> </el-option> |
| 42 | <el-option label="英文" value="en"> </el-option> | 53 | <el-option label="英文" value="en"> </el-option> |
| 43 | - </el-select> | 54 | + </el-select> --> |
| 44 | </div> | 55 | </div> |
| 45 | <Profile :drawer="drawer" @drawerHandleClose="drawerHandleClose"></Profile> | 56 | <Profile :drawer="drawer" @drawerHandleClose="drawerHandleClose"></Profile> |
| 46 | </div> | 57 | </div> |
| ... | @@ -51,21 +62,25 @@ import { mapGetters } from "vuex"; | ... | @@ -51,21 +62,25 @@ import { mapGetters } from "vuex"; |
| 51 | import Breadcrumb from "@/components/Breadcrumb"; | 62 | import Breadcrumb from "@/components/Breadcrumb"; |
| 52 | import TopNav from "@/components/TopNav"; | 63 | import TopNav from "@/components/TopNav"; |
| 53 | import Hamburger from "@/components/Hamburger"; | 64 | import Hamburger from "@/components/Hamburger"; |
| 54 | -import Profile from "@/views/systemConfig/userConfig/profile/index"; | 65 | +import { removeToken } from '@/utils/auth' |
| 55 | 66 | ||
| 56 | export default { | 67 | export default { |
| 57 | components: { | 68 | components: { |
| 58 | Breadcrumb, | 69 | Breadcrumb, |
| 59 | TopNav, | 70 | TopNav, |
| 60 | Hamburger, | 71 | Hamburger, |
| 61 | - Profile, | ||
| 62 | }, | 72 | }, |
| 63 | data() { | 73 | data() { |
| 64 | return { | 74 | return { |
| 65 | - drawer: false, | 75 | + userName:"", |
| 76 | + portNameList: [], | ||
| 66 | locale: "zh", | 77 | locale: "zh", |
| 67 | }; | 78 | }; |
| 68 | }, | 79 | }, |
| 80 | + created() { | ||
| 81 | + this.portNameList = this.$store.state.user.portNames; | ||
| 82 | + this.userName = this.$store.state.user.name; | ||
| 83 | + }, | ||
| 69 | computed: { | 84 | computed: { |
| 70 | ...mapGetters(["sidebar", "avatar", "device"]), | 85 | ...mapGetters(["sidebar", "avatar", "device"]), |
| 71 | setting: { | 86 | setting: { |
| ... | @@ -84,6 +99,43 @@ export default { | ... | @@ -84,6 +99,43 @@ export default { |
| 84 | return this.$store.state.settings.topNav; | 99 | return this.$store.state.settings.topNav; |
| 85 | }, | 100 | }, |
| 86 | }, | 101 | }, |
| 102 | + //切换口岸 | ||
| 103 | + portName: { | ||
| 104 | + get() { | ||
| 105 | + return this.$store.state.user.activePortName; | ||
| 106 | + }, | ||
| 107 | + set(val) { | ||
| 108 | + this.$store | ||
| 109 | + .dispatch("changePort", val) | ||
| 110 | + .then((res) => { | ||
| 111 | + if (res.code === 200) { | ||
| 112 | + this.$store.dispatch('tagsView/delAllCachedViews') | ||
| 113 | + this.$store.dispatch('tagsView/delAllVisitedViews') | ||
| 114 | + // location.reload(); | ||
| 115 | + if(this.$route.path != '/index'){ | ||
| 116 | + this.$router.push('/index') | ||
| 117 | + } | ||
| 118 | + } else { | ||
| 119 | + this.$confirm(res.msg, "提示", { | ||
| 120 | + type: "warning", | ||
| 121 | + }).then(()=>{ | ||
| 122 | + // location.reload(); | ||
| 123 | + if(this.$route.path != '/index'){ | ||
| 124 | + this.$router.push('/index') | ||
| 125 | + } | ||
| 126 | + }).catch(()=>{ | ||
| 127 | + // location.reload(); | ||
| 128 | + if(this.$route.path != '/index'){ | ||
| 129 | + this.$router.push('/index') | ||
| 130 | + } | ||
| 131 | + }); | ||
| 132 | + } | ||
| 133 | + }) | ||
| 134 | + .catch((err) => { | ||
| 135 | + console.log(err); | ||
| 136 | + }); | ||
| 137 | + }, | ||
| 138 | + }, | ||
| 87 | }, | 139 | }, |
| 88 | methods: { | 140 | methods: { |
| 89 | toggleSideBar() { | 141 | toggleSideBar() { |
| ... | @@ -96,14 +148,11 @@ export default { | ... | @@ -96,14 +148,11 @@ export default { |
| 96 | type: "warning", | 148 | type: "warning", |
| 97 | }).then(() => { | 149 | }).then(() => { |
| 98 | this.$store.dispatch("LogOut").then(() => { | 150 | this.$store.dispatch("LogOut").then(() => { |
| 99 | - location.href = "/index"; | 151 | + removeToken() |
| 100 | - // window.location.href = "https://test.secure.fedex.com/logout";//wsso系统跳转 | 152 | + window.location.href = "https://test-myapps.secure.fedex.com/purpleid/signout/";//wsso系统跳转 |
| 101 | }); | 153 | }); |
| 102 | }); | 154 | }); |
| 103 | }, | 155 | }, |
| 104 | - drawerHandleClose(val) { | ||
| 105 | - this.drawer = val; | ||
| 106 | - }, | ||
| 107 | local(val) { | 156 | local(val) { |
| 108 | this.$i18n.locale = val; //此处val为 zh 或者 en | 157 | this.$i18n.locale = val; //此处val为 zh 或者 en |
| 109 | }, | 158 | }, |
| ... | @@ -174,12 +223,19 @@ export default { | ... | @@ -174,12 +223,19 @@ export default { |
| 174 | } | 223 | } |
| 175 | 224 | ||
| 176 | .avatar-container { | 225 | .avatar-container { |
| 226 | + text-align: center; | ||
| 177 | margin-right: 15px; | 227 | margin-right: 15px; |
| 178 | - | 228 | + font-weight: 700; |
| 179 | - .avatar-wrapper { | 229 | + i{ |
| 180 | - margin-top: 5px; | 230 | + display: inline-block; |
| 231 | + height: 50px; | ||
| 232 | + margin-right:5px; | ||
| 233 | + font-size: 24px; | ||
| 234 | + line-height: 50px; | ||
| 235 | + } | ||
| 236 | + .userName-wrapper { | ||
| 181 | position: relative; | 237 | position: relative; |
| 182 | - | 238 | + font-size:14px; |
| 183 | .user-avatar { | 239 | .user-avatar { |
| 184 | cursor: pointer; | 240 | cursor: pointer; |
| 185 | width: 40px; | 241 | width: 40px; | ... | ... |
| 1 | import router from './router' | 1 | import router from './router' |
| 2 | import store from './store' | 2 | import store from './store' |
| 3 | import { Message } from 'element-ui' | 3 | import { Message } from 'element-ui' |
| 4 | -import { getToken } from '@/utils/auth' | 4 | +import { getToken, setToken, removeToken } from '@/utils/auth' |
| 5 | 5 | ||
| 6 | 6 | ||
| 7 | const whiteList = ['/login', '/auth-redirect', '/bind', '/register'] | 7 | const whiteList = ['/login', '/auth-redirect', '/bind', '/register'] |
| ... | @@ -21,9 +21,10 @@ router.beforeEach((to, from, next) => { | ... | @@ -21,9 +21,10 @@ router.beforeEach((to, from, next) => { |
| 21 | next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 | 21 | next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 |
| 22 | }) | 22 | }) |
| 23 | }).catch(err => { | 23 | }).catch(err => { |
| 24 | - store.dispatch('LogOut').then(() => { | ||
| 25 | Message.error(err) | 24 | Message.error(err) |
| 26 | - next({ path: '/' }) | 25 | + store.dispatch('LogOut').then(() => { |
| 26 | + // next({ path: '/' }) | ||
| 27 | + window.location.href = "https://test-myapps.secure.fedex.com/purpleid/signout/";//wsso系统跳转 | ||
| 27 | }) | 28 | }) |
| 28 | }) | 29 | }) |
| 29 | } else { | 30 | } else { |
| ... | @@ -31,13 +32,22 @@ router.beforeEach((to, from, next) => { | ... | @@ -31,13 +32,22 @@ router.beforeEach((to, from, next) => { |
| 31 | } | 32 | } |
| 32 | } | 33 | } |
| 33 | } else { | 34 | } else { |
| 35 | + removeToken() | ||
| 34 | // 没有token | 36 | // 没有token |
| 37 | + //wsso登录时对后端重定向带来的token进行记录 | ||
| 38 | + let token = location.search.split("token=")[1] | ||
| 39 | + if (token != undefined && token != '' && token != null) { | ||
| 40 | + setToken(token) | ||
| 41 | + next({ path: '/' }) | ||
| 42 | + } else { | ||
| 35 | if (whiteList.indexOf(to.path) !== -1) { | 43 | if (whiteList.indexOf(to.path) !== -1) { |
| 36 | // 在免登录白名单,直接进入 | 44 | // 在免登录白名单,直接进入 |
| 37 | next() | 45 | next() |
| 38 | } else { | 46 | } else { |
| 39 | - next(`/login?redirect=${to.fullPath}`) // 否则全部重定向到登录页 | 47 | + window.location.href = "https://test-myapps.secure.fedex.com/purpleid/signout/";//wsso系统跳转 |
| 48 | + } | ||
| 40 | } | 49 | } |
| 50 | + | ||
| 41 | } | 51 | } |
| 42 | }) | 52 | }) |
| 43 | 53 | ... | ... |
| ... | @@ -7,12 +7,15 @@ const getters = { | ... | @@ -7,12 +7,15 @@ const getters = { |
| 7 | token: state => state.user.token, | 7 | token: state => state.user.token, |
| 8 | avatar: state => state.user.avatar, | 8 | avatar: state => state.user.avatar, |
| 9 | name: state => state.user.name, | 9 | name: state => state.user.name, |
| 10 | + activePortName: state => state.user.activePortName, | ||
| 11 | + portName: state => state.user.portName, | ||
| 10 | introduction: state => state.user.introduction, | 12 | introduction: state => state.user.introduction, |
| 11 | roles: state => state.user.roles, | 13 | roles: state => state.user.roles, |
| 12 | permissions: state => state.user.permissions, | 14 | permissions: state => state.user.permissions, |
| 13 | permission_routes: state => state.permission.routes, | 15 | permission_routes: state => state.permission.routes, |
| 14 | - topbarRouters:state => state.permission.topbarRouters, | 16 | + topbarRouters: state => state.permission.topbarRouters, |
| 15 | - defaultRoutes:state => state.permission.defaultRoutes, | 17 | + defaultRoutes: state => state.permission.defaultRoutes, |
| 16 | - sidebarRouters:state => state.permission.sidebarRouters, | 18 | + sidebarRouters: state => state.permission.sidebarRouters, |
| 19 | + filghtAllData: state => state.permission.filghtAllData, | ||
| 17 | } | 20 | } |
| 18 | export default getters | 21 | export default getters | ... | ... |
| ... | @@ -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' |
| 4 | +import { Message } from 'element-ui' | ||
| 3 | 5 | ||
| 4 | const user = { | 6 | const user = { |
| 5 | state: { | 7 | state: { |
| 6 | token: getToken(), | 8 | token: getToken(), |
| 7 | name: '', | 9 | name: '', |
| 8 | avatar: '', | 10 | avatar: '', |
| 11 | + activePortName: '', | ||
| 12 | + portNames:[], | ||
| 9 | roles: [], | 13 | roles: [], |
| 10 | permissions: [] | 14 | permissions: [] |
| 11 | }, | 15 | }, |
| ... | @@ -20,6 +24,13 @@ const user = { | ... | @@ -20,6 +24,13 @@ const user = { |
| 20 | SET_AVATAR: (state, avatar) => { | 24 | SET_AVATAR: (state, avatar) => { |
| 21 | state.avatar = avatar | 25 | state.avatar = avatar |
| 22 | }, | 26 | }, |
| 27 | + SET_ACTIVEPORTNAME: (state, activePortName) => { | ||
| 28 | + state.activePortName = activePortName | ||
| 29 | + sessionStorage.setItem('portName', activePortName) | ||
| 30 | + }, | ||
| 31 | + SET_PORTNAMES:(state,portNames)=>{ | ||
| 32 | + state.portNames = portNames | ||
| 33 | + }, | ||
| 23 | SET_ROLES: (state, roles) => { | 34 | SET_ROLES: (state, roles) => { |
| 24 | state.roles = roles | 35 | state.roles = roles |
| 25 | }, | 36 | }, |
| ... | @@ -29,6 +40,7 @@ const user = { | ... | @@ -29,6 +40,7 @@ const user = { |
| 29 | }, | 40 | }, |
| 30 | 41 | ||
| 31 | actions: { | 42 | actions: { |
| 43 | + | ||
| 32 | // 登录 | 44 | // 登录 |
| 33 | Login({ commit }, userInfo) { | 45 | Login({ commit }, userInfo) { |
| 34 | const username = userInfo.username.trim() | 46 | const username = userInfo.username.trim() |
| ... | @@ -36,10 +48,12 @@ const user = { | ... | @@ -36,10 +48,12 @@ const user = { |
| 36 | const rememberMe = userInfo.rememberMe | 48 | const rememberMe = userInfo.rememberMe |
| 37 | 49 | ||
| 38 | return new Promise((resolve, reject) => { | 50 | return new Promise((resolve, reject) => { |
| 39 | - login(username, password,rememberMe).then(res => { | 51 | + login(username, password, rememberMe).then(res => { |
| 52 | + if(res.code === 200){ | ||
| 40 | setToken(res.data) | 53 | setToken(res.data) |
| 41 | commit('SET_TOKEN', res.data) | 54 | commit('SET_TOKEN', res.data) |
| 42 | - resolve() | 55 | + } |
| 56 | + resolve(res) | ||
| 43 | }).catch(error => { | 57 | }).catch(error => { |
| 44 | reject(error) | 58 | reject(error) |
| 45 | }) | 59 | }) |
| ... | @@ -52,6 +66,20 @@ const user = { | ... | @@ -52,6 +66,20 @@ const user = { |
| 52 | getInfo().then(res => { | 66 | getInfo().then(res => { |
| 53 | const user = res.data.user | 67 | const user = res.data.user |
| 54 | const avatar = user.avatar == "" ? require("@/assets/images/profile.jpg") : process.env.VUE_APP_BASE_API + user.avatar; | 68 | const avatar = user.avatar == "" ? require("@/assets/images/profile.jpg") : process.env.VUE_APP_BASE_API + user.avatar; |
| 69 | + let ports = []; | ||
| 70 | + if(user.portName){ | ||
| 71 | + ports = user.portName.split(','); | ||
| 72 | + commit('SET_PORTNAMES',ports) | ||
| 73 | + commit('SET_ACTIVEPORTNAME', sessionStorage.getItem('portName')?sessionStorage.getItem('portName'):state.portNames[0]) | ||
| 74 | + }else{ | ||
| 75 | + Message({ | ||
| 76 | + message: "未找到口岸信息!请确认后再登录", | ||
| 77 | + type: 'error' | ||
| 78 | + }) | ||
| 79 | + this.LogOut().then(()=>{ | ||
| 80 | + window.location.href = "https://test-myapps.secure.fedex.com/purpleid/signout/";//wsso系统跳转 | ||
| 81 | + }) | ||
| 82 | + } | ||
| 55 | if (res.data.roles && res.data.roles.length > 0) { // 验证返回的roles是否是一个非空数组 | 83 | if (res.data.roles && res.data.roles.length > 0) { // 验证返回的roles是否是一个非空数组 |
| 56 | commit('SET_ROLES', res.data.roles) | 84 | commit('SET_ROLES', res.data.roles) |
| 57 | commit('SET_PERMISSIONS', res.data.permissions) | 85 | commit('SET_PERMISSIONS', res.data.permissions) |
| ... | @@ -67,11 +95,25 @@ const user = { | ... | @@ -67,11 +95,25 @@ const user = { |
| 67 | }) | 95 | }) |
| 68 | }, | 96 | }, |
| 69 | 97 | ||
| 98 | + //切换口岸 | ||
| 99 | + changePort({ commit }, portName) { | ||
| 100 | + return new Promise((resolve, reject) => { | ||
| 101 | + changeCurrentPort({ portName: portName }).then(res=>{ | ||
| 102 | + if(res.code === 200){ | ||
| 103 | + commit('SET_ACTIVEPORTNAME',portName) | ||
| 104 | + } | ||
| 105 | + resolve(res) | ||
| 106 | + }).catch(err=>{ | ||
| 107 | + reject(err) | ||
| 108 | + }) | ||
| 109 | + }) | ||
| 110 | + }, | ||
| 111 | + | ||
| 70 | // 退出系统 | 112 | // 退出系统 |
| 71 | LogOut({ commit, state }) { | 113 | LogOut({ commit, state }) { |
| 72 | return new Promise((resolve, reject) => { | 114 | return new Promise((resolve, reject) => { |
| 73 | logout(state.token).then(() => { | 115 | logout(state.token).then(() => { |
| 74 | - | 116 | + // window.location.href = "https://test-myapps.secure.fedex.com/purpleid/signout";//wsso系统跳转 |
| 75 | commit('SET_TOKEN', '') | 117 | commit('SET_TOKEN', '') |
| 76 | commit('SET_ROLES', []) | 118 | commit('SET_ROLES', []) |
| 77 | commit('SET_PERMISSIONS', []) | 119 | commit('SET_PERMISSIONS', []) |
| ... | @@ -86,6 +128,7 @@ const user = { | ... | @@ -86,6 +128,7 @@ const user = { |
| 86 | // 前端 登出 | 128 | // 前端 登出 |
| 87 | FedLogOut({ commit }) { | 129 | FedLogOut({ commit }) { |
| 88 | return new Promise(resolve => { | 130 | return new Promise(resolve => { |
| 131 | + // window.location.href = "https://test-myapps.secure.fedex.com/purpleid/signout";//wsso系统跳转 | ||
| 89 | commit('SET_TOKEN', '') | 132 | commit('SET_TOKEN', '') |
| 90 | removeToken() | 133 | removeToken() |
| 91 | resolve() | 134 | resolve() | ... | ... |
| ... | @@ -5,9 +5,9 @@ | ... | @@ -5,9 +5,9 @@ |
| 5 | 5 | ||
| 6 | const baseURL = process.env.VUE_APP_BASE_API | 6 | const baseURL = process.env.VUE_APP_BASE_API |
| 7 | 7 | ||
| 8 | -// 日期格式化 | 8 | + // 日期格式化 |
| 9 | -export function parseTime(time, pattern) { | 9 | + export function parseTime(time, pattern) { |
| 10 | - debugger | 10 | + //debugger |
| 11 | if (arguments.length === 0 || !time) { | 11 | if (arguments.length === 0 || !time) { |
| 12 | return null | 12 | return null |
| 13 | } | 13 | } |
| ... | @@ -45,17 +45,17 @@ export function parseTime(time, pattern) { | ... | @@ -45,17 +45,17 @@ export function parseTime(time, pattern) { |
| 45 | return value || 0 | 45 | return value || 0 |
| 46 | }) | 46 | }) |
| 47 | return time_str | 47 | return time_str |
| 48 | -} | 48 | + } |
| 49 | 49 | ||
| 50 | -// 表单重置 | 50 | + // 表单重置 |
| 51 | -export function resetForm(refName) { | 51 | + export function resetForm(refName) { |
| 52 | if (this.$refs[refName]) { | 52 | if (this.$refs[refName]) { |
| 53 | this.$refs[refName].resetFields(); | 53 | this.$refs[refName].resetFields(); |
| 54 | } | 54 | } |
| 55 | -} | 55 | + } |
| 56 | 56 | ||
| 57 | -// 添加日期范围 | 57 | + // 添加日期范围 |
| 58 | -export function addDateRange(params, dateRange, propName) { | 58 | + export function addDateRange(params, dateRange, propName) { |
| 59 | var search = params; | 59 | var search = params; |
| 60 | search.params = {}; | 60 | search.params = {}; |
| 61 | if (null != dateRange && '' != dateRange) { | 61 | if (null != dateRange && '' != dateRange) { |
| ... | @@ -68,10 +68,10 @@ export function addDateRange(params, dateRange, propName) { | ... | @@ -68,10 +68,10 @@ export function addDateRange(params, dateRange, propName) { |
| 68 | } | 68 | } |
| 69 | } | 69 | } |
| 70 | return search; | 70 | return search; |
| 71 | -} | 71 | + } |
| 72 | 72 | ||
| 73 | -// 回显数据字典 | 73 | + // 回显数据字典 |
| 74 | -export function selectDictLabel(datas, value) { | 74 | + export function selectDictLabel(datas, value) { |
| 75 | var actions = []; | 75 | var actions = []; |
| 76 | Object.keys(datas).some((key) => { | 76 | Object.keys(datas).some((key) => { |
| 77 | if (datas[key].dictValue == ('' + value)) { | 77 | if (datas[key].dictValue == ('' + value)) { |
| ... | @@ -80,10 +80,10 @@ export function selectDictLabel(datas, value) { | ... | @@ -80,10 +80,10 @@ export function selectDictLabel(datas, value) { |
| 80 | } | 80 | } |
| 81 | }) | 81 | }) |
| 82 | return actions.join(''); | 82 | return actions.join(''); |
| 83 | -} | 83 | + } |
| 84 | 84 | ||
| 85 | -// 回显数据字典(字符串数组) | 85 | + // 回显数据字典(字符串数组) |
| 86 | -export function selectDictLabels(datas, value, separator) { | 86 | + export function selectDictLabels(datas, value, separator) { |
| 87 | var actions = []; | 87 | var actions = []; |
| 88 | var currentSeparator = undefined === separator ? "," : separator; | 88 | var currentSeparator = undefined === separator ? "," : separator; |
| 89 | var temp = value.split(currentSeparator); | 89 | var temp = value.split(currentSeparator); |
| ... | @@ -95,15 +95,15 @@ export function selectDictLabels(datas, value, separator) { | ... | @@ -95,15 +95,15 @@ export function selectDictLabels(datas, value, separator) { |
| 95 | }) | 95 | }) |
| 96 | }) | 96 | }) |
| 97 | return actions.join('').substring(0, actions.join('').length - 1); | 97 | return actions.join('').substring(0, actions.join('').length - 1); |
| 98 | -} | 98 | + } |
| 99 | 99 | ||
| 100 | -// 通用下载方法 | 100 | + // 通用下载方法 |
| 101 | -export function download(fileName) { | 101 | + export function download(fileName) { |
| 102 | window.location.href = baseURL + "/common/download?fileName=" + encodeURI(fileName) + "&delete=" + true; | 102 | window.location.href = baseURL + "/common/download?fileName=" + encodeURI(fileName) + "&delete=" + true; |
| 103 | -} | 103 | + } |
| 104 | 104 | ||
| 105 | -// 字符串格式化(%s ) | 105 | + // 字符串格式化(%s ) |
| 106 | -export function sprintf(str) { | 106 | + export function sprintf(str) { |
| 107 | var args = arguments, flag = true, i = 1; | 107 | var args = arguments, flag = true, i = 1; |
| 108 | str = str.replace(/%s/g, function () { | 108 | str = str.replace(/%s/g, function () { |
| 109 | var arg = args[i++]; | 109 | var arg = args[i++]; |
| ... | @@ -114,24 +114,24 @@ export function sprintf(str) { | ... | @@ -114,24 +114,24 @@ export function sprintf(str) { |
| 114 | return arg; | 114 | return arg; |
| 115 | }); | 115 | }); |
| 116 | return flag ? str : ''; | 116 | return flag ? str : ''; |
| 117 | -} | 117 | + } |
| 118 | 118 | ||
| 119 | -// 转换字符串,undefined,null等转化为"" | 119 | + // 转换字符串,undefined,null等转化为"" |
| 120 | -export function praseStrEmpty(str) { | 120 | + export function praseStrEmpty(str) { |
| 121 | if (!str || str == "undefined" || str == "null") { | 121 | if (!str || str == "undefined" || str == "null") { |
| 122 | return ""; | 122 | return ""; |
| 123 | } | 123 | } |
| 124 | return str; | 124 | return str; |
| 125 | -} | 125 | + } |
| 126 | 126 | ||
| 127 | -/** | 127 | + /** |
| 128 | * 构造树型结构数据 | 128 | * 构造树型结构数据 |
| 129 | * @param {*} data 数据源 | 129 | * @param {*} data 数据源 |
| 130 | * @param {*} id id字段 默认 'id' | 130 | * @param {*} id id字段 默认 'id' |
| 131 | * @param {*} parentId 父节点字段 默认 'parentId' | 131 | * @param {*} parentId 父节点字段 默认 'parentId' |
| 132 | * @param {*} children 孩子节点字段 默认 'children' | 132 | * @param {*} children 孩子节点字段 默认 'children' |
| 133 | */ | 133 | */ |
| 134 | -export function handleTree(data, id, parentId, children) { | 134 | + export function handleTree(data, id, parentId, children) { |
| 135 | let config = { | 135 | let config = { |
| 136 | id: id || 'id', | 136 | id: id || 'id', |
| 137 | parentId: parentId || 'parentId', | 137 | parentId: parentId || 'parentId', |
| ... | @@ -173,10 +173,10 @@ export function handleTree(data, id, parentId, children) { | ... | @@ -173,10 +173,10 @@ export function handleTree(data, id, parentId, children) { |
| 173 | } | 173 | } |
| 174 | } | 174 | } |
| 175 | return tree; | 175 | return tree; |
| 176 | -} | 176 | + } |
| 177 | 177 | ||
| 178 | -//字符串英文转大写,;转英文; | 178 | + //字符串英文转大写,;转英文; |
| 179 | -export function upCase(str){ | 179 | + export function upCase(str){ |
| 180 | - let newStr = str.replace(/;/g,";").toUpperCase().trim(); | 180 | + let newStr = str.replace(/;/g,";").toUpperCase(); |
| 181 | return newStr; | 181 | return newStr; |
| 182 | -} | 182 | + } | ... | ... |
| ... | @@ -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 | } | ... | ... |
| ... | @@ -67,8 +67,10 @@ service.interceptors.response.use(res => { | ... | @@ -67,8 +67,10 @@ service.interceptors.response.use(res => { |
| 67 | type: 'warning' | 67 | type: 'warning' |
| 68 | } | 68 | } |
| 69 | ).then(() => { | 69 | ).then(() => { |
| 70 | - store.dispatch('FedLogOut').then(() => { | 70 | + store.dispatch('LogOut').then(() => { |
| 71 | - location.href = '/index'; | 71 | + // location.href = '/'; |
| 72 | + window.location.href = "https://test-myapps.secure.fedex.com/purpleid/signout/";//wsso系统跳转 | ||
| 73 | + // testsso.ute.apac.fedex.com/iMAC | ||
| 72 | }) | 74 | }) |
| 73 | }) | 75 | }) |
| 74 | } else if (code === 403) { | 76 | } else if (code === 403) { | ... | ... |
| ... | @@ -199,6 +199,7 @@ | ... | @@ -199,6 +199,7 @@ |
| 199 | <el-col :span="6"> | 199 | <el-col :span="6"> |
| 200 | <el-form-item label="取件日期"> | 200 | <el-form-item label="取件日期"> |
| 201 | <el-date-picker | 201 | <el-date-picker |
| 202 | + class="formItem" | ||
| 202 | v-model="formData.pickUpDate" | 203 | v-model="formData.pickUpDate" |
| 203 | type="date" | 204 | type="date" |
| 204 | placeholder="选择日期" | 205 | placeholder="选择日期" |
| ... | @@ -208,16 +209,6 @@ | ... | @@ -208,16 +209,6 @@ |
| 208 | </el-date-picker> | 209 | </el-date-picker> |
| 209 | </el-form-item> | 210 | </el-form-item> |
| 210 | </el-col> | 211 | </el-col> |
| 211 | - <el-col :span="6"> | ||
| 212 | - <el-form-item label="口岸代码"> | ||
| 213 | - <el-input | ||
| 214 | - v-model="portName" | ||
| 215 | - placeholder="请输入口岸代码" | ||
| 216 | - class="formItem" | ||
| 217 | - clearable | ||
| 218 | - ></el-input> | ||
| 219 | - </el-form-item> | ||
| 220 | - </el-col> | ||
| 221 | <el-col :span="24"> | 212 | <el-col :span="24"> |
| 222 | <el-form-item label="Handling Code"> | 213 | <el-form-item label="Handling Code"> |
| 223 | <el-empty | 214 | <el-empty |
| ... | @@ -267,6 +258,7 @@ | ... | @@ -267,6 +258,7 @@ |
| 267 | <el-button | 258 | <el-button |
| 268 | :type="downLoadingTip.downloading ? 'warning' : 'primary'" | 259 | :type="downLoadingTip.downloading ? 'warning' : 'primary'" |
| 269 | size="mini" | 260 | size="mini" |
| 261 | + v-hasPermi="['allocation:cargo:export']" | ||
| 270 | @click="xlsx(0)" | 262 | @click="xlsx(0)" |
| 271 | :loading="downLoadingTip.downloading" | 263 | :loading="downLoadingTip.downloading" |
| 272 | :disabled="tableData.length <= 0" | 264 | :disabled="tableData.length <= 0" |
| ... | @@ -277,6 +269,7 @@ | ... | @@ -277,6 +269,7 @@ |
| 277 | <el-button | 269 | <el-button |
| 278 | :type="downLoadingTip.downloading ? 'warning' : 'primary'" | 270 | :type="downLoadingTip.downloading ? 'warning' : 'primary'" |
| 279 | size="mini" | 271 | size="mini" |
| 272 | + v-hasPermi="['allocation:cargo:export']" | ||
| 280 | @click="xlsx(1)" | 273 | @click="xlsx(1)" |
| 281 | :loading="downLoadingTip.downloading" | 274 | :loading="downLoadingTip.downloading" |
| 282 | :disabled="tableData.length <= 0" | 275 | :disabled="tableData.length <= 0" |
| ... | @@ -287,8 +280,9 @@ | ... | @@ -287,8 +280,9 @@ |
| 287 | <el-button | 280 | <el-button |
| 288 | type="primary" | 281 | type="primary" |
| 289 | size="mini" | 282 | size="mini" |
| 283 | + v-hasPermi="['allocation:cargo:allocation']" | ||
| 290 | @click="addFit" | 284 | @click="addFit" |
| 291 | - :disabled="tableSelection.length <= 0" | 285 | + :disabled="tableSelection.length <= 0 || formData.accsPool!='OSPR'" |
| 292 | >添加到航班</el-button | 286 | >添加到航班</el-button |
| 293 | > | 287 | > |
| 294 | <div class="tips"> | 288 | <div class="tips"> |
| ... | @@ -307,7 +301,8 @@ | ... | @@ -307,7 +301,8 @@ |
| 307 | :limitStart="formData.limitStart" | 301 | :limitStart="formData.limitStart" |
| 308 | :page="page" | 302 | :page="page" |
| 309 | :shiftKey="shiftKey" | 303 | :shiftKey="shiftKey" |
| 310 | - height="350" | 304 | + :infoShow="false" |
| 305 | + :height="tableHeight" | ||
| 311 | @tableSelect="tableSelect" | 306 | @tableSelect="tableSelect" |
| 312 | @tableSelectAll="tableSelectAll" | 307 | @tableSelectAll="tableSelectAll" |
| 313 | @currentChange="currentChange" | 308 | @currentChange="currentChange" |
| ... | @@ -817,6 +812,7 @@ export default { | ... | @@ -817,6 +812,7 @@ export default { |
| 817 | size: 100, | 812 | size: 100, |
| 818 | allWeight: 0, | 813 | allWeight: 0, |
| 819 | allQty: 0, | 814 | allQty: 0, |
| 815 | + tableHeight:null, | ||
| 820 | dialogVisible: false, | 816 | dialogVisible: false, |
| 821 | shiftKey: false, | 817 | shiftKey: false, |
| 822 | createDate: null, | 818 | createDate: null, |
| ... | @@ -829,6 +825,11 @@ export default { | ... | @@ -829,6 +825,11 @@ export default { |
| 829 | }, | 825 | }, |
| 830 | created() { | 826 | created() { |
| 831 | this.seleData(); | 827 | this.seleData(); |
| 828 | + if(this.$store.state.tagsView.cachedViews.length == 0){ | ||
| 829 | + this.select(); | ||
| 830 | + } | ||
| 831 | + }, | ||
| 832 | + activated(){ | ||
| 832 | this.select(); | 833 | this.select(); |
| 833 | }, | 834 | }, |
| 834 | mounted() { | 835 | mounted() { |
| ... | @@ -842,6 +843,7 @@ export default { | ... | @@ -842,6 +843,7 @@ export default { |
| 842 | this.shiftKey = false; | 843 | this.shiftKey = false; |
| 843 | } | 844 | } |
| 844 | }); | 845 | }); |
| 846 | + this.tableHeight = window.innerHeight - this.$refs.form.$el.offsetHeight-60 | ||
| 845 | }, | 847 | }, |
| 846 | methods: { | 848 | methods: { |
| 847 | //查询条件 | 849 | //查询条件 |
| ... | @@ -888,9 +890,9 @@ export default { | ... | @@ -888,9 +890,9 @@ export default { |
| 888 | this.tableData = res.data.list; | 890 | this.tableData = res.data.list; |
| 889 | this.totalCount = res.data.total; | 891 | this.totalCount = res.data.total; |
| 890 | if (res.data.list.length > 0) { | 892 | if (res.data.list.length > 0) { |
| 891 | - this.tableData.forEach((item, index = 0) => { | 893 | + // this.tableData.forEach((item, index = 0) => { |
| 892 | - item.index = index; | 894 | + // item.index = index; |
| 893 | - }); | 895 | + // }); |
| 894 | } else { | 896 | } else { |
| 895 | this.$message({ | 897 | this.$message({ |
| 896 | message: "未查询到数据", | 898 | message: "未查询到数据", |
| ... | @@ -1025,14 +1027,20 @@ export default { | ... | @@ -1025,14 +1027,20 @@ export default { |
| 1025 | } | 1027 | } |
| 1026 | }); | 1028 | }); |
| 1027 | data = data.sort(this.$refs.newTables.compare(val.prop, val.order)); | 1029 | data = data.sort(this.$refs.newTables.compare(val.prop, val.order)); |
| 1028 | - if (val.order != "ascending") { | 1030 | + if (val.order == "descending") { |
| 1029 | this.tableData = nullData.concat(data); | 1031 | this.tableData = nullData.concat(data); |
| 1030 | - } else { | 1032 | + } else{ |
| 1031 | this.tableData = data.concat(nullData); | 1033 | this.tableData = data.concat(nullData); |
| 1032 | } | 1034 | } |
| 1033 | - this.tableData.forEach((item, index = 0) => { | 1035 | + this.tableSelection = [] |
| 1034 | - item.index = index; | 1036 | + this.cargoTotal() |
| 1035 | - }); | 1037 | + // this.tableData.forEach((item, index = 0) => { |
| 1038 | + // item.index = index; | ||
| 1039 | + // }); | ||
| 1040 | + }, | ||
| 1041 | + sizeChange(val){ | ||
| 1042 | + this.size = val | ||
| 1043 | + this.select(0); | ||
| 1036 | }, | 1044 | }, |
| 1037 | //添加到航班 | 1045 | //添加到航班 |
| 1038 | addFit() { | 1046 | addFit() { |
| ... | @@ -1083,6 +1091,9 @@ export default { | ... | @@ -1083,6 +1091,9 @@ export default { |
| 1083 | }, | 1091 | }, |
| 1084 | }, | 1092 | }, |
| 1085 | }, | 1093 | }, |
| 1094 | + deactivated(){ | ||
| 1095 | + this.tableData = [] | ||
| 1096 | + }, | ||
| 1086 | }; | 1097 | }; |
| 1087 | </script> | 1098 | </script> |
| 1088 | 1099 | ... | ... |
| ... | @@ -28,6 +28,7 @@ | ... | @@ -28,6 +28,7 @@ |
| 28 | :label="item.name" | 28 | :label="item.name" |
| 29 | :key="index" | 29 | :key="index" |
| 30 | :show-overflow-tooltip="true" | 30 | :show-overflow-tooltip="true" |
| 31 | + :formatter="formatter" | ||
| 31 | > | 32 | > |
| 32 | </el-table-column> | 33 | </el-table-column> |
| 33 | </el-table> | 34 | </el-table> |
| ... | @@ -119,7 +120,7 @@ export default { | ... | @@ -119,7 +120,7 @@ export default { |
| 119 | }, | 120 | }, |
| 120 | ], | 121 | ], |
| 121 | }, | 122 | }, |
| 122 | - loading:false | 123 | + loading:false, |
| 123 | }; | 124 | }; |
| 124 | }, | 125 | }, |
| 125 | methods: { | 126 | methods: { |
| ... | @@ -133,7 +134,7 @@ export default { | ... | @@ -133,7 +134,7 @@ export default { |
| 133 | }, | 134 | }, |
| 134 | //确定配舱 | 135 | //确定配舱 |
| 135 | submit() { | 136 | submit() { |
| 136 | - this.loading = true; | 137 | + this.loading= true; |
| 137 | let arr = []; | 138 | let arr = []; |
| 138 | this.tableData.forEach((item) => { | 139 | this.tableData.forEach((item) => { |
| 139 | arr.push(item.id); | 140 | arr.push(item.id); |
| ... | @@ -141,6 +142,7 @@ export default { | ... | @@ -141,6 +142,7 @@ export default { |
| 141 | this.formData.ids = arr; | 142 | this.formData.ids = arr; |
| 142 | if (this.formData.fltNo && this.formData.fltDate) { | 143 | if (this.formData.fltNo && this.formData.fltDate) { |
| 143 | allocationFlight(this.formData).then((res) => { | 144 | allocationFlight(this.formData).then((res) => { |
| 145 | + this.loading = false; | ||
| 144 | //code 200 配舱成功 202 重量已满需要确认 其余code直接输出msg | 146 | //code 200 配舱成功 202 重量已满需要确认 其余code直接输出msg |
| 145 | if (res.code === 200) { | 147 | if (res.code === 200) { |
| 146 | this.$message({ | 148 | this.$message({ |
| ... | @@ -148,7 +150,6 @@ export default { | ... | @@ -148,7 +150,6 @@ export default { |
| 148 | type: "success", | 150 | type: "success", |
| 149 | }); | 151 | }); |
| 150 | this.cleaerForm(); | 152 | this.cleaerForm(); |
| 151 | - this.loading = false; | ||
| 152 | this.$emit("dialogBeforeClose", { close: false, reload: true }); | 153 | this.$emit("dialogBeforeClose", { close: false, reload: true }); |
| 153 | } else if (res.code === 202) { | 154 | } else if (res.code === 202) { |
| 154 | MessageBox.confirm(res.msg, "提示", { | 155 | MessageBox.confirm(res.msg, "提示", { |
| ... | @@ -210,6 +211,16 @@ export default { | ... | @@ -210,6 +211,16 @@ export default { |
| 210 | this.cleaerForm(); | 211 | this.cleaerForm(); |
| 211 | this.$emit("dialogBeforeClose", { close: false, reload: true }); | 212 | this.$emit("dialogBeforeClose", { close: false, reload: true }); |
| 212 | }, | 213 | }, |
| 214 | + formatter(row, column, cellValue, index){ | ||
| 215 | + if(column.property == "cargoRulesStatus"){ | ||
| 216 | + if(cellValue == 1){ | ||
| 217 | + return "手动" | ||
| 218 | + }else{ | ||
| 219 | + return "自动" | ||
| 220 | + } | ||
| 221 | + } | ||
| 222 | + return cellValue | ||
| 223 | + } | ||
| 213 | }, | 224 | }, |
| 214 | computed: { | 225 | computed: { |
| 215 | fltNo: { | 226 | fltNo: { | ... | ... |
| ... | @@ -37,6 +37,7 @@ | ... | @@ -37,6 +37,7 @@ |
| 37 | type="primary" | 37 | type="primary" |
| 38 | icon="el-icon-plus" | 38 | icon="el-icon-plus" |
| 39 | size="mini" | 39 | size="mini" |
| 40 | + v-hasPermi="['allocation:alloc:add']" | ||
| 40 | @click=" | 41 | @click=" |
| 41 | $router.push({ | 42 | $router.push({ |
| 42 | name: 'FlightAllocConfigAdd', | 43 | name: 'FlightAllocConfigAdd', |
| ... | @@ -90,6 +91,7 @@ | ... | @@ -90,6 +91,7 @@ |
| 90 | type="text" | 91 | type="text" |
| 91 | size="mini" | 92 | size="mini" |
| 92 | icon="el-icon-edit" | 93 | icon="el-icon-edit" |
| 94 | + v-hasPermi="['allocation:alloc:update']" | ||
| 93 | @click="handleClick(scope.row.id, 'update')" | 95 | @click="handleClick(scope.row.id, 'update')" |
| 94 | >修改</el-button | 96 | >修改</el-button |
| 95 | > | 97 | > |
| ... | @@ -97,6 +99,7 @@ | ... | @@ -97,6 +99,7 @@ |
| 97 | type="text" | 99 | type="text" |
| 98 | size="mini" | 100 | size="mini" |
| 99 | icon="el-icon-delete" | 101 | icon="el-icon-delete" |
| 102 | + v-hasPermi="['allocation:alloc:delete']" | ||
| 100 | @click="del(scope.row.id, scope.row.status)" | 103 | @click="del(scope.row.id, scope.row.status)" |
| 101 | >删除</el-button | 104 | >删除</el-button |
| 102 | > | 105 | > |
| ... | @@ -104,6 +107,7 @@ | ... | @@ -104,6 +107,7 @@ |
| 104 | type="text" | 107 | type="text" |
| 105 | size="mini" | 108 | size="mini" |
| 106 | icon="el-icon-video-pause" | 109 | icon="el-icon-video-pause" |
| 110 | + v-hasPermi="['allocation:alloc:openClose']" | ||
| 107 | @click="changeStatus(scope.row.id, 3)" | 111 | @click="changeStatus(scope.row.id, 3)" |
| 108 | v-if="scope.row.status == '1'" | 112 | v-if="scope.row.status == '1'" |
| 109 | >停用</el-button | 113 | >停用</el-button |
| ... | @@ -112,6 +116,7 @@ | ... | @@ -112,6 +116,7 @@ |
| 112 | type="text" | 116 | type="text" |
| 113 | size="mini" | 117 | size="mini" |
| 114 | icon="el-icon-video-play" | 118 | icon="el-icon-video-play" |
| 119 | + v-hasPermi="['allocation:alloc:openClose']" | ||
| 115 | @click="changeStatus(scope.row.id, 1)" | 120 | @click="changeStatus(scope.row.id, 1)" |
| 116 | v-else | 121 | v-else |
| 117 | >启用</el-button | 122 | >启用</el-button |
| ... | @@ -159,9 +164,17 @@ export default { | ... | @@ -159,9 +164,17 @@ export default { |
| 159 | loading: false, | 164 | loading: false, |
| 160 | }; | 165 | }; |
| 161 | }, | 166 | }, |
| 167 | + created() { | ||
| 168 | + if(this.$store.state.tagsView.cachedViews.length == 0){ | ||
| 169 | + this.getList(); | ||
| 170 | + } | ||
| 171 | + }, | ||
| 162 | activated(){ | 172 | activated(){ |
| 163 | this.getList() | 173 | this.getList() |
| 164 | }, | 174 | }, |
| 175 | + deactivated(){ | ||
| 176 | + this.flyList = [] | ||
| 177 | + }, | ||
| 165 | methods: { | 178 | methods: { |
| 166 | getList() { | 179 | getList() { |
| 167 | this.queryParams.limit = this.limit; | 180 | this.queryParams.limit = this.limit; |
| ... | @@ -240,9 +253,6 @@ export default { | ... | @@ -240,9 +253,6 @@ export default { |
| 240 | }); | 253 | }); |
| 241 | }, | 254 | }, |
| 242 | }, | 255 | }, |
| 243 | - created() { | ||
| 244 | - this.getList(); | ||
| 245 | - }, | ||
| 246 | computed: { | 256 | computed: { |
| 247 | purposeOfFlightNo: { | 257 | purposeOfFlightNo: { |
| 248 | get: function () { | 258 | get: function () { | ... | ... |
| 1 | <template> | 1 | <template> |
| 2 | <div> | 2 | <div> |
| 3 | - <el-form :model="queryParams" ref="queryForm" :inline="true"> | 3 | + <el-form |
| 4 | - <el-form-item label="ACCS原航班"> | 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 | + > | ||
| 12 | + <el-form-item label="原航班"> | ||
| 5 | <el-input | 13 | <el-input |
| 6 | type="text" | 14 | type="text" |
| 7 | v-model="upCase" | 15 | v-model="upCase" |
| 8 | - placeholder="请输入ACCS原航班" | 16 | + placeholder="请输入原航班" |
| 9 | clearable | 17 | clearable |
| 10 | - class="formItem" | ||
| 11 | ></el-input> | 18 | ></el-input> |
| 12 | <!-- <el-input v-model="upCase" placeholder="请输入原航班" clearable size="small" /> --> | 19 | <!-- <el-input v-model="upCase" placeholder="请输入原航班" clearable size="small" /> --> |
| 13 | </el-form-item> | 20 | </el-form-item> |
| 14 | <el-form-item label="状态" prop="status"> | 21 | <el-form-item label="状态" prop="status"> |
| 15 | - <el-select | 22 | + <el-select v-model="queryParams.status" placeholder="请选择" clearable> |
| 16 | - v-model="queryParams.status" | ||
| 17 | - placeholder="请选择" | ||
| 18 | - clearable | ||
| 19 | - size="small" | ||
| 20 | - > | ||
| 21 | <el-option | 23 | <el-option |
| 22 | v-for="dict in statusList" | 24 | v-for="dict in statusList" |
| 23 | :key="dict.id" | 25 | :key="dict.id" |
| ... | @@ -33,7 +35,7 @@ | ... | @@ -33,7 +35,7 @@ |
| 33 | icon="el-icon-search" | 35 | icon="el-icon-search" |
| 34 | size="mini" | 36 | size="mini" |
| 35 | @click="handleQuery" | 37 | @click="handleQuery" |
| 36 | - >查询ACCS原航班配置</el-button | 38 | + >查询原航班配置</el-button |
| 37 | > | 39 | > |
| 38 | </el-form-item> | 40 | </el-form-item> |
| 39 | <br /> | 41 | <br /> |
| ... | @@ -43,7 +45,6 @@ | ... | @@ -43,7 +45,6 @@ |
| 43 | v-model="queryParams.flightDate" | 45 | v-model="queryParams.flightDate" |
| 44 | type="date" | 46 | type="date" |
| 45 | placeholder="选择日期" | 47 | placeholder="选择日期" |
| 46 | - clearable | ||
| 47 | > | 48 | > |
| 48 | </el-date-picker> | 49 | </el-date-picker> |
| 49 | </el-form-item> | 50 | </el-form-item> |
| ... | @@ -56,22 +57,18 @@ | ... | @@ -56,22 +57,18 @@ |
| 56 | @click="findSourceFlightAndFlightDate" | 57 | @click="findSourceFlightAndFlightDate" |
| 57 | >查询实际配载航班 </el-button | 58 | >查询实际配载航班 </el-button |
| 58 | >  | 59 | >  |
| 59 | - <span style="color: #ff4949" | 60 | + <span style="color:#ff4949">注:原航班+日期查询该日期的航班实际情况</span> |
| 60 | - >注:ACCS原航班+日期查询该日期的航班实际情况</span | ||
| 61 | - > | ||
| 62 | </el-form-item> | 61 | </el-form-item> |
| 63 | <br /> | 62 | <br /> |
| 64 | <el-form-item> | 63 | <el-form-item> |
| 65 | - <el-col :span="1.5"> | ||
| 66 | <el-button | 64 | <el-button |
| 67 | type="primary" | 65 | type="primary" |
| 68 | icon="el-icon-plus" | 66 | icon="el-icon-plus" |
| 69 | size="mini" | 67 | size="mini" |
| 68 | + v-hasPermi="['allocation:rand:add']" | ||
| 70 | @click="handleAdd" | 69 | @click="handleAdd" |
| 71 | >添加规则</el-button | 70 | >添加规则</el-button |
| 72 | > | 71 | > |
| 73 | - </el-col> | ||
| 74 | -   | ||
| 75 | <el-button icon="el-icon-refresh" size="mini" @click="resetQuery" | 72 | <el-button icon="el-icon-refresh" size="mini" @click="resetQuery" |
| 76 | >重置</el-button | 73 | >重置</el-button |
| 77 | > | 74 | > |
| ... | @@ -90,18 +87,13 @@ | ... | @@ -90,18 +87,13 @@ |
| 90 | <el-table-column type="index" label="序号" align="center"> | 87 | <el-table-column type="index" label="序号" align="center"> |
| 91 | <template slot-scope="scope">{{ scope.$index + 1 }}</template> | 88 | <template slot-scope="scope">{{ scope.$index + 1 }}</template> |
| 92 | </el-table-column> | 89 | </el-table-column> |
| 93 | - <el-table-column | 90 | + <el-table-column label="原航班" align="center" prop="sourceFlightNo" /> |
| 94 | - label="ACCS原航班" | ||
| 95 | - align="center" | ||
| 96 | - prop="sourceFlightNo" | ||
| 97 | - /> | ||
| 98 | <el-table-column | 91 | <el-table-column |
| 99 | label="配载航班排序" | 92 | label="配载航班排序" |
| 100 | align="center" | 93 | align="center" |
| 101 | prop="flightRank" | 94 | prop="flightRank" |
| 102 | width="280" | 95 | width="280" |
| 103 | /> | 96 | /> |
| 104 | - <!-- <el-table-column label="优先级" align="center" prop="priority" /> --> | ||
| 105 | <el-table-column | 97 | <el-table-column |
| 106 | label="周期" | 98 | label="周期" |
| 107 | align="center" | 99 | align="center" |
| ... | @@ -150,6 +142,7 @@ | ... | @@ -150,6 +142,7 @@ |
| 150 | size="mini" | 142 | size="mini" |
| 151 | type="text" | 143 | type="text" |
| 152 | icon="el-icon-edit" | 144 | icon="el-icon-edit" |
| 145 | + v-hasPermi="['allocation:rand:update']" | ||
| 153 | @click="handleUpdate(scope.row)" | 146 | @click="handleUpdate(scope.row)" |
| 154 | >修改</el-button | 147 | >修改</el-button |
| 155 | > | 148 | > |
| ... | @@ -157,6 +150,7 @@ | ... | @@ -157,6 +150,7 @@ |
| 157 | size="mini" | 150 | size="mini" |
| 158 | type="text" | 151 | type="text" |
| 159 | icon="el-icon-delete" | 152 | icon="el-icon-delete" |
| 153 | + v-hasPermi="['allocation:rand:delete']" | ||
| 160 | @click="handleDeleteorPlayorpause(scope.row, 0, '删除')" | 154 | @click="handleDeleteorPlayorpause(scope.row, 0, '删除')" |
| 161 | > | 155 | > |
| 162 | 删除</el-button | 156 | 删除</el-button |
| ... | @@ -166,6 +160,7 @@ | ... | @@ -166,6 +160,7 @@ |
| 166 | type="text" | 160 | type="text" |
| 167 | icon="el-icon-video-play" | 161 | icon="el-icon-video-play" |
| 168 | v-if="scope.row.status == '3'" | 162 | v-if="scope.row.status == '3'" |
| 163 | + v-hasPermi="['allocation:rand:openClose']" | ||
| 169 | @click="handleDeleteorPlayorpause(scope.row, 1, '启用')" | 164 | @click="handleDeleteorPlayorpause(scope.row, 1, '启用')" |
| 170 | >启用</el-button | 165 | >启用</el-button |
| 171 | > | 166 | > |
| ... | @@ -174,6 +169,7 @@ | ... | @@ -174,6 +169,7 @@ |
| 174 | type="text" | 169 | type="text" |
| 175 | icon="el-icon-video-pause" | 170 | icon="el-icon-video-pause" |
| 176 | v-if="scope.row.status != '3'" | 171 | v-if="scope.row.status != '3'" |
| 172 | + v-hasPermi="['allocation:rand:openClose']" | ||
| 177 | @click="handleDeleteorPlayorpause(scope.row, 3, '停用')" | 173 | @click="handleDeleteorPlayorpause(scope.row, 3, '停用')" |
| 178 | >停用</el-button | 174 | >停用</el-button |
| 179 | > | 175 | > |
| ... | @@ -202,11 +198,7 @@ | ... | @@ -202,11 +198,7 @@ |
| 202 | <el-table-column type="index" label="序号" align="center"> | 198 | <el-table-column type="index" label="序号" align="center"> |
| 203 | <template slot-scope="scope">{{ scope.$index + 1 }}</template> | 199 | <template slot-scope="scope">{{ scope.$index + 1 }}</template> |
| 204 | </el-table-column> | 200 | </el-table-column> |
| 205 | - <el-table-column | 201 | + <el-table-column label="原航班" align="center" prop="sourceFlightNo" /> |
| 206 | - label="ACCS原航班" | ||
| 207 | - align="center" | ||
| 208 | - prop="sourceFlightNo" | ||
| 209 | - /> | ||
| 210 | <el-table-column | 202 | <el-table-column |
| 211 | label="实际配载航班" | 203 | label="实际配载航班" |
| 212 | align="center" | 204 | align="center" |
| ... | @@ -244,17 +236,42 @@ | ... | @@ -244,17 +236,42 @@ |
| 244 | :append-to-body="true" | 236 | :append-to-body="true" |
| 245 | :close-on-click-modal="false" | 237 | :close-on-click-modal="false" |
| 246 | > | 238 | > |
| 247 | - <el-form ref="form" :model="form" :rules="rules" label-width="100px"> | 239 | + <el-form |
| 240 | + ref="form" | ||
| 241 | + :model="form" | ||
| 242 | + :rules="rules" | ||
| 243 | + label-position="right" | ||
| 244 | + label-width="auto" | ||
| 245 | + > | ||
| 248 | <el-row> | 246 | <el-row> |
| 249 | - <el-col :span="10"> | 247 | + <el-col :span="8"> |
| 250 | - <el-form-item label="ACCS原航班" prop="sourceFlightNo"> | 248 | + <el-form-item label="原航班" prop="sourceFlightNo"> |
| 251 | <el-input | 249 | <el-input |
| 252 | v-model="form.sourceFlightNo" | 250 | v-model="form.sourceFlightNo" |
| 253 | - placeholder="请输入ACCS原航班号" | 251 | + placeholder="请输入原航班号" |
| 254 | maxlength="10" | 252 | maxlength="10" |
| 255 | /> | 253 | /> |
| 256 | </el-form-item> | 254 | </el-form-item> |
| 257 | </el-col> | 255 | </el-col> |
| 256 | + | ||
| 257 | + <el-col :span="8"> | ||
| 258 | + <el-form-item label="口岸" prop="portName"> | ||
| 259 | + <el-select | ||
| 260 | + :disabled="true" | ||
| 261 | + v-model="form.portName" | ||
| 262 | + size="mini" | ||
| 263 | + placeholder="选择口岸" | ||
| 264 | + > | ||
| 265 | + <el-option | ||
| 266 | + v-for="item in portNameList" | ||
| 267 | + :label="item" | ||
| 268 | + :value="item" | ||
| 269 | + :key="item" | ||
| 270 | + > | ||
| 271 | + </el-option> | ||
| 272 | + </el-select> | ||
| 273 | + </el-form-item> | ||
| 274 | + </el-col> | ||
| 258 | </el-row> | 275 | </el-row> |
| 259 | <el-row> | 276 | <el-row> |
| 260 | <el-col :span="8"> | 277 | <el-col :span="8"> |
| ... | @@ -287,10 +304,10 @@ | ... | @@ -287,10 +304,10 @@ |
| 287 | </el-col> | 304 | </el-col> |
| 288 | 305 | ||
| 289 | <el-col :span="24" style="margin-bottom: 5%"> | 306 | <el-col :span="24" style="margin-bottom: 5%"> |
| 290 | - <span style="color:#ff4949; margin-left: 10%" | 307 | + <span style="color: #ff4949; margin-left: 10%" |
| 291 | >提示:配载航班之间请用分号分隔【符号不区分中英文】,例:CA1053;C7433</span | 308 | >提示:配载航班之间请用分号分隔【符号不区分中英文】,例:CA1053;C7433</span |
| 292 | ><br /> | 309 | ><br /> |
| 293 | - <span style="color:#ff4949; margin-left: 10%" | 310 | + <span style="color: #ff4949; margin-left: 10%" |
| 294 | >提示:如果需要设置配载航班延迟或提前可以直接在目的航斑后加减【+-】天数。如:CA1053+1;CZ433-1</span | 311 | >提示:如果需要设置配载航班延迟或提前可以直接在目的航斑后加减【+-】天数。如:CA1053+1;CZ433-1</span |
| 295 | > | 312 | > |
| 296 | </el-col> | 313 | </el-col> |
| ... | @@ -335,6 +352,7 @@ export default { | ... | @@ -335,6 +352,7 @@ export default { |
| 335 | name: "FlightRandConfig", | 352 | name: "FlightRandConfig", |
| 336 | data() { | 353 | data() { |
| 337 | return { | 354 | return { |
| 355 | + portNameList: [], | ||
| 338 | // data 中设定 | 356 | // data 中设定 |
| 339 | pickerOptionsStart: { | 357 | pickerOptionsStart: { |
| 340 | disabledDate: (time) => { | 358 | disabledDate: (time) => { |
| ... | @@ -359,7 +377,6 @@ export default { | ... | @@ -359,7 +377,6 @@ export default { |
| 359 | } | 377 | } |
| 360 | }, | 378 | }, |
| 361 | }, | 379 | }, |
| 362 | - | ||
| 363 | //周期段 | 380 | //周期段 |
| 364 | dayOfWeekList: ["D1", "D2", "D3", "D4", "D5", "D6", "D7"], | 381 | dayOfWeekList: ["D1", "D2", "D3", "D4", "D5", "D6", "D7"], |
| 365 | // 遮罩层 | 382 | // 遮罩层 |
| ... | @@ -390,6 +407,7 @@ export default { | ... | @@ -390,6 +407,7 @@ export default { |
| 390 | openFlightDate: false, | 407 | openFlightDate: false, |
| 391 | // 查询参数 | 408 | // 查询参数 |
| 392 | queryParams: { | 409 | queryParams: { |
| 410 | + portName: undefined, | ||
| 393 | start: 0, //当前条数【代表第几条数据 +1开始】 | 411 | start: 0, //当前条数【代表第几条数据 +1开始】 |
| 394 | pageNum: 1, | 412 | pageNum: 1, |
| 395 | limit: 20, //一页显示多少条数据 | 413 | limit: 20, //一页显示多少条数据 |
| ... | @@ -422,8 +440,26 @@ export default { | ... | @@ -422,8 +440,26 @@ export default { |
| 422 | }; | 440 | }; |
| 423 | }, | 441 | }, |
| 424 | created() { | 442 | created() { |
| 443 | + this.queryParams.portName = this.$store.state.user.activePortName; | ||
| 444 | + this.portNameList = this.$store.state.user.portNames; | ||
| 445 | + if(this.$store.state.tagsView.cachedViews.length == 0){ | ||
| 446 | + this.findSourceFlightRules(); | ||
| 447 | + } | ||
| 448 | + }, | ||
| 449 | + activated(){ | ||
| 425 | this.findSourceFlightRules(); | 450 | this.findSourceFlightRules(); |
| 426 | }, | 451 | }, |
| 452 | + deactivated(){ | ||
| 453 | + this.sourceFlightRulesList = [] | ||
| 454 | + }, | ||
| 455 | + watch:{ | ||
| 456 | + open(val,oldVal){ | ||
| 457 | + if(val){ | ||
| 458 | + this.queryParams.portName = this.$store.state.user.activePortName; | ||
| 459 | + this.form.portName = this.$store.state.user.activePortName; | ||
| 460 | + } | ||
| 461 | + } | ||
| 462 | + }, | ||
| 427 | methods: { | 463 | methods: { |
| 428 | //跳转到查看,修改页面 | 464 | //跳转到查看,修改页面 |
| 429 | handleClick(flightiId, handle) { | 465 | handleClick(flightiId, handle) { |
| ... | @@ -459,16 +495,17 @@ export default { | ... | @@ -459,16 +495,17 @@ export default { |
| 459 | handleAdd() { | 495 | handleAdd() { |
| 460 | this.form = {}; | 496 | this.form = {}; |
| 461 | this.open = true; | 497 | this.open = true; |
| 462 | - this.title = "添加ACCS原航班顺位规则"; | 498 | + this.title = "添加原航班顺位规则"; |
| 463 | this.form.id = -1; | 499 | this.form.id = -1; |
| 464 | this.dayOfWeek = []; | 500 | this.dayOfWeek = []; |
| 501 | + this.form.portName = this.$store.state.user.activePortName; | ||
| 465 | }, | 502 | }, |
| 466 | /** 修改按钮操作 */ | 503 | /** 修改按钮操作 */ |
| 467 | handleUpdate(row) { | 504 | handleUpdate(row) { |
| 468 | this.form = {}; | 505 | this.form = {}; |
| 469 | this.dayOfWeek = []; | 506 | this.dayOfWeek = []; |
| 470 | this.open = true; | 507 | this.open = true; |
| 471 | - this.title = "修改ACCS原航班顺位规则"; | 508 | + this.title = "修改原航班顺位规则"; |
| 472 | this.form = JSON.parse(JSON.stringify(row)); | 509 | this.form = JSON.parse(JSON.stringify(row)); |
| 473 | this.dayOfWeek = this.form.dayOfWeek | 510 | this.dayOfWeek = this.form.dayOfWeek |
| 474 | ? this.form.dayOfWeek.split(";") | 511 | ? this.form.dayOfWeek.split(";") |
| ... | @@ -490,12 +527,15 @@ export default { | ... | @@ -490,12 +527,15 @@ export default { |
| 490 | confirmButtonText: "确定", | 527 | confirmButtonText: "确定", |
| 491 | cancelButtonText: "取消", | 528 | cancelButtonText: "取消", |
| 492 | type: "warning", | 529 | type: "warning", |
| 493 | - }).then(() => { | 530 | + }) |
| 531 | + .then(() => { | ||
| 494 | let disable = { | 532 | let disable = { |
| 495 | id: row.id, | 533 | id: row.id, |
| 496 | status: status, | 534 | status: status, |
| 497 | }; | 535 | }; |
| 498 | - delOrEnableORDisableApi(disable) | 536 | + |
| 537 | + return delOrEnableORDisableApi(disable); | ||
| 538 | + }) | ||
| 499 | .then((response) => { | 539 | .then((response) => { |
| 500 | if (response.code == 200) { | 540 | if (response.code == 200) { |
| 501 | this.findSourceFlightRules(); | 541 | this.findSourceFlightRules(); |
| ... | @@ -505,7 +545,6 @@ export default { | ... | @@ -505,7 +545,6 @@ export default { |
| 505 | } | 545 | } |
| 506 | }) | 546 | }) |
| 507 | .catch(() => {}); | 547 | .catch(() => {}); |
| 508 | - }); | ||
| 509 | }, | 548 | }, |
| 510 | /** 提交按钮 */ | 549 | /** 提交按钮 */ |
| 511 | submitForm: function () { | 550 | submitForm: function () { | ... | ... |
| ... | @@ -108,6 +108,7 @@ | ... | @@ -108,6 +108,7 @@ |
| 108 | :loading="downLoadingTip.downloading" | 108 | :loading="downLoadingTip.downloading" |
| 109 | icon="el-icon-download" | 109 | icon="el-icon-download" |
| 110 | size="mini" | 110 | size="mini" |
| 111 | + v-hasPermi="['base:caExport:export']" | ||
| 111 | >{{ | 112 | >{{ |
| 112 | downLoadingTip.downloading ? downLoadingTip.tip : "导出" | 113 | downLoadingTip.downloading ? downLoadingTip.tip : "导出" |
| 113 | }}</el-button | 114 | }}</el-button |
| ... | @@ -178,7 +179,7 @@ | ... | @@ -178,7 +179,7 @@ |
| 178 | 179 | ||
| 179 | <script> | 180 | <script> |
| 180 | import { findCagroPreData } from "@/api/cargoSelect"; | 181 | import { findCagroPreData } from "@/api/cargoSelect"; |
| 181 | -import { cargoXlsxPre } from "@/utils/zipdownload"; | 182 | +import { downLoadXlsx } from "@/utils/zipdownload"; |
| 182 | export default { | 183 | export default { |
| 183 | name: "CAPreQualificationExport", | 184 | name: "CAPreQualificationExport", |
| 184 | data() { | 185 | data() { |
| ... | @@ -232,7 +233,7 @@ export default { | ... | @@ -232,7 +233,7 @@ export default { |
| 232 | ); | 233 | ); |
| 233 | cargoXlse.cargoExportPreQueryDto.limitStart = 0; | 234 | cargoXlse.cargoExportPreQueryDto.limitStart = 0; |
| 234 | cargoXlse.cargoExportPreQueryDto.limitSize = -1; | 235 | cargoXlse.cargoExportPreQueryDto.limitSize = -1; |
| 235 | - cargoXlsxPre("/cargo/excelPre", cargoXlse) | 236 | + downLoadXlsx("/cargo/excelPre", cargoXlse,'航班预审表') |
| 236 | .then(() => { | 237 | .then(() => { |
| 237 | this.downLoadingTip.downloading = false; | 238 | this.downLoadingTip.downloading = false; |
| 238 | this.downLoadingTip.tip = ""; | 239 | this.downLoadingTip.tip = ""; | ... | ... |
| ... | @@ -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> | ... | ... |
This diff is collapsed. Click to expand it.
| ... | @@ -19,14 +19,13 @@ | ... | @@ -19,14 +19,13 @@ |
| 19 | start-placeholder="开始日期" | 19 | start-placeholder="开始日期" |
| 20 | end-placeholder="结束日期" | 20 | end-placeholder="结束日期" |
| 21 | :value-format="valueFormat" | 21 | :value-format="valueFormat" |
| 22 | - clearable | ||
| 23 | > | 22 | > |
| 24 | </el-date-picker> | 23 | </el-date-picker> |
| 25 | </el-form-item> | 24 | </el-form-item> |
| 26 | </el-col> | 25 | </el-col> |
| 27 | <el-col :span="6"> | 26 | <el-col :span="6"> |
| 28 | <el-form-item label="配载航班号"> | 27 | <el-form-item label="配载航班号"> |
| 29 | - <el-input type="textarea" v-model="cargoPlaneNo" class="formItem" placeholder="AC001;AC002" :autosize="true" clearable></el-input> | 28 | + <el-input type="textarea" v-model="cargoPlaneNo" class="formItem" placeholder="AC001;AC002" :autosize="true"></el-input> |
| 30 | </el-form-item> | 29 | </el-form-item> |
| 31 | </el-col> | 30 | </el-col> |
| 32 | <el-col :span="6"> | 31 | <el-col :span="6"> |
| ... | @@ -56,7 +55,6 @@ | ... | @@ -56,7 +55,6 @@ |
| 56 | class="formItem" | 55 | class="formItem" |
| 57 | placeholder="请输入运单号(回车间隔)" | 56 | placeholder="请输入运单号(回车间隔)" |
| 58 | :autosize="true" | 57 | :autosize="true" |
| 59 | - clearable | ||
| 60 | ></el-input> | 58 | ></el-input> |
| 61 | </el-form-item> | 59 | </el-form-item> |
| 62 | </el-col> | 60 | </el-col> |
| ... | @@ -105,7 +103,6 @@ | ... | @@ -105,7 +103,6 @@ |
| 105 | class="formItem" | 103 | class="formItem" |
| 106 | placeholder="S_;P_;E2" | 104 | placeholder="S_;P_;E2" |
| 107 | :autosize="true" | 105 | :autosize="true" |
| 108 | - clearable | ||
| 109 | ></el-input> | 106 | ></el-input> |
| 110 | </el-form-item> | 107 | </el-form-item> |
| 111 | </el-col> | 108 | </el-col> |
| ... | @@ -117,7 +114,6 @@ | ... | @@ -117,7 +114,6 @@ |
| 117 | class="formItem" | 114 | class="formItem" |
| 118 | placeholder="PVG;PEK" | 115 | placeholder="PVG;PEK" |
| 119 | :autosize="true" | 116 | :autosize="true" |
| 120 | - clearable | ||
| 121 | ></el-input> | 117 | ></el-input> |
| 122 | </el-form-item> | 118 | </el-form-item> |
| 123 | </el-col> | 119 | </el-col> |
| ... | @@ -133,25 +129,22 @@ | ... | @@ -133,25 +129,22 @@ |
| 133 | start-placeholder="开始日期" | 129 | start-placeholder="开始日期" |
| 134 | end-placeholder="结束日期" | 130 | end-placeholder="结束日期" |
| 135 | :value-format="valueFormat" | 131 | :value-format="valueFormat" |
| 136 | - clearable | ||
| 137 | > | 132 | > |
| 138 | </el-date-picker> | 133 | </el-date-picker> |
| 139 | </el-form-item> | 134 | </el-form-item> |
| 140 | </el-col> | 135 | </el-col> |
| 141 | <el-col :span="6"> | 136 | <el-col :span="6"> |
| 142 | <el-form-item label="ACCS原航班号"> | 137 | <el-form-item label="ACCS原航班号"> |
| 143 | - <el-input type="text" v-model="fltNo" class="formItem" placeholder="请输入ACCS航班号" clearable></el-input> | 138 | + <el-input type="text" v-model="fltNo" class="formItem" placeholder="请输入ACCS航班号"></el-input> |
| 144 | </el-form-item> | 139 | </el-form-item> |
| 145 | </el-col> | 140 | </el-col> |
| 146 | <el-col :span="6"> | 141 | <el-col :span="6"> |
| 147 | <el-form-item label="取件日期"> | 142 | <el-form-item label="取件日期"> |
| 148 | <el-date-picker | 143 | <el-date-picker |
| 149 | - class="formItem" | ||
| 150 | v-model="formData.pickUpDate" | 144 | v-model="formData.pickUpDate" |
| 151 | type="date" | 145 | type="date" |
| 152 | placeholder="选择日期" | 146 | placeholder="选择日期" |
| 153 | :value-format="valueFormat" | 147 | :value-format="valueFormat" |
| 154 | - clearable | ||
| 155 | > | 148 | > |
| 156 | </el-date-picker> | 149 | </el-date-picker> |
| 157 | </el-form-item> | 150 | </el-form-item> |
| ... | @@ -166,7 +159,6 @@ | ... | @@ -166,7 +159,6 @@ |
| 166 | start-placeholder="开始日期" | 159 | start-placeholder="开始日期" |
| 167 | end-placeholder="结束日期" | 160 | end-placeholder="结束日期" |
| 168 | :value-format="valueFormat" | 161 | :value-format="valueFormat" |
| 169 | - clearable | ||
| 170 | > | 162 | > |
| 171 | </el-date-picker> | 163 | </el-date-picker> |
| 172 | </el-form-item> | 164 | </el-form-item> |
| ... | @@ -223,10 +215,10 @@ | ... | @@ -223,10 +215,10 @@ |
| 223 | @click="select(0)" | 215 | @click="select(0)" |
| 224 | >查询</el-button | 216 | >查询</el-button |
| 225 | > | 217 | > |
| 226 | - <el-button :type="downLoadingTip.downloading?'warning':'primary'" size="small" @click="xlse(0)" :disabled="tableData.length==0" :loading="downLoadingTip.downloading" | 218 | + <el-button :type="downLoadingTip.downloading?'warning':'primary'" size="small" @click="xlse(0)" :disabled="tableData.length==0" :loading="downLoadingTip.downloading" v-hasPermi="['base:cargo:export']" |
| 227 | >{{downLoadingTip.downloading?downLoadingTip.tip:"导出本页查询结果"}}</el-button | 219 | >{{downLoadingTip.downloading?downLoadingTip.tip:"导出本页查询结果"}}</el-button |
| 228 | > | 220 | > |
| 229 | - <el-button :type="downLoadingTip.downloading?'warning':'primary'" size="small" @click="xlse(1)" :disabled="tableData.length==0" :loading="downLoadingTip.downloading" | 221 | + <el-button :type="downLoadingTip.downloading?'warning':'primary'" size="small" @click="xlse(1)" :disabled="tableData.length==0" :loading="downLoadingTip.downloading" v-hasPermi="['base:cargo:export']" |
| 230 | >{{downLoadingTip.downloading?downLoadingTip.tip:"导出全部查询结果"}}</el-button | 222 | >{{downLoadingTip.downloading?downLoadingTip.tip:"导出全部查询结果"}}</el-button |
| 231 | > | 223 | > |
| 232 | <span style="marginLeft:20px;color:#ffba00">全部导出上限80000条数据</span> | 224 | <span style="marginLeft:20px;color:#ffba00">全部导出上限80000条数据</span> |
| ... | @@ -248,7 +240,7 @@ | ... | @@ -248,7 +240,7 @@ |
| 248 | :limitStart="limitStart" | 240 | :limitStart="limitStart" |
| 249 | :page="page" | 241 | :page="page" |
| 250 | :shiftKey="shiftKey" | 242 | :shiftKey="shiftKey" |
| 251 | - height="550" | 243 | + :height="tableHeight" |
| 252 | @tableSelect="tableSelect" | 244 | @tableSelect="tableSelect" |
| 253 | @tableSelectAll="tableSelectAll" | 245 | @tableSelectAll="tableSelectAll" |
| 254 | @currentChange="currentChange" | 246 | @currentChange="currentChange" |
| ... | @@ -319,7 +311,7 @@ export default { | ... | @@ -319,7 +311,7 @@ export default { |
| 319 | type: "", | 311 | type: "", |
| 320 | name: "口岸代码", | 312 | name: "口岸代码", |
| 321 | value: "portName", | 313 | value: "portName", |
| 322 | - width: "100", | 314 | + width: "120", |
| 323 | align: "center", | 315 | align: "center", |
| 324 | sorTable: true, | 316 | sorTable: true, |
| 325 | fixed: false, | 317 | fixed: false, |
| ... | @@ -359,7 +351,7 @@ export default { | ... | @@ -359,7 +351,7 @@ export default { |
| 359 | type: "", | 351 | type: "", |
| 360 | name: "运单号", | 352 | name: "运单号", |
| 361 | value: "waybillNo", | 353 | value: "waybillNo", |
| 362 | - width: "120", | 354 | + width: "150", |
| 363 | align: "center", | 355 | align: "center", |
| 364 | sorTable: true, | 356 | sorTable: true, |
| 365 | fixed: false, | 357 | fixed: false, |
| ... | @@ -369,7 +361,7 @@ export default { | ... | @@ -369,7 +361,7 @@ export default { |
| 369 | type: "", | 361 | type: "", |
| 370 | name: "总单号", | 362 | name: "总单号", |
| 371 | value: "totalWaybillNo", | 363 | value: "totalWaybillNo", |
| 372 | - width: "120", | 364 | + width: "150", |
| 373 | align: "center", | 365 | align: "center", |
| 374 | sorTable: true, | 366 | sorTable: true, |
| 375 | fixed: false, | 367 | fixed: false, |
| ... | @@ -389,7 +381,7 @@ export default { | ... | @@ -389,7 +381,7 @@ export default { |
| 389 | type: "", | 381 | type: "", |
| 390 | name: "服务代码", | 382 | name: "服务代码", |
| 391 | value: "serviceCode", | 383 | value: "serviceCode", |
| 392 | - width: "100", | 384 | + width: "90", |
| 393 | align: "center", | 385 | align: "center", |
| 394 | sorTable: false, | 386 | sorTable: false, |
| 395 | fixed: false, | 387 | fixed: false, |
| ... | @@ -429,7 +421,7 @@ export default { | ... | @@ -429,7 +421,7 @@ export default { |
| 429 | type: "", | 421 | type: "", |
| 430 | name: "subcategory", | 422 | name: "subcategory", |
| 431 | value: "subCategory", | 423 | value: "subCategory", |
| 432 | - width: "140", | 424 | + width: "150", |
| 433 | align: "center", | 425 | align: "center", |
| 434 | sorTable: true, | 426 | sorTable: true, |
| 435 | fixed: false, | 427 | fixed: false, |
| ... | @@ -499,7 +491,7 @@ export default { | ... | @@ -499,7 +491,7 @@ export default { |
| 499 | type: "", | 491 | type: "", |
| 500 | name: "航班预审意见", | 492 | name: "航班预审意见", |
| 501 | value: "caPretrialOpinion", | 493 | value: "caPretrialOpinion", |
| 502 | - width: "120", | 494 | + width: "140", |
| 503 | align: "center", | 495 | align: "center", |
| 504 | sorTable: false, | 496 | sorTable: false, |
| 505 | fixed: false, | 497 | fixed: false, |
| ... | @@ -519,7 +511,7 @@ export default { | ... | @@ -519,7 +511,7 @@ export default { |
| 519 | type: "", | 511 | type: "", |
| 520 | name: "终配航班号", | 512 | name: "终配航班号", |
| 521 | value: "finalFlightNo", | 513 | value: "finalFlightNo", |
| 522 | - width: "120", | 514 | + width: "130", |
| 523 | align: "center", | 515 | align: "center", |
| 524 | sorTable: true, | 516 | sorTable: true, |
| 525 | fixed: false, | 517 | fixed: false, |
| ... | @@ -529,7 +521,7 @@ export default { | ... | @@ -529,7 +521,7 @@ export default { |
| 529 | type: "", | 521 | type: "", |
| 530 | name: "终配航班日期", | 522 | name: "终配航班日期", |
| 531 | value: "finalFlightTime", | 523 | value: "finalFlightTime", |
| 532 | - width: "140", | 524 | + width: "150", |
| 533 | align: "center", | 525 | align: "center", |
| 534 | sorTable: true, | 526 | sorTable: true, |
| 535 | fixed: false, | 527 | fixed: false, |
| ... | @@ -539,7 +531,7 @@ export default { | ... | @@ -539,7 +531,7 @@ export default { |
| 539 | type: "", | 531 | type: "", |
| 540 | name: "二配航班号", | 532 | name: "二配航班号", |
| 541 | value: "twoMatchFlightNo", | 533 | value: "twoMatchFlightNo", |
| 542 | - width: "120", | 534 | + width: "130", |
| 543 | align: "center", | 535 | align: "center", |
| 544 | sorTable: true, | 536 | sorTable: true, |
| 545 | fixed: false, | 537 | fixed: false, |
| ... | @@ -559,7 +551,7 @@ export default { | ... | @@ -559,7 +551,7 @@ export default { |
| 559 | type: "", | 551 | type: "", |
| 560 | name: "预配航班号", | 552 | name: "预配航班号", |
| 561 | value: "preplanFlightNo", | 553 | value: "preplanFlightNo", |
| 562 | - width: "120", | 554 | + width: "130", |
| 563 | align: "center", | 555 | align: "center", |
| 564 | sorTable: true, | 556 | sorTable: true, |
| 565 | fixed: false, | 557 | fixed: false, |
| ... | @@ -579,7 +571,7 @@ export default { | ... | @@ -579,7 +571,7 @@ export default { |
| 579 | type: "", | 571 | type: "", |
| 580 | name: "ACCS原航班号", | 572 | name: "ACCS原航班号", |
| 581 | value: "fltNoAccs", | 573 | value: "fltNoAccs", |
| 582 | - width: "150", | 574 | + width: "140", |
| 583 | align: "center", | 575 | align: "center", |
| 584 | sorTable: true, | 576 | sorTable: true, |
| 585 | fixed: false, | 577 | fixed: false, |
| ... | @@ -599,7 +591,7 @@ export default { | ... | @@ -599,7 +591,7 @@ export default { |
| 599 | type: "", | 591 | type: "", |
| 600 | name: "ACCS原航线", | 592 | name: "ACCS原航线", |
| 601 | value: "accsFlightRoute", | 593 | value: "accsFlightRoute", |
| 602 | - width: "140", | 594 | + width: "150", |
| 603 | align: "center", | 595 | align: "center", |
| 604 | sorTable: true, | 596 | sorTable: true, |
| 605 | fixed: false, | 597 | fixed: false, |
| ... | @@ -629,7 +621,7 @@ export default { | ... | @@ -629,7 +621,7 @@ export default { |
| 629 | type: "", | 621 | type: "", |
| 630 | name: "发件人账号", | 622 | name: "发件人账号", |
| 631 | value: "shipperAccount", | 623 | value: "shipperAccount", |
| 632 | - width: "120", | 624 | + width: "150", |
| 633 | align: "center", | 625 | align: "center", |
| 634 | sorTable: false, | 626 | sorTable: false, |
| 635 | fixed: false, | 627 | fixed: false, |
| ... | @@ -649,7 +641,7 @@ export default { | ... | @@ -649,7 +641,7 @@ export default { |
| 649 | type: "", | 641 | type: "", |
| 650 | name: "始发地城市名称", | 642 | name: "始发地城市名称", |
| 651 | value: "originCity", | 643 | value: "originCity", |
| 652 | - width: "130", | 644 | + width: "150", |
| 653 | align: "center", | 645 | align: "center", |
| 654 | sorTable: false, | 646 | sorTable: false, |
| 655 | fixed: false, | 647 | fixed: false, |
| ... | @@ -689,7 +681,7 @@ export default { | ... | @@ -689,7 +681,7 @@ export default { |
| 689 | type: "", | 681 | type: "", |
| 690 | name: "大货预审时间", | 682 | name: "大货预审时间", |
| 691 | value: "bigPretrialTime", | 683 | value: "bigPretrialTime", |
| 692 | - width: "120", | 684 | + width: "150", |
| 693 | align: "center", | 685 | align: "center", |
| 694 | sorTable: false, | 686 | sorTable: false, |
| 695 | fixed: false, | 687 | fixed: false, |
| ... | @@ -729,7 +721,7 @@ export default { | ... | @@ -729,7 +721,7 @@ export default { |
| 729 | type: "", | 721 | type: "", |
| 730 | name: "创建时间", | 722 | name: "创建时间", |
| 731 | value: "createTime", | 723 | value: "createTime", |
| 732 | - width: "100", | 724 | + width: "120", |
| 733 | align: "center", | 725 | align: "center", |
| 734 | sorTable: true, | 726 | sorTable: true, |
| 735 | fixed: false, | 727 | fixed: false, |
| ... | @@ -757,6 +749,7 @@ export default { | ... | @@ -757,6 +749,7 @@ export default { |
| 757 | limitSize: 100, //无限制-1 | 749 | limitSize: 100, //无限制-1 |
| 758 | page:1, | 750 | page:1, |
| 759 | progress:0, | 751 | progress:0, |
| 752 | + tableHeight:null, | ||
| 760 | formShow:true, | 753 | formShow:true, |
| 761 | }; | 754 | }; |
| 762 | }, | 755 | }, |
| ... | @@ -774,6 +767,20 @@ export default { | ... | @@ -774,6 +767,20 @@ export default { |
| 774 | }); | 767 | }); |
| 775 | }, | 768 | }, |
| 776 | 769 | ||
| 770 | + activated() { | ||
| 771 | + if(this.$store.state.tagsView.cachedViews.length > 0 ){ | ||
| 772 | + this.$store.state.tagsView.cachedViews.forEach(item=>{ | ||
| 773 | + if(item === 'QueryCargo'){ | ||
| 774 | + this.totalCount>0?this.select():'' | ||
| 775 | + } | ||
| 776 | + }) | ||
| 777 | + } | ||
| 778 | + }, | ||
| 779 | + | ||
| 780 | + deactivated(){ | ||
| 781 | + this.tableData = [] | ||
| 782 | + }, | ||
| 783 | + | ||
| 777 | mounted() { | 784 | mounted() { |
| 778 | window.addEventListener("keydown", (code) => { | 785 | window.addEventListener("keydown", (code) => { |
| 779 | if (code.keyCode === 16 && code.shiftKey) { | 786 | if (code.keyCode === 16 && code.shiftKey) { |
| ... | @@ -785,6 +792,7 @@ export default { | ... | @@ -785,6 +792,7 @@ export default { |
| 785 | this.shiftKey = false; | 792 | this.shiftKey = false; |
| 786 | } | 793 | } |
| 787 | }); | 794 | }); |
| 795 | + this.tableHeight = window.innerHeight - this.$refs.cargoForm.$el.offsetHeight-80 | ||
| 788 | }, | 796 | }, |
| 789 | 797 | ||
| 790 | methods: { | 798 | methods: { | ... | ... |
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 | + watch:{ | ||
| 124 | + dialogVisible(val,oldVal){ | ||
| 125 | + if(val){ | ||
| 126 | + this.menuForm = this.menuData; | ||
| 127 | + } | ||
| 128 | + } | ||
| 129 | + }, | ||
| 130 | + methods: { | ||
| 131 | + handleClose() { | ||
| 132 | + this.$emit("handleClose", false); | ||
| 133 | + }, | ||
| 134 | + selected(val) { | ||
| 135 | + console.log(val); | ||
| 136 | + }, | ||
| 137 | + submit() {}, | ||
| 138 | + }, | ||
| 139 | +}; | ||
| 140 | +</script> | ||
| 141 | + | ||
| 142 | +<style> | ||
| 143 | +</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 | + <template v-for="(item, index) in tableHeader"> | ||
| 23 | + <el-table-column | ||
| 24 | + v-if="item.value === 'menuType'" | ||
| 25 | + :prop="item.value" | ||
| 26 | + :label="item.name" | ||
| 27 | + :key="index" | ||
| 28 | + :align="item.align" | ||
| 29 | + header-align="center" | ||
| 30 | + showOverflowTooltip | ||
| 31 | + :width="item.width" | ||
| 32 | + :formatter="formatter" | ||
| 33 | + > | ||
| 34 | + <template slot-scope="scope"> | ||
| 35 | + <el-tag | ||
| 36 | + :type="scope.row.menuType === 'B' ? '' : 'success'" | ||
| 37 | + disable-transitions | ||
| 38 | + >{{ scope.row.menuType === "B" ? "按钮" : "菜单" }}</el-tag | ||
| 39 | + > | ||
| 40 | + </template> | ||
| 41 | + </el-table-column> | ||
| 42 | + <el-table-column | ||
| 43 | + v-else | ||
| 44 | + :prop="item.value" | ||
| 45 | + :label="item.name" | ||
| 46 | + :key="index" | ||
| 47 | + :align="item.align" | ||
| 48 | + header-align="center" | ||
| 49 | + showOverflowTooltip | ||
| 50 | + :width="item.width" | ||
| 51 | + :formatter="formatter" | ||
| 52 | + > | ||
| 53 | + </el-table-column> | ||
| 54 | + </template> | ||
| 55 | + | ||
| 56 | + <el-table-column | ||
| 57 | + header-align="center" | ||
| 58 | + align="center" | ||
| 59 | + label="操作" | ||
| 60 | + width="auto" | ||
| 61 | + > | ||
| 62 | + <template slot-scope="scope"> | ||
| 63 | + <!-- <el-button type="success" size="mini" @click="buttonClick(scope)">修改</el-button> | ||
| 64 | + <el-button type="primary" size="mini" @click="buttonClick(scope)" | ||
| 65 | + >查看</el-button | ||
| 66 | + > --> | ||
| 67 | + <el-button | ||
| 68 | + :type="scope.row.status == 1 ? 'warning' : 'primary'" | ||
| 69 | + v-hasPermi="['system:menu:openClose']" | ||
| 70 | + size="mini" | ||
| 71 | + @click="menuStatus(scope)" | ||
| 72 | + v-if="scope.row.menuType == 'C'" | ||
| 73 | + >{{ scope.row.status == 1 ? "停用菜单" : "启用菜单" }}</el-button | ||
| 74 | + > | ||
| 75 | + <el-button | ||
| 76 | + type="danger" | ||
| 77 | + size="mini" | ||
| 78 | + v-hasPermi="['system:menu:delete']" | ||
| 79 | + @click="removeMenu(scope)" | ||
| 80 | + v-if="scope.row.menuType == 'C'" | ||
| 81 | + >删除菜单</el-button | ||
| 82 | + > | ||
| 83 | + </template> | ||
| 84 | + </el-table-column> | ||
| 85 | + </el-table> | ||
| 86 | + | ||
| 87 | + <!-- <Tables | ||
| 88 | + ref="newTable" | ||
| 89 | + :data="data" | ||
| 90 | + :headerData="tableHeader" | ||
| 91 | + size="medium" | ||
| 92 | + rowKey="id" | ||
| 93 | + :defaultExpandAll="true" | ||
| 94 | + height="auto" | ||
| 95 | + @tableSelect="tableSelect" | ||
| 96 | + @tableSelectAll="tableSelectAll" | ||
| 97 | + @SelectChange="SelectChange" | ||
| 98 | + > | ||
| 99 | + <el-table-column | ||
| 100 | + header-align="center" | ||
| 101 | + align="center" | ||
| 102 | + label="操作" | ||
| 103 | + width="auto" | ||
| 104 | + > | ||
| 105 | + <template slot-scope="scope"> | ||
| 106 | + <el-button type="primary" size="mini" @click="menuStatus(scope)">{{ | ||
| 107 | + scope.menuStatus == 0 ? "停用" : "启用" | ||
| 108 | + }}</el-button> | ||
| 109 | + <el-button type="danger" size="mini" @click="removeMenu(scope)" | ||
| 110 | + >删除菜单</el-button | ||
| 111 | + > | ||
| 112 | + </template> | ||
| 113 | + </el-table-column> | ||
| 114 | + </Tables> --> | ||
| 115 | + <!-- <Drawer | ||
| 116 | + :dialogVisible="drawer" | ||
| 117 | + :drawerTitle="drawerTitle" | ||
| 118 | + :menuFormDisabled="menuFormDisabled" | ||
| 119 | + :menuData="menuData" | ||
| 120 | + @handleClose="handleClose" | ||
| 121 | + ></Drawer> --> | ||
| 122 | + </div> | ||
| 123 | +</template> | ||
| 124 | + | ||
| 125 | +<script> | ||
| 126 | +import { getAllAuth, updateStatus } from "@/api/system/user.js"; | ||
| 127 | +import dictLabels from "@/assets/languages/dictLabels.js"; | ||
| 128 | +import Drawer from "./drawer.vue"; | ||
| 129 | +import { MessageBox } from "element-ui"; | ||
| 130 | +export default { | ||
| 131 | + name: "MenuConfig", | ||
| 132 | + components: { | ||
| 133 | + Drawer, | ||
| 134 | + }, | ||
| 135 | + data() { | ||
| 136 | + return { | ||
| 137 | + drawer: false, | ||
| 138 | + menuFormDisabled: false, | ||
| 139 | + loading: false, | ||
| 140 | + drawerTitle: "", | ||
| 141 | + menuData: {}, | ||
| 142 | + data: [], | ||
| 143 | + tableHeader: [ | ||
| 144 | + { | ||
| 145 | + name: "菜单名", | ||
| 146 | + value: "title", | ||
| 147 | + width: "200", | ||
| 148 | + align: "left", | ||
| 149 | + sorTable: false, | ||
| 150 | + }, | ||
| 151 | + { | ||
| 152 | + name: "菜单类型", | ||
| 153 | + value: "menuType", | ||
| 154 | + width: "100", | ||
| 155 | + align: "center", | ||
| 156 | + sortable: false, | ||
| 157 | + }, | ||
| 158 | + { | ||
| 159 | + name: "权限标识", | ||
| 160 | + value: "permissionKey", | ||
| 161 | + width: "auto", | ||
| 162 | + align: "left", | ||
| 163 | + sortable: false, | ||
| 164 | + }, | ||
| 165 | + { | ||
| 166 | + name: "菜单状态", | ||
| 167 | + value: "status", | ||
| 168 | + width: "100", | ||
| 169 | + align: "center", | ||
| 170 | + sorTable: false, | ||
| 171 | + }, | ||
| 172 | + { | ||
| 173 | + name: "菜单路由", | ||
| 174 | + value: "path", | ||
| 175 | + width: "auto", | ||
| 176 | + align: "left", | ||
| 177 | + sorTable: false, | ||
| 178 | + }, | ||
| 179 | + ], | ||
| 180 | + }; | ||
| 181 | + }, | ||
| 182 | + created() { | ||
| 183 | + if (this.$store.state.tagsView.cachedViews.length == 0) { | ||
| 184 | + this.menuAll(); | ||
| 185 | + } | ||
| 186 | + }, | ||
| 187 | + activated() { | ||
| 188 | + this.menuAll(); | ||
| 189 | + }, | ||
| 190 | + deactivated() { | ||
| 191 | + this.data = []; | ||
| 192 | + }, | ||
| 193 | + methods: { | ||
| 194 | + addMenu() { | ||
| 195 | + this.menuData = {}; | ||
| 196 | + this.drawer = true; | ||
| 197 | + this.drawerTitle = "新增菜单"; | ||
| 198 | + this.menuFormDisabled = false; | ||
| 199 | + }, | ||
| 200 | + | ||
| 201 | + //关闭 | ||
| 202 | + handleClose(val) { | ||
| 203 | + this.drawer = val; | ||
| 204 | + }, | ||
| 205 | + | ||
| 206 | + buttonClick(row) { | ||
| 207 | + this.menuData = row.row; | ||
| 208 | + this.drawer = true; | ||
| 209 | + this.drawerTitle = "查看/修改"; | ||
| 210 | + this.menuFormDisabled = true; | ||
| 211 | + }, | ||
| 212 | + | ||
| 213 | + //表格数据 | ||
| 214 | + menuAll() { | ||
| 215 | + this.loading = true; | ||
| 216 | + getAllAuth() | ||
| 217 | + .then((res) => { | ||
| 218 | + this.loading = false; | ||
| 219 | + if (res.code === 200) { | ||
| 220 | + res.data.length > 0 | ||
| 221 | + ? (this.data = res.data) | ||
| 222 | + : this.$message({ | ||
| 223 | + message: "数据为空", | ||
| 224 | + type: "warning", | ||
| 225 | + }); | ||
| 226 | + } else { | ||
| 227 | + this.$message({ | ||
| 228 | + message: res.msg, | ||
| 229 | + type: "warning", | ||
| 230 | + }); | ||
| 231 | + } | ||
| 232 | + }) | ||
| 233 | + .catch(() => { | ||
| 234 | + this.loading = false; | ||
| 235 | + }); | ||
| 236 | + }, | ||
| 237 | + | ||
| 238 | + //菜单状态改变 | ||
| 239 | + statusUpdate(data) { | ||
| 240 | + updateStatus(data) | ||
| 241 | + .then((res) => { | ||
| 242 | + if (res.code === 200) { | ||
| 243 | + this.menuAll(); | ||
| 244 | + this.$message({ | ||
| 245 | + message: "操作成功", | ||
| 246 | + type: "success", | ||
| 247 | + }); | ||
| 248 | + location.reload(); | ||
| 249 | + } else { | ||
| 250 | + this.$message({ | ||
| 251 | + message: res.msg, | ||
| 252 | + type: "warning", | ||
| 253 | + }); | ||
| 254 | + } | ||
| 255 | + }) | ||
| 256 | + .catch((err) => { | ||
| 257 | + console.log(err); | ||
| 258 | + }); | ||
| 259 | + }, | ||
| 260 | + | ||
| 261 | + //菜单开启关闭 | ||
| 262 | + menuStatus(row) { | ||
| 263 | + MessageBox.confirm( | ||
| 264 | + row.row.status == 1 ? "是否要关闭此菜单" : "是否要启用此菜单", | ||
| 265 | + "提示", | ||
| 266 | + { | ||
| 267 | + confirmButtonText: "确定", | ||
| 268 | + cancelButtonText: "取消", | ||
| 269 | + type: "warning", | ||
| 270 | + } | ||
| 271 | + ) | ||
| 272 | + .then(() => { | ||
| 273 | + let data = {}; | ||
| 274 | + data.id = row.row.id; | ||
| 275 | + data.status = row.row.status == 1 ? "2" : "1"; | ||
| 276 | + this.statusUpdate(data); | ||
| 277 | + }) | ||
| 278 | + .catch(() => {}); | ||
| 279 | + }, | ||
| 280 | + | ||
| 281 | + //菜单删除 | ||
| 282 | + removeMenu(row) { | ||
| 283 | + MessageBox.confirm("是否要删除此菜单", "提示", { | ||
| 284 | + confirmButtonText: "确定删除", | ||
| 285 | + cancelButtonText: "取消", | ||
| 286 | + type: "warning", | ||
| 287 | + }) | ||
| 288 | + .then(() => { | ||
| 289 | + let data = {}; | ||
| 290 | + data.id = row.row.id; | ||
| 291 | + data.status = "0"; | ||
| 292 | + this.statusUpdate(data); | ||
| 293 | + }) | ||
| 294 | + .catch(() => {}); | ||
| 295 | + }, | ||
| 296 | + | ||
| 297 | + formatter(row, column, cellValue, index) { | ||
| 298 | + if (dictLabels[column.property]) { | ||
| 299 | + if (dictLabels[column.property][cellValue]) { | ||
| 300 | + return dictLabels[column.property][cellValue]; | ||
| 301 | + } | ||
| 302 | + } | ||
| 303 | + return cellValue; | ||
| 304 | + }, | ||
| 305 | + }, | ||
| 306 | +}; | ||
| 307 | +</script> | ||
| 308 | + | ||
| 309 | +<style> | ||
| 310 | +</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 | + clearable | ||
| 30 | + ></el-input> | ||
| 31 | + <div v-else>{{ roleData.name }}</div> | ||
| 32 | + </el-form-item> | ||
| 33 | + </el-col> | ||
| 34 | + <el-col :span="24"> | ||
| 35 | + <el-form-item label="角色描述:" prop="remark"> | ||
| 36 | + <el-input | ||
| 37 | + v-model="roleForm.remark" | ||
| 38 | + type="textarea" | ||
| 39 | + placeholder="请输入角色描述" | ||
| 40 | + :disabled="roleFormDisabled" | ||
| 41 | + v-if="!roleFormDisabled" | ||
| 42 | + clearable | ||
| 43 | + ></el-input> | ||
| 44 | + <div v-else>{{ roleData.remark }}</div> | ||
| 45 | + </el-form-item> | ||
| 46 | + </el-col> | ||
| 47 | + <!-- <el-col :span="24"> | ||
| 48 | + <el-form-item label="角色状态:" prop="valid"> | ||
| 49 | + <el-switch | ||
| 50 | + v-model="roleForm.valid" | ||
| 51 | + :active-value="1" | ||
| 52 | + :inactive-value="2" | ||
| 53 | + active-color="#13ce66" | ||
| 54 | + inactive-color="#ff4949" | ||
| 55 | + :disabled="roleFormDisabled" | ||
| 56 | + ></el-switch> | ||
| 57 | + </el-form-item> | ||
| 58 | + </el-col> --> | ||
| 59 | + <el-col :span="24"> | ||
| 60 | + <el-form-item label="角色权限:" prop="menuIdList"> | ||
| 61 | + <el-tree | ||
| 62 | + ref="tree" | ||
| 63 | + :data="treeData" | ||
| 64 | + node-key="id" | ||
| 65 | + :props="defaultProps" | ||
| 66 | + :show-checkbox="true" | ||
| 67 | + :default-checked-keys="roleData.menuIds" | ||
| 68 | + accordion | ||
| 69 | + > | ||
| 70 | + </el-tree> | ||
| 71 | + </el-form-item> | ||
| 72 | + </el-col> | ||
| 73 | + </el-row> | ||
| 74 | + <el-form-item> | ||
| 75 | + <el-button | ||
| 76 | + type="primary" | ||
| 77 | + v-if="!roleFormDisabled" | ||
| 78 | + size="mini" | ||
| 79 | + :loading="loading" | ||
| 80 | + @click="submit" | ||
| 81 | + >提交</el-button | ||
| 82 | + > | ||
| 83 | + <el-button type="primary" size="mini" @click="handleClose" | ||
| 84 | + >取消</el-button | ||
| 85 | + > | ||
| 86 | + </el-form-item> | ||
| 87 | + </el-form> | ||
| 88 | + </el-drawer> | ||
| 89 | + </div> | ||
| 90 | +</template> | ||
| 91 | + | ||
| 92 | +<script> | ||
| 93 | +import { getAllAuth, addOrUpdateRole } from "@/api/system/user.js"; | ||
| 94 | +export default { | ||
| 95 | + props: { | ||
| 96 | + drawerTitle: { | ||
| 97 | + type: String, | ||
| 98 | + default: "", | ||
| 99 | + }, | ||
| 100 | + roleFormDisabled: { | ||
| 101 | + type: Boolean, | ||
| 102 | + default: false, | ||
| 103 | + }, | ||
| 104 | + drawer: { | ||
| 105 | + type: Boolean, | ||
| 106 | + default: false, | ||
| 107 | + }, | ||
| 108 | + roleData: { | ||
| 109 | + type: Object, | ||
| 110 | + default: null, | ||
| 111 | + }, | ||
| 112 | + }, | ||
| 113 | + data() { | ||
| 114 | + return { | ||
| 115 | + roleForm: { | ||
| 116 | + name: null, | ||
| 117 | + }, | ||
| 118 | + treeData: [], | ||
| 119 | + loading: false, | ||
| 120 | + defaultProps: { | ||
| 121 | + children: "children", | ||
| 122 | + label: "title", | ||
| 123 | + }, | ||
| 124 | + rules: { | ||
| 125 | + name: [ | ||
| 126 | + { | ||
| 127 | + required: true, | ||
| 128 | + message: "角色名不能为空", | ||
| 129 | + trigger: "blur", | ||
| 130 | + }, | ||
| 131 | + ], | ||
| 132 | + }, | ||
| 133 | + }; | ||
| 134 | + }, | ||
| 135 | + created() { | ||
| 136 | + //权限列表 | ||
| 137 | + getAllAuth() | ||
| 138 | + .then((res) => { | ||
| 139 | + if (res.code === 200) { | ||
| 140 | + this.treeData = this.treeDataInfo(res.data); | ||
| 141 | + } else { | ||
| 142 | + this.$message({ | ||
| 143 | + message: res.msg, | ||
| 144 | + type: "warning", | ||
| 145 | + }); | ||
| 146 | + } | ||
| 147 | + }) | ||
| 148 | + .catch((err) => { | ||
| 149 | + console.log(err); | ||
| 150 | + }); | ||
| 151 | + }, | ||
| 152 | + watch: { | ||
| 153 | + roleFormDisabled() { | ||
| 154 | + this.treeData = this.treeDisabled(this.treeData); | ||
| 155 | + }, | ||
| 156 | + drawer(val, oldVal) { | ||
| 157 | + if (val) { | ||
| 158 | + this.roleForm = this.roleData; | ||
| 159 | + } else { | ||
| 160 | + this.loading = false; | ||
| 161 | + } | ||
| 162 | + }, | ||
| 163 | + }, | ||
| 164 | + methods: { | ||
| 165 | + //关闭 | ||
| 166 | + handleClose() { | ||
| 167 | + this.$refs["roleForm"].clearValidate(); | ||
| 168 | + this.$emit("handleClose", false); | ||
| 169 | + }, | ||
| 170 | + | ||
| 171 | + //提交 | ||
| 172 | + submit() { | ||
| 173 | + let formData = {}; | ||
| 174 | + this.loading = true; | ||
| 175 | + let arr = []; | ||
| 176 | + arr = this.$refs.tree.getCheckedKeys().filter((item,index)=>{ | ||
| 177 | + return this.$refs.tree.getCheckedKeys().indexOf(item) == index | ||
| 178 | + }) | ||
| 179 | + formData.menuIdList = arr; | ||
| 180 | + this.roleData ? (formData.id = this.roleData.id) : ""; | ||
| 181 | + formData.remark = this.roleForm.remark; | ||
| 182 | + formData.valid = this.roleForm.valid; | ||
| 183 | + formData.name = this.roleForm.name; | ||
| 184 | + addOrUpdateRole(formData) | ||
| 185 | + .then((res) => { | ||
| 186 | + this.loading = false; | ||
| 187 | + if (res.code === 200) { | ||
| 188 | + this.$message({ | ||
| 189 | + message: "操作成功", | ||
| 190 | + type: "success", | ||
| 191 | + }); | ||
| 192 | + this.$emit("handleClose", false); | ||
| 193 | + } else { | ||
| 194 | + this.$message({ | ||
| 195 | + message: res.msg, | ||
| 196 | + type: "warning", | ||
| 197 | + }); | ||
| 198 | + } | ||
| 199 | + }) | ||
| 200 | + .catch((err) => { | ||
| 201 | + console.log(err); | ||
| 202 | + }); | ||
| 203 | + }, | ||
| 204 | + | ||
| 205 | + //权限结构禁用 | ||
| 206 | + treeDisabled(val) { | ||
| 207 | + let data = []; | ||
| 208 | + val.forEach((item) => { | ||
| 209 | + item.disabled = this.roleFormDisabled; | ||
| 210 | + data.push(item); | ||
| 211 | + if (item.children && item.children.length) { | ||
| 212 | + item.children = this.treeDisabled(item.children); | ||
| 213 | + } | ||
| 214 | + }); | ||
| 215 | + return data; | ||
| 216 | + }, | ||
| 217 | + | ||
| 218 | + treeDataInfo(val) { | ||
| 219 | + let data = []; | ||
| 220 | + val.forEach((item) => { | ||
| 221 | + let menuItem = {}; | ||
| 222 | + menuItem.id = item.id; | ||
| 223 | + menuItem.title = item.title; | ||
| 224 | + data.push(menuItem) | ||
| 225 | + if (item.children && item.children.length) { | ||
| 226 | + menuItem.children = this.treeDataInfo(item.children); | ||
| 227 | + menuItem.children.unshift({id:item.id,title:`${item.title}(菜单)`}) | ||
| 228 | + } | ||
| 229 | + }); | ||
| 230 | + return data; | ||
| 231 | + }, | ||
| 232 | + }, | ||
| 233 | +}; | ||
| 234 | +</script> | ||
| 235 | + | ||
| 236 | +<style> | ||
| 237 | +</style> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
src/views/systemConfig/roleConfig/index.vue
0 → 100644
| 1 | +<template> | ||
| 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 | + clearable | ||
| 11 | + ></el-input> | ||
| 12 | + </el-form-item> | ||
| 13 | + </el-col> | ||
| 14 | + <el-col :span="6"> | ||
| 15 | + <el-form-item label="创建时间"> | ||
| 16 | + <el-date-picker | ||
| 17 | + v-model="createTime" | ||
| 18 | + type="daterange" | ||
| 19 | + range-separator="至" | ||
| 20 | + start-placeholder="开始日期" | ||
| 21 | + end-placeholder="结束日期" | ||
| 22 | + value-format="yyyy-MM-dd" | ||
| 23 | + clearable | ||
| 24 | + > | ||
| 25 | + </el-date-picker> | ||
| 26 | + </el-form-item> | ||
| 27 | + </el-col> | ||
| 28 | + <el-col :span="6"> | ||
| 29 | + <el-form-item label="状态"> | ||
| 30 | + <el-select v-model="formData.valid" placeholder="角色状态" clearable> | ||
| 31 | + <el-option label="启用" value="1"> </el-option> | ||
| 32 | + <el-option label="停用" value="2"> </el-option> | ||
| 33 | + </el-select> | ||
| 34 | + </el-form-item> | ||
| 35 | + </el-col> | ||
| 36 | + </el-row> | ||
| 37 | + </el-form> | ||
| 38 | + <div style="margin:20px"> | ||
| 39 | + <el-button | ||
| 40 | + type="primary" | ||
| 41 | + icon="el-icon-search" | ||
| 42 | + size="mini" | ||
| 43 | + :loading="tableLoading" | ||
| 44 | + @click="selectRoleList(0)" | ||
| 45 | + >搜索</el-button | ||
| 46 | + > | ||
| 47 | + <el-button type="primary" icon="el-icon-plus" size="mini" @click="addRole" v-hasPermi="['system:role:add']" | ||
| 48 | + >新增角色</el-button | ||
| 49 | + > | ||
| 50 | + </div> | ||
| 51 | + <Tables | ||
| 52 | + :data="data" | ||
| 53 | + :headerData="tableHeader" | ||
| 54 | + :infoData="tableHeader" | ||
| 55 | + :totalCount="total" | ||
| 56 | + :limitSize="formData.size" | ||
| 57 | + :page="formData.page" | ||
| 58 | + :pageSizes="[20,30,40,50]" | ||
| 59 | + :loading="tableLoading" | ||
| 60 | + height="600" | ||
| 61 | + @sizeChange="sizeChange" | ||
| 62 | + @currentChange="currentChange" | ||
| 63 | + > | ||
| 64 | + <template> | ||
| 65 | + <el-table-column header-align="center" align="center" label="操作"> | ||
| 66 | + <template slot-scope="scope"> | ||
| 67 | + <el-button type="primary" size="mini" @click="buttonClick(scope, 0)" | ||
| 68 | + >查看</el-button | ||
| 69 | + > | ||
| 70 | + <el-button type="primary" size="mini" @click="buttonClick(scope, 1)" v-hasPermi="['system:role:update']" | ||
| 71 | + >修改</el-button | ||
| 72 | + > | ||
| 73 | + <el-button | ||
| 74 | + :type="scope.row.valid == 1 ? 'warning' : 'primary'" | ||
| 75 | + size="mini" | ||
| 76 | + v-hasPermi="['system:role:openClose']" | ||
| 77 | + @click="roleStatus(scope)" | ||
| 78 | + >{{ scope.row.valid == 1 ? "停用" : "启用" }}</el-button | ||
| 79 | + > | ||
| 80 | + <el-button type="danger" size="mini" @click="removeRole(scope)" v-hasPermi="['system:role:delete']" | ||
| 81 | + >删除角色</el-button | ||
| 82 | + > | ||
| 83 | + </template> | ||
| 84 | + </el-table-column> | ||
| 85 | + </template> | ||
| 86 | + </Tables> | ||
| 87 | + <Drawer | ||
| 88 | + :drawer="drawer" | ||
| 89 | + :drawerTitle="drawerTitle" | ||
| 90 | + :roleFormDisabled="roleFormDisabled" | ||
| 91 | + :roleData="roleData" | ||
| 92 | + @handleClose="handleClose" | ||
| 93 | + ></Drawer> | ||
| 94 | + </div> | ||
| 95 | +</template> | ||
| 96 | + | ||
| 97 | +<script> | ||
| 98 | +import Drawer from "./drawer.vue"; | ||
| 99 | +import { MessageBox } from "element-ui"; | ||
| 100 | +import { | ||
| 101 | + getRoleList, | ||
| 102 | + detailRole, | ||
| 103 | + updateRoleStatus, | ||
| 104 | +} from "@/api/system/user.js"; | ||
| 105 | +export default { | ||
| 106 | + name:"RoleConfig", | ||
| 107 | + components: { | ||
| 108 | + Drawer, | ||
| 109 | + }, | ||
| 110 | + data() { | ||
| 111 | + return { | ||
| 112 | + formData: { | ||
| 113 | + page: 1, | ||
| 114 | + size: 20, | ||
| 115 | + valid: null, | ||
| 116 | + createStart: null, | ||
| 117 | + createEnd: null, | ||
| 118 | + name: null, | ||
| 119 | + }, //查询条件 | ||
| 120 | + data: [], //表格数据 | ||
| 121 | + tableHeader: [ | ||
| 122 | + { | ||
| 123 | + type: "index", | ||
| 124 | + name: "", | ||
| 125 | + value: "", | ||
| 126 | + width: "", | ||
| 127 | + align: "center", | ||
| 128 | + sorTable: false, | ||
| 129 | + disabled:true | ||
| 130 | + }, | ||
| 131 | + { | ||
| 132 | + type: "", | ||
| 133 | + name: "角色名称", | ||
| 134 | + value: "name", | ||
| 135 | + width: "150px", | ||
| 136 | + align: "center", | ||
| 137 | + sorTable: false, | ||
| 138 | + disabled:true | ||
| 139 | + }, | ||
| 140 | + { | ||
| 141 | + type: "", | ||
| 142 | + name: "角色状态", | ||
| 143 | + value: "valid", | ||
| 144 | + width: "150px", | ||
| 145 | + align: "center", | ||
| 146 | + sorTable: false, | ||
| 147 | + disabled:true | ||
| 148 | + }, | ||
| 149 | + { | ||
| 150 | + type: "", | ||
| 151 | + name: "创建人", | ||
| 152 | + value: "createUserName", | ||
| 153 | + width: "150px", | ||
| 154 | + align: "center", | ||
| 155 | + sorTable: false, | ||
| 156 | + disabled:true | ||
| 157 | + }, | ||
| 158 | + { | ||
| 159 | + type: "", | ||
| 160 | + name: "创建时间", | ||
| 161 | + value: "createTime", | ||
| 162 | + width: "150px", | ||
| 163 | + align: "center", | ||
| 164 | + sorTable: false, | ||
| 165 | + disabled:true | ||
| 166 | + }, | ||
| 167 | + { | ||
| 168 | + type: "", | ||
| 169 | + name: "修改时间", | ||
| 170 | + value: "updateTime", | ||
| 171 | + width: "150px", | ||
| 172 | + align: "center", | ||
| 173 | + sorTable: false, | ||
| 174 | + disabled:true | ||
| 175 | + }, | ||
| 176 | + { | ||
| 177 | + type: "", | ||
| 178 | + name: "备注", | ||
| 179 | + value: "remark", | ||
| 180 | + width: "400px", | ||
| 181 | + align: "center", | ||
| 182 | + sorTable: false, | ||
| 183 | + disabled:true | ||
| 184 | + }, | ||
| 185 | + ], //表头数据 | ||
| 186 | + roleData: {}, //角色详情 | ||
| 187 | + createTime: [], | ||
| 188 | + drawer: false, | ||
| 189 | + drawerTitle: "", | ||
| 190 | + roleFormDisabled: false, | ||
| 191 | + tableLoading: false, | ||
| 192 | + total: 0, | ||
| 193 | + }; | ||
| 194 | + }, | ||
| 195 | + created() { | ||
| 196 | + if(this.$store.state.tagsView.cachedViews.length == 0){ | ||
| 197 | + this.selectRoleList(); | ||
| 198 | + } | ||
| 199 | + }, | ||
| 200 | + activated(){ | ||
| 201 | + this.selectRoleList(); | ||
| 202 | + }, | ||
| 203 | + deactivated(){ | ||
| 204 | + this.data = [] | ||
| 205 | + }, | ||
| 206 | + methods: { | ||
| 207 | + //角色列表 | ||
| 208 | + selectRoleList(val) { | ||
| 209 | + if(val == 0){ | ||
| 210 | + this.formData.page = 1 | ||
| 211 | + } | ||
| 212 | + this.tableLoading = true; | ||
| 213 | + if (this.createTime.length > 0) { | ||
| 214 | + this.formData.createStart = this.createTime[0]; | ||
| 215 | + this.formData.createEnd = this.createTime[1]; | ||
| 216 | + } | ||
| 217 | + getRoleList(this.formData) | ||
| 218 | + .then((res) => { | ||
| 219 | + this.tableLoading = false; | ||
| 220 | + if (res.code === 200) { | ||
| 221 | + this.data = res.data.list; | ||
| 222 | + this.total = res.data.total; | ||
| 223 | + } else { | ||
| 224 | + this.$message({ | ||
| 225 | + message: res.msg, | ||
| 226 | + type: "warning", | ||
| 227 | + }); | ||
| 228 | + } | ||
| 229 | + }) | ||
| 230 | + .catch((err) => { | ||
| 231 | + this.tableLoading = false; | ||
| 232 | + console.log(err); | ||
| 233 | + }); | ||
| 234 | + }, | ||
| 235 | + //角色详情 | ||
| 236 | + roleDetail(id) { | ||
| 237 | + detailRole(id) | ||
| 238 | + .then((res) => { | ||
| 239 | + if (res.code === 200) { | ||
| 240 | + this.roleData = res.data; | ||
| 241 | + } else { | ||
| 242 | + this.$message({ | ||
| 243 | + message: res.msg, | ||
| 244 | + type: "warning", | ||
| 245 | + }); | ||
| 246 | + } | ||
| 247 | + }) | ||
| 248 | + .catch((err) => { | ||
| 249 | + console.log(err); | ||
| 250 | + }); | ||
| 251 | + }, | ||
| 252 | + //新增角色 | ||
| 253 | + addRole() { | ||
| 254 | + this.roleData = {}; | ||
| 255 | + this.drawer = true; | ||
| 256 | + this.roleFormDisabled = false; | ||
| 257 | + this.drawerTitle = "新增角色"; | ||
| 258 | + }, | ||
| 259 | + //修改查看角色 | ||
| 260 | + buttonClick(row, status) { | ||
| 261 | + this.roleDetail(row.row.id); | ||
| 262 | + this.roleData = row.row; | ||
| 263 | + this.drawer = true; | ||
| 264 | + status == 0 | ||
| 265 | + ? (this.roleFormDisabled = true) | ||
| 266 | + : (this.roleFormDisabled = false); | ||
| 267 | + this.drawerTitle = "修改角色"; | ||
| 268 | + }, | ||
| 269 | + //修改角色状态 | ||
| 270 | + roleStatus(row) { | ||
| 271 | + let msg = ""; | ||
| 272 | + let status = {}; | ||
| 273 | + status.id = row.row.id; | ||
| 274 | + row.row.valid == 1 | ||
| 275 | + ? ((msg = "是否关闭此角色"), (status.valid = 2)) | ||
| 276 | + : ((msg = "是否启用此角色"), (status.valid = 1)); | ||
| 277 | + MessageBox.confirm(msg, "注意", { | ||
| 278 | + confirmButtonText: "确定", | ||
| 279 | + cancelButtonText: "取消", | ||
| 280 | + type: "warning", | ||
| 281 | + }) | ||
| 282 | + .then(() => { | ||
| 283 | + updateRoleStatus(status).then((res) => { | ||
| 284 | + if (res.code === 200) { | ||
| 285 | + this.$message({ | ||
| 286 | + message: "操作成功", | ||
| 287 | + type: "success", | ||
| 288 | + }); | ||
| 289 | + this.selectRoleList(); | ||
| 290 | + } else { | ||
| 291 | + this.$message({ | ||
| 292 | + message: res.msg, | ||
| 293 | + type: "warning", | ||
| 294 | + }); | ||
| 295 | + } | ||
| 296 | + }); | ||
| 297 | + }) | ||
| 298 | + .catch(() => []); | ||
| 299 | + }, | ||
| 300 | + //删除角色 | ||
| 301 | + removeRole(row) { | ||
| 302 | + MessageBox.confirm( | ||
| 303 | + "如删除此角色,角色下所有用户将从中被剔除,可能会对用户操作造成影响!", | ||
| 304 | + "注意", | ||
| 305 | + { | ||
| 306 | + confirmButtonText: "确定", | ||
| 307 | + cancelButtonText: "取消", | ||
| 308 | + type: "warning", | ||
| 309 | + } | ||
| 310 | + ) | ||
| 311 | + .then(() => { | ||
| 312 | + updateRoleStatus({ | ||
| 313 | + id: row.row.id, | ||
| 314 | + valid: 0, | ||
| 315 | + confirmDel: false, | ||
| 316 | + }).then((res) => { | ||
| 317 | + if (res.code === 200) { | ||
| 318 | + this.$message({ | ||
| 319 | + message: "删除成功", | ||
| 320 | + type: "success", | ||
| 321 | + }); | ||
| 322 | + this.selectRoleList(); | ||
| 323 | + } else if (res.code === 202) { | ||
| 324 | + MessageBox.confirm(res.msg, "注意", { | ||
| 325 | + confirmButtonText: "确定", | ||
| 326 | + cancelButtonText: "取消", | ||
| 327 | + type: "warning", | ||
| 328 | + }) | ||
| 329 | + .then(() => { | ||
| 330 | + updateRoleStatus({ | ||
| 331 | + id: row.row.id, | ||
| 332 | + valid: 0, | ||
| 333 | + confirmDel: true, | ||
| 334 | + }).then((res) => { | ||
| 335 | + if (res.code === 200) { | ||
| 336 | + this.$message({ | ||
| 337 | + message: "操作成功", | ||
| 338 | + type: "success", | ||
| 339 | + }); | ||
| 340 | + this.selectRoleList(); | ||
| 341 | + } | ||
| 342 | + }); | ||
| 343 | + }) | ||
| 344 | + .catch(() => {}); | ||
| 345 | + } else { | ||
| 346 | + this.$message({ | ||
| 347 | + message: res.msg, | ||
| 348 | + type: "warning", | ||
| 349 | + }); | ||
| 350 | + } | ||
| 351 | + }); | ||
| 352 | + }) | ||
| 353 | + .catch(() => []); | ||
| 354 | + }, | ||
| 355 | + handleClose(val) { | ||
| 356 | + this.drawer = val; | ||
| 357 | + this.selectRoleList(); | ||
| 358 | + }, | ||
| 359 | + currentChange(val) { | ||
| 360 | + this.formData.page = val.page; | ||
| 361 | + this.selectRoleList(); | ||
| 362 | + }, | ||
| 363 | + sizeChange(val){ | ||
| 364 | + this.formData.size = val; | ||
| 365 | + this.selectRoleList() | ||
| 366 | + } | ||
| 367 | + }, | ||
| 368 | +}; | ||
| 369 | +</script> | ||
| 370 | + | ||
| 371 | +<style> | ||
| 372 | +</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 | + :title="drawerTitle" | ||
| 5 | + :visible.sync="drawer" | ||
| 6 | + direction="rtl" | ||
| 7 | + size="40%" | ||
| 8 | + :close-on-click-modal="false" | ||
| 9 | + :wrapperClosable="false" | ||
| 10 | + :show-close="false" | ||
| 11 | + > | ||
| 12 | + <el-form | ||
| 13 | + ref="userForm" | ||
| 14 | + :model="userForm" | ||
| 15 | + label-width="auto" | ||
| 16 | + :rules="rules" | ||
| 17 | + style="margin: 10px" | ||
| 18 | + > | ||
| 19 | + <el-row :gutter="10"> | ||
| 20 | + <el-col :span="12"> | ||
| 21 | + <el-form-item label="员工号:" prop="loginName"> | ||
| 22 | + <el-input | ||
| 23 | + placeholder="请输入员工号" | ||
| 24 | + v-model.trim="userForm.loginName" | ||
| 25 | + v-if="!userFormDisabled" | ||
| 26 | + :disabled="drawerTitle != '新增用户'" | ||
| 27 | + size="small" | ||
| 28 | + clearable | ||
| 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="small" | ||
| 41 | + clearable | ||
| 42 | + ></el-input> | ||
| 43 | + <div v-else>{{ userForm.username }}</div> | ||
| 44 | + </el-form-item> | ||
| 45 | + </el-col> | ||
| 46 | + <el-col :span="24"> | ||
| 47 | + <el-alert | ||
| 48 | + title="注意:员工号一但设置就无法更改,请谨慎填写!" | ||
| 49 | + type="warning" | ||
| 50 | + show-icon | ||
| 51 | + size="mini" | ||
| 52 | + :closable="false" | ||
| 53 | + style="width: 400px" | ||
| 54 | + > | ||
| 55 | + </el-alert> | ||
| 56 | + </el-col> | ||
| 57 | + <el-col :span="12"> | ||
| 58 | + <el-form-item label="手机号:" prop="phone"> | ||
| 59 | + <el-input | ||
| 60 | + placeholder="请输入手机号" | ||
| 61 | + type="phone" | ||
| 62 | + v-model.trim="userForm.phone" | ||
| 63 | + :disabled="userFormDisabled" | ||
| 64 | + v-if="!userFormDisabled" | ||
| 65 | + size="small" | ||
| 66 | + clearable | ||
| 67 | + ></el-input> | ||
| 68 | + <div v-else>{{ userForm.phone }}</div> | ||
| 69 | + </el-form-item> | ||
| 70 | + </el-col> | ||
| 71 | + <el-col :span="12"> | ||
| 72 | + <el-form-item label="电子邮箱:" prop="email"> | ||
| 73 | + <el-input | ||
| 74 | + placeholder="请输入电子邮箱" | ||
| 75 | + type="email" | ||
| 76 | + v-model.trim="userForm.email" | ||
| 77 | + :disabled="userFormDisabled" | ||
| 78 | + v-if="!userFormDisabled" | ||
| 79 | + size="small" | ||
| 80 | + clearable | ||
| 81 | + ></el-input> | ||
| 82 | + <div v-else>{{ userForm.email }}</div> | ||
| 83 | + </el-form-item> | ||
| 84 | + </el-col> | ||
| 85 | + <!-- <el-col :span="12" v-if="drawerTitle == '新增用户'"> | ||
| 86 | + <el-form-item label="密码:"> | ||
| 87 | + <el-input | ||
| 88 | + placeholder="请输入密码" | ||
| 89 | + :disabled="userFormDisabled" | ||
| 90 | + type="password" | ||
| 91 | + size="mini" | ||
| 92 | + ></el-input> | ||
| 93 | + </el-form-item> | ||
| 94 | + </el-col> | ||
| 95 | + <el-col :span="12" v-if="drawerTitle == '新增用户'"> | ||
| 96 | + <el-form-item label="确认密码:"> | ||
| 97 | + <el-input | ||
| 98 | + placeholder="请确认密码" | ||
| 99 | + :disabled="userFormDisabled" | ||
| 100 | + type="password" | ||
| 101 | + size="mini" | ||
| 102 | + ></el-input> | ||
| 103 | + </el-form-item> | ||
| 104 | + </el-col> --> | ||
| 105 | + <el-col :span="24"> | ||
| 106 | + <el-form-item label="所属口岸:" prop="portName"> | ||
| 107 | + <el-select | ||
| 108 | + placeholder="请选择口岸" | ||
| 109 | + v-model="port" | ||
| 110 | + :disabled="userFormDisabled" | ||
| 111 | + size="small" | ||
| 112 | + style="width: 100%" | ||
| 113 | + multiple | ||
| 114 | + clearable | ||
| 115 | + > | ||
| 116 | + <el-option | ||
| 117 | + v-for="item in portNameList" | ||
| 118 | + :label="item.englishName" | ||
| 119 | + :value="item.englishName" | ||
| 120 | + :key="item.id" | ||
| 121 | + > | ||
| 122 | + </el-option> | ||
| 123 | + </el-select> | ||
| 124 | + </el-form-item> | ||
| 125 | + </el-col> | ||
| 126 | + <el-col :span="24"> | ||
| 127 | + <el-form-item label="所属角色:" prop="roleIds"> | ||
| 128 | + <el-checkbox-group | ||
| 129 | + v-model="roleid" | ||
| 130 | + :disabled="userFormDisabled" | ||
| 131 | + @change="change" | ||
| 132 | + > | ||
| 133 | + <el-checkbox | ||
| 134 | + v-for="item in roleList" | ||
| 135 | + :label="item.id" | ||
| 136 | + :key="item.id" | ||
| 137 | + >{{ item.name }}</el-checkbox | ||
| 138 | + > | ||
| 139 | + </el-checkbox-group> | ||
| 140 | + </el-form-item> | ||
| 141 | + </el-col> | ||
| 142 | + <el-col :span="24"> | ||
| 143 | + <el-form-item label="备注:" prop="remark"> | ||
| 144 | + <el-input | ||
| 145 | + type="textarea" | ||
| 146 | + v-model="userForm.remark" | ||
| 147 | + placeholder="备注" | ||
| 148 | + :disabled="userFormDisabled" | ||
| 149 | + v-if="!userFormDisabled" | ||
| 150 | + size="small" | ||
| 151 | + clearable | ||
| 152 | + ></el-input> | ||
| 153 | + <div v-else>{{ userForm.remark }}</div> | ||
| 154 | + </el-form-item> | ||
| 155 | + </el-col> | ||
| 156 | + </el-row> | ||
| 157 | + <el-form-item> | ||
| 158 | + <el-button | ||
| 159 | + type="primary" | ||
| 160 | + size="mini" | ||
| 161 | + v-if="!userFormDisabled" | ||
| 162 | + :loading="loading" | ||
| 163 | + @click="submit" | ||
| 164 | + >提交</el-button | ||
| 165 | + > | ||
| 166 | + <el-button type="primary" size="mini" @click="handleClose" | ||
| 167 | + >取消</el-button | ||
| 168 | + > | ||
| 169 | + </el-form-item> | ||
| 170 | + </el-form> | ||
| 171 | + </el-drawer> | ||
| 172 | + </div> | ||
| 173 | +</template> | ||
| 174 | + | ||
| 175 | +<script> | ||
| 176 | +import { | ||
| 177 | + getRoleList, | ||
| 178 | + addOrUpdateUser, | ||
| 179 | + portNameList, | ||
| 180 | +} from "@/api/system/user.js"; | ||
| 181 | +export default { | ||
| 182 | + props: { | ||
| 183 | + drawerTitle: { | ||
| 184 | + type: String, | ||
| 185 | + default: "", | ||
| 186 | + }, | ||
| 187 | + userFormDisabled: { | ||
| 188 | + type: Boolean, | ||
| 189 | + default: false, | ||
| 190 | + }, | ||
| 191 | + drawer: { | ||
| 192 | + type: Boolean, | ||
| 193 | + default: false, | ||
| 194 | + }, | ||
| 195 | + userData: { | ||
| 196 | + type: Object, | ||
| 197 | + default: null, | ||
| 198 | + }, | ||
| 199 | + }, | ||
| 200 | + data() { | ||
| 201 | + return { | ||
| 202 | + userForm: { | ||
| 203 | + roleIds: [], | ||
| 204 | + }, | ||
| 205 | + roleList: [], | ||
| 206 | + portNameList: [], | ||
| 207 | + port: [], | ||
| 208 | + roleid: [], | ||
| 209 | + ImageUploadUrl: "", | ||
| 210 | + dialogVisible: false, | ||
| 211 | + loading: false, | ||
| 212 | + rules: { | ||
| 213 | + loginName: [ | ||
| 214 | + { | ||
| 215 | + required: true, | ||
| 216 | + message: "员工号不能为空", | ||
| 217 | + trigger: "blur", | ||
| 218 | + }, | ||
| 219 | + ], | ||
| 220 | + username: [ | ||
| 221 | + { | ||
| 222 | + required: true, | ||
| 223 | + message: "用户名不能为空", | ||
| 224 | + trigger: "blur", | ||
| 225 | + }, | ||
| 226 | + ], | ||
| 227 | + portName: [ | ||
| 228 | + { | ||
| 229 | + required: true, | ||
| 230 | + message: "所属口岸不能为空", | ||
| 231 | + trigger: "blur", | ||
| 232 | + }, | ||
| 233 | + ], | ||
| 234 | + phone:[ | ||
| 235 | + { | ||
| 236 | + min:11, | ||
| 237 | + max:11, | ||
| 238 | + message:"请输入11位手机号码", | ||
| 239 | + trigger:"blur" | ||
| 240 | + }, | ||
| 241 | + { | ||
| 242 | + pattern:/^(13[0-9]|14[579]|15[0-3,5-9]|16[6]|17[0135678]|18[0-9]|19[89])\d{8}$/, | ||
| 243 | + message:"请输入正确得手机号码" | ||
| 244 | + } | ||
| 245 | + ], | ||
| 246 | + email:[ | ||
| 247 | + { | ||
| 248 | + pattern:/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/, | ||
| 249 | + message:"请输入正确得电子邮箱" | ||
| 250 | + } | ||
| 251 | + ] | ||
| 252 | + }, | ||
| 253 | + }; | ||
| 254 | + }, | ||
| 255 | + created() { | ||
| 256 | + }, | ||
| 257 | + watch: { | ||
| 258 | + drawer(val, oldVal) { | ||
| 259 | + if (val) { | ||
| 260 | + this.roleList = [] | ||
| 261 | + this.selectRoleList(); | ||
| 262 | + this.userForm = this.userData; | ||
| 263 | + if (this.userForm.roleIds) { | ||
| 264 | + this.roleid = this.userForm.roleIds; | ||
| 265 | + } | ||
| 266 | + if (this.userForm.portName) { | ||
| 267 | + this.port = this.userForm.portName; | ||
| 268 | + } | ||
| 269 | + }else{ | ||
| 270 | + this.loading = false; | ||
| 271 | + } | ||
| 272 | + }, | ||
| 273 | + }, | ||
| 274 | + methods: { | ||
| 275 | + clearValidate(formName){ | ||
| 276 | + this.$refs[formName].clearValidate(); | ||
| 277 | + }, | ||
| 278 | + change(val) { | ||
| 279 | + this.roleid = val; | ||
| 280 | + }, | ||
| 281 | + selectRoleList() { | ||
| 282 | + //角色列表 | ||
| 283 | + getRoleList({ size: null, page: null }) | ||
| 284 | + .then((res) => { | ||
| 285 | + if (res.code === 200) { | ||
| 286 | + res.data.list.map((item) => { | ||
| 287 | + if (item.valid == 1) { | ||
| 288 | + this.roleList.push(item); | ||
| 289 | + } | ||
| 290 | + }); | ||
| 291 | + } else { | ||
| 292 | + this.$message({ | ||
| 293 | + message: res.msg, | ||
| 294 | + type: "warning", | ||
| 295 | + }); | ||
| 296 | + } | ||
| 297 | + }) | ||
| 298 | + .catch((err) => { | ||
| 299 | + console.log(err); | ||
| 300 | + }); | ||
| 301 | + //获取口岸 | ||
| 302 | + // this.portNameList = this.$store.state.user.portNames; | ||
| 303 | + portNameList() | ||
| 304 | + .then((res) => { | ||
| 305 | + if (res.code === 200) { | ||
| 306 | + this.portNameList = res.data; | ||
| 307 | + } else { | ||
| 308 | + this.$message({ | ||
| 309 | + message: res.msg, | ||
| 310 | + type: "warning", | ||
| 311 | + }); | ||
| 312 | + } | ||
| 313 | + }) | ||
| 314 | + .catch((err) => { | ||
| 315 | + console.log(err); | ||
| 316 | + }); | ||
| 317 | + }, | ||
| 318 | + | ||
| 319 | + //关闭 | ||
| 320 | + handleClose() { | ||
| 321 | + this.roleid = []; | ||
| 322 | + this.port = []; | ||
| 323 | + this.userForm = { | ||
| 324 | + roleIds: [], | ||
| 325 | + }; | ||
| 326 | + this.clearValidate('userForm') | ||
| 327 | + this.$emit("handleClose", false); | ||
| 328 | + }, | ||
| 329 | + | ||
| 330 | + //提交 | ||
| 331 | + submit() { | ||
| 332 | + if (this.port.join(",").length > 0) { | ||
| 333 | + this.loading = true; | ||
| 334 | + this.userData.isValid ? "" : (this.userForm.isValid = 1); | ||
| 335 | + this.userForm.roleIds = this.roleid; | ||
| 336 | + this.userForm.portName = this.port.join(","); | ||
| 337 | + addOrUpdateUser(this.userForm) | ||
| 338 | + .then((res) => { | ||
| 339 | + this.loading = false; | ||
| 340 | + if (res.code === 200) { | ||
| 341 | + this.$message({ | ||
| 342 | + message: "操作成功", | ||
| 343 | + type: "success", | ||
| 344 | + }); | ||
| 345 | + this.$emit("handleClose", false); | ||
| 346 | + } else { | ||
| 347 | + this.$message({ | ||
| 348 | + message: res.msg, | ||
| 349 | + type: "warning", | ||
| 350 | + }); | ||
| 351 | + } | ||
| 352 | + }) | ||
| 353 | + .catch((err) => { | ||
| 354 | + this.loading = false; | ||
| 355 | + console.log(err); | ||
| 356 | + }); | ||
| 357 | + }else{ | ||
| 358 | + this.$message({ | ||
| 359 | + message: "口岸不能为空", | ||
| 360 | + type: "warning", | ||
| 361 | + }); | ||
| 362 | + } | ||
| 363 | + }, | ||
| 364 | + }, | ||
| 365 | +}; | ||
| 366 | +</script> | ||
| 367 | + | ||
| 368 | +<style> | ||
| 369 | +</style> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
src/views/systemConfig/userConfig/index.vue
0 → 100644
This diff is collapsed. Click to expand it.
-
Please register or login to post a comment