feat(custom): 新增活动订单核销
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-04-12 18:54:54 +08:00
parent e139fed2a6
commit aba5d6d6c6
7 changed files with 1976 additions and 1004 deletions

View File

@@ -2,4 +2,6 @@ import { request } from '@/utils'
export default {
getOrder: (data) => request.post('/order', data),
// 核销订单
verifyOrder: (data) => request.post('/order/verify', data),
}

View File

@@ -20,7 +20,7 @@
</n-card>
<n-card ml-10 w-200 rounded-5>
<n-statistic label="总佣金" tabular-nums>
<n-number-animation :from="0" :to="cardData.commission" />
<n-number-animation :from="0" :to="cardData.commission" :precision="2" />
</n-statistic>
</n-card>
</div>
@@ -99,6 +99,7 @@
:data="data"
:pagination="pagination"
:bordered="false"
:scroll-x="2000"
remote
/>
</CommonPage>
@@ -106,6 +107,7 @@
<script setup>
import api from './api'
import { NButton, NPopconfirm } from 'naive-ui'
const loading = ref(false)
@@ -164,11 +166,15 @@ const columns = ref([
title: '订单号',
align: 'center',
key: 'oid',
width: 200,
fixed: 'left',
},
{
title: '用户',
align: 'center',
slot: 'user',
width: 100,
fixed: 'left',
render: (row) => {
return [
h(
@@ -301,14 +307,47 @@ const columns = ref([
align: 'center',
key: 'cancel_time',
},
// {
// title: '操作',
// align: 'center',
// slot: 'action',
// render() {
// // console.log(row)
// },
// },
{
title: '操作',
align: 'center',
slot: 'action',
fixed: 'right',
render(row) {
const el = []
if (row.status === 1) {
el.push(
h(
NPopconfirm,
{
onPositiveClick: async () => {
await api.verifyOrder({
oids: [row.oid],
})
getList()
},
onNegativeClick: () => $message.info('已取消'),
},
{
default: () => `确定核销此${row.oid}订单吗?`,
trigger: () =>
h(
NButton,
{
type: 'primary',
size: 'small',
text: true,
},
{
default: () => '核销',
}
),
}
)
)
}
return el
},
},
])
const data = ref([])