Commit 8958685b authored by 赵啸非's avatar 赵啸非

Merge remote-tracking branch 'origin/master'

parents 66927f7d c0ac537f
...@@ -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,
}; };
}, },
}; };
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
</el-time-picker> </el-time-picker>
</div> </div>
<div> <div>
<span>时段: </span> <span>时段: </span>
<span>上班前签到</span> <span>上班前签到</span>
<el-time-picker <el-time-picker
size="mini" size="mini"
...@@ -90,7 +90,7 @@ ...@@ -90,7 +90,7 @@
</el-time-picker> </el-time-picker>
</div> </div>
<div> <div>
<span>时段:</span> <span>时段:</span>
<span>下班前签退</span> <span>下班前签退</span>
<el-time-picker <el-time-picker
size="mini" size="mini"
......
...@@ -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" />
<!-- 表格设置 --> <!-- 表格设置 -->
...@@ -47,13 +47,14 @@ ...@@ -47,13 +47,14 @@
<el-checkbox <el-checkbox
v-for="(item, index) in setcolum" v-for="(item, index) in setcolum"
:key="index" :key="index"
:label="item.label" :label="item.prop"
> >
{{ item.label }}
</el-checkbox> </el-checkbox>
</el-checkbox-group> </el-checkbox-group>
<div class="mt20" style="text-align:right"> <div class="mt20" style="text-align:right">
<el-button>取消</el-button> <el-button @click="handleCancel">取消</el-button>
<el-button type="primary">确定</el-button> <el-button type="primary" @click="handleSubmit">确定</el-button>
</div> </div>
</el-dialog> </el-dialog>
<!-- 导出记录查看 --> <!-- 导出记录查看 -->
...@@ -100,6 +101,16 @@ export default { ...@@ -100,6 +101,16 @@ export default {
this.initalArr = this.config.columns; this.initalArr = this.config.columns;
}, },
methods: { methods: {
// 表格设置弹窗取消操作
handleCancel() {
this.checkList = [];
this.isdialog = false;
},
// 表格设置提交操作
handleSubmit() {
this.doExport();
this.isdialog = false;
},
// 处理 // 处理
handleArr(arr, currentTime) { handleArr(arr, currentTime) {
console.log(currentTime); console.log(currentTime);
...@@ -172,6 +183,10 @@ export default { ...@@ -172,6 +183,10 @@ export default {
this.setcolum = this.config.columns.filter( this.setcolum = this.config.columns.filter(
(item) => item.label && item.prop (item) => item.label && item.prop
); );
this.setcolum = this.setcolum.filter(
(val) => val.prop !== "attendanceStaffStatEntities"
);
console.log(this.setcolum);
}, },
lookexportHis() { lookexportHis() {
this.drawerhistory = true; this.drawerhistory = true;
...@@ -188,6 +203,9 @@ export default { ...@@ -188,6 +203,9 @@ export default {
if (this.selection.length > 0) { if (this.selection.length > 0) {
params["idList"] = this.selection; params["idList"] = this.selection;
} }
if (this.checkList.length > 0) {
params["properties"] = this.checkList;
}
this.$download( this.$download(
"/attendance/stat/exportExcelExt", "/attendance/stat/exportExcelExt",
{ {
...@@ -195,7 +213,10 @@ export default { ...@@ -195,7 +213,10 @@ export default {
}, },
{ type: "excel" } { type: "excel" }
) )
.then(() => (this.isExport = false)) .then(() => {
this.isExport = false;
this.checkList = [];
})
.catch((error) => { .catch((error) => {
this.isExport = false; this.isExport = false;
this.$message.error(error.message); this.$message.error(error.message);
......
...@@ -138,22 +138,27 @@ public class CheckAllRecordController extends BaseJsonBodyController { ...@@ -138,22 +138,27 @@ public class CheckAllRecordController extends BaseJsonBodyController {
CheckAllScoreSummaryVo current = checkAllRecordService.getScoreSummary(query); CheckAllScoreSummaryVo current = checkAllRecordService.getScoreSummary(query);
NumberFormat numberFormat = NumberFormat.getPercentInstance(); NumberFormat numberFormat = NumberFormat.getPercentInstance();
numberFormat.setMaximumFractionDigits(2); numberFormat.setMaximumFractionDigits(2);
BigDecimal zero = new BigDecimal(0);
if (current != null) { if (current != null) {
model.put("initScore", current.getInitScore()); model.put("initScore", current.getInitScore());
model.put("checkScore", current.getCheckScore()); model.put("checkScore", current.getCheckScore());
model.put("appealScore", current.getAppealScore()); model.put("appealScore", current.getAppealScore());
model.put("total", current.getTotal()); model.put("total", current.getTotal());
if(current.getInitScore().compareTo(zero)>0) {
BigDecimal checkPercent = current.getCheckScore().divide(current.getInitScore(), 6, BigDecimal.ROUND_HALF_UP); BigDecimal checkPercent = current.getCheckScore().divide(current.getInitScore(), 6, BigDecimal.ROUND_HALF_UP);
model.put("checkPercent", numberFormat.format(checkPercent)); model.put("checkPercent", numberFormat.format(checkPercent));
BigDecimal appealPercent = current.getAppealScore().divide(current.getInitScore(), 6, BigDecimal.ROUND_HALF_UP); BigDecimal appealPercent = current.getAppealScore().divide(current.getInitScore(), 6, BigDecimal.ROUND_HALF_UP);
model.put("appealPercent", numberFormat.format(appealPercent)); model.put("appealPercent", numberFormat.format(appealPercent));
}
CheckAllScoreSummaryVo last = checkAllRecordService.getScoreSummary(lastQuery); CheckAllScoreSummaryVo last = checkAllRecordService.getScoreSummary(lastQuery);
if (last != null) { if (last != null) {
if(last.getTotal().compareTo(zero)>0) {
BigDecimal huanbi = current.getTotal().subtract(last.getTotal()); BigDecimal huanbi = current.getTotal().subtract(last.getTotal());
huanbi = huanbi.divide(last.getTotal(), 6, BigDecimal.ROUND_HALF_UP); huanbi = huanbi.divide(last.getTotal(), 6, BigDecimal.ROUND_HALF_UP);
model.put("huanbi", numberFormat.format(huanbi)); model.put("huanbi", numberFormat.format(huanbi));
} }
}
if (query.getSummaryType() == SummaryTopTypeEnum..getValue()) { if (query.getSummaryType() == SummaryTopTypeEnum..getValue()) {
if (last != null) { if (last != null) {
model.put("tongbi", model.get("huanbi")); model.put("tongbi", model.get("huanbi"));
...@@ -174,12 +179,14 @@ public class CheckAllRecordController extends BaseJsonBodyController { ...@@ -174,12 +179,14 @@ public class CheckAllRecordController extends BaseJsonBodyController {
} }
CheckAllScoreSummaryVo tb = checkAllRecordService.getScoreSummary(lastQuery); CheckAllScoreSummaryVo tb = checkAllRecordService.getScoreSummary(lastQuery);
if (tb != null) { if (tb != null) {
if(last.getTotal().compareTo(zero)>0) {
BigDecimal tongbi = current.getTotal().subtract(tb.getTotal()); BigDecimal tongbi = current.getTotal().subtract(tb.getTotal());
tongbi = tongbi.divide(last.getTotal(), 6, BigDecimal.ROUND_HALF_UP); tongbi = tongbi.divide(last.getTotal(), 6, BigDecimal.ROUND_HALF_UP);
model.put("tongbi", numberFormat.format(tongbi)); model.put("tongbi", numberFormat.format(tongbi));
} }
} }
} }
}
model.put("message_info", busiDesc + "成功"); model.put("message_info", busiDesc + "成功");
if (!ObjectUtils.isEmpty(context) && !ObjectUtils.isEmpty(context.getUser())) { if (!ObjectUtils.isEmpty(context) && !ObjectUtils.isEmpty(context.getUser())) {
......
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