performanceRanking.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. <!--
  2. * @Description: 业绩排行
  3. * @Author: 空白格
  4. * @Date: 2022-06-20 09:15:39
  5. * @LastEditors: 空白格
  6. * @LastEditTime: 2022-06-20 15:49:36
  7. * @FilePath: \parking_operation\pages\collectorManagement\performanceRanking\performanceRanking.vue
  8. * @Copyright: Copyright (c) 2016~2022 by 空白格, All Rights Reserved.
  9. -->
  10. <template>
  11. <view class="performance-ranking">
  12. <!-- <view class="performance-ranking-search">
  13. <view class="performance-ranking-search-item">
  14. <uni-datetime-picker v-model="dateRange" type="daterange" @change="dateChange" />
  15. </view>
  16. <view class="performance-ranking-search-item">
  17. <yealuoInputs
  18. v-if="loadAcheve"
  19. ref="yealuoInputs"
  20. :value="payeeNoList"
  21. placeholder="请勾选收费员"
  22. :binData="collectorList"
  23. checkType="checkbox"
  24. overflow="hide"
  25. @getBackVal="getBackVal"
  26. :selectIco="true"
  27. />
  28. </view>
  29. <view class="performance-ranking-search-item btn-item">
  30. <u-button text="搜索" size="small" class="custom-btn" type="primary" @click="handleQuery"></u-button>
  31. <u-button text="重置" size="small" class="custom-btn" @click="handleReset"></u-button>
  32. </view>
  33. </view> -->
  34. <view class="performance-ranking-content">
  35. <TableRanking
  36. :loading="tableData.loading"
  37. :padding="'2'"
  38. :tableTh="tableData.tableTh"
  39. :tableData="tableData.tableData"
  40. @pageChange="pageChange"
  41. />
  42. </view>
  43. </view>
  44. </template>
  45. <script>
  46. import yealuoInputs from '@/components/yealuo-select/yealuo-select.vue';
  47. import TableRanking from '@/components/tableRanking.vue';
  48. export default {
  49. components: {
  50. yealuoInputs,
  51. TableRanking
  52. },
  53. data() {
  54. return {
  55. dateRange: [],
  56. collectorList: [],
  57. payeeNoList: '',
  58. loadAcheve: false,
  59. params: {
  60. payeeNoList: undefined,
  61. beginTime: undefined,
  62. endTime: undefined,
  63. sortField: 'realAmount',
  64. sortOrder: 'desc',
  65. pageNum: 1,
  66. pageSize: 10
  67. },
  68. tableData: {
  69. loading: false,
  70. tableTh: [
  71. {
  72. field: '工号',
  73. key: 'payeeNo',
  74. width: 100
  75. },
  76. {
  77. field: '姓名',
  78. key: 'payeeName'
  79. },
  80. {
  81. field: '实收金额(元)',
  82. key: 'realAmount'
  83. }
  84. ],
  85. tableData: {
  86. list: [],
  87. total: 0
  88. }
  89. }
  90. };
  91. },
  92. onShow() {
  93. // this.getCollectorList();
  94. this.getList();
  95. },
  96. methods: {
  97. /**
  98. * 获取所有收费员
  99. * @date 2022-06-20
  100. * @returns {any}
  101. */
  102. getCollectorList() {
  103. uni.$u.api.tollCollectorPerformanceApi
  104. .getAllTollCollectorApi()
  105. .then((res) => {
  106. const { code, rows } = res;
  107. if (code === 200) {
  108. this.collectorList = rows.map((item) => {
  109. return { id: item.payeeNo, value: item.payeeName };
  110. });
  111. this.loadAcheve = true;
  112. }
  113. });
  114. },
  115. /**
  116. * 获取数据
  117. */
  118. getList() {
  119. this.tableData.loading = true;
  120. uni.$u.api.statisticalReportApi
  121. .getTollCollectorAchieveListApi({ ...this.params })
  122. .then((res) => {
  123. const { code, rows, total } = res;
  124. if (code === 200) {
  125. this.tableData.tableData.list = rows;
  126. this.tableData.tableData.total = total;
  127. }
  128. this.tableData.loading = false;
  129. });
  130. },
  131. handleQuery() {
  132. this.getList();
  133. },
  134. handleReset() {
  135. this.params = {
  136. payeeNoList: undefined,
  137. beginTime: undefined,
  138. endTime: undefined,
  139. pageNum: 1,
  140. pageSize: 10
  141. };
  142. this.dateRange = [];
  143. this.$refs['yealuoInputs'].clearData();
  144. this.getList();
  145. },
  146. getBackVal(val) {
  147. if (typeof val === 'string') {
  148. let curList = val.split(','),
  149. valList = [];
  150. if (curList.length) {
  151. curList.forEach((item) => {
  152. valList.push(item.split('|')[1]);
  153. });
  154. }
  155. this.params.payeeNoList = valList.join(',');
  156. }
  157. },
  158. /**
  159. * 时间范围选择触发
  160. * @param {*} e
  161. */
  162. dateChange(e) {
  163. this.params.beginTime = e[0];
  164. this.params.endTime = e[1];
  165. },
  166. /**
  167. * 分页触发
  168. * @param {*} page
  169. */
  170. pageChange(page) {
  171. this.params.pageNum = page;
  172. this.getList();
  173. }
  174. }
  175. };
  176. </script>
  177. <style lang="scss">
  178. page {
  179. background-color: #1767f2;
  180. min-height: calc(100vh - 44px);
  181. }
  182. </style>
  183. <style lang="scss" scoped>
  184. @import './performanceRanking.scss';
  185. </style>