拆包预测

This commit is contained in:
zhonghua.li
2026-05-30 18:24:00 +08:00
parent bfcdc9f8e5
commit e2f3014982

View File

@@ -20,6 +20,9 @@
<el-form-item label="状态">
<el-input v-model="queryParams.status" clearable placeholder="状态" style="width: 100px" />
</el-form-item>
<el-form-item label="来源页面">
<el-input v-model="queryParams.currentPage" clearable placeholder="来源页面" style="width: 140px" />
</el-form-item>
<el-form-item label="创建时间">
<el-date-picker
v-model="createdAtRange"
@@ -105,6 +108,7 @@
</template>
</el-table-column>
<el-table-column label="状态" prop="status" width="80" align="center" />
<el-table-column label="来源页面" prop="currentPage" min-width="120" show-overflow-tooltip />
<el-table-column label="图片" prop="image" min-width="120" show-overflow-tooltip />
<el-table-column label="创建时间" prop="createdAt" min-width="160">
<template slot-scope="scope">
@@ -276,6 +280,28 @@ function parseOptionalInt(value) {
return Number.isFinite(n) ? n : undefined
}
/** 最近一个工作日(周一至周五;周末则回退到上周五) */
function getMostRecentWorkday() {
const d = new Date()
d.setHours(0, 0, 0, 0)
while (d.getDay() === 0 || d.getDay() === 6) {
d.setDate(d.getDate() - 1)
}
return d
}
function formatYmd(date) {
const y = date.getFullYear()
const m = String(date.getMonth() + 1).padStart(2, '0')
const day = String(date.getDate()).padStart(2, '0')
return `${y}-${m}-${day}`
}
function getDefaultCreatedAtRange() {
const ymd = formatYmd(getMostRecentWorkday())
return [`${ymd} 00:00:00`, `${ymd} 23:59:59`]
}
export default {
name: 'LbGoodsPackagePredict',
data() {
@@ -325,7 +351,7 @@ export default {
dialogVisible: false,
dialogTitle: '',
isEdit: false,
createdAtRange: null,
createdAtRange: getDefaultCreatedAtRange(),
updatedAtRange: null,
queryParams: {
current: 1,
@@ -334,7 +360,8 @@ export default {
title: '',
sellerId: '',
isShow: undefined,
status: ''
status: '',
currentPage: ''
},
form: emptyForm(),
formRules: {
@@ -443,7 +470,8 @@ export default {
isShow: this.queryParams.isShow === 0 || this.queryParams.isShow === 1
? this.queryParams.isShow
: undefined,
status: parseOptionalInt(this.queryParams.status)
status: parseOptionalInt(this.queryParams.status),
currentPage: this.queryParams.currentPage || undefined
}
const tenantId = this.getTenantIdFromBusinessHeaders()
if (tenantId) params.tenantId = tenantId
@@ -472,9 +500,10 @@ export default {
title: '',
sellerId: '',
isShow: undefined,
status: ''
status: '',
currentPage: ''
}
this.createdAtRange = null
this.createdAtRange = getDefaultCreatedAtRange()
this.updatedAtRange = null
this.fetchList()
},