Răsfoiți Sursa

新增供货商列表页面

wangning 5 ani în urmă
părinte
comite
652b5ace44
1 a modificat fișierele cu 206 adăugiri și 0 ștergeri
  1. 206 0
      ghsApp/src/pagesPurchase/supplier.vue

+ 206 - 0
ghsApp/src/pagesPurchase/supplier.vue

@@ -0,0 +1,206 @@
+<template>
+  <view class="order-page">
+    <scroll-view
+      scroll-y
+      class="order_list"
+      scroll-view
+    >
+        <!-- 供货商列表 -->
+        <!-- <block v-if="!$util.isEmpty(supplierList)"> -->
+          <!-- <view
+            class="list_item"
+            v-for="(item, index) in supplierList"
+            :key="index"
+            @click="enter(item)"
+          >
+            <image :src="item.avatar"></image>
+            <view class="store_name">
+              <view class="store_title">{{item.name}}</view>
+              <view class="accumulative">欠款: {{item.debtAmount}}</view>
+            </view>
+            <view class="store_btn">
+              <view class="btn_entrance" v-if="Number(item.debtAmount) > 0" @click.stop="settleAccounts(item)" >
+                结账
+              </view>
+              <view class="btn_entrance btn_forbid" v-else @click.stop="" >
+                结账
+              </view>
+              <view class="btn_entrance" @click.stop="enter(item)" >
+                采购
+              </view>
+            </view>
+          </view> -->
+          <view class="list_item" v-for="(item, index) in 8" :key="index">
+            <image src="https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=3015225555,4165558783&fm=26&gp=0.jpg"></image>
+            <view class="store_name">
+              <view class="store_title">明星花卉</view>
+              <view class="accumulative">欠款: 5800</view>
+            </view>
+            <view class="store_btn">
+              <view class="btn_entrance">
+                结账
+              </view>
+              <view class="btn_entrance">
+                采购
+              </view>
+            </view>
+          </view>
+        <!-- </block> -->
+        <!-- <block v-else> -->
+          <!-- <AppWrapperEmpty
+            title="暂无数据"
+            :is-empty="$util.isEmpty(supplierList)"
+          /> -->
+        <!-- </block> -->
+    </scroll-view>
+    <!-- 按钮 -->
+			<div class="app-footer">
+				<div class="admin-button-com middle blue">添加供货商</div>
+			</div>
+  </view>
+</template>
+
+<script>
+import AppWrapperEmpty from "@/components/app-wrapper-empty";
+import { ghsList, purchaseList } from "@/api/purchase/index";
+export default {
+  components: {
+    AppWrapperEmpty,
+  },
+  data () {
+    return {
+      tabs: [
+        {
+          name: "供货商",
+          key: "",
+        },
+        {
+          name: "采购记录",
+          key: "1",
+        },
+        {
+          name: "111",
+          key: "1",
+        },
+      ],
+      list: {
+        data: []
+      },
+      supplierList: [],
+      tabIndex: 0
+    }
+  },
+  onPullDownRefresh() {
+    this.getGHSList().then(res => {
+      uni.stopPullDownRefresh();
+    })
+  },
+  methods: {
+    enter (item) {
+      const { id } = item
+					uni.navigateTo({url:`/pagesPurchase/ghsProduct?id=${id}`, type: 2 })
+      // this.pageTo({ url: `/pagesPurchase/ghsProduct?id=${id}`, type: 2 })
+    },
+    // init() {
+    //   this.getGHSList()
+    // },
+    getGHSList () {
+      return ghsList().then(res => {
+        this.supplierList = res.data.list
+        console.log(this.supplierList, 111)
+      }).catch(err => { console.log(err) })
+    },
+    // 结账
+    settleAccounts (item) {
+      this.pageTo({
+        url: '/pagesPurchase/gathering?id='+item.id,
+      })
+    },
+    // 采购记录详情
+    gotoDetails (val) {
+      console.log(val)
+      this.pageTo({
+        url: '/pagesPurchase/purDetails?status=' + val.status + '&id=' + val.id,
+        type:2
+      })
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.order-page {
+  .order_list {
+    // height: 200upx;
+    height: 100%;
+    background: #f0f2f6;
+    padding: 0 0 120upx;
+    .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;
+        width: 280rpx;
+        display: block;
+        & > .store_title {
+          margin-bottom: 30upx;
+          width: 100%;
+          white-space: nowrap;
+          text-overflow: ellipsis;
+          overflow: hidden;
+          word-break: break-all;
+          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: 20upx;
+    background-color: #f0f2f6;
+  }
+  // 按钮
+.app-footer {
+	justify-content: flex-end;
+	.admin-button-com {
+		width: 180px;
+		margin-right: 30px;
+	}
+}
+}
+</style>