yuhao il y a 2 ans
Parent
commit
c947cd9e1c
1 fichiers modifiés avec 21 ajouts et 32 suppressions
  1. 21 32
      src/pages/home/index.vue

+ 21 - 32
src/pages/home/index.vue

@@ -227,7 +227,7 @@ export default {
227 227
       isGoodsPanel: false, //控制确认核销打开关闭
228 228
       goodsCode: "", //美妆核销码
229 229
       goodsList: "", //美妆核销信息
230
-      orderKeyWord:'',//订单搜索关键字
230
+      orderKeyWord: "", //订单搜索关键字
231 231
     };
232 232
   },
233 233
   components: {
@@ -238,7 +238,6 @@ export default {
238 238
   created: function () {
239 239
     this.getTotal();
240 240
     // this.getToday()
241
-    this.getDate();
242 241
   },
243 242
   destroyed() {
244 243
     this.cancelScan();
@@ -249,7 +248,7 @@ export default {
249 248
     goodsPickUp() {
250 249
       api.goodsPickUp({ code: this.goodsCode }).then((res) => {
251 250
         this.goodsList = res.data;
252
-		this.isGoodsPanel = true;
251
+        this.isGoodsPanel = true;
253 252
       });
254 253
     },
255 254
     // 美妆产品取货
@@ -257,7 +256,7 @@ export default {
257 256
       api.goodsTakeOut({ id: this.goodsList.id }).then((res) => {
258 257
         if (res.code == 200) {
259 258
           this.$message.success("取货成功");
260
-          this.isGoodsPanel=false
259
+          this.isGoodsPanel = false;
261 260
           this.goodsCode = "";
262 261
           this.goodsList = "";
263 262
         }
@@ -277,24 +276,6 @@ export default {
277 276
         },
278 277
       });
279 278
     },
280
-    // 获取当天日期&&当天预约总数
281
-    getDate() {
282
-      let date = new Date();
283
-      this.date = date.getMonth() + 1 + "月" + date.getDate() + "日";
284
-      let day =
285
-        date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate();
286
-      api
287
-        .reservedRecords({
288
-          day,
289
-        })
290
-        .then((res) => {
291
-          let total = 0;
292
-          res.data.forEach((item) => {
293
-            total = item.list.length + total;
294
-          });
295
-          this.totalSum = total;
296
-        });
297
-    },
298 279
     // 扫码核销订单
299 280
     cancelQR() {
300 281
       this.startRecognize();
@@ -362,6 +343,11 @@ export default {
362 343
           this.tabList[0].num = res.data.order_num;
363 344
           this.tabList[1].num = res.data.wait_pay_num;
364 345
           this.tabList[2].num = res.data.cancel_num;
346
+          // 今天日期
347
+          let date = new Date();
348
+          this.date = date.getMonth() + 1 + "月" + date.getDate() + "日";
349
+          // 订单总数
350
+          this.totalSum = Number(res.data.order_num)+Number(res.data.wait_pay_num)+Number(res.data.cancel_num)
365 351
         }
366 352
       });
367 353
     },
@@ -372,20 +358,21 @@ export default {
372 358
       this.loading = false;
373 359
       this.finished = false;
374 360
       this.page = 1;
361
+      this.getToday();
375 362
     },
376 363
     //搜索订单
377
-    searchOrder(){
364
+    searchOrder() {
378 365
       setTimeout(() => {
379 366
         api
380 367
           .getToday({
381 368
             page: 1,
382 369
             limit: 20,
383 370
             type: 0,
384
-            keywords:this.orderKeyWord
371
+            keywords: this.orderKeyWord,
385 372
           })
386 373
           .then((res) => {
387 374
             if ((res.code = 200)) {
388
-              this.orderList = res.data.list
375
+              this.orderList = res.data.list;
389 376
             }
390 377
           });
391 378
       }, 1000);
@@ -692,28 +679,27 @@ export default {
692 679
   .order-list {
693 680
     margin-top: 18px;
694 681
     width: 100%;
695
-    background: #ffffff;
682
+    background: #f7f8fa;
696 683
     box-shadow: 0px 2px 4px 0px rgba(184, 191, 198, 0.2);
697 684
     border-radius: 8px;
698 685
     overflow: hidden;
699 686
 
700
-    // padding:0px 12px 14px 12px;
701 687
     .order-list-top {
702 688
       width: 100%;
703 689
       height: 48px;
704 690
       display: flex;
705
-
691
+      background-color: #fff;
706 692
       .tab {
707 693
         width: 402px;
708 694
         height: 48px;
709 695
         background-color: #ffffff;
710 696
         display: flex;
711 697
         overflow: hidden;
712
-
698
+        border-radius: 8px;
713 699
         .tabItem {
714 700
           width: 134px;
715 701
           height: 48px;
716
-          background: #ffffff;
702
+          background-color: #ffffff;
717 703
           text-align: center;
718 704
           line-height: 48px;
719 705
           font-size: 20px;
@@ -722,6 +708,7 @@ export default {
722 708
           position: relative;
723 709
           display: flex;
724 710
           justify-content: center;
711
+          border-radius: 8px;
725 712
         }
726 713
 
727 714
         .tabName {
@@ -753,7 +740,7 @@ export default {
753 740
 
754 741
       .search {
755 742
         flex: 1;
756
-        border-radius: 0px 0px 0px 30px;
743
+        border-radius: 0px 0px 0px 24px;
757 744
         background-color: #f7f8fa;
758 745
         display: flex;
759 746
         align-items: center;
@@ -792,7 +779,9 @@ export default {
792 779
     .list-info {
793 780
       height: 450px;
794 781
       overflow: auto;
795
-
782
+      border-radius: 0 8px 0 0;
783
+      overflow: hidden;
784
+      background-color: #fff;
796 785
       .user-info {
797 786
         padding: 14px 0;
798 787
         border-bottom: 1px solid #e6e6e6;