Parcourir la source

今日实收,今日欠款,总欠款三个的详情面实现

shizhongqi il y a 4 ans
Parent
commit
9280217c9a

+ 29 - 44
ghsApp/src/admin/home/newOrderList.vue

@@ -2,26 +2,24 @@
   <view class="app-main app-content">
     <view class="input-wrap_box">
 
-      <view @click="setSearchType" style="font-size:30upx;margin-right:10upx;color:#666666">
+      <view @click="setSearchType" style="font-size:28upx;margin-right:10upx;color:#666666">
       <text>{{searchTypeName}}</text>
       <i class="iconfont iconsanjiao_xia"></i>
       </view>
 
-      <!-- <view> <AppSearchModule placeholder="输入拼音首字母搜索" @input="searchFn"/> </view> -->
+      <view> <AppSearchModule placeholder="输入拼音首字母搜索" @input="searchFn"/> </view>
 
-      <view class="select-dn_bx">
+      <!-- <view class="select-dn_bx">
         <DateSelect class="bar" top="0" @selectDateFn="selectDateFn" defaultShowName='时间' />
-      </view>
+      </view> -->
     </view>
     <view class="app-tabs">
-      <app-tabs :tabs="tabs" :isFixed="false" :top="50" :currentTab="tabIndex" :height="100" @change="change" itemWidth="20%" />
+      <app-tabs :tabs="tabs" :isFixed="false" :top="50" :currentTab="tabIndex" :height="100" @change="change" itemWidth="33%" />
     </view>
     <div class="list-wrap">
       <block v-if="!$util.isEmpty(list.data)">
         <div class="list" v-for="(item, index) in list.data" :key="index">
-
           <OrderItem :item="item" :isScanEnv="isScanEnv" @printOrder="printOrder"></OrderItem>
-
         </div>
       </block>
       <block v-else>
@@ -40,11 +38,11 @@ import AppWrapperEmpty from "@/components/app-wrapper-empty";
 import ModalModule from "@/components/plugin/modal";
 import { list } from "@/mixins";
 import { mapGetters } from "vuex";
-import { getListB} from "@/api/order";
-//import AppSearchModule from "@/components/module/app-search";
+import { getNewOrderList} from "@/api/order";
+import AppSearchModule from "@/components/module/app-search";
 import DropShopSelect from "@/components/module/shopSelect";
 import OrderItem from "./components/OrderItem";
-import DateSelect from "@/components/module/dateSelect";
+//import DateSelect from "@/components/module/dateSelect";
 import { cloudPrintOrder } from "@/api/order"
 export default {
   name: "order-list",
@@ -52,10 +50,10 @@ export default {
     AppTabs,
     AppWrapperEmpty,
     ModalModule,
-    //AppSearchModule,
+    AppSearchModule,
     DropShopSelect,
     OrderItem,
-    DateSelect,
+    //DateSelect,
     NotLogin
   },
   mixins: [list],
@@ -69,32 +67,23 @@ export default {
       customizationTime: [], //时间段
       customizationTimeType: "", //时间段
       tabIndex: 0,
+      selectType: 0,
       tabs: [
         {
-          name: "全部",
+          name: "今日实收",
           value: 0,
           id: 0,
         },
         {
-          name: "待付款",
+          name: "今日欠款",
           value: 0,
           id: 1,
         },
         {
-          name: "待配送",
+          name: "所有欠款",
           value: 0,
           id: 2,
-        },
-        {
-          name: "配送中",
-          value: 0,
-          id: 3,
-        },
-        {
-          name: "已完成",
-          value: 0,
-          id: 4,
-        },
+        }
       ],
       selectItemId: "",
       operateIndex: null,
@@ -126,14 +115,11 @@ export default {
       uni.stopPullDownRefresh();
     }
   },
-  mounted() {
-  },
   onLoad(option) {
-    let tabIndex = uni.getStorageSync("switchTabQuery") || null;
-    if (tabIndex) {
-      uni.removeStorageSync("switchTabQuery");
-      this.tabIndex = parseInt(tabIndex.tabIndex);
-    }
+    this.selectType = parseInt(option.type)
+    console.log(this.selectType)
+    this.tabIndex = parseInt(option.type) - 1
+    
     this._list();
 
     // #ifdef APP-PLUS
@@ -141,10 +127,6 @@ export default {
       this.isScanEnv = true
     }
 	  //#endif
-
-  },
-  onShow() {
-
   },
   methods: {
     printOrder(item){
@@ -191,11 +173,12 @@ export default {
       this._list()
     },
     _list() {
-      return getListB({
+      return getNewOrderList({
         searchTime: this.searchTime,
         startTime: this.startTime,
         endTime: this.endTime,
-        status: this.tabs[this.tabIndex].id,
+        //status: this.tabs[this.tabIndex].id,
+        type: this.selectType,
         name: this.seekVal,
         page: this.list.page,
         searchType:this.searchType,
@@ -204,11 +187,12 @@ export default {
         if (this.$util.isEmpty(res.data)){
           return false
         }
-        this.tabs[0].value = res.data.totalNum || 0;
-        this.tabs[1].value = res.data.shop.unPayOrder || 0;
-        this.tabs[2].value = res.data.shop.unSendOrder || 0;
-        this.tabs[3].value = res.data.shop.sendingOrder || 0;
-        this.tabs[4].value = res.data.shop.finishOrder || 0;
+        
+        this.tabs[0].value = '';
+        this.tabs[1].value = '';
+        this.tabs[2].value = '';
+
+        this.tabs[res.data.type - 1].value = res.data.totalNum == 0 ? '' : res.data.totalNum;
       });
     },
     change(e) {
@@ -216,6 +200,7 @@ export default {
         return false;
       } else {
         this.tabIndex = e.index;
+        this.selectType = e.index + 1;
         this.resetList();
         this._list();
       }

+ 1 - 2
ghsApp/src/admin/home/workbench.vue

@@ -279,8 +279,7 @@ export default {
 			this.$util.pageTo({url: item.page})
 		},
 		pageToNewOrderList(item) {
-			console.log(item)
-			this.$util.pageTo({url: 'admin/home/newOrderList?type=' + item})
+			this.$util.pageTo({url: "newOrderList?type="+item, type: 2})
 		},
 		getMyMall(){
 			console.log('pagesPurchase/ghsProduct?shopId='+ this.loginInfo.shopId+'&id=0&ghsShopAdminId='+this.loginInfo.shopAdminId)

+ 7 - 0
ghsApp/src/api/order/index.js

@@ -12,6 +12,13 @@ export const getList = data => {
 	return https.get("/order/list", data);
 };
 
+/**
+ * 新订单列表
+ */
+export const getNewOrderList = data => {
+	return https.get("/order/new-order-list", data)
+}
+
 /** *
  * 订单详情 m
  */

+ 2 - 2
ghsApp/src/components/module/app-search.vue

@@ -1,6 +1,6 @@
 <template>
 	<div class="app-search-module" :style="{ height: height + 'upx' }">
-		<div class="map-search" :style="{ backgroundColor: backColor }" style="height: 110upx">
+		<div class="map-search" :style="{ backgroundColor: backColor }" style="height: 90upx">
 			<div class="icon-wrap" v-if="isIcon">
 				<i class="iconfont" :class="[icon]"></i>
 			</div>
@@ -33,7 +33,7 @@ export default {
 		// 搜索组件的高度
 		height: {
 			type: Number,
-			default: 110
+			default: 90
 		},
 		placeholder: {
 			type: String,

+ 28 - 4
ghsApp/src/utils/util.js

@@ -245,20 +245,44 @@ export const pageTo = item => {
 		let allUrl = `${item.url}${query}`;
 		if (item.type == 2) {
 			uni.redirectTo({
-				url: allUrl
+				url: allUrl,
+				success(res) {
+					
+				},
+				fail(err) {
+					console.log(err);
+				}
 			});
 		} else if (item.type == 3) {
 			uni.reLaunch({
-				url: allUrl
+				url: allUrl,
+				success(res) {
+					
+				},
+				fail(err) {
+					console.log(err);
+				}
 			});
 		} else if (item.type == 4) {
 			uni.setStorageSync("switchTabQuery", item.query);
 			uni.switchTab({
-				url: item.url
+				url: item.url,
+				success(res) {
+					
+				},
+				fail(err) {
+					console.log(err);
+				}
 			});
 		} else {
 			uni.navigateTo({
-				url: allUrl
+				url: allUrl,
+				success(res) {
+					
+				},
+				fail(err) {
+					console.log(err);
+				}
 			});
 		}
 	}