diff --git a/src/views/basic/product/productEdit.vue b/src/views/basic/product/productEdit.vue index 2bb39a0..7f6a3a4 100644 --- a/src/views/basic/product/productEdit.vue +++ b/src/views/basic/product/productEdit.vue @@ -1289,7 +1289,7 @@ export default { }, isSave: true, selectedIndex: null, - + editRowSwitch: false //产品标识编辑开关 没保存前其他编辑不能按 } }, @@ -1733,6 +1733,7 @@ export default { this.editQuery = row; }, //层级保存 levelSave(row) { + this.editRowSwitch = false if (isBlank(row.nameCode)) { this.$message.error('层级标识不能为空') return @@ -1787,11 +1788,16 @@ export default { }) }, rowChange(index, val) { - // if (this.selectedIndex != null && this.selectedIndex != index){ - // this.levelSave(val) - // }else - this.selectedIndex = index + + if(this.editRowSwitch == true ){ + this.$message.error('请先保存当前产品标识编辑') + return + } + + console.log("rowChange===",index) + this.selectedIndex = index this.isSave = false + this.editRowSwitch = true }, deleteLevel(index, row) { diff --git a/src/views/supplier/company/basicCompanyproductEdit.vue b/src/views/supplier/company/basicCompanyproductEdit.vue index 88462c0..a090dd8 100644 --- a/src/views/supplier/company/basicCompanyproductEdit.vue +++ b/src/views/supplier/company/basicCompanyproductEdit.vue @@ -786,6 +786,7 @@ export default { ], levelUnitList: [], fromDeptOptions: [], + editRowSwitch: false //产品标识编辑开关 没保存前其他编辑不能按 } }, @@ -1079,6 +1080,7 @@ export default { //层级保存 levelSave(row) { + this.editRowSwitch = false if (isBlank(row.nameCode)) { this.$message.error('层级标识不能为空') return @@ -1119,10 +1121,16 @@ export default { }) }, rowChange(index, val) { + + if(this.editRowSwitch == true ){ + this.$message.error('请先保存当前产品标识编辑') + return + } + console.log("rowChange===",index) this.selectedIndex = index - this.isSave = false + this.editRowSwitch = true }, }, components: {