From 42c92b044f99d12ebbf4e8994910ae52f98006bb Mon Sep 17 00:00:00 2001 From: qyt <123456> Date: Sun, 27 Oct 2024 20:41:32 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E7=89=A9=E8=B5=84=E5=AD=97=E5=85=B8?= =?UTF-8?q?=E7=BB=B4=E6=8A=A4=E5=92=8C=E4=BE=9B=E5=BA=94=E5=95=86=E7=9A=84?= =?UTF-8?q?=E7=89=A9=E8=B5=84=E5=AD=90=E5=AD=97=E5=85=B8=E7=BB=B4=E6=8A=A4?= =?UTF-8?q?=E7=9A=84=E7=BC=96=E8=BE=91=E7=95=8C=E9=9D=A2=E4=BA=A7=E5=93=81?= =?UTF-8?q?=E6=A0=87=E8=AF=86=E9=80=89=E6=8B=A9=E7=BC=96=E8=BE=91=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E7=9A=84=E6=97=B6=E5=80=99=E5=85=B6=E4=BB=96=E7=9A=84?= =?UTF-8?q?=E4=B8=8D=E8=83=BD=E8=BF=9B=E8=A1=8C=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/basic/product/productEdit.vue | 16 +++++++++++----- .../supplier/company/basicCompanyproductEdit.vue | 10 +++++++++- 2 files changed, 20 insertions(+), 6 deletions(-) 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: {