wangn 5 سال پیش
والد
کامیت
0fe8eb2c15

+ 1 - 1
hdApp/src/admin/home/workbench.vue

@@ -209,7 +209,7 @@ export default {
         {
         {
           name: "采购",
           name: "采购",
           img: `${this.$constant.imgUrl}/ghs/home/icon_caigou.png`,
           img: `${this.$constant.imgUrl}/ghs/home/icon_caigou.png`,
-          url: "/pagesPurchase/order"
+          url: "/pagesPurchase/shopping"
         },
         },
         {
         {
           name: "收款",
           name: "收款",

+ 11 - 3
hdApp/src/pages.json

@@ -69,7 +69,7 @@
 			}
 			}
 		},
 		},
 		{
 		{
-			"path": "common/pageSuccess",
+			"path": "common/pageSuccess",  
 			"style": {
 			"style": {
 				"navigationBarBackgroundColor": "#ffffff",
 				"navigationBarBackgroundColor": "#ffffff",
 				"navigationBarTextStyle": "black"
 				"navigationBarTextStyle": "black"
@@ -694,12 +694,20 @@
 					}
 					}
 				},
 				},
 				{
 				{
-					"path": "order",
+					"path": "order", 
 					"style": {
 					"style": {
 						"navigationBarTitleText": "采购",
 						"navigationBarTitleText": "采购",
 						"enablePullDownRefresh": true
 						"enablePullDownRefresh": true
 					}
 					}
-				},{
+				},
+        {
+					"path": "shopping",
+					"style": {
+						"navigationBarTitleText": "采购",
+						"enablePullDownRefresh": true
+					}
+				},
+        {
 					"path": "ghsProduct",
 					"path": "ghsProduct",
 					"style": {
 					"style": {
 						"navigationBarTitleText": "",
 						"navigationBarTitleText": "",

+ 8 - 50
hdApp/src/pagesPurchase/order.vue

@@ -1,16 +1,5 @@
 <template>
 <template>
   <view class="order-page">
   <view class="order-page">
-    <!-- @add="addEvent"
-				isAdd
-				addText="筛选" -->
-    <view class="tabs">
-      <view
-        v-for="(item, index) in tabList"
-        :key="index"
-        :class="{'active': tabIndex === index}"
-        @click="changeTabEvent(index)"
-      >{{item}}</view>
-    </view>
     <scroll-view
     <scroll-view
       scroll-y
       scroll-y
       class="order_list"
       class="order_list"
@@ -62,26 +51,6 @@
         </block>
         </block>
       </block>
       </block>
     </scroll-view>
     </scroll-view>
-    <scroll-view
-      class="pay_list"
-      v-if="tabIndex == 1"
-    >
-      <block v-if="!$util.isEmpty(list.data)">
-        <OrderItem
-          v-for="(item, index) in list.data"
-          :key="index"
-          :info="item"
-          @click="gotoDetails"
-        >
-        </OrderItem>
-      </block>
-      <block v-else>
-        <AppWrapperEmpty
-          title="暂无数据"
-          :is-empty="$util.isEmpty(list.data)"
-        />
-      </block>
-    </scroll-view>
     <kd-entrance></kd-entrance>
     <kd-entrance></kd-entrance>
   </view>
   </view>
 </template>
 </template>
@@ -93,7 +62,7 @@ import { ghsList, purchaseList } from "@/api/purchase/index";
 export default {
 export default {
   components: {
   components: {
     AppWrapperEmpty,
     AppWrapperEmpty,
-    OrderItem
+    OrderItem,
   },
   },
   data () {
   data () {
     return {
     return {
@@ -106,8 +75,11 @@ export default {
           name: "采购记录",
           name: "采购记录",
           key: "1",
           key: "1",
         },
         },
+        {
+          name: "111",
+          key: "1",
+        },
       ],
       ],
-      tabList: ['供货商', '采购记录'],
       list: {
       list: {
         data: []
         data: []
       },
       },
@@ -117,7 +89,9 @@ export default {
   },
   },
   mounted () {
   mounted () {
     this.getGHSList()
     this.getGHSList()
-    this.getpurchaseList()
+  },
+  onPullDownRefresh() {
+    this.getGHSList()
   },
   },
   methods: {
   methods: {
     enter (item) {
     enter (item) {
@@ -130,22 +104,6 @@ export default {
         console.log(this.supplierList, 111)
         console.log(this.supplierList, 111)
       }).catch(err => { console.log(err) })
       }).catch(err => { console.log(err) })
     },
     },
-    // tab切换
-    changeTabEvent (info) {
-      const index = info;
-      if (this.tabIndex == index) {
-        return false;
-      } else {
-        this.tabIndex = index;
-      }
-    },
-    // 获取采购记录列表
-    getpurchaseList () {
-      purchaseList({ status: 0 }).then(res => {
-        console.log(res, 222222)
-        this.list.data = res.data.list
-      }).catch(err => { console.log(err) })
-    },
     // 结账
     // 结账
     settleAccounts (item) {
     settleAccounts (item) {
       console.log('点击了结账', item)
       console.log('点击了结账', item)

+ 4 - 4
hdApp/src/pagesPurchase/orderItem.vue

@@ -59,16 +59,16 @@ export default {
       let statusName = "";
       let statusName = "";
 
 
       switch (this.info.status) {
       switch (this.info.status) {
-        case 1:
+        case '1':
           statusName = "待付款";
           statusName = "待付款";
           break;
           break;
-        case 2:
+        case '2':
           statusName = "待配送";
           statusName = "待配送";
           break;
           break;
-        case 3:
+        case '3':
           statusName = "配送中";
           statusName = "配送中";
           break;
           break;
-        case 4:
+        case '4':
           statusName = "已完成";
           statusName = "已完成";
           break;
           break;
 
 

+ 219 - 0
hdApp/src/pagesPurchase/shopping.vue

@@ -0,0 +1,219 @@
+<template>
+  <view class="order-page">
+    <app-tabs
+			:tabs="tabs"
+			:isFixed="true"
+			:currentTab="tabIndex"
+			@change="change"
+			itemWidth="20%"
+		/>
+    <scroll-view
+      class="pay_list"
+    >
+      <block v-if="!$util.isEmpty(list.data)">
+        <OrderItem
+          v-for="(item, index) in list.data"
+          :key="index"
+          :info="item"
+          @click="gotoDetails"
+        >
+        </OrderItem>
+      </block>
+      <block v-else>
+        <AppWrapperEmpty
+          title="暂无数据"
+          :is-empty="$util.isEmpty(list.data)"
+        />
+      </block>
+    </scroll-view>
+    <view class="app-footer open_btn">
+			<view @click="addEvent" class="admin-button-com middle blue">新增采购</view>
+		</view>
+    <kd-entrance></kd-entrance>
+  </view>
+</template>
+
+<script>
+import AppTabs from "@/components/plugin/tabs";
+import OrderItem from "./orderItem";
+import AppWrapperEmpty from "@/components/app-wrapper-empty";
+import { ghsList, purchaseList } from "@/api/purchase/index";
+export default {
+  components: {
+    AppWrapperEmpty,
+    OrderItem,
+    AppTabs
+  },
+  data () {
+    return {
+       tabs: [
+        {
+          name: "全部",
+          value: 0,
+          key: '0'
+        },
+        {
+          name: "待付款",
+          value: 0,
+          key: '1'
+        },
+        {
+          name: "待配送",
+          value: 0,
+          key: '2'
+        },
+        {
+          name: "配送中",
+          value: 0,
+          key: '3'
+        },
+        {
+          name: "已完结",
+          value: 0,
+          key: '4'
+        }
+      ],
+      list: {
+        data: []
+      },
+      supplierList: [],
+      tabIndex: 0,
+      status: '0'
+    }
+  },
+  mounted () {
+    this.getpurchaseList()
+  },
+  onPullDownRefresh() {
+    this.getpurchaseList().then(res => {
+			uni.stopPullDownRefresh()
+		})
+  },
+  methods: {
+    // tab切换
+    change(e) {
+			if (this.tabIndex == e.index) {
+				return false;
+			} else {
+				this.tabIndex = e.index;
+        console.log(e.item.key)
+        this.status = e.item.key
+        this.getpurchaseList()
+			}
+		},
+    // 获取采购记录列表
+    getpurchaseList () {
+      purchaseList({ status: this.status }).then(res => {
+        console.log(res, 222222)
+        this.list.data = res.data.list
+        this.tabs[0].value = res.data.allNum
+        this.tabs[1].value = res.data.unPayNum
+        this.tabs[2].value = res.data.unSendNum
+        this.tabs[3].value = res.data.sendingNum
+        this.tabs[4].value = res.data.finishNum
+      }).catch(err => { console.log(err) })
+    },
+    // 采购记录详情
+    gotoDetails (val) {
+      console.log(val)
+      uni.navigateTo({
+        url: '/pagesPurchase/purDetails?status=' + val.status + '&id=' + val.id
+      })
+    },
+    // 去往采购页面
+    addEvent() {
+      uni.navigateTo({url: '/pagesPurchase/order'})
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.order-page {
+  .tabs {
+    height: 80upx;
+    line-height: 80upx;
+    & > view {
+      // padding: 0 80upx;
+      width: 50%;
+      text-align: center;
+      font-size: 28upx;
+      color: #666;
+      display: inline-block;
+    }
+    & > .active {
+      position: relative;
+      color: #3385ff;
+      font-weight: 700;
+    }
+    & > .active::after {
+      content: "";
+      position: absolute;
+      bottom: 0;
+      left: 50%;
+      transform: translateX(-50%);
+      width: 70upx;
+      height: 6upx;
+      background: #3385ff;
+    }
+  }
+  .order_list {
+    // height: 200upx;
+    height: 100%;
+    background: #f0f2f6;
+    padding: 0 0 20upx;
+    .list_item {
+      margin: 20upx 0 0;
+      // padding-left: 20upx;
+      position: relative;
+      height: 180upx;
+      width: 100vw;
+      background: #fff;
+      display: flex;
+      align-items: center;
+      & > image {
+        margin-left: 30upx;
+        width: 120upx;
+        height: 120upx;
+        border-radius: 60upx;
+      }
+      & > .store_name {
+        margin-left: 30upx;
+        & > .store_title {
+          margin-bottom: 30upx;
+          font-size: 32upx;
+          font-weight: 700;
+          color: #333;
+        }
+        & > .accumulative {
+          font-size: 26upx;
+          color: #999;
+        }
+      }
+      & > .store_btn {
+        position: absolute;
+        right: 30upx;
+        // padding-right: 30upx;
+        & > .btn_entrance {
+          display: inline-block;
+          font-size: 26upx;
+          color: #3385ff;
+          border: 1px solid #3385ff;
+          border-radius: 8px;
+          padding: 15upx 30upx;
+          margin-left: 30upx;
+        }
+        & > .btn_forbid {
+          border: 1px solid #999;
+          color: #999;
+        }
+      }
+    }
+  }
+  .pay_list {
+    padding-top: 100upx;
+    padding-bottom: 100upx;
+    background-color: #f0f2f6;
+  }
+}
+</style>

+ 1 - 0
hdApp/src/pagesPurchase/wechatPay.vue

@@ -151,6 +151,7 @@ export default {
       uni.navigateTo({
       uni.navigateTo({
         url: '/pagesPurchase/setPsd'
         url: '/pagesPurchase/setPsd'
       })
       })
+      this.setPassModal = false
     },
     },
     // 点击数字键盘
     // 点击数字键盘
     clickKeyFn (val) {
     clickKeyFn (val) {