Sfoglia il codice sorgente

注册审核选择公司部门

wgl 4 anni fa
parent
commit
bde71bf784

+ 13 - 7
src/projects/business/views/Master/Company/RegisterExamine.vue

@@ -217,12 +217,18 @@
 							//同意
 							if (_this.subForm.status == 1) {
 								_this.set_register_examine_form(_this.subForm);
-								_this.$router.push({
-									name: 'MasterCompanyRegisterSelectDevice',
-									query: {
-										hasSceneId4: _this.hasSceneId4 ? '1' : '0'
-									}
-								})
+								if (_this.hasSceneId4) {
+									_this.$router.push({
+										name: 'MasterCompanyRegisterSelectDevice',
+										query: {
+											hasSceneId4: _this.hasSceneId4 ? '1' : '0'
+										}
+									})
+								} else {
+									_this.$router.push({
+										name: 'MasterCompanyRegisterSelectDepartment',
+									})
+								}
 							} else {
 								//拒绝
 								_this.isLoading = true;
@@ -282,7 +288,7 @@
 		watch: {
 			//本页面监听到路由(参数)改变
 			'$route': function(to, from) {
-                this.reloadList(to.query.status?to.query.status:0)
+				this.reloadList(to.query.status ? to.query.status : 0)
 			}
 		},
 	}

+ 12 - 6
src/projects/business/views/Master/Company/RegisterInfo.vue

@@ -162,12 +162,18 @@
 							//同意
 							if (_this.subForm.status == 1) {
 								_this.set_register_examine_form(_this.subForm);
-								_this.$router.push({
-									name: 'MasterCompanyRegisterSelectDevice',
-									query: {
-										hasSceneId4: _this.hasSceneId4 ? '1' : '0'
-									}
-								})
+								if (_this.hasSceneId4) {
+									_this.$router.push({
+										name: 'MasterCompanyRegisterSelectDevice',
+										query: {
+											hasSceneId4: _this.hasSceneId4 ? '1' : '0'
+										}
+									})
+								} else {
+									_this.$router.push({
+										name: 'MasterCompanyRegisterSelectDepartment',
+									})
+								}
 							} else {
 								//拒绝
 								_this.isLoading = true;

+ 164 - 30
src/projects/business/views/Master/Company/RegisterSelectDepartment.vue

@@ -1,56 +1,190 @@
 <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="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>
 			<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">
-						<input name="radio" value="Item 1" type="radio" checked>
-						湖北荆鹏软件集团有限公司湖北荆鹏软件集团有限公司
+						<input name="radio" :value="item.id" type="radio" v-model="subForm.companyId">
+						{{item.name}}
 					</div>
-					<a href="" class="color4fc5f7">
+					<a v-if="item.hasNext" @click="reloadNext(item)" class="color4fc5f7">
 						<span class="iconfont icon-xiaji"></span>
 						下级
 					</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>
 						下级
 					</a>
-				</li>				
+				</li>
 			</ul>
 		</div>
 		<div class="fyy-footer vongi-footer">
 			<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>
-	</body>
-</div>
+
+		<loading :visible="isLoading"></loading>
+	</div>
 </template>
 
 <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>
 
 <style scoped src="$project/assets/css/xpwyfyy.css"></style>

+ 1 - 1
src/projects/business/views/Master/Company/RegisterSelectDevice.vue

@@ -60,7 +60,7 @@
 				recordList: [],
 				successVisible: false,
 
-				hasSceneId4: this.$route.query.hasSceneId4
+				hasSceneId4: this.$route.query.hasSceneId4 ? this.$route.query.hasSceneId4 : '0'
 			}
 		},
 		created() {