cashier-web/src/api/account/printer.ts

129 lines
2.5 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import request from "@/utils/request";
import { Account_BaseUrl } from "@/api/config";
const baseURL = Account_BaseUrl + "/admin/printer";
const API = {
getList(data: getListRequest) {
return request<any>({
url: `${baseURL}`,
method: "get",
params: data
});
},
add(data: addRequest) {
return request({
url: `${baseURL}`,
method: "post",
data: data,
});
},
delete(id: number | string) {
return request({
url: `${baseURL}`,
method: "delete",
data: { id },
});
},
edit(data: editRequest) {
return request({
url: `${baseURL}`,
method: "put",
data: data,
});
},
get(id: number | string) {
return request<any>({
url: `${baseURL}/detail`,
method: "get",
params: { id }
});
},
// 获取商品分类
getPrinterType(params: any) {
return request<any>({
url: `/product/admin/prod/category/page`,
method: "get",
params: {
page: 1, size: 20
}
});
},
}
export default API;
export interface getListRequest {
/**
* 类型 USB 网络 蓝牙
*/
connectionType?: string;
/**
* 名称
*/
name?: string;
[property: string]: any;
}
/**
* PrinterAddDTO
*/
export interface addRequest {
/**
* ip地址
*/
address?: null | string;
/**
* 打印分类Id
*/
categoryIds?: null | string;
/**
* 分类
*/
categoryList?: null | string;
/**
* 分类打印 0-所有 1-部分分类 2-部分商品
*/
classifyPrint: null | string;
/**
* 现在打印机支持USB 和 网络、蓝牙
*/
connectionType: null | string;
/**
* 打印机品牌
*/
contentType: null | string;
/**
* 设备名称
*/
name: null | string;
/**
* 端口
*/
port?: null | string;
/**
* 打印方式 all-全部打印 normal-仅打印结账单「前台」one-仅打印制作单「厨房」
*/
printMethod: null | string;
/**
* 打印数量 c1m1^2=顾客+商家[2张] m1^1=商家[1张] c1^1顾客[1张] c2m1^3顾客2+商家1[3张]
*/
printQty: null | string;
/**
* 打印类型JSON数组 refund-确认退款单 handover-交班单 queue-排队取号
*/
printType: null | string;
/**
* 小票尺寸 58mm 80mm
*/
receiptSize?: null | string;
/**
* 排序
*/
sort?: number | null;
/**
* 打印类型分类label标签cash小票kitchen出品
*/
subType?: null | string;
[property: string]: any;
}
export interface editRequest extends addRequest {
id: number | string
}