|
|
@@ -48,6 +48,12 @@
|
|
|
查询
|
|
|
</el-button>
|
|
|
|
|
|
+ <el-input
|
|
|
+ v-model="state.syncMonth"
|
|
|
+ placeholder="同步月份 如 2026-05"
|
|
|
+ clearable
|
|
|
+ class="wd180 ml10"/>
|
|
|
+
|
|
|
<el-button class="ml10" plain size="default" type="warning" @click="handleSyncMonthStat">
|
|
|
<SvgIcon name="ele-RefreshRight"/>
|
|
|
重新同步
|
|
|
@@ -104,6 +110,7 @@ import ExtSelect from "/@/components/form/ExtSelect.vue";
|
|
|
const queryRef = ref();
|
|
|
|
|
|
const state = reactive({
|
|
|
+ syncMonth: '',
|
|
|
formQuery: {
|
|
|
stationId: '',
|
|
|
statMonth: ''
|
|
|
@@ -140,7 +147,9 @@ onMounted(() => {
|
|
|
// 默认查询上月数据
|
|
|
const now = new Date();
|
|
|
const lastMonth = new Date(now.getFullYear(), now.getMonth() - 1, 1);
|
|
|
- state.formQuery.statMonth = lastMonth.getFullYear() + '-' + String(lastMonth.getMonth() + 1).padStart(2, '0');
|
|
|
+ const lastMonthStr = lastMonth.getFullYear() + '-' + String(lastMonth.getMonth() + 1).padStart(2, '0');
|
|
|
+ state.formQuery.statMonth = lastMonthStr;
|
|
|
+ state.syncMonth = lastMonthStr;
|
|
|
|
|
|
loadData();
|
|
|
|
|
|
@@ -168,9 +177,13 @@ const loadData = (refresh: boolean = false) => {
|
|
|
};
|
|
|
|
|
|
const handleSyncMonthStat = () => {
|
|
|
- Msg.confirm('确认重新同步该月份的统计数据吗?将同步所有站点的数据。', '重新同步月统计').then(() => {
|
|
|
+ if (!state.syncMonth) {
|
|
|
+ Msg.message('请输入同步月份', 'warning');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ Msg.confirm(`确认重新同步 ${state.syncMonth} 的统计数据吗?将同步所有站点的数据。`, '重新同步月统计').then(() => {
|
|
|
Msg.showLoading('同步中...');
|
|
|
- $body(`/month-stat/sync`, {statMonth: state.formQuery.statMonth}).then(() => {
|
|
|
+ $body(`/month-stat/sync`, {statMonth: state.syncMonth}).then(() => {
|
|
|
Msg.message("同步完成");
|
|
|
Msg.hideLoading();
|
|
|
loadData(true);
|