aboutReceivables.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. <template>
  2. <view class="section about-receivables">
  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. v-if="!config.isSeas"
  10. class="add-btn"
  11. @click="handleAdd">
  12. <text class="wk wk-plus icon-add" />
  13. <text>新建</text>
  14. </view>
  15. </view>
  16. <view class="section-body">
  17. <template v-if="list.length > 0">
  18. <view class="list">
  19. <view
  20. v-for="(item, index) in list"
  21. :key="index"
  22. class="list-item"
  23. @click="handleTo(item.receivablesId)">
  24. <view class="list-item-info">
  25. <view class="box">
  26. <text class="left name">
  27. {{ item.receivablesNum }}
  28. </text>
  29. </view>
  30. <view class="box">
  31. <text class="left text">
  32. 回款日期 {{ item.returnTime }}
  33. </text>
  34. <text class="money">
  35. ¥{{ splitNumber(item.receivablesMoney) }}
  36. </text>
  37. </view>
  38. <view class="box">
  39. <text
  40. :style="{
  41. color: statusObj(item).color
  42. }"
  43. class="text">
  44. {{ statusObj(item).label }}
  45. </text>
  46. </view>
  47. </view>
  48. </view>
  49. </view>
  50. </template>
  51. <template v-else>
  52. <view class="no-data">
  53. 暂无数据
  54. </view>
  55. </template>
  56. </view>
  57. </view>
  58. </template>
  59. <script>
  60. import { splitNumber } from '@/utils/lib.js'
  61. import { mapGetters } from 'vuex'
  62. export default {
  63. name: 'AboutReceivables',
  64. props: {
  65. list: {
  66. type: Array,
  67. required: true
  68. },
  69. config: {
  70. type: Object,
  71. default: () => {}
  72. }
  73. },
  74. data() {
  75. return {}
  76. },
  77. computed: {
  78. ...mapGetters({
  79. calcStatus: 'base/calcStatus'
  80. }),
  81. },
  82. methods: {
  83. splitNumber(num) {
  84. return splitNumber(num)
  85. },
  86. statusObj(item) {
  87. return this.calcStatus(item.checkStatus)
  88. },
  89. handleAdd() {
  90. const checkRes = this.$auth('crm.receivables.save')
  91. if (!checkRes) {
  92. this.$toast('权限不足!')
  93. return
  94. }
  95. if (!this.config.detail) return
  96. const type = this.config.type
  97. const formBridge = {
  98. default: {
  99. customerId: [{
  100. customerId: this.config.detail.customerId,
  101. customerName: this.config.detail.customerName
  102. }]
  103. }
  104. }
  105. if (type === 'contract') {
  106. formBridge.default.contractId = [{
  107. contractId: this.config.detail.contractId,
  108. num: this.config.detail.num,
  109. }]
  110. formBridge.assignForm = {
  111. contractId: this.config.detail.contractId
  112. }
  113. }
  114. getApp().globalData.formBridge = formBridge
  115. this.$Router.navigateTo({
  116. url: '/pages_crm/receivables/create',
  117. query: {
  118. type: 'receivables',
  119. crmType: this.config.type
  120. }
  121. })
  122. },
  123. handleTo(id) {
  124. const checkRes = this.$auth('crm.receivables.read')
  125. if (!checkRes) {
  126. this.$toast('权限不足!')
  127. return
  128. }
  129. this.$Router.navigateTo({
  130. url: '/pages_crm/receivables/detail',
  131. query: {
  132. id: id
  133. }
  134. })
  135. },
  136. }
  137. }
  138. </script>
  139. <style scoped lang="scss">
  140. @import './style.scss';
  141. .list {
  142. padding: 0 32rpx;
  143. &-item {
  144. @include left;
  145. &-info {
  146. flex: 1;
  147. border-bottom: 1rpx solid $border-color;
  148. @include padding;
  149. .box {
  150. @include left;
  151. .left {
  152. flex: 1;
  153. }
  154. .name {
  155. font-size: $wk-font-medium;
  156. font-weight: 500;
  157. color: $dark;
  158. line-height: 1.5;
  159. }
  160. .money {
  161. font-size: $wk-font-base;
  162. font-weight: bold;
  163. color: $warning;
  164. }
  165. .text {
  166. font-size: 26rpx;
  167. color: $gray;
  168. }
  169. }
  170. }
  171. }
  172. .list-item:last-child {
  173. .list-item-info {
  174. border-bottom: 0 none;
  175. }
  176. }
  177. }
  178. </style>