|  | @@ -11,7 +11,7 @@
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  					<!-- 循环分组 -->
 | 
	
		
			
				|  |  |  					<el-col :span="24" style="padding-right: 0;" v-loading="rule_trees_load">
 | 
	
		
			
				|  |  | -						<el-menu :default-active='default_active' class="rule_name" :unique-opened="true" :default-openeds="openeds">
 | 
	
		
			
				|  |  | +						<el-menu :default-active='default_active' class="rule_name" :unique-opened="true">
 | 
	
		
			
				|  |  |  							<el-submenu :index="index.toString()" v-for="(item, index) in rule_list" :key="index" >
 | 
	
		
			
				|  |  |  								<template slot="title">
 | 
	
		
			
				|  |  |  									<div style="width: 80%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; height: 47px;line-height: 47px;" >
 | 
	
	
		
			
				|  | @@ -187,6 +187,8 @@ import noData from '@/components/noData';
 | 
	
		
			
				|  |  |  export default {
 | 
	
		
			
				|  |  |  	data() {
 | 
	
		
			
				|  |  |  		return {
 | 
	
		
			
				|  |  | +			pd_tianjia:false,
 | 
	
		
			
				|  |  | +			dianji:{},
 | 
	
		
			
				|  |  |  			openeds:['1'],
 | 
	
		
			
				|  |  |  			default_active:'',
 | 
	
		
			
				|  |  |  			diyige:false,
 | 
	
	
		
			
				|  | @@ -383,8 +385,25 @@ export default {
 | 
	
		
			
				|  |  |  									// self.err_open_right();
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  									// self.open_right();
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | +									
 | 
	
		
			
				|  |  |  									self.get_role_lists();
 | 
	
		
			
				|  |  | +									if(this.pd_tianjia == true){
 | 
	
		
			
				|  |  | +										let user_FH = JSON.parse(localStorage.getItem("user_FH"))
 | 
	
		
			
				|  |  | +											for (const key in user_FH) {
 | 
	
		
			
				|  |  | +												for (let i = 0; i < user_FH[key].length; i++) {
 | 
	
		
			
				|  |  | +													if (i == 0) {
 | 
	
		
			
				|  |  | +														this.default_active = '0'
 | 
	
		
			
				|  |  | +														this.open_right(user_FH[key][i]);
 | 
	
		
			
				|  |  | +														setTimeout(()=>{
 | 
	
		
			
				|  |  | +															this.default_active = ''
 | 
	
		
			
				|  |  | +															this.pd_tianjia = false
 | 
	
		
			
				|  |  | +														},500)
 | 
	
		
			
				|  |  | +														return false
 | 
	
		
			
				|  |  | +													}
 | 
	
		
			
				|  |  | +												}
 | 
	
		
			
				|  |  | +											}
 | 
	
		
			
				|  |  | +										}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  								} else {
 | 
	
		
			
				|  |  |  									self.$message.error(res.data.msg);
 | 
	
		
			
				|  |  |  								}
 | 
	
	
		
			
				|  | @@ -427,7 +446,7 @@ export default {
 | 
	
		
			
				|  |  |  										this.page = this.page - 1;
 | 
	
		
			
				|  |  |  									}
 | 
	
		
			
				|  |  |  								}
 | 
	
		
			
				|  |  | -								self.open_right();	
 | 
	
		
			
				|  |  | +								self.get_role_lists();	
 | 
	
		
			
				|  |  |  							} else {
 | 
	
		
			
				|  |  |  								self.$message.error(res.data.msg);
 | 
	
		
			
				|  |  |  							}
 | 
	
	
		
			
				|  | @@ -471,7 +490,7 @@ export default {
 | 
	
		
			
				|  |  |  					} else {
 | 
	
		
			
				|  |  |  						self.rules_detail_form.is_attendance = 0;
 | 
	
		
			
				|  |  |  					}
 | 
	
		
			
				|  |  | -					var usl=this.rules_detail_title ? 'api/integral/rule/items/edit' : '/api/integral/rule/items';
 | 
	
		
			
				|  |  | +					var url=this.rules_detail_title ? 'api/integral/rule/items/edit' : '/api/integral/rule/items';
 | 
	
		
			
				|  |  |  					self.$axios('post',url,data).then(res => {
 | 
	
		
			
				|  |  |  							this.disabled = false;
 | 
	
		
			
				|  |  |  							this.dialogFormVisible = false;
 | 
	
	
		
			
				|  | @@ -541,6 +560,7 @@ export default {
 | 
	
		
			
				|  |  |  								// self.jieguoId = res.data.data.item_id;
 | 
	
		
			
				|  |  |  								self.add_employee_id = res.data.data.item_id;
 | 
	
		
			
				|  |  |  								self.add_rulse_id = self.rules_detail_form.rule_id;
 | 
	
		
			
				|  |  | +								// this.get_role_lists()
 | 
	
		
			
				|  |  |  								if (this.rules_detail_title == false) {
 | 
	
		
			
				|  |  |  									setTimeout(() => {
 | 
	
		
			
				|  |  |  										self.add_employee_show = true;
 | 
	
	
		
			
				|  | @@ -558,6 +578,9 @@ export default {
 | 
	
		
			
				|  |  |  						})
 | 
	
		
			
				|  |  |  						.finally(() => {
 | 
	
		
			
				|  |  |  							self.loading = false;
 | 
	
		
			
				|  |  | +							setTimeout(() => {
 | 
	
		
			
				|  |  | +								this.pd_tianjia = true
 | 
	
		
			
				|  |  | +							}, 600);
 | 
	
		
			
				|  |  |  						});
 | 
	
		
			
				|  |  |  				} else {
 | 
	
		
			
				|  |  |  					return false;
 | 
	
	
		
			
				|  | @@ -571,9 +594,8 @@ export default {
 | 
	
		
			
				|  |  |  			this.$refs[form].resetFields();
 | 
	
		
			
				|  |  |  		},
 | 
	
		
			
				|  |  |  		open_right(data) {
 | 
	
		
			
				|  |  | -			// console.log(data)
 | 
	
		
			
				|  |  | +			this.dianji = data
 | 
	
		
			
				|  |  |  			this.diyige = false
 | 
	
		
			
				|  |  | -			// console.log(data)
 | 
	
		
			
				|  |  |  			let self = this;
 | 
	
		
			
				|  |  |  			self.table_loading = true;
 | 
	
		
			
				|  |  |  			if (data) {
 | 
	
	
		
			
				|  | @@ -588,16 +610,19 @@ export default {
 | 
	
		
			
				|  |  |  					page_size: Number(this.pagesize)
 | 
	
		
			
				|  |  |  			};
 | 
	
		
			
				|  |  |  			self.$axios('get','/api/integral/auto/list', params).then(res => {
 | 
	
		
			
				|  |  | -					self.table_loading = false;
 | 
	
		
			
				|  |  |  					if (res.data.code == 1) {
 | 
	
		
			
				|  |  |  						self.table_list = res.data.data.list || [];
 | 
	
		
			
				|  |  |  						self.total = res.data.data.total;
 | 
	
		
			
				|  |  | +						this.rule_trees_load = false;
 | 
	
		
			
				|  |  | +						this.table_loading = false;
 | 
	
		
			
				|  |  |  					} else {
 | 
	
		
			
				|  |  |  						self.$message.error(res.data.msg);
 | 
	
		
			
				|  |  |  					}
 | 
	
		
			
				|  |  |  				})
 | 
	
		
			
				|  |  |  				.finally(() => {
 | 
	
		
			
				|  |  | -					self.table_loading = false;
 | 
	
		
			
				|  |  | +					setTimeout(()=>{
 | 
	
		
			
				|  |  | +						self.table_loading = false;
 | 
	
		
			
				|  |  | +					},500)
 | 
	
		
			
				|  |  |  				});
 | 
	
		
			
				|  |  |  		},
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -623,7 +648,7 @@ export default {
 | 
	
		
			
				|  |  |  						if (res.data.code == 1) {
 | 
	
		
			
				|  |  |  							this.$message.success(res.data.msg);
 | 
	
		
			
				|  |  |  							this.rules_detail_show = false;
 | 
	
		
			
				|  |  | -							this.get_role_lists();
 | 
	
		
			
				|  |  | +							this.get_role_lists('a');
 | 
	
		
			
				|  |  |  						} else {
 | 
	
		
			
				|  |  |  							this.dialogFormVisible = false;
 | 
	
		
			
				|  |  |  							this.disabled = false;
 | 
	
	
		
			
				|  | @@ -636,7 +661,7 @@ export default {
 | 
	
		
			
				|  |  |  						this.disabled = false;
 | 
	
		
			
				|  |  |  					})
 | 
	
		
			
				|  |  |  					.finally(() => {
 | 
	
		
			
				|  |  | -						this.loading = false;
 | 
	
		
			
				|  |  | +							this.loading = false;
 | 
	
		
			
				|  |  |  					});
 | 
	
		
			
				|  |  |  			});
 | 
	
		
			
				|  |  |  		},
 | 
	
	
		
			
				|  | @@ -716,37 +741,46 @@ export default {
 | 
	
		
			
				|  |  |  				});
 | 
	
		
			
				|  |  |  		},
 | 
	
		
			
				|  |  |  		// 获取分组
 | 
	
		
			
				|  |  | -		get_role_lists() {
 | 
	
		
			
				|  |  | +		get_role_lists(index) {
 | 
	
		
			
				|  |  |  			this.table_loading = true;
 | 
	
		
			
				|  |  |  			this.rule_trees_load = true;
 | 
	
		
			
				|  |  | -			this.openeds = ['0'];//修改后  修改高亮选中项
 | 
	
		
			
				|  |  | +			// this.openeds = ['0'];//修改后  修改高亮选中项
 | 
	
		
			
				|  |  |  			this.$axios('get','/api/integral/rule/trees', {cycle_type: '2'}).then(res => {
 | 
	
		
			
				|  |  | +				 	localStorage.setItem("user_FH",JSON.stringify(res.data.data.item_list));
 | 
	
		
			
				|  |  |  					this.is_attendance = this.rules_detail_form.is_attendance == '0' ? false : true;
 | 
	
		
			
				|  |  |  					this.rule_list = res.data.data.rule_tree;
 | 
	
		
			
				|  |  |  					this.item_list = res.data.data.item_list;
 | 
	
		
			
				|  |  | +					this.rule_trees_load = false;
 | 
	
		
			
				|  |  |  					if (this.item_list !== null) {
 | 
	
		
			
				|  |  | -						for (const key in this.item_list) {
 | 
	
		
			
				|  |  | -							for (let i = 0; i < this.item_list[key].length; i++) {
 | 
	
		
			
				|  |  | -								if (i == 0) {
 | 
	
		
			
				|  |  | -									if(this.rule_list[0].id == this.item_list[key][0].rule_id){
 | 
	
		
			
				|  |  | -										this.diyige = false
 | 
	
		
			
				|  |  | -										// console.log('不为空')
 | 
	
		
			
				|  |  | -										this.open_right(this.item_list[key][i]);
 | 
	
		
			
				|  |  | +						for(let i in this.item_list){
 | 
	
		
			
				|  |  | +								for(let a in this.item_list[i]){
 | 
	
		
			
				|  |  | +									if(index == 'a'){
 | 
	
		
			
				|  |  | +										for (const key in this.item_list) {
 | 
	
		
			
				|  |  | +											for (let arr = 0; arr < this.item_list[key].length; arr++) {
 | 
	
		
			
				|  |  | +												if (arr == 0) {
 | 
	
		
			
				|  |  | +													this.default_active = '0'
 | 
	
		
			
				|  |  | +													this.open_right(this.item_list[key][arr]);
 | 
	
		
			
				|  |  | +													setTimeout(()=>{
 | 
	
		
			
				|  |  | +														this.default_active = ''
 | 
	
		
			
				|  |  | +													},500)
 | 
	
		
			
				|  |  | +													return false;
 | 
	
		
			
				|  |  | +												}
 | 
	
		
			
				|  |  | +											}
 | 
	
		
			
				|  |  | +										}
 | 
	
		
			
				|  |  |  									}else{
 | 
	
		
			
				|  |  | -										this.diyige = true
 | 
	
		
			
				|  |  | -										// console.log('这是第一个为空时执行的方法')
 | 
	
		
			
				|  |  | -										this.staff_loading = false;
 | 
	
		
			
				|  |  | -										this.rule_trees_load = false;
 | 
	
		
			
				|  |  | -										this.table_loading = false;
 | 
	
		
			
				|  |  | +										if(this.dianji.id == this.item_list[i][a].id){
 | 
	
		
			
				|  |  | +											this.open_right(this.item_list[i][a]);
 | 
	
		
			
				|  |  | +											return false;
 | 
	
		
			
				|  |  | +										}
 | 
	
		
			
				|  |  |  									}
 | 
	
		
			
				|  |  | -									return false;
 | 
	
		
			
				|  |  |  								}
 | 
	
		
			
				|  |  |  							}
 | 
	
		
			
				|  |  | -						}
 | 
	
		
			
				|  |  |  					}
 | 
	
		
			
				|  |  |  			}).finally(err=>{
 | 
	
		
			
				|  |  | -				this.rule_trees_load = false;
 | 
	
		
			
				|  |  | -				this.table_loading = false;
 | 
	
		
			
				|  |  | +				setTimeout(()=>{
 | 
	
		
			
				|  |  | +					this.rule_trees_load = false;
 | 
	
		
			
				|  |  | +					this.table_loading = false;
 | 
	
		
			
				|  |  | +				},700)
 | 
	
		
			
				|  |  |  			});
 | 
	
		
			
				|  |  |  		}
 | 
	
		
			
				|  |  |  	}
 |