diff --git a/.env.development b/.env.development index e774d25..dc23e2f 100644 --- a/.env.development +++ b/.env.development @@ -1,10 +1,10 @@ VITE_APP_NAME=后台管理系统 VITE_SOCKET_URL=wss://server.gxwebsoft.com VITE_SERVER_URL=https://server.gxwebsoft.com/api -#VITE_API_URL=https://cms-api.websoft.top/api +VITE_API_URL=https://cms-api.websoft.top/api #VITE_SOCKET_URL=ws://127.0.0.1:9191 #VITE_SERVER_URL=http://127.0.0.1:8000/api -VITE_API_URL=http://127.0.0.1:9000/api +#VITE_API_URL=http://127.0.0.1:9000/api #/booking/bookingItem diff --git a/src/api/hjm/hjmCar/model/index.ts b/src/api/hjm/hjmCar/model/index.ts index b0438eb..3cfd34f 100644 --- a/src/api/hjm/hjmCar/model/index.ts +++ b/src/api/hjm/hjmCar/model/index.ts @@ -23,6 +23,8 @@ export interface HjmCar { driverId?: number; // 操作员名称 driver?: string; + // 操作员名称 + driverName?: string; // 操作员手机号 driverPhone?: string; // 保险状态 @@ -53,6 +55,8 @@ export interface HjmCar { organizationParentId?: number; // 用户ID userId?: number; + // 认领状态 + claim?: number; // 绑定用户 toUser?: string; // 排序(数字越小越靠前) diff --git a/src/api/shop/shopCommissionRole/index.ts b/src/api/shop/shopCommissionRole/index.ts new file mode 100644 index 0000000..60db05d --- /dev/null +++ b/src/api/shop/shopCommissionRole/index.ts @@ -0,0 +1,105 @@ +import request from '@/utils/request'; +import type { ApiResult, PageResult } from '@/api'; +import type { ShopCommissionRole, ShopCommissionRoleParam } from './model'; + +/** + * 分页查询分红角色 + */ +export async function pageShopCommissionRole(params: ShopCommissionRoleParam) { + const res = await request.get>>( + '/shop/shop-commission-role/page', + { + params + } + ); + if (res.data.code === 0) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 查询分红角色列表 + */ +export async function listShopCommissionRole(params?: ShopCommissionRoleParam) { + const res = await request.get>( + '/shop/shop-commission-role', + { + params + } + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 添加分红角色 + */ +export async function addShopCommissionRole(data: ShopCommissionRole) { + const res = await request.post>( + '/shop/shop-commission-role', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 修改分红角色 + */ +export async function updateShopCommissionRole(data: ShopCommissionRole) { + const res = await request.put>( + '/shop/shop-commission-role', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 删除分红角色 + */ +export async function removeShopCommissionRole(id?: number) { + const res = await request.delete>( + '/shop/shop-commission-role/' + id + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 批量删除分红角色 + */ +export async function removeBatchShopCommissionRole(data: (number | undefined)[]) { + const res = await request.delete>( + '/shop/shop-commission-role/batch', + { + data + } + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 根据id查询分红角色 + */ +export async function getShopCommissionRole(id: number) { + const res = await request.get>( + '/shop/shop-commission-role/' + id + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} diff --git a/src/api/shop/shopCommissionRole/model/index.ts b/src/api/shop/shopCommissionRole/model/index.ts new file mode 100644 index 0000000..4309104 --- /dev/null +++ b/src/api/shop/shopCommissionRole/model/index.ts @@ -0,0 +1,35 @@ +import type { PageParam } from '@/api'; + +/** + * 分红角色 + */ +export interface ShopCommissionRole { + // + id?: number; + // + title?: string; + // + provinceId?: number; + // + cityId?: number; + // + regionId?: number; + // 状态, 0正常, 1异常 + status?: number; + // 备注 + comments?: string; + // 租户id + tenantId?: number; + // 创建时间 + createTime?: string; + // + sortNumber?: number; +} + +/** + * 分红角色搜索条件 + */ +export interface ShopCommissionRoleParam extends PageParam { + id?: number; + keywords?: string; +} diff --git a/src/api/shop/shopExpress/index.ts b/src/api/shop/shopExpress/index.ts new file mode 100644 index 0000000..6ded8bb --- /dev/null +++ b/src/api/shop/shopExpress/index.ts @@ -0,0 +1,106 @@ +import request from '@/utils/request'; +import type { ApiResult, PageResult } from '@/api'; +import type { ShopExpress, ShopExpressParam } from './model'; +import { MODULES_API_URL } from '@/config/setting'; + +/** + * 分页查询物流公司 + */ +export async function pageShopExpress(params: ShopExpressParam) { + const res = await request.get>>( + MODULES_API_URL + '/shop/shop-express/page', + { + params + } + ); + if (res.data.code === 0) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 查询物流公司列表 + */ +export async function listShopExpress(params?: ShopExpressParam) { + const res = await request.get>( + MODULES_API_URL + '/shop/shop-express', + { + params + } + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 添加物流公司 + */ +export async function addShopExpress(data: ShopExpress) { + const res = await request.post>( + MODULES_API_URL + '/shop/shop-express', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 修改物流公司 + */ +export async function updateShopExpress(data: ShopExpress) { + const res = await request.put>( + MODULES_API_URL + '/shop/shop-express', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 删除物流公司 + */ +export async function removeShopExpress(id?: number) { + const res = await request.delete>( + MODULES_API_URL + '/shop/shop-express/' + id + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 批量删除物流公司 + */ +export async function removeBatchShopExpress(data: (number | undefined)[]) { + const res = await request.delete>( + MODULES_API_URL + '/shop/shop-express/batch', + { + data + } + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 根据id查询物流公司 + */ +export async function getShopExpress(id: number) { + const res = await request.get>( + MODULES_API_URL + '/shop/shop-express/' + id + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} diff --git a/src/api/shop/shopExpress/model/index.ts b/src/api/shop/shopExpress/model/index.ts new file mode 100644 index 0000000..24d2098 --- /dev/null +++ b/src/api/shop/shopExpress/model/index.ts @@ -0,0 +1,35 @@ +import type { PageParam } from '@/api'; + +/** + * 物流公司 + */ +export interface ShopExpress { + // 物流公司ID + expressId?: number; + // 物流公司名称 + expressName?: string; + // 物流公司编码 (微信) + wxCode?: string; + // 物流公司编码 (快递100) + kuaidi100Code?: string; + // 物流公司编码 (快递鸟) + kdniaoCode?: string; + // 排序号 + sortNumber?: number; + // 是否删除, 0否, 1是 + deleted?: number; + // 租户id + tenantId?: number; + // 创建时间 + createTime?: string; + // 修改时间 + updateTime?: string; +} + +/** + * 物流公司搜索条件 + */ +export interface ShopExpressParam extends PageParam { + expressId?: number; + keywords?: string; +} diff --git a/src/api/shop/shopExpressTemplate/index.ts b/src/api/shop/shopExpressTemplate/index.ts new file mode 100644 index 0000000..b9c556f --- /dev/null +++ b/src/api/shop/shopExpressTemplate/index.ts @@ -0,0 +1,106 @@ +import request from '@/utils/request'; +import type { ApiResult, PageResult } from '@/api'; +import type { ShopExpressTemplate, ShopExpressTemplateParam } from './model'; +import { MODULES_API_URL } from '@/config/setting'; + +/** + * 分页查询运费模板 + */ +export async function pageShopExpressTemplate(params: ShopExpressTemplateParam) { + const res = await request.get>>( + MODULES_API_URL + '/shop/shop-express-template/page', + { + params + } + ); + if (res.data.code === 0) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 查询运费模板列表 + */ +export async function listShopExpressTemplate(params?: ShopExpressTemplateParam) { + const res = await request.get>( + MODULES_API_URL + '/shop/shop-express-template', + { + params + } + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 添加运费模板 + */ +export async function addShopExpressTemplate(data: ShopExpressTemplate) { + const res = await request.post>( + MODULES_API_URL + '/shop/shop-express-template', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 修改运费模板 + */ +export async function updateShopExpressTemplate(data: ShopExpressTemplate) { + const res = await request.put>( + MODULES_API_URL + '/shop/shop-express-template', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 删除运费模板 + */ +export async function removeShopExpressTemplate(id?: number) { + const res = await request.delete>( + MODULES_API_URL + '/shop/shop-express-template/' + id + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 批量删除运费模板 + */ +export async function removeBatchShopExpressTemplate(data: (number | undefined)[]) { + const res = await request.delete>( + MODULES_API_URL + '/shop/shop-express-template/batch', + { + data + } + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 根据id查询运费模板 + */ +export async function getShopExpressTemplate(id: number) { + const res = await request.get>( + MODULES_API_URL + '/shop/shop-express-template/' + id + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} diff --git a/src/api/shop/shopExpressTemplate/model/index.ts b/src/api/shop/shopExpressTemplate/model/index.ts new file mode 100644 index 0000000..efbf3ee --- /dev/null +++ b/src/api/shop/shopExpressTemplate/model/index.ts @@ -0,0 +1,41 @@ +import type { PageParam } from '@/api'; + +/** + * 运费模板 + */ +export interface ShopExpressTemplate { + // + id?: number; + // + type?: string; + // + title?: string; + // 收件价格 + firstAmount?: string; + // 续件价格 + extraAmount?: string; + // 状态, 0已发布, 1待审核 2已驳回 3违规内容 + status?: number; + // 是否删除, 0否, 1是 + deleted?: number; + // 租户id + tenantId?: number; + // 创建时间 + createTime?: string; + // 修改时间 + updateTime?: string; + // + sortNumber?: number; + // 首件数量/重量 + firstNum?: string; + // 续件数量/重量 + extraNum?: string; +} + +/** + * 运费模板搜索条件 + */ +export interface ShopExpressTemplateParam extends PageParam { + id?: number; + keywords?: string; +} diff --git a/src/api/shop/shopExpressTemplateDetail/index.ts b/src/api/shop/shopExpressTemplateDetail/index.ts new file mode 100644 index 0000000..9ca4f8f --- /dev/null +++ b/src/api/shop/shopExpressTemplateDetail/index.ts @@ -0,0 +1,106 @@ +import request from '@/utils/request'; +import type { ApiResult, PageResult } from '@/api'; +import type { ShopExpressTemplateDetail, ShopExpressTemplateDetailParam } from './model'; +import { MODULES_API_URL } from '@/config/setting'; + +/** + * 分页查询运费模板 + */ +export async function pageShopExpressTemplateDetail(params: ShopExpressTemplateDetailParam) { + const res = await request.get>>( + MODULES_API_URL + '/shop/shop-express-template-detail/page', + { + params + } + ); + if (res.data.code === 0) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 查询运费模板列表 + */ +export async function listShopExpressTemplateDetail(params?: ShopExpressTemplateDetailParam) { + const res = await request.get>( + MODULES_API_URL + '/shop/shop-express-template-detail', + { + params + } + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 添加运费模板 + */ +export async function addShopExpressTemplateDetail(data: ShopExpressTemplateDetail) { + const res = await request.post>( + MODULES_API_URL + '/shop/shop-express-template-detail', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 修改运费模板 + */ +export async function updateShopExpressTemplateDetail(data: ShopExpressTemplateDetail) { + const res = await request.put>( + MODULES_API_URL + '/shop/shop-express-template-detail', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 删除运费模板 + */ +export async function removeShopExpressTemplateDetail(id?: number) { + const res = await request.delete>( + MODULES_API_URL + '/shop/shop-express-template-detail/' + id + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 批量删除运费模板 + */ +export async function removeBatchShopExpressTemplateDetail(data: (number | undefined)[]) { + const res = await request.delete>( + MODULES_API_URL + '/shop/shop-express-template-detail/batch', + { + data + } + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 根据id查询运费模板 + */ +export async function getShopExpressTemplateDetail(id: number) { + const res = await request.get>( + MODULES_API_URL + '/shop/shop-express-template-detail/' + id + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} diff --git a/src/api/shop/shopExpressTemplateDetail/model/index.ts b/src/api/shop/shopExpressTemplateDetail/model/index.ts new file mode 100644 index 0000000..5b74dcc --- /dev/null +++ b/src/api/shop/shopExpressTemplateDetail/model/index.ts @@ -0,0 +1,45 @@ +import type { PageParam } from '@/api'; + +/** + * 运费模板 + */ +export interface ShopExpressTemplateDetail { + // + id?: number; + // + templateId?: number; + // 0按件 + type?: string; + // + provinceId?: number; + // + cityId?: number; + // 首件数量/重量 + firstNum?: string; + // 收件价格 + firstAmount?: string; + // 续件价格 + extraAmount?: string; + // 续件数量/重量 + extraNum?: string; + // 状态, 0已发布, 1待审核 2已驳回 3违规内容 + status?: number; + // 是否删除, 0否, 1是 + deleted?: number; + // 租户id + tenantId?: number; + // 创建时间 + createTime?: string; + // 修改时间 + updateTime?: string; + // + sortNumber?: number; +} + +/** + * 运费模板搜索条件 + */ +export interface ShopExpressTemplateDetailParam extends PageParam { + id?: number; + keywords?: string; +} diff --git a/src/api/shop/shopGoods/index.ts b/src/api/shop/shopGoods/index.ts new file mode 100644 index 0000000..580cd69 --- /dev/null +++ b/src/api/shop/shopGoods/index.ts @@ -0,0 +1,116 @@ +import request from '@/utils/request'; +import type { ApiResult, PageResult } from '@/api'; +import type { ShopGoods, ShopGoodsParam } from './model'; +import { MODULES_API_URL } from '@/config/setting'; + +/** + * 分页查询商品 + */ +export async function pageShopGoods(params: ShopGoodsParam) { + const res = await request.get>>( + MODULES_API_URL + '/shop/shop-goods/page', + { + params + } + ); + if (res.data.code === 0) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 查询商品列表 + */ +export async function listShopGoods(params?: ShopGoodsParam) { + const res = await request.get>( + MODULES_API_URL + '/shop/shop-goods', + { + params + } + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 添加商品 + */ +export async function addShopGoods(data: ShopGoods) { + const res = await request.post>( + MODULES_API_URL + '/shop/shop-goods', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 修改商品 + */ +export async function updateShopGoods(data: ShopGoods) { + const res = await request.put>( + MODULES_API_URL + '/shop/shop-goods', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 删除商品 + */ +export async function removeShopGoods(id?: number) { + const res = await request.delete>( + MODULES_API_URL + '/shop/shop-goods/' + id + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 批量删除商品 + */ +export async function removeBatchShopGoods(data: (number | undefined)[]) { + const res = await request.delete>( + MODULES_API_URL + '/shop/shop-goods/batch', + { + data + } + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 根据id查询商品 + */ +export async function getShopGoods(id: number) { + const res = await request.get>( + MODULES_API_URL + '/shop/shop-goods/' + id + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +export async function getCount(params: ShopGoodsParam) { + const res = await request.get(MODULES_API_URL + '/shop/shop-goods/data', { + params + }); + if (res.data.code === 0) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} diff --git a/src/api/shop/shopGoods/model/index.ts b/src/api/shop/shopGoods/model/index.ts new file mode 100644 index 0000000..ecc1057 --- /dev/null +++ b/src/api/shop/shopGoods/model/index.ts @@ -0,0 +1,147 @@ +import type { PageParam } from '@/api'; +import { ShopGoodsSpec } from '@/api/shop/shopGoodsSpec/model'; +import { ShopGoodsSku } from '@/api/shop/shopGoodsSku/model'; +import { ShopGoodsRoleCommission } from '@/api/shop/shopGoodsRoleCommission/model'; + +export interface GoodsCount { + totalNum: number; + totalNum2: number; + totalNum3: number; + totalNum4: number; +} +/** + * 商品记录表 + */ +export interface ShopGoods { + // 自增ID + goodsId?: number; + // 类型 1实物商品 2虚拟商品 + type?: number; + // 商品编码 + code?: string; + // 商品名称 + name?: string; + // 商品标题 + goodsName?: string; + // 商品封面图 + image?: string; + video?: string; + // 商品详情 + content?: string; + canExpress?: number; + // 商品分类 + category?: string; + // 商品分类ID + categoryId?: number; + parentName?: string; + categoryName?: string; + // 一级分类 + categoryParent?: string; + // 二级分类 + categoryChildren?: string; + // 商品规格 0单规格 1多规格 + specs?: number; + commissionRole?: number; + // 货架 + position?: string; + // 进货价 + buyingPrice?: string; + // 商品价格 + price?: string; + originPrice?: string; + // 销售价格 + salePrice?: string; + chainStorePrice?: string; + chainStoreRate?: string; + memberStoreRate?: string; + memberMarketRate?: string; + memberStoreCommission?: string; + supplierCommission?: string; + coopCommission?: string; + memberStorePrice?: string; + memberMarketPrice?: string; + // 经销商价格 + dealerPrice?: string; + // 有赠品 + buyingGift?: boolean; + // 有赠品 + priceGift?: boolean; + // 有赠品 + dealerGift?: boolean; + buyingGiftNum?: number; + priceGiftNum?: number; + priceGiftName?: string; + dealerGiftNum?: number; + // 库存计算方式(10下单减库存 20付款减库存) + deductStockType?: number; + // 封面图 + files?: string; + // 销量 + sales?: number; + isNew?: number; + // 库存 + stock?: number; + // 商品重量 + goodsWeight?: number; + // 消费赚取积分 + gainIntegral?: number; + // 推荐 + recommend?: number; + // 商户ID + merchantId?: number; + // 商户名称 + merchantName?: string; + supplierMerchantId?: number; + supplierName?: string; + // 状态(0:未上架,1:上架) + isShow?: number; + // 状态, 0上架 1待上架 2待审核 3审核不通过 + status?: number; + // 备注 + comments?: string; + // 排序号 + sortNumber?: number; + // 用户ID + userId?: number; + // 是否删除, 0否, 1是 + deleted?: number; + // 租户id + tenantId?: number; + // 创建时间 + createTime?: string; + // 修改时间 + updateTime?: string; + // 显示规格名 + specName?: string; + // 商品规格 + goodsSpecs?: ShopGoodsSpec[]; + goodsRoleCommission?: ShopGoodsRoleCommission[]; + // 商品sku列表 + goodsSkus?: ShopGoodsSku[]; + // 单位名称 + unitName?: string; + expressTemplateId?: number; + canUseDate?: string; + ensureTag?: string; + expiredDay?: number; +} + +export interface BathSet { + price?: number; + salePrice?: number; + stock?: number; + skuNo?: string; +} + +/** + * 商品记录表搜索条件 + */ +export interface ShopGoodsParam extends PageParam { + parentId?: number; + categoryId?: number; + goodsId?: number; + goodsName?: string; + isShow?: number; + stock?: number; + keywords?: string; +} diff --git a/src/api/shop/shopGoodsCategory/index.ts b/src/api/shop/shopGoodsCategory/index.ts new file mode 100644 index 0000000..dbdf598 --- /dev/null +++ b/src/api/shop/shopGoodsCategory/index.ts @@ -0,0 +1,106 @@ +import request from '@/utils/request'; +import type { ApiResult, PageResult } from '@/api'; +import type { ShopGoodsCategory, ShopGoodsCategoryParam } from './model'; +import { MODULES_API_URL } from '@/config/setting'; + +/** + * 分页查询商品分类 + */ +export async function pageShopGoodsCategory(params: ShopGoodsCategoryParam) { + const res = await request.get>>( + MODULES_API_URL + '/shop/shop-goods-category/page', + { + params + } + ); + if (res.data.code === 0) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 查询商品分类列表 + */ +export async function listShopGoodsCategory(params?: ShopGoodsCategoryParam) { + const res = await request.get>( + MODULES_API_URL + '/shop/shop-goods-category', + { + params + } + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 添加商品分类 + */ +export async function addShopGoodsCategory(data: ShopGoodsCategory) { + const res = await request.post>( + MODULES_API_URL + '/shop/shop-goods-category', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 修改商品分类 + */ +export async function updateShopGoodsCategory(data: ShopGoodsCategory) { + const res = await request.put>( + MODULES_API_URL + '/shop/shop-goods-category', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 删除商品分类 + */ +export async function removeShopGoodsCategory(id?: number) { + const res = await request.delete>( + MODULES_API_URL + '/shop/shop-goods-category/' + id + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 批量删除商品分类 + */ +export async function removeBatchShopGoodsCategory(data: (number | undefined)[]) { + const res = await request.delete>( + MODULES_API_URL + '/shop/shop-goods-category/batch', + { + data + } + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 根据id查询商品分类 + */ +export async function getShopGoodsCategory(id: number) { + const res = await request.get>( + MODULES_API_URL + '/shop/shop-goods-category/' + id + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} diff --git a/src/api/shop/shopGoodsCategory/model/index.ts b/src/api/shop/shopGoodsCategory/model/index.ts new file mode 100644 index 0000000..13fefa1 --- /dev/null +++ b/src/api/shop/shopGoodsCategory/model/index.ts @@ -0,0 +1,64 @@ +import type { PageParam } from '@/api'; + +/** + * 商品分类 + */ +export interface ShopGoodsCategory { + // 商品分类ID + categoryId?: number; + // 分类标识 + categoryCode?: string; + // 分类名称 + title?: string; + // 类型 0商城分类 1外卖分类 + type?: number; + // 分类图片 + image?: string; + // 上级分类ID + parentId?: number; + // 路由/链接地址 + path?: string; + // 组件路径 + component?: string; + // 绑定的页面 + pageId?: number; + // 用户ID + userId?: number; + // 商品数量 + count?: number; + // 排序(数字越小越靠前) + sortNumber?: number; + // 备注 + comments?: string; + // 是否隐藏, 0否, 1是(仅注册路由不显示在左侧菜单) + hide?: number; + // 是否推荐 + recommend?: number; + // 是否显示在首页 + showIndex?: number; + // 商铺ID + merchantId?: number; + // 状态, 0正常, 1禁用 + status?: number; + // 是否删除, 0否, 1是 + deleted?: number; + // 租户id + tenantId?: number; + // 注册时间 + createTime?: string; + // 修改时间 + updateTime?: string; + // 子菜单 + children?: ShopGoodsCategory[]; + key?: number; + value?: number; + label?: string; +} + +/** + * 商品分类搜索条件 + */ +export interface ShopGoodsCategoryParam extends PageParam { + categoryId?: number; + keywords?: string; +} diff --git a/src/api/shop/shopGoodsRoleCommission/index.ts b/src/api/shop/shopGoodsRoleCommission/index.ts new file mode 100644 index 0000000..ac3c88b --- /dev/null +++ b/src/api/shop/shopGoodsRoleCommission/index.ts @@ -0,0 +1,106 @@ +import request from '@/utils/request'; +import type { ApiResult, PageResult } from '@/api'; +import { MODULES_API_URL } from '@/config/setting'; +import { ShopGoodsRoleCommission, ShopGoodsRoleCommissionParam } from '@/api/shop/shopGoodsRoleCommission/model'; + +/** + * 分页查询商品绑定角色的分润金额 + */ +export async function pageShopGoodsRoleCommission(params: ShopGoodsRoleCommissionParam) { + const res = await request.get>>( + MODULES_API_URL + '/shop/shop-goods-role-commission/page', + { + params + } + ); + if (res.data.code === 0) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 查询商品绑定角色的分润金额列表 + */ +export async function listShopGoodsRoleCommission(params?: ShopGoodsRoleCommissionParam) { + const res = await request.get>( + MODULES_API_URL + '/shop/shop-goods-role-commission', + { + params + } + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 添加商品绑定角色的分润金额 + */ +export async function addShopGoodsRoleCommission(data: ShopGoodsRoleCommission) { + const res = await request.post>( + MODULES_API_URL + '/shop/shop-goods-role-commission', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 修改商品绑定角色的分润金额 + */ +export async function updateShopGoodsRoleCommission(data: ShopGoodsRoleCommission) { + const res = await request.put>( + MODULES_API_URL + '/shop/shop-goods-role-commission', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 删除商品绑定角色的分润金额 + */ +export async function removeShopGoodsRoleCommission(id?: number) { + const res = await request.delete>( + MODULES_API_URL + '/shop/shop-goods-role-commission/' + id + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 批量删除商品绑定角色的分润金额 + */ +export async function removeBatchShopGoodsRoleCommission(data: (number | undefined)[]) { + const res = await request.delete>( + MODULES_API_URL + '/shop/shop-goods-role-commission/batch', + { + data + } + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 根据id查询商品绑定角色的分润金额 + */ +export async function getShopGoodsRoleCommission(id: number) { + const res = await request.get>( + MODULES_API_URL + '/shop/shop-goods-role-commission/' + id + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} diff --git a/src/api/shop/shopGoodsRoleCommission/model/index.ts b/src/api/shop/shopGoodsRoleCommission/model/index.ts new file mode 100644 index 0000000..54384fc --- /dev/null +++ b/src/api/shop/shopGoodsRoleCommission/model/index.ts @@ -0,0 +1,35 @@ +import type { PageParam } from '@/api'; + +/** + * 商品绑定角色的分润金额 + */ +export interface ShopGoodsRoleCommission { + // + id?: number; + // + roleId?: number; + // + goodsId?: number; + // + sku?: string; + // + amount?: string; + // 状态, 0正常, 1异常 + status?: number; + // 备注 + comments?: string; + // 租户id + tenantId?: number; + // 创建时间 + createTime?: string; + // + sortNumber?: number; +} + +/** + * 商品绑定角色的分润金额搜索条件 + */ +export interface ShopGoodsRoleCommissionParam extends PageParam { + id?: number; + keywords?: string; +} diff --git a/src/api/shop/shopGoodsSku/index.ts b/src/api/shop/shopGoodsSku/index.ts new file mode 100644 index 0000000..2d0d926 --- /dev/null +++ b/src/api/shop/shopGoodsSku/index.ts @@ -0,0 +1,118 @@ +import request from '@/utils/request'; +import type { ApiResult, PageResult } from '@/api'; +import { MODULES_API_URL } from '@/config/setting'; +import { ShopGoodsSpec } from '@/api/shop/shopGoodsSpec/model'; +import { ShopGoodsSku, ShopGoodsSkuParam } from '@/api/shop/shopGoodsSku/model'; + +export async function generateGoodsSku(data: ShopGoodsSpec) { + const res = await request.post>( + MODULES_API_URL + '/shop/goods-sku/generateGoodsSku', + data + ); + if (res.data.code === 0) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 分页查询商品sku列表 + */ +export async function pageShopGoodsSku(params: ShopGoodsSkuParam) { + const res = await request.get>>( + MODULES_API_URL + '/shop/shop-goods-sku/page', + { + params + } + ); + if (res.data.code === 0) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 查询商品sku列表列表 + */ +export async function listShopGoodsSku(params?: ShopGoodsSkuParam) { + const res = await request.get>( + MODULES_API_URL + '/shop/shop-goods-sku', + { + params + } + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 添加商品sku列表 + */ +export async function addShopGoodsSku(data: ShopGoodsSku) { + const res = await request.post>( + MODULES_API_URL + '/shop/shop-goods-sku', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 修改商品sku列表 + */ +export async function updateShopGoodsSku(data: ShopGoodsSku) { + const res = await request.put>( + MODULES_API_URL + '/shop/shop-goods-sku', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 删除商品sku列表 + */ +export async function removeShopGoodsSku(id?: number) { + const res = await request.delete>( + MODULES_API_URL + '/shop/shop-goods-sku/' + id + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 批量删除商品sku列表 + */ +export async function removeBatchShopGoodsSku(data: (number | undefined)[]) { + const res = await request.delete>( + MODULES_API_URL + '/shop/shop-goods-sku/batch', + { + data + } + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 根据id查询商品sku列表 + */ +export async function getShopGoodsSku(id: number) { + const res = await request.get>( + MODULES_API_URL + '/shop/shop-goods-sku/' + id + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} diff --git a/src/api/shop/shopGoodsSku/model/index.ts b/src/api/shop/shopGoodsSku/model/index.ts new file mode 100644 index 0000000..0880d7f --- /dev/null +++ b/src/api/shop/shopGoodsSku/model/index.ts @@ -0,0 +1,50 @@ +import type { PageParam } from '@/api'; + +/** + * 商品sku列表 + */ +export interface ShopGoodsSku { + // 主键ID + id?: number; + // 商品ID + goodsId?: number; + // 商品属性索引值 (attr_value|attr_value[|....]) + sku?: string; + // 商品图片 + image?: string; + // 商品价格 + price?: string; + // 市场价格 + salePrice?: string; + // 成本价 + cost?: string; + // 库存 + stock?: number; + // sku编码 + skuNo?: string; + // 商品条码 + barCode?: string; + // 重量 + weight?: string; + // 体积 + volume?: string; + // 唯一值 + uuid?: string; + // 状态, 0正常, 1异常 + status?: number; + // 备注 + comments?: string; + // 租户id + tenantId?: number; + // 创建时间 + createTime?: string; + images?: string; +} + +/** + * 商品sku列表搜索条件 + */ +export interface ShopGoodsSkuParam extends PageParam { + id?: number; + keywords?: string; +} diff --git a/src/api/shop/shopGoodsSpec/index.ts b/src/api/shop/shopGoodsSpec/index.ts new file mode 100644 index 0000000..d7d9ef9 --- /dev/null +++ b/src/api/shop/shopGoodsSpec/index.ts @@ -0,0 +1,105 @@ +import request from '@/utils/request'; +import type { ApiResult, PageResult } from '@/api'; +import type { ShopGoodsSpec, ShopGoodsSpecParam } from './model'; + +/** + * 分页查询商品多规格 + */ +export async function pageShopGoodsSpec(params: ShopGoodsSpecParam) { + const res = await request.get>>( + '/shop/shop-goods-spec/page', + { + params + } + ); + if (res.data.code === 0) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 查询商品多规格列表 + */ +export async function listShopGoodsSpec(params?: ShopGoodsSpecParam) { + const res = await request.get>( + '/shop/shop-goods-spec', + { + params + } + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 添加商品多规格 + */ +export async function addShopGoodsSpec(data: ShopGoodsSpec) { + const res = await request.post>( + '/shop/shop-goods-spec', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 修改商品多规格 + */ +export async function updateShopGoodsSpec(data: ShopGoodsSpec) { + const res = await request.put>( + '/shop/shop-goods-spec', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 删除商品多规格 + */ +export async function removeShopGoodsSpec(id?: number) { + const res = await request.delete>( + '/shop/shop-goods-spec/' + id + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 批量删除商品多规格 + */ +export async function removeBatchShopGoodsSpec(data: (number | undefined)[]) { + const res = await request.delete>( + '/shop/shop-goods-spec/batch', + { + data + } + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 根据id查询商品多规格 + */ +export async function getShopGoodsSpec(id: number) { + const res = await request.get>( + '/shop/shop-goods-spec/' + id + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} diff --git a/src/api/shop/shopGoodsSpec/model/index.ts b/src/api/shop/shopGoodsSpec/model/index.ts new file mode 100644 index 0000000..44a6644 --- /dev/null +++ b/src/api/shop/shopGoodsSpec/model/index.ts @@ -0,0 +1,29 @@ +import type { PageParam } from '@/api'; + +/** + * 商品多规格 + */ +export interface ShopGoodsSpec { + // 主键 + id?: number; + // 商品ID + goodsId?: number; + // 规格ID + specId?: number; + // 规格名称 + specName?: string; + // 规格值 + specValue?: string; + // 活动类型 0=商品,1=秒杀,2=砍价,3=拼团 + type?: string; + // 租户id + tenantId?: number; +} + +/** + * 商品多规格搜索条件 + */ +export interface ShopGoodsSpecParam extends PageParam { + id?: number; + keywords?: string; +} diff --git a/src/api/shop/shopMerchant/index.ts b/src/api/shop/shopMerchant/index.ts new file mode 100644 index 0000000..1904a92 --- /dev/null +++ b/src/api/shop/shopMerchant/index.ts @@ -0,0 +1,105 @@ +import request from '@/utils/request'; +import type { ApiResult, PageResult } from '@/api'; +import type { ShopMerchant, ShopMerchantParam } from './model'; + +/** + * 分页查询商户 + */ +export async function pageShopMerchant(params: ShopMerchantParam) { + const res = await request.get>>( + '/shop/shop-merchant/page', + { + params + } + ); + if (res.data.code === 0) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 查询商户列表 + */ +export async function listShopMerchant(params?: ShopMerchantParam) { + const res = await request.get>( + '/shop/shop-merchant', + { + params + } + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 添加商户 + */ +export async function addShopMerchant(data: ShopMerchant) { + const res = await request.post>( + '/shop/shop-merchant', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 修改商户 + */ +export async function updateShopMerchant(data: ShopMerchant) { + const res = await request.put>( + '/shop/shop-merchant', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 删除商户 + */ +export async function removeShopMerchant(id?: number) { + const res = await request.delete>( + '/shop/shop-merchant/' + id + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 批量删除商户 + */ +export async function removeBatchShopMerchant(data: (number | undefined)[]) { + const res = await request.delete>( + '/shop/shop-merchant/batch', + { + data + } + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 根据id查询商户 + */ +export async function getShopMerchant(id: number) { + const res = await request.get>( + '/shop/shop-merchant/' + id + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} diff --git a/src/api/shop/shopMerchant/model/index.ts b/src/api/shop/shopMerchant/model/index.ts new file mode 100644 index 0000000..612ca6c --- /dev/null +++ b/src/api/shop/shopMerchant/model/index.ts @@ -0,0 +1,90 @@ +import type { PageParam } from '@/api'; + +/** + * 商户 + */ +export interface ShopMerchant { + // ID + merchantId?: number; + // 商户名称 + merchantName?: string; + // 商户编号 + merchantCode?: string; + // 商户类型 + type?: number; + // 商户图标 + image?: string; + // 商户手机号 + phone?: string; + // 商户姓名 + realName?: string; + // 店铺类型 + shopType?: string; + // 项目分类 + itemType?: string; + // 商户分类 + category?: string; + // 商户经营分类 + merchantCategoryId?: number; + // 商户分类 + merchantCategoryTitle?: string; + // 经纬度 + lngAndLat?: string; + // + lng?: string; + // + lat?: string; + // 所在省份 + province?: string; + // 所在城市 + city?: string; + // 所在辖区 + region?: string; + // 详细地址 + address?: string; + // 手续费 + commission?: string; + // 关键字 + keywords?: string; + // 资质图片 + files?: string; + // 营业时间 + businessTime?: string; + // 文章内容 + content?: string; + // 每小时价格 + price?: string; + // 是否自营 + ownStore?: number; + // 是否推荐 + recommend?: number; + // 是否需要审核 + goodsReview?: number; + // 管理入口 + adminUrl?: string; + // 备注 + comments?: string; + // 所有人 + userId?: number; + // 是否删除, 0否, 1是 + deleted?: number; + // 状态 + status?: number; + // 排序号 + sortNumber?: number; + // 租户id + tenantId?: number; + // 创建时间 + createTime?: string; +} + +/** + * 商户搜索条件 + */ +export interface ShopMerchantParam extends PageParam { + merchantId?: number; + phone?: string; + userId?: number; + shopType?: string; + keywords?: string; +} diff --git a/src/api/shop/shopMerchantAccount/index.ts b/src/api/shop/shopMerchantAccount/index.ts new file mode 100644 index 0000000..eff50c4 --- /dev/null +++ b/src/api/shop/shopMerchantAccount/index.ts @@ -0,0 +1,106 @@ +import request from '@/utils/request'; +import type { ApiResult, PageResult } from '@/api'; +import type { ShopMerchantAccount, ShopMerchantAccountParam } from './model'; +import { MODULES_API_URL } from '@/config/setting'; + +/** + * 分页查询商户账号 + */ +export async function pageShopMerchantAccount(params: ShopMerchantAccountParam) { + const res = await request.get>>( + MODULES_API_URL + '/shop/shop-merchant-account/page', + { + params + } + ); + if (res.data.code === 0) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 查询商户账号列表 + */ +export async function listShopMerchantAccount(params?: ShopMerchantAccountParam) { + const res = await request.get>( + MODULES_API_URL + '/shop/shop-merchant-account', + { + params + } + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 添加商户账号 + */ +export async function addShopMerchantAccount(data: ShopMerchantAccount) { + const res = await request.post>( + MODULES_API_URL + '/shop/shop-merchant-account', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 修改商户账号 + */ +export async function updateShopMerchantAccount(data: ShopMerchantAccount) { + const res = await request.put>( + MODULES_API_URL + '/shop/shop-merchant-account', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 删除商户账号 + */ +export async function removeShopMerchantAccount(id?: number) { + const res = await request.delete>( + MODULES_API_URL + '/shop/shop-merchant-account/' + id + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 批量删除商户账号 + */ +export async function removeBatchShopMerchantAccount(data: (number | undefined)[]) { + const res = await request.delete>( + MODULES_API_URL + '/shop/shop-merchant-account/batch', + { + data + } + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 根据id查询商户账号 + */ +export async function getShopMerchantAccount(id: number) { + const res = await request.get>( + MODULES_API_URL + '/shop/shop-merchant-account/' + id + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} diff --git a/src/api/shop/shopMerchantAccount/model/index.ts b/src/api/shop/shopMerchantAccount/model/index.ts new file mode 100644 index 0000000..6dbada0 --- /dev/null +++ b/src/api/shop/shopMerchantAccount/model/index.ts @@ -0,0 +1,39 @@ +import type { PageParam } from '@/api'; + +/** + * 商户账号 + */ +export interface ShopMerchantAccount { + // ID + id?: number; + // 商户手机号 + phone?: string; + // 真实姓名 + realName?: string; + // 商户ID + merchantId?: number; + // 角色ID + roleId?: number; + // 角色名称 + roleName?: string; + // 用户ID + userId?: number; + // 备注 + comments?: string; + // 状态 + status?: number; + // 排序号 + sortNumber?: number; + // 租户id + tenantId?: number; + // 创建时间 + createTime?: string; +} + +/** + * 商户账号搜索条件 + */ +export interface ShopMerchantAccountParam extends PageParam { + id?: number; + keywords?: string; +} diff --git a/src/api/shop/shopMerchantApply/index.ts b/src/api/shop/shopMerchantApply/index.ts new file mode 100644 index 0000000..1a725f6 --- /dev/null +++ b/src/api/shop/shopMerchantApply/index.ts @@ -0,0 +1,120 @@ +import request from '@/utils/request'; +import type { ApiResult, PageResult } from '@/api'; +import type { ShopMerchantApply, ShopMerchantApplyParam } from './model'; +import { SERVER_API_URL } from '@/config/setting'; + +/** + * 分页查询商户入驻申请 + */ +export async function pageShopMerchantApply(params: ShopMerchantApplyParam) { + const res = await request.get>>( + SERVER_API_URL + '/shop/shop-merchant-apply/page', + { + params + } + ); + if (res.data.code === 0) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 查询商户入驻申请列表 + */ +export async function listShopMerchantApply(params?: ShopMerchantApplyParam) { + const res = await request.get>( + SERVER_API_URL + '/shop/shop-merchant-apply', + { + params + } + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 添加商户入驻申请 + */ +export async function addShopMerchantApply(data: ShopMerchantApply) { + const res = await request.post>( + SERVER_API_URL + '/shop/shop-merchant-apply', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 修改商户入驻申请 + */ +export async function updateShopMerchantApply(data: ShopMerchantApply) { + const res = await request.put>( + SERVER_API_URL + '/shop/shop-merchant-apply', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +// 审核通过 +export async function checkShopMerchantApply(data: ShopMerchantApply) { + const res = await request.put>( + SERVER_API_URL + '/shop/shop-merchant-apply/check', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 删除商户入驻申请 + */ +export async function removeShopMerchantApply(id?: number) { + const res = await request.delete>( + SERVER_API_URL + '/shop/shop-merchant-apply/' + id + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 批量删除商户入驻申请 + */ +export async function removeBatchShopMerchantApply( + data: (number | undefined)[] +) { + const res = await request.delete>( + SERVER_API_URL + '/shop/shop-merchant-apply/batch', + { + data + } + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 根据id查询商户入驻申请 + */ +export async function getShopMerchantApply(id: number) { + const res = await request.get>( + SERVER_API_URL + '/shop/shop-merchant-apply/' + id + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} diff --git a/src/api/shop/shopMerchantApply/model/index.ts b/src/api/shop/shopMerchantApply/model/index.ts new file mode 100644 index 0000000..6e02334 --- /dev/null +++ b/src/api/shop/shopMerchantApply/model/index.ts @@ -0,0 +1,72 @@ +import type { PageParam } from '@/api'; + +/** + * 商户入驻申请 + */ +export interface ShopMerchantApply { + // ID + applyId?: number; + // 类型 + type?: number; + // 主体名称 + merchantName?: string; + // 证件号码 + merchantCode?: string; + // 商户图标 + image?: string; + // 商户手机号 + phone?: string; + // 商户姓名 + realName?: string; + // 身份证号码 + idCard?: string; + // 店铺类型 + shopType?: string; + // 商户分类 + category?: string; + // 手续费 + commission?: string; + // 关键字 + keywords?: string; + // 营业执照 + yyzz?: string; + // 身份证正面 + sfz1?: string; + // 身份证反面 + sfz2?: string; + // 资质图片 + files?: string; + // 所有人 + userId?: number; + // 是否自营 + ownStore?: number; + // 是否推荐 + recommend?: number; + // 是否需要审核 + goodsReview?: number; + // 工作负责人 + name2?: string; + // 驳回原因 + reason?: string; + // 备注 + comments?: string; + // 状态 + status?: number; + // 排序号 + sortNumber?: number; + // 租户id + tenantId?: number; + // 创建时间 + createTime?: string; +} + +/** + * 商户入驻申请搜索条件 + */ +export interface ShopMerchantApplyParam extends PageParam { + applyId?: number; + userId?: number; + shopType?: string; + phone?: string; + keywords?: string; +} diff --git a/src/api/shop/shopMerchantCount/index.ts b/src/api/shop/shopMerchantCount/index.ts new file mode 100644 index 0000000..c859b1b --- /dev/null +++ b/src/api/shop/shopMerchantCount/index.ts @@ -0,0 +1,108 @@ +import request from '@/utils/request'; +import type { ApiResult, PageResult } from '@/api'; +import type { ShopMerchantCount, ShopMerchantCountParam } from './model'; +import { MODULES_API_URL } from '@/config/setting'; + +/** + * 分页查询门店销售统计表 + */ +export async function pageShopMerchantCount(params: ShopMerchantCountParam) { + const res = await request.get>>( + MODULES_API_URL + '/shop/shop-merchant-count/page', + { + params + } + ); + if (res.data.code === 0) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 查询门店销售统计表列表 + */ +export async function listShopMerchantCount(params?: ShopMerchantCountParam) { + const res = await request.get>( + MODULES_API_URL + '/shop/shop-merchant-count', + { + params + } + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 添加门店销售统计表 + */ +export async function addShopMerchantCount(data: ShopMerchantCount) { + const res = await request.post>( + MODULES_API_URL + '/shop/shop-merchant-count', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 修改门店销售统计表 + */ +export async function updateShopMerchantCount(data: ShopMerchantCount) { + const res = await request.put>( + MODULES_API_URL + '/shop/shop-merchant-count', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 删除门店销售统计表 + */ +export async function removeShopMerchantCount(id?: number) { + const res = await request.delete>( + MODULES_API_URL + '/shop/shop-merchant-count/' + id + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 批量删除门店销售统计表 + */ +export async function removeBatchShopMerchantCount( + data: (number | undefined)[] +) { + const res = await request.delete>( + MODULES_API_URL + '/shop/shop-merchant-count/batch', + { + data + } + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 根据id查询门店销售统计表 + */ +export async function getShopMerchantCount(id: number) { + const res = await request.get>( + MODULES_API_URL + '/shop/shop-merchant-count/' + id + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} diff --git a/src/api/shop/shopMerchantCount/model/index.ts b/src/api/shop/shopMerchantCount/model/index.ts new file mode 100644 index 0000000..ea27a60 --- /dev/null +++ b/src/api/shop/shopMerchantCount/model/index.ts @@ -0,0 +1,29 @@ +import type { PageParam } from '@/api'; + +/** + * 门店销售统计表 + */ +export interface ShopMerchantCount { + // ID + id?: number; + // 店铺名称 + name?: string; + // 店铺说明 + comments?: string; + // 状态 + status?: number; + // 排序号 + sortNumber?: number; + // 租户id + tenantId?: number; + // 创建时间 + createTime?: string; +} + +/** + * 门店销售统计表搜索条件 + */ +export interface ShopMerchantCountParam extends PageParam { + id?: number; + keywords?: string; +} diff --git a/src/api/shop/shopMerchantType/index.ts b/src/api/shop/shopMerchantType/index.ts new file mode 100644 index 0000000..8d7a054 --- /dev/null +++ b/src/api/shop/shopMerchantType/index.ts @@ -0,0 +1,108 @@ +import request from '@/utils/request'; +import type { ApiResult, PageResult } from '@/api'; +import type { ShopMerchantType, ShopMerchantTypeParam } from './model'; +import { SERVER_API_URL } from '@/config/setting'; + +/** + * 分页查询商户类型 + */ +export async function pageShopMerchantType(params: ShopMerchantTypeParam) { + const res = await request.get>>( + SERVER_API_URL + '/shop/shop-merchant-type/page', + { + params + } + ); + if (res.data.code === 0) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 查询商户类型列表 + */ +export async function listShopMerchantType(params?: ShopMerchantTypeParam) { + const res = await request.get>( + SERVER_API_URL + '/shop/shop-merchant-type', + { + params + } + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 添加商户类型 + */ +export async function addShopMerchantType(data: ShopMerchantType) { + const res = await request.post>( + SERVER_API_URL + '/shop/shop-merchant-type', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 修改商户类型 + */ +export async function updateShopMerchantType(data: ShopMerchantType) { + const res = await request.put>( + SERVER_API_URL + '/shop/shop-merchant-type', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 删除商户类型 + */ +export async function removeShopMerchantType(id?: number) { + const res = await request.delete>( + SERVER_API_URL + '/shop/shop-merchant-type/' + id + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 批量删除商户类型 + */ +export async function removeBatchShopMerchantType( + data: (number | undefined)[] +) { + const res = await request.delete>( + SERVER_API_URL + '/shop/shop-merchant-type/batch', + { + data + } + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 根据id查询商户类型 + */ +export async function getShopMerchantType(id: number) { + const res = await request.get>( + SERVER_API_URL + '/shop/shop-merchant-type/' + id + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} diff --git a/src/api/shop/shopMerchantType/model/index.ts b/src/api/shop/shopMerchantType/model/index.ts new file mode 100644 index 0000000..c09be90 --- /dev/null +++ b/src/api/shop/shopMerchantType/model/index.ts @@ -0,0 +1,30 @@ +import type { PageParam } from '@/api'; + +/** + * 商户类型 + */ +export interface ShopMerchantType { + // ID + id?: number; + // 店铺类型 + name?: string; + // 店铺入驻条件 + comments?: string; + // 状态 + status?: number; + // 排序号 + sortNumber?: number; + // 租户id + tenantId?: number; + // 创建时间 + createTime?: string; + value?: string; +} + +/** + * 商户类型搜索条件 + */ +export interface ShopMerchantTypeParam extends PageParam { + id?: number; + keywords?: string; +} diff --git a/src/api/shop/shopSpec/index.ts b/src/api/shop/shopSpec/index.ts new file mode 100644 index 0000000..5056ba8 --- /dev/null +++ b/src/api/shop/shopSpec/index.ts @@ -0,0 +1,106 @@ +import request from '@/utils/request'; +import type { ApiResult, PageResult } from '@/api'; +import { MODULES_API_URL } from '@/config/setting'; +import { ShopSpec, ShopSpecParam } from '@/api/shop/shopSpec/model'; + +/** + * 分页查询规格 + */ +export async function pageShopSpec(params: ShopSpecParam) { + const res = await request.get>>( + MODULES_API_URL + '/shop/shop-spec/page', + { + params + } + ); + if (res.data.code === 0) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 查询规格列表 + */ +export async function listShopSpec(params?: ShopSpecParam) { + const res = await request.get>( + MODULES_API_URL + '/shop/shop-spec', + { + params + } + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 添加规格 + */ +export async function addShopSpec(data: ShopSpec) { + const res = await request.post>( + MODULES_API_URL + '/shop/shop-spec', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 修改规格 + */ +export async function updateShopSpec(data: ShopSpec) { + const res = await request.put>( + MODULES_API_URL + '/shop/shop-spec', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 删除规格 + */ +export async function removeShopSpec(id?: number) { + const res = await request.delete>( + MODULES_API_URL + '/shop/shop-spec/' + id + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 批量删除规格 + */ +export async function removeBatchShopSpec(data: (number | undefined)[]) { + const res = await request.delete>( + MODULES_API_URL + '/shop/shop-spec/batch', + { + data + } + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 根据id查询规格 + */ +export async function getShopSpec(id: number) { + const res = await request.get>( + MODULES_API_URL + '/shop/shop-spec/' + id + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} diff --git a/src/api/shop/shopSpec/model/index.ts b/src/api/shop/shopSpec/model/index.ts new file mode 100644 index 0000000..cd52c14 --- /dev/null +++ b/src/api/shop/shopSpec/model/index.ts @@ -0,0 +1,38 @@ +import type { PageParam } from '@/api'; + +/** + * 规格 + */ +export interface ShopSpec { + // 规格ID + specId?: number; + // 规格名称 + specName?: string; + // 规格值 + specValue?: string; + // 商户ID + merchantId?: number; + // 创建用户 + userId?: number; + // 更新者 + updater?: number; + // 备注 + comments?: string; + // 状态, 0正常, 1待修,2异常已修,3异常未修 + status?: number; + // 排序号 + sortNumber?: number; + // 租户id + tenantId?: number; + // 创建时间 + createTime?: string; + value?: string; +} + +/** + * 规格搜索条件 + */ +export interface ShopSpecParam extends PageParam { + specId?: number; + keywords?: string; +} diff --git a/src/api/shop/shopSpecValue/index.ts b/src/api/shop/shopSpecValue/index.ts new file mode 100644 index 0000000..2eab7d1 --- /dev/null +++ b/src/api/shop/shopSpecValue/index.ts @@ -0,0 +1,105 @@ +import request from '@/utils/request'; +import type { ApiResult, PageResult } from '@/api'; +import type { ShopSpecValue, ShopSpecValueParam } from './model'; + +/** + * 分页查询规格值 + */ +export async function pageShopSpecValue(params: ShopSpecValueParam) { + const res = await request.get>>( + '/shop/shop-spec-value/page', + { + params + } + ); + if (res.data.code === 0) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 查询规格值列表 + */ +export async function listShopSpecValue(params?: ShopSpecValueParam) { + const res = await request.get>( + '/shop/shop-spec-value', + { + params + } + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 添加规格值 + */ +export async function addShopSpecValue(data: ShopSpecValue) { + const res = await request.post>( + '/shop/shop-spec-value', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 修改规格值 + */ +export async function updateShopSpecValue(data: ShopSpecValue) { + const res = await request.put>( + '/shop/shop-spec-value', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 删除规格值 + */ +export async function removeShopSpecValue(id?: number) { + const res = await request.delete>( + '/shop/shop-spec-value/' + id + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 批量删除规格值 + */ +export async function removeBatchShopSpecValue(data: (number | undefined)[]) { + const res = await request.delete>( + '/shop/shop-spec-value/batch', + { + data + } + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 根据id查询规格值 + */ +export async function getShopSpecValue(id: number) { + const res = await request.get>( + '/shop/shop-spec-value/' + id + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} diff --git a/src/api/shop/shopSpecValue/model/index.ts b/src/api/shop/shopSpecValue/model/index.ts new file mode 100644 index 0000000..e911f6c --- /dev/null +++ b/src/api/shop/shopSpecValue/model/index.ts @@ -0,0 +1,29 @@ +import type { PageParam } from '@/api'; + +/** + * 规格值 + */ +export interface ShopSpecValue { + // 规格值ID + specValueId?: number; + // 规格组ID + specId?: number; + // 规格值 + specValue?: string; + // 备注 + comments?: string; + // 排序号 + sortNumber?: number; + // 租户id + tenantId?: number; + // 创建时间 + createTime?: string; +} + +/** + * 规格值搜索条件 + */ +export interface ShopSpecValueParam extends PageParam { + specValueId?: number; + keywords?: string; +} diff --git a/src/components/SelectGoodsCategory/index.vue b/src/components/SelectGoodsCategory/index.vue index 6b5d577..a55f356 100644 --- a/src/components/SelectGoodsCategory/index.vue +++ b/src/components/SelectGoodsCategory/index.vue @@ -14,15 +14,15 @@ diff --git a/src/views/shop/shopGoods/components/search.vue b/src/views/shop/shopGoods/components/search.vue new file mode 100644 index 0000000..b48a085 --- /dev/null +++ b/src/views/shop/shopGoods/components/search.vue @@ -0,0 +1,155 @@ + + + + diff --git a/src/views/shop/shopGoods/components/shopGoodsEdit.vue b/src/views/shop/shopGoods/components/shopGoodsEdit.vue new file mode 100644 index 0000000..98710af --- /dev/null +++ b/src/views/shop/shopGoods/components/shopGoodsEdit.vue @@ -0,0 +1,1557 @@ + + + + diff --git a/src/views/shop/shopGoods/index.vue b/src/views/shop/shopGoods/index.vue new file mode 100644 index 0000000..3973646 --- /dev/null +++ b/src/views/shop/shopGoods/index.vue @@ -0,0 +1,281 @@ + + + + + + + diff --git a/src/views/system/setting/components/mp-weixin.vue b/src/views/system/setting/components/mp-weixin.vue index 8d902e4..7f6c328 100644 --- a/src/views/system/setting/components/mp-weixin.vue +++ b/src/views/system/setting/components/mp-weixin.vue @@ -27,9 +27,9 @@ - + - + @@ -37,9 +37,9 @@ - + - + @@ -47,9 +47,9 @@ - + - + @@ -57,9 +57,9 @@ - + - +