feat:【mall 商城】门店自提的迁移(antd 100%)

This commit is contained in:
YunaiV
2025-10-13 21:17:34 +08:00
parent 59b13842c4
commit 75c24789ff
3 changed files with 47 additions and 11 deletions

View File

@@ -49,6 +49,7 @@ export namespace MallOrderApi {
afterSaleStatus?: null | number; afterSaleStatus?: null | number;
/** 属性数组 */ /** 属性数组 */
properties?: ProductProperty[]; properties?: ProductProperty[];
price?: number;
} }
/** 订单日志 */ /** 订单日志 */

View File

@@ -111,12 +111,8 @@ export function useGridColumns(): VxeGridPropTypes.Columns {
{ {
field: 'spuName', field: 'spuName',
title: '商品信息', title: '商品信息',
minWidth: 100, minWidth: 300,
formatter: ({ row }) => { slots: { default: 'spuName' },
if (row.items.length > 1) {
return row.items.map((item: any) => item.spuName).join(',');
}
},
}, },
{ {
field: 'payPrice', field: 'payPrice',
@@ -134,9 +130,10 @@ export function useGridColumns(): VxeGridPropTypes.Columns {
title: '核销门店', title: '核销门店',
minWidth: 160, minWidth: 160,
formatter: ({ row }) => { formatter: ({ row }) => {
return pickUpStoreList.value.find( return (
(item) => item.id === row.pickUpStoreId, pickUpStoreList.value.find((item) => item.id === row.pickUpStoreId)
)?.name; ?.name || ''
);
}, },
}, },
{ {

View File

@@ -9,7 +9,7 @@ import { DeliveryTypeEnum } from '@vben/constants';
import { $t } from '@vben/locales'; import { $t } from '@vben/locales';
import { fenToYuan } from '@vben/utils'; import { fenToYuan } from '@vben/utils';
import { Card, Input, message } from 'ant-design-vue'; import { Card, Image, Input, message, Tag } from 'ant-design-vue';
import { TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; import { TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
import { import {
@@ -156,6 +156,9 @@ const [Grid, gridApi] = useVbenVxeGrid({
schema: useGridFormSchema(), schema: useGridFormSchema(),
}, },
gridOptions: { gridOptions: {
cellConfig: {
height: 100,
},
columns: useGridColumns(), columns: useGridColumns(),
height: 'auto', height: 'auto',
keepSource: true, keepSource: true,
@@ -226,8 +229,43 @@ const [Grid, gridApi] = useVbenVxeGrid({
/> />
</div> </div>
</Card> </Card>
<!-- TODO @AI商品信息的样式 -->
<Grid class="h-4/5" table-title="核销订单"> <Grid class="h-4/5" table-title="核销订单">
<template #spuName="{ row }">
<div class="flex flex-col gap-2">
<div
v-for="item in row.items"
:key="item.id!"
class="flex items-start gap-2"
>
<Image
:src="item.picUrl"
:alt="item.spuName"
:width="30"
:height="30"
class="flex-shrink-0"
:preview="{
src: item.picUrl,
}"
/>
<div class="flex flex-1 flex-col gap-1">
<span class="text-sm">{{ item.spuName }}</span>
<div class="flex flex-wrap gap-1">
<Tag
v-for="property in item.properties"
:key="property.propertyId!"
size="small"
>
{{ property.propertyName }}: {{ property.valueName }}
</Tag>
</div>
<span class="text-xs text-gray-500">
{{ fenToYuan(item.price!) }} x {{ item.count }}
</span>
</div>
</div>
</div>
</template>
<template #toolbar-tools> <template #toolbar-tools>
<TableAction <TableAction
:actions="[ :actions="[