detailContractItem.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <template>
  2. <view class="list-item" @click="handleToDetail">
  3. <view class="list-item-main">
  4. <text class="left">
  5. {{ itemData.name }}
  6. </text>
  7. <text
  8. :style="{
  9. color: statusObj.color,
  10. backgroundColor: statusObj.bg,
  11. }"
  12. class="right status">
  13. {{ statusObj.label }}
  14. </text>
  15. </view>
  16. <view class="list-item-desc">
  17. <text class="left customer-name">
  18. {{ itemData.customerName }}
  19. </text>
  20. </view>
  21. <view
  22. v-if="type === 7"
  23. class="list-item-desc">
  24. <text class="right">
  25. 到期时间:<text class="end-time">
  26. {{ itemData.endTime || '' }}
  27. </text>
  28. </text>
  29. </view>
  30. <view class="list-item-desc">
  31. <text class="left money">
  32. ¥{{ itemData.money }}
  33. </text>
  34. </view>
  35. </view>
  36. </template>
  37. <script>
  38. import {mapGetters} from 'vuex'
  39. export default {
  40. name: 'DetailContractItem',
  41. props: {
  42. type: {
  43. type: Number,
  44. default: null
  45. },
  46. itemData: {
  47. type: Object,
  48. required: true
  49. }
  50. },
  51. computed: {
  52. ...mapGetters({
  53. calcStatus: 'base/calcStatus'
  54. }),
  55. statusObj() {
  56. return this.calcStatus(this.itemData.checkStatus) || {}
  57. }
  58. },
  59. methods: {
  60. handleToDetail() {
  61. this.$Router.navigateTo({
  62. url: '/pages_crm/contract/detail',
  63. query: {
  64. id: this.itemData.contractId
  65. }
  66. })
  67. }
  68. }
  69. }
  70. </script>
  71. <style scoped lang="scss">
  72. @import "detailItem";
  73. .list-item-desc {
  74. margin-top: 15rpx !important;
  75. line-height: 1.2;
  76. }
  77. .status {
  78. font-size: 26rpx !important;
  79. font-weight: 500;
  80. line-height: normal;
  81. padding: 5rpx 18rpx;
  82. border-radius: 4rpx;
  83. @include center;
  84. }
  85. .customer-name {
  86. color: $gray;
  87. @include ellipsis;
  88. }
  89. .money {
  90. font-size: 28rpx;
  91. color: #FF7812;
  92. font-weight: bold;
  93. }
  94. .end-time {
  95. color: red;
  96. }
  97. </style>