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

推添加手动更新

parent 7fab9434
......@@ -222,6 +222,7 @@ export default {
cancleFresh() {
this.dialogOpen = false;
this.btnFreshLoading = false;
this.freshDate = "";
},
// 手动更新
handleRefresh() {
......
......@@ -50,6 +50,16 @@
@click="restTable"
>重新汇总</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" />
<!-- 导出表格设置 -->
......@@ -108,6 +118,38 @@
</div>
</div>
</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>
</template>
......@@ -134,6 +176,43 @@ export default {
this.initalArr = this.config.columns;
},
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) {
if (i == 1) {
......@@ -399,6 +478,20 @@ export default {
},
data() {
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,
config: {
showType: "tableSelect",
......
......@@ -10,12 +10,52 @@
:disabled="isExport"
>导出</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" />
<div class="mask" v-if="progress">
<el-progress :stroke-width="26" :percentage="percent"></el-progress>
</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>
</template>
......@@ -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() {
return {
freshDate: "",
btnFreshLoading: false,
sortList: "",
dialogOpen: false,
isExport: false,
showBtn: true,
submitLoad: false,
progress: false,
percent: 0,
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