50 lines
1.0 KiB
Vue
50 lines
1.0 KiB
Vue
|
|
<template>
|
||
|
|
<view class="page-main">
|
||
|
|
<liu-folding-panel :dataList="deptList" @change="change"></liu-folding-panel>
|
||
|
|
</view>
|
||
|
|
</template>
|
||
|
|
|
||
|
|
<script>
|
||
|
|
export default {
|
||
|
|
data() {
|
||
|
|
return {
|
||
|
|
deptList: []
|
||
|
|
}
|
||
|
|
},
|
||
|
|
onLoad() {
|
||
|
|
this.getList()
|
||
|
|
},
|
||
|
|
methods: {
|
||
|
|
getList() {
|
||
|
|
// 获取改角色的部门
|
||
|
|
let userInfo = JSON.parse(uni.getStorageSync("userInfo"));
|
||
|
|
this.sendRequest({
|
||
|
|
url: "xmgl/company/getTenantOrgTreeList",
|
||
|
|
data: {
|
||
|
|
userId: userInfo.userId,
|
||
|
|
headquartersSn: uni.getStorageSync("company").headquartersSn
|
||
|
|
},
|
||
|
|
method: "POST",
|
||
|
|
success: (res) => {
|
||
|
|
this.deptList = res.result;
|
||
|
|
}
|
||
|
|
})
|
||
|
|
},
|
||
|
|
change(e) {
|
||
|
|
console.log(e, "点击")
|
||
|
|
if (e.projectSn) {
|
||
|
|
// 可以选择项目
|
||
|
|
let userInfo = JSON.parse(uni.getStorageSync('userInfo'));
|
||
|
|
uni.setStorageSync("dept", e.projectSn);
|
||
|
|
uni.setStorageSync('userInfo', JSON.stringify({
|
||
|
|
...userInfo,
|
||
|
|
sn: e.sn
|
||
|
|
}))
|
||
|
|
uni.showToast({
|
||
|
|
title: "切换成功"
|
||
|
|
})
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
</script>
|