347617796@qq.com il y a 4 ans
Parent
commit
1cdaf37827

+ 2 - 4
src/api/axios.js

@@ -5,7 +5,6 @@ import {
 	setToken
 } from './auth.js'
 import qs from 'qs'
-
 const service = axios.create({
 	baseURL: process.env.VUE_APP_BASE_API, // api的base_url
 	// baseURL:'https://ding.insys.g107.com/',
@@ -22,10 +21,9 @@ service.interceptors.request.use(
 	config => {
 		if (getToken()) {
 			config.headers['A-Token'] = getToken()
-			// config.headers['A-Token'] = ' eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczpcL1wvdGVzdC1kaW5nLmcxMDcuY29tXC9hcGlcL2RpbmdcL2xvZ2luIiwiaWF0IjoxNjAyMzE2OTU0LCJleHAiOjE2MDI5MTY5NTQsIm5iZiI6MTYwMjMxNjk1NCwianRpIjoiSWViRUVZSGREcmM4bGJ2ZiIsInN1YiI6MiwicHJ2IjoiY2E2NDg5ZDUwZjI0MDdhNjc4MzBlODA5MGQwMTQ4ODM1Njg1OTYyYiIsInJvbGUiOiJlbXBsb3llZSJ9.gAoRB1uC4HQAal1IINiVCJkAqTqSgVvXmJJtDqC7hx4'
+			// config.headers['A-Token'] = ' eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczpcL1wvdGVzdC1kaW5nLmcxMDcuY29tXC9hcGlcL2RpbmdcL2xvZ2luIiwiaWF0IjoxNjAzNzcwNTM0LCJleHAiOjE2MDQzNzA1MzQsIm5iZiI6MTYwMzc3MDUzNCwianRpIjoid3g4NVZlZzlaYlBydzhBeSIsInN1YiI6MTU5LCJwcnYiOiJjYTY0ODlkNTBmMjQwN2E2NzgzMGU4MDkwZDAxNDg4MzU2ODU5NjJiIiwicm9sZSI6ImVtcGxveWVlIn0.YdaiWSM5iAYm6dwnxLS0L_mkDkFU1VFL1DAQNkz8haw'
 		}
-		
-		if (config.url == '/api/integral/statistics/ranking' || config.url == '/api/integral/review/apply') {
+		if (config.url == '/api/integral/statistics/ranking' || config.url == '/api/integral/review/apply'|| config.url == '/api/rule/import') {
 		  config.headers['Accept'] = 'application/vnd.test.v2+json'
 		}
 		if (config.url == '/api/integral/statistics/prize/list'  || config.url =='/api/integral/performance/employee') {

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

@@ -81,7 +81,6 @@ export default {
       //     return;
       //   }
       // }
-
       // 无正则代码
       for (var i = 0; i < this.initia_arr.length; i++) {
           arr.push({
@@ -89,7 +88,6 @@ export default {
           });
           if (arr.length == this.initia_arr.length) {
             this.$emit("initia", arr);
-            this.disableds = false;
           }
       }
     },

+ 1 - 1
src/index.vue

@@ -123,7 +123,7 @@ export default {
 		},
 		returnRoutersArr(str){
 			var routers = this.$router.options.routes[0].children;
-			console.log(this.$router.options.routes);
+			// console.log(this.$router.options.routes);
 			var routersArr=[];
 			routers.forEach(item=>{
 				if(item.meta.groupCode==str){

+ 87 - 70
src/views/set/check.vue

@@ -1,15 +1,22 @@
 <template>
-  <div v-loading="loading">
-    <workpoints :initia_arr="initia_arr" v-if="!loading" :initia_head="initia_head" :obj="obj" @initia="initia" />
-  </div>
+ <div>
+	 <div v-loading="loading" v-if="ding_enable">
+	   <workpoints :initia_arr="initia_arr" v-if="!loading" :initia_head="initia_head" :obj="obj" @initia="initia" />
+	 </div>
+	 <div v-else class="all">
+		 <div class="nullD">请在对应企业的钉钉管理后台中开启<span class="blue">   [考勤打卡]</span>功能</div>
+	 </div>
+ </div>	
 </template>
 
 <script>
 import workpoints from "@/components/publics/workpoints";
 export default {
+  components: {workpoints},	
   data() {
     return {
       loading: false,
+	  ding_enable:true,
       initia_head: {
         initial_suername: "考勤积分",
         initial_suertext: "以下考勤奖扣分,均为B分",
@@ -25,13 +32,13 @@ export default {
 			  age: "0",
 			},
 		  },
-        {
-          initialName: "月度全勤,每月加分",
-          initia_mark: false,
-          initia_input: {
-            age: "0",
-          },
-        },
+        // {
+        //   initialName: "月度全勤,每月加分",
+        //   initia_mark: false,
+        //   initia_input: {
+        //     age: "0",
+        //   },
+        // },
         {
           initialName: "正常打卡,每次加分",
           initia_mark: false,
@@ -46,11 +53,13 @@ export default {
             age: "0",
           },
         },
-
-
-
-
-
+		{
+		  initialName: "旷工缺席,每次扣分",
+		  initia_mark: false,
+		  initia_input: {
+		    age: "0",
+		  },
+		},
         {
           initialName: "上班迟到,每次扣分",
           initia_mark: false,
@@ -65,48 +74,43 @@ export default {
             age: "0",
           },
         },
-		
-		
+        // {
+        //   initialName: "加班,每小时加分",
+        //   initia_mark: false,
+        //   initia_input: {
+        //     age: "0",
+        //   },
+        // },
 		{
-		  initialName: "旷工缺席,每次扣分",
+		  initialName: "加班,每满一天加分",
 		  initia_mark: false,
 		  initia_input: {
 		    age: "0",
 		  },
 		},
-		
-		
-        {
-          initialName: "加班,每小时加分",
-          initia_mark: false,
-          initia_input: {
-            age: "0",
-          },
-        },
-        {
-          initialName: "请假,每小时扣分",
-          initia_mark: false,
-          initia_input: {
-            age: "0",
-          },
-        },
+        // {
+        //   initialName: "请假,每小时扣分",
+        //   initia_mark: false,
+        //   initia_input: {
+        //     age: "0",
+        //   },
+        // },
       ],
-	     obj: {
-	          month_full_ad: "", //>=0
-	          normal: "", //>=0
-	          no_sign: "", //<=0
-	          absent: "", //<=0
-	          on_duty_late: "", //<=0
-	          off_duty_early: "", //<=0
-	          ot_per_hour: "", //>=0
-	          leave_per_hour: "", //<=0
-	        },
+	  obj: {
+		  // ding_enable:'',
+		  enable:'',
+		  // month_full_ad: "", //>=0
+		  normal: "", //>=0
+		  no_sign: "", //<=0
+		  absent: "", //<=0
+		  on_duty_late: "", //<=0
+		  off_duty_early: "", //<=0
+		  // ot_per_hour: "", //>=0
+		  ot_per_day:'',
+		  // leave_per_hour: "", //<=0
+	  },
     };
   },
-  components: {
-    workpoints,
-  },
-  created() {},
   mounted() {
     this.cheak_ax();
   },
@@ -114,14 +118,16 @@ export default {
     initia(ok) {
       var objs = {};
 	  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[6].sj>0? -ok[6].sj:ok[6].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[7].sj; //>=0
-      objs.leave_per_hour = ok[8].sj>0? -ok[8].sj:ok[8].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_day =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
+	  // objs.month_full_ad = 0
       this.$axios('post',"/api/ad/update",objs).then((res) => {
           if (res.data.code == 1) {
             this.$message({
@@ -137,20 +143,27 @@ export default {
       this.loading = true;
       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.ding_enable=config.ding_enable==0? false:true;
+		if(!this.ding_enable){
+			return false;
+		}
+		// 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.enable
-        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[6].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[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
+		// this.initia_arr[1].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[7].initia_input.age =config.ot_per_hour? config.ot_per_hour:0 //每小时加班加分 
+		this.initia_arr[6].initia_input.age =config.ot_per_day? config.ot_per_day:0 //每加班满一天加分 
+		// this.initia_arr[8].initia_input.age =config.leave_per_hour? config.leave_per_hour:0 //每小时请假扣分
+		
       }).finally(err=>{
 			this.loading = false;
 	  });
@@ -159,5 +172,9 @@ export default {
 };
 </script>
 
-<style  scoped lang="scss">
+<style scoped lang="scss">
+	.nullD{
+		text-align: center;
+		padding-top: 20%;
+	}
 </style>

+ 1 - 0
src/views/set/framework.vue

@@ -195,6 +195,7 @@ export default {
 		},
 		//获取公司信息
 		getInfo(is) {
+			// api/test?employee_id=155
 			this.$axios('get','/api/site/info').then(res => {
 				this.info = res.data.data;
 				this.getDepartment(is);

+ 1 - 1
src/views/set/jurisdiction.vue

@@ -270,7 +270,7 @@
 		  :visible.sync="integral_limit_show"
 		  :close-on-click-modal="false"
 		  width="700px">
-		  <el-form label-width="120px" :model="integral_limit_form" ref="integral_limit_form" v-loading="integral_limit_loading">
+		  <el-form label-width="160px" :model="integral_limit_form" ref="integral_limit_form" v-loading="integral_limit_loading">
 		    <span v-for="(item,index) in integral_limit_form.point_limit" :key="index" v-show="item.pt_id !== 1">
 		      <el-form-item :label="'(单次奖扣)'+item.name+'权限'" :rules="[{required: true, message: '请输入', trigger: 'blur'}]">
 		        <el-input v-model="item.point" type="Number"></el-input>

+ 8 - 6
src/views/set/rule.vue

@@ -27,7 +27,7 @@
 					<div class="flex-box btns flex-v-ce">
 						<el-button size="small" @click="del_item" type="danger" plain>批量删除</el-button>
 						<el-button size="small" @click="add_rule" type="primary">添加规则</el-button>
-						<!-- <el-button size="small" @click="import_rules_show = true" plain>导入规则</el-button> -->
+						<el-button size="small" @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">
 						<el-table-column type="selection" width="55"></el-table-column>
@@ -187,7 +187,6 @@
 						<el-upload
 							class="upload-demo"
 							:headers="ATOKEN"
-							:data="{ type: 'rule_item' }"
 							ref="upload"
 							:limit="1"
 							:action="action"
@@ -199,7 +198,7 @@
 						>
 							<el-button slot="trigger" type="primary">选取文件</el-button>
 						</el-upload>
-						<p><el-button type="primary" @click="submitUpload" :loading="save_loading" v-show="import_btn_show" block>导入</el-button></p>
+						<!-- <p><el-button type="primary" @click="submitUpload" :loading="save_loading" v-show="import_btn_show" block>导入</el-button></p> -->
 					</div>
 				</el-col>
 			</el-row>
@@ -212,9 +211,9 @@ import noData from '@/components/noData';
 export default {
 	data() {
 		return {
-			action:process.env.VUE_APP_BASE_API+'/api/upload/excel',
+			action:process.env.VUE_APP_BASE_API+'/api/rule/import',
 			downloadUrl:process.env.VUE_APP_BASE_API+'/api/download/rule_item',
-			ATOKEN: { 'A-TOKEN': this.$getToken() },
+			ATOKEN: { 'A-TOKEN': this.$getToken(),'Accept':'application/vnd.test.v2+json' },
 			tips_show: true,
 			rule_loading: false,
 			rule_tree: [],
@@ -349,7 +348,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 });
@@ -364,6 +363,9 @@ export default {
 		handleSuccess(response) {
 			if (response.code == 1) {
 				this.file = response.data;
+				this.$message.success({ message: response.msg });
+				this.getData();
+				this.close_import();
 			}
 		},
 		handleRemove(file, fileList) {