78 lines
1.6 KiB
TypeScript
78 lines
1.6 KiB
TypeScript
import request from '@/utils/request';
|
|
import { AxiosPromise } from 'axios';
|
|
import { FreightTemplatesVO, FreightTemplatesForm, FreightTemplatesQuery } from '@/api/channel/shipping/types';
|
|
|
|
/**
|
|
* 查询运费模板列表
|
|
* @param query
|
|
* @returns {*}
|
|
*/
|
|
|
|
export const listFreightTemplates = (query?: FreightTemplatesQuery): AxiosPromise<FreightTemplatesVO[]> => {
|
|
return request({
|
|
url: '/freightTemplates/list',
|
|
method: 'get',
|
|
params: query
|
|
});
|
|
};
|
|
|
|
/**
|
|
* 查询运费模板详细
|
|
* @param id
|
|
*/
|
|
export const getFreightTemplates = (id: string | number): AxiosPromise<FreightTemplatesVO> => {
|
|
return request({
|
|
url: '/freightTemplates/' + id,
|
|
method: 'get'
|
|
});
|
|
};
|
|
|
|
/**
|
|
* 新增运费模板
|
|
* @param data
|
|
*/
|
|
export const addFreightTemplates = (data: FreightTemplatesForm) => {
|
|
return request({
|
|
url: '/freightTemplates',
|
|
method: 'post',
|
|
data: data
|
|
});
|
|
};
|
|
|
|
/**
|
|
* 修改运费模板
|
|
* @param data
|
|
*/
|
|
export const updateFreightTemplates = (data: FreightTemplatesForm) => {
|
|
return request({
|
|
url: '/freightTemplates',
|
|
method: 'put',
|
|
data: data
|
|
});
|
|
};
|
|
|
|
/**
|
|
* 删除运费模板
|
|
* @param id
|
|
*/
|
|
export const delFreightTemplates = (id: string | number | Array<string | number>) => {
|
|
return request({
|
|
url: '/freightTemplates/' + id,
|
|
method: 'delete'
|
|
});
|
|
};
|
|
|
|
/**
|
|
* 查询所有区域-华中/华北等列表
|
|
* @param query
|
|
* @returns {*}
|
|
*/
|
|
|
|
export const regionArea = (query?: FreightTemplatesQuery): AxiosPromise<FreightTemplatesVO[]> => {
|
|
return request({
|
|
url: '/system/regionArea/all',
|
|
method: 'get',
|
|
params: query
|
|
});
|
|
};
|