考勤明细添加数据同步页面

This commit is contained in:
cwchen 2025-02-18 18:14:29 +08:00
parent 7b245359a3
commit 6f1e3c9872
2 changed files with 668 additions and 552 deletions

View File

@ -92,4 +92,74 @@ export function exportOutCountList(query) {
})
}
/*数据同步1*/
export function ayscData(query) {
return request({
url: '/system/attDetails/getAttCountList',
method: 'get',
params: query
})
}
/*数据同步2*/
export function ayscData2(query) {
return request({
url: '/system/attDetails/getAttCountList',
method: 'get',
params: query
})
}
/*数据同步3*/
export function ayscData3(query) {
return request({
url: '/system/attDetails/getAttCountList',
method: 'get',
params: query
})
}
/*数据同步4*/
export function ayscData4(query) {
return request({
url: '/system/attDetails/getAttCountList',
method: 'get',
params: query
})
}
/*数据同步5*/
export function ayscData5(query) {
return request({
url: '/system/attDetails/getAttCountList',
method: 'get',
params: query
})
}
/*数据同步6*/
export function ayscData6(query) {
return request({
url: '/system/attDetails/getAttCountList',
method: 'get',
params: query
})
}
/*数据同步7*/
export function ayscData7(query) {
return request({
url: '/system/attDetails/getAttCountList',
method: 'get',
params: query
})
}
/*数据同步8*/
export function ayscData8(query) {
return request({
url: '/system/attDetails/getAttCountList',
method: 'get',
params: query
})
}

View File

@ -2,48 +2,29 @@
<div class="app-container" id="attDetails">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="姓名" prop="userName">
<el-input
v-model="queryParams.userName"
placeholder="请输入姓名"
clearable
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
<el-input v-model="queryParams.userName" placeholder="请输入姓名" clearable style="width: 240px"
@keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="部门" prop="orgId">
<treeselect v-model="queryParams.orgId" :options="deptOptions" :normalizer="normalizer" placeholder="选择部门" style="width: 240px"/>
<treeselect v-model="queryParams.orgId" :options="deptOptions" :normalizer="normalizer" placeholder="选择部门"
style="width: 240px" />
</el-form-item>
<el-form-item label="状态" prop="attStatus">
<el-select
v-model="queryParams.attStatus"
placeholder="状态"
clearable
style="width: 240px"
>
<el-option
v-for="dict in dict.type.att_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
<el-select v-model="queryParams.attStatus" placeholder="状态" clearable style="width: 240px">
<el-option v-for="dict in dict.type.att_status" :key="dict.value" :label="dict.label" :value="dict.value" />
</el-select>
</el-form-item>
<el-form-item label="日期">
<el-date-picker
v-model="dateRange"
style="width: 240px"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
<el-date-picker v-model="dateRange" style="width: 240px" value-format="yyyy-MM-dd" type="daterange"
range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
<el-button type="warning" icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['att:attReport:export']">导出</el-button>
<el-button type="warning" icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['att:attReport:abnormal']">异常数据导出</el-button>
<el-button type="warning" icon="el-icon-download" size="mini" @click="handleExport"
v-hasPermi="['att:attReport:export']">导出</el-button>
<el-button type="warning" icon="el-icon-download" size="mini" @click="handleExport"
v-hasPermi="['att:attReport:abnormal']">异常数据导出</el-button>
<el-button type="primary" size="mini" @click="openDialog" v-hasPermi="['att:attReport:batch']">批量修改</el-button>
<el-button type="primary" size="mini" @click="openData" v-hasPermi="['att:attReport:syn']">数据同步</el-button>
@ -79,17 +60,15 @@
</el-table-column>
<el-table-column label="工作时间外出次数" align="center" prop="normalNum" width="180">
<template slot-scope="scope">
<div
@click="openOutCountList(scope.row)" style="color: #02a7f0; cursor: pointer">
{{ scope.row.outCount}}
<div @click="openOutCountList(scope.row)" style="color: #02a7f0; cursor: pointer">
{{ scope.row.outCount }}
</div>
</template>
</el-table-column>
<el-table-column label="打卡记录" align="center" prop="normalNum" >
<el-table-column label="打卡记录" align="center" prop="normalNum">
<template slot-scope="scope">
<div
@click="openAttCountList(scope.row)" style="color: #02a7f0; cursor: pointer">
{{ scope.row.attCount}}
<div @click="openAttCountList(scope.row)" style="color: #02a7f0; cursor: pointer">
{{ scope.row.attCount }}
</div>
</template>
</el-table-column>
@ -97,7 +76,7 @@
<el-table-column label="上班打卡时间" align="center" prop="toWorkAttCurrentTime" width="180"></el-table-column>
<el-table-column label="上班状态" align="center" prop="toWorkAttStatus">
<template slot-scope="scope">
<dict-tag :options="dict.type.att_status" :value="scope.row.toWorkAttStatus"/>
<dict-tag :options="dict.type.att_status" :value="scope.row.toWorkAttStatus" />
</template>
</el-table-column>
<el-table-column label="打卡地址" align="center" prop="toWorkAttAddress" :show-overflow-tooltip="true" />
@ -105,27 +84,23 @@
<el-table-column label="下班打卡时间" align="center" prop="offWorkAttCurrentTime" width="180"></el-table-column>
<el-table-column label="下班状态" align="center" prop="offWorkAttStatus">
<template slot-scope="scope">
<dict-tag :options="dict.type.att_status" :value="scope.row.offWorkAttStatus"/>
<dict-tag :options="dict.type.att_status" :value="scope.row.offWorkAttStatus" />
</template>
</el-table-column>
<el-table-column label="打卡地址" align="center" prop="offWorkAttAddress" :show-overflow-tooltip="true" />
<el-table-column label="异常备注" align="center" prop="offWorkErrorRemake" :show-overflow-tooltip="true" />
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
@pagination="getList" />
<el-dialog title="批量修改" :visible.sync="open" width="1200px" append-to-body @close="cancel">
<el-table v-loading="loading" :data="dialogList" width="100%" height="500px">
<el-table-column label="序号" type="index" width="55" align="center" fixed/>
<el-table-column label="姓名" align="center" prop="userName" fixed/>
<el-table-column label="所属部门" align="center" prop="orgName" :show-overflow-tooltip="true" width="150" fixed/>
<el-table-column label="考勤日期" align="center" prop="attCurrentDay" :show-overflow-tooltip="true" width="180" fixed>
<el-table-column label="序号" type="index" width="55" align="center" fixed />
<el-table-column label="姓名" align="center" prop="userName" fixed />
<el-table-column label="所属部门" align="center" prop="orgName" :show-overflow-tooltip="true" width="150" fixed />
<el-table-column label="考勤日期" align="center" prop="attCurrentDay" :show-overflow-tooltip="true" width="180"
fixed>
<template slot-scope="scope">
<span>{{ formatDate(scope.row.attCurrentDay) }}</span>
</template>
@ -135,10 +110,8 @@
<span class="required-star">*</span> 修改上班时间
</template>
<template slot-scope="scope">
<el-date-picker
v-model="scope.row.toWorkAttCurrentTime" :clearable="false"
type="datetime" value-format="yyyy-MM-dd HH:mm:ss" style="width: 95%"
placeholder="选择上班时间">
<el-date-picker v-model="scope.row.toWorkAttCurrentTime" :clearable="false" type="datetime"
value-format="yyyy-MM-dd HH:mm:ss" style="width: 95%" placeholder="选择上班时间">
</el-date-picker>
</template>
</el-table-column>
@ -147,19 +120,15 @@
<span class="required-star">*</span> 修改上班状态
</template>
<template slot-scope="scope">
<el-select
v-model="scope.row.toWorkAttStatus" @change="changeToWorkAttStatus"
placeholder="修改后上班状态" style="width: 95%">
<el-option
v-for="dict in dict.type.att_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
<el-select v-model="scope.row.toWorkAttStatus" @change="changeToWorkAttStatus" placeholder="修改后上班状态"
style="width: 95%">
<el-option v-for="dict in dict.type.att_status" :key="dict.value" :label="dict.label"
:value="dict.value" />
</el-select>
</template>
</el-table-column>
<el-table-column label="打卡地址" align="center" prop="toWorkAttAddress" :show-overflow-tooltip="true" width="180"/>
<el-table-column label="打卡地址" align="center" prop="toWorkAttAddress" :show-overflow-tooltip="true"
width="180" />
<el-table-column align="center" prop="toErrorRemake" width="200">
<template slot="header">
<span class="required-star">*</span> 原因说明
@ -174,10 +143,8 @@
<span class="required-star">*</span> 修改下班时间
</template>
<template slot-scope="scope">
<el-date-picker
v-model="scope.row.offWorkAttCurrentTime" :clearable="false"
type="datetime" value-format="yyyy-MM-dd HH:mm:ss" style="width: 95%"
placeholder="选择下班时间">
<el-date-picker v-model="scope.row.offWorkAttCurrentTime" :clearable="false" type="datetime"
value-format="yyyy-MM-dd HH:mm:ss" style="width: 95%" placeholder="选择下班时间">
</el-date-picker>
</template>
</el-table-column>
@ -186,19 +153,14 @@
<span class="required-star">*</span> 修改下班状态
</template>
<template slot-scope="scope">
<el-select
v-model="scope.row.offWorkAttStatus"
placeholder="修改后下班状态" style="width: 95%">
<el-option
v-for="dict in dict.type.att_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
<el-select v-model="scope.row.offWorkAttStatus" placeholder="修改后下班状态" style="width: 95%">
<el-option v-for="dict in dict.type.att_status" :key="dict.value" :label="dict.label"
:value="dict.value" />
</el-select>
</template>
</el-table-column>
<el-table-column label="打卡地址" align="center" prop="offWorkAttAddress" :show-overflow-tooltip="true" width="180"></el-table-column>
<el-table-column label="打卡地址" align="center" prop="offWorkAttAddress" :show-overflow-tooltip="true"
width="180"></el-table-column>
<el-table-column align="center" prop="offErrorRemake" width="200">
<template slot="header">
<span class="required-star">*</span> 原因说明
@ -216,14 +178,15 @@
<!-- 外出次数查询 -->
<el-dialog :title="title" :visible.sync="showOutCount" width="1200px" height="1000px" append-to-body >
<el-form :model="queryRecord" ref="queryFormRecord" size="small" :inline="true" v-show="showSearch" label-width="110px">
<el-dialog :title="title" :visible.sync="showOutCount" width="1200px" height="1000px" append-to-body>
<el-form :model="queryRecord" ref="queryFormRecord" size="small" :inline="true" v-show="showSearch"
label-width="110px">
<el-form-item>
<el-button type="warning" icon="el-icon-download" size="mini" @click="handleExportOutCountList">导出</el-button>
</el-form-item>
</el-form>
<el-table v-loading="loadingTwo" :data="tableDataOutCount" width="900px" height = "600px" row-key="id">
<el-table v-loading="loadingTwo" :data="tableDataOutCount" width="900px" height="600px" row-key="id">
<el-table-column label="序号" align="center" width="80" type="index">
<template slot-scope="scope">
<span>{{ (queryRecord.pageNum - 1) * queryRecord.pageSize + scope.$index + 1 }}</span>
@ -238,25 +201,21 @@
<el-table-column label="打卡地址" align="center" prop="attAddress" sortable :show-overflow-tooltip="true" />
</el-table>
<pagination
v-show="totalTwo>0"
:total="totalTwo"
:page.sync="queryRecord.pageNum"
:limit.sync="queryRecord.pageSize"
@pagination="getOutCountList"
/>
<pagination v-show="totalTwo > 0" :total="totalTwo" :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="queryRecord" ref="queryFormRecord" size="small" :inline="true" v-show="showSearch" label-width="110px">
<el-dialog :title="title" :visible.sync="showAttCount" width="1200px" height="1000px" append-to-body>
<el-form :model="queryRecord" ref="queryFormRecord" size="small" :inline="true" v-show="showSearch"
label-width="110px">
<el-form-item>
<!-- <el-button type="warning" icon="el-icon-download" size="mini" @click="handleExport">导出</el-button>-->
</el-form-item>
</el-form>
<el-table v-loading="loadingAttCount" :data="tableDataAttCount" width="900px" height = "600px" row-key="id">
<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>
@ -271,21 +230,42 @@
<el-table-column label="打卡地址" align="center" prop="attAddress" sortable :show-overflow-tooltip="true" />
</el-table>
<pagination
v-show="totalAttCount>0"
:total="totalAttCount"
:page.sync="queryAttCount.pageNum"
:limit.sync="queryAttCount.pageSize"
@pagination="getAttCountList"
/>
<pagination v-show="totalAttCount > 0" :total="totalAttCount" :page.sync="queryAttCount.pageNum"
:limit.sync="queryAttCount.pageSize" @pagination="getAttCountList" />
</el-dialog>
<!-- 数据同步对话框 -->
<el-dialog :title="dataAyscTitle" :visible.sync="dataAyscOpen" width="500px" append-to-body>
<el-form ref="form2" :model="form2" label-width="80px">
<el-row>
<el-form-item label="日期" prop="dateRange">
<el-date-picker v-model="form2.dateRange" style="width: 100%" value-format="yyyy-MM-dd" type="daterange"
range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
</el-form-item>
</el-row>
<el-row style="margin-top: 10px;">
<el-button type="primary" plain @click="operMethod(1)">按钮</el-button>
<el-button type="primary" plain @click="operMethod(2)">按钮2</el-button>
<el-button type="primary" plain @click="operMethod(3)">按钮3</el-button>
<el-button type="primary" plain @click="operMethod(4)">按钮4</el-button>
</el-row>
<el-row style="margin-top: 10px;">
<el-button type="primary" plain @click="operMethod(5)">按钮5</el-button>
<el-button type="primary" plain @click="operMethod(6)">按钮6</el-button>
<el-button type="primary" plain @click="operMethod(7)">按钮7</el-button>
<el-button type="primary" plain @click="operMethod(8)">按钮8</el-button>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dataAyscOpen = !dataAyscOpen"> </el-button>
</div>
</el-dialog>
</div>
</template>
</template>
<script>
import {
<script>
import {
getDetailsList,
updateAttDetails,
exportAttRecord,
@ -293,13 +273,21 @@
listDept,
getOutCountList,
getAttCountList,
exportOutCountList
} from "@/api/report/attReport";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import {checkPersonAssignment} from "@/api/system/userInfo";
import {getDetail} from "@/api/report/monthlyError";
export default {
exportOutCountList,
ayscData,
ayscData2,
ayscData3,
ayscData4,
ayscData5,
ayscData6,
ayscData7,
ayscData8,
} from "@/api/report/attReport";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import { checkPersonAssignment } from "@/api/system/userInfo";
import { getDetail } from "@/api/report/monthlyError";
export default {
name: "AttDetails",
dicts: ['att_status'],
components: { Treeselect },
@ -323,8 +311,8 @@
title: "",
//
open: false,
dialogList:[],
dialogListOld:[],
dialogList: [],
dialogListOld: [],
//
dateRange: [],
deptOptions: [],
@ -343,7 +331,7 @@
attCurrentDay: undefined,
userName: undefined,
},
showOutCount:false,
showOutCount: false,
totalTwo: 0,
//
loadingTwo: false,
@ -357,12 +345,16 @@
attCurrentDay: undefined,
userName: undefined,
},
showAttCount:false,
showAttCount: false,
totalAttCount: 0,
//
loadingAttCount: false,
tableDataAttCount: [],
dataAyscTitle: '数据同步',
dataAyscOpen: false,
form2: {
dateRange:[this.getToday(),this.getToday()]
},
};
},
created() {
@ -381,10 +373,10 @@
const sunday = new Date(monday);
sunday.setDate(sunday.getDate() + 6);
this.dateRange[0]=monday.toISOString().split('T')[0];
this.dateRange[1]=sunday.toISOString().split('T')[0];
this.dateRange[0] = monday.toISOString().split('T')[0];
this.dateRange[1] = sunday.toISOString().split('T')[0];
},
formatDate(dateString){
formatDate(dateString) {
const date = new Date(dateString); //
const year = date.getFullYear(); //
const month = String(date.getMonth() + 1).padStart(2, '0'); // 0
@ -394,7 +386,7 @@
return `${year}-${month}-${day} ${weekday}`; //
},
getDeptList(){
getDeptList() {
listDept().then(response => {
this.deptOptions = this.handleTree(response.data, "id");
});
@ -414,12 +406,12 @@
getList() {
this.loading = true;
console.log(this.dateRange)
if(this.dateRange&&this.dateRange.length>0){
this.queryParams.startDate=this.dateRange[0]
this.queryParams.endDate=this.dateRange[1]
}else{
this.queryParams.startDate=undefined
this.queryParams.endDate=undefined
if (this.dateRange && this.dateRange.length > 0) {
this.queryParams.startDate = this.dateRange[0]
this.queryParams.endDate = this.dateRange[1]
} else {
this.queryParams.startDate = undefined
this.queryParams.endDate = undefined
}
getDetailsList(this.queryParams).then(response => {
this.typeList = response.rows;
@ -435,33 +427,87 @@
},
/** 重置按钮操作 */
resetQuery() {
this.dateRange=[]
this.dateRange = []
this.getWeekDates();
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.dialogList=selection.slice();
this.dialogList = selection.slice();
},
openDialog(){
openDialog() {
console.log(this.dialogList)
if(this.dialogList.length>0){
this.open=true;
this.dialogListOld=JSON.parse(JSON.stringify(this.dialogList));
}else{
if (this.dialogList.length > 0) {
this.open = true;
this.dialogListOld = JSON.parse(JSON.stringify(this.dialogList));
} else {
this.$message({ message: '请先勾选数据!', type: 'warning' })
}
},
openData(){
if(this.dateRange&&this.dateRange.length>0){
this.queryParams.startDate=this.dateRange[0]
this.queryParams.endDate=this.dateRange[1]
openData() {
this.dataAyscOpen = true;
},
getToday() {
const date = new Date();
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
return `${year}-${month}-${day}`;
},
operMethod(type){
const query = {
startDate:this.form2.dateRange[0],
endDate:this.form2.dateRange[1],
}
let loading = this.$loading({
lock: true,
text: "数据同步中,请稍候...",
background: 'rgba(0,0,0,0.2)'
})
if(type === 1){
ayscData(query).then(res=>{
loading.close();
}).catch(err=>{});
}else if(type === 2){
ayscData2(query).then(res=>{
loading.close();
}).catch(err=>{});
}else if(type === 3){
ayscData3(query).then(res=>{
loading.close();
}).catch(err=>{});
}else if(type === 4){
ayscData4(query).then(res=>{
loading.close();
}).catch(err=>{});
}else if(type === 5){
ayscData5(query).then(res=>{
loading.close();
}).catch(err=>{});
}else if(type === 6){
ayscData6(query).then(res=>{
loading.close();
}).catch(err=>{});
}else if(type === 7){
ayscData7(query).then(res=>{
loading.close();
}).catch(err=>{});
}else if(type === 8){
ayscData8(query).then(res=>{
loading.close();
}).catch(err=>{});
}
},
openData2() {
if (this.dateRange && this.dateRange.length > 0) {
this.queryParams.startDate = this.dateRange[0]
this.queryParams.endDate = this.dateRange[1]
let param={
startDate:this.queryParams.startDate,
endDate : this.queryParams.endDate,
id:'1'
let param = {
startDate: this.queryParams.startDate,
endDate: this.queryParams.endDate,
id: '1'
}
console.log(param)
this.$modal.confirm(`是否开始数据同步"${this.queryParams.startDate}~${this.queryParams.endDate}"的数据项?`)
@ -484,12 +530,12 @@
this.$modal.msgError("数据同步失败:" + error.message || "未知错误");
}
});
}else{
} else {
this.$message({ message: '请先选择日期!', type: 'warning' })
}
},
submitEdit(){
submitEdit() {
let paramList = []
let hasError = false;
@ -542,13 +588,13 @@
console.log("存在错误,未提交数据。");
}
},
cancel(){
cancel() {
this.getList();
this.open=false;
this.open = false;
},
/** 导出按钮操作 */
handleExport() {
this.queryParams.exportType="考勤明细"
this.queryParams.exportType = "考勤明细"
exportAttRecord(this.queryParams).then(res => {
this.downloadFile({ fileName: `考勤记录_${new Date().getTime()}.xlsx`, fileData: res, fileType: 'application/vnd.ms-excel;charset=utf-8' })
})
@ -556,7 +602,7 @@
//
openOutCountList(row){
openOutCountList(row) {
this.title = "工作时间外出次数";
this.queryRecord.userId = row.userId;
this.queryRecord.attCurrentDay = row.attCurrentDay;
@ -575,7 +621,7 @@
},
//
openAttCountList(row){
openAttCountList(row) {
this.title = "打卡记录";
this.queryAttCount.userId = row.userId;
this.queryAttCount.userName = row.userName;
@ -606,8 +652,8 @@
},
}
};
</script>
};
</script>
<style scoped>
.required-star {