Commit 835e010c authored by 姬鋆屾's avatar 姬鋆屾

推添加手动更新

parent 7fab9434
...@@ -222,6 +222,7 @@ export default { ...@@ -222,6 +222,7 @@ export default {
cancleFresh() { cancleFresh() {
this.dialogOpen = false; this.dialogOpen = false;
this.btnFreshLoading = false; this.btnFreshLoading = false;
this.freshDate = "";
}, },
// 手动更新 // 手动更新
handleRefresh() { handleRefresh() {
......
...@@ -50,6 +50,16 @@ ...@@ -50,6 +50,16 @@
@click="restTable" @click="restTable"
>重新汇总</el-button >重新汇总</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> </LayoutTable>
<dialog-show ref="dialogform" @ok="getData" /> <dialog-show ref="dialogform" @ok="getData" />
<!-- 导出表格设置 --> <!-- 导出表格设置 -->
...@@ -108,6 +118,38 @@ ...@@ -108,6 +118,38 @@
</div> </div>
</div> </div>
</el-drawer> </el-drawer>
<el-dialog
title="系统提示"
:visible.sync="dialogOpen"
width="500px"
append-to-body
@close="cancleFresh"
:close-on-press-escape="false"
:close-on-click-modal="false"
:show-close="false"
>
<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>
</div> </div>
</template> </template>
...@@ -134,6 +176,43 @@ export default { ...@@ -134,6 +176,43 @@ export default {
this.initalArr = this.config.columns; this.initalArr = this.config.columns;
}, },
methods: { methods: {
submitFresh() {
console.log(this.freshDate);
if (this.freshDate) {
this.submitLoad = true;
this.$post("/attendance/stat/summary", {
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;
this.freshDate = "";
}
})
.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;
this.freshDate = "";
},
// 手动更新
handleRefresh() {
this.btnFreshLoading = true;
this.dialogOpen = true;
},
// 表格设置弹窗取消操作 // 表格设置弹窗取消操作
handleCancel(i) { handleCancel(i) {
if (i == 1) { if (i == 1) {
...@@ -399,6 +478,20 @@ export default { ...@@ -399,6 +478,20 @@ export default {
}, },
data() { data() {
return { return {
pickerOptions0: {
disabledDate(v) {
let limitDate =
v.getTime() < new Date().getTime() - 2 * 86400000 ||
v.getTime() > Date.now();
return limitDate;
7;
},
},
freshDate: "",
submitLoad: false,
btnFreshLoading: false,
dialogOpen: false,
showBtn: true,
isExport: false, isExport: false,
config: { config: {
showType: "tableSelect", showType: "tableSelect",
......
...@@ -10,12 +10,52 @@ ...@@ -10,12 +10,52 @@
:disabled="isExport" :disabled="isExport"
>导出</el-button >导出</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> </LayoutTable>
<dialog-show ref="dialogform" @ok="getData" /> <dialog-show ref="dialogform" @ok="getData" />
<div class="mask" v-if="progress"> <div class="mask" v-if="progress">
<el-progress :stroke-width="26" :percentage="percent"></el-progress> <el-progress :stroke-width="26" :percentage="percent"></el-progress>
</div> </div>
<el-dialog
title="系统提示"
:visible.sync="dialogOpen"
width="500px"
append-to-body
@close="cancleFresh"
:close-on-press-escape="false"
:close-on-click-modal="false"
:show-close="false"
>
<div class="fresh_box">
<div class="title_box" style="margin-bottom: 20px;">
仅支持手动更新月度绩效数据,请选择需要更新的月份:
</div>
<el-date-picker
v-model="freshDate"
type="month"
format="yyyy 年 MM 月"
value-format="yyyy-MM"
placeholder="请选择月"
>
</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>
</div> </div>
</template> </template>
...@@ -133,11 +173,51 @@ export default { ...@@ -133,11 +173,51 @@ export default {
// } // }
}); });
}, },
handleRefresh() {
this.dialogOpen = true;
this.btnFreshLoading = true;
},
submitFresh() {
if (this.freshDate) {
this.submitLoad = true;
this.$post("/staff/perform/summary/summary", {
checkTimeStart: this.freshDate + "-01",
checkTimeEnd: this.freshDate + "-31",
})
.then((res) => {
if (res.code == 1) {
this.$message.success(res.msg);
this.dialogOpen = false;
this.btnFreshLoading = false;
this.submitLoad = false;
this.freshDate = "";
}
})
.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;
this.freshDate = "";
},
}, },
data() { data() {
return { return {
freshDate: "",
btnFreshLoading: false,
sortList: "", sortList: "",
dialogOpen: false,
isExport: false, isExport: false,
showBtn: true,
submitLoad: false,
progress: false, progress: false,
percent: 0, percent: 0,
config: { config: {
......
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