liu
2 天以前 f11bd0d8d9c1190340a445a67df9e43cdbde0a3e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
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 } });
}