This commit is contained in:
刘仕伟
2022-06-26 12:23:49 +08:00
parent 479f18f469
commit cf01759c58

View File

@@ -72,18 +72,18 @@ export default {
this.treeList = this.allData.filter(e => !e.parentid)
this.selectDeptPath = [{name: "可选范围", id: ''}]
},
itemClick({id, name}) {
let index = this.selectDeptPath.findIndex(e => e.id == id)
itemClick({id, name, corpId}) {
let index = this.selectDeptPath.findIndex(e => e.id == id && e.corpId == corpId)
if (index == -1) {
this.selectDeptPath.push({name, id})
this.getDeptsAndUsersByParent(id)
this.selectDeptPath.push({name, id, corpId})
this.getDeptsAndUsersByParent(id, corpId)
}
},
getDeptsAndUsersByParent(departmentId) {
this.treeList = this.allData.filter(e => e.parentid == departmentId)
getDeptsAndUsersByParent(departmentId, corpId) {
this.treeList = this.allData.filter(e => e.parentid == departmentId && e.corpId == corpId)
this.userList = []
this.$http.post(`/app/wxcp/wxuser/listByDeptId`, null, {
params: {departmentId, status: 1}
params: {departmentId, status: 1, cip: corpId}
}).then(res => {
if (res?.data) {
this.userList = res.data.map(e => ({...e, isChecked: this.isSelected(e.id)}))
@@ -97,7 +97,7 @@ export default {
} else {
let length = this.selectDeptPath.length - index
this.selectDeptPath.splice(index + 1, length)
this.getDeptsAndUsersByParent(row.id)
this.getDeptsAndUsersByParent(row.id, row.corpId)
}
},
itemCheck(row, kind) {