master
e 3 years ago
parent ed8235ff6a
commit ec22a93db6
  1. 81
      src/views/Transaction.vue

@ -369,10 +369,6 @@ export default {
token: atob(decodeURI(this.$route.query.token)) token: atob(decodeURI(this.$route.query.token))
}); });
this.getTreeData(); this.getTreeData();
if (this.$route.query.lcId) {
this.lcId = this.$route.query.lcId;
this.getInfoData(this.$route.query.lcId);
}
if (this.$route.query.systemId) { if (this.$route.query.systemId) {
this.formData.lcJudgmentPoint.systemId = this.$route.query.systemId; this.formData.lcJudgmentPoint.systemId = this.$route.query.systemId;
} }
@ -389,54 +385,31 @@ export default {
this.anewPosttingData(judgmentRuleList) this.anewPosttingData(judgmentRuleList)
this.tableData.forEach(async (item, index) => { this.tableData.forEach(async (item, index) => {
// //
console.log(item.operationIds)
if (item.operationIds) { if (item.operationIds) {
this.$nextTick(() => { this.$nextTick(() => {
this.$refs[`tree-${index}`].setCheckedKeys([item.operationIds]); this.$refs[`tree-${index}`].setCheckedKeys([item.operationIds]);
let currentNode = this.$refs[`tree-${index}`].getNode([item]); console.log(this.$refs[`tree-${index}`].getCheckedNodes(true))
let parentLevel for (var i=0;i<this.treeData.length;i++){
let nodeCount = 1// if (this.treeData[i].children>0){
let nodeIndex = 1// let children = this.treeData[i].children
let dataIndex; // for (var j=0;j<children.length;j++){
for ( let i=0; i<this.treeData.length; i++){ if (children[j].children>0) {
if(this.treeData[i].children !=null){// let childrens = children[i].children
if(this.treeData[i].children==this.treeData[i].children){ //this.orgListLine[i].orgCodeorgCodethis.orgListLine[i].orgCodeorgCode() }
dataIndex =i }
} }
} }
if(this.treeData[i].children==item.operationIds){ // // let currentNode = this.$refs[`tree-${index}`].getNode([item]);
dataIndex =i // while ( parentLevel>0)//while ( 1!=parentLevel)
} // let dom = document.querySelector("#divTree")
} // let dom1 = document.querySelector("#depTree")
console.log(dataIndex) // //26px,
let topHeight=dataIndex*20;// // let nodeHight =26
if(currentNode){ // dom1.style.height = (nodeCount * nodeHight) + "px"
let currentNodeOrgCode= currentNode&&currentNode.children.operationIds; // let contHeight=(nodeIndex * nodeHight)+topHeight-300//,
//nodeCountnodeIndex // dom.scrollTo(0, contHeight)
do {
currentNode = currentNode.parent
parentLevel = currentNode.level
let childNodes = currentNode.childNodes
nodeCount += childNodes.length
for (let i = 0; i < childNodes.length; i ++) {
if (childNodes[i].data.children == currentNodeOrgCode) {
nodeIndex += (i + 1)
}
}
currentNodeOrgCode = currentNode.children.operationIds
}
while ( parentLevel>0)//while ( 1!=parentLevel)
let dom = document.querySelector("#divTree")
let dom1 = document.querySelector("#depTree")
//26px,
let nodeHight =26
dom1.style.height = (nodeCount * nodeHight) + "px"
let contHeight=(nodeIndex * nodeHight)+topHeight-300//,
dom.scrollTo(0, contHeight)
}
// this.scrollToDepTree(item.operationIds) // this.scrollToDepTree(item.operationIds)
}); })
} }
// id, // id,
if (item.isSubject && item.type && item.type != 4 && item.emptyOne) { if (item.isSubject && item.type && item.type != 4 && item.emptyOne) {
@ -514,6 +487,7 @@ export default {
handleCheckChange(data, checked, indeterminate, row, index) { // handleCheckChange(data, checked, indeterminate, row, index) { //
if (checked && data.isNode === 1) { if (checked && data.isNode === 1) {
this.tableData[index].operationIds = data.id; // id this.tableData[index].operationIds = data.id; // id
// for ()
row.value1 = ""; row.value1 = "";
row.value2 = ""; row.value2 = "";
row.value3 = ""; row.value3 = "";
@ -527,16 +501,19 @@ export default {
row.type = ""; row.type = "";
this.currentNodeData = {}; this.currentNodeData = {};
this.$refs[`tree-${index}`].setCheckedNodes([data]); this.$refs[`tree-${index}`].setCheckedNodes([data]);
} }
} }
}, },
getTreeData() { // getTreeData() { //
this.$get(this.api.getLcRecord).then(res => { this.$get(this.api.getLcRecord).then(res => {
if (res.status === 200 && res.list) { console.log(res)
if (res.list.length) { if (res.status == 200 && res.list.length>0) {
if (res.list.length>0) {
this.treeData = this.toTreeId(res.list, res.list[0].parentId); this.treeData = this.toTreeId(res.list, res.list[0].parentId);
// console.log(this.treeData) if (this.$route.query.lcId) {
this.lcId = this.$route.query.lcId;
this.getInfoData(this.$route.query.lcId);
}
} }
} else { } else {
this.$message.warning(res.message); this.$message.warning(res.message);

Loading…
Cancel
Save