|
@@ -63,9 +63,12 @@ export default {
|
|
|
const oldform = this.$refs.ruleForm.baseForm
|
|
|
let newForm = { ...oldform }
|
|
|
let apiStr = 'admintegralruleadd'
|
|
|
- if (newForm.id) apiStr = 'admintegralruleedit'
|
|
|
+ if (this.curObj.id) {
|
|
|
+ apiStr = 'admintegralruleedit'
|
|
|
+ newForm.id = this.curObj.id
|
|
|
+ }
|
|
|
this.$api.user[apiStr](newForm).then(data => {
|
|
|
- this.$msgs(newForm.id ? '编辑成功' : '新增成功')
|
|
|
+ this.$msgs(this.curObj.id ? '编辑成功' : '新增成功')
|
|
|
this.$emit('close', newForm)
|
|
|
})
|
|
|
}
|