Summer 4 rokov pred
rodič
commit
7e11d6ed7e

+ 4 - 3
src/api/axios.js

@@ -19,9 +19,10 @@ const service = axios.create({
 
 service.interceptors.request.use(
 	config => {
-		if (getToken()) {
-			config.headers['A-Token'] = getToken()
-		}
+		// if (getToken()) {
+			// config.headers['A-Token'] = getToken()
+			config.headers['A-Token'] = " eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczpcL1wvdGVzdC1kaW5nLmcxMDcuY29tXC9hcGlcL2RpbmdcL2xvZ2luIiwiaWF0IjoxNTk3NDc5OTgxLCJleHAiOjE1OTgwNzk5ODEsIm5iZiI6MTU5NzQ3OTk4MSwianRpIjoiVnpYeUQwRW82dU1VWFJNVSIsInN1YiI6MiwicHJ2IjoiY2E2NDg5ZDUwZjI0MDdhNjc4MzBlODA5MGQwMTQ4ODM1Njg1OTYyYiIsInJvbGUiOiJlbXBsb3llZSJ9.mfpDxWCOwNYevccHWwYu2nHc6FRjyz-2RjCbEflMXiY"
+		// }
 		return config
 	},
 	error => {

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

@@ -0,0 +1,122 @@
+<template>
+  <div class="all">
+    <div class="initialPoint">
+      <div class="initia_title">{{initia_head.initial_suername}}</div>
+      <div class="initia_title_1">{{initia_head.initial_suertext}}</div>
+      <div class="nitia_list" v-for="(v,i) in initia_arr" :key="i">
+        <span>{{v.initialName}}</span>
+        <!-- <el-tooltip placement="top">
+          <div slot="content" class="initia_mark?">多行信息<br/>第二行信息</div>
+          <el-button class="initia_el_button"></el-button>
+        </el-tooltip> -->
+        <p class="initia_mark" v-show="v.initia_mark">?</p>
+        <el-input v-model="v.initia_input" placeholder="请输入分值"></el-input>
+      </div>
+      <button class="initia_button" @click="save()">保存</button>
+    </div>
+  </div>
+</template>
+
+<script>
+export default {
+    props:{
+        'initia_arr':Array,
+        'initia_head':Object
+    },
+  data() {
+    return {
+    };
+  },
+  created() {},
+  mounted() {
+  },
+  methods: {
+	save(){
+        let arr = [];
+        for(var i=0;i<this.initia_arr.length;i++){
+            if(this.initia_arr[i].initia_input!==""){
+              arr.push({
+                "sj":this.initia_arr[i].initia_input
+              })
+              this.initia_arr[i].initia_input="";
+        }
+        }
+        this.$emit('initia',arr);
+
+        // for(var i=0;i<this.initia_arr.length;i++){
+        //     if(this.initia_arr[i].initia_input!==""){
+        //       this.$emit('initia',this.initia_arr[i].initia_input);
+        //       this.initia_arr[i].initia_input="";
+        //     }
+        // }
+        // this.$emit('initia',this.initia_arr[0].initia_input)
+	}
+  },
+};
+</script>
+
+<style>
+.initialPoint {
+  margin-left: 30px;
+}
+.initia_mark{
+  background: #c0c4cc;
+  border-radius: 50%;
+  width: 14px;
+  height: 14px;
+  color: #fff;
+  display: inline-block;
+  font-size: 12px;
+  line-height: 14px;
+  text-align: center;
+  margin-left:4px;
+}
+.initia_title {
+  font-size: 20px;
+    color: rgba(48, 49, 51, 1);
+  padding-top: 30px;
+  font-family: PingFangSC-Regular;
+}
+.initia_title_1 {
+  color: #606266;
+  font-size: 14px;
+  margin-top: 10px;
+}
+.nitia_list{
+  height: 40px;
+  margin-top: 20px;
+  display: flex;
+  align-items: center;
+}
+.nitia_list span{
+	color:#606266;
+	font-size: 14px;
+    height: 20px;
+    white-space: nowrap;
+}
+.nitia_list input{
+	width: 160px;
+	height: 40px;
+	border-radius: 4px;
+	background-color: rgba(255, 255, 255, 1);
+    border: 1px solid rgba(220, 223, 230, 1);
+    margin-left: 11px;
+}
+
+.initia_button {
+  border-radius: 4px;
+  background-color: rgba(38, 162, 255, 1);
+  width: 68px;
+  height: 40px;
+  border: 0;
+  color: #ffffff;
+  text-align: center;
+  line-height: 40px;
+  margin: 20px 0 0 72px;
+  outline:none;
+}
+.initia_el_button{
+  width: 13px;
+  border-radius: 50%;
+}
+</style>

+ 89 - 16
src/views/check.vue

@@ -1,25 +1,98 @@
 <template>
-	<div>考勤</div>
+  <div class="all">
+    <workpoints :initia_arr="initia_arr" :initia_head="initia_head" :obj="obj"  @initia="initia"/>
+  </div>
 </template>
 
 <script>
-</script>
+import workpoints from "@/components/publics/workpoints";
+export default {
+  data() {
+    return {
+      initia_head: {
+        initial_suername: "考勤积分",
+        initial_suertext: "以下考勤奖扣分,均为B分",
+      },
+      initia_arr: [
+        { initialName: "月度全勤,每月加分", initia_mark: false, initia_input: "" },
+        { initialName: "正常打卡,每次加分", initia_mark: false, initia_input: "" },
+        { initialName: "上下班缺卡,每次扣分", initia_mark: false, initia_input: "" },
+        { initialName: "上班迟到,每次扣分", initia_mark: false, initia_input: "" },
+        // { initialName: "严重迟到,每次扣分", initia_mark: false, initia_input: "" },
+        { initialName: "下班早退,每次扣分", initia_mark: false, initia_input: "" },
+        { initialName: "矿工缺席,每次扣分", initia_mark: false, initia_input: "" },
+        { initialName: "加班,每小时加分", initia_mark: false, initia_input: "" },
+        { initialName: "请假,每小时扣分", initia_mark: false, initia_input: "" },
+      ],
+      obj:{
+        month_full_ad:"",
+        normal:"",
+        no_sign:"",
+        absent:"",
+        on_duty_late:"",
+        off_duty_early:"",
+        ot_per_hour:"",
+        leave_per_hour:"",
+      }
+    };
+  },
+  components: {
+    workpoints,
+  },
+  created() {},
+  mounted() {},
+  methods: {
+	  initia(ok){
+      let objs = this.obj
+      objs.month_full_ad = ok[0].sj
+      objs.normal = ok[1].sj
+      objs.no_sign = ok[2].sj
+      objs.absent = ok[5].sj
+      objs.on_duty_late = ok[3].sj
+      objs.off_duty_early = ok[4].sj
+      objs.ot_per_hour = ok[6].sj
+      objs.leave_per_hour = ok[7].sj
+      // console.log(objs)
 
-<style>
-	export default {
-		data() {
-			return {
+      this.$axios.post('api/ad/update', this.obj).then(res => {
+         console.log(res)
+      })
+      // let objToStr = JSON.stringify(this.obj)
+      // console.log(objToStr)
+      // this.$axios({
+      //   url: 'api/ad/update',
+      //   method:'post',
+      //   data:this.obj,
+      //   headers: {"Content-Type": "application/x-www-form-urlencoded","J-TOKEN":" eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczpcL1wvdGVzdC1kaW5nLmcxMDcuY29tXC9hcGlcL2RpbmdcL2xvZ2luIiwiaWF0IjoxNTk3NDc5OTgxLCJleHAiOjE1OTgwNzk5ODEsIm5iZiI6MTU5NzQ3OTk4MSwianRpIjoiVnpYeUQwRW82dU1VWFJNVSIsInN1YiI6MiwicHJ2IjoiY2E2NDg5ZDUwZjI0MDdhNjc4MzBlODA5MGQwMTQ4ODM1Njg1OTYyYiIsInJvbGUiOiJlbXBsb3llZSJ9.mfpDxWCOwNYevccHWwYu2nHc6FRjyz-2RjCbEflMXiY" },
+        
+      // }).then((ok)=>{
+      //   console.log(ok)
+      // })
+
+      
 
-			};
-		},
-		created() {
+      // this.$axios.post('api/ad/update', {
+      //   month_full_ad : ok[0].sj,
+      //   normal : ok[1].sj,
+      //   no_sign : ok[2].sj,
+      //   absent : ok[3].sj,
+      //   on_duty_late : ok[4].sj,
+      //   off_duty_early : ok[5].sj,
+      //   ot_per_hour : ok[6].sj,
+      //   leave_per_hour : ok[7].sj,
+      // }).then(res => {
+      //    console.log(res)
+      // });
+      // console.log(ok[0].sj)
 
-		},
-		mounted() {
+      // console.log(ok)
 
-		},
-		methods:{
-			
-		}
-	};
+      // this.month_full_ad = ok[0]
+		 
+	  }
+  },
+};
+</script>
+
+<style>
 </style>

+ 28 - 17
src/views/initialPoint.vue

@@ -1,25 +1,36 @@
 <template>
-	<div>初始分</div>
+  <div class="all">
+    <workpoints :initia_arr="initia_arr" :initia_head="initia_head" @initia="initia" />
+  </div>
 </template>
 
 <script>
+import workpoints from "@/components/publics/workpoints";
+export default {
+  data() {
+    return {
+      initia_head: {
+        initial_suername: "初始分",
+        initial_suertext: "基础分和工龄分均为B分",
+      },
+      initia_arr: [
+        { initialName: "基础分", initia_mark: true, initia_input: "" },
+        { initialName: "工龄分", initia_mark: true, initia_input: "" },
+      ],
+    };
+  },
+  components: {
+    workpoints,
+  },
+  created() {},
+  mounted() {},
+  methods: {
+	  initia(ok){
+		  console.log(ok)
+	  }
+  },
+};
 </script>
 
 <style>
-	export default {
-		data() {
-			return {
-
-			};
-		},
-		created() {
-
-		},
-		mounted() {
-
-		},
-		methods:{
-			
-		}
-	};
 </style>