@@ -265,6 +261,7 @@ import { onMounted, ref, watch, reactive, onBeforeMount } from "vue";
import Pagination from "@/components/ProTable/components/Pagination.vue";
import type { FormInstance } from "element-plus";
import { unitPageList, classGroupList, memberCountData, memberPageList, attendancePageList } from "@/api/modules/goverment";
+import dayjs from "dayjs";
const typeOptions = ref([
{ label: "管理", value: 1 },
{ label: "工人", value: 2 }
@@ -298,7 +295,7 @@ const classGroupData = ref([]);
const memberCountInfo = ref({});
const memberListData = ref([]);
const attendanceListData = ref([]);
-const monthColumns: any = [];
+const monthColumns = ref
([]);
const visible1 = ref(false);
const emits = defineEmits(["update:detailsDialog", "confirm"]);
const ruleFormRef = ref();
@@ -306,13 +303,20 @@ const form = ref({});
// 获取人员出勤列表数据
const getAttendanceCountList = async () => {
console.log(form.value);
+ monthColumns.value = [];
let requestData = {
current: pageable.value.pageNo,
size: pageable.value.pageSize,
engineeringSn: form.value.engineeringSn,
...attendaceSearch.value
};
- console.log(666);
+ let month = requestData.month.substring(5);
+ for (let i = 0; i < dayjs(month).daysInMonth(); i++) {
+ monthColumns.value.push({
+ prop: "day" + (i + 1),
+ label: "" + (i + 1)
+ });
+ }
const { result } = await attendancePageList(requestData);
if (result && result.records) {
attendanceListData.value = result.records;
@@ -409,7 +413,7 @@ const handleClick = (tab: any, event: any) => {
} else if (val == "fourth") {
attendaceSearch.value = {
personType: null,
- month: ""
+ month: dayjs(new Date()).format("YYYY-MM")
};
attendanceListData.value = [];
getAttendanceCountList();
@@ -459,7 +463,7 @@ watch(
onBeforeMount(() => {
for (let i = 0; i < 31; i++) {
- monthColumns.push({
+ monthColumns.value.push({
prop: "day" + (i + 1),
label: "" + (i + 1)
});
diff --git a/src/views/goverment/largeScreen/components/center.vue b/src/views/goverment/largeScreen/components/center.vue
index eb8caf5..e834976 100644
--- a/src/views/goverment/largeScreen/components/center.vue
+++ b/src/views/goverment/largeScreen/components/center.vue
@@ -33,7 +33,7 @@ const projectNumber = async () => {