347617796@qq.com hace 4 años
padre
commit
cb9cc91139

BIN
dist.rar


+ 11 - 4
src/api/axios.js

@@ -19,10 +19,10 @@ const service = axios.create({
 
 service.interceptors.request.use(
 	config => {
-		// if (getToken()) {
-		// 	config.headers['A-Token'] = getToken()
-			config.headers['A-Token'] = ' eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC90ZXN0LWRpbmcuZzEwNy5jb21cL2FwaVwvdGVzdCIsImlhdCI6MTYwMDA2MzkyNywiZXhwIjoxNjAwNjYzOTI3LCJuYmYiOjE2MDAwNjM5MjcsImp0aSI6InNFYVc0eDlmaXJGdDlJU0EiLCJzdWIiOjIsInBydiI6ImNhNjQ4OWQ1MGYyNDA3YTY3ODMwZTgwOTBkMDE0ODgzNTY4NTk2MmIiLCJyb2xlIjoiZW1wbG95ZWUifQ.7o1wC4OOI4MX5WdP4AK5S5k8WoU_30Zjj6CfPU5bhBc'
-		// }
+		if (getToken()) {
+			config.headers['A-Token'] = getToken()
+			// config.headers['A-Token'] = ' eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczpcL1wvZGluZy5pbnN5cy5nMTA3LmNvbVwvYXBpXC9kaW5nXC9sb2dpbiIsImlhdCI6MTYwMDY3NjM5NCwiZXhwIjoxNjAxMjc2Mzk0LCJuYmYiOjE2MDA2NzYzOTQsImp0aSI6IkpPZWZoc0ZpWlpLeUFubHgiLCJzdWIiOjIsInBydiI6ImNhNjQ4OWQ1MGYyNDA3YTY3ODMwZTgwOTBkMDE0ODgzNTY4NTk2MmIiLCJyb2xlIjoiZW1wbG95ZWUifQ.n4UbsnWf48m9tyb7yCHmvkULu-WK2sdrBc8lC2tQxKc'
+		}
 		return config
 	},
 	error => {
@@ -57,6 +57,13 @@ service.interceptors.response.use(
 		}
 	},
 	error => {
+		if(error.message=='interrupt'){
+			// Message({
+			// 	message: '请勿频繁切换页面',
+			// 	type: 'warning',
+			// })
+			return Promise.reject(error.message)
+		}
 		Message({
 			message: error.message,
 			type: 'error',

BIN
src/assets/image/init.gif


BIN
src/assets/image/wn.png


+ 11 - 18
src/components/EmployeeSelector.vue

@@ -38,13 +38,13 @@
                   <div class="employee_cell_clear"></div>
                 </div>
               </a>
-              <div class="persons_box" style="padding-top:4px;">
-                <a class="employee_cell_a" href="javascript:void(0)" v-for="(item,index) in list" :key="index">
+              <div class="persons_box" style="padding-top:4px;" v-if="list.length>0">
+                <a class="employee_cell_a"  href="javascript:void(0)" v-for="(item,index) in list" :key="index">
                   <div class="employee_cell flex-box flex-v-ce" v-if="can_select_employee" @click.prevent.stop="select_employee(item)">
-					          <div class="employee_checkbox">
+					<div class="employee_checkbox">
                       <el-checkbox v-model="item.checked"></el-checkbox>
                     </div>
-					            <userImage :user_name="item.name" :img_url="item.img_url" width="30px" height="30px"></userImage>
+					<userImage :user_name="item.name" :img_url="item.img_url" width="30px" height="30px"></userImage>
                     <div class="employee_name">
                       {{item.name}}
                     </div>
@@ -52,6 +52,7 @@
                   </div>
                 </a>
               </div>
+			  <div v-else class="fontColorF" style="text-align: center;margin-top: 50px;">暂无可选人员,请确保在'组织架构'中的人员开启了参与积分管理</div>
             </div>
           </el-scrollbar>
         </el-col>
@@ -421,11 +422,9 @@
         if (this.employee_list.length > 0) {
           return
         }
-        this.$axios.get('/api/department/index', {
-          params: {
+        this.$axios('get','/api/department/index',{
             pid: this.pid,
             keyword: this.keyword
-          }
         }).then((res) => {
           for (let i in res.data.data.list) {
             res.data.data.list[i]['checked'] = false
@@ -447,13 +446,10 @@
       },
      //获取员工详情
       get_user_list() {
-        
         this.table_loading = true;
         var _this=this;
         var employee_selected_list=this.employee_selected_list;
-		
 		// var my_id=this.$getUserData().id;
-		
         if (this.employee_list.length > 0) {
           let list = this.employee_list
           for (let i in list) {
@@ -479,15 +475,13 @@
           return false
         }
         this.list = []
-        this.$axios.get('/api/employee/index', {
-          params: {
+        this.$axios('get','/api/employee/index', {
             dept_id: this.pid,//员工ID
             keywords: this.keyword,//搜索关键字
             page: 0,
             page_size: 2000
-          }
         }).then((res) => {
-          this.table_loading = false;
+          
           var employee=res.data.data.list||[];
 		  var userAll=[];
           employee.forEach((item,i)=>{
@@ -510,11 +504,10 @@
           if (userAll.length == employee_selected_list.length) {
             this.checked = true
           }
-		  if(userAll.length==0){
-				this.$message("暂无可选人员,请确保在'组织架构'中的人员开启了参与积分管理!");
-		  }
           _this.list = userAll
-        })
+        }).finally(() => {
+		    this.table_loading = false;
+		})
       }
     },
     created() {

+ 6 - 2
src/components/publics/workpoints.vue

@@ -13,7 +13,7 @@
 					  <span class="initia_mark" v-show="v.initia_mark">?</span>
 					</el-tooltip>
 				  </template>
-				<el-switch v-model="v.initia_input.age" :active-value="is" :inactive-value="no"></el-switch>
+				<el-switch v-model="v.initia_input.age" :active-value="is" :inactive-value="no" @change="changeAge"></el-switch>
 		  </el-form-item>	
           <el-form-item  style="margin: 20px 0 0 0 " v-else>
             <template slot="label">
@@ -23,7 +23,7 @@
                 <span class="initia_mark" v-show="v.initia_mark">?</span>
               </el-tooltip>
             </template>
-            <el-input type="age" v-model="v.initia_input.age"  autocomplete="off"  class="nitia_list_input"  placeholder="请输入分值" oninput="if(this.value=='00'){this.value='0';}else{this.value=this.value.replace(/[^0-9]/g,'')}"></el-input>
+            <el-input type="age" v-model="v.initia_input.age" :disabled="disabled"  autocomplete="off"  class="nitia_list_input"  placeholder="请输入分值" oninput="if(this.value=='00'){this.value='0';}else{this.value=this.value.replace(/[^0-9]/g,'')}"></el-input>
 		  </el-form-item>
         </el-form>
       </div>
@@ -47,6 +47,7 @@ export default {
     return {
 		is: 1,
 		no: 0,
+		disabled:false
 	};
   },
   created() {
@@ -54,6 +55,9 @@ export default {
   },
   mounted() {},
   methods: {
+	changeAge(e){
+		this.disabled=e==1? false:true
+	},
     save() {
       let arr = [];
 

+ 110 - 76
src/index.vue

@@ -1,33 +1,74 @@
 <template>
 	<el-container class="box-all" v-loading="loading">
 		<el-header>
-			<div class="flex-box">
+			<div class="flex-box" style="height: 60px;">
 				<div class="logo-box flex-box flex-center-center">
 					<img src="./assets/image/logo.png" class="logo" />
 					<div>功道云积分制</div>
 				</div>
-				<div class="flex-1 hea-right flex-box flex-v-ce">
+				<div class="flex-1 hea-right flex-box flex-v-ce" v-if="info.name">
 					<div class="name flex-1">{{ info.name }}</div>
 					<div class="flex-box flex-v-ce">
-						<div>您当前的版本:15~20人(剩余231天)</div>
-						<el-button size="small" @click="tz" class="upgrade" type="primary" icon="el-icon-upload">续费升级</el-button>
-						<span class="wn">?</span>
-						<userImage :user_name="userData.name" :img_url="userData.img_url" width="44px" height="44px"></userImage>
+<!-- 						<div>您当前的版本:15~20人(剩余231天)</div>
+						<el-button size="small" @click="tz" class="upgrade" type="primary" icon="el-icon-upload">续费升级</el-button> -->
+						<el-tooltip class="item" effect="dark" content="设置向导" placement="bottom">
+							<img src="./assets/image/wn.png" class="wn" @click="showWn">
+						</el-tooltip>
+						<!-- <userImage :user_name="userData.name" :img_url="userData.img_url" width="44px" height="44px"></userImage> -->
 					</div>
 				</div>
 			</div>
 		</el-header>
 		<el-container class="main">
 			<el-aside>
-				<el-menu default-active="1" class="el-menu-vertical-demo" :router="true">
+				<el-menu :default-active="defaultActive" class="el-menu-vertical-demo" :router="true">
 					<el-menu-item :index="(index + 1).toString()" :route="item.path" v-for="(item, index) in routers" :key="index">
 						<span class="iconfont" :class="item.meta.icon"></span>
 						<span slot="title" style="margin-left: 10px;">{{ item.name }}</span>
 					</el-menu-item>
 				</el-menu>
 			</el-aside>
-			<el-main><router-view /></el-main>
+			<el-main>
+				<router-view />
+				<div class="fontColorF" style="text-align: center;margin: 20px 0;">Copyright © 2020 广东功道云数字科技有限公司 All Rights Reserved</div>
+			</el-main>
 		</el-container>
+		<el-dialog title="设置向导" :visible.sync="wn_show" width="600px">
+			<div>
+				<div class="wn-title fontColorF">三步轻松搭建积分管理体系:建制度、定人员</div>
+				<div class="flex-box flex-v-ce wn-box">
+					<div class="flex-1 flex-box-v flex-v-ce"  @click="openView(0)">
+						<div><span class="iconfont " :class="routers[0].meta.icon"></span></div>
+						<div>1、建立{{routers[0].name}}</div>
+					</div>
+					<div class="flex-1 flex-box-v flex-v-ce"  @click="openView(1)">
+						<div><span class="iconfont " :class="routers[1].meta.icon"></span></div>
+						<div>2、确定{{routers[1].name}}</div>
+					</div>
+					<div class="flex-1 flex-box-v flex-v-ce"  @click="openView(2)">
+						<div><span class="iconfont " :class="routers[2].meta.icon"></span></div>
+						<div>3、分配{{routers[2].name}}</div>
+					</div>
+				</div>
+			</div>
+			<div>
+				<div class="wn-title fontColorF">更有效地做好积分激励和认可,你还可以设置</div>
+				<div class="flex-box flex-v-ce wn-box">
+					<div class="flex-1 flex-box-v flex-v-ce" @click="openView(3)">
+						<div><span class="iconfont " :class="routers[3].meta.icon"></span></div>
+						<div>{{routers[3].name}}</div>
+					</div>
+					<div class="flex-1 flex-box-v flex-v-ce" @click="openView(4)">
+						<div><span class="iconfont " :class="routers[4].meta.icon"></span></div>
+						<div>{{routers[4].name}}</div>
+					</div>
+					<div class="flex-1 flex-box-v flex-v-ce" @click="openView(5)">
+						<div><span class="iconfont " :class="routers[5].meta.icon"></span></div>
+						<div>{{routers[5].name}}</div>
+					</div>
+				</div>
+			</div>
+		</el-dialog>
 	</el-container>
 </template>
 
@@ -36,97 +77,95 @@ export default {
 	data() {
 		return {
 			loading: false,
-			userData: '',
+			userData: {},
 			routers: [],
-			info: ''
+			info: {},
+			wn_show:false,
+			defaultActive:"1"
 		};
 	},
 	created() {
 		this.routers = this.$router.options.routes[0].children;
+		this.userData=this.$getUserData();
 	},
 	mounted() {
-		// var url = window.location.href;
-		// var str = this.GetRequest(url).corpId || '123';
-		// var corpId = str.split('#')[0];
-		// if (corpId) {
-		// 	this.login(corpId);
-			this.getTypes();
-		// }
+		this.getTypes();
+		this.getInfo();
+		this.$nextTick(function() {
+			if (localStorage.getItem('wn_show')) {
+				this.wn_show = false;
+			} else {
+				this.wn_show = true;
+				localStorage.setItem('wn_show','true');
+			}
+		});
 	},
 	methods: {
-		tz(){},
-		login(corpId) {
-			var that = this;
-			this.loading=true;
-			this.$dd.runtime.permission.requestAuthCode({
-				corpId: corpId, // 企业id
-				onSuccess: function(info) {
-					that.$axios.post('api/ding/login', { authCode: info.code, corpId: corpId }).then(res => {
-						var is=false;
-						if (res.data.code == 1) {
-							var { token, user } = res.data.data;
-							user.employee_detail.role_list.forEach(item=>{
-								if(user.is_official==1){
-									if(item.name=='admin'||item.name=='creator'||item.name=='point_manager'){
-										is=true;
-									}
-								}
-							})
-							if(is){
-								that.$setUserData(user);
-								that.userData = user;
-								that.getInfo();
-							}else{
-								that.$router.replace({path:'/noAccess'})
-							}
-						}
-					}).finally(() => {
-						that.loading = false;
-					});
-				}
-			});
+		openView(e){
+			this.defaultActive=(e+1).toString();
+			this.wn_show=false;
+			this.$router.push({path:this.routers[e].path})
+		},
+		showWn(){
+			this.wn_show=true;
 		},
 		getInfo() {
 			var that = this;
-			this.$axios.get('api/site/info').then(res => {
+			this.$axios('get','api/site/info').then(res => {
 				that.info = res.data.data;
 			});
 		},
 		getTypes() {
 			var that = this;
-			this.$axios.get('api/integral/types').then(res => {
+			this.$axios('get','api/integral/types').then(res => {
 				that.$setTyps(res.data.data.list);
 			});
 		},
-		GetRequest(urlStr) {
-			if (typeof urlStr == 'undefined') {
-				var url = decodeURI(location.search); //获取url中"?"符后的字符串
-			} else {
-				var url = '?' + urlStr.split('?')[1];
-			}
-			var theRequest = new Object();
-			var strs;
-			if (url.indexOf('?') != -1) {
-				var str = url.substr(1);
-				strs = str.split('&');
-				for (var i = 0; i < strs.length; i++) {
-					theRequest[strs[i].split('=')[0]] = decodeURI(strs[i].split('=')[1]);
-				}
-			}
-			return theRequest;
-		}
 	}
 };
 </script>
 
 <style scoped="scoped" lang="scss">
+.wn-box{
+	padding: 20px 0;
+}
+.wn-box .flex-1{
+	cursor: pointer;
+}
+.wn-box .flex-1 div:nth-child(1){
+	width: 55px;
+	height: 55px;
+	border-radius: 50%;
+	text-align: center;
+	line-height: 55px;
+	background-color: #E0F2FF;
+	color: #26A2FF;
+	margin-bottom: 20px;
+}
+.wn-box .flex-1 div:nth-child(2){
+	width: 110px;
+	border-radius: 25px;
+	border: 1px solid #26A2FF;
+	padding:7px 10px;
+	text-align: center;
+	color: #26A2FF;
+}
+.wn-box .flex-1:hover div:nth-child(1){
+	color: #fff;
+	background-color: #26A2FF;
+}
+
+.wn-box .flex-1:hover div:nth-child(2){
+	color: #fff;
+	background-color: #26A2FF;
+}
 .el-menu-vertical-demo:not(.el-menu--collapse) {
 	width: 180px;
 	min-height: 400px;
 }
 .el-header {
 	background-color: #fff;
-	line-height: 60px;
+	// line-height: 60px;
 	padding: 0 !important;
 	border-bottom: 1px solid #f1f1f1;
 }
@@ -171,7 +210,7 @@ export default {
 	background-color: #D9D9D9;
 }
 .logo-box {
-	width: 200px;
+	width: 180px;
 }
 .logo-box .logo {
 	width: 30px;
@@ -185,13 +224,8 @@ export default {
 .wn {
 	height: 26px;
 	width: 26px;
-	border: 1px solid #c0c4cc;
-	line-height: 26px;
-	text-align: center;
-	border-radius: 50px;
-	margin: 0 10px;
-	font-size: 18px;
-	color: #c0c4cc;
+	margin-right: 12px;
+	cursor: pointer;
 }
 .hea-right {
 	padding: 0 20px;

+ 94 - 0
src/init.vue

@@ -0,0 +1,94 @@
+<template>
+	<div class="noData flex-box-v flex-center-center">
+		<div class="data-all">
+			<img src="./assets/image/init.gif" class="appImg"/>
+			<div>管理执行难,就用功道云</div>
+		</div>
+	</div>
+</template>
+
+<script>
+	export default{
+		data(){
+			return{
+				
+			}
+		},
+		mounted() {
+			var url = window.location.href;
+			var str = this.GetRequest(url).corpId || '123';
+			var corpId = str.split('#')[0];
+			if (corpId) {
+				this.login(corpId);
+			}
+		},
+		methods:{
+			login(corpId) {
+				var that = this;
+				this.loading=true;
+				this.$dd.runtime.permission.requestAuthCode({
+					corpId: corpId, // 企业id
+					onSuccess: function(info) {
+						that.$axios('post','api/ding/login', { authCode: info.code, corpId: corpId }).then(res => {
+							var is=false;
+							if (res.data.code == 1) {
+								var { token, user } = res.data.data;
+								user.employee_detail.role_list.forEach(item=>{
+									if(user.is_official==1){
+										if(item.name=='admin'||item.name=='creator'||item.name=='point_manager'){
+											is=true;
+										}
+									}
+								})
+								if(is){
+									that.$setUserData(user);
+									that.$router.replace({path:'/index'})
+								}else{
+									that.$router.replace({path:'/noAccess'})
+								}
+							}
+						}).finally(() => {
+							that.loading = false;
+						});
+					}
+				});
+			},
+			GetRequest(urlStr) {
+				if (typeof urlStr == 'undefined') {
+					var url = decodeURI(location.search); //获取url中"?"符后的字符串
+				} else {
+					var url = '?' + urlStr.split('?')[1];
+				}
+				var theRequest = new Object();
+				var strs;
+				if (url.indexOf('?') != -1) {
+					var str = url.substr(1);
+					strs = str.split('&');
+					for (var i = 0; i < strs.length; i++) {
+						theRequest[strs[i].split('=')[0]] = decodeURI(strs[i].split('=')[1]);
+					}
+				}
+				return theRequest;
+			}
+		}
+	} 
+</script>
+
+<style scoped="scoped">
+	.appImg{
+		width: 200px;
+		height: 200px;
+	}
+	.noData{
+		text-align: center;
+		position: fixed;
+		left: 0;
+		top: 0;
+		right: 0;
+		bottom: 0;
+	}
+	.data-all{
+		margin-bottom: 10%;
+		color: #595959;
+	}
+</style>

+ 65 - 1
src/main.js

@@ -6,6 +6,7 @@ import ElementUI from 'element-ui';
 import 'element-ui/lib/theme-chalk/index.css';
 import * as dd from 'dingtalk-jsapi';
 import VConsole from 'vconsole'
+import axios from 'axios'
 import service from './api/axios'
 import { getToken, setToken,getUserData,setUserData,getTyps,setTyps } from './api/auth';
 
@@ -19,7 +20,6 @@ Vue.use(ElementUI);
 // }
 
 Vue.prototype.$dd=dd;
-Vue.prototype.$axios = service
 Vue.prototype.$getToken = getToken
 Vue.prototype.$setToken = setToken
 Vue.prototype.$getUserData = getUserData
@@ -27,6 +27,70 @@ Vue.prototype.$setUserData = setUserData
 Vue.prototype.$getTyps = getTyps
 Vue.prototype.$setTyps = setTyps
 
+Vue.prototype.$http= service;
+//Vue函数添加一个原型属性$axios 指向axios,这样vue实例或组件中不用再去重复引用Axios 直接用this.$axios就能执行axios 方法
+var CancelToken = axios.CancelToken;
+Vue.$httpRequestList=[];
+
+Vue.prototype.$axios = (type, url, data) => {
+	if(url!='api/ding/login'&&url!='api/integral/types'){
+		if(getToken()){
+			return new Promise((resolve, reject) => {   //封装ajax
+			    var aa = {
+			        method: type,
+			        url: url,
+			        cancelToken: new CancelToken(c => {  //强行中断请求要用到的
+			            Vue.$httpRequestList.push(c);
+			        })
+			    }
+			    var json = (type == 'get') ? Object.assign(aa, { params: data }) : Object.assign(aa, { data: data });
+			    var ajax = Vue.prototype.$http(json).then(res => {
+			        resolve(res);
+			    }).catch(error => {   //中断请求和请求出错的处理
+			            if (error.message == "interrupt") {
+			                console.log('已中断请求');
+			                return;
+			            } else {
+			                reject(error);
+			            }
+			        })
+			    return ajax;
+			})
+		}else{return Promise.reject('无token')}
+	}else{
+		return new Promise((resolve, reject) => {   //封装ajax
+		    var aa = {
+		        method: type,
+		        url: url,
+		        cancelToken: new CancelToken(c => {  //强行中断请求要用到的
+		            Vue.$httpRequestList.push(c);
+		        })
+		    }
+		    var json = (type == 'get') ? Object.assign(aa, { params: data }) : Object.assign(aa, { data: data });
+		    var ajax = Vue.prototype.$http(json).then(res => {
+		        resolve(res);
+		    }).catch(error => {   //中断请求和请求出错的处理
+		            if (error.message == "interrupt") {
+		                console.log('已中断请求');
+		                return;
+		            } else {
+		                reject(error);
+		            }
+		        })
+		    return ajax;
+		})
+	}
+};
+
+router.beforeEach((to, from, next) => {   //路由切换检测是否强行中断,
+    if(Vue.$httpRequestList.length>0){        //强行中断时才向下执行
+        Vue.$httpRequestList.forEach(item=>{
+            item('interrupt');//给个标志,中断请求
+        })  
+    }
+    next();    
+});
+
 
 Vue.config.productionTip = false
 new Vue({

+ 68 - 52
src/router/index.js

@@ -3,62 +3,78 @@ import VueRouter from 'vue-router'
 
 Vue.use(VueRouter)
 
-  const routes = [
-  {
-    path: '/',
-    name: '首页',
-    component: () => import('@/index'),
-	redirect: "rule",
-	children:[
-		{
-		  path: '/rule',
-		  name: '积分规则',
-		  component: () => import('@/views/rule.vue'),
-		  meta:{icon:'icon-shezhi_jifenguize'}
+const routes = [
+	{
+		path: '/index',
+		name: '首页',
+		component: () => import('@/index'),
+		redirect: "rule",
+		children: [{
+				path: '/rule',
+				name: '积分规则',
+				component: () => import('@/views/rule.vue'),
+				meta: {
+					icon: 'icon-shezhi_jifenguize'
+				}
+			},
+			{
+				path: '/framework',
+				name: '组织架构',
+				component: () => import('@/views/framework.vue'),
+				meta: {
+					icon: 'icon-shezhi_zuzhijiagou'
+				}
+			},
+			{
+				path: '/jurisdiction',
+				name: '角色权限',
+				component: () => import('@/views/jurisdiction.vue'),
+				meta: {
+					icon: 'icon-shezhi_jiaose'
+				}
+			},
+			{
+				path: '/initialPoint',
+				name: '初始分',
+				component: () => import('@/views/initialPoint.vue'),
+				meta: {
+					icon: 'icon-shezhi_jichushezhi'
+				}
+			},
+			{
+				path: '/check',
+				name: '考勤积分',
+				component: () => import('@/views/check.vue'),
+				meta: {
+					icon: 'icon-kaoqin_kaoqinyuebaobiao'
+				}
+			},
+			{
+				path: '/voluntarilyPoint',
+				name: '自动积分',
+				component: () => import('@/views/voluntarilyPoint.vue'),
+				meta: {
+					icon: 'icon-shezhi_zidongjifen'
+				}
+			}
+		]
+	},
+	{
+		path: '/',
+			name: '初始化',
+			component: () => import('@/init'),
 		},
-		{
-		  path: '/framework',
-		  name: '组织架构',
-		  component: () => import('@/views/framework.vue'),
-		   meta:{icon:'icon-shezhi_zuzhijiagou'}
-		},
-		{
-		  path: '/jurisdiction',
-		  name: '角色权限',
-		  component: () => import('@/views/jurisdiction.vue'),
-		   meta:{icon:'icon-shezhi_jiaose'}
-		},
-		{
-		  path: '/initialPoint',
-		  name: '初始分',
-		  component: () => import('@/views/initialPoint.vue'),
-		   meta:{icon:'icon-shezhi_jichushezhi'}
-		},
-		{
-		  path: '/check',
-		  name: '考勤积分',
-		  component: () => import('@/views/check.vue'),
-		   meta:{icon:'icon-kaoqin_kaoqinyuebaobiao'}
-		},
-		{
-		  path: '/voluntarilyPoint',
-		  name: '自动积分',
-		  component: () => import('@/views/voluntarilyPoint.vue'),
-		   meta:{icon:'icon-shezhi_zidongjifen'}
-		}
-	]
-  },
-  {
-  path: '/noAccess',
-  name: '无权限',
-  component: () => import('@/noAccess'),
-  }
+	{
+		path: '/noAccess',
+		name: '无权限',
+		component: () => import('@/noAccess'),
+	},
 ]
 
 const router = new VueRouter({
-  // mode: 'history',
-  base: process.env.BASE_URL,
-  routes
+	// mode: 'history',
+	base: process.env.BASE_URL,
+	routes
 })
 
 export default router

+ 31 - 30
src/views/check.vue

@@ -17,6 +17,14 @@ export default {
         initial_width: "165px",
       },
       initia_arr: [
+		  {
+			initialName: "是否启用考勤设置",
+			initia_mark: false,
+			type:'switch',
+			initia_input: {
+			  age: "0",
+			},
+		  },
         {
           initialName: "月度全勤,每月加分",
           initia_mark: false,
@@ -73,14 +81,6 @@ export default {
             age: "0",
           },
         },
-		{
-		  initialName: "是否启用考勤设置",
-		  initia_mark: false,
-		  type:'switch',
-		  initia_input: {
-		    age: "0",
-		  },
-		},
       ],
 	     obj: {
 	          month_full_ad: "", //>=0
@@ -104,16 +104,16 @@ export default {
   methods: {
     initia(ok) {
       var objs = {};
-      objs.month_full_ad =ok[0].sj; //>=0
-      objs.normal = ok[1].sj; //>=0
-      objs.no_sign = ok[2].sj>0? -ok[2].sj:ok[2].sj; //<=0
-      objs.absent = ok[3].sj>0? -ok[3].sj:ok[3].sj; //<=0
-      objs.on_duty_late = ok[4].sj>0? -ok[4].sj:ok[4].sj; //<=0
-      objs.off_duty_early = ok[5].sj>0? -ok[5].sj:ok[5].sj; //<=0
-      objs.ot_per_hour = ok[6].sj; //>=0
-      objs.leave_per_hour = ok[7].sj>0? -ok[7].sj:ok[7].sj; //<=0
-	  objs.enable = ok[8].sj; 
-      this.$axios.post("api/ad/update",objs).then((res) => {
+	  objs.enable = ok[0].sj; 
+      objs.month_full_ad =ok[1].sj; //>=0
+      objs.normal = ok[2].sj; //>=0
+      objs.no_sign = ok[3].sj>0? -ok[3].sj:ok[3].sj; //<=0
+      objs.absent = ok[4].sj>0? -ok[4].sj:ok[4].sj; //<=0
+      objs.on_duty_late = ok[5].sj>0? -ok[5].sj:ok[5].sj; //<=0
+      objs.off_duty_early = ok[6].sj>0? -ok[6].sj:ok[6].sj; //<=0
+      objs.ot_per_hour = ok[7].sj; //>=0
+      objs.leave_per_hour = ok[8].sj>0? -ok[8].sj:ok[8].sj; //<=0
+      this.$axios('post',"api/ad/update",objs).then((res) => {
           if (res.data.code == 1) {
             this.$message({
               message: res.data.msg,
@@ -126,24 +126,25 @@ export default {
     },
     cheak_ax() {
       this.loading = true;
-      this.$axios.get("api/ad/info").then((res) => {
-        this.loading = false;
+      this.$axios('get',"api/ad/info").then((res) => {
         var arr = [],config=res.data.data;
 		config.no_sign=config.no_sign-(config.no_sign+config.no_sign);
 		config.absent=config.absent-(config.absent+config.absent);
 		config.on_duty_late=config.on_duty_late-(config.on_duty_late+config.on_duty_late);
 		config.off_duty_early=config.off_duty_early-(config.off_duty_early+config.off_duty_early);
 		config.leave_per_hour=config.leave_per_hour-(config.leave_per_hour+config.leave_per_hour);
-        this.initia_arr[0].initia_input.age =config.month_full_ad? config.month_full_ad:0
-        this.initia_arr[1].initia_input.age =config.normal? config.normal:0
-        this.initia_arr[2].initia_input.age =config.no_sign? config.no_sign:0
-        this.initia_arr[3].initia_input.age =config.absent? config.absent:0
-        this.initia_arr[4].initia_input.age =config.on_duty_late? config.on_duty_late:0
-        this.initia_arr[5].initia_input.age =config.off_duty_early? config.off_duty_early:0
-        this.initia_arr[6].initia_input.age =config.ot_per_hour? config.ot_per_hour:0
-		this.initia_arr[7].initia_input.age =config.leave_per_hour? config.leave_per_hour:0
-		this.initia_arr[8].initia_input.age =config.enable? config.enable:0
-      });
+		this.initia_arr[0].initia_input.age =config.enable? config.enable:0
+        this.initia_arr[1].initia_input.age =config.month_full_ad? config.month_full_ad:0
+        this.initia_arr[2].initia_input.age =config.normal? config.normal:0
+        this.initia_arr[3].initia_input.age =config.no_sign? config.no_sign:0
+        this.initia_arr[4].initia_input.age =config.absent? config.absent:0
+        this.initia_arr[5].initia_input.age =config.on_duty_late? config.on_duty_late:0
+        this.initia_arr[6].initia_input.age =config.off_duty_early? config.off_duty_early:0
+        this.initia_arr[7].initia_input.age =config.ot_per_hour? config.ot_per_hour:0
+		this.initia_arr[8].initia_input.age =config.leave_per_hour? config.leave_per_hour:0
+      }).finally(err=>{
+			this.loading = false;
+	  });
     },
   },
 };

+ 8 - 8
src/views/framework.vue

@@ -3,7 +3,7 @@
 		<!-- 头部提示 -->
 		<div class="top-msg" style="margin-bottom: 10px;">
 			<div>
-				当前组织架构和角色同过钉钉同步,上次同步时间
+				当前组织架构成员通过钉钉通讯录同步,上次同步时间
 				<span v-if="info.sync_time">{{ info.sync_time }}</span>
 				<span v-else>暂未同步</span>
 			</div>
@@ -163,8 +163,8 @@ export default {
 			  type: 'warning'
 			}).then(() => {
 				this.tbLoading = true;
-				var http1 = this.$axios.post('api/ding/department_sync');
-				var http2 = this.$axios.post('api/ding/employee_sync');
+				var http1 = this.$axios('post','api/ding/department_sync');
+				var http2 = this.$axios('post','api/ding/employee_sync');
 				Promise.all([http1, http2]).then(res => {
 					if (res[0]) {
 						this.$message.success({ message: '同步成功' });
@@ -178,7 +178,7 @@ export default {
 		//是否开通
 		changeIs(e, id) {
 			var url = e == 1 ? 'api/employee/disable' : 'api/employee/enable';
-			this.$axios.post(url, { employee_id: [id] }).then(res => {
+			this.$axios('post',url, { employee_id: [id] }).then(res => {
 				if (res) {
 					if(e==0){
 						this.$message.success({ message: '开启成功,可在"角色权限设置对应管理范围"' });
@@ -192,7 +192,7 @@ export default {
 		//批量开通权限
 		participation() {
 			this.enable_loading=true;
-			this.$axios.post('api/employee/enable', { employee_id: this.selectIds }).then(res => {
+			this.$axios('post','api/employee/enable', { employee_id: this.selectIds }).then(res => {
 				if (res) {
 					this.$message.success({ message: '开启成功,可在"角色权限设置对应管理范围"' });
 					this.getEmployee();
@@ -203,7 +203,7 @@ export default {
 		},
 		//获取公司信息
 		getInfo() {
-			this.$axios.get('api/site/info').then(res => {
+			this.$axios('get','api/site/info').then(res => {
 				this.info = res.data.data;
 				this.getDepartment();
 			});
@@ -223,7 +223,7 @@ export default {
 		},
 		//获取部门
 		getDepartment() {
-			this.$axios.get('api/department/tree').then(res => {
+			this.$axios('get','api/department/tree').then(res => {
 				var list=[{
 					id:0,
 					name:this.info.name,
@@ -236,7 +236,7 @@ export default {
 		//获取员工
 		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.$axios('get','api/employee/index', {dept_id: this.dept_id, keywords: this.keywords, page: this.page, page_size: this.perPage }).then(res => {
 				this.total = res.data.data.pageInfo.count;
 				this.userList = res.data.data.list;
 			}).finally(err=>{

+ 5 - 7
src/views/initialPoint.vue

@@ -53,12 +53,9 @@ export default {
   methods: {
     initia(ok) {
       this.loading = true;
-
       this.obj.base_point = +ok[0].sj;
       this.obj.service_point = +ok[1].sj;
-      this.$axios
-        .post("api/integral/site/config", this.obj)
-        .then((res) => {
+      this.$axios('post',"api/integral/site/config", this.obj).then((res) => {
           if (res.data.code == 1) {
             this.$message({
               message: res.data.msg,
@@ -71,15 +68,16 @@ export default {
     },
     cheak_ax() {
       this.loading = true;
-      this.$axios.get("/api/integral/site/config").then((res) => {
-        this.loading = false;
+      this.$axios('get',"/api/integral/site/config").then((res) => {
         var arr = [];
         for (let i in res.data.data) {
           arr.push(res.data.data[i]);
         }
         this.initia_arr[0].initia_input.age = Math.abs(arr[0]);
         this.initia_arr[1].initia_input.age = Math.abs(arr[3]);
-      });
+      }).finally(err=>{
+			this.loading = false;
+	  });
     },
   },
 };

+ 10 - 19
src/views/jurisdiction.vue

@@ -481,13 +481,10 @@ export default {
 		},
 		//设置管理范围
 		sub_management_scope(){
+		 console.log("进来了")
 		  this.scope_loading=true;
 		  this.$refs.Employee2.confirm();//调用组件的confirm();
-		  this.$axios({
-		    url: '/api/employee/scope',
-		    method: 'POST',
-		    data: {employee_id: this.list_info.id,id: this.management_arr},
-		  }).then((res) => {
+		  this.$axios('post','/api/employee/scope',{employee_id: this.list_info.id,id: this.management_arr}).then((res) => {
 		    if (res.data.code == 1) {
 		      this.$message.success("设置成功,如需登录积分管理平台,需到组织架构开启参与积分管理");
 		      this.table_list.forEach(element => {
@@ -501,6 +498,7 @@ export default {
 		},
 		//添加编辑管理范围
 		management_scope_confirm(val){
+			console.log("进来了2")
 		  this.management_arr = []
 		  val.employee.forEach(element => {
 		    this.management_arr.push(element.id)
@@ -510,7 +508,7 @@ export default {
 		  this.list_info = item;
 		  this.my_no_select=item.id;
 		  this.management_scope_arr.employee=[];
-		  this.$axios.get('/api/employee/info',{params: {id: this.list_info.id}}).then((res) => {
+		  this.$axios('get','/api/employee/info',{id: this.list_info.id}).then((res) => {
 		    if (res.data.code == 1) {
 		      this.management_scope_arr.employee = res.data.data.employee_detail.manage_scope||[];//获取当前数据的管理范围
 		      this.management_scope_show = true
@@ -522,7 +520,7 @@ export default {
 		sub_employee_limit(){
 		  this.integral_loading=true;
 		  this.integral_limit_form.employee_id = this.set_mployee_limit_id
-		  this.$axios.post('/api/integral/employee/limit',this.integral_limit_form).then((res) => {
+		  this.$axios('post','/api/integral/employee/limit',this.integral_limit_form).then((res) => {
 		    if (res.data.code == 1) {
 		      this.$message.success(res.data.msg)
 		      this.get_table_list()
@@ -537,7 +535,7 @@ export default {
 		},
 		get_employee_limit(id){
 		  this.integral_limit_loading = true
-		  this.$axios.get('/api/integral/employee/limit',{params: {employee_id: id}}).then((res) => {
+		  this.$axios('get','/api/integral/employee/limit',{employee_id: id}).then((res) => {
 		    if (res.data.code == 1) {
 		       var item = res.data.data;
 				if (item.point_limit == null || item.point_limit == undefined||item.point_limit.length==0) {
@@ -569,7 +567,7 @@ export default {
 				}	
 			 this.setUser_loading=true;
 			 this.$nextTick(()=>{
-				 this.$axios.post('/api/role/user/many',data).then((res) => {
+				 this.$axios('post','/api/role/user/many',data).then((res) => {
 				   if (res.data.code == 1) {
 					 this.$message.success('已经添加成功,请稍后刷新查看')
 					 this.add_employee_show= false
@@ -607,11 +605,7 @@ export default {
 				cancelButtonText: '取消',
 				type: 'warning'
 			}).then(() => {
-				this.$axios({
-				url: '/api/role/user',
-				method: 'DELETE',
-				data: {role_id: this.item_info.id,employee_id: this.radioVal}
-				}).then(res => {
+				this.$axios('DELETE','/api/role/user',{role_id: this.item_info.id,employee_id: this.radioVal}).then(res => {
 					if (res.data.code == 1) {
 						this.$message.success(res.data.msg);
 						this.get_table_list();
@@ -624,9 +618,7 @@ export default {
 		},
 		get_role_list() {
 			this.role_loading = true;
-			this.$axios
-				.get('/api/role/list')
-				.then(res => {
+			this.$axios('get','/api/role/list').then(res => {
 					if (res.data.code == 1) {
 						this.role_list = res.data.data.list;
 						this.open_right(this.role_list[0]);
@@ -644,8 +636,7 @@ export default {
 			this.table_loading = true;
 			var that = this;
 			this.table_list=[];
-			this.$axios.get('/api/role/user', { params: { role_id: this.item_info.id } })
-				.then(res => {
+			this.$axios('get','/api/role/user',{role_id: this.item_info.id}).then(res => {
 					if (res.data.code == 1) {
 						var list = res.data.data.list;
 						list.forEach(item => {

+ 20 - 24
src/views/rule.vue

@@ -36,12 +36,12 @@
 						<el-table-column label="分值" align="center">
 							<template slot-scope="scope">
 								<div v-if="scope.row.range_type == 1">
-									<span :class="scope.row.min_point > 0 ? 'red' : 'green'">{{ scope.row.min_point }}{{ scope.row.pt_Obj.name }}</span>
+									<span :class="scope.row.min_point > 0 ? 'red' : 'green'">{{ scope.row.min_point }} {{ scope.row.pt_Obj.name }}</span>
 								</div>
 								<div v-if="scope.row.range_type == 2">
 									<span :class="scope.row.min_point > 0 ? 'red' : 'green'">{{ scope.row.min_point }}</span>
-									<span :class="scope.row.max_point > 0 ? 'red' : 'green'">{{ scope.row.max_point }}{{ scope.row.pt_Obj.name }}</span>
+									<span :class="scope.row.max_point > 0 ? 'red' : 'green'">{{ scope.row.max_point }} {{ scope.row.pt_Obj.name }}</span>
 								</div>
 							</template>
 						</el-table-column>
@@ -73,7 +73,7 @@
 		</el-dialog>
 
 		<!-- 添加编辑规则 -->
-		<el-dialog :title="rule_type == 'add' ? '添加规则' : '编辑规则'" :visible.sync="rule_show" :close-on-click-modal="false" width="550px">
+		<el-dialog :title="rule_type == 'add' ? '添加规则' : '编辑规则'" :visible.sync="rule_show" :close-on-click-modal="false" width="600px">
 			<el-form :model="rules_detail_form" ref="rules_detail_form" :rules="rules" label-width="80px">
 				<el-form-item label="规则内容" prop="remark">
 					<el-input v-model="rules_detail_form.remark" placeholder="请输入规则内容" type="textarea" :rows="3" maxlength="100" show-word-limit></el-input>
@@ -119,7 +119,7 @@
 								</el-select>
 							</el-input>
 						</el-col>
-						<el-col :span="2" v-show="rules_detail_form.range_type == 2">至</el-col>
+						<el-col :span="1" v-show="rules_detail_form.range_type == 2">至</el-col>
 						<el-col :span="11" v-show="rules_detail_form.range_type == 2">
 							<el-input
 								placeholder="请输入分值"
@@ -128,7 +128,7 @@
 								type="Number"
 								class="input-with-select"
 							>
-								<el-select v-model="integral_select_name2" slot="prepend" placeholder="请选择类型" style="width: 100px;">
+								<el-select v-model="integral_select_name2" slot="prepend" placeholder="请选择类型">
 									<el-option v-for="(item, index) in integral_select" :key="index" :label="item.name" :value="item.value"></el-option>
 								</el-select>
 							</el-input>
@@ -296,7 +296,7 @@ export default {
 		noData
 	},
 	created() {
-		this.point_types = this.$getTyps();
+		this.point_types = this.$getTyps().reverse()
 	},
 	mounted() {
 		this.$nextTick(function() {
@@ -307,9 +307,9 @@ export default {
 			}
 		});
 		var that=this;
-		setTimeout(function(){
+		// setTimeout(function(){
 			that.getData();
-		},1000);
+		// },1000);
 	},
 	methods: {
 		// 导入相关
@@ -323,7 +323,7 @@ export default {
 			let params = {
 				file: this.file
 			};
-			this.$axios.post('/api/rule/import', params).then(res => {
+			this.$axios('post','/api/rule/import', params).then(res => {
 					if (res.data.code == 1) {
 						this.close_import();
 						this.$message.success({ message: res.data.msg });
@@ -412,7 +412,7 @@ export default {
 									this.rule_loading2=false;
 									return false;
 								}
-								this.$axios.post('/api/integral/rule/items/edit', data).then(res => {
+								this.$axios('post','/api/integral/rule/items/edit', data).then(res => {
 										if (res.data.code == 1) {
 											self.$message.success(res.data.msg);
 											self.getData();
@@ -432,7 +432,7 @@ export default {
 							this.rule_loading2=false;
 							return false;
 						}
-						this.$axios.post('/api/integral/rule/items/edit', data).then(res => {
+						this.$axios('post','/api/integral/rule/items/edit', data).then(res => {
 								if (res.data.code == 1) {
 									self.$message.success(res.data.msg);
 									self.getData();
@@ -492,9 +492,7 @@ export default {
 							let data = {
 								items: [self.rules_detail_form]
 							};
-							this.$axios
-								.post('/api/integral/rule/items', data)
-								.then(res => {
+							this.$axios.post('/api/integral/rule/items', data).then(res => {
 									if (res.data.code == 1) {
 										self.$message.success(res.data.msg);
 										self.getData();
@@ -514,7 +512,7 @@ export default {
 						let data = {
 							items: [self.rules_detail_form]
 						};
-						this.$axios.post('/api/integral/rule/items', data).then(res => {
+						this.$axios('post','/api/integral/rule/items', data).then(res => {
 								if (res.data.code == 1) {
 									self.$message.success(res.data.msg);
 									self.getData();
@@ -538,7 +536,7 @@ export default {
 			};
 			this.delRule_loading=true;
 			self.$confirm('此操作将永久删除该选项, 是否继续?', '提示').then(() => {
-					this.$axios.post('/api/integral/rule/items/destroy', 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.rule_show = false;
@@ -581,7 +579,7 @@ export default {
 				remark: '',
 				is_attendance: '0',
 				cycle_type: '1',
-				pt_id: 2
+				pt_id: 3
 			};
 			this.integral_select_name1 = '1';
 			this.integral_select_name2 = '1';
@@ -599,9 +597,7 @@ export default {
 				let data = {
 					item_id: this.del_item_id
 				};
-				this.$axios
-					.post('/api/integral/rule/items/destroy', data)
-					.then(res => {
+				this.$axios.post('/api/integral/rule/items/destroy', data).then(res => {
 						if (res.data.code == 1) {
 							this.$message.success(res.data.msg);
 							this.getData(true);
@@ -687,7 +683,7 @@ export default {
 		getData(is) {
 			this.rule_loading = true;
 			var that = this;
-			this.$axios.get('api/integral/rule/trees', { params: { cycle_type: 1 } }).then(res => {
+			this.$axios('get','api/integral/rule/trees', {cycle_type: 1}).then(res => {
 				var item_list = res.data.data.item_list || [];
 				var list = [];
 				for (let i in item_list) {
@@ -736,7 +732,7 @@ export default {
 								that.dept_formdata.pid=0;
 							}
 						}
-						this.$axios.post('/api/integral/rule/edit', that.dept_formdata).then(res => {
+						this.$axios('post','/api/integral/rule/edit', that.dept_formdata).then(res => {
 							if (res.data.code == 1) {
 								that.selectItem.name=that.dept_formdata.name;
 								that.$message.success('修改积分分类成功');
@@ -752,7 +748,7 @@ export default {
 						} else {
 							that.dept_formdata.pid = that.dept_formdata.pid[that.dept_formdata.pid.length - 1];
 						}
-						this.$axios.post('/api/integral/rule', that.dept_formdata).then(res => {
+						this.$axios('post','/api/integral/rule', that.dept_formdata).then(res => {
 							if (res.data.code == 1) {
 								that.$message.success('添加积分分类成功');
 								this.getData(true);
@@ -775,7 +771,7 @@ export default {
 				cancelButtonText: '取消',
 				type: 'warning'
 			}).then(() => {
-				this.$axios.post('/api/integral/rule/destroy', { rule_id: this.selectItem.id }).then(res => {
+				this.$axios('post','/api/integral/rule/destroy', { rule_id: this.selectItem.id }).then(res => {
 					if (res.data.code == 1) {
 						this.$message.success(res.data.msg);
 						this.getData();

+ 51 - 137
src/views/voluntarilyPoint.vue

@@ -1,7 +1,7 @@
 <template>
 	<div>
-		<el-alert class="diy-tip" title="什么是固定积分?" @close="tips_close" v-if="tips_show" type="success" description show-icon>
-			<p>系统按照设定的时间(每月/每周/每日) 自动给员工添加的积分,比如某员工有一个工程师证,得到公司的认可,公司就会每月给他加分</p>
+		<el-alert class="diy-tip" title="什么是自动积分?" @close="tips_close" v-if="tips_show" type="success" description show-icon>
+			<p>系统按照设定的时间(每月/每周/每日) 自动给员工添加B分,比如某员工有一个工程师证,得到公司的认可,公司就会每月给他加分</p>
 		</el-alert>
 		<div class="all">
 			<div class="flex-box">
@@ -36,26 +36,18 @@
 					<el-col :span="24" v-show="rule_list.length == 0 || item_list.length == 0 || diyige == true"  style="text-align: center;margin: 0 auto;position: relative;top: 30%;">
 						<p><img src="@/assets/image/nodata_default.png" width="200px" alt="" /></p>
 						<p style="color: #909399;">
-							还没有
-							<span v-if="rule_list.length == 0">加分组和</span>
-							加分项
+							还没有<span v-if="rule_list.length == 0">加分组和</span>加分项
 						</p>
 						<p style="color: #909399;">
 							<span v-if="rule_list.length == 0">先</span>
-							<span style="color: #26A2FF;cursor:pointer;" v-if="rule_list.length == 0" @click="add_grouping()">【添加加分组】</span>
-							,
+							<span style="color: #26A2FF;cursor:pointer;" v-if="rule_list.length == 0" @click="add_grouping()">【新增加分组】</span>
 							<span v-if="rule_list.length == 0">再</span>
 							<span v-if="rule_list.length !== 0">请</span>
-							<span style="color: #26A2FF;cursor:pointer" @click="add_rules_detail">【添加加分项】</span>
+							<span style="color: #26A2FF;cursor:pointer" @click="add_rules_detail">【新增加分项】</span>
 						</p>
 					</el-col>
 					<el-col v-if="item_list.length != 0 && diyige == false" >
 						<el-row>
-							<!-- 移除隐藏 -->
-							<!-- <el-col :span="24" style="font-size:20px;color:#303133;line-height:36px;display:flex;flex-wrap: wrap;">
-              <div style="width:5%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap">
-                <span>{{right_rules_detail.remark}}</span>
-              </div> -->
 							<el-col :span="24" style="font-size:20px;color:#303133;line-height:36px;">
 								{{ right_rules_detail.remark }}
 								<span style="padding-left: 10px;">{{ right_rules_detail.min_point }}B分</span>
@@ -116,37 +108,37 @@
 
 			<!-- 可写公共组建: -->
 			<!-- 新增加分组弹出框 -->
-			<el-dialog :close-on-click-modal="false" :title="grouping_type ? '编辑分类' : '新增分类'" :visible.sync="dialogVisible" width="40%">
+			<el-dialog :close-on-click-modal="false" :title="grouping_type ? '编辑加分组' : '新增加分组'" :visible.sync="dialogVisible" width="40%">
 				<el-form :model="numberValidateForm" ref="numberValidateForm" label-width="100px" class="demo-ruleForm">
-					<el-form-item label="分组名称" prop="name" :rules="[{ required: true, message: '请输入分组名称' }]">
-						<el-input type="age" v-model="numberValidateForm.name" autocomplete="off" placeholder="请输入分组名称"></el-input>
+					<el-form-item label="分组名称" prop="name" :rules="[{ required: true, message: '请输入分组名称' }]">
+						<el-input type="age" v-model="numberValidateForm.name" autocomplete="off" placeholder="请输入分组名称"></el-input>
 					</el-form-item>
 				</el-form>
 				<span slot="footer" class="dialog-footer" style=" overflow: hidden;">
 					<el-button class="fl" type="danger" v-show="grouping_type" @click="del_grouping(numberValidateForm)" style="float:left" :disabled="disabled">删除</el-button>
-					<el-button type="primary" @click="submitForm('numberValidateForm')" :disabled="disabled">确 定</el-button>
 					<el-button @click="dialogVisible = false">取 消</el-button>
+					<el-button type="primary" @click="submitForm('numberValidateForm')" :disabled="disabled">确 定</el-button>
 				</span>
 			</el-dialog>
 
 			<!-- 新增加分项 -->
-			<el-dialog :title="rules_detail_title ? '编辑规则' : '新增规则'" :visible.sync="dialogFormVisible" width="500px">
+			<el-dialog :title="rules_detail_title ? '编辑加分项' : '新增加分项'" :visible.sync="dialogFormVisible" width="500px">
 				<el-form :model="rules_detail_form" ref="rules_detail_form" :rules="rules_rules" label-width="120px">
-					<el-form-item label="规则名称" :label-width="formLabelWidth" prop="remark" :rules="[{ required: true, message: '请输入规则名称' }]">
-						<el-input v-model="rules_detail_form.remark" placeholder="请输入规则名称" autocomplete="off"></el-input>
+					<el-form-item label="加分项名称" :label-width="formLabelWidth" prop="remark" :rules="[{ required: true, message: '请输入加分项名称' }]">
+						<el-input v-model="rules_detail_form.remark" placeholder="请输入加分项名称" autocomplete="off"></el-input>
 					</el-form-item>
-					<el-form-item label="分类" :label-width="formLabelWidth" prop="rule_id" :rules="[{ required: true, message: '请选择分类' }]">
-						<el-select v-model="rules_detail_form.rule_id" style="width: 100%;" placeholder="请选择分类">
+					<el-form-item label="加分组" :label-width="formLabelWidth" prop="rule_id" :rules="[{ required: true, message: '请选择加分组' }]">
+						<el-select v-model="rules_detail_form.rule_id" style="width: 100%;" placeholder="请选择加分组">
 							<el-option v-for="item in rule_list" :key="item.value" :label="item.name" :value="item.id"></el-option>
 						</el-select>
 					</el-form-item>
-					<el-form-item label="积分" prop="min_point" :rules="[{ required: true, message: '请输入积分' }]">
+					<el-form-item label="B分" prop="min_point" :rules="[{ required: true, message: '请输入B分分值' }]">
 						<el-input
 							v-model="rules_detail_form.min_point"
-							placeholder="请输入积分"
+							placeholder="请输入B分分值"
 							oninput="if(this.value=='0'){this.value='';}else{this.value=this.value.replace(/[^0-9]/g,'')}"
 						></el-input>
-						<span data-v-a17f1960 style="display: block; font-size: 12px; color: rgb(96, 98, 102);text-align: left;">固定加分加B分</span>
+						<!-- <span data-v-a17f1960 style="display: block; font-size: 12px; color: rgb(96, 98, 102);text-align: left;">固定加分加B分</span> -->
 					</el-form-item>
 					<!-- <el-form-item label="是否与考勤挂钩" prop="is_attendance"><el-switch v-model="is_attendance"></el-switch></el-form-item> -->
 					<div style="overflow: hidden;">
@@ -250,7 +242,6 @@ export default {
 
 			right_rules_detail: {},
 
-			add_employee_id: '',
 			add_employee_id: '',
 			rules_detail_form: {
 				rule_id: '',
@@ -350,19 +341,10 @@ export default {
 		add_employee_show_TJ() {
 			this.add_employee_show = true; //弹出添加人员框
 			var params = {
-				params: {
 					item_id: this.add_employee_id || '',
 					employee_id: this.employee_id || ''
-				}
 			};
-			this.$axios.get('/api/integral/auto/list', params).then(res => {
-				//   let grup_list = [];
-				// for(let i=0;i<res.data.data.list.length;i++){
-				//   grup_list.push(res.data.data.list[i])
-				// }
-				// this.grouping = grup_list//拿到当前细则的人员
-				// this.grouping_Json =  this.res.data.data.list//拿到当前细则的人员
-			});
+			this.$axios('get','/api/integral/auto/list', params).then(res => {});
 		},
 		// 添加成员点击完成
 		sub_add_employee(form) {
@@ -389,12 +371,7 @@ export default {
 					} else {
 						this.disabled = true;
 						self.staff_loading = true;
-						self.$axios({
-							url: '/api/integral/auto/add',
-							method: 'post',
-							data: data
-						})
-							.then(res => {
+						self.$axios('post','/api/integral/auto/add',data).then(res => {
 								this.disabled = false;
 								self.table_loading = false;
 								self.staff_loading = false;
@@ -440,12 +417,7 @@ export default {
 					cancelButtonText: '取消',
 					type: 'warning'
 				}).then(() => {
-					self.$axios({
-						url: '/api/integral/auto/delete/many',
-						method: 'post',
-						data: self.del_arr
-					})
-						.then(res => {
+					self.$axios('post','/api/integral/auto/delete/many',self.del_arr).then(res => {
 							if (res.data.code == 1) {
 								self.$message.success(res.data.msg);
 								// 判断当页的总数与选中的数量是否相等,如果相等,此页就无数据,就请求上一页的数据
@@ -499,12 +471,8 @@ export default {
 					} else {
 						self.rules_detail_form.is_attendance = 0;
 					}
-					self.$axios({
-						url: this.rules_detail_title ? 'api/integral/rule/items/edit' : '/api/integral/rule/items',
-						method: 'post',
-						data: data
-					})
-						.then(res => {
+					var usl=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;
 							setTimeout(() => {
@@ -560,12 +528,8 @@ export default {
 					} else {
 						self.rules_detail_form.is_attendance = 0;
 					}
-					self.$axios({
-						url: this.rules_detail_title ? 'api/integral/rule/items/edit' : '/api/integral/rule/items',
-						method: 'post',
-						data: data
-					})
-						.then(res => {
+					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;
 							setTimeout(() => {
@@ -607,9 +571,9 @@ export default {
 			this.$refs[form].resetFields();
 		},
 		open_right(data) {
-			console.log(data)
+			// console.log(data)
 			this.diyige = false
-			console.log(data)
+			// console.log(data)
 			let self = this;
 			self.table_loading = true;
 			if (data) {
@@ -618,16 +582,12 @@ export default {
 				self.right_rules_detail = data;
 			}
 			var params = {
-				params: {
 					item_id: self.add_employee_id || '',
 					employee_id: self.employee_id || '',
 					page: self.page,
 					page_size: Number(this.pagesize)
-				}
 			};
-			self.$axios
-				.get('/api/integral/auto/list', params)
-				.then(res => {
+			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 || [];
@@ -651,20 +611,13 @@ export default {
 		},
 		// 删除规则
 		del_rules_detail(item) {
-			this.$confirm('此操作将永久删除该规则, 是否继续?', '提示', {
+			this.$confirm('此操作将永久删除该加分项, 是否继续?', '提示', {
 				confirmButtonText: '确定',
 				cancelButtonText: '取消',
 				type: 'warning'
 			}).then(() => {
 				this.disabled = true;
-				this.$axios({
-					url: '/api/integral/rule/items/destroy',
-					method: 'post',
-					data: {
-						item_id: item.id
-					}
-				})
-					.then(res => {
+				this.$axios('post','/api/integral/rule/items/destroy',{item_id: item.id}).then(res => {
 						this.dialogFormVisible = false;
 						this.disabled = false;
 						if (res.data.code == 1) {
@@ -709,12 +662,8 @@ export default {
 								name: this.numberValidateForm.name
 						  };
 					this.disabled = true;
-					this.$axios({
-						url: this.grouping_type ? 'api/integral/rule/edit' : '/api/integral/rule',
-						method: 'post',
-						data: data
-					})
-						.then(res => {
+					var url=this.grouping_type ? 'api/integral/rule/edit' : '/api/integral/rule';
+					this.$axios('post',url,data).then(res => {
 							this.dialogVisible = false;
 							this.disabled = false;
 							if (res.data.code == '1') {
@@ -747,30 +696,20 @@ export default {
 				confirmButtonText: '确定',
 				cancelButtonText: '取消',
 				type: 'warning'
-			})
-				.then(() => {
-					this.disabled = true;
-					this.$axios({
-						url: 'api/integral/rule/destroy',
-						method: 'post',
-						data: {
-							rule_id: item.id
+			}).then(() => {
+				this.disabled = true;
+				this.$axios('post','api/integral/rule/destroy',{rule_id: item.id}).then(res => {
+						this.dialogVisible = false;
+						this.disabled = false;
+						if (res.data.code == 1) {
+							this.get_role_lists();
+							this.$message.success('删除成功');
 						}
-					})
-						.then(res => {
-							this.dialogVisible = false;
-							this.disabled = false;
-							if (res.data.code == 1) {
-								this.get_role_lists();
-								this.$message.success('删除成功');
-							}
-						})
-						.catch(err => {
-							this.dialogVisible = false;
-							this.disabled = false;
-						});
-				})
-				.catch(() => {
+					}).catch(err => {
+						this.dialogVisible = false;
+						this.disabled = false;
+					});
+				}).catch(() => {
 					setTimeout(() => {
 						this.dialogVisible = false;
 					}, 300);
@@ -781,59 +720,34 @@ export default {
 			this.table_loading = true;
 			this.rule_trees_load = true;
 			this.openeds = ['0'];//修改后  修改高亮选中项
-			this.$axios.get('/api/integral/rule/trees', {
-					params: {
-						cycle_type: '2'
-					}
-				})
-				.then(res => {
+			this.$axios('get','/api/integral/rule/trees', {cycle_type: '2'}).then(res => {
 					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) {
-					// 				this.open_right(this.item_list[key][i]);
-					// 				return 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('不为空')
+										// console.log('不为空')
 										this.open_right(this.item_list[key][i]);
 									}else{
 										this.diyige = true
-										console.log('这是第一个为空时执行的方法')
+										// console.log('这是第一个为空时执行的方法')
 										this.staff_loading = false;
 										this.rule_trees_load = false;
 										this.table_loading = false;
 									}
-									// if(this.item_list[key] == undefined){
-									// 	console.log('这是第一个为空时执行的方法')
-										
-									// }else{
-									// 	this.open_right(this.item_list[key][i]);
-									// }
 									return false;
 								}
 							}
 						}
 					}
-					// console.log(this.item_list[0])
-					// if(this.item_list['rule_108'] == undefined){
-					// 	console.log('ccccccccc')
-					// }else{
-					// }
-					this.table_loading = false;
-				});
+			}).finally(err=>{
+				this.rule_trees_load = false;
+				this.table_loading = false;
+			});
 		}
 	}
 };