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

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

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

Loading…
Cancel
Save