diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ecom/order/model/dto/OrderFilterDTO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ecom/order/model/dto/OrderFilterDTO.java index 046474a4..5cf1e8ee 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ecom/order/model/dto/OrderFilterDTO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ecom/order/model/dto/OrderFilterDTO.java @@ -1,5 +1,6 @@ package top.xyquan.ecomdmbbackend.modules.ecom.order.model.dto; +import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; @@ -46,13 +47,15 @@ public class OrderFilterDTO { /** * 下单时间范围-开始时间 */ - @Schema(description = "下单时间范围-开始时间", example = "2024-01-01T00:00:00") + @Schema(description = "下单时间范围-开始时间", example = "2024-01-01 00:00:00") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private LocalDateTime startOrderTime; /** * 下单时间范围-结束时间 */ - @Schema(description = "下单时间范围-结束时间", example = "2024-12-31T23:59:59") + @Schema(description = "下单时间范围-结束时间", example = "2024-12-31 23:59:59") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private LocalDateTime endOrderTime; /** diff --git a/ecom-dmb-frontend/apps/web-antd/src/views/ecommerce/order/index.vue b/ecom-dmb-frontend/apps/web-antd/src/views/ecommerce/order/index.vue index 6b82bfe9..9ab93dd4 100644 --- a/ecom-dmb-frontend/apps/web-antd/src/views/ecommerce/order/index.vue +++ b/ecom-dmb-frontend/apps/web-antd/src/views/ecommerce/order/index.vue @@ -12,7 +12,17 @@ import { useRouter } from 'vue-router'; import { Page } from '@vben/common-ui'; import { createIconifyIcon } from '@vben/icons'; -import { Button, message, Popconfirm, Popover, Space, Tag } from 'ant-design-vue'; +import dayjs from 'dayjs'; + +import { + Button, + DatePicker, + message, + Popconfirm, + Popover, + Space, + Tag, +} from 'ant-design-vue'; import { useVbenVxeGrid } from '#/adapter/vxe-table'; import { deleteOrderApi, getOrderPageApi } from '#/api/ecommerce/order'; @@ -55,6 +65,8 @@ const searchForm = ref({ platformOrderNo: '', shopId: undefined as number | undefined, statusId: undefined as number | undefined, + startOrderTime: undefined as string | undefined, + endOrderTime: undefined as string | undefined, }); // 当前排序状态 @@ -163,6 +175,27 @@ const gridOptions: VxeGridProps = { sortable: true, slots: { default: 'receivedAmount' }, }, + { + field: 'productCost', + title: '商品成本', + minWidth: 'auto', + sortable: true, + slots: { default: 'productCost' }, + }, + { + field: 'shippingCost', + title: '运费', + minWidth: 'auto', + sortable: true, + slots: { default: 'shippingCost' }, + }, + { + field: 'otherCost', + title: '其他成本', + minWidth: 'auto', + sortable: true, + slots: { default: 'otherCost' }, + }, { title: '订单状态', minWidth: 'auto', @@ -244,6 +277,8 @@ const gridOptions: VxeGridProps = { undefined, shopId: searchParams.shopId ?? searchForm.value.shopId, statusId: searchParams.statusId ?? searchForm.value.statusId, + startOrderTime: searchForm.value.startOrderTime, + endOrderTime: searchForm.value.endOrderTime, }; const params: PageQueryDTO = { page: page.currentPage, @@ -326,6 +361,27 @@ const formOptions = computed(() => ({ fieldName: 'statusId', label: '订单状态', }, + { + component: 'RangePicker', + componentProps: { + placeholder: ['下单开始时间', '下单结束时间'], + allowClear: true, + showTime: { format: 'HH:mm:ss' }, + format: 'YYYY-MM-DD HH:mm:ss', + style: { width: '100%' }, + onChange: (val: any) => { + searchForm.value.startOrderTime = val && val[0] + ? (val[0] as dayjs.Dayjs).format('YYYY-MM-DD HH:mm:ss') + : undefined; + searchForm.value.endOrderTime = val && val[1] + ? (val[1] as dayjs.Dayjs).format('YYYY-MM-DD HH:mm:ss') + : undefined; + gridReloadRef.value?.(); + }, + }, + fieldName: 'orderTimeRange', + label: '下单时间', + }, ], showDefaultActions: true, collapsed: true, @@ -486,6 +542,27 @@ onMounted(async () => { + + + + + + + + +