|
|
@@ -699,7 +699,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>
|
|
|
@@ -999,7 +1003,7 @@ export default {
|
|
|
lat: "",
|
|
|
device_name: "",
|
|
|
device_id: "",
|
|
|
- basecity:""
|
|
|
+ basecity: "",
|
|
|
},
|
|
|
rules: {
|
|
|
device_name: [
|
|
|
@@ -1091,7 +1095,7 @@ export default {
|
|
|
for (var key in this.ruleForm) {
|
|
|
this.ruleForm[key] = e[key];
|
|
|
}
|
|
|
- this.city(this.ruleForm.lat,this.ruleForm.lng)
|
|
|
+ this.city(this.ruleForm.lat, this.ruleForm.lng);
|
|
|
this.getmon3(e);
|
|
|
},
|
|
|
getmon3(e) {
|
|
|
@@ -1118,6 +1122,9 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ 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;
|
|
|
});
|
|
|
@@ -1959,6 +1966,15 @@ export default {
|
|
|
org_id = this.ruleForm.org_id;
|
|
|
}
|
|
|
org_id = org_id.join("/");
|
|
|
+ if (this.ruleForm.basecity == "请重新选择地址") {
|
|
|
+ this.$message({
|
|
|
+ showClose: true,
|
|
|
+ message: "请重新选择地址",
|
|
|
+ type: "warning",
|
|
|
+ });
|
|
|
+ this.releaseTF = false;
|
|
|
+ return;
|
|
|
+ }
|
|
|
this.$refs[formName].validate((valid) => {
|
|
|
if (valid) {
|
|
|
this.$axios({
|
|
|
@@ -1971,7 +1987,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);
|
|
|
@@ -2030,7 +2046,25 @@ export default {
|
|
|
}),
|
|
|
}).then((res) => {
|
|
|
console.log(res.data.data);
|
|
|
- this.versionsoptions = res.data.data.page_list; //组织
|
|
|
+ // this.versionsoptions = res.data.data.page_list; //组织
|
|
|
+ var arr = res.data.data.page_list; //组织
|
|
|
+ console.log(this.versionsoptions);
|
|
|
+ if (arr[0].parent_name == "根组织") {
|
|
|
+ this.versionsoptions = arr
|
|
|
+ } else {
|
|
|
+ var obj = {
|
|
|
+ id: 148,
|
|
|
+ org_name: "研发部",
|
|
|
+ childrens: [],
|
|
|
+ };
|
|
|
+ for (var i = 0; i < arr.length; i++) {
|
|
|
+ obj.childrens.push(arr[i]);
|
|
|
+ obj.id = arr[0].parent_id;
|
|
|
+ obj.org_name = arr[0].parent_name;
|
|
|
+ }
|
|
|
+ this.versionsoptions.push(obj);
|
|
|
+ }
|
|
|
+ console.log(this.versionsoptions)
|
|
|
this.traponsoptions = res.data.data.point_data;
|
|
|
this.inducer_data = res.data.data.inducer_data;
|
|
|
});
|
|
|
@@ -2113,7 +2147,7 @@ export default {
|
|
|
this.ruleForm.lng = this.locationForm.lng;
|
|
|
this.ruleForm.lat = this.locationForm.lat;
|
|
|
this.addLocationDialogVisible = false;
|
|
|
- this.city(this.ruleForm.lat,this.ruleForm.lng)
|
|
|
+ this.city(this.ruleForm.lat, this.ruleForm.lng);
|
|
|
},
|
|
|
addLocationDialogClosed() {
|
|
|
//弹框关闭时
|
|
|
@@ -2211,7 +2245,7 @@ export default {
|
|
|
return digital.toFixed(6);
|
|
|
}
|
|
|
},
|
|
|
- city(lat,lng) {
|
|
|
+ city(lat, lng) {
|
|
|
$.ajax({
|
|
|
url: "https://restapi.amap.com/v3/geocode/regeo",
|
|
|
type: "get",
|
|
|
@@ -2221,22 +2255,27 @@ export default {
|
|
|
key: "78ce288400f4fc6d9458989875c833c2",
|
|
|
extensions: "base",
|
|
|
}),
|
|
|
- success: (res)=> {
|
|
|
+ success: (res) => {
|
|
|
console.log(res);
|
|
|
- this.ruleForm.basecity = res.regeocode.addressComponent.city
|
|
|
- console.log(this.ruleForm)
|
|
|
+ // this.ruleForm.basecity = res.regeocode.addressComponent.city
|
|
|
+ if (res.regeocode.addressComponent.city.length == 0) {
|
|
|
+ this.ruleForm.basecity = "请重新选择地址";
|
|
|
+ } else {
|
|
|
+ this.ruleForm.basecity = res.regeocode.addressComponent.city;
|
|
|
+ }
|
|
|
+ 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);
|
|
|
}
|
|
|
- }
|
|
|
+ },
|
|
|
},
|
|
|
watch: {
|
|
|
// 添加设备弹框
|
|
|
@@ -2257,6 +2296,14 @@ export default {
|
|
|
this.stepIndex = 0; // 步骤下标
|
|
|
}
|
|
|
},
|
|
|
+ operationDialogVisible: function (e) {
|
|
|
+ if (e) {
|
|
|
+ console.log(this.$data.ruleForm);
|
|
|
+ if (this.$data.ruleForm.lat != "" && this.$data.ruleForm.lng != "") {
|
|
|
+ this.city(this.$data.ruleForm.lat, this.$data.ruleForm.lng);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|