Showing
30 changed files
with
3177 additions
and
747 deletions
| 1 | import request from '@/utils/request' | 1 | import request from '@/utils/request' |
| 2 | import { praseStrEmpty } from "@/utils/FedEx"; | 2 | import { praseStrEmpty } from "@/utils/FedEx"; |
| 3 | 3 | ||
| 4 | +// // 修改用户 | ||
| 5 | +// export function updateUser(data) { | ||
| 6 | +// return request({ | ||
| 7 | +// url: '/system/user', | ||
| 8 | +// method: 'put', | ||
| 9 | +// data: data | ||
| 10 | +// }) | ||
| 11 | +// } | ||
| 12 | + | ||
| 13 | +// // 导出用户 | ||
| 14 | +// export function exportUser(query) { | ||
| 15 | +// return request({ | ||
| 16 | +// url: '/system/user/export', | ||
| 17 | +// method: 'get', | ||
| 18 | +// params: query | ||
| 19 | +// }) | ||
| 20 | +// } | ||
| 21 | + | ||
| 22 | +// // 用户密码重置 | ||
| 23 | +// export function resetUserPwd(userId, password) { | ||
| 24 | +// const data = { | ||
| 25 | +// userId, | ||
| 26 | +// password | ||
| 27 | +// } | ||
| 28 | +// return request({ | ||
| 29 | +// url: '/system/user/resetPwd', | ||
| 30 | +// method: 'put', | ||
| 31 | +// data: data | ||
| 32 | +// }) | ||
| 33 | +// } | ||
| 34 | + | ||
| 35 | +// // 用户状态修改 | ||
| 36 | +// export function changeUserStatus(userId, status) { | ||
| 37 | +// const data = { | ||
| 38 | +// userId, | ||
| 39 | +// status | ||
| 40 | +// } | ||
| 41 | +// return request({ | ||
| 42 | +// url: '/system/user/changeStatus', | ||
| 43 | +// method: 'put', | ||
| 44 | +// data: data | ||
| 45 | +// }) | ||
| 46 | +// } | ||
| 47 | + | ||
| 48 | +// // 查询用户个人信息 | ||
| 49 | +// export function getUserProfile() { | ||
| 50 | +// return request({ | ||
| 51 | +// url: '/system/user/profile', | ||
| 52 | +// method: 'get' | ||
| 53 | +// }) | ||
| 54 | +// } | ||
| 55 | + | ||
| 56 | +// // 修改用户个人信息 | ||
| 57 | +// export function updateUserProfile(data) { | ||
| 58 | +// return request({ | ||
| 59 | +// url: '/system/user/profile', | ||
| 60 | +// method: 'put', | ||
| 61 | +// data: data | ||
| 62 | +// }) | ||
| 63 | +// } | ||
| 64 | + | ||
| 65 | +// // 用户密码重置 | ||
| 66 | +// export function updateUserPwd(oldPassword, newPassword) { | ||
| 67 | +// const data = { | ||
| 68 | +// oldPassword, | ||
| 69 | +// newPassword | ||
| 70 | +// } | ||
| 71 | +// return request({ | ||
| 72 | +// url: '/system/user/profile/updatePwd', | ||
| 73 | +// method: 'put', | ||
| 74 | +// params: data | ||
| 75 | +// }) | ||
| 76 | +// } | ||
| 77 | + | ||
| 78 | +// // 用户头像上传 | ||
| 79 | +// export function uploadAvatar(data) { | ||
| 80 | +// return request({ | ||
| 81 | +// url: '/system/user/profile/avatar', | ||
| 82 | +// method: 'post', | ||
| 83 | +// data: data | ||
| 84 | +// }) | ||
| 85 | +// } | ||
| 86 | + | ||
| 87 | +// // 下载用户导入模板 | ||
| 88 | +// export function importTemplate() { | ||
| 89 | +// return request({ | ||
| 90 | +// url: '/system/user/importTemplate', | ||
| 91 | +// method: 'get' | ||
| 92 | +// }) | ||
| 93 | +// } | ||
| 94 | + | ||
| 4 | // 查询用户列表 | 95 | // 查询用户列表 |
| 5 | -export function listUser(query) { | 96 | +export function listUser(data) { |
| 6 | return request({ | 97 | return request({ |
| 7 | - url: '/system/user/list', | 98 | + url: '/sysUser/getUserList', |
| 8 | - method: 'get', | 99 | + method: 'post', |
| 9 | - params: query | 100 | + data: data |
| 10 | }) | 101 | }) |
| 11 | } | 102 | } |
| 12 | 103 | ||
| 13 | // 查询用户详细 | 104 | // 查询用户详细 |
| 14 | -export function getUser(userId) { | 105 | +export function detailUser(userId) { |
| 15 | return request({ | 106 | return request({ |
| 16 | - url: '/system/user/' + praseStrEmpty(userId), | 107 | + url: '/sysUser/detailUser?id=' + praseStrEmpty(userId), |
| 17 | method: 'get' | 108 | method: 'get' |
| 18 | }) | 109 | }) |
| 19 | } | 110 | } |
| 20 | 111 | ||
| 21 | // 新增用户 | 112 | // 新增用户 |
| 22 | -export function addUser(data) { | 113 | +export function addOrUpdateUser(data) { |
| 23 | return request({ | 114 | return request({ |
| 24 | - url: '/system/user', | 115 | + url: '/sysUser/addOrUpdateUser', |
| 25 | method: 'post', | 116 | method: 'post', |
| 26 | data: data | 117 | data: data |
| 27 | }) | 118 | }) |
| 28 | } | 119 | } |
| 29 | 120 | ||
| 30 | -// 修改用户 | 121 | +// 修改用户状态 |
| 31 | -export function updateUser(data) { | 122 | +export function updateUserStatus(data) { |
| 32 | return request({ | 123 | return request({ |
| 33 | - url: '/system/user', | 124 | + url: '/sysUser/updateUserStatus', |
| 34 | - method: 'put', | 125 | + method: 'post', |
| 35 | data: data | 126 | data: data |
| 36 | }) | 127 | }) |
| 37 | } | 128 | } |
| 38 | 129 | ||
| 39 | -// 删除用户 | 130 | +//菜单信息 |
| 40 | -export function delUser(userId) { | 131 | +export function getAllAuth() { |
| 41 | return request({ | 132 | return request({ |
| 42 | - url: '/system/user/' + userId, | 133 | + url: '/sysMenu/getAllAuth', |
| 43 | - method: 'delete' | 134 | + method: 'get' |
| 44 | }) | 135 | }) |
| 45 | } | 136 | } |
| 46 | 137 | ||
| 47 | -// 导出用户 | 138 | +//菜单开启关闭 |
| 48 | -export function exportUser(query) { | 139 | +export function updateStatus(data) { |
| 49 | return request({ | 140 | return request({ |
| 50 | - url: '/system/user/export', | 141 | + url: '/sysMenu/updateStatus', |
| 51 | - method: 'get', | 142 | + method: 'post', |
| 52 | - params: query | 143 | + data: data |
| 53 | }) | 144 | }) |
| 54 | } | 145 | } |
| 55 | 146 | ||
| 56 | -// 用户密码重置 | 147 | +//角色列表 |
| 57 | -export function resetUserPwd(userId, password) { | 148 | +export function getRoleList(data) { |
| 58 | - const data = { | ||
| 59 | - userId, | ||
| 60 | - password | ||
| 61 | - } | ||
| 62 | return request({ | 149 | return request({ |
| 63 | - url: '/system/user/resetPwd', | 150 | + url: '/role/getRoleList', |
| 64 | - method: 'put', | 151 | + method: 'post', |
| 65 | data: data | 152 | data: data |
| 66 | }) | 153 | }) |
| 67 | } | 154 | } |
| 68 | 155 | ||
| 69 | -// 用户状态修改 | 156 | +//角色详情 |
| 70 | -export function changeUserStatus(userId, status) { | 157 | +export function detailRole(id) { |
| 71 | - const data = { | ||
| 72 | - userId, | ||
| 73 | - status | ||
| 74 | - } | ||
| 75 | return request({ | 158 | return request({ |
| 76 | - url: '/system/user/changeStatus', | 159 | + url: '/role/detailRole?id=' + id, |
| 77 | - method: 'put', | 160 | + method: 'get', |
| 78 | - data: data | ||
| 79 | }) | 161 | }) |
| 80 | } | 162 | } |
| 81 | 163 | ||
| 82 | -// 查询用户个人信息 | 164 | +//新增修改角色 |
| 83 | -export function getUserProfile() { | 165 | +export function addOrUpdateRole(data) { |
| 84 | return request({ | 166 | return request({ |
| 85 | - url: '/system/user/profile', | 167 | + url: '/role/addOrUpdateRole', |
| 86 | - method: 'get' | 168 | + method: 'post', |
| 169 | + data: data | ||
| 87 | }) | 170 | }) |
| 88 | } | 171 | } |
| 89 | 172 | ||
| 90 | -// 修改用户个人信息 | 173 | +//角色状态修改 |
| 91 | -export function updateUserProfile(data) { | 174 | +export function updateRoleStatus(data) { |
| 92 | return request({ | 175 | return request({ |
| 93 | - url: '/system/user/profile', | 176 | + url: '/role/updateRoleStatus', |
| 94 | - method: 'put', | 177 | + method: 'post', |
| 95 | data: data | 178 | data: data |
| 96 | }) | 179 | }) |
| 97 | } | 180 | } |
| 98 | 181 | ||
| 99 | -// 用户密码重置 | 182 | +//口岸列表 |
| 100 | -export function updateUserPwd(oldPassword, newPassword) { | 183 | +export function portNameList() { |
| 101 | - const data = { | ||
| 102 | - oldPassword, | ||
| 103 | - newPassword | ||
| 104 | - } | ||
| 105 | return request({ | 184 | return request({ |
| 106 | - url: '/system/user/profile/updatePwd', | 185 | + url: '/dictionary/port', |
| 107 | - method: 'put', | 186 | + method: 'get', |
| 108 | - params: data | ||
| 109 | }) | 187 | }) |
| 110 | } | 188 | } |
| 111 | 189 | ||
| 112 | -// 用户头像上传 | 190 | +//口岸变更 |
| 113 | -export function uploadAvatar(data) { | 191 | +export function changeCurrentPort(data) { |
| 114 | return request({ | 192 | return request({ |
| 115 | - url: '/system/user/profile/avatar', | 193 | + url: '/sysUser/changeCurrentPort', |
| 116 | method: 'post', | 194 | method: 'post', |
| 117 | data: data | 195 | data: data |
| 118 | }) | 196 | }) |
| 119 | } | 197 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 120 | - | ||
| 121 | -// 下载用户导入模板 | ||
| 122 | -export function importTemplate() { | ||
| 123 | - return request({ | ||
| 124 | - url: '/system/user/importTemplate', | ||
| 125 | - method: 'get' | ||
| 126 | - }) | ||
| 127 | -} | ... | ... |
| 1 | let ductLabels = { | 1 | let ductLabels = { |
| 2 | - "cargoRulesStatus":{ | 2 | + "cargoRulesStatus": { |
| 3 | - "1":"手动", | 3 | + "1": "手动", |
| 4 | - "2":"自动" | 4 | + "2": "自动" |
| 5 | + }, | ||
| 6 | + "menuType": { | ||
| 7 | + "M": "菜单", | ||
| 8 | + "C": "菜单", | ||
| 9 | + "B": "按钮" | ||
| 10 | + }, | ||
| 11 | + "status": { | ||
| 12 | + "1": "启用", | ||
| 13 | + "2": "停用", | ||
| 14 | + }, | ||
| 15 | + "valid": { | ||
| 16 | + "1": "启用", | ||
| 17 | + "2": "关闭", | ||
| 18 | + }, | ||
| 19 | + "isValid": { | ||
| 20 | + "1": "启用", | ||
| 21 | + "2": "关闭", | ||
| 22 | + }, | ||
| 23 | + "ticketToPiece": { | ||
| 24 | + "1": "是", | ||
| 25 | + "0": "否", | ||
| 26 | + }, | ||
| 27 | + "needRequired": { | ||
| 28 | + "1": "是", | ||
| 29 | + "0": "否", | ||
| 30 | + }, | ||
| 31 | + "highLowPriceFlg": { | ||
| 32 | + "1": "启用", | ||
| 33 | + "0": "未开启", | ||
| 5 | } | 34 | } |
| 35 | + | ||
| 6 | } | 36 | } |
| 7 | 37 | ||
| 8 | export default ductLabels; | 38 | export default ductLabels; |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| 1 | <template> | 1 | <template> |
| 2 | - <div class="Tables"> | 2 | + <div class="w-table" :class="{ 'w-table_moving': dragState.dragging }"> |
| 3 | <el-table | 3 | <el-table |
| 4 | :ref="tableName" | 4 | :ref="tableName" |
| 5 | :data="data" | 5 | :data="data" |
| 6 | - :headerData="headerData" | ||
| 7 | :border="border" | 6 | :border="border" |
| 8 | :stripe="stripe" | 7 | :stripe="stripe" |
| 9 | :size="size" | 8 | :size="size" |
| ... | @@ -25,24 +24,33 @@ | ... | @@ -25,24 +24,33 @@ |
| 25 | @select-change="SelectChange" | 24 | @select-change="SelectChange" |
| 26 | > | 25 | > |
| 27 | <el-table-column | 26 | <el-table-column |
| 28 | - v-for="(item, index) in headerData" | 27 | + v-for="(item, index) in newHeader" |
| 29 | - :column-key="item.value" | ||
| 30 | :type="item.type" | 28 | :type="item.type" |
| 31 | :prop="item.value" | 29 | :prop="item.value" |
| 32 | :label="item.name" | 30 | :label="item.name" |
| 33 | :width="item.width" | 31 | :width="item.width" |
| 34 | :align="item.align" | 32 | :align="item.align" |
| 35 | :fixed="item.fixed" | 33 | :fixed="item.fixed" |
| 34 | + :column-key="index.toString()" | ||
| 36 | :show-overflow-tooltip="showOverflowTooltip" | 35 | :show-overflow-tooltip="showOverflowTooltip" |
| 37 | :sortable="item.sorTable" | 36 | :sortable="item.sorTable" |
| 38 | :formatter="formatter" | 37 | :formatter="formatter" |
| 39 | header-align="center" | 38 | header-align="center" |
| 40 | :sort-orders="['descending', 'ascending', null]" | 39 | :sort-orders="['descending', 'ascending', null]" |
| 41 | :slotHeader="slotHeader" | 40 | :slotHeader="slotHeader" |
| 41 | + :render-header="renderHeader" | ||
| 42 | :key="index" | 42 | :key="index" |
| 43 | + v-if="item.disabled" | ||
| 43 | > | 44 | > |
| 44 | - <!-- <template v-if="item.slot" slot-scope=""> | 45 | + <!-- <template slot-scope="scope"> |
| 45 | - <Item :dom="item.slot" @change="itemChange"></Item> | 46 | + <exSlot |
| 47 | + v-if="item.render" | ||
| 48 | + :render="item.render" | ||
| 49 | + :row="scope.row" | ||
| 50 | + :index="scope.$index" | ||
| 51 | + :column="item" | ||
| 52 | + ></exSlot> | ||
| 53 | + <span v-else>{{ scope.row[item.value] || "" }}</span> | ||
| 46 | </template> --> | 54 | </template> --> |
| 47 | </el-table-column> | 55 | </el-table-column> |
| 48 | <slot></slot> | 56 | <slot></slot> |
| ... | @@ -52,41 +60,87 @@ | ... | @@ -52,41 +60,87 @@ |
| 52 | :page-size.sync="limitSize" | 60 | :page-size.sync="limitSize" |
| 53 | :current-page.sync="pageNum" | 61 | :current-page.sync="pageNum" |
| 54 | background | 62 | background |
| 55 | - layout="prev, pager, next, jumper, ->, total, slot" | 63 | + layout="prev, pager, next, jumper, ->, sizes, total" |
| 56 | class="tablePagination" | 64 | class="tablePagination" |
| 65 | + @size-change="sizeChange" | ||
| 57 | @next-click="nextClick" | 66 | @next-click="nextClick" |
| 58 | @prev-click="prevClick" | 67 | @prev-click="prevClick" |
| 59 | @current-change="currentChange" | 68 | @current-change="currentChange" |
| 60 | > | 69 | > |
| 61 | </el-pagination> | 70 | </el-pagination> |
| 62 | - <!-- <infoTable | 71 | + <div class="tableInfo" v-if="infoShow"> |
| 63 | - v-bind="$attrs" | 72 | + <ul class="tableList" v-show="show"> |
| 64 | - @checkChange="checkChange" | 73 | + <el-checkbox-group v-model="checkDisabled"> |
| 65 | - @top="top" | 74 | + <li |
| 66 | - @bottom="bottom" | 75 | + class="flexList" |
| 67 | - ></infoTable> --> | 76 | + v-for="(item, index) in newHeader" |
| 77 | + :key="index" | ||
| 78 | + v-if="!item.type" | ||
| 79 | + :title="item.name" | ||
| 80 | + > | ||
| 81 | + <div> | ||
| 82 | + <el-checkbox | ||
| 83 | + :label="item.name" | ||
| 84 | + @change="newHeader[index].disabled = !item.disabled" | ||
| 85 | + >{{ item.name }}</el-checkbox | ||
| 86 | + > | ||
| 87 | + </div> | ||
| 88 | + </li> | ||
| 89 | + </el-checkbox-group> | ||
| 90 | + </ul> | ||
| 91 | + <el-button | ||
| 92 | + type="primary" | ||
| 93 | + icon="el-icon-edit" | ||
| 94 | + size="medium" | ||
| 95 | + circle | ||
| 96 | + @click="show = !show" | ||
| 97 | + ></el-button> | ||
| 98 | + </div> | ||
| 68 | </div> | 99 | </div> |
| 69 | </template> | 100 | </template> |
| 70 | 101 | ||
| 71 | <script> | 102 | <script> |
| 72 | -// import infoTable from "./info.vue"; | 103 | +let exSlot = { |
| 73 | -import Item from "./item.vue"; | 104 | + fucntional: true, |
| 105 | + props: { | ||
| 106 | + row: Object, | ||
| 107 | + render: Function, | ||
| 108 | + index: [Number, String], | ||
| 109 | + column: { | ||
| 110 | + type: Object, | ||
| 111 | + default: null, | ||
| 112 | + }, | ||
| 113 | + }, | ||
| 114 | + render: (h, data) => { | ||
| 115 | + console.log(data); | ||
| 116 | + if (data) { | ||
| 117 | + const params = { | ||
| 118 | + row: data.props.row, | ||
| 119 | + index: data.props.index, | ||
| 120 | + }; | ||
| 121 | + if (data.props.column) params.column = data.props.column; | ||
| 122 | + return data.props.render(h, params); | ||
| 123 | + } | ||
| 124 | + }, | ||
| 125 | +}; | ||
| 74 | import dictLabels from "../../assets/languages/dictLabels.js"; | 126 | import dictLabels from "../../assets/languages/dictLabels.js"; |
| 75 | import { scrollTo } from "@/utils/scroll-to"; | 127 | import { scrollTo } from "@/utils/scroll-to"; |
| 76 | export default { | 128 | export default { |
| 77 | name: "Table", | 129 | name: "Table", |
| 78 | components: { | 130 | components: { |
| 79 | - // infoTable, | 131 | + exSlot, |
| 80 | - Item, | ||
| 81 | }, | 132 | }, |
| 82 | props: { | 133 | props: { |
| 134 | + //dom名称 | ||
| 83 | tableName: { type: String, default: "tables" }, | 135 | tableName: { type: String, default: "tables" }, |
| 136 | + //表格数据 | ||
| 84 | data: { | 137 | data: { |
| 85 | type: Array, | 138 | type: Array, |
| 86 | default() { | 139 | default() { |
| 87 | return []; | 140 | return []; |
| 88 | }, | 141 | }, |
| 89 | }, | 142 | }, |
| 143 | + //表头数据 | ||
| 90 | headerData: { | 144 | headerData: { |
| 91 | type: Array, | 145 | type: Array, |
| 92 | default: null, | 146 | default: null, |
| ... | @@ -104,7 +158,7 @@ export default { | ... | @@ -104,7 +158,7 @@ export default { |
| 104 | default: "mini", | 158 | default: "mini", |
| 105 | }, | 159 | }, |
| 106 | height: { | 160 | height: { |
| 107 | - type: String, | 161 | + type: [String,Number], |
| 108 | default: "400", | 162 | default: "400", |
| 109 | }, | 163 | }, |
| 110 | fit: { | 164 | fit: { |
| ... | @@ -143,18 +197,26 @@ export default { | ... | @@ -143,18 +197,26 @@ export default { |
| 143 | type: Boolean, | 197 | type: Boolean, |
| 144 | default: true, | 198 | default: true, |
| 145 | }, | 199 | }, |
| 200 | + //shift键状态 | ||
| 146 | shiftKey: { | 201 | shiftKey: { |
| 147 | type: Boolean, | 202 | type: Boolean, |
| 148 | default: false, | 203 | default: false, |
| 149 | }, | 204 | }, |
| 205 | + //页数 | ||
| 150 | page: { | 206 | page: { |
| 151 | type: Number, | 207 | type: Number, |
| 152 | default: 1, | 208 | default: 1, |
| 153 | }, | 209 | }, |
| 210 | + // pageSizes:{ | ||
| 211 | + // type:Array, | ||
| 212 | + // default:[10, 20, 30, 40, 50, 100] | ||
| 213 | + // }, | ||
| 214 | + //每页长度 | ||
| 154 | limitSize: { | 215 | limitSize: { |
| 155 | type: Number, | 216 | type: Number, |
| 156 | default: 20, | 217 | default: 20, |
| 157 | }, | 218 | }, |
| 219 | + //开始位置 | ||
| 158 | limitStart: { | 220 | limitStart: { |
| 159 | type: Number, | 221 | type: Number, |
| 160 | default: 0, | 222 | default: 0, |
| ... | @@ -167,6 +229,7 @@ export default { | ... | @@ -167,6 +229,7 @@ export default { |
| 167 | type: Number, | 229 | type: Number, |
| 168 | default: 20, | 230 | default: 20, |
| 169 | }, | 231 | }, |
| 232 | + //总数量 | ||
| 170 | totalCount: { | 233 | totalCount: { |
| 171 | type: Number, | 234 | type: Number, |
| 172 | default: 0, | 235 | default: 0, |
| ... | @@ -179,35 +242,65 @@ export default { | ... | @@ -179,35 +242,65 @@ export default { |
| 179 | type: Boolean, | 242 | type: Boolean, |
| 180 | default: false, | 243 | default: false, |
| 181 | }, | 244 | }, |
| 245 | + infoShow:{ | ||
| 246 | + type:Boolean, | ||
| 247 | + default:false, | ||
| 248 | + } | ||
| 182 | }, | 249 | }, |
| 183 | inheritAttrs: false, | 250 | inheritAttrs: false, |
| 184 | data() { | 251 | data() { |
| 185 | return { | 252 | return { |
| 186 | - newHeader: [], | 253 | + newHeader: this.headerData, |
| 187 | selectTable: [], | 254 | selectTable: [], |
| 255 | + checkDisabled: [], | ||
| 188 | pageNum: 1, | 256 | pageNum: 1, |
| 189 | start: -1, | 257 | start: -1, |
| 258 | + show: false, | ||
| 259 | + dragState: { | ||
| 260 | + start: -9, // 起始元素的 index | ||
| 261 | + end: -9, // 移动鼠标时所覆盖的元素 index | ||
| 262 | + dragging: false, // 是否正在拖动 | ||
| 263 | + direction: undefined, // 拖动方向 | ||
| 264 | + }, | ||
| 265 | + //表头数据格式 | ||
| 190 | // { | 266 | // { |
| 191 | - // type: "selection", | 267 | + // type: "", |
| 192 | // name: "", | 268 | // name: "", |
| 193 | // value: "", | 269 | // value: "", |
| 194 | - // slot: null, | ||
| 195 | // width: "", | 270 | // width: "", |
| 196 | // align: "center", | 271 | // align: "center", |
| 197 | // sorTable: false, | 272 | // sorTable: false, |
| 198 | // fixed:false, | 273 | // fixed:false, |
| 274 | + // disabled:true, | ||
| 199 | // }, | 275 | // }, |
| 200 | }; | 276 | }; |
| 201 | }, | 277 | }, |
| 202 | created() { | 278 | created() { |
| 203 | - this.newHeader = this.headerData; | 279 | + this.newHeader.map((item) => { |
| 280 | + this.checkDisabled.push(item.name); | ||
| 281 | + }); | ||
| 204 | }, | 282 | }, |
| 205 | - watch:{ | 283 | + watch: { |
| 206 | - page(){ | 284 | + page() { |
| 207 | this.pageNum = this.page; | 285 | this.pageNum = this.page; |
| 208 | - } | 286 | + }, |
| 287 | + data() { | ||
| 288 | + this.data.forEach((item, index) => { | ||
| 289 | + item.index = index; | ||
| 290 | + }); | ||
| 291 | + this.$nextTick(()=>{ | ||
| 292 | + this.$refs.tables.doLayout() | ||
| 293 | + }) | ||
| 294 | + }, | ||
| 295 | + headerData(val, oldVal) { | ||
| 296 | + this.newHeader = val; | ||
| 297 | + }, | ||
| 209 | }, | 298 | }, |
| 210 | methods: { | 299 | methods: { |
| 300 | + sizeChange(val){ | ||
| 301 | + this.$emit("sizeChange",val) | ||
| 302 | + }, | ||
| 303 | + //下一页 | ||
| 211 | nextClick() { | 304 | nextClick() { |
| 212 | this.$emit("currentChange", { | 305 | this.$emit("currentChange", { |
| 213 | page: this.pageNum + 1, | 306 | page: this.pageNum + 1, |
| ... | @@ -215,6 +308,7 @@ export default { | ... | @@ -215,6 +308,7 @@ export default { |
| 215 | }); | 308 | }); |
| 216 | scrollTo(0, 800); | 309 | scrollTo(0, 800); |
| 217 | }, | 310 | }, |
| 311 | + //上一页 | ||
| 218 | prevClick() { | 312 | prevClick() { |
| 219 | this.$emit("currentChange", { | 313 | this.$emit("currentChange", { |
| 220 | page: this.pageNum - 1, | 314 | page: this.pageNum - 1, |
| ... | @@ -222,13 +316,15 @@ export default { | ... | @@ -222,13 +316,15 @@ export default { |
| 222 | }); | 316 | }); |
| 223 | scrollTo(0, 800); | 317 | scrollTo(0, 800); |
| 224 | }, | 318 | }, |
| 319 | + //某页 | ||
| 225 | currentChange(val) { | 320 | currentChange(val) { |
| 226 | this.$emit("currentChange", { | 321 | this.$emit("currentChange", { |
| 227 | page: val, | 322 | page: val, |
| 228 | - start: val > 1 ? (val-1) * this.limitSize + 1 : val, | 323 | + start: val > 1 ? (val - 1) * this.limitSize + 1 : val, |
| 229 | }); | 324 | }); |
| 230 | scrollTo(0, 800); | 325 | scrollTo(0, 800); |
| 231 | }, | 326 | }, |
| 327 | + //表格多选,shift连续选择 | ||
| 232 | tableSelect(selection, row) { | 328 | tableSelect(selection, row) { |
| 233 | let end = row.index; | 329 | let end = row.index; |
| 234 | if (this.shiftKey) { | 330 | if (this.shiftKey) { |
| ... | @@ -276,18 +372,23 @@ export default { | ... | @@ -276,18 +372,23 @@ export default { |
| 276 | selection = this.selectTable.sort(this.compare("index", "ascending")); | 372 | selection = this.selectTable.sort(this.compare("index", "ascending")); |
| 277 | this.$emit("tableSelect", { selection, row }); | 373 | this.$emit("tableSelect", { selection, row }); |
| 278 | }, | 374 | }, |
| 375 | + //表格全选 | ||
| 279 | tableSelectAll(selection) { | 376 | tableSelectAll(selection) { |
| 280 | this.selectTable = selection; | 377 | this.selectTable = selection; |
| 281 | this.$emit("tableSelectAll", selection); | 378 | this.$emit("tableSelectAll", selection); |
| 282 | }, | 379 | }, |
| 380 | + //多选框改变 | ||
| 283 | SelectChange(selection) { | 381 | SelectChange(selection) { |
| 284 | this.$emit("SelectChange", selection); | 382 | this.$emit("SelectChange", selection); |
| 285 | }, | 383 | }, |
| 384 | + //表格选择清空 | ||
| 286 | clearTable() { | 385 | clearTable() { |
| 287 | this.selectTable = []; | 386 | this.selectTable = []; |
| 288 | this.$refs.tables.clearSelection(); | 387 | this.$refs.tables.clearSelection(); |
| 289 | }, | 388 | }, |
| 389 | + //排序 | ||
| 290 | sortChange({ column, prop, order }) { | 390 | sortChange({ column, prop, order }) { |
| 391 | + this.selectTable = []; | ||
| 291 | this.$emit("sortChange", { prop: prop, order: order }); | 392 | this.$emit("sortChange", { prop: prop, order: order }); |
| 292 | }, | 393 | }, |
| 293 | compare(propertyName, sort) { | 394 | compare(propertyName, sort) { |
| ... | @@ -306,26 +407,218 @@ export default { | ... | @@ -306,26 +407,218 @@ export default { |
| 306 | } | 407 | } |
| 307 | }; | 408 | }; |
| 308 | }, | 409 | }, |
| 410 | + //自定义表头 | ||
| 411 | + renderHeader(createElement, { column }) { | ||
| 412 | + return createElement( | ||
| 413 | + "div", | ||
| 414 | + { | ||
| 415 | + class: ["thead-cell"], | ||
| 416 | + // on: { | ||
| 417 | + // mousedown: ($event) => { | ||
| 418 | + // this.handleMouseDown($event, column); | ||
| 419 | + // }, | ||
| 420 | + // mousemove: ($event) => { | ||
| 421 | + // this.handleMouseMove($event, column); | ||
| 422 | + // }, | ||
| 423 | + // }, | ||
| 424 | + }, | ||
| 425 | + [ | ||
| 426 | + // 添加 <a> 用于显示表头 label | ||
| 427 | + createElement("a", column.label), | ||
| 428 | + // 添加一个空标签用于显示拖动动画 | ||
| 429 | + createElement("span", { | ||
| 430 | + class: ["virtual"], | ||
| 431 | + }), | ||
| 432 | + ] | ||
| 433 | + ); | ||
| 434 | + }, | ||
| 435 | + | ||
| 436 | + // 按下鼠标开始拖动 | ||
| 437 | + // handleMouseDown(e, column) { | ||
| 438 | + // this.dragState.dragging = true; | ||
| 439 | + // this.dragState.start = parseInt(column.columnKey); | ||
| 440 | + // // 给拖动时的虚拟容器添加宽高 | ||
| 441 | + // let table = document.getElementsByClassName("w-table")[0]; | ||
| 442 | + // let virtual = document.getElementsByClassName("virtual"); | ||
| 443 | + // for (let item of virtual) { | ||
| 444 | + // item.style.height = table.clientHeight - 1 + "px"; | ||
| 445 | + // item.style.width = item.parentElement.parentElement.clientWidth + "px"; | ||
| 446 | + // } | ||
| 447 | + // document.addEventListener("mouseup", this.handleMouseUp); | ||
| 448 | + // }, | ||
| 449 | + | ||
| 450 | + // 鼠标放开结束拖动 | ||
| 451 | + // handleMouseUp() { | ||
| 452 | + // this.dragColumn(this.dragState); | ||
| 453 | + // // 初始化拖动状态 | ||
| 454 | + // this.dragState = { | ||
| 455 | + // start: -9, | ||
| 456 | + // end: -9, | ||
| 457 | + // dragging: false, | ||
| 458 | + // direction: undefined, | ||
| 459 | + // }; | ||
| 460 | + // document.removeEventListener("mouseup", this.handleMouseUp); | ||
| 461 | + // }, | ||
| 462 | + | ||
| 463 | + // 拖动中 | ||
| 464 | + // handleMouseMove(e, column) { | ||
| 465 | + // if (this.dragState.dragging) { | ||
| 466 | + // let index = parseInt(column.columnKey); // 记录起始列 | ||
| 467 | + // if (index - this.dragState.start !== 0) { | ||
| 468 | + // this.dragState.direction = | ||
| 469 | + // index - this.dragState.start < 0 ? "left" : "right"; // 判断拖动方向 | ||
| 470 | + // this.dragState.end = parseInt(column.columnKey); | ||
| 471 | + // } else { | ||
| 472 | + // this.dragState.direction = undefined; | ||
| 473 | + // } | ||
| 474 | + // } else { | ||
| 475 | + // return false; | ||
| 476 | + // } | ||
| 477 | + // }, | ||
| 478 | + | ||
| 479 | + // 拖动易位 | ||
| 480 | + // dragColumn({ start, end, direction }) { | ||
| 481 | + // let tempData = []; | ||
| 482 | + // let left = direction === "left"; | ||
| 483 | + // let min = left ? end : start - 1; | ||
| 484 | + // let max = left ? start + 1 : end; | ||
| 485 | + // for (let i = 0; i < this.newHeader.length; i++) { | ||
| 486 | + // if (i === end) { | ||
| 487 | + // tempData.push(this.newHeader[start]); | ||
| 488 | + // } else if (i > min && i < max) { | ||
| 489 | + // tempData.push(this.newHeader[left ? i - 1 : i + 1]); | ||
| 490 | + // } else { | ||
| 491 | + // tempData.push(this.newHeader[i]); | ||
| 492 | + // } | ||
| 493 | + // } | ||
| 494 | + // this.newHeader = tempData; | ||
| 495 | + // }, | ||
| 496 | + // headerCellClassName({ column, columnIndex }) { | ||
| 497 | + // let active = | ||
| 498 | + // columnIndex - 1 === this.dragState.end | ||
| 499 | + // ? `darg_active_${this.dragState.direction}` | ||
| 500 | + // : ""; | ||
| 501 | + // let start = columnIndex - 1 === this.dragState.start ? `darg_start` : ""; | ||
| 502 | + // return `${active} ${start}`; | ||
| 503 | + // }, | ||
| 504 | + | ||
| 505 | + // cellClassName({ column, columnIndex }) { | ||
| 506 | + // return columnIndex - 1 === this.dragState.start ? `darg_start` : ""; | ||
| 507 | + // }, | ||
| 508 | + //数据格式化 | ||
| 309 | formatter(row, column, cellValue, index) { | 509 | formatter(row, column, cellValue, index) { |
| 310 | if (dictLabels[column.property]) { | 510 | if (dictLabels[column.property]) { |
| 311 | if (dictLabels[column.property][cellValue]) { | 511 | if (dictLabels[column.property][cellValue]) { |
| 312 | return dictLabels[column.property][cellValue]; | 512 | return dictLabels[column.property][cellValue]; |
| 313 | } | 513 | } |
| 314 | } | 514 | } |
| 515 | + if (column.property == "roleNames") { | ||
| 516 | + return cellValue.toString(); | ||
| 517 | + } | ||
| 315 | return cellValue; | 518 | return cellValue; |
| 316 | }, | 519 | }, |
| 317 | }, | 520 | }, |
| 318 | }; | 521 | }; |
| 319 | </script> | 522 | </script> |
| 320 | 523 | ||
| 321 | -<style> | 524 | +<style lang="scss"> |
| 322 | -.Tables { | ||
| 323 | - width: 100%; | ||
| 324 | - margin-top: 20px; | ||
| 325 | -} | ||
| 326 | .tablePagination { | 525 | .tablePagination { |
| 327 | margin-top: 40px; | 526 | margin-top: 40px; |
| 328 | text-align: right; | 527 | text-align: right; |
| 329 | } | 528 | } |
| 529 | +.w-table { | ||
| 530 | + height:100%; | ||
| 531 | + .el-table .darg_start { | ||
| 532 | + background-color: #f3f3f3; | ||
| 533 | + } | ||
| 534 | + .el-table th { | ||
| 535 | + padding: 0; | ||
| 536 | + .virtual { | ||
| 537 | + position: absolute; | ||
| 538 | + display: block; | ||
| 539 | + width: 0; | ||
| 540 | + height: 0; | ||
| 541 | + top: 0px; | ||
| 542 | + left: 0px; | ||
| 543 | + background: none; | ||
| 544 | + border: none; | ||
| 545 | + } | ||
| 546 | + &.darg_active_left { | ||
| 547 | + .virtual { | ||
| 548 | + border-left: 2px dotted #666; | ||
| 549 | + z-index: 99; | ||
| 550 | + } | ||
| 551 | + } | ||
| 552 | + &.darg_active_right { | ||
| 553 | + .virtual { | ||
| 554 | + border-right: 2px dotted #666; | ||
| 555 | + z-index: 99; | ||
| 556 | + } | ||
| 557 | + } | ||
| 558 | + } | ||
| 559 | + .thead-cell { | ||
| 560 | + padding: 0; | ||
| 561 | + display: inline-flex; | ||
| 562 | + flex-direction: column; | ||
| 563 | + align-items: left; | ||
| 564 | + cursor: pointer; | ||
| 565 | + overflow: initial; | ||
| 566 | + &:before { | ||
| 567 | + content: ""; | ||
| 568 | + position: absolute; | ||
| 569 | + top: 0; | ||
| 570 | + left: 0; | ||
| 571 | + bottom: 0; | ||
| 572 | + right: 0; | ||
| 573 | + } | ||
| 574 | + } | ||
| 575 | + &.w-table_moving { | ||
| 576 | + .el-table th .thead-cell { | ||
| 577 | + cursor: move !important; | ||
| 578 | + } | ||
| 579 | + .el-table__fixed { | ||
| 580 | + cursor: not-allowed; | ||
| 581 | + } | ||
| 582 | + } | ||
| 583 | +} | ||
| 584 | +.tableInfo { | ||
| 585 | + position: fixed; | ||
| 586 | + right: 30px; | ||
| 587 | + bottom: 100px; | ||
| 588 | + z-index: 99999999; | ||
| 589 | +} | ||
| 590 | +.tableList { | ||
| 591 | + width: 200px; | ||
| 592 | + max-height: 500px; | ||
| 593 | + padding: 5px; | ||
| 594 | + margin: 0; | ||
| 595 | + position: absolute; | ||
| 596 | + bottom: 35px; | ||
| 597 | + right: 0px; | ||
| 598 | + border: 1px solid #ccc; | ||
| 599 | + border-radius: 3%; | ||
| 600 | + background: #fff; | ||
| 601 | + overflow-y: scroll; | ||
| 602 | +} | ||
| 603 | +.tableList::-webkit-scrollbar { | ||
| 604 | + width: 4px; | ||
| 605 | + height: 4px; | ||
| 606 | +} | ||
| 607 | +.tableList::-webkit-scrollbar-thumb { | ||
| 608 | + border-radius: 10px; | ||
| 609 | + -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2); | ||
| 610 | + background: rgba(0, 0, 0, 0.2); | ||
| 611 | +} | ||
| 612 | +.tableList::-webkit-scrollbar-track { | ||
| 613 | + -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2); | ||
| 614 | + border-radius: 0; | ||
| 615 | + background: rgba(0, 0, 0, 0.2); | ||
| 616 | +} | ||
| 617 | +.flexList { | ||
| 618 | + width: 100%; | ||
| 619 | + display: flex; | ||
| 620 | + height: 20px; | ||
| 621 | + line-height: 20px; | ||
| 622 | +} | ||
| 330 | </style> | 623 | </style> |
| 331 | 624 | ... | ... |
src/components/Table/info.vue
deleted
100644 → 0
| 1 | -<template> | ||
| 2 | - <div class="tableInfo"> | ||
| 3 | - <el-dropdown trigger="click" :hide-on-click="false"> | ||
| 4 | - <el-button | ||
| 5 | - type="primary" | ||
| 6 | - icon="el-icon-edit" | ||
| 7 | - size="medium" | ||
| 8 | - circle | ||
| 9 | - ></el-button> | ||
| 10 | - <el-dropdown-menu slot="dropdown"> | ||
| 11 | - <el-checkbox-group v-model="checkList"> | ||
| 12 | - <el-dropdown-item | ||
| 13 | - v-for="(item, index) in infoData" | ||
| 14 | - :key="index" | ||
| 15 | - v-if="!item.type" | ||
| 16 | - class="dropItem" | ||
| 17 | - > | ||
| 18 | - <el-checkbox | ||
| 19 | - :label="item.name" | ||
| 20 | - :checked="true" | ||
| 21 | - @change="checkChange" | ||
| 22 | - ></el-checkbox> | ||
| 23 | - <span class="itemRight"> | ||
| 24 | - <i class="el-icon-caret-top" @click.stop="top(index)"></i> | ||
| 25 | - <i class="el-icon-caret-bottom" @click.stop="bottom(index)"></i> | ||
| 26 | - </span> | ||
| 27 | - </el-dropdown-item> | ||
| 28 | - </el-checkbox-group> | ||
| 29 | - </el-dropdown-menu> | ||
| 30 | - </el-dropdown> | ||
| 31 | - </div> | ||
| 32 | -</template> | ||
| 33 | - | ||
| 34 | -<script> | ||
| 35 | -export default { | ||
| 36 | - props: { infoData: { type: Array, default: null } }, | ||
| 37 | - inheritAttrs: false, | ||
| 38 | - data() { | ||
| 39 | - return { | ||
| 40 | - checkList: [], | ||
| 41 | - }; | ||
| 42 | - }, | ||
| 43 | - methods: { | ||
| 44 | - checkChange(val) { | ||
| 45 | - this.$emit("checkChange", { type: val }); | ||
| 46 | - }, | ||
| 47 | - top(val) { | ||
| 48 | - this.$emit("top", val); | ||
| 49 | - }, | ||
| 50 | - bottom(val) { | ||
| 51 | - this.$emit("bottom", val); | ||
| 52 | - }, | ||
| 53 | - }, | ||
| 54 | - created() {}, | ||
| 55 | -}; | ||
| 56 | -</script> | ||
| 57 | - | ||
| 58 | -<style scope lang="scss"> | ||
| 59 | -.itemRight { | ||
| 60 | - display: -webkit-inline-box; | ||
| 61 | - display: -ms-inline-flexbox; | ||
| 62 | - display: inline-flex; | ||
| 63 | - -webkit-box-orient: vertical; | ||
| 64 | - -webkit-box-direction: normal; | ||
| 65 | - -ms-flex-direction: column; | ||
| 66 | - flex-direction: column; | ||
| 67 | - -webkit-box-align: center; | ||
| 68 | - -ms-flex-align: center; | ||
| 69 | - align-items: center; | ||
| 70 | - height: 34px; | ||
| 71 | - width: 24px; | ||
| 72 | - vertical-align: middle; | ||
| 73 | - cursor: pointer; | ||
| 74 | - overflow: initial; | ||
| 75 | - position: relative; | ||
| 76 | - .el-icon-caret-bottom, | ||
| 77 | - .el-icon-caret-top { | ||
| 78 | - width: 0; | ||
| 79 | - height: 0; | ||
| 80 | - border: solid 5px transparent; | ||
| 81 | - position: absolute; | ||
| 82 | - left: 10px; | ||
| 83 | - } | ||
| 84 | - .el-icon-caret-bottom { | ||
| 85 | - bottom: 12px; | ||
| 86 | - } | ||
| 87 | - .el-icon-caret-top { | ||
| 88 | - top: 5px; | ||
| 89 | - } | ||
| 90 | -} | ||
| 91 | -.dropItem { | ||
| 92 | - display: flex; | ||
| 93 | - justify-content: space-between; | ||
| 94 | -} | ||
| 95 | -</style> | ||
| 96 | - | ||
| 97 | -<style> | ||
| 98 | -.tableInfo { | ||
| 99 | - position: fixed; | ||
| 100 | - right: 30px; | ||
| 101 | - bottom: 40px; | ||
| 102 | - z-index: 99999999; | ||
| 103 | -} | ||
| 104 | -</style> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
src/components/Table/item.vue
deleted
100644 → 0
| 1 | -<script> | ||
| 2 | -export default { | ||
| 3 | - name: "Item", | ||
| 4 | - inheritAttrs: false, | ||
| 5 | - props: { | ||
| 6 | - dom: { | ||
| 7 | - type: Object, | ||
| 8 | - default: null, | ||
| 9 | - }, | ||
| 10 | - }, | ||
| 11 | - render() { | ||
| 12 | - let newDom = []; | ||
| 13 | - newDom.push(this.dom); | ||
| 14 | - return newDom; | ||
| 15 | - }, | ||
| 16 | - methods: { | ||
| 17 | - change(val){ | ||
| 18 | - this.$emit('change',val) | ||
| 19 | - } | ||
| 20 | - }, | ||
| 21 | -}; | ||
| 22 | -</script> |
| ... | @@ -3,9 +3,9 @@ | ... | @@ -3,9 +3,9 @@ |
| 3 | * Copyright (c) 2019 FedEx | 3 | * Copyright (c) 2019 FedEx |
| 4 | */ | 4 | */ |
| 5 | 5 | ||
| 6 | -import store from '@/store' | 6 | + import store from '@/store' |
| 7 | 7 | ||
| 8 | -export default { | 8 | + export default { |
| 9 | inserted(el, binding, vnode) { | 9 | inserted(el, binding, vnode) { |
| 10 | const { value } = binding | 10 | const { value } = binding |
| 11 | const all_permission = "*:*:*"; | 11 | const all_permission = "*:*:*"; |
| ... | @@ -24,5 +24,23 @@ export default { | ... | @@ -24,5 +24,23 @@ export default { |
| 24 | } else { | 24 | } else { |
| 25 | throw new Error(`请设置操作权限标签值`) | 25 | throw new Error(`请设置操作权限标签值`) |
| 26 | } | 26 | } |
| 27 | + }, | ||
| 28 | + | ||
| 29 | + //路由权限处理 | ||
| 30 | + routerPer(router){ | ||
| 31 | + const permissions = store.getters && store.getters.permissions | ||
| 32 | + let newRouter = []; | ||
| 33 | + router.forEach(item => { | ||
| 34 | + permissions.forEach(per=>{ | ||
| 35 | + if(item.meta.permissions == per){ | ||
| 36 | + newRouter.push(item) | ||
| 37 | + } | ||
| 38 | + }) | ||
| 39 | + if(item.children && item.children.length){ | ||
| 40 | + item.children = this.routerPer(item.children) | ||
| 27 | } | 41 | } |
| 28 | -} | 42 | + }); |
| 43 | + return newRouter | ||
| 44 | + } | ||
| 45 | + } | ||
| 46 | + | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -6,7 +6,6 @@ | ... | @@ -6,7 +6,6 @@ |
| 6 | class="hamburger-container" | 6 | class="hamburger-container" |
| 7 | @toggleClick="toggleSideBar" | 7 | @toggleClick="toggleSideBar" |
| 8 | /> | 8 | /> |
| 9 | - | ||
| 10 | <breadcrumb | 9 | <breadcrumb |
| 11 | id="breadcrumb-container" | 10 | id="breadcrumb-container" |
| 12 | class="breadcrumb-container" | 11 | class="breadcrumb-container" |
| ... | @@ -16,31 +15,43 @@ | ... | @@ -16,31 +15,43 @@ |
| 16 | 15 | ||
| 17 | <div class="right-menu"> | 16 | <div class="right-menu"> |
| 18 | <template v-if="device !== 'mobile'"> </template> | 17 | <template v-if="device !== 'mobile'"> </template> |
| 19 | - | 18 | + <el-select |
| 19 | + v-model="portName" | ||
| 20 | + size="mini" | ||
| 21 | + style="width: 120px; top: -17px; right: 7px" | ||
| 22 | + placeholder="选择口岸" | ||
| 23 | + > | ||
| 24 | + <el-option | ||
| 25 | + v-for="item in portNameList" | ||
| 26 | + :label="item" | ||
| 27 | + :value="item" | ||
| 28 | + :key="item" | ||
| 29 | + > | ||
| 30 | + </el-option> | ||
| 31 | + </el-select> | ||
| 20 | <el-dropdown | 32 | <el-dropdown |
| 21 | class="avatar-container right-menu-item hover-effect" | 33 | class="avatar-container right-menu-item hover-effect" |
| 22 | trigger="click" | 34 | trigger="click" |
| 23 | > | 35 | > |
| 24 | - <div class="avatar-wrapper"> | 36 | + <div class="userName-wrapper"> |
| 25 | - <img :src="avatar" class="user-avatar"> | 37 | + <!-- <img :src="avatar" class="user-avatar" /> --> |
| 38 | + <span><i class="el-icon-user-solid" style="color:#1890ff"></i>欢迎!{{userName}}</span> | ||
| 26 | </div> | 39 | </div> |
| 27 | <el-dropdown-menu slot="dropdown"> | 40 | <el-dropdown-menu slot="dropdown"> |
| 28 | - <router-link to="/user/profile"> | ||
| 29 | - </router-link> | ||
| 30 | <el-dropdown-item @click.native="logout"> | 41 | <el-dropdown-item @click.native="logout"> |
| 31 | <span>退出登录</span> | 42 | <span>退出登录</span> |
| 32 | </el-dropdown-item> | 43 | </el-dropdown-item> |
| 33 | </el-dropdown-menu> | 44 | </el-dropdown-menu> |
| 34 | </el-dropdown> | 45 | </el-dropdown> |
| 35 | - <el-select | 46 | + <!-- <el-select |
| 36 | v-model="locale" | 47 | v-model="locale" |
| 37 | size="mini" | 48 | size="mini" |
| 38 | @change="local" | 49 | @change="local" |
| 39 | - style="width: 75px;top:-17px;right:7px" | 50 | + style="width: 75px; top: -17px; right: 7px" |
| 40 | > | 51 | > |
| 41 | <el-option label="中文" value="zh"> </el-option> | 52 | <el-option label="中文" value="zh"> </el-option> |
| 42 | <el-option label="英文" value="en"> </el-option> | 53 | <el-option label="英文" value="en"> </el-option> |
| 43 | - </el-select> | 54 | + </el-select> --> |
| 44 | </div> | 55 | </div> |
| 45 | <Profile :drawer="drawer" @drawerHandleClose="drawerHandleClose"></Profile> | 56 | <Profile :drawer="drawer" @drawerHandleClose="drawerHandleClose"></Profile> |
| 46 | </div> | 57 | </div> |
| ... | @@ -51,21 +62,25 @@ import { mapGetters } from "vuex"; | ... | @@ -51,21 +62,25 @@ import { mapGetters } from "vuex"; |
| 51 | import Breadcrumb from "@/components/Breadcrumb"; | 62 | import Breadcrumb from "@/components/Breadcrumb"; |
| 52 | import TopNav from "@/components/TopNav"; | 63 | import TopNav from "@/components/TopNav"; |
| 53 | import Hamburger from "@/components/Hamburger"; | 64 | import Hamburger from "@/components/Hamburger"; |
| 54 | -import Profile from "@/views/systemConfig/userConfig/profile/index"; | 65 | +import { removeToken } from '@/utils/auth' |
| 55 | 66 | ||
| 56 | export default { | 67 | export default { |
| 57 | components: { | 68 | components: { |
| 58 | Breadcrumb, | 69 | Breadcrumb, |
| 59 | TopNav, | 70 | TopNav, |
| 60 | Hamburger, | 71 | Hamburger, |
| 61 | - Profile, | ||
| 62 | }, | 72 | }, |
| 63 | data() { | 73 | data() { |
| 64 | return { | 74 | return { |
| 65 | - drawer: false, | 75 | + userName:"", |
| 76 | + portNameList: [], | ||
| 66 | locale: "zh", | 77 | locale: "zh", |
| 67 | }; | 78 | }; |
| 68 | }, | 79 | }, |
| 80 | + created() { | ||
| 81 | + this.portNameList = this.$store.state.user.portNames; | ||
| 82 | + this.userName = this.$store.state.user.name; | ||
| 83 | + }, | ||
| 69 | computed: { | 84 | computed: { |
| 70 | ...mapGetters(["sidebar", "avatar", "device"]), | 85 | ...mapGetters(["sidebar", "avatar", "device"]), |
| 71 | setting: { | 86 | setting: { |
| ... | @@ -84,6 +99,43 @@ export default { | ... | @@ -84,6 +99,43 @@ export default { |
| 84 | return this.$store.state.settings.topNav; | 99 | return this.$store.state.settings.topNav; |
| 85 | }, | 100 | }, |
| 86 | }, | 101 | }, |
| 102 | + //切换口岸 | ||
| 103 | + portName: { | ||
| 104 | + get() { | ||
| 105 | + return this.$store.state.user.activePortName; | ||
| 106 | + }, | ||
| 107 | + set(val) { | ||
| 108 | + this.$store | ||
| 109 | + .dispatch("changePort", val) | ||
| 110 | + .then((res) => { | ||
| 111 | + if (res.code === 200) { | ||
| 112 | + this.$store.dispatch('tagsView/delAllCachedViews') | ||
| 113 | + this.$store.dispatch('tagsView/delAllVisitedViews') | ||
| 114 | + // location.reload(); | ||
| 115 | + if(this.$route.path != '/index'){ | ||
| 116 | + this.$router.push('/index') | ||
| 117 | + } | ||
| 118 | + } else { | ||
| 119 | + this.$confirm(res.msg, "提示", { | ||
| 120 | + type: "warning", | ||
| 121 | + }).then(()=>{ | ||
| 122 | + // location.reload(); | ||
| 123 | + if(this.$route.path != '/index'){ | ||
| 124 | + this.$router.push('/index') | ||
| 125 | + } | ||
| 126 | + }).catch(()=>{ | ||
| 127 | + // location.reload(); | ||
| 128 | + if(this.$route.path != '/index'){ | ||
| 129 | + this.$router.push('/index') | ||
| 130 | + } | ||
| 131 | + }); | ||
| 132 | + } | ||
| 133 | + }) | ||
| 134 | + .catch((err) => { | ||
| 135 | + console.log(err); | ||
| 136 | + }); | ||
| 137 | + }, | ||
| 138 | + }, | ||
| 87 | }, | 139 | }, |
| 88 | methods: { | 140 | methods: { |
| 89 | toggleSideBar() { | 141 | toggleSideBar() { |
| ... | @@ -96,14 +148,11 @@ export default { | ... | @@ -96,14 +148,11 @@ export default { |
| 96 | type: "warning", | 148 | type: "warning", |
| 97 | }).then(() => { | 149 | }).then(() => { |
| 98 | this.$store.dispatch("LogOut").then(() => { | 150 | this.$store.dispatch("LogOut").then(() => { |
| 99 | - location.href = "/index"; | 151 | + removeToken() |
| 100 | - // window.location.href = "https://test.secure.fedex.com/logout";//wsso系统跳转 | 152 | + window.location.href = "https://test-myapps.secure.fedex.com/purpleid/signout/";//wsso系统跳转 |
| 101 | }); | 153 | }); |
| 102 | }); | 154 | }); |
| 103 | }, | 155 | }, |
| 104 | - drawerHandleClose(val) { | ||
| 105 | - this.drawer = val; | ||
| 106 | - }, | ||
| 107 | local(val) { | 156 | local(val) { |
| 108 | this.$i18n.locale = val; //此处val为 zh 或者 en | 157 | this.$i18n.locale = val; //此处val为 zh 或者 en |
| 109 | }, | 158 | }, |
| ... | @@ -174,12 +223,19 @@ export default { | ... | @@ -174,12 +223,19 @@ export default { |
| 174 | } | 223 | } |
| 175 | 224 | ||
| 176 | .avatar-container { | 225 | .avatar-container { |
| 226 | + text-align: center; | ||
| 177 | margin-right: 15px; | 227 | margin-right: 15px; |
| 178 | - | 228 | + font-weight: 700; |
| 179 | - .avatar-wrapper { | 229 | + i{ |
| 180 | - margin-top: 5px; | 230 | + display: inline-block; |
| 231 | + height: 50px; | ||
| 232 | + margin-right:5px; | ||
| 233 | + font-size: 24px; | ||
| 234 | + line-height: 50px; | ||
| 235 | + } | ||
| 236 | + .userName-wrapper { | ||
| 181 | position: relative; | 237 | position: relative; |
| 182 | - | 238 | + font-size:14px; |
| 183 | .user-avatar { | 239 | .user-avatar { |
| 184 | cursor: pointer; | 240 | cursor: pointer; |
| 185 | width: 40px; | 241 | width: 40px; | ... | ... |
| 1 | import router from './router' | 1 | import router from './router' |
| 2 | import store from './store' | 2 | import store from './store' |
| 3 | import { Message } from 'element-ui' | 3 | import { Message } from 'element-ui' |
| 4 | -import { getToken } from '@/utils/auth' | 4 | +import { getToken, setToken, removeToken } from '@/utils/auth' |
| 5 | 5 | ||
| 6 | 6 | ||
| 7 | const whiteList = ['/login', '/auth-redirect', '/bind', '/register'] | 7 | const whiteList = ['/login', '/auth-redirect', '/bind', '/register'] |
| ... | @@ -21,9 +21,10 @@ router.beforeEach((to, from, next) => { | ... | @@ -21,9 +21,10 @@ router.beforeEach((to, from, next) => { |
| 21 | next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 | 21 | next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 |
| 22 | }) | 22 | }) |
| 23 | }).catch(err => { | 23 | }).catch(err => { |
| 24 | - store.dispatch('LogOut').then(() => { | ||
| 25 | Message.error(err) | 24 | Message.error(err) |
| 26 | - next({ path: '/' }) | 25 | + store.dispatch('LogOut').then(() => { |
| 26 | + // next({ path: '/' }) | ||
| 27 | + window.location.href = "https://test-myapps.secure.fedex.com/purpleid/signout/";//wsso系统跳转 | ||
| 27 | }) | 28 | }) |
| 28 | }) | 29 | }) |
| 29 | } else { | 30 | } else { |
| ... | @@ -31,13 +32,22 @@ router.beforeEach((to, from, next) => { | ... | @@ -31,13 +32,22 @@ router.beforeEach((to, from, next) => { |
| 31 | } | 32 | } |
| 32 | } | 33 | } |
| 33 | } else { | 34 | } else { |
| 35 | + removeToken() | ||
| 34 | // 没有token | 36 | // 没有token |
| 37 | + //wsso登录时对后端重定向带来的token进行记录 | ||
| 38 | + let token = location.search.split("token=")[1] | ||
| 39 | + if (token != undefined && token != '' && token != null) { | ||
| 40 | + setToken(token) | ||
| 41 | + next({ path: '/' }) | ||
| 42 | + } else { | ||
| 35 | if (whiteList.indexOf(to.path) !== -1) { | 43 | if (whiteList.indexOf(to.path) !== -1) { |
| 36 | // 在免登录白名单,直接进入 | 44 | // 在免登录白名单,直接进入 |
| 37 | next() | 45 | next() |
| 38 | } else { | 46 | } else { |
| 39 | - next(`/login?redirect=${to.fullPath}`) // 否则全部重定向到登录页 | 47 | + window.location.href = "https://test-myapps.secure.fedex.com/purpleid/signout/";//wsso系统跳转 |
| 48 | + } | ||
| 40 | } | 49 | } |
| 50 | + | ||
| 41 | } | 51 | } |
| 42 | }) | 52 | }) |
| 43 | 53 | ... | ... |
| ... | @@ -7,12 +7,15 @@ const getters = { | ... | @@ -7,12 +7,15 @@ const getters = { |
| 7 | token: state => state.user.token, | 7 | token: state => state.user.token, |
| 8 | avatar: state => state.user.avatar, | 8 | avatar: state => state.user.avatar, |
| 9 | name: state => state.user.name, | 9 | name: state => state.user.name, |
| 10 | + activePortName: state => state.user.activePortName, | ||
| 11 | + portName: state => state.user.portName, | ||
| 10 | introduction: state => state.user.introduction, | 12 | introduction: state => state.user.introduction, |
| 11 | roles: state => state.user.roles, | 13 | roles: state => state.user.roles, |
| 12 | permissions: state => state.user.permissions, | 14 | permissions: state => state.user.permissions, |
| 13 | permission_routes: state => state.permission.routes, | 15 | permission_routes: state => state.permission.routes, |
| 14 | - topbarRouters:state => state.permission.topbarRouters, | 16 | + topbarRouters: state => state.permission.topbarRouters, |
| 15 | - defaultRoutes:state => state.permission.defaultRoutes, | 17 | + defaultRoutes: state => state.permission.defaultRoutes, |
| 16 | - sidebarRouters:state => state.permission.sidebarRouters, | 18 | + sidebarRouters: state => state.permission.sidebarRouters, |
| 19 | + filghtAllData: state => state.permission.filghtAllData, | ||
| 17 | } | 20 | } |
| 18 | export default getters | 21 | export default getters | ... | ... |
| ... | @@ -2,14 +2,15 @@ import { constantRoutes } from '@/router' | ... | @@ -2,14 +2,15 @@ import { constantRoutes } from '@/router' |
| 2 | import { getRouters } from '@/api/menu' | 2 | import { getRouters } from '@/api/menu' |
| 3 | import Layout from '@/layout/index' | 3 | import Layout from '@/layout/index' |
| 4 | import ParentView from '@/components/ParentView'; | 4 | import ParentView from '@/components/ParentView'; |
| 5 | - | 5 | +import hasPermi from '../../directive/permission/hasPermi'; |
| 6 | const permission = { | 6 | const permission = { |
| 7 | state: { | 7 | state: { |
| 8 | routes: [], | 8 | routes: [], |
| 9 | addRoutes: [], | 9 | addRoutes: [], |
| 10 | defaultRoutes: [], | 10 | defaultRoutes: [], |
| 11 | topbarRouters: [], | 11 | topbarRouters: [], |
| 12 | - sidebarRouters: [] | 12 | + sidebarRouters: [], |
| 13 | + filghtAllData: {} | ||
| 13 | }, | 14 | }, |
| 14 | mutations: { | 15 | mutations: { |
| 15 | SET_ROUTES: (state, routes) => { | 16 | SET_ROUTES: (state, routes) => { |
| ... | @@ -23,13 +24,20 @@ const permission = { | ... | @@ -23,13 +24,20 @@ const permission = { |
| 23 | // 顶部导航菜单默认添加统计报表栏指向首页 | 24 | // 顶部导航菜单默认添加统计报表栏指向首页 |
| 24 | const index = [{ | 25 | const index = [{ |
| 25 | path: 'index', | 26 | path: 'index', |
| 26 | - meta: { title: '统计报表', icon: 'dashboard'} | 27 | + meta: { title: '首页', icon: 'home' } |
| 27 | }] | 28 | }] |
| 28 | state.topbarRouters = routes.concat(index); | 29 | state.topbarRouters = routes.concat(index); |
| 29 | }, | 30 | }, |
| 30 | SET_SIDEBAR_ROUTERS: (state, routes) => { | 31 | SET_SIDEBAR_ROUTERS: (state, routes) => { |
| 31 | state.sidebarRouters = routes | 32 | state.sidebarRouters = routes |
| 32 | }, | 33 | }, |
| 34 | + SET_FILGHTALL: (state, data) => { | ||
| 35 | + let name = data.name; | ||
| 36 | + state.filghtAllData[name] = data.data; | ||
| 37 | + }, | ||
| 38 | + REMOVE_FILGHTALL: (state, name) => { | ||
| 39 | + delete state.filghtAllData[name] | ||
| 40 | + } | ||
| 33 | }, | 41 | }, |
| 34 | actions: { | 42 | actions: { |
| 35 | // 生成路由 | 43 | // 生成路由 |
| ... | @@ -37,6 +45,7 @@ const permission = { | ... | @@ -37,6 +45,7 @@ const permission = { |
| 37 | return new Promise(resolve => { | 45 | return new Promise(resolve => { |
| 38 | // 向后端请求路由数据 | 46 | // 向后端请求路由数据 |
| 39 | getRouters().then(res => { | 47 | getRouters().then(res => { |
| 48 | + res.data = hasPermi.routerPer(res.data); | ||
| 40 | const sdata = JSON.parse(JSON.stringify(res.data)) | 49 | const sdata = JSON.parse(JSON.stringify(res.data)) |
| 41 | const rdata = JSON.parse(JSON.stringify(res.data)) | 50 | const rdata = JSON.parse(JSON.stringify(res.data)) |
| 42 | const sidebarRoutes = filterAsyncRouter(sdata) | 51 | const sidebarRoutes = filterAsyncRouter(sdata) | ... | ... |
| 1 | import { login, logout, getInfo } from '@/api/login' | 1 | import { login, logout, getInfo } from '@/api/login' |
| 2 | +import { changeCurrentPort } from "@/api/system/user.js"; | ||
| 2 | import { getToken, setToken, removeToken } from '@/utils/auth' | 3 | import { getToken, setToken, removeToken } from '@/utils/auth' |
| 4 | +import { Message } from 'element-ui' | ||
| 3 | 5 | ||
| 4 | const user = { | 6 | const user = { |
| 5 | state: { | 7 | state: { |
| 6 | token: getToken(), | 8 | token: getToken(), |
| 7 | name: '', | 9 | name: '', |
| 8 | avatar: '', | 10 | avatar: '', |
| 11 | + activePortName: '', | ||
| 12 | + portNames:[], | ||
| 9 | roles: [], | 13 | roles: [], |
| 10 | permissions: [] | 14 | permissions: [] |
| 11 | }, | 15 | }, |
| ... | @@ -20,6 +24,13 @@ const user = { | ... | @@ -20,6 +24,13 @@ const user = { |
| 20 | SET_AVATAR: (state, avatar) => { | 24 | SET_AVATAR: (state, avatar) => { |
| 21 | state.avatar = avatar | 25 | state.avatar = avatar |
| 22 | }, | 26 | }, |
| 27 | + SET_ACTIVEPORTNAME: (state, activePortName) => { | ||
| 28 | + state.activePortName = activePortName | ||
| 29 | + sessionStorage.setItem('portName', activePortName) | ||
| 30 | + }, | ||
| 31 | + SET_PORTNAMES:(state,portNames)=>{ | ||
| 32 | + state.portNames = portNames | ||
| 33 | + }, | ||
| 23 | SET_ROLES: (state, roles) => { | 34 | SET_ROLES: (state, roles) => { |
| 24 | state.roles = roles | 35 | state.roles = roles |
| 25 | }, | 36 | }, |
| ... | @@ -29,6 +40,7 @@ const user = { | ... | @@ -29,6 +40,7 @@ const user = { |
| 29 | }, | 40 | }, |
| 30 | 41 | ||
| 31 | actions: { | 42 | actions: { |
| 43 | + | ||
| 32 | // 登录 | 44 | // 登录 |
| 33 | Login({ commit }, userInfo) { | 45 | Login({ commit }, userInfo) { |
| 34 | const username = userInfo.username.trim() | 46 | const username = userInfo.username.trim() |
| ... | @@ -36,10 +48,12 @@ const user = { | ... | @@ -36,10 +48,12 @@ const user = { |
| 36 | const rememberMe = userInfo.rememberMe | 48 | const rememberMe = userInfo.rememberMe |
| 37 | 49 | ||
| 38 | return new Promise((resolve, reject) => { | 50 | return new Promise((resolve, reject) => { |
| 39 | - login(username, password,rememberMe).then(res => { | 51 | + login(username, password, rememberMe).then(res => { |
| 52 | + if(res.code === 200){ | ||
| 40 | setToken(res.data) | 53 | setToken(res.data) |
| 41 | commit('SET_TOKEN', res.data) | 54 | commit('SET_TOKEN', res.data) |
| 42 | - resolve() | 55 | + } |
| 56 | + resolve(res) | ||
| 43 | }).catch(error => { | 57 | }).catch(error => { |
| 44 | reject(error) | 58 | reject(error) |
| 45 | }) | 59 | }) |
| ... | @@ -52,6 +66,20 @@ const user = { | ... | @@ -52,6 +66,20 @@ const user = { |
| 52 | getInfo().then(res => { | 66 | getInfo().then(res => { |
| 53 | const user = res.data.user | 67 | const user = res.data.user |
| 54 | const avatar = user.avatar == "" ? require("@/assets/images/profile.jpg") : process.env.VUE_APP_BASE_API + user.avatar; | 68 | const avatar = user.avatar == "" ? require("@/assets/images/profile.jpg") : process.env.VUE_APP_BASE_API + user.avatar; |
| 69 | + let ports = []; | ||
| 70 | + if(user.portName){ | ||
| 71 | + ports = user.portName.split(','); | ||
| 72 | + commit('SET_PORTNAMES',ports) | ||
| 73 | + commit('SET_ACTIVEPORTNAME', sessionStorage.getItem('portName')?sessionStorage.getItem('portName'):state.portNames[0]) | ||
| 74 | + }else{ | ||
| 75 | + Message({ | ||
| 76 | + message: "未找到口岸信息!请确认后再登录", | ||
| 77 | + type: 'error' | ||
| 78 | + }) | ||
| 79 | + this.LogOut().then(()=>{ | ||
| 80 | + window.location.href = "https://test-myapps.secure.fedex.com/purpleid/signout/";//wsso系统跳转 | ||
| 81 | + }) | ||
| 82 | + } | ||
| 55 | if (res.data.roles && res.data.roles.length > 0) { // 验证返回的roles是否是一个非空数组 | 83 | if (res.data.roles && res.data.roles.length > 0) { // 验证返回的roles是否是一个非空数组 |
| 56 | commit('SET_ROLES', res.data.roles) | 84 | commit('SET_ROLES', res.data.roles) |
| 57 | commit('SET_PERMISSIONS', res.data.permissions) | 85 | commit('SET_PERMISSIONS', res.data.permissions) |
| ... | @@ -67,11 +95,25 @@ const user = { | ... | @@ -67,11 +95,25 @@ const user = { |
| 67 | }) | 95 | }) |
| 68 | }, | 96 | }, |
| 69 | 97 | ||
| 98 | + //切换口岸 | ||
| 99 | + changePort({ commit }, portName) { | ||
| 100 | + return new Promise((resolve, reject) => { | ||
| 101 | + changeCurrentPort({ portName: portName }).then(res=>{ | ||
| 102 | + if(res.code === 200){ | ||
| 103 | + commit('SET_ACTIVEPORTNAME',portName) | ||
| 104 | + } | ||
| 105 | + resolve(res) | ||
| 106 | + }).catch(err=>{ | ||
| 107 | + reject(err) | ||
| 108 | + }) | ||
| 109 | + }) | ||
| 110 | + }, | ||
| 111 | + | ||
| 70 | // 退出系统 | 112 | // 退出系统 |
| 71 | LogOut({ commit, state }) { | 113 | LogOut({ commit, state }) { |
| 72 | return new Promise((resolve, reject) => { | 114 | return new Promise((resolve, reject) => { |
| 73 | logout(state.token).then(() => { | 115 | logout(state.token).then(() => { |
| 74 | - | 116 | + // window.location.href = "https://test-myapps.secure.fedex.com/purpleid/signout";//wsso系统跳转 |
| 75 | commit('SET_TOKEN', '') | 117 | commit('SET_TOKEN', '') |
| 76 | commit('SET_ROLES', []) | 118 | commit('SET_ROLES', []) |
| 77 | commit('SET_PERMISSIONS', []) | 119 | commit('SET_PERMISSIONS', []) |
| ... | @@ -86,6 +128,7 @@ const user = { | ... | @@ -86,6 +128,7 @@ const user = { |
| 86 | // 前端 登出 | 128 | // 前端 登出 |
| 87 | FedLogOut({ commit }) { | 129 | FedLogOut({ commit }) { |
| 88 | return new Promise(resolve => { | 130 | return new Promise(resolve => { |
| 131 | + // window.location.href = "https://test-myapps.secure.fedex.com/purpleid/signout";//wsso系统跳转 | ||
| 89 | commit('SET_TOKEN', '') | 132 | commit('SET_TOKEN', '') |
| 90 | removeToken() | 133 | removeToken() |
| 91 | resolve() | 134 | resolve() | ... | ... |
| ... | @@ -5,9 +5,9 @@ | ... | @@ -5,9 +5,9 @@ |
| 5 | 5 | ||
| 6 | const baseURL = process.env.VUE_APP_BASE_API | 6 | const baseURL = process.env.VUE_APP_BASE_API |
| 7 | 7 | ||
| 8 | -// 日期格式化 | 8 | + // 日期格式化 |
| 9 | -export function parseTime(time, pattern) { | 9 | + export function parseTime(time, pattern) { |
| 10 | - debugger | 10 | + //debugger |
| 11 | if (arguments.length === 0 || !time) { | 11 | if (arguments.length === 0 || !time) { |
| 12 | return null | 12 | return null |
| 13 | } | 13 | } |
| ... | @@ -45,17 +45,17 @@ export function parseTime(time, pattern) { | ... | @@ -45,17 +45,17 @@ export function parseTime(time, pattern) { |
| 45 | return value || 0 | 45 | return value || 0 |
| 46 | }) | 46 | }) |
| 47 | return time_str | 47 | return time_str |
| 48 | -} | 48 | + } |
| 49 | 49 | ||
| 50 | -// 表单重置 | 50 | + // 表单重置 |
| 51 | -export function resetForm(refName) { | 51 | + export function resetForm(refName) { |
| 52 | if (this.$refs[refName]) { | 52 | if (this.$refs[refName]) { |
| 53 | this.$refs[refName].resetFields(); | 53 | this.$refs[refName].resetFields(); |
| 54 | } | 54 | } |
| 55 | -} | 55 | + } |
| 56 | 56 | ||
| 57 | -// 添加日期范围 | 57 | + // 添加日期范围 |
| 58 | -export function addDateRange(params, dateRange, propName) { | 58 | + export function addDateRange(params, dateRange, propName) { |
| 59 | var search = params; | 59 | var search = params; |
| 60 | search.params = {}; | 60 | search.params = {}; |
| 61 | if (null != dateRange && '' != dateRange) { | 61 | if (null != dateRange && '' != dateRange) { |
| ... | @@ -68,10 +68,10 @@ export function addDateRange(params, dateRange, propName) { | ... | @@ -68,10 +68,10 @@ export function addDateRange(params, dateRange, propName) { |
| 68 | } | 68 | } |
| 69 | } | 69 | } |
| 70 | return search; | 70 | return search; |
| 71 | -} | 71 | + } |
| 72 | 72 | ||
| 73 | -// 回显数据字典 | 73 | + // 回显数据字典 |
| 74 | -export function selectDictLabel(datas, value) { | 74 | + export function selectDictLabel(datas, value) { |
| 75 | var actions = []; | 75 | var actions = []; |
| 76 | Object.keys(datas).some((key) => { | 76 | Object.keys(datas).some((key) => { |
| 77 | if (datas[key].dictValue == ('' + value)) { | 77 | if (datas[key].dictValue == ('' + value)) { |
| ... | @@ -80,10 +80,10 @@ export function selectDictLabel(datas, value) { | ... | @@ -80,10 +80,10 @@ export function selectDictLabel(datas, value) { |
| 80 | } | 80 | } |
| 81 | }) | 81 | }) |
| 82 | return actions.join(''); | 82 | return actions.join(''); |
| 83 | -} | 83 | + } |
| 84 | 84 | ||
| 85 | -// 回显数据字典(字符串数组) | 85 | + // 回显数据字典(字符串数组) |
| 86 | -export function selectDictLabels(datas, value, separator) { | 86 | + export function selectDictLabels(datas, value, separator) { |
| 87 | var actions = []; | 87 | var actions = []; |
| 88 | var currentSeparator = undefined === separator ? "," : separator; | 88 | var currentSeparator = undefined === separator ? "," : separator; |
| 89 | var temp = value.split(currentSeparator); | 89 | var temp = value.split(currentSeparator); |
| ... | @@ -95,15 +95,15 @@ export function selectDictLabels(datas, value, separator) { | ... | @@ -95,15 +95,15 @@ export function selectDictLabels(datas, value, separator) { |
| 95 | }) | 95 | }) |
| 96 | }) | 96 | }) |
| 97 | return actions.join('').substring(0, actions.join('').length - 1); | 97 | return actions.join('').substring(0, actions.join('').length - 1); |
| 98 | -} | 98 | + } |
| 99 | 99 | ||
| 100 | -// 通用下载方法 | 100 | + // 通用下载方法 |
| 101 | -export function download(fileName) { | 101 | + export function download(fileName) { |
| 102 | window.location.href = baseURL + "/common/download?fileName=" + encodeURI(fileName) + "&delete=" + true; | 102 | window.location.href = baseURL + "/common/download?fileName=" + encodeURI(fileName) + "&delete=" + true; |
| 103 | -} | 103 | + } |
| 104 | 104 | ||
| 105 | -// 字符串格式化(%s ) | 105 | + // 字符串格式化(%s ) |
| 106 | -export function sprintf(str) { | 106 | + export function sprintf(str) { |
| 107 | var args = arguments, flag = true, i = 1; | 107 | var args = arguments, flag = true, i = 1; |
| 108 | str = str.replace(/%s/g, function () { | 108 | str = str.replace(/%s/g, function () { |
| 109 | var arg = args[i++]; | 109 | var arg = args[i++]; |
| ... | @@ -114,24 +114,24 @@ export function sprintf(str) { | ... | @@ -114,24 +114,24 @@ export function sprintf(str) { |
| 114 | return arg; | 114 | return arg; |
| 115 | }); | 115 | }); |
| 116 | return flag ? str : ''; | 116 | return flag ? str : ''; |
| 117 | -} | 117 | + } |
| 118 | 118 | ||
| 119 | -// 转换字符串,undefined,null等转化为"" | 119 | + // 转换字符串,undefined,null等转化为"" |
| 120 | -export function praseStrEmpty(str) { | 120 | + export function praseStrEmpty(str) { |
| 121 | if (!str || str == "undefined" || str == "null") { | 121 | if (!str || str == "undefined" || str == "null") { |
| 122 | return ""; | 122 | return ""; |
| 123 | } | 123 | } |
| 124 | return str; | 124 | return str; |
| 125 | -} | 125 | + } |
| 126 | 126 | ||
| 127 | -/** | 127 | + /** |
| 128 | * 构造树型结构数据 | 128 | * 构造树型结构数据 |
| 129 | * @param {*} data 数据源 | 129 | * @param {*} data 数据源 |
| 130 | * @param {*} id id字段 默认 'id' | 130 | * @param {*} id id字段 默认 'id' |
| 131 | * @param {*} parentId 父节点字段 默认 'parentId' | 131 | * @param {*} parentId 父节点字段 默认 'parentId' |
| 132 | * @param {*} children 孩子节点字段 默认 'children' | 132 | * @param {*} children 孩子节点字段 默认 'children' |
| 133 | */ | 133 | */ |
| 134 | -export function handleTree(data, id, parentId, children) { | 134 | + export function handleTree(data, id, parentId, children) { |
| 135 | let config = { | 135 | let config = { |
| 136 | id: id || 'id', | 136 | id: id || 'id', |
| 137 | parentId: parentId || 'parentId', | 137 | parentId: parentId || 'parentId', |
| ... | @@ -173,10 +173,10 @@ export function handleTree(data, id, parentId, children) { | ... | @@ -173,10 +173,10 @@ export function handleTree(data, id, parentId, children) { |
| 173 | } | 173 | } |
| 174 | } | 174 | } |
| 175 | return tree; | 175 | return tree; |
| 176 | -} | 176 | + } |
| 177 | 177 | ||
| 178 | -//字符串英文转大写,;转英文; | 178 | + //字符串英文转大写,;转英文; |
| 179 | -export function upCase(str){ | 179 | + export function upCase(str){ |
| 180 | - let newStr = str.replace(/;/g,";").toUpperCase().trim(); | 180 | + let newStr = str.replace(/;/g,";").toUpperCase(); |
| 181 | return newStr; | 181 | return newStr; |
| 182 | -} | 182 | + } | ... | ... |
| ... | @@ -17,5 +17,6 @@ export function setToken(token) { | ... | @@ -17,5 +17,6 @@ export function setToken(token) { |
| 17 | export function removeToken() { | 17 | export function removeToken() { |
| 18 | //return Cookies.remove(TokenKey) | 18 | //return Cookies.remove(TokenKey) |
| 19 | // return localStorage.removeItem(TokenKey) | 19 | // return localStorage.removeItem(TokenKey) |
| 20 | + sessionStorage.removeItem('portName') | ||
| 20 | return sessionStorage.removeItem(TokenKey) | 21 | return sessionStorage.removeItem(TokenKey) |
| 21 | } | 22 | } | ... | ... |
| ... | @@ -67,8 +67,10 @@ service.interceptors.response.use(res => { | ... | @@ -67,8 +67,10 @@ service.interceptors.response.use(res => { |
| 67 | type: 'warning' | 67 | type: 'warning' |
| 68 | } | 68 | } |
| 69 | ).then(() => { | 69 | ).then(() => { |
| 70 | - store.dispatch('FedLogOut').then(() => { | 70 | + store.dispatch('LogOut').then(() => { |
| 71 | - location.href = '/index'; | 71 | + // location.href = '/'; |
| 72 | + window.location.href = "https://test-myapps.secure.fedex.com/purpleid/signout/";//wsso系统跳转 | ||
| 73 | + // testsso.ute.apac.fedex.com/iMAC | ||
| 72 | }) | 74 | }) |
| 73 | }) | 75 | }) |
| 74 | } else if (code === 403) { | 76 | } else if (code === 403) { | ... | ... |
| ... | @@ -199,6 +199,7 @@ | ... | @@ -199,6 +199,7 @@ |
| 199 | <el-col :span="6"> | 199 | <el-col :span="6"> |
| 200 | <el-form-item label="取件日期"> | 200 | <el-form-item label="取件日期"> |
| 201 | <el-date-picker | 201 | <el-date-picker |
| 202 | + class="formItem" | ||
| 202 | v-model="formData.pickUpDate" | 203 | v-model="formData.pickUpDate" |
| 203 | type="date" | 204 | type="date" |
| 204 | placeholder="选择日期" | 205 | placeholder="选择日期" |
| ... | @@ -208,16 +209,6 @@ | ... | @@ -208,16 +209,6 @@ |
| 208 | </el-date-picker> | 209 | </el-date-picker> |
| 209 | </el-form-item> | 210 | </el-form-item> |
| 210 | </el-col> | 211 | </el-col> |
| 211 | - <el-col :span="6"> | ||
| 212 | - <el-form-item label="口岸代码"> | ||
| 213 | - <el-input | ||
| 214 | - v-model="portName" | ||
| 215 | - placeholder="请输入口岸代码" | ||
| 216 | - class="formItem" | ||
| 217 | - clearable | ||
| 218 | - ></el-input> | ||
| 219 | - </el-form-item> | ||
| 220 | - </el-col> | ||
| 221 | <el-col :span="24"> | 212 | <el-col :span="24"> |
| 222 | <el-form-item label="Handling Code"> | 213 | <el-form-item label="Handling Code"> |
| 223 | <el-empty | 214 | <el-empty |
| ... | @@ -267,6 +258,7 @@ | ... | @@ -267,6 +258,7 @@ |
| 267 | <el-button | 258 | <el-button |
| 268 | :type="downLoadingTip.downloading ? 'warning' : 'primary'" | 259 | :type="downLoadingTip.downloading ? 'warning' : 'primary'" |
| 269 | size="mini" | 260 | size="mini" |
| 261 | + v-hasPermi="['allocation:cargo:export']" | ||
| 270 | @click="xlsx(0)" | 262 | @click="xlsx(0)" |
| 271 | :loading="downLoadingTip.downloading" | 263 | :loading="downLoadingTip.downloading" |
| 272 | :disabled="tableData.length <= 0" | 264 | :disabled="tableData.length <= 0" |
| ... | @@ -277,6 +269,7 @@ | ... | @@ -277,6 +269,7 @@ |
| 277 | <el-button | 269 | <el-button |
| 278 | :type="downLoadingTip.downloading ? 'warning' : 'primary'" | 270 | :type="downLoadingTip.downloading ? 'warning' : 'primary'" |
| 279 | size="mini" | 271 | size="mini" |
| 272 | + v-hasPermi="['allocation:cargo:export']" | ||
| 280 | @click="xlsx(1)" | 273 | @click="xlsx(1)" |
| 281 | :loading="downLoadingTip.downloading" | 274 | :loading="downLoadingTip.downloading" |
| 282 | :disabled="tableData.length <= 0" | 275 | :disabled="tableData.length <= 0" |
| ... | @@ -287,8 +280,9 @@ | ... | @@ -287,8 +280,9 @@ |
| 287 | <el-button | 280 | <el-button |
| 288 | type="primary" | 281 | type="primary" |
| 289 | size="mini" | 282 | size="mini" |
| 283 | + v-hasPermi="['allocation:cargo:allocation']" | ||
| 290 | @click="addFit" | 284 | @click="addFit" |
| 291 | - :disabled="tableSelection.length <= 0" | 285 | + :disabled="tableSelection.length <= 0 || formData.accsPool!='OSPR'" |
| 292 | >添加到航班</el-button | 286 | >添加到航班</el-button |
| 293 | > | 287 | > |
| 294 | <div class="tips"> | 288 | <div class="tips"> |
| ... | @@ -307,7 +301,8 @@ | ... | @@ -307,7 +301,8 @@ |
| 307 | :limitStart="formData.limitStart" | 301 | :limitStart="formData.limitStart" |
| 308 | :page="page" | 302 | :page="page" |
| 309 | :shiftKey="shiftKey" | 303 | :shiftKey="shiftKey" |
| 310 | - height="350" | 304 | + :infoShow="false" |
| 305 | + :height="tableHeight" | ||
| 311 | @tableSelect="tableSelect" | 306 | @tableSelect="tableSelect" |
| 312 | @tableSelectAll="tableSelectAll" | 307 | @tableSelectAll="tableSelectAll" |
| 313 | @currentChange="currentChange" | 308 | @currentChange="currentChange" |
| ... | @@ -817,6 +812,7 @@ export default { | ... | @@ -817,6 +812,7 @@ export default { |
| 817 | size: 100, | 812 | size: 100, |
| 818 | allWeight: 0, | 813 | allWeight: 0, |
| 819 | allQty: 0, | 814 | allQty: 0, |
| 815 | + tableHeight:null, | ||
| 820 | dialogVisible: false, | 816 | dialogVisible: false, |
| 821 | shiftKey: false, | 817 | shiftKey: false, |
| 822 | createDate: null, | 818 | createDate: null, |
| ... | @@ -829,6 +825,11 @@ export default { | ... | @@ -829,6 +825,11 @@ export default { |
| 829 | }, | 825 | }, |
| 830 | created() { | 826 | created() { |
| 831 | this.seleData(); | 827 | this.seleData(); |
| 828 | + if(this.$store.state.tagsView.cachedViews.length == 0){ | ||
| 829 | + this.select(); | ||
| 830 | + } | ||
| 831 | + }, | ||
| 832 | + activated(){ | ||
| 832 | this.select(); | 833 | this.select(); |
| 833 | }, | 834 | }, |
| 834 | mounted() { | 835 | mounted() { |
| ... | @@ -842,6 +843,7 @@ export default { | ... | @@ -842,6 +843,7 @@ export default { |
| 842 | this.shiftKey = false; | 843 | this.shiftKey = false; |
| 843 | } | 844 | } |
| 844 | }); | 845 | }); |
| 846 | + this.tableHeight = window.innerHeight - this.$refs.form.$el.offsetHeight-60 | ||
| 845 | }, | 847 | }, |
| 846 | methods: { | 848 | methods: { |
| 847 | //查询条件 | 849 | //查询条件 |
| ... | @@ -888,9 +890,9 @@ export default { | ... | @@ -888,9 +890,9 @@ export default { |
| 888 | this.tableData = res.data.list; | 890 | this.tableData = res.data.list; |
| 889 | this.totalCount = res.data.total; | 891 | this.totalCount = res.data.total; |
| 890 | if (res.data.list.length > 0) { | 892 | if (res.data.list.length > 0) { |
| 891 | - this.tableData.forEach((item, index = 0) => { | 893 | + // this.tableData.forEach((item, index = 0) => { |
| 892 | - item.index = index; | 894 | + // item.index = index; |
| 893 | - }); | 895 | + // }); |
| 894 | } else { | 896 | } else { |
| 895 | this.$message({ | 897 | this.$message({ |
| 896 | message: "未查询到数据", | 898 | message: "未查询到数据", |
| ... | @@ -1025,14 +1027,20 @@ export default { | ... | @@ -1025,14 +1027,20 @@ export default { |
| 1025 | } | 1027 | } |
| 1026 | }); | 1028 | }); |
| 1027 | data = data.sort(this.$refs.newTables.compare(val.prop, val.order)); | 1029 | data = data.sort(this.$refs.newTables.compare(val.prop, val.order)); |
| 1028 | - if (val.order != "ascending") { | 1030 | + if (val.order == "descending") { |
| 1029 | this.tableData = nullData.concat(data); | 1031 | this.tableData = nullData.concat(data); |
| 1030 | - } else { | 1032 | + } else{ |
| 1031 | this.tableData = data.concat(nullData); | 1033 | this.tableData = data.concat(nullData); |
| 1032 | } | 1034 | } |
| 1033 | - this.tableData.forEach((item, index = 0) => { | 1035 | + this.tableSelection = [] |
| 1034 | - item.index = index; | 1036 | + this.cargoTotal() |
| 1035 | - }); | 1037 | + // this.tableData.forEach((item, index = 0) => { |
| 1038 | + // item.index = index; | ||
| 1039 | + // }); | ||
| 1040 | + }, | ||
| 1041 | + sizeChange(val){ | ||
| 1042 | + this.size = val | ||
| 1043 | + this.select(0); | ||
| 1036 | }, | 1044 | }, |
| 1037 | //添加到航班 | 1045 | //添加到航班 |
| 1038 | addFit() { | 1046 | addFit() { |
| ... | @@ -1083,6 +1091,9 @@ export default { | ... | @@ -1083,6 +1091,9 @@ export default { |
| 1083 | }, | 1091 | }, |
| 1084 | }, | 1092 | }, |
| 1085 | }, | 1093 | }, |
| 1094 | + deactivated(){ | ||
| 1095 | + this.tableData = [] | ||
| 1096 | + }, | ||
| 1086 | }; | 1097 | }; |
| 1087 | </script> | 1098 | </script> |
| 1088 | 1099 | ... | ... |
| ... | @@ -28,6 +28,7 @@ | ... | @@ -28,6 +28,7 @@ |
| 28 | :label="item.name" | 28 | :label="item.name" |
| 29 | :key="index" | 29 | :key="index" |
| 30 | :show-overflow-tooltip="true" | 30 | :show-overflow-tooltip="true" |
| 31 | + :formatter="formatter" | ||
| 31 | > | 32 | > |
| 32 | </el-table-column> | 33 | </el-table-column> |
| 33 | </el-table> | 34 | </el-table> |
| ... | @@ -119,7 +120,7 @@ export default { | ... | @@ -119,7 +120,7 @@ export default { |
| 119 | }, | 120 | }, |
| 120 | ], | 121 | ], |
| 121 | }, | 122 | }, |
| 122 | - loading:false | 123 | + loading:false, |
| 123 | }; | 124 | }; |
| 124 | }, | 125 | }, |
| 125 | methods: { | 126 | methods: { |
| ... | @@ -133,7 +134,7 @@ export default { | ... | @@ -133,7 +134,7 @@ export default { |
| 133 | }, | 134 | }, |
| 134 | //确定配舱 | 135 | //确定配舱 |
| 135 | submit() { | 136 | submit() { |
| 136 | - this.loading = true; | 137 | + this.loading= true; |
| 137 | let arr = []; | 138 | let arr = []; |
| 138 | this.tableData.forEach((item) => { | 139 | this.tableData.forEach((item) => { |
| 139 | arr.push(item.id); | 140 | arr.push(item.id); |
| ... | @@ -141,6 +142,7 @@ export default { | ... | @@ -141,6 +142,7 @@ export default { |
| 141 | this.formData.ids = arr; | 142 | this.formData.ids = arr; |
| 142 | if (this.formData.fltNo && this.formData.fltDate) { | 143 | if (this.formData.fltNo && this.formData.fltDate) { |
| 143 | allocationFlight(this.formData).then((res) => { | 144 | allocationFlight(this.formData).then((res) => { |
| 145 | + this.loading = false; | ||
| 144 | //code 200 配舱成功 202 重量已满需要确认 其余code直接输出msg | 146 | //code 200 配舱成功 202 重量已满需要确认 其余code直接输出msg |
| 145 | if (res.code === 200) { | 147 | if (res.code === 200) { |
| 146 | this.$message({ | 148 | this.$message({ |
| ... | @@ -148,7 +150,6 @@ export default { | ... | @@ -148,7 +150,6 @@ export default { |
| 148 | type: "success", | 150 | type: "success", |
| 149 | }); | 151 | }); |
| 150 | this.cleaerForm(); | 152 | this.cleaerForm(); |
| 151 | - this.loading = false; | ||
| 152 | this.$emit("dialogBeforeClose", { close: false, reload: true }); | 153 | this.$emit("dialogBeforeClose", { close: false, reload: true }); |
| 153 | } else if (res.code === 202) { | 154 | } else if (res.code === 202) { |
| 154 | MessageBox.confirm(res.msg, "提示", { | 155 | MessageBox.confirm(res.msg, "提示", { |
| ... | @@ -210,6 +211,16 @@ export default { | ... | @@ -210,6 +211,16 @@ export default { |
| 210 | this.cleaerForm(); | 211 | this.cleaerForm(); |
| 211 | this.$emit("dialogBeforeClose", { close: false, reload: true }); | 212 | this.$emit("dialogBeforeClose", { close: false, reload: true }); |
| 212 | }, | 213 | }, |
| 214 | + formatter(row, column, cellValue, index){ | ||
| 215 | + if(column.property == "cargoRulesStatus"){ | ||
| 216 | + if(cellValue == 1){ | ||
| 217 | + return "手动" | ||
| 218 | + }else{ | ||
| 219 | + return "自动" | ||
| 220 | + } | ||
| 221 | + } | ||
| 222 | + return cellValue | ||
| 223 | + } | ||
| 213 | }, | 224 | }, |
| 214 | computed: { | 225 | computed: { |
| 215 | fltNo: { | 226 | fltNo: { | ... | ... |
| ... | @@ -37,6 +37,7 @@ | ... | @@ -37,6 +37,7 @@ |
| 37 | type="primary" | 37 | type="primary" |
| 38 | icon="el-icon-plus" | 38 | icon="el-icon-plus" |
| 39 | size="mini" | 39 | size="mini" |
| 40 | + v-hasPermi="['allocation:alloc:add']" | ||
| 40 | @click=" | 41 | @click=" |
| 41 | $router.push({ | 42 | $router.push({ |
| 42 | name: 'FlightAllocConfigAdd', | 43 | name: 'FlightAllocConfigAdd', |
| ... | @@ -90,6 +91,7 @@ | ... | @@ -90,6 +91,7 @@ |
| 90 | type="text" | 91 | type="text" |
| 91 | size="mini" | 92 | size="mini" |
| 92 | icon="el-icon-edit" | 93 | icon="el-icon-edit" |
| 94 | + v-hasPermi="['allocation:alloc:update']" | ||
| 93 | @click="handleClick(scope.row.id, 'update')" | 95 | @click="handleClick(scope.row.id, 'update')" |
| 94 | >修改</el-button | 96 | >修改</el-button |
| 95 | > | 97 | > |
| ... | @@ -97,6 +99,7 @@ | ... | @@ -97,6 +99,7 @@ |
| 97 | type="text" | 99 | type="text" |
| 98 | size="mini" | 100 | size="mini" |
| 99 | icon="el-icon-delete" | 101 | icon="el-icon-delete" |
| 102 | + v-hasPermi="['allocation:alloc:delete']" | ||
| 100 | @click="del(scope.row.id, scope.row.status)" | 103 | @click="del(scope.row.id, scope.row.status)" |
| 101 | >删除</el-button | 104 | >删除</el-button |
| 102 | > | 105 | > |
| ... | @@ -104,6 +107,7 @@ | ... | @@ -104,6 +107,7 @@ |
| 104 | type="text" | 107 | type="text" |
| 105 | size="mini" | 108 | size="mini" |
| 106 | icon="el-icon-video-pause" | 109 | icon="el-icon-video-pause" |
| 110 | + v-hasPermi="['allocation:alloc:openClose']" | ||
| 107 | @click="changeStatus(scope.row.id, 3)" | 111 | @click="changeStatus(scope.row.id, 3)" |
| 108 | v-if="scope.row.status == '1'" | 112 | v-if="scope.row.status == '1'" |
| 109 | >停用</el-button | 113 | >停用</el-button |
| ... | @@ -112,6 +116,7 @@ | ... | @@ -112,6 +116,7 @@ |
| 112 | type="text" | 116 | type="text" |
| 113 | size="mini" | 117 | size="mini" |
| 114 | icon="el-icon-video-play" | 118 | icon="el-icon-video-play" |
| 119 | + v-hasPermi="['allocation:alloc:openClose']" | ||
| 115 | @click="changeStatus(scope.row.id, 1)" | 120 | @click="changeStatus(scope.row.id, 1)" |
| 116 | v-else | 121 | v-else |
| 117 | >启用</el-button | 122 | >启用</el-button |
| ... | @@ -159,9 +164,17 @@ export default { | ... | @@ -159,9 +164,17 @@ export default { |
| 159 | loading: false, | 164 | loading: false, |
| 160 | }; | 165 | }; |
| 161 | }, | 166 | }, |
| 167 | + created() { | ||
| 168 | + if(this.$store.state.tagsView.cachedViews.length == 0){ | ||
| 169 | + this.getList(); | ||
| 170 | + } | ||
| 171 | + }, | ||
| 162 | activated(){ | 172 | activated(){ |
| 163 | this.getList() | 173 | this.getList() |
| 164 | }, | 174 | }, |
| 175 | + deactivated(){ | ||
| 176 | + this.flyList = [] | ||
| 177 | + }, | ||
| 165 | methods: { | 178 | methods: { |
| 166 | getList() { | 179 | getList() { |
| 167 | this.queryParams.limit = this.limit; | 180 | this.queryParams.limit = this.limit; |
| ... | @@ -240,9 +253,6 @@ export default { | ... | @@ -240,9 +253,6 @@ export default { |
| 240 | }); | 253 | }); |
| 241 | }, | 254 | }, |
| 242 | }, | 255 | }, |
| 243 | - created() { | ||
| 244 | - this.getList(); | ||
| 245 | - }, | ||
| 246 | computed: { | 256 | computed: { |
| 247 | purposeOfFlightNo: { | 257 | purposeOfFlightNo: { |
| 248 | get: function () { | 258 | get: function () { | ... | ... |
| 1 | <template> | 1 | <template> |
| 2 | <div> | 2 | <div> |
| 3 | - <el-form :model="queryParams" ref="queryForm" :inline="true"> | 3 | + <el-form |
| 4 | - <el-form-item label="ACCS原航班"> | 4 | + class="form-header" |
| 5 | + :model="queryParams" | ||
| 6 | + ref="queryForm" | ||
| 7 | + size="medium" | ||
| 8 | + :inline="true" | ||
| 9 | + label-position="right" | ||
| 10 | + label-width="auto" | ||
| 11 | + > | ||
| 12 | + <el-form-item label="原航班"> | ||
| 5 | <el-input | 13 | <el-input |
| 6 | type="text" | 14 | type="text" |
| 7 | v-model="upCase" | 15 | v-model="upCase" |
| 8 | - placeholder="请输入ACCS原航班" | 16 | + placeholder="请输入原航班" |
| 9 | clearable | 17 | clearable |
| 10 | - class="formItem" | ||
| 11 | ></el-input> | 18 | ></el-input> |
| 12 | <!-- <el-input v-model="upCase" placeholder="请输入原航班" clearable size="small" /> --> | 19 | <!-- <el-input v-model="upCase" placeholder="请输入原航班" clearable size="small" /> --> |
| 13 | </el-form-item> | 20 | </el-form-item> |
| 14 | <el-form-item label="状态" prop="status"> | 21 | <el-form-item label="状态" prop="status"> |
| 15 | - <el-select | 22 | + <el-select v-model="queryParams.status" placeholder="请选择" clearable> |
| 16 | - v-model="queryParams.status" | ||
| 17 | - placeholder="请选择" | ||
| 18 | - clearable | ||
| 19 | - size="small" | ||
| 20 | - > | ||
| 21 | <el-option | 23 | <el-option |
| 22 | v-for="dict in statusList" | 24 | v-for="dict in statusList" |
| 23 | :key="dict.id" | 25 | :key="dict.id" |
| ... | @@ -33,7 +35,7 @@ | ... | @@ -33,7 +35,7 @@ |
| 33 | icon="el-icon-search" | 35 | icon="el-icon-search" |
| 34 | size="mini" | 36 | size="mini" |
| 35 | @click="handleQuery" | 37 | @click="handleQuery" |
| 36 | - >查询ACCS原航班配置</el-button | 38 | + >查询原航班配置</el-button |
| 37 | > | 39 | > |
| 38 | </el-form-item> | 40 | </el-form-item> |
| 39 | <br /> | 41 | <br /> |
| ... | @@ -43,7 +45,6 @@ | ... | @@ -43,7 +45,6 @@ |
| 43 | v-model="queryParams.flightDate" | 45 | v-model="queryParams.flightDate" |
| 44 | type="date" | 46 | type="date" |
| 45 | placeholder="选择日期" | 47 | placeholder="选择日期" |
| 46 | - clearable | ||
| 47 | > | 48 | > |
| 48 | </el-date-picker> | 49 | </el-date-picker> |
| 49 | </el-form-item> | 50 | </el-form-item> |
| ... | @@ -56,22 +57,18 @@ | ... | @@ -56,22 +57,18 @@ |
| 56 | @click="findSourceFlightAndFlightDate" | 57 | @click="findSourceFlightAndFlightDate" |
| 57 | >查询实际配载航班 </el-button | 58 | >查询实际配载航班 </el-button |
| 58 | >  | 59 | >  |
| 59 | - <span style="color: #ff4949" | 60 | + <span style="color:#ff4949">注:原航班+日期查询该日期的航班实际情况</span> |
| 60 | - >注:ACCS原航班+日期查询该日期的航班实际情况</span | ||
| 61 | - > | ||
| 62 | </el-form-item> | 61 | </el-form-item> |
| 63 | <br /> | 62 | <br /> |
| 64 | <el-form-item> | 63 | <el-form-item> |
| 65 | - <el-col :span="1.5"> | ||
| 66 | <el-button | 64 | <el-button |
| 67 | type="primary" | 65 | type="primary" |
| 68 | icon="el-icon-plus" | 66 | icon="el-icon-plus" |
| 69 | size="mini" | 67 | size="mini" |
| 68 | + v-hasPermi="['allocation:rand:add']" | ||
| 70 | @click="handleAdd" | 69 | @click="handleAdd" |
| 71 | >添加规则</el-button | 70 | >添加规则</el-button |
| 72 | > | 71 | > |
| 73 | - </el-col> | ||
| 74 | -   | ||
| 75 | <el-button icon="el-icon-refresh" size="mini" @click="resetQuery" | 72 | <el-button icon="el-icon-refresh" size="mini" @click="resetQuery" |
| 76 | >重置</el-button | 73 | >重置</el-button |
| 77 | > | 74 | > |
| ... | @@ -90,18 +87,13 @@ | ... | @@ -90,18 +87,13 @@ |
| 90 | <el-table-column type="index" label="序号" align="center"> | 87 | <el-table-column type="index" label="序号" align="center"> |
| 91 | <template slot-scope="scope">{{ scope.$index + 1 }}</template> | 88 | <template slot-scope="scope">{{ scope.$index + 1 }}</template> |
| 92 | </el-table-column> | 89 | </el-table-column> |
| 93 | - <el-table-column | 90 | + <el-table-column label="原航班" align="center" prop="sourceFlightNo" /> |
| 94 | - label="ACCS原航班" | ||
| 95 | - align="center" | ||
| 96 | - prop="sourceFlightNo" | ||
| 97 | - /> | ||
| 98 | <el-table-column | 91 | <el-table-column |
| 99 | label="配载航班排序" | 92 | label="配载航班排序" |
| 100 | align="center" | 93 | align="center" |
| 101 | prop="flightRank" | 94 | prop="flightRank" |
| 102 | width="280" | 95 | width="280" |
| 103 | /> | 96 | /> |
| 104 | - <!-- <el-table-column label="优先级" align="center" prop="priority" /> --> | ||
| 105 | <el-table-column | 97 | <el-table-column |
| 106 | label="周期" | 98 | label="周期" |
| 107 | align="center" | 99 | align="center" |
| ... | @@ -150,6 +142,7 @@ | ... | @@ -150,6 +142,7 @@ |
| 150 | size="mini" | 142 | size="mini" |
| 151 | type="text" | 143 | type="text" |
| 152 | icon="el-icon-edit" | 144 | icon="el-icon-edit" |
| 145 | + v-hasPermi="['allocation:rand:update']" | ||
| 153 | @click="handleUpdate(scope.row)" | 146 | @click="handleUpdate(scope.row)" |
| 154 | >修改</el-button | 147 | >修改</el-button |
| 155 | > | 148 | > |
| ... | @@ -157,6 +150,7 @@ | ... | @@ -157,6 +150,7 @@ |
| 157 | size="mini" | 150 | size="mini" |
| 158 | type="text" | 151 | type="text" |
| 159 | icon="el-icon-delete" | 152 | icon="el-icon-delete" |
| 153 | + v-hasPermi="['allocation:rand:delete']" | ||
| 160 | @click="handleDeleteorPlayorpause(scope.row, 0, '删除')" | 154 | @click="handleDeleteorPlayorpause(scope.row, 0, '删除')" |
| 161 | > | 155 | > |
| 162 | 删除</el-button | 156 | 删除</el-button |
| ... | @@ -166,6 +160,7 @@ | ... | @@ -166,6 +160,7 @@ |
| 166 | type="text" | 160 | type="text" |
| 167 | icon="el-icon-video-play" | 161 | icon="el-icon-video-play" |
| 168 | v-if="scope.row.status == '3'" | 162 | v-if="scope.row.status == '3'" |
| 163 | + v-hasPermi="['allocation:rand:openClose']" | ||
| 169 | @click="handleDeleteorPlayorpause(scope.row, 1, '启用')" | 164 | @click="handleDeleteorPlayorpause(scope.row, 1, '启用')" |
| 170 | >启用</el-button | 165 | >启用</el-button |
| 171 | > | 166 | > |
| ... | @@ -174,6 +169,7 @@ | ... | @@ -174,6 +169,7 @@ |
| 174 | type="text" | 169 | type="text" |
| 175 | icon="el-icon-video-pause" | 170 | icon="el-icon-video-pause" |
| 176 | v-if="scope.row.status != '3'" | 171 | v-if="scope.row.status != '3'" |
| 172 | + v-hasPermi="['allocation:rand:openClose']" | ||
| 177 | @click="handleDeleteorPlayorpause(scope.row, 3, '停用')" | 173 | @click="handleDeleteorPlayorpause(scope.row, 3, '停用')" |
| 178 | >停用</el-button | 174 | >停用</el-button |
| 179 | > | 175 | > |
| ... | @@ -202,11 +198,7 @@ | ... | @@ -202,11 +198,7 @@ |
| 202 | <el-table-column type="index" label="序号" align="center"> | 198 | <el-table-column type="index" label="序号" align="center"> |
| 203 | <template slot-scope="scope">{{ scope.$index + 1 }}</template> | 199 | <template slot-scope="scope">{{ scope.$index + 1 }}</template> |
| 204 | </el-table-column> | 200 | </el-table-column> |
| 205 | - <el-table-column | 201 | + <el-table-column label="原航班" align="center" prop="sourceFlightNo" /> |
| 206 | - label="ACCS原航班" | ||
| 207 | - align="center" | ||
| 208 | - prop="sourceFlightNo" | ||
| 209 | - /> | ||
| 210 | <el-table-column | 202 | <el-table-column |
| 211 | label="实际配载航班" | 203 | label="实际配载航班" |
| 212 | align="center" | 204 | align="center" |
| ... | @@ -244,17 +236,42 @@ | ... | @@ -244,17 +236,42 @@ |
| 244 | :append-to-body="true" | 236 | :append-to-body="true" |
| 245 | :close-on-click-modal="false" | 237 | :close-on-click-modal="false" |
| 246 | > | 238 | > |
| 247 | - <el-form ref="form" :model="form" :rules="rules" label-width="100px"> | 239 | + <el-form |
| 240 | + ref="form" | ||
| 241 | + :model="form" | ||
| 242 | + :rules="rules" | ||
| 243 | + label-position="right" | ||
| 244 | + label-width="auto" | ||
| 245 | + > | ||
| 248 | <el-row> | 246 | <el-row> |
| 249 | - <el-col :span="10"> | 247 | + <el-col :span="8"> |
| 250 | - <el-form-item label="ACCS原航班" prop="sourceFlightNo"> | 248 | + <el-form-item label="原航班" prop="sourceFlightNo"> |
| 251 | <el-input | 249 | <el-input |
| 252 | v-model="form.sourceFlightNo" | 250 | v-model="form.sourceFlightNo" |
| 253 | - placeholder="请输入ACCS原航班号" | 251 | + placeholder="请输入原航班号" |
| 254 | maxlength="10" | 252 | maxlength="10" |
| 255 | /> | 253 | /> |
| 256 | </el-form-item> | 254 | </el-form-item> |
| 257 | </el-col> | 255 | </el-col> |
| 256 | + | ||
| 257 | + <el-col :span="8"> | ||
| 258 | + <el-form-item label="口岸" prop="portName"> | ||
| 259 | + <el-select | ||
| 260 | + :disabled="true" | ||
| 261 | + v-model="form.portName" | ||
| 262 | + size="mini" | ||
| 263 | + placeholder="选择口岸" | ||
| 264 | + > | ||
| 265 | + <el-option | ||
| 266 | + v-for="item in portNameList" | ||
| 267 | + :label="item" | ||
| 268 | + :value="item" | ||
| 269 | + :key="item" | ||
| 270 | + > | ||
| 271 | + </el-option> | ||
| 272 | + </el-select> | ||
| 273 | + </el-form-item> | ||
| 274 | + </el-col> | ||
| 258 | </el-row> | 275 | </el-row> |
| 259 | <el-row> | 276 | <el-row> |
| 260 | <el-col :span="8"> | 277 | <el-col :span="8"> |
| ... | @@ -287,10 +304,10 @@ | ... | @@ -287,10 +304,10 @@ |
| 287 | </el-col> | 304 | </el-col> |
| 288 | 305 | ||
| 289 | <el-col :span="24" style="margin-bottom: 5%"> | 306 | <el-col :span="24" style="margin-bottom: 5%"> |
| 290 | - <span style="color:#ff4949; margin-left: 10%" | 307 | + <span style="color: #ff4949; margin-left: 10%" |
| 291 | >提示:配载航班之间请用分号分隔【符号不区分中英文】,例:CA1053;C7433</span | 308 | >提示:配载航班之间请用分号分隔【符号不区分中英文】,例:CA1053;C7433</span |
| 292 | ><br /> | 309 | ><br /> |
| 293 | - <span style="color:#ff4949; margin-left: 10%" | 310 | + <span style="color: #ff4949; margin-left: 10%" |
| 294 | >提示:如果需要设置配载航班延迟或提前可以直接在目的航斑后加减【+-】天数。如:CA1053+1;CZ433-1</span | 311 | >提示:如果需要设置配载航班延迟或提前可以直接在目的航斑后加减【+-】天数。如:CA1053+1;CZ433-1</span |
| 295 | > | 312 | > |
| 296 | </el-col> | 313 | </el-col> |
| ... | @@ -335,6 +352,7 @@ export default { | ... | @@ -335,6 +352,7 @@ export default { |
| 335 | name: "FlightRandConfig", | 352 | name: "FlightRandConfig", |
| 336 | data() { | 353 | data() { |
| 337 | return { | 354 | return { |
| 355 | + portNameList: [], | ||
| 338 | // data 中设定 | 356 | // data 中设定 |
| 339 | pickerOptionsStart: { | 357 | pickerOptionsStart: { |
| 340 | disabledDate: (time) => { | 358 | disabledDate: (time) => { |
| ... | @@ -359,7 +377,6 @@ export default { | ... | @@ -359,7 +377,6 @@ export default { |
| 359 | } | 377 | } |
| 360 | }, | 378 | }, |
| 361 | }, | 379 | }, |
| 362 | - | ||
| 363 | //周期段 | 380 | //周期段 |
| 364 | dayOfWeekList: ["D1", "D2", "D3", "D4", "D5", "D6", "D7"], | 381 | dayOfWeekList: ["D1", "D2", "D3", "D4", "D5", "D6", "D7"], |
| 365 | // 遮罩层 | 382 | // 遮罩层 |
| ... | @@ -390,6 +407,7 @@ export default { | ... | @@ -390,6 +407,7 @@ export default { |
| 390 | openFlightDate: false, | 407 | openFlightDate: false, |
| 391 | // 查询参数 | 408 | // 查询参数 |
| 392 | queryParams: { | 409 | queryParams: { |
| 410 | + portName: undefined, | ||
| 393 | start: 0, //当前条数【代表第几条数据 +1开始】 | 411 | start: 0, //当前条数【代表第几条数据 +1开始】 |
| 394 | pageNum: 1, | 412 | pageNum: 1, |
| 395 | limit: 20, //一页显示多少条数据 | 413 | limit: 20, //一页显示多少条数据 |
| ... | @@ -422,8 +440,26 @@ export default { | ... | @@ -422,8 +440,26 @@ export default { |
| 422 | }; | 440 | }; |
| 423 | }, | 441 | }, |
| 424 | created() { | 442 | created() { |
| 443 | + this.queryParams.portName = this.$store.state.user.activePortName; | ||
| 444 | + this.portNameList = this.$store.state.user.portNames; | ||
| 445 | + if(this.$store.state.tagsView.cachedViews.length == 0){ | ||
| 446 | + this.findSourceFlightRules(); | ||
| 447 | + } | ||
| 448 | + }, | ||
| 449 | + activated(){ | ||
| 425 | this.findSourceFlightRules(); | 450 | this.findSourceFlightRules(); |
| 426 | }, | 451 | }, |
| 452 | + deactivated(){ | ||
| 453 | + this.sourceFlightRulesList = [] | ||
| 454 | + }, | ||
| 455 | + watch:{ | ||
| 456 | + open(val,oldVal){ | ||
| 457 | + if(val){ | ||
| 458 | + this.queryParams.portName = this.$store.state.user.activePortName; | ||
| 459 | + this.form.portName = this.$store.state.user.activePortName; | ||
| 460 | + } | ||
| 461 | + } | ||
| 462 | + }, | ||
| 427 | methods: { | 463 | methods: { |
| 428 | //跳转到查看,修改页面 | 464 | //跳转到查看,修改页面 |
| 429 | handleClick(flightiId, handle) { | 465 | handleClick(flightiId, handle) { |
| ... | @@ -459,16 +495,17 @@ export default { | ... | @@ -459,16 +495,17 @@ export default { |
| 459 | handleAdd() { | 495 | handleAdd() { |
| 460 | this.form = {}; | 496 | this.form = {}; |
| 461 | this.open = true; | 497 | this.open = true; |
| 462 | - this.title = "添加ACCS原航班顺位规则"; | 498 | + this.title = "添加原航班顺位规则"; |
| 463 | this.form.id = -1; | 499 | this.form.id = -1; |
| 464 | this.dayOfWeek = []; | 500 | this.dayOfWeek = []; |
| 501 | + this.form.portName = this.$store.state.user.activePortName; | ||
| 465 | }, | 502 | }, |
| 466 | /** 修改按钮操作 */ | 503 | /** 修改按钮操作 */ |
| 467 | handleUpdate(row) { | 504 | handleUpdate(row) { |
| 468 | this.form = {}; | 505 | this.form = {}; |
| 469 | this.dayOfWeek = []; | 506 | this.dayOfWeek = []; |
| 470 | this.open = true; | 507 | this.open = true; |
| 471 | - this.title = "修改ACCS原航班顺位规则"; | 508 | + this.title = "修改原航班顺位规则"; |
| 472 | this.form = JSON.parse(JSON.stringify(row)); | 509 | this.form = JSON.parse(JSON.stringify(row)); |
| 473 | this.dayOfWeek = this.form.dayOfWeek | 510 | this.dayOfWeek = this.form.dayOfWeek |
| 474 | ? this.form.dayOfWeek.split(";") | 511 | ? this.form.dayOfWeek.split(";") |
| ... | @@ -490,12 +527,15 @@ export default { | ... | @@ -490,12 +527,15 @@ export default { |
| 490 | confirmButtonText: "确定", | 527 | confirmButtonText: "确定", |
| 491 | cancelButtonText: "取消", | 528 | cancelButtonText: "取消", |
| 492 | type: "warning", | 529 | type: "warning", |
| 493 | - }).then(() => { | 530 | + }) |
| 531 | + .then(() => { | ||
| 494 | let disable = { | 532 | let disable = { |
| 495 | id: row.id, | 533 | id: row.id, |
| 496 | status: status, | 534 | status: status, |
| 497 | }; | 535 | }; |
| 498 | - delOrEnableORDisableApi(disable) | 536 | + |
| 537 | + return delOrEnableORDisableApi(disable); | ||
| 538 | + }) | ||
| 499 | .then((response) => { | 539 | .then((response) => { |
| 500 | if (response.code == 200) { | 540 | if (response.code == 200) { |
| 501 | this.findSourceFlightRules(); | 541 | this.findSourceFlightRules(); |
| ... | @@ -505,7 +545,6 @@ export default { | ... | @@ -505,7 +545,6 @@ export default { |
| 505 | } | 545 | } |
| 506 | }) | 546 | }) |
| 507 | .catch(() => {}); | 547 | .catch(() => {}); |
| 508 | - }); | ||
| 509 | }, | 548 | }, |
| 510 | /** 提交按钮 */ | 549 | /** 提交按钮 */ |
| 511 | submitForm: function () { | 550 | submitForm: function () { | ... | ... |
| ... | @@ -108,6 +108,7 @@ | ... | @@ -108,6 +108,7 @@ |
| 108 | :loading="downLoadingTip.downloading" | 108 | :loading="downLoadingTip.downloading" |
| 109 | icon="el-icon-download" | 109 | icon="el-icon-download" |
| 110 | size="mini" | 110 | size="mini" |
| 111 | + v-hasPermi="['base:caExport:export']" | ||
| 111 | >{{ | 112 | >{{ |
| 112 | downLoadingTip.downloading ? downLoadingTip.tip : "导出" | 113 | downLoadingTip.downloading ? downLoadingTip.tip : "导出" |
| 113 | }}</el-button | 114 | }}</el-button |
| ... | @@ -178,7 +179,7 @@ | ... | @@ -178,7 +179,7 @@ |
| 178 | 179 | ||
| 179 | <script> | 180 | <script> |
| 180 | import { findCagroPreData } from "@/api/cargoSelect"; | 181 | import { findCagroPreData } from "@/api/cargoSelect"; |
| 181 | -import { cargoXlsxPre } from "@/utils/zipdownload"; | 182 | +import { downLoadXlsx } from "@/utils/zipdownload"; |
| 182 | export default { | 183 | export default { |
| 183 | name: "CAPreQualificationExport", | 184 | name: "CAPreQualificationExport", |
| 184 | data() { | 185 | data() { |
| ... | @@ -232,7 +233,7 @@ export default { | ... | @@ -232,7 +233,7 @@ export default { |
| 232 | ); | 233 | ); |
| 233 | cargoXlse.cargoExportPreQueryDto.limitStart = 0; | 234 | cargoXlse.cargoExportPreQueryDto.limitStart = 0; |
| 234 | cargoXlse.cargoExportPreQueryDto.limitSize = -1; | 235 | cargoXlse.cargoExportPreQueryDto.limitSize = -1; |
| 235 | - cargoXlsxPre("/cargo/excelPre", cargoXlse) | 236 | + downLoadXlsx("/cargo/excelPre", cargoXlse,'航班预审表') |
| 236 | .then(() => { | 237 | .then(() => { |
| 237 | this.downLoadingTip.downloading = false; | 238 | this.downLoadingTip.downloading = false; |
| 238 | this.downLoadingTip.tip = ""; | 239 | this.downLoadingTip.tip = ""; | ... | ... |
| ... | @@ -4,12 +4,12 @@ | ... | @@ -4,12 +4,12 @@ |
| 4 | <el-form-item> | 4 | <el-form-item> |
| 5 | <el-upload action="/caPreReviewImport/importFlight" name="file" :http-request="uploadExcel" | 5 | <el-upload action="/caPreReviewImport/importFlight" name="file" :http-request="uploadExcel" |
| 6 | :on-remove="handleRemove" :limit="1" :on-exceed="handleExceed" :file-list="fileList" accept=".xlsx" | 6 | :on-remove="handleRemove" :limit="1" :on-exceed="handleExceed" :file-list="fileList" accept=".xlsx" |
| 7 | - class="upload-demo"> | 7 | + class="upload-demo" v-hasPermi="['base:caImport:import']"> |
| 8 | <el-button type="primary">点击上传</el-button> | 8 | <el-button type="primary">点击上传</el-button> |
| 9 | </el-upload> | 9 | </el-upload> |
| 10 | </el-form-item> | 10 | </el-form-item> |
| 11 | <el-form-item> | 11 | <el-form-item> |
| 12 | - <el-button type="primary" @click="downloadTempleate">下载模板</el-button> | 12 | + <el-button type="primary" @click="downloadTempleate" v-hasPermi="['base:caImport:download']">下载模板</el-button> |
| 13 | </el-form-item> | 13 | </el-form-item> |
| 14 | </el-form> | 14 | </el-form> |
| 15 | <div style="font-size: 12px; font-weight: 700"> | 15 | <div style="font-size: 12px; font-weight: 700"> | ... | ... |
| ... | @@ -23,12 +23,13 @@ | ... | @@ -23,12 +23,13 @@ |
| 23 | :file-list="fileList" | 23 | :file-list="fileList" |
| 24 | accept=".xlsx" | 24 | accept=".xlsx" |
| 25 | class="upload-demo" | 25 | class="upload-demo" |
| 26 | + v-hasPermi="['base:flightImport:importFlight']" | ||
| 26 | > | 27 | > |
| 27 | <el-button type="primary">点击上传</el-button> | 28 | <el-button type="primary">点击上传</el-button> |
| 28 | </el-upload> | 29 | </el-upload> |
| 29 | </el-form-item> | 30 | </el-form-item> |
| 30 | <el-form-item> | 31 | <el-form-item> |
| 31 | - <el-button type="primary" @click="downloadTempleate" | 32 | + <el-button type="primary" @click="downloadTempleate" v-hasPermi="['base:flightImport:exportExcel']" |
| 32 | >下载模板</el-button | 33 | >下载模板</el-button |
| 33 | > | 34 | > |
| 34 | </el-form-item> | 35 | </el-form-item> | ... | ... |
| ... | @@ -21,7 +21,6 @@ | ... | @@ -21,7 +21,6 @@ |
| 21 | </el-date-picker> | 21 | </el-date-picker> |
| 22 | </el-form-item> | 22 | </el-form-item> |
| 23 | </el-col> | 23 | </el-col> |
| 24 | - | ||
| 25 | <el-col :span="6"> | 24 | <el-col :span="6"> |
| 26 | <el-form-item label="到" prop="fltDateEnd"> | 25 | <el-form-item label="到" prop="fltDateEnd"> |
| 27 | <el-date-picker | 26 | <el-date-picker |
| ... | @@ -34,7 +33,6 @@ | ... | @@ -34,7 +33,6 @@ |
| 34 | </el-date-picker> | 33 | </el-date-picker> |
| 35 | </el-form-item> | 34 | </el-form-item> |
| 36 | </el-col> | 35 | </el-col> |
| 37 | - | ||
| 38 | <el-col :span="6"> | 36 | <el-col :span="6"> |
| 39 | <el-form-item label="航班号" prop="fltNo"> | 37 | <el-form-item label="航班号" prop="fltNo"> |
| 40 | <el-input | 38 | <el-input |
| ... | @@ -45,7 +43,6 @@ | ... | @@ -45,7 +43,6 @@ |
| 45 | /> | 43 | /> |
| 46 | </el-form-item> | 44 | </el-form-item> |
| 47 | </el-col> | 45 | </el-col> |
| 48 | - | ||
| 49 | <el-col :span="6"> | 46 | <el-col :span="6"> |
| 50 | <el-form-item label="航班类型" prop="typeId"> | 47 | <el-form-item label="航班类型" prop="typeId"> |
| 51 | <el-select | 48 | <el-select |
| ... | @@ -55,7 +52,7 @@ | ... | @@ -55,7 +52,7 @@ |
| 55 | clearable | 52 | clearable |
| 56 | > | 53 | > |
| 57 | <el-option | 54 | <el-option |
| 58 | - v-for="dict in flightTypelist" | 55 | + v-for="dict in selectOption.flightTypelist" |
| 59 | :key="dict.id" | 56 | :key="dict.id" |
| 60 | :label="dict.chineseName" | 57 | :label="dict.chineseName" |
| 61 | :value="dict.id" | 58 | :value="dict.id" |
| ... | @@ -63,7 +60,6 @@ | ... | @@ -63,7 +60,6 @@ |
| 63 | </el-select> | 60 | </el-select> |
| 64 | </el-form-item> | 61 | </el-form-item> |
| 65 | </el-col> | 62 | </el-col> |
| 66 | - | ||
| 67 | <el-col :span="6"> | 63 | <el-col :span="6"> |
| 68 | <el-form-item label="航班状态" prop="statusId"> | 64 | <el-form-item label="航班状态" prop="statusId"> |
| 69 | <el-select | 65 | <el-select |
| ... | @@ -73,7 +69,7 @@ | ... | @@ -73,7 +69,7 @@ |
| 73 | clearable | 69 | clearable |
| 74 | > | 70 | > |
| 75 | <el-option | 71 | <el-option |
| 76 | - v-for="dict in flightStatuslist" | 72 | + v-for="dict in selectOption.flightStatuslist" |
| 77 | :key="dict.id" | 73 | :key="dict.id" |
| 78 | :label="dict.chineseName" | 74 | :label="dict.chineseName" |
| 79 | :value="dict.id" | 75 | :value="dict.id" |
| ... | @@ -81,7 +77,6 @@ | ... | @@ -81,7 +77,6 @@ |
| 81 | </el-select> | 77 | </el-select> |
| 82 | </el-form-item> | 78 | </el-form-item> |
| 83 | </el-col> | 79 | </el-col> |
| 84 | - | ||
| 85 | <el-col :span="6"> | 80 | <el-col :span="6"> |
| 86 | <el-form-item label="航班种类" prop="flightKindId"> | 81 | <el-form-item label="航班种类" prop="flightKindId"> |
| 87 | <el-select | 82 | <el-select |
| ... | @@ -91,7 +86,7 @@ | ... | @@ -91,7 +86,7 @@ |
| 91 | clearable | 86 | clearable |
| 92 | > | 87 | > |
| 93 | <el-option | 88 | <el-option |
| 94 | - v-for="dict in flightKindlist" | 89 | + v-for="dict in selectOption.flightKindlist" |
| 95 | :key="dict.id" | 90 | :key="dict.id" |
| 96 | :label="dict.chineseName" | 91 | :label="dict.chineseName" |
| 97 | :value="dict.id" | 92 | :value="dict.id" |
| ... | @@ -100,7 +95,6 @@ | ... | @@ -100,7 +95,6 @@ |
| 100 | </el-form-item> | 95 | </el-form-item> |
| 101 | </el-col> | 96 | </el-col> |
| 102 | </el-row> | 97 | </el-row> |
| 103 | - | ||
| 104 | <el-button | 98 | <el-button |
| 105 | type="primary" | 99 | type="primary" |
| 106 | icon="el-icon-search" | 100 | icon="el-icon-search" |
| ... | @@ -116,6 +110,7 @@ | ... | @@ -116,6 +110,7 @@ |
| 116 | icon="el-icon-plus" | 110 | icon="el-icon-plus" |
| 117 | size="mini" | 111 | size="mini" |
| 118 | @click="handleAdd" | 112 | @click="handleAdd" |
| 113 | + v-hasPermi="['base:flightInfo:add']" | ||
| 119 | >新增</el-button | 114 | >新增</el-button |
| 120 | > | 115 | > |
| 121 | <el-button | 116 | <el-button |
| ... | @@ -124,197 +119,52 @@ | ... | @@ -124,197 +119,52 @@ |
| 124 | size="mini" | 119 | size="mini" |
| 125 | :disabled="multiple" | 120 | :disabled="multiple" |
| 126 | @click="handleDelete" | 121 | @click="handleDelete" |
| 122 | + v-hasPermi="['base:flightInfo:delete']" | ||
| 127 | >删除 | 123 | >删除 |
| 128 | </el-button> | 124 | </el-button> |
| 129 | <el-button | 125 | <el-button |
| 130 | type="primary" | 126 | type="primary" |
| 131 | icon="el-icon-circle-check" | 127 | icon="el-icon-circle-check" |
| 132 | size="mini" | 128 | size="mini" |
| 129 | + :disabled="multiple" | ||
| 133 | @click="handleFlightStatus('flightStatus10')" | 130 | @click="handleFlightStatus('flightStatus10')" |
| 131 | + v-hasPermi="['base:flightInfo:open']" | ||
| 134 | >自动配舱开启</el-button | 132 | >自动配舱开启</el-button |
| 135 | > | 133 | > |
| 136 | <el-button | 134 | <el-button |
| 137 | type="primary" | 135 | type="primary" |
| 138 | icon="el-icon-circle-close" | 136 | icon="el-icon-circle-close" |
| 139 | size="mini" | 137 | size="mini" |
| 138 | + :disabled="multiple" | ||
| 140 | @click="handleFlightStatus('flightStatus80')" | 139 | @click="handleFlightStatus('flightStatus80')" |
| 140 | + v-hasPermi="['base:flightInfo:close']" | ||
| 141 | >自动配舱关闭</el-button | 141 | >自动配舱关闭</el-button |
| 142 | > | 142 | > |
| 143 | </el-form> | 143 | </el-form> |
| 144 | - <!-- <el-row :gutter="10" class="mb8"> | 144 | + <Tables |
| 145 | - <el-col :span="1.5"> | 145 | + ref="flightInfoTable" |
| 146 | - <el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button> | ||
| 147 | - </el-col> | ||
| 148 | - <el-col :span="1.5"> | ||
| 149 | - <el-button type="success" icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate">修改 | ||
| 150 | - </el-button> | ||
| 151 | - </el-col> | ||
| 152 | - <el-col :span="1.5"> | ||
| 153 | - <el-button type="danger" icon="el-icon-delete" size="mini" :disabled="multiple">删除 | ||
| 154 | - </el-button> | ||
| 155 | - </el-col> | ||
| 156 | - </el-row> --> | ||
| 157 | - <el-table | ||
| 158 | - height="550" | ||
| 159 | - highlight-current-row | ||
| 160 | - border | ||
| 161 | - stripe | ||
| 162 | - v-loading="loading" | ||
| 163 | :data="findAllFltDatList" | 146 | :data="findAllFltDatList" |
| 164 | - size="small" | 147 | + :headerData="tableHeader" |
| 165 | - @selection-change="handleSelectionChange" | 148 | + :infoData="tableHeader" |
| 149 | + :totalCount="total" | ||
| 150 | + :loading="loading" | ||
| 151 | + :limitSize="queryParams.limitSize" | ||
| 152 | + :page="queryParams.pageNum" | ||
| 153 | + :shiftKey="shiftKey" | ||
| 154 | + :infoShow="false" | ||
| 155 | + :height="tableHeight" | ||
| 156 | + @tableSelect="tableSelect" | ||
| 157 | + @tableSelectAll="tableSelectAll" | ||
| 158 | + @currentChange="currentChange" | ||
| 159 | + @sortChange="sortChange" | ||
| 160 | + @sizeChange="sizeChange" | ||
| 166 | > | 161 | > |
| 167 | - <el-table-column type="selection" width="55" align="center" /> | 162 | + <template> |
| 168 | - <el-table-column | ||
| 169 | - label="航班日期" | ||
| 170 | - align="center" | ||
| 171 | - prop="fltDate" | ||
| 172 | - width="120" | ||
| 173 | - /> | ||
| 174 | - <el-table-column | ||
| 175 | - label="航班起飞时间" | ||
| 176 | - align="center" | ||
| 177 | - prop="takeOffTime" | ||
| 178 | - width="120" | ||
| 179 | - /> | ||
| 180 | - <el-table-column label="航班号" align="center" prop="fltNo" width="150"/> | ||
| 181 | - <el-table-column label="航班路线" align="center" prop="route" width="150" /> | ||
| 182 | - <el-table-column | ||
| 183 | - label="航班类型" | ||
| 184 | - align="center" | ||
| 185 | - prop="typeName" | ||
| 186 | - width="100" | ||
| 187 | - /> | ||
| 188 | - <el-table-column | ||
| 189 | - label="航班种类" | ||
| 190 | - align="center" | ||
| 191 | - prop="flightKindName" | ||
| 192 | - width="130" | ||
| 193 | - /> | ||
| 194 | - <el-table-column label="航班状态" align="center" prop="statusName" /> | ||
| 195 | - <el-table-column | ||
| 196 | - label="总重量" | ||
| 197 | - align="center" | ||
| 198 | - prop="totalWeight" | ||
| 199 | - width="130" | ||
| 200 | - /> | ||
| 201 | - <el-table-column | ||
| 202 | - label="原始重量(KG)" | ||
| 203 | - align="center" | ||
| 204 | - prop="originalWeight" | ||
| 205 | - width="130" | ||
| 206 | - /> | ||
| 207 | - <el-table-column | ||
| 208 | - label="总体积(cm³)" | ||
| 209 | - align="center" | ||
| 210 | - prop="totalVolume" | ||
| 211 | - width="130" | ||
| 212 | - /> | ||
| 213 | - <el-table-column | ||
| 214 | - label="是否限制一票一件" | ||
| 215 | - align="center" | ||
| 216 | - prop="ticketToPiece" | ||
| 217 | - width="150" | ||
| 218 | - :formatter="ticketToPieceFormat" | ||
| 219 | - /> | ||
| 220 | - <el-table-column | ||
| 221 | - label="是否需要预审" | ||
| 222 | - align="center" | ||
| 223 | - prop="needRequired" | ||
| 224 | - width="150" | ||
| 225 | - :formatter="needRequiredFormat" | ||
| 226 | - /> | ||
| 227 | - <el-table-column | ||
| 228 | - label="额外增重百分比" | ||
| 229 | - align="center" | ||
| 230 | - prop="extraWeightPercent" | ||
| 231 | - width="150" | ||
| 232 | - /> | ||
| 233 | - <el-table-column | ||
| 234 | - label="高价百分比" | ||
| 235 | - align="center" | ||
| 236 | - prop="highPriceWeightPercent" | ||
| 237 | - width="150" | ||
| 238 | - /> | ||
| 239 | - <el-table-column | ||
| 240 | - label="低价百分比" | ||
| 241 | - align="center" | ||
| 242 | - prop="lowPriceWeightPercent" | ||
| 243 | - width="150" | ||
| 244 | - /> | ||
| 245 | - <el-table-column | ||
| 246 | - label="是否开启高地价" | ||
| 247 | - align="center" | ||
| 248 | - prop="highLowPriceFlg" | ||
| 249 | - width="150" | ||
| 250 | - :formatter="highLowPriceFlgFormat" | ||
| 251 | - /> | ||
| 252 | - <el-table-column | ||
| 253 | - label="已配重量" | ||
| 254 | - align="center" | ||
| 255 | - prop="alloctedWeight" | ||
| 256 | - width="150" | ||
| 257 | - /> | ||
| 258 | - <el-table-column | ||
| 259 | - label="已配体积(cm³)" | ||
| 260 | - align="center" | ||
| 261 | - prop="alloctedVolume" | ||
| 262 | - width="150" | ||
| 263 | - /> | ||
| 264 | - <el-table-column | ||
| 265 | - label="航班优先级" | ||
| 266 | - align="center" | ||
| 267 | - prop="priorityName" | ||
| 268 | - width="150" | ||
| 269 | - /> | ||
| 270 | - <el-table-column | ||
| 271 | - label="配舱优先级" | ||
| 272 | - align="center" | ||
| 273 | - prop="priorityRuleName" | ||
| 274 | - width="150" | ||
| 275 | - /> | ||
| 276 | - <el-table-column | ||
| 277 | - label="创建人" | ||
| 278 | - align="center" | ||
| 279 | - prop="createUserName" | ||
| 280 | - width="120" | ||
| 281 | - /> | ||
| 282 | - <el-table-column | ||
| 283 | - label="创建时间" | ||
| 284 | - align="center" | ||
| 285 | - prop="createTime" | ||
| 286 | - width="155" | ||
| 287 | - /> | ||
| 288 | - | ||
| 289 | - <!-- <el-table-column label="创建时间" align="center" prop="createTime" width="155"> | ||
| 290 | - <template slot-scope="scope"> | ||
| 291 | - <span>{{ renderTime(scope.row.createTime) }}</span> | ||
| 292 | - </template> | ||
| 293 | - </el-table-column> --> | ||
| 294 | - <el-table-column | ||
| 295 | - label="最后修改人" | ||
| 296 | - align="center" | ||
| 297 | - prop="lastModifyUserName" | ||
| 298 | - width="155" | ||
| 299 | - /> | ||
| 300 | - <!-- <el-table-column label="最后修改时间" align="center" prop="lastModifyTime" width="155"> | ||
| 301 | - <template slot-scope="scope"> | ||
| 302 | - <span>{{ renderTime(scope.row.lastModifyTime) }}</span> | ||
| 303 | - </template> | ||
| 304 | - </el-table-column> --> | ||
| 305 | - <el-table-column | ||
| 306 | - label="最后修改时间" | ||
| 307 | - align="center" | ||
| 308 | - prop="lastModifyTime" | ||
| 309 | - width="120" | ||
| 310 | - /> | ||
| 311 | - | ||
| 312 | <el-table-column | 163 | <el-table-column |
| 313 | v-if="findAllFltDatList.length > 0" | 164 | v-if="findAllFltDatList.length > 0" |
| 314 | label="操作" | 165 | label="操作" |
| 315 | align="center" | 166 | align="center" |
| 316 | class-name="small-padding fixed-width" | 167 | class-name="small-padding fixed-width" |
| 317 | - width="130" | ||
| 318 | fixed="right" | 168 | fixed="right" |
| 319 | > | 169 | > |
| 320 | <template slot-scope="scope"> | 170 | <template slot-scope="scope"> |
| ... | @@ -323,23 +173,13 @@ | ... | @@ -323,23 +173,13 @@ |
| 323 | type="text" | 173 | type="text" |
| 324 | icon="el-icon-edit" | 174 | icon="el-icon-edit" |
| 325 | @click="handleUpdate(scope.row)" | 175 | @click="handleUpdate(scope.row)" |
| 176 | + v-hasPermi="['base:flightInfo:update']" | ||
| 326 | >修改</el-button | 177 | >修改</el-button |
| 327 | > | 178 | > |
| 328 | - <!-- <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row,'删除')"> | ||
| 329 | - 删除</el-button> --> | ||
| 330 | </template> | 179 | </template> |
| 331 | </el-table-column> | 180 | </el-table-column> |
| 332 | - </el-table> | 181 | + </template> |
| 333 | - | 182 | + </Tables> |
| 334 | - <pagination | ||
| 335 | - v-show="total > 0" | ||
| 336 | - :total="total" | ||
| 337 | - layout=" prev, pager, next, jumper, sizes,total" | ||
| 338 | - :page.sync="queryParams.pageNum" | ||
| 339 | - :limit.sync="queryParams.limitSize" | ||
| 340 | - @pagination="findAllFltData" | ||
| 341 | - /> | ||
| 342 | - | ||
| 343 | <!-- 添加或修改对话框 --> | 183 | <!-- 添加或修改对话框 --> |
| 344 | <el-dialog | 184 | <el-dialog |
| 345 | :title="title" | 185 | :title="title" |
| ... | @@ -364,10 +204,10 @@ | ... | @@ -364,10 +204,10 @@ |
| 364 | style="width: 93%" | 204 | style="width: 93%" |
| 365 | v-model="form.fltNo" | 205 | v-model="form.fltNo" |
| 366 | placeholder="请输入航班号" | 206 | placeholder="请输入航班号" |
| 207 | + maxlength="10" | ||
| 367 | /> | 208 | /> |
| 368 | </el-form-item> | 209 | </el-form-item> |
| 369 | </el-col> | 210 | </el-col> |
| 370 | - <!-- <el-col :span="1">  </el-col> --> | ||
| 371 | <el-col :span="12"> | 211 | <el-col :span="12"> |
| 372 | <el-form-item label="航班日期" prop="fltDate"> | 212 | <el-form-item label="航班日期" prop="fltDate"> |
| 373 | <el-date-picker | 213 | <el-date-picker |
| ... | @@ -382,7 +222,6 @@ | ... | @@ -382,7 +222,6 @@ |
| 382 | </el-date-picker> | 222 | </el-date-picker> |
| 383 | </el-form-item> | 223 | </el-form-item> |
| 384 | </el-col> | 224 | </el-col> |
| 385 | - | ||
| 386 | <el-col :span="12"> | 225 | <el-col :span="12"> |
| 387 | <el-form-item label="航班路线" prop="route"> | 226 | <el-form-item label="航班路线" prop="route"> |
| 388 | <el-input | 227 | <el-input |
| ... | @@ -392,12 +231,11 @@ | ... | @@ -392,12 +231,11 @@ |
| 392 | /> | 231 | /> |
| 393 | </el-form-item> | 232 | </el-form-item> |
| 394 | </el-col> | 233 | </el-col> |
| 395 | - | ||
| 396 | <el-col :span="12"> | 234 | <el-col :span="12"> |
| 397 | <el-form-item label="航班种类" prop="kindId"> | 235 | <el-form-item label="航班种类" prop="kindId"> |
| 398 | <el-select v-model="form.kindId" placeholder="请选择航班种类"> | 236 | <el-select v-model="form.kindId" placeholder="请选择航班种类"> |
| 399 | <el-option | 237 | <el-option |
| 400 | - v-for="item in flightKindlist" | 238 | + v-for="item in selectOption.flightKindlist" |
| 401 | :key="item.id" | 239 | :key="item.id" |
| 402 | :label="item.chineseName" | 240 | :label="item.chineseName" |
| 403 | :value="item.id" | 241 | :value="item.id" |
| ... | @@ -410,7 +248,7 @@ | ... | @@ -410,7 +248,7 @@ |
| 410 | <el-form-item label="航班类型" prop="typeId"> | 248 | <el-form-item label="航班类型" prop="typeId"> |
| 411 | <el-select v-model="form.typeId" placeholder="请选择航班类型"> | 249 | <el-select v-model="form.typeId" placeholder="请选择航班类型"> |
| 412 | <el-option | 250 | <el-option |
| 413 | - v-for="item in flightTypelist" | 251 | + v-for="item in selectOption.flightTypelist" |
| 414 | :key="item.id" | 252 | :key="item.id" |
| 415 | :label="item.chineseName" | 253 | :label="item.chineseName" |
| 416 | :value="item.id" | 254 | :value="item.id" |
| ... | @@ -427,7 +265,7 @@ | ... | @@ -427,7 +265,7 @@ |
| 427 | placeholder="请选择航班状态" | 265 | placeholder="请选择航班状态" |
| 428 | > | 266 | > |
| 429 | <el-option | 267 | <el-option |
| 430 | - v-for="item in flightStatuslist" | 268 | + v-for="item in selectOption.flightStatuslist" |
| 431 | :key="item.id" | 269 | :key="item.id" |
| 432 | :label="item.chineseName" | 270 | :label="item.chineseName" |
| 433 | :value="item.id" | 271 | :value="item.id" |
| ... | @@ -446,7 +284,6 @@ | ... | @@ -446,7 +284,6 @@ |
| 446 | ></el-input-number> | 284 | ></el-input-number> |
| 447 | </el-form-item> | 285 | </el-form-item> |
| 448 | </el-col> | 286 | </el-col> |
| 449 | - | ||
| 450 | <el-col :span="12"> | 287 | <el-col :span="12"> |
| 451 | <el-form-item label="额外增重百分比" prop="extraWeightPercent"> | 288 | <el-form-item label="额外增重百分比" prop="extraWeightPercent"> |
| 452 | <el-input-number | 289 | <el-input-number |
| ... | @@ -457,30 +294,30 @@ | ... | @@ -457,30 +294,30 @@ |
| 457 | ></el-input-number> | 294 | ></el-input-number> |
| 458 | </el-form-item> | 295 | </el-form-item> |
| 459 | </el-col> | 296 | </el-col> |
| 460 | - | ||
| 461 | <el-col :span="12"> | 297 | <el-col :span="12"> |
| 462 | <el-form-item label="是否开启高低价" prop="highLowPriceFlg"> | 298 | <el-form-item label="是否开启高低价" prop="highLowPriceFlg"> |
| 463 | <el-switch | 299 | <el-switch |
| 464 | @change="LowHighAvailable" | 300 | @change="LowHighAvailable" |
| 465 | v-model="form.highLowPriceFlg" | 301 | v-model="form.highLowPriceFlg" |
| 302 | + :active-value="1" | ||
| 303 | + :inactive-value="0" | ||
| 466 | active-color="#13ce66" | 304 | active-color="#13ce66" |
| 467 | > | 305 | > |
| 468 | </el-switch> | 306 | </el-switch> |
| 469 | </el-form-item> | 307 | </el-form-item> |
| 470 | </el-col> | 308 | </el-col> |
| 471 | - | ||
| 472 | - <!-- 是否需要预审,1:预审,0:取消预审 --> | ||
| 473 | <el-col :span="12"> | 309 | <el-col :span="12"> |
| 474 | <el-form-item label="是否预审" prop="isNeedRequired"> | 310 | <el-form-item label="是否预审" prop="isNeedRequired"> |
| 475 | <el-switch | 311 | <el-switch |
| 476 | :disabled="true" | 312 | :disabled="true" |
| 477 | v-model="form.isNeedRequired" | 313 | v-model="form.isNeedRequired" |
| 314 | + :active-value="1" | ||
| 315 | + :inactive-value="0" | ||
| 478 | active-color="#13ce66" | 316 | active-color="#13ce66" |
| 479 | > | 317 | > |
| 480 | </el-switch> | 318 | </el-switch> |
| 481 | </el-form-item> | 319 | </el-form-item> |
| 482 | </el-col> | 320 | </el-col> |
| 483 | - | ||
| 484 | <el-col :span="12"> | 321 | <el-col :span="12"> |
| 485 | <el-form-item label="高价百分比" prop="highPriceWeightPercent"> | 322 | <el-form-item label="高价百分比" prop="highPriceWeightPercent"> |
| 486 | <el-input-number | 323 | <el-input-number |
| ... | @@ -492,7 +329,6 @@ | ... | @@ -492,7 +329,6 @@ |
| 492 | ></el-input-number> | 329 | ></el-input-number> |
| 493 | </el-form-item> | 330 | </el-form-item> |
| 494 | </el-col> | 331 | </el-col> |
| 495 | - | ||
| 496 | <el-col :span="12"> | 332 | <el-col :span="12"> |
| 497 | <el-form-item label="低价百分比" prop="lowPriceWeightPercent"> | 333 | <el-form-item label="低价百分比" prop="lowPriceWeightPercent"> |
| 498 | <el-input-number | 334 | <el-input-number |
| ... | @@ -503,7 +339,6 @@ | ... | @@ -503,7 +339,6 @@ |
| 503 | ></el-input-number> | 339 | ></el-input-number> |
| 504 | </el-form-item> | 340 | </el-form-item> |
| 505 | </el-col> | 341 | </el-col> |
| 506 | - | ||
| 507 | <el-col :span="12"> | 342 | <el-col :span="12"> |
| 508 | <el-form-item label="高价可配重量" prop="highAvailableWeight"> | 343 | <el-form-item label="高价可配重量" prop="highAvailableWeight"> |
| 509 | <el-input-number | 344 | <el-input-number |
| ... | @@ -526,7 +361,6 @@ | ... | @@ -526,7 +361,6 @@ |
| 526 | ></el-input-number> | 361 | ></el-input-number> |
| 527 | </el-form-item> | 362 | </el-form-item> |
| 528 | </el-col> | 363 | </el-col> |
| 529 | - | ||
| 530 | <el-col :span="12"> | 364 | <el-col :span="12"> |
| 531 | <el-form-item label="高价已配重量" prop="highAllocatedWeight"> | 365 | <el-form-item label="高价已配重量" prop="highAllocatedWeight"> |
| 532 | <el-input-number | 366 | <el-input-number |
| ... | @@ -567,29 +401,20 @@ | ... | @@ -567,29 +401,20 @@ |
| 567 | <el-button @click="cancel">取 消</el-button> | 401 | <el-button @click="cancel">取 消</el-button> |
| 568 | </div> | 402 | </div> |
| 569 | </el-dialog> | 403 | </el-dialog> |
| 570 | - | ||
| 571 | <el-dialog | 404 | <el-dialog |
| 572 | title="未删除成功航班" | 405 | title="未删除成功航班" |
| 573 | width="40%" | 406 | width="40%" |
| 574 | center | 407 | center |
| 575 | :visible.sync="dialogTableVisible" | 408 | :visible.sync="dialogTableVisible" |
| 576 | - :close-on-click-modal="false" :append-to-body="true" | 409 | + :close-on-click-modal="false" |
| 410 | + :append-to-body="true" | ||
| 577 | > | 411 | > |
| 578 | <el-table :data="gridData"> | 412 | <el-table :data="gridData"> |
| 579 | - <el-table-column | 413 | + <el-table-column property="fltNo" label="航班号"></el-table-column> |
| 580 | - property="fltNo" | 414 | + <el-table-column property="fltDate" label="航班日期"></el-table-column> |
| 581 | - label="航班号" | ||
| 582 | - width="150" | ||
| 583 | - ></el-table-column> | ||
| 584 | - <el-table-column | ||
| 585 | - property="fltDate" | ||
| 586 | - label="航班日期" | ||
| 587 | - width="200" | ||
| 588 | - ></el-table-column> | ||
| 589 | <el-table-column | 415 | <el-table-column |
| 590 | property="alloctedWeight" | 416 | property="alloctedWeight" |
| 591 | label="已配重量" | 417 | label="已配重量" |
| 592 | - width="200" | ||
| 593 | ></el-table-column> | 418 | ></el-table-column> |
| 594 | </el-table> | 419 | </el-table> |
| 595 | </el-dialog> | 420 | </el-dialog> |
| ... | @@ -610,66 +435,7 @@ export default { | ... | @@ -610,66 +435,7 @@ export default { |
| 610 | name: "FlightInformationMaintenance", | 435 | name: "FlightInformationMaintenance", |
| 611 | data() { | 436 | data() { |
| 612 | return { | 437 | return { |
| 613 | - gridData: [], | 438 | + //查询参数 |
| 614 | - dialogTableVisible: false, | ||
| 615 | - //高价百分比是否打开 | ||
| 616 | - ishighPriceWeightPercent: true, | ||
| 617 | - //form属性禁用状态 | ||
| 618 | - formdisabled: { | ||
| 619 | - //航班号 | ||
| 620 | - fltNo: false, | ||
| 621 | - //航班日期 | ||
| 622 | - fltDate: false, | ||
| 623 | - //航班路线 | ||
| 624 | - route: false, | ||
| 625 | - //航班种类 | ||
| 626 | - kindId: false, | ||
| 627 | - //航班类型 | ||
| 628 | - typeId: false, | ||
| 629 | - //原始重量 | ||
| 630 | - originalWeight: false, | ||
| 631 | - }, | ||
| 632 | - | ||
| 633 | - //航班种类 | ||
| 634 | - flightKindlist: [], | ||
| 635 | - //航班状态 | ||
| 636 | - flightStatuslist: [], | ||
| 637 | - //航班类型 | ||
| 638 | - flightTypelist: [], | ||
| 639 | - // 选中数组 | ||
| 640 | - ids: [], | ||
| 641 | - // 非单个禁用 | ||
| 642 | - single: true, | ||
| 643 | - // 非多个禁用 | ||
| 644 | - multiple: true, | ||
| 645 | - | ||
| 646 | - // 遮罩层 | ||
| 647 | - loading: false, | ||
| 648 | - // 遮罩层 | ||
| 649 | - loadingFlightDate: false, | ||
| 650 | - // 弹出层标题 | ||
| 651 | - title: "", | ||
| 652 | - // 总条数 | ||
| 653 | - total: 0, | ||
| 654 | - // 原航班规则数据 | ||
| 655 | - findAllFltDatList: [], | ||
| 656 | - //目的航班数据 | ||
| 657 | - sourceFlightAndFlightDate: [], | ||
| 658 | - statusList: [ | ||
| 659 | - { | ||
| 660 | - id: 1, | ||
| 661 | - name: "有效", | ||
| 662 | - }, | ||
| 663 | - { | ||
| 664 | - id: 3, | ||
| 665 | - name: "停用", | ||
| 666 | - }, | ||
| 667 | - ], | ||
| 668 | - // 新增修改查看规则弹出层 | ||
| 669 | - open: false, | ||
| 670 | - // 是否显示查看目的航班弹出层 | ||
| 671 | - openFlightDate: false, | ||
| 672 | - // 查询参数 | ||
| 673 | queryParams: { | 439 | queryParams: { |
| 674 | limitStart: 0, //当前条数【代表第几条数据 +1开始】 | 440 | limitStart: 0, //当前条数【代表第几条数据 +1开始】 |
| 675 | pageNum: 1, | 441 | pageNum: 1, |
| ... | @@ -681,10 +447,9 @@ export default { | ... | @@ -681,10 +447,9 @@ export default { |
| 681 | flightKindId: undefined, //航班种类 | 447 | flightKindId: undefined, //航班种类 |
| 682 | fltNo: undefined, //航班号,要大写 | 448 | fltNo: undefined, //航班号,要大写 |
| 683 | }, | 449 | }, |
| 684 | - | 450 | + //表单参数 |
| 685 | - // 表单参数 | ||
| 686 | form: {}, | 451 | form: {}, |
| 687 | - // 表单校验 | 452 | + //表单校验 |
| 688 | rules: { | 453 | rules: { |
| 689 | fltNo: [ | 454 | fltNo: [ |
| 690 | { | 455 | { |
| ... | @@ -715,13 +480,381 @@ export default { | ... | @@ -715,13 +480,381 @@ export default { |
| 715 | }, | 480 | }, |
| 716 | ], | 481 | ], |
| 717 | }, | 482 | }, |
| 483 | + //原航班规则数据 | ||
| 484 | + findAllFltDatList: [], | ||
| 485 | + //表头 | ||
| 486 | + tableHeader: [ | ||
| 487 | + { | ||
| 488 | + type: "selection", | ||
| 489 | + name: "", | ||
| 490 | + value: "", | ||
| 491 | + width: "50", | ||
| 492 | + align: "center", | ||
| 493 | + sorTable: false, | ||
| 494 | + fixed: true, | ||
| 495 | + disabled: true, | ||
| 496 | + }, | ||
| 497 | + { | ||
| 498 | + type: "index", | ||
| 499 | + name: "", | ||
| 500 | + value: "", | ||
| 501 | + width: "50", | ||
| 502 | + align: "center", | ||
| 503 | + sorTable: false, | ||
| 504 | + fixed: false, | ||
| 505 | + disabled: true, | ||
| 506 | + }, | ||
| 507 | + { | ||
| 508 | + type: "", | ||
| 509 | + name: "航班日期", | ||
| 510 | + value: "fltDate", | ||
| 511 | + width: "100", | ||
| 512 | + align: "center", | ||
| 513 | + sorTable: false, | ||
| 514 | + fixed: false, | ||
| 515 | + disabled: true, | ||
| 516 | + }, | ||
| 517 | + { | ||
| 518 | + type: "", | ||
| 519 | + name: "航班起飞时间", | ||
| 520 | + value: "takeOffTime", | ||
| 521 | + width: "120", | ||
| 522 | + align: "center", | ||
| 523 | + sorTable: false, | ||
| 524 | + fixed: false, | ||
| 525 | + disabled: true, | ||
| 526 | + }, | ||
| 527 | + { | ||
| 528 | + type: "", | ||
| 529 | + name: "航班号", | ||
| 530 | + value: "fltNo", | ||
| 531 | + width: "100", | ||
| 532 | + align: "center", | ||
| 533 | + sorTable: false, | ||
| 534 | + fixed: false, | ||
| 535 | + disabled: true, | ||
| 536 | + }, | ||
| 537 | + { | ||
| 538 | + type: "", | ||
| 539 | + name: "航班路线", | ||
| 540 | + value: "route", | ||
| 541 | + width: "140", | ||
| 542 | + align: "center", | ||
| 543 | + sorTable: false, | ||
| 544 | + fixed: false, | ||
| 545 | + disabled: true, | ||
| 546 | + }, | ||
| 547 | + { | ||
| 548 | + type: "", | ||
| 549 | + name: "航班类型", | ||
| 550 | + value: "typeName", | ||
| 551 | + width: "100", | ||
| 552 | + align: "center", | ||
| 553 | + sorTable: false, | ||
| 554 | + fixed: false, | ||
| 555 | + disabled: true, | ||
| 556 | + }, | ||
| 557 | + { | ||
| 558 | + type: "", | ||
| 559 | + name: "航班种类", | ||
| 560 | + value: "flightKindName", | ||
| 561 | + width: "100", | ||
| 562 | + align: "center", | ||
| 563 | + sorTable: false, | ||
| 564 | + fixed: false, | ||
| 565 | + disabled: true, | ||
| 566 | + }, | ||
| 567 | + { | ||
| 568 | + type: "", | ||
| 569 | + name: "航班状态", | ||
| 570 | + value: "statusName", | ||
| 571 | + width: "100", | ||
| 572 | + align: "center", | ||
| 573 | + sorTable: false, | ||
| 574 | + fixed: false, | ||
| 575 | + disabled: true, | ||
| 576 | + }, | ||
| 577 | + { | ||
| 578 | + type: "", | ||
| 579 | + name: "总重量", | ||
| 580 | + value: "totalWeight", | ||
| 581 | + width: "90", | ||
| 582 | + align: "center", | ||
| 583 | + sorTable: false, | ||
| 584 | + fixed: false, | ||
| 585 | + disabled: true, | ||
| 586 | + }, | ||
| 587 | + { | ||
| 588 | + type: "", | ||
| 589 | + name: "原始重量(KG)", | ||
| 590 | + value: "originalWeight", | ||
| 591 | + width: "120", | ||
| 592 | + align: "center", | ||
| 593 | + sorTable: false, | ||
| 594 | + fixed: false, | ||
| 595 | + disabled: true, | ||
| 596 | + }, | ||
| 597 | + { | ||
| 598 | + type: "", | ||
| 599 | + name: "总体积(cm³)", | ||
| 600 | + value: "totalVolume", | ||
| 601 | + width: "100", | ||
| 602 | + align: "center", | ||
| 603 | + sorTable: false, | ||
| 604 | + fixed: false, | ||
| 605 | + disabled: true, | ||
| 606 | + }, | ||
| 607 | + { | ||
| 608 | + type: "", | ||
| 609 | + name: "是否限制一票一件", | ||
| 610 | + value: "ticketToPiece", | ||
| 611 | + width: "140", | ||
| 612 | + align: "center", | ||
| 613 | + sorTable: false, | ||
| 614 | + fixed: false, | ||
| 615 | + disabled: true, | ||
| 616 | + }, | ||
| 617 | + { | ||
| 618 | + type: "", | ||
| 619 | + name: "是否需要预审", | ||
| 620 | + value: "needRequired", | ||
| 621 | + width: "130", | ||
| 622 | + align: "center", | ||
| 623 | + sorTable: false, | ||
| 624 | + fixed: false, | ||
| 625 | + disabled: true, | ||
| 626 | + }, | ||
| 627 | + { | ||
| 628 | + type: "", | ||
| 629 | + name: "是否开启高地价", | ||
| 630 | + value: "highLowPriceFlg", | ||
| 631 | + width: "140", | ||
| 632 | + align: "center", | ||
| 633 | + sorTable: false, | ||
| 634 | + fixed: false, | ||
| 635 | + disabled: true, | ||
| 636 | + }, | ||
| 637 | + { | ||
| 638 | + type: "", | ||
| 639 | + name: "额外增重百分比", | ||
| 640 | + value: "extraWeightPercent", | ||
| 641 | + width: "140", | ||
| 642 | + align: "center", | ||
| 643 | + sorTable: false, | ||
| 644 | + fixed: false, | ||
| 645 | + disabled: true, | ||
| 646 | + }, | ||
| 647 | + { | ||
| 648 | + type: "", | ||
| 649 | + name: "高价百分比", | ||
| 650 | + value: "highPriceWeightPercent", | ||
| 651 | + width: "120", | ||
| 652 | + align: "center", | ||
| 653 | + sorTable: false, | ||
| 654 | + fixed: false, | ||
| 655 | + disabled: true, | ||
| 656 | + }, | ||
| 657 | + { | ||
| 658 | + type: "", | ||
| 659 | + name: "低价百分比", | ||
| 660 | + value: "lowPriceWeightPercent", | ||
| 661 | + width: "120", | ||
| 662 | + align: "center", | ||
| 663 | + sorTable: false, | ||
| 664 | + fixed: false, | ||
| 665 | + disabled: true, | ||
| 666 | + }, | ||
| 667 | + { | ||
| 668 | + type: "", | ||
| 669 | + name: "已配重量", | ||
| 670 | + value: "alloctedWeight", | ||
| 671 | + width: "90", | ||
| 672 | + align: "center", | ||
| 673 | + sorTable: false, | ||
| 674 | + fixed: false, | ||
| 675 | + disabled: true, | ||
| 676 | + }, | ||
| 677 | + { | ||
| 678 | + type: "", | ||
| 679 | + name: "已配体积(cm³)", | ||
| 680 | + value: "alloctedVolume", | ||
| 681 | + width: "120", | ||
| 682 | + align: "center", | ||
| 683 | + sorTable: false, | ||
| 684 | + fixed: false, | ||
| 685 | + disabled: true, | ||
| 686 | + }, | ||
| 687 | + { | ||
| 688 | + type: "", | ||
| 689 | + name: "航班优先级", | ||
| 690 | + value: "priorityName", | ||
| 691 | + width: "100", | ||
| 692 | + align: "center", | ||
| 693 | + sorTable: false, | ||
| 694 | + fixed: false, | ||
| 695 | + disabled: true, | ||
| 696 | + }, | ||
| 697 | + { | ||
| 698 | + type: "", | ||
| 699 | + name: "配舱优先级", | ||
| 700 | + value: "priorityRuleName", | ||
| 701 | + width: "100", | ||
| 702 | + align: "center", | ||
| 703 | + sorTable: false, | ||
| 704 | + fixed: false, | ||
| 705 | + disabled: true, | ||
| 706 | + }, | ||
| 707 | + { | ||
| 708 | + type: "", | ||
| 709 | + name: "创建人", | ||
| 710 | + value: "createUserName", | ||
| 711 | + width: "90", | ||
| 712 | + align: "center", | ||
| 713 | + sorTable: false, | ||
| 714 | + fixed: false, | ||
| 715 | + disabled: true, | ||
| 716 | + }, | ||
| 717 | + { | ||
| 718 | + type: "", | ||
| 719 | + name: "创建时间", | ||
| 720 | + value: "createTime", | ||
| 721 | + width: "100", | ||
| 722 | + align: "center", | ||
| 723 | + sorTable: false, | ||
| 724 | + fixed: false, | ||
| 725 | + disabled: true, | ||
| 726 | + }, | ||
| 727 | + { | ||
| 728 | + type: "", | ||
| 729 | + name: "最后修改人", | ||
| 730 | + value: "lastModifyUserName", | ||
| 731 | + width: "120", | ||
| 732 | + align: "center", | ||
| 733 | + sorTable: false, | ||
| 734 | + fixed: false, | ||
| 735 | + disabled: true, | ||
| 736 | + }, | ||
| 737 | + { | ||
| 738 | + type: "", | ||
| 739 | + name: "最后修改时间", | ||
| 740 | + value: "lastModifyTime", | ||
| 741 | + width: "120", | ||
| 742 | + align: "center", | ||
| 743 | + sorTable: false, | ||
| 744 | + fixed: false, | ||
| 745 | + disabled: true, | ||
| 746 | + }, | ||
| 747 | + ], | ||
| 748 | + //删除失败数据 | ||
| 749 | + gridData: [], | ||
| 750 | + //form属性禁用状态 | ||
| 751 | + formdisabled: { | ||
| 752 | + //航班号 | ||
| 753 | + fltNo: false, | ||
| 754 | + //航班日期 | ||
| 755 | + fltDate: false, | ||
| 756 | + //航班路线 | ||
| 757 | + route: false, | ||
| 758 | + //航班种类 | ||
| 759 | + kindId: false, | ||
| 760 | + //航班类型 | ||
| 761 | + typeId: false, | ||
| 762 | + //原始重量 | ||
| 763 | + originalWeight: false, | ||
| 764 | + }, | ||
| 765 | + //下拉框数据 | ||
| 766 | + selectOption: { | ||
| 767 | + //航班种类 | ||
| 768 | + flightKindlist: [], | ||
| 769 | + //航班状态 | ||
| 770 | + flightStatuslist: [], | ||
| 771 | + //航班类型 | ||
| 772 | + flightTypelist: [], | ||
| 773 | + //cutOffTime数据 | ||
| 774 | + cutOffTime: [ | ||
| 775 | + "00:00:00", | ||
| 776 | + "01:00:00", | ||
| 777 | + "02:00:00", | ||
| 778 | + "03:00:00", | ||
| 779 | + "04:00:00", | ||
| 780 | + "05:00:00", | ||
| 781 | + "06:00:00", | ||
| 782 | + "07:00:00", | ||
| 783 | + "08:00:00", | ||
| 784 | + "09:00:00", | ||
| 785 | + "10:00:00", | ||
| 786 | + "11:00:00", | ||
| 787 | + "12:00:00", | ||
| 788 | + "13:00:00", | ||
| 789 | + "14:00:00", | ||
| 790 | + "15:00:00", | ||
| 791 | + "16:00:00", | ||
| 792 | + "17:00:00", | ||
| 793 | + "18:00:00", | ||
| 794 | + "19:00:00", | ||
| 795 | + "20:00:00", | ||
| 796 | + "21:00:00", | ||
| 797 | + "22:00:00", | ||
| 798 | + "23:00:00", | ||
| 799 | + ], | ||
| 800 | + }, | ||
| 801 | + //选中数组 | ||
| 802 | + ids: [], | ||
| 803 | + //目的航班数据 | ||
| 804 | + sourceFlightAndFlightDate: [], | ||
| 805 | + //高价百分比是否打开 | ||
| 806 | + ishighPriceWeightPercent: true, | ||
| 807 | + //非单个禁用 | ||
| 808 | + //single: true, | ||
| 809 | + //非多个禁用 | ||
| 810 | + multiple: true, | ||
| 811 | + //遮罩层 | ||
| 812 | + loading: false, | ||
| 813 | + //遮罩层 | ||
| 814 | + loadingFlightDate: false, | ||
| 815 | + //删除失败弹框 | ||
| 816 | + dialogTableVisible: false, | ||
| 817 | + //弹出层标题 | ||
| 818 | + title: "", | ||
| 819 | + //总条数 | ||
| 820 | + total: 0, | ||
| 821 | + //表格高度 | ||
| 822 | + tableHeight: null, | ||
| 823 | + //新增修改查看规则弹出层 | ||
| 824 | + open: false, | ||
| 825 | + //是否显示查看目的航班弹出层 | ||
| 826 | + openFlightDate: false, | ||
| 827 | + //shift键状态 | ||
| 828 | + shiftKey: false, | ||
| 718 | }; | 829 | }; |
| 719 | }, | 830 | }, |
| 720 | created() { | 831 | created() { |
| 721 | //查询条件数据源 | 832 | //查询条件数据源 |
| 722 | this.findFltConditionData(); | 833 | this.findFltConditionData(); |
| 834 | + if (this.$store.state.tagsView.cachedViews.length == 0) { | ||
| 835 | + this.findAllFltData(); | ||
| 836 | + } | ||
| 837 | + }, | ||
| 838 | + activated() { | ||
| 723 | this.findAllFltData(); | 839 | this.findAllFltData(); |
| 724 | }, | 840 | }, |
| 841 | + deactivated(){ | ||
| 842 | + this.findAllFltDatList = [] | ||
| 843 | + }, | ||
| 844 | + mounted() { | ||
| 845 | + window.addEventListener("keydown", (code) => { | ||
| 846 | + if (code.keyCode === 16 && code.shiftKey) { | ||
| 847 | + this.shiftKey = true; | ||
| 848 | + } | ||
| 849 | + }); | ||
| 850 | + window.addEventListener("keyup", (code) => { | ||
| 851 | + if (code.keyCode === 16) { | ||
| 852 | + this.shiftKey = false; | ||
| 853 | + } | ||
| 854 | + }); | ||
| 855 | + this.tableHeight = | ||
| 856 | + window.innerHeight - this.$refs.queryForm.$el.offsetHeight - 150; | ||
| 857 | + }, | ||
| 725 | methods: { | 858 | methods: { |
| 726 | //输入航班号后 | 859 | //输入航班号后 |
| 727 | blurfltNo() { | 860 | blurfltNo() { |
| ... | @@ -755,10 +888,9 @@ export default { | ... | @@ -755,10 +888,9 @@ export default { |
| 755 | response.data.highLowPriceFlg != null && | 888 | response.data.highLowPriceFlg != null && |
| 756 | response.data.highLowPriceFlg != undefined | 889 | response.data.highLowPriceFlg != undefined |
| 757 | ) { | 890 | ) { |
| 758 | - this.form.highLowPriceFlg = | 891 | + this.form.highLowPriceFlg = response.data.highLowPriceFlg; |
| 759 | - response.data.highLowPriceFlg === 1 ? true : false; | ||
| 760 | } else { | 892 | } else { |
| 761 | - this.$set(this.form, "highLowPriceFlg", true); | 893 | + this.$set(this.form, "highLowPriceFlg", 1); |
| 762 | //this.form.highLowPriceFlg = true; | 894 | //this.form.highLowPriceFlg = true; |
| 763 | } | 895 | } |
| 764 | //是否预审:根据已存在的相同航班号对应的最新值进行设置,如果无相同航班号,按照默认设置‘是否预审’ 为否,不可编辑; | 896 | //是否预审:根据已存在的相同航班号对应的最新值进行设置,如果无相同航班号,按照默认设置‘是否预审’ 为否,不可编辑; |
| ... | @@ -767,10 +899,9 @@ export default { | ... | @@ -767,10 +899,9 @@ export default { |
| 767 | response.data.isNeedRequired != null && | 899 | response.data.isNeedRequired != null && |
| 768 | response.data.isNeedRequired != undefined | 900 | response.data.isNeedRequired != undefined |
| 769 | ) { | 901 | ) { |
| 770 | - this.form.isNeedRequired = | 902 | + this.form.isNeedRequired = response.data.isNeedRequired; |
| 771 | - response.data.isNeedRequired === 1 ? true : false; | ||
| 772 | } else { | 903 | } else { |
| 773 | - this.form.isNeedRequired = false; | 904 | + this.form.isNeedRequired = 0; |
| 774 | } | 905 | } |
| 775 | //高/低价百分比:根据已存在的相同航班号对应的最新值进行设置,如果无相同航班号,按照默认设置‘高价百分比’60%,‘低价百分比’40%,不可编辑 | 906 | //高/低价百分比:根据已存在的相同航班号对应的最新值进行设置,如果无相同航班号,按照默认设置‘高价百分比’60%,‘低价百分比’40%,不可编辑 |
| 776 | if ( | 907 | if ( |
| ... | @@ -800,66 +931,25 @@ export default { | ... | @@ -800,66 +931,25 @@ export default { |
| 800 | }); | 931 | }); |
| 801 | } | 932 | } |
| 802 | }, | 933 | }, |
| 803 | - // 是否一票一件 | ||
| 804 | - ticketToPieceFormat(row) { | ||
| 805 | - if (row.ticketToPiece === 1) { | ||
| 806 | - return "是"; | ||
| 807 | - } else { | ||
| 808 | - return "否"; | ||
| 809 | - } | ||
| 810 | - return row.ticketToPiece; | ||
| 811 | - }, | ||
| 812 | - // 是否需要预审 1 预审 0 取消预审 | ||
| 813 | - needRequiredFormat(row) { | ||
| 814 | - if (row.needRequired === 1) { | ||
| 815 | - return "是"; | ||
| 816 | - } else { | ||
| 817 | - return "否"; | ||
| 818 | - } | ||
| 819 | - return row.ticketToPiece; | ||
| 820 | - }, | ||
| 821 | - //是否开启高低价 | ||
| 822 | - highLowPriceFlgFormat(row) { | ||
| 823 | - if (row.highLowPriceFlg === 1) { | ||
| 824 | - return "开启"; | ||
| 825 | - } else { | ||
| 826 | - return "未开启"; | ||
| 827 | - } | ||
| 828 | - return row.ticketToPiece; | ||
| 829 | - }, | ||
| 830 | - //时间格式化 | ||
| 831 | - renderTime(date) { | ||
| 832 | - var dateee = new Date(date).toJSON(); | ||
| 833 | - return new Date(+new Date(dateee) + 8 * 3600 * 1000) | ||
| 834 | - .toISOString() | ||
| 835 | - .replace(/T/g, " ") | ||
| 836 | - .replace(/\.[\d]{3}Z/, ""); | ||
| 837 | - }, | ||
| 838 | //查询条件数据源 | 934 | //查询条件数据源 |
| 839 | findFltConditionData() { | 935 | findFltConditionData() { |
| 840 | findFltConditionDataApi().then((response) => { | 936 | findFltConditionDataApi().then((response) => { |
| 841 | if (response.code == 200) { | 937 | if (response.code == 200) { |
| 842 | //航班种类 | 938 | //航班种类 |
| 843 | - this.flightKindlist = response.data.flightKind; | 939 | + this.selectOption.flightKindlist = response.data.flightKind; |
| 844 | //航班类型 | 940 | //航班类型 |
| 845 | - this.flightTypelist = response.data.flightType; | 941 | + this.selectOption.flightTypelist = response.data.flightType; |
| 846 | //航班状态 | 942 | //航班状态 |
| 847 | - this.flightStatuslist = response.data.flightStatus; | 943 | + this.selectOption.flightStatuslist = response.data.flightStatus; |
| 848 | } else { | 944 | } else { |
| 849 | this.msgError(response.msg); | 945 | this.msgError(response.msg); |
| 850 | } | 946 | } |
| 851 | }); | 947 | }); |
| 852 | }, | 948 | }, |
| 853 | - | ||
| 854 | - // 多选框选中数据 | ||
| 855 | - handleSelectionChange(selection) { | ||
| 856 | - this.ids = selection.map((item) => item.id); | ||
| 857 | - this.single = selection.length != 1; | ||
| 858 | - this.multiple = !selection.length; | ||
| 859 | - }, | ||
| 860 | - | ||
| 861 | /** 航班信息维护查询*/ | 949 | /** 航班信息维护查询*/ |
| 862 | findAllFltData() { | 950 | findAllFltData() { |
| 951 | + this.ids = []; | ||
| 952 | + this.multiple = true; | ||
| 863 | this.loading = true; | 953 | this.loading = true; |
| 864 | if (this.queryParams.pageNum > 1) { | 954 | if (this.queryParams.pageNum > 1) { |
| 865 | this.queryParams.limitStart = | 955 | this.queryParams.limitStart = |
| ... | @@ -874,12 +964,11 @@ export default { | ... | @@ -874,12 +964,11 @@ export default { |
| 874 | ) { | 964 | ) { |
| 875 | this.queryParams.fltNo = this.queryParams.fltNo.toUpperCase(); | 965 | this.queryParams.fltNo = this.queryParams.fltNo.toUpperCase(); |
| 876 | } | 966 | } |
| 877 | - | ||
| 878 | findAllFltDataApi(this.queryParams).then((response) => { | 967 | findAllFltDataApi(this.queryParams).then((response) => { |
| 968 | + this.loading = false; | ||
| 879 | if (response.code == 200) { | 969 | if (response.code == 200) { |
| 880 | this.findAllFltDatList = response.data.list; | 970 | this.findAllFltDatList = response.data.list; |
| 881 | this.total = response.data.totalCount; | 971 | this.total = response.data.totalCount; |
| 882 | - this.loading = false; | ||
| 883 | } else { | 972 | } else { |
| 884 | this.msgError(response.msg); | 973 | this.msgError(response.msg); |
| 885 | } | 974 | } |
| ... | @@ -891,11 +980,10 @@ export default { | ... | @@ -891,11 +980,10 @@ export default { |
| 891 | this.open = true; | 980 | this.open = true; |
| 892 | this.title = "添加航班信息"; | 981 | this.title = "添加航班信息"; |
| 893 | this.form.id = null; | 982 | this.form.id = null; |
| 894 | - this.form.statusId = this.flightStatuslist[0].id; | 983 | + this.form.statusId = this.selectOption.flightStatuslist[0].id; |
| 895 | this.form.alloctedWeight = 0; //已配重量 | 984 | this.form.alloctedWeight = 0; //已配重量 |
| 896 | this.form.lowAllocatedWeight = 0; //低价已配重量 | 985 | this.form.lowAllocatedWeight = 0; //低价已配重量 |
| 897 | this.form.highAllocatedWeight = 0; //高价已配重量 | 986 | this.form.highAllocatedWeight = 0; //高价已配重量 |
| 898 | - | ||
| 899 | //航班号 | 987 | //航班号 |
| 900 | this.formdisabled.fltNo = false; | 988 | this.formdisabled.fltNo = false; |
| 901 | //航班日期 | 989 | //航班日期 |
| ... | @@ -1003,7 +1091,6 @@ export default { | ... | @@ -1003,7 +1091,6 @@ export default { |
| 1003 | } | 1091 | } |
| 1004 | return Weight; | 1092 | return Weight; |
| 1005 | }, | 1093 | }, |
| 1006 | - | ||
| 1007 | /** 修改按钮操作 */ | 1094 | /** 修改按钮操作 */ |
| 1008 | handleUpdate(row) { | 1095 | handleUpdate(row) { |
| 1009 | this.reset(); | 1096 | this.reset(); |
| ... | @@ -1018,11 +1105,9 @@ export default { | ... | @@ -1018,11 +1105,9 @@ export default { |
| 1018 | if (response.code == 200) { | 1105 | if (response.code == 200) { |
| 1019 | this.form = response.data; | 1106 | this.form = response.data; |
| 1020 | //是否开启高地价 | 1107 | //是否开启高地价 |
| 1021 | - this.form.highLowPriceFlg = | 1108 | + // this.form.highLowPriceFlg = this.form.highLowPriceFlg === 1 ? true : false; |
| 1022 | - this.form.highLowPriceFlg === 1 ? true : false; | ||
| 1023 | //是否预审 | 1109 | //是否预审 |
| 1024 | - this.form.isNeedRequired = | 1110 | + // this.form.isNeedRequired = this.form.isNeedRequired === 1 ? true : false; |
| 1025 | - this.form.isNeedRequired === 1 ? true : false; | ||
| 1026 | // 计算高地价可配 | 1111 | // 计算高地价可配 |
| 1027 | this.LowHighAvailable(); | 1112 | this.LowHighAvailable(); |
| 1028 | } else { | 1113 | } else { |
| ... | @@ -1061,13 +1146,11 @@ export default { | ... | @@ -1061,13 +1146,11 @@ export default { |
| 1061 | }) | 1146 | }) |
| 1062 | .catch(() => {}); | 1147 | .catch(() => {}); |
| 1063 | }, | 1148 | }, |
| 1064 | - | ||
| 1065 | /** 提交按钮 */ | 1149 | /** 提交按钮 */ |
| 1066 | submitForm: function () { | 1150 | submitForm: function () { |
| 1067 | this.$refs["form"].validate((valid) => { | 1151 | this.$refs["form"].validate((valid) => { |
| 1068 | if (valid) { | 1152 | if (valid) { |
| 1069 | let formdata = JSON.parse(JSON.stringify(this.form)); | 1153 | let formdata = JSON.parse(JSON.stringify(this.form)); |
| 1070 | - | ||
| 1071 | //高价百分比和低价百分比和不可以大于100 | 1154 | //高价百分比和低价百分比和不可以大于100 |
| 1072 | if ( | 1155 | if ( |
| 1073 | this.form.highLowPriceFlg && | 1156 | this.form.highLowPriceFlg && |
| ... | @@ -1080,7 +1163,7 @@ export default { | ... | @@ -1080,7 +1163,7 @@ export default { |
| 1080 | //已删除的无法修改 | 1163 | //已删除的无法修改 |
| 1081 | //拿到已删除的id | 1164 | //拿到已删除的id |
| 1082 | let statusId = 0; | 1165 | let statusId = 0; |
| 1083 | - this.flightStatuslist.map((item) => { | 1166 | + this.selectOption.flightStatuslist.map((item) => { |
| 1084 | // this.unitList 是你 select option遍历的集合 e 是选中的id | 1167 | // this.unitList 是你 select option遍历的集合 e 是选中的id |
| 1085 | if (item.chineseName === "已删除") { | 1168 | if (item.chineseName === "已删除") { |
| 1086 | statusId = item.id; | 1169 | statusId = item.id; |
| ... | @@ -1092,9 +1175,9 @@ export default { | ... | @@ -1092,9 +1175,9 @@ export default { |
| 1092 | return; | 1175 | return; |
| 1093 | } | 1176 | } |
| 1094 | //是否开启高地价 | 1177 | //是否开启高地价 |
| 1095 | - formdata.highLowPriceFlg = formdata.highLowPriceFlg ? 1 : 0; | 1178 | + // formdata.highLowPriceFlg = formdata.highLowPriceFlg ? 1 : 0; |
| 1096 | //是否预审 | 1179 | //是否预审 |
| 1097 | - formdata.isNeedRequired = formdata.isNeedRequired ? 1 : 0; | 1180 | + // formdata.isNeedRequired = formdata.isNeedRequired ? 1 : 0; |
| 1098 | //处理数据 | 1181 | //处理数据 |
| 1099 | saveOrUpdate(formdata).then((response) => { | 1182 | saveOrUpdate(formdata).then((response) => { |
| 1100 | if (response.code === 200) { | 1183 | if (response.code === 200) { |
| ... | @@ -1108,18 +1191,17 @@ export default { | ... | @@ -1108,18 +1191,17 @@ export default { |
| 1108 | } | 1191 | } |
| 1109 | }); | 1192 | }); |
| 1110 | }, | 1193 | }, |
| 1111 | - // 表单重置 | 1194 | + //表单重置 |
| 1112 | reset() { | 1195 | reset() { |
| 1113 | this.form = {}; | 1196 | this.form = {}; |
| 1114 | this.resetForm("form"); | 1197 | this.resetForm("form"); |
| 1115 | }, | 1198 | }, |
| 1116 | - // 取消按钮 | 1199 | + //取消按钮 |
| 1117 | cancel() { | 1200 | cancel() { |
| 1118 | this.open = false; | 1201 | this.open = false; |
| 1119 | this.findAllFltData(); | 1202 | this.findAllFltData(); |
| 1120 | this.reset(); | 1203 | this.reset(); |
| 1121 | }, | 1204 | }, |
| 1122 | - | ||
| 1123 | /** 重置按钮操作 */ | 1205 | /** 重置按钮操作 */ |
| 1124 | resetQuery() { | 1206 | resetQuery() { |
| 1125 | this.resetForm("queryForm"); | 1207 | this.resetForm("queryForm"); |
| ... | @@ -1151,6 +1233,30 @@ export default { | ... | @@ -1151,6 +1233,30 @@ export default { |
| 1151 | } | 1233 | } |
| 1152 | }); | 1234 | }); |
| 1153 | }, | 1235 | }, |
| 1236 | + //多选框选中数据 | ||
| 1237 | + tableSelect(val) { | ||
| 1238 | + this.ids = val.selection.map((item) => item.id); | ||
| 1239 | + this.multiple = !val.selection.length; | ||
| 1240 | + }, | ||
| 1241 | + //全选 | ||
| 1242 | + tableSelectAll(val) { | ||
| 1243 | + this.ids = val.selection.map((item) => item.id); | ||
| 1244 | + this.multiple = !val.selection.length; | ||
| 1245 | + }, | ||
| 1246 | + //分页 | ||
| 1247 | + currentChange(val) { | ||
| 1248 | + this.queryParams.pageNum = val.page; | ||
| 1249 | + this.findAllFltData(); | ||
| 1250 | + }, | ||
| 1251 | + //排序 | ||
| 1252 | + sortChange(val) { | ||
| 1253 | + console.log(val); | ||
| 1254 | + }, | ||
| 1255 | + //每页长度 | ||
| 1256 | + sizeChange(val) { | ||
| 1257 | + this.queryParams.limitSize = val; | ||
| 1258 | + this.findAllFltData(); | ||
| 1259 | + }, | ||
| 1154 | }, | 1260 | }, |
| 1155 | }; | 1261 | }; |
| 1156 | </script> | 1262 | </script> | ... | ... |
| ... | @@ -19,14 +19,13 @@ | ... | @@ -19,14 +19,13 @@ |
| 19 | start-placeholder="开始日期" | 19 | start-placeholder="开始日期" |
| 20 | end-placeholder="结束日期" | 20 | end-placeholder="结束日期" |
| 21 | :value-format="valueFormat" | 21 | :value-format="valueFormat" |
| 22 | - clearable | ||
| 23 | > | 22 | > |
| 24 | </el-date-picker> | 23 | </el-date-picker> |
| 25 | </el-form-item> | 24 | </el-form-item> |
| 26 | </el-col> | 25 | </el-col> |
| 27 | <el-col :span="6"> | 26 | <el-col :span="6"> |
| 28 | <el-form-item label="配载航班号"> | 27 | <el-form-item label="配载航班号"> |
| 29 | - <el-input type="textarea" v-model="cargoPlaneNo" class="formItem" placeholder="AC001;AC002" :autosize="true" clearable></el-input> | 28 | + <el-input type="textarea" v-model="cargoPlaneNo" class="formItem" placeholder="AC001;AC002" :autosize="true"></el-input> |
| 30 | </el-form-item> | 29 | </el-form-item> |
| 31 | </el-col> | 30 | </el-col> |
| 32 | <el-col :span="6"> | 31 | <el-col :span="6"> |
| ... | @@ -56,7 +55,6 @@ | ... | @@ -56,7 +55,6 @@ |
| 56 | class="formItem" | 55 | class="formItem" |
| 57 | placeholder="请输入运单号(回车间隔)" | 56 | placeholder="请输入运单号(回车间隔)" |
| 58 | :autosize="true" | 57 | :autosize="true" |
| 59 | - clearable | ||
| 60 | ></el-input> | 58 | ></el-input> |
| 61 | </el-form-item> | 59 | </el-form-item> |
| 62 | </el-col> | 60 | </el-col> |
| ... | @@ -105,7 +103,6 @@ | ... | @@ -105,7 +103,6 @@ |
| 105 | class="formItem" | 103 | class="formItem" |
| 106 | placeholder="S_;P_;E2" | 104 | placeholder="S_;P_;E2" |
| 107 | :autosize="true" | 105 | :autosize="true" |
| 108 | - clearable | ||
| 109 | ></el-input> | 106 | ></el-input> |
| 110 | </el-form-item> | 107 | </el-form-item> |
| 111 | </el-col> | 108 | </el-col> |
| ... | @@ -117,7 +114,6 @@ | ... | @@ -117,7 +114,6 @@ |
| 117 | class="formItem" | 114 | class="formItem" |
| 118 | placeholder="PVG;PEK" | 115 | placeholder="PVG;PEK" |
| 119 | :autosize="true" | 116 | :autosize="true" |
| 120 | - clearable | ||
| 121 | ></el-input> | 117 | ></el-input> |
| 122 | </el-form-item> | 118 | </el-form-item> |
| 123 | </el-col> | 119 | </el-col> |
| ... | @@ -133,25 +129,22 @@ | ... | @@ -133,25 +129,22 @@ |
| 133 | start-placeholder="开始日期" | 129 | start-placeholder="开始日期" |
| 134 | end-placeholder="结束日期" | 130 | end-placeholder="结束日期" |
| 135 | :value-format="valueFormat" | 131 | :value-format="valueFormat" |
| 136 | - clearable | ||
| 137 | > | 132 | > |
| 138 | </el-date-picker> | 133 | </el-date-picker> |
| 139 | </el-form-item> | 134 | </el-form-item> |
| 140 | </el-col> | 135 | </el-col> |
| 141 | <el-col :span="6"> | 136 | <el-col :span="6"> |
| 142 | <el-form-item label="ACCS原航班号"> | 137 | <el-form-item label="ACCS原航班号"> |
| 143 | - <el-input type="text" v-model="fltNo" class="formItem" placeholder="请输入ACCS航班号" clearable></el-input> | 138 | + <el-input type="text" v-model="fltNo" class="formItem" placeholder="请输入ACCS航班号"></el-input> |
| 144 | </el-form-item> | 139 | </el-form-item> |
| 145 | </el-col> | 140 | </el-col> |
| 146 | <el-col :span="6"> | 141 | <el-col :span="6"> |
| 147 | <el-form-item label="取件日期"> | 142 | <el-form-item label="取件日期"> |
| 148 | <el-date-picker | 143 | <el-date-picker |
| 149 | - class="formItem" | ||
| 150 | v-model="formData.pickUpDate" | 144 | v-model="formData.pickUpDate" |
| 151 | type="date" | 145 | type="date" |
| 152 | placeholder="选择日期" | 146 | placeholder="选择日期" |
| 153 | :value-format="valueFormat" | 147 | :value-format="valueFormat" |
| 154 | - clearable | ||
| 155 | > | 148 | > |
| 156 | </el-date-picker> | 149 | </el-date-picker> |
| 157 | </el-form-item> | 150 | </el-form-item> |
| ... | @@ -166,7 +159,6 @@ | ... | @@ -166,7 +159,6 @@ |
| 166 | start-placeholder="开始日期" | 159 | start-placeholder="开始日期" |
| 167 | end-placeholder="结束日期" | 160 | end-placeholder="结束日期" |
| 168 | :value-format="valueFormat" | 161 | :value-format="valueFormat" |
| 169 | - clearable | ||
| 170 | > | 162 | > |
| 171 | </el-date-picker> | 163 | </el-date-picker> |
| 172 | </el-form-item> | 164 | </el-form-item> |
| ... | @@ -223,10 +215,10 @@ | ... | @@ -223,10 +215,10 @@ |
| 223 | @click="select(0)" | 215 | @click="select(0)" |
| 224 | >查询</el-button | 216 | >查询</el-button |
| 225 | > | 217 | > |
| 226 | - <el-button :type="downLoadingTip.downloading?'warning':'primary'" size="small" @click="xlse(0)" :disabled="tableData.length==0" :loading="downLoadingTip.downloading" | 218 | + <el-button :type="downLoadingTip.downloading?'warning':'primary'" size="small" @click="xlse(0)" :disabled="tableData.length==0" :loading="downLoadingTip.downloading" v-hasPermi="['base:cargo:export']" |
| 227 | >{{downLoadingTip.downloading?downLoadingTip.tip:"导出本页查询结果"}}</el-button | 219 | >{{downLoadingTip.downloading?downLoadingTip.tip:"导出本页查询结果"}}</el-button |
| 228 | > | 220 | > |
| 229 | - <el-button :type="downLoadingTip.downloading?'warning':'primary'" size="small" @click="xlse(1)" :disabled="tableData.length==0" :loading="downLoadingTip.downloading" | 221 | + <el-button :type="downLoadingTip.downloading?'warning':'primary'" size="small" @click="xlse(1)" :disabled="tableData.length==0" :loading="downLoadingTip.downloading" v-hasPermi="['base:cargo:export']" |
| 230 | >{{downLoadingTip.downloading?downLoadingTip.tip:"导出全部查询结果"}}</el-button | 222 | >{{downLoadingTip.downloading?downLoadingTip.tip:"导出全部查询结果"}}</el-button |
| 231 | > | 223 | > |
| 232 | <span style="marginLeft:20px;color:#ffba00">全部导出上限80000条数据</span> | 224 | <span style="marginLeft:20px;color:#ffba00">全部导出上限80000条数据</span> |
| ... | @@ -248,7 +240,7 @@ | ... | @@ -248,7 +240,7 @@ |
| 248 | :limitStart="limitStart" | 240 | :limitStart="limitStart" |
| 249 | :page="page" | 241 | :page="page" |
| 250 | :shiftKey="shiftKey" | 242 | :shiftKey="shiftKey" |
| 251 | - height="550" | 243 | + :height="tableHeight" |
| 252 | @tableSelect="tableSelect" | 244 | @tableSelect="tableSelect" |
| 253 | @tableSelectAll="tableSelectAll" | 245 | @tableSelectAll="tableSelectAll" |
| 254 | @currentChange="currentChange" | 246 | @currentChange="currentChange" |
| ... | @@ -319,7 +311,7 @@ export default { | ... | @@ -319,7 +311,7 @@ export default { |
| 319 | type: "", | 311 | type: "", |
| 320 | name: "口岸代码", | 312 | name: "口岸代码", |
| 321 | value: "portName", | 313 | value: "portName", |
| 322 | - width: "100", | 314 | + width: "120", |
| 323 | align: "center", | 315 | align: "center", |
| 324 | sorTable: true, | 316 | sorTable: true, |
| 325 | fixed: false, | 317 | fixed: false, |
| ... | @@ -359,7 +351,7 @@ export default { | ... | @@ -359,7 +351,7 @@ export default { |
| 359 | type: "", | 351 | type: "", |
| 360 | name: "运单号", | 352 | name: "运单号", |
| 361 | value: "waybillNo", | 353 | value: "waybillNo", |
| 362 | - width: "120", | 354 | + width: "150", |
| 363 | align: "center", | 355 | align: "center", |
| 364 | sorTable: true, | 356 | sorTable: true, |
| 365 | fixed: false, | 357 | fixed: false, |
| ... | @@ -369,7 +361,7 @@ export default { | ... | @@ -369,7 +361,7 @@ export default { |
| 369 | type: "", | 361 | type: "", |
| 370 | name: "总单号", | 362 | name: "总单号", |
| 371 | value: "totalWaybillNo", | 363 | value: "totalWaybillNo", |
| 372 | - width: "120", | 364 | + width: "150", |
| 373 | align: "center", | 365 | align: "center", |
| 374 | sorTable: true, | 366 | sorTable: true, |
| 375 | fixed: false, | 367 | fixed: false, |
| ... | @@ -389,7 +381,7 @@ export default { | ... | @@ -389,7 +381,7 @@ export default { |
| 389 | type: "", | 381 | type: "", |
| 390 | name: "服务代码", | 382 | name: "服务代码", |
| 391 | value: "serviceCode", | 383 | value: "serviceCode", |
| 392 | - width: "100", | 384 | + width: "90", |
| 393 | align: "center", | 385 | align: "center", |
| 394 | sorTable: false, | 386 | sorTable: false, |
| 395 | fixed: false, | 387 | fixed: false, |
| ... | @@ -429,7 +421,7 @@ export default { | ... | @@ -429,7 +421,7 @@ export default { |
| 429 | type: "", | 421 | type: "", |
| 430 | name: "subcategory", | 422 | name: "subcategory", |
| 431 | value: "subCategory", | 423 | value: "subCategory", |
| 432 | - width: "140", | 424 | + width: "150", |
| 433 | align: "center", | 425 | align: "center", |
| 434 | sorTable: true, | 426 | sorTable: true, |
| 435 | fixed: false, | 427 | fixed: false, |
| ... | @@ -499,7 +491,7 @@ export default { | ... | @@ -499,7 +491,7 @@ export default { |
| 499 | type: "", | 491 | type: "", |
| 500 | name: "航班预审意见", | 492 | name: "航班预审意见", |
| 501 | value: "caPretrialOpinion", | 493 | value: "caPretrialOpinion", |
| 502 | - width: "120", | 494 | + width: "140", |
| 503 | align: "center", | 495 | align: "center", |
| 504 | sorTable: false, | 496 | sorTable: false, |
| 505 | fixed: false, | 497 | fixed: false, |
| ... | @@ -519,7 +511,7 @@ export default { | ... | @@ -519,7 +511,7 @@ export default { |
| 519 | type: "", | 511 | type: "", |
| 520 | name: "终配航班号", | 512 | name: "终配航班号", |
| 521 | value: "finalFlightNo", | 513 | value: "finalFlightNo", |
| 522 | - width: "120", | 514 | + width: "130", |
| 523 | align: "center", | 515 | align: "center", |
| 524 | sorTable: true, | 516 | sorTable: true, |
| 525 | fixed: false, | 517 | fixed: false, |
| ... | @@ -529,7 +521,7 @@ export default { | ... | @@ -529,7 +521,7 @@ export default { |
| 529 | type: "", | 521 | type: "", |
| 530 | name: "终配航班日期", | 522 | name: "终配航班日期", |
| 531 | value: "finalFlightTime", | 523 | value: "finalFlightTime", |
| 532 | - width: "140", | 524 | + width: "150", |
| 533 | align: "center", | 525 | align: "center", |
| 534 | sorTable: true, | 526 | sorTable: true, |
| 535 | fixed: false, | 527 | fixed: false, |
| ... | @@ -539,7 +531,7 @@ export default { | ... | @@ -539,7 +531,7 @@ export default { |
| 539 | type: "", | 531 | type: "", |
| 540 | name: "二配航班号", | 532 | name: "二配航班号", |
| 541 | value: "twoMatchFlightNo", | 533 | value: "twoMatchFlightNo", |
| 542 | - width: "120", | 534 | + width: "130", |
| 543 | align: "center", | 535 | align: "center", |
| 544 | sorTable: true, | 536 | sorTable: true, |
| 545 | fixed: false, | 537 | fixed: false, |
| ... | @@ -559,7 +551,7 @@ export default { | ... | @@ -559,7 +551,7 @@ export default { |
| 559 | type: "", | 551 | type: "", |
| 560 | name: "预配航班号", | 552 | name: "预配航班号", |
| 561 | value: "preplanFlightNo", | 553 | value: "preplanFlightNo", |
| 562 | - width: "120", | 554 | + width: "130", |
| 563 | align: "center", | 555 | align: "center", |
| 564 | sorTable: true, | 556 | sorTable: true, |
| 565 | fixed: false, | 557 | fixed: false, |
| ... | @@ -579,7 +571,7 @@ export default { | ... | @@ -579,7 +571,7 @@ export default { |
| 579 | type: "", | 571 | type: "", |
| 580 | name: "ACCS原航班号", | 572 | name: "ACCS原航班号", |
| 581 | value: "fltNoAccs", | 573 | value: "fltNoAccs", |
| 582 | - width: "150", | 574 | + width: "140", |
| 583 | align: "center", | 575 | align: "center", |
| 584 | sorTable: true, | 576 | sorTable: true, |
| 585 | fixed: false, | 577 | fixed: false, |
| ... | @@ -599,7 +591,7 @@ export default { | ... | @@ -599,7 +591,7 @@ export default { |
| 599 | type: "", | 591 | type: "", |
| 600 | name: "ACCS原航线", | 592 | name: "ACCS原航线", |
| 601 | value: "accsFlightRoute", | 593 | value: "accsFlightRoute", |
| 602 | - width: "140", | 594 | + width: "150", |
| 603 | align: "center", | 595 | align: "center", |
| 604 | sorTable: true, | 596 | sorTable: true, |
| 605 | fixed: false, | 597 | fixed: false, |
| ... | @@ -629,7 +621,7 @@ export default { | ... | @@ -629,7 +621,7 @@ export default { |
| 629 | type: "", | 621 | type: "", |
| 630 | name: "发件人账号", | 622 | name: "发件人账号", |
| 631 | value: "shipperAccount", | 623 | value: "shipperAccount", |
| 632 | - width: "120", | 624 | + width: "150", |
| 633 | align: "center", | 625 | align: "center", |
| 634 | sorTable: false, | 626 | sorTable: false, |
| 635 | fixed: false, | 627 | fixed: false, |
| ... | @@ -649,7 +641,7 @@ export default { | ... | @@ -649,7 +641,7 @@ export default { |
| 649 | type: "", | 641 | type: "", |
| 650 | name: "始发地城市名称", | 642 | name: "始发地城市名称", |
| 651 | value: "originCity", | 643 | value: "originCity", |
| 652 | - width: "130", | 644 | + width: "150", |
| 653 | align: "center", | 645 | align: "center", |
| 654 | sorTable: false, | 646 | sorTable: false, |
| 655 | fixed: false, | 647 | fixed: false, |
| ... | @@ -689,7 +681,7 @@ export default { | ... | @@ -689,7 +681,7 @@ export default { |
| 689 | type: "", | 681 | type: "", |
| 690 | name: "大货预审时间", | 682 | name: "大货预审时间", |
| 691 | value: "bigPretrialTime", | 683 | value: "bigPretrialTime", |
| 692 | - width: "120", | 684 | + width: "150", |
| 693 | align: "center", | 685 | align: "center", |
| 694 | sorTable: false, | 686 | sorTable: false, |
| 695 | fixed: false, | 687 | fixed: false, |
| ... | @@ -729,7 +721,7 @@ export default { | ... | @@ -729,7 +721,7 @@ export default { |
| 729 | type: "", | 721 | type: "", |
| 730 | name: "创建时间", | 722 | name: "创建时间", |
| 731 | value: "createTime", | 723 | value: "createTime", |
| 732 | - width: "100", | 724 | + width: "120", |
| 733 | align: "center", | 725 | align: "center", |
| 734 | sorTable: true, | 726 | sorTable: true, |
| 735 | fixed: false, | 727 | fixed: false, |
| ... | @@ -757,6 +749,7 @@ export default { | ... | @@ -757,6 +749,7 @@ export default { |
| 757 | limitSize: 100, //无限制-1 | 749 | limitSize: 100, //无限制-1 |
| 758 | page:1, | 750 | page:1, |
| 759 | progress:0, | 751 | progress:0, |
| 752 | + tableHeight:null, | ||
| 760 | formShow:true, | 753 | formShow:true, |
| 761 | }; | 754 | }; |
| 762 | }, | 755 | }, |
| ... | @@ -774,6 +767,20 @@ export default { | ... | @@ -774,6 +767,20 @@ export default { |
| 774 | }); | 767 | }); |
| 775 | }, | 768 | }, |
| 776 | 769 | ||
| 770 | + activated() { | ||
| 771 | + if(this.$store.state.tagsView.cachedViews.length > 0 ){ | ||
| 772 | + this.$store.state.tagsView.cachedViews.forEach(item=>{ | ||
| 773 | + if(item === 'QueryCargo'){ | ||
| 774 | + this.totalCount>0?this.select():'' | ||
| 775 | + } | ||
| 776 | + }) | ||
| 777 | + } | ||
| 778 | + }, | ||
| 779 | + | ||
| 780 | + deactivated(){ | ||
| 781 | + this.tableData = [] | ||
| 782 | + }, | ||
| 783 | + | ||
| 777 | mounted() { | 784 | mounted() { |
| 778 | window.addEventListener("keydown", (code) => { | 785 | window.addEventListener("keydown", (code) => { |
| 779 | if (code.keyCode === 16 && code.shiftKey) { | 786 | if (code.keyCode === 16 && code.shiftKey) { |
| ... | @@ -785,6 +792,7 @@ export default { | ... | @@ -785,6 +792,7 @@ export default { |
| 785 | this.shiftKey = false; | 792 | this.shiftKey = false; |
| 786 | } | 793 | } |
| 787 | }); | 794 | }); |
| 795 | + this.tableHeight = window.innerHeight - this.$refs.cargoForm.$el.offsetHeight-80 | ||
| 788 | }, | 796 | }, |
| 789 | 797 | ||
| 790 | methods: { | 798 | methods: { | ... | ... |
src/views/systemConfig/menuConfig/drawer.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <div class="menuDrawer"> | ||
| 3 | + <el-dialog | ||
| 4 | + :title="drawerTitle" | ||
| 5 | + width="50%" | ||
| 6 | + :visible.sync="dialogVisible" | ||
| 7 | + :close-on-click-modal="false" | ||
| 8 | + :append-to-body="true" | ||
| 9 | + > | ||
| 10 | + <el-form | ||
| 11 | + ref="userForm" | ||
| 12 | + :model="menuForm" | ||
| 13 | + :disabled="menuFormDisabled" | ||
| 14 | + :rules="rules" | ||
| 15 | + label-width="auto" | ||
| 16 | + style="margin: 10px" | ||
| 17 | + > | ||
| 18 | + <el-row> | ||
| 19 | + <el-col :span="12"> | ||
| 20 | + <el-form-item label="菜单名称" prop=""> | ||
| 21 | + <!-- <el-input | ||
| 22 | + placeholder="请输入权限名" | ||
| 23 | + :disabled="menuFormDisabled" | ||
| 24 | + v-model="menuData.userName" | ||
| 25 | + size="mini" | ||
| 26 | + ></el-input> --> | ||
| 27 | + </el-form-item> | ||
| 28 | + </el-col> | ||
| 29 | + <el-col :span="12"> | ||
| 30 | + <el-form-item label="菜单路由" prop=""> | ||
| 31 | + <!-- <el-input | ||
| 32 | + placeholder="请输入权限名" | ||
| 33 | + :disabled="menuFormDisabled" | ||
| 34 | + v-model="menuData.userName" | ||
| 35 | + size="mini" | ||
| 36 | + ></el-input> --> | ||
| 37 | + </el-form-item> | ||
| 38 | + </el-col> | ||
| 39 | + <el-col :span="12"> | ||
| 40 | + <el-form-item label="组件名称" prop=""> | ||
| 41 | + <!-- <el-input | ||
| 42 | + placeholder="请输入权限名" | ||
| 43 | + :disabled="menuFormDisabled" | ||
| 44 | + v-model="menuData.userName" | ||
| 45 | + size="mini" | ||
| 46 | + ></el-input> --> | ||
| 47 | + </el-form-item> | ||
| 48 | + </el-col> | ||
| 49 | + <el-col :span="24"> | ||
| 50 | + <el-form-item label="菜单状态" prop=""> | ||
| 51 | + <el-switch | ||
| 52 | + v-model="menuData.menuStatus" | ||
| 53 | + active-color="#13ce66" | ||
| 54 | + inactive-color="#ff4949" | ||
| 55 | + :disabled="menuFormDisabled" | ||
| 56 | + ></el-switch> | ||
| 57 | + </el-form-item> | ||
| 58 | + </el-col> | ||
| 59 | + <el-col :span="24"> | ||
| 60 | + <el-form-item label="图标选择" prop=""> | ||
| 61 | + <iconSelect @selected="selected"></iconSelect> | ||
| 62 | + </el-form-item> | ||
| 63 | + </el-col> | ||
| 64 | + <el-col :span="24"> | ||
| 65 | + <el-form-item label="权限设置" prop=""> | ||
| 66 | + <el-col :span="6"> | ||
| 67 | + <el-radio label="页面" size="medium"></el-radio> | ||
| 68 | + </el-col> | ||
| 69 | + <el-col :span="6"> | ||
| 70 | + <el-radio label="按钮" size="medium"></el-radio> | ||
| 71 | + </el-col> | ||
| 72 | + <el-col :span="24"> | ||
| 73 | + <el-card shadow="never"> | ||
| 74 | + <el-input placeholder=""></el-input> | ||
| 75 | + </el-card> | ||
| 76 | + </el-col> | ||
| 77 | + </el-form-item> | ||
| 78 | + </el-col> | ||
| 79 | + </el-row> | ||
| 80 | + </el-form> | ||
| 81 | + | ||
| 82 | + <div slot="footer"> | ||
| 83 | + <el-button @click="handleClose">取 消</el-button> | ||
| 84 | + <el-button type="primary" @click="submit">确 定</el-button> | ||
| 85 | + </div> | ||
| 86 | + </el-dialog> | ||
| 87 | + </div> | ||
| 88 | +</template> | ||
| 89 | + | ||
| 90 | +<script> | ||
| 91 | +import iconSelect from "@/components/IconSelect"; | ||
| 92 | +export default { | ||
| 93 | + components: { | ||
| 94 | + iconSelect, | ||
| 95 | + }, | ||
| 96 | + props: { | ||
| 97 | + drawerTitle: { | ||
| 98 | + type: String, | ||
| 99 | + default: "", | ||
| 100 | + }, | ||
| 101 | + menuFormDisabled: { | ||
| 102 | + type: Boolean, | ||
| 103 | + default: false, | ||
| 104 | + }, | ||
| 105 | + dialogVisible: { | ||
| 106 | + type: Boolean, | ||
| 107 | + default: false, | ||
| 108 | + }, | ||
| 109 | + menuData: { | ||
| 110 | + type: Object, | ||
| 111 | + default: null, | ||
| 112 | + }, | ||
| 113 | + }, | ||
| 114 | + data() { | ||
| 115 | + return { | ||
| 116 | + menuForm: {}, | ||
| 117 | + rules:{} | ||
| 118 | + }; | ||
| 119 | + }, | ||
| 120 | + updated() { | ||
| 121 | + this.menuForm = this.menuData; | ||
| 122 | + }, | ||
| 123 | + watch:{ | ||
| 124 | + dialogVisible(val,oldVal){ | ||
| 125 | + if(val){ | ||
| 126 | + this.menuForm = this.menuData; | ||
| 127 | + } | ||
| 128 | + } | ||
| 129 | + }, | ||
| 130 | + methods: { | ||
| 131 | + handleClose() { | ||
| 132 | + this.$emit("handleClose", false); | ||
| 133 | + }, | ||
| 134 | + selected(val) { | ||
| 135 | + console.log(val); | ||
| 136 | + }, | ||
| 137 | + submit() {}, | ||
| 138 | + }, | ||
| 139 | +}; | ||
| 140 | +</script> | ||
| 141 | + | ||
| 142 | +<style> | ||
| 143 | +</style> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
src/views/systemConfig/menuConfig/index.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <div> | ||
| 3 | + <el-form ref="selectionUserForm" label-width="auto" style="margin: 20px"> | ||
| 4 | + <el-row :gutter="50"> </el-row> | ||
| 5 | + </el-form> | ||
| 6 | + <!-- <div style="margin:20px"> | ||
| 7 | + <el-button type="primary" icon="el-icon-plus" size="mini" @click="addMenu" | ||
| 8 | + >新增菜单</el-button | ||
| 9 | + > | ||
| 10 | + </div> --> | ||
| 11 | + <el-table | ||
| 12 | + :data="data" | ||
| 13 | + row-key="id" | ||
| 14 | + fit | ||
| 15 | + border | ||
| 16 | + stripe | ||
| 17 | + highlightCurrentRow | ||
| 18 | + v-loading="loading" | ||
| 19 | + default-expand-all | ||
| 20 | + :tree-props="{ children: 'children', hasChildren: 'hasChildren' }" | ||
| 21 | + > | ||
| 22 | + <template v-for="(item, index) in tableHeader"> | ||
| 23 | + <el-table-column | ||
| 24 | + v-if="item.value === 'menuType'" | ||
| 25 | + :prop="item.value" | ||
| 26 | + :label="item.name" | ||
| 27 | + :key="index" | ||
| 28 | + :align="item.align" | ||
| 29 | + header-align="center" | ||
| 30 | + showOverflowTooltip | ||
| 31 | + :width="item.width" | ||
| 32 | + :formatter="formatter" | ||
| 33 | + > | ||
| 34 | + <template slot-scope="scope"> | ||
| 35 | + <el-tag | ||
| 36 | + :type="scope.row.menuType === 'B' ? '' : 'success'" | ||
| 37 | + disable-transitions | ||
| 38 | + >{{ scope.row.menuType === "B" ? "按钮" : "菜单" }}</el-tag | ||
| 39 | + > | ||
| 40 | + </template> | ||
| 41 | + </el-table-column> | ||
| 42 | + <el-table-column | ||
| 43 | + v-else | ||
| 44 | + :prop="item.value" | ||
| 45 | + :label="item.name" | ||
| 46 | + :key="index" | ||
| 47 | + :align="item.align" | ||
| 48 | + header-align="center" | ||
| 49 | + showOverflowTooltip | ||
| 50 | + :width="item.width" | ||
| 51 | + :formatter="formatter" | ||
| 52 | + > | ||
| 53 | + </el-table-column> | ||
| 54 | + </template> | ||
| 55 | + | ||
| 56 | + <el-table-column | ||
| 57 | + header-align="center" | ||
| 58 | + align="center" | ||
| 59 | + label="操作" | ||
| 60 | + width="auto" | ||
| 61 | + > | ||
| 62 | + <template slot-scope="scope"> | ||
| 63 | + <!-- <el-button type="success" size="mini" @click="buttonClick(scope)">修改</el-button> | ||
| 64 | + <el-button type="primary" size="mini" @click="buttonClick(scope)" | ||
| 65 | + >查看</el-button | ||
| 66 | + > --> | ||
| 67 | + <el-button | ||
| 68 | + :type="scope.row.status == 1 ? 'warning' : 'primary'" | ||
| 69 | + v-hasPermi="['system:menu:openClose']" | ||
| 70 | + size="mini" | ||
| 71 | + @click="menuStatus(scope)" | ||
| 72 | + v-if="scope.row.menuType == 'C'" | ||
| 73 | + >{{ scope.row.status == 1 ? "停用菜单" : "启用菜单" }}</el-button | ||
| 74 | + > | ||
| 75 | + <el-button | ||
| 76 | + type="danger" | ||
| 77 | + size="mini" | ||
| 78 | + v-hasPermi="['system:menu:delete']" | ||
| 79 | + @click="removeMenu(scope)" | ||
| 80 | + v-if="scope.row.menuType == 'C'" | ||
| 81 | + >删除菜单</el-button | ||
| 82 | + > | ||
| 83 | + </template> | ||
| 84 | + </el-table-column> | ||
| 85 | + </el-table> | ||
| 86 | + | ||
| 87 | + <!-- <Tables | ||
| 88 | + ref="newTable" | ||
| 89 | + :data="data" | ||
| 90 | + :headerData="tableHeader" | ||
| 91 | + size="medium" | ||
| 92 | + rowKey="id" | ||
| 93 | + :defaultExpandAll="true" | ||
| 94 | + height="auto" | ||
| 95 | + @tableSelect="tableSelect" | ||
| 96 | + @tableSelectAll="tableSelectAll" | ||
| 97 | + @SelectChange="SelectChange" | ||
| 98 | + > | ||
| 99 | + <el-table-column | ||
| 100 | + header-align="center" | ||
| 101 | + align="center" | ||
| 102 | + label="操作" | ||
| 103 | + width="auto" | ||
| 104 | + > | ||
| 105 | + <template slot-scope="scope"> | ||
| 106 | + <el-button type="primary" size="mini" @click="menuStatus(scope)">{{ | ||
| 107 | + scope.menuStatus == 0 ? "停用" : "启用" | ||
| 108 | + }}</el-button> | ||
| 109 | + <el-button type="danger" size="mini" @click="removeMenu(scope)" | ||
| 110 | + >删除菜单</el-button | ||
| 111 | + > | ||
| 112 | + </template> | ||
| 113 | + </el-table-column> | ||
| 114 | + </Tables> --> | ||
| 115 | + <!-- <Drawer | ||
| 116 | + :dialogVisible="drawer" | ||
| 117 | + :drawerTitle="drawerTitle" | ||
| 118 | + :menuFormDisabled="menuFormDisabled" | ||
| 119 | + :menuData="menuData" | ||
| 120 | + @handleClose="handleClose" | ||
| 121 | + ></Drawer> --> | ||
| 122 | + </div> | ||
| 123 | +</template> | ||
| 124 | + | ||
| 125 | +<script> | ||
| 126 | +import { getAllAuth, updateStatus } from "@/api/system/user.js"; | ||
| 127 | +import dictLabels from "@/assets/languages/dictLabels.js"; | ||
| 128 | +import Drawer from "./drawer.vue"; | ||
| 129 | +import { MessageBox } from "element-ui"; | ||
| 130 | +export default { | ||
| 131 | + name: "MenuConfig", | ||
| 132 | + components: { | ||
| 133 | + Drawer, | ||
| 134 | + }, | ||
| 135 | + data() { | ||
| 136 | + return { | ||
| 137 | + drawer: false, | ||
| 138 | + menuFormDisabled: false, | ||
| 139 | + loading: false, | ||
| 140 | + drawerTitle: "", | ||
| 141 | + menuData: {}, | ||
| 142 | + data: [], | ||
| 143 | + tableHeader: [ | ||
| 144 | + { | ||
| 145 | + name: "菜单名", | ||
| 146 | + value: "title", | ||
| 147 | + width: "200", | ||
| 148 | + align: "left", | ||
| 149 | + sorTable: false, | ||
| 150 | + }, | ||
| 151 | + { | ||
| 152 | + name: "菜单类型", | ||
| 153 | + value: "menuType", | ||
| 154 | + width: "100", | ||
| 155 | + align: "center", | ||
| 156 | + sortable: false, | ||
| 157 | + }, | ||
| 158 | + { | ||
| 159 | + name: "权限标识", | ||
| 160 | + value: "permissionKey", | ||
| 161 | + width: "auto", | ||
| 162 | + align: "left", | ||
| 163 | + sortable: false, | ||
| 164 | + }, | ||
| 165 | + { | ||
| 166 | + name: "菜单状态", | ||
| 167 | + value: "status", | ||
| 168 | + width: "100", | ||
| 169 | + align: "center", | ||
| 170 | + sorTable: false, | ||
| 171 | + }, | ||
| 172 | + { | ||
| 173 | + name: "菜单路由", | ||
| 174 | + value: "path", | ||
| 175 | + width: "auto", | ||
| 176 | + align: "left", | ||
| 177 | + sorTable: false, | ||
| 178 | + }, | ||
| 179 | + ], | ||
| 180 | + }; | ||
| 181 | + }, | ||
| 182 | + created() { | ||
| 183 | + if (this.$store.state.tagsView.cachedViews.length == 0) { | ||
| 184 | + this.menuAll(); | ||
| 185 | + } | ||
| 186 | + }, | ||
| 187 | + activated() { | ||
| 188 | + this.menuAll(); | ||
| 189 | + }, | ||
| 190 | + deactivated() { | ||
| 191 | + this.data = []; | ||
| 192 | + }, | ||
| 193 | + methods: { | ||
| 194 | + addMenu() { | ||
| 195 | + this.menuData = {}; | ||
| 196 | + this.drawer = true; | ||
| 197 | + this.drawerTitle = "新增菜单"; | ||
| 198 | + this.menuFormDisabled = false; | ||
| 199 | + }, | ||
| 200 | + | ||
| 201 | + //关闭 | ||
| 202 | + handleClose(val) { | ||
| 203 | + this.drawer = val; | ||
| 204 | + }, | ||
| 205 | + | ||
| 206 | + buttonClick(row) { | ||
| 207 | + this.menuData = row.row; | ||
| 208 | + this.drawer = true; | ||
| 209 | + this.drawerTitle = "查看/修改"; | ||
| 210 | + this.menuFormDisabled = true; | ||
| 211 | + }, | ||
| 212 | + | ||
| 213 | + //表格数据 | ||
| 214 | + menuAll() { | ||
| 215 | + this.loading = true; | ||
| 216 | + getAllAuth() | ||
| 217 | + .then((res) => { | ||
| 218 | + this.loading = false; | ||
| 219 | + if (res.code === 200) { | ||
| 220 | + res.data.length > 0 | ||
| 221 | + ? (this.data = res.data) | ||
| 222 | + : this.$message({ | ||
| 223 | + message: "数据为空", | ||
| 224 | + type: "warning", | ||
| 225 | + }); | ||
| 226 | + } else { | ||
| 227 | + this.$message({ | ||
| 228 | + message: res.msg, | ||
| 229 | + type: "warning", | ||
| 230 | + }); | ||
| 231 | + } | ||
| 232 | + }) | ||
| 233 | + .catch(() => { | ||
| 234 | + this.loading = false; | ||
| 235 | + }); | ||
| 236 | + }, | ||
| 237 | + | ||
| 238 | + //菜单状态改变 | ||
| 239 | + statusUpdate(data) { | ||
| 240 | + updateStatus(data) | ||
| 241 | + .then((res) => { | ||
| 242 | + if (res.code === 200) { | ||
| 243 | + this.menuAll(); | ||
| 244 | + this.$message({ | ||
| 245 | + message: "操作成功", | ||
| 246 | + type: "success", | ||
| 247 | + }); | ||
| 248 | + location.reload(); | ||
| 249 | + } else { | ||
| 250 | + this.$message({ | ||
| 251 | + message: res.msg, | ||
| 252 | + type: "warning", | ||
| 253 | + }); | ||
| 254 | + } | ||
| 255 | + }) | ||
| 256 | + .catch((err) => { | ||
| 257 | + console.log(err); | ||
| 258 | + }); | ||
| 259 | + }, | ||
| 260 | + | ||
| 261 | + //菜单开启关闭 | ||
| 262 | + menuStatus(row) { | ||
| 263 | + MessageBox.confirm( | ||
| 264 | + row.row.status == 1 ? "是否要关闭此菜单" : "是否要启用此菜单", | ||
| 265 | + "提示", | ||
| 266 | + { | ||
| 267 | + confirmButtonText: "确定", | ||
| 268 | + cancelButtonText: "取消", | ||
| 269 | + type: "warning", | ||
| 270 | + } | ||
| 271 | + ) | ||
| 272 | + .then(() => { | ||
| 273 | + let data = {}; | ||
| 274 | + data.id = row.row.id; | ||
| 275 | + data.status = row.row.status == 1 ? "2" : "1"; | ||
| 276 | + this.statusUpdate(data); | ||
| 277 | + }) | ||
| 278 | + .catch(() => {}); | ||
| 279 | + }, | ||
| 280 | + | ||
| 281 | + //菜单删除 | ||
| 282 | + removeMenu(row) { | ||
| 283 | + MessageBox.confirm("是否要删除此菜单", "提示", { | ||
| 284 | + confirmButtonText: "确定删除", | ||
| 285 | + cancelButtonText: "取消", | ||
| 286 | + type: "warning", | ||
| 287 | + }) | ||
| 288 | + .then(() => { | ||
| 289 | + let data = {}; | ||
| 290 | + data.id = row.row.id; | ||
| 291 | + data.status = "0"; | ||
| 292 | + this.statusUpdate(data); | ||
| 293 | + }) | ||
| 294 | + .catch(() => {}); | ||
| 295 | + }, | ||
| 296 | + | ||
| 297 | + formatter(row, column, cellValue, index) { | ||
| 298 | + if (dictLabels[column.property]) { | ||
| 299 | + if (dictLabels[column.property][cellValue]) { | ||
| 300 | + return dictLabels[column.property][cellValue]; | ||
| 301 | + } | ||
| 302 | + } | ||
| 303 | + return cellValue; | ||
| 304 | + }, | ||
| 305 | + }, | ||
| 306 | +}; | ||
| 307 | +</script> | ||
| 308 | + | ||
| 309 | +<style> | ||
| 310 | +</style> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
src/views/systemConfig/roleConfig/drawer.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <div class="roleDrawer"> | ||
| 3 | + <el-drawer | ||
| 4 | + :title="drawerTitle" | ||
| 5 | + :visible.sync="drawer" | ||
| 6 | + direction="rtl" | ||
| 7 | + size="40%" | ||
| 8 | + destroy-on-close | ||
| 9 | + :close-on-click-modal="false" | ||
| 10 | + :wrapperClosable="false" | ||
| 11 | + :show-close="false" | ||
| 12 | + > | ||
| 13 | + <el-form | ||
| 14 | + ref="roleForm" | ||
| 15 | + :model="roleForm" | ||
| 16 | + label-width="auto" | ||
| 17 | + :rules="rules" | ||
| 18 | + size="mini" | ||
| 19 | + style="margin: 10px" | ||
| 20 | + > | ||
| 21 | + <el-row :gutter="10"> | ||
| 22 | + <el-col :span="12"> | ||
| 23 | + <el-form-item label="角色名:" prop="name"> | ||
| 24 | + <el-input | ||
| 25 | + placeholder="请输入角色名" | ||
| 26 | + v-model.trim="roleForm.name" | ||
| 27 | + :disabled="roleFormDisabled" | ||
| 28 | + v-if="!roleFormDisabled" | ||
| 29 | + clearable | ||
| 30 | + ></el-input> | ||
| 31 | + <div v-else>{{ roleData.name }}</div> | ||
| 32 | + </el-form-item> | ||
| 33 | + </el-col> | ||
| 34 | + <el-col :span="24"> | ||
| 35 | + <el-form-item label="角色描述:" prop="remark"> | ||
| 36 | + <el-input | ||
| 37 | + v-model="roleForm.remark" | ||
| 38 | + type="textarea" | ||
| 39 | + placeholder="请输入角色描述" | ||
| 40 | + :disabled="roleFormDisabled" | ||
| 41 | + v-if="!roleFormDisabled" | ||
| 42 | + clearable | ||
| 43 | + ></el-input> | ||
| 44 | + <div v-else>{{ roleData.remark }}</div> | ||
| 45 | + </el-form-item> | ||
| 46 | + </el-col> | ||
| 47 | + <!-- <el-col :span="24"> | ||
| 48 | + <el-form-item label="角色状态:" prop="valid"> | ||
| 49 | + <el-switch | ||
| 50 | + v-model="roleForm.valid" | ||
| 51 | + :active-value="1" | ||
| 52 | + :inactive-value="2" | ||
| 53 | + active-color="#13ce66" | ||
| 54 | + inactive-color="#ff4949" | ||
| 55 | + :disabled="roleFormDisabled" | ||
| 56 | + ></el-switch> | ||
| 57 | + </el-form-item> | ||
| 58 | + </el-col> --> | ||
| 59 | + <el-col :span="24"> | ||
| 60 | + <el-form-item label="角色权限:" prop="menuIdList"> | ||
| 61 | + <el-tree | ||
| 62 | + ref="tree" | ||
| 63 | + :data="treeData" | ||
| 64 | + node-key="id" | ||
| 65 | + :props="defaultProps" | ||
| 66 | + :show-checkbox="true" | ||
| 67 | + :default-checked-keys="roleData.menuIds" | ||
| 68 | + accordion | ||
| 69 | + > | ||
| 70 | + </el-tree> | ||
| 71 | + </el-form-item> | ||
| 72 | + </el-col> | ||
| 73 | + </el-row> | ||
| 74 | + <el-form-item> | ||
| 75 | + <el-button | ||
| 76 | + type="primary" | ||
| 77 | + v-if="!roleFormDisabled" | ||
| 78 | + size="mini" | ||
| 79 | + :loading="loading" | ||
| 80 | + @click="submit" | ||
| 81 | + >提交</el-button | ||
| 82 | + > | ||
| 83 | + <el-button type="primary" size="mini" @click="handleClose" | ||
| 84 | + >取消</el-button | ||
| 85 | + > | ||
| 86 | + </el-form-item> | ||
| 87 | + </el-form> | ||
| 88 | + </el-drawer> | ||
| 89 | + </div> | ||
| 90 | +</template> | ||
| 91 | + | ||
| 92 | +<script> | ||
| 93 | +import { getAllAuth, addOrUpdateRole } from "@/api/system/user.js"; | ||
| 94 | +export default { | ||
| 95 | + props: { | ||
| 96 | + drawerTitle: { | ||
| 97 | + type: String, | ||
| 98 | + default: "", | ||
| 99 | + }, | ||
| 100 | + roleFormDisabled: { | ||
| 101 | + type: Boolean, | ||
| 102 | + default: false, | ||
| 103 | + }, | ||
| 104 | + drawer: { | ||
| 105 | + type: Boolean, | ||
| 106 | + default: false, | ||
| 107 | + }, | ||
| 108 | + roleData: { | ||
| 109 | + type: Object, | ||
| 110 | + default: null, | ||
| 111 | + }, | ||
| 112 | + }, | ||
| 113 | + data() { | ||
| 114 | + return { | ||
| 115 | + roleForm: { | ||
| 116 | + name: null, | ||
| 117 | + }, | ||
| 118 | + treeData: [], | ||
| 119 | + loading: false, | ||
| 120 | + defaultProps: { | ||
| 121 | + children: "children", | ||
| 122 | + label: "title", | ||
| 123 | + }, | ||
| 124 | + rules: { | ||
| 125 | + name: [ | ||
| 126 | + { | ||
| 127 | + required: true, | ||
| 128 | + message: "角色名不能为空", | ||
| 129 | + trigger: "blur", | ||
| 130 | + }, | ||
| 131 | + ], | ||
| 132 | + }, | ||
| 133 | + }; | ||
| 134 | + }, | ||
| 135 | + created() { | ||
| 136 | + //权限列表 | ||
| 137 | + getAllAuth() | ||
| 138 | + .then((res) => { | ||
| 139 | + if (res.code === 200) { | ||
| 140 | + this.treeData = this.treeDataInfo(res.data); | ||
| 141 | + } else { | ||
| 142 | + this.$message({ | ||
| 143 | + message: res.msg, | ||
| 144 | + type: "warning", | ||
| 145 | + }); | ||
| 146 | + } | ||
| 147 | + }) | ||
| 148 | + .catch((err) => { | ||
| 149 | + console.log(err); | ||
| 150 | + }); | ||
| 151 | + }, | ||
| 152 | + watch: { | ||
| 153 | + roleFormDisabled() { | ||
| 154 | + this.treeData = this.treeDisabled(this.treeData); | ||
| 155 | + }, | ||
| 156 | + drawer(val, oldVal) { | ||
| 157 | + if (val) { | ||
| 158 | + this.roleForm = this.roleData; | ||
| 159 | + } else { | ||
| 160 | + this.loading = false; | ||
| 161 | + } | ||
| 162 | + }, | ||
| 163 | + }, | ||
| 164 | + methods: { | ||
| 165 | + //关闭 | ||
| 166 | + handleClose() { | ||
| 167 | + this.$refs["roleForm"].clearValidate(); | ||
| 168 | + this.$emit("handleClose", false); | ||
| 169 | + }, | ||
| 170 | + | ||
| 171 | + //提交 | ||
| 172 | + submit() { | ||
| 173 | + let formData = {}; | ||
| 174 | + this.loading = true; | ||
| 175 | + let arr = []; | ||
| 176 | + arr = this.$refs.tree.getCheckedKeys().filter((item,index)=>{ | ||
| 177 | + return this.$refs.tree.getCheckedKeys().indexOf(item) == index | ||
| 178 | + }) | ||
| 179 | + formData.menuIdList = arr; | ||
| 180 | + this.roleData ? (formData.id = this.roleData.id) : ""; | ||
| 181 | + formData.remark = this.roleForm.remark; | ||
| 182 | + formData.valid = this.roleForm.valid; | ||
| 183 | + formData.name = this.roleForm.name; | ||
| 184 | + addOrUpdateRole(formData) | ||
| 185 | + .then((res) => { | ||
| 186 | + this.loading = false; | ||
| 187 | + if (res.code === 200) { | ||
| 188 | + this.$message({ | ||
| 189 | + message: "操作成功", | ||
| 190 | + type: "success", | ||
| 191 | + }); | ||
| 192 | + this.$emit("handleClose", false); | ||
| 193 | + } else { | ||
| 194 | + this.$message({ | ||
| 195 | + message: res.msg, | ||
| 196 | + type: "warning", | ||
| 197 | + }); | ||
| 198 | + } | ||
| 199 | + }) | ||
| 200 | + .catch((err) => { | ||
| 201 | + console.log(err); | ||
| 202 | + }); | ||
| 203 | + }, | ||
| 204 | + | ||
| 205 | + //权限结构禁用 | ||
| 206 | + treeDisabled(val) { | ||
| 207 | + let data = []; | ||
| 208 | + val.forEach((item) => { | ||
| 209 | + item.disabled = this.roleFormDisabled; | ||
| 210 | + data.push(item); | ||
| 211 | + if (item.children && item.children.length) { | ||
| 212 | + item.children = this.treeDisabled(item.children); | ||
| 213 | + } | ||
| 214 | + }); | ||
| 215 | + return data; | ||
| 216 | + }, | ||
| 217 | + | ||
| 218 | + treeDataInfo(val) { | ||
| 219 | + let data = []; | ||
| 220 | + val.forEach((item) => { | ||
| 221 | + let menuItem = {}; | ||
| 222 | + menuItem.id = item.id; | ||
| 223 | + menuItem.title = item.title; | ||
| 224 | + data.push(menuItem) | ||
| 225 | + if (item.children && item.children.length) { | ||
| 226 | + menuItem.children = this.treeDataInfo(item.children); | ||
| 227 | + menuItem.children.unshift({id:item.id,title:`${item.title}(菜单)`}) | ||
| 228 | + } | ||
| 229 | + }); | ||
| 230 | + return data; | ||
| 231 | + }, | ||
| 232 | + }, | ||
| 233 | +}; | ||
| 234 | +</script> | ||
| 235 | + | ||
| 236 | +<style> | ||
| 237 | +</style> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
src/views/systemConfig/roleConfig/index.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <div class="roleConfig"> | ||
| 3 | + <el-form ref="selectionRoleForm" label-width="auto" style="margin: 20px"> | ||
| 4 | + <el-row :gutter="50"> | ||
| 5 | + <el-col :span="6"> | ||
| 6 | + <el-form-item label="角色名称"> | ||
| 7 | + <el-input | ||
| 8 | + v-model="formData.name" | ||
| 9 | + placeholder="请输入角色名称" | ||
| 10 | + clearable | ||
| 11 | + ></el-input> | ||
| 12 | + </el-form-item> | ||
| 13 | + </el-col> | ||
| 14 | + <el-col :span="6"> | ||
| 15 | + <el-form-item label="创建时间"> | ||
| 16 | + <el-date-picker | ||
| 17 | + v-model="createTime" | ||
| 18 | + type="daterange" | ||
| 19 | + range-separator="至" | ||
| 20 | + start-placeholder="开始日期" | ||
| 21 | + end-placeholder="结束日期" | ||
| 22 | + value-format="yyyy-MM-dd" | ||
| 23 | + clearable | ||
| 24 | + > | ||
| 25 | + </el-date-picker> | ||
| 26 | + </el-form-item> | ||
| 27 | + </el-col> | ||
| 28 | + <el-col :span="6"> | ||
| 29 | + <el-form-item label="状态"> | ||
| 30 | + <el-select v-model="formData.valid" placeholder="角色状态" clearable> | ||
| 31 | + <el-option label="启用" value="1"> </el-option> | ||
| 32 | + <el-option label="停用" value="2"> </el-option> | ||
| 33 | + </el-select> | ||
| 34 | + </el-form-item> | ||
| 35 | + </el-col> | ||
| 36 | + </el-row> | ||
| 37 | + </el-form> | ||
| 38 | + <div style="margin:20px"> | ||
| 39 | + <el-button | ||
| 40 | + type="primary" | ||
| 41 | + icon="el-icon-search" | ||
| 42 | + size="mini" | ||
| 43 | + :loading="tableLoading" | ||
| 44 | + @click="selectRoleList(0)" | ||
| 45 | + >搜索</el-button | ||
| 46 | + > | ||
| 47 | + <el-button type="primary" icon="el-icon-plus" size="mini" @click="addRole" v-hasPermi="['system:role:add']" | ||
| 48 | + >新增角色</el-button | ||
| 49 | + > | ||
| 50 | + </div> | ||
| 51 | + <Tables | ||
| 52 | + :data="data" | ||
| 53 | + :headerData="tableHeader" | ||
| 54 | + :infoData="tableHeader" | ||
| 55 | + :totalCount="total" | ||
| 56 | + :limitSize="formData.size" | ||
| 57 | + :page="formData.page" | ||
| 58 | + :pageSizes="[20,30,40,50]" | ||
| 59 | + :loading="tableLoading" | ||
| 60 | + height="600" | ||
| 61 | + @sizeChange="sizeChange" | ||
| 62 | + @currentChange="currentChange" | ||
| 63 | + > | ||
| 64 | + <template> | ||
| 65 | + <el-table-column header-align="center" align="center" label="操作"> | ||
| 66 | + <template slot-scope="scope"> | ||
| 67 | + <el-button type="primary" size="mini" @click="buttonClick(scope, 0)" | ||
| 68 | + >查看</el-button | ||
| 69 | + > | ||
| 70 | + <el-button type="primary" size="mini" @click="buttonClick(scope, 1)" v-hasPermi="['system:role:update']" | ||
| 71 | + >修改</el-button | ||
| 72 | + > | ||
| 73 | + <el-button | ||
| 74 | + :type="scope.row.valid == 1 ? 'warning' : 'primary'" | ||
| 75 | + size="mini" | ||
| 76 | + v-hasPermi="['system:role:openClose']" | ||
| 77 | + @click="roleStatus(scope)" | ||
| 78 | + >{{ scope.row.valid == 1 ? "停用" : "启用" }}</el-button | ||
| 79 | + > | ||
| 80 | + <el-button type="danger" size="mini" @click="removeRole(scope)" v-hasPermi="['system:role:delete']" | ||
| 81 | + >删除角色</el-button | ||
| 82 | + > | ||
| 83 | + </template> | ||
| 84 | + </el-table-column> | ||
| 85 | + </template> | ||
| 86 | + </Tables> | ||
| 87 | + <Drawer | ||
| 88 | + :drawer="drawer" | ||
| 89 | + :drawerTitle="drawerTitle" | ||
| 90 | + :roleFormDisabled="roleFormDisabled" | ||
| 91 | + :roleData="roleData" | ||
| 92 | + @handleClose="handleClose" | ||
| 93 | + ></Drawer> | ||
| 94 | + </div> | ||
| 95 | +</template> | ||
| 96 | + | ||
| 97 | +<script> | ||
| 98 | +import Drawer from "./drawer.vue"; | ||
| 99 | +import { MessageBox } from "element-ui"; | ||
| 100 | +import { | ||
| 101 | + getRoleList, | ||
| 102 | + detailRole, | ||
| 103 | + updateRoleStatus, | ||
| 104 | +} from "@/api/system/user.js"; | ||
| 105 | +export default { | ||
| 106 | + name:"RoleConfig", | ||
| 107 | + components: { | ||
| 108 | + Drawer, | ||
| 109 | + }, | ||
| 110 | + data() { | ||
| 111 | + return { | ||
| 112 | + formData: { | ||
| 113 | + page: 1, | ||
| 114 | + size: 20, | ||
| 115 | + valid: null, | ||
| 116 | + createStart: null, | ||
| 117 | + createEnd: null, | ||
| 118 | + name: null, | ||
| 119 | + }, //查询条件 | ||
| 120 | + data: [], //表格数据 | ||
| 121 | + tableHeader: [ | ||
| 122 | + { | ||
| 123 | + type: "index", | ||
| 124 | + name: "", | ||
| 125 | + value: "", | ||
| 126 | + width: "", | ||
| 127 | + align: "center", | ||
| 128 | + sorTable: false, | ||
| 129 | + disabled:true | ||
| 130 | + }, | ||
| 131 | + { | ||
| 132 | + type: "", | ||
| 133 | + name: "角色名称", | ||
| 134 | + value: "name", | ||
| 135 | + width: "150px", | ||
| 136 | + align: "center", | ||
| 137 | + sorTable: false, | ||
| 138 | + disabled:true | ||
| 139 | + }, | ||
| 140 | + { | ||
| 141 | + type: "", | ||
| 142 | + name: "角色状态", | ||
| 143 | + value: "valid", | ||
| 144 | + width: "150px", | ||
| 145 | + align: "center", | ||
| 146 | + sorTable: false, | ||
| 147 | + disabled:true | ||
| 148 | + }, | ||
| 149 | + { | ||
| 150 | + type: "", | ||
| 151 | + name: "创建人", | ||
| 152 | + value: "createUserName", | ||
| 153 | + width: "150px", | ||
| 154 | + align: "center", | ||
| 155 | + sorTable: false, | ||
| 156 | + disabled:true | ||
| 157 | + }, | ||
| 158 | + { | ||
| 159 | + type: "", | ||
| 160 | + name: "创建时间", | ||
| 161 | + value: "createTime", | ||
| 162 | + width: "150px", | ||
| 163 | + align: "center", | ||
| 164 | + sorTable: false, | ||
| 165 | + disabled:true | ||
| 166 | + }, | ||
| 167 | + { | ||
| 168 | + type: "", | ||
| 169 | + name: "修改时间", | ||
| 170 | + value: "updateTime", | ||
| 171 | + width: "150px", | ||
| 172 | + align: "center", | ||
| 173 | + sorTable: false, | ||
| 174 | + disabled:true | ||
| 175 | + }, | ||
| 176 | + { | ||
| 177 | + type: "", | ||
| 178 | + name: "备注", | ||
| 179 | + value: "remark", | ||
| 180 | + width: "400px", | ||
| 181 | + align: "center", | ||
| 182 | + sorTable: false, | ||
| 183 | + disabled:true | ||
| 184 | + }, | ||
| 185 | + ], //表头数据 | ||
| 186 | + roleData: {}, //角色详情 | ||
| 187 | + createTime: [], | ||
| 188 | + drawer: false, | ||
| 189 | + drawerTitle: "", | ||
| 190 | + roleFormDisabled: false, | ||
| 191 | + tableLoading: false, | ||
| 192 | + total: 0, | ||
| 193 | + }; | ||
| 194 | + }, | ||
| 195 | + created() { | ||
| 196 | + if(this.$store.state.tagsView.cachedViews.length == 0){ | ||
| 197 | + this.selectRoleList(); | ||
| 198 | + } | ||
| 199 | + }, | ||
| 200 | + activated(){ | ||
| 201 | + this.selectRoleList(); | ||
| 202 | + }, | ||
| 203 | + deactivated(){ | ||
| 204 | + this.data = [] | ||
| 205 | + }, | ||
| 206 | + methods: { | ||
| 207 | + //角色列表 | ||
| 208 | + selectRoleList(val) { | ||
| 209 | + if(val == 0){ | ||
| 210 | + this.formData.page = 1 | ||
| 211 | + } | ||
| 212 | + this.tableLoading = true; | ||
| 213 | + if (this.createTime.length > 0) { | ||
| 214 | + this.formData.createStart = this.createTime[0]; | ||
| 215 | + this.formData.createEnd = this.createTime[1]; | ||
| 216 | + } | ||
| 217 | + getRoleList(this.formData) | ||
| 218 | + .then((res) => { | ||
| 219 | + this.tableLoading = false; | ||
| 220 | + if (res.code === 200) { | ||
| 221 | + this.data = res.data.list; | ||
| 222 | + this.total = res.data.total; | ||
| 223 | + } else { | ||
| 224 | + this.$message({ | ||
| 225 | + message: res.msg, | ||
| 226 | + type: "warning", | ||
| 227 | + }); | ||
| 228 | + } | ||
| 229 | + }) | ||
| 230 | + .catch((err) => { | ||
| 231 | + this.tableLoading = false; | ||
| 232 | + console.log(err); | ||
| 233 | + }); | ||
| 234 | + }, | ||
| 235 | + //角色详情 | ||
| 236 | + roleDetail(id) { | ||
| 237 | + detailRole(id) | ||
| 238 | + .then((res) => { | ||
| 239 | + if (res.code === 200) { | ||
| 240 | + this.roleData = res.data; | ||
| 241 | + } else { | ||
| 242 | + this.$message({ | ||
| 243 | + message: res.msg, | ||
| 244 | + type: "warning", | ||
| 245 | + }); | ||
| 246 | + } | ||
| 247 | + }) | ||
| 248 | + .catch((err) => { | ||
| 249 | + console.log(err); | ||
| 250 | + }); | ||
| 251 | + }, | ||
| 252 | + //新增角色 | ||
| 253 | + addRole() { | ||
| 254 | + this.roleData = {}; | ||
| 255 | + this.drawer = true; | ||
| 256 | + this.roleFormDisabled = false; | ||
| 257 | + this.drawerTitle = "新增角色"; | ||
| 258 | + }, | ||
| 259 | + //修改查看角色 | ||
| 260 | + buttonClick(row, status) { | ||
| 261 | + this.roleDetail(row.row.id); | ||
| 262 | + this.roleData = row.row; | ||
| 263 | + this.drawer = true; | ||
| 264 | + status == 0 | ||
| 265 | + ? (this.roleFormDisabled = true) | ||
| 266 | + : (this.roleFormDisabled = false); | ||
| 267 | + this.drawerTitle = "修改角色"; | ||
| 268 | + }, | ||
| 269 | + //修改角色状态 | ||
| 270 | + roleStatus(row) { | ||
| 271 | + let msg = ""; | ||
| 272 | + let status = {}; | ||
| 273 | + status.id = row.row.id; | ||
| 274 | + row.row.valid == 1 | ||
| 275 | + ? ((msg = "是否关闭此角色"), (status.valid = 2)) | ||
| 276 | + : ((msg = "是否启用此角色"), (status.valid = 1)); | ||
| 277 | + MessageBox.confirm(msg, "注意", { | ||
| 278 | + confirmButtonText: "确定", | ||
| 279 | + cancelButtonText: "取消", | ||
| 280 | + type: "warning", | ||
| 281 | + }) | ||
| 282 | + .then(() => { | ||
| 283 | + updateRoleStatus(status).then((res) => { | ||
| 284 | + if (res.code === 200) { | ||
| 285 | + this.$message({ | ||
| 286 | + message: "操作成功", | ||
| 287 | + type: "success", | ||
| 288 | + }); | ||
| 289 | + this.selectRoleList(); | ||
| 290 | + } else { | ||
| 291 | + this.$message({ | ||
| 292 | + message: res.msg, | ||
| 293 | + type: "warning", | ||
| 294 | + }); | ||
| 295 | + } | ||
| 296 | + }); | ||
| 297 | + }) | ||
| 298 | + .catch(() => []); | ||
| 299 | + }, | ||
| 300 | + //删除角色 | ||
| 301 | + removeRole(row) { | ||
| 302 | + MessageBox.confirm( | ||
| 303 | + "如删除此角色,角色下所有用户将从中被剔除,可能会对用户操作造成影响!", | ||
| 304 | + "注意", | ||
| 305 | + { | ||
| 306 | + confirmButtonText: "确定", | ||
| 307 | + cancelButtonText: "取消", | ||
| 308 | + type: "warning", | ||
| 309 | + } | ||
| 310 | + ) | ||
| 311 | + .then(() => { | ||
| 312 | + updateRoleStatus({ | ||
| 313 | + id: row.row.id, | ||
| 314 | + valid: 0, | ||
| 315 | + confirmDel: false, | ||
| 316 | + }).then((res) => { | ||
| 317 | + if (res.code === 200) { | ||
| 318 | + this.$message({ | ||
| 319 | + message: "删除成功", | ||
| 320 | + type: "success", | ||
| 321 | + }); | ||
| 322 | + this.selectRoleList(); | ||
| 323 | + } else if (res.code === 202) { | ||
| 324 | + MessageBox.confirm(res.msg, "注意", { | ||
| 325 | + confirmButtonText: "确定", | ||
| 326 | + cancelButtonText: "取消", | ||
| 327 | + type: "warning", | ||
| 328 | + }) | ||
| 329 | + .then(() => { | ||
| 330 | + updateRoleStatus({ | ||
| 331 | + id: row.row.id, | ||
| 332 | + valid: 0, | ||
| 333 | + confirmDel: true, | ||
| 334 | + }).then((res) => { | ||
| 335 | + if (res.code === 200) { | ||
| 336 | + this.$message({ | ||
| 337 | + message: "操作成功", | ||
| 338 | + type: "success", | ||
| 339 | + }); | ||
| 340 | + this.selectRoleList(); | ||
| 341 | + } | ||
| 342 | + }); | ||
| 343 | + }) | ||
| 344 | + .catch(() => {}); | ||
| 345 | + } else { | ||
| 346 | + this.$message({ | ||
| 347 | + message: res.msg, | ||
| 348 | + type: "warning", | ||
| 349 | + }); | ||
| 350 | + } | ||
| 351 | + }); | ||
| 352 | + }) | ||
| 353 | + .catch(() => []); | ||
| 354 | + }, | ||
| 355 | + handleClose(val) { | ||
| 356 | + this.drawer = val; | ||
| 357 | + this.selectRoleList(); | ||
| 358 | + }, | ||
| 359 | + currentChange(val) { | ||
| 360 | + this.formData.page = val.page; | ||
| 361 | + this.selectRoleList(); | ||
| 362 | + }, | ||
| 363 | + sizeChange(val){ | ||
| 364 | + this.formData.size = val; | ||
| 365 | + this.selectRoleList() | ||
| 366 | + } | ||
| 367 | + }, | ||
| 368 | +}; | ||
| 369 | +</script> | ||
| 370 | + | ||
| 371 | +<style> | ||
| 372 | +</style> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
src/views/systemConfig/userConfig/drawer.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <div class="userDrawer"> | ||
| 3 | + <el-drawer | ||
| 4 | + :title="drawerTitle" | ||
| 5 | + :visible.sync="drawer" | ||
| 6 | + direction="rtl" | ||
| 7 | + size="40%" | ||
| 8 | + :close-on-click-modal="false" | ||
| 9 | + :wrapperClosable="false" | ||
| 10 | + :show-close="false" | ||
| 11 | + > | ||
| 12 | + <el-form | ||
| 13 | + ref="userForm" | ||
| 14 | + :model="userForm" | ||
| 15 | + label-width="auto" | ||
| 16 | + :rules="rules" | ||
| 17 | + style="margin: 10px" | ||
| 18 | + > | ||
| 19 | + <el-row :gutter="10"> | ||
| 20 | + <el-col :span="12"> | ||
| 21 | + <el-form-item label="员工号:" prop="loginName"> | ||
| 22 | + <el-input | ||
| 23 | + placeholder="请输入员工号" | ||
| 24 | + v-model.trim="userForm.loginName" | ||
| 25 | + v-if="!userFormDisabled" | ||
| 26 | + :disabled="drawerTitle != '新增用户'" | ||
| 27 | + size="small" | ||
| 28 | + clearable | ||
| 29 | + ></el-input> | ||
| 30 | + <div v-else>{{ userForm.loginName }}</div> | ||
| 31 | + </el-form-item> | ||
| 32 | + </el-col> | ||
| 33 | + <el-col :span="12"> | ||
| 34 | + <el-form-item label="用户姓名:" prop="username"> | ||
| 35 | + <el-input | ||
| 36 | + placeholder="请输入用户姓名" | ||
| 37 | + :disabled="userFormDisabled" | ||
| 38 | + v-model.trim="userForm.username" | ||
| 39 | + v-if="!userFormDisabled" | ||
| 40 | + size="small" | ||
| 41 | + clearable | ||
| 42 | + ></el-input> | ||
| 43 | + <div v-else>{{ userForm.username }}</div> | ||
| 44 | + </el-form-item> | ||
| 45 | + </el-col> | ||
| 46 | + <el-col :span="24"> | ||
| 47 | + <el-alert | ||
| 48 | + title="注意:员工号一但设置就无法更改,请谨慎填写!" | ||
| 49 | + type="warning" | ||
| 50 | + show-icon | ||
| 51 | + size="mini" | ||
| 52 | + :closable="false" | ||
| 53 | + style="width: 400px" | ||
| 54 | + > | ||
| 55 | + </el-alert> | ||
| 56 | + </el-col> | ||
| 57 | + <el-col :span="12"> | ||
| 58 | + <el-form-item label="手机号:" prop="phone"> | ||
| 59 | + <el-input | ||
| 60 | + placeholder="请输入手机号" | ||
| 61 | + type="phone" | ||
| 62 | + v-model.trim="userForm.phone" | ||
| 63 | + :disabled="userFormDisabled" | ||
| 64 | + v-if="!userFormDisabled" | ||
| 65 | + size="small" | ||
| 66 | + clearable | ||
| 67 | + ></el-input> | ||
| 68 | + <div v-else>{{ userForm.phone }}</div> | ||
| 69 | + </el-form-item> | ||
| 70 | + </el-col> | ||
| 71 | + <el-col :span="12"> | ||
| 72 | + <el-form-item label="电子邮箱:" prop="email"> | ||
| 73 | + <el-input | ||
| 74 | + placeholder="请输入电子邮箱" | ||
| 75 | + type="email" | ||
| 76 | + v-model.trim="userForm.email" | ||
| 77 | + :disabled="userFormDisabled" | ||
| 78 | + v-if="!userFormDisabled" | ||
| 79 | + size="small" | ||
| 80 | + clearable | ||
| 81 | + ></el-input> | ||
| 82 | + <div v-else>{{ userForm.email }}</div> | ||
| 83 | + </el-form-item> | ||
| 84 | + </el-col> | ||
| 85 | + <!-- <el-col :span="12" v-if="drawerTitle == '新增用户'"> | ||
| 86 | + <el-form-item label="密码:"> | ||
| 87 | + <el-input | ||
| 88 | + placeholder="请输入密码" | ||
| 89 | + :disabled="userFormDisabled" | ||
| 90 | + type="password" | ||
| 91 | + size="mini" | ||
| 92 | + ></el-input> | ||
| 93 | + </el-form-item> | ||
| 94 | + </el-col> | ||
| 95 | + <el-col :span="12" v-if="drawerTitle == '新增用户'"> | ||
| 96 | + <el-form-item label="确认密码:"> | ||
| 97 | + <el-input | ||
| 98 | + placeholder="请确认密码" | ||
| 99 | + :disabled="userFormDisabled" | ||
| 100 | + type="password" | ||
| 101 | + size="mini" | ||
| 102 | + ></el-input> | ||
| 103 | + </el-form-item> | ||
| 104 | + </el-col> --> | ||
| 105 | + <el-col :span="24"> | ||
| 106 | + <el-form-item label="所属口岸:" prop="portName"> | ||
| 107 | + <el-select | ||
| 108 | + placeholder="请选择口岸" | ||
| 109 | + v-model="port" | ||
| 110 | + :disabled="userFormDisabled" | ||
| 111 | + size="small" | ||
| 112 | + style="width: 100%" | ||
| 113 | + multiple | ||
| 114 | + clearable | ||
| 115 | + > | ||
| 116 | + <el-option | ||
| 117 | + v-for="item in portNameList" | ||
| 118 | + :label="item.englishName" | ||
| 119 | + :value="item.englishName" | ||
| 120 | + :key="item.id" | ||
| 121 | + > | ||
| 122 | + </el-option> | ||
| 123 | + </el-select> | ||
| 124 | + </el-form-item> | ||
| 125 | + </el-col> | ||
| 126 | + <el-col :span="24"> | ||
| 127 | + <el-form-item label="所属角色:" prop="roleIds"> | ||
| 128 | + <el-checkbox-group | ||
| 129 | + v-model="roleid" | ||
| 130 | + :disabled="userFormDisabled" | ||
| 131 | + @change="change" | ||
| 132 | + > | ||
| 133 | + <el-checkbox | ||
| 134 | + v-for="item in roleList" | ||
| 135 | + :label="item.id" | ||
| 136 | + :key="item.id" | ||
| 137 | + >{{ item.name }}</el-checkbox | ||
| 138 | + > | ||
| 139 | + </el-checkbox-group> | ||
| 140 | + </el-form-item> | ||
| 141 | + </el-col> | ||
| 142 | + <el-col :span="24"> | ||
| 143 | + <el-form-item label="备注:" prop="remark"> | ||
| 144 | + <el-input | ||
| 145 | + type="textarea" | ||
| 146 | + v-model="userForm.remark" | ||
| 147 | + placeholder="备注" | ||
| 148 | + :disabled="userFormDisabled" | ||
| 149 | + v-if="!userFormDisabled" | ||
| 150 | + size="small" | ||
| 151 | + clearable | ||
| 152 | + ></el-input> | ||
| 153 | + <div v-else>{{ userForm.remark }}</div> | ||
| 154 | + </el-form-item> | ||
| 155 | + </el-col> | ||
| 156 | + </el-row> | ||
| 157 | + <el-form-item> | ||
| 158 | + <el-button | ||
| 159 | + type="primary" | ||
| 160 | + size="mini" | ||
| 161 | + v-if="!userFormDisabled" | ||
| 162 | + :loading="loading" | ||
| 163 | + @click="submit" | ||
| 164 | + >提交</el-button | ||
| 165 | + > | ||
| 166 | + <el-button type="primary" size="mini" @click="handleClose" | ||
| 167 | + >取消</el-button | ||
| 168 | + > | ||
| 169 | + </el-form-item> | ||
| 170 | + </el-form> | ||
| 171 | + </el-drawer> | ||
| 172 | + </div> | ||
| 173 | +</template> | ||
| 174 | + | ||
| 175 | +<script> | ||
| 176 | +import { | ||
| 177 | + getRoleList, | ||
| 178 | + addOrUpdateUser, | ||
| 179 | + portNameList, | ||
| 180 | +} from "@/api/system/user.js"; | ||
| 181 | +export default { | ||
| 182 | + props: { | ||
| 183 | + drawerTitle: { | ||
| 184 | + type: String, | ||
| 185 | + default: "", | ||
| 186 | + }, | ||
| 187 | + userFormDisabled: { | ||
| 188 | + type: Boolean, | ||
| 189 | + default: false, | ||
| 190 | + }, | ||
| 191 | + drawer: { | ||
| 192 | + type: Boolean, | ||
| 193 | + default: false, | ||
| 194 | + }, | ||
| 195 | + userData: { | ||
| 196 | + type: Object, | ||
| 197 | + default: null, | ||
| 198 | + }, | ||
| 199 | + }, | ||
| 200 | + data() { | ||
| 201 | + return { | ||
| 202 | + userForm: { | ||
| 203 | + roleIds: [], | ||
| 204 | + }, | ||
| 205 | + roleList: [], | ||
| 206 | + portNameList: [], | ||
| 207 | + port: [], | ||
| 208 | + roleid: [], | ||
| 209 | + ImageUploadUrl: "", | ||
| 210 | + dialogVisible: false, | ||
| 211 | + loading: false, | ||
| 212 | + rules: { | ||
| 213 | + loginName: [ | ||
| 214 | + { | ||
| 215 | + required: true, | ||
| 216 | + message: "员工号不能为空", | ||
| 217 | + trigger: "blur", | ||
| 218 | + }, | ||
| 219 | + ], | ||
| 220 | + username: [ | ||
| 221 | + { | ||
| 222 | + required: true, | ||
| 223 | + message: "用户名不能为空", | ||
| 224 | + trigger: "blur", | ||
| 225 | + }, | ||
| 226 | + ], | ||
| 227 | + portName: [ | ||
| 228 | + { | ||
| 229 | + required: true, | ||
| 230 | + message: "所属口岸不能为空", | ||
| 231 | + trigger: "blur", | ||
| 232 | + }, | ||
| 233 | + ], | ||
| 234 | + phone:[ | ||
| 235 | + { | ||
| 236 | + min:11, | ||
| 237 | + max:11, | ||
| 238 | + message:"请输入11位手机号码", | ||
| 239 | + trigger:"blur" | ||
| 240 | + }, | ||
| 241 | + { | ||
| 242 | + pattern:/^(13[0-9]|14[579]|15[0-3,5-9]|16[6]|17[0135678]|18[0-9]|19[89])\d{8}$/, | ||
| 243 | + message:"请输入正确得手机号码" | ||
| 244 | + } | ||
| 245 | + ], | ||
| 246 | + email:[ | ||
| 247 | + { | ||
| 248 | + pattern:/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/, | ||
| 249 | + message:"请输入正确得电子邮箱" | ||
| 250 | + } | ||
| 251 | + ] | ||
| 252 | + }, | ||
| 253 | + }; | ||
| 254 | + }, | ||
| 255 | + created() { | ||
| 256 | + }, | ||
| 257 | + watch: { | ||
| 258 | + drawer(val, oldVal) { | ||
| 259 | + if (val) { | ||
| 260 | + this.roleList = [] | ||
| 261 | + this.selectRoleList(); | ||
| 262 | + this.userForm = this.userData; | ||
| 263 | + if (this.userForm.roleIds) { | ||
| 264 | + this.roleid = this.userForm.roleIds; | ||
| 265 | + } | ||
| 266 | + if (this.userForm.portName) { | ||
| 267 | + this.port = this.userForm.portName; | ||
| 268 | + } | ||
| 269 | + }else{ | ||
| 270 | + this.loading = false; | ||
| 271 | + } | ||
| 272 | + }, | ||
| 273 | + }, | ||
| 274 | + methods: { | ||
| 275 | + clearValidate(formName){ | ||
| 276 | + this.$refs[formName].clearValidate(); | ||
| 277 | + }, | ||
| 278 | + change(val) { | ||
| 279 | + this.roleid = val; | ||
| 280 | + }, | ||
| 281 | + selectRoleList() { | ||
| 282 | + //角色列表 | ||
| 283 | + getRoleList({ size: null, page: null }) | ||
| 284 | + .then((res) => { | ||
| 285 | + if (res.code === 200) { | ||
| 286 | + res.data.list.map((item) => { | ||
| 287 | + if (item.valid == 1) { | ||
| 288 | + this.roleList.push(item); | ||
| 289 | + } | ||
| 290 | + }); | ||
| 291 | + } else { | ||
| 292 | + this.$message({ | ||
| 293 | + message: res.msg, | ||
| 294 | + type: "warning", | ||
| 295 | + }); | ||
| 296 | + } | ||
| 297 | + }) | ||
| 298 | + .catch((err) => { | ||
| 299 | + console.log(err); | ||
| 300 | + }); | ||
| 301 | + //获取口岸 | ||
| 302 | + // this.portNameList = this.$store.state.user.portNames; | ||
| 303 | + portNameList() | ||
| 304 | + .then((res) => { | ||
| 305 | + if (res.code === 200) { | ||
| 306 | + this.portNameList = res.data; | ||
| 307 | + } else { | ||
| 308 | + this.$message({ | ||
| 309 | + message: res.msg, | ||
| 310 | + type: "warning", | ||
| 311 | + }); | ||
| 312 | + } | ||
| 313 | + }) | ||
| 314 | + .catch((err) => { | ||
| 315 | + console.log(err); | ||
| 316 | + }); | ||
| 317 | + }, | ||
| 318 | + | ||
| 319 | + //关闭 | ||
| 320 | + handleClose() { | ||
| 321 | + this.roleid = []; | ||
| 322 | + this.port = []; | ||
| 323 | + this.userForm = { | ||
| 324 | + roleIds: [], | ||
| 325 | + }; | ||
| 326 | + this.clearValidate('userForm') | ||
| 327 | + this.$emit("handleClose", false); | ||
| 328 | + }, | ||
| 329 | + | ||
| 330 | + //提交 | ||
| 331 | + submit() { | ||
| 332 | + if (this.port.join(",").length > 0) { | ||
| 333 | + this.loading = true; | ||
| 334 | + this.userData.isValid ? "" : (this.userForm.isValid = 1); | ||
| 335 | + this.userForm.roleIds = this.roleid; | ||
| 336 | + this.userForm.portName = this.port.join(","); | ||
| 337 | + addOrUpdateUser(this.userForm) | ||
| 338 | + .then((res) => { | ||
| 339 | + this.loading = false; | ||
| 340 | + if (res.code === 200) { | ||
| 341 | + this.$message({ | ||
| 342 | + message: "操作成功", | ||
| 343 | + type: "success", | ||
| 344 | + }); | ||
| 345 | + this.$emit("handleClose", false); | ||
| 346 | + } else { | ||
| 347 | + this.$message({ | ||
| 348 | + message: res.msg, | ||
| 349 | + type: "warning", | ||
| 350 | + }); | ||
| 351 | + } | ||
| 352 | + }) | ||
| 353 | + .catch((err) => { | ||
| 354 | + this.loading = false; | ||
| 355 | + console.log(err); | ||
| 356 | + }); | ||
| 357 | + }else{ | ||
| 358 | + this.$message({ | ||
| 359 | + message: "口岸不能为空", | ||
| 360 | + type: "warning", | ||
| 361 | + }); | ||
| 362 | + } | ||
| 363 | + }, | ||
| 364 | + }, | ||
| 365 | +}; | ||
| 366 | +</script> | ||
| 367 | + | ||
| 368 | +<style> | ||
| 369 | +</style> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
src/views/systemConfig/userConfig/index.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <div> | ||
| 3 | + <el-form ref="selectionUserForm" label-width="auto" style="margin: 20px"> | ||
| 4 | + <el-row :gutter="50"> | ||
| 5 | + <el-col :span="6"> | ||
| 6 | + <el-form-item label="用户姓名"> | ||
| 7 | + <el-input | ||
| 8 | + placeholder="请输入用户名称" | ||
| 9 | + v-model="formData.username" | ||
| 10 | + clearable | ||
| 11 | + ></el-input> | ||
| 12 | + </el-form-item> | ||
| 13 | + </el-col> | ||
| 14 | + <el-col :span="6"> | ||
| 15 | + <el-form-item label="手机号码"> | ||
| 16 | + <el-input | ||
| 17 | + placeholder="请输入手机号码" | ||
| 18 | + v-model="formData.phone" | ||
| 19 | + clearable | ||
| 20 | + ></el-input> | ||
| 21 | + </el-form-item> | ||
| 22 | + </el-col> | ||
| 23 | + <el-col :span="6"> | ||
| 24 | + <el-form-item label="状态"> | ||
| 25 | + <el-select placeholder="用户状态" v-model="formData.isValid" clearable> | ||
| 26 | + <el-option label="启用" value="1"> </el-option> | ||
| 27 | + <el-option label="停用" value="2"> </el-option> | ||
| 28 | + </el-select> | ||
| 29 | + </el-form-item> | ||
| 30 | + </el-col> | ||
| 31 | + </el-row> | ||
| 32 | + </el-form> | ||
| 33 | + <div style="margin:20px"> | ||
| 34 | + <el-button | ||
| 35 | + type="primary" | ||
| 36 | + icon="el-icon-search" | ||
| 37 | + size="mini" | ||
| 38 | + :loading="loading" | ||
| 39 | + @click="selectUser(0)" | ||
| 40 | + >搜索</el-button | ||
| 41 | + > | ||
| 42 | + <el-button type="primary" icon="el-icon-plus" size="mini" @click="addUser" v-hasPermi="['system:user:add']" | ||
| 43 | + >新增用户</el-button | ||
| 44 | + > | ||
| 45 | + </div> | ||
| 46 | + <Tables | ||
| 47 | + :data="data" | ||
| 48 | + :headerData="tableHeader" | ||
| 49 | + :limitSize="formData.size" | ||
| 50 | + :totalCount="total" | ||
| 51 | + :loading="loading" | ||
| 52 | + :page="formData.page" | ||
| 53 | + :pageSizes="[20,30,40,50]" | ||
| 54 | + height="600" | ||
| 55 | + @sizeChange="sizeChange" | ||
| 56 | + @currentChange="currentChange" | ||
| 57 | + > | ||
| 58 | + <template> | ||
| 59 | + <el-table-column | ||
| 60 | + header-align="center" | ||
| 61 | + align="center" | ||
| 62 | + width="auto" | ||
| 63 | + label="操作" | ||
| 64 | + > | ||
| 65 | + <template slot-scope="scope"> | ||
| 66 | + <el-button type="primary" size="mini" @click="buttonClick(scope, 0)" | ||
| 67 | + >查看</el-button | ||
| 68 | + > | ||
| 69 | + <el-button type="primary" size="mini" @click="buttonClick(scope, 1)" v-hasPermi="['system:user:update']" | ||
| 70 | + >修改</el-button | ||
| 71 | + > | ||
| 72 | + <!-- <el-button type="primary" size="mini" @click="passwordShow = !passwordShow" | ||
| 73 | + >修改密码</el-button | ||
| 74 | + > --> | ||
| 75 | + <el-button | ||
| 76 | + :type="scope.row.isValid == 1 ? 'warning' : 'primary'" | ||
| 77 | + size="mini" | ||
| 78 | + v-hasPermi="['system:user:openClose']" | ||
| 79 | + @click="userStatus(scope)" | ||
| 80 | + >{{ scope.row.isValid == 1 ? "停用" : "启用" }}</el-button | ||
| 81 | + > | ||
| 82 | + <el-button type="danger" size="mini" @click="removeUser(scope)" v-hasPermi="['system:user:delete']" | ||
| 83 | + >删除用户</el-button | ||
| 84 | + > | ||
| 85 | + </template> | ||
| 86 | + </el-table-column> | ||
| 87 | + </template> | ||
| 88 | + </Tables> | ||
| 89 | + <Drawer | ||
| 90 | + :drawer="drawer" | ||
| 91 | + :drawerTitle="drawerTitle" | ||
| 92 | + :userFormDisabled="userFormDisabled" | ||
| 93 | + :userData="userData" | ||
| 94 | + @handleClose="handleClose" | ||
| 95 | + ></Drawer> | ||
| 96 | + <!-- <el-dialog | ||
| 97 | + title="修改密码" | ||
| 98 | + :visible.sync="passwordShow" | ||
| 99 | + width="30%" | ||
| 100 | + :close-on-click-modal="false" | ||
| 101 | + :append-to-body="true" | ||
| 102 | + > | ||
| 103 | + <el-form label-width="auto"> | ||
| 104 | + <el-row :gutter="10"> | ||
| 105 | + <el-col :span="24"> | ||
| 106 | + <el-form-item label="旧密码:"> | ||
| 107 | + <el-input placeholder="请输入旧密码" type="password"></el-input> | ||
| 108 | + </el-form-item> | ||
| 109 | + </el-col> | ||
| 110 | + <el-col :span="24"> | ||
| 111 | + <el-form-item label="新密码:"> | ||
| 112 | + <el-input placeholder="请输入新密码" type="password"></el-input> | ||
| 113 | + </el-form-item> | ||
| 114 | + </el-col> | ||
| 115 | + <el-col :span="24"> | ||
| 116 | + <el-form-item label="确认新密码:"> | ||
| 117 | + <el-input placeholder="请确认新密码" type="password"></el-input> | ||
| 118 | + </el-form-item> | ||
| 119 | + </el-col> | ||
| 120 | + </el-row> | ||
| 121 | + <div class="dialogFoot"> | ||
| 122 | + <el-button @click="passwordShow = false">取 消</el-button> | ||
| 123 | + <el-button type="primary" @click="passwordShow = false">确 定</el-button> | ||
| 124 | + </div> | ||
| 125 | + </el-form> | ||
| 126 | + </el-dialog> --> | ||
| 127 | + </div> | ||
| 128 | +</template> | ||
| 129 | + | ||
| 130 | +<script> | ||
| 131 | +import Drawer from "./drawer.vue"; | ||
| 132 | +import { MessageBox } from "element-ui"; | ||
| 133 | +import { listUser, detailUser, updateUserStatus } from "@/api/system/user.js"; | ||
| 134 | +export default { | ||
| 135 | + name: "UserConfig", | ||
| 136 | + components: { | ||
| 137 | + Drawer, | ||
| 138 | + }, | ||
| 139 | + data() { | ||
| 140 | + return { | ||
| 141 | + formData: { | ||
| 142 | + page: 1, | ||
| 143 | + size: 20, | ||
| 144 | + isValid: null, | ||
| 145 | + username: null, | ||
| 146 | + phone: null, | ||
| 147 | + }, //查询条件 | ||
| 148 | + tableHeader: [ | ||
| 149 | + { | ||
| 150 | + type: "index", | ||
| 151 | + name: "", | ||
| 152 | + value: "", | ||
| 153 | + width: "", | ||
| 154 | + align: "center", | ||
| 155 | + sorTable: false, | ||
| 156 | + disabled:true | ||
| 157 | + }, | ||
| 158 | + { | ||
| 159 | + type: "", | ||
| 160 | + name: "员工号", | ||
| 161 | + value: "loginName", | ||
| 162 | + width: "150px", | ||
| 163 | + align: "center", | ||
| 164 | + sorTable: false, | ||
| 165 | + disabled:true | ||
| 166 | + }, | ||
| 167 | + { | ||
| 168 | + type: "", | ||
| 169 | + name: "用户姓名", | ||
| 170 | + value: "username", | ||
| 171 | + width: "150px", | ||
| 172 | + align: "center", | ||
| 173 | + sorTable: false, | ||
| 174 | + disabled:true | ||
| 175 | + }, | ||
| 176 | + { | ||
| 177 | + type: "", | ||
| 178 | + name: "所属口岸", | ||
| 179 | + value: "portName", | ||
| 180 | + width: "150px", | ||
| 181 | + align: "center", | ||
| 182 | + sortable: false, | ||
| 183 | + disabled:true | ||
| 184 | + }, | ||
| 185 | + { | ||
| 186 | + type: "", | ||
| 187 | + name: "所属角色", | ||
| 188 | + value: "roleNames", | ||
| 189 | + width: "150px", | ||
| 190 | + align: "center", | ||
| 191 | + sorTable: false, | ||
| 192 | + disabled:true | ||
| 193 | + }, | ||
| 194 | + { | ||
| 195 | + type: "", | ||
| 196 | + name: "电子邮箱", | ||
| 197 | + value: "email", | ||
| 198 | + width: "150px", | ||
| 199 | + align: "center", | ||
| 200 | + sorTable: false, | ||
| 201 | + disabled:true | ||
| 202 | + }, | ||
| 203 | + { | ||
| 204 | + type: "", | ||
| 205 | + name: "用户状态", | ||
| 206 | + value: "isValid", | ||
| 207 | + width: "100px", | ||
| 208 | + align: "center", | ||
| 209 | + sorTable: false, | ||
| 210 | + disabled:true | ||
| 211 | + }, | ||
| 212 | + { | ||
| 213 | + type: "", | ||
| 214 | + name: "修改时间", | ||
| 215 | + value: "updateTime", | ||
| 216 | + width: "150px", | ||
| 217 | + align: "center", | ||
| 218 | + sorTable: false, | ||
| 219 | + disabled:true | ||
| 220 | + }, | ||
| 221 | + { | ||
| 222 | + type: "", | ||
| 223 | + name: "备注", | ||
| 224 | + value: "remark", | ||
| 225 | + width: "150px", | ||
| 226 | + align: "center", | ||
| 227 | + sorTable: false, | ||
| 228 | + disabled:true | ||
| 229 | + }, | ||
| 230 | + ], //表头数据 | ||
| 231 | + userData: {}, //用户详情 | ||
| 232 | + data: [], //用户列表 | ||
| 233 | + drawer: false, | ||
| 234 | + userFormDisabled: false, | ||
| 235 | + passwordShow: false, | ||
| 236 | + drawerTitle: "", | ||
| 237 | + total: 0, | ||
| 238 | + loading: false, | ||
| 239 | + }; | ||
| 240 | + }, | ||
| 241 | + created() { | ||
| 242 | + if(this.$store.state.tagsView.cachedViews.length == 0){ | ||
| 243 | + this.selectUser(); | ||
| 244 | + } | ||
| 245 | + }, | ||
| 246 | + activated(){ | ||
| 247 | + this.selectUser(); | ||
| 248 | + }, | ||
| 249 | + deactivated(){ | ||
| 250 | + this.data = [] | ||
| 251 | + }, | ||
| 252 | + methods: { | ||
| 253 | + //用户列表 | ||
| 254 | + selectUser(val) { | ||
| 255 | + if(val == 0){ | ||
| 256 | + this.formData.page = 1 | ||
| 257 | + } | ||
| 258 | + this.loading = true; | ||
| 259 | + listUser(this.formData) | ||
| 260 | + .then((res) => { | ||
| 261 | + this.loading = false; | ||
| 262 | + if (res.code === 200) { | ||
| 263 | + this.data = res.data.list; | ||
| 264 | + this.total = res.data.total; | ||
| 265 | + this.formData.page = res.data.page; | ||
| 266 | + } else { | ||
| 267 | + this.$message({ | ||
| 268 | + message: res.msg, | ||
| 269 | + type: "warning", | ||
| 270 | + }); | ||
| 271 | + } | ||
| 272 | + }) | ||
| 273 | + .catch((err) => { | ||
| 274 | + this.loading = false; | ||
| 275 | + console.log(err); | ||
| 276 | + }); | ||
| 277 | + }, | ||
| 278 | + | ||
| 279 | + //用户详情 | ||
| 280 | + userDetail(id) { | ||
| 281 | + detailUser(id) | ||
| 282 | + .then((res) => { | ||
| 283 | + this.drawer = true; | ||
| 284 | + this.drawerTitle = "修改用户"; | ||
| 285 | + if (res.code === 200) { | ||
| 286 | + this.userData = res.data; | ||
| 287 | + this.userData.portName | ||
| 288 | + ?this.userData.portName=this.userData.portName.split(",") | ||
| 289 | + : ''; | ||
| 290 | + } else { | ||
| 291 | + this.$message({ | ||
| 292 | + message: res.msg, | ||
| 293 | + type: "warning", | ||
| 294 | + }); | ||
| 295 | + } | ||
| 296 | + }) | ||
| 297 | + .catch((err) => { | ||
| 298 | + console.log(err); | ||
| 299 | + }); | ||
| 300 | + }, | ||
| 301 | + | ||
| 302 | + //新增用户 | ||
| 303 | + addUser() { | ||
| 304 | + this.userData = {}; | ||
| 305 | + this.drawer = true; | ||
| 306 | + this.drawerTitle = "新增用户"; | ||
| 307 | + this.userFormDisabled = false; | ||
| 308 | + }, | ||
| 309 | + | ||
| 310 | + //查询修改用户 | ||
| 311 | + buttonClick(row, status) { | ||
| 312 | + this.userDetail(row.row.id); | ||
| 313 | + status == 0 | ||
| 314 | + ? (this.userFormDisabled = true) | ||
| 315 | + : (this.userFormDisabled = false); | ||
| 316 | + }, | ||
| 317 | + | ||
| 318 | + //修改用户状态 | ||
| 319 | + userStatus(row) { | ||
| 320 | + let msg = ""; | ||
| 321 | + let nowValid = 1; | ||
| 322 | + row.row.isValid == 1 | ||
| 323 | + ? ((msg = "是否要停用此用户"), (nowValid = 2)) | ||
| 324 | + : ((msg = "是否要启用此用户"), (nowValid = 1)); | ||
| 325 | + MessageBox.confirm(msg, "提示", { | ||
| 326 | + confirmButtonText: "确定", | ||
| 327 | + cancelButtonText: "取消", | ||
| 328 | + type: "warning", | ||
| 329 | + }) | ||
| 330 | + .then(() => { | ||
| 331 | + updateUserStatus({ id: row.row.id, isValid: nowValid }).then( | ||
| 332 | + (res) => { | ||
| 333 | + if (res.code === 200) { | ||
| 334 | + this.$message({ | ||
| 335 | + message: "操作成功", | ||
| 336 | + type: "success", | ||
| 337 | + }); | ||
| 338 | + this.selectUser(); | ||
| 339 | + } else { | ||
| 340 | + this.$message({ | ||
| 341 | + message: res.msg, | ||
| 342 | + type: "warning", | ||
| 343 | + }); | ||
| 344 | + } | ||
| 345 | + } | ||
| 346 | + ); | ||
| 347 | + }) | ||
| 348 | + .catch((err) => { | ||
| 349 | + console.log(err); | ||
| 350 | + }) | ||
| 351 | + .catch(() => []); | ||
| 352 | + }, | ||
| 353 | + | ||
| 354 | + //删除用户 | ||
| 355 | + removeUser(row) { | ||
| 356 | + MessageBox.confirm("是否要删除此用户", "提示", { | ||
| 357 | + confirmButtonText: "确定删除", | ||
| 358 | + cancelButtonText: "取消", | ||
| 359 | + type: "warning", | ||
| 360 | + }) | ||
| 361 | + .then(() => { | ||
| 362 | + updateUserStatus({ id: row.row.id, isValid: 0 }).then((res) => { | ||
| 363 | + if (res.code === 200) { | ||
| 364 | + this.$message({ | ||
| 365 | + message: "操作成功", | ||
| 366 | + type: "success", | ||
| 367 | + }); | ||
| 368 | + this.selectUser(); | ||
| 369 | + } else { | ||
| 370 | + this.$message({ | ||
| 371 | + message: res.msg, | ||
| 372 | + type: "warning", | ||
| 373 | + }); | ||
| 374 | + } | ||
| 375 | + }); | ||
| 376 | + }) | ||
| 377 | + .catch((err) => { | ||
| 378 | + console.log(err); | ||
| 379 | + }) | ||
| 380 | + .catch(() => []); | ||
| 381 | + }, | ||
| 382 | + | ||
| 383 | + handleClose(val) { | ||
| 384 | + this.drawer = val; | ||
| 385 | + this.userData = {}; | ||
| 386 | + this.selectUser(); | ||
| 387 | + }, | ||
| 388 | + | ||
| 389 | + currentChange(val) { | ||
| 390 | + this.formData.page = val.page; | ||
| 391 | + this.selectUser(); | ||
| 392 | + }, | ||
| 393 | + | ||
| 394 | + sizeChange(val){ | ||
| 395 | + this.formData.size = val; | ||
| 396 | + this.selectUser() | ||
| 397 | + } | ||
| 398 | + }, | ||
| 399 | +}; | ||
| 400 | +</script> | ||
| 401 | + | ||
| 402 | +<style> | ||
| 403 | +</style> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
-
Please register or login to post a comment