| | |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <pagination |
| | | v-if="tableCount > 0" |
| | | :total="tableCount" |
| | | :page="filterForm.current" |
| | | :limit="filterForm.size" |
| | | @pagination="paginationChange" |
| | | /> |
| | | </div> |
| | | |
| | | <!-- 批量操作 --> |
| | |
| | | import {save, del, delByIds, listPage} from "@/api/personnelManagement/scheduling.js" |
| | | import {getStaffOnJob} from "@/api/personnelManagement/onboarding.js"; |
| | | import dayjs from "dayjs"; |
| | | import pagination from "@/components/PIMTable/Pagination.vue"; |
| | | |
| | | const tableCount = ref(0) |
| | | // 响应式数据 |
| | | const scheduleDialog = ref(false) |
| | | const dialogType = ref('add') |
| | |
| | | const filterForm = reactive({ |
| | | staffName: '', |
| | | shiftType: '', |
| | | dateRange: [] |
| | | dateRange: [], |
| | | current:1, |
| | | size: 10 |
| | | }) |
| | | |
| | | // 排班表单 |
| | |
| | | personList.value = res.data |
| | | }) |
| | | }; |
| | | |
| | | const paginationChange = (obj) => { |
| | | filterForm.current = obj.page; |
| | | filterForm.size = obj.limit; |
| | | handleFilter(); |
| | | }; |
| | | |
| | | const handleSelectStaff = (val) => { |
| | | let obj = personList.value.find(item => item.id === val) |
| | |
| | | const handleFilter = async () => { |
| | | tableLoading.value = true |
| | | let searchForm = { |
| | | staffName: filterForm.staffName, |
| | | shiftType: filterForm.shiftType, |
| | | ...filterForm, |
| | | ...(filterForm.dateRange.length > 0 && { |
| | | startDate: filterForm.dateRange[0], |
| | | endDate: filterForm.dateRange[1], |
| | | }) |
| | | } |
| | | let resp = await listPage(searchForm) |
| | | tableCount.value = resp.data.total |
| | | scheduleList.value = resp.data.records.map(it => { |
| | | return { |
| | | ...it, |