Commit 1dcf5559fb78f588412abfa5beadbb72d418ba92
1 parent
4f534e03
用户管理页所属仓库展示优化
Signed-off-by: TanYibin <5491541@qq.com>
Showing
3 changed files
with
50 additions
and
9 deletions
ant-design-vue-jeecg/src/views/system/UserList.vue
@@ -115,6 +115,12 @@ | @@ -115,6 +115,12 @@ | ||
115 | :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" | 115 | :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" |
116 | @change="handleTableChange"> | 116 | @change="handleTableChange"> |
117 | 117 | ||
118 | + <span slot="selectedWarehouses" slot-scope="selectedWarehouses" > | ||
119 | + <a-tag v-for="selectedWarehouse in selectedWarehouses" :key="selectedWarehouse" color=pink> | ||
120 | + {{ solutionWarehouse(selectedWarehouse) }} | ||
121 | + </a-tag> | ||
122 | + </span> | ||
123 | + | ||
118 | <template slot="avatarslot" slot-scope="text, record"> | 124 | <template slot="avatarslot" slot-scope="text, record"> |
119 | <div class="anty-img-wrap"> | 125 | <div class="anty-img-wrap"> |
120 | <a-avatar shape="square" :src="getAvatarView(record.avatar)" icon="user"/> | 126 | <a-avatar shape="square" :src="getAvatarView(record.avatar)" icon="user"/> |
@@ -186,7 +192,7 @@ | @@ -186,7 +192,7 @@ | ||
186 | import UserModal from './modules/UserModal' | 192 | import UserModal from './modules/UserModal' |
187 | import PasswordModal from './modules/PasswordModal' | 193 | import PasswordModal from './modules/PasswordModal' |
188 | import {putAction, getFileAccessHttpUrl} from '@/api/manage'; | 194 | import {putAction, getFileAccessHttpUrl} from '@/api/manage'; |
189 | -import {frozenBatch} from '@/api/api' | 195 | +import {frozenBatch, getAllWarehouseList} from '@/api/api' |
190 | import {JeecgListMixin} from '@/mixins/JeecgListMixin' | 196 | import {JeecgListMixin} from '@/mixins/JeecgListMixin' |
191 | import SysUserAgentModal from "./modules/SysUserAgentModal"; | 197 | import SysUserAgentModal from "./modules/SysUserAgentModal"; |
192 | import JInput from '@/components/jeecg/JInput' | 198 | import JInput from '@/components/jeecg/JInput' |
@@ -211,6 +217,7 @@ export default { | @@ -211,6 +217,7 @@ export default { | ||
211 | description: '这是用户管理页面', | 217 | description: '这是用户管理页面', |
212 | queryParam: {}, | 218 | queryParam: {}, |
213 | recycleBinVisible: false, | 219 | recycleBinVisible: false, |
220 | + allWarehouseList: [], | ||
214 | columns: [ | 221 | columns: [ |
215 | /*{ | 222 | /*{ |
216 | title: '#', | 223 | title: '#', |
@@ -265,8 +272,10 @@ export default { | @@ -265,8 +272,10 @@ export default { | ||
265 | { | 272 | { |
266 | title: '所属仓库', | 273 | title: '所属仓库', |
267 | align: "center", | 274 | align: "center", |
268 | - width: 100, | ||
269 | - dataIndex: 'selectedWarehouse' | 275 | + width: 200, |
276 | + dataIndex: 'selectedWarehouses', | ||
277 | + key: 'selectedWarehouses', | ||
278 | + scopedSlots: {customRender: 'selectedWarehouses'} | ||
270 | }, | 279 | }, |
271 | // { | 280 | // { |
272 | // title: '部门', | 281 | // title: '部门', |
@@ -315,11 +324,30 @@ export default { | @@ -315,11 +324,30 @@ export default { | ||
315 | return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; | 324 | return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; |
316 | } | 325 | } |
317 | }, | 326 | }, |
327 | + created() { | ||
328 | + this.loadFrom(); | ||
329 | + }, | ||
318 | methods: { | 330 | methods: { |
331 | + loadFrom() { | ||
332 | + getAllWarehouseList().then((res) => { | ||
333 | + if (res.success) { | ||
334 | + this.allWarehouseList = res.result | ||
335 | + } | ||
336 | + }); | ||
337 | + }, | ||
338 | + solutionWarehouse(value) { | ||
339 | + var actions = [] | ||
340 | + Object.keys(this.allWarehouseList).some((key) => { | ||
341 | + if (this.allWarehouseList[key].code == ('' + value)) { | ||
342 | + actions.push(this.allWarehouseList[key].name) | ||
343 | + return true | ||
344 | + } | ||
345 | + }) | ||
346 | + return actions.join('') | ||
347 | + }, | ||
319 | getAvatarView: function (avatar) { | 348 | getAvatarView: function (avatar) { |
320 | return getFileAccessHttpUrl(avatar) | 349 | return getFileAccessHttpUrl(avatar) |
321 | }, | 350 | }, |
322 | - | ||
323 | batchFrozen: function (status) { | 351 | batchFrozen: function (status) { |
324 | if (this.selectedRowKeys.length <= 0) { | 352 | if (this.selectedRowKeys.length <= 0) { |
325 | this.$message.warning('请选择一条记录!'); | 353 | this.$message.warning('请选择一条记录!'); |
ant-design-vue-jeecg/src/views/system/modules/UserModal.vue
@@ -251,11 +251,11 @@ export default { | @@ -251,11 +251,11 @@ export default { | ||
251 | this.departIdShow = false; | 251 | this.departIdShow = false; |
252 | } | 252 | } |
253 | 253 | ||
254 | - if (record.hasOwnProperty("id")) { | ||
255 | - that.getUserRoles(record.id); | ||
256 | - that.getWarehouse(record.id); | ||
257 | - that.getUserDeparts(record.id); | ||
258 | - } | 254 | + // if (record.hasOwnProperty("id")) { |
255 | + // that.getUserRoles(record.id); | ||
256 | + // that.getWarehouse(record.id); | ||
257 | + // that.getUserDeparts(record.id); | ||
258 | + // } | ||
259 | console.log('that.model=', that.model) | 259 | console.log('that.model=', that.model) |
260 | }, | 260 | }, |
261 | isDisabledAuth(code) { | 261 | isDisabledAuth(code) { |
huaheng-wms-core/src/main/java/org/jeecg/modules/system/entity/SysUser.java
1 | package org.jeecg.modules.system.entity; | 1 | package org.jeecg.modules.system.entity; |
2 | 2 | ||
3 | import java.io.Serializable; | 3 | import java.io.Serializable; |
4 | +import java.util.Arrays; | ||
4 | import java.util.Date; | 5 | import java.util.Date; |
6 | +import java.util.List; | ||
5 | 7 | ||
6 | import org.jeecg.common.aspect.annotation.Dict; | 8 | import org.jeecg.common.aspect.annotation.Dict; |
7 | import org.jeecgframework.poi.excel.annotation.Excel; | 9 | import org.jeecgframework.poi.excel.annotation.Excel; |
8 | import org.springframework.format.annotation.DateTimeFormat; | 10 | import org.springframework.format.annotation.DateTimeFormat; |
9 | 11 | ||
10 | import com.baomidou.mybatisplus.annotation.IdType; | 12 | import com.baomidou.mybatisplus.annotation.IdType; |
13 | +import com.baomidou.mybatisplus.annotation.TableField; | ||
11 | import com.baomidou.mybatisplus.annotation.TableId; | 14 | import com.baomidou.mybatisplus.annotation.TableId; |
12 | import com.baomidou.mybatisplus.annotation.TableLogic; | 15 | import com.baomidou.mybatisplus.annotation.TableLogic; |
13 | import com.fasterxml.jackson.annotation.JsonFormat; | 16 | import com.fasterxml.jackson.annotation.JsonFormat; |
@@ -189,4 +192,14 @@ public class SysUser implements Serializable { | @@ -189,4 +192,14 @@ public class SysUser implements Serializable { | ||
189 | 192 | ||
190 | /** 设备id uniapp推送用 */ | 193 | /** 设备id uniapp推送用 */ |
191 | private String clientId; | 194 | private String clientId; |
195 | + | ||
196 | + @TableField(exist = false) | ||
197 | + private List<String> selectedWarehouses; | ||
198 | + | ||
199 | + public void setSelectedWarehouse(String selectedWarehouse) { | ||
200 | + if (selectedWarehouse != null) { | ||
201 | + this.selectedWarehouse = selectedWarehouse; | ||
202 | + this.selectedWarehouses = Arrays.asList(selectedWarehouse.split(",")); | ||
203 | + } | ||
204 | + } | ||
192 | } | 205 | } |