From be70055b4213fac14ae8da31e447c91ab5aea7fe Mon Sep 17 00:00:00 2001 From: lizhenhua <1075222162@qq.com> Date: Thu, 7 Aug 2025 13:12:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9F=BA=E6=9C=AC=E9=85=8D=E7=BD=AE=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=20=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/canteen/dish/dish/index.vue | 8 ++++++-- src/views/canteen/superstore/shopMaterial/index.vue | 4 ++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/views/canteen/dish/dish/index.vue b/src/views/canteen/dish/dish/index.vue index 70d67069..0ee5ce27 100644 --- a/src/views/canteen/dish/dish/index.vue +++ b/src/views/canteen/dish/dish/index.vue @@ -1370,7 +1370,11 @@ }, /** 删除按钮操作 */ handleDelete(row) { - this.$modal + if (Number(row.hasInventory) === 1) { + this.$modal.msgWarning("该物料仍有库存,无法删除!"); + return; + } + this.$modal .confirm("是否确认删除数据项?") .then(function () { return removeMenuDishesApi({dishesId:row.dishesId}); @@ -1379,7 +1383,7 @@ this.$modal.msgSuccess("删除成功"); this.getList(); }) - .catch(() => {}); + .catch(() => {}); }, handleSelectionChange(selection){ this.batchIds = [] diff --git a/src/views/canteen/superstore/shopMaterial/index.vue b/src/views/canteen/superstore/shopMaterial/index.vue index 8fa94476..e5ec28a1 100644 --- a/src/views/canteen/superstore/shopMaterial/index.vue +++ b/src/views/canteen/superstore/shopMaterial/index.vue @@ -583,6 +583,10 @@ export default { /** 删除按钮操作 */ handleDelete(row) { + if (Number(row.hasInventory) === 1) { + this.$modal.msgWarning("该物料仍有库存,无法删除!"); + return; + } this.$modal .confirm("是否确认删除数据项?") .then(function () {