zhangwencui
6 天以前 7619c19a67c2ac824f803090bab753fc5ea14408
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import type { PageParam, PageResult } from '@vben/request';
 
import { requestClient } from '#/api/request';
 
export namespace WlsWarehouseLocationApi {
  /** MES 库区 */
  export interface WarehouseLocation {
    id?: number; // 库区编号
    code?: string; // 库区编码
    name?: string; // 库区名称
    warehouseId?: number; // 仓库编号
    warehouseName?: string; // 仓库名称
    area?: number; // 面积
    frozen?: boolean; // 是否冻结
    remark?: string; // 备注
    createTime?: Date; // 创建时间
  }
}
 
/** 查询库区分页 */
export function getWarehouseLocationPage(params: PageParam) {
  return requestClient.get<
    PageResult<WlsWarehouseLocationApi.WarehouseLocation>
  >('/mes/wm/warehouse-location/page', { params });
}
 
/** 查询库区精简列表 */
export function getWarehouseLocationSimpleList(warehouseId?: number) {
  return requestClient.get<WlsWarehouseLocationApi.WarehouseLocation[]>(
    '/mes/wm/warehouse-location/simple-list',
    { params: { warehouseId } },
  );
}
 
/** 查询库区详情 */
export function getWarehouseLocation(id: number) {
  return requestClient.get<WlsWarehouseLocationApi.WarehouseLocation>(
    `/mes/wm/warehouse-location/get?id=${id}`,
  );
}
 
/** 新增库区 */
export function createWarehouseLocation(
  data: WlsWarehouseLocationApi.WarehouseLocation,
) {
  return requestClient.post('/mes/wm/warehouse-location/create', data);
}
 
/** 修改库区 */
export function updateWarehouseLocation(
  data: WlsWarehouseLocationApi.WarehouseLocation,
) {
  return requestClient.put('/mes/wm/warehouse-location/update', data);
}
 
/** 删除库区 */
export function deleteWarehouseLocation(id: number) {
  return requestClient.delete(`/mes/wm/warehouse-location/delete?id=${id}`);
}
 
/** 批量设置库区下所有库位的混放规则 */
export function updateAreaByLocationId(
  locationId: number,
  allowItemMixing?: boolean,
  allowBatchMixing?: boolean,
) {
  return requestClient.put(
    '/mes/wm/warehouse-location/update-by-location-id',
    null,
    { params: { allowBatchMixing, allowItemMixing, locationId } },
  );
}