Biao 3 vuotta sitten
vanhempi
commit
738b5a690b

+ 1 - 0
src/App.vue

@@ -576,4 +576,5 @@ body {
   background-color: #040c0b;
   border: 0px;
 }
+
 </style>

+ 12 - 1
src/api/economic/index.js

@@ -495,6 +495,16 @@ const analysisplusBdzlist = (data) => {
         method: "get",
     });
 };
+// 报表管理  --统计分析--确认提交数据‘
+const analysisplusCommit = (data) => {
+    return request({
+        url: `/consumer/analysisplus/commit`,
+        method: "post",
+        data: data
+    });
+};
+
+
 export default {
     benchmarking,
     benchmarkingLineList,
@@ -563,5 +573,6 @@ export default {
     weatherWatherChart,
     statisticAnalysis,
     analysisplusTjfxlist,
-    analysisplusBdzlist
+    analysisplusBdzlist,
+    analysisplusCommit
 }

+ 47 - 40
src/views/NewPages/form.vue

@@ -1,9 +1,9 @@
 <template>
   <div class="from">
     <div class="btns">
-      <button class="btn green">保存</button>
+      <!-- <button class="btn green">保存</button> -->
       <button class="btn green" @click="back">返回</button>
-      <button class="btn green">表底</button>
+      <button class="btn green" @click="blackCZ">场站</button>
     </div>
     <div class="tableForm">
       <el-table
@@ -26,37 +26,30 @@
           background: 'rgba(83, 98, 104)';
         "
       >
-        <!-- <el-table-column
-        v-for="(i, index) in Object.keys(tableData[0]).sort(function (n, m) {
-          return parseInt(n.split('_')[0]) - parseInt(m.split('_')[0]);
-        })"
-        :key="index"
-        :prop="i"
-        :label="i | clu"
-        width="160"
-      >
-        <template slot-scope="scope">
-          <el-input
-            @input="send(scope.row)"
-            v-if="scope.row.name == '止码' && i != 'name' && i != 'date'"
-            v-model="scope.row[i]"
-            :disabled="true"
-          ></el-input>
-          <label v-else>{{ scope.row[i] }}</label>
-        </template>
-      </el-table-column> -->
-
         <el-table-column
-          v-for="(i, index) in Object.keys(tableData[0]).sort(function (n, m) {
-            return parseInt(n.split('_')[0]) - parseInt(m.split('_')[0]);
-          })"
-           :fixed="(i === 'name'||i === 'date')?'left':null"
+          v-for="(i, index) in tableData[0]
+            ? Object.keys(tableData[0]).sort(function (n, m) {
+                return parseInt(n.split('_')[0]) - parseInt(m.split('_')[0]);
+              })
+            : ''"
           :key="index"
           :prop="i"
-          :label="i"
-          width="160"
+          :label="i === 'name' ? '名字' : i === 'date' ? '日期' : i"
+          :fixed="i === 'name' || i === 'date' ? 'left' : null"
+          width="200"
           align="center"
         >
+          <template #default="scope">
+            <!-- <el-input @input="send(scope.row)"  v-if="scope.row.name =='止码' && i != 'name' && i != 'date'" v-model="scope.row[i]" :disabled='routerData.isConfirm == 1'></el-input> -->
+            <el-input
+              @input="send(scope.row)"
+              v-if="scope.row.name == '止码' && i != 'name' && i != 'date'"
+              v-model="scope.row[i]"
+              :disabled="true"
+              style="width: 75%"
+            ></el-input>
+            <label v-else>{{ scope.row[i] }}</label>
+          </template>
         </el-table-column>
       </el-table>
     </div>
@@ -69,6 +62,8 @@ export default {
   data() {
     return {
       tableData: [],
+      tableTit: [],
+      timeNow: this.$route.query,
     };
   },
   created() {
@@ -78,29 +73,41 @@ export default {
     getFormList() {
       api
         .analysisplusBdzlist({
-          wpid: this.$route.query.wpid,
-          theday: this.$route.query.theday,
+          wpid: this.timeNow.wpid,
+          theday: this.timeNow.theday,
         })
         .then((res) => {
-        // console.log(res.data);
-        // res.data.forEach(item =>{
-        //     item.aaa = 1
-        //     item.bbb = 1
-        //     item.vv = 1
-        //     item.mm = 1
-        //     item.ee = 1
-        //     item.dd = 1
-        // })
+          // console.log(res.data);
+          for (let i = 0; i < res.data.length; i++) {
+            for (let key in res.data[i]) {
+              if (key === "date") {
+                res.data[i][key] = res.data[i][key].slice(0, 10);
+              }
+            }
+          }
+
           this.tableData = res.data;
+
+          // console.log(res.data);
+          // console.log(44444444444444444444, this.tableTit, this.tableData);
         });
     },
     // 表格
     handleClick(row) {
-      console.log(row);
+      // console.log(row);
     },
     back() {
       this.$router.push("/decision/statisticAnalysis");
     },
+    blackCZ() {
+      this.$router.push({
+        path: "/decision/statisticAnalysis/station",
+        query: {
+          theday: this.timeNow.theday,
+          wpid: this.timeNow.wpid,
+        },
+      });
+    },
   },
 };
 </script>

+ 157 - 6
src/views/NewPages/station.vue

@@ -1,9 +1,64 @@
 <template>
   <div class="station">
     <div class="btns">
-      <button class="btn green">保存</button>
+      <!-- <button class="btn green">保存</button> -->
       <button class="btn green" @click="back">返回</button>
-      <button class="btn green">表底</button>
+      <button class="btn green" @click="backForm">表底</button>
+    </div>
+    <div class="table-D">
+      <!-- 表格 -->
+      <el-table
+        :data="tableData"
+        style="width: 100%; overflow-y: auto;min-width='80vh';"
+        :cell-style="addClass"
+        max-height="80vh"
+      >
+        <el-table-column
+          v-for="(i, index) in tableClu.slice(0, 2)"
+          :key="index"
+          :prop="i"
+          :label="i"
+          width="240"
+        >
+          <template #default="scope">
+            {{ scope.row[i] }}
+          </template>
+        </el-table-column>
+
+        <el-table-column
+          v-for="(k, index) in tableCluObj"
+          :key="index"
+          :label="k.split('_')[0]"
+          align="center"
+        >
+          <el-table-column
+            v-for="i in tableClu.slice(2 + index * 2, 4 + index * 2)"
+            :key="i"
+            :prop="i"
+            label="当日值"
+           
+            align="center"
+          >
+            <template #default="scope">
+              <!-- <el-input
+              v-if="tableString.indexOf(i) != -1"
+              :disabled="scope.row['是否可编辑'] == 1 || routerData.isConfirm == 1"
+              size="mini"
+              @change="changeNum(scope.row)"
+              v-model="scope.row[i]"
+            ></el-input> -->
+              <el-input
+                v-if="tableString.indexOf(i) != -1"
+                :disabled="true"
+                size="mini"
+                @change="changeNum(scope.row)"
+                v-model="scope.row[i]"
+              ></el-input>
+              <label v-else>{{ scope.row[i] }}</label>
+            </template>
+          </el-table-column>
+        </el-table-column>
+      </el-table>
     </div>
   </div>
 </template>
@@ -11,7 +66,17 @@
 <script>
 import api from "@api/economic/index.js";
 export default {
+  data() {
+    return {
+      tableData: [],
+      tableClu: [],
+      tableCluObj: [],
+      tableString: [],
+      timeNow: this.$route.query,
+    };
+  },
   created() {
+    // console.log("xxxxxxxxxxxxxxxxxxxxxxxxx", this.timeNow);
     this.getCZList();
   },
   methods: {
@@ -19,17 +84,97 @@ export default {
     getCZList() {
       api
         .analysisplusTjfxlist({
-          wpid: this.$route.query.wpid,
-          theday: this.$route.query.theday,
+          wpid: this.timeNow.wpid,
+          theday: this.timeNow.theday,
         })
         .then((res) => {
-          console.log(res);
-        //   this.tableList = res.data;
+          for (let k of res.data[0] ? Object.keys(res.data[0]) : "") {
+            for (let i of res.data) {
+              if (typeof i[k] == "object") {
+                if (i[k] != null) {
+                  for (let p of res.data[0] ? Object.keys(i[k]) : "") {
+                    // console.log(i[k][p]);
+                    i[k + p] = i[k][p];
+                  }
+                }
+              }
+            }
+          }
+
+          this.tableData = res.data;
+          // console.log("tableData", this.tableData);
+          for (let i of res.data[0] ? Object.keys(res.data[0]) : "") {
+            if (typeof res.data[0][i] != "object") {
+              if (i != "是否可编辑" && i != "id") {
+                this.tableClu.push(i);
+              }
+            } else {
+              this.tableCluObj.push(i);
+            }
+            this.tableClu.sort(function (n, m) {
+              return parseInt(n.split("_")[1]) - parseInt(m.split("_")[1]);
+            });
+            this.tableCluObj.sort(function (n, m) {
+              return parseInt(n.split("_")[1]) - parseInt(m.split("_")[1]);
+            });
+          }
+          for (let i of this.tableCluObj) {
+            this.tableString.push(i + "当日值(编辑)");
+          }
+          // console.log("tableClu", this.tableClu);
+          // console.log("tableCluObj", this.tableCluObj);
         });
     },
     back() {
       this.$router.push("/decision/statisticAnalysis");
     },
+    backForm() {
+      this.$router.push({
+        path: "/decision/statisticAnalysis/form",
+        query: {
+          theday: this.timeNow.theday,
+          wpid: this.timeNow.wpid,
+        },
+      });
+    },
+
+    addClass({ row, column, rowIndex, columnIndex }) {
+      // if(columnIndex === 4){
+      if (parseFloat(row.麻黄山风电场) < 0) {
+        return "background:yellow";
+      }
+      if (parseFloat(row.牛首山风电场) < 0) {
+        return "background:yellow";
+      }
+      if (parseFloat(row.青山风电场) < 0) {
+        return "background:yellow";
+      }
+      if (parseFloat(row.石板泉风电场) < 0) {
+        return "background:yellow";
+      }
+      if (parseFloat(row.香山风电场) < 0) {
+        return "background:yellow";
+      }
+      if (parseFloat(row.大武口电站) < 0) {
+        return "background:yellow";
+      }
+      if (parseFloat(row.平罗光伏电站) < 0) {
+        return "background:yellow";
+      }
+      if (parseFloat(row.宣和光伏发电站) < 0) {
+        return "background:yellow";
+      }
+
+      // }
+    },
+    changeNum(v) {
+      const date = this.routerData.data.theday;
+      const wpid = this.routerData.data.wpid;
+      v.date = date;
+      v.wpid = wpid;
+      // console.log(this.routerData);
+      this.sendData.push(v);
+    },
   },
 };
 </script>
@@ -41,4 +186,10 @@ export default {
 .btn {
   margin: 20px;
 }
+.table-D {
+  margin: 20px 20px 0 20px;
+}
+/deep/.el-table thead.is-group th.el-table__cell {
+  background-color: rgb(37, 36, 36);
+}
 </style>

+ 37 - 7
src/views/NewPages/statisticAnalysis.vue

@@ -13,11 +13,14 @@
         align="right"
       >
       </el-date-picker>
-      <button class="btn green">搜索</button>
+      <button class="btn green" @click="search">搜索</button>
     </div>
 
     <div class="table1">
       <el-table
+        max-height="80vh"
+        v-loading="loading"
+        element-loading-background="rgba(0, 0, 0, 0.8)"
         :data="tableData"
         :header-cell-style="{
           height: '40px',
@@ -30,7 +33,7 @@
           'border-bottom': 'solid 0px #242424',
         }"
         stripe
-        style="width: 100%; margin-bottom: 10px"
+        style="width: 100%; margin-bottom: 10px; overflow-y: auto"
       >
         <el-table-column prop="wpname" label="场站" align="center" width="360">
         </el-table-column>
@@ -47,12 +50,17 @@
         </el-table-column>
         <el-table-column align="center" label="操作">
           <template #default="scope">
-            <el-button @click="handleClick3(scope.row)" class="btn1" disabled
-              >确认</el-button
+            <el-button
+              @click="handleClick3(scope.row)"
+              :class="scope.row.isConfirm == 1 ? 'aaaa' : 'btn'"
+              :disabled="scope.row.isConfirm == 1"
+            >
+              确认</el-button
             >
           </template>
         </el-table-column>
       </el-table>
+      <!-- :class="scope.row.isConfirm == 1 ? 'active' : 'active:hover'" -->
     </div>
   </div>
 </template>
@@ -77,12 +85,12 @@ export default {
         this.fmtDate(new Date()),
       ],
       tableData: [],
+      loading: false,
     };
   },
 
   methods: {
     handleClickCZ(row) {
-      // console.log(666666666666666666,row);
       this.$router.push({
         path: "/decision/statisticAnalysis/station",
         query: {
@@ -92,15 +100,22 @@ export default {
       });
     },
     handleClickForm(row) {
-      console.log(66666666666, row);
       this.$router.push({
         path: "/decision/statisticAnalysis/form",
-          query: {
+        query: {
           wpid: row.wpid,
           theday: row.theday,
         },
       });
     },
+    handleClick3(row) {
+      console.log("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", row);
+      api.analysisplusCommit(row).then((res) => {
+        console.log("666666666666666666", res);
+        this.getList();
+        // this.tableData = res.data;
+      });
+    },
     getList: function () {
       api
         .statisticAnalysis({
@@ -110,6 +125,7 @@ export default {
         .then((res) => {
           // console.log('666666666666666666',res.data);
           this.tableData = res.data;
+          this.loading=false
         });
     },
     getTime(val) {
@@ -152,6 +168,10 @@ export default {
         (seconds < 10 ? "0" + seconds : seconds)
       );
     },
+    search() {
+      this.loading = true;
+      this.getList();
+    },
   },
 };
 </script>
@@ -197,4 +217,14 @@ export default {
   color: #05bb4c;
   border-color: #05bb4c;
 }
+
+.aaaa {
+  background-color: #4d4949;
+  color: rgb(87 110 108);
+}
+.aaaa:hover {
+  border: #4d4949;
+  background-color: #4d4949;
+  color: rgb(87 110 108);
+}
 </style>