协同宣发
This commit is contained in:
@@ -38,6 +38,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { mapState } from "vuex";
|
||||||
export default {
|
export default {
|
||||||
name: "selectDeptUser",
|
name: "selectDeptUser",
|
||||||
appName: "选择人员",
|
appName: "选择人员",
|
||||||
@@ -54,7 +55,8 @@ export default {
|
|||||||
computed: {
|
computed: {
|
||||||
hasData() {
|
hasData() {
|
||||||
return this.treeList?.length > 0 || this.userList?.length > 0
|
return this.treeList?.length > 0 || this.userList?.length > 0
|
||||||
}
|
},
|
||||||
|
...mapState(['user'])
|
||||||
},
|
},
|
||||||
onLoad(o) {
|
onLoad(o) {
|
||||||
this.selected = uni.getStorageSync('selectDeptUser') || []
|
this.selected = uni.getStorageSync('selectDeptUser') || []
|
||||||
@@ -66,7 +68,15 @@ export default {
|
|||||||
return !!this.selected.find(e => e.id == id && e.corpId == corpId)
|
return !!this.selected.find(e => e.id == id && e.corpId == corpId)
|
||||||
},
|
},
|
||||||
getAllDepts() {
|
getAllDepts() {
|
||||||
this.$http.post('/app/wxcp/wxdepartment/listAllByCorp').then((res) => {
|
// 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()
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
|
||||||
|
this.$http.post(`/app/wxcp/wxdepartment/listAll?wxMainDepartmentId=${this.user.wxMainDepartmentId}`).then((res) => {
|
||||||
if (res?.data) {
|
if (res?.data) {
|
||||||
let parents = res.data.map(e => e.parentid)
|
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.allData = res.data.map(e => ({...e, hasChildren: parents.includes(e.id), isChecked: this.isSelected(e.id, e.corpId)}))
|
||||||
@@ -75,7 +85,8 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
deptInit() {
|
deptInit() {
|
||||||
this.treeList = this.allData.filter(e => !e.parentid)
|
// this.treeList = this.allData.filter(e => !e.parentid)
|
||||||
|
this.treeList = this.allData
|
||||||
this.selectDeptPath = [{name: "可选范围", id: ''}]
|
this.selectDeptPath = [{name: "可选范围", id: ''}]
|
||||||
},
|
},
|
||||||
itemClick({id, name, corpId}) {
|
itemClick({id, name, corpId}) {
|
||||||
|
|||||||
Reference in New Issue
Block a user