billDetail.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. <template>
  2. <view class="bill-detail" v-if="detail.id">
  3. <view class="detail">
  4. <view class="detail-box">
  5. <view class="title-box">
  6. <view class="title" v-if="type == 1">{{'第' + detail.phase + '期'}}</view>
  7. <view class="title" v-else>{{ detail.name}}</view>
  8. <view class="date" v-if="type == 1">{{detail.startDate}}至{{detail.endDate}}</view>
  9. <view class="date" v-else>{{detail.reminderDate}}</view>
  10. <view class="title-icon">
  11. <uni-icons type="icon-hetongwendang" custom-prefix="iconfont" color="#fff" size="18">
  12. </uni-icons>
  13. </view>
  14. </view>
  15. <view class="other">
  16. <view class="item">
  17. <view class="label">金额</view>
  18. <view class="value">{{detail.amount + '元'}}</view>
  19. </view>
  20. <view class="item">
  21. <view class="label">收款方</view>
  22. <view class="value"> {{detail.organizationName}}</view>
  23. </view>
  24. <view class="item">
  25. <view class="label">付款方</view>
  26. <view class="value">{{detail.payMerchantName || detail.payClientName}}</view>
  27. </view>
  28. </view>
  29. <view class="state">
  30. <view></view>
  31. <view class="tag">
  32. <view class="status-tag info" v-if="!detail.status">待付款</view>
  33. <view class="status-tag warning" v-else-if="detail.status === 1">付款中</view>
  34. <view class="status-tag success" v-else-if="detail.status === 2">已付款</view>
  35. </view>
  36. </view>
  37. </view>
  38. <view class="detail-box" v-for="(item,index) in detail.paymentRecordList" :key="item">
  39. <view class="sub-title file-box">
  40. <uni-icons type="map-filled" class="inherit-icons" size="24" color="#08979c"></uni-icons>
  41. <text class="sub-label">付款记录</text>
  42. </view>
  43. <view class="other">
  44. <view class="item">
  45. <view class="label">付款名称</view>
  46. <view class="value">{{item.name}}</view>
  47. </view>
  48. <view class="item">
  49. <view class="label" style="margin-bottom: 10rpx;">回执单</view>
  50. <upload accept="all" :list="item.attachment ? JSON.parse(item.attachment) : []"></upload>
  51. </view>
  52. </view>
  53. </view>
  54. <view class="detail-box" v-for="(item,index) in detail.paymentInvoiceList" :key="item">
  55. <view class="sub-title file-box">
  56. <uni-icons type="map-filled" class="inherit-icons" size="24" color="#08979c"></uni-icons>
  57. <text class="sub-label">发票记录</text>
  58. </view>
  59. <view class="other">
  60. <view class="item">
  61. <view class="label">发票名称</view>
  62. <view class="value">{{item.name}}</view>
  63. </view>
  64. <view class="item">
  65. <view class="label">发票类型</view>
  66. <view class="value">{{$field.findTypeName('invoiceType',item.type)}}</view>
  67. </view>
  68. <view class="item">
  69. <view class="label">发票代码</view>
  70. <view class="value">{{item.code || '-'}}</view>
  71. </view>
  72. <view class="item">
  73. <view class="label">发票号码</view>
  74. <view class="value">{{item.number || '-'}}</view>
  75. </view>
  76. <view class="item">
  77. <view class="label">货物名称</view>
  78. <view class="value">{{item.cargoName || '-'}}</view>
  79. </view>
  80. <view class="item">
  81. <view class="label" style="margin-bottom: 10rpx;">发票附件</view>
  82. <upload accept="all" :list="item.attachment ? JSON.parse(item.attachment) : []"></upload>
  83. </view>
  84. </view>
  85. </view>
  86. </view>
  87. <view class="hui-button-box" v-if="operationBtn.length>0">
  88. <view class="hui-button" v-for="(item,index) in operationBtn" :key="index"
  89. @click="$navigateTo(item.type+'?billId='+billId+'&type='+type)">
  90. {{item.name}}
  91. </view>
  92. </view>
  93. </view>
  94. </template>
  95. <script>
  96. import {
  97. getPaymentDetailById,
  98. getCommonPaymentDetailById
  99. } from '@/request/api/bill.js'
  100. import upload from '@/components/common/upload.vue'
  101. export default {
  102. data() {
  103. return {
  104. billId: '',
  105. type: '',
  106. detail: {},
  107. operationBtn: []
  108. }
  109. },
  110. onLoad(body) {
  111. this.billId = body.billId;
  112. this.type = body.type;
  113. this.init();
  114. uni.$on('reloadBill', () => {
  115. this.init();
  116. })
  117. },
  118. methods: {
  119. init() {
  120. if (!this.billId) return;
  121. if (this.type == 1) {
  122. getPaymentDetailById(this.billId).then(this.billSuccess);
  123. } else {
  124. getCommonPaymentDetailById(this.billId).then(this.billSuccess);
  125. }
  126. },
  127. billSuccess(res) {
  128. if (res.code === 200) {
  129. this.detail = res.data;
  130. if (!this.detail.status && (this.$store.getters.identity.id === 1 || this.$store.getters.identity
  131. .id === 4)) {
  132. this.operationBtn.push({
  133. id: 1,
  134. name: '账单付款',
  135. type: '/pages/billRecord/billRecord'
  136. })
  137. }
  138. if (this.detail.status === 1 && this.detail.organizationId === this.$store.getters.organization.id) {
  139. this.operationBtn.push({
  140. id: 2,
  141. name: '账单发票',
  142. type: '/pages/billInvoice/billInvoice'
  143. })
  144. }
  145. }
  146. }
  147. },
  148. components: {
  149. upload
  150. }
  151. }
  152. </script>
  153. <style>
  154. </style>