From 29be8639dc16b5d82bddc6099b1fa5cdca75f77a Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期二, 20 十月 2026 16:28:22 +0800
Subject: [PATCH] feat(import): 统一导入弹框与模板,修复模板日期格式及上传报错

---
 src/views/CNAS/systemManagement/measuresDealRisks/components/hazardIdentificationRiskAssessment.vue |   17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/src/views/CNAS/systemManagement/measuresDealRisks/components/hazardIdentificationRiskAssessment.vue b/src/views/CNAS/systemManagement/measuresDealRisks/components/hazardIdentificationRiskAssessment.vue
index bf5817a..b4af08b 100644
--- a/src/views/CNAS/systemManagement/measuresDealRisks/components/hazardIdentificationRiskAssessment.vue
+++ b/src/views/CNAS/systemManagement/measuresDealRisks/components/hazardIdentificationRiskAssessment.vue
@@ -6,10 +6,7 @@
         <el-button type="primary" size="small" @click="addFun">鏂� 澧�</el-button>
         <el-button type="primary" size="small" @click="approvalFun">瀹� 鎵�</el-button>
         <el-button type="primary" size="small" @click="approveFun">鎵� 鍑�</el-button>
-        <el-upload style="display: inline-block; padding: 0 6px" :headers="uploadHeader" :action="action"
-          :on-error="onError" :show-file-list="false" :on-success="onSuccess">
-          <el-button size="small" type="primary">瀵� 鍏�</el-button>
-        </el-upload>
+        <el-button size="small" type="primary" @click="$refs.importDialog.open()">瀵� 鍏�</el-button>
         <el-button size="small" @click="openDownloadDia">瀵煎嚭</el-button>
       </div>
     </div>
@@ -121,6 +118,16 @@
         <el-button type="primary" @click="addApi" :loading="loading">纭� 瀹�</el-button>
       </span></template>
     </el-dialog>
+    <import-dialog
+      ref="importDialog"
+      title="瀵煎叆鍗遍櫓鍥犵礌杈ㄨ瘑涓庨闄╄瘎浠�"
+      :action="action"
+      accept=".xls,.xlsx"
+      template-url="/import-templates/鍗遍櫓鍥犵礌杈ㄨ瘑涓庨闄╄瘎浠峰鍏ユā鏉�.xlsx"
+      template-name="鍗遍櫓鍥犵礌杈ㄨ瘑涓庨闄╄瘎浠峰鍏ユā鏉�.xlsx"
+      :tips="['鍓嶄袱琛屼负琛ㄥご锛屾暟鎹粠绗� 3 琛屽紑濮嬪~鍐�', '椋庨櫓璇勪环 L/E/C/D 闇�鍒嗗埆濉啓']"
+      @success="initData"
+    />
   </div>
 </template>
 
@@ -135,7 +142,9 @@
   exportHazardFactorIdentification,
 } from '@/api/cnas/systemManagement/measuresDealRisks.js'
 import { mapGetters } from "@/utils/store-compat";
+import ImportDialog from '@/components/ImportDialog/index.vue'
 export default {
+  components: { ImportDialog },
   data() {
     return {
       dialogVisible: false,

--
Gitblit v1.9.3