RechargeRecord.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. <template>
  2. <div class="main">
  3. <div class="search">
  4. <el-input
  5. clearable
  6. placeholder="输入用户名字/手机号码"
  7. class="search-input"
  8. v-trim
  9. v-model.trim="mixins_query.likeName"
  10. ></el-input>
  11. <el-select
  12. class="width65"
  13. placeholder="充值方式"
  14. v-model="mixins_query.paymentMethod"
  15. clearable
  16. >
  17. <el-option
  18. label="微信"
  19. :value="7"
  20. ></el-option>
  21. <el-option
  22. label="支付宝"
  23. :value="2"
  24. ></el-option>
  25. <el-option
  26. label="现金"
  27. :value="3"
  28. ></el-option>
  29. <el-option
  30. label="预存"
  31. :value="4"
  32. ></el-option>
  33. <el-option
  34. label="其他"
  35. :value="5"
  36. ></el-option>
  37. </el-select>
  38. <el-date-picker
  39. v-model="times"
  40. value-format="yyyy-MM-dd"
  41. type="daterange"
  42. range-separator="至"
  43. start-placeholder="选择开始日期"
  44. end-placeholder="选择结束日期"
  45. @change="effectiveDateToggle"
  46. ></el-date-picker>
  47. <el-button
  48. type="primary"
  49. class="search-btn"
  50. @click="mixins_search"
  51. icon="el-icon-search"
  52. >查询 </el-button>
  53. <div class="search-icon">
  54. <el-tooltip
  55. class="item"
  56. effect="light"
  57. placement="bottom"
  58. content="返回"
  59. >
  60. <i
  61. class="zoniot_font zoniot-icon-fanhui"
  62. @click="close()"
  63. ></i>
  64. </el-tooltip>
  65. </div>
  66. </div>
  67. <div class="table-top">
  68. <div class="name">
  69. {{ name }} <span class="totle">充值总金额:{{ balance || '-' }} 元</span>
  70. </div>
  71. </div>
  72. <div class="roles-wrap">
  73. <zz-table
  74. :cols="cols"
  75. :settings="{ showIndex: true, stripe: true }"
  76. :loading="mixins_onQuery"
  77. :data="mixins_list"
  78. :pageset="mixins_pageset"
  79. @page-change="pageChange"
  80. >
  81. </zz-table>
  82. </div>
  83. </div>
  84. </template>
  85. <script>
  86. import list from '@utils/list.js';
  87. export default {
  88. mixins: [list],
  89. props: ['params'],
  90. name: 'RechargeRecord',
  91. data () {
  92. return {
  93. cols: [
  94. {
  95. label: '充值时间',
  96. prop: 'createDate'
  97. },
  98. {
  99. label: '充值人姓名',
  100. prop: 'userName'
  101. },
  102. {
  103. label: '手机号',
  104. prop: 'phone'
  105. },
  106. {
  107. label: '充值方式',
  108. prop: 'paymentMethod',
  109. format (val) {
  110. if (val == '7') {
  111. return '微信';
  112. } else if (val == '2') {
  113. return '支付宝';
  114. } else if (val == '3') {
  115. return '现金';
  116. } else if (val == '4') {
  117. return '预存';
  118. } else if (val == '5') {
  119. return '其他';
  120. }
  121. }
  122. },
  123. {
  124. label: '充值金额(元)',
  125. prop: 'amount'
  126. },
  127. {
  128. label: '水费余额(元)',
  129. prop: 'balance'
  130. },
  131. {
  132. label: '备注',
  133. prop: 'remark'
  134. }
  135. ],
  136. mixins_post: 'post',
  137. publicData: {},
  138. times: '',
  139. balance: '',
  140. name: ''
  141. };
  142. },
  143. created () {
  144. this.mixins_dataUrl = '/czc-charge/payment/record/page';
  145. if (this.$route.query || this.params) {
  146. const { accountType, name, paymentType, id } = this.params || this.$route.query;
  147. let typeName = '水';
  148. if (accountType == 1) {
  149. typeName = '物业';
  150. } else if (accountType == 2) {
  151. typeName = '水';
  152. } else if (accountType == 3) {
  153. typeName = '电';
  154. }
  155. this.cols[5].label = typeName + '费余额(元)';
  156. this.name = name;
  157. this.publicData = {
  158. accountType: accountType,
  159. paymentType: paymentType,
  160. houseId: id
  161. };
  162. this.mixins_query = this.publicData;
  163. this.getSun();
  164. this.mixins_search();
  165. }
  166. },
  167. mounted () { },
  168. methods: {
  169. close () {
  170. this.$parent.viewActive = 'index';
  171. // let activeRout = this.$route;
  172. // let tagsList = this.$store.getters['getTagsList'];
  173. // tagsList.forEach((item, index) => {
  174. // if (item.title == activeRout.meta.title || item.path == activeRout.path) {
  175. // tagsList.splice(index, 1);
  176. // history.go(-1);
  177. // return true;
  178. // }
  179. // });
  180. },
  181. getSun () {
  182. this.$http
  183. .post('/czc-charge/payment/record/sum/amount', this.publicData)
  184. .then(({ data, status, msg }) => {
  185. if (status == 0) {
  186. this.balance = data;
  187. } else {
  188. this.$message.error(msg);
  189. }
  190. })
  191. .catch(() => { });
  192. },
  193. effectiveDateToggle (va) {
  194. let arr = va;
  195. if (!arr) {
  196. arr = ['', ''];
  197. }
  198. this.mixins_query.startTime = arr[0] + ' 00:00:00';
  199. this.mixins_query.endTime = arr[1] + ' 23:59:59';
  200. }
  201. }
  202. };
  203. </script>
  204. <style scoped lang='scss'>
  205. @import '@assets/css/public-style.scss';
  206. .table-top {
  207. width: 1660px;
  208. height: 60px;
  209. line-height: 60px;
  210. background: #ffffff;
  211. font-size: 16px;
  212. border-radius: 4px;
  213. margin-bottom: 20px;
  214. padding-left: 20px;
  215. color: #424656;
  216. .totle {
  217. font-size: 12px;
  218. margin-left: 40px;
  219. }
  220. }
  221. </style>