Showing
28 changed files
with
2198 additions
and
582 deletions
| 1 | import request from '@/utils/request' | 1 | import request from '@/utils/request' |
| 2 | import { praseStrEmpty } from "@/utils/FedEx"; | 2 | import { praseStrEmpty } from "@/utils/FedEx"; |
| 3 | 3 | ||
| 4 | +// // 修改用户 | ||
| 5 | +// export function updateUser(data) { | ||
| 6 | +// return request({ | ||
| 7 | +// url: '/system/user', | ||
| 8 | +// method: 'put', | ||
| 9 | +// data: data | ||
| 10 | +// }) | ||
| 11 | +// } | ||
| 12 | + | ||
| 13 | +// // 导出用户 | ||
| 14 | +// export function exportUser(query) { | ||
| 15 | +// return request({ | ||
| 16 | +// url: '/system/user/export', | ||
| 17 | +// method: 'get', | ||
| 18 | +// params: query | ||
| 19 | +// }) | ||
| 20 | +// } | ||
| 21 | + | ||
| 22 | +// // 用户密码重置 | ||
| 23 | +// export function resetUserPwd(userId, password) { | ||
| 24 | +// const data = { | ||
| 25 | +// userId, | ||
| 26 | +// password | ||
| 27 | +// } | ||
| 28 | +// return request({ | ||
| 29 | +// url: '/system/user/resetPwd', | ||
| 30 | +// method: 'put', | ||
| 31 | +// data: data | ||
| 32 | +// }) | ||
| 33 | +// } | ||
| 34 | + | ||
| 35 | +// // 用户状态修改 | ||
| 36 | +// export function changeUserStatus(userId, status) { | ||
| 37 | +// const data = { | ||
| 38 | +// userId, | ||
| 39 | +// status | ||
| 40 | +// } | ||
| 41 | +// return request({ | ||
| 42 | +// url: '/system/user/changeStatus', | ||
| 43 | +// method: 'put', | ||
| 44 | +// data: data | ||
| 45 | +// }) | ||
| 46 | +// } | ||
| 47 | + | ||
| 48 | +// // 查询用户个人信息 | ||
| 49 | +// export function getUserProfile() { | ||
| 50 | +// return request({ | ||
| 51 | +// url: '/system/user/profile', | ||
| 52 | +// method: 'get' | ||
| 53 | +// }) | ||
| 54 | +// } | ||
| 55 | + | ||
| 56 | +// // 修改用户个人信息 | ||
| 57 | +// export function updateUserProfile(data) { | ||
| 58 | +// return request({ | ||
| 59 | +// url: '/system/user/profile', | ||
| 60 | +// method: 'put', | ||
| 61 | +// data: data | ||
| 62 | +// }) | ||
| 63 | +// } | ||
| 64 | + | ||
| 65 | +// // 用户密码重置 | ||
| 66 | +// export function updateUserPwd(oldPassword, newPassword) { | ||
| 67 | +// const data = { | ||
| 68 | +// oldPassword, | ||
| 69 | +// newPassword | ||
| 70 | +// } | ||
| 71 | +// return request({ | ||
| 72 | +// url: '/system/user/profile/updatePwd', | ||
| 73 | +// method: 'put', | ||
| 74 | +// params: data | ||
| 75 | +// }) | ||
| 76 | +// } | ||
| 77 | + | ||
| 78 | +// // 用户头像上传 | ||
| 79 | +// export function uploadAvatar(data) { | ||
| 80 | +// return request({ | ||
| 81 | +// url: '/system/user/profile/avatar', | ||
| 82 | +// method: 'post', | ||
| 83 | +// data: data | ||
| 84 | +// }) | ||
| 85 | +// } | ||
| 86 | + | ||
| 87 | +// // 下载用户导入模板 | ||
| 88 | +// export function importTemplate() { | ||
| 89 | +// return request({ | ||
| 90 | +// url: '/system/user/importTemplate', | ||
| 91 | +// method: 'get' | ||
| 92 | +// }) | ||
| 93 | +// } | ||
| 94 | + | ||
| 4 | // 查询用户列表 | 95 | // 查询用户列表 |
| 5 | -export function listUser(query) { | 96 | +export function listUser(data) { |
| 6 | return request({ | 97 | return request({ |
| 7 | - url: '/system/user/list', | 98 | + url: '/sysUser/getUserList', |
| 8 | - method: 'get', | 99 | + method: 'post', |
| 9 | - params: query | 100 | + data: data |
| 10 | }) | 101 | }) |
| 11 | } | 102 | } |
| 12 | 103 | ||
| 13 | // 查询用户详细 | 104 | // 查询用户详细 |
| 14 | -export function getUser(userId) { | 105 | +export function detailUser(userId) { |
| 15 | return request({ | 106 | return request({ |
| 16 | - url: '/system/user/' + praseStrEmpty(userId), | 107 | + url: '/sysUser/detailUser?id=' + praseStrEmpty(userId), |
| 17 | method: 'get' | 108 | method: 'get' |
| 18 | }) | 109 | }) |
| 19 | } | 110 | } |
| 20 | 111 | ||
| 21 | // 新增用户 | 112 | // 新增用户 |
| 22 | -export function addUser(data) { | 113 | +export function addOrUpdateUser(data) { |
| 23 | return request({ | 114 | return request({ |
| 24 | - url: '/system/user', | 115 | + url: '/sysUser/addOrUpdateUser', |
| 25 | method: 'post', | 116 | method: 'post', |
| 26 | data: data | 117 | data: data |
| 27 | }) | 118 | }) |
| 28 | } | 119 | } |
| 29 | 120 | ||
| 30 | -// 修改用户 | 121 | +// 修改用户状态 |
| 31 | -export function updateUser(data) { | 122 | +export function updateUserStatus(data) { |
| 32 | return request({ | 123 | return request({ |
| 33 | - url: '/system/user', | 124 | + url: '/sysUser/updateUserStatus', |
| 34 | - method: 'put', | 125 | + method: 'post', |
| 35 | data: data | 126 | data: data |
| 36 | }) | 127 | }) |
| 37 | } | 128 | } |
| 38 | 129 | ||
| 39 | -// 删除用户 | 130 | +//菜单信息 |
| 40 | -export function delUser(userId) { | 131 | +export function getAllAuth() { |
| 41 | return request({ | 132 | return request({ |
| 42 | - url: '/system/user/' + userId, | 133 | + url: '/sysMenu/getAllAuth', |
| 43 | - method: 'delete' | 134 | + method: 'get' |
| 44 | }) | 135 | }) |
| 45 | } | 136 | } |
| 46 | 137 | ||
| 47 | -// 导出用户 | 138 | +//菜单开启关闭 |
| 48 | -export function exportUser(query) { | 139 | +export function updateStatus(data) { |
| 49 | return request({ | 140 | return request({ |
| 50 | - url: '/system/user/export', | 141 | + url: '/sysMenu/updateStatus', |
| 51 | - method: 'get', | 142 | + method: 'post', |
| 52 | - params: query | 143 | + data: data |
| 53 | }) | 144 | }) |
| 54 | } | 145 | } |
| 55 | 146 | ||
| 56 | -// 用户密码重置 | 147 | +//角色列表 |
| 57 | -export function resetUserPwd(userId, password) { | 148 | +export function getRoleList(data) { |
| 58 | - const data = { | ||
| 59 | - userId, | ||
| 60 | - password | ||
| 61 | - } | ||
| 62 | return request({ | 149 | return request({ |
| 63 | - url: '/system/user/resetPwd', | 150 | + url: '/role/getRoleList', |
| 64 | - method: 'put', | 151 | + method: 'post', |
| 65 | data: data | 152 | data: data |
| 66 | }) | 153 | }) |
| 67 | } | 154 | } |
| 68 | 155 | ||
| 69 | -// 用户状态修改 | 156 | +//角色详情 |
| 70 | -export function changeUserStatus(userId, status) { | 157 | +export function detailRole(id) { |
| 71 | - const data = { | ||
| 72 | - userId, | ||
| 73 | - status | ||
| 74 | - } | ||
| 75 | return request({ | 158 | return request({ |
| 76 | - url: '/system/user/changeStatus', | 159 | + url: '/role/detailRole?id=' + id, |
| 77 | - method: 'put', | 160 | + method: 'get', |
| 78 | - data: data | ||
| 79 | }) | 161 | }) |
| 80 | } | 162 | } |
| 81 | 163 | ||
| 82 | -// 查询用户个人信息 | 164 | +//新增修改角色 |
| 83 | -export function getUserProfile() { | 165 | +export function addOrUpdateRole(data) { |
| 84 | return request({ | 166 | return request({ |
| 85 | - url: '/system/user/profile', | 167 | + url: '/role/addOrUpdateRole', |
| 86 | - method: 'get' | 168 | + method: 'post', |
| 169 | + data: data | ||
| 87 | }) | 170 | }) |
| 88 | } | 171 | } |
| 89 | 172 | ||
| 90 | -// 修改用户个人信息 | 173 | +//角色状态修改 |
| 91 | -export function updateUserProfile(data) { | 174 | +export function updateRoleStatus(data) { |
| 92 | return request({ | 175 | return request({ |
| 93 | - url: '/system/user/profile', | 176 | + url: '/role/updateRoleStatus', |
| 94 | - method: 'put', | 177 | + method: 'post', |
| 95 | data: data | 178 | data: data |
| 96 | }) | 179 | }) |
| 97 | } | 180 | } |
| 98 | 181 | ||
| 99 | -// 用户密码重置 | 182 | +//口岸列表 |
| 100 | -export function updateUserPwd(oldPassword, newPassword) { | 183 | +export function portNameList() { |
| 101 | - const data = { | ||
| 102 | - oldPassword, | ||
| 103 | - newPassword | ||
| 104 | - } | ||
| 105 | return request({ | 184 | return request({ |
| 106 | - url: '/system/user/profile/updatePwd', | 185 | + url: '/dictionary/port', |
| 107 | - method: 'put', | 186 | + method: 'get', |
| 108 | - params: data | ||
| 109 | }) | 187 | }) |
| 110 | } | 188 | } |
| 111 | 189 | ||
| 112 | -// 用户头像上传 | 190 | +//口岸变更 |
| 113 | -export function uploadAvatar(data) { | 191 | +export function changeCurrentPort(data) { |
| 114 | return request({ | 192 | return request({ |
| 115 | - url: '/system/user/profile/avatar', | 193 | + url: '/sysUser/changeCurrentPort', |
| 116 | method: 'post', | 194 | method: 'post', |
| 117 | data: data | 195 | data: data |
| 118 | }) | 196 | }) |
| 119 | -} | 197 | +} |
| 120 | - | ||
| 121 | -// 下载用户导入模板 | ||
| 122 | -export function importTemplate() { | ||
| 123 | - return request({ | ||
| 124 | - url: '/system/user/importTemplate', | ||
| 125 | - method: 'get' | ||
| 126 | - }) | ||
| 127 | -} | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| 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,26 +3,44 @@ | ... | @@ -3,26 +3,44 @@ |
| 3 | * Copyright (c) 2019 FedEx | 3 | * Copyright (c) 2019 FedEx |
| 4 | */ | 4 | */ |
| 5 | 5 | ||
| 6 | -import store from '@/store' | 6 | + import store from '@/store' |
| 7 | 7 | ||
| 8 | -export default { | 8 | + export default { |
| 9 | - inserted(el, binding, vnode) { | 9 | + inserted(el, binding, vnode) { |
| 10 | - const { value } = binding | 10 | + const { value } = binding |
| 11 | - const all_permission = "*:*:*"; | 11 | + const all_permission = "*:*:*"; |
| 12 | - const permissions = store.getters && store.getters.permissions | 12 | + const permissions = store.getters && store.getters.permissions |
| 13 | - | 13 | + |
| 14 | - if (value && value instanceof Array && value.length > 0) { | 14 | + if (value && value instanceof Array && value.length > 0) { |
| 15 | - const permissionFlag = value | 15 | + const permissionFlag = value |
| 16 | - | 16 | + |
| 17 | - const hasPermissions = permissions.some(permission => { | 17 | + const hasPermissions = permissions.some(permission => { |
| 18 | - return all_permission === permission || permissionFlag.includes(permission) | 18 | + return all_permission === permission || permissionFlag.includes(permission) |
| 19 | - }) | 19 | + }) |
| 20 | - | 20 | + |
| 21 | - if (!hasPermissions) { | 21 | + if (!hasPermissions) { |
| 22 | - el.parentNode && el.parentNode.removeChild(el) | 22 | + el.parentNode && el.parentNode.removeChild(el) |
| 23 | + } | ||
| 24 | + } else { | ||
| 25 | + throw new Error(`请设置操作权限标签值`) | ||
| 23 | } | 26 | } |
| 24 | - } else { | 27 | + }, |
| 25 | - throw new Error(`请设置操作权限标签值`) | 28 | + |
| 29 | + //路由权限处理 | ||
| 30 | + routerPer(router){ | ||
| 31 | + const permissions = store.getters && store.getters.permissions | ||
| 32 | + let newRouter = []; | ||
| 33 | + router.forEach(item => { | ||
| 34 | + permissions.forEach(per=>{ | ||
| 35 | + if(item.meta.permissions == per){ | ||
| 36 | + newRouter.push(item) | ||
| 37 | + } | ||
| 38 | + }) | ||
| 39 | + if(item.children && item.children.length){ | ||
| 40 | + item.children = this.routerPer(item.children) | ||
| 41 | + } | ||
| 42 | + }); | ||
| 43 | + return newRouter | ||
| 26 | } | 44 | } |
| 27 | } | 45 | } |
| 28 | -} | 46 | + |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| 1 | <template> | 1 | <template> |
| 2 | <div class="navbar"> | 2 | <div class="navbar"> |
| 3 | - <hamburger id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" /> | 3 | + <hamburger |
| 4 | - | 4 | + id="hamburger-container" |
| 5 | - <breadcrumb id="breadcrumb-container" class="breadcrumb-container" v-if="!topNav"/> | 5 | + :is-active="sidebar.opened" |
| 6 | - <top-nav id="topmenu-container" class="topmenu-container" v-if="topNav"/> | 6 | + class="hamburger-container" |
| 7 | + @toggleClick="toggleSideBar" | ||
| 8 | + /> | ||
| 9 | + <breadcrumb | ||
| 10 | + id="breadcrumb-container" | ||
| 11 | + class="breadcrumb-container" | ||
| 12 | + v-if="!topNav" | ||
| 13 | + /> | ||
| 14 | + <top-nav id="topmenu-container" class="topmenu-container" v-if="topNav" /> | ||
| 7 | 15 | ||
| 8 | <div class="right-menu"> | 16 | <div class="right-menu"> |
| 9 | - <template v-if="device!=='mobile'"> | 17 | + <template v-if="device !== 'mobile'"> </template> |
| 10 | - | 18 | + <el-select |
| 11 | - </template> | 19 | + v-model="portName" |
| 12 | - | 20 | + size="mini" |
| 13 | - <el-dropdown class="avatar-container right-menu-item hover-effect" trigger="click"> | 21 | + style="width: 120px; top: -17px; right: 7px" |
| 14 | - <div class="avatar-wrapper"> | 22 | + placeholder="选择口岸" |
| 15 | - <img :src="avatar" class="user-avatar"> | 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> | ||
| 32 | + <el-dropdown | ||
| 33 | + class="avatar-container right-menu-item hover-effect" | ||
| 34 | + trigger="click" | ||
| 35 | + > | ||
| 36 | + <div class="userName-wrapper"> | ||
| 37 | + <!-- <img :src="avatar" class="user-avatar" /> --> | ||
| 38 | + <span><i class="el-icon-user-solid" style="color:#1890ff"></i>欢迎!{{userName}}</span> | ||
| 16 | </div> | 39 | </div> |
| 17 | <el-dropdown-menu slot="dropdown"> | 40 | <el-dropdown-menu slot="dropdown"> |
| 18 | - <router-link to="/user/profile"> | ||
| 19 | - </router-link> | ||
| 20 | <el-dropdown-item @click.native="logout"> | 41 | <el-dropdown-item @click.native="logout"> |
| 21 | <span>退出登录</span> | 42 | <span>退出登录</span> |
| 22 | </el-dropdown-item> | 43 | </el-dropdown-item> |
| 23 | </el-dropdown-menu> | 44 | </el-dropdown-menu> |
| 24 | </el-dropdown> | 45 | </el-dropdown> |
| 46 | + <!-- <el-select | ||
| 47 | + v-model="locale" | ||
| 48 | + size="mini" | ||
| 49 | + @change="local" | ||
| 50 | + style="width: 75px; top: -17px; right: 7px" | ||
| 51 | + > | ||
| 52 | + <el-option label="中文" value="zh"> </el-option> | ||
| 53 | + <el-option label="英文" value="en"> </el-option> | ||
| 54 | + </el-select> --> | ||
| 25 | </div> | 55 | </div> |
| 26 | </div> | 56 | </div> |
| 27 | </template> | 57 | </template> |
| 28 | 58 | ||
| 29 | <script> | 59 | <script> |
| 30 | -import { mapGetters } from 'vuex' | 60 | +import { mapGetters } from "vuex"; |
| 31 | -import Breadcrumb from '@/components/Breadcrumb' | 61 | +import Breadcrumb from "@/components/Breadcrumb"; |
| 32 | -import TopNav from '@/components/TopNav' | 62 | +import TopNav from "@/components/TopNav"; |
| 33 | -import Hamburger from '@/components/Hamburger' | 63 | +import Hamburger from "@/components/Hamburger"; |
| 34 | 64 | ||
| 35 | export default { | 65 | export default { |
| 36 | components: { | 66 | components: { |
| 37 | Breadcrumb, | 67 | Breadcrumb, |
| 38 | TopNav, | 68 | TopNav, |
| 39 | - Hamburger | 69 | + Hamburger, |
| 70 | + }, | ||
| 71 | + data() { | ||
| 72 | + return { | ||
| 73 | + userName:"", | ||
| 74 | + portNameList: [], | ||
| 75 | + locale: "zh", | ||
| 76 | + }; | ||
| 77 | + }, | ||
| 78 | + created() { | ||
| 79 | + this.portNameList = this.$store.state.user.portNames; | ||
| 80 | + this.userName = this.$store.state.user.name; | ||
| 40 | }, | 81 | }, |
| 41 | computed: { | 82 | computed: { |
| 42 | - ...mapGetters([ | 83 | + ...mapGetters(["sidebar", "avatar", "device"]), |
| 43 | - 'sidebar', | ||
| 44 | - 'avatar', | ||
| 45 | - 'device' | ||
| 46 | - ]), | ||
| 47 | setting: { | 84 | setting: { |
| 48 | get() { | 85 | get() { |
| 49 | - return this.$store.state.settings.showSettings | 86 | + return this.$store.state.settings.showSettings; |
| 50 | }, | 87 | }, |
| 51 | set(val) { | 88 | set(val) { |
| 52 | - this.$store.dispatch('settings/changeSetting', { | 89 | + this.$store.dispatch("settings/changeSetting", { |
| 53 | - key: 'showSettings', | 90 | + key: "showSettings", |
| 54 | - value: val | 91 | + value: val, |
| 55 | - }) | 92 | + }); |
| 56 | - } | 93 | + }, |
| 57 | }, | 94 | }, |
| 58 | topNav: { | 95 | topNav: { |
| 59 | get() { | 96 | get() { |
| 60 | - return this.$store.state.settings.topNav | 97 | + return this.$store.state.settings.topNav; |
| 61 | - } | 98 | + }, |
| 62 | - } | 99 | + }, |
| 100 | + //切换口岸 | ||
| 101 | + portName: { | ||
| 102 | + get() { | ||
| 103 | + return this.$store.state.user.activePortName; | ||
| 104 | + }, | ||
| 105 | + set(val) { | ||
| 106 | + this.$store | ||
| 107 | + .dispatch("changePort", val) | ||
| 108 | + .then((res) => { | ||
| 109 | + if (res.code === 200) { | ||
| 110 | + this.$store.dispatch('tagsView/delAllCachedViews') | ||
| 111 | + this.$store.dispatch('tagsView/delAllVisitedViews') | ||
| 112 | + // location.reload(); | ||
| 113 | + if(this.$route.path != '/index'){ | ||
| 114 | + this.$router.push('/index') | ||
| 115 | + } | ||
| 116 | + } else { | ||
| 117 | + this.$confirm(res.msg, "提示", { | ||
| 118 | + type: "warning", | ||
| 119 | + }).then(()=>{ | ||
| 120 | + // location.reload(); | ||
| 121 | + if(this.$route.path != '/index'){ | ||
| 122 | + this.$router.push('/index') | ||
| 123 | + } | ||
| 124 | + }).catch(()=>{ | ||
| 125 | + // location.reload(); | ||
| 126 | + if(this.$route.path != '/index'){ | ||
| 127 | + this.$router.push('/index') | ||
| 128 | + } | ||
| 129 | + }); | ||
| 130 | + } | ||
| 131 | + }) | ||
| 132 | + .catch((err) => { | ||
| 133 | + console.log(err); | ||
| 134 | + }); | ||
| 135 | + }, | ||
| 136 | + }, | ||
| 63 | }, | 137 | }, |
| 64 | methods: { | 138 | methods: { |
| 65 | toggleSideBar() { | 139 | toggleSideBar() { |
| 66 | - this.$store.dispatch('app/toggleSideBar') | 140 | + this.$store.dispatch("app/toggleSideBar"); |
| 67 | }, | 141 | }, |
| 68 | async logout() { | 142 | async logout() { |
| 69 | - this.$confirm('确定注销并退出系统吗?', '提示', { | 143 | + this.$confirm("确定注销并退出系统吗?", "提示", { |
| 70 | - confirmButtonText: '确定', | 144 | + confirmButtonText: "确定", |
| 71 | - cancelButtonText: '取消', | 145 | + cancelButtonText: "取消", |
| 72 | - type: 'warning' | 146 | + type: "warning", |
| 73 | }).then(() => { | 147 | }).then(() => { |
| 74 | - this.$store.dispatch('LogOut').then(() => { | 148 | + this.$store.dispatch("LogOut").then(() => { |
| 75 | - location.href = '/index'; | 149 | + location.href = "/index"; |
| 76 | - }) | 150 | + // window.location.href = "https://test.secure.fedex.com/logout";//wsso系统跳转 |
| 77 | - }) | 151 | + }); |
| 78 | - } | 152 | + }); |
| 79 | - } | 153 | + }, |
| 80 | -} | 154 | + local(val) { |
| 155 | + this.$i18n.locale = val; //此处val为 zh 或者 en | ||
| 156 | + }, | ||
| 157 | + }, | ||
| 158 | +}; | ||
| 81 | </script> | 159 | </script> |
| 82 | 160 | ||
| 83 | <style lang="scss" scoped> | 161 | <style lang="scss" scoped> |
| ... | @@ -86,18 +164,18 @@ export default { | ... | @@ -86,18 +164,18 @@ export default { |
| 86 | overflow: hidden; | 164 | overflow: hidden; |
| 87 | position: relative; | 165 | position: relative; |
| 88 | background: #fff; | 166 | background: #fff; |
| 89 | - box-shadow: 0 1px 4px rgba(0,21,41,.08); | 167 | + box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08); |
| 90 | 168 | ||
| 91 | .hamburger-container { | 169 | .hamburger-container { |
| 92 | line-height: 46px; | 170 | line-height: 46px; |
| 93 | height: 100%; | 171 | height: 100%; |
| 94 | float: left; | 172 | float: left; |
| 95 | cursor: pointer; | 173 | cursor: pointer; |
| 96 | - transition: background .3s; | 174 | + transition: background 0.3s; |
| 97 | - -webkit-tap-highlight-color:transparent; | 175 | + -webkit-tap-highlight-color: transparent; |
| 98 | 176 | ||
| 99 | &:hover { | 177 | &:hover { |
| 100 | - background: rgba(0, 0, 0, .025) | 178 | + background: rgba(0, 0, 0, 0.025); |
| 101 | } | 179 | } |
| 102 | } | 180 | } |
| 103 | 181 | ||
| ... | @@ -134,21 +212,28 @@ export default { | ... | @@ -134,21 +212,28 @@ export default { |
| 134 | 212 | ||
| 135 | &.hover-effect { | 213 | &.hover-effect { |
| 136 | cursor: pointer; | 214 | cursor: pointer; |
| 137 | - transition: background .3s; | 215 | + transition: background 0.3s; |
| 138 | 216 | ||
| 139 | &:hover { | 217 | &:hover { |
| 140 | - background: rgba(0, 0, 0, .025) | 218 | + background: rgba(0, 0, 0, 0.025); |
| 141 | } | 219 | } |
| 142 | } | 220 | } |
| 143 | } | 221 | } |
| 144 | 222 | ||
| 145 | .avatar-container { | 223 | .avatar-container { |
| 146 | - margin-right: 30px; | 224 | + text-align: center; |
| 147 | - | 225 | + margin-right: 15px; |
| 148 | - .avatar-wrapper { | 226 | + font-weight: 700; |
| 149 | - margin-top: 5px; | 227 | + i{ |
| 228 | + display: inline-block; | ||
| 229 | + height: 50px; | ||
| 230 | + margin-right:5px; | ||
| 231 | + font-size: 24px; | ||
| 232 | + line-height: 50px; | ||
| 233 | + } | ||
| 234 | + .userName-wrapper { | ||
| 150 | position: relative; | 235 | position: relative; |
| 151 | - | 236 | + font-size:14px; |
| 152 | .user-avatar { | 237 | .user-avatar { |
| 153 | cursor: pointer; | 238 | cursor: pointer; |
| 154 | width: 40px; | 239 | width: 40px; | ... | ... |
| ... | @@ -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 => { |
| 40 | - setToken(res.data) | 52 | + if(res.code === 200){ |
| 41 | - commit('SET_TOKEN', res.data) | 53 | + setToken(res.data) |
| 42 | - resolve() | 54 | + commit('SET_TOKEN', res.data) |
| 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://testsso.ute.apac.fedex.com/logout";//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://sso.secure.fedex.com/logout";//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://sso.secure.fedex.com/logout";//wsso系统跳转 | ||
| 89 | commit('SET_TOKEN', '') | 132 | commit('SET_TOKEN', '') |
| 90 | removeToken() | 133 | removeToken() |
| 91 | resolve() | 134 | resolve() | ... | ... |
| ... | @@ -3,180 +3,180 @@ | ... | @@ -3,180 +3,180 @@ |
| 3 | * Copyright (c) 2019 FedEx | 3 | * Copyright (c) 2019 FedEx |
| 4 | */ | 4 | */ |
| 5 | 5 | ||
| 6 | -const baseURL = process.env.VUE_APP_BASE_API | ||
| 7 | - | ||
| 8 | -// 日期格式化 | ||
| 9 | -export function parseTime(time, pattern) { | ||
| 10 | - debugger | ||
| 11 | - if (arguments.length === 0 || !time) { | ||
| 12 | - return null | ||
| 13 | - } | ||
| 14 | - const format = pattern || '{y}-{m}-{d} {h}:{i}:{s}' | ||
| 15 | - let date | ||
| 16 | - if (typeof time === 'object') { | ||
| 17 | - date = time | ||
| 18 | - } else { | ||
| 19 | - if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) { | ||
| 20 | - time = parseInt(time) | ||
| 21 | - } else if (typeof time === 'string') { | ||
| 22 | - time = time.replace(new RegExp(/-/gm), '/'); | ||
| 23 | - } | ||
| 24 | - if ((typeof time === 'number') && (time.toString().length === 10)) { | ||
| 25 | - time = time * 1000 | ||
| 26 | - } | ||
| 27 | - date = new Date(time) | ||
| 28 | - } | ||
| 29 | - const formatObj = { | ||
| 30 | - y: date.getFullYear(), | ||
| 31 | - m: date.getMonth() + 1, | ||
| 32 | - d: date.getDate(), | ||
| 33 | - h: date.getHours(), | ||
| 34 | - i: date.getMinutes(), | ||
| 35 | - s: date.getSeconds(), | ||
| 36 | - a: date.getDay() | ||
| 37 | - } | ||
| 38 | - const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => { | ||
| 39 | - let value = formatObj[key] | ||
| 40 | - // Note: getDay() returns 0 on Sunday | ||
| 41 | - if (key === 'a') { return ['日', '一', '二', '三', '四', '五', '六'][value] } | ||
| 42 | - if (result.length > 0 && value < 10) { | ||
| 43 | - value = '0' + value | ||
| 44 | - } | ||
| 45 | - return value || 0 | ||
| 46 | - }) | ||
| 47 | - return time_str | ||
| 48 | -} | ||
| 49 | - | ||
| 50 | -// 表单重置 | ||
| 51 | -export function resetForm(refName) { | ||
| 52 | - if (this.$refs[refName]) { | ||
| 53 | - this.$refs[refName].resetFields(); | ||
| 54 | - } | ||
| 55 | -} | ||
| 56 | - | ||
| 57 | -// 添加日期范围 | ||
| 58 | -export function addDateRange(params, dateRange, propName) { | ||
| 59 | - var search = params; | ||
| 60 | - search.params = {}; | ||
| 61 | - if (null != dateRange && '' != dateRange) { | ||
| 62 | - if (typeof (propName) === "undefined") { | ||
| 63 | - search.params["beginTime"] = dateRange[0]; | ||
| 64 | - search.params["endTime"] = dateRange[1]; | ||
| 65 | - } else { | ||
| 66 | - search.params["begin" + propName] = dateRange[0]; | ||
| 67 | - search.params["end" + propName] = dateRange[1]; | ||
| 68 | - } | ||
| 69 | - } | ||
| 70 | - return search; | ||
| 71 | -} | ||
| 72 | - | ||
| 73 | -// 回显数据字典 | ||
| 74 | -export function selectDictLabel(datas, value) { | ||
| 75 | - var actions = []; | ||
| 76 | - Object.keys(datas).some((key) => { | ||
| 77 | - if (datas[key].dictValue == ('' + value)) { | ||
| 78 | - actions.push(datas[key].dictLabel); | ||
| 79 | - return true; | ||
| 80 | - } | ||
| 81 | - }) | ||
| 82 | - return actions.join(''); | ||
| 83 | -} | ||
| 84 | - | ||
| 85 | -// 回显数据字典(字符串数组) | ||
| 86 | -export function selectDictLabels(datas, value, separator) { | ||
| 87 | - var actions = []; | ||
| 88 | - var currentSeparator = undefined === separator ? "," : separator; | ||
| 89 | - var temp = value.split(currentSeparator); | ||
| 90 | - Object.keys(value.split(currentSeparator)).some((val) => { | ||
| 91 | - Object.keys(datas).some((key) => { | ||
| 92 | - if (datas[key].dictValue == ('' + temp[val])) { | ||
| 93 | - actions.push(datas[key].dictLabel + currentSeparator); | ||
| 94 | - } | ||
| 95 | - }) | ||
| 96 | - }) | ||
| 97 | - return actions.join('').substring(0, actions.join('').length - 1); | ||
| 98 | -} | ||
| 99 | - | ||
| 100 | -// 通用下载方法 | ||
| 101 | -export function download(fileName) { | ||
| 102 | - window.location.href = baseURL + "/common/download?fileName=" + encodeURI(fileName) + "&delete=" + true; | ||
| 103 | -} | ||
| 104 | - | ||
| 105 | -// 字符串格式化(%s ) | ||
| 106 | -export function sprintf(str) { | ||
| 107 | - var args = arguments, flag = true, i = 1; | ||
| 108 | - str = str.replace(/%s/g, function () { | ||
| 109 | - var arg = args[i++]; | ||
| 110 | - if (typeof arg === 'undefined') { | ||
| 111 | - flag = false; | ||
| 112 | - return ''; | ||
| 113 | - } | ||
| 114 | - return arg; | ||
| 115 | - }); | ||
| 116 | - return flag ? str : ''; | ||
| 117 | -} | ||
| 118 | - | ||
| 119 | -// 转换字符串,undefined,null等转化为"" | ||
| 120 | -export function praseStrEmpty(str) { | ||
| 121 | - if (!str || str == "undefined" || str == "null") { | ||
| 122 | - return ""; | ||
| 123 | - } | ||
| 124 | - return str; | ||
| 125 | -} | ||
| 126 | - | ||
| 127 | -/** | ||
| 128 | - * 构造树型结构数据 | ||
| 129 | - * @param {*} data 数据源 | ||
| 130 | - * @param {*} id id字段 默认 'id' | ||
| 131 | - * @param {*} parentId 父节点字段 默认 'parentId' | ||
| 132 | - * @param {*} children 孩子节点字段 默认 'children' | ||
| 133 | - */ | ||
| 134 | -export function handleTree(data, id, parentId, children) { | ||
| 135 | - let config = { | ||
| 136 | - id: id || 'id', | ||
| 137 | - parentId: parentId || 'parentId', | ||
| 138 | - childrenList: children || 'children' | ||
| 139 | - }; | ||
| 140 | - | ||
| 141 | - var childrenListMap = {}; | ||
| 142 | - var nodeIds = {}; | ||
| 143 | - var tree = []; | ||
| 144 | - | ||
| 145 | - for (let d of data) { | ||
| 146 | - let parentId = d[config.parentId]; | ||
| 147 | - if (childrenListMap[parentId] == null) { | ||
| 148 | - childrenListMap[parentId] = []; | ||
| 149 | - } | ||
| 150 | - nodeIds[d[config.id]] = d; | ||
| 151 | - childrenListMap[parentId].push(d); | ||
| 152 | - } | ||
| 153 | - | ||
| 154 | - for (let d of data) { | ||
| 155 | - let parentId = d[config.parentId]; | ||
| 156 | - if (nodeIds[parentId] == null) { | ||
| 157 | - tree.push(d); | ||
| 158 | - } | ||
| 159 | - } | ||
| 160 | - | ||
| 161 | - for (let t of tree) { | ||
| 162 | - adaptToChildrenList(t); | ||
| 163 | - } | ||
| 164 | - | ||
| 165 | - function adaptToChildrenList(o) { | ||
| 166 | - if (childrenListMap[o[config.id]] !== null) { | ||
| 167 | - o[config.childrenList] = childrenListMap[o[config.id]]; | ||
| 168 | - } | ||
| 169 | - if (o[config.childrenList]) { | ||
| 170 | - for (let c of o[config.childrenList]) { | ||
| 171 | - adaptToChildrenList(c); | ||
| 172 | - } | ||
| 173 | - } | ||
| 174 | - } | ||
| 175 | - return tree; | ||
| 176 | -} | ||
| 177 | - | ||
| 178 | -//字符串英文转大写,;转英文; | ||
| 179 | -export function upCase(str){ | ||
| 180 | - let newStr = str.replace(/;/g,";").toUpperCase().trim(); | ||
| 181 | - return newStr; | ||
| 182 | -} | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 6 | + const baseURL = process.env.VUE_APP_BASE_API | ||
| 7 | + | ||
| 8 | + // 日期格式化 | ||
| 9 | + export function parseTime(time, pattern) { | ||
| 10 | + //debugger | ||
| 11 | + if (arguments.length === 0 || !time) { | ||
| 12 | + return null | ||
| 13 | + } | ||
| 14 | + const format = pattern || '{y}-{m}-{d} {h}:{i}:{s}' | ||
| 15 | + let date | ||
| 16 | + if (typeof time === 'object') { | ||
| 17 | + date = time | ||
| 18 | + } else { | ||
| 19 | + if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) { | ||
| 20 | + time = parseInt(time) | ||
| 21 | + } else if (typeof time === 'string') { | ||
| 22 | + time = time.replace(new RegExp(/-/gm), '/'); | ||
| 23 | + } | ||
| 24 | + if ((typeof time === 'number') && (time.toString().length === 10)) { | ||
| 25 | + time = time * 1000 | ||
| 26 | + } | ||
| 27 | + date = new Date(time) | ||
| 28 | + } | ||
| 29 | + const formatObj = { | ||
| 30 | + y: date.getFullYear(), | ||
| 31 | + m: date.getMonth() + 1, | ||
| 32 | + d: date.getDate(), | ||
| 33 | + h: date.getHours(), | ||
| 34 | + i: date.getMinutes(), | ||
| 35 | + s: date.getSeconds(), | ||
| 36 | + a: date.getDay() | ||
| 37 | + } | ||
| 38 | + const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => { | ||
| 39 | + let value = formatObj[key] | ||
| 40 | + // Note: getDay() returns 0 on Sunday | ||
| 41 | + if (key === 'a') { return ['日', '一', '二', '三', '四', '五', '六'][value] } | ||
| 42 | + if (result.length > 0 && value < 10) { | ||
| 43 | + value = '0' + value | ||
| 44 | + } | ||
| 45 | + return value || 0 | ||
| 46 | + }) | ||
| 47 | + return time_str | ||
| 48 | + } | ||
| 49 | + | ||
| 50 | + // 表单重置 | ||
| 51 | + export function resetForm(refName) { | ||
| 52 | + if (this.$refs[refName]) { | ||
| 53 | + this.$refs[refName].resetFields(); | ||
| 54 | + } | ||
| 55 | + } | ||
| 56 | + | ||
| 57 | + // 添加日期范围 | ||
| 58 | + export function addDateRange(params, dateRange, propName) { | ||
| 59 | + var search = params; | ||
| 60 | + search.params = {}; | ||
| 61 | + if (null != dateRange && '' != dateRange) { | ||
| 62 | + if (typeof (propName) === "undefined") { | ||
| 63 | + search.params["beginTime"] = dateRange[0]; | ||
| 64 | + search.params["endTime"] = dateRange[1]; | ||
| 65 | + } else { | ||
| 66 | + search.params["begin" + propName] = dateRange[0]; | ||
| 67 | + search.params["end" + propName] = dateRange[1]; | ||
| 68 | + } | ||
| 69 | + } | ||
| 70 | + return search; | ||
| 71 | + } | ||
| 72 | + | ||
| 73 | + // 回显数据字典 | ||
| 74 | + export function selectDictLabel(datas, value) { | ||
| 75 | + var actions = []; | ||
| 76 | + Object.keys(datas).some((key) => { | ||
| 77 | + if (datas[key].dictValue == ('' + value)) { | ||
| 78 | + actions.push(datas[key].dictLabel); | ||
| 79 | + return true; | ||
| 80 | + } | ||
| 81 | + }) | ||
| 82 | + return actions.join(''); | ||
| 83 | + } | ||
| 84 | + | ||
| 85 | + // 回显数据字典(字符串数组) | ||
| 86 | + export function selectDictLabels(datas, value, separator) { | ||
| 87 | + var actions = []; | ||
| 88 | + var currentSeparator = undefined === separator ? "," : separator; | ||
| 89 | + var temp = value.split(currentSeparator); | ||
| 90 | + Object.keys(value.split(currentSeparator)).some((val) => { | ||
| 91 | + Object.keys(datas).some((key) => { | ||
| 92 | + if (datas[key].dictValue == ('' + temp[val])) { | ||
| 93 | + actions.push(datas[key].dictLabel + currentSeparator); | ||
| 94 | + } | ||
| 95 | + }) | ||
| 96 | + }) | ||
| 97 | + return actions.join('').substring(0, actions.join('').length - 1); | ||
| 98 | + } | ||
| 99 | + | ||
| 100 | + // 通用下载方法 | ||
| 101 | + export function download(fileName) { | ||
| 102 | + window.location.href = baseURL + "/common/download?fileName=" + encodeURI(fileName) + "&delete=" + true; | ||
| 103 | + } | ||
| 104 | + | ||
| 105 | + // 字符串格式化(%s ) | ||
| 106 | + export function sprintf(str) { | ||
| 107 | + var args = arguments, flag = true, i = 1; | ||
| 108 | + str = str.replace(/%s/g, function () { | ||
| 109 | + var arg = args[i++]; | ||
| 110 | + if (typeof arg === 'undefined') { | ||
| 111 | + flag = false; | ||
| 112 | + return ''; | ||
| 113 | + } | ||
| 114 | + return arg; | ||
| 115 | + }); | ||
| 116 | + return flag ? str : ''; | ||
| 117 | + } | ||
| 118 | + | ||
| 119 | + // 转换字符串,undefined,null等转化为"" | ||
| 120 | + export function praseStrEmpty(str) { | ||
| 121 | + if (!str || str == "undefined" || str == "null") { | ||
| 122 | + return ""; | ||
| 123 | + } | ||
| 124 | + return str; | ||
| 125 | + } | ||
| 126 | + | ||
| 127 | + /** | ||
| 128 | + * 构造树型结构数据 | ||
| 129 | + * @param {*} data 数据源 | ||
| 130 | + * @param {*} id id字段 默认 'id' | ||
| 131 | + * @param {*} parentId 父节点字段 默认 'parentId' | ||
| 132 | + * @param {*} children 孩子节点字段 默认 'children' | ||
| 133 | + */ | ||
| 134 | + export function handleTree(data, id, parentId, children) { | ||
| 135 | + let config = { | ||
| 136 | + id: id || 'id', | ||
| 137 | + parentId: parentId || 'parentId', | ||
| 138 | + childrenList: children || 'children' | ||
| 139 | + }; | ||
| 140 | + | ||
| 141 | + var childrenListMap = {}; | ||
| 142 | + var nodeIds = {}; | ||
| 143 | + var tree = []; | ||
| 144 | + | ||
| 145 | + for (let d of data) { | ||
| 146 | + let parentId = d[config.parentId]; | ||
| 147 | + if (childrenListMap[parentId] == null) { | ||
| 148 | + childrenListMap[parentId] = []; | ||
| 149 | + } | ||
| 150 | + nodeIds[d[config.id]] = d; | ||
| 151 | + childrenListMap[parentId].push(d); | ||
| 152 | + } | ||
| 153 | + | ||
| 154 | + for (let d of data) { | ||
| 155 | + let parentId = d[config.parentId]; | ||
| 156 | + if (nodeIds[parentId] == null) { | ||
| 157 | + tree.push(d); | ||
| 158 | + } | ||
| 159 | + } | ||
| 160 | + | ||
| 161 | + for (let t of tree) { | ||
| 162 | + adaptToChildrenList(t); | ||
| 163 | + } | ||
| 164 | + | ||
| 165 | + function adaptToChildrenList(o) { | ||
| 166 | + if (childrenListMap[o[config.id]] !== null) { | ||
| 167 | + o[config.childrenList] = childrenListMap[o[config.id]]; | ||
| 168 | + } | ||
| 169 | + if (o[config.childrenList]) { | ||
| 170 | + for (let c of o[config.childrenList]) { | ||
| 171 | + adaptToChildrenList(c); | ||
| 172 | + } | ||
| 173 | + } | ||
| 174 | + } | ||
| 175 | + return tree; | ||
| 176 | + } | ||
| 177 | + | ||
| 178 | + //字符串英文转大写,;转英文; | ||
| 179 | + export function upCase(str){ | ||
| 180 | + let newStr = str.replace(/;/g,";").toUpperCase(); | ||
| 181 | + return newStr; | ||
| 182 | + } | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -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 | } | ... | ... |
| ... | @@ -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,9 +825,13 @@ export default { | ... | @@ -829,9 +825,13 @@ 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 | - | ||
| 835 | mounted() { | 835 | mounted() { |
| 836 | window.addEventListener("keydown", (code) => { | 836 | window.addEventListener("keydown", (code) => { |
| 837 | if (code.keyCode === 16 && code.shiftKey) { | 837 | if (code.keyCode === 16 && code.shiftKey) { |
| ... | @@ -843,6 +843,7 @@ export default { | ... | @@ -843,6 +843,7 @@ export default { |
| 843 | this.shiftKey = false; | 843 | this.shiftKey = false; |
| 844 | } | 844 | } |
| 845 | }); | 845 | }); |
| 846 | + this.tableHeight = window.innerHeight - this.$refs.form.$el.offsetHeight-60 | ||
| 846 | }, | 847 | }, |
| 847 | methods: { | 848 | methods: { |
| 848 | //查询条件 | 849 | //查询条件 |
| ... | @@ -889,9 +890,9 @@ export default { | ... | @@ -889,9 +890,9 @@ export default { |
| 889 | this.tableData = res.data.list; | 890 | this.tableData = res.data.list; |
| 890 | this.totalCount = res.data.total; | 891 | this.totalCount = res.data.total; |
| 891 | if (res.data.list.length > 0) { | 892 | if (res.data.list.length > 0) { |
| 892 | - this.tableData.forEach((item, index = 0) => { | 893 | + // this.tableData.forEach((item, index = 0) => { |
| 893 | - item.index = index; | 894 | + // item.index = index; |
| 894 | - }); | 895 | + // }); |
| 895 | } else { | 896 | } else { |
| 896 | this.$message({ | 897 | this.$message({ |
| 897 | message: "未查询到数据", | 898 | message: "未查询到数据", |
| ... | @@ -1026,14 +1027,20 @@ export default { | ... | @@ -1026,14 +1027,20 @@ export default { |
| 1026 | } | 1027 | } |
| 1027 | }); | 1028 | }); |
| 1028 | data = data.sort(this.$refs.newTables.compare(val.prop, val.order)); | 1029 | data = data.sort(this.$refs.newTables.compare(val.prop, val.order)); |
| 1029 | - if (val.order != "ascending") { | 1030 | + if (val.order == "descending") { |
| 1030 | this.tableData = nullData.concat(data); | 1031 | this.tableData = nullData.concat(data); |
| 1031 | - } else { | 1032 | + } else{ |
| 1032 | this.tableData = data.concat(nullData); | 1033 | this.tableData = data.concat(nullData); |
| 1033 | } | 1034 | } |
| 1034 | - this.tableData.forEach((item, index = 0) => { | 1035 | + this.tableSelection = [] |
| 1035 | - item.index = index; | 1036 | + this.cargoTotal() |
| 1036 | - }); | 1037 | + // this.tableData.forEach((item, index = 0) => { |
| 1038 | + // item.index = index; | ||
| 1039 | + // }); | ||
| 1040 | + }, | ||
| 1041 | + sizeChange(val){ | ||
| 1042 | + this.size = val | ||
| 1043 | + this.select(0); | ||
| 1037 | }, | 1044 | }, |
| 1038 | //添加到航班 | 1045 | //添加到航班 |
| 1039 | addFit() { | 1046 | addFit() { |
| ... | @@ -1084,6 +1091,9 @@ export default { | ... | @@ -1084,6 +1091,9 @@ export default { |
| 1084 | }, | 1091 | }, |
| 1085 | }, | 1092 | }, |
| 1086 | }, | 1093 | }, |
| 1094 | + deactivated(){ | ||
| 1095 | + this.tableData = [] | ||
| 1096 | + }, | ||
| 1087 | }; | 1097 | }; |
| 1088 | </script> | 1098 | </script> |
| 1089 | 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,29 +57,25 @@ | ... | @@ -56,29 +57,25 @@ |
| 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"> | 64 | + <el-button |
| 66 | - <el-button | 65 | + type="primary" |
| 67 | - type="primary" | 66 | + icon="el-icon-plus" |
| 68 | - icon="el-icon-plus" | 67 | + size="mini" |
| 69 | - 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 | > |
| 78 | </el-form-item> | 75 | </el-form-item> |
| 79 | </el-form> | 76 | </el-form> |
| 80 | 77 | ||
| 81 | - <el-table | 78 | + <el-table |
| 82 | v-loading="loading" | 79 | v-loading="loading" |
| 83 | height="550" | 80 | height="550" |
| 84 | size="small" | 81 | size="small" |
| ... | @@ -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,22 +527,24 @@ export default { | ... | @@ -490,22 +527,24 @@ export default { |
| 490 | confirmButtonText: "确定", | 527 | confirmButtonText: "确定", |
| 491 | cancelButtonText: "取消", | 528 | cancelButtonText: "取消", |
| 492 | type: "warning", | 529 | type: "warning", |
| 493 | - }).then(() => { | 530 | + }) |
| 494 | - let disable = { | 531 | + .then(() => { |
| 495 | - id: row.id, | 532 | + let disable = { |
| 496 | - status: status, | 533 | + id: row.id, |
| 497 | - }; | 534 | + status: status, |
| 498 | - delOrEnableORDisableApi(disable) | 535 | + }; |
| 499 | - .then((response) => { | 536 | + |
| 500 | - if (response.code == 200) { | 537 | + return delOrEnableORDisableApi(disable); |
| 501 | - this.findSourceFlightRules(); | 538 | + }) |
| 502 | - this.msgSuccess(statusText + "成功"); | 539 | + .then((response) => { |
| 503 | - } else { | 540 | + if (response.code == 200) { |
| 504 | - this.msgError(response.msg); | 541 | + this.findSourceFlightRules(); |
| 505 | - } | 542 | + this.msgSuccess(statusText + "成功"); |
| 506 | - }) | 543 | + } else { |
| 507 | - .catch(() => {}); | 544 | + this.msgError(response.msg); |
| 508 | - }); | 545 | + } |
| 546 | + }) | ||
| 547 | + .catch(() => {}); | ||
| 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 | + <el-table-column | ||
| 23 | + v-for="(item, index) in tableHeader" | ||
| 24 | + :prop="item.value" | ||
| 25 | + :label="item.name" | ||
| 26 | + :key="index" | ||
| 27 | + :align="item.align" | ||
| 28 | + header-align="center" | ||
| 29 | + showOverflowTooltip | ||
| 30 | + :width="item.width" | ||
| 31 | + :formatter="formatter" | ||
| 32 | + > | ||
| 33 | + <template slot-scope="scope"> | ||
| 34 | + <el-tag v-if="item.value === 'menuType'" :type="scope.row.menuType === 'B'?'':'success'" | ||
| 35 | + disable-transitions>{{scope.row.menuType === 'B'?'按钮':'菜单'}}</el-tag> | ||
| 36 | + <span v-else>{{scope.row.title}}</span> | ||
| 37 | + </template> | ||
| 38 | + </el-table-column> | ||
| 39 | + | ||
| 40 | + <el-table-column | ||
| 41 | + header-align="center" | ||
| 42 | + align="center" | ||
| 43 | + label="操作" | ||
| 44 | + width="auto" | ||
| 45 | + > | ||
| 46 | + <template slot-scope="scope"> | ||
| 47 | + <!-- <el-button type="success" size="mini" @click="buttonClick(scope)">修改</el-button> | ||
| 48 | + <el-button type="primary" size="mini" @click="buttonClick(scope)" | ||
| 49 | + >查看</el-button | ||
| 50 | + > --> | ||
| 51 | + <el-button | ||
| 52 | + :type="scope.row.status == 1 ? 'warning' : 'primary'" | ||
| 53 | + v-hasPermi="['system:menu:openClose']" | ||
| 54 | + size="mini" | ||
| 55 | + @click="menuStatus(scope)" | ||
| 56 | + v-if="scope.row.menuType == 'C'" | ||
| 57 | + >{{ scope.row.status == 1 ? "停用菜单" : "启用菜单" }}</el-button | ||
| 58 | + > | ||
| 59 | + <el-button | ||
| 60 | + type="danger" | ||
| 61 | + size="mini" | ||
| 62 | + v-hasPermi="['system:menu:delete']" | ||
| 63 | + @click="removeMenu(scope)" | ||
| 64 | + v-if="scope.row.menuType == 'C'" | ||
| 65 | + >删除菜单</el-button | ||
| 66 | + > | ||
| 67 | + </template> | ||
| 68 | + </el-table-column> | ||
| 69 | + </el-table> | ||
| 70 | + | ||
| 71 | + <!-- <Tables | ||
| 72 | + ref="newTable" | ||
| 73 | + :data="data" | ||
| 74 | + :headerData="tableHeader" | ||
| 75 | + size="medium" | ||
| 76 | + rowKey="id" | ||
| 77 | + :defaultExpandAll="true" | ||
| 78 | + height="auto" | ||
| 79 | + @tableSelect="tableSelect" | ||
| 80 | + @tableSelectAll="tableSelectAll" | ||
| 81 | + @SelectChange="SelectChange" | ||
| 82 | + > | ||
| 83 | + <el-table-column | ||
| 84 | + header-align="center" | ||
| 85 | + align="center" | ||
| 86 | + label="操作" | ||
| 87 | + width="auto" | ||
| 88 | + > | ||
| 89 | + <template slot-scope="scope"> | ||
| 90 | + <el-button type="primary" size="mini" @click="menuStatus(scope)">{{ | ||
| 91 | + scope.menuStatus == 0 ? "停用" : "启用" | ||
| 92 | + }}</el-button> | ||
| 93 | + <el-button type="danger" size="mini" @click="removeMenu(scope)" | ||
| 94 | + >删除菜单</el-button | ||
| 95 | + > | ||
| 96 | + </template> | ||
| 97 | + </el-table-column> | ||
| 98 | + </Tables> --> | ||
| 99 | + <!-- <Drawer | ||
| 100 | + :dialogVisible="drawer" | ||
| 101 | + :drawerTitle="drawerTitle" | ||
| 102 | + :menuFormDisabled="menuFormDisabled" | ||
| 103 | + :menuData="menuData" | ||
| 104 | + @handleClose="handleClose" | ||
| 105 | + ></Drawer> --> | ||
| 106 | + </div> | ||
| 107 | +</template> | ||
| 108 | + | ||
| 109 | +<script> | ||
| 110 | +import { getAllAuth, updateStatus } from "@/api/system/user.js"; | ||
| 111 | +import dictLabels from "@/assets/languages/dictLabels.js"; | ||
| 112 | +import Drawer from "./drawer.vue"; | ||
| 113 | +import { MessageBox } from "element-ui"; | ||
| 114 | +export default { | ||
| 115 | + name:"MenuConfig", | ||
| 116 | + components: { | ||
| 117 | + Drawer, | ||
| 118 | + }, | ||
| 119 | + data() { | ||
| 120 | + return { | ||
| 121 | + drawer: false, | ||
| 122 | + menuFormDisabled: false, | ||
| 123 | + loading:false, | ||
| 124 | + drawerTitle: "", | ||
| 125 | + menuData: {}, | ||
| 126 | + data: [], | ||
| 127 | + tableHeader: [ | ||
| 128 | + { | ||
| 129 | + type: "", | ||
| 130 | + name: "菜单名", | ||
| 131 | + value: "title", | ||
| 132 | + width: "200", | ||
| 133 | + align: "left", | ||
| 134 | + sorTable: false, | ||
| 135 | + }, | ||
| 136 | + { | ||
| 137 | + type: "", | ||
| 138 | + name: "菜单类型", | ||
| 139 | + value: "menuType", | ||
| 140 | + width: "100", | ||
| 141 | + align: "center", | ||
| 142 | + sortable: false, | ||
| 143 | + }, | ||
| 144 | + { | ||
| 145 | + type: "", | ||
| 146 | + name: "权限标识", | ||
| 147 | + value: "permissionKey", | ||
| 148 | + width: "auto", | ||
| 149 | + align: "left", | ||
| 150 | + sortable: false, | ||
| 151 | + }, | ||
| 152 | + { | ||
| 153 | + type: "", | ||
| 154 | + name: "菜单状态", | ||
| 155 | + value: "status", | ||
| 156 | + width: "100", | ||
| 157 | + align: "center", | ||
| 158 | + sorTable: false, | ||
| 159 | + }, | ||
| 160 | + { | ||
| 161 | + type: "", | ||
| 162 | + name: "菜单路由", | ||
| 163 | + value: "path", | ||
| 164 | + width: "auto", | ||
| 165 | + align: "left", | ||
| 166 | + sorTable: false, | ||
| 167 | + }, | ||
| 168 | + ], | ||
| 169 | + }; | ||
| 170 | + }, | ||
| 171 | + created() { | ||
| 172 | + if(this.$store.state.tagsView.cachedViews.length == 0){ | ||
| 173 | + this.menuAll(); | ||
| 174 | + } | ||
| 175 | + }, | ||
| 176 | + activated(){ | ||
| 177 | + this.menuAll(); | ||
| 178 | + }, | ||
| 179 | + deactivated(){ | ||
| 180 | + this.data = [] | ||
| 181 | + }, | ||
| 182 | + methods: { | ||
| 183 | + addMenu() { | ||
| 184 | + this.menuData = {}; | ||
| 185 | + this.drawer = true; | ||
| 186 | + this.drawerTitle = "新增菜单"; | ||
| 187 | + this.menuFormDisabled = false; | ||
| 188 | + }, | ||
| 189 | + | ||
| 190 | + //关闭 | ||
| 191 | + handleClose(val) { | ||
| 192 | + this.drawer = val; | ||
| 193 | + }, | ||
| 194 | + | ||
| 195 | + buttonClick(row) { | ||
| 196 | + this.menuData = row.row; | ||
| 197 | + this.drawer = true; | ||
| 198 | + this.drawerTitle = "查看/修改"; | ||
| 199 | + this.menuFormDisabled = true; | ||
| 200 | + }, | ||
| 201 | + | ||
| 202 | + //表格数据 | ||
| 203 | + menuAll() { | ||
| 204 | + this.loading = true; | ||
| 205 | + getAllAuth().then((res) => { | ||
| 206 | + this.loading = false; | ||
| 207 | + if (res.code === 200) { | ||
| 208 | + res.data.length > 0 | ||
| 209 | + ? (this.data = res.data) | ||
| 210 | + : this.$message({ | ||
| 211 | + message: "数据为空", | ||
| 212 | + type: "warning", | ||
| 213 | + }); | ||
| 214 | + } else { | ||
| 215 | + this.$message({ | ||
| 216 | + message: res.msg, | ||
| 217 | + type: "warning", | ||
| 218 | + }); | ||
| 219 | + } | ||
| 220 | + }).catch(()=>{ | ||
| 221 | + this.loading = false; | ||
| 222 | + }); | ||
| 223 | + }, | ||
| 224 | + | ||
| 225 | + //菜单状态改变 | ||
| 226 | + statusUpdate(data) { | ||
| 227 | + updateStatus(data) | ||
| 228 | + .then((res) => { | ||
| 229 | + if (res.code === 200) { | ||
| 230 | + this.menuAll(); | ||
| 231 | + this.$message({ | ||
| 232 | + message: "操作成功", | ||
| 233 | + type: "success", | ||
| 234 | + }); | ||
| 235 | + // location.reload() | ||
| 236 | + this.$store.dispatch('tagsView/delAllCachedViews') | ||
| 237 | + this.$store.dispatch('tagsView/delAllVisitedViews') | ||
| 238 | + this.$router.push('/index') | ||
| 239 | + } else { | ||
| 240 | + this.$message({ | ||
| 241 | + message: res.msg, | ||
| 242 | + type: "warning", | ||
| 243 | + }); | ||
| 244 | + } | ||
| 245 | + }) | ||
| 246 | + .catch((err) => { | ||
| 247 | + console.log(err); | ||
| 248 | + }); | ||
| 249 | + }, | ||
| 250 | + | ||
| 251 | + //菜单开启关闭 | ||
| 252 | + menuStatus(row) { | ||
| 253 | + MessageBox.confirm( | ||
| 254 | + row.row.status == 1 ? "是否要关闭此菜单" : "是否要启用此菜单", | ||
| 255 | + "提示", | ||
| 256 | + { | ||
| 257 | + confirmButtonText: "确定", | ||
| 258 | + cancelButtonText: "取消", | ||
| 259 | + type: "warning", | ||
| 260 | + } | ||
| 261 | + ) | ||
| 262 | + .then(() => { | ||
| 263 | + let data = {}; | ||
| 264 | + data.id = row.row.id; | ||
| 265 | + data.status = row.row.status == 1 ? "2" : "1"; | ||
| 266 | + this.statusUpdate(data); | ||
| 267 | + }) | ||
| 268 | + .catch(() => {}); | ||
| 269 | + }, | ||
| 270 | + | ||
| 271 | + //菜单删除 | ||
| 272 | + removeMenu(row) { | ||
| 273 | + MessageBox.confirm("是否要删除此菜单", "提示", { | ||
| 274 | + confirmButtonText: "确定删除", | ||
| 275 | + cancelButtonText: "取消", | ||
| 276 | + type: "warning", | ||
| 277 | + }) | ||
| 278 | + .then(() => { | ||
| 279 | + let data = {}; | ||
| 280 | + data.id = row.row.id; | ||
| 281 | + data.status = "0"; | ||
| 282 | + this.statusUpdate(data); | ||
| 283 | + }) | ||
| 284 | + .catch(() => {}); | ||
| 285 | + }, | ||
| 286 | + | ||
| 287 | + formatter(row, column, cellValue, index) { | ||
| 288 | + if (dictLabels[column.property]) { | ||
| 289 | + if (dictLabels[column.property][cellValue]) { | ||
| 290 | + return dictLabels[column.property][cellValue]; | ||
| 291 | + } | ||
| 292 | + } | ||
| 293 | + return cellValue; | ||
| 294 | + }, | ||
| 295 | + }, | ||
| 296 | +}; | ||
| 297 | +</script> | ||
| 298 | + | ||
| 299 | +<style> | ||
| 300 | +</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 | + check-strictly | ||
| 69 | + accordion | ||
| 70 | + > | ||
| 71 | + </el-tree> | ||
| 72 | + </el-form-item> | ||
| 73 | + </el-col> | ||
| 74 | + </el-row> | ||
| 75 | + <el-form-item> | ||
| 76 | + <el-button | ||
| 77 | + type="primary" | ||
| 78 | + v-if="!roleFormDisabled" | ||
| 79 | + size="mini" | ||
| 80 | + :loading="loading" | ||
| 81 | + @click="submit" | ||
| 82 | + >提交</el-button | ||
| 83 | + > | ||
| 84 | + <el-button type="primary" size="mini" @click="handleClose" | ||
| 85 | + >取消</el-button | ||
| 86 | + > | ||
| 87 | + </el-form-item> | ||
| 88 | + </el-form> | ||
| 89 | + </el-drawer> | ||
| 90 | + </div> | ||
| 91 | +</template> | ||
| 92 | + | ||
| 93 | +<script> | ||
| 94 | +import { getAllAuth, addOrUpdateRole } from "@/api/system/user.js"; | ||
| 95 | +export default { | ||
| 96 | + props: { | ||
| 97 | + drawerTitle: { | ||
| 98 | + type: String, | ||
| 99 | + default: "", | ||
| 100 | + }, | ||
| 101 | + roleFormDisabled: { | ||
| 102 | + type: Boolean, | ||
| 103 | + default: false, | ||
| 104 | + }, | ||
| 105 | + drawer: { | ||
| 106 | + type: Boolean, | ||
| 107 | + default: false, | ||
| 108 | + }, | ||
| 109 | + roleData: { | ||
| 110 | + type: Object, | ||
| 111 | + default: null, | ||
| 112 | + }, | ||
| 113 | + }, | ||
| 114 | + data() { | ||
| 115 | + return { | ||
| 116 | + roleForm: { | ||
| 117 | + name: null, | ||
| 118 | + }, | ||
| 119 | + treeData: [], | ||
| 120 | + loading: false, | ||
| 121 | + defaultProps: { | ||
| 122 | + children: "children", | ||
| 123 | + label: "title", | ||
| 124 | + }, | ||
| 125 | + rules: { | ||
| 126 | + name: [ | ||
| 127 | + { | ||
| 128 | + required: true, | ||
| 129 | + message: "角色名不能为空", | ||
| 130 | + trigger: "blur", | ||
| 131 | + }, | ||
| 132 | + ], | ||
| 133 | + }, | ||
| 134 | + }; | ||
| 135 | + }, | ||
| 136 | + created() { | ||
| 137 | + //权限列表 | ||
| 138 | + getAllAuth() | ||
| 139 | + .then((res) => { | ||
| 140 | + if (res.code === 200) { | ||
| 141 | + this.treeData = res.data; | ||
| 142 | + } else { | ||
| 143 | + this.$message({ | ||
| 144 | + message: res.msg, | ||
| 145 | + type: "warning", | ||
| 146 | + }); | ||
| 147 | + } | ||
| 148 | + }) | ||
| 149 | + .catch((err) => { | ||
| 150 | + console.log(err); | ||
| 151 | + }); | ||
| 152 | + }, | ||
| 153 | + watch:{ | ||
| 154 | + roleFormDisabled(){ | ||
| 155 | + this.treeData = this.treeDisabled(this.treeData) | ||
| 156 | + }, | ||
| 157 | + drawer(val,oldVal){ | ||
| 158 | + if(val){ | ||
| 159 | + this.roleForm = this.roleData; | ||
| 160 | + }else{ | ||
| 161 | + this.loading = false; | ||
| 162 | + } | ||
| 163 | + } | ||
| 164 | + }, | ||
| 165 | + methods: { | ||
| 166 | + //关闭 | ||
| 167 | + handleClose() { | ||
| 168 | + this.$refs['roleForm'].clearValidate(); | ||
| 169 | + this.$emit("handleClose", false); | ||
| 170 | + }, | ||
| 171 | + | ||
| 172 | + //提交 | ||
| 173 | + submit() { | ||
| 174 | + let formData = {}; | ||
| 175 | + this.loading = true; | ||
| 176 | + formData.menuIdList = this.$refs.tree.getCheckedKeys(); | ||
| 177 | + this.roleData ? (formData.id = this.roleData.id) : ""; | ||
| 178 | + formData.remark = this.roleForm.remark; | ||
| 179 | + formData.valid = this.roleForm.valid; | ||
| 180 | + formData.name = this.roleForm.name; | ||
| 181 | + addOrUpdateRole(formData) | ||
| 182 | + .then((res) => { | ||
| 183 | + this.loading = false; | ||
| 184 | + if (res.code === 200) { | ||
| 185 | + this.$message({ | ||
| 186 | + message: "操作成功", | ||
| 187 | + type: "success", | ||
| 188 | + }); | ||
| 189 | + this.$emit("handleClose", false); | ||
| 190 | + } else { | ||
| 191 | + this.$message({ | ||
| 192 | + message: res.msg, | ||
| 193 | + type: "warning", | ||
| 194 | + }); | ||
| 195 | + } | ||
| 196 | + }) | ||
| 197 | + .catch((err) => { | ||
| 198 | + console.log(err); | ||
| 199 | + }); | ||
| 200 | + }, | ||
| 201 | + | ||
| 202 | + //权限结构禁用 | ||
| 203 | + treeDisabled(val) { | ||
| 204 | + let data = []; | ||
| 205 | + val.forEach((item) => { | ||
| 206 | + item.disabled = this.roleFormDisabled; | ||
| 207 | + data.push(item) | ||
| 208 | + if (item.children && item.children.length) { | ||
| 209 | + item.children = this.treeDisabled(item.children) | ||
| 210 | + } | ||
| 211 | + }); | ||
| 212 | + return data; | ||
| 213 | + }, | ||
| 214 | + }, | ||
| 215 | +}; | ||
| 216 | +</script> | ||
| 217 | + | ||
| 218 | +<style> | ||
| 219 | +</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