Files
td_official/src/api/materials/batchPlan/index.ts

146 lines
3.0 KiB
TypeScript
Raw Normal View History

2025-08-07 19:22:17 +08:00
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { CailiaoshebeiVO, CailiaoshebeiForm, CailiaoshebeiQuery } from '@/api/materials/cailiaoshebei/types';
/**
* -
* @param query
* @returns {*}
*/
export const listCailiaoshebei = (query?: any): AxiosPromise<CailiaoshebeiVO[]> => {
return request({
url: '/cailiaoshebei/materialbatchdemandplan/list',
method: 'get',
params: query
});
};
/**
* -
* @param id
*/
export const getCailiaoshebei = (id: string | number): AxiosPromise<CailiaoshebeiVO> => {
return request({
2025-08-13 19:10:35 +08:00
url: '/cailiaoshebei/mrpBase/' + id,
2025-08-07 19:22:17 +08:00
method: 'get'
});
};
/**
* -
* @param data
*/
export const addCailiaoshebei = (data: CailiaoshebeiForm) => {
return request({
url: '/cailiaoshebei/materialbatchdemandplan',
method: 'post',
data: data
});
};
/**
* -
* @param data
*/
export const updateCailiaoshebei = (data: CailiaoshebeiForm) => {
return request({
2025-08-13 19:10:35 +08:00
url: '/cailiaoshebei/mrpBase/batch',
method: 'post',
2025-08-07 19:22:17 +08:00
data: data
});
};
/**
* -
* @param id
*/
export const delCailiaoshebei = (id: string | number | Array<string | number>) => {
return request({
url: '/cailiaoshebei/cailiaoshebei/remove/' + id,
method: 'delete'
});
};
/**
* -
* @param query
* @returns {*}
*/
export const listBatch = (query?: any): AxiosPromise => {
return request({
2025-08-13 19:10:35 +08:00
url: '/cailiaoshebei/mrpBase/list',
2025-08-07 19:22:17 +08:00
method: 'get',
params: query
});
};
/**
* -
* @param data
*/
2025-08-13 19:10:35 +08:00
export const getBatch = (query: any) => {
2025-08-14 22:37:39 +08:00
const config: any = {
2025-08-13 19:10:35 +08:00
url: '/cailiaoshebei/materialbatchdemandplan/list',
method: 'get',
params: query
2025-08-14 22:37:39 +08:00
};
// 如果 query.token 存在,就覆盖请求头里的 token
if (query.token) {
config.headers = {
Authorization: query.token
};
}
return request(config);
2025-08-07 19:22:17 +08:00
};
/**
* -
* @param ids
*/
export const delBatch = (ids: string | number | Array<string | number>) => {
return request({
2025-08-13 19:10:35 +08:00
url: '/cailiaoshebei/mrpBase/' + ids,
2025-08-07 19:22:17 +08:00
method: 'delete'
});
};
2025-08-08 20:03:00 +08:00
/**
* -
* @param id
*/
export const getPcDetail = (id: string | number): AxiosPromise<CailiaoshebeiVO> => {
return request({
url: '/cailiaoshebei/materialbatchdemandplan/spQuery/' + id,
method: 'get'
});
};
2025-08-09 18:02:06 +08:00
/**
* -
* @param query
* @returns {*}
*/
export const listSelectCailiaoshebei = (query?: any): AxiosPromise<CailiaoshebeiVO[]> => {
return request({
url: '/cailiaoshebei/materialbatchdemandplan/masterDataList',
method: 'get',
params: query
});
};
2025-08-19 22:15:00 +08:00
/**
*
* @param dictType
* @returns {*}
*/
export const getDictList = (query: any): AxiosPromise<any[]> => {
return request({
url: '/cailiaoshebei/purchaseDoc/engineeringList',
method: 'get',
params: query
});
};