diff --git a/src/views/quality/material/index.vue b/src/views/quality/material/index.vue index 5ab80c5..d76812f 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 5efc4e7..fe27368 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("关联成功");