shish 11 месяцев назад
Родитель
Сommit
b17d8d9ffc
1 измененных файлов с 41 добавлено и 40 удалено
  1. 41 40
      hdApp/src/admin/home/order.vue

+ 41 - 40
hdApp/src/admin/home/order.vue

@@ -23,8 +23,9 @@
       <view class="select-dn_bx">
         <DateSelect class="bar" top="0" @selectDateFn="selectDateFn" defaultShowName='时间' />
       </view>
-      <view> <AppSearchModule placeholder="这里搜索" @input="searchFn"/> </view>
-      <button class="admin-button-com middle" @click="selectStaffFn()">员工</button>
+      <view> <AppSearchModule placeholder="搜索客户" @input="searchFn"/> </view>
+      <button class="admin-button-com middle" @click="getScanOrder()" style="margin-left:15upx;">扫码</button>
+      <button class="admin-button-com middle" @click="selectStaffFn()" style="margin-left:15upx;margin-right:15upx;">员工</button>
       <button class="admin-button-com middle" @click="cancelFn()">清空</button>
     </view>
     <app-tabs :tabs="tabs" class="app-tabs" :isFixed="false" :top="50" :currentTab="tabIndex" :height="100" @change="change" itemWidth="20%" />
@@ -114,7 +115,7 @@ import { cancelExpressOrder } from '@/api/shop-express'
 import DateSelect from "@/components/module/dateSelect";
 import { getList } from "@/api/member";
 export default {
-  name: "order-list",
+  name: "order",
   components: {
     orderItem,
     AppTabs,
@@ -131,15 +132,15 @@ export default {
       staffList:[],
       shopAdminId:0,
       searchText:'',
-      debt:2,
-      searchTypeName:'价格',
-      searchType:0,
-      searchOption:['价格', '单号','手机','名称'],
       refreshPage:0,
       showSearch:false,
       searchList:[],
       showSearch:false,
-      customId:0
+      customId:0,
+      searchTime:'',
+      startTime:'',
+      endTime:'',
+      repeat:-1
     };
   },
   onPullDownRefresh () {
@@ -178,24 +179,19 @@ export default {
     }
   },
   methods: {
-    setSearchType(){
-      let that = this
-      uni.showActionSheet({
-        itemList: that.searchOption,
-        success: function (respond) {
-          let currentIndex = respond.tapIndex
-          that.searchType = currentIndex
-          that.searchTypeName = that.searchOption[currentIndex]
-          that.searchFn()
-        }
-      })
-    },
     getCustom(item){
       this.showSearch = false
       this.customId = item.id
       this.resetList()
       this.getOrderList()
     },
+    selectDateFn(val) {
+      this.searchTime = val.searchTime
+      this.startTime = val.startTime
+      this.endTime = val.endTime
+      this.resetList();
+      this.getOrderList();
+    },
     searchFn(e) {
       let that = this
       if(that.$util.isEmpty(e)){
@@ -228,6 +224,11 @@ export default {
         })          
       })
     },
+    getScanOrder(){
+      this.repeat = this.repeat == -1 ? 1 : -1
+      this.resetList()
+      this.getOrderList()
+    },
     getCurrentStaff(id){
       this.resetList();
       this.shopAdminId = id
@@ -237,20 +238,14 @@ export default {
     selectStaffFn(){
       this.$refs.getStaffRef.open('top')
     },
-    debtChangeFn(){
-      if(this.debt == 2){
-        this.debt = 1
-      }else{
-        this.debt = this.debt == 0 ? 1 : 0
-      }
-      this.resetList();
-      this.getOrderList()
-    },
     cancelFn(){
       this.resetList();
       this.shopAdminId = 0
-      this.debt = 2
       this.searchText = ''
+      this.customId = 0
+      this.searchTime = ''
+      this.startTime = ''
+      this.endTime = ''
       this.getOrderList()
     },
     printOrder(item){
@@ -266,24 +261,26 @@ export default {
     getOrderList () {
       let status = JSON.parse(JSON.stringify(this.tabIndex));
       return getListB({
+        searchTime: this.searchTime,
+        startTime: this.startTime,
+        endTime: this.endTime,
         status: status,
-        search: "",
         shopAdminId:this.shopAdminId,
         searchText:this.searchText,
-        debt:this.debt,
         page: this.list.page,
-        searchType:this.searchType
+        customId:this.customId,
+        repeat:this.repeat
       }).then(res => {
         this.completes(res);
         if (this.$util.isEmpty(res.data)){
           return false
         } 
-        this.tabs[0].value = res.data.shop.totalOrder;
-        this.tabs[1].value = res.data.shop.unPayOrder;
-        this.tabs[2].value = res.data.shop.unSendOrder;
-        this.tabs[3].value = res.data.shop.sendingOrder;
-        this.tabs[4].value = res.data.shop.finishOrder;
-      });
+        this.tabs[0].value = 0;
+        this.tabs[1].value = 0;
+        this.tabs[2].value = 0;
+        this.tabs[3].value = 0;
+        this.tabs[4].value = 0;
+      })
     },
     change (e) {
       if (this.tabIndex == e.index) {
@@ -342,6 +339,10 @@ export default {
 .app-content {
   padding-top: 100upx;
   padding-bottom: 1px;
+  .select-dn_bx {
+    padding-left: 14upx;
+    padding-right:10upx;
+  }
   .app-tabs {
     position: fixed;
     /* 手机mobile屏幕小于1000px */
@@ -361,7 +362,7 @@ export default {
     height: 100upx;
     display: flex;
     align-items: center;
-    padding: 0 30upx;
+    padding: 0 20upx;
     & > view:nth-child(2) {
       flex: 1;
     }