This commit is contained in:
Leo
2026-01-26 22:31:42 +08:00
parent 5118598d83
commit 53edda8a02

View File

@@ -71,6 +71,24 @@
<el-option label="未到账" :value="0" />
</el-select>
</el-form-item>
<el-form-item label="点过价保">
<el-select v-model="queryParams.isPriceProtected" placeholder="全部" clearable size="small" style="width: 120px;">
<el-option label="已点价保" :value="1" />
<el-option label="未点价保" :value="0" />
</el-select>
</el-form-item>
<el-form-item label="开过专票">
<el-select v-model="queryParams.isInvoiceOpened" placeholder="全部" clearable size="small" style="width: 120px;">
<el-option label="已开专票" :value="1" />
<el-option label="未开专票" :value="0" />
</el-select>
</el-form-item>
<el-form-item label="晒过评价">
<el-select v-model="queryParams.isReviewPosted" placeholder="全部" clearable size="small" style="width: 120px;">
<el-option label="已晒评价" :value="1" />
<el-option label="未晒评价" :value="0" />
</el-select>
</el-form-item>
<!-- 搜索按钮桌面端显示移动端展开时在底部显示 -->
<el-form-item>
<el-button type="primary" size="small" icon="el-icon-search" @click="handleQuery">搜索</el-button>
@@ -263,9 +281,30 @@
:type="row.isRebateReceived === 1 ? 'success' : 'info'"
size="mini"
@click.native="toggleRebateReceived(row)"
style="cursor: pointer;">
style="cursor: pointer; margin-right: 8px;">
{{ row.isRebateReceived === 1 ? '后返到账' : '未到账' }}
</el-tag>
<el-tag
:type="row.isPriceProtected === 1 ? 'warning' : 'info'"
size="mini"
@click.native="togglePriceProtected(row)"
style="cursor: pointer; margin-right: 8px;">
{{ row.isPriceProtected === 1 ? '点过价保' : '未点价保' }}
</el-tag>
<el-tag
:type="row.isInvoiceOpened === 1 ? 'success' : 'info'"
size="mini"
@click.native="toggleInvoiceOpened(row)"
style="cursor: pointer; margin-right: 8px;">
{{ row.isInvoiceOpened === 1 ? '开过专票' : '未开专票' }}
</el-tag>
<el-tag
:type="row.isReviewPosted === 1 ? 'success' : 'info'"
size="mini"
@click.native="toggleReviewPosted(row)"
style="cursor: pointer;">
{{ row.isReviewPosted === 1 ? '晒过评价' : '未晒评价' }}
</el-tag>
</div>
</div>
@@ -328,7 +367,7 @@
</el-table-column>
<el-table-column label="下单人" prop="buyer" width="100"/>
<!-- 退款状态标签列行显示 -->
<!-- 退款状态标签列行显示 -->
<el-table-column label="退款状态" width="160" align="left">
<template slot-scope="scope">
<div style="display: flex; flex-direction: column; gap: 6px;">
@@ -365,6 +404,39 @@
{{ scope.row.isRebateReceived === 1 ? '后返到账' : '未到账' }}
</el-tag>
</div>
<div style="display: flex; align-items: center; gap: 8px;">
<span style="min-width: 80px; font-size: 12px; color: #606266;">点过价保</span>
<el-tag
:type="scope.row.isPriceProtected === 1 ? 'warning' : 'info'"
size="small"
:title="scope.row.isPriceProtected === 1 && scope.row.priceProtectedDate ? '价保日期:' + parseTime(scope.row.priceProtectedDate) : ''"
@click.native="togglePriceProtected(scope.row)"
style="cursor: pointer; flex: 1;">
{{ scope.row.isPriceProtected === 1 ? '点过价保' : '未点价保' }}
</el-tag>
</div>
<div style="display: flex; align-items: center; gap: 8px;">
<span style="min-width: 80px; font-size: 12px; color: #606266;">开过专票</span>
<el-tag
:type="scope.row.isInvoiceOpened === 1 ? 'success' : 'info'"
size="small"
:title="scope.row.isInvoiceOpened === 1 && scope.row.invoiceOpenedDate ? '开票日期:' + parseTime(scope.row.invoiceOpenedDate) : ''"
@click.native="toggleInvoiceOpened(scope.row)"
style="cursor: pointer; flex: 1;">
{{ scope.row.isInvoiceOpened === 1 ? '开过专票' : '未开专票' }}
</el-tag>
</div>
<div style="display: flex; align-items: center; gap: 8px;">
<span style="min-width: 80px; font-size: 12px; color: #606266;">晒过评价</span>
<el-tag
:type="scope.row.isReviewPosted === 1 ? 'success' : 'info'"
size="small"
:title="scope.row.isReviewPosted === 1 && scope.row.reviewPostedDate ? '评价日期:' + parseTime(scope.row.reviewPostedDate) : ''"
@click.native="toggleReviewPosted(scope.row)"
style="cursor: pointer; flex: 1;">
{{ scope.row.isReviewPosted === 1 ? '晒过评价' : '未晒评价' }}
</el-tag>
</div>
</div>
</template>
</el-table-column>
@@ -799,7 +871,10 @@ export default {
hasFinishTime: false,
isRefunded: undefined,
isRefundReceived: undefined,
isRebateReceived: undefined
isRebateReceived: undefined,
isPriceProtected: undefined,
isInvoiceOpened: undefined,
isReviewPosted: undefined
},
// 同步物流对话框
syncLogisticsDialogVisible: false,
@@ -962,7 +1037,10 @@ export default {
...item,
isRefunded: item.isRefunded != null ? item.isRefunded : 0,
isRefundReceived: item.isRefundReceived != null ? item.isRefundReceived : 0,
isRebateReceived: item.isRebateReceived != null ? item.isRebateReceived : 0
isRebateReceived: item.isRebateReceived != null ? item.isRebateReceived : 0,
isPriceProtected: item.isPriceProtected != null ? item.isPriceProtected : 0,
isInvoiceOpened: item.isInvoiceOpened != null ? item.isInvoiceOpened : 0,
isReviewPosted: item.isReviewPosted != null ? item.isReviewPosted : 0
}))
this.total = res.total || 0
this.loading = false
@@ -980,7 +1058,10 @@ export default {
...item,
isRefunded: item.isRefunded != null ? item.isRefunded : 0,
isRefundReceived: item.isRefundReceived != null ? item.isRefundReceived : 0,
isRebateReceived: item.isRebateReceived != null ? item.isRebateReceived : 0
isRebateReceived: item.isRebateReceived != null ? item.isRebateReceived : 0,
isPriceProtected: item.isPriceProtected != null ? item.isPriceProtected : 0,
isInvoiceOpened: item.isInvoiceOpened != null ? item.isInvoiceOpened : 0,
isReviewPosted: item.isReviewPosted != null ? item.isReviewPosted : 0
}))
this.list = list
this.total = res.total || 0
@@ -1007,7 +1088,10 @@ export default {
...item,
isRefunded: item.isRefunded != null ? item.isRefunded : 0,
isRefundReceived: item.isRefundReceived != null ? item.isRefundReceived : 0,
isRebateReceived: item.isRebateReceived != null ? item.isRebateReceived : 0
isRebateReceived: item.isRebateReceived != null ? item.isRebateReceived : 0,
isPriceProtected: item.isPriceProtected != null ? item.isPriceProtected : 0,
isInvoiceOpened: item.isInvoiceOpened != null ? item.isInvoiceOpened : 0,
isReviewPosted: item.isReviewPosted != null ? item.isReviewPosted : 0
}))
this.list = yesterdayList
this.total = yesterdayRes.total || 0
@@ -1055,7 +1139,10 @@ export default {
hasFinishTime: false,
isRefunded: undefined,
isRefundReceived: undefined,
isRebateReceived: undefined
isRebateReceived: undefined,
isPriceProtected: undefined,
isInvoiceOpened: undefined,
isReviewPosted: undefined
}
// 重置排序为默认降序
this.queryParams.orderBy = 'create_time'
@@ -1291,6 +1378,78 @@ export default {
}
})
},
/** 切换点过价保状态(标签点击) */
togglePriceProtected(row) {
const oldValue = row.isPriceProtected
row.isPriceProtected = row.isPriceProtected === 1 ? 0 : 1
// 如果设置为"是",自动设置当前日期
if (row.isPriceProtected === 1 && !row.priceProtectedDate) {
row.priceProtectedDate = new Date()
}
// 如果设置为"否",清空日期
if (row.isPriceProtected === 0) {
row.priceProtectedDate = null
}
// 调用后端API更新数据库
updateJDOrder(row).then(() => {
this.$message.success(`订单 ${row.remark} 的点过价保状态已更新`)
}).catch(() => {
this.$message.error('更新失败,请稍后重试')
// 恢复原状态
row.isPriceProtected = oldValue
if (row.isPriceProtected === 0) {
row.priceProtectedDate = null
}
})
},
/** 切换开过专票状态(标签点击) */
toggleInvoiceOpened(row) {
const oldValue = row.isInvoiceOpened
row.isInvoiceOpened = row.isInvoiceOpened === 1 ? 0 : 1
// 如果设置为"是",自动设置当前日期
if (row.isInvoiceOpened === 1 && !row.invoiceOpenedDate) {
row.invoiceOpenedDate = new Date()
}
// 如果设置为"否",清空日期
if (row.isInvoiceOpened === 0) {
row.invoiceOpenedDate = null
}
// 调用后端API更新数据库
updateJDOrder(row).then(() => {
this.$message.success(`订单 ${row.remark} 的开过专票状态已更新`)
}).catch(() => {
this.$message.error('更新失败,请稍后重试')
// 恢复原状态
row.isInvoiceOpened = oldValue
if (row.isInvoiceOpened === 0) {
row.invoiceOpenedDate = null
}
})
},
/** 切换晒过评价状态(标签点击) */
toggleReviewPosted(row) {
const oldValue = row.isReviewPosted
row.isReviewPosted = row.isReviewPosted === 1 ? 0 : 1
// 如果设置为"是",自动设置当前日期
if (row.isReviewPosted === 1 && !row.reviewPostedDate) {
row.reviewPostedDate = new Date()
}
// 如果设置为"否",清空日期
if (row.isReviewPosted === 0) {
row.reviewPostedDate = null
}
// 调用后端API更新数据库
updateJDOrder(row).then(() => {
this.$message.success(`订单 ${row.remark} 的晒过评价状态已更新`)
}).catch(() => {
this.$message.error('更新失败,请稍后重试')
// 恢复原状态
row.isReviewPosted = oldValue
if (row.isReviewPosted === 0) {
row.reviewPostedDate = null
}
})
},
/** 删除单条记录(需输入随机确认码) */
async handleDelete(row) {
const code = String(Math.floor(100000 + Math.random() * 900000))