aboutReceivablesPlan.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. <template>
  2. <view class="section about-receivables-plan">
  3. <view class="section-title">
  4. <image :src="$static('images/crm_about/receivables.png')" class="icon" />
  5. <text class="title">
  6. 回款计划
  7. </text>
  8. <view
  9. class="add-btn"
  10. @click="handleAdd">
  11. <text class="wk wk-plus icon-add" />
  12. <text>新建</text>
  13. </view>
  14. </view>
  15. <view class="section-body">
  16. <template v-if="list.length > 0">
  17. <view class="list">
  18. <view v-for="(item, index) in list" :key="index" class="list-item">
  19. <view class="list-item-info">
  20. <view class="box">
  21. <text class="left main">
  22. {{ item.num }}期
  23. </text>
  24. <text class="text">
  25. 回款方式:{{ item.returnType }}
  26. </text>
  27. </view>
  28. <view class="box">
  29. <text class="left text">
  30. 计划回款日 {{ formatTime(item.returnDate) }}
  31. </text>
  32. <text class="special">
  33. ¥{{ splitNumber(item.money) }}
  34. </text>
  35. </view>
  36. </view>
  37. </view>
  38. </view>
  39. </template>
  40. <template v-else>
  41. <view class="no-data">
  42. 暂无数据
  43. </view>
  44. </template>
  45. </view>
  46. </view>
  47. </template>
  48. <script>
  49. import { splitNumber } from '@/utils/lib.js'
  50. import moment from 'moment'
  51. export default {
  52. name: 'AboutReceivablesPlan',
  53. props: {
  54. list: {
  55. type: Array,
  56. required: true
  57. },
  58. config: {
  59. type: Object,
  60. default: () => {}
  61. }
  62. },
  63. data() {
  64. return {}
  65. },
  66. methods: {
  67. formatTime(date) {
  68. if (!date) return '--'
  69. return moment(date).format('YYYY-MM-DD')
  70. },
  71. splitNumber(num) {
  72. return splitNumber(num)
  73. },
  74. handleAdd() {
  75. const crmType = this.config.type
  76. if (crmType === 'contract') {
  77. getApp().globalData.formBridge = {
  78. default: {
  79. contractId: [{
  80. contractId: this.config.detail.contractId,
  81. num: this.config.detail.num
  82. }],
  83. customerId: [{
  84. customerId: this.config.detail.customerId,
  85. customerName: this.config.detail.customerName
  86. }]
  87. },
  88. assignForm: {
  89. businessId: this.config.detail.businessId
  90. }
  91. }
  92. }
  93. this.$Router.navigateTo({
  94. url: '/pages_crm/receivables_plan/create'
  95. })
  96. }
  97. }
  98. }
  99. </script>
  100. <style scoped lang="scss">
  101. @import './style.scss';
  102. .list {
  103. padding: 0 32rpx;
  104. &-item {
  105. @include left;
  106. &-info {
  107. flex: 1;
  108. border-bottom: 1rpx solid $border-color;
  109. @include padding;
  110. .box {
  111. @include left;
  112. .left {
  113. flex: 1;
  114. }
  115. .main {
  116. font-size: $wk-font-medium;
  117. color: $dark;
  118. line-height: 2;
  119. }
  120. .special {
  121. font-size: $wk-font-sm;
  122. color: $warning;
  123. font-weight: bold;
  124. }
  125. .text {
  126. font-size: 26rpx;
  127. color: $gray;
  128. }
  129. }
  130. }
  131. }
  132. .list-item:last-child {
  133. .list-item-info {
  134. border-bottom: 0 none;
  135. }
  136. }
  137. }
  138. </style>