1.新增排班时间管理页面及其对接接口
2.对接排班人员列表接口 3.修改部分样式
This commit is contained in:
@ -72,6 +72,7 @@
|
||||
<renyuanguanliDialog
|
||||
v-model:manageAttendDialogVisible="manageAttendDialogVisible"
|
||||
@confirm="handleAttendConfirm"
|
||||
:personnel-list="paibanRenYuanList"
|
||||
/>
|
||||
|
||||
<!-- 编辑排班弹窗 -->
|
||||
@ -107,13 +108,49 @@
|
||||
<script setup lang="ts">
|
||||
import infoBox from '@/views/integratedManage/attendManage/components/infoBox.vue'
|
||||
import attendTrend from '@/views/integratedManage/attendManage/components/attendTrend.vue'
|
||||
import todayAttend from '@/views/integratedManage/attendManage/components/leftBox/todayAttend.vue'
|
||||
import approval from '@/views/integratedManage/attendManage/components/leftBox/approval.vue'
|
||||
import calendar from '@/views/integratedManage/attendManage/components/leftBox/calendar.vue'
|
||||
import todayAttend from '@/views/integratedManage/attendManage/components/rightBox/todayAttend.vue'
|
||||
import approval from '@/views/integratedManage/attendManage/components/rightBox/approval.vue'
|
||||
import calendar from '@/views/integratedManage/attendManage/components/rightBox/calendar.vue'
|
||||
import totalView from '@/views/integratedManage/attendManage/components/totalView.vue'
|
||||
import renyuanpaiban from '@/views/integratedManage/attendManage/components/renyuanpaiban.vue'
|
||||
import renyuanguanliDialog from '@/views/integratedManage/attendManage/components/renyuanguanliDialog.vue'
|
||||
import { ref } from 'vue';
|
||||
import { getPaibanRenYuanList } from '@/api/renyuan/paiban';
|
||||
import { ref, onMounted } from 'vue';
|
||||
// 导入用户store
|
||||
import { useUserStore } from '@/store/modules/user';
|
||||
|
||||
// 排班人员列表
|
||||
const paibanRenYuanList = ref([]);
|
||||
|
||||
// 获取排班人员列表
|
||||
const fetchPaibanRenYuanList = async (deptId?: string) => {
|
||||
try {
|
||||
// 如果没有提供deptId,默认使用当前登录用户的部门ID
|
||||
const targetDeptId = deptId || userStore.deptId;
|
||||
if (!targetDeptId) {
|
||||
console.warn('未提供部门ID,无法获取排班人员列表');
|
||||
return;
|
||||
}
|
||||
const response = await getPaibanRenYuanList(targetDeptId);
|
||||
// 格式化人员列表数据,确保每个人员对象包含label和value属性
|
||||
paibanRenYuanList.value = response.data?.map((user: any) => ({
|
||||
label: user.nickName || user.userName || '未知用户',
|
||||
value: user.userId || user.id || ''
|
||||
})) || [];
|
||||
|
||||
console.log('获取排班人员列表成功:', paibanRenYuanList.value);
|
||||
} catch (error) {
|
||||
console.error('获取排班人员列表失败:', error);
|
||||
// 错误情况下提供模拟数据,确保功能可用
|
||||
paibanRenYuanList.value = [
|
||||
{ label: '张三', value: '1' },
|
||||
{ label: '李四', value: '2' },
|
||||
{ label: '王五', value: '3' },
|
||||
{ label: '赵六', value: '4' },
|
||||
{ label: '钱七', value: '5' }
|
||||
];
|
||||
}
|
||||
};
|
||||
|
||||
// 人员排班弹窗
|
||||
const manageAttendDialogVisible = ref(false);
|
||||
@ -329,6 +366,13 @@ const calendarData = ref({
|
||||
});
|
||||
|
||||
|
||||
// 初始化用户store
|
||||
const userStore = useUserStore();
|
||||
|
||||
onMounted(() => {
|
||||
fetchPaibanRenYuanList(String(userStore.deptId));
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
Reference in New Issue
Block a user