南昌市物联网技防平台-前端
Administrator
2021-06-29 7dd864a513917bf85e59909ba09891cc3c662802
设备管理,客户管理,修改信息时,修改为选择定位后不改变行政区
2 files modified
33 ■■■■■ changed files
src/views/clientManagement/clientManagement.vue 18 ●●●●● patch | view | raw | blame | history
src/views/system/cs.vue 15 ●●●●● patch | view | raw | blame | history
src/views/clientManagement/clientManagement.vue
@@ -738,16 +738,6 @@
        handler(val) {
          if (val) {
            var that = this;
            //重新加载一次页面详情数据,解决新的省市区无法写入问题
            //判断是新增还是修改
            if(that.isEdit){
                getclient(this.form.id).then(res => {
                  // that.province = res.data.data.province;
                  // that.city = res.data.data.city;
                  // that.district = res.data.data.district;
                });
              }
            //经纬度替换
            this.form.wd = val.latitude;
            this.form.jd = val.longitude;
@@ -759,14 +749,6 @@
            if(address.search("区") != -1){
              this.form.street = address.substring(address.indexOf("区")+1,address.length);
            }
            //写入新的省市区
            that.form.province = val.addressComponent.province;
            if(val.addressComponent.city==""){
                that.form.city = val.addressComponent.province;
            }else{
                that.form.city = val.addressComponent.city;
            }
            that.form.district = val.addressComponent.district;
          }
        },
        immediate: true,
src/views/system/cs.vue
@@ -728,13 +728,6 @@
        // form是表单或者表格绑定的数据集,v-model='form'
        handler(val) {
          if (val) {
            if (that.isEdit) {
              getDetail(this.form.id).then((res) => {
                this.form = res.data.data;
                this.form.wd = val.latitude;
                this.form.jd = val.longitude;
              });
            }
            //地址截取,从县/区开始截取,并且取从县区第一个出现的位置开始
            var address = val.formattedAddress.toString();
            if (address.search("县") != -1) {
@@ -749,14 +742,6 @@
                address.length
              );
            }
            //写入新的省市区
            that.form.province = val.addressComponent.province;
            if (val.addressComponent.city == "") {
              that.form.city = val.addressComponent.province;
            } else {
              that.form.city = val.addressComponent.city;
            }
            that.form.district = val.addressComponent.district;
          }
        },
        immediate: true,