Commit 2a2a9c88 authored by 姬鋆屾's avatar 姬鋆屾

parent a11b7fd7
...@@ -72,6 +72,8 @@ export default { ...@@ -72,6 +72,8 @@ export default {
return; return;
} }
this.tableData.loading = true; this.tableData.loading = true;
console.log(this.source.token);
this.$post(this.pageInfo.list, this.query, { this.$post(this.pageInfo.list, this.query, {
cancelToken: this.source.token, cancelToken: this.source.token,
}) })
...@@ -100,6 +102,7 @@ export default { ...@@ -100,6 +102,7 @@ export default {
return; return;
} }
this.tableData.loading = true; this.tableData.loading = true;
return;
this.$post("/attendance/stat/summary", this.query, { this.$post("/attendance/stat/summary", this.query, {
cancelToken: this.source.token, cancelToken: this.source.token,
}) })
......
...@@ -160,6 +160,13 @@ ...@@ -160,6 +160,13 @@
title="查询" title="查询"
>查询</el-button >查询</el-button
> >
<el-button
icon="el-icon-tickets"
@click="resetTable"
v-if="visible"
title="重新汇总"
>重新汇总</el-button
>
<el-button <el-button
icon="el-icon-download" icon="el-icon-download"
...@@ -198,9 +205,59 @@ export default { ...@@ -198,9 +205,59 @@ export default {
}, },
}, },
async created() { async created() {
console.log(this.$route);
this.$route.name == "attendance/stat/list"
? (this.visible = true)
: (this.visible = false);
this.initForm(this.$route.query); this.initForm(this.$route.query);
}, },
methods: { methods: {
resetTable() {
let { path, query } = this.$route;
if (this.form.attendanceDateStart && this.form.attendanceDateEnd) {
let startValue = Date.parse(this.form.attendanceDateStart);
let endValue = Date.parse(this.form.attendanceDateEnd);
if (startValue > endValue) {
this.$message.error("查询-结束的日期需大于开始日期");
this.form.attendanceDateEnd = "";
return false;
}
}
if (this.form.startTime && this.form.endTime) {
let startValue = Date.parse(this.form.startTime);
let endValue = Date.parse(this.form.endTime);
if (startValue > endValue) {
this.$message.error("查询-结束的日期需大于开始日期");
this.form.endTime = "";
return false;
}
}
if (this.form.summaryTimeStart && this.form.summaryTimeEnd) {
let startValue = Date.parse(this.form.summaryTimeStart);
let endValue = Date.parse(this.form.summaryTimeEnd);
if (startValue > endValue) {
this.$message.error("查询-结束的日期需大于开始日期");
this.form.summaryTimeEnd = "";
return false;
}
} else {
this.form.summaryTimeStart = getFirstDay();
this.form.summaryTimeEnd = getLastDay();
}
let params = JSON.parse(JSON.stringify(this.form)); //不更改原始数据
let data = this.decode(params);
data.size = -1;
this.$post("/attendance/stat/summary", data).then((res) => {
if (res.code == 1) {
this.$message.success(res.msg);
} else {
this.$message.error(res.msg);
}
});
},
remoteMethod(query, searchType) { remoteMethod(query, searchType) {
if (query == "") { if (query == "") {
console.log("查询参数为空!"); console.log("查询参数为空!");
...@@ -403,6 +460,7 @@ export default { ...@@ -403,6 +460,7 @@ export default {
// groupList: [], // groupList: [],
}, },
remoteOptions: {}, remoteOptions: {},
visible: false,
}; };
}, },
}; };
......
...@@ -28,14 +28,14 @@ ...@@ -28,14 +28,14 @@
@click="setdialog" @click="setdialog"
>表格设置</el-button >表格设置</el-button
> >
<el-button <!-- <el-button
slot="table-head-left2" slot="table-head-left2"
style="margin-left: 10px" style="margin-left: 10px"
icon="el-icon-tickets" icon="el-icon-tickets"
size="mini" size="mini"
@click="restTable" @click="restTable"
>重新汇总</el-button >重新汇总</el-button
> > -->
</LayoutTable> </LayoutTable>
<dialog-show ref="dialogform" @ok="getData" /> <dialog-show ref="dialogform" @ok="getData" />
<!-- 表格设置 --> <!-- 表格设置 -->
......
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