Commit 796dbb23 authored by 姬鋆屾's avatar 姬鋆屾

提交手动汇总提示倒计时弹窗

parent 26c7161d
...@@ -128,7 +128,7 @@ ...@@ -128,7 +128,7 @@
:close-on-click-modal="false" :close-on-click-modal="false"
:show-close="false" :show-close="false"
> >
<div class="fresh_box"> <div class="fresh_box" v-if="showContent">
<div class="title_box" style="margin-bottom: 20px;"> <div class="title_box" style="margin-bottom: 20px;">
仅支持手动更新前一天及当日的打卡数据,请选择需要更新的时间段: 仅支持手动更新前一天及当日的打卡数据,请选择需要更新的时间段:
</div> </div>
...@@ -143,8 +143,41 @@ ...@@ -143,8 +143,41 @@
> >
</el-date-picker> </el-date-picker>
</div> </div>
<div slot="footer" class="dialog-footer"> <div class="fresh_box" v-else>
<el-button type="primary" @click="submitFresh" :loading="submitLoad" <div
class="title_box"
style="margin-bottom: 20px;line-height: 30px;"
v-if="showTip"
>
请确认是否开始进行{{
freshDate[0] + "" + freshDate[1]
}}的考勤数据重新汇总;此过程预计需要
<span style="color:#ff0000 ;">10</span> 分钟左右,请勿关闭或刷新页面
</div>
<div
class="title_box"
style="margin-bottom: 20px;line-height: 30px;"
v-else
>
正在进行{{
freshDate[0] + "" + freshDate[1]
}}的考勤数据重新汇总;此过程预计还需要
<span style="color:#ff0000 ;">{{ restTime }}</span>
分钟左右,请勿关闭或刷新页面
</div>
</div>
<div slot="footer" class="dialog-footer" v-if="showTip">
<el-button
type="primary"
@click="() => (showContent = false)"
v-if="showContent"
>确 定</el-button
>
<el-button
type="primary"
@click="submitFresh"
v-else
:loading="submitLoad"
>确 定</el-button >确 定</el-button
> >
<el-button @click="cancleFresh">取 消</el-button> <el-button @click="cancleFresh">取 消</el-button>
...@@ -176,6 +209,30 @@ export default { ...@@ -176,6 +209,30 @@ export default {
this.initalArr = this.config.columns; this.initalArr = this.config.columns;
}, },
methods: { methods: {
//倒计时
countdown() {
let now = Date.parse(new Date());
let msec = this.endTime - now;
if (msec < 0) return;
// let day = parseInt(msec / 1000 / 60 / 60 / 24);
let hr = parseInt((msec / 1000 / 60 / 60) % 24);
let min = parseInt((msec / 1000 / 60) % 60);
let sec = parseInt((msec / 1000) % 60);
min = min > 9 ? min : "0" + min;
sec = sec > 9 ? sec : "0" + sec;
this.restTime = min + "" + sec + "";
const that = this;
if (min >= 0 && sec >= 0) {
if (min == 0 && sec == 0) {
return;
}
setTimeout(function() {
that.countdown();
}, 1000);
}
},
submitFresh() { submitFresh() {
console.log(this.freshDate); console.log(this.freshDate);
if (this.freshDate) { if (this.freshDate) {
...@@ -186,11 +243,11 @@ export default { ...@@ -186,11 +243,11 @@ export default {
}) })
.then((res) => { .then((res) => {
if (res.code == 1) { if (res.code == 1) {
this.$message.success(res.msg); this.showTip = false;
this.dialogOpen = false;
this.btnFreshLoading = false; this.btnFreshLoading = false;
this.submitLoad = false; this.submitLoad = false;
this.freshDate = ""; this.endTime = Date.parse(new Date()) + 10 * 60 * 1000;
this.countdown();
} }
}) })
.catch((error) => { .catch((error) => {
...@@ -198,6 +255,9 @@ export default { ...@@ -198,6 +255,9 @@ export default {
this.submitLoad = false; this.submitLoad = false;
this.dialogOpen = false; this.dialogOpen = false;
this.btnFreshLoading = false; this.btnFreshLoading = false;
this.showContent = true;
this.showTip = true;
this.freshDate = "";
}); });
} else { } else {
this.$message.error("请选择时间范围!"); this.$message.error("请选择时间范围!");
...@@ -206,6 +266,7 @@ export default { ...@@ -206,6 +266,7 @@ export default {
cancleFresh() { cancleFresh() {
this.dialogOpen = false; this.dialogOpen = false;
this.btnFreshLoading = false; this.btnFreshLoading = false;
this.showContent = true;
this.freshDate = ""; this.freshDate = "";
}, },
// 手动更新 // 手动更新
...@@ -478,6 +539,10 @@ export default { ...@@ -478,6 +539,10 @@ export default {
}, },
data() { data() {
return { return {
showTip: true,
showContent: true,
endTime: "",
restTime: "10",
pickerOptions0: { pickerOptions0: {
disabledDate(v) { disabledDate(v) {
let limitDate = let limitDate =
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
:close-on-click-modal="false" :close-on-click-modal="false"
:show-close="false" :show-close="false"
> >
<div class="fresh_box"> <div class="fresh_box" v-if="showContent">
<div class="title_box" style="margin-bottom: 20px;"> <div class="title_box" style="margin-bottom: 20px;">
仅支持手动更新月度绩效数据,请选择需要更新的月份: 仅支持手动更新月度绩效数据,请选择需要更新的月份:
</div> </div>
...@@ -49,8 +49,37 @@ ...@@ -49,8 +49,37 @@
> >
</el-date-picker> </el-date-picker>
</div> </div>
<div slot="footer" class="dialog-footer"> <div class="fresh_box" v-else>
<el-button type="primary" @click="submitFresh" :loading="submitLoad" <div
class="title_box"
style="margin-bottom: 20px;line-height: 30px;"
v-if="showTip"
>
请确认是否开始进行{{ freshDate }}的绩效数据重新汇总;此过程预计需要
<span style="color:#ff0000 ;">15</span> 分钟,请勿关闭或刷新页面
</div>
<div
class="title_box"
style="margin-bottom: 20px;line-height: 30px;"
v-else
>
正在进行{{ freshDate }}的绩效数据重新汇总;此过程预计还需要
<span style="color:#ff0000 ;">{{ restTime }}</span>
分钟,请勿关闭或刷新页面
</div>
</div>
<div slot="footer" class="dialog-footer" v-if="showTip">
<el-button
type="primary"
@click="() => (showContent = false)"
v-if="showContent"
>确 定</el-button
>
<el-button
type="primary"
@click="submitFresh"
v-else
:loading="submitLoad"
>确 定</el-button >确 定</el-button
> >
<el-button @click="cancleFresh">取 消</el-button> <el-button @click="cancleFresh">取 消</el-button>
...@@ -69,7 +98,9 @@ export default { ...@@ -69,7 +98,9 @@ export default {
dialogShow, dialogShow,
}, },
mixins: [table], mixins: [table],
created() {}, created() {
console.log();
},
methods: { methods: {
/** 导出Excel */ /** 导出Excel */
...@@ -186,11 +217,12 @@ export default { ...@@ -186,11 +217,12 @@ export default {
}) })
.then((res) => { .then((res) => {
if (res.code == 1) { if (res.code == 1) {
this.$message.success(res.msg); // this.$message.success(res.msg);
this.dialogOpen = false; this.showTip = false;
this.btnFreshLoading = false; this.btnFreshLoading = false;
this.submitLoad = false; this.submitLoad = false;
this.freshDate = ""; this.endTime = Date.parse(new Date()) + 15 * 60 * 1000;
this.countdown();
} }
}) })
.catch((error) => { .catch((error) => {
...@@ -198,6 +230,9 @@ export default { ...@@ -198,6 +230,9 @@ export default {
this.submitLoad = false; this.submitLoad = false;
this.dialogOpen = false; this.dialogOpen = false;
this.btnFreshLoading = false; this.btnFreshLoading = false;
this.showContent = true;
this.showTip = true;
this.freshDate = "";
}); });
} else { } else {
this.$message.error("请选择需要更新的月份!"); this.$message.error("请选择需要更新的月份!");
...@@ -206,17 +241,46 @@ export default { ...@@ -206,17 +241,46 @@ export default {
cancleFresh() { cancleFresh() {
this.dialogOpen = false; this.dialogOpen = false;
this.btnFreshLoading = false; this.btnFreshLoading = false;
this.showContent = true;
this.freshDate = ""; this.freshDate = "";
}, },
//倒计时
countdown() {
let now = Date.parse(new Date());
let msec = this.endTime - now;
if (msec < 0) return;
// let day = parseInt(msec / 1000 / 60 / 60 / 24);
let hr = parseInt((msec / 1000 / 60 / 60) % 24);
let min = parseInt((msec / 1000 / 60) % 60);
let sec = parseInt((msec / 1000) % 60);
min = min > 9 ? min : "0" + min;
sec = sec > 9 ? sec : "0" + sec;
this.restTime = min + "" + sec + "";
const that = this;
if (min >= 0 && sec >= 0) {
if (min == 0 && sec == 0) {
return;
}
setTimeout(function() {
that.countdown();
}, 1000);
}
},
}, },
data() { data() {
return { return {
endTime: "",
restTime: "15",
freshDate: "", freshDate: "",
btnFreshLoading: false, btnFreshLoading: false,
sortList: "", sortList: "",
dialogOpen: false, dialogOpen: false,
isExport: false, isExport: false,
showBtn: true, showBtn: true,
showTip: true,
showContent: true,
submitLoad: false, submitLoad: false,
progress: false, progress: false,
percent: 0, percent: 0,
......
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