|
@@ -2,6 +2,10 @@
|
|
<div class="attendanceCenterDep">
|
|
<div class="attendanceCenterDep">
|
|
<h1>考勤统计表</h1>
|
|
<h1>考勤统计表</h1>
|
|
<div class="depSearch">
|
|
<div class="depSearch">
|
|
|
|
+ <div class="searBox">
|
|
|
|
+ <span class="span">月份:</span>
|
|
|
|
+ <el-date-picker v-model="fromParams.month" type="month" placeholder="请选择月份" />
|
|
|
|
+ </div>
|
|
<div class="searBox">
|
|
<div class="searBox">
|
|
<span class="span">部门:</span>
|
|
<span class="span">部门:</span>
|
|
<el-tree-select
|
|
<el-tree-select
|
|
@@ -13,10 +17,6 @@
|
|
placeholder="请选择部门"
|
|
placeholder="请选择部门"
|
|
/>
|
|
/>
|
|
</div>
|
|
</div>
|
|
- <div class="searBox">
|
|
|
|
- <span class="span">月份:</span>
|
|
|
|
- <el-date-picker v-model="fromParams.month" type="month" placeholder="请选择月份" />
|
|
|
|
- </div>
|
|
|
|
<div class="searBox">
|
|
<div class="searBox">
|
|
<span class="span">人员:</span>
|
|
<span class="span">人员:</span>
|
|
<el-input v-model="fromParams.userName" placeholder="请输入人员名称" />
|
|
<el-input v-model="fromParams.userName" placeholder="请输入人员名称" />
|
|
@@ -34,29 +34,30 @@
|
|
</div>
|
|
</div>
|
|
<div class="depTable">
|
|
<div class="depTable">
|
|
<el-table :data="tableData" style="width: 100%">
|
|
<el-table :data="tableData" style="width: 100%">
|
|
- <el-table-column prop="index" label="序号" width="80" />
|
|
|
|
- <el-table-column prop="dep" label="部门" />
|
|
|
|
- <el-table-column prop="name" label="姓名" />
|
|
|
|
- <!-- <el-table-column label="Delivery Info">
|
|
|
|
- <el-table-column prop="name" label="Name" width="120" />
|
|
|
|
- <el-table-column label="Address Info">
|
|
|
|
- <el-table-column prop="state" label="State" width="120" />
|
|
|
|
- <el-table-column prop="city" label="City" width="120" />
|
|
|
|
- <el-table-column prop="address" label="Address" />
|
|
|
|
- <el-table-column prop="zip" label="Zip" width="120" />
|
|
|
|
|
|
+ <el-table-column prop="index" label="序号" width="40" />
|
|
|
|
+ <el-table-column prop="deptName" label="部门" />
|
|
|
|
+ <el-table-column prop="nickName" label="姓名" width="80" />
|
|
|
|
+ <el-table-column
|
|
|
|
+ v-for="(item, index) in tableHeadList"
|
|
|
|
+ :key="index"
|
|
|
|
+ :label="item.dayOfWeek"
|
|
|
|
+ width="30"
|
|
|
|
+ >
|
|
|
|
+ <el-table-column :label="item.day" width="30">
|
|
|
|
+ <template #default="scope">{{ sco(scope.row, item) }}</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- </el-table-column> -->
|
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
|
- <el-table-column prop="1" label="旷工" />
|
|
|
|
- <el-table-column prop="1" label="迟到" />
|
|
|
|
- <el-table-column prop="1" label="早退" />
|
|
|
|
- <el-table-column prop="1" label="出差" />
|
|
|
|
- <el-table-column prop="1" label="事假" />
|
|
|
|
- <el-table-column prop="1" label="调休" />
|
|
|
|
- <el-table-column prop="1" label="病假" />
|
|
|
|
- <el-table-column prop="1" label="年假" />
|
|
|
|
- <el-table-column prop="1" label="产假" />
|
|
|
|
- <el-table-column prop="1" label="其他" />
|
|
|
|
|
|
+ <el-table-column prop="1" label="旷工" width="40" label-class-name="labelModeRl" />
|
|
|
|
+ <el-table-column prop="1" label="迟到" width="40" label-class-name="labelModeRl" />
|
|
|
|
+ <el-table-column prop="1" label="早退" width="40" label-class-name="labelModeRl" />
|
|
|
|
+ <el-table-column prop="1" label="出差" width="40" label-class-name="labelModeRl" />
|
|
|
|
+ <el-table-column prop="1" label="事假" width="40" label-class-name="labelModeRl" />
|
|
|
|
+ <el-table-column prop="1" label="调休" width="40" label-class-name="labelModeRl" />
|
|
|
|
+ <el-table-column prop="1" label="病假" width="40" label-class-name="labelModeRl" />
|
|
|
|
+ <el-table-column prop="1" label="年假" width="40" label-class-name="labelModeRl" />
|
|
|
|
+ <el-table-column prop="1" label="产假" width="40" label-class-name="labelModeRl" />
|
|
|
|
+ <el-table-column prop="1" label="其他" width="40" label-class-name="labelModeRl" />
|
|
</el-table>
|
|
</el-table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -66,30 +67,15 @@ defineOptions({ name: 'AttendanceDep' })
|
|
import * as DeptApi from '@/api/system/dept'
|
|
import * as DeptApi from '@/api/system/dept'
|
|
import { defaultProps, handleTree } from '@/utils/tree'
|
|
import { defaultProps, handleTree } from '@/utils/tree'
|
|
import * as MineApi from '@/api/oa/attendanceCenter'
|
|
import * as MineApi from '@/api/oa/attendanceCenter'
|
|
-import {
|
|
|
|
- isAttendNormal,
|
|
|
|
- isArrayDelRepeat,
|
|
|
|
- allArrayCalendar,
|
|
|
|
- isArrayDelOrNickname,
|
|
|
|
- allDeptsArr
|
|
|
|
-} from './attendAuth'
|
|
|
|
|
|
+import { isArrayDelOrNickname, allDeptsArr, dayOfWeekCall } from './attendAuth'
|
|
import moment from 'moment'
|
|
import moment from 'moment'
|
|
const fromParams: any = ref({
|
|
const fromParams: any = ref({
|
|
- deptId: '',
|
|
|
|
|
|
+ deptId: '0a168fe9-2ba8-4302-b6b6-a524c1aef967',
|
|
month: '',
|
|
month: '',
|
|
userName: ''
|
|
userName: ''
|
|
})
|
|
})
|
|
const deptList = ref<Tree[]>([]) // 树形结构
|
|
const deptList = ref<Tree[]>([]) // 树形结构
|
|
-const tableData = ref([
|
|
|
|
- {
|
|
|
|
- date: '2016-05-03',
|
|
|
|
- name: 'Tom',
|
|
|
|
- state: 'California',
|
|
|
|
- city: 'Los Angeles',
|
|
|
|
- address: 'No. 189, Grove St, Los Angeles',
|
|
|
|
- zip: 'CA 90036'
|
|
|
|
- }
|
|
|
|
-])
|
|
|
|
|
|
+const tableData = ref([])
|
|
const initTreeDeps = async () => {
|
|
const initTreeDeps = async () => {
|
|
deptList.value = handleTree(await DeptApi.getSimpleDeptList())
|
|
deptList.value = handleTree(await DeptApi.getSimpleDeptList())
|
|
}
|
|
}
|
|
@@ -112,16 +98,33 @@ const initInsMouth = async (date: any) => {
|
|
}
|
|
}
|
|
initWorkDay(date).then((restall) => {
|
|
initWorkDay(date).then((restall) => {
|
|
MineApi.getWorkdaySheetList(params).then((res) => {
|
|
MineApi.getWorkdaySheetList(params).then((res) => {
|
|
- let namesArr: any = isArrayDelOrNickname(res)
|
|
|
|
|
|
+ let namesArr: any = isArrayDelOrNickname(JSON.parse(JSON.stringify(res)))
|
|
let resArr: any = res
|
|
let resArr: any = res
|
|
resArr.forEach((item: any) => {
|
|
resArr.forEach((item: any) => {
|
|
item.date = moment(item.attendanceTime).format('YYYY-MM-DD')
|
|
item.date = moment(item.attendanceTime).format('YYYY-MM-DD')
|
|
})
|
|
})
|
|
let arr = allDeptsArr(restall, resArr, namesArr)
|
|
let arr = allDeptsArr(restall, resArr, namesArr)
|
|
- // console.log(arr)
|
|
|
|
|
|
+ tableData.value = arr
|
|
})
|
|
})
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
+const sco = (row, item) => {
|
|
|
|
+ let swkq = ''
|
|
|
|
+ let xwkq = ''
|
|
|
|
+ row.attendArray.forEach((k) => {
|
|
|
|
+ if (k.date == item.date) {
|
|
|
|
+ if (k.swAttendanceStatus) {
|
|
|
|
+ swkq = k.swAttendanceStatus
|
|
|
|
+ }
|
|
|
|
+ if (k.xwAttendanceStatus) {
|
|
|
|
+ xwkq = k.xwAttendanceStatus
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ return swkq + '' + xwkq
|
|
|
|
+}
|
|
|
|
+const tableHeadList: any = ref([])
|
|
const initWorkDay = async (date: any) => {
|
|
const initWorkDay = async (date: any) => {
|
|
let params = {
|
|
let params = {
|
|
dateDay: date, // 日期(数组)
|
|
dateDay: date, // 日期(数组)
|
|
@@ -136,7 +139,11 @@ const initWorkDay = async (date: any) => {
|
|
let arr = res
|
|
let arr = res
|
|
arr.forEach((item: any) => {
|
|
arr.forEach((item: any) => {
|
|
item.date = moment(item.dateDay).format('YYYY-MM-DD')
|
|
item.date = moment(item.dateDay).format('YYYY-MM-DD')
|
|
|
|
+ item.prop = item.dayOfWeek
|
|
|
|
+ item.dayOfWeek = dayOfWeekCall(item.dayOfWeek)
|
|
|
|
+ item.day = moment(item.dateDay).format('DD')
|
|
})
|
|
})
|
|
|
|
+ tableHeadList.value = arr
|
|
|
|
|
|
return await arr
|
|
return await arr
|
|
}
|
|
}
|
|
@@ -183,6 +190,20 @@ onMounted(() => {
|
|
.depTable {
|
|
.depTable {
|
|
width: 100%;
|
|
width: 100%;
|
|
height: calc(100% - 100px);
|
|
height: calc(100% - 100px);
|
|
|
|
+ overflow-y: auto;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+:deep(.depTable) {
|
|
|
|
+ .el-table {
|
|
|
|
+ .cell {
|
|
|
|
+ font-size: 14px !important;
|
|
|
|
+ padding: 0 !important;
|
|
|
|
+ text-align: center;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .labelModeRl {
|
|
|
|
+ writing-mode: vertical-rl;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|