Browse Source

选组织中搜索跟手动选择更换接口调用

feature
mk 10 months ago
parent
commit
a2fabdb8f1
  1. 20
      src/views/selectAgency/index.vue

20
src/views/selectAgency/index.vue

@ -36,7 +36,7 @@
</template> </template>
<script> <script>
import { editUser, getAllOrgTreeList ,getNeighborHoodListByName } from "@/api/user"; import { editUser, getAllOrgTreeList } from "@/api/user";
import { setConfig } from '@/utils/jweixin' import { setConfig } from '@/utils/jweixin'
export default { export default {
data() { data() {
@ -64,14 +64,14 @@ export default {
methods: { methods: {
search(){ search(){
this.organizationName = this.searchKey; this.organizationName = this.searchKey;
this.getNeighborHoodListByName(); this.getAgency();
}, },
restAddress() { restAddress() {
this.autoFlag = false; this.autoFlag = false;
this.organizationName = ''; this.organizationName = '';
this.selfCity = []; this.selfCity = [];
this.searchKey = null; this.searchKey = null;
this.getNeighborHoodListByName(); this.getAgency(true);
}, },
signWX() { signWX() {
let _this = this let _this = this
@ -136,21 +136,13 @@ export default {
this.cityJson = res.data; this.cityJson = res.data;
} }
}, },
async getNeighborHoodListByName(){
let parm ={
neighborHoodName:this.organizationName
}
let res = await getNeighborHoodListByName(parm)
if (res.code === 0) {
this.cityJson = res.data;
}
},
handelClickAgencyNav(item, index) { handelClickAgencyNav(item, index) {
console.log(item);
if (item.id === this.selfCity[this.selfCity.length - 1].id) return if (item.id === this.selfCity[this.selfCity.length - 1].id) return
this.selfCity.splice(index + 1); this.selfCity.splice(index + 1);
this.cityJson = item.children; this.cityJson = item.children;
if(this.autoFlag ){ if(!this.autoFlag ){
this.neighborHoodName = item.label; this.organizationName = item.label;
this.getAgency() this.getAgency()
} }
}, },

Loading…
Cancel
Save