YYC
2023-05-19 6e7865b1f1c3d310019987f52d7e145cde691942
igds-app/js/admin/es-detail.js
@@ -22,7 +22,6 @@
   data.tokenAuth = user.tokenAuth;
   data.data.deptId = selectDeptId;
   startTime = getDate(new Date());
   document.getElementById("start").value = startTime;
   getEsDetailList();
}
@@ -48,14 +47,22 @@
      // endDate: new Date(2016, 04, 25), //设置结束日期 
   })
   if (tag == 'start') {
      var start = startTime;
      dtpicker.show(function(e) {
         startTime = e.value
         document.getElementById("start").value = e.value
      })
         if(start != startTime){
            getEsDetailList();
         }
      })
   } else {
      var end = endTime;
      dtpicker.show(function(e) {
         endTime = e.value;
         document.getElementById("end").value = e.value
         if(end != endTime){
            getEsDetailList();
         }
      })
   }
}
@@ -63,6 +70,7 @@
function getEsDetailList() {
   data.data.startTime = startTime
   data.data.endTime = endTime
   console.log(JSON.stringify(data.data))
   mui.ajax(url, {
      type: "POST",
      dataType: "json",
@@ -76,48 +84,47 @@
         } else {
            renderData();
            mui.toast(result.msg);
            console.log("else", JSON.stringify(result))
         }
      },
      error: function() {
         mui.alert("系统繁忙,请重试!", "提示", ["确定"], function() {}, "div")
      }
   })
   // esDetailList =  [
 //        {
 //            "depotId": "16",
 //            "depotName": "值话各元",
 //            "startEs": "31",
 //            "endEs": "56",
 //            "epSum": "13",
 //            "eqSum": "37",
 //            "esSum": "25"
 //        },
 //        {
 //            "depotId": "2",
 //            "depotName": "划点王数队",
 //            "startEs": "55",
 //            "endEs": "47",
 //            "epSum": "46",
 //            "eqSum": "42",
 //            "esSum": "59"
 //        },
 //        {
 //            "depotId": "34",
 //            "depotName": "和多断们",
 //            "startEs": "78",
 //            "endEs": "24",
 //            "epSum": "37",
 //            "eqSum": "73",
 //            "esSum": "83"
 //        }
 //    ]
   esDetailList = [{
         "depotId": "16",
         "depotName": "值话各元",
         "startEs": "31",
         "endEs": "56",
         "epSum": "13",
         "eqSum": "37",
         "esSum": "25"
      },
      {
         "depotId": "2",
         "depotName": "划点王数队",
         "startEs": "55",
         "endEs": "47",
         "epSum": "46",
         "eqSum": "42",
         "esSum": "59"
      },
      {
         "depotId": "34",
         "depotName": "和多断们",
         "startEs": "78",
         "endEs": "24",
         "epSum": "37",
         "eqSum": "73",
         "esSum": "83"
      }
   ]
}
mui('.mui-content').on("tap", ".g-sobox div button", function() {
   data.data.depotId = document.getElementById("search").value
   getEsDetailList()
})
//渲染页面
function renderData() {
@@ -126,13 +133,18 @@
      $.each(esDetailList, function(index, item) {
         html += '<div class="wp"><div class="m-ck-cont"><div class="g-titck1">' + item.depotName + '</div>'
         html += '<div class="m-energy1"><div class="inner"><div class="con con1">'
         html += '<div class="num"><div class="l"></div>' + item.startEs + ' <span>KWh</span></div><div class="desc">起始能耗</div></div></div>'
         html += '<div class="num"><div class="l"></div>' + item.startEs +
            ' <span>KWh</span></div><div class="desc">起始能耗</div></div></div>'
         html += '<div class="inner"><div class="con con2">'
         html += '<div class="num"><div class="l"></div>' + item.endEs + ' <span>KWh</span></div><div class="desc">截止能耗</div></div></div></div>'
         html += '<div class="num"><div class="l"></div>' + item.endEs +
            ' <span>KWh</span></div><div class="desc">截止能耗</div></div></div></div>'
         html += '<div class="m-energy2"><div class="tit">能耗统计信息</div><ul class="ul-txtliste1">'
         html += '<li><div class="con"><div class="num">' + item.epSum + ' <span>KWh</span></div><div class="desc">有功电能</div></div></li>'
         html += '<li><div class="con"><div class="num">' + item.eqSum + ' <span>KWh</span></div><div class="desc">无功电能</div></div></li>'
         html += '<li><div class="con"><div class="num">' + item.esSum + ' <span>KWh</span></div><div class="desc">总电能</div></div></li>'
         html += '<li><div class="con"><div class="num">' + item.epSum +
            ' <span>KWh</span></div><div class="desc">有功电能</div></div></li>'
         html += '<li><div class="con"><div class="num">' + item.eqSum +
            ' <span>KWh</span></div><div class="desc">无功电能</div></div></li>'
         html += '<li><div class="con"><div class="num">' + item.esSum +
            ' <span>KWh</span></div><div class="desc">总电能</div></div></li>'
         html += '</ul></div></div></div>'
      })
   } else {