347617796@qq.com 4 years ago
parent
commit
aed461ad85
6 changed files with 374 additions and 263 deletions
  1. 10 6
      src/api/axios.js
  2. 3 2
      src/assets/css/reset.css
  3. 11 18
      src/components/UserImage.vue
  4. 8 8
      src/index.vue
  5. 232 176
      src/views/framework.vue
  6. 110 53
      src/views/rule.vue

+ 10 - 6
src/api/axios.js

@@ -19,9 +19,9 @@ const service = axios.create({
 
 service.interceptors.request.use(
 	config => {
-		if (getToken()) {
-			config.headers['A-Token'] = getToken()
-		}
+		// if (getToken()) {
+			config.headers['A-Token'] = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczpcL1wvdGVzdC1kaW5nLmcxMDcuY29tXC9hcGlcL2RpbmdcL2xvZ2luIiwiaWF0IjoxNTk3NjMxNzE4LCJleHAiOjE1OTgyMzE3MTgsIm5iZiI6MTU5NzYzMTcxOCwianRpIjoiS1BmVGhOOXJYbUpJZUR5RiIsInN1YiI6MiwicHJ2IjoiY2E2NDg5ZDUwZjI0MDdhNjc4MzBlODA5MGQwMTQ4ODM1Njg1OTYyYiIsInJvbGUiOiJlbXBsb3llZSJ9.Kr9oiHTHOG1X28jsY38QC2y_6RarDhXfHWN0B_ZS7ME'
+		// }
 		return config
 	},
 	error => {
@@ -38,20 +38,24 @@ service.interceptors.response.use(
 					setToken(response.data.refresh_token);
 				}
 			}
+			return response;
 		} else if (response.data.code === 401) {
 			Message({
 				message: response.data.msg,
 				type: 'error',
-				duration: 10 * 1000
+			})
+		}else{
+			Message({
+				message: response.data.msg,
+				type: 'error',
 			})
 		}
-		return response;
+	
 	},
 	error => {
 		Message({
 			message: error.message,
 			type: 'error',
-			duration: 10 * 1000
 		})
 		return Promise.reject(error)
 	}

+ 3 - 2
src/assets/css/reset.css

@@ -189,7 +189,7 @@ table { border-collapse:collapse; border-spacing:0; }
 	background-color: #fff;
 	border-radius: 5px;
 	height: 100%;
-	min-width: 500px;
+	min-width: 800px;
 }
 .terr-left {
 	width: 200px;
@@ -198,7 +198,7 @@ table { border-collapse:collapse; border-spacing:0; }
 }
 .terr-right{
 	padding: 20px;
-	min-width: 300px;
+	min-width: 600px;
 }
 .border-right:after {
 	content: ' ';
@@ -221,6 +221,7 @@ table { border-collapse:collapse; border-spacing:0; }
 	color: #67c23a !important;
 	border: 1px solid #67c23a !important;
 	padding:16px !important;
+	min-width: 800px;
 }
 .diy-tip p{
 	color: #67c23a !important;

+ 11 - 18
src/components/UserImage.vue

@@ -1,10 +1,13 @@
 <template>
   <div>
     <img v-if="info.img_url" class="logo_img" :src="info.img_url" :width="width" :height="height" />
-    <span class="img_round" v-else>
-      <div class="user_name_div" :style="{width: width, height: height,lineHeight: height, fontSize: fontSize + 'rem'}">{{name}}</div>
-      <div class="user_img_bg" :style="{width: width, height: height}" ></div>
-    </span>
+    <div v-else class="user_name_div" :style="{
+	   width: width,
+	   height: height,
+	   lineHeight: height, 
+	   fontSize: fontSize + 'rem'}">
+	   {{name}}
+	 </div>
   </div>
 </template>
 <script>
@@ -102,23 +105,13 @@
   }
 </script>
 <style scoped>
-  .img_round{
-    position: relative;
-    display: inline-block;
-    vertical-align: top;
-  }
-  .img_round .user_img_bg{
-    border-radius: 50%;
-    background: #238dfa;
-  }
   .user_name_div{
-    position: absolute;
-    z-index: 1;
-    text-align: center;
-    color: #fff;
+	border-radius: 50%;
+	background: #238dfa;
+	text-align: center;
+	color: #fff;
   }
   .logo_img{
     border-radius: 50%;
   }
-  /deep/ .van-image{vertical-align: top;}
 </style>

+ 8 - 8
src/index.vue

@@ -12,7 +12,7 @@
 						<div>您当前的版本:15~20人(剩余231天)</div>
 						<el-button size="small" class="upgrade" type="primary" icon="el-icon-upload">续费升级</el-button>
 						<span class="wn">?</span>
-						<userImage style="position: relative;top:8px" :user_name="userData.name" :img_url="userData.img_url" width="44px" height="44px"></userImage>
+						<userImage :user_name="userData.name" :img_url="userData.img_url" width="44px" height="44px"></userImage>
 					</div>
 				</div>
 			</div>
@@ -45,13 +45,13 @@ export default {
 		this.routers = this.$router.options.routes[0].children;
 	},
 	mounted() {
-		var url = window.location.href;
-		var str = this.GetRequest(url).corpId || '123';
-		var corpId = str.split('#')[0];
-		if (corpId) {
-			this.login(corpId);
+		// var url = window.location.href;
+		// var str = this.GetRequest(url).corpId || '123';
+		// var corpId = str.split('#')[0];
+		// if (corpId) {
+		// 	this.login(corpId);
 			this.getTypes();
-		}
+		// }
 	},
 	methods: {
 		login(corpId) {
@@ -145,7 +145,7 @@ export default {
 	overflow: hidden;
 }
 .el-main {
-	background-color: #f4f6f9;
+	background-color: #ccc;
 	height: calc(100vh - 60px);
 	overflow-y: scroll;
 }

+ 232 - 176
src/views/framework.vue

@@ -2,60 +2,90 @@
 	<div>
 		<!-- 头部提示 -->
 		<div class="top-msg margin-bottom">
-			<div>当前组织架构和角色同过钉钉同步,上次同步时间2020-06-14</div>
-			<div>如果您的钉钉通讯录有变动,请及时同步<span class="blue" style="margin-left: 10px;cursor: pointer;"><i class="el-icon-refresh"></i>立即同步</span></div>
+			<div>当前组织架构和角色同过钉钉同步,上次同步时间
+				<span v-if="info.sync_time">{{info.sync_time}}</span>
+				<span v-else>暂未同步</span>
+			</div>
+			<div>
+				如果您的钉钉通讯录有变动,请及时同步
+				<span class="blue" style="margin-left: 10px;cursor: pointer;" @click="tb()" v-loading="tbLoading">
+					<i class="el-icon-refresh"></i>
+					立即同步
+				</span>
+			</div>
 		</div>
 		<div class="all">
 			<div class="flex-box">
-<!-- 				<div class="terr-left">
-					<el-button size="medium"  type="primary">+ 添加规则分类</el-button>
+				<div class="terr-left">
 					<div class="rule_class_box">
-						<div @click="handleNodeClick({ value: 0 })" class="company_name">
+						<div @click="handleNodeClick({ id: 0 })" class="company_name">
 							<img src="../assets/image/two.png" />
-							<span>你好啊</span>
+							<span>{{ info.name }}</span>
 						</div>
-						<el-tree :data="data" class="cate-tree" :props="defaultProps" @node-click="handleNodeClick">
+						<el-tree
+							:data="bmList"
+							class="cate-tree"
+							:expand-on-click-node="false"
+							:highlight-current="true"
+							:props="{ children: '_child', label: 'name' }"
+							@node-click="handleNodeClick"
+						>
 							<div
 								content="tree"
 								v-show="treedata.length != 0"
 								class="flex-box flex-v-ce"
 								slot-scope="{ node, data }"
-								style="font-size: 14px;color: #606266; width:100%; text-align: left;">
-								<img src="../assets/images/one.png" style="width: 20px;"/>
-								<span class="name">{{ data.label }}</span>
-								<span style="position: absolute;right: 0px;display:inline-block;vertical-align: top;margin-top:2px;">({{ data.count }}人)</span>
+								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>
 							</div>
 						</el-tree>
 					</div>
 				</div>
 				<div class="terr-right border-right flex-1">
 					<div class="margin-bottom">
-						<el-input placeholder="输入同事姓名" v-model="input3">
-						    <el-button slot="append" icon="el-icon-search"></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="tableData" @selection-change="handleSelectionChange">
-						<el-table-column type="selection" width="50" ></el-table-column>
-						<el-table-column prop="name" label="姓名"><template slot-scope="scope"></template></el-table-column>
-						<el-table-column prop="tel" label="部门"></el-table-column>
-						<el-table-column prop="company_id" label="入职时间"></el-table-column>
-						<el-table-column prop="status" label="是否参与积分管理"><template slot-scope="scope"></template></el-table-column>
+					<el-table :data="userList" @selection-change="handleSelectionChange" v-loading="tableToading">
+						<el-table-column type="selection" width="50"></el-table-column>
+						<el-table-column label="姓名">
+							<template slot-scope="scope">
+								<div class="flex-box flex-v-ce">
+									<userImage :user_name="scope.row.name" :img_url="scope.row.img_url" width="44px" height="44px"></userImage>
+									<div style="margin-left: 10px;">{{ scope.row.name }}</div>
+								</div>
+							</template>
+						</el-table-column>
+						<el-table-column label="部门">
+							<template slot-scope="scope">
+								<div class="flex-box flex-v-ce bms">
+									<div v-for="(item, index) in scope.row.employee_detail.dept_list" :key="index">{{ item.dept_name }}</div>
+								</div>
+							</template>
+						</el-table-column>
+						<el-table-column prop="accedence_time" label="入职时间"></el-table-column>
+						<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>
+							</template>
+						</el-table-column>
 					</el-table>
 					<div class="pagination">
 						<el-pagination
-							background
-							layout="total,sizes, prev, pager, next"
 							@size-change="handleSizeChange"
-							:page-size="pageLimit"
+							@current-change="handleCurrentChange"
+							:current-page="page + 1"
+							:page-sizes="[10, 20, 30, 40, 50, 100]"
+							:page-size="perPage"
+							layout="total,sizes, prev, pager, next"
 							:total="total"
-							:current-page.sync="currentPage"
-							@current-change="changePage"
 						></el-pagination>
 					</div>
-				</div> -->
-				
+				</div>
 			</div>
-		
 		</div>
 	</div>
 </template>
@@ -64,78 +94,35 @@
 export default {
 	data() {
 		return {
+			is: 1,
+			no: 0,
+			page: 0,
+			perPage: 10,
+			total: 0,
+			info: {}, //公司信息
 			tips_show: true,
-			rule_tree: [],
-			item_list: [],
-			data: [
-				{
-					label: '一级 1',
-					children: [
-						{
-							label: '二级 1-1',
-							children: [
-								{
-									label: '三级 1-1-1'
-								}
-							]
-						}
-					]
-				},
-				{
-					label: '一级 2',
-					children: [
-						{
-							label: '二级 2-1',
-							children: [
-								{
-									label: '三级 2-1-1'
-								}
-							]
-						},
-						{
-							label: '二级 2-2',
-							children: [
-								{
-									label: '三级 2-2-1'
-								}
-							]
-						}
-					]
-				},
-				{
-					label: '一级 3',
-					children: [
-						{
-							label: '二级 3-1',
-							children: [
-								{
-									label: '三级 3-1-1'
-								}
-							]
-						},
-						{
-							label: '二级 3-2',
-							children: [
-								{
-									label: '三级 3-2-1'
-								}
-							]
-						}
-					]
-				}
-			],
-			defaultProps: {
-				children: 'children',
-				label: 'label'
-			},
+			bmList: [],
+			userList: [],
 			class_type: '',
 			treedata: [1],
 			tableData: [],
-			input3:'',
+			keywords: '',
+			dept_id:0,
+				
+			tableToading: false,
+			tbLoading:false,
+			selectIds:[],
 		};
 	},
+	watch:{
+		dept_id(val){
+			this.getEmployee();
+		}
+	},
 	created() {
-		// this.getData();
+		this.getInfo();
+		this.getDepartment();
+		this.getEmployee();
 	},
 	mounted() {
 		this.$nextTick(function() {
@@ -147,98 +134,167 @@ export default {
 		});
 	},
 	methods: {
-		editDetails() {},
-		handleSelectionChange() {},
-		handleNodeClick() {},
-		getData() {
-			var that = this;
-			// this.$axios.get('api/integral/rule/trees', { cycle_type: 1 }).then(res => {
-			// 	this.dept_list = res.data.data.rule_tree;
-			// 	this.rule_category_list = [];
-			// 	this.item_list = res.data.data.item_list;
-			// 	this.parse_tree(this.dept_list, this.pid);
-			// 	if (this.pid > 0) {
-			// 		this.list = this.cur_item_list;
-			// 	} else {
-			// 		this.list = [];
-			// 		for (let i in this.item_list) {
-			// 			for (let k in this.item_list[i]) {
-			// 				this.list.push(this.item_list[i][k]);
-			// 			}
-			// 		}
-			// 	}
-
-			// 	that.rule_tree = res.data.data.rule_tree;
-			// 	that.item_list = res.data.data.item_list;
-			// });
+		//同步信息
+		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})
+				}
+			})
+		},
+		//是否开通
+		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})
+				}
+			});
+		},
+		//批量开通权限
+		participation(){
+			this.$axios.post('api/employee/enable',{ employee_id: this.selectIds}).then(res => {
+				if(res){
+					this.getEmployee();
+				}
+			});
+		},
+		//获取公司信息
+		getInfo() {
+			this.$axios.get('api/site/info').then(res => {
+				this.info = res.data.data;
+			});
+		},
+		//选择员工
+		handleSelectionChange(e) {
+			var arr=[];
+			for(var item in e){
+				arr.push(e[item].id);
+			}
+			this.selectIds=arr;
+		},
+		//点击部门
+		handleNodeClick(e) {
+			this.page = 0;
+			this.dept_id=e.id;
+		},
+		//获取部门
+		getDepartment() {
+			this.$axios.get('api/department/tree').then(res => {
+				this.bmList = res.data.data.list;
+			});
+		},
+		//获取员工
+		getEmployee() {
+			this.tableToading = true;
+			this.$axios.get('api/employee/index', { params: { dept_id: this.dept_id, keywords: this.keywords, page: this.page, page_size: this.perPage } }).then(res => {
+				
+				this.tableToading = false;
+				console.log(res.data.data.pageInfo);
+				this.total = res.data.data.pageInfo.count;
+				this.userList = res.data.data.list;
+			});
 		},
 		//关闭提示
 		tips_close() {
 			localStorage.setItem('rule', 'true');
 			this.tips_show = false;
 		},
+		handleSizeChange: function(val) {
+			this.perPage = val;
+			this.page = 0;
+			this.getEmployee();
+		},
+		//页码变更
+		handleCurrentChange: function(val) {
+			this.page = val - 1;
+			this.getEmployee();
+		}
 	}
 };
 </script>
 
- <style lang="scss" scoped="scoped">
-		// .top-msg div:nth-child(1){
-		// 	margin-bottom: 10px;
-		// }
-		// .company_name {
-		// 	position: relative;
-		// 	display: block;
-		// 	font-family: 'Microsoft YaHei';
-		// 	text-align: left;
-		// 	padding: 15px 25px;
-		// 	cursor: pointer;
-		// 	overflow: hidden;
-		// 	white-space: nowrap;
-		// 	text-overflow: ellipsis;
-		// 	border-bottom: 1px #f8f8f8 solid;
-		// }
-		// .company_name img {
-		// 	position: relative;
-		// 	display: inline-block;
-		// 	top: 2px;
-		// 	width: 18px;
-		// 	height: 18px;
-		// 	margin-right: 4px;
-		// }
-		// .terr-right {
-		// 	.custom-tree-node {
-		// 		margin-left: -4px;
-		// 	}
-		// 	.custom-tree-node * {
-		// 		vertical-align: middle;
-		// 	}
-		// 	.custom-tree-node:hover {
-		// 		.treeIcon {
-		// 			display: inline-block;
-		// 			width: 55%;
-		// 		}
-		// 	}
-		// }
+<style lang="scss" scoped="scoped">
+.name{
+	overflow: hidden;
+	text-overflow: ellipsis;
+	white-space: nowrap;
+	width: 80%;
+}
+.bms div {
+	margin-right: 10px;
+}
+.top-msg div:nth-child(1) {
+	margin-bottom: 10px;
+}
+.company_name {
+	position: relative;
+	display: block;
+	font-family: 'Microsoft YaHei';
+	text-align: left;
+	padding: 15px 25px;
+	cursor: pointer;
+	overflow: hidden;
+	white-space: nowrap;
+	text-overflow: ellipsis;
+	border-bottom: 1px #f8f8f8 solid;
+}
+.company_name img {
+	position: relative;
+	display: inline-block;
+	top: 2px;
+	width: 18px;
+	height: 18px;
+	margin-right: 4px;
+}
+.terr-right {
+	.custom-tree-node {
+		margin-left: -4px;
+	}
+	.custom-tree-node * {
+		vertical-align: middle;
+	}
+	.custom-tree-node:hover {
+		.treeIcon {
+			display: inline-block;
+			width: 55%;
+		}
+	}
+}
 
-		// .rule_class_box {
-		// 	::v-deep .el-tree-node {
-		// 		border-bottom: 1px #f8f8f8 solid;
-		// 	}
-		// 	::v-deep .el-tree-node__content {
-		// 		height: 46px;
-		// 		line-height: 46px;
-		// 	}
-		// 	::v-deep .is-current .el-tree-node__content .el-icon-caret-right {
-		// 		color: #409eff !important;
-		// 	}
-		// 	::v-deep .is-current .el-tree-node__content .el-tree-node__label {
-		// 		color: #409eff !important;
-		// 	}
-		// 	::v-deep .is-current .el-tree-node__children .el-icon-caret-right {
-		// 		color: #c0c4cc !important;
-		// 	}
-		// 	::v-deep .is-current .el-tree-node__children .el-tree-node__label {
-		// 		color: #606266 !important;
-		// 	}
-		// }
+.rule_class_box {
+	::v-deep .el-tree-node {
+		border-bottom: 1px #f8f8f8 solid;
+	}
+	::v-deep .el-tree-node__content {
+		padding: 10px 0;
+		border-bottom: 1px #f8f8f8 solid;
+	}
+	::v-deep .el-tree-node__content:hover {
+		background: #ecf5ff;
+		border-radius: 4px;
+	}
+	::v-deep .is-current .el-tree-node__content .el-icon-caret-right {
+		color: #409eff !important;
+	}
+	::v-deep .is-current .el-tree-node__content .el-tree-node__label {
+		color: #409eff !important;
+	}
+	::v-deep .is-current .el-tree-node__children .el-icon-caret-right {
+		color: #c0c4cc !important;
+	}
+	::v-deep .is-current .el-tree-node__children .el-tree-node__label {
+		color: #606266 !important;
+	}
+	::v-deep .is-current .name {
+		color: #409eff !important;
+		font-weight: normal;
+		transition: 0.35s ease-in-out;
+	}
+}
 </style>

+ 110 - 53
src/views/rule.vue

@@ -9,20 +9,19 @@
 				<div class="terr-left">
 					<el-button size="medium" @click="add_class" type="primary">+ 添加规则分类</el-button>
 					<div class="rule_class_box">
-						<el-tree accordion :data="rule_tree" :expand-on-click-node="false"
-						 class="cate-tree" :props="defaultProps" :highlight-current="true" @node-click="handleNodeClick">
+						<el-tree accordion :data="rule_tree" :expand-on-click-node="false" class="cate-tree" :props="defaultProps" :highlight-current="true" @node-click="handleNodeClick">
 						</el-tree>
 					</div>
 				</div>
 				<div class="terr-right border-right flex-1">
 					<div class="flex-box flex-v-ce">
 						<div class="name">{{selectItem.name}}</div>
-						<el-button size="mini" plain v-if="selectItem.id" @click="edit_class">编辑</el-button>
+						<el-button size="medium" plain v-if="selectItem.id" @click="edit_class">编辑</el-button>
 					</div>
 					<div class="flex-box btns flex-v-ce">
-						<el-button size="mini"  @click="del_item" type="danger" plain>批量删除</el-button>
-						<el-button size="mini" @click="add_rule" type="primary">添加规则</el-button>
-						<el-button size="mini"  @click="import_rules_show = true" plain>导入规则</el-button>
+						<el-button size="medium"  @click="del_item" type="danger" plain>批量删除</el-button>
+						<el-button size="medium" @click="add_rule" type="primary">添加规则</el-button>
+						<el-button size="medium"  @click="import_rules_show = true" plain>导入规则</el-button>
 					</div>
 					<el-table stripe ref="multipleTable" :data="item_list" tooltip-effect="dark" 
 					  @selection-change="handleSelectionChange" @row-click="editDetails" align="center">
@@ -63,8 +62,6 @@
 		  </el-form>
 		</el-dialog>
 		
-		
-		
 		<!-- 添加编辑规则 -->
 		<el-dialog :title="rule_type=='add'?'添加规则':'编辑规则'" :visible.sync="rule_show" :close-on-click-modal="false"
 		  width="700px">
@@ -120,7 +117,7 @@
 		</el-dialog>
 		
 		<!-- 导入规则 -->
-<!-- 		<el-dialog
+		<el-dialog
 		  title="导入规则"
 		  :visible.sync="import_rules_show"
 		  width="500px"
@@ -130,7 +127,7 @@
 		      <div class="text-center">
 		        <p>1、下载规则模版,填写好规则</p>
 		        <p>
-		          <img src="/static/images/rules_mould.png" alt="">
+		          <img src="../assets/image/rules_mould.png" alt="">
 		        </p>
 		        <p>规则表</p>
 		        <p><a target="_blank" :href="'/api/download/rule_item'" ><el-button type="primary">下载模板</el-button></a></p>
@@ -140,7 +137,7 @@
 		      <div class="text-center">
 		        <p>2、上传填好的规则表</p>
 		        <p>
-		          <img src="/static/images/rules_mould1.png" alt="">
+		          <img src="../assets/image/rules_mould1.png" alt="">
 		        </p>
 		        <p>仅支持xls、xlsx格式文件</p>
 		      <el-upload
@@ -161,7 +158,7 @@
 		      </div>
 		    </el-col>
 		  </el-row>
-		</el-dialog> -->
+		</el-dialog>
 	</div>
 </template>
 
@@ -169,6 +166,7 @@
 export default {
 	data() {
 		return {
+			ATOKEN: { 'A-TOKEN': this.$getToken()},
 			tips_show: true,
 			rule_loading:false,
 			rule_tree: [],
@@ -267,7 +265,12 @@ export default {
 			    value: '2'
 			  },
 			],
-			
+			//导入规则
+			import_rules_show: false,
+			save_loading: false,
+			import_btn_show: false,
+			fileList: [],
+			file: null
 		};
 	},
 	created() {
@@ -284,6 +287,61 @@ export default {
 		});
 	},
 	methods: {
+	  // 导入相关
+      close_import(){
+        this.import_rules_show = false
+        this.$refs.upload.clearFiles()
+      },
+      submitUpload() {
+        this.save_loading = true
+        let params = {
+          file: this.file
+        }
+        this.$axios.post('/api/rule/import', params).then(res => {
+          if(res.data.code == 1) {
+            this.import_rules_show = false;
+            this.$message.success({message:res.data.msg})
+          }else{
+            this.$message({type:'error',message:res.data.msg})
+          }
+        }).finally(()=>{
+          this.save_loading = false
+        })
+      },
+      handleSuccess(response) {
+        if(response.code == 1) {
+          this.file = response.data;
+        }
+      },
+      handleRemove(file, fileList) {
+        if (fileList !== null && fileList.length != 0) {
+          this.import_btn_show = true
+        }else{
+          this.import_btn_show = false
+        }
+      },
+      handlePreview(file) {
+        console.log(file);
+      },
+      imgChange(file, fileList){
+        if (fileList !== null && fileList.length != 0) {
+          this.import_btn_show = true
+        }else{
+          this.import_btn_show = false
+        }
+      },
+      beforeFilesUpload(file) {
+        const $ext_list = ['xlsx', 'xls'];
+          let len =  file.name.split('.').length - 1;
+          const $ext_name = file.name.split('.')[len]
+          if ($ext_list.indexOf($ext_name) != -1) {
+            this.import_btn_show = true
+          }else {
+            this.$message.warning('文件格式上传错误,仅支持上传xlsx,xls)')
+            return false
+          }
+      },
+	  
 		edit_submit_rule(form) {
 		  let self = this
 		  self.$refs[form].validate((valid) => {
@@ -428,22 +486,16 @@ export default {
 		    item_id: [this.rules_detail_form.id]
 		  }
 		  self.$confirm('此操作将永久删除该选项, 是否继续?', '提示').then(() => {
-		    self.$http({
-		      url: '/api/integral/rule/items',
-		      method: 'delete',
-		      data: data,
-		    }).then((res) => {
+		   this.$axios.post('/api/integral/rule/items/destroy',data).then((res) => {
 		      if (res.data.code == 1) {
 		        self.$message.success(res.data.msg)
-		        self.get_department_list(function() {})
 		        self.rule_show = false
+				 self.getData();
 		      } else {
 		        self.$message.error(res.data.msg)
 		      }
 		    }).catch((e) => {
 		      self.$message.error(e.data.msg)
-		    }).finally(() => {
-		      self.loading = false
 		    })
 		  }).catch(() => {});
 		},
@@ -510,26 +562,26 @@ export default {
 		  })
 		},
 		
-     editDetails(val) {
-        this.rules_detail_form = JSON.parse(JSON.stringify(val))
-        if(this.rules_detail_form.min_point == this.rules_detail_form.max_point){
-          this.rules_detail_form.range_type = '1'
-        }else{
-          this.rules_detail_form.range_type = '2'
-        }
-        if(this.rules_detail_form.min_point < 0){
-          this.integral_select_name1 = '2'
-        }else{
-          this.integral_select_name1 = '1'
-        }
-        if(this.rules_detail_form.max_point < 0){
-          this.integral_select_name2 = '2'
-        }else{
-          this.integral_select_name2 = '1'
-        }
-		this.rule_show = true
-		this.rule_type = 'edit'
-      },
+		editDetails(val) {
+			this.rules_detail_form = JSON.parse(JSON.stringify(val))
+			if(this.rules_detail_form.min_point == this.rules_detail_form.max_point){
+			  this.rules_detail_form.range_type = '1'
+			}else{
+			  this.rules_detail_form.range_type = '2'
+			}
+			if(this.rules_detail_form.min_point < 0){
+			  this.integral_select_name1 = '2'
+			}else{
+			  this.integral_select_name1 = '1'
+			}
+			if(this.rules_detail_form.max_point < 0){
+			  this.integral_select_name2 = '2'
+			}else{
+			  this.integral_select_name2 = '1'
+			}
+			this.rule_show = true
+			this.rule_type = 'edit'
+		},
 		handleSelectionChange(val) {
 			this.del_item_id = []
 			val.forEach(element => {
@@ -681,6 +733,12 @@ export default {
 </script>
 
 <style scoped lang="scss">
+	.text-center{
+	  text-align: center;
+	}
+	.text-center p{
+	  padding: 10px 0;
+	}
 	.terr-right{
 		.name{
 			font-size: 18px;
@@ -691,24 +749,18 @@ export default {
 			margin-right: 5px;
 		}
 	}
-  // /deep/.el-tree-node__expand-icon.is-leaf {
-  //   color: inherit !important;
-  // }
-  // .text-center{
-  //   text-align: center;
-  // }
-  // .cate-tree /deep/ .is-focusable .el-tree-node__content:hover{
-  //   background:#F5F7FA !important;
-  // }
-  // // wei_left_nav
   .rule_class_box{
     ::v-deep .el-tree-node{
       border-bottom:1px #f8f8f8 solid;
     }
     ::v-deep .el-tree-node__content{
-      height:46px;
-      line-height:46px;
+	  padding:10px 0;
+	  border-bottom: 1px #f8f8f8 solid;
     }
+	::v-deep .el-tree-node__content:hover {
+	  background:#ecf5ff;
+	  border-radius:4px;
+	}
     ::v-deep .is-current .el-tree-node__content .el-icon-caret-right{
       color:#409EFF !important;
     }
@@ -721,6 +773,11 @@ export default {
 	::v-deep .is-current .el-tree-node__children .el-tree-node__label{
       color:#606266 !important;
     }
+	::v-deep .el-tree-node__label{
+		overflow: hidden;
+		text-overflow: ellipsis;
+		white-space: nowrap;
+	}
   }
 .terr-left button{
 	margin: 0 auto;