修复已知问题
This commit is contained in:
106
src/api/mall/shopCashier/index.ts
Normal file
106
src/api/mall/shopCashier/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ShopCashier, ShopCashierParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询收银
|
||||
*/
|
||||
export async function pageShopCashier(params: ShopCashierParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopCashier>>>(
|
||||
MODULES_API_URL + '/mall/shop-cashier/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询收银列表
|
||||
*/
|
||||
export async function listShopCashier(params?: ShopCashierParam) {
|
||||
const res = await request.get<ApiResult<ShopCashier[]>>(
|
||||
MODULES_API_URL + '/mall/shop-cashier',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加收银
|
||||
*/
|
||||
export async function addShopCashier(data: ShopCashier) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/mall/shop-cashier',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改收银
|
||||
*/
|
||||
export async function updateShopCashier(data: ShopCashier) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/mall/shop-cashier',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除收银
|
||||
*/
|
||||
export async function removeShopCashier(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/mall/shop-cashier/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除收银
|
||||
*/
|
||||
export async function removeBatchShopCashier(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/mall/shop-cashier/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询收银
|
||||
*/
|
||||
export async function getShopCashier(id: number) {
|
||||
const res = await request.get<ApiResult<ShopCashier>>(
|
||||
MODULES_API_URL + '/mall/shop-cashier/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
55
src/api/mall/shopCashier/model/index.ts
Normal file
55
src/api/mall/shopCashier/model/index.ts
Normal file
@@ -0,0 +1,55 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 收银
|
||||
*/
|
||||
export interface ShopCashier {
|
||||
// 收银单ID
|
||||
id?: string;
|
||||
// 类型 0商城 1外卖
|
||||
type?: number;
|
||||
// 唯一标识
|
||||
code?: string;
|
||||
// 商品ID
|
||||
goodsId?: string;
|
||||
// 商品名称
|
||||
name?: string;
|
||||
// 商品规格
|
||||
spec?: string;
|
||||
// 商品价格
|
||||
price?: string;
|
||||
// 商品数量
|
||||
cartNum?: number;
|
||||
// 单商品合计
|
||||
totalPrice?: string;
|
||||
// 0 = 未购买 1 = 已购买
|
||||
isPay?: string;
|
||||
// 是否为立即购买
|
||||
isNew?: string;
|
||||
// 是否选中
|
||||
selected?: string;
|
||||
// 商户ID
|
||||
merchantId?: string;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 用户ID
|
||||
userId?: string;
|
||||
// 收银员ID
|
||||
cashierId?: string;
|
||||
// 分组取单
|
||||
groupId?: string;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 收银搜索条件
|
||||
*/
|
||||
export interface ShopCashierParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
Reference in New Issue
Block a user