|
@@ -6,7 +6,7 @@
|
|
|
<a href="#">系统管理</a>
|
|
|
</el-breadcrumb-item>
|
|
|
<el-breadcrumb-item>
|
|
|
- <a href="/workScheduleAttendance">考勤统计明细</a>
|
|
|
+ <a href="/workScheduleAttendance">考勤按日统计</a>
|
|
|
</el-breadcrumb-item>
|
|
|
</el-breadcrumb>
|
|
|
<el-divider></el-divider>
|
|
@@ -16,146 +16,203 @@
|
|
|
<el-form
|
|
|
ref="queryForm"
|
|
|
:model="queryModel"
|
|
|
+ :rules="ruleValidate"
|
|
|
inline
|
|
|
class="demo-form-inline"
|
|
|
>
|
|
|
- <el-form-item label="统计区间" prop="timeRanges">
|
|
|
- <el-date-picker
|
|
|
- v-model="queryModel.timeRanges"
|
|
|
- type="monthrange"
|
|
|
- range-separator="至"
|
|
|
- start-placeholder="开始月份"
|
|
|
- end-placeholder="结束月份"
|
|
|
- value-format="yyyy-MM"
|
|
|
- :default-time="timeRangesDefaultTime"
|
|
|
- size="mini"
|
|
|
- ></el-date-picker>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item>
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- size="mini"
|
|
|
- icon="ios-search"
|
|
|
- @click="changePage(1)"
|
|
|
- :loading="loading"
|
|
|
- >查询</el-button
|
|
|
- >
|
|
|
- <el-button
|
|
|
- type="info"
|
|
|
- size="mini"
|
|
|
- style="margin-left: 8px"
|
|
|
- @click="handleReset('queryForm')"
|
|
|
- >重置</el-button
|
|
|
- >
|
|
|
- <el-button
|
|
|
+ <div>
|
|
|
+ <el-row>
|
|
|
+ <el-form-item label="统计区间" prop="queryDate">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="queryModel.queryDate"
|
|
|
+ type="date"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ placeholder="选择日期"
|
|
|
+ size="mini"
|
|
|
+ >
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="单位/部门" prop="companyId">
|
|
|
+ <el-select-tree
|
|
|
+ :props="props"
|
|
|
+ :options="companyResult"
|
|
|
+ v-model="queryModel.companyId"
|
|
|
+ height="200"
|
|
|
+ ></el-select-tree>
|
|
|
+
|
|
|
+ <el-checkbox v-model="queryModel.subordinate"
|
|
|
+ >是否包含下级单位</el-checkbox
|
|
|
+ >
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="姓名" prop="name">
|
|
|
+ <el-input
|
|
|
+ type="text"
|
|
|
+ size="mini"
|
|
|
+ v-model="queryModel.name"
|
|
|
+ style="width: 100px"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ size="mini"
|
|
|
+ style="margin-left: 8px"
|
|
|
+ @click="handleQuery('queryForm')"
|
|
|
+ >查询</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ type="info"
|
|
|
+ size="mini"
|
|
|
+ style="margin-left: 8px"
|
|
|
+ @click="handleReset('queryForm')"
|
|
|
+ >重置</el-button
|
|
|
+ >
|
|
|
+ </el-form-item>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+ </el-form>
|
|
|
+ <el-divider></el-divider>
|
|
|
+ <el-row class="button-group">
|
|
|
+ <!-- <el-button
|
|
|
+ type="primary"
|
|
|
+ size="small"
|
|
|
+ plain
|
|
|
+ icon="el-icon-download"
|
|
|
+ :loading="xlsLoading"
|
|
|
+ @click="downloadAll"
|
|
|
+ >导出数据</el-button
|
|
|
+ > -->
|
|
|
+ <el-button
|
|
|
type="primary"
|
|
|
- size="mini"
|
|
|
+ size="small"
|
|
|
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>
|
|
|
- <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-button
|
|
|
>
|
|
|
- <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 =='2' || row.onWorkResult =='3')
|
|
|
- "
|
|
|
- >
|
|
|
- {{ 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 == '2' || row.offWorkResult == '3')
|
|
|
- "
|
|
|
- >
|
|
|
- {{ 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>
|
|
|
+ </el-row>
|
|
|
+ <el-table
|
|
|
+ id="printAttendanceListContent"
|
|
|
+ ref="formTable"
|
|
|
+ stripe
|
|
|
+ :data="tableData"
|
|
|
+ :height="tableHeight"
|
|
|
+ style="width: 100%"
|
|
|
+ v-loading="loading"
|
|
|
+ :element-loading-text="loadingText"
|
|
|
+ >
|
|
|
+ <el-table-column
|
|
|
+ type="index"
|
|
|
+ label="序号"
|
|
|
+ :index="indexMethod"
|
|
|
+ fixed="left"
|
|
|
+ width="50"
|
|
|
+ ></el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="personInfo.name"
|
|
|
+ label="姓名"
|
|
|
+ width="120"
|
|
|
+ fixed="left"
|
|
|
+ ></el-table-column
|
|
|
+ ><el-table-column
|
|
|
+ prop="personInfo.companyName"
|
|
|
+ label="部门"
|
|
|
+ width="120"
|
|
|
+ fixed="left"
|
|
|
+ ></el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="personInfo.jobNumber"
|
|
|
+ label="工号"
|
|
|
+ width="80"
|
|
|
+ fixed="left"
|
|
|
+ ></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 == '2' || row.onWorkResult == '3')
|
|
|
+ "
|
|
|
+ >
|
|
|
+ {{ 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 == '2' || row.offWorkResult == '3')
|
|
|
+ "
|
|
|
+ >
|
|
|
+ {{ 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>
|
|
|
+ <workScheduleAttendance-detail
|
|
|
+ v-if="showModal"
|
|
|
+ :businessKey="businessKey"
|
|
|
+ :title="modalTitle"
|
|
|
+ @close="onDetailModalClose"
|
|
|
+ ></workScheduleAttendance-detail>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
import Constant from "@/constant";
|
|
|
import workScheduleAttendanceApi from "@/api/business/workScheduleAttendance";
|
|
|
+import companyInfoApi from "@/api/base/companyInfo";
|
|
|
+import SelectTree from "@/components/SelectTree";
|
|
|
import NProgress from "nprogress"; // progress bar
|
|
|
import "nprogress/nprogress.css"; // progress bar style
|
|
|
import pageUtil from "@/utils/page";
|
|
@@ -166,9 +223,17 @@ export default {
|
|
|
var self = this;
|
|
|
|
|
|
return {
|
|
|
+ ruleValidate: {
|
|
|
+ companyId: [{ required: true, message: "不能为空", trigger: "blur" }],
|
|
|
+ queryDate: [
|
|
|
+ { required: true, message: "请选择查询时间", trigger: "blur" },
|
|
|
+ ],
|
|
|
+ },
|
|
|
queryModel: {
|
|
|
- timeRanges: "",
|
|
|
- personId: "",
|
|
|
+ companyId: "",
|
|
|
+ queryDate: "",
|
|
|
+ subordinate: false,
|
|
|
+ name: "",
|
|
|
},
|
|
|
loading: false,
|
|
|
tableData: [],
|
|
@@ -183,89 +248,103 @@ export default {
|
|
|
showModal: false,
|
|
|
modalTitle: "",
|
|
|
businessKey: "",
|
|
|
+ treeData: [],
|
|
|
+ props: {
|
|
|
+ // 配置项(必选)
|
|
|
+ value: "id",
|
|
|
+ label: "name",
|
|
|
+ children: "children",
|
|
|
+ },
|
|
|
+ companyResult: [],
|
|
|
tableHeight: 400,
|
|
|
- personInfo: "",
|
|
|
- showMessage: "",
|
|
|
timeRangesDefaultTime: [],
|
|
|
+ loadingText: "加载中",
|
|
|
+ xlsLoading: false,
|
|
|
};
|
|
|
},
|
|
|
+ created() {
|
|
|
+ var self = this;
|
|
|
+ companyInfoApi.treeList().then(function (response) {
|
|
|
+ var jsonData = response.data;
|
|
|
+ if (jsonData.result) {
|
|
|
+ if (jsonData.data != null && jsonData.data != "") {
|
|
|
+ self.companyResult = jsonData.data;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
methods: {
|
|
|
- printReport() {
|
|
|
- var title = this.personInfo.name + "考勤统计明细";
|
|
|
+ indexMethod(index) {
|
|
|
+ return (this.pageIndex - 1) * this.pageSize + (index + 1);
|
|
|
+ },
|
|
|
+ changePage(pageIndex) {
|
|
|
+ var self = this;
|
|
|
+ self.pageIndex = pageIndex;
|
|
|
|
|
|
- var rows = JSON.parse(JSON.stringify(this.tableData));
|
|
|
+ var formData = new FormData();
|
|
|
|
|
|
- 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 = "";
|
|
|
- }
|
|
|
+ // formData.append("pageIndex", self.pageIndex);
|
|
|
+ // formData.append("pageSize", self.pageSize);
|
|
|
|
|
|
- //如果是上班状态且上班缺卡
|
|
|
- if(row.onWorkStatus == "1" && row.onWorkResult == "0"){
|
|
|
- row.onWorkResult = row.onWorkResultN;
|
|
|
- }
|
|
|
- else if(row.onWorkStatus == "1"
|
|
|
- && (row.onWorkResult == "2" || row.onWorkResult == "3")
|
|
|
- ){
|
|
|
- //如果是上班状态但上班迟到或早退
|
|
|
- row.onWorkResult = row.onWorkResultN + ' ' + row.onLateLeaveMinuteN;
|
|
|
- }
|
|
|
- else{
|
|
|
- row.onWorkResult = "";
|
|
|
- }
|
|
|
+ if (self.queryModel.companyId == null) {
|
|
|
+ self.queryModel.companyId = "";
|
|
|
+ }
|
|
|
|
|
|
- //非上班状态或者缺卡,则下班考勤时间不显示
|
|
|
- if(row.offWorkStatus != "1" || row.offWorkResult == "0"){
|
|
|
- row.offWorkRecordTime = "";
|
|
|
- }
|
|
|
+ formData.append("companyId", self.queryModel.companyId);
|
|
|
+ formData.append("subordinate", self.queryModel.subordinate);
|
|
|
|
|
|
- //如果是上班状态且下班缺卡
|
|
|
- if(row.offWorkStatus == "1" && row.offWorkResult == "0"){
|
|
|
- row.offWorkResult = row.offWorkResultN;
|
|
|
- }
|
|
|
- else if(row.offWorkStatus == "1"
|
|
|
- && (row.offWorkResult == "2" || row.offWorkResult == "3")
|
|
|
- ){
|
|
|
- //如果是上班状态但下班迟到或早退
|
|
|
- row.offWorkResult = row.offWorkResultN + ' ' + row.offLateLeaveMinuteN;
|
|
|
- }
|
|
|
- else{
|
|
|
- row.offWorkResult = "";
|
|
|
- }
|
|
|
- });
|
|
|
+ formData.append("name", self.queryModel.name);
|
|
|
|
|
|
- pageUtil.printTable(rows,
|
|
|
- [
|
|
|
- { field: 'attendanceDate', displayName: '日期'},
|
|
|
- { field: 'shiftNumbers', displayName: '班次'},
|
|
|
- { field: 'onWorkRecordTime', displayName: '上班打卡时间'},
|
|
|
- { field: 'onWorkResult', displayName: '上班打卡状态'},
|
|
|
- { field: 'offWorkRecordTime', displayName: '下班打卡时间'},
|
|
|
- { field: 'offWorkResult', displayName: '下班打卡状态'},
|
|
|
- { field: 'absenteeismDays', displayName: '旷工天数'},
|
|
|
- { field: 'notSwipingNum', displayName: '未打卡次数'}
|
|
|
- ],title);
|
|
|
- },
|
|
|
- changePage(pageIndex) {
|
|
|
- var self = this;
|
|
|
+ formData.append("queryDate", self.queryModel.queryDate);
|
|
|
|
|
|
self.loading = true;
|
|
|
+ self.loadingText = "加载中";
|
|
|
+ self.xlsLoading = true;
|
|
|
+
|
|
|
+ workScheduleAttendanceApi
|
|
|
+ .attendanceDay(formData)
|
|
|
+ .then(function (response) {
|
|
|
+ var jsonData = response.data;
|
|
|
+
|
|
|
+ self.loading = false;
|
|
|
+ self.xlsLoading = false;
|
|
|
+
|
|
|
+ if (jsonData.result) {
|
|
|
+ self.tableData = jsonData.data.wsaList;
|
|
|
|
|
|
+ //self.totalPages = jsonData.data.totalPages;
|
|
|
+ //self.totalElements = jsonData.data.recordsTotal;
|
|
|
+
|
|
|
+ //45为分页栏的高度
|
|
|
+ //页面高度-列表上面的高度-分页栏高度
|
|
|
+ self.tableHeight =
|
|
|
+ window.innerHeight - self.$refs.formTable.$el.offsetTop - 100;
|
|
|
+ } else {
|
|
|
+ self.$message({
|
|
|
+ type: "warning",
|
|
|
+ message: jsonData.message,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ downloadAll() {
|
|
|
+ //导出
|
|
|
+ var self = this;
|
|
|
var formData = new FormData();
|
|
|
+ if (self.queryModel.companyId == null) {
|
|
|
+ self.queryModel.companyId = "";
|
|
|
+ }
|
|
|
|
|
|
- formData.append("personId", self.queryModel.personId);
|
|
|
+ formData.append("companyId", self.queryModel.companyId);
|
|
|
+ formData.append("subordinate", self.queryModel.subordinate);
|
|
|
+
|
|
|
+ formData.append("name", self.queryModel.name);
|
|
|
|
|
|
- var timeRanges = self.queryModel.timeRanges + "";
|
|
|
var startDate = "";
|
|
|
var endDate = "";
|
|
|
+ var timeRanges = self.queryModel.timeRanges + "";
|
|
|
+
|
|
|
if (timeRanges != "" && timeRanges != null) {
|
|
|
timeRanges = timeRanges.split(",");
|
|
|
startDate = timeRanges[0];
|
|
@@ -275,39 +354,28 @@ export default {
|
|
|
formData.append("startMonth", startDate);
|
|
|
formData.append("endMonth", endDate);
|
|
|
|
|
|
- if (this.field != null) {
|
|
|
- formData.append("field", this.field);
|
|
|
- }
|
|
|
-
|
|
|
- if (this.direction != null) {
|
|
|
- formData.append("direction", this.direction);
|
|
|
- }
|
|
|
-
|
|
|
- workScheduleAttendanceApi
|
|
|
- .pageList(formData)
|
|
|
- .then(function (response) {
|
|
|
- self.loading = false;
|
|
|
+ self.loading = true;
|
|
|
+ self.loadingText = "加载中";
|
|
|
|
|
|
- var jsonData = response.data.data;
|
|
|
+ workScheduleAttendanceApi.exportXls(formData).then(function (response) {
|
|
|
+ self.loading = false;
|
|
|
+ var jsonData = response.data;
|
|
|
+ if (jsonData.result) {
|
|
|
+ if (jsonData.data != null) {
|
|
|
+ if (document.location.href.startsWith("https://")) {
|
|
|
+ jsonData.data = jsonData.data.replace("http://", "https://");
|
|
|
+ }
|
|
|
|
|
|
- self.tableData = jsonData.wsaList;
|
|
|
- self.personInfo = jsonData.personInfo;
|
|
|
- let message = "查询结果 部门:" + self.personInfo.companyName;
|
|
|
- let message2 = " 工号:" + self.personInfo.jobNumber;
|
|
|
- let message3 = " 姓名:" + self.personInfo.name;
|
|
|
- if (self.personInfo.jobNumber == null) {
|
|
|
- self.showMessage = message + message3;
|
|
|
- } else {
|
|
|
- self.showMessage = message + message2 + message3;
|
|
|
+ self.$message({
|
|
|
+ showClose: true,
|
|
|
+ type: "success",
|
|
|
+ dangerouslyUseHTMLString: true,
|
|
|
+ message: `报表已生成,<a href="${jsonData.data}" target="_blank">点击下载报表</a> `,
|
|
|
+ duration: 30000,
|
|
|
+ });
|
|
|
}
|
|
|
-
|
|
|
- self.tableHeight =
|
|
|
- window.innerHeight - self.$refs.formTable.$el.offsetTop - 100;
|
|
|
- })
|
|
|
- .catch((error) => {
|
|
|
- self.loading = false;
|
|
|
- // self.$message.error(error + "");
|
|
|
- });
|
|
|
+ }
|
|
|
+ });
|
|
|
},
|
|
|
pageSizeChange(pageSize) {
|
|
|
this.pageSize = pageSize;
|
|
@@ -328,6 +396,63 @@ export default {
|
|
|
handleReset(name) {
|
|
|
this.$refs[name].resetFields();
|
|
|
},
|
|
|
+ handleAdd() {
|
|
|
+ this.modalTitle = "新增";
|
|
|
+ this.businessKey = "";
|
|
|
+ this.showModal = true;
|
|
|
+ },
|
|
|
+ handleDelete(record) {
|
|
|
+ var self = this;
|
|
|
+
|
|
|
+ self
|
|
|
+ .$confirm("是否确认删除?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ workScheduleAttendanceApi.remove(record.id).then(function (response) {
|
|
|
+ var jsonData = response.data;
|
|
|
+
|
|
|
+ if (jsonData.result) {
|
|
|
+ // var index = self.tableData.indexOf(record);
|
|
|
+ // self.tableData.splice(index, 1);
|
|
|
+ self.changePage(self.pageIndex);
|
|
|
+
|
|
|
+ self.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "删除成功!",
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleBatchDelete() {
|
|
|
+ var self = this;
|
|
|
+
|
|
|
+ var idList = this.multipleSelection.map((record) => {
|
|
|
+ return record.id;
|
|
|
+ });
|
|
|
+
|
|
|
+ this.$confirm("是否确认删除选中项?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ }).then(() => {
|
|
|
+ workScheduleAttendanceApi.batchRemove(idList).then(function (response) {
|
|
|
+ var jsonData = response.data;
|
|
|
+
|
|
|
+ if (jsonData.result) {
|
|
|
+ self.changePage(self.pageIndex);
|
|
|
+
|
|
|
+ self.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "删除成功!",
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
onDetailModalClose(refreshed) {
|
|
|
//保存成功后回调
|
|
|
this.showModal = false;
|
|
@@ -336,15 +461,63 @@ export default {
|
|
|
this.changePage(this.pageIndex);
|
|
|
}
|
|
|
},
|
|
|
+ handleQuery() {
|
|
|
+ var self = this;
|
|
|
+ this.$refs["queryForm"].validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ self.changePage(1);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ printReport() {
|
|
|
+ var title = "考勤统计表";
|
|
|
+
|
|
|
+ var rows = JSON.parse(JSON.stringify(this.tableData));
|
|
|
+
|
|
|
+ var index = 0;
|
|
|
+
|
|
|
+ rows.forEach((row) => {
|
|
|
+ row.index = ++index;
|
|
|
+
|
|
|
+ if (row.personInfo.jobNumber == null) {
|
|
|
+ row.personInfo.jobNumber = "";
|
|
|
+ }
|
|
|
+
|
|
|
+ if (row.shiftNumbers == null) {
|
|
|
+ row.shiftNumbers = "";
|
|
|
+ row.onWorkRecordTime = "";
|
|
|
+ row.onWorkResultN = "";
|
|
|
+ row.offWorkRecordTime = "";
|
|
|
+ row.offWorkResultN = "";
|
|
|
+ row.absenteeismDays = "";
|
|
|
+ row.notSwipingNum = "";
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ pageUtil.printTable(
|
|
|
+ rows,
|
|
|
+ [
|
|
|
+ { field: "index", displayName: "序号" ,columnSize: "2%"},
|
|
|
+ { field: "personInfo.name", displayName: "姓名", columnSize: "8%" },
|
|
|
+ { field: "personInfo.companyName", displayName: "部门" ,columnSize: "8%" },
|
|
|
+ { field: "personInfo.jobNumber", displayName: "工号" },
|
|
|
+ { field: "shiftNumbers", displayName: "班次" },
|
|
|
+ { field: "onWorkRecordTime", displayName: "上班打卡时间", columnSize: "8%"},
|
|
|
+ { field: "onWorkResultN", displayName: "上班打卡状态" },
|
|
|
+ { field: "offWorkRecordTime", displayName: "下班打卡时间", columnSize: "8%" },
|
|
|
+ { field: "offWorkResultN", displayName: "下班打卡状态" },
|
|
|
+ { field: "absenteeismDays", displayName: "旷工天数" },
|
|
|
+ { field: "notSwipingNum", displayName: "未打卡次数" },
|
|
|
+ ],
|
|
|
+ title
|
|
|
+ );
|
|
|
+ },
|
|
|
},
|
|
|
mounted: function () {
|
|
|
- var personId = this.$route.query.personId;
|
|
|
- var timeRanges = this.$route.query.timeRanges;
|
|
|
- this.queryModel.personId = personId;
|
|
|
- let tims = timeRanges.split(",");
|
|
|
- this.queryModel.timeRanges = [tims[0], tims[1]];
|
|
|
-
|
|
|
- this.changePage();
|
|
|
+ //this.changePage(1);
|
|
|
+ },
|
|
|
+ components: {
|
|
|
+ "el-select-tree": SelectTree,
|
|
|
},
|
|
|
};
|
|
|
</script>
|