diff --git a/src/views/modules/part/partCatalogInformation.vue b/src/views/modules/part/partCatalogInformation.vue index 3a414a0..c76d0fe 100644 --- a/src/views/modules/part/partCatalogInformation.vue +++ b/src/views/modules/part/partCatalogInformation.vue @@ -1403,9 +1403,21 @@ } }, + // 清空下方物料属性页签数据 + clearPartItemData () { + this.partItemList = [] + this.copyAttributeList = [] + this.updatePartItemList = [] + this.attributeDialog = true + }, + // ======== 列表数据刷新方法 ======== // 查询物料属性 getMasterPartItem () { + if (!this.partCurrentRow.partNo) { + this.clearPartItemData() + return + } let tempData = { site: this.$store.state.user.site, partNo: this.partCurrentRow.partNo, @@ -1417,7 +1429,7 @@ if (data && data.code === 0) { this.partItemList = data.rows } else { - this.partItemList = [] + this.clearPartItemData() } }) }, @@ -1441,6 +1453,7 @@ this.partClickRow(this.dataList[0]) } else { this.partCurrentRow = {} + this.clearPartItemData() } } }) @@ -1800,6 +1813,15 @@ if (data && data.code === 0){ this.dataList = data.page.list this.totalPage = data.page.totalCount + this.$refs.selectDiv.setLengthAll(this.dataList.length) + if (this.dataList.length > 0) { + this.$refs.partTable.setCurrentRow(this.dataList[0]) + this.partClickRow(this.dataList[0]) + this.refreshCurrentTabTable() + } else { + this.partCurrentRow = {} + this.clearPartItemData() + } }else { this.$message.warning(data.msg) }