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

Merge remote-tracking branch 'origin/master'

parents 66927f7d c0ac537f
......@@ -72,6 +72,8 @@ export default {
return;
}
this.tableData.loading = true;
console.log(this.source.token);
this.$post(this.pageInfo.list, this.query, {
cancelToken: this.source.token,
})
......@@ -100,6 +102,7 @@ export default {
return;
}
this.tableData.loading = true;
return;
this.$post("/attendance/stat/summary", this.query, {
cancelToken: this.source.token,
})
......
......@@ -160,6 +160,13 @@
title="查询"
>查询</el-button
>
<el-button
icon="el-icon-tickets"
@click="resetTable"
v-if="visible"
title="重新汇总"
>重新汇总</el-button
>
<el-button
icon="el-icon-download"
......@@ -198,9 +205,59 @@ export default {
},
},
async created() {
console.log(this.$route);
this.$route.name == "attendance/stat/list"
? (this.visible = true)
: (this.visible = false);
this.initForm(this.$route.query);
},
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) {
if (query == "") {
console.log("查询参数为空!");
......@@ -403,6 +460,7 @@ export default {
// groupList: [],
},
remoteOptions: {},
visible: false,
};
},
};
......
......@@ -51,7 +51,7 @@
</el-time-picker>
</div>
<div>
<span>时段: </span>
<span>时段: </span>
<span>上班前签到</span>
<el-time-picker
size="mini"
......@@ -90,7 +90,7 @@
</el-time-picker>
</div>
<div>
<span>时段:</span>
<span>时段:</span>
<span>下班前签退</span>
<el-time-picker
size="mini"
......
......@@ -28,14 +28,14 @@
@click="setdialog"
>表格设置</el-button
>
<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" />
<!-- 表格设置 -->
......@@ -47,13 +47,14 @@
<el-checkbox
v-for="(item, index) in setcolum"
:key="index"
:label="item.label"
:label="item.prop"
>
{{ item.label }}
</el-checkbox>
</el-checkbox-group>
<div class="mt20" style="text-align:right">
<el-button>取消</el-button>
<el-button type="primary">确定</el-button>
<el-button @click="handleCancel">取消</el-button>
<el-button type="primary" @click="handleSubmit">确定</el-button>
</div>
</el-dialog>
<!-- 导出记录查看 -->
......@@ -100,6 +101,16 @@ export default {
this.initalArr = this.config.columns;
},
methods: {
// 表格设置弹窗取消操作
handleCancel() {
this.checkList = [];
this.isdialog = false;
},
// 表格设置提交操作
handleSubmit() {
this.doExport();
this.isdialog = false;
},
// 处理
handleArr(arr, currentTime) {
console.log(currentTime);
......@@ -172,6 +183,10 @@ export default {
this.setcolum = this.config.columns.filter(
(item) => item.label && item.prop
);
this.setcolum = this.setcolum.filter(
(val) => val.prop !== "attendanceStaffStatEntities"
);
console.log(this.setcolum);
},
lookexportHis() {
this.drawerhistory = true;
......@@ -188,6 +203,9 @@ export default {
if (this.selection.length > 0) {
params["idList"] = this.selection;
}
if (this.checkList.length > 0) {
params["properties"] = this.checkList;
}
this.$download(
"/attendance/stat/exportExcelExt",
{
......@@ -195,7 +213,10 @@ export default {
},
{ type: "excel" }
)
.then(() => (this.isExport = false))
.then(() => {
this.isExport = false;
this.checkList = [];
})
.catch((error) => {
this.isExport = false;
this.$message.error(error.message);
......
......@@ -138,21 +138,26 @@ public class CheckAllRecordController extends BaseJsonBodyController {
CheckAllScoreSummaryVo current = checkAllRecordService.getScoreSummary(query);
NumberFormat numberFormat = NumberFormat.getPercentInstance();
numberFormat.setMaximumFractionDigits(2);
BigDecimal zero = new BigDecimal(0);
if (current != null) {
model.put("initScore", current.getInitScore());
model.put("checkScore", current.getCheckScore());
model.put("appealScore", current.getAppealScore());
model.put("total", current.getTotal());
BigDecimal checkPercent = current.getCheckScore().divide(current.getInitScore(), 6, BigDecimal.ROUND_HALF_UP);
model.put("checkPercent", numberFormat.format(checkPercent));
BigDecimal appealPercent = current.getAppealScore().divide(current.getInitScore(), 6, BigDecimal.ROUND_HALF_UP);
model.put("appealPercent", numberFormat.format(appealPercent));
if(current.getInitScore().compareTo(zero)>0) {
BigDecimal checkPercent = current.getCheckScore().divide(current.getInitScore(), 6, BigDecimal.ROUND_HALF_UP);
model.put("checkPercent", numberFormat.format(checkPercent));
BigDecimal appealPercent = current.getAppealScore().divide(current.getInitScore(), 6, BigDecimal.ROUND_HALF_UP);
model.put("appealPercent", numberFormat.format(appealPercent));
}
CheckAllScoreSummaryVo last = checkAllRecordService.getScoreSummary(lastQuery);
if (last != null) {
BigDecimal huanbi = current.getTotal().subtract(last.getTotal());
huanbi = huanbi.divide(last.getTotal(), 6, BigDecimal.ROUND_HALF_UP);
model.put("huanbi", numberFormat.format(huanbi));
if(last.getTotal().compareTo(zero)>0) {
BigDecimal huanbi = current.getTotal().subtract(last.getTotal());
huanbi = huanbi.divide(last.getTotal(), 6, BigDecimal.ROUND_HALF_UP);
model.put("huanbi", numberFormat.format(huanbi));
}
}
if (query.getSummaryType() == SummaryTopTypeEnum..getValue()) {
if (last != null) {
......@@ -174,9 +179,11 @@ public class CheckAllRecordController extends BaseJsonBodyController {
}
CheckAllScoreSummaryVo tb = checkAllRecordService.getScoreSummary(lastQuery);
if (tb != null) {
BigDecimal tongbi = current.getTotal().subtract(tb.getTotal());
tongbi = tongbi.divide(last.getTotal(), 6, BigDecimal.ROUND_HALF_UP);
model.put("tongbi", numberFormat.format(tongbi));
if(last.getTotal().compareTo(zero)>0) {
BigDecimal tongbi = current.getTotal().subtract(tb.getTotal());
tongbi = tongbi.divide(last.getTotal(), 6, BigDecimal.ROUND_HALF_UP);
model.put("tongbi", numberFormat.format(tongbi));
}
}
}
}
......
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