From 53edda8a02c884c15289466959be046ec948f832 Mon Sep 17 00:00:00 2001 From: Leo Date: Mon, 26 Jan 2026 22:31:42 +0800 Subject: [PATCH] 1 --- src/views/system/jdorder/orderList.vue | 173 ++++++++++++++++++++++++- 1 file changed, 166 insertions(+), 7 deletions(-) diff --git a/src/views/system/jdorder/orderList.vue b/src/views/system/jdorder/orderList.vue index d607216..849a05b 100644 --- a/src/views/system/jdorder/orderList.vue +++ b/src/views/system/jdorder/orderList.vue @@ -71,6 +71,24 @@ + + + + + + + + + + + + + + + + + + 搜索 @@ -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 ? '后返到账' : '未到账' }} + + {{ row.isPriceProtected === 1 ? '点过价保' : '未点价保' }} + + + {{ row.isInvoiceOpened === 1 ? '开过专票' : '未开专票' }} + + + {{ row.isReviewPosted === 1 ? '晒过评价' : '未晒评价' }} + @@ -328,7 +367,7 @@ - + @@ -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))