master
luoJunYong.123 3 years ago
parent ec36d948f2
commit a8ff72aa41
  1. 23
      src/views/Transaction.vue

@ -425,18 +425,22 @@ export default {
let startId = idArr.shift() let startId = idArr.shift()
let findOut = null let findOut = null
let testObj = null
for(let i=0; i<list.length; i++) { for(let i=0; i<list.length; i++) {
if(list[i].id == startId) { if(list[i].id == startId) {
findOut = this.cxk(idArr, list[i]) testObj = list[i]
findOut = this.cxk(idArr, list[i], testObj)
// item.operationIData.push(findOut) // item.operationIData.push(findOut)
} }
} }
console.log('testObj')
console.log(testObj)
this.operationIData.push(findOut) this.operationIData.push(findOut)
for (let a=0;a<this.operationIData.length;a++){ // for (let a=0;a<this.operationIData.length;a++){
console.log(a+1) // console.log(a+1)
this.operationIData[a].nub = 'aaa' // this.operationIData[a].nub = 'aaa'
} // }
console.log(this.operationIData) // console.log(this.operationIData)
// console.log(item.operationIData) // console.log(item.operationIData)
// this.$nextTick(() => { // this.$nextTick(() => {
// this.$refs[`tree-${index}`].setCheckedKeys([item.operationIds]); // this.$refs[`tree-${index}`].setCheckedKeys([item.operationIds]);
@ -454,14 +458,17 @@ export default {
// console.log(err); // console.log(err);
}); });
}, },
cxk(arr, obj) { cxk(arr, obj, needObj) {
if(arr.length === 0) { if(arr.length === 0) {
return obj return obj
} }
// console.log('arr')
// console.log(arr)
this.operationIData.push(obj) this.operationIData.push(obj)
let findIt = arr.shift() let findIt = arr.shift()
let tmp = obj.children.find(item => item.id == findIt) let tmp = obj.children.find(item => item.id == findIt)
return this.cxk(arr, tmp) needObj.children = obj.children.filter(item => item.id == findIt)
return this.cxk(arr, tmp, needObj.children[0])
}, },
//1.+- //1.+-
scrollToDepTree(deptCode){ scrollToDepTree(deptCode){

Loading…
Cancel
Save