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 @@ + 自动抵扣 + @@ -270,6 +272,14 @@ v-has-permi="['bst:order:verify']" v-show="OrderStatus.canVerify().includes(scope.row.status)" >审核 + 押金抵扣 @@ -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 @@ - - - - - - - - - - + + + + + + + + + + + + + 元 + + + 分钟 + 在 @@ -198,6 +190,23 @@ + + + + + + + + + + +