|
|
@@ -113,8 +113,16 @@
|
|
|
:loading="downloadLoading"
|
|
|
@click="exportXls"
|
|
|
>导出数据</el-button>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ size="small"
|
|
|
+ plain
|
|
|
+ icon="el-icon-edit"
|
|
|
+ :loading="loading"
|
|
|
+ @click="handleBatchUpdate"
|
|
|
+ >重新生成考勤数据</el-button>
|
|
|
</el-row>
|
|
|
- <el-table ref="formTable" stripe :data="tableData" :height="tableHeight" style="width: 100%">
|
|
|
+ <el-table ref="formTable" stripe :data="tableData" :height="tableHeight" style="width: 100%" v-loading="loading">
|
|
|
<el-table-column label="序号" fixed="left" type="index" :index="indexMethod"></el-table-column>
|
|
|
<el-table-column label="姓名" fixed="left" prop="name"></el-table-column>
|
|
|
<el-table-column label="公司" prop="companyName" width="200"></el-table-column>
|
|
|
@@ -499,9 +507,37 @@ export default {
|
|
|
//设置为第一天
|
|
|
lastDate.setDate(1);
|
|
|
var lastMonth = parseInt(lastDate.getMonth() + 2);
|
|
|
- var endTime =
|
|
|
- lastDate.getFullYear() + "-" + lastMonth + "-" + lastDate.getDate();
|
|
|
+ var endTime = lastDate.getFullYear() + "-" + lastMonth + "-" + lastDate.getDate();
|
|
|
+
|
|
|
self.queryModel.timeRanges = [startTime, endTime];
|
|
|
+ },
|
|
|
+ handleBatchUpdate() {
|
|
|
+ var self = this;
|
|
|
+ var formData = new FormData();
|
|
|
+
|
|
|
+ formData.append("companyId", this.queryModel.companyId);
|
|
|
+ formData.append("startDate", this.queryModel.timeRanges[0]);
|
|
|
+ formData.append("endDate", this.queryModel.timeRanges[1]);
|
|
|
+
|
|
|
+ self.loading = true;
|
|
|
+
|
|
|
+ workAttendanceApi.batchUpdate(formData).then(function(response) {
|
|
|
+ var jsonData = response.data;
|
|
|
+
|
|
|
+ self.loading = false;
|
|
|
+
|
|
|
+ if (jsonData.result) {
|
|
|
+ self.$message({
|
|
|
+ type: "success",
|
|
|
+ message: jsonData.message + ""
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ self.$message({
|
|
|
+ type: "warning",
|
|
|
+ message: jsonData.message + ""
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
},
|
|
|
mounted: function() {},
|