a9ee7796 by xiaomiao

权籍调登记簿调整

1 parent 794f43d5
......@@ -72,6 +72,8 @@ export default {
//左侧树形结构数据
treedata: [],
sfqdata: [],
keyy: "",
iskey: "",
activeName: 0,
// 查询参数
queryForm: {},
......@@ -167,28 +169,28 @@ export default {
getBdcqljqtsx({
bdcdyid: val.bdcdyid,
bdcdyh: val.bdcdyh,
}).then((res) => {
if (res.code === 200) {
if (this.sfqdata.some((item) => item.bdcdyid === val.bdcdyid)) {
let index= this.sfqdata.findIndex((item) => {
return item.bdcdyid ==val.bdcdyid;
});
this.activeName=index
this.setstyle(index,0);
} else {
this.sfqdata.push(loadsfqData(res.result, val.bdcdyh, val.bdcdyid));
this.activeName = this.sfqdata.length - 1;
this.$nextTick(() => {
this.setstyle(this.sfqdata.length - 1,0);
})
}).then((res) => {
if (res.code === 200) {
if (this.sfqdata.some((item) => item.bdcdyid === val.bdcdyid)) {
let index = this.sfqdata.findIndex((item) => {
return item.bdcdyid == val.bdcdyid;
});
this.activeName = index
this.setstyle(index, 0, this.iskey);
} else {
this.sfqdata.push(loadsfqData(res.result, val.bdcdyh, val.bdcdyid));
this.activeName = this.sfqdata.length - 1;
this.$nextTick(() => {
this.setstyle(this.sfqdata.length - 1, 0, this.iskey);
})
}
}
}
});
});
this.currentSelectProps = {
bdcdyid: val.bdcdyid,
bdcdyh: val.bdcdyh,
qllx: this.formData.qllx,
bsmQlxx: this.formData.bsmQlxx,
qllx: this.currentSelectProps.qllx,
bsmQlxx: this.currentSelectProps.bsmQlxx,
};
},
/**
......@@ -201,9 +203,7 @@ export default {
bdcdyh: val,
}).then((res) => {
if (res.code === 200) {
this.treedata = loadTreeData(
val
);
this.treedata = loadTreeData(val);
this.sfqdata.push(
loadsfqData(res.result, val, this.currentSelectProps.bdcdyid)
);
......@@ -211,14 +211,22 @@ export default {
this.defaultNode = getNode(
this.currentSelectProps.qllx,
{ linShi: 0, xianShi: 0, liShi: 0 },
""
);
this.$refs.tree.setCurrentKey(this.defaultNode.id); //data[0].id为默认选中的节点
this.loadComponent(this.defaultNode.form);
this.setstyle(0,0);
});
}
});
res.result.bdcdylx|| ""
);
this.sfqdata[0].children.forEach((item, index) => {
if (item.id == this.defaultNode.id) {
this.iskey = index
}
})
// this.$refs.tree.setCurrentKey(this.defaultNode.id); //data[0].id为默认选中的节点
// this.loadComponent(this.defaultNode.form);
this.setstyle(0, 0, this.iskey);
});
}
});
this.currentSelectProps = {
bdcdyid: this.currentSelectProps.bdcdyid,
bdcdyh: this.currentSelectProps.bdcdyh,
......@@ -244,35 +252,50 @@ export default {
* @author: renchao
* 设置样式和点击定位到当前功能
*/
setstyle(newindex,index) {
if(index==0){
this.loadComponent(this.$refs.sfq[newindex].$children[0].$attrs.re.form);
}
let dpme = this.$refs.sfq[newindex].$children[0].$el
if (index != 0) {
dpme.style.backgroundColor = "#ffffff";
dpme.style.color = "black";
dpme.style.border = "none";
} else {
dpme.style.backgroundColor = "#f5f5f5";
dpme.style.color = "#0079fe";
dpme.style.borderRight = "4px solid #0079fe";
}
},
setstyle (newindex, index, key) {
if (key != undefined || this.keyy == index) {
if (key != undefined) {
this.keyy = key
}
this.loadComponent(this.$refs.sfq[newindex].$children[this.keyy].$attrs.re.form);
let dpme = this.$refs.sfq[newindex].$children[this.keyy].$el
dpme.style.backgroundColor = "#f5f5f5";
dpme.style.color = "#0079fe";
dpme.style.borderRight = "4px solid #0079fe";
} else {
let dpme = this.$refs.sfq[newindex].$children[this.keyy].$el
dpme.style.backgroundColor = "#ffffff";
dpme.style.color = "black";
dpme.style.border = "none";
}
},
/**
* @description: addlist
* @param {*} data
* @author: renchao
* 新增列表功能
*/
addlist(data, index) {
let newindex= this.sfqdata.findIndex((item) => {
return item.bdcdyid ==data.bdcdyid;
});
this.setstyle(newindex,index);
this.currentSelectProps.bdcdyid = data.bdcdyid;
this.loadComponent(data.form);
},
addlist (data, index) {
if (index != undefined) {
let newindex = this.sfqdata.findIndex((item) => {
return item.bdcdyid == data.bdcdyid;
});
this.setstyle(newindex, index);
this.currentSelectProps.bdcdyid = data.bdcdyid;
this.loadComponent(data.form);
} else {
let newindex = this.sfqdata.findIndex((item) => {
return item.bdcdyid == data.bdcdyid;
});
this.setstyle(newindex, index, this.iskey);
this.currentSelectProps.bdcdyid = data.bdcdyid;
}
},
/**
* @description: loadComponent
* @param {*} form
......