协同宣发

This commit is contained in:
liuye
2023-06-27 14:46:54 +08:00
parent 3817075596
commit 0f2aed7613

View File

@@ -60,13 +60,27 @@ export default {
},
onLoad(o) {
this.selected = uni.getStorageSync('selectDeptUser') || []
this.getAllDepts()
this.type = o.selectTtype.split('?')[0]
if(this.type == 1) { //选择发送范围部门
this.getAllDepts()
}else { //选择审批人
this.getListAll()
}
},
methods: {
isSelected(id, corpId) {
return !!this.selected.find(e => e.id == id && e.corpId == corpId)
},
getListAll() {
this.$http.post('/app/wxcp/wxdepartment/listAllByCorp').then((res) => {
if (res?.data) {
let parents = res.data.map(e => e.parentid)
this.allData = res.data.map(e => ({...e, hasChildren: parents.includes(e.id), isChecked: this.isSelected(e.id, e.corpId)}))
this.deptInit()
}
})
},
getAllDepts() {
// this.$http.post('/app/wxcp/wxdepartment/listAllByCorp').then((res) => {
// if (res?.data) {
@@ -85,8 +99,11 @@ export default {
})
},
deptInit() {
// this.treeList = this.allData.filter(e => !e.parentid)
this.treeList = this.allData
if(this.type == 1) { //选择发送范围部门
this.treeList = this.allData.filter(e => e.id == this.user.wxMainDepartmentId)
}else { //选择审批人
this.treeList = this.allData.filter(e => !e.parentid)
}
this.selectDeptPath = [{name: "可选范围", id: ''}]
},
itemClick({id, name, corpId}) {