From 04031b86d12c54dad59ebca8819f03479e87924f Mon Sep 17 00:00:00 2001
From: zhoucong <123456>
Date: 星期五, 22 四月 2022 15:25:56 +0800
Subject: [PATCH] fix

---
 src/views/majorHazardSourceMonitoring/instrumentData/index.vue |   49 +++++++++++++++++++++++++------------------------
 1 files changed, 25 insertions(+), 24 deletions(-)

diff --git a/src/views/majorHazardSourceMonitoring/instrumentData/index.vue b/src/views/majorHazardSourceMonitoring/instrumentData/index.vue
index 6e76326..fecc456 100644
--- a/src/views/majorHazardSourceMonitoring/instrumentData/index.vue
+++ b/src/views/majorHazardSourceMonitoring/instrumentData/index.vue
@@ -7,27 +7,12 @@
                         <el-input v-model="listQuery.filter.equipmentName" clearable></el-input>
                     </el-form-item>
                 </el-col>
-                <el-col :span="8" style="text-align: center">
-                    <el-button type="primary" icon="el-icon-search" @click="find()" class="btns"
-                    >搜索</el-button
-                    >
-                    <el-button
-                        type="primary"
-                        icon="el-icon-plus"
-                        class="btns"
-                        @click="handleClick('', '新增')"
-                    >新增</el-button
-                    >
-                    <el-button
-                        type="primary"
-                        icon="el-icon-plus"
-                        class="btns"
-                        @click="importData()"
-                    >导入</el-button
-                    >
-                    <el-button type="primary" icon="el-icon-refresh" @click="reset()" class="btns"
-                    >重置</el-button
-                    >
+                <el-col :span="10" style="text-align: center">
+                    <el-button type="primary" icon="el-icon-search" @click="find()" class="btns">搜索</el-button>
+                    <el-button type="primary" icon="el-icon-refresh" @click="reset()" class="btns">重置</el-button>
+                    <el-button type="primary" icon="el-icon-plus" class="btns" @click="handleClick('', '新增')">新增</el-button>
+                    <el-button type="primary" icon="el-icon-plus" class="btns" @click="importData()">导入</el-button>
+                    <el-button type="primary"  class="btns" @click="exportTemplate()">下载导入模板</el-button>
                 </el-col>
             </el-row>
         </el-form>
@@ -85,6 +70,7 @@
         <el-dialog
             :title="title"
             :visible.sync="dialogVisible"
+            :close-on-click-modal="false"
             width="40%"
         >
             <el-form ref="form" :rules="rules" :model="form" label-width="120px">
@@ -174,6 +160,7 @@
     } from "@/api/majorEquipmentData.js";
     import { majorEquipmentErt } from "@/api/majorEquipment.js";
     import XLSX from 'xlsx'
+    const exampleFile = require('@/assets/example/instrumentData.xlsx')
     export default {
         data() {
             return {
@@ -241,6 +228,9 @@
             this.initMajorEquipment()
         },
         methods: {
+            exportTemplate(){
+                window.open(exampleFile, '_blank')
+            },
 
             importData(){
                 let input = document.createElement('input'); input.type = 'file';
@@ -447,9 +437,7 @@
                     };
                 } else {
                     this.title = "编辑";
-                    this.form = value;
-                    console.log(123,this.form)
-                    console.log(222,this.equipmentName)
+                    this.form=JSON.parse(JSON.stringify(value));
                 }
             },
             AddelementManagement() {
@@ -467,6 +455,10 @@
                                         title: "成功",
                                     });
                                 } else {
+                                    this.$message({
+                                        type: "warning",
+                                        message: res.data.message,
+                                    });
                                 }
                             });
                         } else {
@@ -481,6 +473,10 @@
                                         title: "成功",
                                     });
                                 } else {
+                                    this.$message({
+                                        type: "warning",
+                                        message: res.data.message,
+                                    });
                                 }
                             });
                         }
@@ -507,6 +503,11 @@
                                    type: "success",
                                    duration: 2000,
                                });
+                           }else {
+                               this.$message({
+                                   type: "warning",
+                                   message: res.data.message,
+                               });
                            }
                        });
                     })

--
Gitblit v1.9.2