| | |
| | | class="shift-dropdown"> |
| | | <div class="shift-box" |
| | | :class="{ |
| | | 'shift-box-early': m.shift === '早班', |
| | | 'shift-box-mid': m.shift === '中班', |
| | | 'shift-box-night': m.shift === '夜班', |
| | | 'shift-box-early': m.shift && m.shift.includes('早班'), |
| | | 'shift-box-mid': m.shift && m.shift.includes('中班'), |
| | | 'shift-box-night': m.shift && m.shift.includes('夜班'), |
| | | 'shift-box-rest': !m.shift || m.shift === '休息', |
| | | 'shift-box-leave': m.shift === '请假', |
| | | 'shift-box-other': m.shift === '夜11', |
| | |
| | | </div> |
| | | <template #dropdown> |
| | | <el-dropdown-menu> |
| | | <el-dropdown-item v-for="(n, j) in classType" |
| | | <el-dropdown-item v-for="(n, j) in getRowClassType(item)" |
| | | :key="'h' + j" |
| | | :command="n.id">{{ n.shift || '—' |
| | | }}</el-dropdown-item> |
| | |
| | | if (!schedulingQuery.deptId) return classType.value || []; |
| | | return (classType.value || []).filter(item => { |
| | | if (["998", "999"].includes(String(item?.id))) return true; |
| | | const itemDeptId = item.deptId ?? item.sysDeptId ?? item.dept_id; |
| | | const itemDeptId = item.sysDeptId ?? item.deptId ?? item.dept_id; |
| | | return String(itemDeptId) === String(schedulingQuery.deptId); |
| | | }); |
| | | }); |
| | | |
| | | // 格子内改班次时,按该员工的部门过滤可选班次(避免不同部门的同名班次混淆) |
| | | const getRowClassType = row => { |
| | | const list = classType.value || []; |
| | | const staffId = row?.userId ?? row?.user_id ?? row?.id; |
| | | const staff = (personListAll.value || []).find( |
| | | item => String(item.id) === String(staffId) |
| | | ); |
| | | const deptId = staff?.sysDeptId ?? staff?.deptId ?? staff?.dept_id; |
| | | if (!deptId) return list; |
| | | return list.filter(item => { |
| | | if (["998", "999"].includes(String(item?.id))) return true; |
| | | const itemDeptId = item.sysDeptId ?? item.deptId ?? item.dept_id; |
| | | return String(itemDeptId) === String(deptId); |
| | | }); |
| | | }; |
| | | |
| | | // 列表数据 |
| | | const listForm = ref([]); |
| | |
| | | const node = findDeptNodeById(schedulingQuery.deptId); |
| | | const deptIds = new Set(collectDeptIds(node)); |
| | | personList.value = (personListAll.value || []).filter(item => { |
| | | const itemDeptId = item.deptId ?? item.sysDeptId ?? item.dept_id; |
| | | const itemDeptId = item.sysDeptId ?? item.deptId ?? item.dept_id; |
| | | return deptIds.has(String(itemDeptId)) && !isEmployeeBlockedByLeaveDate(item); |
| | | }); |
| | | }; |