1
This commit is contained in:
@@ -55,10 +55,10 @@
|
||||
<template slot-scope="scope">
|
||||
<div>
|
||||
<span style="margin-right: 8px;">{{ scope.row.orderId }}</span>
|
||||
<el-button
|
||||
type="text"
|
||||
size="mini"
|
||||
icon="el-icon-copy-document"
|
||||
<el-button
|
||||
type="text"
|
||||
size="mini"
|
||||
icon="el-icon-copy-document"
|
||||
@click="copyToClipboard(scope.row.orderId)"
|
||||
title="复制订单号"
|
||||
>
|
||||
@@ -78,7 +78,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="下单人" prop="buyer" width="140"/>
|
||||
<el-table-column label="备注/状态" prop="status" min-width="160"/>
|
||||
|
||||
|
||||
<el-table-column label="参与统计" prop="isCountEnabled" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
@@ -86,6 +86,8 @@
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
@change="handleCountEnabledChange(scope.row)"
|
||||
active-text="是"
|
||||
inactive-text="否">
|
||||
</el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -94,10 +96,10 @@
|
||||
<template slot-scope="scope">
|
||||
<div v-if="scope.row.logisticsLink">
|
||||
<a :href="scope.row.logisticsLink" target="_blank" style="margin-right: 8px;">查看物流</a>
|
||||
<el-button
|
||||
type="text"
|
||||
size="mini"
|
||||
icon="el-icon-copy-document"
|
||||
<el-button
|
||||
type="text"
|
||||
size="mini"
|
||||
icon="el-icon-copy-document"
|
||||
@click="copyToClipboard(scope.row.logisticsLink)"
|
||||
title="复制链接"
|
||||
>
|
||||
@@ -194,38 +196,38 @@ export default {
|
||||
/** 智能查询列表,如果今天数据为空则查询昨天 */
|
||||
async getListWithFallback() {
|
||||
this.loading = true
|
||||
|
||||
|
||||
try {
|
||||
const res = await listJDOrders(this.queryParams)
|
||||
this.list = (res.rows || res.data || [])
|
||||
this.total = res.total || 0
|
||||
|
||||
|
||||
// 如果今天的数据为空,且是默认查询(没有手动选择日期),则尝试查询昨天
|
||||
if (this.list.length === 0 && this.isDefaultQuery()) {
|
||||
this.$message.info('今天暂无慢单数据,正在查询昨天的数据...')
|
||||
|
||||
|
||||
// 获取昨天的日期
|
||||
const yesterday = new Date()
|
||||
yesterday.setDate(yesterday.getDate() - 1)
|
||||
const yesterdayStr = this.formatDate(yesterday)
|
||||
|
||||
|
||||
// 更新查询参数为昨天
|
||||
this.queryParams.beginTime = yesterdayStr
|
||||
this.queryParams.endTime = yesterdayStr
|
||||
this.dateRange = [yesterdayStr, yesterdayStr]
|
||||
|
||||
|
||||
// 查询昨天的数据
|
||||
const yesterdayRes = await listJDOrders(this.queryParams)
|
||||
this.list = (yesterdayRes.rows || yesterdayRes.data || [])
|
||||
this.total = yesterdayRes.total || 0
|
||||
|
||||
|
||||
if (this.list.length > 0) {
|
||||
this.$message.success(`已查询到昨天(${yesterdayStr})的慢单数据`)
|
||||
} else {
|
||||
this.$message.warning('昨天也没有慢单数据')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
this.loading = false
|
||||
} catch (error) {
|
||||
this.loading = false
|
||||
@@ -243,8 +245,8 @@ export default {
|
||||
this.getList()
|
||||
},
|
||||
resetQuery() {
|
||||
this.queryParams = {
|
||||
pageNum: 1,
|
||||
this.queryParams = {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
remark: undefined,
|
||||
distributionMark: undefined,
|
||||
@@ -305,7 +307,7 @@ export default {
|
||||
document.body.appendChild(textArea)
|
||||
textArea.focus()
|
||||
textArea.select()
|
||||
|
||||
|
||||
try {
|
||||
const successful = document.execCommand('copy')
|
||||
if (successful) {
|
||||
@@ -316,7 +318,7 @@ export default {
|
||||
} catch (err) {
|
||||
this.$message.error('复制失败,请手动复制')
|
||||
}
|
||||
|
||||
|
||||
document.body.removeChild(textArea)
|
||||
},
|
||||
/** 处理统计开关变化 */
|
||||
@@ -330,7 +332,7 @@ export default {
|
||||
row.isCountEnabled = row.isCountEnabled ? 0 : 1
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user