This commit is contained in:
van
2026-05-16 02:27:56 +08:00
parent 3980fed315
commit f55b5f46a4
3 changed files with 173 additions and 11 deletions

View File

@@ -214,9 +214,9 @@
<div>统计<b>{{ profitSummaryLabel }}</b></div>
<div>后返合计 <b>{{ toYuan(profitSummaryRebateTotal) }}</b> · 利润合计 <b>{{ profitSummaryProfitTotal === '' ? '—' : toYuan(profitSummaryProfitTotal) }}</b><span class="profit-summary-hint">不含已退款</span></div>
</div>
<div
v-for="row in list"
:key="row.id"
<div
v-for="row in list"
:key="row.id"
class="mobile-order-card"
:class="{ 'is-expanded': mobileExpandedOrderId === row.id }"
>
@@ -553,7 +553,11 @@
</div>
</div>
</div>
<p v-if="isMobile && !loading && total > list.length" class="mobile-order-list-cap-hint">
<b>{{ total }}</b> 当前已加载 <b>{{ list.length }}</b> 单次上限 {{ queryParams.pageSize }}其余请缩小日期/筛选或在电脑端查看
</p>
<el-empty v-if="!loading && list.length === 0" description="暂无数据" :image-size="100" />
</div>
@@ -1289,6 +1293,9 @@ import TencentDocAutoWriteConfig from './components/TencentDocAutoWriteConfig'
import TencentDocPushMonitor from './components/TencentDocPushMonitor'
import DistributionMarkTouserConfig from './components/DistributionMarkTouserConfig'
/** 移动端「下好的慢单」一次拉取条数ListLayout 在窄屏隐藏分页,原先默认 50 条无法翻页) */
const MOBILE_JD_ORDER_PAGE_SIZE = 500
export default {
name: 'JDOrderList',
components: {
@@ -1417,9 +1424,15 @@ export default {
return (base || []).filter(r => r.isRefunded !== 1)
},
profitSummaryLabel() {
return this.selectedRows && this.selectedRows.length > 0
? `已选 ${this.selectedRows.length}`
: `本页 ${this.list.length}`
if (this.selectedRows && this.selectedRows.length > 0) {
return `已选 ${this.selectedRows.length}`
}
if (this.isMobile) {
const n = (this.list && this.list.length) || 0
const t = this.total || 0
return t > n ? `本批 ${n} 条(共 ${t} 条)` : `本批 ${n}`
}
return `本页 ${this.list.length}`
},
profitSummaryRebateTotal() {
return this.profitSummaryRows.reduce((s, r) => s + (Number(r.rebateAmount) || 0), 0)
@@ -1467,7 +1480,17 @@ export default {
]
}
},
watch: {
device(val, oldVal) {
if (val === 'mobile' && oldVal !== 'mobile') {
this.queryParams.pageSize = MOBILE_JD_ORDER_PAGE_SIZE
this.queryParams.pageNum = 1
this.getList()
}
}
},
created() {
this.applyMobileSlowOrderPageSize()
// 设置默认日期为今天
this.setDefaultDateRange()
this.getListWithFallback()
@@ -1571,6 +1594,12 @@ export default {
}
})
},
/** 移动端 ListLayout 隐藏分页栏,默认 pageSize 过小会导致无法看到后序订单 */
applyMobileSlowOrderPageSize() {
if (this.device === 'mobile' || (typeof window !== 'undefined' && window.innerWidth < 768)) {
this.queryParams.pageSize = MOBILE_JD_ORDER_PAGE_SIZE
}
},
/** 处理移动端操作菜单命令 */
handleActionCommand({ action, row }) {
switch (action) {
@@ -1885,7 +1914,7 @@ export default {
resetQuery() {
this.queryParams = {
pageNum: 1,
pageSize: 50,
pageSize: this.isMobile ? MOBILE_JD_ORDER_PAGE_SIZE : 50,
remark: undefined,
orderSearch: undefined,
distributionMark: undefined,
@@ -4427,6 +4456,17 @@ export default {
margin-top: 4px;
}
.mobile-order-list-cap-hint {
margin: 12px 4px 4px;
padding: 10px 12px;
font-size: 12px;
line-height: 1.5;
color: #92400e;
background: #fffbeb;
border: 1px solid #fde68a;
border-radius: 8px;
}
/* 本页:避免外层 .table-section 与表格内部双纵向滚动,横向滚动仍由表体承担 */
.jd-order-list-root ::v-deep .table-section {
overflow-x: auto;