BUG 29320

This commit is contained in:
aixianling
2022-04-29 19:26:41 +08:00
parent 6e5038e4c7
commit b12ae2c588
2 changed files with 18 additions and 8 deletions

View File

@@ -121,8 +121,7 @@
<span>现住址</span>
</div>
<div class="right">
<!-- :areaId="user.areaId" v-model="form.currentAreaId"-->
<AiAreaPicker :fullName.sync="form.currentAreaName" v-model="form.currentAreaId" :root="user.areaId">
<AiAreaPicker :fullName.sync="form.currentAreaName" v-model="form.currentAreaId">
<AiMore v-model="form.currentAreaName"/>
</AiAreaPicker>
</div>

View File

@@ -26,7 +26,7 @@ export default {
event: "select"
},
props: {
areaId: {default: ''},
areaId: String,
name: {default: ''},
value: String,
all: Boolean,
@@ -52,7 +52,7 @@ export default {
return level
},
root() {
return this.areaId || this.user.areaId || this.$areaId
return this.areaId || this.rootArea
},
locationIcon() {
return this.$cdn + this.icon
@@ -61,7 +61,8 @@ export default {
data() {
return {
fullArea: [],
areaName: ""
areaName: "",
rootArea: ""
}
},
watch: {
@@ -72,16 +73,27 @@ export default {
v && !this.areaName && this.getAreaName(this.value)
},
fullArea(v) {
v && this.$emit('update:fullName', v?.map(e => e.name)?.join("") || "")
v && this.value && this.$emit('update:fullName', v?.map(e => e.name)?.join("") || "")
},
areaName(v) {
v && this.$emit('update:name', v)
}
},
created() {
this.getRootArea()
this.value && this.getAreaName(this.value)
},
methods: {
getRootArea() {
if (uni.getStorageSync("rootArea")) {
this.rootArea = uni.getStorageSync("rootArea")
} else this.$http.post("/app/appdvcpconfig/getCorpArea", null, {}).then(res => {
if (res?.data) {
this.rootArea = res.data
uni.setStorageSync("rootArea", res.data)
}
})
},
getInfo(areaId) {
return areaId && this.$http.post('/admin/area/getAllParentAreaId', null, {
withoutToken: true,
@@ -111,9 +123,8 @@ export default {
this.fullArea = data.fullArea
this.$forceUpdate()
}
})
let {value, all, valueLevel, selectRoot, areaId} = this.$props
let {value, all, valueLevel, selectRoot, areaId = this.root} = this.$props
let url = qs.stringifyUrl({
url: "/components/pages/selectArea", query: {...this.$attrs, value, all, valueLevel, selectRoot, areaId}
})