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);
|
}
|