|
@@ -47,103 +47,112 @@
|
|
|
@click="handleReset('queryForm')"
|
|
|
>重置</el-button
|
|
|
>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ size="mini"
|
|
|
+ plain
|
|
|
+ icon="el-icon-printer"
|
|
|
+ @click="printReport"
|
|
|
+ >打印报表</el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<el-divider></el-divider>
|
|
|
<el-row class="button-group">
|
|
|
<div v-html="showMessage"></div>
|
|
|
</el-row>
|
|
|
- <el-table
|
|
|
- ref="formTable"
|
|
|
- stripe
|
|
|
- :data="tableData"
|
|
|
- :height="tableHeight"
|
|
|
- style="min-height: 400px"
|
|
|
- v-loading="loading"
|
|
|
- @sort-change="sortChange"
|
|
|
- @selection-change="handleSelectionChange"
|
|
|
- >
|
|
|
- <el-table-column
|
|
|
- prop="attendanceDate"
|
|
|
- label="日期"
|
|
|
- width="180"
|
|
|
- ></el-table-column>
|
|
|
- <el-table-column prop="shiftNumbers" label="班次" width="180">
|
|
|
- <template slot-scope="{ row }">
|
|
|
- <span
|
|
|
- v-if="
|
|
|
- row.onWorkStatus != 1 &&
|
|
|
- row.onWorkStatus != 1 &&
|
|
|
- row.onWorkStatus != null
|
|
|
- "
|
|
|
- >
|
|
|
- {{ row.onWorkStatusN }}
|
|
|
- </span>
|
|
|
- <span v-else>
|
|
|
- {{ row.shiftNumbers }}
|
|
|
- </span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="onWorkRecordTime" label="上班打卡时间" width="180"
|
|
|
- ><template slot-scope="{ row }">
|
|
|
- <span v-if="row.onWorkStatus == 1 && row.onWorkResult != 0">
|
|
|
- {{ row.onWorkRecordTime }}
|
|
|
- </span>
|
|
|
- <span v-else></span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="onWorkResult" label="上班打卡状态" width="180">
|
|
|
- <template slot-scope="{ row }">
|
|
|
- <span v-if="row.onWorkStatus == 1 && row.onWorkResult == 0">
|
|
|
- {{ row.onWorkResultN }}
|
|
|
- </span>
|
|
|
- <span
|
|
|
- v-else-if="
|
|
|
- row.onWorkStatus == 1 &&
|
|
|
- row.onWorkResult != 1 &&
|
|
|
- row.onWorkResult != 0
|
|
|
- "
|
|
|
- >
|
|
|
- {{ row.onWorkResultN }} {{ row.onLateLeaveMinuteN }}
|
|
|
- </span>
|
|
|
- <span v-else></span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="offWorkRecordTime" label="下班打卡时间" width="180"
|
|
|
- ><template slot-scope="{ row }">
|
|
|
- <span v-if="row.offWorkStatus == 1 && row.offWorkResult != 0">
|
|
|
- {{ row.offWorkRecordTime }}</span
|
|
|
- >
|
|
|
- <span v-else> </span> </template
|
|
|
- ></el-table-column>
|
|
|
- <el-table-column prop="offWorkResult" label="下班" width="180">
|
|
|
- <template slot-scope="{ row }">
|
|
|
- <span v-if="row.offWorkStatus == 1 && row.offWorkResult == 0">
|
|
|
- {{ row.offWorkResultN }}
|
|
|
- </span>
|
|
|
- <span
|
|
|
- v-if="
|
|
|
- row.offWorkStatus == 1 &&
|
|
|
- row.offWorkResult != 1 &&
|
|
|
- row.offWorkResult != 0
|
|
|
- "
|
|
|
- >
|
|
|
- {{ row.offWorkResultN }} {{ row.OffLateLeaveMinuteN }}
|
|
|
- </span>
|
|
|
- <span v-else></span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="absenteeismDays"
|
|
|
- label="旷工天数"
|
|
|
- width="180"
|
|
|
- ></el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="notSwipingNum"
|
|
|
- label="未打卡次数"
|
|
|
- width="180"
|
|
|
- ></el-table-column>
|
|
|
- </el-table>
|
|
|
+ <section id="printContent">
|
|
|
+ <el-table
|
|
|
+ ref="formTable"
|
|
|
+ stripe
|
|
|
+ :data="tableData"
|
|
|
+ :height="tableHeight"
|
|
|
+ style="min-height: 400px"
|
|
|
+ v-loading="loading"
|
|
|
+ @sort-change="sortChange"
|
|
|
+ @selection-change="handleSelectionChange"
|
|
|
+ >
|
|
|
+ <el-table-column
|
|
|
+ prop="attendanceDate"
|
|
|
+ label="日期"
|
|
|
+ width="180"
|
|
|
+ ></el-table-column>
|
|
|
+ <el-table-column prop="shiftNumbers" label="班次" width="180">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ <span
|
|
|
+ v-if="
|
|
|
+ row.onWorkStatus != 1 &&
|
|
|
+ row.onWorkStatus != 1 &&
|
|
|
+ row.onWorkStatus != null
|
|
|
+ "
|
|
|
+ >
|
|
|
+ {{ row.onWorkStatusN }}
|
|
|
+ </span>
|
|
|
+ <span v-else>
|
|
|
+ {{ row.shiftNumbers }}
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="onWorkRecordTime" label="上班打卡时间" width="180"
|
|
|
+ ><template slot-scope="{ row }">
|
|
|
+ <span v-if="row.onWorkStatus == 1 && row.onWorkResult != 0">
|
|
|
+ {{ row.onWorkRecordTime }}
|
|
|
+ </span>
|
|
|
+ <span v-else></span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="onWorkResult" label="上班打卡状态" width="180">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ <span v-if="row.onWorkStatus == 1 && row.onWorkResult == 0">
|
|
|
+ {{ row.onWorkResultN }}
|
|
|
+ </span>
|
|
|
+ <span
|
|
|
+ v-else-if="
|
|
|
+ row.onWorkStatus == 1 &&
|
|
|
+ row.onWorkResult != 1 &&
|
|
|
+ row.onWorkResult != 0
|
|
|
+ "
|
|
|
+ >
|
|
|
+ {{ row.onWorkResultN }} {{ row.onLateLeaveMinuteN }}
|
|
|
+ </span>
|
|
|
+ <span v-else></span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="offWorkRecordTime" label="下班打卡时间" width="180"
|
|
|
+ ><template slot-scope="{ row }">
|
|
|
+ <span v-if="row.offWorkStatus == 1 && row.offWorkResult != 0">
|
|
|
+ {{ row.offWorkRecordTime }}</span
|
|
|
+ >
|
|
|
+ <span v-else> </span> </template
|
|
|
+ ></el-table-column>
|
|
|
+ <el-table-column prop="offWorkResult" label="下班" width="180">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ <span v-if="row.offWorkStatus == 1 && row.offWorkResult == 0">
|
|
|
+ {{ row.offWorkResultN }}
|
|
|
+ </span>
|
|
|
+ <span
|
|
|
+ v-if="
|
|
|
+ row.offWorkStatus == 1 &&
|
|
|
+ row.offWorkResult != 1 &&
|
|
|
+ row.offWorkResult != 0
|
|
|
+ "
|
|
|
+ >
|
|
|
+ {{ row.offWorkResultN }} {{ row.OffLateLeaveMinuteN }}
|
|
|
+ </span>
|
|
|
+ <span v-else></span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="absenteeismDays"
|
|
|
+ label="旷工天数"
|
|
|
+ width="180"
|
|
|
+ ></el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="notSwipingNum"
|
|
|
+ label="未打卡次数"
|
|
|
+ width="180"
|
|
|
+ ></el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </section>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
@@ -151,6 +160,7 @@ import Constant from "@/constant";
|
|
|
import workScheduleAttendanceApi from "@/api/business/workScheduleAttendance";
|
|
|
import NProgress from "nprogress"; // progress bar
|
|
|
import "nprogress/nprogress.css"; // progress bar style
|
|
|
+import pageUtil from "@/utils/page";
|
|
|
|
|
|
export default {
|
|
|
name: "BusinessWorkScheduleAttendanceDayList",
|
|
@@ -182,6 +192,64 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
+ printReport() {
|
|
|
+ var title = this.personInfo.name + "考勤统计明细";
|
|
|
+
|
|
|
+ var rows = JSON.parse(JSON.stringify(this.tableData));
|
|
|
+
|
|
|
+ rows.forEach(row=>{
|
|
|
+ if(row.onWorkStatus != "1" &&
|
|
|
+ row.onWorkResult != "1" &&
|
|
|
+ row.onWorkStatus != null){
|
|
|
+ rows.shiftNumbers = row.onWorkStatusN;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(row.onWorkStatus != "1" || row.onWorkResult == "0"){
|
|
|
+ row.onWorkRecordTime = "";
|
|
|
+ }
|
|
|
+
|
|
|
+ if(row.onWorkStatus == "1" && row.onWorkResult == "0"){
|
|
|
+ row.onWorkResult = row.onWorkResultN;
|
|
|
+ }
|
|
|
+ else if(row.onWorkStatus == "1" &&
|
|
|
+ row.onWorkResult != "1" &&
|
|
|
+ row.onWorkResult != "0"){
|
|
|
+ row.onWorkResult = row.onWorkResultN + ' ' + row.onLateLeaveMinuteN;
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ row.onWorkStatus = "";
|
|
|
+ }
|
|
|
+
|
|
|
+ if(row.offWorkStatus=="0"){
|
|
|
+ row.offWorkRecordTime = "";
|
|
|
+ }
|
|
|
+
|
|
|
+ if(row.offWorkStatus == 1 && row.offWorkResult == 0){
|
|
|
+ row.offWorkResult = row.offWorkResultN;
|
|
|
+ }
|
|
|
+ else if(row.offWorkStatus == 1 &&
|
|
|
+ row.offWorkResult != 1 &&
|
|
|
+ row.offWorkResult != 0){
|
|
|
+ row.offWorkResult = row.offWorkResultN + ' ' + row.offLateLeaveMinuteN;
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ pageUtil.printTable(rows,
|
|
|
+ [
|
|
|
+ { field: 'attendanceDate', displayName: '日期'},
|
|
|
+ { field: 'shiftNumbers', displayName: '班次'},
|
|
|
+ { field: 'onWorkRecordTime', displayName: '上班打卡时间'},
|
|
|
+ { field: 'onWorkResult', displayName: '上班打卡状态'},
|
|
|
+ { field: 'offWorkRecordTime', displayName: '下班打卡时间'},
|
|
|
+ { field: 'lateMinutes', displayName: '下班打卡状态'},
|
|
|
+ { field: 'absenteeismDays', displayName: '迟到次数'},
|
|
|
+ { field: 'leaveEarlyMinutes', displayName: '早退分钟'},
|
|
|
+ { field: 'leaveEarlyNum', displayName: '早退次数'},
|
|
|
+ { field: 'overtime', displayName: '加班小时'},
|
|
|
+ { field: 'absenteeismDays', displayName: '旷工天数'},
|
|
|
+ { field: 'notSwipingNum', displayName: '未打卡次数'}
|
|
|
+ ],title);
|
|
|
+ },
|
|
|
changePage(pageIndex) {
|
|
|
var self = this;
|
|
|
|