feat(order): add order refund function and related operations
- 新增订单退款API接口refundOrder
- 添加退款中、已退款、退款失败三种订单状态选项
- 为符合条件的订单新增退款操作按钮与确认弹窗
- 临时注释两个详情页面的支付功能展示模块
| | |
| | | return request.Delete<Service.ResponseResult<any>>(`/order/api/v1/order/deleteById?id=${id}`) |
| | | } |
| | | |
| | | // 订单退款 |
| | | export function refundOrder(orderId: number | string) { |
| | | return request.Post<Service.ResponseResult<any>>('/order/api/v1/mini-program/order/refund', { orderId }) |
| | | } |
| | | |
| | | // 获取车队不分页列表 |
| | | export function getFleetList() { |
| | | return request.Post<Service.ResponseResult<any>>('/vehicleConvoy/api/v1/fleet/list') |
| | |
| | | </div> |
| | | |
| | | <!-- 支付功能 --> |
| | | <div class="manual-item"> |
| | | <!-- <div class="manual-item"> |
| | | <div class="check-label"> |
| | | 支付功能: |
| | | </div> |
| | |
| | | </template> |
| | | <span v-else class="no-data">-</span> |
| | | </div> |
| | | </div> |
| | | </div> --> |
| | | </div> |
| | | <div class="manual-check-grid mt-[16px]" style="grid-template-columns: repeat(2, 1fr);"> |
| | | <div class="detail-row"> |
| | |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="block"> |
| | | <!-- <div class="block"> |
| | | <div class="block-label">支付功能:</div> |
| | | <div class="thumb-list"> |
| | | <img |
| | |
| | | @error="(e: any) => { e.target.src = 'https://huishou-1323682843.cos.ap-nanjing.myqcloud.com/images/9bed493b-a6aa-4ef6-ac10-7f67f5c6adc5.png' }" |
| | | /> |
| | | </div> |
| | | </div> |
| | | </div> --> |
| | | </div> |
| | | |
| | | <div style="display: grid; grid-template-columns: 1fr 1fr"> |
| | |
| | | import { computed, onMounted, onUnmounted, ref } from 'vue' |
| | | import type { DataTableColumns, DataTableRowKey } from 'naive-ui' |
| | | import { useBoolean } from '@/hooks' |
| | | import { cancelAndCloseOrder, deleteOrder, exportOrderExcel, getFleetList, getOrderList } from '@/service/api/transaction' |
| | | import { cancelAndCloseOrder, deleteOrder, exportOrderExcel, getFleetList, getOrderList, refundOrder } from '@/service/api/transaction' |
| | | import { operationPageList } from '@/service/api/vehicleConvoy' |
| | | import { getRegionCascaderNoArea } from '@/service/api/operations' |
| | | import { NButton, NSpace, useMessage } from 'naive-ui' |
| | |
| | | count += 1 |
| | | if (row.status === 0) |
| | | count += 1 |
| | | if (row.status === 9 || row.status === 10 || row.status === 13) |
| | | count += 1 |
| | | return count |
| | | } |
| | | |
| | | function handleRefund(row: any) { |
| | | dialog.warning({ |
| | | title: '是否确认退款?', |
| | | content: '', |
| | | positiveText: '确定', |
| | | negativeText: '取消', |
| | | maskClosable: false, |
| | | autoFocus: false, |
| | | onPositiveClick: () => { |
| | | refundOrder(row.id!).then((res) => { |
| | | if (res.code === 200) { |
| | | message.success('退款成功') |
| | | getList() |
| | | } |
| | | }) |
| | | }, |
| | | }) |
| | | } |
| | | |
| | | const actionColumnWidth = computed(() => { |
| | |
| | | label: '已完成', |
| | | value: 10, |
| | | type: 'success', |
| | | }, |
| | | { |
| | | label: '退款中', |
| | | value: 11, |
| | | type: 'warning', |
| | | }, |
| | | { |
| | | label: '已退款', |
| | | value: 12, |
| | | type: 'success', |
| | | }, |
| | | { |
| | | label: '退款失败', |
| | | value: 13, |
| | | type: 'error', |
| | | }, |
| | | { |
| | | label: '已取消', |
| | |
| | | 改派 |
| | | </NButton> |
| | | )} |
| | | {(row.status === 9 || row.status === 10 || row.status === 13) && ( |
| | | <NButton |
| | | text |
| | | type="primary" |
| | | onClick={() => handleRefund(row)} |
| | | > |
| | | 退款 |
| | | </NButton> |
| | | )} |
| | | <NButton |
| | | text |
| | | v-permission="60111" |