diff --git a/src/api/mall/product/channel.ts b/src/api/mall/product/channel.ts index c42c321d..be569333 100644 --- a/src/api/mall/product/channel.ts +++ b/src/api/mall/product/channel.ts @@ -2,12 +2,14 @@ import request from '@/config/axios' // 货道 VO export interface ChannelVO { - id: number // 表编号,自增 - name: string // 名称 - deviceId: string // 设备IMEI - cabinetChannel: string // 当前使用的货道或柜门编号 - maxNum: number // 最大货物数 - channelLine: number // 货道行号 + id?: number // 表编号,自增 + name?: string // 名称 + deviceId?: number | string // 设备ID(number)或设备IMEI(string,兼容字段) + deviceImei?: string // 设备IMEI(兼容字段) + cabinetChannel?: string // 当前使用的货道或柜门编号 + maxNum?: number // 最大货物数 + channelLine?: number // 货道行号 + createTime?: string // 创建时间 } // 货道 API @@ -40,5 +42,15 @@ export const ChannelApi = { // 导出货道 Excel exportChannel: async (params) => { return await request.download({ url: `/product/channel/export-excel`, params }) + }, + + // 测试货道 + testChannel: async (id: number) => { + return await request.post({ url: `/product/channel/channel-test?id=` + id }) + }, + + // 批量新增货道 + batchCreateChannel: async (data: { channels: ChannelVO[] }) => { + return await request.post({ url: `/product/channel/batch-create`, data }) } } diff --git a/src/api/mall/product/device-spu.ts b/src/api/mall/product/device-spu.ts new file mode 100644 index 00000000..9ca47441 --- /dev/null +++ b/src/api/mall/product/device-spu.ts @@ -0,0 +1,33 @@ +import request from '@/config/axios' +import type { Sku, Spu } from './spu' + +// 售货机商品 API(与商城商品分离) +export const DeviceSpuApi = { + // 分页查询售货机商品 + getDeviceSpuPage: async (params: PageParam) => { + return await request.get({ url: '/product/device-spu/page', params }) + }, + + // 获取售货机商品详情 + getDeviceSpu: async (id: number) => { + return await request.get({ url: `/product/device-spu/get-detail?id=${id}` }) + }, + + // 创建售货机商品 + createDeviceSpu: async (data: Spu) => { + return await request.post({ url: '/product/device-spu/create', data }) + }, + + // 更新售货机商品 + updateDeviceSpu: async (data: Spu) => { + return await request.put({ url: '/product/device-spu/update', data }) + }, + + // 删除售货机商品 + deleteDeviceSpu: async (id: number) => { + return await request.delete({ url: `/product/device-spu/delete?id=${id}` }) + } +} + +// 导出类型,方便其他地方使用 +export type { Spu, Sku } diff --git a/src/api/product/device/index.ts b/src/api/product/device/index.ts index ceb7afcd..24a4187d 100644 --- a/src/api/product/device/index.ts +++ b/src/api/product/device/index.ts @@ -50,8 +50,13 @@ export const DeviceApi = { return await request.download({ url: `/product/device/export-excel`, params }) }, - // 获取设备下拉列表(精简,自动根据当前登录用户过滤) + // 获取设备下拉列表(精简,全部,不按用户过滤) getDeviceListAllSimple: async () => { return await request.get({ url: `/product/device/list-all-simple` }) }, + + // 获取设备下拉列表(精简,按用户绑定过滤) + getDeviceListSimpleByUser: async () => { + return await request.get({ url: `/product/device/list-simple-by-user` }) + }, } diff --git a/src/views/Home/Index.vue b/src/views/Home/Index.vue index c59b9d22..42b77661 100644 --- a/src/views/Home/Index.vue +++ b/src/views/Home/Index.vue @@ -20,35 +20,35 @@ - - {{ t('workplace.project') }} - - - - - {{ t('workplace.toDo') }} - - - - - {{ t('workplace.access') }} - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -56,7 +56,7 @@ - + + + diff --git a/src/views/mall/product/containergoods/components/index.ts b/src/views/mall/product/containergoods/components/index.ts index e2cbe73d..5e4f1e34 100644 --- a/src/views/mall/product/containergoods/components/index.ts +++ b/src/views/mall/product/containergoods/components/index.ts @@ -1,5 +1,5 @@ import SkuList from './SkuList.vue' -import { Spu } from '@/api/mall/product/spu' +import type { Spu } from '@/api/mall/product/device-spu' interface PropertyAndValues { id: number diff --git a/src/views/mall/product/containergoods/form/DeliveryForm.vue b/src/views/mall/product/containergoods/form/DeliveryForm.vue index e7965ec8..5005e48f 100644 --- a/src/views/mall/product/containergoods/form/DeliveryForm.vue +++ b/src/views/mall/product/containergoods/form/DeliveryForm.vue @@ -32,7 +32,7 @@ import { PropType } from 'vue' import { copyValueToTarget } from '@/utils' import { propTypes } from '@/utils/propTypes' -import type { Spu } from '@/api/mall/product/spu' +import type { Spu } from '@/api/mall/product/device-spu' import * as ExpressTemplateApi from '@/api/mall/trade/delivery/expressTemplate' import { DICT_TYPE, getIntDictOptions } from '@/utils/dict' import { DeliveryTypeEnum } from '@/utils/constants' diff --git a/src/views/mall/product/containergoods/form/DescriptionForm.vue b/src/views/mall/product/containergoods/form/DescriptionForm.vue index 2980aa46..9e2979e8 100644 --- a/src/views/mall/product/containergoods/form/DescriptionForm.vue +++ b/src/views/mall/product/containergoods/form/DescriptionForm.vue @@ -8,7 +8,7 @@ diff --git a/src/views/mall/product/containergoods/form/OtherForm.vue b/src/views/mall/product/containergoods/form/OtherForm.vue index e7e63580..ae7cc79f 100644 --- a/src/views/mall/product/containergoods/form/OtherForm.vue +++ b/src/views/mall/product/containergoods/form/OtherForm.vue @@ -28,7 +28,7 @@ diff --git a/src/views/mall/product/containergoods/form/index.vue b/src/views/mall/product/containergoods/form/index.vue index 1401e50d..264e39d7 100644 --- a/src/views/mall/product/containergoods/form/index.vue +++ b/src/views/mall/product/containergoods/form/index.vue @@ -9,7 +9,7 @@ :propFormData="formData" /> - + - - - - - - - - - @@ -55,12 +31,9 @@ + + diff --git a/src/views/mall/product/channel/ChannelForm.vue b/src/views/mall/product/device/ChannelForm.vue similarity index 56% rename from src/views/mall/product/channel/ChannelForm.vue rename to src/views/mall/product/device/ChannelForm.vue index 890597e2..ef0eb563 100644 --- a/src/views/mall/product/channel/ChannelForm.vue +++ b/src/views/mall/product/device/ChannelForm.vue @@ -10,8 +10,14 @@ - - + + + @@ -31,6 +37,7 @@ + + diff --git a/src/views/mall/product/device/inde.vue b/src/views/mall/product/device/index.vue similarity index 93% rename from src/views/mall/product/device/inde.vue rename to src/views/mall/product/device/index.vue index d34e48b7..e7b10fd4 100644 --- a/src/views/mall/product/device/inde.vue +++ b/src/views/mall/product/device/index.vue @@ -70,6 +70,14 @@ type="success" plain @click="handleExport" :loading="exportLoading" 刷新小程序二维码 + + 货道管理 + 编辑 @@ -88,6 +96,8 @@ type="success" plain @click="handleExport" :loading="exportLoading" + + +