From 5c243d9d05da668a32b1bc9a4f543ea081488d11 Mon Sep 17 00:00:00 2001
From: xiaoyi <908147524@qq.com>
Date: 星期四, 20 八月 2026 14:08:03 +0800
Subject: [PATCH] feat 功能变更

---
 src/api/crm/contract/index.ts |   53 +++++++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 45 insertions(+), 8 deletions(-)

diff --git a/src/api/crm/contract/index.ts b/src/api/crm/contract/index.ts
index 92e9695..35b4e05 100644
--- a/src/api/crm/contract/index.ts
+++ b/src/api/crm/contract/index.ts
@@ -1,4 +1,4 @@
-import type { PageParam, PageResult } from '../../../packages/effects/request/src';
+import type { PageParam, PageResult } from '@vben/request';
 
 import type { CrmPermissionApi } from '#/api/crm/permission';
 
@@ -26,7 +26,10 @@
     totalProductPrice: number;
     discountPercent: number;
     totalPrice: number;
+    depositPrice?: number; // 瀹氶噾閲戦锛屽崟浣嶏細鍏�
     totalReceivablePrice: number;
+    totalInvoicePrice?: number; // 宸插紑绁ㄩ噾棰濓紙鍚鎵逛腑锛夛紝鍗曚綅锛氬厓
+    unInvoicePrice?: number; // 鏈紑绁ㄩ噾棰濓紝鍗曚綅锛氬厓
     signContactId: number;
     signContactName?: string;
     signUserId: number;
@@ -38,19 +41,39 @@
     updateTime?: Date;
     products?: ContractProduct[];
     contactName?: string;
+    orderId?: number; // 鍏宠仈 ERP 閿�鍞鍗曠紪鍙�
+    orderNo?: string; // ERP 閿�鍞鍗曞崟鍙�
+    contractType?: string; // 鍚堝悓绫诲瀷锛堜緵鐢ㄧ數/鑳芥簮鏈嶅姟绛夛級
+    voltageLevel?: string; // 鐢靛帇绛夌骇
+    electricityType?: string; // 鐢ㄧ數绫诲瀷
+    contractCapacity?: number; // 鍚堝悓瀹归噺锛坘VA锛�
+    tariffMode?: string; // 鐢典环妯″紡
+    meterMode?: string; // 璁¢噺鏂瑰紡
+    payCycle?: number; // 缂磋垂鍛ㄦ湡锛堟湀锛�
+    commandCount?: number; // 鎸囦护鏁伴噺
   }
 
   /** 鍚堝悓浜у搧淇℃伅 */
   export interface ContractProduct {
     id: number;
-    productId: number;
-    productName: string;
-    productNo: string;
-    productUnit: number;
-    productPrice: number;
+    itemId: number;
+    itemName: string;
+    itemCode: string;
+    itemBarCode: string;
+    itemSpecification?: string;
+    itemUnitName: string;
+    itemUnitName2?: string;
+    itemUnitName3?: string;
+    itemPrice: number;
     contractPrice: number;
     count: number;
     totalPrice: number;
+  }
+
+  /** 瀹℃壒娴佺▼ */
+  export interface ApproveProcess {
+    key: string;
+    name: string;
   }
 }
 
@@ -113,8 +136,17 @@
 }
 
 /** 鎻愪氦瀹℃牳 */
-export function submitContract(id: number) {
-  return requestClient.put(`/crm/contract/submit?id=${id}`);
+export function submitContract(id: number, processDefinitionKey: string) {
+  return requestClient.put('/crm/contract/submit', null, {
+    params: { id, processDefinitionKey },
+  });
+}
+
+/** 鑾峰彇鍚堝悓瀹℃壒娴佺▼鍒楄〃 */
+export function getContractApproveProcessList() {
+  return requestClient.get<CrmContractApi.ApproveProcess[]>(
+    '/crm/contract/approve-process-list',
+  );
 }
 
 /** 鍚堝悓杞Щ */
@@ -131,3 +163,8 @@
 export function getRemindContractCount() {
   return requestClient.get<number>('/crm/contract/remind-count');
 }
+
+/** 鏍规嵁鍚堝悓鐢熸垚閿�鍞鍗� */
+export function generateSaleOrder(id: number) {
+  return requestClient.post<number>('/crm/contract/generate-sale-order', null, { params: { id } });
+}

--
Gitblit v1.9.3