From 91e90cc7e22b1f12386b4bd4f72d36e660c5436a Mon Sep 17 00:00:00 2001 From: liufumingren Date: Sat, 7 Nov 2026 08:18:34 +0800 Subject: [PATCH] =?UTF-8?q?feat(order):=20=E6=96=B0=E5=A2=9E=E3=80=8C?= =?UTF-8?q?=E9=85=8D=E9=80=81=E5=BC=82=E5=B8=B8=E3=80=8D=E8=A7=86=E5=9B=BE?= =?UTF-8?q?=EF=BC=8C=E5=9B=9E=E4=BC=A0=E5=B9=B3=E5=8F=B0=E5=A4=B1=E8=B4=A5?= =?UTF-8?q?=E5=8F=AF=E7=9C=8B=E5=8E=9F=E5=9B=A0=E5=B9=B6=E9=87=8D=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 订单页左侧「配送」下面新增「配送异常」tab: - 数据 = 配送表 + external_send_status IN (2 待重试, 3 同步异常),不用再进配送页自己筛 - 新增「回传失败原因」列(红色 + tooltip 全文),状态列保留「第 N 次」 - 行内「重试」按钮(单条重试),批量重试仍走原 resend_external - tab 上带红色数量徽标(待重试 + 同步异常),重试后自动刷新 - 导出:配送异常视图导出时按 2,3 过滤;导出面板新增「回传平台状态」多选 后端导出补充 external_send_status 过滤(与列表接口同口径)。 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- backend/app/utils/exportDefs.js | 18 ++++++ frontend/src/views/Order/Status.vue | 64 +++++++++++++++++-- frontend/src/views/Order/StatusPanel.vue | 81 ++++++++++++++++++++---- 3 files changed, 147 insertions(+), 16 deletions(-) diff --git a/backend/app/utils/exportDefs.js b/backend/app/utils/exportDefs.js index e1ba7a2..ff91bcf 100644 --- a/backend/app/utils/exportDefs.js +++ b/backend/app/utils/exportDefs.js @@ -751,6 +751,19 @@ const EXPORT_TYPES = { { key: 'remark', label: '备注', type: 'text' }, { key: 'shop_id', label: '店铺', type: 'shop' }, { key: 'warehouse_id', label: '仓库', type: 'warehouse' }, + { + key: 'external_send_status', + label: '回传平台状态', + type: 'select', + options: [ + { label: '待同步外部', value: '0' }, + { label: '已同步外部', value: '1' }, + { label: '同步失败待重试', value: '2' }, + { label: '同步异常', value: '3' }, + ], + multiple: true, + placeholder: '配送视图用;配送异常=2,3', + }, { key: 'created_from', label: '创建时间起', type: 'date' }, { key: 'created_to', label: '创建时间止', type: 'date' }, { key: 'archived_from', label: '归档时间起', type: 'date' }, @@ -791,6 +804,11 @@ const EXPORT_TYPES = { // 电商平台(多选)与平台单号(多个精确匹配),与列表接口同口径 whereIn(wh, 't.source_platform_code', csvValues(f.platform_codes, 50).map(code => code.toUpperCase())); whereIn(wh, 't.oaid_order_source_code', csvValues(f.platform_order_nos, 200)); + // 外部发货同步状态(配送视图/配送异常视图用:0待同步 1已同步 2待重试 3异常,支持逗号多选) + const sendStatuses = csvValues(f.external_send_status, 10) + .map(value => Number(value)) + .filter(value => Number.isInteger(value)); + if (sendStatuses.length) whereIn(wh, 't.external_send_status', sendStatuses); if (String(f.exclude_unbound) === '1') { wh.raw( 'NOT EXISTS (SELECT 1 FROM order_status_items oi WHERE oi.order_id = t.id ' + diff --git a/frontend/src/views/Order/Status.vue b/frontend/src/views/Order/Status.vue index 2110106..2d052d8 100644 --- a/frontend/src/views/Order/Status.vue +++ b/frontend/src/views/Order/Status.vue @@ -1,7 +1,8 @@