electricityAudit.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <template>
  2. <div class="main">
  3. <template v-if="!showDialog">
  4. <div class="search">
  5. <el-select v-model="mixins_query.communityId" placeholder="选择社区" clearable>
  6. <el-option v-for="(item, index) in communityArr" :key="index" :label="item.communityName" :value="item.id"></el-option>
  7. </el-select>
  8. <el-date-picker
  9. v-model="times"
  10. value-format="yyyy-MM-dd"
  11. type="daterange"
  12. range-separator="至"
  13. start-placeholder="选择开始日期"
  14. end-placeholder="选择结束日期"
  15. @change="effectiveDateToggle"
  16. ></el-date-picker>
  17. <el-button type="primary" class="search-btn" @click="mixins_search" icon="el-icon-search">查询 </el-button>
  18. </div>
  19. <zz-table
  20. :cols="cols"
  21. :settings="{ showIndex: true, stripe: true }"
  22. :loading="mixins_onQuery"
  23. :data="mixins_list"
  24. :pageset="mixins_pageset"
  25. @page-change="pageChange"
  26. >
  27. <template slot="settledateRange" slot-scope="scope">
  28. <span>{{ timeformat(scope.row.clearingStartDate) }} - {{ timeformat(scope.row.clearingEndDate) }}</span>
  29. </template>
  30. <template slot-scope="scope" slot="auditNumberPercent">
  31. <div class="progress_clickzone">
  32. <el-progress
  33. :stroke-width="6"
  34. color="#29B6FF"
  35. :percentage="
  36. scope.row.numberOfWaterMetersReviewed > 0
  37. ? (scope.row.numberOfWaterMetersReviewed / scope.row.totalWaterMeters).toFixed(2) * 100
  38. : 0
  39. "
  40. ></el-progress>
  41. </div>
  42. </template>
  43. <template slot-scope="scope" slot="opt">
  44. <div class="opt">
  45. <el-tooltip class="item" effect="light" placement="bottom" content="审核">
  46. <i class="zoniot_font zoniot-icon-yanshou" @click="lookPage(scope.row)"></i>
  47. </el-tooltip>
  48. </div>
  49. </template>
  50. </zz-table>
  51. </template>
  52. <auditnum :params="dialogParams" :userinfo="userinfo" v-else @close="showDialog = false"></auditnum>
  53. </div>
  54. </template>
  55. <script>
  56. import list from '@utils/list.js';
  57. import auditnum from './setPage/auditnum';
  58. export default {
  59. mixins: [list],
  60. components: {
  61. auditnum
  62. },
  63. data() {
  64. return {
  65. showDialog: false,
  66. dialogParams: {},
  67. cols: [
  68. {
  69. label: '所属社区',
  70. prop: 'communityName'
  71. },
  72. {
  73. label: '计量周期',
  74. prop: 'settledateRange',
  75. slot: 'settledateRange'
  76. },
  77. {
  78. label: '电表数量',
  79. prop: 'totalWaterMeters'
  80. },
  81. {
  82. label: '审核',
  83. prop: 'auditNumberPercent',
  84. slot: 'auditNumberPercent'
  85. },
  86. {
  87. label: '操作',
  88. prop: 'id',
  89. slot: 'opt'
  90. }
  91. ],
  92. mixins_post: 'post',
  93. communityArr: [],
  94. times: []
  95. };
  96. },
  97. created() {
  98. this.getorgTree();
  99. this.mixins_dataUrl = '/sc-energy/measurementInstance/page';
  100. this.mixins_query.type = 2;
  101. this.mixins_search();
  102. },
  103. mounted() {},
  104. methods: {
  105. getorgTree() {
  106. this.$http
  107. .get('/sc-community/assets/community/list')
  108. .then((data) => {
  109. this.communityArr = data.data;
  110. this.$store.commit('setAreaSelect', data.data);
  111. })
  112. .catch(function () {});
  113. },
  114. timeformat(val) {
  115. return this.$moment(val).format('YYYY-MM-DD HH:mm:ss');
  116. },
  117. effectiveDateToggle(va) {
  118. let arr = va;
  119. if (!arr) {
  120. arr = ['', ''];
  121. }
  122. this.mixins_query.clearingStartDate = !!arr[0] ? arr[0] : null;
  123. this.mixins_query.clearingEndDate = !!arr[1] ? arr[1] + 'T23:59:59' : '';
  124. },
  125. lookPage(row) {
  126. this.showDialog = true;
  127. this.dialogParams = row;
  128. }
  129. }
  130. };
  131. </script>
  132. <style scoped lang='scss'>
  133. @import '@assets/css/public-style.scss';
  134. .search {
  135. .zz-tab-button {
  136. margin-right: 20px;
  137. }
  138. }
  139. </style>