From c819024e241b9f7c54cc3786373ad0d2998f2190 Mon Sep 17 00:00:00 2001
From: 马宇豪 <978517621@qq.com>
Date: 星期五, 05 五月 2023 08:55:46 +0800
Subject: [PATCH] 修改

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

diff --git a/src/views/majorHazardSourceMonitoring/instrumentData/index.vue b/src/views/majorHazardSourceMonitoring/instrumentData/index.vue
index c28761d..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">
@@ -159,7 +145,7 @@
         <el-button type="primary" class="btns" @click="AddelementManagement()"
         >确 定</el-button
         >
-        <el-button @click="dialogVisible = false">取 消</el-button>
+        <el-button @click="cancel()">取 消</el-button>
       </span>
         </el-dialog>
     </div>
@@ -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() {
@@ -485,7 +473,7 @@
                                         title: "成功",
                                     });
                                 } else {
-                                    his.$message({
+                                    this.$message({
                                         type: "warning",
                                         message: res.data.message,
                                     });
@@ -494,6 +482,10 @@
                         }
                     }
                 });
+            },
+            cancel(){
+                this.elementManagementL();
+                this.dialogVisible = false
             },
             deleteById(val) {
                 this.$confirm('确认删除吗','提示', {
@@ -511,6 +503,11 @@
                                    type: "success",
                                    duration: 2000,
                                });
+                           }else {
+                               this.$message({
+                                   type: "warning",
+                                   message: res.data.message,
+                               });
                            }
                        });
                     })

--
Gitblit v1.9.2