|
|
|
@ -488,7 +488,7 @@ import quill from "@/components/quill"; |
|
|
|
|
import MyTree from "@/components/myTree/src/tree"; |
|
|
|
|
import { deepCopy } from "@/utils/deepCopy"; |
|
|
|
|
import { mapState } from 'vuex' |
|
|
|
|
|
|
|
|
|
import _ from 'lodash' |
|
|
|
|
export default { |
|
|
|
|
components: { quill, MyTree }, |
|
|
|
|
data () { |
|
|
|
@ -554,7 +554,7 @@ export default { |
|
|
|
|
SelectedObj: [], |
|
|
|
|
counts: 0, |
|
|
|
|
loading: true, |
|
|
|
|
moneys: [100, 50, 20, 10, 5, 1, 0.5, 0.1] |
|
|
|
|
moneys: [100, 50, 20, 10, 5, 1, 0.5, 0.1], |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
computed: { |
|
|
|
@ -568,6 +568,7 @@ export default { |
|
|
|
|
localStorage.setItem('token', atob(decodeURI(token))) |
|
|
|
|
localStorage.setItem('referrer', atob(decodeURI(referrer))) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (this.isSt) { |
|
|
|
|
this.leftSymbols = [ |
|
|
|
|
{ |
|
|
|
@ -626,38 +627,25 @@ export default { |
|
|
|
|
this.tableData.forEach(async (item, index) => { |
|
|
|
|
item.i = index |
|
|
|
|
// 勾选树节点 |
|
|
|
|
//let lists = JSON.parse(JSON.stringify(this.treeData)) |
|
|
|
|
// let lists = this.treeData |
|
|
|
|
if (item.operationIds) { |
|
|
|
|
let list = JSON.parse(JSON.stringify(this.treeData)) |
|
|
|
|
let list = _.cloneDeep(this.treeData) |
|
|
|
|
item.operationIData = [] |
|
|
|
|
let findOut = null |
|
|
|
|
let testObj = {} |
|
|
|
|
for (let i = 0; i < list.length; i++) { |
|
|
|
|
const id = item.operationIds.split(',') |
|
|
|
|
if (list[i].id == id[0]) { |
|
|
|
|
findOut = this.filterRule(id, list, testObj) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
item.operationIData.push(testObj.children[0]) |
|
|
|
|
} |
|
|
|
|
// 根据题目id,获取题目信息 |
|
|
|
|
if (item.isSubject && item.type && item.type != 4 && item.emptyOne) { |
|
|
|
|
// await this.getSubjectData(item.emptyOne, index); |
|
|
|
|
let result = {} |
|
|
|
|
let serial = 0 |
|
|
|
|
this.handleRule(item.operationIds.split(','), list, result, serial) |
|
|
|
|
item.operationIData.push(result.children[0]) |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
this.setIndex() |
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
this.loading = false |
|
|
|
|
}) |
|
|
|
|
console.log("🚀 ~ file: Transaction.vue:646 ~ this.tableData.forEach ~ this.tableData:", this.treeData) |
|
|
|
|
} else { |
|
|
|
|
this.$message.warning(res.message); |
|
|
|
|
this.loading = false |
|
|
|
|
} |
|
|
|
|
}).catch(err => { |
|
|
|
|
this.loading = false |
|
|
|
|
// console.log(err); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
// 获取业务 |
|
|
|
@ -685,11 +673,12 @@ export default { |
|
|
|
|
handleSelectionChange (val) { |
|
|
|
|
this.multipleSelection = val |
|
|
|
|
}, |
|
|
|
|
filterRule (id, obj = [], needObj) { |
|
|
|
|
let first = id.shift() |
|
|
|
|
let tmp = obj.find(item => item.id == first) |
|
|
|
|
needObj.children = obj.filter(item => item.id == first) |
|
|
|
|
if (tmp) return this.filterRule(id, tmp.children, needObj.children.length ? needObj.children[0] : []) |
|
|
|
|
handleRule (id, list, result, serial) { |
|
|
|
|
const curId = id[serial] |
|
|
|
|
const cur = list.find(e => e.id == curId) |
|
|
|
|
result.children = cur ? [cur] : [] |
|
|
|
|
++serial |
|
|
|
|
cur && cur.children && this.handleRule(id, cur.children, result.children[0], serial) |
|
|
|
|
}, |
|
|
|
|
//计算此节点的距离思路1.计算出当前节点据顶部的高度+当前节点在树的位置的高度-盒子高度的一半 |
|
|
|
|
scrollToDepTree (deptCode) { |
|
|
|
@ -721,17 +710,13 @@ export default { |
|
|
|
|
this.getSubjectData(item.subjectId, index); |
|
|
|
|
} |
|
|
|
|
if (item.operationIds) { |
|
|
|
|
let list = JSON.parse(JSON.stringify(this.treeData)) |
|
|
|
|
let list = _.cloneDeep(this.treeData) |
|
|
|
|
item.operationIData = [] |
|
|
|
|
let testObj = {} |
|
|
|
|
let findOut = null |
|
|
|
|
for (let i = 0; i < list.length; i++) { |
|
|
|
|
let id = item.operationIds.split(',') |
|
|
|
|
if (list[i].id == id[0]) { |
|
|
|
|
findOut = this.filterRule(id, list, testObj) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
testObj.children && item.operationIData.push(testObj.children[0]) |
|
|
|
|
|
|
|
|
|
let result = {} |
|
|
|
|
let serial = 0 |
|
|
|
|
this.handleRule(item.operationIds.split(','), list, result, serial) |
|
|
|
|
result.children && item.operationIData.push(result.children[0]) |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
this.setIndex() |
|
|
|
@ -891,7 +876,6 @@ export default { |
|
|
|
|
this.$set(this.tableData, index, item); |
|
|
|
|
} |
|
|
|
|
}).catch(err => { |
|
|
|
|
// console.log(err); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
@ -956,7 +940,6 @@ export default { |
|
|
|
|
const name = this.isSt ? 'recordChildren' : 'children' |
|
|
|
|
let result = []; |
|
|
|
|
data.forEach(item => { |
|
|
|
|
// console.log("🚀 ~ file: Transaction.vue:866 ~ toTreeId ~ name:", item[name]) |
|
|
|
|
item.label = item.name |
|
|
|
|
if (item.isNode === 0) { |
|
|
|
|
item.showCheckbox = false; |
|
|
|
@ -986,9 +969,7 @@ export default { |
|
|
|
|
} else { |
|
|
|
|
this.isNameRepeat = true; |
|
|
|
|
} |
|
|
|
|
}).catch(err => { |
|
|
|
|
// console.log(err); |
|
|
|
|
}); |
|
|
|
|
}).catch(err => { }); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
saveAll () { // 保存判分点 |
|
|
|
@ -1078,9 +1059,7 @@ export default { |
|
|
|
|
} else { |
|
|
|
|
this.$message.warning(res.message); |
|
|
|
|
} |
|
|
|
|
}).catch(err => { |
|
|
|
|
// console.log(err); |
|
|
|
|
}); |
|
|
|
|
}).catch(err => { }); |
|
|
|
|
} else if (this.isEdit) { // 编辑判分点 |
|
|
|
|
this.$post(this.api.updateJudgmentPoint, this.formData).then(res => { |
|
|
|
|
if (res.status === 200) { |
|
|
|
@ -1089,9 +1068,7 @@ export default { |
|
|
|
|
} else { |
|
|
|
|
this.$message.warning(res.message); |
|
|
|
|
} |
|
|
|
|
}).catch(err => { |
|
|
|
|
// console.log(err); |
|
|
|
|
}); |
|
|
|
|
}).catch(err => { }); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 新增判分点 |
|
|
|
|