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 | 115 | :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" |
116 | 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 | 124 | <template slot="avatarslot" slot-scope="text, record"> |
119 | 125 | <div class="anty-img-wrap"> |
120 | 126 | <a-avatar shape="square" :src="getAvatarView(record.avatar)" icon="user"/> |
... | ... | @@ -186,7 +192,7 @@ |
186 | 192 | import UserModal from './modules/UserModal' |
187 | 193 | import PasswordModal from './modules/PasswordModal' |
188 | 194 | import {putAction, getFileAccessHttpUrl} from '@/api/manage'; |
189 | -import {frozenBatch} from '@/api/api' | |
195 | +import {frozenBatch, getAllWarehouseList} from '@/api/api' | |
190 | 196 | import {JeecgListMixin} from '@/mixins/JeecgListMixin' |
191 | 197 | import SysUserAgentModal from "./modules/SysUserAgentModal"; |
192 | 198 | import JInput from '@/components/jeecg/JInput' |
... | ... | @@ -211,6 +217,7 @@ export default { |
211 | 217 | description: '这是用户管理页面', |
212 | 218 | queryParam: {}, |
213 | 219 | recycleBinVisible: false, |
220 | + allWarehouseList: [], | |
214 | 221 | columns: [ |
215 | 222 | /*{ |
216 | 223 | title: '#', |
... | ... | @@ -265,8 +272,10 @@ export default { |
265 | 272 | { |
266 | 273 | title: '所属仓库', |
267 | 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 | 281 | // title: '部门', |
... | ... | @@ -315,11 +324,30 @@ export default { |
315 | 324 | return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; |
316 | 325 | } |
317 | 326 | }, |
327 | + created() { | |
328 | + this.loadFrom(); | |
329 | + }, | |
318 | 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 | 348 | getAvatarView: function (avatar) { |
320 | 349 | return getFileAccessHttpUrl(avatar) |
321 | 350 | }, |
322 | - | |
323 | 351 | batchFrozen: function (status) { |
324 | 352 | if (this.selectedRowKeys.length <= 0) { |
325 | 353 | this.$message.warning('请选择一条记录!'); |
... | ... |
ant-design-vue-jeecg/src/views/system/modules/UserModal.vue
... | ... | @@ -251,11 +251,11 @@ export default { |
251 | 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 | 259 | console.log('that.model=', that.model) |
260 | 260 | }, |
261 | 261 | isDisabledAuth(code) { |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/system/entity/SysUser.java
1 | 1 | package org.jeecg.modules.system.entity; |
2 | 2 | |
3 | 3 | import java.io.Serializable; |
4 | +import java.util.Arrays; | |
4 | 5 | import java.util.Date; |
6 | +import java.util.List; | |
5 | 7 | |
6 | 8 | import org.jeecg.common.aspect.annotation.Dict; |
7 | 9 | import org.jeecgframework.poi.excel.annotation.Excel; |
8 | 10 | import org.springframework.format.annotation.DateTimeFormat; |
9 | 11 | |
10 | 12 | import com.baomidou.mybatisplus.annotation.IdType; |
13 | +import com.baomidou.mybatisplus.annotation.TableField; | |
11 | 14 | import com.baomidou.mybatisplus.annotation.TableId; |
12 | 15 | import com.baomidou.mybatisplus.annotation.TableLogic; |
13 | 16 | import com.fasterxml.jackson.annotation.JsonFormat; |
... | ... | @@ -189,4 +192,14 @@ public class SysUser implements Serializable { |
189 | 192 | |
190 | 193 | /** 设备id uniapp推送用 */ |
191 | 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 | } |
... | ... |