42 changed files with 4635 additions and 35 deletions
@ -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 |
|||
|
@ -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<ApiResult<PageResult<ShopCommissionRole>>>( |
|||
'/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<ApiResult<ShopCommissionRole[]>>( |
|||
'/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<ApiResult<unknown>>( |
|||
'/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<ApiResult<unknown>>( |
|||
'/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<ApiResult<unknown>>( |
|||
'/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<ApiResult<unknown>>( |
|||
'/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<ApiResult<ShopCommissionRole>>( |
|||
'/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)); |
|||
} |
@ -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; |
|||
} |
@ -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<ApiResult<PageResult<ShopExpress>>>( |
|||
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<ApiResult<ShopExpress[]>>( |
|||
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<ApiResult<unknown>>( |
|||
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<ApiResult<unknown>>( |
|||
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<ApiResult<unknown>>( |
|||
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<ApiResult<unknown>>( |
|||
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<ApiResult<ShopExpress>>( |
|||
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)); |
|||
} |
@ -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; |
|||
} |
@ -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<ApiResult<PageResult<ShopExpressTemplate>>>( |
|||
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<ApiResult<ShopExpressTemplate[]>>( |
|||
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<ApiResult<unknown>>( |
|||
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<ApiResult<unknown>>( |
|||
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<ApiResult<unknown>>( |
|||
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<ApiResult<unknown>>( |
|||
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<ApiResult<ShopExpressTemplate>>( |
|||
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)); |
|||
} |
@ -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; |
|||
} |
@ -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<ApiResult<PageResult<ShopExpressTemplateDetail>>>( |
|||
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<ApiResult<ShopExpressTemplateDetail[]>>( |
|||
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<ApiResult<unknown>>( |
|||
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<ApiResult<unknown>>( |
|||
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<ApiResult<unknown>>( |
|||
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<ApiResult<unknown>>( |
|||
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<ApiResult<ShopExpressTemplateDetail>>( |
|||
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)); |
|||
} |
@ -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; |
|||
} |
@ -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<ApiResult<PageResult<ShopGoods>>>( |
|||
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<ApiResult<ShopGoods[]>>( |
|||
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<ApiResult<unknown>>( |
|||
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<ApiResult<unknown>>( |
|||
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<ApiResult<unknown>>( |
|||
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<ApiResult<unknown>>( |
|||
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<ApiResult<ShopGoods>>( |
|||
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)); |
|||
} |
@ -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; |
|||
} |
@ -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<ApiResult<PageResult<ShopGoodsCategory>>>( |
|||
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<ApiResult<ShopGoodsCategory[]>>( |
|||
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<ApiResult<unknown>>( |
|||
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<ApiResult<unknown>>( |
|||
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<ApiResult<unknown>>( |
|||
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<ApiResult<unknown>>( |
|||
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<ApiResult<ShopGoodsCategory>>( |
|||
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)); |
|||
} |
@ -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; |
|||
} |
@ -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<ApiResult<PageResult<ShopGoodsRoleCommission>>>( |
|||
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<ApiResult<ShopGoodsRoleCommission[]>>( |
|||
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<ApiResult<unknown>>( |
|||
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<ApiResult<unknown>>( |
|||
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<ApiResult<unknown>>( |
|||
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<ApiResult<unknown>>( |
|||
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<ApiResult<ShopGoodsRoleCommission>>( |
|||
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)); |
|||
} |
@ -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; |
|||
} |
@ -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<ApiResult<ShopGoodsSku[]>>( |
|||
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<ApiResult<PageResult<ShopGoodsSku>>>( |
|||
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<ApiResult<ShopGoodsSku[]>>( |
|||
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<ApiResult<unknown>>( |
|||
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<ApiResult<unknown>>( |
|||
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<ApiResult<unknown>>( |
|||
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<ApiResult<unknown>>( |
|||
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<ApiResult<ShopGoodsSku>>( |
|||
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)); |
|||
} |
@ -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; |
|||
} |
@ -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<ApiResult<PageResult<ShopGoodsSpec>>>( |
|||
'/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<ApiResult<ShopGoodsSpec[]>>( |
|||
'/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<ApiResult<unknown>>( |
|||
'/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<ApiResult<unknown>>( |
|||
'/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<ApiResult<unknown>>( |
|||
'/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<ApiResult<unknown>>( |
|||
'/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<ApiResult<ShopGoodsSpec>>( |
|||
'/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)); |
|||
} |
@ -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; |
|||
} |
@ -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<ApiResult<PageResult<ShopMerchant>>>( |
|||
'/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<ApiResult<ShopMerchant[]>>( |
|||
'/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<ApiResult<unknown>>( |
|||
'/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<ApiResult<unknown>>( |
|||
'/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<ApiResult<unknown>>( |
|||
'/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<ApiResult<unknown>>( |
|||
'/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<ApiResult<ShopMerchant>>( |
|||
'/shop/shop-merchant/' + id |
|||
); |
|||
if (res.data.code === 0 && res.data.data) { |
|||
return res.data.data; |
|||
} |
|||
return Promise.reject(new Error(res.data.message)); |
|||
} |
@ -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; |
|||
} |
@ -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<ApiResult<PageResult<ShopMerchantAccount>>>( |
|||
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<ApiResult<ShopMerchantAccount[]>>( |
|||
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<ApiResult<unknown>>( |
|||
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<ApiResult<unknown>>( |
|||
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<ApiResult<unknown>>( |
|||
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<ApiResult<unknown>>( |
|||
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<ApiResult<ShopMerchantAccount>>( |
|||
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)); |
|||
} |
@ -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; |
|||
} |
@ -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<ApiResult<PageResult<ShopMerchantApply>>>( |
|||
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<ApiResult<ShopMerchantApply[]>>( |
|||
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<ApiResult<unknown>>( |
|||
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<ApiResult<unknown>>( |
|||
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<ApiResult<unknown>>( |
|||
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<ApiResult<unknown>>( |
|||
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<ApiResult<unknown>>( |
|||
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<ApiResult<ShopMerchantApply>>( |
|||
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)); |
|||
} |
@ -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; |
|||
} |
@ -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<ApiResult<PageResult<ShopMerchantCount>>>( |
|||
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<ApiResult<ShopMerchantCount[]>>( |
|||
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<ApiResult<unknown>>( |
|||
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<ApiResult<unknown>>( |
|||
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<ApiResult<unknown>>( |
|||
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<ApiResult<unknown>>( |
|||
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<ApiResult<ShopMerchantCount>>( |
|||
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)); |
|||
} |
@ -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; |
|||
} |
@ -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<ApiResult<PageResult<ShopMerchantType>>>( |
|||
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<ApiResult<ShopMerchantType[]>>( |
|||
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<ApiResult<unknown>>( |
|||
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<ApiResult<unknown>>( |
|||
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<ApiResult<unknown>>( |
|||
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<ApiResult<unknown>>( |
|||
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<ApiResult<ShopMerchantType>>( |
|||
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)); |
|||
} |
@ -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; |
|||
} |
@ -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<ApiResult<PageResult<ShopSpec>>>( |
|||
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<ApiResult<ShopSpec[]>>( |
|||
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<ApiResult<unknown>>( |
|||
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<ApiResult<unknown>>( |
|||
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<ApiResult<unknown>>( |
|||
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<ApiResult<unknown>>( |
|||
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<ApiResult<ShopSpec>>( |
|||
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)); |
|||
} |
@ -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; |
|||
} |
@ -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<ApiResult<PageResult<ShopSpecValue>>>( |
|||
'/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<ApiResult<ShopSpecValue[]>>( |
|||
'/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<ApiResult<unknown>>( |
|||
'/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<ApiResult<unknown>>( |
|||
'/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<ApiResult<unknown>>( |
|||
'/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<ApiResult<unknown>>( |
|||
'/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<ApiResult<ShopSpecValue>>( |
|||
'/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)); |
|||
} |
@ -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; |
|||
} |
@ -0,0 +1,41 @@ |
|||
<!-- 搜索表单 --> |
|||
<template> |
|||
<a-space |
|||
style="flex-wrap: wrap" |
|||
v-if="hasRole('superAdmin') || hasRole('admin') || hasRole('foundation')" |
|||
> |
|||
<a-button type="text" @click="push('/shop/category')">商品分类</a-button> |
|||
</a-space> |
|||
</template> |
|||
|
|||
<script lang="ts" setup> |
|||
import { watch, nextTick } from 'vue'; |
|||
import { CmsWebsite } from '@/api/cms/cmsWebsite/model'; |
|||
import { push } from '@/utils/common'; |
|||
import { hasRole } from '@/utils/permission'; |
|||
|
|||
const props = withDefaults( |
|||
defineProps<{ |
|||
// 选中的角色 |
|||
selection?: []; |
|||
website?: CmsWebsite; |
|||
count?: 0; |
|||
}>(), |
|||
{} |
|||
); |
|||
|
|||
const emit = defineEmits<{ |
|||
(e: 'add'): void; |
|||
}>(); |
|||
|
|||
nextTick(() => { |
|||
if (localStorage.getItem('NotActive')) { |
|||
// IsActive.value = false |
|||
} |
|||
}); |
|||
|
|||
watch( |
|||
() => props.selection, |
|||
() => {} |
|||
); |
|||
</script> |
@ -0,0 +1,155 @@ |
|||
<!-- 搜索表单 --> |
|||
<template> |
|||
<a-space :size="10" style="flex-wrap: wrap"> |
|||
<a-button type="primary" class="ele-btn-icon" @click="add"> |
|||
<template #icon> |
|||
<PlusOutlined /> |
|||
</template> |
|||
<span>添加</span> |
|||
</a-button> |
|||
<a-radio-group v-model:value="type" @change="handleSearch"> |
|||
<a-radio-button value="出售中" |
|||
>出售中({{ goodsCount?.totalNum }}) |
|||
</a-radio-button> |
|||
<a-radio-button value="待上架" |
|||
>待上架({{ goodsCount?.totalNum2 }}) |
|||
</a-radio-button> |
|||
<a-radio-button value="已售罄" |
|||
>已售罄({{ goodsCount?.totalNum3 }}) |
|||
</a-radio-button> |
|||
</a-radio-group> |
|||
<SelectMerchant |
|||
:placeholder="`商户刷新`" |
|||
class="input-item" |
|||
v-if="!merchantId" |
|||
v-model:value="where.merchantName" |
|||
@done="chooseMerchantId" |
|||
/> |
|||
<SelectGoodsCategory |
|||
class="input-item" |
|||
:placeholder="`请选择商品分类`" |
|||
v-model:value="where.categoryId" |
|||
@done="chooseGoodsCategory" |
|||
/> |
|||
<a-input-search |
|||
allow-clear |
|||
placeholder="请输入关键词" |
|||
v-model:value="where.keywords" |
|||
@pressEnter="reload" |
|||
@search="reload" |
|||
/> |
|||
<a-button @click="reset">重置</a-button> |
|||
</a-space> |
|||
</template> |
|||
|
|||
<script lang="ts" setup> |
|||
import { PlusOutlined } from '@ant-design/icons-vue'; |
|||
import { ref, watch } from 'vue'; |
|||
import { getCount } from '@/api/shop/shopGoods'; |
|||
import type { GoodsCount, ShopGoodsParam } from '@/api/shop/shopGoods/model'; |
|||
import useSearch from '@/utils/use-search'; |
|||
import { ShopMerchant } from '@/api/shop/shopMerchant/model'; |
|||
import { ShopGoodsCategory } from '@/api/shop/shopGoodsCategory/model'; |
|||
import { getMerchantId } from '@/utils/merchant'; |
|||
|
|||
const props = withDefaults( |
|||
defineProps<{ |
|||
// 选中的角色 |
|||
selection?: []; |
|||
merchantId?: number; |
|||
}>(), |
|||
{ |
|||
merchantId: getMerchantId() |
|||
} |
|||
); |
|||
|
|||
const type = ref<string>(); |
|||
// 统计数据 |
|||
const goodsCount = ref<GoodsCount>(); |
|||
|
|||
// 表单数据 |
|||
const { where, resetFields } = useSearch<ShopGoodsParam>({ |
|||
goodsId: undefined, |
|||
isShow: undefined, |
|||
status: undefined, |
|||
stock: undefined, |
|||
categoryId: undefined, |
|||
merchantId: undefined, |
|||
keywords: '' |
|||
}); |
|||
|
|||
const emit = defineEmits<{ |
|||
(e: 'search', where?: ShopGoodsParam): void; |
|||
(e: 'add'): void; |
|||
(e: 'remove'): void; |
|||
(e: 'batchMove'): void; |
|||
}>(); |
|||
|
|||
// 新增 |
|||
const add = () => { |
|||
emit('add'); |
|||
}; |
|||
|
|||
const handleSearch = (e) => { |
|||
const text = e.target.value; |
|||
resetFields(); |
|||
if (text === '出售中') { |
|||
where.sceneType = 'on_sale'; |
|||
} |
|||
if (text === '待上架') { |
|||
where.sceneType = 'pending'; |
|||
} |
|||
if (text === '已售罄') { |
|||
where.sceneType = 'sold_out'; |
|||
} |
|||
emit('search', where); |
|||
}; |
|||
|
|||
const reload = () => { |
|||
getCount(where).then((data: any) => { |
|||
goodsCount.value = data; |
|||
}); |
|||
emit('search', where); |
|||
}; |
|||
|
|||
/* 搜索 */ |
|||
const chooseMerchantId = (item: ShopMerchant) => { |
|||
where.merchantName = item.merchantName; |
|||
where.merchantId = item.merchantId; |
|||
reload(); |
|||
}; |
|||
|
|||
const chooseGoodsCategory = ( |
|||
category: ShopGoodsCategory, |
|||
data: ShopGoodsCategory |
|||
) => { |
|||
where.categoryName = data[1].label; |
|||
where.categoryId = data[1].value; |
|||
reload(); |
|||
}; |
|||
|
|||
/* 重置 */ |
|||
const reset = () => { |
|||
resetFields(); |
|||
type.value = ''; |
|||
reload(); |
|||
}; |
|||
|
|||
// watch( |
|||
// () => props.selection, |
|||
// () => {} |
|||
// ); |
|||
watch( |
|||
() => props.merchantId, |
|||
(id) => { |
|||
if (Number(id) > 0) { |
|||
where.merchantId = id; |
|||
reload(); |
|||
} else { |
|||
where.merchantId = undefined; |
|||
reload(); |
|||
} |
|||
}, |
|||
{ immediate: true } |
|||
); |
|||
</script> |
File diff suppressed because it is too large
@ -0,0 +1,281 @@ |
|||
<template> |
|||
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)"> |
|||
<template #extra> |
|||
<Extra /> |
|||
</template> |
|||
<a-card :bordered="false" :body-style="{ padding: '16px' }"> |
|||
<ele-pro-table |
|||
ref="tableRef" |
|||
row-key="goodsId" |
|||
:columns="columns" |
|||
:datasource="datasource" |
|||
:customRow="customRow" |
|||
tool-class="ele-toolbar-form" |
|||
class="sys-org-table" |
|||
> |
|||
<template #toolbar> |
|||
<search |
|||
@search="reload" |
|||
:selection="selection" |
|||
@add="openEdit" |
|||
@remove="removeBatch" |
|||
@batchMove="openMove" |
|||
/> |
|||
</template> |
|||
<template #bodyCell="{ column, record }"> |
|||
<template v-if="column.key === 'name'"> |
|||
<a-space class="flex items-center"> |
|||
<a-image :src="record.image" v-if="record.image" :width="50" /> |
|||
<span class="text-gray-700 font-bold">{{ record.name }}</span> |
|||
</a-space> |
|||
</template> |
|||
<template v-if="column.key === 'status'"> |
|||
<a-tag v-if="record.status === 0" color="green">出售中</a-tag> |
|||
<a-tag v-if="record.status === 1" color="orange">待上架</a-tag> |
|||
<a-tag v-if="record.status === 2" color="purple">待审核</a-tag> |
|||
<a-tag v-if="record.status === 3" color="red">审核不通过</a-tag> |
|||
</template> |
|||
<template v-if="column.key === 'action'"> |
|||
<a-space> |
|||
<a @click="openEdit(record)">修改</a> |
|||
<a-divider type="vertical" /> |
|||
<a-popconfirm |
|||
title="确定要删除此记录吗?" |
|||
@confirm="remove(record)" |
|||
> |
|||
<a class="ele-text-danger">删除</a> |
|||
</a-popconfirm> |
|||
</a-space> |
|||
</template> |
|||
</template> |
|||
</ele-pro-table> |
|||
</a-card> |
|||
|
|||
<!-- 编辑弹窗 --> |
|||
<ShopGoodsEdit v-model:visible="showEdit" :data="current" @done="reload" /> |
|||
</a-page-header> |
|||
</template> |
|||
|
|||
<script lang="ts" setup> |
|||
import { createVNode, ref } from 'vue'; |
|||
import { message, Modal } from 'ant-design-vue'; |
|||
import { ExclamationCircleOutlined } from '@ant-design/icons-vue'; |
|||
import type { EleProTable } from 'ele-admin-pro'; |
|||
import { toDateString } from 'ele-admin-pro'; |
|||
import type { |
|||
DatasourceFunction, |
|||
ColumnItem |
|||
} from 'ele-admin-pro/es/ele-pro-table/types'; |
|||
import Search from './components/search.vue'; |
|||
import ShopGoodsEdit from './components/shopGoodsEdit.vue'; |
|||
import { |
|||
pageShopGoods, |
|||
removeShopGoods, |
|||
removeBatchShopGoods |
|||
} from '@/api/shop/shopGoods'; |
|||
import type { ShopGoods, ShopGoodsParam } from '@/api/shop/shopGoods/model'; |
|||
import { getPageTitle } from '@/utils/common'; |
|||
import Extra from '@/views/shop/shopGoods/components/extra.vue'; |
|||
|
|||
// 表格实例 |
|||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null); |
|||
|
|||
// 表格选中数据 |
|||
const selection = ref<ShopGoods[]>([]); |
|||
// 当前编辑数据 |
|||
const current = ref<ShopGoods | null>(null); |
|||
// 是否显示编辑弹窗 |
|||
const showEdit = ref(false); |
|||
// 是否显示批量移动弹窗 |
|||
const showMove = ref(false); |
|||
// 加载状态 |
|||
const loading = ref(true); |
|||
|
|||
// 表格数据源 |
|||
const datasource: DatasourceFunction = ({ |
|||
page, |
|||
limit, |
|||
where, |
|||
orders, |
|||
filters |
|||
}) => { |
|||
if (filters) { |
|||
where.status = filters.status; |
|||
} |
|||
return pageShopGoods({ |
|||
...where, |
|||
...orders, |
|||
page, |
|||
limit |
|||
}); |
|||
}; |
|||
|
|||
// 表格列配置 |
|||
const columns = ref<ColumnItem[]>([ |
|||
{ |
|||
title: 'ID', |
|||
dataIndex: 'goodsId', |
|||
key: 'goodsId', |
|||
align: 'center', |
|||
width: 90 |
|||
}, |
|||
{ |
|||
title: '商品', |
|||
dataIndex: 'name', |
|||
key: 'name', |
|||
width: 280 |
|||
}, |
|||
// { |
|||
// title: '编号', |
|||
// dataIndex: 'code', |
|||
// key: 'code', |
|||
// align: 'center', |
|||
// }, |
|||
{ |
|||
title: '价格', |
|||
dataIndex: 'price', |
|||
key: 'price', |
|||
align: 'center' |
|||
}, |
|||
{ |
|||
title: '销量', |
|||
dataIndex: 'sales', |
|||
key: 'sales', |
|||
align: 'center' |
|||
}, |
|||
{ |
|||
title: '库存', |
|||
dataIndex: 'stock', |
|||
key: 'stock', |
|||
align: 'center' |
|||
}, |
|||
{ |
|||
title: '推荐', |
|||
dataIndex: 'recommend', |
|||
key: 'recommend', |
|||
align: 'center' |
|||
}, |
|||
{ |
|||
title: '状态', |
|||
dataIndex: 'status', |
|||
key: 'status', |
|||
align: 'center' |
|||
}, |
|||
// { |
|||
// title: '备注', |
|||
// dataIndex: 'comments', |
|||
// key: 'comments', |
|||
// align: 'center', |
|||
// }, |
|||
{ |
|||
title: '排序号', |
|||
dataIndex: 'sortNumber', |
|||
key: 'sortNumber', |
|||
align: 'center' |
|||
}, |
|||
{ |
|||
title: '创建时间', |
|||
dataIndex: 'createTime', |
|||
key: 'createTime', |
|||
align: 'center', |
|||
sorter: true, |
|||
ellipsis: true, |
|||
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd') |
|||
}, |
|||
{ |
|||
title: '操作', |
|||
key: 'action', |
|||
width: 180, |
|||
fixed: 'right', |
|||
align: 'center', |
|||
hideInSetting: true |
|||
} |
|||
]); |
|||
|
|||
/* 搜索 */ |
|||
const reload = (where?: ShopGoodsParam) => { |
|||
selection.value = []; |
|||
tableRef?.value?.reload({ where: where }); |
|||
}; |
|||
|
|||
/* 打开编辑弹窗 */ |
|||
const openEdit = (row?: ShopGoods) => { |
|||
current.value = row ?? null; |
|||
showEdit.value = true; |
|||
}; |
|||
|
|||
/* 打开批量移动弹窗 */ |
|||
const openMove = () => { |
|||
showMove.value = true; |
|||
}; |
|||
|
|||
/* 删除单个 */ |
|||
const remove = (row: ShopGoods) => { |
|||
const hide = message.loading('请求中..', 0); |
|||
removeShopGoods(row.shopGoodsId) |
|||
.then((msg) => { |
|||
hide(); |
|||
message.success(msg); |
|||
reload(); |
|||
}) |
|||
.catch((e) => { |
|||
hide(); |
|||
message.error(e.message); |
|||
}); |
|||
}; |
|||
|
|||
/* 批量删除 */ |
|||
const removeBatch = () => { |
|||
if (!selection.value.length) { |
|||
message.error('请至少选择一条数据'); |
|||
return; |
|||
} |
|||
Modal.confirm({ |
|||
title: '提示', |
|||
content: '确定要删除选中的记录吗?', |
|||
icon: createVNode(ExclamationCircleOutlined), |
|||
maskClosable: true, |
|||
onOk: () => { |
|||
const hide = message.loading('请求中..', 0); |
|||
removeBatchShopGoods(selection.value.map((d) => d.shopGoodsId)) |
|||
.then((msg) => { |
|||
hide(); |
|||
message.success(msg); |
|||
reload(); |
|||
}) |
|||
.catch((e) => { |
|||
hide(); |
|||
message.error(e.message); |
|||
}); |
|||
} |
|||
}); |
|||
}; |
|||
|
|||
/* 查询 */ |
|||
const query = () => { |
|||
loading.value = true; |
|||
}; |
|||
|
|||
/* 自定义行属性 */ |
|||
const customRow = (record: ShopGoods) => { |
|||
return { |
|||
// 行点击事件 |
|||
onClick: () => { |
|||
// console.log(record); |
|||
}, |
|||
// 行双击事件 |
|||
onDblclick: () => { |
|||
openEdit(record); |
|||
} |
|||
}; |
|||
}; |
|||
query(); |
|||
</script> |
|||
|
|||
<script lang="ts"> |
|||
export default { |
|||
name: 'ShopGoods' |
|||
}; |
|||
</script> |
|||
|
|||
<style lang="less" scoped></style> |
Loading…
Reference in new issue