Initial commit
This commit is contained in:
106
src/api/apps/bc/agent/index.ts
Normal file
106
src/api/apps/bc/agent/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { BCAgent, BCAgentParam } from '@/api/apps/bc/agent/model';
|
||||
import { OPEN_API_URL } from '@/config/setting';
|
||||
/**
|
||||
* 分页查询设备
|
||||
*/
|
||||
export async function pageBCAgent(params: BCAgentParam) {
|
||||
const res = await request.get<ApiResult<PageResult<BCAgent>>>(
|
||||
OPEN_API_URL + '/apps/bc-agent/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询设备列表
|
||||
*/
|
||||
export async function listBCAgent(params?: BCAgentParam) {
|
||||
const res = await request.get<ApiResult<BCAgent[]>>(
|
||||
OPEN_API_URL + '/apps/bc-agent',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加设备
|
||||
*/
|
||||
export async function addBCAgent(data: BCAgent) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/apps/bc-agent',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设备
|
||||
*/
|
||||
export async function updateBCAgent(data: BCAgent) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/apps/bc-agent',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定设备
|
||||
*/
|
||||
export async function bindBCAgent(data: BCAgent) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/apps/bc-agent/bind',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除设备
|
||||
*/
|
||||
export async function removeBCAgent(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/apps/bc-agent/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除设备
|
||||
*/
|
||||
export async function removeBatchBCAgent(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/apps/bc-agent/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
23
src/api/apps/bc/agent/model/index.ts
Normal file
23
src/api/apps/bc/agent/model/index.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 代理报餐
|
||||
*/
|
||||
export interface BCAgent {
|
||||
agentId?: number;
|
||||
userId?: number;
|
||||
parentId?: number;
|
||||
sortNumber?: number;
|
||||
status?: number;
|
||||
comments?: string;
|
||||
createTime?: string;
|
||||
tenantId?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单搜索条件
|
||||
*/
|
||||
export interface BCAgentParam extends PageParam {
|
||||
status?: number;
|
||||
userId?: number;
|
||||
}
|
||||
104
src/api/apps/bc/balance-log/index.ts
Normal file
104
src/api/apps/bc/balance-log/index.ts
Normal file
@@ -0,0 +1,104 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { UserBalanceLog, UserBalanceLogParam } from './model';
|
||||
import { OPEN_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询余额明细
|
||||
*/
|
||||
export async function pageUserBalanceLog(params: UserBalanceLogParam) {
|
||||
const res = await request.get<ApiResult<PageResult<UserBalanceLog>>>(
|
||||
OPEN_API_URL + '/shop/user-balance-log/page',
|
||||
{ params }
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询余额明细列表
|
||||
*/
|
||||
export async function listUserBalanceLog(params?: UserBalanceLogParam) {
|
||||
const res = await request.get<ApiResult<UserBalanceLog[]>>(
|
||||
OPEN_API_URL + '/shop/user-balance-log',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询余额明细
|
||||
*/
|
||||
export async function getUserBalanceLog(id: number) {
|
||||
const res = await request.get<ApiResult<UserBalanceLog>>(
|
||||
OPEN_API_URL + '/shop/user-balance-log/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加余额明细
|
||||
*/
|
||||
export async function addUserBalanceLog(data: UserBalanceLog) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/user-balance-log',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改余额明细
|
||||
*/
|
||||
export async function updateUserBalanceLog(data: UserBalanceLog) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/user-balance-log',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除余额明细
|
||||
*/
|
||||
export async function removeUserBalanceLog(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/user-balance-log/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除余额明细
|
||||
*/
|
||||
export async function removeUserBalanceLogs(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/user-balance-log/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
33
src/api/apps/bc/balance-log/model/index.ts
Normal file
33
src/api/apps/bc/balance-log/model/index.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 余额明细
|
||||
*/
|
||||
export interface UserBalanceLog {
|
||||
logId?: number;
|
||||
userId?: number;
|
||||
scene?: number;
|
||||
money?: string;
|
||||
describe?: string;
|
||||
remark?: string;
|
||||
sortNumber?: number;
|
||||
MerchantCode?: string;
|
||||
comments?: string;
|
||||
status?: number;
|
||||
deleted?: number;
|
||||
tenantId?: number;
|
||||
createTime?: string;
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户搜索条件
|
||||
*/
|
||||
export interface UserBalanceLogParam extends PageParam {
|
||||
logId?: number;
|
||||
userId?: number;
|
||||
scene?: number;
|
||||
createTimeStart?: string;
|
||||
createTimeEnd?: string;
|
||||
MerchantCode?: string;
|
||||
}
|
||||
143
src/api/apps/bc/equipment/index.ts
Normal file
143
src/api/apps/bc/equipment/index.ts
Normal file
@@ -0,0 +1,143 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { BcEquipment, BcEquipmentParam } from './model';
|
||||
import { OPEN_API_URL } from '@/config/setting';
|
||||
/**
|
||||
* 分页查询设备
|
||||
*/
|
||||
export async function pageBcEquipment(params: BcEquipmentParam) {
|
||||
const res = await request.get<ApiResult<PageResult<BcEquipment>>>(
|
||||
OPEN_API_URL + '/apps/bc-equipment/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询设备列表
|
||||
*/
|
||||
export async function listBcEquipment(params?: BcEquipmentParam) {
|
||||
const res = await request.get<ApiResult<BcEquipment[]>>(
|
||||
OPEN_API_URL + '/apps/bc-equipment',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加设备
|
||||
*/
|
||||
export async function addBcEquipment(data: BcEquipment) {
|
||||
const merchantCode = localStorage.getItem('MerchantCode');
|
||||
console.log(merchantCode);
|
||||
if (merchantCode !== null && merchantCode != '') {
|
||||
console.log(merchantCode);
|
||||
data.merchantCode = String(merchantCode);
|
||||
}
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/apps/bc-equipment',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设备
|
||||
*/
|
||||
export async function updateBcEquipment(data: BcEquipment) {
|
||||
const res = await request.put<ApiResult<unknown>>('/apps/bc-equipment', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定设备
|
||||
*/
|
||||
export async function bindBcEquipment(data: BcEquipment) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/apps/bc-equipment/bind',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除设备
|
||||
*/
|
||||
export async function removeBcEquipment(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/apps/bc-equipment/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除设备
|
||||
*/
|
||||
export async function removeBatchBcEquipment(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/apps/bc-equipment/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查IP是否存在
|
||||
*/
|
||||
export async function checkExistence(
|
||||
field: string,
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/apps/bc-equipment/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送企业微信消息推送
|
||||
*/
|
||||
export async function addSend(data: BcEquipment) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/apps/bc-equipment/addSend',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
31
src/api/apps/bc/equipment/model/index.ts
Normal file
31
src/api/apps/bc/equipment/model/index.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 设备
|
||||
*/
|
||||
export interface BcEquipment {
|
||||
bcEquipmentId?: number;
|
||||
equipmentName?: string;
|
||||
equipmentCode?: string;
|
||||
gear?: number;
|
||||
describe?: string;
|
||||
sortNumber?: number;
|
||||
status?: number;
|
||||
comments?: string;
|
||||
createTime?: string;
|
||||
tenantId?: number;
|
||||
content?: string;
|
||||
merchantCode?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单搜索条件
|
||||
*/
|
||||
export interface BcEquipmentParam extends PageParam {
|
||||
bcEquipmentId?: number;
|
||||
equipmentName?: string;
|
||||
equipmentCode?: string;
|
||||
status?: number;
|
||||
merchantCode?: string;
|
||||
userId?: number;
|
||||
}
|
||||
107
src/api/apps/bc/export/index.ts
Normal file
107
src/api/apps/bc/export/index.ts
Normal file
@@ -0,0 +1,107 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { BcExport, BcExportParam } from '@/api/apps/bc/export/model';
|
||||
import { OPEN_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询计划
|
||||
*/
|
||||
export async function pageBcExport(params: BcExportParam) {
|
||||
const res = await request.get<ApiResult<PageResult<BcExport>>>(
|
||||
OPEN_API_URL + '/apps/bc-export/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询计划列表
|
||||
*/
|
||||
export async function listBcExport(params?: BcExportParam) {
|
||||
const res = await request.get<ApiResult<BcExport[]>>(
|
||||
OPEN_API_URL + '/apps/bc-export',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加计划
|
||||
*/
|
||||
export async function addBcExport(data: BcExport) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/apps/bc-export',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改计划
|
||||
*/
|
||||
export async function updateBcExport(data: BcExport) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/apps/bc-export',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定计划
|
||||
*/
|
||||
export async function bindBcExport(data: BcExport) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/apps/bc-export/bind',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除计划
|
||||
*/
|
||||
export async function removeBcExport(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/apps/bc-export/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除计划
|
||||
*/
|
||||
export async function removeBatchBcExport(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/apps/bc-export/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
41
src/api/apps/bc/export/model/index.ts
Normal file
41
src/api/apps/bc/export/model/index.ts
Normal file
@@ -0,0 +1,41 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
export interface BcExport {
|
||||
exportId?: number;
|
||||
organizationName?: string;
|
||||
nickname?: string;
|
||||
breakfastPost?: number;
|
||||
breakfastSign?: number;
|
||||
lunchPost?: number;
|
||||
lunchSign?: number;
|
||||
dinnerPost?: number;
|
||||
dinnerSign?: number;
|
||||
gear10?: number;
|
||||
gear20?: number;
|
||||
signGear10?: number;
|
||||
signGear20?: number;
|
||||
createTime?: string;
|
||||
tenantId?: number;
|
||||
expendMoney?: number;
|
||||
userId?: number;
|
||||
lunchPostText?: string;
|
||||
lunchSignText?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索条件
|
||||
*/
|
||||
export interface BcExportParam extends PageParam {
|
||||
exportId?: number;
|
||||
organizationName?: string;
|
||||
organizationId?: number;
|
||||
dayTime?: string;
|
||||
week?: number;
|
||||
status?: number;
|
||||
userId?: number;
|
||||
deliveryTime?: string;
|
||||
createTimeStart?: string;
|
||||
createTimeEnd?: string;
|
||||
deliveryTimeStart?: string;
|
||||
deliveryTimeEnd?: string;
|
||||
}
|
||||
106
src/api/apps/bc/food/index.ts
Normal file
106
src/api/apps/bc/food/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { BCFood, BCFoodParam } from '@/api/apps/bc/food/model';
|
||||
import { OPEN_API_URL } from '@/config/setting';
|
||||
/**
|
||||
* 分页查询计划
|
||||
*/
|
||||
export async function pageBCFood(params: BCFoodParam) {
|
||||
const res = await request.get<ApiResult<PageResult<BCFood>>>(
|
||||
OPEN_API_URL + '/apps/bc-food/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询计划列表
|
||||
*/
|
||||
export async function listBCFood(params?: BCFoodParam) {
|
||||
const res = await request.get<ApiResult<BCFood[]>>(
|
||||
OPEN_API_URL + '/apps/bc-food',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加计划
|
||||
*/
|
||||
export async function addBCFood(data: BCFood) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/apps/bc-food',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改计划
|
||||
*/
|
||||
export async function updateBCFood(data: BCFood) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/apps/bc-food',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定计划
|
||||
*/
|
||||
export async function bindBCFood(data: BCFood) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/apps/bc-food/bind',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除计划
|
||||
*/
|
||||
export async function removeBCFood(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/apps/bc-food/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除计划
|
||||
*/
|
||||
export async function removeBatchBCFood(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/apps/bc-food/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
21
src/api/apps/bc/food/model/index.ts
Normal file
21
src/api/apps/bc/food/model/index.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
export interface BCFood {
|
||||
temporaryId?: number;
|
||||
userId?: number;
|
||||
parentId?: number;
|
||||
sortNumber?: number;
|
||||
status?: number;
|
||||
comments?: string;
|
||||
expirationTime?: string;
|
||||
createTime?: string;
|
||||
tenantId?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索条件
|
||||
*/
|
||||
export interface BCFoodParam extends PageParam {
|
||||
status?: number;
|
||||
userId?: number;
|
||||
}
|
||||
114
src/api/apps/bc/goods/category/index.ts
Normal file
114
src/api/apps/bc/goods/category/index.ts
Normal file
@@ -0,0 +1,114 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Category, CategoryParam } from './model';
|
||||
import { OPEN_API_URL } from '@/config/setting';
|
||||
// const merchantCode = String(localStorage.getItem('MerchantCode'));
|
||||
|
||||
/**
|
||||
* 分页查询商品分类
|
||||
*/
|
||||
export async function pageCategory(params: CategoryParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Category>>>(
|
||||
OPEN_API_URL + '/shop/category/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商品分类列表
|
||||
*/
|
||||
export async function listCategory(params?: CategoryParam) {
|
||||
const res = await request.get<ApiResult<Category[]>>(
|
||||
OPEN_API_URL + '/shop/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 addCategory(data: Category) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/category',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商品分类
|
||||
*/
|
||||
export async function updateCategory(data: Category) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/category',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商品分类
|
||||
*/
|
||||
export async function removeCategory(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/category/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除商品分类
|
||||
*/
|
||||
export async function removeBatchCategory(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/category/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查IP是否存在
|
||||
*/
|
||||
export async function checkExistence(
|
||||
field: string,
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/category/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
51
src/api/apps/bc/goods/category/model/index.ts
Normal file
51
src/api/apps/bc/goods/category/model/index.ts
Normal file
@@ -0,0 +1,51 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 商品分类
|
||||
*/
|
||||
export interface Category {
|
||||
// 商品分类id
|
||||
categoryId?: number;
|
||||
// 商品分类
|
||||
title?: string;
|
||||
// 商品分类图片
|
||||
image?: string;
|
||||
// 上级分类
|
||||
parentId?: number;
|
||||
// 是否隐藏
|
||||
hide?: number;
|
||||
// 封面图
|
||||
avatar?: string;
|
||||
// 用户ID
|
||||
userId?: string;
|
||||
// 所属门店ID
|
||||
shopId?: string;
|
||||
// 排序
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 更新时间
|
||||
updateTime?: string;
|
||||
//
|
||||
key?: number;
|
||||
//
|
||||
merchantCode?: string;
|
||||
value?: any;
|
||||
// 子菜单
|
||||
children?: Category[];
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品分类搜索条件
|
||||
*/
|
||||
export interface CategoryParam extends PageParam {
|
||||
title?: string;
|
||||
categoryId?: number;
|
||||
parentId?: number;
|
||||
// 商户编号
|
||||
merchantCode?: string;
|
||||
}
|
||||
91
src/api/apps/bc/goods/comment/index.ts
Normal file
91
src/api/apps/bc/goods/comment/index.ts
Normal file
@@ -0,0 +1,91 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Comment, CommentParam } from './model';
|
||||
import { OPEN_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询商品评价
|
||||
*/
|
||||
export async function pageComments(params: CommentParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Comment>>>(
|
||||
OPEN_API_URL + '/shop/comment/page',
|
||||
{ params }
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商品评价列表
|
||||
*/
|
||||
export async function listComments(params?: CommentParam) {
|
||||
const res = await request.get<ApiResult<Comment[]>>(
|
||||
OPEN_API_URL + '/shop/comment',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加商品评价
|
||||
*/
|
||||
export async function addComment(data: Comment) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/comment',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商品评价
|
||||
*/
|
||||
export async function updateComment(data: Comment) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/comment',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商品评价
|
||||
*/
|
||||
export async function removeComment(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/comment/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除商品评价
|
||||
*/
|
||||
export async function removeComments(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/comment/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
30
src/api/apps/bc/goods/comment/model/index.ts
Normal file
30
src/api/apps/bc/goods/comment/model/index.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 商品评价
|
||||
*/
|
||||
export interface Comment {
|
||||
// 商品评价id
|
||||
commentId?: number;
|
||||
// 商品评价标识
|
||||
commentCode?: string;
|
||||
// 商品评价名称
|
||||
commentName?: string;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品评价搜索条件
|
||||
*/
|
||||
export interface CommentParam extends PageParam {
|
||||
type?: string;
|
||||
goodsName?: string;
|
||||
goodsCode?: string;
|
||||
userId?: string;
|
||||
score?: number;
|
||||
// 商户编号
|
||||
merchantCode?: string;
|
||||
}
|
||||
113
src/api/apps/bc/goods/index.ts
Normal file
113
src/api/apps/bc/goods/index.ts
Normal file
@@ -0,0 +1,113 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Goods, GoodsParam } from './model';
|
||||
import { OPEN_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询商品
|
||||
*/
|
||||
export async function pageGoods(params: GoodsParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Goods>>>(
|
||||
OPEN_API_URL + '/shop/goods/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商品列表
|
||||
*/
|
||||
export async function listGoods(params?: GoodsParam) {
|
||||
const res = await request.get<ApiResult<Goods[]>>(
|
||||
OPEN_API_URL + '/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 addGoods(data: Goods) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/goods',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商品
|
||||
*/
|
||||
export async function updateGoods(data: Goods) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/goods',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商品
|
||||
*/
|
||||
export async function removeGoods(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/goods/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除商品
|
||||
*/
|
||||
export async function removeBatchGoods(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/goods/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查IP是否存在
|
||||
*/
|
||||
export async function checkExistence(
|
||||
field: string,
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/goods/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
53
src/api/apps/bc/goods/model/index.ts
Normal file
53
src/api/apps/bc/goods/model/index.ts
Normal file
@@ -0,0 +1,53 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 商品
|
||||
*/
|
||||
export interface Goods {
|
||||
goodsType?: number;
|
||||
goodsId?: number;
|
||||
goodsName?: string;
|
||||
goodsCode?: string;
|
||||
period?: string;
|
||||
gear?: number;
|
||||
categoryId?: number;
|
||||
categoryName?: string;
|
||||
fullName?: string;
|
||||
logo?: string;
|
||||
describe?: string;
|
||||
logoImageId?: number;
|
||||
isRecycle?: number;
|
||||
sortNumber?: number;
|
||||
status?: number;
|
||||
comments?: string;
|
||||
createTime?: string;
|
||||
tenantId?: number;
|
||||
specType?: number;
|
||||
deliveryType?: number;
|
||||
content?: string;
|
||||
deliveryId?: number;
|
||||
image?: string;
|
||||
files?: string;
|
||||
goodsPriceMin?: number;
|
||||
linePriceMin?: number;
|
||||
linePriceMax?: number;
|
||||
sellingPoint?: string;
|
||||
purchaseLimit?: number;
|
||||
deductStockType?: number;
|
||||
salesActual?: number;
|
||||
goodsWeight?: number;
|
||||
stockTotal?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单搜索条件
|
||||
*/
|
||||
export interface GoodsParam extends PageParam {
|
||||
goodsId?: number;
|
||||
goodsName?: string;
|
||||
goodsCode?: string;
|
||||
listType?: string;
|
||||
status?: number;
|
||||
stockTotal?: number;
|
||||
merchantCode?: string;
|
||||
}
|
||||
91
src/api/apps/bc/goods/service/index.ts
Normal file
91
src/api/apps/bc/goods/service/index.ts
Normal file
@@ -0,0 +1,91 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Service, ServiceParam } from './model';
|
||||
import { OPEN_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询服务承诺
|
||||
*/
|
||||
export async function pageServices(params: ServiceParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Service>>>(
|
||||
OPEN_API_URL + '/shop/goods-service/page',
|
||||
{ params }
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询服务承诺列表
|
||||
*/
|
||||
export async function listServices(params?: ServiceParam) {
|
||||
const res = await request.get<ApiResult<Service[]>>(
|
||||
OPEN_API_URL + '/shop/goods-service',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加服务承诺
|
||||
*/
|
||||
export async function addService(data: Service) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/goods-service',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改服务承诺
|
||||
*/
|
||||
export async function updateService(data: Service) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/goods-service',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除服务承诺
|
||||
*/
|
||||
export async function removeService(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/goods-service/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除服务承诺
|
||||
*/
|
||||
export async function removeServices(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/goods-service/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
29
src/api/apps/bc/goods/service/model/index.ts
Normal file
29
src/api/apps/bc/goods/service/model/index.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 服务承诺
|
||||
*/
|
||||
export interface Service {
|
||||
// 服务承诺id
|
||||
serviceId?: number;
|
||||
// 服务承诺名称
|
||||
name?: string;
|
||||
// 描述
|
||||
summary?: string;
|
||||
// 是否默认勾选
|
||||
isDefault?: number;
|
||||
// 排序
|
||||
sortNumber?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 服务承诺搜索条件
|
||||
*/
|
||||
export interface ServiceParam extends PageParam {
|
||||
serviceId?: string;
|
||||
name?: string;
|
||||
// 商户编号
|
||||
merchantCode?: string;
|
||||
}
|
||||
113
src/api/apps/bc/order/goods/index.ts
Normal file
113
src/api/apps/bc/order/goods/index.ts
Normal file
@@ -0,0 +1,113 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { OrderGoods, OrderGoodsParam } from './model';
|
||||
import { OPEN_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询订单商品
|
||||
*/
|
||||
export async function pageOrderGoods(params: OrderGoodsParam) {
|
||||
const res = await request.get<ApiResult<PageResult<OrderGoods>>>(
|
||||
OPEN_API_URL + '/shop/order-goods/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询订单商品列表
|
||||
*/
|
||||
export async function listOrderGoods(params?: OrderGoodsParam) {
|
||||
const res = await request.get<ApiResult<OrderGoods[]>>(
|
||||
OPEN_API_URL + '/shop/order-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 addOrderGoods(data: OrderGoods) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/order-goods',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改订单商品
|
||||
*/
|
||||
export async function updateOrderGoods(data: OrderGoods) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/order-goods',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除订单商品
|
||||
*/
|
||||
export async function removeOrderGoods(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/order-goods/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除订单商品
|
||||
*/
|
||||
export async function removeBatchOrderGoods(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/order-goods/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查IP是否存在
|
||||
*/
|
||||
export async function checkExistence(
|
||||
field: string,
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/order-goods/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
45
src/api/apps/bc/order/goods/model/index.ts
Normal file
45
src/api/apps/bc/order/goods/model/index.ts
Normal file
@@ -0,0 +1,45 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 订单
|
||||
*/
|
||||
export interface OrderGoods {
|
||||
// 订单id
|
||||
orderGoodsId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
startTime?: string;
|
||||
// 状态
|
||||
status?: string;
|
||||
deliveryStatus?: number;
|
||||
// 用户ID
|
||||
userId?: any;
|
||||
totalNum?: any;
|
||||
organizationName?: string;
|
||||
nickname?: '';
|
||||
breakfastPostUsers?: '';
|
||||
breakfastSignUsers?: '';
|
||||
lunchPostUsers?: '';
|
||||
lunchSignUsers?: '';
|
||||
dinnerPostUsers?: '';
|
||||
dinnerSignUsers?: '';
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单搜索条件
|
||||
*/
|
||||
export interface OrderGoodsParam extends PageParam {
|
||||
keywords?: string;
|
||||
deliveryTime?: string;
|
||||
categoryId?: number;
|
||||
createTimeStart?: string;
|
||||
createTimeEnd?: string;
|
||||
deliveryTimeStart?: string;
|
||||
deliveryTimeEnd?: string;
|
||||
payStatus?: number;
|
||||
gear?: number;
|
||||
week?: number;
|
||||
deliveryStatus?: number;
|
||||
organizationId?: number;
|
||||
organizationName?: string;
|
||||
}
|
||||
126
src/api/apps/bc/order/index.ts
Normal file
126
src/api/apps/bc/order/index.ts
Normal file
@@ -0,0 +1,126 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Order, OrderParam } from './model';
|
||||
import { OPEN_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询订单
|
||||
*/
|
||||
export async function pageOrder(params: OrderParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Order>>>(
|
||||
OPEN_API_URL + '/shop/order/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询订单列表
|
||||
*/
|
||||
export async function listOrder(params?: OrderParam) {
|
||||
const res = await request.get<ApiResult<Order[]>>(
|
||||
OPEN_API_URL + '/shop/order',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询订单
|
||||
*/
|
||||
export async function getOrder(id: number) {
|
||||
const res = await request.get<ApiResult<Order>>(
|
||||
OPEN_API_URL + '/shop/order/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加订单
|
||||
*/
|
||||
export async function addOrder(data: Order) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/order',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改订单
|
||||
*/
|
||||
export async function updateOrder(data: Order) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/order',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除订单
|
||||
*/
|
||||
export async function removeOrder(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/order/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除订单
|
||||
*/
|
||||
export async function removeBatchOrder(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/order/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查IP是否存在
|
||||
*/
|
||||
export async function checkExistence(
|
||||
field: string,
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/order/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
95
src/api/apps/bc/order/model/index.ts
Normal file
95
src/api/apps/bc/order/model/index.ts
Normal file
@@ -0,0 +1,95 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 订单
|
||||
*/
|
||||
export interface Order {
|
||||
// 订单id
|
||||
orderId?: number;
|
||||
// 订单类型
|
||||
orderType?: string;
|
||||
// 订单来源
|
||||
orderSource?: string;
|
||||
// 来源记录ID
|
||||
orderSourceId?: number;
|
||||
// 来源记录的参数 (json格式)
|
||||
orderSourceData?: string;
|
||||
rentOrderId?: number;
|
||||
// 订单编号
|
||||
orderNo?: string;
|
||||
// 订单名称
|
||||
orderName?: string;
|
||||
// 订单头像
|
||||
orderAvatar?: string;
|
||||
// 座机电话
|
||||
orderPhone?: string;
|
||||
// 手机号码
|
||||
orderMobile?: string;
|
||||
// 联系人
|
||||
orderContacts?: string;
|
||||
// 联系地址
|
||||
orderAddress?: string;
|
||||
// 跟进状态
|
||||
progress?: string;
|
||||
// 排序
|
||||
sortNumber?: number;
|
||||
// 配送方式
|
||||
deliveryType?: string;
|
||||
// 付款状态
|
||||
payStatus?: number;
|
||||
expressPrice?: string;
|
||||
// 付款金额
|
||||
payPrice?: number;
|
||||
payMethod?: string;
|
||||
tradeId?: string;
|
||||
goodsId?: number;
|
||||
// 总金额
|
||||
totalPrice?: number;
|
||||
// 发货状态
|
||||
deliveryStatus?: number;
|
||||
// 收货状态
|
||||
receiptStatus?: number;
|
||||
// 订单状态
|
||||
orderStatus?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
buyerRemark?: string;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
startTime?: string;
|
||||
deliveryTime?: string;
|
||||
expirationTime?: string;
|
||||
// 状态
|
||||
status?: string;
|
||||
// 用户ID
|
||||
userId?: any;
|
||||
nickname?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单搜索条件
|
||||
*/
|
||||
export interface OrderParam extends PageParam {
|
||||
keywords?: string;
|
||||
orderName?: string;
|
||||
orderNo?: string;
|
||||
orderType?: string;
|
||||
createTimeStart?: string;
|
||||
createTimeEnd?: string;
|
||||
deliveryTime?: string;
|
||||
orderCategory?: string;
|
||||
progress?: string;
|
||||
orderSource?: string;
|
||||
betweenTime?: any;
|
||||
userId?: string;
|
||||
week?: number;
|
||||
payStatus?: number;
|
||||
rentOrderId?: number;
|
||||
deliveryStatus?: number;
|
||||
receiptStatus?: number;
|
||||
orderStatus?: number;
|
||||
isTemporary?: number;
|
||||
isRenew?: number;
|
||||
// 商户编号
|
||||
merchantCode?: string;
|
||||
}
|
||||
126
src/api/apps/bc/order/refund/index.ts
Normal file
126
src/api/apps/bc/order/refund/index.ts
Normal file
@@ -0,0 +1,126 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { OrderRefund, OrderRefundParam } from './model';
|
||||
import { OPEN_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询退货单
|
||||
*/
|
||||
export async function pageOrderRefund(params: OrderRefundParam) {
|
||||
const res = await request.get<ApiResult<PageResult<OrderRefund>>>(
|
||||
OPEN_API_URL + '/shop/order-refund/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询退货单列表
|
||||
*/
|
||||
export async function listOrderRefund(params?: OrderRefundParam) {
|
||||
const res = await request.get<ApiResult<OrderRefund[]>>(
|
||||
OPEN_API_URL + '/shop/order-refund',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询退货单
|
||||
*/
|
||||
export async function getOrderRefund(id: number) {
|
||||
const res = await request.get<ApiResult<OrderRefund>>(
|
||||
OPEN_API_URL + '/shop/order-refund/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加退货单
|
||||
*/
|
||||
export async function addOrderRefund(data: OrderRefund) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/order-refund',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改退货单
|
||||
*/
|
||||
export async function updateOrderRefund(data: OrderRefund) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/order-refund',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除退货单
|
||||
*/
|
||||
export async function removeOrderRefund(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/order-refund/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除退货单
|
||||
*/
|
||||
export async function removeBatchOrderRefund(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/order-refund/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查IP是否存在
|
||||
*/
|
||||
export async function checkExistence(
|
||||
field: string,
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/order-refund/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
38
src/api/apps/bc/order/refund/model/index.ts
Normal file
38
src/api/apps/bc/order/refund/model/index.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 退货订单
|
||||
*/
|
||||
export interface OrderRefund {
|
||||
orderRefundId?: number;
|
||||
orderId?: number;
|
||||
orderGoodsId?: number;
|
||||
userId?: number;
|
||||
type?: number;
|
||||
applyDesc?: string;
|
||||
auditStatus?: number;
|
||||
refuseDesc?: string;
|
||||
refundMoney?: number;
|
||||
isUserSend?: number;
|
||||
sendTime?: string;
|
||||
expressId?: string;
|
||||
expressNo?: string;
|
||||
isReceipt?: number;
|
||||
shopId?: number;
|
||||
sortNumber?: number;
|
||||
comments?: string;
|
||||
status?: number;
|
||||
merchantCode?: string;
|
||||
createTime?: string;
|
||||
updateTIme?: string;
|
||||
tenantId?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 退货订单搜索条件
|
||||
*/
|
||||
export interface OrderRefundParam extends PageParam {
|
||||
orderRefundId?: number;
|
||||
orderId?: number;
|
||||
orderGoodsId?: number;
|
||||
}
|
||||
106
src/api/apps/bc/plan/index.ts
Normal file
106
src/api/apps/bc/plan/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { BCPlan, BCPlanParam } from '@/api/apps/bc/plan/model';
|
||||
import { OPEN_API_URL } from '@/config/setting';
|
||||
/**
|
||||
* 分页查询计划
|
||||
*/
|
||||
export async function pageBCPlan(params: BCPlanParam) {
|
||||
const res = await request.get<ApiResult<PageResult<BCPlan>>>(
|
||||
OPEN_API_URL + '/apps/bc-plan/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询计划列表
|
||||
*/
|
||||
export async function listBCPlan(params?: BCPlanParam) {
|
||||
const res = await request.get<ApiResult<BCPlan[]>>(
|
||||
OPEN_API_URL + '/apps/bc-plan',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加计划
|
||||
*/
|
||||
export async function addBCPlan(data: BCPlan) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/apps/bc-plan',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改计划
|
||||
*/
|
||||
export async function updateBCPlan(data: BCPlan) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/apps/bc-plan',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定计划
|
||||
*/
|
||||
export async function bindBCPlan(data: BCPlan) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/apps/bc-plan/bind',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除计划
|
||||
*/
|
||||
export async function removeBCPlan(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/apps/bc-plan/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除计划
|
||||
*/
|
||||
export async function removeBatchBCPlan(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/apps/bc-plan/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
28
src/api/apps/bc/plan/model/index.ts
Normal file
28
src/api/apps/bc/plan/model/index.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
export interface BCPlan {
|
||||
bcPlanId?: number;
|
||||
dayTime?: any;
|
||||
oldTime?: string;
|
||||
type?: string;
|
||||
userId?: number;
|
||||
goodsIds?: any;
|
||||
status?: number;
|
||||
period?: string;
|
||||
comments?: string;
|
||||
createTime?: string;
|
||||
tenantId?: number;
|
||||
isRepeat?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索条件
|
||||
*/
|
||||
export interface BCPlanParam extends PageParam {
|
||||
bcPlanId?: number;
|
||||
dayTime?: string;
|
||||
week?: number;
|
||||
status?: number;
|
||||
userId?: number;
|
||||
oldTime?: string;
|
||||
}
|
||||
109
src/api/apps/bc/recharge/export/index.ts
Normal file
109
src/api/apps/bc/recharge/export/index.ts
Normal file
@@ -0,0 +1,109 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type {
|
||||
RechargeOrder,
|
||||
RechargeOrderParam
|
||||
} from '@/api/user/recharge/export/model';
|
||||
import { OPEN_API_URL } from '@/config/setting';
|
||||
/**
|
||||
* 分页查询充值计划
|
||||
*/
|
||||
export async function pageRechargeOrder(params: RechargeOrderParam) {
|
||||
const res = await request.get<ApiResult<PageResult<RechargeOrder>>>(
|
||||
OPEN_API_URL + '/shop/recharge-order/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询充值计划列表
|
||||
*/
|
||||
export async function listRechargeOrder(params?: RechargeOrderParam) {
|
||||
const res = await request.get<ApiResult<RechargeOrder[]>>(
|
||||
OPEN_API_URL + '/shop/recharge-order',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加充值计划
|
||||
*/
|
||||
export async function addRechargeOrder(data: RechargeOrder) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/recharge-order',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改充值计划
|
||||
*/
|
||||
export async function updateRechargeOrder(data: RechargeOrder) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/recharge-order',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定充值计划
|
||||
*/
|
||||
export async function bindRechargeOrder(data: RechargeOrder) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/recharge-order/bind',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除充值计划
|
||||
*/
|
||||
export async function removeRechargeOrder(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/recharge-order/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除充值计划
|
||||
*/
|
||||
export async function removeBatchRechargeOrder(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/recharge-order/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
31
src/api/apps/bc/recharge/export/model/index.ts
Normal file
31
src/api/apps/bc/recharge/export/model/index.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
export interface RechargeOrder {
|
||||
orderId?: number;
|
||||
organizationId?: number;
|
||||
organizationName?: string;
|
||||
nickname?: string;
|
||||
payPrice?: number;
|
||||
comments?: string;
|
||||
createTime?: string;
|
||||
tenantId?: number;
|
||||
expendMoney?: string;
|
||||
userId?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索条件
|
||||
*/
|
||||
export interface RechargeOrderParam extends PageParam {
|
||||
exportId?: number;
|
||||
organizationName?: string;
|
||||
organizationId?: number;
|
||||
dayTime?: string;
|
||||
week?: number;
|
||||
status?: number;
|
||||
userId?: number;
|
||||
createTimeStart?: string;
|
||||
createTimeEnd?: string;
|
||||
deliveryTimeStart?: string;
|
||||
deliveryTimeEnd?: string;
|
||||
}
|
||||
134
src/api/apps/bc/recharge/order/index.ts
Normal file
134
src/api/apps/bc/recharge/order/index.ts
Normal file
@@ -0,0 +1,134 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { RechargeOrder, RechargeOrderParam } from './model/index';
|
||||
import { OPEN_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 充值
|
||||
*/
|
||||
export async function recharge(data: RechargeOrder) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/recharge-order/recharge',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询充值记录
|
||||
*/
|
||||
export async function pageRechargeOrder(params: RechargeOrderParam) {
|
||||
const res = await request.get<ApiResult<PageResult<RechargeOrder>>>(
|
||||
OPEN_API_URL + '/shop/recharge-order/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询充值记录列表
|
||||
*/
|
||||
export async function listRechargeOrder(params?: RechargeOrderParam) {
|
||||
const res = await request.get<ApiResult<RechargeOrder[]>>(
|
||||
OPEN_API_URL + '/shop/recharge-order',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询充值记录
|
||||
*/
|
||||
export async function getRechargeOrder(id: number) {
|
||||
const res = await request.get<ApiResult<RechargeOrder>>(
|
||||
OPEN_API_URL + '/shop/recharge-order/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加充值记录
|
||||
*/
|
||||
export async function addRechargeOrder(data: RechargeOrder) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/recharge-order',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改充值记录
|
||||
*/
|
||||
export async function updateRechargeOrder(data: RechargeOrder) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/recharge-order',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除充值记录
|
||||
*/
|
||||
export async function removeRechargeOrder(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/recharge-order/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除充值记录
|
||||
*/
|
||||
export async function removeBatchRechargeOrder(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/recharge-order/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量充值操作
|
||||
*/
|
||||
export async function batchRecharge(data: RechargeOrder[]) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/shop/recharge-order/batchRecharge',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
33
src/api/apps/bc/recharge/order/model/index.ts
Normal file
33
src/api/apps/bc/recharge/order/model/index.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 充值记录
|
||||
*/
|
||||
export interface RechargeOrder {
|
||||
orderId?: number;
|
||||
userId?: number;
|
||||
scene?: number;
|
||||
orderNo?: string;
|
||||
money?: string;
|
||||
payPrice?: number;
|
||||
organizationId?: number;
|
||||
rechargeType?: number;
|
||||
describe?: string;
|
||||
remark?: string;
|
||||
sortNumber?: number;
|
||||
comments?: string;
|
||||
status?: number;
|
||||
deleted?: number;
|
||||
tenantId?: number;
|
||||
createTime?: string;
|
||||
updateTime?: string;
|
||||
balance?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户搜索条件
|
||||
*/
|
||||
export interface RechargeOrderParam extends PageParam {
|
||||
orderId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
109
src/api/apps/bc/temporary/index.ts
Normal file
109
src/api/apps/bc/temporary/index.ts
Normal file
@@ -0,0 +1,109 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type {
|
||||
BCTemporary,
|
||||
BCTemporaryParam
|
||||
} from '@/api/apps/bc/temporary/model';
|
||||
import { OPEN_API_URL } from '@/config/setting';
|
||||
/**
|
||||
* 分页查询设备
|
||||
*/
|
||||
export async function pageBCTemporary(params: BCTemporaryParam) {
|
||||
const res = await request.get<ApiResult<PageResult<BCTemporary>>>(
|
||||
OPEN_API_URL + '/apps/bc-temporary/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询设备列表
|
||||
*/
|
||||
export async function listBCTemporary(params?: BCTemporaryParam) {
|
||||
const res = await request.get<ApiResult<BCTemporary[]>>(
|
||||
OPEN_API_URL + '/apps/bc-temporary',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加设备
|
||||
*/
|
||||
export async function addBCTemporary(data: BCTemporary) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/apps/bc-temporary',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设备
|
||||
*/
|
||||
export async function updateBCTemporary(data: BCTemporary) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/apps/bc-temporary',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定设备
|
||||
*/
|
||||
export async function bindBCTemporary(data: BCTemporary) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/apps/bc-temporary/bind',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除设备
|
||||
*/
|
||||
export async function removeBCTemporary(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/apps/bc-temporary/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除设备
|
||||
*/
|
||||
export async function removeBatchBCTemporary(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
OPEN_API_URL + '/apps/bc-temporary/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
25
src/api/apps/bc/temporary/model/index.ts
Normal file
25
src/api/apps/bc/temporary/model/index.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 代理报餐
|
||||
*/
|
||||
export interface BCTemporary {
|
||||
temporaryId?: number;
|
||||
userId?: number;
|
||||
parentId?: number;
|
||||
sortNumber?: number;
|
||||
applyStatus?: number;
|
||||
status?: number;
|
||||
comments?: string;
|
||||
expirationTime?: string;
|
||||
createTime?: string;
|
||||
tenantId?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单搜索条件
|
||||
*/
|
||||
export interface BCTemporaryParam extends PageParam {
|
||||
status?: number;
|
||||
userId?: number;
|
||||
}
|
||||
46
src/api/apps/statistics/index.ts
Normal file
46
src/api/apps/statistics/index.ts
Normal file
@@ -0,0 +1,46 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import { Order, OrderParam } from '@/api/apps/bc/order/model';
|
||||
import { OPEN_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 菜品预定统计
|
||||
*/
|
||||
export async function countOrderGoods(params: any) {
|
||||
const res = await request.get<ApiResult<any>>(
|
||||
OPEN_API_URL + '/apps/bc-statistics/baoCanUsers',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
export async function repairData(params?: OrderParam) {
|
||||
const res = await request.get<ApiResult<Order[]>>(
|
||||
OPEN_API_URL + '/apps/bc-statistics/repairData',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
export async function pageUserLog(params: any) {
|
||||
const res = await request.get<ApiResult<PageResult<any>>>(
|
||||
'http://127.0.0.1:10051/api/shop/user-balance-log/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
15
src/api/apps/statistics/model/index.ts
Normal file
15
src/api/apps/statistics/model/index.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 链接
|
||||
*/
|
||||
export interface Link {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 链接搜索条件
|
||||
*/
|
||||
export interface LinkParam extends PageParam {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user