|
@@ -185,7 +185,9 @@ export default {
|
|
|
const id = row.id
|
|
|
getSelectById(id).then(response => {
|
|
|
const obj = response.data;
|
|
|
- this.getList({id:row.parentId})
|
|
|
+ if(row.parentId && obj.parentId != 0){
|
|
|
+ this.getList({id:row.parentId})
|
|
|
+ }
|
|
|
this.$nextTick(() => {
|
|
|
this.$set(this.form, 'id', obj.id);
|
|
|
this.$set(this.form, 'name', obj.name);
|
|
@@ -194,7 +196,7 @@ export default {
|
|
|
this.$set(this.form, 'mobile', obj.mobile);
|
|
|
this.$set(this.form, 'allowWithdraw', obj.allowWithdraw);
|
|
|
this.$set(this.form, 'parentName', obj.parentName);
|
|
|
- this.$set(this.form, 'parentId', obj.parentId);
|
|
|
+ this.$set(this.form, 'parentId', obj.parentId && obj.parentId != 0 ? obj.parentId : null);
|
|
|
this.$set(this.form, 'salePerson', obj.salePerson);
|
|
|
});
|
|
|
});
|
|
@@ -210,7 +212,10 @@ export default {
|
|
|
if (valid) {
|
|
|
try {
|
|
|
this.loading = true;
|
|
|
- const { code } = await saveAndEdit({ ...this.form });
|
|
|
+ const { code } = await saveAndEdit({
|
|
|
+ ...this.form,
|
|
|
+ parentId: this.form.parentId && this.form.parentId != 0 ? this.form.parentId : 0
|
|
|
+ });
|
|
|
if (code === 200) {
|
|
|
this.$message.success("操作成功!");
|
|
|
this.$emit("getList");
|
|
@@ -235,6 +240,8 @@ export default {
|
|
|
this.$set(this.form, 'contact', '');
|
|
|
this.$set(this.form, 'mobile', '');
|
|
|
this.$set(this.form, 'password', '');
|
|
|
+ this.$set(this.form, 'parentId', '');
|
|
|
+ this.$set(this.form, 'salePerson', '');
|
|
|
},
|
|
|
/**
|
|
|
* 关闭弹框
|