选人!!!!

This commit is contained in:
shijingjing
2023-03-03 15:15:41 +08:00
parent d4a8eaf204
commit 28687d9a01
4 changed files with 316 additions and 32 deletions

View File

@@ -2,15 +2,16 @@
<div class="scopedSelect">
<div class="item">
<div>添加人</div>
<div @click="selectUser">
<div v-if="type == 1" style="display: inline-block;">
<span v-if="deptListArr.length">已选择{{ deptListArr.length }}个部门</span>
<div v-if="type == 1" style="display: inline-block;">
<AiPagePicker type="dept" :selected.sync="deptListArr" @select="getDeptList" nodeKey="id" isRequire="0">
<span class="label" v-if="deptListArr.length">已选择{{ deptListArr.length }}个部门</span>
<span class="color_gray" v-else>请选择</span>
</div>
<div v-if="type == 2" style="display: inline-block;">
<span v-if="selectedUser.length">已选择{{ selectedUser.length }}个网格</span>
<span class="color_gray" v-else>请选择</span>
</div>
<u-icon name="arrow-right" color="#CCD0D3" size="28"/>
</AiPagePicker>
</div>
<div @click="selectUser" v-if="type == 2" style="display: inline-block;">
<span v-if="selectedUser.length">已选择{{ selectedUser.length }}个网格</span>
<span class="color_gray" v-else>请选择</span>
<u-icon name="arrow-right" color="#CCD0D3"></u-icon>
</div>
</div>
@@ -81,29 +82,14 @@ export default {
},
methods: {
...mapActions(['selectEnterpriseContact']),
// 选
// 选网格
selectUser() {
if(this.type == "1") { // 部门
this.getDeptUser()
} else if(this.type == "2") { // 网格
uni.navigateTo({url: `./selectGridMember`})
}
uni.navigateTo({url: `./selectGridMember`})
},
getDeptUser() {
this.selectEnterpriseContact({
fromDepartmentId: 0, // 从最上层开始
mode: "multi", // 多选
type: ["department"],
selectedDepartmentIds: this.deptListArr?.map(e => e.id) // 已选部门ID列表
}).then((res)=>{
if(res?.departmentList) {
this.deptListArr = res.departmentList
uni.setStorageSync('deptList', this.deptListArr)
}
}).catch((err) => {
this.$u.toast(err)
})
// 选部门
getDeptList(e) {
this.deptListArr = e
uni.setStorageSync('deptList', this.deptListArr)
},
// 选择包含、剔除的标签 0包含 1剔除