diff --git a/src/api/bst/feeLog.js b/src/api/bst/feeLog.js new file mode 100644 index 0000000..0a1151c --- /dev/null +++ b/src/api/bst/feeLog.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询改价记录列表 +export function listFeeLog(query) { + return request({ + url: '/bst/feeLog/list', + method: 'get', + params: query + }) +} + +// 查询改价记录详细 +export function getFeeLog(id) { + return request({ + url: '/bst/feeLog/' + id, + method: 'get' + }) +} + +// 新增改价记录 +export function addFeeLog(data) { + return request({ + url: '/bst/feeLog', + method: 'post', + data: data + }) +} + +// 修改改价记录 +export function updateFeeLog(data) { + return request({ + url: '/bst/feeLog', + method: 'put', + data: data + }) +} + +// 删除改价记录 +export function delFeeLog(id) { + return request({ + url: '/bst/feeLog/' + id, + method: 'delete' + }) +} diff --git a/src/api/bst/order.js b/src/api/bst/order.js index a12fbe5..8da83f7 100644 --- a/src/api/bst/order.js +++ b/src/api/bst/order.js @@ -81,3 +81,12 @@ export function deductOrder(data) { data: data }) } + +// 订单改价 +export function updateOrderPrice(data) { + return request({ + url: '/bst/order/updatePrice', + method: 'put', + data: data + }) +} diff --git a/src/utils/enums.js b/src/utils/enums.js index 884e605..12d66b0 100644 --- a/src/utils/enums.js +++ b/src/utils/enums.js @@ -158,9 +158,7 @@ export const OrderStatus = { FINISHED: "FINISHED", // 已结束 CANCELED: "CANCELED", // 已取消 WAIT_VERIFY: "WAIT_VERIFY", // 待审核 - REJECTED: "REJECTED", // 已驳回 - REFUNDED: "REFUNDED", // 已退款 - RIDE_WAIT_PAY: "RIDE_WAIT_PAY", // 骑行费待支付 + RIDE_WAIT_PAY: "RIDE_WAIT_PAY", // 骑行费待支付 // 允许支付的订单状态 canPay() { @@ -180,7 +178,7 @@ export const OrderStatus = { }, // 可以退款的订单状态 canRefund() { - return [this.FINISHED, this.REFUNDED]; + return [this.FINISHED]; }, // 未支付的订单状态 unPayList() { @@ -194,22 +192,30 @@ export const OrderStatus = { canVerify() { return [this.WAIT_VERIFY]; }, - // 有效的订单状态 + // 有效的订单状态:已支付的订单 valid() { - return [this.PROCESSING, this.FINISHED, this.WAIT_VERIFY, this.REJECTED, this.RIDE_WAIT_PAY]; + return [this.PROCESSING, this.FINISHED, this.WAIT_VERIFY, this.RIDE_WAIT_PAY]; }, - // 已完成的订单状态 + // 已完成的订单 finishedList() { - return [this.FINISHED, this.WAIT_VERIFY, this.REJECTED, this.REFUNDED]; + return [this.FINISHED, this.WAIT_VERIFY, this.RIDE_WAIT_PAY]; }, // 允许押金抵扣的订单状态 canDeduct() { return [this.RIDE_WAIT_PAY]; }, - // 允许骑行支付成功的订单状态 + // 允许骑行支付成功的订单状态 canRidePaySuccess() { return [this.RIDE_WAIT_PAY]; }, + // 允许调起支付骑行费的订单状态 + canPayRideFee() { + return [this.RIDE_WAIT_PAY]; + }, + // 允许改价的订单状态 + canUpdatePrice() { + return [this.RIDE_WAIT_PAY]; + } } // 支付业务类型 diff --git a/src/views/bst/device/view/components/DeviceLocation.vue b/src/views/bst/device/view/components/DeviceLocation.vue index f70f538..d5fe9eb 100644 --- a/src/views/bst/device/view/components/DeviceLocation.vue +++ b/src/views/bst/device/view/components/DeviceLocation.vue @@ -13,7 +13,7 @@ - + - + +
+ + + + + + + + + + + + 搜索 + 重置 + + + + + + 导出 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + diff --git a/src/views/bst/order/components/OrderChangePriceDialog.vue b/src/views/bst/order/components/OrderChangePriceDialog.vue new file mode 100644 index 0000000..07ad772 --- /dev/null +++ b/src/views/bst/order/components/OrderChangePriceDialog.vue @@ -0,0 +1,149 @@ + + + + + diff --git a/src/views/bst/order/components/OrderDeductDialog.vue b/src/views/bst/order/components/OrderDeductDialog.vue index e093d5d..a246426 100644 --- a/src/views/bst/order/components/OrderDeductDialog.vue +++ b/src/views/bst/order/components/OrderDeductDialog.vue @@ -10,6 +10,7 @@

即将进行押金抵扣,请确认。

抵扣金额:{{ detail.totalFee | fix2 | dv }} 元

剩余可抵扣押金:{{ detail.depositDeductRemain | fix2 | dv }} 元

+

若押金不足,则收取最大可抵扣金额

@@ -278,6 +308,9 @@ import { BonusBstType, LogBizType, OrderStatus, PayBstType, SuitRidingRule } fro import Bonus from '@/views/bst/bonus/index.vue' import CommandLog from '@/views/bst/commandLog/index.vue' import DeviceLocation from '@/views/bst/device/view/components/DeviceLocation.vue' +import FeeLog from '@/views/bst/feeLog/index.vue' +import OrderChangePriceDialog from '@/views/bst/order/components/OrderChangePriceDialog.vue' +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' @@ -288,7 +321,16 @@ import Operlog from '@/views/monitor/operlog/index.vue' export default { name: 'OrderView', - dicts: ['order_status', 'device_lock_status', 'suit_type', 'suit_rental_unit', 'suit_riding_rule', 'order_return_mode', 'order_return_type'], + dicts: [ + 'order_status', + 'device_lock_status', + 'suit_type', + 'suit_rental_unit', + 'suit_riding_rule', + 'order_return_mode', + 'order_return_type', + 'order_pay_type' + ], components: { CollapsePanel, OrderDevice, @@ -302,10 +344,14 @@ export default { CommandLog, DeviceLink, UserLink, - AreaLink + AreaLink, + OrderDeductDialog, + FeeLog, + OrderChangePriceDialog }, data() { return { + payBstTypes: [PayBstType.ORDER, PayBstType.ORDER_RIDE], OrderStatus, id: null, detail: {}, @@ -316,6 +362,8 @@ export default { LogBizType, showRefundDialog: false, showVerifyDialog: false, + showDeductDialog: false, + showUpdatePriceDialog: false, } }, computed: { @@ -352,6 +400,12 @@ export default { handleVerify(row) { this.showVerifyDialog = true; }, + handleDeduct(row) { + this.showDeductDialog = true; + }, + handleUpdatePrice(row) { + this.showUpdatePriceDialog = true; + }, async handleEnd(row) { const calcRes = await appCalcOrderFee({orderId: row.id, checkLocation: false}) let fee = {} diff --git a/src/views/system/user/view/view.vue b/src/views/system/user/view/view.vue index 3c44609..8c71de8 100644 --- a/src/views/system/user/view/view.vue +++ b/src/views/system/user/view/view.vue @@ -93,6 +93,9 @@ + + + @@ -122,6 +125,7 @@ import BalanceLog from '@/views/bst/balanceLog/index.vue' import Bonus from '@/views/bst/bonus/index.vue' import CommandLog from '@/views/bst/commandLog/index.vue' import Device from '@/views/bst/device/index.vue' +import FeeLog from '@/views/bst/feeLog/index.vue' import OrderDailyStat from '@/views/bst/index/components/OrderDailyStat.vue' import Model from '@/views/bst/model/index.vue' import Order from '@/views/bst/order/index.vue' @@ -156,7 +160,8 @@ export default { RealName, AreaJoin, OperLog, - CommandLog + CommandLog, + FeeLog }, data() { return {