| | |
| | | accountId?: number; // 结算账户编号 |
| | | status?: number; // 状态 |
| | | remark?: string; // 备注 |
| | | fileUrl?: string; // 附件地址 |
| | | attachmentList?: { id: number; name?: string; url?: string }[]; // 附件列表 |
| | | inCount?: number; // 采购入库数量 |
| | | count?: number; // 数量 |
| | | returnCount?: number; // 采购退货数量 |
| | |
| | | productNames?: string; // 产品名称列表 |
| | | creatorName?: string; // 创建人名称 |
| | | createTime?: Date; // 创建时间 |
| | | reviewerId?: number; // 审核人编号 |
| | | reviewerName?: string; // 审核人姓名 |
| | | reviewTime?: Date | string; // 审核时间 |
| | | reviewRemark?: string; // 审核意见(不通过时为驳回原因) |
| | | items?: PurchaseOrderItem[]; // 订单项列表 |
| | | } |
| | | |
| | |
| | | /** 查询采购订单分页 */ |
| | | export function getPurchaseOrderPage(params: PageParam) { |
| | | return requestClient.get<PageResult<ErpPurchaseOrderApi.PurchaseOrder>>( |
| | | '/erp/purchase-order/page', |
| | | '/purchase/order/page', |
| | | { params }, |
| | | ); |
| | | } |
| | |
| | | /** 查询采购订单详情 */ |
| | | export function getPurchaseOrder(id: number) { |
| | | return requestClient.get<ErpPurchaseOrderApi.PurchaseOrder>( |
| | | `/erp/purchase-order/get?id=${id}`, |
| | | `/purchase/order/get?id=${id}`, |
| | | ); |
| | | } |
| | | |
| | | /** 新增采购订单 */ |
| | | export function createPurchaseOrder(data: ErpPurchaseOrderApi.PurchaseOrder) { |
| | | return requestClient.post('/erp/purchase-order/create', data); |
| | | return requestClient.post('/purchase/order/create', data); |
| | | } |
| | | |
| | | /** 修改采购订单 */ |
| | | export function updatePurchaseOrder(data: ErpPurchaseOrderApi.PurchaseOrder) { |
| | | return requestClient.put('/erp/purchase-order/update', data); |
| | | return requestClient.put('/purchase/order/update', data); |
| | | } |
| | | |
| | | /** 更新采购订单的状态 */ |
| | | export function updatePurchaseOrderStatus(id: number, status: number) { |
| | | return requestClient.put('/erp/purchase-order/update-status', null, { |
| | | return requestClient.put('/purchase/order/update-status', null, { |
| | | params: { id, status }, |
| | | }); |
| | | } |
| | | |
| | | /** 删除采购订单 */ |
| | | export function deletePurchaseOrder(ids: number[]) { |
| | | return requestClient.delete('/erp/purchase-order/delete', { |
| | | return requestClient.delete('/purchase/order/delete', { |
| | | params: { ids: ids.join(',') }, |
| | | }); |
| | | } |
| | | |
| | | /** 导出采购订单 Excel */ |
| | | export function exportPurchaseOrder(params: any) { |
| | | return requestClient.download('/erp/purchase-order/export-excel', { params }); |
| | | return requestClient.download('/purchase/order/export-excel', { params }); |
| | | } |
| | | |
| | | /** 获取采购审核流程列表 */ |
| | | export function getPurchaseApproveProcessList() { |
| | | return requestClient.get<any[]>('/erp/purchase-order/approve-process-list'); |
| | | /** |
| | | * 提交采购订单审批(未提交/审核不通过 → 审批中) |
| | | * |
| | | * 改为轻量级状态机审批后,后端按审批配置校验审批人,前端无需再选择 BPM 流程。 |
| | | */ |
| | | export function submitPurchaseOrder(id: number) { |
| | | return requestClient.put('/purchase/order/submit', null, { |
| | | params: { id }, |
| | | }); |
| | | } |
| | | |
| | | /** 获取采购审核流程列表响应 */ |
| | | export interface ProcessDefinition { |
| | | id: string; // 流程定义ID |
| | | key: string; // 流程Key |
| | | name: string; // 流程名称 |
| | | version: number; // 版本号 |
| | | /** |
| | | * 审核采购订单(审批中 → 审核通过/审核不通过) |
| | | * |
| | | * 仅审批配置中指定的审批人本人可调用;pass=false 时 reviewRemark(不通过原因)必填。 |
| | | */ |
| | | export function auditPurchaseOrder( |
| | | id: number, |
| | | pass: boolean, |
| | | reviewRemark?: string, |
| | | ) { |
| | | return requestClient.put('/purchase/order/audit', { |
| | | id, |
| | | pass, |
| | | reviewRemark, |
| | | }); |
| | | } |
| | | |
| | | /** 获取采购订单的审批人编号集合,供前端判断是否展示审核按钮 */ |
| | | export function getPurchaseOrderApproverUserIds() { |
| | | return requestClient.get<number[]>('/purchase/order/approver-ids'); |
| | | } |
| | | |
| | | /** 确认收货 */ |
| | | export function confirmReceipt(id: number) { |
| | | return requestClient.post<number>('/purchase/order/confirm-receipt', null, { |
| | | params: { id }, |
| | | }); |
| | | } |