|
@@ -1,38 +1,49 @@
|
|
|
<template>
|
|
|
-<div>
|
|
|
- <header class="mui-bar mui-bar-nav">
|
|
|
- <h1 class="mui-title">选择单位</h1>
|
|
|
- <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
|
|
|
- </header>
|
|
|
+ <div>
|
|
|
+ <common @asynCallBack="asynCallBack"></common>
|
|
|
+ <top-header :pageTitle="pageTitle"></top-header>
|
|
|
+
|
|
|
<div class="mui-content vongi-xzdw">
|
|
|
<div class="mui-content-padded vongi-xzdw-search">
|
|
|
- <input type="search" placeholder="请输入姓名">
|
|
|
+ <input type="search" placeholder="请输入公司名称">
|
|
|
<span class="mui-icon mui-icon-search"></span>
|
|
|
</div>
|
|
|
<div class="mui-content-padded fyy-date mui-clearfix">
|
|
|
- <h5>荆州市 > 沙市区</h5>
|
|
|
+ <h5>{{firstAreaName}} > {{secondAreaName}}</h5>
|
|
|
+ </div>
|
|
|
+ <!--地区选择-->
|
|
|
+ <div v-show="nowLevel==1" class="mui-row mui-fullscreen vongi-xzdw-city">
|
|
|
+ <div class="mui-col-xs-3">
|
|
|
+ <div class="mui-segmented-control mui-segmented-control-inverted mui-segmented-control-vertical">
|
|
|
+ <a @click="clickFirstArea(item)" v-for="(item,index) in firstAreaList" :class="'mui-control-item '+(item.name==firstAreaName?'mui-active':'')"
|
|
|
+ v-text="item.name"></a>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="mui-col-xs-9">
|
|
|
+ <div class="mui-control-content">
|
|
|
+ <ul class="mui-table-view">
|
|
|
+ <li @click="clickSecondArea(item)" v-for="(item,index) in secondAreaList" class="mui-table-view-cell" v-text="item.name"></li>
|
|
|
+ </ul>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- <div class="mui-row mui-fullscreen vongi-xzdw-city">
|
|
|
+ <!--公司选择-->
|
|
|
+ <div v-show="nowLevel==2" class="mui-row mui-fullscreen vongi-xzdw-city">
|
|
|
<div class="mui-col-xs-3">
|
|
|
<div class="mui-segmented-control mui-segmented-control-inverted mui-segmented-control-vertical">
|
|
|
- <a class="mui-control-item mui-active" href="">荆州市</a>
|
|
|
- <a class="mui-control-item" href="">荆州市</a>
|
|
|
- <a class="mui-control-item" href="">荆州市</a>
|
|
|
- <a class="mui-control-item" href="">荆州市</a>
|
|
|
+ <a @click="clickFirstCompany(item)" v-for="(item,index) in firstCompanyList" :class="'mui-control-item '+(item.name==secondAreaName?'mui-active':'')"
|
|
|
+ v-text="item.name"></a>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="mui-col-xs-9">
|
|
|
<div class="mui-control-content">
|
|
|
<ul class="mui-table-view">
|
|
|
- <li class="mui-table-view-cell">市辖区</li>
|
|
|
- <li class="mui-table-view-cell">市辖区</li>
|
|
|
- <li class="mui-table-view-cell">市辖区</li>
|
|
|
- <li class="mui-table-view-cell">市辖区</li>
|
|
|
+ <li @click="clickSecondCompany(item)" v-for="(item,index) in secondCompanyList" class="mui-table-view-cell"
|
|
|
+ v-text="item.name"></li>
|
|
|
</ul>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
-
|
|
|
</div>
|
|
|
<!--搜索结果的状态-->
|
|
|
<!-- <div class="mui-content vongi-xzdw">
|
|
@@ -51,10 +62,165 @@
|
|
|
</li>
|
|
|
</ul>
|
|
|
</div> -->
|
|
|
-</div>
|
|
|
+
|
|
|
+ <loading :visible="isLoading"></loading>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+ import * as API_Person from '@/apis/person'
|
|
|
+ import Common from '$project/components/Common.vue'
|
|
|
+ import Loading from '$project/components/Loading.vue'
|
|
|
+ import TopHeader from '$project/components/TopHeader.vue'
|
|
|
+ import {
|
|
|
+ mapGetters,
|
|
|
+ mapMutations
|
|
|
+ } from 'vuex'
|
|
|
+ import * as types from '$project/store/mutation-types'
|
|
|
+ export default {
|
|
|
+ name: 'RegisterBusinessStep2',
|
|
|
+ components: {
|
|
|
+ Common,
|
|
|
+ Loading,
|
|
|
+ TopHeader
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ pageTitle: '选择单位',
|
|
|
+
|
|
|
+ subForm: {
|
|
|
+ sceneId: '',
|
|
|
+ sceneName: '',
|
|
|
+ personRoleId: '',
|
|
|
+ roleName: '',
|
|
|
+ name: '',
|
|
|
+ telephone: '',
|
|
|
+ personId: '',
|
|
|
+ companyId: '',
|
|
|
+ companyName: '请选择',
|
|
|
+ companyStructureId: '',
|
|
|
+ companyStructureName: '请选择',
|
|
|
+ address: '',
|
|
|
+ idCard: '',
|
|
|
+ faceImageUrl: ''
|
|
|
+ },
|
|
|
+
|
|
|
+ isLoading: false,
|
|
|
+
|
|
|
+ firstAreaList: [],
|
|
|
+ secondAreaList: [],
|
|
|
+ firstAreaName: '',
|
|
|
+ secondAreaName: '',
|
|
|
+ //当前选择的层次
|
|
|
+ nowLevel: 1,
|
|
|
+
|
|
|
+ companyForm: {
|
|
|
+ sceneId: '',
|
|
|
+ regionId: '',
|
|
|
+ },
|
|
|
+ firstCompanyList: [],
|
|
|
+ secondCompanyList: [],
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.subForm = this.register_form_data;
|
|
|
+ this.companyForm.sceneId = this.subForm.sceneId;
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ //获取一级地区列表
|
|
|
+ getFirstAreaList() {
|
|
|
+ this.firstAreaName = '';
|
|
|
+ this.getRegionList();
|
|
|
+ },
|
|
|
+ //获取地区列表
|
|
|
+ getRegionList() {
|
|
|
+ this.isLoading = true;
|
|
|
+ API_Person.getRegionList(this.firstAreaName).then(response => {
|
|
|
+ this.isLoading = false;
|
|
|
+ if (this.firstAreaName) {
|
|
|
+ for (var i = 0; i < response.length; i++) {
|
|
|
+ if (response[i].name == this.firstAreaName) {
|
|
|
+ this.secondAreaList = response[i].list;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.firstAreaList = response;
|
|
|
+ this.firstAreaName = response[0].name;
|
|
|
+ }
|
|
|
+ }).catch(error => {
|
|
|
+ this.isLoading = false;
|
|
|
+ mui.toast(error);
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //一级地区选择点击
|
|
|
+ clickFirstArea(item) {
|
|
|
+ this.firstAreaName = item.name;
|
|
|
+ },
|
|
|
+ //二级地区选择点击
|
|
|
+ clickSecondArea(item) {
|
|
|
+ this.companyForm.regionId = item.id;
|
|
|
+ this.secondAreaName = item.name;
|
|
|
+ this.nowLevel = 2;
|
|
|
+ this.firstCompanyList = this.secondAreaList;
|
|
|
+ this.companyForm.regionId = this.secondAreaList[0].id;
|
|
|
+ },
|
|
|
+ //获取公司列表
|
|
|
+ getCompanyList() {
|
|
|
+ this.isLoading = true;
|
|
|
+ API_Person.getCompanyList(this.companyForm).then(response => {
|
|
|
+ this.isLoading = false;
|
|
|
+ this.secondCompanyList = response.list;
|
|
|
+ }).catch(error => {
|
|
|
+ this.isLoading = false;
|
|
|
+ mui.toast(error);
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //一级公司选择
|
|
|
+ clickFirstCompany(item) {
|
|
|
+ this.secondAreaName = item.name;
|
|
|
+ this.companyForm.regionId = item.id;
|
|
|
+ },
|
|
|
+ //二级公司选择
|
|
|
+ clickSecondCompany(item) {
|
|
|
+ this.subForm.companyId = item.id;
|
|
|
+ this.subForm.companyName = item.name;
|
|
|
+ this.set_register_form_data(this.subForm);
|
|
|
+ this.$router.push({
|
|
|
+ name: 'RegisterBusinessStep1'
|
|
|
+ })
|
|
|
+ },
|
|
|
+ asynCallBack() {
|
|
|
+
|
|
|
+ },
|
|
|
+ ...mapMutations({
|
|
|
+ set_register_form_data: types.SET_REGISTER_FORM_DATA,
|
|
|
+ })
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.getFirstAreaList();
|
|
|
+ },
|
|
|
+ destroyed() {
|
|
|
+
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ ...mapGetters({
|
|
|
+ openId: 'wx_openid',
|
|
|
+ token: 'token',
|
|
|
+ person_data: 'person_data',
|
|
|
+ person_popedom: 'person_popedom',
|
|
|
+ register_form_data: 'register_form_data'
|
|
|
+ })
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ 'firstAreaName': function(val) {
|
|
|
+ this.getRegionList();
|
|
|
+ },
|
|
|
+ 'companyForm.regionId': function(val) {
|
|
|
+ this.getCompanyList();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
</script>
|
|
|
|
|
|
<style scoped src="$project/assets/css/xpwyfyy.css"></style>
|