This commit is contained in:
zlwu committed 2026-05-25 15:14:06 +08:00
1 parent 575e63e7e8
commit 771f010a39
165 files changed
+67359 -21698

No files matched your search

@@ -18,9 +18,20 @@
<el-form-item label="关键词">
<el-input v-model="searchForm.keyword" placeholder="预约编号/来访单位/联系人" clearable />
</el-form-item>
<el-form-item label="到访日期">
<el-date-picker
v-model="visitDateRange"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="YYYY-MM-DD"
style="width: 100%"
/>
</el-form-item>
</div>
<div class="filter-actions-row">
<span class="filter-hint">按预约编号、来访单位、联系人模糊查询。</span>
<span class="filter-hint">按预约编号、来访单位、联系人模糊查询;默认展示未来 30 天内的到访预约。</span>
<div class="filter-actions-end">
<el-button class="btn-ghost" @click="handleReset"><el-icon><RefreshLeft /></el-icon>重置</el-button>
<el-button class="btn-main" type="primary" @click="handleSearch"><el-icon><Search /></el-icon>搜索</el-button>
@@ -190,7 +201,22 @@
[key: string]: any
}
function formatLocalDate(d: Date): string {
const y = d.getFullYear()
const m = String(d.getMonth() + 1).padStart(2, '0')
const day = String(d.getDate()).padStart(2, '0')
return `${y}-${m}-${day}`
}
function getDefaultVisitDateRange(): [string, string] {
const start = new Date()
const end = new Date()
end.setDate(end.getDate() + 30)
return [formatLocalDate(start), formatLocalDate(end)]
}
const searchForm = reactive<{ keyword: string }>({ keyword: '' })
const visitDateRange = ref<[string, string] | null>(getDefaultVisitDateRange())
const tableData = ref<AppointmentRow[]>([])
const selectedRows = ref<AppointmentRow[]>([])
const loading = ref(false)
@@ -245,7 +271,9 @@
const res = await fetchExhibitionAppointmentList({
page: pagination.page,
pageSize: pagination.pageSize,
keyword: searchForm.keyword || undefined
keyword: searchForm.keyword || undefined,
visitDateStart: visitDateRange.value?.[0] || undefined,
visitDateEnd: visitDateRange.value?.[1] || undefined
})
tableData.value = res.list || []
pagination.total = res.total ?? 0
@@ -261,6 +289,7 @@
function handleReset() {
searchForm.keyword = ''
visitDateRange.value = getDefaultVisitDateRange()
pagination.page = 1
loadData()
}
@@ -350,7 +379,7 @@
}
// 输入检索条件时自动搜索(防抖 300ms)
watchDebounced(
searchForm,
[searchForm, visitDateRange],
() => {
pagination.page = 1
loadData()