From 8fa692c8c6693d9f8833c58ce84f6b61f6b6610e Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期六, 10 十月 2026 23:09:56 +0800
Subject: [PATCH] feat: 导入 添加导入按钮

---
 src/views/mes/qc/ipqc/index.vue |   42 +++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 41 insertions(+), 1 deletions(-)

diff --git a/src/views/mes/qc/ipqc/index.vue b/src/views/mes/qc/ipqc/index.vue
index 2d47360..786c402 100644
--- a/src/views/mes/qc/ipqc/index.vue
+++ b/src/views/mes/qc/ipqc/index.vue
@@ -8,9 +8,16 @@
 import { Button, message } from 'ant-design-vue';
 
 import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
-import { deleteIpqc, exportIpqc, getIpqcPage } from '#/api/mes/qc/ipqc';
+import {
+  deleteIpqc,
+  exportIpqc,
+  getIpqcPage,
+  importIpqc,
+  importIpqcTemplate,
+} from '#/api/mes/qc/ipqc';
 import { $t } from '#/locales';
 import QcExportRangeModal from '#/views/mes/qc/components/export-range-modal.vue';
+import QcImportFormModal from '#/views/mes/qc/components/import-form-modal.vue';
 import QcReportGenerateModal from '#/views/mes/qc/components/report-generate-modal.vue';
 
 import { useGridColumns, useGridFormSchema } from './data';
@@ -34,9 +41,34 @@
   destroyOnClose: true,
 });
 
+const [ImportModal, importModalApi] = useVbenModal({
+  connectedComponent: QcImportFormModal,
+  destroyOnClose: true,
+});
+
 /** 鍒锋柊琛ㄦ牸 */
 function handleRefresh() {
   gridApi.query();
+}
+
+/** 鎵归噺瀵煎叆杩囩▼妫�楠屽崟 */
+function handleImport() {
+  importModalApi
+    .setData({
+      title: '鎵归噺瀵煎叆杩囩▼妫�楠屽崟',
+      templateApi: importIpqcTemplate,
+      importApi: importIpqc,
+      fileName: '杩囩▼妫�楠屽崟瀵煎叆妯℃澘.xls',
+      hints: [
+        '浠呭厑璁稿鍏� xls銆亁lsx 鏍煎紡鏂囦欢锛涘繀濉垪锛氭楠屽崟鍚嶇О銆佷骇鍝佺墿鏂欑紪鐮併�佹壒鍙枫�佸悎鏍煎搧鏁伴噺銆佷笉鍚堟牸鍝佹暟閲忋��',
+        '銆屼骇鍝佺墿鏂欑紪鐮併�嶉渶涓庛�岀墿鏂欑鐞嗐�嶄腑鐨勭紪鐮佸畬鍏ㄤ竴鑷达紱銆屾壒鍙枫�嶄负蹇呭~锛屼笉鍏佽涓虹┖銆�',
+        '銆屾楠岀被鍨嬨�嶆寜瀛楀吀鍚嶇О濉啓锛堣嚜鍒跺伐搴忔楠� / 棣栨 / 宸℃ / 鑷 / 鎴愬搧妫�楠岋級锛涖�屾娴嬬粨鏋溿�嶆寜瀛楀吀鍚嶇О濉啓锛堟牎楠岄�氳繃 / 鏍¢獙涓嶉�氳繃锛夈��',
+        '鍚堟牸鍝佹暟閲� + 涓嶅悎鏍煎搧鏁伴噺 蹇呴』绛変簬銆屾娴嬫暟閲忋�嶏紙鐣欑┖鏃惰嚜鍔ㄥ彇涓よ�呬箣鍜岋級锛涘伐搴� + 鏂欏簾 + 鍏朵粬搴熷搧 涔嬪拰涓嶅緱瓒呰繃涓嶅悎鏍煎搧鏁伴噺銆�',
+        '銆岃川妫�鏂规銆嶅~鏂规鍚嶇О锛岀暀绌哄垯鎸夌墿鏂欒嚜鍔ㄥ尮閰� IPQC 鏂规锛涖�屾娴嬩汉鍛樸�嶇暀绌哄彇褰撳墠鐧诲綍鐢ㄦ埛锛涖�屾娴嬫棩鏈熴�嶅彲鐣欑┖銆�',
+        '閫愯瀵煎叆锛屽け璐ヨ涓嶅奖鍝嶆垚鍔熻锛涘鍏ュ悗鐨勬楠屽崟涓恒�屽緟妫�楠屻�嶇姸鎬侊紝鍙湪鍒楄〃涓户缁紪杈戙�佸綍鍏ユ娴嬬粨鏋溿��',
+      ],
+    })
+    .open();
 }
 
 /** 鍒涘缓杩囩▼妫�楠屽崟 */
@@ -123,6 +155,7 @@
     <FormModal @success="handleRefresh" />
     <ExportRangeModal />
     <ReportModal />
+    <ImportModal @success="handleRefresh" />
     <Grid table-title="杩囩▼妫�楠屽崟鍒楄〃">
       <template #toolbar-tools>
         <TableAction
@@ -135,6 +168,13 @@
               onClick: handleCreate,
             },
             {
+              label: '鎵归噺瀵煎叆',
+              type: 'primary',
+              icon: ACTION_ICON.UPLOAD,
+              auth: ['mes:qc-ipqc:import'],
+              onClick: handleImport,
+            },
+            {
               label: $t('ui.actionTitle.export'),
               type: 'primary',
               icon: ACTION_ICON.DOWNLOAD,

--
Gitblit v1.9.3