billingRules.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  1. <template>
  2. <view>
  3. <u-navbar title="计费规则" title-color="#101010"></u-navbar>
  4. <view class="background">
  5. <!-- 单位 -->
  6. <view class="unit">
  7. <view class="title">
  8. 所属收款单位
  9. </view>
  10. <view class="value">
  11. 岑河物业公司
  12. </view>
  13. </view>
  14. <!-- 规则 -->
  15. <view class="rules">
  16. <view class="content">
  17. <view class="rule1">
  18. <view class="title">
  19. 用电分类
  20. </view>
  21. <view class="value" v-for="(item,index) in groupPriceList" :key="index"
  22. :class="item.electricPeriodPriceList.length>1 ? '' : 'title3'">
  23. {{item.name}}
  24. </view>
  25. <!-- <view class="value">
  26. 谷段用电
  27. </view>
  28. <view class="value title3">
  29. 平段用电
  30. </view>
  31. <view class="value">
  32. 尖峰用电
  33. </view> -->
  34. </view>
  35. <view class="rule2">
  36. <view class="title">
  37. 用电时段
  38. </view>
  39. <view class="value" v-for="(item,index) in groupPriceList" :key="index"
  40. :class="item.electricPeriodPriceList.length>1 ? '' : 'value3'">
  41. <span v-for="e in item.electricPeriodPriceList">{{e.startTime}}-{{e.endTime}}</span>
  42. </view>
  43. <!-- <view class="value">
  44. 23:00-07:00
  45. </view>
  46. <view class="value value3">
  47. <p>07:00-09:00</p>
  48. <p>15:00-20:00</p>
  49. <p>22:00-23:00</p>
  50. </view>
  51. <view class="value">
  52. 20:00-22:00
  53. </view> -->
  54. </view>
  55. <view class="rule3">
  56. <view class="title">
  57. 电度电价
  58. </view>
  59. <view class="value" v-for="(item,index) in groupPriceList" :key="index"
  60. :class="item.electricPeriodPriceList.length>1 ? '' : 'value4'">
  61. <span v-for="e in item.electricPeriodPriceList">{{e.price}}元/度</span>
  62. </view>
  63. <view class="value">
  64. 0.37元/度
  65. </view>
  66. <view class="value value4">
  67. 0.69元/度
  68. </view>
  69. <view class="value">
  70. 1.18元/度
  71. </view>
  72. </view>
  73. </view>
  74. <!-- 备注 -->
  75. <view class="remark" v-if="tenantContract!=null">
  76. <view class="title">
  77. 备注说明:
  78. </view>
  79. <view class="value">
  80. <view class="item">1.计费规则仅展示租赁合同中的计算方式,最终扣费金额以账单中的实际扣费金额为准。
  81. </view>
  82. <view class="item" v-if="startTime!=null && endTime!=null">
  83. 2.本次租约有效期:{{startTime}}-{{endTime}}
  84. </view>
  85. </view>
  86. </view>
  87. </view>
  88. </view>
  89. </view>
  90. </template>
  91. <script>
  92. import * as API_electricityMeter from '@/apis/pagejs/electricityMeter.js'
  93. import {
  94. parseUnixTime,
  95. beforeTimeStamp,
  96. getWeek
  97. } from '@/apis/utils'
  98. export default {
  99. data() {
  100. return {
  101. groupPriceList: [],
  102. queryDate: '',
  103. meterId: '',
  104. name: '',
  105. tenantContract: null,
  106. startTime: null,
  107. endTime: null
  108. }
  109. },
  110. onLoad(op) {
  111. if(op.id) {
  112. this.meterId = op.id;
  113. this.queryDate = op.queryDate;
  114. this.getBillingRules();
  115. }
  116. },
  117. methods: {
  118. getBillingRules() {
  119. uni.showLoading({
  120. title: "加载中",
  121. mask: true,
  122. })
  123. API_electricityMeter.billingRules({
  124. meterId: this.meterId,
  125. queryDate: this.queryDate+'-01'
  126. }).then((res) => {
  127. uni.hideLoading();
  128. this.name = res.data.name;
  129. this.groupPriceList = res.data.groupPriceList;
  130. this.tenantContract = res.data.tenantContract;
  131. var startTime = res.data.tenantContract.startTime;
  132. var endTime = res.data.tenantContract.endTime;
  133. if(startTime != null) {
  134. this.startTime = startTime.slice(0,4)+'年'+parseInt(startTime.slice(5,7))+'月'+parseInt(startTime.slice(8))+'日';
  135. }
  136. if(endTime != null) {
  137. this.endTime = endTime.slice(0,4)+'年'+parseInt(endTime.slice(5,7))+'月'+parseInt(endTime.slice(8))+'日';
  138. }
  139. }).catch(error => {
  140. uni.showToast({
  141. title: error,
  142. icon: "none"
  143. })
  144. })
  145. },
  146. }
  147. }
  148. </script>
  149. <style lang="scss" scoped>
  150. .background {
  151. background: linear-gradient(180deg, rgba(22, 119, 255, 1) 0%, rgba(22, 119, 255, 0) 100%);
  152. height: 720rpx;
  153. padding-top: 24rpx;
  154. .unit {
  155. background-color: #fff;
  156. border-radius: 8px;
  157. padding: 32rpx;
  158. margin: 0 32rpx;
  159. .title {
  160. color: rgba(153, 153, 153, 1);
  161. }
  162. .value {
  163. color: rgba(51, 51, 51, 1);
  164. font-size: 40rpx;
  165. margin-top: 16rpx;
  166. font-weight: bold;
  167. }
  168. }
  169. }
  170. // 规则
  171. .rules {
  172. margin: 24rpx 32rpx 40rpx;
  173. background-color: #fff;
  174. padding-bottom: 24rpx;
  175. border-radius: 8px;
  176. .content {
  177. padding: 24rpx;
  178. display: flex;
  179. text-align: center;
  180. .rule1 {
  181. width: 200rpx;
  182. .title {
  183. line-height: 96rpx;
  184. color: rgba(51, 51, 51, 1);
  185. font-size: 32rpx;
  186. font-weight: bold;
  187. }
  188. .value {
  189. color: rgba(51, 51, 51, 1);
  190. line-height: 96rpx;
  191. font-weight: bold;
  192. }
  193. }
  194. .rule2,
  195. .rule3 {
  196. width: 200rpx;
  197. .title {
  198. color: rgba(51, 51, 51, 1);
  199. font-size: 32rpx;
  200. line-height: 96rpx;
  201. font-weight: bold;
  202. }
  203. .value {
  204. color: rgba(119, 119, 119, 1);
  205. line-height: 96rpx;
  206. }
  207. }
  208. .title3 {
  209. height: 144rpx;
  210. line-height: 144rpx !important;
  211. }
  212. .value3 {
  213. height: 144rpx;
  214. p {
  215. line-height: 48rpx;
  216. }
  217. }
  218. .value4 {
  219. height: 144rpx;
  220. line-height: 144rpx !important;
  221. }
  222. }
  223. // 备注
  224. .remark {
  225. padding: 40rpx 32rpx;
  226. margin: 0 24rpx;
  227. border-radius: 8px;
  228. background-color: rgba(242, 244, 246, 1);
  229. color: rgba(16, 16, 16, 1);
  230. font-size: 24rpx;
  231. line-height: 34rpx;
  232. .value {
  233. margin-top: 16rpx;
  234. }
  235. .item {
  236. margin-bottom: 8rpx;
  237. }
  238. }
  239. }
  240. </style>