|
@@ -239,8 +239,13 @@ export default {
|
|
|
const nodeListResult = []
|
|
|
this.IteraNodeList(this.list[0].nodeList, nodeListResult, 0)
|
|
|
param.nodeList = nodeListResult
|
|
|
+ const {params,grandson} = this.reparams(param)
|
|
|
+ if(grandson == 0){
|
|
|
+ this.message('增加子项数据后才能保存~');
|
|
|
+ return
|
|
|
+ }
|
|
|
this.saveDisable = true //提交保存按钮不可点击,返回结果时才可点击,防止频繁发送请求
|
|
|
- api.diseaseBaseSave(this.reparams(param)).then((res) => {
|
|
|
+ api.diseaseBaseSave(params).then((res) => {
|
|
|
const { data } = res
|
|
|
if(data.code == '0') {
|
|
|
this.message(res.data.msg||'保存成功','success');
|
|
@@ -291,10 +296,12 @@ export default {
|
|
|
this.list.length>0&&this.excludedConceptIds.push(this.list[0].conceptId)
|
|
|
const params = {
|
|
|
"name": txt,
|
|
|
+ "diseaseName":txt,
|
|
|
"excludedConceptIds": this.excludedConceptIds||[],
|
|
|
"libType": this.addLevel == 0?100:libType&&libType[0]||''
|
|
|
}
|
|
|
- api.searchConcept(params).then((res) => {
|
|
|
+ let searchUrl = this.addLevel == 0?'findDisName':'searchConcept'
|
|
|
+ api[searchUrl](params).then((res) => {
|
|
|
const { data } = res
|
|
|
if(data.code == '0') {
|
|
|
this.conceptList = data.data
|
|
@@ -318,8 +325,11 @@ export default {
|
|
|
data.nodeList.push(newChild);
|
|
|
}
|
|
|
this.conceptList = [];
|
|
|
- this.searchConcept(txt)
|
|
|
- // this.closeSearch();
|
|
|
+ if(this.addLevel == 0){
|
|
|
+ this.closeSearch();
|
|
|
+ }else{
|
|
|
+ this.searchConcept(txt)
|
|
|
+ }
|
|
|
},
|
|
|
openSearch(e) {
|
|
|
this.showSearch = true
|
|
@@ -349,15 +359,18 @@ export default {
|
|
|
nodeList.splice(index, 1);
|
|
|
},
|
|
|
reparams(param){
|
|
|
- let params = []
|
|
|
+ let params = [],grandson = 0;
|
|
|
const tmplis = param.nodeList||[];
|
|
|
for(let i = 0;i < tmplis.length;i++){
|
|
|
- let item = tmplis[i],sonIds=[]
|
|
|
+ let item = tmplis[i],sonIds=[];
|
|
|
if(item.nodeList&&item.nodeList.length>0){
|
|
|
for(let j = 0;j < item.nodeList.length;j++){
|
|
|
sonIds.push(item.nodeList[j].conceptId)
|
|
|
}
|
|
|
}
|
|
|
+ if(sonIds.length > 0){
|
|
|
+ ++grandson
|
|
|
+ }
|
|
|
let obj = {
|
|
|
"sid": param.conceptId,
|
|
|
"rid": item.conceptId,
|
|
@@ -367,7 +380,7 @@ export default {
|
|
|
}
|
|
|
params.push(obj)
|
|
|
}
|
|
|
- return params
|
|
|
+ return {params,grandson}
|
|
|
},
|
|
|
message(msg,type){
|
|
|
this.$message({
|