From 8633ab58a07f2bb9564dfbc32b2596565cffe272 Mon Sep 17 00:00:00 2001 From: anthonywj Date: Thu, 29 Dec 2022 17:18:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=93=E5=BA=93=E9=83=A8=E9=97=A8=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E7=95=8C=E9=9D=A2=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/system/deptUser.js | 12 +++ src/views/inventory/InvSpaceManage.vue | 108 ++++++++++--------- src/views/system/dept/authDept.vue | 139 ++++++++++++------------- src/views/system/dept/invWarehouse.vue | 108 ++++++++++++------- src/views/system/user/authUser.vue | 70 +++++++++---- vue.config.js | 2 +- 6 files changed, 255 insertions(+), 184 deletions(-) create mode 100644 src/api/system/deptUser.js diff --git a/src/api/system/deptUser.js b/src/api/system/deptUser.js new file mode 100644 index 00000000..2b3a11c7 --- /dev/null +++ b/src/api/system/deptUser.js @@ -0,0 +1,12 @@ +import request from '@/utils/request' + +// 查询部门列表 +export function listDeptUser(query) { + return request({ + url: '/udi/auth/dept/user/filter', + method: 'get', + params: query + }) +} + + diff --git a/src/views/inventory/InvSpaceManage.vue b/src/views/inventory/InvSpaceManage.vue index 14cd173f..d4cd7684 100644 --- a/src/views/inventory/InvSpaceManage.vue +++ b/src/views/inventory/InvSpaceManage.vue @@ -1,60 +1,58 @@ + + + @@ -362,6 +329,8 @@ import {treeList, treeSelectedList} from "@/api/system/dataStatus"; import Treeselect from "@riophae/vue-treeselect"; import "@riophae/vue-treeselect/dist/vue-treeselect.css"; import {selectNotSelectUser} from "@/api/auth/authUser"; +import {listDeptUser} from "@/api/system/deptUser"; +import {filterSubAll} from "@/api/system/invSubWarehouse"; export default { data() { @@ -410,14 +379,13 @@ export default { name: "部门" }, - + //部门用户 userQuery: { key: null, page: 1, limit: 10, }, userlist: [], - userFormVisible: false, userloading: false, userTotal: 0, selectUserList: [], @@ -427,8 +395,18 @@ export default { code: null, page: 1, limit: 10 - } + }, + + //部门仓库 + invQuery: { + key: null, + page: 1, + limit: 10 + }, + invlist: [], + invTotal: 0, + invLoading: false, }; }, filters: { @@ -652,6 +630,8 @@ export default { }, handleDeptChange(row) { this.currentRow = row; + this.onUserSubmit(); + this.onInvSubmit(); }, @@ -659,14 +639,6 @@ export default { handleUserSelectionChange(val) { this.selectAddUser = val; }, - getSelectUser() { - selectNotSelectUser(this.selectUserQuery).then((res) => { - this.selectUserList = res.data.list; - this.selectUserToatl = res.data.total; - }).catch((error) => { - this.$message.error("用户数据加载失败") - }); - }, onUserReset() { this.userQuery = { key: null, @@ -678,23 +650,44 @@ export default { onUserSubmit() { this.getUerList(); }, - onUserSelect(){ - this.userQuery = { - key: null, - page: 1, - limit: 10, - }; - this.getUerList(); - }, - getUerList() { + let query = { + deptId: this.currentRow.id, + }; + listDeptUser(query) + .then((response) => { + this.loading = false; + this.userlist = response.data.list || []; + this.userTotal = response.data.total; + }) + .catch(() => { + this.loading = false; + this.userlist = []; + this.userTotal = 0; + }); - }, - selectUserData(){ }, + //仓库相关 + getInvList() { + let query = { + parentId: this.currentRow.code, + }; + filterSubAll(query) + .then((response) => { + this.loading = false; + this.invlist = response.data || []; + }) + .catch(() => { + this.invlist = false; + this.list = []; + }); + }, + onInvSubmit() { + this.getInvList(); + }, }, components: {Treeselect}, mounted() { diff --git a/src/views/system/dept/invWarehouse.vue b/src/views/system/dept/invWarehouse.vue index b117a505..ea79b1de 100644 --- a/src/views/system/dept/invWarehouse.vue +++ b/src/views/system/dept/invWarehouse.vue @@ -20,6 +20,7 @@ 重置 查询 + 新增 @@ -47,27 +48,6 @@