receivedItem.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <template>
  2. <button class="received-item" @click="handleDetail">
  3. <view class="cell">
  4. <text class="cell-left name">
  5. {{ itemData.number || '' }}
  6. </text>
  7. <view
  8. :style="{
  9. color: statusObj.color,
  10. backgroundColor: statusObj.bg,
  11. }"
  12. class="cell-right status">
  13. {{ statusObj.label }}
  14. </view>
  15. </view>
  16. <view class="cell">
  17. <text class="cell-left text-info">
  18. {{ itemData.customerName || '' }}
  19. </text>
  20. </view>
  21. <view class="cell">
  22. <text class="cell-left text-info">
  23. 回款时间:{{ itemData.returnTime | formatTime }}
  24. </text>
  25. <text v-if="hasMoney" class="cell-right money">
  26. ¥{{ splitNumber(itemData.money) }}
  27. </text>
  28. </view>
  29. </button>
  30. </template>
  31. <script>
  32. import { splitNumber } from '@/utils/lib.js'
  33. import { mapGetters } from 'vuex'
  34. import moment from 'moment'
  35. export default {
  36. name: 'ReceivedItem',
  37. filters: {
  38. formatTime(val) {
  39. if (!val) return '--'
  40. return moment(val).format('YYYY-MM-DD')
  41. }
  42. },
  43. props: {
  44. itemData: {
  45. type: Object,
  46. required: true
  47. }
  48. },
  49. data() {
  50. return {}
  51. },
  52. computed: {
  53. ...mapGetters({
  54. calcStatus: 'base/calcStatus'
  55. }),
  56. statusObj() {
  57. return this.calcStatus(this.itemData.checkStatus) || {}
  58. },
  59. hasMoney() {
  60. return this.itemData.hasOwnProperty('money')
  61. }
  62. },
  63. methods: {
  64. splitNumber(num) {
  65. return splitNumber(num)
  66. },
  67. /**
  68. * 详情跳转
  69. */
  70. handleDetail() {
  71. if (!this.$auth('crm.receivables.read')) {
  72. this.$toast('权限不足')
  73. return
  74. }
  75. this.$Router.navigateTo({
  76. url: '/pages_crm/receivables/detail',
  77. query: {
  78. id: this.itemData.receivablesId
  79. }
  80. })
  81. }
  82. }
  83. }
  84. </script>
  85. <style scoped lang="scss">
  86. @import "../../style/listItem";
  87. .received-item {
  88. border-bottom: 1rpx solid $border-color;
  89. background-color: white;
  90. padding: 20rpx 32rpx;
  91. .cell {
  92. .name {
  93. font-size: 32rpx;
  94. color: #212121;
  95. @include ellipsis;
  96. }
  97. .status {
  98. width: 116rpx;
  99. height: 46rpx;
  100. font-size: 24rpx;
  101. border-radius: 4rpx;
  102. @include center;
  103. }
  104. .text-info {
  105. font-size: 26rpx;
  106. color: $gray;
  107. }
  108. .money {
  109. color: #FF7300;
  110. font-size: 28rpx;
  111. font-weight: bold;
  112. }
  113. }
  114. }
  115. </style>