|
@@ -2,8 +2,12 @@
|
|
|
<template>
|
|
<template>
|
|
|
<div class="cbdbox">
|
|
<div class="cbdbox">
|
|
|
<div class="cbdboxs_search">
|
|
<div class="cbdboxs_search">
|
|
|
- <el-input v-model="idinput" placeholder="请输入设备ID"></el-input>
|
|
|
|
|
- <el-select v-model="trapvalue" placeholder="请选择所在监测点">
|
|
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-model="idinput"
|
|
|
|
|
+ placeholder="请输入诱捕器编号"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ ></el-input>
|
|
|
|
|
+ <el-select v-model="trapvalue" placeholder="请选择所在监测点" size="mini">
|
|
|
<el-option
|
|
<el-option
|
|
|
v-for="item in traponsoptions"
|
|
v-for="item in traponsoptions"
|
|
|
:key="item.point_id"
|
|
:key="item.point_id"
|
|
@@ -12,7 +16,11 @@
|
|
|
>
|
|
>
|
|
|
</el-option>
|
|
</el-option>
|
|
|
</el-select>
|
|
</el-select>
|
|
|
- <el-select v-model="versionsvalue" placeholder="请选择组织">
|
|
|
|
|
|
|
+ <!-- <el-select
|
|
|
|
|
+ v-model="versionsvalue"
|
|
|
|
|
+ placeholder="请选择隶属海关"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ >
|
|
|
<el-option
|
|
<el-option
|
|
|
v-for="item in versionsoptions"
|
|
v-for="item in versionsoptions"
|
|
|
:key="item.org_id"
|
|
:key="item.org_id"
|
|
@@ -20,8 +28,22 @@
|
|
|
:value="item.org_id"
|
|
:value="item.org_id"
|
|
|
>
|
|
>
|
|
|
</el-option>
|
|
</el-option>
|
|
|
- </el-select>
|
|
|
|
|
- <el-select v-model="inoffvalue" placeholder="请选择诱捕器状态">
|
|
|
|
|
|
|
+ </el-select> -->
|
|
|
|
|
+ <el-cascader
|
|
|
|
|
+ :change-on-select="true"
|
|
|
|
|
+ :options="versionsoptions"
|
|
|
|
|
+ v-model="versionsvalue"
|
|
|
|
|
+ :props="defaultParams"
|
|
|
|
|
+ :clearable="true"
|
|
|
|
|
+ @change="cascaderchange"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ placeholder="请选择隶属海关"
|
|
|
|
|
+ ></el-cascader>
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ v-model="inoffvalue"
|
|
|
|
|
+ placeholder="请选择诱捕器状态"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ >
|
|
|
<el-option
|
|
<el-option
|
|
|
v-for="item in inoffoptions"
|
|
v-for="item in inoffoptions"
|
|
|
:key="item.value"
|
|
:key="item.value"
|
|
@@ -30,11 +52,23 @@
|
|
|
>
|
|
>
|
|
|
</el-option>
|
|
</el-option>
|
|
|
</el-select>
|
|
</el-select>
|
|
|
- <el-button type="info" @click="search">搜索</el-button>
|
|
|
|
|
- <el-button>重置</el-button>
|
|
|
|
|
- <el-button type="info">添加诱捕器</el-button>
|
|
|
|
|
- <el-button type="info">批量导入诱捕器</el-button>
|
|
|
|
|
- <el-button type="info">导出数据</el-button>
|
|
|
|
|
|
|
+ <el-button type="info" @click="search" size="mini">搜索</el-button>
|
|
|
|
|
+ <el-button size="mini" @click="reset">重置</el-button>
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ type="info"
|
|
|
|
|
+ @click="
|
|
|
|
|
+ addtraptf = true;
|
|
|
|
|
+ parameter = 'add';
|
|
|
|
|
+ "
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ >添加诱捕器</el-button
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-button type="info" @click="downloadtf = true" size="mini"
|
|
|
|
|
+ >批量导入诱捕器</el-button
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-button type="info" size="mini" @click="deriveVisible = true"
|
|
|
|
|
+ >导出数据</el-button
|
|
|
|
|
+ >
|
|
|
</div>
|
|
</div>
|
|
|
<div class="cbdboxs_table" v-loading="loading">
|
|
<div class="cbdboxs_table" v-loading="loading">
|
|
|
<el-table :data="tableData" style="width: 100%" :stripe="true">
|
|
<el-table :data="tableData" style="width: 100%" :stripe="true">
|
|
@@ -49,19 +83,34 @@
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
<el-table-column prop="is_online" label="状态">
|
|
<el-table-column prop="is_online" label="状态">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
- <p>·{{ scope.row.trap_status == "1" ? "正常" : "停用" }}</p>
|
|
|
|
|
|
|
+ <div class="state">
|
|
|
|
|
+ <p
|
|
|
|
|
+ :style="{
|
|
|
|
|
+ color: scope.row.trap_status == '1' ? '#30A031 ' : 'red',
|
|
|
|
|
+ }"
|
|
|
|
|
+ >
|
|
|
|
|
+ ·
|
|
|
|
|
+ </p>
|
|
|
|
|
+ <p
|
|
|
|
|
+ :style="{
|
|
|
|
|
+ color: scope.row.trap_status == '1' ? '#30A031 ' : 'red',
|
|
|
|
|
+ }"
|
|
|
|
|
+ >
|
|
|
|
|
+ {{ scope.row.trap_status == "1" ? "正常" : "停用" }}
|
|
|
|
|
+ </p>
|
|
|
|
|
+ </div>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
<el-table-column label="操作" width="300">
|
|
<el-table-column label="操作" width="300">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
<span
|
|
<span
|
|
|
style="color: #409eff; margin-right: 5px"
|
|
style="color: #409eff; margin-right: 5px"
|
|
|
- @click="viewPhotoDialog(scope.row)"
|
|
|
|
|
|
|
+ @click="addtrap(scope.row)"
|
|
|
>编辑</span
|
|
>编辑</span
|
|
|
>
|
|
>
|
|
|
<span
|
|
<span
|
|
|
style="color: #409eff; margin-right: 5px"
|
|
style="color: #409eff; margin-right: 5px"
|
|
|
- @click="showTimeControlDialog(scope.row)"
|
|
|
|
|
|
|
+ @click="deletes(scope.row)"
|
|
|
>删除</span
|
|
>删除</span
|
|
|
>
|
|
>
|
|
|
</template>
|
|
</template>
|
|
@@ -75,6 +124,139 @@
|
|
|
@current-change="pageChange"
|
|
@current-change="pageChange"
|
|
|
>
|
|
>
|
|
|
</el-pagination>
|
|
</el-pagination>
|
|
|
|
|
+ <el-dialog :title="addtitle" :visible.sync="addtraptf" width="30%" @close="resetForm('ruleForm')">
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <el-form
|
|
|
|
|
+ :model="ruleForm"
|
|
|
|
|
+ :rules="rules"
|
|
|
|
|
+ ref="ruleForm"
|
|
|
|
|
+ label-width="100px"
|
|
|
|
|
+ class="demo-ruleForm"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-form-item label="诱捕器编号" prop="trap_number">
|
|
|
|
|
+ <el-input v-model="ruleForm.trap_number"></el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="addtrapbox">
|
|
|
|
|
+ <el-form-item label="所在纬度" prop="lng">
|
|
|
|
|
+ <el-input v-model="ruleForm.lng"></el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="所在纬度" prop="lat">
|
|
|
|
|
+ <el-input v-model="ruleForm.lat"></el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <el-form-item label="隶属海关" prop="org_id">
|
|
|
|
|
+ <!-- <el-select v-model="ruleForm.org_id" placeholder="请选择隶属海关">
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="item in versionsoptions"
|
|
|
|
|
+ :label="item.org_name"
|
|
|
|
|
+ :value="item.org_id"
|
|
|
|
|
+ :key="item.org_id"
|
|
|
|
|
+ ></el-option>
|
|
|
|
|
+ </el-select> -->
|
|
|
|
|
+ <el-cascader
|
|
|
|
|
+ :change-on-select="true"
|
|
|
|
|
+ v-model="ruleForm.org_id"
|
|
|
|
|
+ :options="versionsoptions"
|
|
|
|
|
+ :props="defaultParams"
|
|
|
|
|
+ :clearable="true"
|
|
|
|
|
+ placeholder="请选择隶属海关"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ ></el-cascader>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="所在监测点" prop="point_id">
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ v-model="ruleForm.point_id"
|
|
|
|
|
+ placeholder="请选择所在监测点"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="item in traponsoptions"
|
|
|
|
|
+ :label="item.point_name"
|
|
|
|
|
+ :value="item.point_id"
|
|
|
|
|
+ :key="item.point_id"
|
|
|
|
|
+ ></el-option>
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="诱剂名称" prop="inducer_id">
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ v-model="ruleForm.inducer_id"
|
|
|
|
|
+ placeholder="请选择诱剂名称"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="item in inducer_data"
|
|
|
|
|
+ :label="item.inducer_name"
|
|
|
|
|
+ :value="item.inducer"
|
|
|
|
|
+ :key="item.inducer"
|
|
|
|
|
+ ></el-option>
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="设备状态" prop="trap_status">
|
|
|
|
|
+ <el-radio-group
|
|
|
|
|
+ v-model="ruleForm.trap_status"
|
|
|
|
|
+ placeholder="请选择设备状态"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-radio label="1">正常</el-radio>
|
|
|
|
|
+ <el-radio label="0">停用</el-radio>
|
|
|
|
|
+ </el-radio-group>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-form>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
|
|
+ <el-button @click="resetForm('ruleForm')" size="mini">取 消</el-button>
|
|
|
|
|
+ <el-button type="primary" @click="submitForm('ruleForm')" size="mini"
|
|
|
|
|
+ >确 定</el-button
|
|
|
|
|
+ >
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </el-dialog>
|
|
|
|
|
+ <el-dialog title="提示" :visible.sync="downloadtf" width="25%">
|
|
|
|
|
+ <div class="downloadbox">
|
|
|
|
|
+ <div class="downloadbox_item">
|
|
|
|
|
+ <p class="title">导入诱捕器</p>
|
|
|
|
|
+ <!-- <el-input placeholder="请输入内容" v-model="input1">
|
|
|
|
|
+ <template slot="prepend">Http://</template>
|
|
|
|
|
+ </el-input> -->
|
|
|
|
|
+ <el-upload
|
|
|
|
|
+ action=""
|
|
|
|
|
+ :auto-upload="false"
|
|
|
|
|
+ accept=".xlsx, .xls"
|
|
|
|
|
+ :show-file-list="false"
|
|
|
|
|
+ :on-change="handle"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-button type="success" size="mini">点击上传</el-button>
|
|
|
|
|
+ </el-upload>
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-model="downloadinput"
|
|
|
|
|
+ placeholder="请输入内容"
|
|
|
|
|
+ :disabled="true"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ ></el-input>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <p class="tishi">
|
|
|
|
|
+ <span>注:请先下模板,在模板中填入数据上传</span
|
|
|
|
|
+ ><span @click="download">下载模板</span>
|
|
|
|
|
+ </p>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <!-- <span slot="footer" class="dialog-footer">
|
|
|
|
|
+ <el-button @click="downloadtf = false">取 消</el-button>
|
|
|
|
|
+ <el-button type="primary" @click="downloadtf = false">确 定</el-button>
|
|
|
|
|
+ </span> -->
|
|
|
|
|
+ </el-dialog>
|
|
|
|
|
+ <el-dialog title="提示" :visible.sync="deriveVisible" width="30%">
|
|
|
|
|
+ <div class="derivebox">
|
|
|
|
|
+ <p><span>*</span>文件名称:</p>
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-model="derivefilename"
|
|
|
|
|
+ placeholder="请输入文件名称"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ ></el-input>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
|
|
+ <el-button @click="deriveVisible = false" size="mini">取 消</el-button>
|
|
|
|
|
+ <el-button type="primary" @click="deriveclick" size="mini"
|
|
|
|
|
+ >确 定</el-button
|
|
|
|
|
+ >
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -86,6 +268,20 @@ export default {
|
|
|
components: {},
|
|
components: {},
|
|
|
data() {
|
|
data() {
|
|
|
//这里存放数据
|
|
//这里存放数据
|
|
|
|
|
+ var checkname = (rule, value, callback) => {
|
|
|
|
|
+ if (/^[A-Za-z0-9\u4e00-\u9fa5]+$/.test(value)) {
|
|
|
|
|
+ callback();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ callback(new Error("请输入非中文格式"));
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+ var checklnglat = (rule, value, callback) => {
|
|
|
|
|
+ if (isNaN(value)) {
|
|
|
|
|
+ callback(new Error("请输入数字值"));
|
|
|
|
|
+ } else {
|
|
|
|
|
+ callback();
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
return {
|
|
return {
|
|
|
idinput: "",
|
|
idinput: "",
|
|
|
inoffvalue: "",
|
|
inoffvalue: "",
|
|
@@ -94,9 +290,16 @@ export default {
|
|
|
{ label: "正常", value: "1" },
|
|
{ label: "正常", value: "1" },
|
|
|
],
|
|
],
|
|
|
versionsvalue: "",
|
|
versionsvalue: "",
|
|
|
|
|
+ versionsvalue1: "", //组织id
|
|
|
versionsoptions: [], //组织
|
|
versionsoptions: [], //组织
|
|
|
|
|
+ defaultParams: {
|
|
|
|
|
+ label: "org_name",
|
|
|
|
|
+ value: "id",
|
|
|
|
|
+ children: "childrens",
|
|
|
|
|
+ },
|
|
|
trapvalue: "",
|
|
trapvalue: "",
|
|
|
traponsoptions: [], //监测点
|
|
traponsoptions: [], //监测点
|
|
|
|
|
+ inducer_data: [],
|
|
|
queryInfo: {
|
|
queryInfo: {
|
|
|
page: 1,
|
|
page: 1,
|
|
|
point_id: "", //监测点id
|
|
point_id: "", //监测点id
|
|
@@ -108,12 +311,65 @@ export default {
|
|
|
device_id: "",
|
|
device_id: "",
|
|
|
total: 10,
|
|
total: 10,
|
|
|
loading: false,
|
|
loading: false,
|
|
|
|
|
+ addtraptf: false, //增加诱捕器弹框
|
|
|
|
|
+ ruleForm: {
|
|
|
|
|
+ trap_id: "", //诱捕器id 修改时用到
|
|
|
|
|
+ trap_number: "", //诱捕器编号
|
|
|
|
|
+ lat: "", // 必传(string) 纬度
|
|
|
|
|
+ lng: "", // 必传(string) 经度
|
|
|
|
|
+ org_id: "", // 必传(string) 所属海关id
|
|
|
|
|
+ inducer_id: "", // 必传(string) 诱剂id
|
|
|
|
|
+ point_id: "", // 必传(string) 所属监测点id
|
|
|
|
|
+ trap_status: "", // 必传(string) 设备状态0停用 1正常
|
|
|
|
|
+ },
|
|
|
|
|
+ rules: {
|
|
|
|
|
+ trap_number: [
|
|
|
|
|
+ { required: true, message: "请输入诱捕器编号", trigger: "blur" },
|
|
|
|
|
+ { validator: checkname, trigger: "blur" },
|
|
|
|
|
+ ],
|
|
|
|
|
+ lng: [
|
|
|
|
|
+ { required: true, message: "请输入经度", trigger: "blur" },
|
|
|
|
|
+ { validator: checklnglat, trigger: "blur" },
|
|
|
|
|
+ ],
|
|
|
|
|
+ lat: [
|
|
|
|
|
+ { required: true, message: "请输入纬度", trigger: "blur" },
|
|
|
|
|
+ { validator: checklnglat, trigger: "blur" },
|
|
|
|
|
+ ],
|
|
|
|
|
+ org_id: [
|
|
|
|
|
+ { required: true, message: "请选择隶属海关", trigger: "change" },
|
|
|
|
|
+ ],
|
|
|
|
|
+ point_id: [
|
|
|
|
|
+ { required: true, message: "请选择所在监测点", trigger: "change" },
|
|
|
|
|
+ ],
|
|
|
|
|
+ inducer_id: [
|
|
|
|
|
+ { required: true, message: "请选择诱剂名称", trigger: "change" },
|
|
|
|
|
+ ],
|
|
|
|
|
+ trap_status: [
|
|
|
|
|
+ { required: true, message: "请选择设备状态", trigger: "change" },
|
|
|
|
|
+ ],
|
|
|
|
|
+ },
|
|
|
|
|
+ parameter: "",
|
|
|
|
|
+ addtitle: "新增诱捕器",
|
|
|
|
|
+ downloadtf: false,
|
|
|
|
|
+ downloadinput: "", //上传的文件名
|
|
|
|
|
+ deriveVisible: false, //导出弹框
|
|
|
|
|
+ derivefilename: "", //导出文件名称
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
//监听属性 类似于data概念
|
|
//监听属性 类似于data概念
|
|
|
computed: {},
|
|
computed: {},
|
|
|
//监控data中的数据变化
|
|
//监控data中的数据变化
|
|
|
- watch: {},
|
|
|
|
|
|
|
+ watch: {
|
|
|
|
|
+ parameter: function (e) {
|
|
|
|
|
+ // console.log(e);
|
|
|
|
|
+ if (e == "add") {
|
|
|
|
|
+ // console.log(this.$data.addtitle)
|
|
|
|
|
+ this.$data.addtitle = "新增诱捕器";
|
|
|
|
|
+ } else if (e == "modify") {
|
|
|
|
|
+ this.$data.addtitle = "修改诱捕器";
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ },
|
|
|
//方法集合
|
|
//方法集合
|
|
|
methods: {
|
|
methods: {
|
|
|
getcbdlist() {
|
|
getcbdlist() {
|
|
@@ -144,19 +400,25 @@ export default {
|
|
|
//获取监测点列表 组织列表
|
|
//获取监测点列表 组织列表
|
|
|
this.$axios({
|
|
this.$axios({
|
|
|
method: "POST",
|
|
method: "POST",
|
|
|
- url: "/api/api_gateway?method=monitor_manage.trap_manage.trap_org",
|
|
|
|
|
|
|
+ url: "/api/api_gateway?method=sysmenage.usermanager.org_list",
|
|
|
}).then((res) => {
|
|
}).then((res) => {
|
|
|
console.log(res.data.data);
|
|
console.log(res.data.data);
|
|
|
- this.versionsoptions = res.data.data.org_data; //组织
|
|
|
|
|
|
|
+ this.versionsoptions = res.data.data.page_list; //组织
|
|
|
this.traponsoptions = res.data.data.point_data;
|
|
this.traponsoptions = res.data.data.point_data;
|
|
|
|
|
+ this.inducer_data = res.data.data.inducer_data;
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
|
|
+ cascaderchange(e) {
|
|
|
|
|
+ // console.log(this.versionsvalue, e);
|
|
|
|
|
+ console.log(e[e.length - 1]);
|
|
|
|
|
+ this.versionsvalue1 = e[e.length - 1];
|
|
|
|
|
+ },
|
|
|
search() {
|
|
search() {
|
|
|
this.queryInfo.point_id = this.trapvalue;
|
|
this.queryInfo.point_id = this.trapvalue;
|
|
|
this.queryInfo.trap_number = this.idinput;
|
|
this.queryInfo.trap_number = this.idinput;
|
|
|
- this.queryInfo.org_id = this.versionsvalue;
|
|
|
|
|
|
|
+ this.queryInfo.org_id = this.versionsvalue1;
|
|
|
this.queryInfo.trap_status = this.inoffvalue;
|
|
this.queryInfo.trap_status = this.inoffvalue;
|
|
|
- console.log(this.inoffvalue,this.versionsvalue,this.inoffvalue)
|
|
|
|
|
|
|
+ // console.log(this.inoffvalue, this.versionsvalue, this.inoffvalue);
|
|
|
this.getcbdlist();
|
|
this.getcbdlist();
|
|
|
},
|
|
},
|
|
|
pageChange(e) {
|
|
pageChange(e) {
|
|
@@ -164,6 +426,173 @@ export default {
|
|
|
this.queryInfo.page = e;
|
|
this.queryInfo.page = e;
|
|
|
this.getcbdlist();
|
|
this.getcbdlist();
|
|
|
},
|
|
},
|
|
|
|
|
+ submitForm(formName) {
|
|
|
|
|
+ console.log(this.ruleForm);
|
|
|
|
|
+ this.$refs[formName].validate((valid) => {
|
|
|
|
|
+ if (valid) {
|
|
|
|
|
+ this.$axios({
|
|
|
|
|
+ method: "POST",
|
|
|
|
|
+ url: "/api/api_gateway?method=monitor_manage.trap_manage.add_trap",
|
|
|
|
|
+ data: this.qs.stringify({
|
|
|
|
|
+ trap_id: this.ruleForm.trap_id, // 非必传(num) 诱捕器id 修改项
|
|
|
|
|
+ trap_number: this.ruleForm.trap_number, // 必传(string) 设备编号
|
|
|
|
|
+ lat: this.ruleForm.lat, // 必传(string) 纬度
|
|
|
|
|
+ lng: this.ruleForm.lng, // 必传(string) 经度
|
|
|
|
|
+ org_id: this.ruleForm.org_id[this.ruleForm.org_id.length - 1], // 必传(string) 所属海关id
|
|
|
|
|
+ inducer_id: this.ruleForm.inducer_id, // 必传(string) 诱剂id
|
|
|
|
|
+ point_id: this.ruleForm.point_id, // 必传(string) 所属监测点id
|
|
|
|
|
+ trap_status: this.ruleForm.trap_status, // 必传(string) 设备状态0停用 1正常
|
|
|
|
|
+ parameter: this.parameter,
|
|
|
|
|
+ }),
|
|
|
|
|
+ }).then((res) => {
|
|
|
|
|
+ console.log(res);
|
|
|
|
|
+ if (res.data.data) {
|
|
|
|
|
+ var message = "";
|
|
|
|
|
+ if (this.parameter == "add") {
|
|
|
|
|
+ // console.log(this.$data.addtitle)
|
|
|
|
|
+ message = "添加成功!";
|
|
|
|
|
+ } else if (this.parameter == "modify") {
|
|
|
|
|
+ message = "修改成功!";
|
|
|
|
|
+ }
|
|
|
|
|
+ this.$message({
|
|
|
|
|
+ showClose: true,
|
|
|
|
|
+ message: message,
|
|
|
|
|
+ type: "success",
|
|
|
|
|
+ });
|
|
|
|
|
+ this.addtraptf = false;
|
|
|
|
|
+ this.getcbdlist();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$message({
|
|
|
|
|
+ showClose: true,
|
|
|
|
|
+ message: "添加失败" + res.data.message,
|
|
|
|
|
+ type: "warning",
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$message({
|
|
|
|
|
+ message: "请将信息填写完全",
|
|
|
|
|
+ type: "warning",
|
|
|
|
|
+ });
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ resetForm(formName) {
|
|
|
|
|
+ this.addtraptf = false;
|
|
|
|
|
+ this.$refs[formName].resetFields();
|
|
|
|
|
+ },
|
|
|
|
|
+ addtrap(e) {
|
|
|
|
|
+ //增加诱捕器
|
|
|
|
|
+ console.log(e);
|
|
|
|
|
+ // this.
|
|
|
|
|
+ for (var key in this.ruleForm) {
|
|
|
|
|
+ this.ruleForm[key] = e[key];
|
|
|
|
|
+ }
|
|
|
|
|
+ this.ruleForm.trap_status = this.ruleForm.trap_status.toString();
|
|
|
|
|
+ this.parameter = "modify";
|
|
|
|
|
+ this.addtraptf = true;
|
|
|
|
|
+ },
|
|
|
|
|
+ deletes(events) {
|
|
|
|
|
+ //删除诱捕器
|
|
|
|
|
+ console.log(events);
|
|
|
|
|
+ var str = "您确定删除编号为<" + events.trap_number + ">的诱捕器吗?";
|
|
|
|
|
+ this.$confirm(str, "删除诱捕器", {
|
|
|
|
|
+ confirmButtonText: "确定",
|
|
|
|
|
+ cancelButtonText: "取消",
|
|
|
|
|
+ })
|
|
|
|
|
+ .then(() => {
|
|
|
|
|
+ this.$axios({
|
|
|
|
|
+ method: "POST",
|
|
|
|
|
+ url: "/api/api_gateway?method=monitor_manage.trap_manage.add_trap",
|
|
|
|
|
+ data: this.qs.stringify({
|
|
|
|
|
+ trap_id: events.trap_id,
|
|
|
|
|
+ parameter: "del",
|
|
|
|
|
+ }),
|
|
|
|
|
+ }).then((res) => {
|
|
|
|
|
+ console.log(res);
|
|
|
|
|
+ if (res.data.data) {
|
|
|
|
|
+ this.$message({
|
|
|
|
|
+ showClose: true,
|
|
|
|
|
+ message: "删除成功!",
|
|
|
|
|
+ type: "success",
|
|
|
|
|
+ });
|
|
|
|
|
+ this.getcbdlist();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$message({
|
|
|
|
|
+ showClose: true,
|
|
|
|
|
+ message: "删除失败," + res.data.message,
|
|
|
|
|
+ type: "warning",
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(() => {
|
|
|
|
|
+ this.$message({
|
|
|
|
|
+ type: "info",
|
|
|
|
|
+ message: "已取消删除",
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ handle(ev) {
|
|
|
|
|
+ this.downloadinput = ev.name;
|
|
|
|
|
+ var datas = new FormData();
|
|
|
|
|
+ datas.append("username", localStorage.getItem("usernme"));
|
|
|
|
|
+ datas.append("file", ev.raw);
|
|
|
|
|
+ this.$axios({
|
|
|
|
|
+ method: "POST",
|
|
|
|
|
+ url: "/api/trap_export",
|
|
|
|
|
+ data: datas,
|
|
|
|
|
+ responseType: "blob",
|
|
|
|
|
+ }).then((res) => {
|
|
|
|
|
+ console.log(res);
|
|
|
|
|
+ this.downloadFile(res, "allot_result.xls");
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ download() {
|
|
|
|
|
+ //下载模板
|
|
|
|
|
+ window.location.href =
|
|
|
|
|
+ // this.$deriveData +
|
|
|
|
|
+ "http://192.168.1.77:12345/api/trap_export";
|
|
|
|
|
+ },
|
|
|
|
|
+ downloadFile(res, name) {
|
|
|
|
|
+ let link = document.createElement("a");
|
|
|
|
|
+ link.href = window.URL.createObjectURL(new Blob([res.data]));
|
|
|
|
|
+ link.target = "_blank";
|
|
|
|
|
+ //文件名和格式
|
|
|
|
|
+ link.download = name;
|
|
|
|
|
+ document.body.appendChild(link);
|
|
|
|
|
+ link.click();
|
|
|
|
|
+ document.body.removeChild(link);
|
|
|
|
|
+ },
|
|
|
|
|
+ deriveclick() {
|
|
|
|
|
+ // this.deriveVisible = false;
|
|
|
|
|
+ this.$axios({
|
|
|
|
|
+ method: "POST",
|
|
|
|
|
+ url: "api/trap_list_export",
|
|
|
|
|
+ data: this.qs.stringify({
|
|
|
|
|
+ trap_number: this.ruleForm.trap_number,
|
|
|
|
|
+ point_id: this.ruleForm.point_id,
|
|
|
|
|
+ org_id: this.ruleForm.org_id,
|
|
|
|
|
+ trap_status: this.ruleForm.trap_status,
|
|
|
|
|
+ file_name: this.derivefilename,
|
|
|
|
|
+ user: localStorage.getItem("usernme"),
|
|
|
|
|
+ }),
|
|
|
|
|
+ responseType: "blob",
|
|
|
|
|
+ }).then((res) => {
|
|
|
|
|
+ console.log(res);
|
|
|
|
|
+ this.downloadFile(res, this.derivefilename + ".xls");
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ reset() {
|
|
|
|
|
+ //重置
|
|
|
|
|
+ this.queryInfo.trap_number = "";
|
|
|
|
|
+ this.queryInfo.point_id = "";
|
|
|
|
|
+ this.queryInfo.org_id = "";
|
|
|
|
|
+ this.queryInfo.trap_status = "";
|
|
|
|
|
+ this.versionsvalue = []
|
|
|
|
|
+ this.getcbdlist();
|
|
|
|
|
+ },
|
|
|
},
|
|
},
|
|
|
beforeCreate() {}, //生命周期 - 创建之前
|
|
beforeCreate() {}, //生命周期 - 创建之前
|
|
|
//生命周期 - 创建完成(可以访问当前this实例)
|
|
//生命周期 - 创建完成(可以访问当前this实例)
|
|
@@ -185,7 +614,7 @@ export default {
|
|
|
.cbdboxs_search {
|
|
.cbdboxs_search {
|
|
|
display: flex;
|
|
display: flex;
|
|
|
justify-content: flex-start;
|
|
justify-content: flex-start;
|
|
|
- height: 40px;
|
|
|
|
|
|
|
+ // height: 40px;
|
|
|
.el-select {
|
|
.el-select {
|
|
|
width: 250px;
|
|
width: 250px;
|
|
|
margin-right: 15px;
|
|
margin-right: 15px;
|
|
@@ -194,6 +623,10 @@ export default {
|
|
|
width: 250px;
|
|
width: 250px;
|
|
|
margin-right: 15px;
|
|
margin-right: 15px;
|
|
|
}
|
|
}
|
|
|
|
|
+ .el-cascader {
|
|
|
|
|
+ width: 250px;
|
|
|
|
|
+ margin-right: 15px;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
.cbdboxs_table {
|
|
.cbdboxs_table {
|
|
|
margin-top: 15px;
|
|
margin-top: 15px;
|
|
@@ -202,6 +635,51 @@ export default {
|
|
|
background-color: #fafafa;
|
|
background-color: #fafafa;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ .state {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ p:first-child {
|
|
|
|
|
+ font-size: 40px;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+.addtrapbox {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+}
|
|
|
|
|
+.downloadbox {
|
|
|
|
|
+ .downloadbox_item {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ .title {
|
|
|
|
|
+ width: 100px;
|
|
|
|
|
+ line-height: 28px;
|
|
|
|
|
+ }
|
|
|
|
|
+ .el-input {
|
|
|
|
|
+ width: 250px;
|
|
|
|
|
+ margin-left: 15px;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ .tishi {
|
|
|
|
|
+ padding-left: 100px;
|
|
|
|
|
+ margin-top: 15px;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ justify-content: space-between;
|
|
|
|
|
+ color: #409eff;
|
|
|
|
|
+ span:last-child {
|
|
|
|
|
+ cursor: pointer;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+.derivebox {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ p {
|
|
|
|
|
+ width: 100px;
|
|
|
|
|
+ line-height: 28px;
|
|
|
|
|
+ span {
|
|
|
|
|
+ color: red;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ .el-input {
|
|
|
|
|
+ width: 250px;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
/deep/.el-button--info {
|
|
/deep/.el-button--info {
|
|
|
background-color: #409eff;
|
|
background-color: #409eff;
|