Browse Source

考勤中心

wuhongbo 1 năm trước cách đây
mục cha
commit
638d5d0847

+ 28 - 0
client/src/views/OaSystem/attendanceCenter/all.vue

@@ -0,0 +1,28 @@
+<template>
+  <div class="attendanceCenter"> 公司考勤 </div>
+</template>
+<script setup lang="ts">
+import OaCalendar from '@/views/OaSystem/components/OaCalendar/index.vue'
+import { useAppStore } from '@/store/modules/app'
+import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
+defineOptions({ name: 'AttendanceAll' })
+const { wsCache } = useCache()
+const appStore = useAppStore()
+const user = wsCache.get(CACHE_KEY.USER)
+const userName = user.user.nickname ? user.user.nickname : 'Admin'
+const calendarList = ref([])
+
+const titleOne = ref('浙江万维')
+onMounted(() => {})
+</script>
+<style lang="scss" scoped>
+h1 {
+  font-size: 20px;
+  margin-bottom: 20px;
+}
+.attendanceCenter {
+  width: 100%;
+  height: 100%;
+  padding: 15px 220px;
+}
+</style>

+ 28 - 0
client/src/views/OaSystem/attendanceCenter/dep.vue

@@ -0,0 +1,28 @@
+<template>
+  <div class="attendanceCenter"> 部门考勤 </div>
+</template>
+<script setup lang="ts">
+import OaCalendar from '@/views/OaSystem/components/OaCalendar/index.vue'
+import { useAppStore } from '@/store/modules/app'
+import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
+defineOptions({ name: 'AttendanceDep' })
+const { wsCache } = useCache()
+const appStore = useAppStore()
+const user = wsCache.get(CACHE_KEY.USER)
+const userName = user.user.nickname ? user.user.nickname : 'Admin'
+const calendarList = ref([])
+
+const titleOne = ref('浙江万维')
+onMounted(() => {})
+</script>
+<style lang="scss" scoped>
+h1 {
+  font-size: 20px;
+  margin-bottom: 20px;
+}
+.attendanceCenter {
+  width: 100%;
+  height: 100%;
+  padding: 15px 220px;
+}
+</style>

+ 33 - 0
client/src/views/OaSystem/attendanceCenter/mine.vue

@@ -0,0 +1,33 @@
+<template>
+  <div class="attendanceCenter">
+    <h1>{{ titleOne }}</h1>
+    <OaCalendar />
+  </div>
+</template>
+<script setup lang="ts">
+import OaCalendar from '@/views/OaSystem/components/OaCalendar/index.vue'
+import { useAppStore } from '@/store/modules/app'
+import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
+defineOptions({ name: 'AttendanceMine' })
+const { wsCache } = useCache()
+const appStore = useAppStore()
+const user = wsCache.get(CACHE_KEY.USER)
+const userName = user.user.nickname ? user.user.nickname : 'Admin'
+const calendarList = ref([])
+
+const titleOne = ref('2023年11月考勤')
+onMounted(() => {
+  console.log(user)
+})
+</script>
+<style lang="scss" scoped>
+h1 {
+  font-size: 20px;
+  margin-bottom: 15px;
+}
+.attendanceCenter {
+  width: 100%;
+  height: 100%;
+  padding: 15px 220px;
+}
+</style>

+ 95 - 24
client/src/views/OaSystem/components/OaCalendar/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="OaCalendar">
-    <div class="selectBox">
+    <div class="selectBox" v-if="false">
       <el-icon class="icon1" @click="lastClick"><ArrowLeftBold /></el-icon>
       <p>{{ moment(nowTime).format('YYYY年MM月') }}</p>
       <el-icon class="icon1" @click="nextClick"><ArrowRightBold /></el-icon>
@@ -15,12 +15,16 @@
             <div class="bomBox">
               <img :src="imgBoxInit(item, index)" />
             </div>
+            <div class="bomBox1">
+              <img :src="imgBoxInit(item, index)" />
+            </div>
           </li>
         </ul>
       </div>
       <div class="infoBox">
-        <span>已填写&nbsp;(天)</span>
-        <p>15</p>
+        <p v-for="(item, index) in attendanceInfo" :key="index">
+          {{ item.name }}:{{ item.value }}{{ item.unit }}
+        </p>
       </div>
     </div>
   </div>
@@ -30,7 +34,78 @@ import { getAssetURL } from '@/utils/auth'
 import moment from 'moment'
 const daysList: any = ref([])
 const nowTime: any = ref(moment().format('YYYY-MM'))
-
+const attendanceInfo = ref([
+  {
+    name: '应工作日',
+    value: '0',
+    unit: '天'
+  },
+  {
+    name: '出勤',
+    value: '0',
+    unit: '天'
+  },
+  {
+    name: '迟到',
+    value: '0',
+    unit: '次'
+  },
+  {
+    name: '早退',
+    value: '0',
+    unit: '次'
+  },
+  {
+    name: '旷工',
+    value: '0',
+    unit: '天'
+  },
+  {
+    name: ' 事假',
+    value: '0',
+    unit: '天'
+  },
+  {
+    name: ' 病假',
+    value: '0',
+    unit: '天'
+  },
+  {
+    name: ' 年休假',
+    value: '0',
+    unit: '天'
+  },
+  {
+    name: '工伤',
+    value: '0',
+    unit: '天'
+  },
+  {
+    name: ' 出差',
+    value: '0',
+    unit: '天'
+  },
+  {
+    name: ' 调休',
+    value: '0',
+    unit: '天'
+  },
+  {
+    name: '产假/护理假/丧假',
+    value: '0',
+    unit: '天'
+  },
+  {
+    name: '婚假',
+    value: '0',
+    unit: '天'
+  },
+  {
+    name: ' 其它',
+    value: '0',
+    unit: '天'
+  }
+])
 const initDates = async () => {
   let curDays: any = moment(nowTime.value).daysInMonth() // 当前天数
   let currentM: any = nowTime.value // 当前月
@@ -104,15 +179,12 @@ onMounted(() => {
   }
   .contentBox {
     width: 100%;
-    height: 80px;
-    display: flex;
-    align-items: center;
-    justify-content: space-between;
+    height: 160px;
     border: 1px solid #dee0e3;
 
     .ulBox {
-      width: calc(100% - 120px);
-      height: 100%;
+      width: calc(100%);
+      height: calc(100% - 40px);
       ul {
         width: 100%;
         height: 100%;
@@ -124,7 +196,7 @@ onMounted(() => {
         height: 100%;
         .topBox {
           width: 100%;
-          height: 50%;
+          height: 40px;
           border: 1px solid #dee0e3;
           display: flex;
           align-items: center;
@@ -151,7 +223,7 @@ onMounted(() => {
 
         .bomBox {
           width: 100%;
-          height: 50%;
+          height: 40px;
           display: flex;
           align-items: center;
           justify-content: center;
@@ -159,6 +231,13 @@ onMounted(() => {
             user-select: none;
           }
         }
+        .bomBox1 {
+          width: 100%;
+          height: 40px;
+          display: flex;
+          align-items: center;
+          justify-content: center;
+        }
       }
       li:first-child {
         .topBox {
@@ -172,24 +251,16 @@ onMounted(() => {
       }
     }
     .infoBox {
-      width: 120px;
-      height: 100%;
+      width: 100%;
+      height: 40px;
       display: flex;
       align-items: center;
       justify-content: space-between;
       flex-wrap: wrap;
       background-color: #edf0f4;
-      border-left: 1px solid #dee0e3;
-      span {
-        display: block;
-        width: 100%;
-        text-align: center;
-        font-size: 14px;
-      }
+      padding: 0 10px;
       p {
-        width: 100%;
-        text-align: center;
-        font-size: 18px;
+        font-size: 14px;
       }
     }
   }

+ 4 - 1
client/src/views/OaSystem/oaLayout/header.vue

@@ -10,7 +10,7 @@
     <div class="header-right">
       <ul class="menuUl" v-if="menuUlShow">
         <li v-for="(item, index) in reactiveData.routes" :key="index" v-show="item.alwaysShow">
-          <router-link :to="'/oaSystem/projectCenter/' + item.path">
+          <router-link :to="'/oaSystem/' + pathBossName + '/' + item.path">
             <span>{{ item.name }}</span>
           </router-link>
         </li>
@@ -97,6 +97,8 @@ const reactiveData: any = reactive({
 const menuUlShow = ref(false) // 菜单列表是否显示,是首页就不显示
 const headerTitleName: any = ref('') // 标题名称
 const router = useRouter()
+
+const pathBossName = ref('')
 const initMenus = async () => {
   const uid = router.currentRoute.value
   let locals: any = localStorage.getItem('roleRouters')
@@ -120,6 +122,7 @@ const childFun = async (name: any, arr: any) => {
     if (arr[i].children != null && arr[i].children) {
       for (let j = 0; j < arr[i].children.length; j++) {
         if (arr[i].children[j].path == name) {
+          pathBossName.value = arr[i].path
           headerTitleName.value = arr[i].name
           reactiveData.routes = arr[i].children
         }