From 27c8277d717b34b55f3ea967027b53b067f77df3 Mon Sep 17 00:00:00 2001
From: xiaoyi <908147524@qq.com>
Date: 星期四, 20 八月 2026 16:58:49 +0800
Subject: [PATCH] feat 功能变更
---
src/api/erp/purchase/plan/index.ts | 102 +++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 102 insertions(+), 0 deletions(-)
diff --git a/src/api/erp/purchase/plan/index.ts b/src/api/erp/purchase/plan/index.ts
new file mode 100644
index 0000000..6ba0506
--- /dev/null
+++ b/src/api/erp/purchase/plan/index.ts
@@ -0,0 +1,102 @@
+import type { PageParam, PageResult } from '@vben/request';
+
+import { requestClient } from '#/api/request';
+
+export namespace ErpPurchasePlanApi {
+ /** 閲囪喘璁″垝淇℃伅 */
+ export interface PurchasePlan {
+ id?: number; // 缂栧彿
+ no?: string; // 璁″垝鍗曞彿
+ name?: string; // 璁″垝鍚嶇О
+ status?: number; // 鐘舵�侊細0鏈彁浜� 10瀹℃壒涓� 20瀹℃牳閫氳繃 30瀹℃牳涓嶉�氳繃 40宸插彇娑�
+ processInstanceId?: string; // 宸ヤ綔娴佺紪鍙�
+ demandSource?: number; // 闇�姹傛潵婧愶細1搴撳瓨棰勮 2杩愮淮/鐢熶骇璁″垝
+ demandSourceName?: string; // 闇�姹傛潵婧愬悕绉�
+ planDate?: string; // 璁″垝鏃ユ湡
+ planUserId?: number; // 缂栧埗浜虹紪鍙�
+ planUserName?: string; // 缂栧埗浜哄鍚�
+ planDeptId?: number; // 缂栧埗閮ㄩ棬缂栧彿
+ planDeptName?: string; // 缂栧埗閮ㄩ棬鍚嶇О
+ supplierId?: number; // 渚涘簲鍟嗙紪鍙�
+ supplierName?: string; // 渚涘簲鍟嗗悕绉�
+ totalCount?: number; // 鍚堣鏁伴噺
+ generatedFlag?: boolean; // 鏄惁宸茬敓鎴愰噰璐敵璇�
+ remark?: string; // 澶囨敞
+ productNames?: string; // 浜у搧鍚嶇О鍒楄〃
+ items?: PurchasePlanItem[]; // 璁″垝鏄庣粏
+ createTime?: string; // 鍒涘缓鏃堕棿
+ }
+
+ /** 閲囪喘璁″垝鏄庣粏 */
+ export interface PurchasePlanItem {
+ id?: number; // 缂栧彿
+ productId: number; // 浜у搧缂栧彿
+ productName?: string; // 浜у搧鍚嶇О
+ productUnitId?: number; // 浜у搧鍗曚綅缂栧彿
+ productUnitName?: string; // 浜у搧鍗曚綅鍚嶇О
+ count: number; // 璁″垝閲囪喘鏁伴噺
+ demandTime?: string; // 闇�姹傛棩鏈�
+ remark?: string; // 澶囨敞
+ }
+}
+
+/** 鍒涘缓閲囪喘璁″垝 */
+export function createPurchasePlan(data: ErpPurchasePlanApi.PurchasePlan) {
+ return requestClient.post('/erp/purchase-plan/create', data);
+}
+
+/** 鏇存柊閲囪喘璁″垝 */
+export function updatePurchasePlan(data: ErpPurchasePlanApi.PurchasePlan) {
+ return requestClient.put('/erp/purchase-plan/update', data);
+}
+
+/** 鎻愪氦閲囪喘璁″垝瀹℃壒 */
+export function submitPurchasePlan(id: number, processDefinitionKey: string) {
+ return requestClient.put('/erp/purchase-plan/submit', null, {
+ params: { id, processDefinitionKey },
+ });
+}
+
+/** 鏍规嵁搴撳瓨棰勮鐢熸垚閲囪喘璁″垝 */
+export function generatePlanFromStockAlert(params: { name?: string; supplierId?: number }) {
+ return requestClient.post<number>('/erp/purchase-plan/generate-from-stock-alert', null, {
+ params,
+ });
+}
+
+/** 鐢熸垚閲囪喘鐢宠 */
+export function generatePurchaseRequests(id: number) {
+ return requestClient.post<number[]>('/erp/purchase-plan/generate-requests', null, {
+ params: { id },
+ });
+}
+
+/** 鍒犻櫎閲囪喘璁″垝 */
+export function deletePurchasePlan(ids: number[]) {
+ return requestClient.delete('/erp/purchase-plan/delete', { params: { ids: ids.join(',') } });
+}
+
+/** 鑾峰彇閲囪喘璁″垝璇︽儏 */
+export function getPurchasePlan(id: number) {
+ return requestClient.get<ErpPurchasePlanApi.PurchasePlan>(
+ `/erp/purchase-plan/get?id=${id}`,
+ );
+}
+
+/** 鑾峰彇閲囪喘璁″垝鍒嗛〉 */
+export function getPurchasePlanPage(params: PageParam) {
+ return requestClient.get<PageResult<ErpPurchasePlanApi.PurchasePlan>>(
+ '/erp/purchase-plan/page',
+ { params },
+ );
+}
+
+/** 瀵煎嚭閲囪喘璁″垝 Excel */
+export function exportPurchasePlan(params: any) {
+ return requestClient.download('/erp/purchase-plan/export-excel', { params });
+}
+
+/** 鑾峰彇瀹℃壒娴佺▼鍒楄〃 */
+export function getApproveProcessList(id: number) {
+ return requestClient.get(`/erp/purchase-plan/approve-process-list`, { params: { id } });
+}
--
Gitblit v1.9.3