From fa061c4f157017cdf59e4357cbe182a0e1204ee7 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期三, 14 十月 2026 09:29:28 +0800
Subject: [PATCH] feat(crm-invoice): 新增开票Excel批量导入功能

---
 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 2dd9949..2c80419 100644
--- a/src/views/mes/qc/ipqc/index.vue
+++ b/src/views/mes/qc/ipqc/index.vue
@@ -12,9 +12,16 @@
 
 import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
 import { exportProductWord } from '#/api/mes/qc/indicatorresult';
-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 QcReportPrint from '#/views/mes/qc/components/qc-report-print.vue';
 
 import { useGridColumns, useGridFormSchema } from './data';
@@ -31,6 +38,11 @@
 });
 
 const printRef = ref<InstanceType<typeof QcReportPrint> | null>(null);
+
+const [ImportModal, importModalApi] = useVbenModal({
+  connectedComponent: QcImportFormModal,
+  destroyOnClose: true,
+});
 
 /** 鍒锋柊琛ㄦ牸 */
 function handleRefresh() {
@@ -49,6 +61,26 @@
     fileName: `浜у搧妫�楠屽崟-${row.code ?? row.id}.docx`,
     source: blob,
   });
+}
+
+/** 鎵归噺瀵煎叆杩囩▼妫�楠屽崟 */
+function handleImport() {
+  importModalApi
+    .setData({
+      title: '鎵归噺瀵煎叆杩囩▼妫�楠屽崟',
+      templateApi: importIpqcTemplate,
+      importApi: importIpqc,
+      fileName: '杩囩▼妫�楠屽崟瀵煎叆妯℃澘.xls',
+      hints: [
+        '浠呭厑璁稿鍏� xls銆亁lsx 鏍煎紡鏂囦欢锛涘繀濉垪锛氭楠屽崟鍚嶇О銆佷骇鍝佺墿鏂欑紪鐮併�佹壒鍙枫�佸悎鏍煎搧鏁伴噺銆佷笉鍚堟牸鍝佹暟閲忋��',
+        '銆屼骇鍝佺墿鏂欑紪鐮併�嶉渶涓庛�岀墿鏂欑鐞嗐�嶄腑鐨勭紪鐮佸畬鍏ㄤ竴鑷达紱銆屾壒鍙枫�嶄负蹇呭~锛屼笉鍏佽涓虹┖銆�',
+        '銆屾楠岀被鍨嬨�嶆寜瀛楀吀鍚嶇О濉啓锛堣嚜鍒跺伐搴忔楠� / 棣栨 / 宸℃ / 鑷 / 鎴愬搧妫�楠岋級锛涖�屾娴嬬粨鏋溿�嶆寜瀛楀吀鍚嶇О濉啓锛堟牎楠岄�氳繃 / 鏍¢獙涓嶉�氳繃锛夈��',
+        '鍚堟牸鍝佹暟閲� + 涓嶅悎鏍煎搧鏁伴噺 蹇呴』绛変簬銆屾娴嬫暟閲忋�嶏紙鐣欑┖鏃惰嚜鍔ㄥ彇涓よ�呬箣鍜岋級锛涘伐搴� + 鏂欏簾 + 鍏朵粬搴熷搧 涔嬪拰涓嶅緱瓒呰繃涓嶅悎鏍煎搧鏁伴噺銆�',
+        '銆岃川妫�鏂规銆嶅~鏂规鍚嶇О锛岀暀绌哄垯鎸夌墿鏂欒嚜鍔ㄥ尮閰� IPQC 鏂规锛涖�屾娴嬩汉鍛樸�嶇暀绌哄彇褰撳墠鐧诲綍鐢ㄦ埛锛涖�屾娴嬫棩鏈熴�嶅彲鐣欑┖銆�',
+        '閫愯瀵煎叆锛屽け璐ヨ涓嶅奖鍝嶆垚鍔熻锛涘鍏ュ悗鐨勬楠屽崟涓恒�屽緟妫�楠屻�嶇姸鎬侊紝鍙湪鍒楄〃涓户缁紪杈戙�佸綍鍏ユ娴嬬粨鏋溿��',
+      ],
+    })
+    .open();
 }
 
 /** 鍒涘缓杩囩▼妫�楠屽崟 */
@@ -128,6 +160,7 @@
     <FormModal @success="handleRefresh" />
     <ExportRangeModal />
     <QcReportPrint ref="printRef" />
+    <ImportModal @success="handleRefresh" />
     <Grid table-title="杩囩▼妫�楠屽崟鍒楄〃">
       <template #toolbar-tools>
         <TableAction
@@ -140,6 +173,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