12 小时以前 c77086ad2d7949ab36dd0c4e0b59907e672dd64f
src/api/crm/contract/index.ts
@@ -28,6 +28,8 @@
    totalPrice: number;
    depositPrice?: number; // 定金金额,单位:元
    totalReceivablePrice: number;
    totalInvoicePrice?: number; // 已开票金额(含审批中),单位:元
    unInvoicePrice?: number; // 未开票金额,单位:元
    signContactId: number;
    signContactName?: string;
    signUserId: number;
@@ -158,3 +160,23 @@
export function generateSaleOrder(id: number) {
  return requestClient.post<number>('/crm/contract/generate-sale-order', null, { params: { id } });
}
/** 合同导入结果 */
export interface ImportResult {
  /** 创建成功的合同编号 */
  createList?: string[];
  /** 更新成功的合同编号 */
  updateList?: string[];
  /** 导入失败集合,key 为合同编号或行号,value 为失败原因 */
  failureList?: Record<string, string>;
}
/** 下载合同导入模板 */
export function importContractTemplate() {
  return requestClient.download('/crm/contract/get-import-template');
}
/** 导入合同 */
export function importContract(file: File) {
  return requestClient.upload<ImportResult>('/crm/contract/import', { file });
}