From 96b6565272a83e948e81981c0bd2f4b3d87b77e5 Mon Sep 17 00:00:00 2001 From: paulGao Date: Fri, 2 Sep 2022 11:12:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=95=86=E5=93=81=E8=A7=84?= =?UTF-8?q?=E6=A0=BC=E7=BC=96=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/goods/goods-seller/goodsOperationSec.vue | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/seller/src/views/goods/goods-seller/goodsOperationSec.vue b/seller/src/views/goods/goods-seller/goodsOperationSec.vue index ae9a2580..9054742b 100644 --- a/seller/src/views/goods/goods-seller/goodsOperationSec.vue +++ b/seller/src/views/goods/goods-seller/goodsOperationSec.vue @@ -289,8 +289,6 @@ @@ -311,7 +309,7 @@ size="small" style="margin-left: 10px" type="primary" - @click="handleCloseSkuValue(val, index)" + @click="handleCloseSkuValue(val, index, item)" > 删除 @@ -1494,14 +1492,18 @@ export default { this.renderTableData(this.skuTableData); }, /** 移除当前规格值 */ - handleCloseSkuValue(item, index) { + handleCloseSkuValue(item, index, spec) { + if (spec.spec_values.length <= 1) { + this.$Message.error("至少保留一个规格值!"); + return; + } this.skuInfo.forEach((i) => { - if (i.name === item.name) { + if (i.name === spec.name) { i.spec_values.splice(index, 1); } }); this.skuTableData = this.skuTableData.filter( - (e) => e[item.name] !== item.value + (e) => e[spec.name] !== item.value ); this.baseInfoForm.regeneratorSkuFlag = true; },