myCommission.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320
  1. <template>
  2. <view class="my_commission_wrap">
  3. <view class="queryParams_wrap">
  4. <view class="search">
  5. <u--input clearable prefixIcon="search" v-model="queryParams.phone" shape="circle" clearable
  6. @blur="handleKeyword" @clear="handleKeywordClear" placeholder="请输入电话"></u--input>
  7. </view>
  8. <view class="query">
  9. <view style="margin-right: 10rpx;" @click="handleshowFilter">筛选</view>
  10. <u-icon name="arrow-down-fill" color="#aaa" size="10"></u-icon>
  11. </view>
  12. </view>
  13. <view class="commission_item_wrap">
  14. <!-- 统计信息 -->
  15. <view class="commission_item" v-for="item in listData" :key="item.id">
  16. <view class="commission_top">
  17. <view class="top_left">{{item.item}}</view>
  18. <view class="top_right">
  19. <text class="account_type">{{ item.accountType === '1' ? '前端' : '后端' }}</text>
  20. </view>
  21. </view>
  22. <view class="commission_info">
  23. <view class="info_row">
  24. <view class="info_item">
  25. <text class="label">电话: </text>
  26. <show-real-text :real="item.phone" :type='type'></show-real-text>
  27. </view>
  28. </view>
  29. <view class="info_row">
  30. <view class="info_item">
  31. <text class="label">收单时间: </text>
  32. <text class="value">{{item.receiptDate || '-'}}</text>
  33. </view>
  34. </view>
  35. <view class="info_row">
  36. <view class="info_item">
  37. <text class="label">收单人: </text>
  38. <text class="value">{{item.receiptNickName || '-'}}</text>
  39. </view>
  40. <view class="info_item">
  41. <text class="label">公司: </text>
  42. <text class="value">{{item.orgName || '-'}}</text>
  43. </view>
  44. </view>
  45. <view class="info_row">
  46. <view class="info_item">
  47. <text class="label">分成所属人: </text>
  48. <text class="value">{{item.userName || '-'}}</text>
  49. </view>
  50. <view class="info_item">
  51. <text class="label">分成比例: </text>
  52. <text class="value">{{item.commissionRate || '-'}}%</text>
  53. </view>
  54. </view>
  55. </view>
  56. <view class="commission_amount">
  57. <view class="amount_item">
  58. <view class="amount_label">业绩</view>
  59. <view class="amount_value primary">{{formatAmount(item.commissionAmount)}}</view>
  60. </view>
  61. <view class="amount_item">
  62. <view class="amount_label">毛业绩</view>
  63. <view class="amount_value">{{formatAmount(item.grossAmount)}}</view>
  64. </view>
  65. </view>
  66. </view>
  67. </view>
  68. <filter-query ref="filter" v-model="queryParams" @getList="resetData" :mapHeight="mapHeight"></filter-query>
  69. <!-- 加载更多 -->
  70. <u-loadmore :status="loadStatus" v-if="listData.length > 0" />
  71. <!-- 空状态 -->
  72. <show-emtry v-if="listData.length === 0"></show-emtry>
  73. </view>
  74. </template>
  75. <script>
  76. import pullUpRefresh from "@/utils/pullUpRefresh";
  77. import filterQuery from "./filterQuery.vue";
  78. export default {
  79. mixins: [pullUpRefresh],
  80. components: {
  81. filterQuery,
  82. },
  83. props: {
  84. type: {
  85. type: String,
  86. default: '2'
  87. },
  88. showStats: {
  89. type: Boolean,
  90. default: true
  91. }
  92. },
  93. data() {
  94. return {
  95. queryParams: {
  96. phone : "",
  97. pageNum: 1,
  98. pageSize: 10,
  99. },
  100. mapHeight: "0px"
  101. }
  102. },
  103. methods: {
  104. handleKeyword() {
  105. this.resetData();
  106. },
  107. handleKeywordClear() {
  108. // 组件有bug 清空后的值还是存在
  109. this.queryParams.phone = "";
  110. this.resetData();
  111. },
  112. handleshowFilter() {
  113. this.$refs.filter.show();
  114. },
  115. formatAmount(amount) {
  116. if (!amount) return '-';
  117. return parseFloat(amount).toLocaleString();
  118. },
  119. async getList() {
  120. const {
  121. pageNum,
  122. pageSize,
  123. } = this.queryParams;
  124. this.queryParams.type = this.type;
  125. // 调用分成接口
  126. const {
  127. rows,
  128. total
  129. } = await uni.$u.api.selectCommissionList({
  130. pageSize,
  131. pageNum,
  132. }, this.queryParams);
  133. return rows;
  134. },
  135. handleOnReachBottom() {
  136. this.handleReachBottom();
  137. }
  138. },
  139. mounted() {
  140. this.resetData();
  141. uni.getSystemInfo({
  142. success: (e) => {
  143. const {
  144. windowTop,
  145. windowBottom,
  146. windowHeight
  147. } = e;
  148. this.mapHeight = windowHeight + 'px';
  149. }
  150. });
  151. }
  152. }
  153. </script>
  154. <style lang="scss" scoped>
  155. .my_commission_wrap {
  156. .queryParams_wrap {
  157. display: flex;
  158. background: #fff;
  159. padding: 14px 0;
  160. .query,
  161. .search {
  162. display: flex;
  163. align-items: center;
  164. justify-content: center;
  165. font-size: 16px;
  166. font-weight: 700;
  167. color: #202020;
  168. }
  169. .query {
  170. flex: 1;
  171. }
  172. .search {
  173. flex: 2;
  174. padding-left: 20px;
  175. }
  176. }
  177. }
  178. .stats_info_wrap {
  179. margin-bottom: 30px;
  180. }
  181. .stats_info_top {
  182. display: flex;
  183. margin-bottom: 20px;
  184. .info_item {
  185. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  186. width: 23%;
  187. margin-right: 2.6%;
  188. height: 120px;
  189. padding: 15px;
  190. background: #fff;
  191. border-radius: 15px;
  192. &:last-child {
  193. margin-right: 0;
  194. }
  195. .info_title {
  196. font-size: 14px;
  197. color: #6b7280;
  198. margin-bottom: 15px;
  199. }
  200. .info_value {
  201. font-size: 24px;
  202. font-weight: bold;
  203. color: #202020;
  204. }
  205. }
  206. }
  207. .commission_item_wrap {
  208. padding: 20px 20px;
  209. }
  210. .commission_item {
  211. background: #fff;
  212. border-radius: 20px;
  213. padding: 20px;
  214. margin-bottom: 20px;
  215. box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  216. .commission_top {
  217. display: flex;
  218. justify-content: space-between;
  219. margin-bottom: 15px;
  220. .top_left {
  221. font-size: 18px;
  222. font-weight: bold;
  223. color: #202020;
  224. }
  225. .top_right {
  226. .account_type {
  227. background: #108cff;
  228. color: #fff;
  229. padding: 4px 8px;
  230. border-radius: 10px;
  231. font-size: 12px;
  232. }
  233. }
  234. }
  235. .commission_info {
  236. margin-bottom: 15px;
  237. .info_row {
  238. display: flex;
  239. margin-bottom: 8px;
  240. &:last-child {
  241. margin-bottom: 0;
  242. }
  243. .info_item {
  244. flex: 1;
  245. display: flex;
  246. align-items: center;
  247. font-size: 14px;
  248. .label {
  249. color: #9b9aa2;
  250. margin-right: 8px;
  251. min-width: 60px;
  252. }
  253. .value {
  254. color: #202020;
  255. }
  256. }
  257. }
  258. }
  259. .commission_amount {
  260. display: flex;
  261. justify-content: space-around;
  262. padding: 15px 0;
  263. border-top: 1px solid #f0f0f0;
  264. background: #f8f9fb;
  265. border-radius: 10px;
  266. .amount_item {
  267. text-align: center;
  268. .amount_label {
  269. font-size: 12px;
  270. color: #9b9aa2;
  271. margin-bottom: 5px;
  272. }
  273. .amount_value {
  274. font-size: 16px;
  275. font-weight: bold;
  276. color: #202020;
  277. &.primary {
  278. color: #108cff;
  279. }
  280. }
  281. }
  282. }
  283. }
  284. .empty_wrap {
  285. margin-top: 100px;
  286. }
  287. </style>