lyfO_o
2022-04-06 1cc4eb09ce38f1f0db114b7d3570f92ceaf1d470
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,
                               });
                           }
                       });
                    })