|
@@ -1,5 +1,174 @@
|
|
|
<template>
|
|
|
- <div> 订单列表 </div>
|
|
|
+ <div class="p-4">
|
|
|
+ <BasicTable @register="registerTable">
|
|
|
+ <template #toolbar> </template>
|
|
|
+ <template #cover="{ record }">
|
|
|
+ <TableImg :size="150" :simpleShow="true" :imgList="[record.cover]" />
|
|
|
+ </template>
|
|
|
+ <template #action="{ record }">
|
|
|
+ <TableAction
|
|
|
+ :actions="[
|
|
|
+ {
|
|
|
+ icon: 'mdi:information-outline',
|
|
|
+ label: '详情',
|
|
|
+ onClick: () => {
|
|
|
+ go(`/order/list/detail/${record.orderNo}`);
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ icon: 'mdi:printer-outline',
|
|
|
+ label: '打印',
|
|
|
+ color: 'error',
|
|
|
+ onClick: () => {
|
|
|
+ createMessage.info(`暂未接入`);
|
|
|
+ },
|
|
|
+ },
|
|
|
+ ]"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ </BasicTable>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
+<script lang="ts">
|
|
|
+ import { defineComponent } from 'vue';
|
|
|
+ import {
|
|
|
+ BasicTable,
|
|
|
+ useTable,
|
|
|
+ BasicColumn,
|
|
|
+ FormProps,
|
|
|
+ TableAction,
|
|
|
+ TableImg,
|
|
|
+ } from '/@/components/Table';
|
|
|
+ import { useMessage } from '/@/hooks/web/useMessage';
|
|
|
+ import { uploadApi } from '/@/api/sys/upload';
|
|
|
+ // import { Switch } from 'ant-design-vue';
|
|
|
+ // import { h } from 'vue';
|
|
|
+ import { ListApi } from '/@/api/order/list';
|
|
|
+ import { useI18n } from '/@/hooks/web/useI18n';
|
|
|
+ // import { useCopyToClipboard } from '/@/hooks/web/useCopyToClipboard';
|
|
|
+ import { useGo } from '/@/hooks/web/usePage';
|
|
|
|
|
|
-<script lang="ts" setup></script>
|
|
|
+ export default defineComponent({
|
|
|
+ components: { BasicTable, TableAction, TableImg },
|
|
|
+ setup() {
|
|
|
+ const { createMessage } = useMessage();
|
|
|
+ const go = useGo();
|
|
|
+ const { t } = useI18n();
|
|
|
+ const columns: BasicColumn[] = [
|
|
|
+ {
|
|
|
+ title: 'ID',
|
|
|
+ dataIndex: 'id',
|
|
|
+ fixed: 'left',
|
|
|
+ width: 60,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '订单号',
|
|
|
+ dataIndex: 'orderNo',
|
|
|
+ width: 160,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '会员昵称',
|
|
|
+ dataIndex: 'name',
|
|
|
+ width: 80,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: 'VR场景',
|
|
|
+ dataIndex: 'scene.name',
|
|
|
+ width: 80,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '订单类型',
|
|
|
+ dataIndex: 'orderType',
|
|
|
+ width: 80,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '订单状态',
|
|
|
+ dataIndex: 'orderStatus',
|
|
|
+ width: 60,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '发货状态',
|
|
|
+ dataIndex: 'shipingStatus',
|
|
|
+ width: 60,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '付款状态',
|
|
|
+ dataIndex: 'paymentStatus',
|
|
|
+ width: 60,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '快递公司',
|
|
|
+ dataIndex: 'shipingCompany',
|
|
|
+ width: 60,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '快递单号',
|
|
|
+ dataIndex: 'shipingNo',
|
|
|
+ width: 80,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '实际支付金额',
|
|
|
+ dataIndex: 'shipingAmount',
|
|
|
+ width: 80,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '下单时间',
|
|
|
+ dataIndex: 'createTime',
|
|
|
+ width: 120,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '操作',
|
|
|
+ dataIndex: '',
|
|
|
+ slots: { customRender: 'action' },
|
|
|
+ fixed: 'right',
|
|
|
+ width: 140,
|
|
|
+ },
|
|
|
+ ];
|
|
|
+
|
|
|
+ const searchForm: Partial<FormProps> = {
|
|
|
+ labelWidth: 100,
|
|
|
+ schemas: [
|
|
|
+ {
|
|
|
+ field: 'orderNo',
|
|
|
+ label: '订单号',
|
|
|
+ component: 'Input',
|
|
|
+ colProps: {
|
|
|
+ xl: 5,
|
|
|
+ xxl: 5,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ field: 'userName',
|
|
|
+ label: '企业账号',
|
|
|
+ component: 'Input',
|
|
|
+ colProps: {
|
|
|
+ xl: 12,
|
|
|
+ xxl: 8,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ };
|
|
|
+
|
|
|
+ const [registerTable] = useTable({
|
|
|
+ title: '订单列表',
|
|
|
+ api: ListApi,
|
|
|
+ columns: columns,
|
|
|
+ useSearchForm: true,
|
|
|
+ formConfig: searchForm,
|
|
|
+ showTableSetting: true,
|
|
|
+ tableSetting: { fullScreen: true },
|
|
|
+ showIndexColumn: false,
|
|
|
+ rowKey: 'id',
|
|
|
+ pagination: { pageSize: 20 },
|
|
|
+ });
|
|
|
+
|
|
|
+ return {
|
|
|
+ registerTable,
|
|
|
+ createMessage,
|
|
|
+ t,
|
|
|
+ go,
|
|
|
+ uploadApi: uploadApi as any,
|
|
|
+ };
|
|
|
+ },
|
|
|
+ });
|
|
|
+</script>
|