From 9e63f8a5997f9c4bca9f0440aea0798be2e38337 Mon Sep 17 00:00:00 2001 From: wsb1224 Date: Fri, 3 Jul 2026 22:40:07 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=B0=8F=E7=A8=8B=E5=BA=8F=E5=AE=A1?= =?UTF-8?q?=E6=89=B9=E8=AF=A6=E6=83=85=E9=A1=B5=E5=AF=B9=E9=BD=90=20web-ad?= =?UTF-8?q?min=20=E5=B8=83=E5=B1=80=E5=92=8C=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 添加 pending_logistics 填写快递单号入口(无物流任务时) 2. 物流信息区域添加修改单号按钮(有物流任务时) 3. 头部增加业务员姓名显示 4. 产品列表增加计价过程列 5. 自发订单提示扩展到运输中等状态 6. 费用汇总增加其他费用字段 Co-Authored-By: Claude Sonnet 4.6 --- .../manager/approve-detail/approve-detail.js | 73 +++++++++++++++++++ .../approve-detail/approve-detail.wxml | 19 ++++- .../approve-detail/approve-detail.wxss | 3 + 3 files changed, 91 insertions(+), 4 deletions(-) diff --git a/frontend/mini-app/pages/manager/approve-detail/approve-detail.js b/frontend/mini-app/pages/manager/approve-detail/approve-detail.js index ad60edc..b126509 100644 --- a/frontend/mini-app/pages/manager/approve-detail/approve-detail.js +++ b/frontend/mini-app/pages/manager/approve-detail/approve-detail.js @@ -53,6 +53,8 @@ Page({ quantity: "1", }, serviceBound: true, + showPendingTrackingEdit: false, + pendingTrackingNumber: "", }, async onLoad(options) { @@ -127,6 +129,8 @@ Page({ if (freight > 0) feeItems.push({ label: "运费", value: fmt(freight) }); if (tax > 0) feeItems.push({ label: "税费", value: fmt(tax) }); if (commission > 0) feeItems.push({ label: "佣金", value: fmt(commission) }); + var otherFee = Number(data.other_fee_total || 0); + if (otherFee > 0) feeItems.push({ label: "其他费用", value: fmt(otherFee) }); feeItems.push({ label: "利润", value: fmt(profit), isProfit: true }); // 产品明细(从 data.items 构建,包含规格/需求规格/单位等完整字段) @@ -149,6 +153,7 @@ Page({ areaSqm: ci.area_sqm ? fmt(ci.area_sqm) + "㎡" : "", supplierModel: ci.supplier_model || "", priceTier: ci.price_tier || "", + formulaDetail: ci.formula_detail || "", }); } } @@ -553,6 +558,74 @@ Page({ }); }, + // 填写快递单号(pending_logistics 状态,无物流任务) + openPendingTrackingEdit: function () { + var that = this; + var app = getApp(); + wx.showModal({ + title: "填写快递单号", + editable: true, + placeholderText: "请输入快递单号", + confirmColor: "#2563eb", + success: function (res) { + if (!res.confirm) return; + var trackingNumber = (res.content || "").trim(); + if (!trackingNumber) { + wx.showToast({ title: "请输入快递单号", icon: "none" }); + return; + } + that.setData({ actionLoading: true }); + app.request({ + url: "/api/orders/" + that.data.orderInfo.order_id + "/tracking", + method: "PUT", + data: { tracking_number: trackingNumber, remark: "填写快递单号" }, + }).then(function () { + wx.showToast({ title: "快递单号已填写,订单已进入运输状态", icon: "success" }); + return that.loadDetail(); + }).catch(function (error) { + that.setData({ message: error.message || "填写快递单号失败" }); + }).finally(function () { + that.setData({ actionLoading: false }); + }); + }, + }); + }, + + // 修改物流单号(有物流任务时) + openLogisticsTrackingEdit: function () { + var that = this; + var app = getApp(); + var logistics = this.data.logistics; + if (!logistics || !logistics.task_id) return; + wx.showModal({ + title: "修改物流单号", + editable: true, + placeholderText: "请输入新快递单号", + confirmColor: "#2563eb", + success: function (res) { + if (!res.confirm) return; + var trackingNumber = (res.content || "").trim(); + if (!trackingNumber) { + wx.showToast({ title: "请输入快递单号", icon: "none" }); + return; + } + that.setData({ actionLoading: true }); + app.request({ + url: "/api/logistics/tasks/" + logistics.task_id + "/tracking", + method: "PUT", + data: { tracking_number: trackingNumber, remark: "修改物流单号" }, + }).then(function () { + wx.showToast({ title: "物流单号已更新", icon: "success" }); + return that.loadDetail(); + }).catch(function (error) { + that.setData({ message: error.message || "修改物流单号失败" }); + }).finally(function () { + that.setData({ actionLoading: false }); + }); + }, + }); + }, + handleBack: function () { wx.navigateBack({ delta: 1 }); }, // 分享给好友 diff --git a/frontend/mini-app/pages/manager/approve-detail/approve-detail.wxml b/frontend/mini-app/pages/manager/approve-detail/approve-detail.wxml index 8e36a32..d3222f6 100644 --- a/frontend/mini-app/pages/manager/approve-detail/approve-detail.wxml +++ b/frontend/mini-app/pages/manager/approve-detail/approve-detail.wxml @@ -15,8 +15,8 @@ - {{orderInfo.order_no}} - {{orderInfo.customer_name}} · {{orderInfo.customer_mobile}} + {{orderInfo.salesman_name ? orderInfo.salesman_name + '-' : ''}}{{orderInfo.customer_name}}的销售订单 + 订单号:{{orderInfo.order_no}} {{orderInfo.statusText}} @@ -91,6 +91,7 @@ 计价: {{item.pricingType}} 面积: {{item.areaSqm}} 型号: {{item.supplierModel}} + 计价过程: {{item.formulaDetail}} 单价: ¥{{item.costPrice}} @@ -135,9 +136,19 @@ + + + 物流单号 + 订单已审批通过,当前待绑定物流单号,请填写快递信息后进入运输状态。 + 填写快递单号 + + - 物流信息 + + 物流信息 + 修改单号 + 快递公司 {{logistics.express_company}} @@ -165,7 +176,7 @@ - + 马甸工厂自发 — 已填写快递单号({{orderInfo.tracking_number}}),审批通过后跳过工厂下发 diff --git a/frontend/mini-app/pages/manager/approve-detail/approve-detail.wxss b/frontend/mini-app/pages/manager/approve-detail/approve-detail.wxss index 49cd7ba..6f674a7 100644 --- a/frontend/mini-app/pages/manager/approve-detail/approve-detail.wxss +++ b/frontend/mini-app/pages/manager/approve-detail/approve-detail.wxss @@ -135,6 +135,9 @@ /* 通用 */ .section-title { font-size: 26rpx; color: #64748b; font-weight: 600; margin-bottom: 12rpx; } +.section-title-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12rpx; } +.section-title-row .section-title { margin-bottom: 0; } +.action-link { font-size: 24rpx; color: #2563eb; padding: 8rpx 0; } .message { color: #047857; padding: 20rpx 24rpx; } .empty-card { padding: 40rpx; text-align: center; } .page-subtitle { color: #94a3b8; font-size: 28rpx; }