Browse Source

执行中列表根据状态进行筛选

seimin 3 years ago
parent
commit
2246100b5c
1 changed files with 67 additions and 5 deletions
  1. 67 5
      pages/receiptpage/receiptpage.vue

+ 67 - 5
pages/receiptpage/receiptpage.vue

@@ -3,7 +3,13 @@
3 3
     <view class="page_tab">
4 4
       <view class="page_tab_bar" :class="{ active: item.label === selectedLabelSlots }" v-for="item in tabs"
5 5
         :key="item.value" @click="clickHandler(item.label)">
6
-        {{ item.label }}<text class="tab_num">( {{ item.num }} )</text>
6
+        {{ item.label }}
7
+        <text class="tab_num">( {{ item.num }} )</text>
8
+        <view class="more" v-if="item.label==='执行中'"></view>
9
+        <picker class="more_picker" v-if="item.label==='执行中'" @click.stop @change="execFilter($event)" :value="index"
10
+          :range="array" range-key="name">
11
+          <view class="uni-input">{{array[index].name}}</view>
12
+        </picker>
7 13
       </view>
8 14
     </view>
9 15
     <view v-if="zxzData.length == 0" class="zwsj">
@@ -225,6 +231,22 @@
225 231
   export default {
226 232
     data() {
227 233
       return {
234
+        // 筛选条件
235
+        array: [{
236
+          id: 0,
237
+          name: '全部'
238
+        }, {
239
+          id: 71,
240
+          name: '待到达'
241
+        }, {
242
+          id: 72,
243
+          name: '待送达'
244
+        }, {
245
+          id: 75,
246
+          name: '执行中'
247
+        }, ],
248
+        index: 0,
249
+        arrayKey: 0,
228 250
         // 当前登录人是否是药房角色
229 251
         pharmacistFlag: false,
230 252
         // 抢单的id
@@ -298,6 +320,20 @@
298 320
       bigScreen,
299 321
     },
300 322
     methods: {
323
+      // 执行中筛选
324
+      execFilter({
325
+        detail: {
326
+          value
327
+        }
328
+      }) {
329
+        this.index = value;
330
+        this.arrayKey = this.array[value].id;
331
+        this.zxzData = [];
332
+        this.totalNum = -1;
333
+        this.idx = 0;
334
+        this.selectedLabelSlots = '执行中';
335
+        this.executingOrders(0);
336
+      },
301 337
       // 获取科室二维码设置开关
302 338
       getMenu() {
303 339
         let menu = uni.getStorageSync('userData').menu;
@@ -327,10 +363,6 @@
327 363
               text: "二维码设置",
328 364
             });
329 365
           }
330
-          // --------------------------
331
-
332
-
333
-          // --------------------------
334 366
         })
335 367
       },
336 368
       // 拍照
@@ -670,6 +702,7 @@
670 702
       },
671 703
       //执行中列表数据获取
672 704
       executingOrders(idx) {
705
+        console.log(this.zxzData.length,this.totalNum)
673 706
         if (this.zxzData.length == this.totalNum) {
674 707
           uni.showToast({
675 708
             icon: "none",
@@ -682,6 +715,11 @@
682 715
           idx,
683 716
           sum: 20,
684 717
         };
718
+        if (this.arrayKey) {
719
+          data.keyWord = this.arrayKey;
720
+        } else {
721
+          delete data.keyWord;
722
+        }
685 723
         uni.showLoading({
686 724
           title: "加载中",
687 725
           mask: true,
@@ -794,6 +832,11 @@
794 832
           idx: 0,
795 833
           sum: 20,
796 834
         };
835
+        if (this.arrayKey) {
836
+          data.keyWord = this.arrayKey;
837
+        } else {
838
+          delete data.keyWord;
839
+        }
797 840
         post("/workerOrder/executingOrders", data).then((res) => {
798 841
           if (res.status == 200) {
799 842
             this.tabs[1].num = res.data.resultCount;
@@ -912,6 +955,25 @@
912 955
           margin-left: 8rpx;
913 956
         }
914 957
 
958
+        .more {
959
+          position: absolute;
960
+          right: 20rpx;
961
+          width: 40rpx;
962
+          height: 4rpx;
963
+          border-top: 2px solid #49b856;
964
+          border-bottom: 2px solid #49b856;
965
+          background-color: #49b856;
966
+          padding: 5px 0;
967
+          background-clip: content-box;
968
+        }
969
+
970
+        .more_picker {
971
+          position: absolute;
972
+          right: 0;
973
+          height: 100%;
974
+          opacity: 0;
975
+        }
976
+
915 977
         &.active {
916 978
           color: #49b856;
917 979