Browse Source

新增:shop模块

dev
科技小王子 2 months ago
parent
commit
2c569cb237
  1. 4
      .env.development
  2. 4
      src/api/hjm/hjmCar/model/index.ts
  3. 105
      src/api/shop/shopCommissionRole/index.ts
  4. 35
      src/api/shop/shopCommissionRole/model/index.ts
  5. 106
      src/api/shop/shopExpress/index.ts
  6. 35
      src/api/shop/shopExpress/model/index.ts
  7. 106
      src/api/shop/shopExpressTemplate/index.ts
  8. 41
      src/api/shop/shopExpressTemplate/model/index.ts
  9. 106
      src/api/shop/shopExpressTemplateDetail/index.ts
  10. 45
      src/api/shop/shopExpressTemplateDetail/model/index.ts
  11. 116
      src/api/shop/shopGoods/index.ts
  12. 147
      src/api/shop/shopGoods/model/index.ts
  13. 106
      src/api/shop/shopGoodsCategory/index.ts
  14. 64
      src/api/shop/shopGoodsCategory/model/index.ts
  15. 106
      src/api/shop/shopGoodsRoleCommission/index.ts
  16. 35
      src/api/shop/shopGoodsRoleCommission/model/index.ts
  17. 118
      src/api/shop/shopGoodsSku/index.ts
  18. 50
      src/api/shop/shopGoodsSku/model/index.ts
  19. 105
      src/api/shop/shopGoodsSpec/index.ts
  20. 29
      src/api/shop/shopGoodsSpec/model/index.ts
  21. 105
      src/api/shop/shopMerchant/index.ts
  22. 90
      src/api/shop/shopMerchant/model/index.ts
  23. 106
      src/api/shop/shopMerchantAccount/index.ts
  24. 39
      src/api/shop/shopMerchantAccount/model/index.ts
  25. 120
      src/api/shop/shopMerchantApply/index.ts
  26. 72
      src/api/shop/shopMerchantApply/model/index.ts
  27. 108
      src/api/shop/shopMerchantCount/index.ts
  28. 29
      src/api/shop/shopMerchantCount/model/index.ts
  29. 108
      src/api/shop/shopMerchantType/index.ts
  30. 30
      src/api/shop/shopMerchantType/model/index.ts
  31. 106
      src/api/shop/shopSpec/index.ts
  32. 38
      src/api/shop/shopSpec/model/index.ts
  33. 105
      src/api/shop/shopSpecValue/index.ts
  34. 29
      src/api/shop/shopSpecValue/model/index.ts
  35. 24
      src/components/SelectGoodsCategory/index.vue
  36. 16
      src/components/SelectSpec/components/select-data.vue
  37. 32
      src/views/hjm/hjmCar/index.vue
  38. 41
      src/views/shop/shopGoods/components/extra.vue
  39. 155
      src/views/shop/shopGoods/components/search.vue
  40. 1557
      src/views/shop/shopGoods/components/shopGoodsEdit.vue
  41. 281
      src/views/shop/shopGoods/index.vue
  42. 16
      src/views/system/setting/components/mp-weixin.vue

4
.env.development

@ -1,10 +1,10 @@
VITE_APP_NAME=后台管理系统
VITE_SOCKET_URL=wss://server.gxwebsoft.com
VITE_SERVER_URL=https://server.gxwebsoft.com/api
#VITE_API_URL=https://cms-api.websoft.top/api
VITE_API_URL=https://cms-api.websoft.top/api
#VITE_SOCKET_URL=ws://127.0.0.1:9191
#VITE_SERVER_URL=http://127.0.0.1:8000/api
VITE_API_URL=http://127.0.0.1:9000/api
#VITE_API_URL=http://127.0.0.1:9000/api
#/booking/bookingItem

4
src/api/hjm/hjmCar/model/index.ts

@ -23,6 +23,8 @@ export interface HjmCar {
driverId?: number;
// 操作员名称
driver?: string;
// 操作员名称
driverName?: string;
// 操作员手机号
driverPhone?: string;
// 保险状态
@ -53,6 +55,8 @@ export interface HjmCar {
organizationParentId?: number;
// 用户ID
userId?: number;
// 认领状态
claim?: number;
// 绑定用户
toUser?: string;
// 排序(数字越小越靠前)

105
src/api/shop/shopCommissionRole/index.ts

@ -0,0 +1,105 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { ShopCommissionRole, ShopCommissionRoleParam } from './model';
/**
*
*/
export async function pageShopCommissionRole(params: ShopCommissionRoleParam) {
const res = await request.get<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));
}

35
src/api/shop/shopCommissionRole/model/index.ts

@ -0,0 +1,35 @@
import type { PageParam } from '@/api';
/**
*
*/
export interface ShopCommissionRole {
//
id?: number;
//
title?: string;
//
provinceId?: number;
//
cityId?: number;
//
regionId?: number;
// 状态, 0正常, 1异常
status?: number;
// 备注
comments?: string;
// 租户id
tenantId?: number;
// 创建时间
createTime?: string;
//
sortNumber?: number;
}
/**
*
*/
export interface ShopCommissionRoleParam extends PageParam {
id?: number;
keywords?: string;
}

106
src/api/shop/shopExpress/index.ts

@ -0,0 +1,106 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { ShopExpress, ShopExpressParam } from './model';
import { MODULES_API_URL } from '@/config/setting';
/**
*
*/
export async function pageShopExpress(params: ShopExpressParam) {
const res = await request.get<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));
}

35
src/api/shop/shopExpress/model/index.ts

@ -0,0 +1,35 @@
import type { PageParam } from '@/api';
/**
*
*/
export interface ShopExpress {
// 物流公司ID
expressId?: number;
// 物流公司名称
expressName?: string;
// 物流公司编码 (微信)
wxCode?: string;
// 物流公司编码 (快递100)
kuaidi100Code?: string;
// 物流公司编码 (快递鸟)
kdniaoCode?: string;
// 排序号
sortNumber?: number;
// 是否删除, 0否, 1是
deleted?: number;
// 租户id
tenantId?: number;
// 创建时间
createTime?: string;
// 修改时间
updateTime?: string;
}
/**
*
*/
export interface ShopExpressParam extends PageParam {
expressId?: number;
keywords?: string;
}

106
src/api/shop/shopExpressTemplate/index.ts

@ -0,0 +1,106 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { ShopExpressTemplate, ShopExpressTemplateParam } from './model';
import { MODULES_API_URL } from '@/config/setting';
/**
*
*/
export async function pageShopExpressTemplate(params: ShopExpressTemplateParam) {
const res = await request.get<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));
}

41
src/api/shop/shopExpressTemplate/model/index.ts

@ -0,0 +1,41 @@
import type { PageParam } from '@/api';
/**
*
*/
export interface ShopExpressTemplate {
//
id?: number;
//
type?: string;
//
title?: string;
// 收件价格
firstAmount?: string;
// 续件价格
extraAmount?: string;
// 状态, 0已发布, 1待审核 2已驳回 3违规内容
status?: number;
// 是否删除, 0否, 1是
deleted?: number;
// 租户id
tenantId?: number;
// 创建时间
createTime?: string;
// 修改时间
updateTime?: string;
//
sortNumber?: number;
// 首件数量/重量
firstNum?: string;
// 续件数量/重量
extraNum?: string;
}
/**
*
*/
export interface ShopExpressTemplateParam extends PageParam {
id?: number;
keywords?: string;
}

106
src/api/shop/shopExpressTemplateDetail/index.ts

@ -0,0 +1,106 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { ShopExpressTemplateDetail, ShopExpressTemplateDetailParam } from './model';
import { MODULES_API_URL } from '@/config/setting';
/**
*
*/
export async function pageShopExpressTemplateDetail(params: ShopExpressTemplateDetailParam) {
const res = await request.get<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));
}

45
src/api/shop/shopExpressTemplateDetail/model/index.ts

@ -0,0 +1,45 @@
import type { PageParam } from '@/api';
/**
*
*/
export interface ShopExpressTemplateDetail {
//
id?: number;
//
templateId?: number;
// 0按件
type?: string;
//
provinceId?: number;
//
cityId?: number;
// 首件数量/重量
firstNum?: string;
// 收件价格
firstAmount?: string;
// 续件价格
extraAmount?: string;
// 续件数量/重量
extraNum?: string;
// 状态, 0已发布, 1待审核 2已驳回 3违规内容
status?: number;
// 是否删除, 0否, 1是
deleted?: number;
// 租户id
tenantId?: number;
// 创建时间
createTime?: string;
// 修改时间
updateTime?: string;
//
sortNumber?: number;
}
/**
*
*/
export interface ShopExpressTemplateDetailParam extends PageParam {
id?: number;
keywords?: string;
}

116
src/api/shop/shopGoods/index.ts

@ -0,0 +1,116 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { ShopGoods, ShopGoodsParam } from './model';
import { MODULES_API_URL } from '@/config/setting';
/**
*
*/
export async function pageShopGoods(params: ShopGoodsParam) {
const res = await request.get<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));
}

147
src/api/shop/shopGoods/model/index.ts

@ -0,0 +1,147 @@
import type { PageParam } from '@/api';
import { ShopGoodsSpec } from '@/api/shop/shopGoodsSpec/model';
import { ShopGoodsSku } from '@/api/shop/shopGoodsSku/model';
import { ShopGoodsRoleCommission } from '@/api/shop/shopGoodsRoleCommission/model';
export interface GoodsCount {
totalNum: number;
totalNum2: number;
totalNum3: number;
totalNum4: number;
}
/**
*
*/
export interface ShopGoods {
// 自增ID
goodsId?: number;
// 类型 1实物商品 2虚拟商品
type?: number;
// 商品编码
code?: string;
// 商品名称
name?: string;
// 商品标题
goodsName?: string;
// 商品封面图
image?: string;
video?: string;
// 商品详情
content?: string;
canExpress?: number;
// 商品分类
category?: string;
// 商品分类ID
categoryId?: number;
parentName?: string;
categoryName?: string;
// 一级分类
categoryParent?: string;
// 二级分类
categoryChildren?: string;
// 商品规格 0单规格 1多规格
specs?: number;
commissionRole?: number;
// 货架
position?: string;
// 进货价
buyingPrice?: string;
// 商品价格
price?: string;
originPrice?: string;
// 销售价格
salePrice?: string;
chainStorePrice?: string;
chainStoreRate?: string;
memberStoreRate?: string;
memberMarketRate?: string;
memberStoreCommission?: string;
supplierCommission?: string;
coopCommission?: string;
memberStorePrice?: string;
memberMarketPrice?: string;
// 经销商价格
dealerPrice?: string;
// 有赠品
buyingGift?: boolean;
// 有赠品
priceGift?: boolean;
// 有赠品
dealerGift?: boolean;
buyingGiftNum?: number;
priceGiftNum?: number;
priceGiftName?: string;
dealerGiftNum?: number;
// 库存计算方式(10下单减库存 20付款减库存)
deductStockType?: number;
// 封面图
files?: string;
// 销量
sales?: number;
isNew?: number;
// 库存
stock?: number;
// 商品重量
goodsWeight?: number;
// 消费赚取积分
gainIntegral?: number;
// 推荐
recommend?: number;
// 商户ID
merchantId?: number;
// 商户名称
merchantName?: string;
supplierMerchantId?: number;
supplierName?: string;
// 状态(0:未上架,1:上架)
isShow?: number;
// 状态, 0上架 1待上架 2待审核 3审核不通过
status?: number;
// 备注
comments?: string;
// 排序号
sortNumber?: number;
// 用户ID
userId?: number;
// 是否删除, 0否, 1是
deleted?: number;
// 租户id
tenantId?: number;
// 创建时间
createTime?: string;
// 修改时间
updateTime?: string;
// 显示规格名
specName?: string;
// 商品规格
goodsSpecs?: ShopGoodsSpec[];
goodsRoleCommission?: ShopGoodsRoleCommission[];
// 商品sku列表
goodsSkus?: ShopGoodsSku[];
// 单位名称
unitName?: string;
expressTemplateId?: number;
canUseDate?: string;
ensureTag?: string;
expiredDay?: number;
}
export interface BathSet {
price?: number;
salePrice?: number;
stock?: number;
skuNo?: string;
}
/**
*
*/
export interface ShopGoodsParam extends PageParam {
parentId?: number;
categoryId?: number;
goodsId?: number;
goodsName?: string;
isShow?: number;
stock?: number;
keywords?: string;
}

106
src/api/shop/shopGoodsCategory/index.ts

@ -0,0 +1,106 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { ShopGoodsCategory, ShopGoodsCategoryParam } from './model';
import { MODULES_API_URL } from '@/config/setting';
/**
*
*/
export async function pageShopGoodsCategory(params: ShopGoodsCategoryParam) {
const res = await request.get<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));
}

64
src/api/shop/shopGoodsCategory/model/index.ts

@ -0,0 +1,64 @@
import type { PageParam } from '@/api';
/**
*
*/
export interface ShopGoodsCategory {
// 商品分类ID
categoryId?: number;
// 分类标识
categoryCode?: string;
// 分类名称
title?: string;
// 类型 0商城分类 1外卖分类
type?: number;
// 分类图片
image?: string;
// 上级分类ID
parentId?: number;
// 路由/链接地址
path?: string;
// 组件路径
component?: string;
// 绑定的页面
pageId?: number;
// 用户ID
userId?: number;
// 商品数量
count?: number;
// 排序(数字越小越靠前)
sortNumber?: number;
// 备注
comments?: string;
// 是否隐藏, 0否, 1是(仅注册路由不显示在左侧菜单)
hide?: number;
// 是否推荐
recommend?: number;
// 是否显示在首页
showIndex?: number;
// 商铺ID
merchantId?: number;
// 状态, 0正常, 1禁用
status?: number;
// 是否删除, 0否, 1是
deleted?: number;
// 租户id
tenantId?: number;
// 注册时间
createTime?: string;
// 修改时间
updateTime?: string;
// 子菜单
children?: ShopGoodsCategory[];
key?: number;
value?: number;
label?: string;
}
/**
*
*/
export interface ShopGoodsCategoryParam extends PageParam {
categoryId?: number;
keywords?: string;
}

106
src/api/shop/shopGoodsRoleCommission/index.ts

@ -0,0 +1,106 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import { MODULES_API_URL } from '@/config/setting';
import { ShopGoodsRoleCommission, ShopGoodsRoleCommissionParam } from '@/api/shop/shopGoodsRoleCommission/model';
/**
*
*/
export async function pageShopGoodsRoleCommission(params: ShopGoodsRoleCommissionParam) {
const res = await request.get<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));
}

35
src/api/shop/shopGoodsRoleCommission/model/index.ts

@ -0,0 +1,35 @@
import type { PageParam } from '@/api';
/**
*
*/
export interface ShopGoodsRoleCommission {
//
id?: number;
//
roleId?: number;
//
goodsId?: number;
//
sku?: string;
//
amount?: string;
// 状态, 0正常, 1异常
status?: number;
// 备注
comments?: string;
// 租户id
tenantId?: number;
// 创建时间
createTime?: string;
//
sortNumber?: number;
}
/**
*
*/
export interface ShopGoodsRoleCommissionParam extends PageParam {
id?: number;
keywords?: string;
}

118
src/api/shop/shopGoodsSku/index.ts

@ -0,0 +1,118 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import { MODULES_API_URL } from '@/config/setting';
import { ShopGoodsSpec } from '@/api/shop/shopGoodsSpec/model';
import { ShopGoodsSku, ShopGoodsSkuParam } from '@/api/shop/shopGoodsSku/model';
export async function generateGoodsSku(data: ShopGoodsSpec) {
const res = await request.post<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));
}

50
src/api/shop/shopGoodsSku/model/index.ts

@ -0,0 +1,50 @@
import type { PageParam } from '@/api';
/**
* sku列表
*/
export interface ShopGoodsSku {
// 主键ID
id?: number;
// 商品ID
goodsId?: number;
// 商品属性索引值 (attr_value|attr_value[|....])
sku?: string;
// 商品图片
image?: string;
// 商品价格
price?: string;
// 市场价格
salePrice?: string;
// 成本价
cost?: string;
// 库存
stock?: number;
// sku编码
skuNo?: string;
// 商品条码
barCode?: string;
// 重量
weight?: string;
// 体积
volume?: string;
// 唯一值
uuid?: string;
// 状态, 0正常, 1异常
status?: number;
// 备注
comments?: string;
// 租户id
tenantId?: number;
// 创建时间
createTime?: string;
images?: string;
}
/**
* sku列表搜索条件
*/
export interface ShopGoodsSkuParam extends PageParam {
id?: number;
keywords?: string;
}

105
src/api/shop/shopGoodsSpec/index.ts

@ -0,0 +1,105 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { ShopGoodsSpec, ShopGoodsSpecParam } from './model';
/**
*
*/
export async function pageShopGoodsSpec(params: ShopGoodsSpecParam) {
const res = await request.get<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));
}

29
src/api/shop/shopGoodsSpec/model/index.ts

@ -0,0 +1,29 @@
import type { PageParam } from '@/api';
/**
*
*/
export interface ShopGoodsSpec {
// 主键
id?: number;
// 商品ID
goodsId?: number;
// 规格ID
specId?: number;
// 规格名称
specName?: string;
// 规格值
specValue?: string;
// 活动类型 0=商品,1=秒杀,2=砍价,3=拼团
type?: string;
// 租户id
tenantId?: number;
}
/**
*
*/
export interface ShopGoodsSpecParam extends PageParam {
id?: number;
keywords?: string;
}

105
src/api/shop/shopMerchant/index.ts

@ -0,0 +1,105 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { ShopMerchant, ShopMerchantParam } from './model';
/**
*
*/
export async function pageShopMerchant(params: ShopMerchantParam) {
const res = await request.get<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));
}

90
src/api/shop/shopMerchant/model/index.ts

@ -0,0 +1,90 @@
import type { PageParam } from '@/api';
/**
*
*/
export interface ShopMerchant {
// ID
merchantId?: number;
// 商户名称
merchantName?: string;
// 商户编号
merchantCode?: string;
// 商户类型
type?: number;
// 商户图标
image?: string;
// 商户手机号
phone?: string;
// 商户姓名
realName?: string;
// 店铺类型
shopType?: string;
// 项目分类
itemType?: string;
// 商户分类
category?: string;
// 商户经营分类
merchantCategoryId?: number;
// 商户分类
merchantCategoryTitle?: string;
// 经纬度
lngAndLat?: string;
//
lng?: string;
//
lat?: string;
// 所在省份
province?: string;
// 所在城市
city?: string;
// 所在辖区
region?: string;
// 详细地址
address?: string;
// 手续费
commission?: string;
// 关键字
keywords?: string;
// 资质图片
files?: string;
// 营业时间
businessTime?: string;
// 文章内容
content?: string;
// 每小时价格
price?: string;
// 是否自营
ownStore?: number;
// 是否推荐
recommend?: number;
// 是否需要审核
goodsReview?: number;
// 管理入口
adminUrl?: string;
// 备注
comments?: string;
// 所有人
userId?: number;
// 是否删除, 0否, 1是
deleted?: number;
// 状态
status?: number;
// 排序号
sortNumber?: number;
// 租户id
tenantId?: number;
// 创建时间
createTime?: string;
}
/**
*
*/
export interface ShopMerchantParam extends PageParam {
merchantId?: number;
phone?: string;
userId?: number;
shopType?: string;
keywords?: string;
}

106
src/api/shop/shopMerchantAccount/index.ts

@ -0,0 +1,106 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { ShopMerchantAccount, ShopMerchantAccountParam } from './model';
import { MODULES_API_URL } from '@/config/setting';
/**
*
*/
export async function pageShopMerchantAccount(params: ShopMerchantAccountParam) {
const res = await request.get<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));
}

39
src/api/shop/shopMerchantAccount/model/index.ts

@ -0,0 +1,39 @@
import type { PageParam } from '@/api';
/**
*
*/
export interface ShopMerchantAccount {
// ID
id?: number;
// 商户手机号
phone?: string;
// 真实姓名
realName?: string;
// 商户ID
merchantId?: number;
// 角色ID
roleId?: number;
// 角色名称
roleName?: string;
// 用户ID
userId?: number;
// 备注
comments?: string;
// 状态
status?: number;
// 排序号
sortNumber?: number;
// 租户id
tenantId?: number;
// 创建时间
createTime?: string;
}
/**
*
*/
export interface ShopMerchantAccountParam extends PageParam {
id?: number;
keywords?: string;
}

120
src/api/shop/shopMerchantApply/index.ts

@ -0,0 +1,120 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { ShopMerchantApply, ShopMerchantApplyParam } from './model';
import { SERVER_API_URL } from '@/config/setting';
/**
*
*/
export async function pageShopMerchantApply(params: ShopMerchantApplyParam) {
const res = await request.get<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));
}

72
src/api/shop/shopMerchantApply/model/index.ts

@ -0,0 +1,72 @@
import type { PageParam } from '@/api';
/**
*
*/
export interface ShopMerchantApply {
// ID
applyId?: number;
// 类型
type?: number;
// 主体名称
merchantName?: string;
// 证件号码
merchantCode?: string;
// 商户图标
image?: string;
// 商户手机号
phone?: string;
// 商户姓名
realName?: string;
// 身份证号码
idCard?: string;
// 店铺类型
shopType?: string;
// 商户分类
category?: string;
// 手续费
commission?: string;
// 关键字
keywords?: string;
// 营业执照
yyzz?: string;
// 身份证正面
sfz1?: string;
// 身份证反面
sfz2?: string;
// 资质图片
files?: string;
// 所有人
userId?: number;
// 是否自营
ownStore?: number;
// 是否推荐
recommend?: number;
// 是否需要审核
goodsReview?: number;
// 工作负责人
name2?: string;
// 驳回原因
reason?: string;
// 备注
comments?: string;
// 状态
status?: number;
// 排序号
sortNumber?: number;
// 租户id
tenantId?: number;
// 创建时间
createTime?: string;
}
/**
*
*/
export interface ShopMerchantApplyParam extends PageParam {
applyId?: number;
userId?: number;
shopType?: string;
phone?: string;
keywords?: string;
}

108
src/api/shop/shopMerchantCount/index.ts

@ -0,0 +1,108 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { ShopMerchantCount, ShopMerchantCountParam } from './model';
import { MODULES_API_URL } from '@/config/setting';
/**
*
*/
export async function pageShopMerchantCount(params: ShopMerchantCountParam) {
const res = await request.get<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));
}

29
src/api/shop/shopMerchantCount/model/index.ts

@ -0,0 +1,29 @@
import type { PageParam } from '@/api';
/**
*
*/
export interface ShopMerchantCount {
// ID
id?: number;
// 店铺名称
name?: string;
// 店铺说明
comments?: string;
// 状态
status?: number;
// 排序号
sortNumber?: number;
// 租户id
tenantId?: number;
// 创建时间
createTime?: string;
}
/**
*
*/
export interface ShopMerchantCountParam extends PageParam {
id?: number;
keywords?: string;
}

108
src/api/shop/shopMerchantType/index.ts

@ -0,0 +1,108 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { ShopMerchantType, ShopMerchantTypeParam } from './model';
import { SERVER_API_URL } from '@/config/setting';
/**
*
*/
export async function pageShopMerchantType(params: ShopMerchantTypeParam) {
const res = await request.get<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));
}

30
src/api/shop/shopMerchantType/model/index.ts

@ -0,0 +1,30 @@
import type { PageParam } from '@/api';
/**
*
*/
export interface ShopMerchantType {
// ID
id?: number;
// 店铺类型
name?: string;
// 店铺入驻条件
comments?: string;
// 状态
status?: number;
// 排序号
sortNumber?: number;
// 租户id
tenantId?: number;
// 创建时间
createTime?: string;
value?: string;
}
/**
*
*/
export interface ShopMerchantTypeParam extends PageParam {
id?: number;
keywords?: string;
}

106
src/api/shop/shopSpec/index.ts

@ -0,0 +1,106 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import { MODULES_API_URL } from '@/config/setting';
import { ShopSpec, ShopSpecParam } from '@/api/shop/shopSpec/model';
/**
*
*/
export async function pageShopSpec(params: ShopSpecParam) {
const res = await request.get<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));
}

38
src/api/shop/shopSpec/model/index.ts

@ -0,0 +1,38 @@
import type { PageParam } from '@/api';
/**
*
*/
export interface ShopSpec {
// 规格ID
specId?: number;
// 规格名称
specName?: string;
// 规格值
specValue?: string;
// 商户ID
merchantId?: number;
// 创建用户
userId?: number;
// 更新者
updater?: number;
// 备注
comments?: string;
// 状态, 0正常, 1待修,2异常已修,3异常未修
status?: number;
// 排序号
sortNumber?: number;
// 租户id
tenantId?: number;
// 创建时间
createTime?: string;
value?: string;
}
/**
*
*/
export interface ShopSpecParam extends PageParam {
specId?: number;
keywords?: string;
}

105
src/api/shop/shopSpecValue/index.ts

@ -0,0 +1,105 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { ShopSpecValue, ShopSpecValueParam } from './model';
/**
*
*/
export async function pageShopSpecValue(params: ShopSpecValueParam) {
const res = await request.get<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));
}

29
src/api/shop/shopSpecValue/model/index.ts

@ -0,0 +1,29 @@
import type { PageParam } from '@/api';
/**
*
*/
export interface ShopSpecValue {
// 规格值ID
specValueId?: number;
// 规格组ID
specId?: number;
// 规格值
specValue?: string;
// 备注
comments?: string;
// 排序号
sortNumber?: number;
// 租户id
tenantId?: number;
// 创建时间
createTime?: string;
}
/**
*
*/
export interface ShopSpecValueParam extends PageParam {
specValueId?: number;
keywords?: string;
}

24
src/components/SelectGoodsCategory/index.vue

@ -14,15 +14,15 @@
<script lang="ts" setup>
import { ref, watch, reactive } from 'vue';
import type { ValueType } from 'ant-design-vue/es/vc-cascader/Cascader';
import { listGoodsCategory } from '@/api/shop/goodsCategory';
import { listShopGoodsCategory } from '@/api/shop/shopGoodsCategory';
import { toTreeData } from 'ele-admin-pro/es';
import { GoodsCategory } from '@/api/shop/goodsCategory/model';
import { ShopGoodsCategory } from '@/api/shop/shopGoodsCategory/model';
const props = withDefaults(
defineProps<{
value?: string[];
placeholder?: string;
options?: GoodsCategory[];
options?: ShopGoodsCategory[];
valueField?: 'label';
type?: 'provinceCity' | 'province';
showSearch?: boolean;
@ -36,16 +36,16 @@
const emit = defineEmits<{
(e: 'done', item?: any, value?: ValueType);
(e: 'update:value', value?: string[]): void;
(e: 'load-data-done', value: GoodsCategory[]): void;
(e: 'load-data-done', value: ShopGoodsCategory[]): void;
}>();
//
const where = reactive<GoodsCategory>({
const where = reactive<ShopGoodsCategory>({
merchantId: undefined
});
//
const regionsData = ref<GoodsCategory[]>([]);
const regionsData = ref<ShopGoodsCategory[]>([]);
/* 更新 value */
const updateValue = (value: ValueType) => {
@ -58,16 +58,16 @@
};
/* 级联选择器数据 value 处理 */
const formatData = (data: GoodsCategory[]) => {
const formatData = (data: ShopGoodsCategory[]) => {
if (props.valueField === 'label') {
return data.map((d) => {
const item: GoodsCategory = {
const item: ShopGoodsCategory = {
label: d.title,
value: d.categoryId
};
if (d.children) {
item.children = d.children.map((c) => {
const cItem: GoodsCategory = {
const cItem: ShopGoodsCategory = {
label: c.title,
value: c.categoryId
};
@ -90,10 +90,10 @@
};
/* 省市区数据筛选 */
const filterData = (data: GoodsCategory[]) => {
const filterData = (data: ShopGoodsCategory[]) => {
return formatData(
data.map((d) => {
const item: GoodsCategory = {
const item: ShopGoodsCategory = {
label: d.title,
value: d.categoryId
};
@ -117,7 +117,7 @@
if (props.merchantId) {
where.merchantId = props.merchantId;
}
listGoodsCategory(where).then((data) => {
listShopGoodsCategory(where).then((data) => {
const list = toTreeData({
data: data?.map((d) => {
d.value = d.categoryId;

16
src/components/SelectSpec/components/select-data.vue

@ -69,9 +69,9 @@
ColumnItem,
DatasourceFunction
} from 'ele-admin-pro/es/ele-pro-table/types';
import { pageSpec } from '@/api/shop/spec';
import { pageShopSpec } from '@/api/shop/shopSpec';
import { EleProTable } from 'ele-admin-pro';
import { Spec, SpecParam } from '@/api/shop/spec/model';
import { ShopSpec, ShopSpecParam } from '@/api/shop/shopSpec/model';
const props = defineProps<{
//
@ -81,11 +81,11 @@
//
shopType?: string;
//
data?: Spec | null;
data?: ShopSpec | null;
}>();
const emit = defineEmits<{
(e: 'done', data: Spec): void;
(e: 'done', data: ShopSpec): void;
(e: 'update:visible', visible: boolean): void;
}>();
@ -132,7 +132,7 @@
} else {
where.shopType = props.shopType;
}
return pageSpec({
return pageShopSpec({
...where,
...orders,
page,
@ -141,17 +141,17 @@
};
/* 搜索 */
const reload = (where?: SpecParam) => {
const reload = (where?: ShopSpecParam) => {
tableRef?.value?.reload({ page: 1, where });
};
const onRadio = (record: Spec) => {
const onRadio = (record: ShopSpec) => {
updateVisible(false);
emit('done', record);
};
/* 自定义行属性 */
const customRow = (record: Spec) => {
const customRow = (record: ShopSpec) => {
return {
//
// onClick: () => {

32
src/views/hjm/hjmCar/index.vue

@ -42,9 +42,9 @@
</template>
<template v-if="column.key === 'status'">
<a-tag v-if="record.status === 0" color="red">未安装</a-tag>
<a-tag v-if="record.status === 1" color="orange">已安装</a-tag>
<a-tag v-if="record.status === 2" color="green">已认领</a-tag>
<a-tag v-if="record.status === 0 && record.claim == 0" color="red">未安装</a-tag>
<a-tag v-if="record.claim === 0 && record.status == 1" color="orange">已安装</a-tag>
<a-tag v-if="record.claim === 1 && record.status == 1" color="green" @click="updateStatus(record)">已认领</a-tag>
</template>
<template v-if="column.key === 'action'">
<div>
@ -86,7 +86,7 @@ import Extra from './components/Extra.vue';
import {toTreeData} from 'ele-admin-pro';
import Search from './components/search.vue';
import HjmCarEdit from './components/hjmCarEdit.vue';
import {pageHjmCar, removeHjmCar, removeBatchHjmCar} from '@/api/hjm/hjmCar';
import {pageHjmCar, removeHjmCar, removeBatchHjmCar, updateHjmCar} from '@/api/hjm/hjmCar';
import type {HjmCar, HjmCarParam} from '@/api/hjm/hjmCar/model';
import {getPageTitle} from "@/utils/common";
import Qrcode from "./components/qrcode.vue";
@ -250,7 +250,7 @@ const openMove = () => {
};
const onShare = (row?: HjmCar) => {
qrcode.value = row?.code;
qrcode.value = row?.code + '';
showQrcode.value = true;
}
@ -258,6 +258,28 @@ const hideShare = () => {
showQrcode.value = false;
}
const updateStatus = (row?: HjmCar) => {
Modal.confirm({
title: '提示',
content: '确定要解绑吗?',
icon: createVNode(ExclamationCircleOutlined),
maskClosable: true,
onOk: () => {
updateHjmCar({
...row,
status: 1,
claim: 0,
driverId: 0,
driverName: ''
}).then(res => {
message.success(res);
reload()
})
}
});
}
/* 删除单个 */
const remove = (row: HjmCar) => {
const hide = message.loading('请求中..', 0);

41
src/views/shop/shopGoods/components/extra.vue

@ -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>

155
src/views/shop/shopGoods/components/search.vue

@ -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>

1557
src/views/shop/shopGoods/components/shopGoodsEdit.vue

File diff suppressed because it is too large

281
src/views/shop/shopGoods/index.vue

@ -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>

16
src/views/system/setting/components/mp-weixin.vue

@ -27,9 +27,9 @@
</div>
<a-form-item label="request合法域名" name="request">
<a-input-group compact>
<a-input :value="`https://open.gxwebsoft.com`" placeholder="请输入小程序AppSecret" style="width: calc(100% - 50px)" />
<a-input :value="`https://server.gxwebsoft.com;https://cms-api.websoft.top;`" placeholder="请输入小程序AppSecret" style="width: calc(100% - 50px)" />
<a-tooltip title="复制">
<a-button @click="onCopyText(`https://open.gxwebsoft.com`)">
<a-button @click="onCopyText(`https://server.gxwebsoft.com;https://cms-api.websoft.top;`)">
<template #icon><CopyOutlined /></template>
</a-button>
</a-tooltip>
@ -37,9 +37,9 @@
</a-form-item>
<a-form-item label="socket合法域名" name="socket">
<a-input-group compact>
<a-input :value="`wss://open.gxwebsoft.com`" placeholder="请输入小程序AppSecret" style="width: calc(100% - 50px)" />
<a-input :value="`wss://server.gxwebsoft.com`" placeholder="请输入小程序AppSecret" style="width: calc(100% - 50px)" />
<a-tooltip title="复制">
<a-button @click="onCopyText(`wss://open.gxwebsoft.com`)">
<a-button @click="onCopyText(`wss://server.gxwebsoft.com`)">
<template #icon><CopyOutlined /></template>
</a-button>
</a-tooltip>
@ -47,9 +47,9 @@
</a-form-item>
<a-form-item label="uploadFile合法域名" name="uploadFile">
<a-input-group compact>
<a-input :value="`https://open.gxwebsoft.com`" style="width: calc(100% - 50px)" />
<a-input :value="`https://oss.wsdns.cn;`" style="width: calc(100% - 50px)" />
<a-tooltip title="复制">
<a-button @click="onCopyText(`https://open.gxwebsoft.com`)">
<a-button @click="onCopyText(`https://oss.wsdns.cn;`)">
<template #icon><CopyOutlined /></template>
</a-button>
</a-tooltip>
@ -57,9 +57,9 @@
</a-form-item>
<a-form-item label="downloadFile合法域名" name="downloadFile">
<a-input-group compact>
<a-input :value="`https://open.gxwebsoft.com`" style="width: calc(100% - 50px)" />
<a-input :value="`https://oss.wsdns.cn;`" style="width: calc(100% - 50px)" />
<a-tooltip title="复制">
<a-button @click="onCopyText(`https://open.gxwebsoft.com`)">
<a-button @click="onCopyText(`https://oss.wsdns.cn;`)">
<template #icon><CopyOutlined /></template>
</a-button>
</a-tooltip>

Loading…
Cancel
Save