waterChargeDetails.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. <template>
  2. <div class="main">
  3. <div class="search">
  4. <el-select v-model="mixins_query.communityId" placeholder="选择社区" clearable>
  5. <el-option v-for="(item, index) in communityArr" :key="index" :label="item.communityName" :value="item.id"></el-option>
  6. </el-select>
  7. <el-date-picker
  8. v-model="times"
  9. value-format="yyyy-MM-dd"
  10. type="daterange"
  11. range-separator="至"
  12. start-placeholder="选择开始日期"
  13. end-placeholder="选择结束日期"
  14. @change="effectiveDateToggle"
  15. ></el-date-picker>
  16. <el-button type="primary" class="search-btn" @click="initPageData" icon="el-icon-search">查询 </el-button>
  17. <div class="search-icon">
  18. <el-tooltip class="item" effect="light" placement="bottom" content="导出">
  19. <i class="zoniot_font zoniot-icon-daochu2" @click="exportExcel"></i>
  20. </el-tooltip>
  21. </div>
  22. </div>
  23. <div class="search_bottom_tab">
  24. <div
  25. class="tab_list"
  26. v-for="(item, index) in tabs"
  27. @click="toggle(index + 1)"
  28. :class="activeIndex == index + 1 ? 'active' : ''"
  29. :key="index"
  30. >
  31. {{ item.label }}{{ item.value }}元
  32. </div>
  33. </div>
  34. <zz-table
  35. :cols="activeIndex == 1 ? cols : statusCols"
  36. :settings="{ showIndex: true, stripe: true }"
  37. :loading="mixins_onQuery"
  38. :data="mixins_list"
  39. :pageset="mixins_pageset"
  40. @page-change="pageChange"
  41. >
  42. </zz-table>
  43. </div>
  44. </template>
  45. <script>
  46. import list from '@utils/list.js';
  47. export default {
  48. mixins: [list],
  49. data() {
  50. return {
  51. cols: [
  52. {
  53. label: '社区名称',
  54. prop: 'communityName'
  55. },
  56. {
  57. label: '房间',
  58. prop: 'assets'
  59. },
  60. {
  61. label: '充值时间',
  62. prop: 'createDate'
  63. },
  64. {
  65. label: '充值方式',
  66. prop: 'paymentMethod',
  67. format(val) {
  68. if (val == '1') {
  69. return '微信';
  70. } else if (val == '2') {
  71. return '支付宝';
  72. } else if (val == '3') {
  73. return '现金';
  74. } else if (val == '4') {
  75. return '预存';
  76. } else if (val == '5') {
  77. return '其他';
  78. }
  79. }
  80. },
  81. {
  82. label: '充值人姓名',
  83. prop: 'userName'
  84. },
  85. {
  86. label: '手机号',
  87. prop: 'phone'
  88. },
  89. {
  90. label: '充值金额(元)',
  91. prop: 'amount'
  92. },
  93. {
  94. label: '备注',
  95. prop: 'remark'
  96. }
  97. ],
  98. statusCols: [
  99. {
  100. label: '社区名称',
  101. prop: 'communityName'
  102. },
  103. {
  104. label: '房间',
  105. prop: 'assets'
  106. },
  107. {
  108. label: '扣费时间',
  109. prop: 'createDate'
  110. },
  111. {
  112. label: '上期读数',
  113. prop: 'previousReading'
  114. },
  115. {
  116. label: '本期读数',
  117. prop: 'currentReading'
  118. },
  119. {
  120. label: '用水量(吨)',
  121. prop: 'volume'
  122. },
  123. {
  124. label: '扣费金额(元)',
  125. prop: 'amount'
  126. }
  127. ],
  128. tabs: [
  129. {
  130. label: '充值金额:',
  131. value: '0'
  132. },
  133. {
  134. label: '扣费金额:',
  135. value: '0'
  136. }
  137. ],
  138. activeIndex: 1,
  139. mixins_post: 'post',
  140. times: [],
  141. communityArr: []
  142. };
  143. },
  144. created() {
  145. this.mixins_dataUrl = '/sc-charge/payment/record/page';
  146. this.mixins_query = {
  147. accountType: 2,
  148. paymentType: 1
  149. };
  150. this.initPageData();
  151. this.getorgTree();
  152. },
  153. mounted() {},
  154. methods: {
  155. toggle(index) {
  156. this.activeIndex = index;
  157. this.mixins_query.paymentType = index;
  158. this.mixins_search();
  159. },
  160. initPageData() {
  161. this.getSun(1);
  162. this.getSun(2);
  163. this.mixins_search();
  164. },
  165. getSun(type) {
  166. debugger;
  167. this.$http
  168. .post('/sc-charge/payment/record/sum/amount', {
  169. accountType: 2,
  170. paymentType: type,
  171. communityId: this.mixins_query.communityId,
  172. endTime: this.mixins_query.endTime,
  173. startTime: this.mixins_query.startTime
  174. })
  175. .then(({ data, status, msg }) => {
  176. if (status == 0) {
  177. if (type == 1) {
  178. this.tabs[0].value = data;
  179. } else if (type == 2) {
  180. this.tabs[1].value = data;
  181. }
  182. } else {
  183. this.$message.error(msg);
  184. }
  185. })
  186. .catch(() => {});
  187. },
  188. exportExcel() {
  189. this.__exportExcel('/sc-charge/payment/record/export/excel', this.mixins_query);
  190. },
  191. effectiveDateToggle(va) {
  192. let arr = va;
  193. if (!arr) {
  194. arr = ['', ''];
  195. }
  196. this.mixins_query.startTime = !!arr[0] ? arr[0] + ' 00:00:00' : '';
  197. this.mixins_query.endTime = !!arr[1] ? arr[1] + ' 23:59:59' : '';
  198. },
  199. getorgTree() {
  200. this.$http
  201. .get('/sc-community/assets/community/list')
  202. .then((data) => {
  203. this.communityArr = data.data;
  204. this.$store.commit('setAreaSelect', data.data);
  205. })
  206. .catch(function () {});
  207. }
  208. }
  209. };
  210. </script>
  211. <style scoped lang='scss'>
  212. @import '@assets/css/public-style.scss';
  213. .search_bottom_tab {
  214. height: 60px;
  215. line-height: 60px;
  216. background: #ffffff;
  217. border-radius: 4px;
  218. margin-bottom: 20px;
  219. padding: 0 20px;
  220. box-sizing: border-box;
  221. .tab_list {
  222. display: inline-block;
  223. border-bottom: 1px solid transparent;
  224. cursor: pointer;
  225. color: #424656;
  226. &:not(:last-child) {
  227. margin-right: 40px;
  228. }
  229. &.active {
  230. color: $mainTextColor;
  231. border-color: $mainTextColor;
  232. }
  233. }
  234. }
  235. </style>