myCommission.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  1. <template>
  2. <view class="my_commission_wrap">
  3. <!-- 统计信息 -->
  4. <view class="commission_item" v-for="item in listData" :key="item.id">
  5. <view class="commission_top">
  6. <view class="top_left">{{item.item}}</view>
  7. <view class="top_right">
  8. <text class="account_type">{{ item.accountType === '1' ? '前端' : '后端' }}</text>
  9. </view>
  10. </view>
  11. <view class="commission_info">
  12. <view class="info_row">
  13. <view class="info_item">
  14. <text class="label">电话: </text>
  15. <show-real-text :real="item.phone" :type='type'></show-real-text>
  16. </view>
  17. </view>
  18. <view class="info_row">
  19. <view class="info_item">
  20. <text class="label">收单时间: </text>
  21. <text class="value">{{item.receiptDate || '-'}}</text>
  22. </view>
  23. </view>
  24. <view class="info_row">
  25. <view class="info_item">
  26. <text class="label">收单人: </text>
  27. <text class="value">{{item.receiptNickName || '-'}}</text>
  28. </view>
  29. <view class="info_item">
  30. <text class="label">公司: </text>
  31. <text class="value">{{item.orgName || '-'}}</text>
  32. </view>
  33. </view>
  34. <view class="info_row">
  35. <view class="info_item">
  36. <text class="label">分成所属人: </text>
  37. <text class="value">{{item.userName || '-'}}</text>
  38. </view>
  39. <view class="info_item">
  40. <text class="label">分成比例: </text>
  41. <text class="value">{{item.commissionRate || '-'}}%</text>
  42. </view>
  43. </view>
  44. </view>
  45. <view class="commission_amount">
  46. <view class="amount_item">
  47. <view class="amount_label">业绩</view>
  48. <view class="amount_value primary">{{formatAmount(item.commissionAmount)}}</view>
  49. </view>
  50. <view class="amount_item">
  51. <view class="amount_label">毛业绩</view>
  52. <view class="amount_value">{{formatAmount(item.grossAmount)}}</view>
  53. </view>
  54. </view>
  55. </view>
  56. <!-- 加载更多 -->
  57. <u-loadmore :status="loadStatus" v-if="listData.length > 0" />
  58. <!-- 空状态 -->
  59. <show-emtry v-if="listData.length === 0"></show-emtry>
  60. </view>
  61. </template>
  62. <script>
  63. import pullUpRefresh from "@/utils/pullUpRefresh";
  64. export default {
  65. mixins: [pullUpRefresh],
  66. props: {
  67. type: {
  68. type: String,
  69. default: '2'
  70. },
  71. showStats: {
  72. type: Boolean,
  73. default: true
  74. }
  75. },
  76. data() {
  77. return {
  78. queryParams: {
  79. pageNum: 1,
  80. pageSize: 10,
  81. },
  82. }
  83. },
  84. methods: {
  85. formatAmount(amount) {
  86. if (!amount) return '-';
  87. return parseFloat(amount).toLocaleString();
  88. },
  89. async getList() {
  90. const {
  91. pageNum,
  92. pageSize,
  93. } = this.queryParams;
  94. this.queryParams.type = this.type;
  95. // 调用分成接口
  96. const {
  97. rows,
  98. total
  99. } = await uni.$u.api.selectCommissionList({
  100. pageSize,
  101. pageNum,
  102. }, this.queryParams);
  103. return rows;
  104. },
  105. handleOnReachBottom() {
  106. this.handleReachBottom();
  107. }
  108. },
  109. mounted() {
  110. this.resetData();
  111. }
  112. }
  113. </script>
  114. <style lang="scss" scoped>
  115. .my_commission_wrap {
  116. padding: 20px;
  117. }
  118. .stats_info_wrap {
  119. margin-bottom: 30px;
  120. }
  121. .stats_info_top {
  122. display: flex;
  123. margin-bottom: 20px;
  124. .info_item {
  125. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  126. width: 23%;
  127. margin-right: 2.6%;
  128. height: 120px;
  129. padding: 15px;
  130. background: #fff;
  131. border-radius: 15px;
  132. &:last-child {
  133. margin-right: 0;
  134. }
  135. .info_title {
  136. font-size: 14px;
  137. color: #6b7280;
  138. margin-bottom: 15px;
  139. }
  140. .info_value {
  141. font-size: 24px;
  142. font-weight: bold;
  143. color: #202020;
  144. }
  145. }
  146. }
  147. .commission_item {
  148. background: #fff;
  149. border-radius: 20px;
  150. padding: 20px;
  151. margin-bottom: 20px;
  152. box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  153. .commission_top {
  154. display: flex;
  155. justify-content: space-between;
  156. margin-bottom: 15px;
  157. .top_left {
  158. font-size: 18px;
  159. font-weight: bold;
  160. color: #202020;
  161. }
  162. .top_right {
  163. .account_type {
  164. background: #108cff;
  165. color: #fff;
  166. padding: 4px 8px;
  167. border-radius: 10px;
  168. font-size: 12px;
  169. }
  170. }
  171. }
  172. .commission_info {
  173. margin-bottom: 15px;
  174. .info_row {
  175. display: flex;
  176. margin-bottom: 8px;
  177. &:last-child {
  178. margin-bottom: 0;
  179. }
  180. .info_item {
  181. flex: 1;
  182. display: flex;
  183. align-items: center;
  184. font-size: 14px;
  185. .label {
  186. color: #9b9aa2;
  187. margin-right: 8px;
  188. min-width: 60px;
  189. }
  190. .value {
  191. color: #202020;
  192. }
  193. }
  194. }
  195. }
  196. .commission_amount {
  197. display: flex;
  198. justify-content: space-around;
  199. padding: 15px 0;
  200. border-top: 1px solid #f0f0f0;
  201. background: #f8f9fb;
  202. border-radius: 10px;
  203. .amount_item {
  204. text-align: center;
  205. .amount_label {
  206. font-size: 12px;
  207. color: #9b9aa2;
  208. margin-bottom: 5px;
  209. }
  210. .amount_value {
  211. font-size: 16px;
  212. font-weight: bold;
  213. color: #202020;
  214. &.primary {
  215. color: #108cff;
  216. }
  217. }
  218. }
  219. }
  220. }
  221. .empty_wrap {
  222. margin-top: 100px;
  223. }
  224. </style>