liu
3 天以前 0127fd119fe2a349fbfee92b375a5680e10d3275
src/api/erp/sale/order/index.ts
@@ -1,4 +1,4 @@
import type { PageParam, PageResult } from '..\..\..\..\packages\effects\request\src';
import type { PageParam, PageResult } from '@vben/request';
import { requestClient } from '#/api/request';
@@ -8,20 +8,34 @@
    id?: number; // 订单工单编号
    no: string; // 销售订单号
    customerId: number; // 客户编号
    customerName?: string; // 客户名称
    accountId?: number; // 收款账户编号
    saleUserId?: number; // 销售人员编号
    orderTime: Date; // 订单时间
    totalCount: number; // 合计数量
    totalPrice: number; // 合计金额,单位:元
    status: number; // 状态
    remark: string; // 备注
    processInstanceId?: string; // BPM 流程实例编号(提交协同办公审批后生成)
    outCount: number; // 销售出库数量
    fileUrl?: string; // 附件地址
    outStatus?: number; // 出库状态:0-未出库,1-部分出库,2-全部出库
    attachmentList?: { id: number; name?: string; url?: string }[]; // 附件列表
    inCount?: number; // 采购入库数量
    returnCount: number; // 销售退货数量
    totalProductPrice?: number; // 产品金额,单位:元
    discountPercent?: number; // 优惠率,百分比
    discountPrice?: number; // 优惠金额,单位:元
    depositPrice?: number; // 定金金额,单位:元
    contractId?: number; // 关联 CRM 合同编号
    contractNo?: string; // CRM 合同单号
    needProduction?: number; // 是否需要生产:0-不需要,1-需要
    productionStatus?: number; // 生产状态:0-未完成,1-已完成
    productionFinishTime?: Date; // 生产完成时间
    hasSalesNotice?: boolean; // 是否已生成发货通知单
    canCreateSalesNotice?: boolean; // 是否可以生成发货通知单
    creator?: string; // 创建人编号(字符串)
    creatorName?: string; // 创建人名称
    createTime?: Date; // 创建时间
    items?: SaleOrderItem[]; // 销售订单产品明细列表
  }
@@ -44,6 +58,10 @@
    totalTaxPrice?: number; // 含税总价,单位:元
    remark?: string; // 备注
    stockCount?: number; // 库存数量(显示字段)
    productSpecification?: string; // 规格型号(显示字段)
    needProduction?: number; // 是否需要生产:0-不需要,1-需要
    mpsId?: number; // MPS编号
    batchCode?: string; // 批次号
  }
}
@@ -79,11 +97,18 @@
  return requestClient.put('/erp/sale-order/update', data);
}
/** 更新销售订单的状态 */
export function updateSaleOrderStatus(id: number, status: number) {
  return requestClient.put('/erp/sale-order/update-status', null, {
    params: { id, status },
/** 提交销售订单审批(协同办公) */
export function submitSaleOrder(id: number, processDefinitionKey: string) {
  return requestClient.post('/erp/sale-order/submit', null, {
    params: { id, processDefinitionKey },
  });
}
/** 获取销售订单审批流程定义列表 */
export function getSaleOrderApproveProcessList() {
  return requestClient.get<
    { id: string; key: string; name: string }[]
  >('/erp/sale-order/approve-process-list');
}
/** 删除销售订单 */
@@ -97,3 +122,17 @@
export function exportSaleOrder(params: any) {
  return requestClient.download('/erp/sale-order/export-excel', { params });
}
/** 作废销售订单 */
export function cancelSaleOrder(id: number) {
  return requestClient.put('/erp/sale-order/cancel', null, {
    params: { id },
  });
}
/** 启用销售订单(恢复已作废订单) */
export function enableSaleOrder(id: number) {
  return requestClient.put('/erp/sale-order/enable', null, {
    params: { id },
  });
}