import { requestClient } from '#/api/request';
|
|
export namespace MesProProcessParamApi {
|
/** 工序-工艺参数绑定 */
|
export interface ProcessParam {
|
id?: number;
|
processId?: number;
|
processParamId?: number;
|
paramCode?: string;
|
paramName?: string;
|
paramType?: number;
|
unitMeasureId?: number;
|
unitMeasureName?: string;
|
required?: boolean;
|
sort?: number;
|
remark?: string;
|
}
|
|
/** 保存绑定项 */
|
export interface SaveItem {
|
processParamId: number;
|
required?: boolean;
|
sort?: number;
|
remark?: string;
|
}
|
}
|
|
/** 查询工序绑定的工艺参数列表 */
|
export function getProcessParamListByProcess(processId: number) {
|
return requestClient.get<MesProProcessParamApi.ProcessParam[]>(
|
'/mes/pro/process-param/list-by-process',
|
{ params: { processId } },
|
);
|
}
|
|
/** 全量覆盖保存工序绑定的工艺参数 */
|
export function updateProcessParams(
|
processId: number,
|
items: MesProProcessParamApi.SaveItem[],
|
) {
|
return requestClient.post('/mes/pro/process-param/update-bindings', {
|
processId,
|
items,
|
});
|
}
|
|
/** 查询某工艺参数被哪些工序绑定 */
|
export function getProcessListByParam(paramId: number) {
|
return requestClient.get<
|
{ id: number; code?: string; name?: string; attention?: string }[]
|
>('/mes/pro/process-param/list-by-param', { params: { paramId } });
|
}
|