完成订单模块

This commit is contained in:
gxwebsoft
2024-04-25 23:38:42 +08:00
parent a6cb9f7f78
commit 16e38b6f31
58 changed files with 6130 additions and 1753 deletions

View File

@@ -8,6 +8,7 @@
:columns="columns"
:datasource="datasource"
:customRow="customRow"
:scroll="{ x: 800 }"
tool-class="ele-toolbar-form"
class="sys-org-table"
>
@@ -21,28 +22,16 @@
/>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'userId'">
{{ record.nickname }}
</template>
<template v-if="column.key === 'image'">
<a-image :src="record.image" :width="50" />
</template>
<template v-if="column.key === 'status'">
<a-tag v-if="record.status === 0" color="green">已完成</a-tag>
<a-tag v-if="record.status === 1" color="red">待付款</a-tag>
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
</template>
<template v-if="column.key === 'action'">
<a-space>
<a @click="openEdit(record)">订单详情</a>
<template v-if="hasRole('superAdmin') || hasRole('admin')">
<a-divider type="vertical" />
<a-popconfirm
title="确定要删除此记录吗?"
@confirm="remove(record)"
>
<a class="ele-text-danger">删除</a>
</a-popconfirm>
</template>
<a @click="openEdit(record)">详情</a>
</a-space>
</template>
</template>
@@ -59,8 +48,7 @@
import { createVNode, ref } from 'vue';
import { message, Modal } from 'ant-design-vue';
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
import type { EleProTable } from 'ele-admin-pro';
import { toDateString } from 'ele-admin-pro';
import { EleProTable, toDateString } from "ele-admin-pro";
import type {
DatasourceFunction,
ColumnItem
@@ -69,7 +57,6 @@
import OrderEdit from './components/orderEdit.vue';
import { pageOrder, removeOrder, removeBatchOrder } from '@/api/shop/order';
import type { Order, OrderParam } from '@/api/shop/order/model';
import {hasRole} from "@/utils/permission";
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
@@ -107,49 +94,47 @@
// 表格列配置
const columns = ref<ColumnItem[]>([
{
title: 'ID',
title: '订单号',
dataIndex: 'orderId',
key: 'orderId',
align: 'center',
width: 90,
width: 90
},
{
title: '订单号',
dataIndex: 'orderNo',
key: 'orderNo',
align: 'center',
title: '姓名',
dataIndex: 'name',
key: 'name',
align: 'center'
},
// {
// title: '类型',
// dataIndex: 'type',
// key: 'type',
// align: 'center',
// customRender: ({ text }) => ['实物商品', '虚拟商品'][text]
// },
{
title: '用户昵称',
dataIndex: 'userId',
key: 'userId',
align: 'center',
title: '手机号',
dataIndex: 'phone',
key: 'phone',
width: 120,
align: 'center'
},
{
title: '总额',
dataIndex: 'totalPrice',
key: 'totalPrice',
align: 'center'
},
{
title: '减少金额',
dataIndex: 'reducePrice',
key: 'reducePrice',
align: 'center'
},
{
title: '实付金额',
dataIndex: 'payPrice',
key: 'payPrice',
align: 'center',
align: 'center'
},
{
title: '支付方式',
dataIndex: 'payMethod',
key: 'payMethod',
align: 'center',
},
{
title: '付款时间',
dataIndex: 'payTime',
key: 'payTime',
align: 'center',
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd')
dataIndex: 'payType',
key: 'payType',
align: 'center'
},
{
title: '付款状态',
@@ -158,36 +143,47 @@
align: 'center'
},
{
title: '排序',
dataIndex: 'sortNumber',
key: 'sortNumber',
align: 'center',
title: '订单状态',
dataIndex: 'orderStatus',
key: 'orderStatus',
align: 'center'
},
{
title: '优惠类型',
dataIndex: 'type',
key: 'type',
align: 'center'
},
{
title: '是否已开票',
dataIndex: 'isInvoice',
key: 'isInvoice',
align: 'center'
},
{
title: '付款时间',
dataIndex: 'payTime',
key: 'payTime',
align: 'center',
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
},
// {
// title: '申请退款时间',
// dataIndex: 'refundApplyTime',
// key: 'refundApplyTime',
// align: 'center',
// customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
// },
{
title: '备注',
dataIndex: 'comments',
key: 'comments',
align: 'center',
},
{
title: '状态',
dataIndex: 'status',
key: 'status',
align: 'center',
},
{
title: '下单时间',
dataIndex: 'createTime',
key: 'createTime',
align: 'center',
width: 180,
ellipsis: true,
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:MM:ss')
align: 'center'
},
{
title: '操作',
key: 'action',
width: 120,
width: 180,
fixed: 'right',
align: 'center',
hideInSetting: true