Browse Source

1、电数据补全

QuietShadow 2 years ago
parent
commit
9b9738c894

+ 68 - 1
src/views/energyScheduling/components/measuringLocationData/measuringLocationEntry.vue

@@ -286,7 +286,15 @@
                         v-privilege="activeMenu + 'BQ'"
                         @click="but_resData()"
                         :loading="loading"
-                    >数据补全</el-button>
+                    >数据补全(水)</el-button>
+                    <el-button
+                        class="button"
+                        type="primary"
+                        size="mini"
+                        v-privilege="activeMenu + 'BQ'"
+                        @click="but_resEData()"
+                        :loading="loading"
+                    >数据补全(电)</el-button>
                     <el-switch
                       v-model="filterForm.data.allOrCorrect"
                       active-text="修正"
@@ -1762,6 +1770,65 @@ export default {
             } else {
                 this.$message.error('至少要选择一条数据');
             }
+        },
+        // 补全数据
+        but_resEData () {
+            let that = this;
+            if (!that.filterForm.data.clock || that.filterForm.data.clock.length === 0) {
+                that.$message.warning('请选择日期范围');
+                return true;
+            }
+            if (!that.filterForm.data.clock[0] || !that.filterForm.data.clock[1]) {
+                that.$message.warning('请选择开始日期与结束日期');
+                return true;
+            }
+            if (!that.filterForm.data.timegranid) {
+                that.$message.warning('请选择时间粒度');
+                return true;
+            }
+            if (that.multipleSelection.length > 0) {
+              that.$confirm('是否补全当前选中点位日数据?数据不益多选!否则运行时间较长', '提示', {
+                  confirmButtonText: '确定',
+                  cancelButtonText: '取消',
+                  state: 'warning'
+              }).then(() => {
+                        let SubmitData = {},itemId = [];
+                        for (let key in that.tableFormDataObj) {
+                          itemId.push(that.tableFormDataObj[key].itemid);
+                        }
+                        SubmitData = {
+                            clock: that.filterForm.data.clock[0],
+                            clocke: that.filterForm.data.clock[1],
+                            itemid: itemId.toString()
+                        }
+                that.loading = true;
+                let url = 'pass/ems/v1/trmcalpointvalues/resElData'
+                that.axios.get(url, {
+                    params: SubmitData
+                })
+                    .then(function (res) {
+                        if (res.code === '0') {
+                            if (res.message && res.message !== '操作成功') {
+                                that.$message.warning('自动补全电数据完成, 其中【' + res.message + '】');
+                            } else {
+                                that.$message({
+                                    message: '自动补全电数据完成!',
+                                    type: 'success'
+                                });
+                            }
+                        } else {
+                            that.$message.error(res.message);
+                        }
+                        that.loading = false;
+                    }).catch(function () {
+                        that.loading = false;
+                    });
+                }).catch(() => {
+                  this.$message.warning('用户取消操作');
+                });
+            } else {
+                this.$message.error('至少要选择一条数据');
+            }
         }
     }
 }