企业编辑
This commit is contained in:
parent
d5ccdd08d0
commit
65470ba161
@ -58,16 +58,9 @@ export default {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let data = new FormData();
|
|
||||||
for (let k in this.params) {
|
|
||||||
if (this.params[k]) {
|
|
||||||
data.append(k, this.params[k]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.data) {
|
if (this.data) {
|
||||||
// 编辑
|
// 编辑
|
||||||
API.update(data, this.data.id).then(res => {
|
API.update(this.params, this.data.id).then(res => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
this.$emit('update-success');
|
this.$emit('update-success');
|
||||||
@ -79,7 +72,7 @@ export default {
|
|||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// 添加
|
// 添加
|
||||||
API.create(data).then(res => {
|
API.create(this.params).then(res => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
this.$emit('add-success');
|
this.$emit('add-success');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user