This commit is contained in:
van
2026-09-06 21:01:05 +08:00
parent c34abb73c2
commit 7c6e701e97
2 changed files with 21 additions and 3 deletions
@@ -175,7 +175,7 @@
/>
<el-button type="primary" :loading="historyLoading" @click="searchHistory">搜索</el-button>
</div>
<p class="history-hint">待填写(生成后未补全)排在前面,已落库记录也保留。</p>
<p class="history-hint">仅查最近 3 天。待填写排在前面,已落库记录也保留。</p>
<div class="history-list" v-loading="historyLoading">
<div v-if="!historyList.length && !historyLoading" class="history-empty">暂无历史记录</div>
<div
@@ -878,17 +878,32 @@ export default {
id: row.id
}
},
historyDateRange(days) {
const end = new Date()
const start = new Date()
start.setDate(start.getDate() - (days || 3))
const fmt = d => {
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}`
}
return { beginTime: fmt(start), endTime: fmt(end) }
},
async loadHistory() {
this.historyLoading = true
try {
const kw = (this.historyKeyword || '').trim()
const range = this.historyDateRange(3)
const [histRes, orderRes] = await Promise.all([
getHistory('response', 300, kw || undefined),
getHistory('response', 300, kw || undefined, 3),
listJDOrders({
pageNum: 1,
pageSize: 100,
orderBy: 'id',
isAsc: 'desc',
beginTime: range.beginTime,
endTime: range.endTime,
quickRecordSearch: kw || undefined
})
])