performanceRanking.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  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="'0'"
  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: '',
  61. beginTime: '',
  62. endTime: '',
  63. pageNum: 1,
  64. pageSize: 10
  65. },
  66. tableData: {
  67. loading: false,
  68. tableTh: [
  69. {
  70. field: '工号',
  71. key: 'payeeNo',
  72. width: 100
  73. },
  74. {
  75. field: '姓名',
  76. key: 'payeeName'
  77. },
  78. {
  79. field: '实收金额(元)',
  80. key: 'realAmount'
  81. }
  82. ],
  83. tableData: {
  84. list: [],
  85. total: 0
  86. }
  87. }
  88. };
  89. },
  90. onShow() {
  91. this.getCollectorList();
  92. this.getList();
  93. },
  94. methods: {
  95. /**
  96. * 获取所有收费员
  97. * @date 2022-06-20
  98. * @returns {any}
  99. */
  100. getCollectorList() {
  101. uni.$u.api.tollCollectorPerformanceApi
  102. .getAllTollCollectorApi()
  103. .then((res) => {
  104. const { code, rows } = res;
  105. if (code === 200) {
  106. this.collectorList = rows.map((item) => {
  107. return { id: item.payeeNo, value: item.payeeName };
  108. });
  109. this.loadAcheve = true;
  110. }
  111. });
  112. },
  113. /**
  114. * 获取数据
  115. */
  116. getList() {
  117. this.tableData.loading = true;
  118. uni.$u.api.statisticalReportApi
  119. .getTollCollectorAchieveListApi({ ...this.params })
  120. .then((res) => {
  121. const { code, rows, total } = res;
  122. if (code === 200) {
  123. this.tableData.tableData.list = rows;
  124. this.tableData.tableData.total = total;
  125. }
  126. this.tableData.loading = false;
  127. });
  128. },
  129. handleQuery() {
  130. this.getList();
  131. },
  132. handleReset() {
  133. this.params = {
  134. payeeNoList: '',
  135. beginTime: '',
  136. endTime: '',
  137. pageNum: 1,
  138. pageSize: 10
  139. };
  140. this.dateRange = [];
  141. this.$refs['yealuoInputs'].clearData();
  142. this.getList();
  143. },
  144. getBackVal(val) {
  145. if (typeof val === 'string') {
  146. let curList = val.split(','),
  147. valList = [];
  148. if (curList.length) {
  149. curList.forEach((item) => {
  150. valList.push(item.split('|')[1]);
  151. });
  152. }
  153. this.params.payeeNoList = valList.join(',');
  154. }
  155. },
  156. /**
  157. * 时间范围选择触发
  158. * @param {*} e
  159. */
  160. dateChange(e) {
  161. this.params.beginTime = e[0];
  162. this.params.endTime = e[1];
  163. },
  164. /**
  165. * 分页触发
  166. * @param {*} page
  167. */
  168. pageChange(page) {
  169. this.params.pageNum = page;
  170. this.getList();
  171. }
  172. }
  173. };
  174. </script>
  175. <style lang="scss">
  176. page {
  177. background-color: #1767f2;
  178. min-height: calc(100vh - 44px);
  179. }
  180. </style>
  181. <style lang="scss" scoped>
  182. @import './performanceRanking.scss';
  183. </style>