ChargebackRecord.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <template>
  2. <div class="main">
  3. <div class="search">
  4. <el-date-picker
  5. v-model="times"
  6. value-format="yyyy-MM-dd"
  7. type="daterange"
  8. range-separator="至"
  9. start-placeholder="选择开始日期"
  10. end-placeholder="选择结束日期"
  11. @change="effectiveDateToggle"
  12. ></el-date-picker>
  13. <el-button type="primary" class="search-btn" @click="mixins_search" icon="el-icon-search">查询 </el-button>
  14. </div>
  15. <div class="table-top">
  16. <div class="name">
  17. {{ name }} <span class="totle">扣费总金额:{{ balance || '-' }} 元</span>
  18. </div>
  19. </div>
  20. <div class="roles-wrap">
  21. <zz-table
  22. :cols="cols"
  23. :settings="{ showIndex: true, stripe: true }"
  24. :loading="mixins_onQuery"
  25. :data="mixins_list"
  26. :pageset="mixins_pageset"
  27. @page-change="pageChange"
  28. >
  29. </zz-table>
  30. </div>
  31. </div>
  32. </template>
  33. <script>
  34. import list from '@utils/list.js';
  35. export default {
  36. mixins: [list],
  37. data() {
  38. return {
  39. cols: [
  40. {
  41. label: '扣费时间',
  42. prop: 'createDate'
  43. },
  44. {
  45. label: '上期读数',
  46. prop: 'previousReading'
  47. },
  48. {
  49. label: '本期读数',
  50. prop: 'currentReading'
  51. },
  52. {
  53. label: '用水量(吨)',
  54. prop: 'volume'
  55. },
  56. {
  57. label: '扣费金额(元)',
  58. prop: 'amount'
  59. },
  60. {
  61. label: '水费余额(元)',
  62. prop: 'balance'
  63. }
  64. ],
  65. mixins_post: 'post',
  66. times: '',
  67. balance: '',
  68. name: ''
  69. };
  70. },
  71. created() {
  72. this.mixins_dataUrl = '/sc-charge/payment/record/page';
  73. if (this.$route.query) {
  74. const { accountType, name, paymentType, id } = this.$route.query;
  75. this.name = name;
  76. let typeName = '水';
  77. let Quantity = '用水量(吨)';
  78. if (accountType == 1) {
  79. typeName = '物业';
  80. } else if (accountType == 2) {
  81. typeName = '水';
  82. Quantity = '用水量(吨)';
  83. } else if (accountType == 3) {
  84. typeName = '电';
  85. Quantity = '用电量(度)';
  86. }
  87. this.cols[3].label = Quantity;
  88. this.cols[5].label = typeName + '费余额(元)';
  89. this.publicData = {
  90. accountType: accountType,
  91. paymentType: paymentType,
  92. houseId: id
  93. };
  94. this.mixins_query = this.publicData;
  95. this.getSun();
  96. this.mixins_search();
  97. }
  98. },
  99. mounted() {},
  100. methods: {
  101. getSun() {
  102. this.$http
  103. .post('/sc-charge/payment/record/sum/amount', this.publicData)
  104. .then(({ data, status, msg }) => {
  105. if (status == 0) {
  106. this.balance = data;
  107. } else {
  108. this.$message.error(msg);
  109. }
  110. })
  111. .catch(() => {});
  112. },
  113. effectiveDateToggle(va) {
  114. let arr = va;
  115. if (!arr) {
  116. arr = ['', ''];
  117. }
  118. this.mixins_query.startTime = arr[0] + ' 00:00:00';
  119. this.mixins_query.endTime = arr[1] + ' 23:59:59';
  120. }
  121. }
  122. };
  123. </script>
  124. <style scoped lang='scss'>
  125. @import '@assets/css/public-style.scss';
  126. .table-top {
  127. width: 1660px;
  128. height: 60px;
  129. line-height: 60px;
  130. background: #ffffff;
  131. font-size: 16px;
  132. border-radius: 4px;
  133. margin-bottom: 20px;
  134. padding-left: 20px;
  135. color: #424656;
  136. .totle {
  137. font-size: 12px;
  138. margin-left: 40px;
  139. }
  140. }
  141. </style>