修改编辑店铺入参

This commit is contained in:
15386982806
2024-03-21 18:51:39 +08:00
parent 85729e3761
commit 25f9cc1095

View File

@@ -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)
}
},
// 全部选中