orderCenter.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  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="send_status_wrap">
  14. <scroll-view scroll-x="true">
  15. <view class="clue_state_list">
  16. <view @click="handleSendStatusClick(item)" v-for="(item, index) in clueSendStatusCountList " :key="index"
  17. class="clue_state_item" :class="{ active : queryParams.status === item.status }">
  18. <text>{{item.statusName}}</text>
  19. <text>({{item.count}})</text>
  20. </view>
  21. </view>
  22. </scroll-view>
  23. </view>
  24. <view class="order_item_wrap">
  25. <order-item v-for="item in listData" :key="item.id" :item="item" :type="type" :dicts="dicts"></order-item>
  26. </view>
  27. <!-- 加载更多 -->
  28. <u-loadmore :status="loadStatus" v-if="listData.length > 0" />
  29. <!-- 空状态 -->
  30. <show-emtry v-if="listData.length === 0"></show-emtry>
  31. <filter-query ref="filter" v-model="queryParams" @getList="resetData" :mapHeight="mapHeight"
  32. :dicts="dicts"></filter-query>
  33. </view>
  34. </template>
  35. <script>
  36. import pullUpRefresh from "@/utils/pullUpRefresh";
  37. import filterQuery from "./filterQuery.vue";
  38. import orderItem from "./orderItem.vue";
  39. export default {
  40. mixins: [pullUpRefresh],
  41. props: {
  42. type: {
  43. type: String,
  44. default: '2'
  45. },
  46. dicts: {
  47. type: Object,
  48. required: true
  49. }
  50. },
  51. components: {
  52. filterQuery,
  53. orderItem
  54. },
  55. data() {
  56. return {
  57. // 可以添加特定于接单中心的参数
  58. queryParams: {
  59. sendDateStart: '',
  60. sendDateEnd: '',
  61. type: '2',
  62. item: undefined,
  63. phone: undefined,
  64. deptId: undefined,
  65. state: undefined,
  66. status: undefined,
  67. allTagList: [],
  68. identification: undefined,
  69. createBy: undefined,
  70. pageNum: 1,
  71. pageSize: 10,
  72. },
  73. clueSendStatusCountList : [],
  74. mapHeight: "0px"
  75. }
  76. },
  77. methods: {
  78. getOtherData() {
  79. this.statisticsSendStatus();
  80. },
  81. async statisticsSendStatus() {
  82. const {
  83. data
  84. } = await uni.$u.api.statisticsSendStatus(this.queryParams);
  85. this.clueSendStatusCountList = data;
  86. },
  87. handleSendStatusClick(item) {
  88. this.queryParams.status = item.status;
  89. this.resetData();
  90. },
  91. handleKeyword() {
  92. this.resetData();
  93. },
  94. handleKeywordClear() {
  95. // 组件有bug 清空后的值还是存在
  96. this.queryParams.phone = "";
  97. this.resetData();
  98. },
  99. handleshowFilter() {
  100. this.$refs.filter.show();
  101. },
  102. async getList() {
  103. const {
  104. pageNum,
  105. pageSize,
  106. } = this.queryParams;
  107. this.queryParams.type = this.type;
  108. // 调用接单中心的接口
  109. const {
  110. rows,
  111. total
  112. } = await uni.$u.api.selectClueOrderFormList({
  113. pageSize,
  114. pageNum
  115. },
  116. this.queryParams
  117. );
  118. return rows;
  119. },
  120. handleOnReachBottom() {
  121. this.handleReachBottom();
  122. }
  123. },
  124. mounted() {
  125. this.resetData();
  126. // 根据路由名称设置类型
  127. this.queryParams.type = this.type;
  128. uni.getSystemInfo({
  129. success: (e) => {
  130. const {
  131. windowTop,
  132. windowBottom,
  133. windowHeight
  134. } = e;
  135. this.mapHeight = (windowHeight - 100) + 'px';
  136. }
  137. });
  138. },
  139. }
  140. </script>
  141. <style lang="scss" scoped>
  142. .send_status_wrap {
  143. width: 690rpx;
  144. padding: 0 30rpx;
  145. margin-top: 20rpx;
  146. display: flex;
  147. .clue_state_list {
  148. display: flex;
  149. .clue_state_item {
  150. font-size: 30rpx;
  151. display: inline-flex;
  152. /* 关键改动:改为行内弹性盒子 */
  153. align-items: center;
  154. /* 垂直居中 */
  155. background: #fff;
  156. margin-right: 30rpx;
  157. padding: 8rpx 16rpx;
  158. /* 增加内边距 */
  159. white-space: nowrap;
  160. /* 关键:禁止文本换行 */
  161. border-radius: 6rpx;
  162. &.active {
  163. color: #fff;
  164. background: #4c8afe;
  165. }
  166. }
  167. }
  168. }
  169. .order_center_wrap {
  170. box-sizing: border-box;
  171. min-height: 100vh;
  172. .queryParams_wrap {
  173. display: flex;
  174. background: #fff;
  175. padding: 14px 0;
  176. .query,
  177. .search {
  178. display: flex;
  179. align-items: center;
  180. justify-content: center;
  181. font-size: 16px;
  182. font-weight: 700;
  183. color: #202020;
  184. }
  185. .query {
  186. flex: 1;
  187. }
  188. .search {
  189. flex: 2;
  190. padding-left: 20px;
  191. }
  192. }
  193. }
  194. .order_item_wrap {
  195. padding: 10px 20px;
  196. }
  197. .empty_wrap {
  198. margin-top: 100px;
  199. }
  200. </style>