|
|
@@ -544,6 +544,23 @@
|
|
|
<el-form-item label="设备名称" prop="device_name">
|
|
|
<el-input v-model="ruleForm.device_name"></el-input>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="已绑定海关" prop="oldorg_id">
|
|
|
+ <div class="haiguan">
|
|
|
+ <p
|
|
|
+ class="haiguan_item"
|
|
|
+ v-for="(item, index) in ruleForm.oldorg_id"
|
|
|
+ :key="item.id"
|
|
|
+ >
|
|
|
+ <span style="margin-right: 5px">{{ item.org_name }}</span>
|
|
|
+ <span style="font-size: 16px" @click="oldorgdelect(index)"
|
|
|
+ >×</span
|
|
|
+ >
|
|
|
+ </p>
|
|
|
+ <p v-if="ruleForm.oldorg_id.length == 0" class="haiguan_itemnone">
|
|
|
+ 暂无绑定
|
|
|
+ </p>
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="隶属海关" prop="org_id">
|
|
|
<el-cascader
|
|
|
:change-on-select="true"
|
|
|
@@ -587,7 +604,11 @@
|
|
|
>
|
|
|
</div>
|
|
|
<el-form-item label="所在城市" prop="basecity">
|
|
|
- <el-input v-model="ruleForm.basecity" disabled style="width:217px"></el-input>
|
|
|
+ <el-input
|
|
|
+ v-model="ruleForm.basecity"
|
|
|
+ disabled
|
|
|
+ style="width: 217px"
|
|
|
+ ></el-input>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</div>
|
|
|
@@ -787,7 +808,8 @@ export default {
|
|
|
lat: "",
|
|
|
device_name: "",
|
|
|
device_id: "",
|
|
|
- basecity:""
|
|
|
+ basecity: "",
|
|
|
+ oldorg_id: [],
|
|
|
},
|
|
|
rules: {
|
|
|
device_name: [
|
|
|
@@ -795,9 +817,9 @@ export default {
|
|
|
],
|
|
|
lng: [{ required: true, message: "请输入经度", trigger: "blur" }],
|
|
|
lat: [{ required: true, message: "请输入纬度", trigger: "blur" }],
|
|
|
- org_id: [
|
|
|
- { required: true, message: "请选择隶属海关", trigger: "change" },
|
|
|
- ],
|
|
|
+ // org_id: [
|
|
|
+ // { required: true, message: "请选择隶属海关", trigger: "change" },
|
|
|
+ // ],
|
|
|
point_id: [
|
|
|
{ required: true, message: "请选择所在监测点", trigger: "change" },
|
|
|
],
|
|
|
@@ -1109,10 +1131,13 @@ export default {
|
|
|
// this.ruleForm[key] = e[key];
|
|
|
// }
|
|
|
this.ruleForm.org_id = [];
|
|
|
- this.city(this.ruleForm.lat,this.ruleForm.lng)
|
|
|
- this.getmon3(item);
|
|
|
+ this.ruleForm.oldorg_id = item.org_list;
|
|
|
+ this.city(this.ruleForm.lat, this.ruleForm.lng);
|
|
|
+ // this.getmon3(item);
|
|
|
+ this.operationDialogVisible = true;
|
|
|
},
|
|
|
getmon3(item) {
|
|
|
+ //弃用
|
|
|
this.$axios({
|
|
|
method: "POST",
|
|
|
url: "/api/api_gateway?method=sysmenage.usermanager.get_parent_org_list",
|
|
|
@@ -1136,11 +1161,10 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- if(this.ruleForm.org_id[0] != this.versionsoptions[0].id){
|
|
|
- this.ruleForm.org_id.unshift(this.versionsoptions[0].id)
|
|
|
+ if (this.ruleForm.org_id[0] != this.versionsoptions[0].id) {
|
|
|
+ this.ruleForm.org_id.unshift(this.versionsoptions[0].id);
|
|
|
}
|
|
|
console.log(this.ruleForm.org_id);
|
|
|
- this.operationDialogVisible = true;
|
|
|
});
|
|
|
},
|
|
|
// 设备版本、用户筛选
|
|
|
@@ -1358,35 +1382,48 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ oldorgdelect(index) {
|
|
|
+ this.ruleForm.oldorg_id.splice(index, 1);
|
|
|
+ },
|
|
|
submitForm(formName) {
|
|
|
- // console.log(isArray(this.ruleForm.org_id));
|
|
|
var org_id = [];
|
|
|
- // if (Array.isArray(this.ruleForm.org_id)) {
|
|
|
- // org_id = this.ruleForm.org_id[this.ruleForm.org_id.length - 1];
|
|
|
- // } else {
|
|
|
- // org_id = this.ruleForm.org_id;
|
|
|
- // }
|
|
|
if (Array.isArray(this.ruleForm.org_id)) {
|
|
|
for (var i = 0; i < this.ruleForm.org_id.length; i++) {
|
|
|
org_id.push(
|
|
|
this.ruleForm.org_id[i][this.ruleForm.org_id[i].length - 1]
|
|
|
);
|
|
|
}
|
|
|
- // org_id = this.ruleForm.org_id[this.ruleForm.org_id.length - 1];
|
|
|
} else {
|
|
|
org_id = this.ruleForm.org_id;
|
|
|
}
|
|
|
- org_id = org_id.join("/");
|
|
|
- console.log(this.ruleForm);
|
|
|
- if (this.ruleForm.basecity == "请重新选择地址") {
|
|
|
- this.$message({
|
|
|
- showClose: true,
|
|
|
- message: "请重新选择地址",
|
|
|
- type: "warning",
|
|
|
- });
|
|
|
- this.releaseTF = false;
|
|
|
- return;
|
|
|
+ for (var i = 0; i < this.ruleForm.oldorg_id.length; i++) {
|
|
|
+ if (org_id.length > 0) {
|
|
|
+ if (org_id.indexOf(this.ruleForm.oldorg_id[i].org_id) == -1) {
|
|
|
+ org_id.push(this.ruleForm.oldorg_id[i].org_id);
|
|
|
}
|
|
|
+ } else {
|
|
|
+ org_id.push(this.ruleForm.oldorg_id[i].org_id);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (org_id.length > 0) {
|
|
|
+ org_id = org_id.join("/");
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: "请选择隶属海关",
|
|
|
+ type: "warning",
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ console.log(org_id);
|
|
|
+ if (this.ruleForm.basecity == "请重新选择地址") {
|
|
|
+ this.$message({
|
|
|
+ showClose: true,
|
|
|
+ message: "请重新选择地址",
|
|
|
+ type: "warning",
|
|
|
+ });
|
|
|
+ this.releaseTF = false;
|
|
|
+ return;
|
|
|
+ }
|
|
|
this.$refs[formName].validate((valid) => {
|
|
|
if (valid) {
|
|
|
this.releaseTF = true;
|
|
|
@@ -1400,7 +1437,7 @@ export default {
|
|
|
lng: this.ToDigital(this.ruleForm.lng), //
|
|
|
device_id: this.ruleForm.device_id,
|
|
|
device_name: this.ruleForm.device_name,
|
|
|
- city:this.ruleForm.basecity
|
|
|
+ city: this.ruleForm.basecity,
|
|
|
}),
|
|
|
}).then((res) => {
|
|
|
console.log(res);
|
|
|
@@ -1464,7 +1501,7 @@ export default {
|
|
|
var arr = res.data.data.page_list; //组织
|
|
|
console.log(this.versionsoptions);
|
|
|
if (arr[0].parent_name == "根组织") {
|
|
|
- this.versionsoptions = arr
|
|
|
+ this.versionsoptions = arr;
|
|
|
} else {
|
|
|
var obj = {
|
|
|
id: 148,
|
|
|
@@ -1478,7 +1515,7 @@ export default {
|
|
|
}
|
|
|
this.versionsoptions.push(obj);
|
|
|
}
|
|
|
- console.log(this.versionsoptions)
|
|
|
+ console.log(this.versionsoptions);
|
|
|
this.traponsoptions = res.data.data.point_data;
|
|
|
this.inducer_data = res.data.data.inducer_data;
|
|
|
});
|
|
|
@@ -1561,7 +1598,7 @@ export default {
|
|
|
this.ruleForm.lng = this.locationForm.lng;
|
|
|
this.ruleForm.lat = this.locationForm.lat;
|
|
|
console.log(this.ruleForm);
|
|
|
- this.city(this.ruleForm.lat,this.ruleForm.lng)
|
|
|
+ this.city(this.ruleForm.lat, this.ruleForm.lng);
|
|
|
this.addLocationDialogVisible = false;
|
|
|
},
|
|
|
addLocationDialogClosed() {
|
|
|
@@ -1668,7 +1705,7 @@ export default {
|
|
|
}
|
|
|
this.content = str;
|
|
|
},
|
|
|
- city(lat,lng) {
|
|
|
+ city(lat, lng) {
|
|
|
$.ajax({
|
|
|
url: "https://restapi.amap.com/v3/geocode/regeo",
|
|
|
type: "get",
|
|
|
@@ -1678,26 +1715,26 @@ export default {
|
|
|
key: "78ce288400f4fc6d9458989875c833c2",
|
|
|
extensions: "base",
|
|
|
}),
|
|
|
- success: (res)=> {
|
|
|
+ success: (res) => {
|
|
|
console.log(res);
|
|
|
if (res.regeocode.addressComponent.city.length == 0) {
|
|
|
this.ruleForm.basecity = "请重新选择地址";
|
|
|
} else {
|
|
|
this.ruleForm.basecity = res.regeocode.addressComponent.city;
|
|
|
}
|
|
|
- console.log(this.ruleForm)
|
|
|
+ console.log(this.ruleForm);
|
|
|
},
|
|
|
error: function (err) {
|
|
|
- alert("服务端错误,请刷新浏览器后重试")
|
|
|
- }
|
|
|
- })
|
|
|
+ alert("服务端错误,请刷新浏览器后重试");
|
|
|
+ },
|
|
|
+ });
|
|
|
// return arr;
|
|
|
},
|
|
|
- latblur(){
|
|
|
- if(this.ruleForm.lat!=""&&this.ruleForm.lng!=""){
|
|
|
- this.city(this.ruleForm.lat,this.ruleForm.lng)
|
|
|
+ latblur() {
|
|
|
+ if (this.ruleForm.lat != "" && this.ruleForm.lng != "") {
|
|
|
+ this.city(this.ruleForm.lat, this.ruleForm.lng);
|
|
|
}
|
|
|
- }
|
|
|
+ },
|
|
|
},
|
|
|
components: {
|
|
|
SearchBar,
|
|
|
@@ -1846,6 +1883,23 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+.haiguan {
|
|
|
+ display: flex;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ margin-top: 10px;
|
|
|
+ .haiguan_item {
|
|
|
+ width: 70px;
|
|
|
+ height: 20px;
|
|
|
+ border: 1px solid #d4d2d2;
|
|
|
+ line-height: 20px;
|
|
|
+ margin-right: 10px;
|
|
|
+ padding: 0 0 0 10px;
|
|
|
+ border-radius: 5px;
|
|
|
+ }
|
|
|
+ .haiguan_itemnone {
|
|
|
+ line-height: 20px;
|
|
|
+ }
|
|
|
+}
|
|
|
// 表格文字居中
|
|
|
/deep/.el-table th > .cell {
|
|
|
// text-align: center;
|