From d0e47d8a3586a88f7d8bc13da36f17ecc8476b57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A3=B7=E5=8F=B6?= <14103883+leaf-phos@user.noreply.gitee.com> Date: Mon, 19 May 2025 18:10:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=B4=E6=97=B6=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/bst/order.js | 9 ++ src/utils/enums.js | 13 +- .../order/components/OrderDeductDialog.vue | 104 ++++++++++++++ src/views/bst/order/index.vue | 22 ++- .../bst/suit/components/SuitEditDialog.vue | 132 ++++++++++-------- src/views/bst/suit/index.vue | 16 ++- 6 files changed, 229 insertions(+), 67 deletions(-) create mode 100644 src/views/bst/order/components/OrderDeductDialog.vue diff --git a/src/api/bst/order.js b/src/api/bst/order.js index 4c54da6..a12fbe5 100644 --- a/src/api/bst/order.js +++ b/src/api/bst/order.js @@ -72,3 +72,12 @@ export function verifyOrder(data) { data: data }) } + +// 订单押金抵扣 +export function deductOrder(data) { + return request({ + url: '/bst/order/deduct', + method: 'put', + data: data + }) +} diff --git a/src/utils/enums.js b/src/utils/enums.js index c3ee346..6e359c1 100644 --- a/src/utils/enums.js +++ b/src/utils/enums.js @@ -153,13 +153,14 @@ export const AreaJoinType = { // 订单状态 export const OrderStatus = { - WAIT_PAY: "WAIT_PAY", // 待支付 + WAIT_PAY: "WAIT_PAY", // 押金待支付 PROCESSING: "PROCESSING", // 进行中 FINISHED: "FINISHED", // 已结束 CANCELED: "CANCELED", // 已取消 WAIT_VERIFY: "WAIT_VERIFY", // 待审核 REJECTED: "REJECTED", // 已驳回 REFUNDED: "REFUNDED", // 已退款 + RIDE_WAIT_PAY: "RIDE_WAIT_PAY", // 骑行费待支付 // 允许支付的订单状态 canPay() { @@ -200,7 +201,15 @@ export const OrderStatus = { // 已完成的订单状态 finishedList() { return [this.FINISHED, this.WAIT_VERIFY, this.REJECTED, this.REFUNDED]; - } + }, + // 允许押金抵扣的订单状态 + canDeduct() { + return [this.RIDE_WAIT_PAY]; + }, + // 允许骑行支付成功的订单状态 + canRidePaySuccess() { + return [this.RIDE_WAIT_PAY]; + }, } // 支付业务类型 diff --git a/src/views/bst/order/components/OrderDeductDialog.vue b/src/views/bst/order/components/OrderDeductDialog.vue new file mode 100644 index 0000000..429e137 --- /dev/null +++ b/src/views/bst/order/components/OrderDeductDialog.vue @@ -0,0 +1,104 @@ + + + + + \ No newline at end of file diff --git a/src/views/bst/order/index.vue b/src/views/bst/order/index.vue index 3a7f8de..bf7c132 100644 --- a/src/views/bst/order/index.vue +++ b/src/views/bst/order/index.vue @@ -150,10 +150,12 @@
+ 自动抵扣 @@ -285,6 +295,8 @@ + + @@ -300,6 +312,7 @@ import FormCol from "@/components/FormCol/index.vue"; import { toDescriptionFromSecond } from '@/utils/date'; import { OrderStatus } from "@/utils/enums"; import { $showColumns } from '@/utils/mixins'; +import OrderDeductDialog from "@/views/bst/order/components/OrderDeductDialog.vue"; import OrderRefundDialog from "@/views/bst/order/components/OrderRefundDialog.vue"; import OrderVerifyDialog from "@/views/bst/order/components/OrderVerifyDialog.vue"; import { getOrderDuration } from '@/views/bst/order/util.js'; @@ -313,8 +326,8 @@ const defaultSort = { export default { name: "Order", mixins: [$showColumns], - dicts: ['order_status', 'suit_type', 'order_return_type', 'order_return_mode', 'suit_rental_unit', 'suit_riding_rule', 'device_status'], - components: {FormCol, OrderRefundDialog, OrderVerifyDialog, UserLink, DeviceLink, OrderLink, AreaLink, AreaRemoteSelect}, + dicts: ['order_status', 'suit_type', 'order_return_type', 'order_return_mode', 'suit_rental_unit', 'suit_riding_rule', 'device_status', 'order_pay_type'], + components: {FormCol, OrderRefundDialog, OrderVerifyDialog, OrderDeductDialog, UserLink, DeviceLink, OrderLink, AreaLink, AreaRemoteSelect}, props: { query: { type: Object, @@ -387,6 +400,7 @@ export default { row: {}, showRefundDialog: false, showVerifyDialog: false, + showDeductDialog: false, }; }, created() { @@ -396,6 +410,10 @@ export default { methods: { getOrderDuration, toDescriptionFromSecond, + handleDeduct(row) { + this.row = row; + this.showDeductDialog = true; + }, handleVerify(row) { this.row = row; this.showVerifyDialog = true; diff --git a/src/views/bst/suit/components/SuitEditDialog.vue b/src/views/bst/suit/components/SuitEditDialog.vue index 2127cf3..50bb6a9 100644 --- a/src/views/bst/suit/components/SuitEditDialog.vue +++ b/src/views/bst/suit/components/SuitEditDialog.vue @@ -7,7 +7,7 @@ :close-on-click-modal="false" @open="handleOpen" > - + @@ -15,15 +15,6 @@ - - - - - 元 - - - 分钟 - @@ -70,29 +40,51 @@ - - - - - - - - - - + + + + + + + + + + + + + 元 + + + 分钟 + + + + + + + + + + + +