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 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> </template>
</el-table-column> </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> </el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" <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" <pagination v-show="totalTwoOutCount > 0" :total="totalTwoOutCount" :page.sync="queryRecord.pageNum"
:limit.sync="queryRecord.pageSize" @pagination="getOutCountList" /> :limit.sync="queryRecord.pageSize" @pagination="getOutCountList" />
</el-dialog> </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> </div>
</template> </template>
<script> <script>
import { getDetail } from "@/api/report/monthlyError"; 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 { listDeptTree } from "@/api/system/userInfo";
import Treeselect from "@riophae/vue-treeselect"; import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css"; import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import { getOutCountList, exportOutCountList } from "@/api/report/attReport"; import { getOutCountList, exportOutCountList } from '@/api/report/attReport'
var monstr = ""; var monstr = "";
export default { export default {
@ -242,7 +280,7 @@ export default {
typeList: [], typeList: [],
// //
title: "", title: "",
title1: "打卡记录", title1: "正常打卡天数",
title2: "迟到记录", title2: "迟到记录",
title3: "早退记录", title3: "早退记录",
title4: "旷工记录", title4: "旷工记录",
@ -252,6 +290,7 @@ export default {
title8: "轮休记录", title8: "轮休记录",
title9: "临时外出记录", title9: "临时外出记录",
title10: "出差天数", title10: "出差天数",
title11: "打卡记录",
// //
open: false, open: false,
showRecord: false, showRecord: false,
@ -299,6 +338,19 @@ export default {
// //
loadingTwo: false, loadingTwo: false,
tableDataOutCount: [], tableDataOutCount: [],
queryAttCount: {
pageNum: 1,
pageSize: 10,
month: undefined,
userName: undefined,
},
showAttCount: false,
totalAttCount: 0,
//
loadingAttCount: false,
tableDataAttCount: [],
}; };
}, },
created() { created() {
@ -384,7 +436,7 @@ export default {
this.queryRecord.userId = row.userId; this.queryRecord.userId = row.userId;
this.queryRecord.attCurrentMonth = row.attCurrentMonth; this.queryRecord.attCurrentMonth = row.attCurrentMonth;
this.attCurrentMonth = row.attCurrentMonth; this.attCurrentMonth = row.attCurrentMonth;
if (titleBoss == '打卡记录') { if (titleBoss == '正常打卡天数') {
this.queryRecord.attStatis = 1; this.queryRecord.attStatis = 1;
} else if (titleBoss == '迟到记录') { } else if (titleBoss == '迟到记录') {
this.queryRecord.attStatis = 2; 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> </script>

View File

@ -1,150 +1,174 @@
<template> <template>
<div class="app-container" id="monthlyError"> <div class="app-container" id="monthlyError">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
<el-form-item label="选择月份" prop="attCurrentMonth"> <el-form-item label="选择月份" prop="attCurrentMonth">
<!-- <el-date-picker <!-- <el-date-picker
v-model="queryParams.attCurrentMonth" v-model="queryParams.attCurrentMonth"
style="width: 240px" style="width: 240px"
placeholder="请选择月份" placeholder="请选择月份"
type="month" type="month"
value-format="yyyy-MM" value-format="yyyy-MM"
></el-date-picker> --> ></el-date-picker> -->
<el-date-picker v-model="queryParams.attCurrentMonth" type="monthrange" range-separator="" start-placeholder="开始月份" <el-date-picker v-model="queryParams.attCurrentMonth" type="monthrange" range-separator=""
end-placeholder="结束月份" value-format="yyyy-MM" :clearable="false" :editable="false"> start-placeholder="开始月份"
end-placeholder="结束月份" value-format="yyyy-MM" :clearable="false" :editable="false"
>
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="部门" prop="orgId"> <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"
</el-form-item> placeholder="选择部门" style="width: 240px"
<el-form-item label="姓名:" prop="name"> />
<el-input </el-form-item>
v-model="queryParams.name" <el-form-item label="姓名:" prop="name">
placeholder="请输入姓名" <el-input
clearable v-model="queryParams.name"
@keyup.enter.native="handleQuery" placeholder="请输入姓名"
maxlength="20" clearable
/> @keyup.enter.native="handleQuery"
</el-form-item> maxlength="20"
<el-form-item> />
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">查询</el-button> </el-form-item>
<el-button icon="el-icon-refresh" size="mini" @click="reset">重置</el-button> <el-form-item>
<el-button <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">查询</el-button>
type="warning" <el-button icon="el-icon-refresh" size="mini" @click="reset">重置</el-button>
plain <el-button
icon="el-icon-download" type="warning"
size="mini" plain
@click="handleExport" icon="el-icon-download"
v-hasPermi="['att:detail:export']" size="mini"
>导出数据</el-button> @click="handleExport"
</el-form-item> v-hasPermi="['att:detail:export']"
</el-form> >导出数据
</el-button>
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="tableData" ref="multipleTable" row-key="id" > <el-table v-loading="loading" :data="tableData" ref="multipleTable" row-key="id">
<el-table-column label="序号" align="center" width="80" type="index"> <el-table-column label="序号" align="center" width="80" type="index">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }}</span> <span>{{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="姓名" align="center" prop="name" sortable/> <el-table-column label="姓名" align="center" prop="name" sortable/>
<el-table-column label="所属部门" align="center" prop="orgName" sortable/> <el-table-column label="所属部门" align="center" prop="orgName" sortable/>
<el-table-column label="考勤月份" align="center" prop="attCurrentMonth" sortable/> <el-table-column label="考勤月份" align="center" prop="attCurrentMonth" sortable/>
<el-table-column label="应出勤天数" align="center" prop="requiredDays" sortable/> <el-table-column label="应出勤天数" align="center" prop="requiredDays" sortable/>
<el-table-column label="正常打卡天数" align="center" prop="normalNum" sortable> <el-table-column label="正常打卡天数" align="center" prop="normalNum" sortable>
<template slot-scope="scope"> <template slot-scope="scope">
<div <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> {{ scope.row.normalNum }}
</div>
</template> </template>
</el-table-column> </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"> <template slot-scope="scope">
<div <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> {{ scope.row.lateNum }}
</div>
</template> </template>
</el-table-column> </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"> <template slot-scope="scope">
<div <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> {{ scope.row.earlyNum }}
</div>
</template> </template>
</el-table-column> </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"> <template slot-scope="scope">
<div <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> {{ scope.row.skippingNum }}
</div>
</template> </template>
</el-table-column> </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"> <template slot-scope="scope">
<div <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> {{ scope.row.addressErrorNum }}
</div>
</template> </template>
</el-table-column> </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"> <template slot-scope="scope">
<div <div
@click="openRecord(scope.row,title6)" style="color: #02a7f0; cursor: pointer"> @click="openRecord(scope.row,title6)" style="color: #02a7f0; cursor: pointer">
{{ scope.row.einErrorNum}} {{ scope.row.einErrorNum}}
</div> </div>
</template>
</el-table-column>-->
<el-table-column label="请假天数" align="center" prop="leaveNum" sortable>
<template slot-scope="scope">
<div
@click="openRecord(scope.row,title7)" style="color: #02a7f0; cursor: pointer"
>
{{ scope.row.leaveNum }}
</div>
</template> </template>
</el-table-column>--> </el-table-column>
<el-table-column label="请假天数" align="center" prop="leaveNum" sortable>
<template slot-scope="scope">
<div
@click="openRecord(scope.row,title7)" style="color: #02a7f0; cursor: pointer">
{{ scope.row.leaveNum}}
</div>
</template>
</el-table-column>
</el-table>
<pagination <el-table-column label="打卡记录" align="center" prop="clockingRecordNum">
v-show="total>0" <template slot-scope="scope">
:total="total" <div @click="openAttCountList(scope.row)" style="color: #02a7f0; cursor: pointer">
:page.sync="queryParams.pageNum" {{ scope.row.clockingRecordNum }}
:limit.sync="queryParams.pageSize" </div>
@pagination="getList" </template>
/> </el-table-column>
<!-- 相关记录 --> </el-table>
<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"> <pagination
<el-form-item label="选择考勤时间段"> v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 相关记录 -->
<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 <el-date-picker
v-model="dateRange" v-model="dateRange"
style="width: 240px" style="width: 240px"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
type="daterange" type="daterange"
range-separator="-" range-separator="-"
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期" end-placeholder="结束日期"
:picker-options="pickerOptions" :picker-options="pickerOptions"
></el-date-picker> ></el-date-picker>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQueryRecord">查询</el-button> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQueryRecord">查询</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetRecord">重置</el-button> <el-button icon="el-icon-refresh" size="mini" @click="resetRecord">重置</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table v-loading="loadingTwo" :data="tableDataRecord" width="900px" height = "600px" row-key="id"> <el-table v-loading="loadingTwo" :data="tableDataRecord" width="900px" height="600px" row-key="id">
<el-table-column label="序号" align="center" width="80" type="index"> <el-table-column label="序号" align="center" width="80" type="index">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ (queryRecord.pageNum - 1) * queryRecord.pageSize + scope.$index + 1 }}</span> <span>{{ (queryRecord.pageNum - 1) * queryRecord.pageSize + scope.$index + 1 }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="id" align="center" prop="id" v-if="false" /> <el-table-column label="id" align="center" prop="id" v-if="false"/>
<el-table-column label="姓名" align="center" prop="name" width="80" sortable/> <el-table-column label="姓名" align="center" prop="name" width="80" sortable/>
<el-table-column label="所属部门" align="center" prop="orgName" sortable/> <el-table-column label="所属部门" align="center" prop="orgName" sortable/>
<el-table-column label="考勤日期" align="center" prop="attCurrent" width="100" sortable>\ <el-table-column label="考勤日期" align="center" prop="attCurrent" width="100" sortable>\
@ -154,16 +178,16 @@
</el-table-column> </el-table-column>
<el-table-column label="上班打卡时间" align="center" prop="goWorkTime" width="140" sortable/> <el-table-column label="上班打卡时间" align="center" prop="goWorkTime" width="140" sortable/>
<el-table-column label="上班状态" align="center" prop="goWorkStatus" width="100" sortable> <el-table-column label="上班状态" align="center" prop="goWorkStatus" width="100" sortable>
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :options="dict.type.att_status" :value="scope.row.goWorkStatus"/> <dict-tag :options="dict.type.att_status" :value="scope.row.goWorkStatus"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="上班打卡地址" align="center" prop="goWorkAddress" sortable/> <el-table-column label="上班打卡地址" align="center" prop="goWorkAddress" sortable/>
<el-table-column label="下班打卡时间" align="center" prop="offWorkTime" width="140" sortable/> <el-table-column label="下班打卡时间" align="center" prop="offWorkTime" width="140" sortable/>
<el-table-column label="下班状态" align="center" prop="offWorkStatus" width="100" sortable> <el-table-column label="下班状态" align="center" prop="offWorkStatus" width="100" sortable>
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :options="dict.type.att_status" :value="scope.row.offWorkStatus"/> <dict-tag :options="dict.type.att_status" :value="scope.row.offWorkStatus"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="下班打卡地址" align="center" prop="offWorkAddress" sortable/> <el-table-column label="下班打卡地址" align="center" prop="offWorkAddress" sortable/>
</el-table> </el-table>
@ -176,285 +200,355 @@
@pagination="getListRecord" @pagination="getListRecord"
/> />
</el-dialog> </el-dialog>
</div>
</template>
<script> <!-- 打卡次数记录 -->
import { listMonthlyError,getDetail,exportMonthlyError} from "@/api/report/monthlyError"; <el-dialog :title="title" :visible.sync="showAttCount" width="1200px" height="1000px" append-to-body>
import {listDeptTree} from "@/api/system/userInfo"; <el-form :model="queryAttCount" ref="queryFormRecordAtt" size="small" :inline="true" v-show="showSearch"
import { downloadFile } from '@/utils/download' label-width="110px">
import Treeselect from "@riophae/vue-treeselect"; <el-form-item>
import "@riophae/vue-treeselect/dist/vue-treeselect.css"; </el-form-item>
// import { getEngineeringList } from "@/api/select"; </el-form>
import { getToken } from '@/utils/auth'
export default {
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'],
components: { Treeselect },
data() {
return {
showAttribute:false,
//
loading: false,
//
loadingTwo: false,
//
ids: [],
//
deptOptions: [],
//
showSearch: true,
showRecord:false,
maxLength:100,//
//
total: 0,
totalTwo: 0,
//
tableData: [],
tableDataRecord: [],
//
title: "",
title1: "打卡记录",
title2: "迟到记录",
title3: "早退记录",
title4: "旷工记录",
title5: "打卡地异常记录",
title6: "出入异常记录",
title7: "请假记录",
//
open: false,
dateRange: [],
startDate:undefined,
endDate:undefined,
queryParams: { <el-table v-loading="loadingAttCount" :data="tableDataAttCount" width="900px" height="600px" row-key="id">
pageNum: 1,
pageSize: 10,
attCurrentMonth:undefined,
name:undefined,
orgName: undefined,
orgId: undefined,
},
queryRecord: {
pageNum: 1,
pageSize: 10,
userId: undefined,
attStatis: undefined,
attCurrent: undefined,
},
//
pickerOptions: {
disabledDate: this.disabledDate,
}
}; <el-table-column label="序号" align="center" width="80" type="index">
}, <template slot-scope="scope">
computed: { <span>{{ (queryAttCount.pageNum - 1) * queryAttCount.pageSize + scope.$index + 1 }}</span>
}, </template>
created() { </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>
this.getMonth(); <pagination v-show="totalAttCount > 0" :total="totalAttCount" :page.sync="queryAttCount.pageNum"
this.getDeptList(); :limit.sync="queryAttCount.pageSize" @pagination="getClockingRecordListByUserId" />
if(this.$route.query.param){ </el-dialog>
console.log(this.$route.query.param)
this.queryParams.attCurrentMonth=this.$route.query.param
}
this.getList();
},
mounted(){
},
methods: {
disabledDate(time) {
const str=this.queryRecord.attCurrent+'-01';
//
var currentDate = new Date(str);
//
var firstDayOfMonth = new Date(currentDate.getFullYear(), currentDate.getMonth(), 1);
//
var lastDayOfMonth = new Date(currentDate.getFullYear(), currentDate.getMonth() + 1, 0);
return time < firstDayOfMonth || time > lastDayOfMonth;
},
// defaultTime(){
// // ['2023-04-01', '2023-04-10']
// console.log(11111111111111)
// const str=this.queryRecord.attCurrent+'-01';
// var currentDate = new Date(str);
// //
// var firstDayOfMonth = new Date(currentDate.getFullYear(), currentDate.getMonth(), 1);
// //
// var lastDayOfMonth = new Date(currentDate.getFullYear(), currentDate.getMonth() + 1, 0);
// const strTemp=[firstDayOfMonth,lastDayOfMonth]
// return strTemp;
// },
getMonth(){
//
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);
// var date = new Date();
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()]; //
return `${year}-${month}-${day} ${weekday}`; // </div>
}, </template>
getDeptList(){ <script>
listDeptTree().then(response => { import { listMonthlyError, getDetail, exportMonthlyError,getClockingRecordListByUserId } from '@/api/report/monthlyError'
this.deptOptions = this.handleTree(response.data, "id"); 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'
normalizer(node) { // import { getEngineeringList } from "@/api/select";
if (node.children && !node.children.length) { import { getToken } from '@/utils/auth'
delete node.children;
}
return {
id: node.id,
label: node.orgName,
children: node.children
};
},
handleSelect(value, instanceId) {
console.log('Selected:', value);
//
this.queryParams.orgName=value.orgName;
},
/** 查询月异常列表 */ export default {
getList() { name: 'MonthlyError',
this.loading = true; dicts: ['att_status'],
let query = _.cloneDeep(this.queryParams); // dicts: ['sys_normal_disable','sys_voltage_level','sys_org_name','sys_pro_type','sys_pro_status',
query.startMonth = query.attCurrentMonth[0]; // 'sys_yz_manage','sys_sg_manage','sys_jl_manage','sys_device_type'],
query.endMonth = query.attCurrentMonth[1]; components: { Treeselect },
delete query['attCurrentMonth']; data() {
console.log(query) return {
listMonthlyError(query).then(response => { showAttribute: false,
this.tableData = response.rows; //
this.total = response.total; loading: false,
this.loading = false; //
}); loadingTwo: false,
}, //
ids: [],
//
deptOptions: [],
//
showSearch: true,
showRecord: false,
maxLength: 100,//
//
total: 0,
totalTwo: 0,
//
tableData: [],
tableDataRecord: [],
//
title: '',
title1: '打卡记录',
title2: '迟到记录',
title3: '早退记录',
title4: '旷工记录',
title5: '打卡地异常记录',
title6: '出入异常记录',
title7: '请假记录',
//
open: false,
dateRange: [],
startDate: undefined,
endDate: undefined,
/** 搜索按钮操作 */ queryParams: {
handleQuery() { pageNum: 1,
this.queryParams.pageNum = 1; pageSize: 10,
this.getList(); attCurrentMonth: undefined,
}, name: undefined,
orgName: undefined,
// orgId: undefined
reset() {
this.queryForm = {};
this.resetForm("queryForm");
this.getList();
},
//
resetRecord() {
// this.queryFormRecord = {};
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;
if(titleBoss=='打卡记录'){
this.queryRecord.attStatis=1;
}else if(titleBoss=='迟到记录'){
this.queryRecord.attStatis=2;
}else if(titleBoss=='早退记录'){
this.queryRecord.attStatis=4;
}else if(titleBoss=='旷工记录'){
this.queryRecord.attStatis=3;
}else if(titleBoss=='打卡地异常记录'){
this.queryRecord.attStatis=9;
}else if(titleBoss=='出入异常记录'){
this.queryRecord.attStatis=8;
}else if(titleBoss=='请假记录'){
this.queryRecord.attStatis=6;
}
this.showRecord = true;
this.getListRecord();
},
/** 查询月异常详情列表 */
getListRecord() {
this.loadingTwo = true;
getDetail(this.addDateRange(this.queryRecord, this.dateRange)).then(response => {
this.tableDataRecord = response.rows;
this.totalTwo = response.total;
this.loadingTwo = false;
});
},
/** 搜索按钮操作 */
handleQueryRecord() {
this.queryRecord.pageNum = 1;
this.getListRecord();
},
cancelRecord() {
this.showRecord = false;
this.resetRecord();
},
/** 导出按钮操作 */
handleExport() {
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' })
})
}, },
} queryRecord: {
}; pageNum: 1,
</script> pageSize: 10,
userId: undefined,
attStatis: undefined,
attCurrent: undefined
},
//
pickerOptions: {
disabledDate: this.disabledDate
},
<style lang="scss" scoped> queryAttCount: {
.uploadImg { pageNum: 1,
padding-top: 20px; pageSize: 10,
display: flex; month: undefined,
align-items: center; userName: undefined
justify-content: center; },
} showAttCount: false,
.deviceCode { totalAttCount: 0,
margin-top: 10px; //
padding-bottom: 20px; loadingAttCount: false,
font-size: 18px; tableDataAttCount: []
}
::v-deep.el-table .fixed-width .el-button--mini { }
width: 60px !important; },
margin-bottom: 10px; computed: {},
} created() {
//css
::v-deep.disabled { this.getMonth()
.el-upload--picture-card { this.getDeptList()
display: none; if (this.$route.query.param) {
console.log(this.$route.query.param)
this.queryParams.attCurrentMonth = this.$route.query.param
}
this.getList()
},
mounted() {
},
methods: {
disabledDate(time) {
const str = this.queryRecord.attCurrent + '-01'
//
var currentDate = new Date(str)
//
var firstDayOfMonth = new Date(currentDate.getFullYear(), currentDate.getMonth(), 1)
//
var lastDayOfMonth = new Date(currentDate.getFullYear(), currentDate.getMonth() + 1, 0)
return time < firstDayOfMonth || time > lastDayOfMonth
},
// defaultTime(){
// // ['2023-04-01', '2023-04-10']
// console.log(11111111111111)
// const str=this.queryRecord.attCurrent+'-01';
// var currentDate = new Date(str);
// //
// var firstDayOfMonth = new Date(currentDate.getFullYear(), currentDate.getMonth(), 1);
// //
// var lastDayOfMonth = new Date(currentDate.getFullYear(), currentDate.getMonth() + 1, 0);
// const strTemp=[firstDayOfMonth,lastDayOfMonth]
// return strTemp;
// },
getMonth() {
//
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)
// var date = new Date();
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()] //
return `${year}-${month}-${day} ${weekday}` //
},
getDeptList() {
listDeptTree().then(response => {
this.deptOptions = this.handleTree(response.data, 'id')
})
},
/** 转换部门数据结构 */
normalizer(node) {
if (node.children && !node.children.length) {
delete node.children
}
return {
id: node.id,
label: node.orgName,
children: node.children
}
},
handleSelect(value, instanceId) {
console.log('Selected:', value)
//
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']
console.log(query)
listMonthlyError(query).then(response => {
this.tableData = response.rows
this.total = response.total
this.loading = false
})
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
//
reset() {
this.queryForm = {}
this.resetForm('queryForm')
this.getList()
},
//
resetRecord() {
// this.queryFormRecord = {};
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
if (titleBoss == '打卡记录') {
this.queryRecord.attStatis = 1
} else if (titleBoss == '迟到记录') {
this.queryRecord.attStatis = 2
} else if (titleBoss == '早退记录') {
this.queryRecord.attStatis = 4
} else if (titleBoss == '旷工记录') {
this.queryRecord.attStatis = 3
} else if (titleBoss == '打卡地异常记录') {
this.queryRecord.attStatis = 9
} else if (titleBoss == '出入异常记录') {
this.queryRecord.attStatis = 8
} else if (titleBoss == '请假记录') {
this.queryRecord.attStatis = 6
}
this.showRecord = true
this.getListRecord()
},
/** 查询月异常详情列表 */
getListRecord() {
this.loadingTwo = true
getDetail(this.addDateRange(this.queryRecord, this.dateRange)).then(response => {
this.tableDataRecord = response.rows
this.totalTwo = response.total
this.loadingTwo = false
})
},
/** 搜索按钮操作 */
handleQueryRecord() {
this.queryRecord.pageNum = 1
this.getListRecord()
},
cancelRecord() {
this.showRecord = false
this.resetRecord()
},
/** 导出按钮操作 */
handleExport() {
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'
})
})
},
//
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
})
}
} }
</style> }
</script>
<style lang="scss" scoped>
.uploadImg {
padding-top: 20px;
display: flex;
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 {
display: none;
}
}
</style>