invoiceItem.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <template>
  2. <view class="invoice-item" @click="handleDetail">
  3. <view class="cell">
  4. <text class="cell-left name">
  5. {{ itemData.invoiceApplyNumber || '' }}
  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. <view class="cell-left text-info">
  23. 开票日期:{{ itemData.invoiceDate }}
  24. </view>
  25. <view class="cell-right money">
  26. ¥{{ splitNumber(itemData.invoiceMoney) }}
  27. </view>
  28. </view>
  29. </view>
  30. </template>
  31. <script>
  32. import { splitNumber } from '@/utils/lib.js'
  33. import { mapGetters } from 'vuex'
  34. export default {
  35. name: 'InvoiceItem',
  36. props: {
  37. itemData: {
  38. type: Object,
  39. required: true
  40. }
  41. },
  42. data() {
  43. return {
  44. auth: 'crm.invoice.read'
  45. }
  46. },
  47. computed: {
  48. ...mapGetters({
  49. calcStatus: 'base/calcStatus'
  50. }),
  51. statusObj() {
  52. return this.calcStatus(this.itemData.checkStatus) || {}
  53. }
  54. },
  55. methods: {
  56. splitNumber(num) {
  57. return splitNumber(num)
  58. },
  59. handleDetail() {
  60. if (!this.$auth(this.auth)) {
  61. this.$toast('权限不足')
  62. return
  63. }
  64. this.$Router.navigateTo({
  65. url: '/pages_crm/invoice/detail',
  66. query: {
  67. id: this.itemData.invoiceId
  68. }
  69. })
  70. }
  71. }
  72. }
  73. </script>
  74. <style scoped lang="scss">
  75. @import "../../style/listItem";
  76. .invoice-item {
  77. border-bottom: 1rpx solid $border-color;
  78. background-color: white;
  79. padding: 20rpx 32rpx;
  80. .cell {
  81. .name {
  82. font-size: 32rpx;
  83. color: #212121;
  84. @include ellipsis;
  85. }
  86. .status {
  87. width: 116rpx;
  88. height: 46rpx;
  89. font-size: 24rpx;
  90. border-radius: 4rpx;
  91. @include center;
  92. }
  93. .text-info {
  94. font-size: 26rpx;
  95. color: $gray;
  96. }
  97. .money {
  98. color: #FF7300;
  99. font-size: 28rpx;
  100. font-weight: bold;
  101. }
  102. }
  103. }
  104. </style>