|
|
@ -41,6 +41,7 @@ import { setConfig } from '@/utils/jweixin' |
|
|
|
export default { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
type:"", |
|
|
|
cityJson: [], |
|
|
|
selfCity: [], |
|
|
|
address: null, |
|
|
@ -55,6 +56,11 @@ export default { |
|
|
|
created() { |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
const url = location.href; |
|
|
|
const queryString = url.split('?')[1]; |
|
|
|
const params = new URLSearchParams(queryString); |
|
|
|
this.type = params.get('type'); |
|
|
|
console.log(type); // 输出 "add" |
|
|
|
setConfig(['checkJsApi', 'openLocation', 'getLocation', 'updateAppMessageShareData', 'updateTimelineShareData']) |
|
|
|
this.signWX() |
|
|
|
if(this.latLng){ |
|
|
@ -63,6 +69,7 @@ export default { |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
search(){ |
|
|
|
|
|
|
|
this.organizationName = this.searchKey; |
|
|
|
this.getAgency(); |
|
|
|
}, |
|
|
@ -108,8 +115,8 @@ export default { |
|
|
|
this.city = res.data.regeocode.addressComponent.city |
|
|
|
this.district = res.data.regeocode.addressComponent.district; |
|
|
|
this.street = res.data.regeocode.addressComponent.township; |
|
|
|
this.organizationName = res.data.regeocode.addressComponent.township; |
|
|
|
this.selfCity.push({label:this.city},{ label: this.district},{label:this.street}) |
|
|
|
this.organizationName = res.data.regeocode.addressComponent.district; |
|
|
|
this.selfCity.push({label:this.city},{ label: this.district}) |
|
|
|
this.getAgency() |
|
|
|
} else{ |
|
|
|
console.log(res); |
|
|
@ -125,6 +132,7 @@ export default { |
|
|
|
this.signWX() |
|
|
|
}, |
|
|
|
async getAgency(type) { |
|
|
|
console.log(type,"adsfjlsjlsflks") |
|
|
|
let parm ={ |
|
|
|
organizationName:this.organizationName |
|
|
|
} |
|
|
@ -154,8 +162,13 @@ export default { |
|
|
|
parm.agencyName = item.label; |
|
|
|
let res = await editUser(parm) |
|
|
|
if (res.code === 0) { |
|
|
|
if(this.type=="add"){ |
|
|
|
this.$router.replace('/peoSuggestion') |
|
|
|
}else{ |
|
|
|
this.$router.replace('/') |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} else { |
|
|
|
this.organizationName = item.label; |
|
|
|
this.getAgency() |
|
|
|