orderCenter.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. <template>
  2. <view class="order_center_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="order_item_wrap">
  14. <order-item v-for="item in listData" :key="item.id" :item="item" :type="type" :dicts="dicts"></order-item>
  15. </view>
  16. <!-- 加载更多 -->
  17. <u-loadmore :status="loadStatus" v-if="listData.length > 0" />
  18. <!-- 空状态 -->
  19. <show-emtry v-if="listData.length === 0"></show-emtry>
  20. <filter-query ref="filter" v-model="queryParams" @getList="resetData" :mapHeight="mapHeight"
  21. :dicts="dicts"></filter-query>
  22. </view>
  23. </template>
  24. <script>
  25. import pullUpRefresh from "@/utils/pullUpRefresh";
  26. import filterQuery from "./filterQuery.vue";
  27. import orderItem from "./orderItem.vue";
  28. export default {
  29. mixins: [pullUpRefresh],
  30. props: {
  31. type: {
  32. type: String,
  33. default: '2'
  34. },
  35. dicts: {
  36. type: Object,
  37. required: true
  38. }
  39. },
  40. components: {
  41. filterQuery,
  42. orderItem
  43. },
  44. data() {
  45. return {
  46. // 可以添加特定于接单中心的参数
  47. queryParams: {
  48. sendDateStart: '',
  49. sendDateEnd: '',
  50. type: '2',
  51. item: undefined,
  52. phone: undefined,
  53. deptId: undefined,
  54. state: undefined,
  55. status: undefined,
  56. allTagList: [],
  57. identification: undefined,
  58. createBy: undefined,
  59. pageNum: 1,
  60. pageSize: 10,
  61. },
  62. mapHeight: "0px"
  63. }
  64. },
  65. methods: {
  66. handleKeyword() {
  67. this.resetData();
  68. },
  69. handleKeywordClear() {
  70. // 组件有bug 清空后的值还是存在
  71. this.queryParams.phone = "";
  72. this.resetData();
  73. },
  74. handleshowFilter() {
  75. this.$refs.filter.show();
  76. },
  77. async getList() {
  78. const {
  79. pageNum,
  80. pageSize,
  81. } = this.queryParams;
  82. this.queryParams.type = this.type;
  83. // 调用接单中心的接口
  84. const {
  85. rows,
  86. total
  87. } = await uni.$u.api.selectClueOrderFormList({
  88. pageSize,
  89. pageNum
  90. },
  91. this.queryParams
  92. );
  93. return rows;
  94. },
  95. handleOnReachBottom() {
  96. this.handleReachBottom();
  97. }
  98. },
  99. mounted() {
  100. this.resetData();
  101. // 根据路由名称设置类型
  102. this.queryParams.type = this.type;
  103. uni.getSystemInfo({
  104. success: (e) => {
  105. const {
  106. windowTop,
  107. windowBottom,
  108. windowHeight
  109. } = e;
  110. this.mapHeight = windowHeight + 'px';
  111. }
  112. });
  113. },
  114. }
  115. </script>
  116. <style lang="scss" scoped>
  117. .order_center_wrap {
  118. box-sizing: border-box;
  119. min-height: 100vh;
  120. .queryParams_wrap {
  121. display: flex;
  122. background: #fff;
  123. padding: 14px 0;
  124. .query,
  125. .search {
  126. display: flex;
  127. align-items: center;
  128. justify-content: center;
  129. font-size: 16px;
  130. font-weight: 700;
  131. color: #202020;
  132. }
  133. .query {
  134. flex: 1;
  135. }
  136. .search {
  137. flex: 2;
  138. padding-left: 20px;
  139. }
  140. }
  141. }
  142. .order_item_wrap {
  143. padding: 20px 20px;
  144. }
  145. .empty_wrap {
  146. margin-top: 100px;
  147. }
  148. </style>