From 6ff0a81561b4507c9a8673a02a61304ca01b64ee Mon Sep 17 00:00:00 2001 From: 77 <77@77.com> Date: Mon, 13 May 2024 00:48:08 +0800 Subject: [PATCH] init --- .../activityShop/add-activity-shop-dialog.vue | 50 ++++++++++--------- .../update-activity-shop-user-dialog.vue | 3 +- 2 files changed, 27 insertions(+), 26 deletions(-) diff --git a/src/views/xq/activityShop/add-activity-shop-dialog.vue b/src/views/xq/activityShop/add-activity-shop-dialog.vue index 93908a3..8b65f11 100644 --- a/src/views/xq/activityShop/add-activity-shop-dialog.vue +++ b/src/views/xq/activityShop/add-activity-shop-dialog.vue @@ -239,30 +239,32 @@ export default { submitForm () { this.$refs['form'].validate((valid) => { if (valid) { - this.buttonLoading = true; - addActivityShop({ - ...this.form, - cityCode: this.getCode(this.form.cityCode), - }).then(data => { - this.$modal.msgSuccess("新增成功"); - this.buttonLoading = false; - this.open = false - this.$emit('refreshDataList') - }).finally(() => { - this.buttonLoading = false; - }); - }else{ - updateActivityShop({ - ...this.form, - cityCode: this.getCode(this.form.cityCode), - }).then(data => { - this.$modal.msgSuccess("修改成功"); - this.buttonLoading = false; - this.open = false - this.$emit('refreshDataList') - }).finally(() => { - this.buttonLoading = false; - }); + if(this.form.id){ + updateActivityShop({ + ...this.form, + cityCode: this.getCode(this.form.cityCode), + }).then(data => { + this.$modal.msgSuccess("修改成功"); + this.buttonLoading = false; + this.open = false + this.$emit('refreshDataList') + }).finally(() => { + this.buttonLoading = false; + }); + }else{ + this.buttonLoading = true; + addActivityShop({ + ...this.form, + cityCode: this.getCode(this.form.cityCode), + }).then(data => { + this.$modal.msgSuccess("新增成功"); + this.buttonLoading = false; + this.open = false + this.$emit('refreshDataList') + }).finally(() => { + this.buttonLoading = false; + }); + } } }) }, diff --git a/src/views/xq/activityShop/update-activity-shop-user-dialog.vue b/src/views/xq/activityShop/update-activity-shop-user-dialog.vue index cc4cb25..5c3e726 100644 --- a/src/views/xq/activityShop/update-activity-shop-user-dialog.vue +++ b/src/views/xq/activityShop/update-activity-shop-user-dialog.vue @@ -53,8 +53,7 @@