完成部门选择和人员选择页面新规则
This commit is contained in:
parent
82ba6ddbd7
commit
69fd096c4d
@ -402,10 +402,15 @@
|
||||
class="flex flex-col"
|
||||
>
|
||||
<div
|
||||
v-if="index === 0 && allCheckedList.length == 0"
|
||||
v-if="
|
||||
index === 0 &&
|
||||
allCheckedList.length == 0 &&
|
||||
state.chooseMode === 2
|
||||
"
|
||||
class="divider"
|
||||
></div>
|
||||
<div
|
||||
v-if="state.chooseMode === 2"
|
||||
class="flex items-center justify-between mt-[36rpx] font-medium text-[#000000] leading-[40rpx] mb-[34rpx]"
|
||||
>
|
||||
<div class="text-[28rpx] ml-[10rpx] flex">
|
||||
@ -429,7 +434,7 @@
|
||||
></customBtn>
|
||||
</div>
|
||||
</div>
|
||||
<div class="divider"></div>
|
||||
<div class="divider" v-if="state.chooseMode === 2"></div>
|
||||
</div>
|
||||
</div>
|
||||
</scroll-view>
|
||||
@ -465,6 +470,7 @@ const {
|
||||
crumbsIndex,
|
||||
depCheckedKeys,
|
||||
getDepMembers,
|
||||
memberDepCheckedKeys,
|
||||
membersCheckedKeys,
|
||||
allChooseMembers,
|
||||
} = useGroupTypeStore()
|
||||
@ -851,14 +857,18 @@ const handleConfirm = async () => {
|
||||
})
|
||||
if (res.status == 0 && res.data?.data?.length) {
|
||||
res.data?.data.forEach((v) => {
|
||||
listT.push(v)
|
||||
// 检查是否已存在相同 ID 的成员
|
||||
if (!listT.some((item) => item.ID === v.ID)) {
|
||||
listT.push(v)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
allChooseMembers.value = listT
|
||||
memberDepCheckedKeys.value = lodash.cloneDeep(allCheckedList.value) // 存储人员选择模式下的部门
|
||||
} else {
|
||||
depCheckedKeys.value = lodash.cloneDeep(allCheckedList.value) // 存储部门选择模式下的部门
|
||||
}
|
||||
depCheckedKeys.value = lodash.cloneDeep(allCheckedList.value)
|
||||
console.log('depCheckedKeys', depCheckedKeys.value)
|
||||
uni.navigateBack()
|
||||
}
|
||||
|
||||
@ -897,8 +907,8 @@ const init = async () => {
|
||||
}
|
||||
|
||||
if (state.chooseMode === 2) {
|
||||
// 恢复部门选中状态,但只显示父部门
|
||||
depCheckedKeys.value.forEach((item) => {
|
||||
// 恢复人员选择模式下的部门状态,但只显示父部门
|
||||
memberDepCheckedKeys.value.forEach((item) => {
|
||||
const node = findNodeById(depTreeMyList.value[0], item.ID)
|
||||
if (node) {
|
||||
node.checkStatus = 'checked'
|
||||
|
@ -22,8 +22,9 @@ export const useGroupTypeStore = createGlobalState(() => {
|
||||
const departmentAllPositions = ref([]) //部门下所有岗位
|
||||
const crumbs = ref([])
|
||||
const crumbsIndex = ref(0)
|
||||
const depCheckedKeys = ref([]) // 选中的部门keys
|
||||
const depCheckedKeys = ref([]) // 部门选择模式下,选中的部门keys
|
||||
const groupAdmins = ref([]) // 选中的管理员
|
||||
const memberDepCheckedKeys = ref([]) // 人员选择模式下,选中的部门keys
|
||||
const membersCheckedKeys = ref([]) // 选中的人员keys
|
||||
const allChooseMembers = ref([])
|
||||
|
||||
@ -63,6 +64,7 @@ export const useGroupTypeStore = createGlobalState(() => {
|
||||
crumbsIndex.value = 0
|
||||
depCheckedKeys.value = []
|
||||
groupAdmins.value = []
|
||||
memberDepCheckedKeys.value = []
|
||||
membersCheckedKeys.value = []
|
||||
allChooseMembers.value = []
|
||||
}
|
||||
@ -132,6 +134,7 @@ export const useGroupTypeStore = createGlobalState(() => {
|
||||
createDepGroup,
|
||||
getDepMembers,
|
||||
membersCheckedKeys,
|
||||
memberDepCheckedKeys,
|
||||
allChooseMembers,
|
||||
getDepartmentPositionsById,
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user