15 小时以前 c77086ad2d7949ab36dd0c4e0b59907e672dd64f
src/api/erp/purchase/order/index.ts
@@ -13,6 +13,8 @@
    totalCount?: number; // 合计数量
    totalPrice?: number; // 合计金额,单位:元
    totalProductPrice?: number; // 产品金额,单位:元
    totalTaxPrice?: number; // 合计税额,单位:元
    remainInvoicePrice?: number; // 剩余可开票金额(订单总金额-已来票金额),单位:元
    discountPercent?: number; // 优惠率,百分比
    discountPrice?: number; // 优惠金额,单位:元
    depositPrice?: number; // 定金金额,单位:元
@@ -103,6 +105,23 @@
  return requestClient.get<any[]>('/erp/purchase-order/approve-process-list');
}
/** 反审批(协同办公已办任务中撤回已审核订单,回退为未审核) */
export function reverseApprove(processInstanceId: string) {
  return requestClient.post('/erp/purchase-order/reverse-approve', null, {
    params: { processInstanceId },
  });
}
/** 采购订单导入结果 */
export interface ImportResult {
  /** 创建成功的采购单编号 */
  createList?: string[];
  /** 更新成功的采购单编号 */
  updateList?: string[];
  /** 导入失败集合,key 为采购单编号或行号,value 为失败原因 */
  failureList?: Record<string, string>;
}
/** 获取采购审核流程列表响应 */
export interface ProcessDefinition {
  id: string; // 流程定义ID
@@ -117,3 +136,16 @@
    params: { id },
  });
}
/** 下载采购订单导入模板 */
export function importPurchaseOrderTemplate() {
  return requestClient.download('/erp/purchase-order/get-import-template');
}
/** 导入采购订单 */
export function importPurchaseOrder(file: File, directApprove: boolean) {
  return requestClient.upload<ImportResult>(
    '/erp/purchase-order/import',
    { file, directApprove },
  );
}