bill.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. <template>
  2. <view class="bill-list">
  3. <uni-collapse class="bill-box">
  4. <uni-collapse-item class="bill-item" v-for="(item,index) in list" :key="item.id" title-border="none"
  5. :border="false">
  6. <template v-slot:title>
  7. <view class="collapse-title">
  8. <view class="label">{{'第' + item.phase + '期'}}</view>
  9. <view>
  10. <view class="hui-tag info" v-if="!item.status">待付款</view>
  11. <view class="hui-tag warning" v-if="item.status === 1">付款中</view>
  12. <view class="hui-tag success" v-if="item.status === 2">已付款</view>
  13. </view>
  14. </view>
  15. </template>
  16. <view class="contract-bill-box">
  17. <view class="contract-bill-item">
  18. <view class="name">账单期数</view>
  19. <view class="label">{{'第' + item.phase + '期'}}</view>
  20. </view>
  21. <view class="contract-bill-item">
  22. <view class="name">账单日期</view>
  23. <view class="label">{{item.startDate}}至{{item.endDate}}</view>
  24. </view>
  25. <view class="contract-bill-item">
  26. <view class="name">金额</view>
  27. <view class="label">{{item.amount}}元</view>
  28. </view>
  29. <view class="contract-bill-item">
  30. <view class="name">收款方</view>
  31. <view class="label">{{item.organizationName}}</view>
  32. </view>
  33. <view class="contract-bill-item">
  34. <view class="name">付款方</view>
  35. <view class="label">{{item.payMerchantName || item.payClientName}}</view>
  36. </view>
  37. <view class="contract-bill-item">
  38. <view class="name">账单组成</view>
  39. <view class="label">{{returnLabel(item.data)}}</view>
  40. </view>
  41. </view>
  42. </uni-collapse-item>
  43. </uni-collapse>
  44. </view>
  45. </template>
  46. <script>
  47. import {
  48. getPaymentListByPage
  49. } from '@/request/api/contract.js'
  50. export default {
  51. props: ['detailId'],
  52. data() {
  53. return {
  54. list: []
  55. }
  56. },
  57. created() {
  58. this.init();
  59. },
  60. methods: {
  61. init() {
  62. getPaymentListByPage({
  63. currPage: 1,
  64. pageSize: 100,
  65. contractId: this.detailId
  66. }).then(res => {
  67. if (res.code === 200) {
  68. this.list = res.data.dataList;
  69. }
  70. })
  71. },
  72. returnLabel(data) {
  73. if (!data) return '';
  74. let list = JSON.parse(data);
  75. let str = [];
  76. for (var i = 0; i < list.length; i++) {
  77. if (list[i].unitPrice) {
  78. str.push(list[i].payCycle + '个月租金' + list[i].unitPrice + '元')
  79. } else if (list[i].earnestMoney) {
  80. str.push(this.$field.findTypeName('earnestMoneyType', list[i].earnestMoneyType) + list[i]
  81. .earnestMoney + '元')
  82. }
  83. }
  84. return str.join('+')
  85. }
  86. },
  87. }
  88. </script>
  89. <style lang="scss">
  90. .bill-list {
  91. .bill-box,
  92. .uni-collapse {
  93. background: transparent;
  94. }
  95. .collapse-title {
  96. display: flex;
  97. align-items: center;
  98. height: 84rpx;
  99. padding-left: 30rpx;
  100. .label {
  101. margin-right: 20rpx;
  102. }
  103. }
  104. .bill-item {
  105. margin-bottom: 20rpx;
  106. background: #fff;
  107. border-radius: 8rpx;
  108. }
  109. .contract-bill-box {
  110. padding: 30rpx;
  111. border-top: 1px solid $uni-border-1;
  112. .contract-bill-item {
  113. margin-top: 16rpx;
  114. }
  115. .name {
  116. color: $uni-secondary-color;
  117. font-size: 24rpx;
  118. }
  119. .label {
  120. margin-top: 10rpx;
  121. font-weight: 400;
  122. }
  123. }
  124. }
  125. </style>