xiaoyi
5 天以前 27c8277d717b34b55f3ea967027b53b067f77df3
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
73
74
75
76
import type { PageParam, PageResult } from '@vben/request';
 
import { requestClient } from '#/api/request';
 
export namespace MesPdProductApi {
  /** 产品档案 */
  export interface Product {
    id?: number; // 编号
    archiveType?: number; // 档案类型(1电力服务/2供电产品/3增值能源产品)
    archiveTypeName?: string; // 档案类型名称
    code?: string; // 档案编码
    name?: string; // 档案名称
    spec?: string; // 规格型号
    unit?: string; // 单位
    price?: number; // 基准价格
    auditStatus?: number; // 审批状态(0未提交/10审批中/20审核通过/30审核不通过)
    auditStatusName?: string; // 审批状态名称
    auditRemark?: string; // 审批意见
    auditTime?: Date; // 审批时间
    status?: number; // 启用状态(1启用/0禁用)
    remark?: string; // 备注
    createTime?: Date; // 创建时间
  }
 
  /** 产品档案审批参数 */
  export interface ProductAudit {
    id: number; // 编号
    pass: boolean; // 审批结果:true=通过 / false=驳回
    auditRemark?: string; // 审批意见
  }
}
 
/** 查询产品档案分页 */
export function getProductPage(params: PageParam) {
  return requestClient.get<PageResult<MesPdProductApi.Product>>(
    '/mes/pd/product/page',
    { params },
  );
}
 
/** 查询产品档案详情 */
export function getProduct(id: number) {
  return requestClient.get<MesPdProductApi.Product>(
    `/mes/pd/product/get?id=${id}`,
  );
}
 
/** 新增产品档案 */
export function createProduct(data: MesPdProductApi.Product) {
  return requestClient.post('/mes/pd/product/create', data);
}
 
/** 修改产品档案 */
export function updateProduct(data: MesPdProductApi.Product) {
  return requestClient.put('/mes/pd/product/update', data);
}
 
/** 删除产品档案 */
export function deleteProduct(id: number) {
  return requestClient.delete(`/mes/pd/product/delete?id=${id}`);
}
 
/** 导出产品档案 Excel */
export function exportProduct(params: any) {
  return requestClient.download('/mes/pd/product/export-excel', { params });
}
 
/** 提交审批(未提交/驳回 → 审批中) */
export function submitProduct(id: number) {
  return requestClient.put(`/mes/pd/product/submit?id=${id}`);
}
 
/** 审批产品档案(审批中 → 通过/驳回) */
export function auditProduct(data: MesPdProductApi.ProductAudit) {
  return requestClient.put('/mes/pd/product/audit', data);
}