|
@@ -1,56 +1,190 @@
|
|
<template>
|
|
<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>
|
|
|
|
- <!--<a class="mui-btn mui-btn-grey mui-pull-right">确定</a>-->
|
|
|
|
- <a class="mui-btn mui-btn-primary mui-pull-right">确定</a>
|
|
|
|
- </header>
|
|
|
|
|
|
+ <div>
|
|
|
|
+ <!--<a class="mui-btn mui-btn-grey mui-pull-right">确定</a>-->
|
|
|
|
+ <common ref="common" @asynCallBack="asynCallBack"></common>
|
|
|
|
+ <top-header :pageTitle="pageTitle" :rightLink="rightLink" :doRightLink="doRightLink"></top-header>
|
|
|
|
+
|
|
|
|
+
|
|
<div class="mui-content vongi-fpbm">
|
|
<div class="mui-content vongi-fpbm">
|
|
<div class="vongi-bread">
|
|
<div class="vongi-bread">
|
|
- <a href="" class="color4fc5f7">首页</a><span class="mui-icon mui-icon-forward"></span>
|
|
|
|
- <a href="" class="color4fc5f7">湖北荆鹏软件集团有限公司</a><span class="mui-icon mui-icon-forward"></span>
|
|
|
|
- <a href="">行政服务中心</a>
|
|
|
|
|
|
+ <template v-for="(item,index) in navList">
|
|
|
|
+ <a :class="item.hasNext?'color4fc5f7':''" @click="reloadItem(item,index)" v-text="item.name"></a>
|
|
|
|
+ <span v-if="index!=navList.length-1" class="mui-icon mui-icon-forward"></span>
|
|
|
|
+ </template>
|
|
</div>
|
|
</div>
|
|
<ul class="mui-table-view">
|
|
<ul class="mui-table-view">
|
|
- <li class="mui-table-view-cell flew-sp flew-items">
|
|
|
|
|
|
+ <li v-for="(item,index) in companyList" class="mui-table-view-cell flew-sp flew-items">
|
|
<div class="mui-radio mui-left mui-ellipsis">
|
|
<div class="mui-radio mui-left mui-ellipsis">
|
|
- <input name="radio" value="Item 1" type="radio" checked>
|
|
|
|
- 湖北荆鹏软件集团有限公司湖北荆鹏软件集团有限公司
|
|
|
|
|
|
+ <input name="radio" :value="item.id" type="radio" v-model="subForm.companyId">
|
|
|
|
+ {{item.name}}
|
|
</div>
|
|
</div>
|
|
- <a href="" class="color4fc5f7">
|
|
|
|
|
|
+ <a v-if="item.hasNext" @click="reloadNext(item)" class="color4fc5f7">
|
|
<span class="iconfont icon-xiaji"></span>
|
|
<span class="iconfont icon-xiaji"></span>
|
|
下级
|
|
下级
|
|
</a>
|
|
</a>
|
|
<!--灰色状态-->
|
|
<!--灰色状态-->
|
|
- <!--<a href="" class="color999">
|
|
|
|
- <span class="iconfont icon-xiaji"></span>
|
|
|
|
- 下级
|
|
|
|
- </a>-->
|
|
|
|
- </li>
|
|
|
|
- <li class="mui-table-view-cell flew-sp flew-items">
|
|
|
|
- <div class="mui-radio mui-left mui-ellipsis">
|
|
|
|
- <input name="radio" value="Item 1" type="radio">
|
|
|
|
- 湖北荆鹏软件集团有限公司湖北荆鹏软件集团有限公司
|
|
|
|
- </div>
|
|
|
|
- <a href="" class="color4fc5f7">
|
|
|
|
|
|
+ <a v-else class="color999">
|
|
<span class="iconfont icon-xiaji"></span>
|
|
<span class="iconfont icon-xiaji"></span>
|
|
下级
|
|
下级
|
|
</a>
|
|
</a>
|
|
- </li>
|
|
|
|
|
|
+ </li>
|
|
</ul>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<div class="fyy-footer vongi-footer">
|
|
<div class="fyy-footer vongi-footer">
|
|
<h5 class="margin10">已选择部门:</h5>
|
|
<h5 class="margin10">已选择部门:</h5>
|
|
- <div class="vongi-yjbtn">
|
|
|
|
- <button type="submit" class="mui-btn mui-btn-primary mui-btn-outlined">部门名</button>
|
|
|
|
|
|
+ <div class="vongi-yjbtn" v-if="companyName">
|
|
|
|
+ <button type="submit" class="mui-btn mui-btn-primary mui-btn-outlined" v-text="companyName"></button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- </body>
|
|
|
|
-</div>
|
|
|
|
|
|
+
|
|
|
|
+ <loading :visible="isLoading"></loading>
|
|
|
|
+ </div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
+ import * as API_Company from '@/apis/Master/company'
|
|
|
|
+ import Common from '$project/components/Common.vue'
|
|
|
|
+ import Loading from '$project/components/Loading.vue'
|
|
|
|
+ import TopHeader from '$project/components/TopHeader.vue'
|
|
|
|
+ import NavMenu from '@/components/NavMenu.vue'
|
|
|
|
+ import {
|
|
|
|
+ mapGetters,
|
|
|
|
+ mapMutations
|
|
|
|
+ } from 'vuex'
|
|
|
|
+ import * as types from '$project/store/mutation-types'
|
|
|
|
+ export default {
|
|
|
|
+ name: 'MasterCompanyRegisterSelectDepartment',
|
|
|
|
+ components: {
|
|
|
|
+ Common,
|
|
|
|
+ Loading,
|
|
|
|
+ TopHeader,
|
|
|
|
+ NavMenu
|
|
|
|
+ },
|
|
|
|
+ data() {
|
|
|
|
+ return {
|
|
|
|
+ isLoading: false,
|
|
|
|
+
|
|
|
|
+ pageTitle: '分配部门',
|
|
|
|
+
|
|
|
|
+ rightLink: {
|
|
|
|
+ show: true,
|
|
|
|
+ icon: 'mui-btn mui-btn-primary',
|
|
|
|
+ style: 'width: 55px;height: 25px;margin-top:5px;margin-right: 0px;line-height: 5px;color: #fff;font-size:16px;border-radius:20px;',
|
|
|
|
+ title: '确认'
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ companyId: '',
|
|
|
|
+ companyList: [],
|
|
|
|
+ nowLevel: 0,
|
|
|
|
+ navList: [{
|
|
|
|
+ name: '首页',
|
|
|
|
+ id: '',
|
|
|
|
+ hasNext: false,
|
|
|
|
+ }],
|
|
|
|
+
|
|
|
|
+ subForm: {
|
|
|
|
+ ids: '',
|
|
|
|
+ content: '',
|
|
|
|
+ status: '',
|
|
|
|
+ deviceIds: '',
|
|
|
|
+ companyId: '',
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ hasSceneId4: this.$route.query.hasSceneId4 ? this.$route.query.hasSceneId4 : '0'
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ created() {
|
|
|
|
+ if (this.register_examine_form) {
|
|
|
|
+ this.subForm = this.register_examine_form;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if ((!this.subForm.ids || !this.subForm.status) && this.hasSceneId4 == '0') {
|
|
|
|
+ this.$router.go(-1);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ //获取公司部门列表
|
|
|
|
+ getCompanyList() {
|
|
|
|
+ this.isLoading = true;
|
|
|
|
+ API_Company.getExamineCompanyList(this.companyId).then(response => {
|
|
|
|
+
|
|
|
|
+ this.companyList = response.list;
|
|
|
|
+ if (this.nowLevel == 0) {
|
|
|
|
+ this.navList[0]['hasNext'] = response.list.length > 0 ? true : false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ this.isLoading = false;
|
|
|
|
+ }).catch(error => {
|
|
|
|
+ this.isLoading = false;
|
|
|
|
+ mui.toast(error);
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ //加载下级
|
|
|
|
+ reloadNext(item) {
|
|
|
|
+ this.navList.push(item)
|
|
|
|
+ this.nowLevel++;
|
|
|
|
+ this.companyId = item.id;
|
|
|
|
+ },
|
|
|
|
+ //面包屑选择加载
|
|
|
|
+ reloadItem(item, index) {
|
|
|
|
+ this.navList = this.navList.slice(0, index + 1);
|
|
|
|
+ this.nowLevel = index;
|
|
|
|
+ this.companyId = item.id;
|
|
|
|
+ },
|
|
|
|
+ //确认
|
|
|
|
+ doRightLink() {
|
|
|
|
+ this.set_register_examine_form(this.subForm);
|
|
|
|
+ this.$router.push({
|
|
|
|
+ name: 'MasterCompanyRegisterSelectDevice',
|
|
|
|
+ query: {
|
|
|
|
+ hasSceneId4: '0'
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ asynCallBack() {
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ ...mapMutations({
|
|
|
|
+ set_register_examine_form: types.SET_REGISTER_EXAMINE_FORM,
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ mounted() {
|
|
|
|
+ this.getCompanyList();
|
|
|
|
+ },
|
|
|
|
+ destroyed() {
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ computed: {
|
|
|
|
+ //公司名称
|
|
|
|
+ companyName: {
|
|
|
|
+ // getter
|
|
|
|
+ get: function() {
|
|
|
|
+ for (var i = 0; i < this.companyList.length; i++) {
|
|
|
|
+ if (this.companyList[i]['id'] == this.subForm.companyId) {
|
|
|
|
+ return this.companyList[i]['name'];
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return '';
|
|
|
|
+ },
|
|
|
|
+ // setter
|
|
|
|
+ set: function(newValue) {
|
|
|
|
+ console.log(newValue)
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ ...mapGetters({
|
|
|
|
+ openId: 'wx_openid',
|
|
|
|
+ token: 'token',
|
|
|
|
+ person_data: 'person_data',
|
|
|
|
+ person_popedom: 'person_popedom',
|
|
|
|
+ register_examine_form: 'register_examine_form'
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ watch: {
|
|
|
|
+ 'companyId': function(val) {
|
|
|
|
+ this.getCompanyList();
|
|
|
|
+ },
|
|
|
|
+ }
|
|
|
|
+ }
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style scoped src="$project/assets/css/xpwyfyy.css"></style>
|
|
<style scoped src="$project/assets/css/xpwyfyy.css"></style>
|