Commit d895158e authored by 赵啸非's avatar 赵啸非

Merge remote-tracking branch 'origin/master'

parents 358ce519 b93ef253
......@@ -92,6 +92,34 @@ export default {
}, 300);
});
},
// 默认拉取数据
async getTable() {
try {
await this.beforeFecth();
} catch (error) {
return;
}
this.tableData.loading = true;
this.$post("/attendance/stat/summary", this.query, {
cancelToken: this.source.token,
})
.then(({ data }) => {
this.tableData = this.beforeRender(
Object.assign({}, this.tableData, data)
);
this.afterRender(this.tableData);
})
.catch((error) => {
if (error.message == "自动取消ajax操作") return;
this.$message.error(error.message);
})
.then((data) => {
clearTimeout(this.loadingTimer);
this.loadingTimer = setTimeout(() => {
this.tableData.loading = false;
}, 300);
});
},
// 复制一个数组或对象
util_copy(data) {
if (typeof data !== "object") return data;
......
......@@ -28,6 +28,14 @@
@click="setdialog"
>表格设置</el-button
>
<el-button
slot="table-head-left2"
style="margin-left: 10px"
icon="el-icon-tickets"
size="mini"
@click="restTable"
>重新汇总</el-button
>
</LayoutTable>
<dialog-show ref="dialogform" @ok="getData" />
<!-- 表格设置 -->
......@@ -101,6 +109,9 @@ export default {
return "-";
}
},
restTable() {
this.getTable();
},
afterRender(data) {
this.addColumn = getdiffdate(
this.query.summaryTimeStart,
......@@ -129,7 +140,6 @@ export default {
this.$forceUpdate();
},
beforeRender(row) {
console.log(row.data);
row.data.forEach((element) => {
if (
element.attendanceStaffStatEntities &&
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment