From 4c735f93a04cd4609fb6b4fa2587154239835a86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E7=BA=A2=E5=85=B5?= <374362909@qq.com> Date: Tue, 3 Mar 2026 15:32:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/purchase/purchasingcategory.ts | 39 +++++++ src/hooks/usePurchaseRules.ts | 2 +- .../purchase/purchasingRuleConfig/index.vue | 1 + .../purchase/purchasingcategory/index.vue | 109 +++++++++++++----- .../purchase/purchasingrequisition/add.vue | 21 ++-- 5 files changed, 131 insertions(+), 41 deletions(-) diff --git a/src/api/purchase/purchasingcategory.ts b/src/api/purchase/purchasingcategory.ts index 88c13da..c11d60b 100644 --- a/src/api/purchase/purchasingcategory.ts +++ b/src/api/purchase/purchasingcategory.ts @@ -87,3 +87,42 @@ export function editObj(obj: any) { }); } +/** + * 下载导入模板 + */ +export function downloadTemplate() { + return request({ + url: '/purchase/purchasingcategory/import/template', + method: 'get', + responseType: 'blob' + }); +} + +/** + * 导入数据 + * @param file 文件对象 + */ +export function importData(file: File) { + const formData = new FormData(); + formData.append('file', file); + return request({ + url: '/purchase/purchasingcategory/import', + method: 'post', + data: formData, + headers: { + 'Content-Type': 'multipart/form-data' + } + }); +} + +/** + * 导出数据 + */ +export function exportData() { + return request({ + url: '/purchase/purchasingcategory/export', + method: 'get', + responseType: 'blob' + }); +} + diff --git a/src/hooks/usePurchaseRules.ts b/src/hooks/usePurchaseRules.ts index 395bd9f..bf855ee 100644 --- a/src/hooks/usePurchaseRules.ts +++ b/src/hooks/usePurchaseRules.ts @@ -67,7 +67,7 @@ export function usePurchaseRules() { const thresholds: Record = { deptPurchase: 50000, feasibility: 300000, - publicSelect: 400000, + publicSelect: 300000, govPurchase: 1000000 }; diff --git a/src/views/purchase/purchasingRuleConfig/index.vue b/src/views/purchase/purchasingRuleConfig/index.vue index b04bf47..831f8e4 100644 --- a/src/views/purchase/purchasingRuleConfig/index.vue +++ b/src/views/purchase/purchasingRuleConfig/index.vue @@ -32,6 +32,7 @@ + 既定规则请不要随意修改,否则会出错 新增 + + 下载模板 + + + + 导入 + + + + 导出 + @@ -93,20 +118,17 @@