Browse Source

feat(接单中心): 增强我的分成筛选功能

引入新的查询参数管理,支持"我的分成"的筛选条件,优化数据获取逻辑,确保分页和状态筛选的准确性。调整样式以提升用户体验。
Yannay 2 months ago
parent
commit
c6eb96b284
1 changed files with 61 additions and 22 deletions
  1. 61 22
      pages/pagereceivecenter/pagereceivecenter.vue

+ 61 - 22
pages/pagereceivecenter/pagereceivecenter.vue

@@ -1,12 +1,15 @@
1 1
 <script>
2 2
 // import orderCard from "./compounts/orderCard.vue";
3 3
 import filterQuery from "../order/components/orderCenter/filterQuery.vue";
4
+import commissionFilterQuery from "../order/components/commission/filterQuery.vue";
5
+import dayjs from "dayjs";
4 6
 
5 7
 // status 状态 1 发单(刚发出来) 2 接单(处理中) 3 收单(入库了) 4 未收(没有收到)
6 8
 export default {
7 9
     components: {
8 10
         // orderCard,
9 11
         filterQuery,
12
+        commissionFilterQuery,
10 13
     },
11 14
     data() {
12 15
         return {
@@ -65,7 +68,24 @@ export default {
65 68
                 crmFormTacticDict: [],
66 69
             },
67 70
 
68
-            mapHeight: "0px"
71
+            mapHeight: "0px",
72
+
73
+            // 我的分成的查询参数
74
+            commissionQueryParams: {
75
+                receiptDateEnd: dayjs().format("YYYY-MM-DD"),
76
+                receiptDateStart: dayjs().startOf('month').format("YYYY-MM-DD"),
77
+                item: undefined,
78
+                phone: undefined,
79
+                receiptUserId: undefined,
80
+                pageNum: 1,
81
+                pageSize: 10,
82
+            },
83
+        }
84
+    },
85
+    computed: {
86
+        // 根据当前选择的类型返回对应的查询参数
87
+        currentQueryParams() {
88
+            return this.activeType === 3 ? this.commissionQueryParams : this.queryParams;
69 89
         }
70 90
     },
71 91
     onLoad() {
@@ -131,11 +151,10 @@ export default {
131 151
                 // 如果是"我的分成",调用分成接口
132 152
                 if (this.activeType === 3) {
133 153
                     result = await uni.$u.api.selectCommissionList({
134
-                        pageSize: this.queryParams.pageSize,
135
-                        pageNum: this.queryParams.pageNum,
154
+                        pageSize: this.commissionQueryParams.pageSize,
155
+                        pageNum: this.commissionQueryParams.pageNum,
136 156
                     }, {
137
-                        type: '2',
138
-                        ...this.queryParams
157
+                        ...this.commissionQueryParams
139 158
                     });
140 159
                     console.log('分成列表', result);
141 160
                 } else {
@@ -162,16 +181,19 @@ export default {
162 181
                     })
163 182
                 }
164 183
 
184
+                // 获取当前使用的查询参数
185
+                const params = this.activeType === 3 ? this.commissionQueryParams : this.queryParams;
186
+                
165 187
                 // 如果是第一页(下拉刷新或初始加载),直接替换列表
166
-                if (this.queryParams.pageNum === 1) {
188
+                if (params.pageNum === 1) {
167 189
                     this.orderList = result.rows;
168 190
                 } else {
169 191
                     // 否则追加数据(上拉加载更多)
170 192
                     this.orderList.push(...result.rows);
171 193
                 }
172 194
                 this.page.total = result.total;
173
-                this.page.pageNum = this.queryParams.pageNum;
174
-                this.page.pageSize = this.queryParams.pageSize;
195
+                this.page.pageNum = params.pageNum;
196
+                this.page.pageSize = params.pageSize;
175 197
 
176 198
             } catch (error) {
177 199
                 console.error('列表接口调用失败:', error);
@@ -185,6 +207,8 @@ export default {
185 207
             this.refresherTriggered = true;
186 208
             // 重置页码和列表
187 209
             this.page.pageNum = 1;
210
+            this.queryParams.pageNum = 1;
211
+            this.commissionQueryParams.pageNum = 1;
188 212
             this.orderList = [];
189 213
             // 重新获取数据
190 214
             await this.getOrderList();
@@ -290,7 +314,8 @@ export default {
290 314
             if (this.orderList.length >= this.page.total) {
291 315
                 //到底了,没有更多
292 316
             } else {
293
-                this.queryParams.pageNum++;
317
+                const params = this.activeType === 3 ? this.commissionQueryParams : this.queryParams;
318
+                params.pageNum++;
294 319
                 this.page.pageNum++;
295 320
                 this.getOrderList();
296 321
             }
@@ -345,6 +370,7 @@ export default {
345 370
 
346 371
             this.page.pageNum = 1;
347 372
             this.queryParams.pageNum = 1;
373
+            this.commissionQueryParams.pageNum = 1;
348 374
             this.orderList = [];
349 375
 
350 376
             this.getOrderList();
@@ -352,26 +378,30 @@ export default {
352 378
         },
353 379
         // 处理关键词搜索
354 380
         handleKeyword() {
355
-            this.queryParams.pageNum = 1;
381
+            const params = this.activeType === 3 ? this.commissionQueryParams : this.queryParams;
382
+            params.pageNum = 1;
356 383
             this.page.pageNum = 1;
357 384
             this.orderList = [];
358 385
             this.getOrderList();
359 386
         },
360 387
         // 处理关键词清空
361 388
         handleKeywordClear() {
362
-            this.queryParams.phone = "";
363
-            this.queryParams.pageNum = 1;
389
+            const params = this.activeType === 3 ? this.commissionQueryParams : this.queryParams;
390
+            params.phone = "";
391
+            params.pageNum = 1;
364 392
             this.page.pageNum = 1;
365 393
             this.orderList = [];
366 394
             this.getOrderList();
367 395
         },
368 396
         // 显示筛选弹窗
369 397
         handleshowFilter() {
370
-            this.$refs.filter.show();
398
+            const refName = this.activeType === 3 ? 'commissionFilter' : 'filter';
399
+            this.$refs[refName].show();
371 400
         },
372 401
         // 处理筛选查询
373 402
         handleFilterQuery() {
374
-            this.queryParams.pageNum = 1;
403
+            const params = this.activeType === 3 ? this.commissionQueryParams : this.queryParams;
404
+            params.pageNum = 1;
375 405
             this.page.pageNum = 1;
376 406
             this.orderList = [];
377 407
             this.getOrderList();
@@ -431,12 +461,13 @@ export default {
431 461
     <view class="container">
432 462
         <u-navbar title="接单中心" :autoBack="true" :placeholder="true" v-hideNav></u-navbar>
433 463
 
434
-
464
+        <!-- 筛选条件 -->
465
+        <u-tabs :list="filterList" @click="changeFilter"></u-tabs>
435 466
 
436 467
         <!-- 查询参数区域 -->
437 468
         <view class="queryParams_wrap">
438 469
             <view class="search">
439
-                <u--input clearable prefixIcon="search" v-model="queryParams.phone" shape="circle" @blur="handleKeyword"
470
+                <u--input clearable prefixIcon="search" v-model="currentQueryParams.phone" shape="circle" @blur="handleKeyword"
440 471
                     @clear="handleKeywordClear" placeholder="请输入电话"></u--input>
441 472
             </view>
442 473
             <view class="query">
@@ -445,9 +476,6 @@ export default {
445 476
             </view>
446 477
         </view>
447 478
 
448
-        <!-- 筛选条件 -->
449
-        <u-tabs :list="filterList" @click="changeFilter"></u-tabs>
450
-
451 479
 
452 480
 
453 481
         <!-- 统计数据 -->
@@ -599,9 +627,12 @@ export default {
599 627
             <!-- </view> -->
600 628
         </u-modal>
601 629
 
602
-        <!-- 筛选组件 -->
603
-        <filter-query ref="filter" v-model="queryParams" @getList="handleFilterQuery" :mapHeight="mapHeight"
630
+        <!-- 筛选组件 - 订单列表 -->
631
+        <filter-query v-if="activeType !== 3" ref="filter" v-model="queryParams" @getList="handleFilterQuery" :mapHeight="mapHeight"
604 632
             :dicts="dicts"></filter-query>
633
+        
634
+        <!-- 筛选组件 - 我的分成 -->
635
+        <commission-filter-query v-if="activeType === 3" ref="commissionFilter" v-model="commissionQueryParams" @getList="handleFilterQuery" :mapHeight="mapHeight"></commission-filter-query>
605 636
     </view>
606 637
 </template>
607 638
 
@@ -616,7 +647,8 @@ export default {
616 647
 .queryParams_wrap {
617 648
     display: flex;
618 649
     background: #fff;
619
-    padding: 14px 0;
650
+    padding: 10px 0;
651
+    border-bottom: 1px solid #f0f0f0;
620 652
 
621 653
     .query,
622 654
     .search {
@@ -630,11 +662,13 @@ export default {
630 662
 
631 663
     .query {
632 664
         flex: 1;
665
+        cursor: pointer;
633 666
     }
634 667
 
635 668
     .search {
636 669
         flex: 2;
637 670
         padding-left: 20px;
671
+        padding-right: 10px;
638 672
     }
639 673
 }
640 674
 
@@ -847,6 +881,7 @@ export default {
847 881
     flex-wrap: nowrap;
848 882
     white-space: nowrap;
849 883
     padding: 0 0rpx;
884
+    margin-top: 20rpx;
850 885
 }
851 886
 
852 887
 .statisticsItem {
@@ -912,4 +947,8 @@ export default {
912 947
 .followUpBox {
913 948
     height: 600rpx;
914 949
 }
950
+
951
+.u-tabs{
952
+    background-color: #fff;
953
+}
915 954
 </style>