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