|
@@ -100,7 +100,7 @@
|
|
|
/>
|
|
|
|
|
|
<!-- 添加或修改家族成员对话框 -->
|
|
|
- <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body :close-on-click-modal=false>
|
|
|
+ <el-dialog :title="title" v-if="open" :visible.sync="open" width="500px" append-to-body :close-on-click-modal=false>
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
|
|
|
|
<el-form-item label="父辈" prop="parentId">
|
|
@@ -116,6 +116,10 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
|
|
|
+ <el-form-item label="第几代" prop="generation">
|
|
|
+ <el-input v-model="form.generation" type="number" :min="1" placeholder="请输入代数" />
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
<el-form-item label="备注" prop="remark">
|
|
|
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
|
|
</el-form-item>
|
|
@@ -234,12 +238,16 @@ export default {
|
|
|
getList() {
|
|
|
this.loading = true;
|
|
|
listTree(this.queryParams).then(response => {
|
|
|
+ this.reset();
|
|
|
this.memberList = response.rows;
|
|
|
this.total = response.total;
|
|
|
this.loading = false;
|
|
|
if(this.memberList.length <= 0) {
|
|
|
// 家族树没有人时,允许添加第一个人
|
|
|
this.singleAdd = false;
|
|
|
+ this.form.parentId = 0
|
|
|
+ }else {
|
|
|
+ this.singleAdd = true;
|
|
|
}
|
|
|
});
|
|
|
},
|
|
@@ -364,6 +372,7 @@ export default {
|
|
|
this.msgSuccess("保存成功");
|
|
|
this.open = false;
|
|
|
this.getList();
|
|
|
+ this.singleAdd = false;
|
|
|
}
|
|
|
});
|
|
|
}
|
|
@@ -382,6 +391,7 @@ export default {
|
|
|
}).then(() => {
|
|
|
this.getList();
|
|
|
this.msgSuccess("移除成功");
|
|
|
+ this.singleAdd = true;
|
|
|
}).catch(function() {});
|
|
|
},
|
|
|
}
|