This commit is contained in:
77
2024-05-13 00:48:08 +08:00
parent 660fc954eb
commit 6ff0a81561
2 changed files with 27 additions and 26 deletions

View File

@@ -239,30 +239,32 @@ export default {
submitForm () { submitForm () {
this.$refs['form'].validate((valid) => { this.$refs['form'].validate((valid) => {
if (valid) { if (valid) {
this.buttonLoading = true; if(this.form.id){
addActivityShop({ updateActivityShop({
...this.form, ...this.form,
cityCode: this.getCode(this.form.cityCode), cityCode: this.getCode(this.form.cityCode),
}).then(data => { }).then(data => {
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("修改成功");
this.buttonLoading = false; this.buttonLoading = false;
this.open = false this.open = false
this.$emit('refreshDataList') this.$emit('refreshDataList')
}).finally(() => { }).finally(() => {
this.buttonLoading = false; this.buttonLoading = false;
}); });
}else{ }else{
updateActivityShop({ this.buttonLoading = true;
...this.form, addActivityShop({
cityCode: this.getCode(this.form.cityCode), ...this.form,
}).then(data => { cityCode: this.getCode(this.form.cityCode),
this.$modal.msgSuccess("修改成功"); }).then(data => {
this.buttonLoading = false; this.$modal.msgSuccess("新增成功");
this.open = false this.buttonLoading = false;
this.$emit('refreshDataList') this.open = false
}).finally(() => { this.$emit('refreshDataList')
this.buttonLoading = false; }).finally(() => {
}); this.buttonLoading = false;
});
}
} }
}) })
}, },

View File

@@ -53,8 +53,7 @@
<script> <script>
import { enableStatusList } from '@/constant/statusMap' import { enableStatusList } from '@/constant/statusMap'
import { getTreeAreaCode } from '@/api/xq/areaCode' import { getTreeAreaCode } from '@/api/xq/areaCode'
import { addActivityShop, getActivityShop, updateActivityShop, updateActivityShopUser } from '@/api/xq/activityShop' import { getActivityShop, updateActivityShopUser } from '@/api/xq/activityShop'
import { addBanner, getBanner } from '@/api/xq/banner'
export default { export default {
components: { components: {