This commit is contained in:
fl 2025-02-19 13:56:49 +08:00
commit 580da770f2
4 changed files with 582 additions and 398 deletions

View File

@ -19,3 +19,13 @@ export function exportMonthReport(query) {
params: query
})
}
// 查询外出次数查询列表
export function getClockingRecordListByUserId(query) {
return request({
url: '/system/attDetails/getClockingRecordListByUserId',
method: 'get',
params: query
})
}

View File

@ -30,3 +30,12 @@ export function exportMonthlyError(query) {
})
}
// 查询外出次数查询列表
export function getClockingRecordListByUserId(query) {
return request({
url: '/system/attDetails/getClockingRecordListByUserId',
method: 'get',
params: query
})
}

View File

@ -124,6 +124,14 @@
</template>
</el-table-column>
<el-table-column label="打卡记录" align="center" prop="clockingRecordNum">
<template slot-scope="scope">
<div @click="openAttCountList(scope.row)" style="color: #02a7f0; cursor: pointer">
{{ scope.row.clockingRecordNum }}
</div>
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
@ -208,16 +216,46 @@
<pagination v-show="totalTwoOutCount > 0" :total="totalTwoOutCount" :page.sync="queryRecord.pageNum"
:limit.sync="queryRecord.pageSize" @pagination="getOutCountList" />
</el-dialog>
<!-- 打卡次数记录 -->
<el-dialog :title="title" :visible.sync="showAttCount" width="1200px" height="1000px" append-to-body>
<el-form :model="queryAttCount" ref="queryFormRecordAtt" size="small" :inline="true" v-show="showSearch"
label-width="110px">
<el-form-item>
</el-form-item>
</el-form>
<el-table v-loading="loadingAttCount" :data="tableDataAttCount" width="900px" height="600px" row-key="id">
<el-table-column label="序号" align="center" width="80" type="index">
<template slot-scope="scope">
<span>{{ (queryAttCount.pageNum - 1) * queryAttCount.pageSize + scope.$index + 1 }}</span>
</template>
</el-table-column>
<el-table-column label="考勤日期" align="center" prop="attCurrentDay" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span>{{ formatDate(scope.row.attCurrentDay) }}</span>
</template>
</el-table-column>
<el-table-column label="考勤时间" align="center" prop="attCurrentTime" sortable :show-overflow-tooltip="true" />
<el-table-column label="打卡地址" align="center" prop="attAddress" sortable :show-overflow-tooltip="true" />
<el-table-column label="备注" align="center" prop="remark" sortable :show-overflow-tooltip="true" />
</el-table>
<pagination v-show="totalAttCount > 0" :total="totalAttCount" :page.sync="queryAttCount.pageNum"
:limit.sync="queryAttCount.pageSize" @pagination="getClockingRecordListByUserId" />
</el-dialog>
</div>
</template>
<script>
import { getDetail } from "@/api/report/monthlyError";
import { getMonthAttReport, exportMonthReport } from "@/api/report/monthReport";
import { getMonthAttReport, exportMonthReport , getClockingRecordListByUserId} from "@/api/report/monthReport";
import { listDeptTree } from "@/api/system/userInfo";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import { getOutCountList, exportOutCountList } from "@/api/report/attReport";
import { getOutCountList, exportOutCountList } from '@/api/report/attReport'
var monstr = "";
export default {
@ -242,7 +280,7 @@ export default {
typeList: [],
//
title: "",
title1: "打卡记录",
title1: "正常打卡天数",
title2: "迟到记录",
title3: "早退记录",
title4: "旷工记录",
@ -252,6 +290,7 @@ export default {
title8: "轮休记录",
title9: "临时外出记录",
title10: "出差天数",
title11: "打卡记录",
//
open: false,
showRecord: false,
@ -299,6 +338,19 @@ export default {
//
loadingTwo: false,
tableDataOutCount: [],
queryAttCount: {
pageNum: 1,
pageSize: 10,
month: undefined,
userName: undefined,
},
showAttCount: false,
totalAttCount: 0,
//
loadingAttCount: false,
tableDataAttCount: [],
};
},
created() {
@ -384,7 +436,7 @@ export default {
this.queryRecord.userId = row.userId;
this.queryRecord.attCurrentMonth = row.attCurrentMonth;
this.attCurrentMonth = row.attCurrentMonth;
if (titleBoss == '打卡记录') {
if (titleBoss == '正常打卡天数') {
this.queryRecord.attStatis = 1;
} else if (titleBoss == '迟到记录') {
this.queryRecord.attStatis = 2;
@ -489,6 +541,25 @@ export default {
})
},
//
openAttCountList(row) {
this.title = "打卡记录";
this.queryAttCount.month = row.attCurrentMonth;
this.queryAttCount.userName = row.userName;
this.showAttCount = true;
this.getClockingRecordListByUserId();
},
/** 查询打卡次数记录列表 */
getClockingRecordListByUserId() {
this.loadingAttCount = true;
getClockingRecordListByUserId(this.queryAttCount).then(response => {
this.tableDataAttCount = response.rows;
this.totalAttCount = response.total;
this.loadingAttCount = false;
});
},
}
};
</script>

View File

@ -9,12 +9,16 @@
type="month"
value-format="yyyy-MM"
></el-date-picker> -->
<el-date-picker v-model="queryParams.attCurrentMonth" type="monthrange" range-separator="" start-placeholder="开始月份"
end-placeholder="结束月份" value-format="yyyy-MM" :clearable="false" :editable="false">
<el-date-picker v-model="queryParams.attCurrentMonth" type="monthrange" range-separator=""
start-placeholder="开始月份"
end-placeholder="结束月份" value-format="yyyy-MM" :clearable="false" :editable="false"
>
</el-date-picker>
</el-form-item>
<el-form-item label="部门" prop="orgId">
<treeselect v-model="queryParams.orgId" :options="deptOptions" :normalizer="normalizer" @select="handleSelect" placeholder="选择部门" style="width: 240px"/>
<treeselect v-model="queryParams.orgId" :options="deptOptions" :normalizer="normalizer" @select="handleSelect"
placeholder="选择部门" style="width: 240px"
/>
</el-form-item>
<el-form-item label="姓名:" prop="name">
<el-input
@ -35,7 +39,8 @@
size="mini"
@click="handleExport"
v-hasPermi="['att:detail:export']"
>导出数据</el-button>
>导出数据
</el-button>
</el-form-item>
</el-form>
@ -53,44 +58,49 @@
<el-table-column label="正常打卡天数" align="center" prop="normalNum" sortable>
<template slot-scope="scope">
<div
@click="openRecord(scope.row,title1)" style="color: #02a7f0; cursor: pointer">
@click="openRecord(scope.row,title1)" style="color: #02a7f0; cursor: pointer"
>
{{ scope.row.normalNum }}
</div>
</template>
</el-table-column>
<el-table-column label="迟到数" align="center" prop="lateNum" sortable>
<el-table-column label="迟到数" align="center" prop="lateNum" sortable>
<template slot-scope="scope">
<div
@click="openRecord(scope.row,title2)" style="color: #02a7f0; cursor: pointer">
@click="openRecord(scope.row,title2)" style="color: #02a7f0; cursor: pointer"
>
{{ scope.row.lateNum }}
</div>
</template>
</el-table-column>
<el-table-column label="早退数" align="center" prop="earlyNum" sortable>
<el-table-column label="早退数" align="center" prop="earlyNum" sortable>
<template slot-scope="scope">
<div
@click="openRecord(scope.row,title3)" style="color: #02a7f0; cursor: pointer">
@click="openRecord(scope.row,title3)" style="color: #02a7f0; cursor: pointer"
>
{{ scope.row.earlyNum }}
</div>
</template>
</el-table-column>
<el-table-column label="旷工数" align="center" prop="skippingNum" sortable>
<el-table-column label="旷工数" align="center" prop="skippingNum" sortable>
<template slot-scope="scope">
<div
@click="openRecord(scope.row,title4)" style="color: #02a7f0; cursor: pointer">
@click="openRecord(scope.row,title4)" style="color: #02a7f0; cursor: pointer"
>
{{ scope.row.skippingNum }}
</div>
</template>
</el-table-column>
<el-table-column label="打卡地异常数" align="center" prop="addressErrorNum" sortable>
<el-table-column label="打卡地异常数" align="center" prop="addressErrorNum" sortable>
<template slot-scope="scope">
<div
@click="openRecord(scope.row,title5)" style="color: #02a7f0; cursor: pointer">
@click="openRecord(scope.row,title5)" style="color: #02a7f0; cursor: pointer"
>
{{ scope.row.addressErrorNum }}
</div>
</template>
</el-table-column>
<!-- <el-table-column label="出入异常数" align="center" prop="einErrorNum" sortable>
<!-- <el-table-column label="出入异常数" align="center" prop="einErrorNum" sortable>
<template slot-scope="scope">
<div
@click="openRecord(scope.row,title6)" style="color: #02a7f0; cursor: pointer">
@ -101,11 +111,21 @@
<el-table-column label="请假天数" align="center" prop="leaveNum" sortable>
<template slot-scope="scope">
<div
@click="openRecord(scope.row,title7)" style="color: #02a7f0; cursor: pointer">
@click="openRecord(scope.row,title7)" style="color: #02a7f0; cursor: pointer"
>
{{ scope.row.leaveNum }}
</div>
</template>
</el-table-column>
<el-table-column label="打卡记录" align="center" prop="clockingRecordNum">
<template slot-scope="scope">
<div @click="openAttCountList(scope.row)" style="color: #02a7f0; cursor: pointer">
{{ scope.row.clockingRecordNum }}
</div>
</template>
</el-table-column>
</el-table>
<pagination
@ -117,8 +137,12 @@
/>
<!-- 相关记录 -->
<el-dialog :title="title" :visible.sync="showRecord" width="1200px" height="1000px" append-to-body @close="cancelRecord">
<el-form :model="queryRecord" ref="queryFormRecord" size="small" :inline="true" v-show="showSearch" label-width="110px">
<el-dialog :title="title" :visible.sync="showRecord" width="1200px" height="1000px" append-to-body
@close="cancelRecord"
>
<el-form :model="queryRecord" ref="queryFormRecord" size="small" :inline="true" v-show="showSearch"
label-width="110px"
>
<el-form-item label="选择考勤时间段">
<el-date-picker
v-model="dateRange"
@ -178,19 +202,52 @@
</el-dialog>
<!-- 打卡次数记录 -->
<el-dialog :title="title" :visible.sync="showAttCount" width="1200px" height="1000px" append-to-body>
<el-form :model="queryAttCount" ref="queryFormRecordAtt" size="small" :inline="true" v-show="showSearch"
label-width="110px">
<el-form-item>
</el-form-item>
</el-form>
<el-table v-loading="loadingAttCount" :data="tableDataAttCount" width="900px" height="600px" row-key="id">
<el-table-column label="序号" align="center" width="80" type="index">
<template slot-scope="scope">
<span>{{ (queryAttCount.pageNum - 1) * queryAttCount.pageSize + scope.$index + 1 }}</span>
</template>
</el-table-column>
<el-table-column label="考勤日期" align="center" prop="attCurrentDay" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span>{{ formatDate(scope.row.attCurrentDay) }}</span>
</template>
</el-table-column>
<el-table-column label="考勤时间" align="center" prop="attCurrentTime" sortable :show-overflow-tooltip="true" />
<el-table-column label="打卡地址" align="center" prop="attAddress" sortable :show-overflow-tooltip="true" />
<el-table-column label="备注" align="center" prop="remark" sortable :show-overflow-tooltip="true" />
</el-table>
<pagination v-show="totalAttCount > 0" :total="totalAttCount" :page.sync="queryAttCount.pageNum"
:limit.sync="queryAttCount.pageSize" @pagination="getClockingRecordListByUserId" />
</el-dialog>
</div>
</template>
<script>
import { listMonthlyError,getDetail,exportMonthlyError} from "@/api/report/monthlyError";
import {listDeptTree} from "@/api/system/userInfo";
import { listMonthlyError, getDetail, exportMonthlyError,getClockingRecordListByUserId } from '@/api/report/monthlyError'
import { listDeptTree } from '@/api/system/userInfo'
import { downloadFile } from '@/utils/download'
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
// import { getEngineeringList } from "@/api/select";
import { getToken } from '@/utils/auth'
export default {
name: "MonthlyError",
name: 'MonthlyError',
dicts: ['att_status'],
// dicts: ['sys_normal_disable','sys_voltage_level','sys_org_name','sys_pro_type','sys_pro_status',
// 'sys_yz_manage','sys_sg_manage','sys_jl_manage','sys_device_type'],
@ -217,14 +274,14 @@
tableData: [],
tableDataRecord: [],
//
title: "",
title1: "打卡记录",
title2: "迟到记录",
title3: "早退记录",
title4: "旷工记录",
title5: "打卡地异常记录",
title6: "出入异常记录",
title7: "请假记录",
title: '',
title1: '打卡记录',
title2: '迟到记录',
title3: '早退记录',
title4: '旷工记录',
title5: '打卡地异常记录',
title6: '出入异常记录',
title7: '请假记录',
//
open: false,
dateRange: [],
@ -237,7 +294,7 @@
attCurrentMonth: undefined,
name: undefined,
orgName: undefined,
orgId: undefined,
orgId: undefined
},
queryRecord: {
@ -245,39 +302,50 @@
pageSize: 10,
userId: undefined,
attStatis: undefined,
attCurrent: undefined,
attCurrent: undefined
},
//
pickerOptions: {
disabledDate: this.disabledDate,
}
disabledDate: this.disabledDate
},
};
queryAttCount: {
pageNum: 1,
pageSize: 10,
month: undefined,
userName: undefined
},
computed: {
showAttCount: false,
totalAttCount: 0,
//
loadingAttCount: false,
tableDataAttCount: []
}
},
computed: {},
created() {
this.getMonth();
this.getDeptList();
this.getMonth()
this.getDeptList()
if (this.$route.query.param) {
console.log(this.$route.query.param)
this.queryParams.attCurrentMonth = this.$route.query.param
}
this.getList();
this.getList()
},
mounted() {
},
methods: {
disabledDate(time) {
const str=this.queryRecord.attCurrent+'-01';
const str = this.queryRecord.attCurrent + '-01'
//
var currentDate = new Date(str);
var currentDate = new Date(str)
//
var firstDayOfMonth = new Date(currentDate.getFullYear(), currentDate.getMonth(), 1);
var firstDayOfMonth = new Date(currentDate.getFullYear(), currentDate.getMonth(), 1)
//
var lastDayOfMonth = new Date(currentDate.getFullYear(), currentDate.getMonth() + 1, 0);
return time < firstDayOfMonth || time > lastDayOfMonth;
var lastDayOfMonth = new Date(currentDate.getFullYear(), currentDate.getMonth() + 1, 0)
return time < firstDayOfMonth || time > lastDayOfMonth
},
// defaultTime(){
// // ['2023-04-01', '2023-04-10']
@ -293,146 +361,169 @@
// },
getMonth() {
//
var nowDate = new Date();
var nowDate = new Date()
var date = {
year: nowDate.getFullYear(),
month: nowDate.getMonth() + 1,
day: nowDate.getDate()
};
const dayDate = date.year + "-" + (date.month >= 10 ? date.month : "0" + date.month);
}
const dayDate = date.year + '-' + (date.month >= 10 ? date.month : '0' + date.month)
// var date = new Date();
this.$set(this.queryParams, "attCurrentMonth", [dayDate.toString(),dayDate.toString()]);
this.$set(this.queryParams, 'attCurrentMonth', [dayDate.toString(), dayDate.toString()])
},
formatDate(dateString) {
const date = new Date(dateString); //
const year = date.getFullYear(); //
const month = String(date.getMonth() + 1).padStart(2, '0'); // 0
const day = String(date.getDate()).padStart(2, '0'); //
const weekdays = ['星期天', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六']; //
const weekday = weekdays[date.getDay()]; //
const date = new Date(dateString) //
const year = date.getFullYear() //
const month = String(date.getMonth() + 1).padStart(2, '0') // 0
const day = String(date.getDate()).padStart(2, '0') //
const weekdays = ['星期天', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'] //
const weekday = weekdays[date.getDay()] //
return `${year}-${month}-${day} ${weekday}`; //
return `${year}-${month}-${day} ${weekday}` //
},
getDeptList() {
listDeptTree().then(response => {
this.deptOptions = this.handleTree(response.data, "id");
});
this.deptOptions = this.handleTree(response.data, 'id')
})
},
/** 转换部门数据结构 */
normalizer(node) {
if (node.children && !node.children.length) {
delete node.children;
delete node.children
}
return {
id: node.id,
label: node.orgName,
children: node.children
};
}
},
handleSelect(value, instanceId) {
console.log('Selected:', value);
console.log('Selected:', value)
//
this.queryParams.orgName=value.orgName;
this.queryParams.orgName = value.orgName
},
/** 查询月异常列表 */
getList() {
this.loading = true;
let query = _.cloneDeep(this.queryParams);
query.startMonth = query.attCurrentMonth[0];
query.endMonth = query.attCurrentMonth[1];
delete query['attCurrentMonth'];
this.loading = true
let query = _.cloneDeep(this.queryParams)
query.startMonth = query.attCurrentMonth[0]
query.endMonth = query.attCurrentMonth[1]
delete query['attCurrentMonth']
console.log(query)
listMonthlyError(query).then(response => {
this.tableData = response.rows;
this.total = response.total;
this.loading = false;
});
this.tableData = response.rows
this.total = response.total
this.loading = false
})
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
this.queryParams.pageNum = 1
this.getList()
},
//
reset() {
this.queryForm = {};
this.resetForm("queryForm");
this.getList();
this.queryForm = {}
this.resetForm('queryForm')
this.getList()
},
//
resetRecord() {
// this.queryFormRecord = {};
this.dateRange = [];
this.resetForm("queryFormRecord");
this.getListRecord();
this.dateRange = []
this.resetForm('queryFormRecord')
this.getListRecord()
},
//
openRecord(row, titleBoss) {
this.id = row.id;
this.title = titleBoss;
this.queryRecord.userId = row.userId;
this.queryRecord.orgId = row.orgId;
this.queryRecord.attCurrent = row.attCurrentMonth;
this.id = row.id
this.title = titleBoss
this.queryRecord.userId = row.userId
this.queryRecord.orgId = row.orgId
this.queryRecord.attCurrent = row.attCurrentMonth
if (titleBoss == '打卡记录') {
this.queryRecord.attStatis=1;
this.queryRecord.attStatis = 1
} else if (titleBoss == '迟到记录') {
this.queryRecord.attStatis=2;
this.queryRecord.attStatis = 2
} else if (titleBoss == '早退记录') {
this.queryRecord.attStatis=4;
this.queryRecord.attStatis = 4
} else if (titleBoss == '旷工记录') {
this.queryRecord.attStatis=3;
this.queryRecord.attStatis = 3
} else if (titleBoss == '打卡地异常记录') {
this.queryRecord.attStatis=9;
this.queryRecord.attStatis = 9
} else if (titleBoss == '出入异常记录') {
this.queryRecord.attStatis=8;
this.queryRecord.attStatis = 8
} else if (titleBoss == '请假记录') {
this.queryRecord.attStatis=6;
this.queryRecord.attStatis = 6
}
this.showRecord = true;
this.getListRecord();
this.showRecord = true
this.getListRecord()
},
/** 查询月异常详情列表 */
getListRecord() {
this.loadingTwo = true;
this.loadingTwo = true
getDetail(this.addDateRange(this.queryRecord, this.dateRange)).then(response => {
this.tableDataRecord = response.rows;
this.totalTwo = response.total;
this.loadingTwo = false;
});
this.tableDataRecord = response.rows
this.totalTwo = response.total
this.loadingTwo = false
})
},
/** 搜索按钮操作 */
handleQueryRecord() {
this.queryRecord.pageNum = 1;
this.getListRecord();
this.queryRecord.pageNum = 1
this.getListRecord()
},
cancelRecord() {
this.showRecord = false;
this.resetRecord();
this.showRecord = false
this.resetRecord()
},
/** 导出按钮操作 */
handleExport() {
let query = _.cloneDeep(this.queryParams);
query.startMonth = query.attCurrentMonth[0];
query.endMonth = query.attCurrentMonth[1];
delete query['attCurrentMonth'];
let query = _.cloneDeep(this.queryParams)
query.startMonth = query.attCurrentMonth[0]
query.endMonth = query.attCurrentMonth[1]
delete query['attCurrentMonth']
console.log(query)
exportMonthlyError(query).then(res => {
downloadFile({ fileName: `月异常报表_${new Date().getTime()}.xlsx`, fileData: res, fileType: 'application/vnd.ms-excel;charset=utf-8' })
downloadFile({
fileName: `月异常报表_${new Date().getTime()}.xlsx`,
fileData: res,
fileType: 'application/vnd.ms-excel;charset=utf-8'
})
})
},
//
openAttCountList(row) {
this.title = '打卡记录'
this.queryAttCount.month = row.attCurrentMonth
this.queryAttCount.userName = row.name
this.showAttCount = true
this.getClockingRecordListByUserId()
},
/** 查询打卡次数记录列表 */
getClockingRecordListByUserId() {
this.loadingAttCount = true
getClockingRecordListByUserId(this.queryAttCount).then(response => {
this.tableDataAttCount = response.rows
this.totalAttCount = response.total
this.loadingAttCount = false
})
}
}
}
};
</script>
<style lang="scss" scoped>
@ -442,15 +533,18 @@
align-items: center;
justify-content: center;
}
.deviceCode {
margin-top: 10px;
padding-bottom: 20px;
font-size: 18px;
}
::v-deep.el-table .fixed-width .el-button--mini {
width: 60px !important;
margin-bottom: 10px;
}
//css
::v-deep.disabled {
.el-upload--picture-card {