Commit 863e9d4b authored by 姬鋆屾's avatar 姬鋆屾

添加打卡汇总手动更新

parent 70b7ce8a
......@@ -38,8 +38,47 @@
:loading="btnLoading"
>极速计算结果</el-button
>
<el-button
type="primary"
size="mini"
slot="table-head-left2"
v-if="showBtn"
style="margin-left: 10px"
@click="handleRefresh"
:loading="btnFreshLoading"
>手动更新</el-button
>
</LayoutTable>
<dialog-show ref="dialogform" @ok="getData" />
<el-dialog
title="系统提示"
:visible.sync="dialogOpen"
width="500px"
append-to-body
@close="cancleFresh"
>
<div class="fresh_box">
<div class="title_box" style="margin-bottom: 20px;">
仅支持手动更新近90天的打卡数据,请选择需要更新的时间段:
</div>
<el-date-picker
v-model="freshDate"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
value-format="yyyy-MM-dd"
end-placeholder="结束日期"
:picker-options="pickerOptions0"
>
</el-date-picker>
</div>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitFresh" :loading="submitLoad"
>确 定</el-button
>
<el-button @click="cancleFresh">取 消</el-button>
</div>
</el-dialog>
<el-dialog
:title="upload.title"
:visible.sync="upload.open"
......@@ -151,6 +190,41 @@ export default {
: (this.showBtn = false);
},
methods: {
submitFresh() {
console.log(this.freshDate);
if (this.freshDate) {
this.submitLoad = true;
this.$post("/attendance/record/hik/addAttendanceHikRecordCustom", {
attendanceDateStart: this.freshDate[0],
attendanceDateEnd: this.freshDate[1],
})
.then((res) => {
if (res.code == 1) {
this.$message.success(res.msg);
this.dialogOpen = false;
this.btnFreshLoading = false;
this.submitLoad = false;
}
})
.catch((error) => {
this.$message.error(res.msg);
this.submitLoad = false;
this.dialogOpen = false;
this.btnFreshLoading = false;
});
} else {
this.$message.error("请选择时间范围!");
}
},
cancleFresh() {
this.dialogOpen = false;
this.btnFreshLoading = false;
},
// 手动更新
handleRefresh() {
this.btnFreshLoading = true;
this.dialogOpen = true;
},
// 极速计算结果
formatData() {
this.btnLoading = true;
......@@ -286,7 +360,19 @@ export default {
},
data() {
return {
pickerOptions0: {
disabledDate(time) {
let curDate = new Date().getTime();
let three = 90 * 24 * 3600 * 1000;
let threeMonths = curDate - three;
return time.getTime() > Date.now() || time.getTime() < threeMonths;
},
},
freshDate: "",
submitLoad: false,
btnLoading: false,
btnFreshLoading: false,
dialogOpen: false,
showBtn: false,
progress: false,
isExport: false,
......
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