diff --git a/apps/web-antd/src/api/mall/trade/delivery/pickUpStore/index.ts b/apps/web-antd/src/api/mall/trade/delivery/pickUpStore/index.ts index 3cce03875..fe1d9d395 100644 --- a/apps/web-antd/src/api/mall/trade/delivery/pickUpStore/index.ts +++ b/apps/web-antd/src/api/mall/trade/delivery/pickUpStore/index.ts @@ -35,6 +35,9 @@ export namespace MallDeliveryPickUpStoreApi { /** 绑定自提店员请求 */ export interface BindStaffRequest { + id?: number; + /** 门店名称 */ + name: string; /** 门店编号 */ storeId: number; /** 用户编号列表 */ diff --git a/apps/web-antd/src/views/mall/trade/delivery/pickUpStore/data.ts b/apps/web-antd/src/views/mall/trade/delivery/pickUpStore/data.ts new file mode 100644 index 000000000..65d1f0fb9 --- /dev/null +++ b/apps/web-antd/src/views/mall/trade/delivery/pickUpStore/data.ts @@ -0,0 +1,248 @@ +import type { VbenFormSchema } from '#/adapter/form'; +import type { VxeTableGridOptions } from '#/adapter/vxe-table'; + +import { z } from '#/adapter/form'; +import { getAreaTree } from '#/api/system/area'; +import { getSimpleUserList } from '#/api/system/user'; +import { + CommonStatusEnum, + DICT_TYPE, + getDictOptions, + getRangePickerDefaultProps, +} from '#/utils'; + +/** 新增/修改的表单 */ +export function useFormSchema(): VbenFormSchema[] { + return [ + { + component: 'Input', + fieldName: 'id', + dependencies: { + triggerFields: [''], + show: () => false, + }, + }, + { + component: 'ImageUpload', + fieldName: 'logo', + label: '门店logo', + componentProps: { + maxSize: 1, + }, + rules: 'required', + }, + { + component: 'Input', + fieldName: 'name', + label: '门店名称', + rules: 'required', + }, + { + component: 'Input', + fieldName: 'phone', + label: '门店手机', + rules: 'mobileRequired', + }, + { + component: 'Textarea', + fieldName: 'introduction', + label: '门店简介', + }, + { + fieldName: 'areaId', + label: '地址', + component: 'ApiTreeSelect', + componentProps: { + api: () => getAreaTree(), + fieldNames: { label: 'name', value: 'id', children: 'children' }, + }, + }, + { + component: 'Input', + fieldName: 'detailAddress', + label: '详细地址', + rules: 'required', + }, + { + component: 'TimePicker', + fieldName: 'openingTime', + label: '营业开始时间', + rules: 'required', + }, + { + component: 'TimePicker', + fieldName: 'closingTime', + label: '营业结束时间', + rules: 'required', + }, + { + component: 'Input', + fieldName: 'longitude', + label: '经度', + rules: 'required', + }, + { + component: 'Input', + fieldName: 'latitude', + label: '纬度', + rules: 'required', + }, + { + component: 'Input', + fieldName: 'getGeo', + label: '获取经纬度', + }, + { + fieldName: 'status', + label: '门店状态', + component: 'RadioGroup', + componentProps: { + options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'), + buttonStyle: 'solid', + optionType: 'button', + }, + rules: z.number().default(CommonStatusEnum.ENABLE), + }, + ]; +} + +/** 绑定店员的表单 */ +export function useBindFormSchema(): VbenFormSchema[] { + return [ + { + component: 'Input', + fieldName: 'id', + dependencies: { + triggerFields: [''], + show: () => false, + }, + }, + { + component: 'Input', + fieldName: 'name', + label: '门店名称', + dependencies: { + triggerFields: ['id'], + disabled: () => true, + }, + }, + { + component: 'ApiSelect', + fieldName: 'verifyUserIds', + label: '门店店员', + rules: 'required', + componentProps: { + api: () => getSimpleUserList(), + fieldNames: { label: 'nickname', value: 'id' }, + mode: 'tags', + allowClear: true, + }, + }, + { + component: 'Select', + fieldName: 'verifyUsers', + label: '店员列表', + rules: 'required', + componentProps: { + options: [], + mode: 'tags', + }, + dependencies: { + triggerFields: ['verifyUserIds'], + trigger(values, form) { + form.setFieldValue('verifyUsers', values.verifyUserIds); + }, + disabled: () => true, + }, + }, + ]; +} + +/** 列表的搜索表单 */ +export function useGridFormSchema(): VbenFormSchema[] { + return [ + { + fieldName: 'phone', + label: '门店手机', + component: 'Input', + }, + { + fieldName: 'name', + label: '门店名称', + component: 'Input', + }, + { + fieldName: 'status', + label: '门店状态', + component: 'Select', + componentProps: { + allowClear: true, + options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'), + }, + }, + { + fieldName: 'createTime', + label: '创建时间', + component: 'RangePicker', + componentProps: { + ...getRangePickerDefaultProps(), + allowClear: true, + }, + }, + ]; +} + +/** 列表的字段 */ +export function useGridColumns(): VxeTableGridOptions['columns'] { + return [ + { + field: 'id', + title: '编号', + }, + { + field: 'logo', + title: '门店logo', + cellRender: { + name: 'CellImage', + }, + }, + { + field: 'name', + title: '门店名称', + }, + { + field: 'phone', + title: '门店手机', + }, + { + field: 'detailAddress', + title: '地址', + }, + { + field: 'openingTime', + title: '营业时间', + formatter: ({ row }) => { + return `${row.openingTime} ~ ${row.closingTime}`; + }, + }, + { + field: 'status', + title: '开启状态', + cellRender: { + name: 'CellDict', + props: { type: DICT_TYPE.COMMON_STATUS }, + }, + }, + { + field: 'createTime', + title: '创建时间', + formatter: 'formatDateTime', + }, + { + title: '操作', + width: 200, + fixed: 'right', + slots: { default: 'actions' }, + }, + ]; +} diff --git a/apps/web-antd/src/views/mall/trade/delivery/pickUpStore/index.vue b/apps/web-antd/src/views/mall/trade/delivery/pickUpStore/index.vue index de4700a85..0fec6490a 100644 --- a/apps/web-antd/src/views/mall/trade/delivery/pickUpStore/index.vue +++ b/apps/web-antd/src/views/mall/trade/delivery/pickUpStore/index.vue @@ -1,34 +1,149 @@ diff --git a/apps/web-antd/src/views/mall/trade/delivery/pickUpStore/modules/bind-form.vue b/apps/web-antd/src/views/mall/trade/delivery/pickUpStore/modules/bind-form.vue new file mode 100644 index 000000000..8b16fbda2 --- /dev/null +++ b/apps/web-antd/src/views/mall/trade/delivery/pickUpStore/modules/bind-form.vue @@ -0,0 +1,87 @@ + + + diff --git a/apps/web-antd/src/views/mall/trade/delivery/pickUpStore/modules/form.vue b/apps/web-antd/src/views/mall/trade/delivery/pickUpStore/modules/form.vue new file mode 100644 index 000000000..f240a2626 --- /dev/null +++ b/apps/web-antd/src/views/mall/trade/delivery/pickUpStore/modules/form.vue @@ -0,0 +1,89 @@ + + +