181 lines
3.8 KiB
JavaScript
181 lines
3.8 KiB
JavaScript
import http from '../utils/http'
|
|
import config from '../config/config'
|
|
|
|
/**
|
|
* 登录/注册同一个接口
|
|
* @author Seven
|
|
* @data 2025-3-29
|
|
* @param number // 验证码
|
|
* @returns { }
|
|
* @see https://mall.gpxscs.cn/api/admin/shop/store/printer/page
|
|
*/
|
|
|
|
export function GetPrinterList (params){
|
|
return new Promise((resolve, reject) => {
|
|
http({
|
|
url:'/shop/store/printer/page',
|
|
method:'get',
|
|
params,
|
|
baseURL:config.adminApi
|
|
}).then(res=>{
|
|
resolve(res)
|
|
}).catch(e => reject(console.warn(e)))
|
|
})
|
|
}
|
|
|
|
/**
|
|
* 获取打印机区域列表
|
|
* @author Seven
|
|
* @data 2025-4-5
|
|
* @param
|
|
* @returns { }
|
|
* @see https://mall.gpxscs.cn/api/admin/shop/store/printer/region/list
|
|
*/
|
|
|
|
export function GetPrinterflagList (params){
|
|
return new Promise((resolve, reject) => {
|
|
http({
|
|
url:'/shop/store/printer/region/list',
|
|
method:'get',
|
|
params,
|
|
baseURL:config.adminApi
|
|
}).then(res=>{
|
|
resolve(res)
|
|
}).catch(e => reject(console.warn(e)))
|
|
})
|
|
}
|
|
|
|
|
|
/**
|
|
* 获取打印机品牌列表
|
|
* @author Seven
|
|
* @data 2025-4-5
|
|
* @param
|
|
* @returns { }
|
|
* @see https://mall.gpxscs.cn/api/admin/shop/store/printer/model/list
|
|
*/
|
|
|
|
export function GetPrinterModelList (params){
|
|
return new Promise((resolve, reject) => {
|
|
http({
|
|
url:'/shop/store/printer/model/list',
|
|
method:'get',
|
|
params,
|
|
baseURL:config.adminApi
|
|
}).then(res=>{
|
|
resolve(res)
|
|
}).catch(e => reject(console.warn(e)))
|
|
})
|
|
}
|
|
|
|
/**
|
|
* 添加打印机
|
|
* @author Seven
|
|
* @data 2025-4-5
|
|
* @param
|
|
* @returns { }
|
|
* @see https://mall.gpxscs.cn/api/admin/shop/store/printer/add/new
|
|
*/
|
|
|
|
export function AddPrinter (params){
|
|
return new Promise((resolve, reject) => {
|
|
http({
|
|
url:'/shop/store/printer/add/new',
|
|
method:'post',
|
|
params,
|
|
baseURL:config.adminApi
|
|
}).then(res=>{
|
|
resolve(res)
|
|
}).catch(e => reject(console.warn(e)))
|
|
})
|
|
}
|
|
|
|
|
|
/**
|
|
* 删除打印机
|
|
* @author Seven
|
|
* @data 2025-4-5
|
|
* @param { printer_id:0} 打票机自增ID
|
|
* @returns { }
|
|
* @see https://mall.gpxscs.cn/api/admin/shop/store/printer/delete
|
|
*/
|
|
|
|
export function DelectPrinter (params){
|
|
return new Promise((resolve, reject) => {
|
|
http({
|
|
url:'/shop/store/printer/delete',
|
|
method:'post',
|
|
params,
|
|
baseURL:config.adminApi
|
|
}).then(res=>{
|
|
resolve(res)
|
|
}).catch(e => reject(console.warn(e)))
|
|
})
|
|
}
|
|
|
|
/**
|
|
* 更新打印机
|
|
* @author Seven
|
|
* @data 2025-4-5
|
|
* @param { printer_id:0} 打票机自增ID
|
|
* @returns { }
|
|
* @see https://mall.gpxscs.cn/api/admin/shop/store/printer/update
|
|
*/
|
|
|
|
export function UpdatePrinter (params){
|
|
return new Promise((resolve, reject) => {
|
|
http({
|
|
url:'/shop/store/printer/update',
|
|
method:'post',
|
|
params,
|
|
baseURL:config.adminApi
|
|
}).then(res=>{
|
|
resolve(res)
|
|
}).catch(e => reject(console.warn(e)))
|
|
})
|
|
}
|
|
|
|
/**
|
|
* 更新打印机状态
|
|
* @author Seven
|
|
* @data 2025-4-5
|
|
* @param {printer_id,status} 打票机自增ID
|
|
* @returns { }
|
|
* @see https://mall.gpxscs.cn/api/admin/shop/store/printer/status/update'
|
|
*/
|
|
|
|
export function UpdatePrinterStatus (params){
|
|
return new Promise((resolve, reject) => {
|
|
http({
|
|
url:'/shop/store/printer/status/update',
|
|
method:'post',
|
|
params,
|
|
baseURL:config.adminApi
|
|
}).then(res=>{
|
|
resolve(res)
|
|
}).catch(e => reject(console.warn(e)))
|
|
})
|
|
}
|
|
|
|
|
|
/**
|
|
* 测试打印机
|
|
* @author Seven
|
|
* @data 2025-4-5
|
|
* @param {orderId} DD-20241112-1
|
|
* @returns { }
|
|
* @see https://mall.gpxscs.cn/api/admin/shop/store/printer/print/order
|
|
*/
|
|
|
|
export function TestPrinter (params){
|
|
return new Promise((resolve, reject) => {
|
|
http({
|
|
url:'shop/store/printer/print/order',
|
|
method:'post',
|
|
params,
|
|
baseURL:config.adminApi
|
|
}).then(res=>{
|
|
resolve(res)
|
|
}).catch(e => reject(console.warn(e)))
|
|
})
|
|
} |