客户管理,设备管理编辑页面选择坐标后省市区不会改变bug修复
| | |
| | | height: 'auto', |
| | | indexLabel: '序号', |
| | | calcHeight: 80, |
| | | labelWidth: '105', |
| | | dialogWidth: 1040, |
| | | labelWidth: '125', |
| | | dialogWidth: 1150, |
| | | menuWidth: 150, |
| | | align:"center", |
| | | size: "mini", |
| | |
| | | prop: "reason", |
| | | addDisplay: false, |
| | | editDisplay: false |
| | | },{ |
| | | label: "心跳时间", |
| | | prop: "heartbeat", |
| | | type: "datetime", |
| | | format: "yyyy-MM-dd", |
| | | valueFormat: "yyyy-MM-dd HH:mm:ss", |
| | | width: 130, |
| | | hide: true, |
| | | addDisplay: true, |
| | | editDisplay: true, |
| | | viewDisplay: true, |
| | | }, |
| | | |
| | | { |
| | | label: "省份", |
| | | prop: "province", |
| | | search: true, |
| | | searchSpan: 2, |
| | | labelWidth: '100', |
| | | labelWidth: '110', |
| | | searchLabelWidth: 45, |
| | | placeholder: "省份", |
| | | type: "select", |
| | |
| | | }, |
| | | cascaderItem: ["city", "district"], |
| | | dicUrl: "/api/blade-system/region/select", |
| | | span: 7, |
| | | span: 8, |
| | | className: "city1", |
| | | hide: true, |
| | | addDisplay: true, |
| | |
| | | value: "code" |
| | | }, |
| | | dicUrl: "/api/blade-system/region/select?code={{key}}", |
| | | span: 3, |
| | | span: 2, |
| | | labelWidth: "0", |
| | | className: "city3", |
| | | hide: true, |
| | |
| | | }, { |
| | | label: "地址", |
| | | prop: "street", |
| | | // type:"map", |
| | | span:11, |
| | | labelWidth: '160', |
| | | span:10, |
| | | hide: true, |
| | | }, |
| | | { |
| | |
| | | searchSpan:0, |
| | | maxlength:0, |
| | | hide: true, |
| | | span: 1, |
| | | span: 2, |
| | | // display:false, |
| | | component: "AvueMap" |
| | | }, |
| | |
| | | prop: "jd", |
| | | searchSpan:2, |
| | | width:"100", |
| | | labelWidth: "110", |
| | | labelWidth: "120", |
| | | formatter: (row,value,label,column)=>{ |
| | | return value = value.substring(0,11); |
| | | }, |
| | |
| | | }, |
| | | span:5, |
| | | }, |
| | | { |
| | | label: "心跳时间", |
| | | prop: "heartbeat", |
| | | type: "datetime", |
| | | format: "yyyy-MM-dd", |
| | | valueFormat: "yyyy-MM-dd HH:mm:ss", |
| | | width: 130, |
| | | hide: true, |
| | | addDisplay: true, |
| | | editDisplay: true, |
| | | viewDisplay: true, |
| | | }, |
| | | |
| | | { |
| | | label: "负责人1", |
| | | label: "主要负责人", |
| | | prop: "oneId", |
| | | type: "tree", |
| | | dicUrl: "/api/blade-system/dept/Batrees", |
| | |
| | | viewDisplay: true, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请选择负责人", |
| | | message: "请选择主要负责人", |
| | | trigger: "blur" |
| | | }], |
| | | }, |
| | | { |
| | | label: "负责人1电话", |
| | | label: "主要负责人电话", |
| | | prop: "onePhone", |
| | | width: 110, |
| | | hide: true, |
| | |
| | | trigger: "blur" |
| | | }], |
| | | }, { |
| | | label: "负责人2", |
| | | label: "负责人1", |
| | | prop: "twoId", |
| | | type: "tree", |
| | | dicUrl: "/api/blade-system/dept/Batrees", |
| | |
| | | viewDisplay: true, |
| | | }, |
| | | { |
| | | label: "负责人2电话", |
| | | label: "负责人1电话", |
| | | prop: "twoPhone", |
| | | width: 110, |
| | | hide: true, |
| | |
| | | editDisplay: true, |
| | | viewDisplay: true, |
| | | }, { |
| | | label: "负责人3", |
| | | label: "负责人2", |
| | | prop: "threeId", |
| | | type: "tree", |
| | | dicUrl: "/api/blade-system/dept/Batrees", |
| | |
| | | viewDisplay: true, |
| | | }, |
| | | { |
| | | label: "负责人3电话", |
| | | label: "负责人2电话", |
| | | prop: "threePhone", |
| | | width: 110, |
| | | hide: true, |
| | |
| | | handler(val) { |
| | | if (val) { |
| | | var that = this; |
| | | this.form.wd = val.latitude; |
| | | // this.form.wd = val.latitude.toString().substring(0,10); |
| | | this.form.jd = val.longitude; |
| | | // this.form.jd = val.longitude.toString().substring(0,11); |
| | | //地址截取,从县/区开始截取,并且取从县区第一个出现的位置开始 |
| | | var address = val.formattedAddress.toString(); |
| | | if(address.search("县") != -1){ |
| | | this.form.street = address.substring(address.indexOf("县")+1,address.length); |
| | | } |
| | | if(address.search("区") != -1){ |
| | | this.form.street = address.substring(address.indexOf("区")+1,address.length); |
| | | } |
| | | |
| | | // that.form.province = val.addressComponent.province; |
| | | // that.form.city = val.addressComponent.city; |
| | | // that.form.district = val.addressComponent.district; |
| | | //重新加载一次页面详情数据,解决新的省市区无法写入问题 |
| | | getclient(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){ |
| | | this.form.street = address.substring(address.indexOf("县")+1,address.length); |
| | | } |
| | | if(address.search("区") != -1){ |
| | | this.form.street = address.substring(address.indexOf("区")+1,address.length); |
| | | } |
| | | //写入新的省市区 |
| | | that.form.province = val.addressComponent.province; |
| | | that.form.city = val.addressComponent.city; |
| | | that.form.district = val.addressComponent.district; |
| | | }); |
| | | } |
| | | }, |
| | | immediate: true, |
| | |
| | | }); |
| | | }, |
| | | beforeOpen(done, type) { |
| | | debugger; |
| | | if (["edit", "view"].includes(type)) { |
| | | getclient(this.form.id).then(res => { |
| | | this.form = res.data.data; |
| | |
| | | // form是表单或者表格绑定的数据集,v-model='form' |
| | | handler(val) { |
| | | if (val) { |
| | | getDetail(this.form.id).then((res) => { |
| | | this.form = res.data.data; |
| | | }) |
| | | this.form.wd = val.latitude; |
| | | this.form.jd = val.longitude; |
| | | //地址截取,从县/区开始截取,并且取从县区第一个出现的位置开始 |
| | |
| | | if(address.search("区") != -1){ |
| | | this.form.address = address.substring(address.indexOf("区")+1,address.length); |
| | | } |
| | | //写入新的省市区 |
| | | that.form.province = val.addressComponent.province; |
| | | that.form.city = val.addressComponent.city; |
| | | that.form.district = val.addressComponent.district; |
| | | } |
| | | }, |
| | | immediate: true, |