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

This commit is contained in:
YunaiV
2025-10-13 20:50:42 +08:00
parent e1cb380fdc
commit 59b13842c4
3 changed files with 78 additions and 30 deletions

View File

@@ -4,15 +4,24 @@ import type { MallDeliveryPickUpStoreApi } from '#/api/mall/trade/delivery/pickU
import { ref } from 'vue';
import { DeliveryTypeEnum, DICT_TYPE } from '@vben/constants';
import { DICT_TYPE } from '@vben/constants';
import { useUserStore } from '@vben/stores';
import { getSimpleDeliveryPickUpStoreList } from '#/api/mall/trade/delivery/pickUpStore';
import { getRangePickerDefaultProps } from '#/utils';
// TODO @芋艿:统一风格;
const userStore = useUserStore();
const pickUpStoreList = ref<MallDeliveryPickUpStoreApi.PickUpStore[]>([]);
/** 自提门店列表 */
getSimpleDeliveryPickUpStoreList().then((res) => {
pickUpStoreList.value = res;
// 移除自己无法核销的门店
const userId = userStore?.userInfo?.id;
pickUpStoreList.value = pickUpStoreList.value.filter((item) =>
item.verifyUserIds?.includes(userId),
);
});
/** 列表的搜索表单 */
@@ -28,20 +37,53 @@ export function useGridFormSchema(): VbenFormSchema[] {
},
},
{
fieldName: 'pickUpStoreId',
fieldName: 'pickUpStoreIds',
label: '自提门店',
component: 'ApiSelect',
component: 'Select',
componentProps: {
api: getSimpleDeliveryPickUpStoreList,
options: pickUpStoreList,
fieldNames: {
label: 'name',
value: 'id',
},
placeholder: '请选择自提门店',
},
dependencies: {
triggerFields: ['deliveryType'],
trigger: (values) =>
values.deliveryType === DeliveryTypeEnum.PICK_UP.type,
defaultValue: pickUpStoreList.value[0]?.id,
},
{
fieldName: 'no',
label: '订单号',
component: 'Input',
componentProps: {
placeholder: '请输入订单号',
allowClear: true,
},
},
{
fieldName: 'userId',
label: '用户 UID',
component: 'Input',
componentProps: {
placeholder: '请输入用户 UID',
allowClear: true,
},
},
{
fieldName: 'userNickname',
label: '用户昵称',
component: 'Input',
componentProps: {
placeholder: '请输入用户昵称',
allowClear: true,
},
},
{
fieldName: 'userMobile',
label: '用户电话',
component: 'Input',
componentProps: {
placeholder: '请输入用户电话',
allowClear: true,
},
},
];