From dec4a044b8bad975db4e69e63b47bb0b95685767 Mon Sep 17 00:00:00 2001 From: jjLv <1981429112@qq.com> Date: Fri, 8 Nov 2024 15:52:42 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E7=AB=99=E7=82=B9=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/material/basic/siteConfig/index.vue | 242 ++-- src/views/material/basic/unitType/index.vue | 301 ++-- src/views/material/ma/partType/index.vue | 1251 ++++++++--------- 3 files changed, 919 insertions(+), 875 deletions(-) diff --git a/src/views/material/basic/siteConfig/index.vue b/src/views/material/basic/siteConfig/index.vue index 4213459d..2ff52e23 100644 --- a/src/views/material/basic/siteConfig/index.vue +++ b/src/views/material/basic/siteConfig/index.vue @@ -1,53 +1,57 @@ diff --git a/src/views/material/ma/partType/index.vue b/src/views/material/ma/partType/index.vue index 367d7c46..915415fc 100644 --- a/src/views/material/ma/partType/index.vue +++ b/src/views/material/ma/partType/index.vue @@ -1,120 +1,110 @@ + 取 消 + + + + + + \ No newline at end of file From ce21f53e0e690989c68d0a574efe02e02705b35e Mon Sep 17 00:00:00 2001 From: jjLv <1981429112@qq.com> Date: Fri, 8 Nov 2024 16:13:43 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E7=AB=99=E7=82=B9=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/material/basic/siteConfig/index.vue | 28 +- .../material/ma/typeConfigKeeper/index.vue | 533 +++++++++--------- 2 files changed, 291 insertions(+), 270 deletions(-) diff --git a/src/views/material/basic/siteConfig/index.vue b/src/views/material/basic/siteConfig/index.vue index 2ff52e23..4fa25567 100644 --- a/src/views/material/basic/siteConfig/index.vue +++ b/src/views/material/basic/siteConfig/index.vue @@ -4,6 +4,13 @@
库管员配置 + 保存库管员配置 - 保存库管员配置
维修员配置 + 保存维修员配置 - 保存维修员配置
diff --git a/src/views/material/ma/typeConfigKeeper/index.vue b/src/views/material/ma/typeConfigKeeper/index.vue index 2110d2ed..8d6d0832 100644 --- a/src/views/material/ma/typeConfigKeeper/index.vue +++ b/src/views/material/ma/typeConfigKeeper/index.vue @@ -16,7 +16,7 @@ />
-
组织人员树
+
组织人员树
-
物资类型树
+
物资类型树
- + > + - + > + - + > + - + > + - +
@@ -248,7 +248,7 @@ import { import { bindKeeper, noBindKeeper, - getKeeperIds + getKeeperIds, } from "@/api/ma/typeConfigKeeper"; import { getUserList } from "@/api/basic/basic"; import { getInfo } from "@/api/login"; @@ -270,9 +270,9 @@ export default { showSearch: true, // 总条数 total: 0, - totalTemp:0, + totalTemp: 0, countTemp: 1, - totalAll:0, + totalAll: 0, // 库管员用户数据 keeperList: null, keeperDataRange: [], @@ -318,20 +318,20 @@ export default { children: "children", label: "label", }, - roleIdsTemp:[], - userList:[], - userNoList:[], + roleIdsTemp: [], + userList: [], + userNoList: [], userIdTemp: -1, typeIdTemp: -1, - maxLength:100,//已选列表上限,防止数据过多请求报错 + maxLength: 100, //已选列表上限,防止数据过多请求报错 // 查询参数 queryParams: { typeName: "", level: 0, pageNum: 1, pageSize: 10, - displayBindRelationship:true, - houseId:"", + displayBindRelationship: true, + houseId: "", // phonenumber: undefined, // status: undefined, // typeId: undefined @@ -343,8 +343,8 @@ export default { afterPrice: "", useDate: "", }, - isAllSelect:false, - selectionRows:[], + isAllSelect: false, + selectionRows: [], }; }, // mounted(){ @@ -362,13 +362,12 @@ export default { }, created() { // this.getInfo() - this.getTreeData(); - this.getTreeDataTwo(); + this.getTreeData(); + this.getTreeDataTwo(); // this.getKeeperDataList(); // setTimeout(()=>{ // this.getList(); // },200) - }, methods: { // getInfo() { @@ -377,22 +376,22 @@ export default { // this.companyId = res.user.companyId // }) // }, - selectFirstNode(){ - const firstNode = this.$refs.treeTwo.getNode(1); - if(firstNode){ - this.queryParams.typeId = firstNode.id - this.queryParams.level = 0 - this.queryParams.houseId = firstNode.id - this.$refs.treeTwo.setChecked(firstNode,true); - } - }, + selectFirstNode() { + const firstNode = this.$refs.treeTwo.getNode(1); + if (firstNode) { + this.queryParams.typeId = firstNode.id; + this.queryParams.level = 0; + this.queryParams.houseId = firstNode.id; + this.$refs.treeTwo.setChecked(firstNode, true); + } + }, - renderConent(h, { node }) { - let iconClass = ''; + renderConent(h, { node }) { + let iconClass = ""; // 根据 node 的类型判断图标 if (node.data.level == 99) { - iconClass = 'el-icon-user-solid'; - } + iconClass = "el-icon-user-solid"; + } // else if (node.type === 'file') { // iconClass = 'el-icon-document'; // } @@ -402,10 +401,8 @@ export default { {node.label} ); - }, - /** 查询物资类型 */ async getKeeperDataList(data) { let keepdataRes = await queryKeeperDataApi({ @@ -444,40 +441,44 @@ export default { this.form.keeperDataPro = this.keeperProRange.value; }, /** 查询新增页面-上级类型下拉树结构 */ - async getTreeData() {; - const itemName = 'ku_guan_role_ids' - await getKeeperIds(itemName).then((response) =>{ - const roleIds = response.rows[0].itemValue.split(',').map(item => Number(item)) - this.roleIdsTemp = roleIds - }) - await getUserList({ roleIds: this.roleIdsTemp}).then(response => { - this.treeOptions = response.data + async getTreeData() { + const itemName = "ku_guan_role_ids"; + await getKeeperIds(itemName).then((response) => { + const roleIds = response.rows[0].itemValue + .split(",") + .map((item) => Number(item)); + this.roleIdsTemp = roleIds; + }); + await getUserList({ roleIds: this.roleIdsTemp }).then((response) => { + this.treeOptions = response.data; }); }, /** 查询新增页面-上级类型下拉树结构 */ - async getTreeDataTwo() { - getMaTypeList().then((response) => { - this.treeOptionsTwo = response.data - if(this.treeOptionsTwo.length>0 && this.treeOptionsTwo[0].children.length>0){ - const firstNode = this.treeOptionsTwo[0].children[0]; - this.queryParams.typeId = firstNode.id - this.queryParams.level = 1 - this.queryParams.houseId = firstNode.houseId - this.getList(); - } - }) - + async getTreeDataTwo() { + getMaTypeList().then((response) => { + this.treeOptionsTwo = response.data; + if ( + this.treeOptionsTwo.length > 0 && + this.treeOptionsTwo[0].children.length > 0 + ) { + const firstNode = this.treeOptionsTwo[0].children[0]; + this.queryParams.typeId = firstNode.id; + this.queryParams.level = 1; + this.queryParams.houseId = firstNode.houseId; + this.getList(); + } + }); }, /** 查询列表 */ - async getList() { - this.loading = true - this.queryParams.displayBindRelationship="true"; - console.log('queryParams1',this.queryParams) - await getListByMaType(this.queryParams).then((response) => { - this.typeList = response.data.rows - this.total = response.data.total - this.loading = false - }) + async getList() { + this.loading = true; + this.queryParams.displayBindRelationship = "true"; + console.log("queryParams1", this.queryParams); + await getListByMaType(this.queryParams).then((response) => { + this.typeList = response.data.rows; + this.total = response.data.total; + this.loading = false; + }); }, // 筛选节点 - 左侧树 filterNode(value, data) { @@ -493,22 +494,22 @@ export default { }, // 筛选节点 - 左侧树 filterNodeTwo(value, data) { - if (!value) return true - return data.label.indexOf(value) !== -1 - }, - // 节点单击事件 - 左侧树 - async handleNodeClickTwo(data,node) { - if(data.level==0){ - this.queryParams.typeId = data.id - this.queryParams.level = data.level - this.queryParams.houseId = data.id - }else{ - this.queryParams.typeId = data.id - this.queryParams.level = data.level - this.queryParams.houseId = data.houseId - } - this.handleQuery() - }, + if (!value) return true; + return data.label.indexOf(value) !== -1; + }, + // 节点单击事件 - 左侧树 + async handleNodeClickTwo(data, node) { + if (data.level == 0) { + this.queryParams.typeId = data.id; + this.queryParams.level = data.level; + this.queryParams.houseId = data.id; + } else { + this.queryParams.typeId = data.id; + this.queryParams.level = data.level; + this.queryParams.houseId = data.houseId; + } + this.handleQuery(); + }, // 取消按钮 cancel() { @@ -545,108 +546,131 @@ export default { this.handleQuery(); }, - // 多选框选中数据 handleSelectionChange(selection) { - this.userList=[]; - this.userNoList=[]; - this.selectionRows = selection, - this.ids = selection.map((item) =>item.typeId); + this.userList = []; + this.userNoList = []; + (this.selectionRows = selection), + (this.ids = selection.map((item) => item.typeId)); - selection.forEach(item=>{ - this.userList.push({'typeId':item.typeId,'userId':this.userIdTemp}) - }) - selection.forEach(item=>{ - if(item.keeperUserId!=null){ - this.userNoList.push({'typeId':item.typeId,'userId':item.keeperUserId}) + selection.forEach((item) => { + this.userList.push({ typeId: item.typeId, userId: this.userIdTemp }); + }); + selection.forEach((item) => { + if (item.keeperUserId != null) { + this.userNoList.push({ + typeId: item.typeId, + userId: item.keeperUserId, + }); } - - }) + }); this.single = selection.length != 1; this.multiple = !selection.length; - }, - //单选操作-跨页 - handlerSelect(val, row) { - const index = this.userList.findIndex(item=>item.typeId===row.typeId); - if(this.ids.indexOf(row.typeId) === -1){ - this.userList.push({'typeId':row.typeId,'userId':this.userIdTemp}) - }else if(index!== -1){ - this.userList.splice(index,1); - } - const indexNo = this.userNoList.findIndex(item=>item.typeId===row.typeId); - if(this.ids.indexOf(row.typeId) === -1){ - this.userNoList.push({'typeId':row.typeId,'userId':row.keeperUserId}) - }else if(indexNo!== -1){ - this.userNoList.splice(indexNo,1); - } - }, + //单选操作-跨页 + handlerSelect(val, row) { + const index = this.userList.findIndex( + (item) => item.typeId === row.typeId + ); + if (this.ids.indexOf(row.typeId) === -1) { + this.userList.push({ typeId: row.typeId, userId: this.userIdTemp }); + } else if (index !== -1) { + this.userList.splice(index, 1); + } + const indexNo = this.userNoList.findIndex( + (item) => item.typeId === row.typeId + ); + if (this.ids.indexOf(row.typeId) === -1) { + this.userNoList.push({ typeId: row.typeId, userId: row.keeperUserId }); + } else if (indexNo !== -1) { + this.userNoList.splice(indexNo, 1); + } + }, - //全选操作-跨页 - handlerSelectAll(val) { - if (val.length) { - // 进来此处说明: - // 1 当前页的全选 2 其他页有数据然后当前页的取消全选 - // 比较全选或者取消全选与当前页的数据,得到差集 - // 如果tableData中的数据在val中不存在,则说明是取消全选,需要从currentSelection中移除 - // 如果tableData中所有的数据都在val中存在,则说明是全选,需要将差集添加到currentSelection中 - const isAllSelect = this.tableData.every(item => - val.some(valItem => valItem.typeId === item.typeId) - ) - if (isAllSelect) { - // 全选中新增的差集 - const diff = val.filter( - item => !this.userList.some(user => user.typeId === item.typeId) - ) - if (this.userList.length + diff.length > this.maxLength) { - const spaceLeft = this.maxLength - this.userList.length - const toAdd = diff.slice(0,spaceLeft) - this.userList = this.userList.concat(toAdd.map(item =>({ - typeId:item.typeId, - userId:this.userIdTemp - }))); - diff.slice(spaceLeft).forEach(item => this.$refs.multipleTable.toggleRowSelection(item, false)) - } else { - this.userList = this.userList.concat(diff.map(item=>({ - typeId:item.typeId, - userId:this.userIdTemp - }))) - } - - // 全选中新增的差集 - const diffNo = val.filter( - item => !this.userNoList.some(user => user.typeId === item.typeId) - ) - if (this.userNoList.length + diff.length > this.maxLength) { - const spaceLeft = this.maxLength - this.userNoList.length - const toAdd = diff.slice(0,spaceLeft) - this.userNoList = this.userNoList.concat(toAdd.map(item =>({ - typeId:item.typeId, - userId:item.userId - }))); - diff.slice(spaceLeft).forEach(item => this.$refs.multipleTable.toggleRowSelection(item, false)) - } else { - this.userNoList = this.userNoList.concat(diff.map(item=>({ - typeId:item.typeId, - userId:item.userId - }))) - } - } else { - this.userList = this.userList.filter( - user => !this.tableData.some(item => item.typeId === user.typeId) - ) - this.userNoList = this.userNoList.filter( - user => !this.tableData.some(item => item.typeId === user.typeId) - ) - } + //全选操作-跨页 + handlerSelectAll(val) { + if (val.length) { + // 进来此处说明: + // 1 当前页的全选 2 其他页有数据然后当前页的取消全选 + // 比较全选或者取消全选与当前页的数据,得到差集 + // 如果tableData中的数据在val中不存在,则说明是取消全选,需要从currentSelection中移除 + // 如果tableData中所有的数据都在val中存在,则说明是全选,需要将差集添加到currentSelection中 + const isAllSelect = this.tableData.every((item) => + val.some((valItem) => valItem.typeId === item.typeId) + ); + if (isAllSelect) { + // 全选中新增的差集 + const diff = val.filter( + (item) => !this.userList.some((user) => user.typeId === item.typeId) + ); + if (this.userList.length + diff.length > this.maxLength) { + const spaceLeft = this.maxLength - this.userList.length; + const toAdd = diff.slice(0, spaceLeft); + this.userList = this.userList.concat( + toAdd.map((item) => ({ + typeId: item.typeId, + userId: this.userIdTemp, + })) + ); + diff + .slice(spaceLeft) + .forEach((item) => + this.$refs.multipleTable.toggleRowSelection(item, false) + ); } else { - // 进来此处说明: - // 其他页并无勾选数据,且当前页取消勾选 - this.userList = [] - this.userNoList = [] + this.userList = this.userList.concat( + diff.map((item) => ({ + typeId: item.typeId, + userId: this.userIdTemp, + })) + ); } - }, + + // 全选中新增的差集 + const diffNo = val.filter( + (item) => + !this.userNoList.some((user) => user.typeId === item.typeId) + ); + if (this.userNoList.length + diff.length > this.maxLength) { + const spaceLeft = this.maxLength - this.userNoList.length; + const toAdd = diff.slice(0, spaceLeft); + this.userNoList = this.userNoList.concat( + toAdd.map((item) => ({ + typeId: item.typeId, + userId: item.userId, + })) + ); + diff + .slice(spaceLeft) + .forEach((item) => + this.$refs.multipleTable.toggleRowSelection(item, false) + ); + } else { + this.userNoList = this.userNoList.concat( + diff.map((item) => ({ + typeId: item.typeId, + userId: item.userId, + })) + ); + } + } else { + this.userList = this.userList.filter( + (user) => + !this.tableData.some((item) => item.typeId === user.typeId) + ); + this.userNoList = this.userNoList.filter( + (user) => + !this.tableData.some((item) => item.typeId === user.typeId) + ); + } + } else { + // 进来此处说明: + // 其他页并无勾选数据,且当前页取消勾选 + this.userList = []; + this.userNoList = []; + } + }, // handleSelect(selection, row) { // this.toggleSelection(selection, row); // }, @@ -654,57 +678,55 @@ export default { // this.isAllSelect = !this.isAllSelect; // let data = this.typeList; // this.toggleSelect(data,this.isAllSelect,'all'); - + // }, - // //选择某行 - // selectTr(selection,row){ - // this.$set(row,'isChecked',!row.isChecked); - // this.$nextTick(()=>{ - // this.isAllSelect = row.isChecked; - // this.toggleSelect(row,row.isChecked,'tr'); - // }); - // }, + // //选择某行 + // selectTr(selection,row){ + // this.$set(row,'isChecked',!row.isChecked); + // this.$nextTick(()=>{ + // this.isAllSelect = row.isChecked; + // this.toggleSelect(row,row.isChecked,'tr'); + // }); + // }, - // //递归子级 - // toggleSelect(data,flag,type){ - // if(type === 'all'){ - // if(data.length > 0){ - // data.forEach(item=>{ - // this.toggleSelection(item, flag); - // if(item.children && item.children.length > 0){ - // this.toggleSelect(item.children,flag,type) - // } - // }) - // } - // }else { - // if(data.children && data.children.length > 0){ - // data.children.forEach(item =>{ - // item.isChecked = !item.isChecked; - // this.$refs.multipleTable.toggleRowSelection(item, flag); - // this.toggleSelect(item,flag,type); - // }) - // } - // } - // }, - - - // //改变选中 - // toggleSelection(row, flag) { - // this.$set(row,'isChecked',flag); - // this.$nextTick(()=>{ - // if (flag) { - // this.$refs.multipleTable.toggleRowSelection(row, flag); - // } else { - // this.$refs.multipleTable.clearSelection(); - // } - // }); - // }, + // //递归子级 + // toggleSelect(data,flag,type){ + // if(type === 'all'){ + // if(data.length > 0){ + // data.forEach(item=>{ + // this.toggleSelection(item, flag); + // if(item.children && item.children.length > 0){ + // this.toggleSelect(item.children,flag,type) + // } + // }) + // } + // }else { + // if(data.children && data.children.length > 0){ + // data.children.forEach(item =>{ + // item.isChecked = !item.isChecked; + // this.$refs.multipleTable.toggleRowSelection(item, flag); + // this.toggleSelect(item,flag,type); + // }) + // } + // } + // }, + // //改变选中 + // toggleSelection(row, flag) { + // this.$set(row,'isChecked',flag); + // this.$nextTick(()=>{ + // if (flag) { + // this.$refs.multipleTable.toggleRowSelection(row, flag); + // } else { + // this.$refs.multipleTable.clearSelection(); + // } + // }); + // }, /** 绑定按钮操作 */ handleBind() { - console.log('ids----',this.ids) + console.log("ids----", this.ids); if (this.userIdTemp == -1) { this.$alert("未勾选绑定人,无法绑定", "提示", { type: "warning", @@ -712,21 +734,21 @@ export default { }); return; } - if (this.ids.length == 0) { - this.$alert("未进行勾选相关物资,无法绑定", "提示", { - type: "warning", - confirmButtonText: "确定", - }); - return; - } else { - const ids = this.ids.join(","); - } - console.log('userList',this.userList) + if (this.ids.length == 0) { + this.$alert("未进行勾选相关物资,无法绑定", "提示", { + type: "warning", + confirmButtonText: "确定", + }); + return; + } else { + const ids = this.ids.join(","); + } + console.log("userList", this.userList); bindKeeper(this.userList).then((response) => { this.$modal.msgSuccess("绑定成功"); this.ids = null; this.userList = null; - this.userIdTemp = -1 + this.userIdTemp = -1; this.getTreeData(); this.getList(); this.$refs.multipleTable.clearSelection(); @@ -741,16 +763,16 @@ export default { confirmButtonText: "确定", }); return; - }else{ - noBindKeeper(this.userNoList).then((response) => { - this.$modal.msgSuccess("解绑成功"); - this.ids = null; - this.userList = null; - this.userNoList= null; - this.getTreeData(); - this.getList(); - this.$refs.multipleTable.clearSelection(); - }); + } else { + noBindKeeper(this.userNoList).then((response) => { + this.$modal.msgSuccess("解绑成功"); + this.ids = null; + this.userList = null; + this.userNoList = null; + this.getTreeData(); + this.getList(); + this.$refs.multipleTable.clearSelection(); + }); } }, /** 修改按钮操作 */ @@ -773,7 +795,7 @@ export default { userTwo.push({ typeId: typeId, userId: userId, - }) + }); noBindKeeper(userTwo).then((response) => { this.$modal.msgSuccess("解绑成功"); this.getList(); @@ -822,8 +844,8 @@ export default { /** 导出按钮操作 */ handleExport() { - let queryTemp = this.queryParams; - queryTemp.level = 0; + let queryTemp = this.queryParams; + queryTemp.level = 0; this.download( "/material/ma_type/export4Keeper", { @@ -832,7 +854,6 @@ export default { `物资类型信息_${new Date().getTime()}.xlsx` ); }, - }, }; @@ -854,11 +875,11 @@ export default { } } .grid-content { - border-radius: 4px; - min-height: 24px; + border-radius: 4px; + min-height: 24px; } .bg-purple-dark { - background: #e5e9f2; + background: #e5e9f2; } ::v-deep .el-tree .el-tree-node__expand-icon.expanded { From 5d2a0e272b8d19e77b7bc90a341b9a2e4a9f7776 Mon Sep 17 00:00:00 2001 From: jjLv <1981429112@qq.com> Date: Fri, 8 Nov 2024 17:27:11 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E7=AB=99=E7=82=B9=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/ma/typeConfigKeeper.js | 17 +- src/views/material/basic/siteConfig/index.vue | 129 ++--- src/views/material/ma/partType/index.vue | 17 +- .../material/ma/typeConfigKeeper/index.vue | 2 +- .../material/ma/typeConfigRepair/index.vue | 442 +++++++++--------- 5 files changed, 331 insertions(+), 276 deletions(-) diff --git a/src/api/ma/typeConfigKeeper.js b/src/api/ma/typeConfigKeeper.js index 96e58079..01884b52 100644 --- a/src/api/ma/typeConfigKeeper.js +++ b/src/api/ma/typeConfigKeeper.js @@ -30,9 +30,9 @@ export function bindKeeper(data) { // 库管员管理--绑定 export function noBindKeeper(data) { return request({ - url: '/material/ma_type_keeper', - method: 'delete', - data: data, + url: '/material/ma_type_keeper', + method: 'delete', + data: data, }) } @@ -41,6 +41,15 @@ export function getKeeperIds(itemName) { return request({ url: '/material/bm_config/list/', method: 'get', - params:{"itemName":itemName}, + params: { "itemName": itemName }, + }) +} + +//修改库管员树的角色数组 +export function updateBmConfig(data) { + return request({ + url: '/material/bm_config', + method: 'post', + data: data, }) } \ No newline at end of file diff --git a/src/views/material/basic/siteConfig/index.vue b/src/views/material/basic/siteConfig/index.vue index 4fa25567..e543f902 100644 --- a/src/views/material/basic/siteConfig/index.vue +++ b/src/views/material/basic/siteConfig/index.vue @@ -4,52 +4,60 @@
库管员配置 - 保存库管员配置 - - + + + {{ item.roleName }} + + + +
+ 保存库管员配置 - {{ item.roleKey }} - - +
维修员配置 - 保存维修员配置 - - + - {{ item.roleKey }} - - + + {{ item.roleName }} + + + +
+ 保存维修员配置 +
@@ -103,7 +111,7 @@ @@ -711,11 +733,11 @@ export default { } } .grid-content { - border-radius: 4px; - min-height: 24px; + border-radius: 4px; + min-height: 24px; } .bg-purple-dark { - background: #e5e9f2; + background: #e5e9f2; } ::v-deep .el-tree .el-tree-node__expand-icon.expanded {