forked from gxwebsoft/mp-10550
提交代码
This commit is contained in:
101
src/api/shop/shopCommissionRole/index.ts
Normal file
101
src/api/shop/shopCommissionRole/index.ts
Normal file
@@ -0,0 +1,101 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api/index';
|
||||
import type { ShopCommissionRole, ShopCommissionRoleParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询分红角色
|
||||
*/
|
||||
export async function pageShopCommissionRole(params: ShopCommissionRoleParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopCommissionRole>>>(
|
||||
'/shop/shop-commission-role/page',
|
||||
params
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询分红角色列表
|
||||
*/
|
||||
export async function listShopCommissionRole(params?: ShopCommissionRoleParam) {
|
||||
const res = await request.get<ApiResult<ShopCommissionRole[]>>(
|
||||
'/shop/shop-commission-role',
|
||||
params
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加分红角色
|
||||
*/
|
||||
export async function addShopCommissionRole(data: ShopCommissionRole) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-commission-role',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改分红角色
|
||||
*/
|
||||
export async function updateShopCommissionRole(data: ShopCommissionRole) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-commission-role',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除分红角色
|
||||
*/
|
||||
export async function removeShopCommissionRole(id?: number) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-commission-role/' + id
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除分红角色
|
||||
*/
|
||||
export async function removeBatchShopCommissionRole(data: (number | undefined)[]) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-commission-role/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询分红角色
|
||||
*/
|
||||
export async function getShopCommissionRole(id: number) {
|
||||
const res = await request.get<ApiResult<ShopCommissionRole>>(
|
||||
'/shop/shop-commission-role/' + id
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
35
src/api/shop/shopCommissionRole/model/index.ts
Normal file
35
src/api/shop/shopCommissionRole/model/index.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import type { PageParam } from '@/api/index';
|
||||
|
||||
/**
|
||||
* 分红角色
|
||||
*/
|
||||
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;
|
||||
}
|
||||
101
src/api/shop/shopExpress/index.ts
Normal file
101
src/api/shop/shopExpress/index.ts
Normal file
@@ -0,0 +1,101 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api/index';
|
||||
import type { ShopExpress, ShopExpressParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询物流公司
|
||||
*/
|
||||
export async function pageShopExpress(params: ShopExpressParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopExpress>>>(
|
||||
'/shop/shop-express/page',
|
||||
params
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询物流公司列表
|
||||
*/
|
||||
export async function listShopExpress(params?: ShopExpressParam) {
|
||||
const res = await request.get<ApiResult<ShopExpress[]>>(
|
||||
'/shop/shop-express',
|
||||
params
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加物流公司
|
||||
*/
|
||||
export async function addShopExpress(data: ShopExpress) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-express',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改物流公司
|
||||
*/
|
||||
export async function updateShopExpress(data: ShopExpress) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-express',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除物流公司
|
||||
*/
|
||||
export async function removeShopExpress(id?: number) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-express/' + id
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除物流公司
|
||||
*/
|
||||
export async function removeBatchShopExpress(data: (number | undefined)[]) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-express/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询物流公司
|
||||
*/
|
||||
export async function getShopExpress(id: number) {
|
||||
const res = await request.get<ApiResult<ShopExpress>>(
|
||||
'/shop/shop-express/' + id
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
35
src/api/shop/shopExpress/model/index.ts
Normal file
35
src/api/shop/shopExpress/model/index.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import type { PageParam } from '@/api/index';
|
||||
|
||||
/**
|
||||
* 物流公司
|
||||
*/
|
||||
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;
|
||||
}
|
||||
101
src/api/shop/shopExpressTemplate/index.ts
Normal file
101
src/api/shop/shopExpressTemplate/index.ts
Normal file
@@ -0,0 +1,101 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api/index';
|
||||
import type { ShopExpressTemplate, ShopExpressTemplateParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询运费模板
|
||||
*/
|
||||
export async function pageShopExpressTemplate(params: ShopExpressTemplateParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopExpressTemplate>>>(
|
||||
'/shop/shop-express-template/page',
|
||||
params
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询运费模板列表
|
||||
*/
|
||||
export async function listShopExpressTemplate(params?: ShopExpressTemplateParam) {
|
||||
const res = await request.get<ApiResult<ShopExpressTemplate[]>>(
|
||||
'/shop/shop-express-template',
|
||||
params
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加运费模板
|
||||
*/
|
||||
export async function addShopExpressTemplate(data: ShopExpressTemplate) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-express-template',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改运费模板
|
||||
*/
|
||||
export async function updateShopExpressTemplate(data: ShopExpressTemplate) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-express-template',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除运费模板
|
||||
*/
|
||||
export async function removeShopExpressTemplate(id?: number) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-express-template/' + id
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除运费模板
|
||||
*/
|
||||
export async function removeBatchShopExpressTemplate(data: (number | undefined)[]) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-express-template/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询运费模板
|
||||
*/
|
||||
export async function getShopExpressTemplate(id: number) {
|
||||
const res = await request.get<ApiResult<ShopExpressTemplate>>(
|
||||
'/shop/shop-express-template/' + id
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
41
src/api/shop/shopExpressTemplate/model/index.ts
Normal file
41
src/api/shop/shopExpressTemplate/model/index.ts
Normal file
@@ -0,0 +1,41 @@
|
||||
import type { PageParam } from '@/api/index';
|
||||
|
||||
/**
|
||||
* 运费模板
|
||||
*/
|
||||
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;
|
||||
}
|
||||
101
src/api/shop/shopExpressTemplateDetail/index.ts
Normal file
101
src/api/shop/shopExpressTemplateDetail/index.ts
Normal file
@@ -0,0 +1,101 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api/index';
|
||||
import type { ShopExpressTemplateDetail, ShopExpressTemplateDetailParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询运费模板
|
||||
*/
|
||||
export async function pageShopExpressTemplateDetail(params: ShopExpressTemplateDetailParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopExpressTemplateDetail>>>(
|
||||
'/shop/shop-express-template-detail/page',
|
||||
params
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询运费模板列表
|
||||
*/
|
||||
export async function listShopExpressTemplateDetail(params?: ShopExpressTemplateDetailParam) {
|
||||
const res = await request.get<ApiResult<ShopExpressTemplateDetail[]>>(
|
||||
'/shop/shop-express-template-detail',
|
||||
params
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加运费模板
|
||||
*/
|
||||
export async function addShopExpressTemplateDetail(data: ShopExpressTemplateDetail) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-express-template-detail',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改运费模板
|
||||
*/
|
||||
export async function updateShopExpressTemplateDetail(data: ShopExpressTemplateDetail) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-express-template-detail',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除运费模板
|
||||
*/
|
||||
export async function removeShopExpressTemplateDetail(id?: number) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-express-template-detail/' + id
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除运费模板
|
||||
*/
|
||||
export async function removeBatchShopExpressTemplateDetail(data: (number | undefined)[]) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-express-template-detail/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询运费模板
|
||||
*/
|
||||
export async function getShopExpressTemplateDetail(id: number) {
|
||||
const res = await request.get<ApiResult<ShopExpressTemplateDetail>>(
|
||||
'/shop/shop-express-template-detail/' + id
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
45
src/api/shop/shopExpressTemplateDetail/model/index.ts
Normal file
45
src/api/shop/shopExpressTemplateDetail/model/index.ts
Normal file
@@ -0,0 +1,45 @@
|
||||
import type { PageParam } from '@/api/index';
|
||||
|
||||
/**
|
||||
* 运费模板
|
||||
*/
|
||||
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;
|
||||
}
|
||||
112
src/api/shop/shopGoods/index.ts
Normal file
112
src/api/shop/shopGoods/index.ts
Normal file
@@ -0,0 +1,112 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api/index';
|
||||
import type { ShopGoods, ShopGoodsParam } from './model';
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询商品
|
||||
*/
|
||||
export async function pageShopGoods(params: ShopGoodsParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopGoods>>>(
|
||||
'/shop/shop-goods/page',
|
||||
params
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商品列表
|
||||
*/
|
||||
export async function listShopGoods(params?: ShopGoodsParam) {
|
||||
const res = await request.get<ApiResult<ShopGoods[]>>(
|
||||
'/shop/shop-goods',
|
||||
params
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加商品
|
||||
*/
|
||||
export async function addShopGoods(data: ShopGoods) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-goods',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商品
|
||||
*/
|
||||
export async function updateShopGoods(data: ShopGoods) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-goods',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商品
|
||||
*/
|
||||
export async function removeShopGoods(id?: number) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-goods/' + id
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除商品
|
||||
*/
|
||||
export async function removeBatchShopGoods(data: (number | undefined)[]) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-goods/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询商品
|
||||
*/
|
||||
export async function getShopGoods(id: number) {
|
||||
const res = await request.get<ApiResult<ShopGoods>>(
|
||||
'/shop/shop-goods/' + id
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
export async function getCount(params: ShopGoodsParam) {
|
||||
const res = await request.get<ApiResult<unknown>>('/shop/shop-goods/data', {
|
||||
params
|
||||
});
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
147
src/api/shop/shopGoods/model/index.ts
Normal file
147
src/api/shop/shopGoods/model/index.ts
Normal file
@@ -0,0 +1,147 @@
|
||||
import type { PageParam } from '@/api/index';
|
||||
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;
|
||||
}
|
||||
101
src/api/shop/shopGoodsCategory/index.ts
Normal file
101
src/api/shop/shopGoodsCategory/index.ts
Normal file
@@ -0,0 +1,101 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api/index';
|
||||
import type { ShopGoodsCategory, ShopGoodsCategoryParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询商品分类
|
||||
*/
|
||||
export async function pageShopGoodsCategory(params: ShopGoodsCategoryParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopGoodsCategory>>>(
|
||||
'/shop/shop-goods-category/page',
|
||||
params
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商品分类列表
|
||||
*/
|
||||
export async function listShopGoodsCategory(params?: ShopGoodsCategoryParam) {
|
||||
const res = await request.get<ApiResult<ShopGoodsCategory[]>>(
|
||||
'/shop/shop-goods-category',
|
||||
params
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加商品分类
|
||||
*/
|
||||
export async function addShopGoodsCategory(data: ShopGoodsCategory) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-goods-category',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商品分类
|
||||
*/
|
||||
export async function updateShopGoodsCategory(data: ShopGoodsCategory) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-goods-category',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商品分类
|
||||
*/
|
||||
export async function removeShopGoodsCategory(id?: number) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-goods-category/' + id
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除商品分类
|
||||
*/
|
||||
export async function removeBatchShopGoodsCategory(data: (number | undefined)[]) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-goods-category/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询商品分类
|
||||
*/
|
||||
export async function getShopGoodsCategory(id: number) {
|
||||
const res = await request.get<ApiResult<ShopGoodsCategory>>(
|
||||
'/shop/shop-goods-category/' + id
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
64
src/api/shop/shopGoodsCategory/model/index.ts
Normal file
64
src/api/shop/shopGoodsCategory/model/index.ts
Normal file
@@ -0,0 +1,64 @@
|
||||
import type { PageParam } from '@/api/index';
|
||||
|
||||
/**
|
||||
* 商品分类
|
||||
*/
|
||||
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;
|
||||
}
|
||||
101
src/api/shop/shopGoodsRoleCommission/index.ts
Normal file
101
src/api/shop/shopGoodsRoleCommission/index.ts
Normal file
@@ -0,0 +1,101 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api/index';
|
||||
import { ShopGoodsRoleCommission, ShopGoodsRoleCommissionParam } from '@/api/shop/shopGoodsRoleCommission/model';
|
||||
|
||||
/**
|
||||
* 分页查询商品绑定角色的分润金额
|
||||
*/
|
||||
export async function pageShopGoodsRoleCommission(params: ShopGoodsRoleCommissionParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopGoodsRoleCommission>>>(
|
||||
'/shop/shop-goods-role-commission/page',
|
||||
params
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商品绑定角色的分润金额列表
|
||||
*/
|
||||
export async function listShopGoodsRoleCommission(params?: ShopGoodsRoleCommissionParam) {
|
||||
const res = await request.get<ApiResult<ShopGoodsRoleCommission[]>>(
|
||||
'/shop/shop-goods-role-commission',
|
||||
params
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加商品绑定角色的分润金额
|
||||
*/
|
||||
export async function addShopGoodsRoleCommission(data: ShopGoodsRoleCommission) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-goods-role-commission',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商品绑定角色的分润金额
|
||||
*/
|
||||
export async function updateShopGoodsRoleCommission(data: ShopGoodsRoleCommission) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-goods-role-commission',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商品绑定角色的分润金额
|
||||
*/
|
||||
export async function removeShopGoodsRoleCommission(id?: number) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-goods-role-commission/' + id
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除商品绑定角色的分润金额
|
||||
*/
|
||||
export async function removeBatchShopGoodsRoleCommission(data: (number | undefined)[]) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-goods-role-commission/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询商品绑定角色的分润金额
|
||||
*/
|
||||
export async function getShopGoodsRoleCommission(id: number) {
|
||||
const res = await request.get<ApiResult<ShopGoodsRoleCommission>>(
|
||||
'/shop/shop-goods-role-commission/' + id
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
35
src/api/shop/shopGoodsRoleCommission/model/index.ts
Normal file
35
src/api/shop/shopGoodsRoleCommission/model/index.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import type { PageParam } from '@/api/index';
|
||||
|
||||
/**
|
||||
* 商品绑定角色的分润金额
|
||||
*/
|
||||
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;
|
||||
}
|
||||
117
src/api/shop/shopGoodsSku/index.ts
Normal file
117
src/api/shop/shopGoodsSku/index.ts
Normal file
@@ -0,0 +1,117 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api/index';
|
||||
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<ApiResult<ShopGoodsSku[]>>(
|
||||
'/shop/goods-sku/generateGoodsSku',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询商品sku列表
|
||||
*/
|
||||
export async function pageShopGoodsSku(params: ShopGoodsSkuParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopGoodsSku>>>(
|
||||
'/shop/shop-goods-sku/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商品sku列表列表
|
||||
*/
|
||||
export async function listShopGoodsSku(params?: ShopGoodsSkuParam) {
|
||||
const res = await request.get<ApiResult<ShopGoodsSku[]>>(
|
||||
'/shop/shop-goods-sku',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加商品sku列表
|
||||
*/
|
||||
export async function addShopGoodsSku(data: ShopGoodsSku) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-goods-sku',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商品sku列表
|
||||
*/
|
||||
export async function updateShopGoodsSku(data: ShopGoodsSku) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-goods-sku',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商品sku列表
|
||||
*/
|
||||
export async function removeShopGoodsSku(id?: number) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-goods-sku/' + id
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除商品sku列表
|
||||
*/
|
||||
export async function removeBatchShopGoodsSku(data: (number | undefined)[]) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-goods-sku/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询商品sku列表
|
||||
*/
|
||||
export async function getShopGoodsSku(id: number) {
|
||||
const res = await request.get<ApiResult<ShopGoodsSku>>(
|
||||
'/shop/shop-goods-sku/' + id
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
50
src/api/shop/shopGoodsSku/model/index.ts
Normal file
50
src/api/shop/shopGoodsSku/model/index.ts
Normal file
@@ -0,0 +1,50 @@
|
||||
import type { PageParam } from '@/api/index';
|
||||
|
||||
/**
|
||||
* 商品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;
|
||||
}
|
||||
101
src/api/shop/shopGoodsSpec/index.ts
Normal file
101
src/api/shop/shopGoodsSpec/index.ts
Normal file
@@ -0,0 +1,101 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api/index';
|
||||
import type { ShopGoodsSpec, ShopGoodsSpecParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询商品多规格
|
||||
*/
|
||||
export async function pageShopGoodsSpec(params: ShopGoodsSpecParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopGoodsSpec>>>(
|
||||
'/shop/shop-goods-spec/page',
|
||||
params
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商品多规格列表
|
||||
*/
|
||||
export async function listShopGoodsSpec(params?: ShopGoodsSpecParam) {
|
||||
const res = await request.get<ApiResult<ShopGoodsSpec[]>>(
|
||||
'/shop/shop-goods-spec',
|
||||
params
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加商品多规格
|
||||
*/
|
||||
export async function addShopGoodsSpec(data: ShopGoodsSpec) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-goods-spec',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商品多规格
|
||||
*/
|
||||
export async function updateShopGoodsSpec(data: ShopGoodsSpec) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-goods-spec',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商品多规格
|
||||
*/
|
||||
export async function removeShopGoodsSpec(id?: number) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-goods-spec/' + id
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除商品多规格
|
||||
*/
|
||||
export async function removeBatchShopGoodsSpec(data: (number | undefined)[]) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-goods-spec/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询商品多规格
|
||||
*/
|
||||
export async function getShopGoodsSpec(id: number) {
|
||||
const res = await request.get<ApiResult<ShopGoodsSpec>>(
|
||||
'/shop/shop-goods-spec/' + id
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
29
src/api/shop/shopGoodsSpec/model/index.ts
Normal file
29
src/api/shop/shopGoodsSpec/model/index.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import type { PageParam } from '@/api/index';
|
||||
|
||||
/**
|
||||
* 商品多规格
|
||||
*/
|
||||
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;
|
||||
}
|
||||
101
src/api/shop/shopMerchant/index.ts
Normal file
101
src/api/shop/shopMerchant/index.ts
Normal file
@@ -0,0 +1,101 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api/index';
|
||||
import type { ShopMerchant, ShopMerchantParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询商户
|
||||
*/
|
||||
export async function pageShopMerchant(params: ShopMerchantParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopMerchant>>>(
|
||||
'/shop/shop-merchant/page',
|
||||
params
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商户列表
|
||||
*/
|
||||
export async function listShopMerchant(params?: ShopMerchantParam) {
|
||||
const res = await request.get<ApiResult<ShopMerchant[]>>(
|
||||
'/shop/shop-merchant',
|
||||
params
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加商户
|
||||
*/
|
||||
export async function addShopMerchant(data: ShopMerchant) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-merchant',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商户
|
||||
*/
|
||||
export async function updateShopMerchant(data: ShopMerchant) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-merchant',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商户
|
||||
*/
|
||||
export async function removeShopMerchant(id?: number) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-merchant/' + id
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除商户
|
||||
*/
|
||||
export async function removeBatchShopMerchant(data: (number | undefined)[]) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-merchant/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询商户
|
||||
*/
|
||||
export async function getShopMerchant(id: number) {
|
||||
const res = await request.get<ApiResult<ShopMerchant>>(
|
||||
'/shop/shop-merchant/' + id
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
90
src/api/shop/shopMerchant/model/index.ts
Normal file
90
src/api/shop/shopMerchant/model/index.ts
Normal file
@@ -0,0 +1,90 @@
|
||||
import type { PageParam } from '@/api/index';
|
||||
|
||||
/**
|
||||
* 商户
|
||||
*/
|
||||
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;
|
||||
}
|
||||
101
src/api/shop/shopMerchantAccount/index.ts
Normal file
101
src/api/shop/shopMerchantAccount/index.ts
Normal file
@@ -0,0 +1,101 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api/index';
|
||||
import type { ShopMerchantAccount, ShopMerchantAccountParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询商户账号
|
||||
*/
|
||||
export async function pageShopMerchantAccount(params: ShopMerchantAccountParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopMerchantAccount>>>(
|
||||
'/shop/shop-merchant-account/page',
|
||||
params
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商户账号列表
|
||||
*/
|
||||
export async function listShopMerchantAccount(params?: ShopMerchantAccountParam) {
|
||||
const res = await request.get<ApiResult<ShopMerchantAccount[]>>(
|
||||
'/shop/shop-merchant-account',
|
||||
params
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加商户账号
|
||||
*/
|
||||
export async function addShopMerchantAccount(data: ShopMerchantAccount) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-merchant-account',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商户账号
|
||||
*/
|
||||
export async function updateShopMerchantAccount(data: ShopMerchantAccount) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-merchant-account',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商户账号
|
||||
*/
|
||||
export async function removeShopMerchantAccount(id?: number) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-merchant-account/' + id
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除商户账号
|
||||
*/
|
||||
export async function removeBatchShopMerchantAccount(data: (number | undefined)[]) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-merchant-account/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询商户账号
|
||||
*/
|
||||
export async function getShopMerchantAccount(id: number) {
|
||||
const res = await request.get<ApiResult<ShopMerchantAccount>>(
|
||||
'/shop/shop-merchant-account/' + id
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
39
src/api/shop/shopMerchantAccount/model/index.ts
Normal file
39
src/api/shop/shopMerchantAccount/model/index.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
import type { PageParam } from '@/api/index';
|
||||
|
||||
/**
|
||||
* 商户账号
|
||||
*/
|
||||
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;
|
||||
}
|
||||
115
src/api/shop/shopMerchantApply/index.ts
Normal file
115
src/api/shop/shopMerchantApply/index.ts
Normal file
@@ -0,0 +1,115 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api/index';
|
||||
import type { ShopMerchantApply, ShopMerchantApplyParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询商户入驻申请
|
||||
*/
|
||||
export async function pageShopMerchantApply(params: ShopMerchantApplyParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopMerchantApply>>>(
|
||||
'/shop/shop-merchant-apply/page',
|
||||
params
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商户入驻申请列表
|
||||
*/
|
||||
export async function listShopMerchantApply(params?: ShopMerchantApplyParam) {
|
||||
const res = await request.get<ApiResult<ShopMerchantApply[]>>(
|
||||
'/shop/shop-merchant-apply',
|
||||
params
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加商户入驻申请
|
||||
*/
|
||||
export async function addShopMerchantApply(data: ShopMerchantApply) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-merchant-apply',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商户入驻申请
|
||||
*/
|
||||
export async function updateShopMerchantApply(data: ShopMerchantApply) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-merchant-apply',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
// 审核通过
|
||||
export async function checkShopMerchantApply(data: ShopMerchantApply) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-merchant-apply/check',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商户入驻申请
|
||||
*/
|
||||
export async function removeShopMerchantApply(id?: number) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-merchant-apply/' + id
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除商户入驻申请
|
||||
*/
|
||||
export async function removeBatchShopMerchantApply(
|
||||
data: (number | undefined)[]
|
||||
) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-merchant-apply/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询商户入驻申请
|
||||
*/
|
||||
export async function getShopMerchantApply(id: number) {
|
||||
const res = await request.get<ApiResult<ShopMerchantApply>>(
|
||||
'/shop/shop-merchant-apply/' + id
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
72
src/api/shop/shopMerchantApply/model/index.ts
Normal file
72
src/api/shop/shopMerchantApply/model/index.ts
Normal file
@@ -0,0 +1,72 @@
|
||||
import type { PageParam } from '@/api/index';
|
||||
|
||||
/**
|
||||
* 商户入驻申请
|
||||
*/
|
||||
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;
|
||||
}
|
||||
103
src/api/shop/shopMerchantCount/index.ts
Normal file
103
src/api/shop/shopMerchantCount/index.ts
Normal file
@@ -0,0 +1,103 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api/index';
|
||||
import type { ShopMerchantCount, ShopMerchantCountParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询门店销售统计表
|
||||
*/
|
||||
export async function pageShopMerchantCount(params: ShopMerchantCountParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopMerchantCount>>>(
|
||||
'/shop/shop-merchant-count/page',
|
||||
params
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询门店销售统计表列表
|
||||
*/
|
||||
export async function listShopMerchantCount(params?: ShopMerchantCountParam) {
|
||||
const res = await request.get<ApiResult<ShopMerchantCount[]>>(
|
||||
'/shop/shop-merchant-count',
|
||||
params
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加门店销售统计表
|
||||
*/
|
||||
export async function addShopMerchantCount(data: ShopMerchantCount) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-merchant-count',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改门店销售统计表
|
||||
*/
|
||||
export async function updateShopMerchantCount(data: ShopMerchantCount) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-merchant-count',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除门店销售统计表
|
||||
*/
|
||||
export async function removeShopMerchantCount(id?: number) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-merchant-count/' + id
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除门店销售统计表
|
||||
*/
|
||||
export async function removeBatchShopMerchantCount(
|
||||
data: (number | undefined)[]
|
||||
) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-merchant-count/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询门店销售统计表
|
||||
*/
|
||||
export async function getShopMerchantCount(id: number) {
|
||||
const res = await request.get<ApiResult<ShopMerchantCount>>(
|
||||
'/shop/shop-merchant-count/' + id
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
29
src/api/shop/shopMerchantCount/model/index.ts
Normal file
29
src/api/shop/shopMerchantCount/model/index.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import type { PageParam } from '@/api/index';
|
||||
|
||||
/**
|
||||
* 门店销售统计表
|
||||
*/
|
||||
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;
|
||||
}
|
||||
103
src/api/shop/shopMerchantType/index.ts
Normal file
103
src/api/shop/shopMerchantType/index.ts
Normal file
@@ -0,0 +1,103 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api/index';
|
||||
import type { ShopMerchantType, ShopMerchantTypeParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询商户类型
|
||||
*/
|
||||
export async function pageShopMerchantType(params: ShopMerchantTypeParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopMerchantType>>>(
|
||||
'/shop/shop-merchant-type/page',
|
||||
params
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商户类型列表
|
||||
*/
|
||||
export async function listShopMerchantType(params?: ShopMerchantTypeParam) {
|
||||
const res = await request.get<ApiResult<ShopMerchantType[]>>(
|
||||
'/shop/shop-merchant-type',
|
||||
params
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加商户类型
|
||||
*/
|
||||
export async function addShopMerchantType(data: ShopMerchantType) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-merchant-type',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商户类型
|
||||
*/
|
||||
export async function updateShopMerchantType(data: ShopMerchantType) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-merchant-type',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商户类型
|
||||
*/
|
||||
export async function removeShopMerchantType(id?: number) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-merchant-type/' + id
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除商户类型
|
||||
*/
|
||||
export async function removeBatchShopMerchantType(
|
||||
data: (number | undefined)[]
|
||||
) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-merchant-type/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询商户类型
|
||||
*/
|
||||
export async function getShopMerchantType(id: number) {
|
||||
const res = await request.get<ApiResult<ShopMerchantType>>(
|
||||
'/shop/shop-merchant-type/' + id
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
30
src/api/shop/shopMerchantType/model/index.ts
Normal file
30
src/api/shop/shopMerchantType/model/index.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import type { PageParam } from '@/api/index';
|
||||
|
||||
/**
|
||||
* 商户类型
|
||||
*/
|
||||
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;
|
||||
}
|
||||
115
src/api/shop/shopOrder/index.ts
Normal file
115
src/api/shop/shopOrder/index.ts
Normal file
@@ -0,0 +1,115 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api/index';
|
||||
import type { ShopOrder, ShopOrderParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询订单
|
||||
*/
|
||||
export async function pageShopOrder(params: ShopOrderParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopOrder>>>(
|
||||
'/shop/shop-order/page',
|
||||
params
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询订单列表
|
||||
*/
|
||||
export async function listShopOrder(params?: ShopOrderParam) {
|
||||
const res = await request.get<ApiResult<ShopOrder[]>>(
|
||||
'/shop/shop-order',
|
||||
params
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加订单
|
||||
*/
|
||||
export async function addShopOrder(data: ShopOrder) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-order',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改订单
|
||||
*/
|
||||
export async function updateShopOrder(data: ShopOrder) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-order',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除订单
|
||||
*/
|
||||
export async function removeShopOrder(id?: number) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-order/' + id
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除订单
|
||||
*/
|
||||
export async function removeBatchShopOrder(data: (number | undefined)[]) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-order/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询订单
|
||||
*/
|
||||
export async function getShopOrder(id: number) {
|
||||
const res = await request.get<ApiResult<ShopOrder>>(
|
||||
'/shop/shop-order/' + id
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改订单
|
||||
*/
|
||||
export async function repairOrder(data: ShopOrder) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-order/repair',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
157
src/api/shop/shopOrder/model/index.ts
Normal file
157
src/api/shop/shopOrder/model/index.ts
Normal file
@@ -0,0 +1,157 @@
|
||||
import type { PageParam } from '@/api/index';
|
||||
|
||||
/**
|
||||
* 订单
|
||||
*/
|
||||
export interface ShopOrder {
|
||||
// 订单号
|
||||
orderId?: number;
|
||||
// 订单编号
|
||||
orderNo?: string;
|
||||
// 订单类型,0商城订单 1预定订单/外卖 2会员卡
|
||||
type?: number;
|
||||
// 快递/自提
|
||||
deliveryType?: number;
|
||||
// 下单渠道,0小程序预定 1俱乐部训练场 3活动订场
|
||||
channel?: number;
|
||||
// 微信支付订单号
|
||||
transactionId?: string;
|
||||
// 微信退款订单号
|
||||
refundOrder?: string;
|
||||
// 商户ID
|
||||
merchantId?: number;
|
||||
// 商户名称
|
||||
merchantName?: string;
|
||||
// 商户编号
|
||||
merchantCode?: string;
|
||||
// 使用的优惠券id
|
||||
couponId?: number;
|
||||
// 使用的会员卡id
|
||||
cardId?: string;
|
||||
// 关联管理员id
|
||||
adminId?: number;
|
||||
// 核销管理员id
|
||||
confirmId?: number;
|
||||
// IC卡号
|
||||
icCard?: string;
|
||||
// 头像
|
||||
avatar?: string;
|
||||
// 真实姓名
|
||||
realName?: string;
|
||||
// 手机号码
|
||||
phone?: string;
|
||||
// 手机号码(脱敏)
|
||||
mobile?: string;
|
||||
// 收货地址
|
||||
address?: string;
|
||||
//
|
||||
addressLat?: string;
|
||||
//
|
||||
addressLng?: string;
|
||||
// 自提店铺id
|
||||
selfTakeMerchantId?: number;
|
||||
// 自提店铺
|
||||
selfTakeMerchantName?: string;
|
||||
// 配送开始时间
|
||||
sendStartTime?: string;
|
||||
// 配送结束时间
|
||||
sendEndTime?: string;
|
||||
// 发货店铺id
|
||||
expressMerchantId?: number;
|
||||
// 发货店铺
|
||||
expressMerchantName?: string;
|
||||
// 订单总额
|
||||
totalPrice?: string;
|
||||
// 减少的金额,使用VIP会员折扣、优惠券抵扣、优惠券折扣后减去的价格
|
||||
reducePrice?: string;
|
||||
// 实际付款
|
||||
payPrice?: string;
|
||||
// 用于统计
|
||||
price?: string;
|
||||
// 价钱,用于积分赠送
|
||||
money?: string;
|
||||
// 退款金额
|
||||
refundMoney?: string;
|
||||
// 教练价格
|
||||
coachPrice?: string;
|
||||
// 购买数量
|
||||
totalNum?: number;
|
||||
// 教练id
|
||||
coachId?: number;
|
||||
// 支付的用户id
|
||||
payUserId?: number;
|
||||
// 0余额支付, 1微信支付,102微信Native,2会员卡支付,3支付宝,4现金,5POS机,6VIP月卡,7VIP年卡,8VIP次卡,9IC月卡,10IC年卡,11IC次卡,12免费,13VIP充值卡,14IC充值卡,15积分支付,16VIP季卡,17IC季卡,18代付
|
||||
payType?: number;
|
||||
// 代付支付方式,0余额支付, 1微信支付,102微信Native,2会员卡支付,3支付宝,4现金,5POS机,6VIP月卡,7VIP年卡,8VIP次卡,9IC月卡,10IC年卡,11IC次卡,12免费,13VIP充值卡,14IC充值卡,15积分支付,16VIP季卡,17IC季卡,18代付
|
||||
friendPayType?: number;
|
||||
// 0未付款,1已付款
|
||||
payStatus?: number;
|
||||
// 0未使用,1已完成,2已取消,3取消中,4退款申请中,5退款被拒绝,6退款成功,7客户端申请退款
|
||||
orderStatus?: number;
|
||||
// 发货状态(10未发货 20已发货 30部分发货)
|
||||
deliveryStatus?: number;
|
||||
// 发货时间
|
||||
deliveryTime?: string;
|
||||
// 优惠类型:0无、1抵扣优惠券、2折扣优惠券、3、VIP月卡、4VIP年卡,5VIP次卡、6VIP会员卡、7IC月卡、8IC年卡、9IC次卡、10IC会员卡、11免费订单、12VIP充值卡、13IC充值卡、14VIP季卡、15IC季卡
|
||||
couponType?: number;
|
||||
// 优惠说明
|
||||
couponDesc?: string;
|
||||
// 二维码地址,保存订单号,支付成功后才生成
|
||||
qrcode?: string;
|
||||
// vip月卡年卡、ic月卡年卡回退次数
|
||||
returnNum?: number;
|
||||
// vip充值回退金额
|
||||
returnMoney?: string;
|
||||
// 预约详情开始时间数组
|
||||
startTime?: string;
|
||||
// 是否已开具发票:0未开发票,1已开发票,2不能开具发票
|
||||
isInvoice?: number;
|
||||
// 发票流水号
|
||||
invoiceNo?: string;
|
||||
// 支付时间
|
||||
payTime?: string;
|
||||
// 退款时间
|
||||
refundTime?: string;
|
||||
// 申请退款时间
|
||||
refundApplyTime?: string;
|
||||
// 过期时间
|
||||
expirationTime?: string;
|
||||
// 对账情况:0=未对账;1=已对账;3=已对账,金额对不上;4=未查询到该订单
|
||||
checkBill?: number;
|
||||
// 订单是否已结算(0未结算 1已结算)
|
||||
isSettled?: number;
|
||||
// 系统版本号 0当前版本 value=其他版本
|
||||
version?: number;
|
||||
// 用户id
|
||||
userId?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 自提码
|
||||
selfTakeCode?: string;
|
||||
// 是否已收到赠品
|
||||
hasTakeGift?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单搜索条件
|
||||
*/
|
||||
export interface ShopOrderParam extends PageParam {
|
||||
orderId?: number;
|
||||
orderNo?: string;
|
||||
phone?: string;
|
||||
payStatus?: number;
|
||||
orderStatus?: number;
|
||||
payType?: number;
|
||||
isInvoice?: boolean;
|
||||
keywords?: string;
|
||||
}
|
||||
101
src/api/shop/shopSpec/index.ts
Normal file
101
src/api/shop/shopSpec/index.ts
Normal file
@@ -0,0 +1,101 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api/index';
|
||||
import { ShopSpec, ShopSpecParam } from '@/api/shop/shopSpec/model';
|
||||
|
||||
/**
|
||||
* 分页查询规格
|
||||
*/
|
||||
export async function pageShopSpec(params: ShopSpecParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopSpec>>>(
|
||||
'/shop/shop-spec/page',
|
||||
params
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询规格列表
|
||||
*/
|
||||
export async function listShopSpec(params?: ShopSpecParam) {
|
||||
const res = await request.get<ApiResult<ShopSpec[]>>(
|
||||
'/shop/shop-spec',
|
||||
params
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加规格
|
||||
*/
|
||||
export async function addShopSpec(data: ShopSpec) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-spec',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改规格
|
||||
*/
|
||||
export async function updateShopSpec(data: ShopSpec) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-spec',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除规格
|
||||
*/
|
||||
export async function removeShopSpec(id?: number) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-spec/' + id
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除规格
|
||||
*/
|
||||
export async function removeBatchShopSpec(data: (number | undefined)[]) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-spec/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询规格
|
||||
*/
|
||||
export async function getShopSpec(id: number) {
|
||||
const res = await request.get<ApiResult<ShopSpec>>(
|
||||
'/shop/shop-spec/' + id
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
38
src/api/shop/shopSpec/model/index.ts
Normal file
38
src/api/shop/shopSpec/model/index.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
import type { PageParam } from '@/api/index';
|
||||
|
||||
/**
|
||||
* 规格
|
||||
*/
|
||||
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;
|
||||
}
|
||||
101
src/api/shop/shopSpecValue/index.ts
Normal file
101
src/api/shop/shopSpecValue/index.ts
Normal file
@@ -0,0 +1,101 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api/index';
|
||||
import type { ShopSpecValue, ShopSpecValueParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询规格值
|
||||
*/
|
||||
export async function pageShopSpecValue(params: ShopSpecValueParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopSpecValue>>>(
|
||||
'/shop/shop-spec-value/page',
|
||||
params
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询规格值列表
|
||||
*/
|
||||
export async function listShopSpecValue(params?: ShopSpecValueParam) {
|
||||
const res = await request.get<ApiResult<ShopSpecValue[]>>(
|
||||
'/shop/shop-spec-value',
|
||||
params
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加规格值
|
||||
*/
|
||||
export async function addShopSpecValue(data: ShopSpecValue) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-spec-value',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改规格值
|
||||
*/
|
||||
export async function updateShopSpecValue(data: ShopSpecValue) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-spec-value',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除规格值
|
||||
*/
|
||||
export async function removeShopSpecValue(id?: number) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-spec-value/' + id
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除规格值
|
||||
*/
|
||||
export async function removeBatchShopSpecValue(data: (number | undefined)[]) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-spec-value/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询规格值
|
||||
*/
|
||||
export async function getShopSpecValue(id: number) {
|
||||
const res = await request.get<ApiResult<ShopSpecValue>>(
|
||||
'/shop/shop-spec-value/' + id
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
29
src/api/shop/shopSpecValue/model/index.ts
Normal file
29
src/api/shop/shopSpecValue/model/index.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import type { PageParam } from '@/api/index';
|
||||
|
||||
/**
|
||||
* 规格值
|
||||
*/
|
||||
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;
|
||||
}
|
||||
101
src/api/shop/shopUserReferee/index.ts
Normal file
101
src/api/shop/shopUserReferee/index.ts
Normal file
@@ -0,0 +1,101 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api/index';
|
||||
import type { ShopUserReferee, ShopUserRefereeParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询用户推荐关系表
|
||||
*/
|
||||
export async function pageShopUserReferee(params: ShopUserRefereeParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopUserReferee>>>(
|
||||
'/shop/shop-user-referee/page',
|
||||
params
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询用户推荐关系表列表
|
||||
*/
|
||||
export async function listShopUserReferee(params?: ShopUserRefereeParam) {
|
||||
const res = await request.get<ApiResult<ShopUserReferee[]>>(
|
||||
'/shop/shop-user-referee',
|
||||
params
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加用户推荐关系表
|
||||
*/
|
||||
export async function addShopUserReferee(data: ShopUserReferee) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-user-referee',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户推荐关系表
|
||||
*/
|
||||
export async function updateShopUserReferee(data: ShopUserReferee) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-user-referee',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户推荐关系表
|
||||
*/
|
||||
export async function removeShopUserReferee(id?: number) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-user-referee/' + id
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除用户推荐关系表
|
||||
*/
|
||||
export async function removeBatchShopUserReferee(data: (number | undefined)[]) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-user-referee/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询用户推荐关系表
|
||||
*/
|
||||
export async function getShopUserReferee(id: number) {
|
||||
const res = await request.get<ApiResult<ShopUserReferee>>(
|
||||
'/shop/shop-user-referee/' + id
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
33
src/api/shop/shopUserReferee/model/index.ts
Normal file
33
src/api/shop/shopUserReferee/model/index.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import type { PageParam } from '@/api/index';
|
||||
|
||||
/**
|
||||
* 用户推荐关系表
|
||||
*/
|
||||
export interface ShopUserReferee {
|
||||
// 主键ID
|
||||
id?: number;
|
||||
// 推荐人ID
|
||||
dealerId?: number;
|
||||
// 用户id(被推荐人)
|
||||
userId?: number;
|
||||
// 推荐关系层级(1,2,3)
|
||||
level?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户推荐关系表搜索条件
|
||||
*/
|
||||
export interface ShopUserRefereeParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
Reference in New Issue
Block a user