diff --git a/src/api/hard/hard-order.ts b/src/api/hard/hard-order.ts index 2f627a8..b133ffb 100644 --- a/src/api/hard/hard-order.ts +++ b/src/api/hard/hard-order.ts @@ -117,6 +117,34 @@ export function offlinePay(data: any) { }) } +/** 智能柜手动结算提交的商品项;productId 为 hard_spu 主键。 */ +export interface HardDoorManualSettleItem { + productId: string | number + productCount: number +} + +/** + * 智能柜订单手动结算(第三方识别不可用时,人工核对视频后结算) + */ +export function manualSettle(data: { orderId: string | number; items: HardDoorManualSettleItem[] }) { + return request({ + url: "/hard/hard-order/manual-settle", + method: "post", + data, + }) +} + +/** + * 智能柜订单手动取消(用户未拿商品) + */ +export function manualCancel(data: { orderId: string | number }) { + return request({ + url: "/hard/hard-order/manual-cancel", + method: "post", + data, + }) +} + export function pageJoin(query: any) { return request({ url: "/hard/hard-order/page-join", diff --git a/src/views/hard/components/manual-settlement.vue b/src/views/hard/components/manual-settlement.vue new file mode 100644 index 0000000..1a7cab4 --- /dev/null +++ b/src/views/hard/components/manual-settlement.vue @@ -0,0 +1,434 @@ + + + + + + + + 柜内商品({{ cabinetNoLabel }}) + + + 第 {{ floor.floorNo }} 层 + + + + + + {{ product.name }} + + + {{ displayPrice(product.price) }} + 库存 {{ product.stock }} + + + + + + + + + + + + + + 已选商品 + + + + {{ item.name }} + × {{ item.count }} + {{ displayPrice(item.price * item.count) }} + + + + 合计:{{ displayPrice(cartTotalPrice) }} + (金额仅供参考,以实际结算结果为准) + + + + + + + + 开门视频 + + + {{ video.label }} + + + + + + + + + + 手动结算 + + + 用户未拿商品,取消订单 + + + + + + + + + + diff --git a/src/views/hard/hard-after-sale/order-refund.vue b/src/views/hard/hard-after-sale/order-refund.vue index 0e1cc63..e24a5ea 100644 --- a/src/views/hard/hard-after-sale/order-refund.vue +++ b/src/views/hard/hard-after-sale/order-refund.vue @@ -781,6 +781,20 @@ + + + + + 手动结算 + 人工核对开门视频,选择用户拿走的商品后手动完成订单 + + + + @@ -802,7 +816,7 @@ import * as hardAfterSaleApi from "/@/api/hard/hard-after-sale" import * as hardInvoiceApi from "/@/api/hard/hard-invoice" import { displayPrice } from "/@/utils/formatMoney" import { getAutoRefundTaskStatus } from "/@/constants/autoRefund" -import { Box, Calendar, Check, CreditCard, Document, List, Location, Money, Picture, Printer, ShoppingCart, Timer } from "@element-plus/icons-vue" +import { Box, Calendar, Check, Coin, CreditCard, Document, List, Location, Money, Picture, Printer, ShoppingCart, Timer } from "@element-plus/icons-vue" import type { Component } from "vue" import dayjs from "dayjs" @@ -810,6 +824,8 @@ import dayjs from "dayjs" const RefundRejectForm = defineAsyncComponent(() => import("./refund-reject.vue")) /** 智能柜订单流程日志,仅设备类型为生鲜柜时加载。 */ const HardDoorLog = defineAsyncComponent(() => import("../components/hard-door-log.vue")) +/** 智能柜免密订单手动结算,第三方识别不可用时人工核对视频结算。 */ +const ManualSettlement = defineAsyncComponent(() => import("../components/manual-settlement.vue")) /** 当前订单的全部售后记录与日志入口。 */ const SaleTable = defineAsyncComponent(() => import("../components/sale-table.vue")) @@ -817,6 +833,10 @@ const SaleTable = defineAsyncComponent(() => import("../components/sale-table.vu const AFTER_SALE_APPLY_STATUS = "10" /** 设备类型 4 表示生鲜智能柜,只有该类型存在开门与识别流程日志。 */ const SMART_CABINET_HARD_TYPE = "4" +/** 支付方式 9 表示智能柜免密支付,订单依赖第三方识别后自动结算。 */ +const HARD_DOOR_FREE_PAY_TYPE = "9" +/** 智能柜免密订单待结算(未支付)状态编码,仅该状态允许手动结算/取消。 */ +const DOOR_ORDER_PENDING_SETTLE_STATUS = "1" /** 消费机支付订单类型编码,后端允许该类型没有购物车明细。 */ const SIMPLE_PAYMENT_ORDER_TYPE = "9" /** 商城订单类型编码,使用发货、收货履约状态。 */ @@ -1224,6 +1244,13 @@ const isSimplePaymentOrder = computed(() => orderTypeCode.value === SIMPLE_PAYME const isSmartCabinetOrder = computed( () => String(globalData.detail.hardType || globalData.detail.sysType || "") === SMART_CABINET_HARD_TYPE, ) +/** 是否为待结算的智能柜免密订单;第三方识别不可用时提供人工核对视频后的手动结算入口。 */ +const showManualSettlementSection = computed( + () => + String(globalData.detail.payType || "") === HARD_DOOR_FREE_PAY_TYPE && + isSmartCabinetOrder.value && + orderStatusCode.value === DOOR_ORDER_PENDING_SETTLE_STATUS, +) /** 当前订单在管理端的业务流程摘要。 */ const orderScenarioLabel = computed(() => getOrderScenarioLabel(orderTypeCode.value)) @@ -1451,6 +1478,9 @@ const sectionNavItems = computed(() => { if (isSmartCabinetOrder.value) { items.push({ key: "cabinet", label: "智能柜日志", targetId: "section-cabinet", icon: Box }) } + if (showManualSettlementSection.value) { + items.push({ key: "manual-settlement", label: "手动结算", targetId: "section-manual-settlement", icon: Coin }) + } return items })
人工核对开门视频,选择用户拿走的商品后手动完成订单