|
@@ -7,8 +7,13 @@
|
|
|
placeholder="请输入诱捕器编号"
|
|
placeholder="请输入诱捕器编号"
|
|
|
size="mini"
|
|
size="mini"
|
|
|
></el-input>
|
|
></el-input>
|
|
|
- <el-select v-model="trapvalue" placeholder="请选择所在监测点" clearable
|
|
|
|
|
- @change="search" size="mini">
|
|
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ v-model="trapvalue"
|
|
|
|
|
+ placeholder="请选择所在监测点"
|
|
|
|
|
+ clearable
|
|
|
|
|
+ @change="search"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ >
|
|
|
<el-option
|
|
<el-option
|
|
|
v-for="item in traponsoptions"
|
|
v-for="item in traponsoptions"
|
|
|
:key="item.point_id"
|
|
:key="item.point_id"
|
|
@@ -59,15 +64,7 @@
|
|
|
</el-select>
|
|
</el-select>
|
|
|
<el-button type="info" @click="search" size="mini">搜索</el-button>
|
|
<el-button type="info" @click="search" size="mini">搜索</el-button>
|
|
|
<el-button size="mini" @click="reset">重置</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="openadd" size="mini">添加诱捕器</el-button>
|
|
|
<el-button type="info" @click="downloadtf = true" size="mini"
|
|
<el-button type="info" @click="downloadtf = true" size="mini"
|
|
|
>批量导入诱捕器</el-button
|
|
>批量导入诱捕器</el-button
|
|
|
>
|
|
>
|
|
@@ -165,6 +162,7 @@
|
|
|
:total="total"
|
|
:total="total"
|
|
|
:page-size="20"
|
|
:page-size="20"
|
|
|
@current-change="pageChange"
|
|
@current-change="pageChange"
|
|
|
|
|
+ :current-page="queryInfo.page"
|
|
|
>
|
|
>
|
|
|
</el-pagination>
|
|
</el-pagination>
|
|
|
</el-card>
|
|
</el-card>
|
|
@@ -188,13 +186,13 @@
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<div class="addtrapbox">
|
|
<div class="addtrapbox">
|
|
|
<el-form-item label="所在纬度" prop="lng">
|
|
<el-form-item label="所在纬度" prop="lng">
|
|
|
- <el-input v-model="ruleForm.lng"></el-input>
|
|
|
|
|
|
|
+ <el-input v-model="ruleForm.lng" @blur="latblur"></el-input>
|
|
|
<p style="height: 24px; padding-left: 16px">
|
|
<p style="height: 24px; padding-left: 16px">
|
|
|
{{ ToDegrees(ruleForm.lng, "lng") }}
|
|
{{ ToDegrees(ruleForm.lng, "lng") }}
|
|
|
</p>
|
|
</p>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item label="所在纬度" prop="lat">
|
|
<el-form-item label="所在纬度" prop="lat">
|
|
|
- <el-input v-model="ruleForm.lat"></el-input>
|
|
|
|
|
|
|
+ <el-input v-model="ruleForm.lat" @blur="latblur"></el-input>
|
|
|
<p style="height: 24px; padding-left: 16px">
|
|
<p style="height: 24px; padding-left: 16px">
|
|
|
{{ ToDegrees(ruleForm.lat, "lat") }}
|
|
{{ ToDegrees(ruleForm.lat, "lat") }}
|
|
|
</p>
|
|
</p>
|
|
@@ -205,6 +203,9 @@
|
|
|
>地图选点</el-button
|
|
>地图选点</el-button
|
|
|
>
|
|
>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <el-form-item label="所在城市" prop="basecity">
|
|
|
|
|
+ <el-input v-model="ruleForm.basecity" disabled style="width:217px"></el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="隶属海关" prop="org_id">
|
|
<el-form-item label="隶属海关" prop="org_id">
|
|
|
<!-- <el-select v-model="ruleForm.org_id" placeholder="请选择隶属海关">
|
|
<!-- <el-select v-model="ruleForm.org_id" placeholder="请选择隶属海关">
|
|
|
<el-option
|
|
<el-option
|
|
@@ -448,6 +449,7 @@ export default {
|
|
|
inducer_id: "", // 必传(string) 诱剂id
|
|
inducer_id: "", // 必传(string) 诱剂id
|
|
|
point_id: "", // 必传(string) 所属监测点id
|
|
point_id: "", // 必传(string) 所属监测点id
|
|
|
trap_status: "", // 必传(string) 设备状态0停用 1正常
|
|
trap_status: "", // 必传(string) 设备状态0停用 1正常
|
|
|
|
|
+ basecity:""
|
|
|
},
|
|
},
|
|
|
rules: {
|
|
rules: {
|
|
|
trap_number: [
|
|
trap_number: [
|
|
@@ -569,6 +571,7 @@ export default {
|
|
|
this.versionsvalue1 = e[e.length - 1];
|
|
this.versionsvalue1 = e[e.length - 1];
|
|
|
},
|
|
},
|
|
|
search() {
|
|
search() {
|
|
|
|
|
+ this.queryInfo.page = 1;
|
|
|
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.versionsvalue2;
|
|
this.queryInfo.org_id = this.versionsvalue2;
|
|
@@ -613,6 +616,7 @@ export default {
|
|
|
point_id: this.ruleForm.point_id, // 必传(string) 所属监测点id
|
|
point_id: this.ruleForm.point_id, // 必传(string) 所属监测点id
|
|
|
trap_status: this.ruleForm.trap_status, // 必传(string) 设备状态0停用 1正常
|
|
trap_status: this.ruleForm.trap_status, // 必传(string) 设备状态0停用 1正常
|
|
|
parameter: this.parameter,
|
|
parameter: this.parameter,
|
|
|
|
|
+ city:this.ruleForm.basecity
|
|
|
}),
|
|
}),
|
|
|
}).then((res) => {
|
|
}).then((res) => {
|
|
|
console.log(res);
|
|
console.log(res);
|
|
@@ -663,6 +667,11 @@ export default {
|
|
|
this.ruleForm[key] = "";
|
|
this.ruleForm[key] = "";
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+ openadd() {
|
|
|
|
|
+ this.addtraptf = true;
|
|
|
|
|
+ this.parameter = "add";
|
|
|
|
|
+ // console.log(this.ruleForm)
|
|
|
|
|
+ },
|
|
|
addtrap(e) {
|
|
addtrap(e) {
|
|
|
//增加诱捕器
|
|
//增加诱捕器
|
|
|
console.log(e);
|
|
console.log(e);
|
|
@@ -674,6 +683,8 @@ export default {
|
|
|
this.ruleForm.trap_status = this.ruleForm.trap_status.toString();
|
|
this.ruleForm.trap_status = this.ruleForm.trap_status.toString();
|
|
|
this.parameter = "modify";
|
|
this.parameter = "modify";
|
|
|
this.ruleForm.org_id = [];
|
|
this.ruleForm.org_id = [];
|
|
|
|
|
+ console.log(this.ruleForm)
|
|
|
|
|
+ this.city(e.lat,e.lng)
|
|
|
this.getmon3(e);
|
|
this.getmon3(e);
|
|
|
},
|
|
},
|
|
|
getmon3(e) {
|
|
getmon3(e) {
|
|
@@ -687,9 +698,9 @@ export default {
|
|
|
// console.log(res.data.data);
|
|
// console.log(res.data.data);
|
|
|
var orgdatas = res.data.data;
|
|
var orgdatas = res.data.data;
|
|
|
for (var i = 0; i < e.org_list.length; i++) {
|
|
for (var i = 0; i < e.org_list.length; i++) {
|
|
|
- var arr = [e.org_list[i].org_id];
|
|
|
|
|
- this.ruleForm.org_id.push(arr);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ var arr = [e.org_list[i].org_id];
|
|
|
|
|
+ this.ruleForm.org_id.push(arr);
|
|
|
|
|
+ }
|
|
|
if (orgdatas.length != 0) {
|
|
if (orgdatas.length != 0) {
|
|
|
for (var i = 0; i < orgdatas.length; i++) {
|
|
for (var i = 0; i < orgdatas.length; i++) {
|
|
|
if (orgdatas[i].length != 0) {
|
|
if (orgdatas[i].length != 0) {
|
|
@@ -753,7 +764,7 @@ export default {
|
|
|
handle(ev) {
|
|
handle(ev) {
|
|
|
this.downloadinput = ev.name;
|
|
this.downloadinput = ev.name;
|
|
|
var datas = new FormData();
|
|
var datas = new FormData();
|
|
|
- var username = localStorage.getItem("username")
|
|
|
|
|
|
|
+ var username = localStorage.getItem("username");
|
|
|
datas.append("username", username);
|
|
datas.append("username", username);
|
|
|
datas.append("file", ev.raw);
|
|
datas.append("file", ev.raw);
|
|
|
this.$axios({
|
|
this.$axios({
|
|
@@ -806,7 +817,7 @@ export default {
|
|
|
org_id: this.ruleForm.org_id,
|
|
org_id: this.ruleForm.org_id,
|
|
|
trap_status: this.ruleForm.trap_status,
|
|
trap_status: this.ruleForm.trap_status,
|
|
|
file_name: this.derivefilename,
|
|
file_name: this.derivefilename,
|
|
|
- user: localStorage.getItem("usernme"),
|
|
|
|
|
|
|
+ user: localStorage.getItem("username"),
|
|
|
}),
|
|
}),
|
|
|
responseType: "blob",
|
|
responseType: "blob",
|
|
|
}).then((res) => {
|
|
}).then((res) => {
|
|
@@ -826,6 +837,7 @@ export default {
|
|
|
this.queryInfo.trap_status = "";
|
|
this.queryInfo.trap_status = "";
|
|
|
this.versionsvalue2 = "";
|
|
this.versionsvalue2 = "";
|
|
|
this.versionsvalue = [];
|
|
this.versionsvalue = [];
|
|
|
|
|
+ this.queryInfo.page = 1
|
|
|
this.getcbdlist();
|
|
this.getcbdlist();
|
|
|
},
|
|
},
|
|
|
init() {
|
|
init() {
|
|
@@ -906,12 +918,14 @@ export default {
|
|
|
this.ruleForm.lng = this.locationForm.lng;
|
|
this.ruleForm.lng = this.locationForm.lng;
|
|
|
this.ruleForm.lat = this.locationForm.lat;
|
|
this.ruleForm.lat = this.locationForm.lat;
|
|
|
this.addLocationDialogVisible = false;
|
|
this.addLocationDialogVisible = false;
|
|
|
|
|
+ this.city(this.ruleForm.lat,this.ruleForm.lng)
|
|
|
},
|
|
},
|
|
|
addLocationDialogClosed() {
|
|
addLocationDialogClosed() {
|
|
|
//弹框关闭时
|
|
//弹框关闭时
|
|
|
// this.locationForm = { lat: "", lng: "" };
|
|
// this.locationForm = { lat: "", lng: "" };
|
|
|
this.center = [114.05, 22.55];
|
|
this.center = [114.05, 22.55];
|
|
|
this.map = null;
|
|
this.map = null;
|
|
|
|
|
+
|
|
|
},
|
|
},
|
|
|
locationSearch() {
|
|
locationSearch() {
|
|
|
if (this.locationForm.lat && this.locationForm.lng) {
|
|
if (this.locationForm.lat && this.locationForm.lng) {
|
|
@@ -1016,6 +1030,32 @@ export default {
|
|
|
}
|
|
}
|
|
|
this.content = str;
|
|
this.content = str;
|
|
|
},
|
|
},
|
|
|
|
|
+ city(lat,lng) {
|
|
|
|
|
+ $.ajax({
|
|
|
|
|
+ url: "https://restapi.amap.com/v3/geocode/regeo",
|
|
|
|
|
+ type: "get",
|
|
|
|
|
+ dataType: "jsonp",
|
|
|
|
|
+ data: this.qs.stringify({
|
|
|
|
|
+ location: lng + "," + lat,
|
|
|
|
|
+ key: "78ce288400f4fc6d9458989875c833c2",
|
|
|
|
|
+ extensions: "base",
|
|
|
|
|
+ }),
|
|
|
|
|
+ success: (res)=> {
|
|
|
|
|
+ console.log(res);
|
|
|
|
|
+ this.ruleForm.basecity = res.regeocode.addressComponent.city
|
|
|
|
|
+ console.log(this.ruleForm)
|
|
|
|
|
+ },
|
|
|
|
|
+ error: function (err) {
|
|
|
|
|
+ alert("服务端错误,请刷新浏览器后重试")
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ // return arr;
|
|
|
|
|
+ },
|
|
|
|
|
+ latblur(){
|
|
|
|
|
+ if(this.ruleForm.lat!=""&&this.ruleForm.lng!=""){
|
|
|
|
|
+ this.city(this.ruleForm.lat,this.ruleForm.lng)
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
beforeCreate() {}, //生命周期 - 创建之前
|
|
beforeCreate() {}, //生命周期 - 创建之前
|
|
|
//生命周期 - 创建完成(可以访问当前this实例)
|
|
//生命周期 - 创建完成(可以访问当前this实例)
|