forked from b2894lxlx/tuanwei-admin
Initial commit
This commit is contained in:
@@ -0,0 +1,103 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { OrderGoods, OrderGoodsParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询订单商品
|
||||
*/
|
||||
export async function pageOrderGoods(params: OrderGoodsParam) {
|
||||
const res = await request.get<ApiResult<PageResult<OrderGoods>>>(
|
||||
'/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[]>>('/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>>('/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>>('/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>>(
|
||||
'/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>>(
|
||||
'/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>>(
|
||||
'/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));
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
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;
|
||||
deliveryStatus?: number;
|
||||
organizationId?: number;
|
||||
organizationName?: string;
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Order, OrderParam } from './model';
|
||||
import { App } from "@/api/app/model";
|
||||
|
||||
/**
|
||||
* 分页查询订单
|
||||
*/
|
||||
export async function pageOrder(params: OrderParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Order>>>(
|
||||
'/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[]>>('/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<App>>('/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>>('/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>>('/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>>('/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>>('/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>>('/shop/order/existence', {
|
||||
params: { field, value, id }
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { OrderRefund, OrderRefundParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询退货单
|
||||
*/
|
||||
export async function pageOrderRefund(params: OrderRefundParam) {
|
||||
const res = await request.get<ApiResult<PageResult<OrderRefund>>>(
|
||||
'/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[]>>(
|
||||
'/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>>(
|
||||
'/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>>(
|
||||
'/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>>('/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>>(
|
||||
'/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>>(
|
||||
'/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>>(
|
||||
'/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));
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user