From 9e541ffffea22c8d42ceea2cf77793b9496e71da Mon Sep 17 00:00:00 2001 From: shaoyong Date: Mon, 18 Mar 2024 17:03:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=BA=E5=91=98=E7=BA=BF=E4=BD=93=E7=BB=91?= =?UTF-8?q?=E5=AE=9A=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/quality/material/index.vue | 18 +++++++++--------- src/views/quality/material/userbind.vue | 22 +++++++++++++--------- 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/src/views/quality/material/index.vue b/src/views/quality/material/index.vue index 5ab80c5a..d76812fc 100644 --- a/src/views/quality/material/index.vue +++ b/src/views/quality/material/index.vue @@ -78,8 +78,8 @@ - - + + @@ -212,11 +212,10 @@ export default { }, // 多选框选中数据 handleSelectionChange(selection) { - this.ids = selection.map(item => item.userCode) - this.names = selection.map(item => item.userName) - this.handleCode = names.toString(); - this.single = selection.length!==1 - this.multiple = !selection.length + this.ids = selection.map(item => item.userCode); + this.names = selection.map(item => item.userName); + this.single = selection.length!==1; + this.multiple = !selection.length; }, /** 新增按钮操作 */ @@ -228,8 +227,9 @@ export default { /** 绑定按钮操作 */ handleUpdate(row) { this.reset(); - const userCodes = row.userCode || this.ids; - const userNames = row.userName || this.names; + let userCodes = row.userCode || this.ids; + let userNames = row.userName || this.names; + this.handleCode = this.ids.toString(); this.form.userCodes = userCodes; this.form.userNames = userNames; this.open = true; diff --git a/src/views/quality/material/userbind.vue b/src/views/quality/material/userbind.vue index 5efc4e74..fe27368c 100644 --- a/src/views/quality/material/userbind.vue +++ b/src/views/quality/material/userbind.vue @@ -136,8 +136,8 @@ export default { queryParams: { pageNum: 1, pageSize: 10, - userCodes: this.userCodes, - userNames: this.userNames, + userCodes: null, + userNames: null, itemId: null, itemCode: null, materialName: null, @@ -165,8 +165,8 @@ export default { leftLength: null, leftQueryParams: { materialName: null, - userCodes: this.userCodes, - userNames: this.userNames, + userCodes: null, + userNames: null, pageNum: 1, pageSize: 20, }, @@ -179,8 +179,8 @@ export default { RNextPage: null, rightQueryParams: { materialName: null, - userCodes: this.userCodes, - userNames: this.userNames, + userCodes: null, + userNames: null, pageNum: 1, pageSize: 20, }, @@ -226,6 +226,7 @@ export default { /** 查询未分配产品列表 */ getList() { this.loading = true; + this.leftQueryParams.userCodes = this.userCodes; getListProduct(this.leftQueryParams).then((response) => { this.LPages = Math.ceil(response.total / this.LPageSize); this.leftList = response.rows; @@ -253,6 +254,7 @@ export default { /** 查询已分配产品列表 -------------------------------*/ getRightListFun() { this.loading = true; + this.rightQueryParams.userCodes = this.userCodes; getRightList(this.rightQueryParams).then((response) => { this.RPages = Math.ceil(response.total / this.RPageSize); @@ -290,8 +292,8 @@ export default { reset() { this.form = { recordId: null, - userCode: this.userCodes, - userName: this.userNames, + userCode: null, + userName: null, itemId: null, itemCode: null, materialName: null, @@ -310,7 +312,9 @@ export default { /** 提交按钮 */ handleChange(value, direction, movedKeys) { - if (this.queryParams.userCodes != null) { + this.queryParams.userCodes = this.userCodes; + this.queryParams.userNames = this.userNames; + if (this.queryParams.userCodes !== null) { this.queryParams.selectedValues = value; addProduct(this.queryParams).then((response) => { this.$modal.msgSuccess("关联成功");