企业编辑

This commit is contained in:
邓皓元 2018-12-17 15:39:36 +08:00
parent d5ccdd08d0
commit 65470ba161

View File

@ -8,7 +8,7 @@ export default {
}, },
data: { data: {
type: Object, type: Object,
default() { default () {
return null; return null;
} }
} }
@ -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');