Browse Source

合并SUMMer

347617796@qq.com 4 years ago
parent
commit
face57b3b3
4 changed files with 232 additions and 35 deletions
  1. 2 1
      src/api/axios.js
  2. 112 0
      src/components/publics/workpoints.vue
  3. 90 17
      src/views/check.vue
  4. 28 17
      src/views/initialPoint.vue

+ 2 - 1
src/api/axios.js

@@ -20,7 +20,8 @@ const service = axios.create({
 service.interceptors.request.use(
 	config => {
 		// if (getToken()) {
-			config.headers['A-Token'] = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczpcL1wvdGVzdC1kaW5nLmcxMDcuY29tXC9hcGlcL2RpbmdcL2xvZ2luIiwiaWF0IjoxNTk3NjMxNzE4LCJleHAiOjE1OTgyMzE3MTgsIm5iZiI6MTU5NzYzMTcxOCwianRpIjoiS1BmVGhOOXJYbUpJZUR5RiIsInN1YiI6MiwicHJ2IjoiY2E2NDg5ZDUwZjI0MDdhNjc4MzBlODA5MGQwMTQ4ODM1Njg1OTYyYiIsInJvbGUiOiJlbXBsb3llZSJ9.Kr9oiHTHOG1X28jsY38QC2y_6RarDhXfHWN0B_ZS7ME'
+			// config.headers['A-Token'] = getToken()
+			config.headers['A-Token'] = " eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczpcL1wvdGVzdC1kaW5nLmcxMDcuY29tXC9hcGlcL2RpbmdcL2xvZ2luIiwiaWF0IjoxNTk3NDc5OTgxLCJleHAiOjE1OTgwNzk5ODEsIm5iZiI6MTU5NzQ3OTk4MSwianRpIjoiVnpYeUQwRW82dU1VWFJNVSIsInN1YiI6MiwicHJ2IjoiY2E2NDg5ZDUwZjI0MDdhNjc4MzBlODA5MGQwMTQ4ODM1Njg1OTYyYiIsInJvbGUiOiJlbXBsb3llZSJ9.mfpDxWCOwNYevccHWwYu2nHc6FRjyz-2RjCbEflMXiY"
 		// }
 		return config
 	},

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

@@ -0,0 +1,112 @@
+<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);
+    },
+  },
+};
+</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>

+ 90 - 17
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>
+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: "", //>=0
+        normal: "", //>=0
+        no_sign: "", //<=0
+        absent: "", //<=0
+        on_duty_late: "", //<=0
+        off_duty_early: "", //<=0
+        ot_per_hour: "", //>=0
+        leave_per_hour: "", //<=0
+      },
+    };
+  },
+  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;
+
+      this.$axios.post("api/ad/update", this.obj).then((res) => {
+        console.log(res);
+      });
+    },
+  },
+};
 </script>
 
 <style>
-	export default {
-		data() {
-			return {
-
-			};
-		},
-		created() {
-
-		},
-		mounted() {
-
-		},
-		methods:{
-			
-		}
-	};
 </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>