From e207c5523882eb313f87b1c185fac500e82a8191 Mon Sep 17 00:00:00 2001 From: wangfukang <15630117759@163.com> Date: Sun, 17 Mar 2024 09:37:03 +0800 Subject: [PATCH] 11 --- pages/inventory/addGoods.vue | 37 ++++++++++++++++++++++++++++++++-- pages/inventory/batchPrint.vue | 1 + 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/pages/inventory/addGoods.vue b/pages/inventory/addGoods.vue index 4338045..8a3ad3b 100644 --- a/pages/inventory/addGoods.vue +++ b/pages/inventory/addGoods.vue @@ -51,8 +51,11 @@ trim="all" /> - - 保存 + + 删除商品 + 保存 + + @@ -220,6 +223,36 @@ } }) + }, + delGoods(){ + let that = this; + if(that.dataList.stockCount == 0 || that.dataList.purchasePrice==null){ + uni.showModal({ + title: "提示", + content: "确定删除此条商品吗?", + success: function(res) { + if(res.confirm){ + that.tui.request('/app/product/edit', "post", { + id:that.dataList.id, + delFlag:0 + }, false, false).then((res1) => { + if (res1.code == 200) { + uni.navigateBack({ + delta: 2 + }) + } else { + uni.showToast({ + title: "删除失败", + icon: 'none' + }) + } + }) + } + } + }) + }else{ + this.tui.toast("您的商品下有库存,不能执行删除操作!") + } }, // 触发提交表单 submit() { diff --git a/pages/inventory/batchPrint.vue b/pages/inventory/batchPrint.vue index b90fd70..3fe7613 100644 --- a/pages/inventory/batchPrint.vue +++ b/pages/inventory/batchPrint.vue @@ -267,6 +267,7 @@ }, //点击打印按钮 goPrint(){ + uni.setStorageSync('small',true) let that = this; for(var i=0;i