equipmentElectricityWater.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359
  1. <template>
  2. <view>
  3. <view class="navbar-c">
  4. <view class="back" @click="backStatistics">
  5. <u-icon name="arrow-left" color="#101010" size="36"></u-icon>
  6. </view>
  7. <view class="title">
  8. 用水量(度)
  9. <image class="img" src="@/assets/img/refresh-line.svg" @click="getList(true)"></image>
  10. </view>
  11. </view>
  12. <u-select title="" v-model="tabsFrom.show1" :defaultValue="[current2]"
  13. :list="childList" value-name="id" label-name="name"
  14. @confirm="selector1confirm" >
  15. </u-select>
  16. <u-picker-select title="日期选择" v-model="tabsFrom.show2" :defaultTime="tabsFrom.show2Index" :endYear="endYear"
  17. mode="time" :params="params" :noselect="false" @confirm="selector2confirm" @cancel="selector2cancel"
  18. @reset="selector2reset"></u-picker-select>
  19. <!-- 标签 -->
  20. <view class="tabs-box" >
  21. <view class="tabs" :class="'tabs-len-'+merchantList1.length" v-show="companyList.length>1"
  22. :style="{width: companyList.length>3 ? '' : '100%'}">
  23. <u-tabs-one v-if="utabsone"
  24. :list="merchantList1" :is-scroll="false" inactive-color="#999999" active-color="#666666"
  25. :current="current" @change="change"></u-tabs-one>
  26. </view>
  27. <view class="more" @click="popShow=true" v-if="companyList.length >= 4">
  28. <u-icon name="arrow-down" color="#fff" size="40"></u-icon>
  29. </view>
  30. </view>
  31. <!-- 标签弹出层 -->
  32. <u-popup v-model="popShow" duration="10" mode="top" :negative-top="88" border-radius="16">
  33. <view class="popup-tabs">
  34. <view class="tabs">
  35. <u-tabs :list="merchantList1" :is-scroll="false" :current="current" @change="change"></u-tabs>
  36. </view>
  37. <view class="more">
  38. <u-icon name="arrow-up" color="#777777" size="40" @click="popShow=false"></u-icon>
  39. </view>
  40. </view>
  41. <view class="tabs-options">
  42. <view class="item" v-for="(item, index) in merchantList2" :key="index"
  43. @click="merchantChange(item,index)">
  44. {{item.name}}
  45. </view>
  46. </view>
  47. </u-popup>
  48. <view class="electronicMonitoring-title"
  49. @click="titleCk"
  50. v-if="childList&&childList.length>0" >
  51. <view>
  52. {{childListName}}
  53. </view>
  54. <view v-show="childList.length>1">
  55. <u-icon name="arrow-down" color="#fff"></u-icon>
  56. </view>
  57. </view>
  58. <!-- 全部标签 -->
  59. <view class="main" >
  60. <view class="item" v-for="(item, index) in kWhList" :key="item.index"
  61. @click="toElectronicMonitoring(item)">
  62. <view class="item-content">
  63. <view class="equipment">
  64. <view class="equipment1 ">
  65. {{replaceLastTwoWords(item.name)}}
  66. </view>
  67. <view class="equipment2">
  68. {{item.installationAddressSimple}}
  69. </view>
  70. <view class="state" v-if="!item.online">
  71. <view class="dot off-line"></view>
  72. <view class="text">离线</view>
  73. </view>
  74. <view class="state state2" v-else>
  75. <view class="dot on-line"></view>
  76. <view class="text">在线</view>
  77. </view>
  78. </view>
  79. <view class="electricity">
  80. <view class="electricity-item electricity-item-day">
  81. <view class="date">
  82. 今日
  83. </view>
  84. <view class="number">
  85. {{item.thisDayTotalConsumption}}
  86. </view>
  87. </view>
  88. <view class="electricity-item">
  89. <view class="date">
  90. 本月
  91. </view>
  92. <view class="number">
  93. {{item.thisMonthTotalConsumption}}
  94. </view>
  95. </view>
  96. <view class="electricity-item">
  97. <view class="date">
  98. 上月
  99. </view>
  100. <view class="number">
  101. {{item.lastMonthTotalConsumption}}
  102. </view>
  103. </view>
  104. </view>
  105. </view>
  106. <view class="more">
  107. <u-icon name="arrow-right" color="#d4d4d4" size="24"></u-icon>
  108. </view>
  109. </view>
  110. </view>
  111. <u-divider :isnone="kWhList.length==0" nonetext="暂无数据" border-color="#CFD2D5">已经到底了</u-divider>
  112. </view>
  113. </template>
  114. <script>
  115. import * as API from '@/apis/pagejs/index.js'
  116. import * as API2 from '@/apis/pagejs/energyManage.js'
  117. import * as API_water from '@/apis/pagejs/water.js'
  118. import * as echarts from 'echarts';
  119. import {
  120. parseUnixTime,
  121. beforeTimeStamp,
  122. getWeek
  123. } from '@/apis/utils'
  124. import TreeBody from '@/components/tree/tree-body.vue';
  125. import electronicMonitoring from '@/pages/equipmentDataMonitoring/electronicMonitoring.vue'
  126. export default {
  127. components: {
  128. TreeBody,electronicMonitoring
  129. },
  130. data() {
  131. return {
  132. codes:"",
  133. getHomePageManageReady:false,
  134. getHomePageManageshowLoading:false,
  135. companyList: [], // 商户
  136. merchantList1: [],
  137. merchantList2: [],
  138. myLineChart: null, // 图表
  139. myBarChart: null,
  140. myPieChart: null,
  141. homePageManageType: 2,
  142. homePageManageObj: {
  143. chargeKwh: 0,
  144. lostKwh: 0,
  145. parkKwh: 0,
  146. freeKwh:0,
  147. publicKwh:0,
  148. },
  149. meterList: [],
  150. meterListShow:{},
  151. queryDate: '',
  152. kWhList: [], //设备
  153. companyId: '',
  154. popShow: false,
  155. current: 0,
  156. allKWhList: [],
  157. companyKwhList: [],
  158. pageIndex: 1,
  159. recordsTotal: 0,
  160. windowHeight: '',
  161. checked:false,
  162. list: [{
  163. name: '上月',
  164. value: "2"
  165. },
  166. {
  167. name: '当月',
  168. value: "1"
  169. },
  170. {
  171. name: '今日',
  172. value: "4"
  173. }, {
  174. name: '当年',
  175. value: "3"
  176. }, {
  177. name: '合计',
  178. value: "0"
  179. },
  180. {
  181. name: '指定月份',
  182. value: "10"
  183. }
  184. ],
  185. endYear: '',
  186. params: {
  187. year: true,
  188. month: true,
  189. day: true,
  190. hour: false,
  191. minute: false,
  192. second: false
  193. },
  194. value: '2',
  195. clickType: -1,
  196. tabsFrom: {
  197. show1: false,
  198. show1Index: 0,
  199. show2Index: '',
  200. show2: false,
  201. show1Text: "全部类型",
  202. show2Text: "全部时间",
  203. },
  204. utabsone:true,
  205. //companyType:0,
  206. incomeExpenditureObj:{},
  207. opCompanyId: '',
  208. childList:[],
  209. companyListMain:[],
  210. current2:0,
  211. childInfo:{},
  212. companyInfo:{}
  213. }
  214. },
  215. onReady() {
  216. },
  217. computed:{
  218. childListName(){
  219. return this.childInfo.name;
  220. },
  221. companyType(){
  222. return this.companyInfo.type;
  223. }
  224. },
  225. onLoad(op) {
  226. this.endYear = new Date().getFullYear();
  227. this.queryDate = parseUnixTime(new Date(), '{y}-{m}-{d}');
  228. if(op.companyId){
  229. this.opCompanyId=op.companyId
  230. this.companyId=op.companyId
  231. }
  232. else{
  233. this.getCompanyInfoList();
  234. }
  235. this.getList();
  236. },
  237. onReachBottom() {
  238. if (this.kWhList.length < this.recordsTotal) {
  239. this.myLoadmore();
  240. }
  241. },
  242. methods: {
  243. titleCk() {
  244. if(this.childList.length>1){
  245. this.tabsFrom.show1 = true
  246. }
  247. },
  248. selector1confirm(e) {
  249. //this.getHomePageKwh()
  250. console.log(e)
  251. this.companyId=e[0].value
  252. this.current2=e[0].i
  253. this.childInfo=this.childList[this.current2];
  254. uni.showLoading()
  255. this.merchantChangeApi()
  256. },
  257. companyIdSet(val,item){
  258. this.companyType= 0
  259. if(val&&item){
  260. this.companyType= item.type
  261. }else{
  262. if(!val){
  263. }else{
  264. var bl=false
  265. this.companyList.find(item=>{
  266. if(item.id==val){
  267. this.companyType= item.type;
  268. }
  269. })
  270. }
  271. }
  272. },
  273. switchBtnApiMethod(node,key){
  274. uni.showLoading({
  275. title: "加载中",
  276. mask: true,
  277. })
  278. API2.remoteSwitch({
  279. meterId:node.id,
  280. enabled:key
  281. }).then((res) => {
  282. uni.hideLoading();
  283. node.switchStatus=key
  284. }).catch(error => {
  285. uni.showToast({
  286. title: error,
  287. icon: "none"
  288. })
  289. })
  290. },
  291. switchBtnApi(node,key){
  292. uni.showModal({
  293. confirmColor:`${key?'#3CC51F':'red'}`,
  294. confirmText:`${key?'开启':'关闭'}`,
  295. content: `确认是否要"${key?'开启':'关闭'}"${this.replaceLastTwoWords(node.name)}`,
  296. title: "提示",
  297. success:res=> {
  298. if(res.confirm){
  299. this.switchBtnApiMethod(node,key);
  300. }
  301. }
  302. })
  303. console.log(node,key)
  304. },
  305. refreshList() {
  306. // if (this.current != 0) {
  307. // } else {
  308. // this.getCompanyInfoList();
  309. // }
  310. this.getList(true);
  311. },
  312. companyChange(item, index) {
  313. this.current = index + 1;
  314. this.companyId = item.id;
  315. //this.companyIdSet(this.companyId)
  316. this.getList(true);
  317. },
  318. getCompanyInfoList() {
  319. this.companyKwhList = [];
  320. API.deviceCompanyList().then((response) => {
  321. var list = response.data.companyInfoList;
  322. this.companyListMain=response.data.companyInfoList;
  323. if(list.length==1&&list[0].childList&&list[0].childList.length){
  324. list=list[0].childList
  325. }
  326. this.companyList = list;
  327. var mList1 = [];
  328. var mList2 = [];
  329. mList1.push({
  330. id: '',
  331. name: '全部'
  332. });
  333. for (var i = 0; i < list.length; i++) {
  334. if (i >= 3) {
  335. mList2.push(list[i]);
  336. } else {
  337. mList1.push(list[i]);
  338. }
  339. }
  340. this.merchantList1 = mList1;
  341. this.merchantList2 = mList2;
  342. this.companyId = mList1[0].id;
  343. //this.companyIdSet(this.companyId)
  344. //this.getList();
  345. }).catch(error => {
  346. uni.showToast({
  347. title: error,
  348. icon: "none"
  349. })
  350. })
  351. },
  352. myLoadmore() {
  353. this.pageIndex += 1;
  354. this.getList();
  355. },
  356. getList(bl) {
  357. uni.showLoading({
  358. title: "加载中",
  359. mask: true,
  360. })
  361. if (bl) {
  362. this.kWhList = [];
  363. this.pageIndex = 1;
  364. }
  365. var data = {
  366. pageIndex: this.pageIndex,
  367. pageSize: 20,
  368. companyId: this.companyId
  369. };
  370. API_water.waterConsumption(data).then((res) => {
  371. uni.hideLoading();
  372. this.kWhList = [
  373. ...this.kWhList,
  374. ...res.data.data
  375. ];
  376. this.recordsTotal = res.data.recordsTotal;
  377. }).catch(error => {
  378. uni.showToast({
  379. title: error,
  380. icon: "none"
  381. })
  382. })
  383. },
  384. getHomePageKwh(companyId) {
  385. },
  386. merchantChange(item, index) {
  387. if(this.current==0){
  388. this.current=1;
  389. }
  390. var m = company;
  391. var n = this.merchantList1[this.current];
  392. this.merchantList1[this.current] = m;
  393. this.merchantList2[index] = n;
  394. //this.$forceUpdate()
  395. this.utabsone=false
  396. this.companyId = company.id;
  397. this.companyInfo=company
  398. if(company.id!=''){
  399. this.childList=company.childList;
  400. if(this.childList&&this.childList.length){
  401. this.companyId = this.childList[0].id;
  402. this.childInfo=this.childList[0]
  403. }else{
  404. this.childList=[]
  405. this.companyId =company.id
  406. this.childInfo=company
  407. }
  408. }else{
  409. this.companyId =''
  410. }
  411. this.merchantChangeApi()
  412. this.popShow = false;
  413. },
  414. // 设备数据监测
  415. getHomePageManageChildMeter(item,bl) {
  416. // if(!bl){
  417. // uni.showLoading({
  418. // title: "加载中",
  419. // mask: true,
  420. // })
  421. // }
  422. API2.homePageManageChildMeter({
  423. parentMeterId:item.id,
  424. queryDate:this.queryDate,
  425. companyId: this.companyId,
  426. type: this.list[this.homePageManageType].value
  427. }).then((response) => {
  428. // if(!bl){
  429. // uni.hideLoading();
  430. // }
  431. // this.meterList = response.data.meterList;
  432. // if(!this.meterListShow.id){
  433. // this.meterListShow.id=1
  434. // this.recursionList(this.meterList)
  435. // }
  436. var childMeterList=response.data.childMeterList
  437. item.childMeterList=childMeterList
  438. if(!bl){
  439. for(var i in childMeterList){
  440. var obj=childMeterList[i]
  441. this.getHomePageManageChildMeter(obj,true)
  442. }
  443. }
  444. }).catch(error => {
  445. uni.showToast({
  446. title: error,
  447. icon: "none"
  448. })
  449. })
  450. },
  451. getIncomeExpenditure(){
  452. API2.incomeExpenditure({
  453. //parentMeterId:item.id,
  454. queryDate:this.queryDate,
  455. companyId: this.companyId,
  456. type: this.list[this.homePageManageType].value
  457. }).then((response) => {
  458. this.incomeExpenditureObj=response.data
  459. this.incomeExpenditureObj.id=1
  460. }).catch(error => {
  461. uni.showToast({
  462. title: error,
  463. icon: "none"
  464. })
  465. })
  466. },
  467. // 设备数据监测
  468. // 设备数据监测
  469. getHomePageManage(bl) {
  470. this.getHomePageManageReady=false
  471. if(bl){
  472. this.getHomePageManageshowLoading=false
  473. }else{
  474. uni.showLoading({
  475. title: "加载中",
  476. mask: true,
  477. })
  478. }
  479. // uni.showLoading({
  480. // title: "加载中",
  481. // mask: true,
  482. // })
  483. this.incomeExpenditureObj={}
  484. API2.homePageManage({
  485. queryDate:this.queryDate,
  486. companyId: this.companyId,
  487. type: this.list[this.homePageManageType].value
  488. }).then((response) => {
  489. //uni.hideLoading();
  490. this.getHomePageManageReady=true
  491. if(bl){
  492. this.getHomePageManageshowLoading=true
  493. }else{
  494. uni.hideLoading();
  495. }
  496. this.utabsone=true;
  497. this.codes =this.carhelp.getPersonInfo().codes;
  498. this.meterList = response.data.meterList;
  499. // this.$nextTick(()=>{
  500. // this.$refs.mytree.toggle()
  501. // })
  502. this.homePageManageObj = response.data;
  503. if(this.companyType!=4&&this.homePageManageObj.showPark){
  504. this.$nextTick(()=>{
  505. this.myBarChart=null;
  506. this.getBarCharts()
  507. })
  508. this.getIncomeExpenditure();
  509. }
  510. }).catch(error => {
  511. uni.showToast({
  512. title: error,
  513. icon: "none"
  514. })
  515. })
  516. },
  517. sectionChange(index) {
  518. this.clickType = this.homePageManageType;
  519. this.homePageManageType = index;
  520. if (index == 5) {
  521. this.tabsFrom.show2 = true;
  522. this.params.day = false;
  523. } else {
  524. this.list[5].name = '指定月份'
  525. this.getHomePageManage()
  526. }
  527. },
  528. recursionList(list){
  529. if(list){
  530. for(var i in list){
  531. var obj=list[i]
  532. this.meterListShow[obj.id]=false
  533. this.recursionList(obj.childMeterList)
  534. }
  535. }
  536. },
  537. ifBtnShow(item){
  538. return this.meterListShow[item.id]
  539. },
  540. showBtn(item){
  541. var key=this.meterListShow[item.id];
  542. this.$set(this.meterListShow,item.id,!key)
  543. console.log("showBtn,",key)
  544. this.getHomePageManageChildMeter(item);
  545. this.$forceUpdate()
  546. },
  547. selector2reset(e) {
  548. console.log(e)
  549. this.tabsFrom.show2Text = '全部时间'
  550. this.tabsFrom.show2Index = '';
  551. if (e.day) {
  552. this.queryDate = parseUnixTime(new Date(), '{y}-{m}-{d}');
  553. this.getHomePageManage();
  554. } else {
  555. this.homePageManageType = this.clickType;
  556. if (this.homePageManageType != 5) {
  557. this.list[5].name = '指定月份';
  558. }
  559. this.getHomePageManage();
  560. }
  561. },
  562. selector2cancel() {
  563. if(this.clickType != -1) {
  564. }
  565. this.homePageManageType = this.clickType;
  566. },
  567. selector2confirm(e) {
  568. this.tabsFrom.show2Text = e.year + "年" + e.month + "月"
  569. this.tabsFrom.show2Index = e.year + "-" + e.month
  570. if (e.day) {
  571. this.tabsFrom.show2Text += e.day + "日"
  572. this.tabsFrom.show2Index += '-' + e.day
  573. this.queryDateMethod(this.tabsFrom.show2Index, true)
  574. } else {
  575. this.queryDateMethod(this.tabsFrom.show2Index, false)
  576. }
  577. },
  578. queryDateMethod(queryTime, day) {
  579. if (day) {
  580. this.queryDate = queryTime;
  581. } else {
  582. this.queryDate = queryTime + "-01";
  583. this.homePageManageType = "5";
  584. this.list[5].name = queryTime;
  585. this.getHomePageManage();
  586. }
  587. },
  588. getBarCharts() {
  589. if (!this.myBarChart) {
  590. this.myBarChart = echarts.init(document.getElementById('barEcharts-statistics'),null,{
  591. width:uni.upx2px(620),height:uni.upx2px(740)
  592. });
  593. }
  594. this.myBarChart.clear()
  595. var data=[
  596. {
  597. name:"总表电量",
  598. key:"parkKwh",
  599. color:"#307af6"
  600. },
  601. {
  602. name:"计费电量",
  603. key:"chargeKwh",
  604. color:"#52b8aa"
  605. },
  606. {
  607. name:"自用电量",
  608. key:"freeKwh",
  609. color:"#53b56b"
  610. },
  611. {
  612. name:"公用电量",
  613. key:"publicKwh",
  614. color:"#ef8132"
  615. },
  616. {
  617. name:"电损量",
  618. key:"lostKwh",
  619. color:"#dc4441"
  620. }
  621. ]
  622. var dataName=[]
  623. var dataSeries=[]
  624. for(var i in data){
  625. var it=data[i]
  626. dataName.push(it.name)
  627. dataSeries.push({})
  628. }
  629. for(var i in data){
  630. var it=data[i]
  631. dataSeries[data.length-i-1]={
  632. name:it.name,
  633. type: 'bar',
  634. itemStyle:{
  635. color:it.color
  636. },
  637. data: [
  638. this.homePageManageObj[it.key]
  639. ],
  640. coordinateSystem: 'polar',
  641. label: {
  642. show: true,
  643. position: 'start',
  644. formatter: '{c}度'
  645. }
  646. }
  647. }
  648. var option = {
  649. polar: {
  650. center:['50%','58%'],
  651. radius:[25, '80%']
  652. },
  653. angleAxis: {
  654. startAngle: 75,
  655. label: {
  656. rotate: 45, // 旋转标签,使得重叠的概率降低
  657. // margin: 5 // 设置标签与轴线之间的距离,增加空间
  658. }
  659. },
  660. legend: {
  661. itemGap:5,
  662. data: dataName,
  663. //orient :'vertical'
  664. },
  665. radiusAxis: {
  666. type: 'category',
  667. data: ['']
  668. },
  669. tooltip: {},
  670. series: dataSeries
  671. };
  672. console.log(option)
  673. this.myBarChart.setOption(option);
  674. },
  675. merchantChangeApi() {
  676. this.popShow=false
  677. this.getList(true)
  678. },
  679. change(index) {
  680. this.current = index;
  681. this.current2=0;
  682. this.childList=[]
  683. var company= this.merchantList1[index]
  684. if(company.id!=''){
  685. this.childList=company.childList;
  686. if(this.childList&&this.childList.length){
  687. this.companyId = this.childList[0].id;
  688. this.childInfo=this.childList[0]
  689. }else{
  690. this.childList=[]
  691. this.companyId =company.id
  692. this.childInfo=company
  693. }
  694. }else{
  695. this.companyId =''
  696. }
  697. this.companyInfo=company;
  698. this.merchantChangeApi()
  699. },
  700. backStatistics() {
  701. uni.navigateBack()
  702. },
  703. toElectronicMonitoring(item) {
  704. uni.navigateTo({
  705. url: '/pages/equipmentDataMonitoring/electronicMonitoringWater?id=' + item.id + '&name=' + item
  706. .name +
  707. '&companyId=' + item.companyId
  708. })
  709. }
  710. }
  711. }
  712. </script>
  713. <style lang="scss" scoped>
  714. .incomeExpenditureClass{
  715. display: flex;
  716. justify-content: space-evenly;
  717. width: 100%;
  718. padding:32rpx 0;
  719. .income1:last-child{
  720. .income11,.income12{
  721. border-right: 1px solid #c5c3c3;
  722. }
  723. }
  724. .income1{
  725. .income121{
  726. font-size: 24rpx;
  727. color:#c5c3c3;
  728. }
  729. width: 33.33%;
  730. text-align: center;
  731. .income11{
  732. padding:12rpx 0;
  733. background-color: #1677FF ;
  734. color:#fff;
  735. // font-size: 36rpx;
  736. font-size: 32rpx;
  737. border-top: 1px solid #c5c3c3;
  738. border-left: 1px solid #c5c3c3;
  739. }
  740. .income12{
  741. padding:12rpx 0;
  742. border-top: 1px solid #c5c3c3;
  743. border-bottom: 1px solid #c5c3c3;
  744. border-left: 1px solid #c5c3c3;
  745. font-size: 40rpx;
  746. }
  747. }
  748. }
  749. .back {
  750. z-index: 999;
  751. width: 200rpx;
  752. }
  753. /deep/.u-drawer-content {
  754. margin-top: 88rpx;
  755. }
  756. // /deep/.u-tab-item {
  757. // width: 25% !important;
  758. // flex: none !important;
  759. // }
  760. .tabs-box {
  761. background-color: #fff;
  762. display: flex;
  763. align-items: center;
  764. padding-right: 32rpx;
  765. justify-content: space-between;
  766. border-bottom: 1px solid rgba(232, 232, 232, 1);
  767. .tabs {
  768. width: 97%;
  769. }
  770. .more{
  771. padding-right: 12rpx;
  772. }
  773. .icon {
  774. margin-left: auto;
  775. margin-right: 24rpx;
  776. }
  777. }
  778. .tabs-len-1{
  779. }
  780. .tabs-len-2{
  781. /deep/.u-tab-item {
  782. // max-width: 39% !important;
  783. // flex: none !important;
  784. }
  785. }
  786. .tabs-len-3{
  787. /deep/.u-tab-item {
  788. max-width: 39% !important;
  789. flex: none !important;
  790. }
  791. }
  792. .tabs-len-4{
  793. /deep/.u-tab-item {
  794. max-width: 26% !important;
  795. flex: none !important;
  796. }
  797. }
  798. /deep/.u-tab-item:first-child {
  799. width: 20% !important;
  800. flex: none !important;
  801. }
  802. .popup-tabs {
  803. background-color: #fff;
  804. display: flex;
  805. align-items: center;
  806. justify-content: space-between;
  807. padding-right: 32rpx;
  808. color: rgba(51, 51, 51, 1);
  809. font-size: 32rpx;
  810. padding-top: 32rpx;
  811. .tabs {
  812. width: 88%;
  813. }
  814. }
  815. .tabs-options {
  816. display: flex;
  817. padding: 64rpx 32rpx 0;
  818. flex-wrap: wrap;
  819. .item {
  820. width: 25%;
  821. margin-bottom: 40rpx;
  822. }
  823. }
  824. // 用电量合计
  825. .total {
  826. padding: 24rpx 32rpx;
  827. background: linear-gradient(90deg, rgba(49, 110, 207, 1) 2%, rgba(37, 138, 255, 1) 100%);
  828. .company {
  829. display: flex;
  830. align-items: center;
  831. justify-content: space-between;
  832. .name {
  833. color: rgba(255, 255, 255, 1);
  834. font-size: 36rpx;
  835. font-weight: bold;
  836. }
  837. .amount {
  838. color: #f2f4f6;
  839. margin-top: 4rpx;
  840. }
  841. }
  842. .infos {
  843. display: flex;
  844. justify-content: space-between;
  845. align-items: center;
  846. margin-top: 4rpx;
  847. width: 93%;
  848. .infos-item {
  849. display: flex;
  850. width: 33.3%;
  851. .number {
  852. color: rgba(255, 255, 255, 1);
  853. font-size: 32rpx;
  854. font-weight: bold;
  855. margin-left: 8rpx;
  856. }
  857. .time {
  858. color: #f2f4f6;
  859. }
  860. }
  861. }
  862. }
  863. // 用电量
  864. .main {
  865. background-color: #fff;
  866. padding: 26rpx 32rpx;
  867. .item:last-of-type {
  868. border: none;
  869. }
  870. .item {
  871. padding: 16rpx 0;
  872. display: flex;
  873. align-items: center;
  874. justify-content: space-between;
  875. border-bottom: 1px solid rgba(245, 245, 245, 1);
  876. .item-content {
  877. width: 93%;
  878. }
  879. .equipment {
  880. display: flex;
  881. align-items: center;
  882. .equipment1 {
  883. color: rgba(51, 51, 51, 1);
  884. font-size: 32rpx;
  885. max-width: 40%;
  886. font-weight: bold;
  887. white-space: nowrap;
  888. overflow: hidden;
  889. text-overflow: ellipsis;
  890. }
  891. .equipment2 {
  892. color: rgba(119, 119, 119, 1);
  893. margin-left: 16rpx;
  894. max-width: 40%;
  895. white-space: nowrap;
  896. overflow: hidden;
  897. text-overflow: ellipsis;
  898. }
  899. }
  900. // 状态
  901. .state {
  902. display: flex;
  903. align-items: center;
  904. color: rgba(255, 123, 0, 1);
  905. margin-left: auto;
  906. .dot {
  907. margin-right: 8rpx;
  908. width: 16rpx;
  909. height: 16rpx;
  910. background-color: rgba(255, 123, 0, 1);
  911. border-radius: 999px;
  912. margin-left: auto;
  913. }
  914. .off-line {
  915. background-color: rgba(255, 123, 0, 1);
  916. }
  917. .on-line {
  918. background-color: rgba(0, 185, 98, 1);
  919. }
  920. }
  921. .state2 {
  922. color: rgba(0, 185, 98, 1);
  923. }
  924. .electricity {
  925. display: flex;
  926. justify-content: space-between;
  927. align-items: center;
  928. margin-top: 8rpx;
  929. text-align: center;
  930. .electricity-item {
  931. display: flex;
  932. align-items: center;
  933. width: 33.3%;
  934. .number {
  935. color: rgba(51, 51, 51, 1);
  936. font-weight: bold;
  937. font-size: 32rpx;
  938. margin-left: 8rpx;
  939. }
  940. .date {
  941. color: rgba(119, 119, 119, 1);
  942. }
  943. }
  944. }
  945. }
  946. }
  947. .statistics-manage {
  948. border-radius: 8px;
  949. background-color: rgba(255, 255, 255, 1);
  950. box-shadow: 0px 1px 6px 0px rgba(0, 59, 142, 0.05);
  951. margin: 32rpx;
  952. padding: 40rpx 0;
  953. .title,
  954. .chart,
  955. .search,
  956. .meter-statistic {
  957. padding: 0 32rpx;
  958. }
  959. // 图表
  960. .chart {
  961. /deep/.u-subsection {
  962. padding: 2px;
  963. }
  964. /deep/.u-item {
  965. padding: 0;
  966. font-size: 24rpx
  967. }
  968. .chat-box {
  969. //margin-top: 24rpx;
  970. width: 100%;
  971. //height: 480rpx;
  972. img {
  973. width: 100%;
  974. height: 100%;
  975. }
  976. }
  977. }
  978. .search {
  979. border-top: 1px solid rgba(242, 242, 242, 1);
  980. border-bottom: 1px solid rgba(242, 242, 242, 1);
  981. display: flex;
  982. align-items: center;
  983. justify-content: space-between;
  984. padding: 40rpx 32rpx;
  985. .switch {
  986. display: flex;
  987. align-items: center;
  988. text {
  989. margin-left: 8rpx;
  990. color: rgba(51, 51, 51, 1);
  991. }
  992. }
  993. .search-box {
  994. border-radius: 50px;
  995. background-color: rgba(242, 244, 246, 1);
  996. color: rgba(136, 136, 136, 1);
  997. height: 56rpx;
  998. line-height: 56rpx;
  999. padding-left: 16rpx;
  1000. padding-right: 8rpx;
  1001. flex: 1;
  1002. margin-left: 28rpx;
  1003. display: flex;
  1004. align-items: center;
  1005. justify-content: space-between;
  1006. uni-input {
  1007. height: 56rpx;
  1008. line-height: 56rpx !important;
  1009. font-size: 28rpx;
  1010. width: 75%;
  1011. }
  1012. .icon {
  1013. display: flex;
  1014. align-items: center;
  1015. justify-content: center;
  1016. width: 64rpx;
  1017. height: 40rpx;
  1018. border-radius: 50px;
  1019. background-color: rgba(22, 119, 255, 1);
  1020. }
  1021. }
  1022. }
  1023. }
  1024. .meter-statistic {
  1025. margin-top: 32rpx;
  1026. .meter-statistic-main{
  1027. display: flex;
  1028. align-items: center;
  1029. }
  1030. .sum {
  1031. .meter-name {
  1032. color: rgba(51, 51, 51, 1);
  1033. font-size: 32rpx;
  1034. margin-left: 8rpx;
  1035. font-weight: bold;
  1036. }
  1037. .icon {
  1038. margin-right: 8rpx;
  1039. img {
  1040. width: 40rpx;
  1041. height: 40rpx;
  1042. vertical-align: middle;
  1043. }
  1044. }
  1045. .meter-state {
  1046. margin-left: 8rpx;
  1047. width: 64rpx;
  1048. height: 36rpx;
  1049. line-height: 36rpx;
  1050. border-radius: 4px;
  1051. background-color: rgba(255, 255, 255, 1);
  1052. color: rgba(0, 185, 98, 1);
  1053. font-size: 22rpx;
  1054. text-align: center;
  1055. border: 1px solid rgba(0, 185, 98, 1);
  1056. }
  1057. .meter-state2 {
  1058. border: 1px solid rgba(255, 123, 0, 1);
  1059. color: rgba(255, 123, 0, 1);
  1060. }
  1061. .meter-number {
  1062. margin-left: auto;
  1063. color: rgba(51, 51, 51, 1);
  1064. font-size: 32rpx;
  1065. /deep/.u-icon--right {
  1066. margin-left: 8rpx;
  1067. }
  1068. }
  1069. }
  1070. .sum2 {
  1071. padding: 0 32rpx;
  1072. margin-top: 8rpx;
  1073. display: flex;
  1074. align-items: center;
  1075. justify-content: space-between;
  1076. .title {
  1077. color: rgba(119, 119, 119, 1);
  1078. }
  1079. .value {
  1080. color: rgba(119, 119, 119, 1);
  1081. }
  1082. }
  1083. .first-level-list{
  1084. width: 100%;
  1085. display: flex;
  1086. align-items: center;
  1087. }
  1088. // 一级表
  1089. .first-level {
  1090. padding-left: 32rpx;
  1091. margin-top: 20rpx;
  1092. .meter-name {
  1093. font-size: 28rpx
  1094. }
  1095. }
  1096. // 二级表
  1097. .second-level {
  1098. padding-left: 64rpx;
  1099. margin-top: 20rpx;
  1100. .meter-name {
  1101. font-size: 24rpx
  1102. }
  1103. }
  1104. .else-switch {
  1105. padding-left: 144rpx;
  1106. .meter-name {
  1107. font-size: 24rpx
  1108. }
  1109. .item {
  1110. margin-top: 24rpx;
  1111. }
  1112. }
  1113. }
  1114. .electronicMonitoring-title{
  1115. display: flex;
  1116. align-items: center;
  1117. padding: 0px 32rpx;
  1118. justify-content: space-between;
  1119. height: 120rpx;
  1120. font-size: 36rpx;
  1121. background: linear-gradient(88.25deg, rgba(31,85,255,1) 0.65%,rgba(39,171,255,1) 99.34%);
  1122. color:#fff;
  1123. }
  1124. </style>