From 25f9cc1095285073fd3bab0e2c883b124ea01b99 Mon Sep 17 00:00:00 2001 From: 15386982806 Date: Thu, 21 Mar 2024 18:51:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BC=96=E8=BE=91=E5=BA=97?= =?UTF-8?q?=E9=93=BA=E5=85=A5=E5=8F=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manager/src/views/seller/shop/shopOperation.vue | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/manager/src/views/seller/shop/shopOperation.vue b/manager/src/views/seller/shop/shopOperation.vue index 4c6837e0..1eb0fc3f 100644 --- a/manager/src/views/seller/shop/shopOperation.vue +++ b/manager/src/views/seller/shop/shopOperation.vue @@ -708,7 +708,7 @@ export default { params.settlementCycle = this.settlementCycle; if (this.shopId) { delete params.memberId; - shopEdit(this.shopId, params).then((res) => { + shopEdit(this.shopId, this.filterFun(params)).then((res) => { if (res.success) { this.$Message.success("编辑成功"); this.$router.push({ name: "shopList" }); @@ -720,7 +720,7 @@ export default { this.$Message.error("请选择开店的会员"); return; } - shopAdd(params).then((resp) => { + shopAdd(this.filterFun(params)).then((resp) => { if (resp.success) { this.$Message.success("添加成功"); this.shopForm = {}; @@ -731,6 +731,15 @@ export default { } }); }, + // 筛选值为空的参数 + filterFun (params) { + Object.entries(params).map(value => { + if (!value[1] || value[1] === '' || value[1] === 'null') { + delete params[value[0]]; + } + }); + return params; + }, // 点击定位获取店铺地址 getAddress(val) { if (val.type === 'select') { @@ -765,9 +774,6 @@ export default { this.$set(this.shopForm, "companyAddressPath", val.data.addr); this.$set(this.shopForm, "companyAddressIdPath", val.data.addrId); } - - console.log(this.shopForm.storeAddressPath) - } }, // 全部选中