|  | @@ -2,8 +2,9 @@
 | 
	
		
			
				|  |  |  	<div class="all-box">
 | 
	
		
			
				|  |  |  		<!-- 头部提示 -->
 | 
	
		
			
				|  |  |  		<div class="top-msg margin-bottom">
 | 
	
		
			
				|  |  | -			<div>当前组织架构和角色同过钉钉同步,上次同步时间
 | 
	
		
			
				|  |  | -				<span v-if="info.sync_time">{{info.sync_time}}</span>
 | 
	
		
			
				|  |  | +			<div>
 | 
	
		
			
				|  |  | +				当前组织架构和角色同过钉钉同步,上次同步时间
 | 
	
		
			
				|  |  | +				<span v-if="info.sync_time">{{ info.sync_time }}</span>
 | 
	
		
			
				|  |  |  				<span v-else>暂未同步</span>
 | 
	
		
			
				|  |  |  			</div>
 | 
	
		
			
				|  |  |  			<div>
 | 
	
	
		
			
				|  | @@ -38,15 +39,17 @@
 | 
	
		
			
				|  |  |  								style="font-size: 14px;color: #606266; width:100%; text-align: left;"
 | 
	
		
			
				|  |  |  							>
 | 
	
		
			
				|  |  |  								<img src="../assets/image/one.png" style="width: 20px;margin-right: 5px;" />
 | 
	
		
			
				|  |  | -								<span class="name">{{ data.name}}</span>
 | 
	
		
			
				|  |  | +								<span class="name">{{ data.name }}</span>
 | 
	
		
			
				|  |  |  							</div>
 | 
	
		
			
				|  |  |  						</el-tree>
 | 
	
		
			
				|  |  |  					</div>
 | 
	
		
			
				|  |  |  				</div>
 | 
	
		
			
				|  |  |  				<div class="terr-right border-right flex-1">
 | 
	
		
			
				|  |  |  					<div class="margin-bottom">
 | 
	
		
			
				|  |  | -						<el-button @click="participation()" size="medium" type="primary" style="margin-right: 10px;" v-show="selectIds.length>0">参与积分管理</el-button>
 | 
	
		
			
				|  |  | -						<el-input placeholder="输入同事姓名" size="medium" style="width: 230px;" v-model="keywords"><el-button slot="append" icon="el-icon-search" @click="getEmployee()"></el-button></el-input>
 | 
	
		
			
				|  |  | +						<el-button @click="participation()" size="medium" type="primary" style="margin-right: 10px;" v-show="selectIds.length > 0">参与积分管理</el-button>
 | 
	
		
			
				|  |  | +						<el-input placeholder="输入同事姓名" size="medium" style="width: 230px;" v-model="keywords">
 | 
	
		
			
				|  |  | +							<el-button slot="append" icon="el-icon-search" @click="getEmployee()"></el-button>
 | 
	
		
			
				|  |  | +						</el-input>
 | 
	
		
			
				|  |  |  					</div>
 | 
	
		
			
				|  |  |  					<el-table :data="userList" @selection-change="handleSelectionChange" v-loading="tableToading">
 | 
	
		
			
				|  |  |  						<el-table-column type="selection" width="50"></el-table-column>
 | 
	
	
		
			
				|  | @@ -69,9 +72,12 @@
 | 
	
		
			
				|  |  |  						<el-table-column label="是否参与积分管理">
 | 
	
		
			
				|  |  |  							<template slot-scope="scope">
 | 
	
		
			
				|  |  |  								<!-- {{scope.row.is_official}} -->
 | 
	
		
			
				|  |  | -								<el-switch @change="changeIs($event,scope.row.id)"  v-model="scope.row.is_official" :active-value="is" :inactive-value="no"></el-switch>
 | 
	
		
			
				|  |  | +								<el-switch @change="changeIs($event, scope.row.id)" v-model="scope.row.is_official" :active-value="is" :inactive-value="no"></el-switch>
 | 
	
		
			
				|  |  |  							</template>
 | 
	
		
			
				|  |  |  						</el-table-column>
 | 
	
		
			
				|  |  | +						<template slot="empty">
 | 
	
		
			
				|  |  | +							<noData></noData>
 | 
	
		
			
				|  |  | +						</template>
 | 
	
		
			
				|  |  |  					</el-table>
 | 
	
		
			
				|  |  |  					<div class="pagination">
 | 
	
		
			
				|  |  |  						<el-pagination
 | 
	
	
		
			
				|  | @@ -91,6 +97,7 @@
 | 
	
		
			
				|  |  |  </template>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  <script>
 | 
	
		
			
				|  |  | +import noData from '@/components/noData';
 | 
	
		
			
				|  |  |  export default {
 | 
	
		
			
				|  |  |  	data() {
 | 
	
		
			
				|  |  |  		return {
 | 
	
	
		
			
				|  | @@ -107,15 +114,18 @@ export default {
 | 
	
		
			
				|  |  |  			treedata: [1],
 | 
	
		
			
				|  |  |  			tableData: [],
 | 
	
		
			
				|  |  |  			keywords: '',
 | 
	
		
			
				|  |  | -			dept_id:0,
 | 
	
		
			
				|  |  | -				
 | 
	
		
			
				|  |  | +			dept_id: 0,
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  			tableToading: false,
 | 
	
		
			
				|  |  | -			tbLoading:false,
 | 
	
		
			
				|  |  | -			selectIds:[],
 | 
	
		
			
				|  |  | +			tbLoading: false,
 | 
	
		
			
				|  |  | +			selectIds: []
 | 
	
		
			
				|  |  |  		};
 | 
	
		
			
				|  |  |  	},
 | 
	
		
			
				|  |  | -	watch:{
 | 
	
		
			
				|  |  | -		dept_id(val){
 | 
	
		
			
				|  |  | +	components: {
 | 
	
		
			
				|  |  | +		noData
 | 
	
		
			
				|  |  | +	},
 | 
	
		
			
				|  |  | +	watch: {
 | 
	
		
			
				|  |  | +		dept_id(val) {
 | 
	
		
			
				|  |  |  			this.getEmployee();
 | 
	
		
			
				|  |  |  		}
 | 
	
		
			
				|  |  |  	},
 | 
	
	
		
			
				|  | @@ -135,33 +145,33 @@ export default {
 | 
	
		
			
				|  |  |  	},
 | 
	
		
			
				|  |  |  	methods: {
 | 
	
		
			
				|  |  |  		//同步信息
 | 
	
		
			
				|  |  | -		tb(){
 | 
	
		
			
				|  |  | -			this.tbLoading=true;
 | 
	
		
			
				|  |  | -			var http1=this.$axios.post('api/ding/department_sync');
 | 
	
		
			
				|  |  | -			var http2=this.$axios.post('api/ding/employee_sync');
 | 
	
		
			
				|  |  | -			Promise.all([http1,http2]).then(res=>{
 | 
	
		
			
				|  |  | -				this.tbLoading=false;
 | 
	
		
			
				|  |  | -				if(res[0]){
 | 
	
		
			
				|  |  | -					this.tbLoading=false;
 | 
	
		
			
				|  |  | -					this.$message.success({message:res[0].data.msg})
 | 
	
		
			
				|  |  | +		tb() {
 | 
	
		
			
				|  |  | +			this.tbLoading = true;
 | 
	
		
			
				|  |  | +			var http1 = this.$axios.post('api/ding/department_sync');
 | 
	
		
			
				|  |  | +			var http2 = this.$axios.post('api/ding/employee_sync');
 | 
	
		
			
				|  |  | +			Promise.all([http1, http2]).then(res => {
 | 
	
		
			
				|  |  | +				this.tbLoading = false;
 | 
	
		
			
				|  |  | +				if (res[0]) {
 | 
	
		
			
				|  |  | +					this.tbLoading = false;
 | 
	
		
			
				|  |  | +					this.$message.success({ message: res[0].data.msg });
 | 
	
		
			
				|  |  |  					this.getInfo();
 | 
	
		
			
				|  |  |  				}
 | 
	
		
			
				|  |  | -			})
 | 
	
		
			
				|  |  | +			});
 | 
	
		
			
				|  |  |  		},
 | 
	
		
			
				|  |  |  		//是否开通
 | 
	
		
			
				|  |  | -		changeIs(e,id){
 | 
	
		
			
				|  |  | -			var url=e==1? 'api/employee/enable':'api/employee/disable';
 | 
	
		
			
				|  |  | -			this.$axios.post(url,{ employee_id:[id]}).then(res => {
 | 
	
		
			
				|  |  | -				if(res){
 | 
	
		
			
				|  |  | -					this.$message.success({message:res.data.msg})
 | 
	
		
			
				|  |  | +		changeIs(e, id) {
 | 
	
		
			
				|  |  | +			var url = e == 1 ? 'api/employee/enable' : 'api/employee/disable';
 | 
	
		
			
				|  |  | +			this.$axios.post(url, { employee_id: [id] }).then(res => {
 | 
	
		
			
				|  |  | +				if (res) {
 | 
	
		
			
				|  |  | +					this.$message.success({ message: res.data.msg });
 | 
	
		
			
				|  |  |  				}
 | 
	
		
			
				|  |  |  				this.getEmployee();
 | 
	
		
			
				|  |  |  			});
 | 
	
		
			
				|  |  |  		},
 | 
	
		
			
				|  |  |  		//批量开通权限
 | 
	
		
			
				|  |  | -		participation(){
 | 
	
		
			
				|  |  | -			this.$axios.post('api/employee/enable',{ employee_id: this.selectIds}).then(res => {
 | 
	
		
			
				|  |  | -				if(res){
 | 
	
		
			
				|  |  | +		participation() {
 | 
	
		
			
				|  |  | +			this.$axios.post('api/employee/enable', { employee_id: this.selectIds }).then(res => {
 | 
	
		
			
				|  |  | +				if (res) {
 | 
	
		
			
				|  |  |  					this.getEmployee();
 | 
	
		
			
				|  |  |  				}
 | 
	
		
			
				|  |  |  			});
 | 
	
	
		
			
				|  | @@ -174,16 +184,16 @@ export default {
 | 
	
		
			
				|  |  |  		},
 | 
	
		
			
				|  |  |  		//选择员工
 | 
	
		
			
				|  |  |  		handleSelectionChange(e) {
 | 
	
		
			
				|  |  | -			var arr=[];
 | 
	
		
			
				|  |  | -			for(var item in e){
 | 
	
		
			
				|  |  | +			var arr = [];
 | 
	
		
			
				|  |  | +			for (var item in e) {
 | 
	
		
			
				|  |  |  				arr.push(e[item].id);
 | 
	
		
			
				|  |  |  			}
 | 
	
		
			
				|  |  | -			this.selectIds=arr;
 | 
	
		
			
				|  |  | +			this.selectIds = arr;
 | 
	
		
			
				|  |  |  		},
 | 
	
		
			
				|  |  |  		//点击部门
 | 
	
		
			
				|  |  |  		handleNodeClick(e) {
 | 
	
		
			
				|  |  |  			this.page = 1;
 | 
	
		
			
				|  |  | -			this.dept_id=e.id;
 | 
	
		
			
				|  |  | +			this.dept_id = e.id;
 | 
	
		
			
				|  |  |  		},
 | 
	
		
			
				|  |  |  		//获取部门
 | 
	
		
			
				|  |  |  		getDepartment() {
 | 
	
	
		
			
				|  | @@ -212,7 +222,7 @@ export default {
 | 
	
		
			
				|  |  |  		},
 | 
	
		
			
				|  |  |  		//页码变更
 | 
	
		
			
				|  |  |  		handleCurrentChange: function(val) {
 | 
	
		
			
				|  |  | -			this.page = val ;
 | 
	
		
			
				|  |  | +			this.page = val;
 | 
	
		
			
				|  |  |  			this.getEmployee();
 | 
	
		
			
				|  |  |  		}
 | 
	
		
			
				|  |  |  	}
 | 
	
	
		
			
				|  | @@ -220,7 +230,7 @@ export default {
 | 
	
		
			
				|  |  |  </script>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  <style lang="scss" scoped="scoped">
 | 
	
		
			
				|  |  | -.name{
 | 
	
		
			
				|  |  | +.name {
 | 
	
		
			
				|  |  |  	overflow: hidden;
 | 
	
		
			
				|  |  |  	text-overflow: ellipsis;
 | 
	
		
			
				|  |  |  	white-space: nowrap;
 |