维保列表去除默认当月筛选

master
2358328281@qq.com 2 months ago
parent 13c66287b2
commit 056acd48b5

@ -120,6 +120,12 @@
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination v-model:current-page="page" v-model:page-size="pageSize" :page-sizes="[10, 20, 50]"
:total="total" layout="total, sizes, prev, pager, next, jumper" @size-change="loadList"
@current-change="loadList" />
</div>
</div>
@ -189,7 +195,7 @@ const hospitals = computed(() => hospitalStore.list);
const filters = reactive({ keyword: undefined });
// 稿
const currentMonth = ref(dayjs());
const currentMonth = ref('');
const currentMonthLabel = computed(() => currentMonth.value.format("YYYY年M月"));
const prevMonth = () => {
currentMonth.value = currentMonth.value.subtract(1, "month");
@ -206,17 +212,20 @@ const formatExpiringDays = (n) => {
const v = Number(n);
return `${v}`;
};
const total = ref(0);
const page = ref(1);
const pageSize = ref(10);
const loadList = async () => {
loading.value = true;
try {
const params = {
page: 1,
pageSize: 200,
page: page.value,
pageSize: pageSize.value,
keyword: filters.keyword || undefined,
category: filters.category || undefined,
year: currentMonth.value.year(),
month: currentMonth.value.month() + 1,
// year: currentMonth.value.year(),
// month: currentMonth.value.month() + 1,
}
if (dateRange.value?.length === 2) {
params.maintenanceStart = dateRange.value[0];
@ -224,6 +233,7 @@ const loadList = async () => {
}
const res = await getAdminMaintenance(params);
list.value = res?.list || [];
total.value = res?.total || 0;
} finally {
loading.value = false;
}

Loading…
Cancel
Save