Ver Fonte

供货商查询

shish há 1 ano atrás
pai
commit
0010caa3b6

+ 1 - 0
hdApp/src/pages.json

@@ -419,6 +419,7 @@
 			"root": "pagesPurchase",
 			"pages": [
 				{ "path": "result", "style": { "navigationBarTitleText": "结果" } },
+				{ "path": "selectGhs", "style": { "navigationBarTitleText": "选择供货商" } },
 				{ "path": "add", "style": { "navigationBarTitleText": "新增采购单", "enablePullDownRefresh": true } },
 				{ "path": "gathering", "style": { "navigationBarTitleText": "待结订单", "enablePullDownRefresh": true } },
 				{ "path": "particulars", "style": { "navigationBarTitleText": "", "enablePullDownRefresh": true } },

+ 285 - 0
hdApp/src/pagesPurchase/selectGhs.vue

@@ -0,0 +1,285 @@
+<template>
+  <div class="app-main app-content">
+    <view class="input-wrap_box">
+      <view>
+        <AppSearchModule placeholder="输入拼音首字母搜索" @input="searchFn"/>
+      </view>
+    </view>
+    <block v-if="!$util.isEmpty(list.data)">
+      <block v-for="(item, index) in list.data" :key="index">
+        <tui-list-cell :arrow="true" @click="selectCurrent(item)">
+          <div class="tui-msg-box">
+            <img :src="item.avatar" class="tui-msg-pic" mode="widthFix"/>
+            <div class="tui-msg-item" style="position:relative;">
+              <div class="tui-msg-name">
+                <div class="tui-user-name">
+                  {{ item.name }}
+                </div>
+              </div>
+            </div>
+          </div>
+          <div class="tui-msg-right">
+          </div>
+        </tui-list-cell>
+      </block>
+    </block>
+    <block v-else>
+      <app-wrapper-empty :is-empty="$util.isEmpty(list.data)" />
+    </block>
+  </div>
+</template>
+<script>
+import TuiListCell from "@/components/plugin/list-cell";
+import BadgeModule from "@/components/plugin/badge";
+import AppWrapperEmpty from "@/components/app-wrapper-empty";
+import appVipModule from "@/components/module/app-vip";
+import AppTag from "@/components/module/app-tag.vue";
+import AppSearchModule from "@/components/module/app-search";
+import { list } from "@/mixins";
+import { ghsList } from "@/api/purchase/index";
+import { mapGetters } from "vuex";
+export default {
+  name: "selectGhs",
+  components: {
+    TuiListCell,
+    BadgeModule,
+    AppWrapperEmpty,
+    appVipModule,
+    AppTag,
+    AppSearchModule,
+    couldScan:false
+  },
+  mixins: [list],
+  data() {
+    return {
+      tabIndex: 0,
+      selectStyle:1
+    };
+  },
+  computed:{
+    ...mapGetters(["getMyShopInfo"]),
+  },
+  onPullDownRefresh() {
+    this.resetList();
+    this.getMyGhs().then((res) => {
+      uni.stopPullDownRefresh();
+    });
+  },
+  onReachBottom() {
+    if (!this.list.finished) {
+      this.getMyGhs().then((res) => {
+        uni.stopPullDownRefresh();
+      });
+    } else {
+      uni.stopPullDownRefresh();
+    }
+  },
+  onLoad(){
+  },
+	onShow(){
+	},
+  methods: {
+    selectCurrent(item){
+        let pages = getCurrentPages()
+        let prevPage = pages[pages.length-2]
+        prevPage.$vm.ghsId = item.id;
+        prevPage.$vm.ghsName = item.name
+        prevPage.$vm.refreshPage = 1
+        uni.navigateBack({})      
+    },
+    init() {
+      this.getMyGhs()
+    },
+    searchFn(e) {
+        this.resetList();
+        this.seekVal = e;
+        this.getMyGhs();
+    },
+    getMyGhs() {
+      return ghsList({ page: this.list.page, name: this.seekVal }).then((res) => {
+        this.completes(res);
+        if (this.$util.isEmpty(res.data)){
+          return false
+        }
+      })
+    }
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.app-content {
+  padding-top: 100upx;
+  padding-bottom: 20upx;
+}
+.tabs-wrap {
+  position: fixed;
+  .tabs-left {
+    width: 80%;
+  }
+  .tabs-right {
+    width: 19%;
+    border-left: $borderColor;
+    @include disFlex(center, center);
+  }
+}
+.input-wrap_box {
+  background-color: #fff;
+  position: fixed;
+  top: 0;
+  z-index: 10;
+  /* 手机mobile屏幕小于1000px */
+  @media screen and (max-width: 1100px) {
+    width: 100%;
+  }
+  /* 收银台cashier屏幕大于1000px */
+  @media screen and (min-width:1100px) {
+    width: 40%;
+  }
+  height: 100upx;
+  display: flex;
+  align-items: center;
+  padding: 0 30upx;
+  & > view:nth-child(1) {
+    flex: 1;
+  }
+}
+.tui-msg-box {
+  display: flex;
+  align-items: center;
+
+  .tui-msg-pic {
+    width: 80upx;
+    height: 80upx;
+    border-radius: 50%;
+    margin-right: 20upx;
+  }
+
+  .tui-msg-item {
+    max-width: 500upx;
+    min-height: 80upx;
+    overflow: hidden;
+    display: flex;
+    flex-direction: column;
+    justify-content: space-between;
+    & > div {
+      @include disFlex(center, flex-start);
+      & > div:first-child {
+        margin-right: 8upx;
+      }
+    }
+    .level-img {
+      ::v-deep.vip-text {
+        left: 70upx;
+        top: 8upx;
+      }
+    }
+    .normal-img {
+      width: 70upx;
+      padding: 2upx 6upx;
+      color: #999;
+      background-color: #f0f2f6;
+      border-radius: 20upx;
+      .vip-text {
+        font-size: 24upx;
+        transform: scale(0.6);
+        position: relative;
+        top: -2upx;
+        left: -8upx;
+      }
+    }
+    .member-img {
+      width: 70upx;
+      padding: 2upx 6upx;
+      color: green;
+      background-color: #f0f2f6;
+      border-radius: 20upx;
+      .vip-text {
+        font-size: 24upx;
+        transform: scale(0.6);
+        position: relative;
+        top: -2upx;
+        left: -8upx;
+      }
+    }
+    .iconfont {
+      color: #00aaed;
+    }
+  }
+
+  .tui-msg-name {
+    overflow: hidden;
+    white-space: nowrap;
+    text-overflow: ellipsis;
+    font-size: 30upx;
+    line-height: 1;
+    color: #262b3a;
+    .tui-user-name {
+      overflow: hidden;
+      text-overflow: ellipsis;
+      white-space: nowrap;
+      width: 500upx;
+      font-size: 32upx;
+      .super-man{
+        margin-left:30upx;
+        color:red;
+        font-size:24upx;
+        display:inline-block;
+        color:white;
+        border:1upx solid green;
+        padding:6upx 10upx;
+        background-color: green;
+        border-radius: 11upx;
+      }
+      .ls-man{
+        margin-left:30upx;
+        font-size:24upx;
+        display:inline-block;
+        color:white;
+        border:1upx solid #a5b1a5;
+        padding:6upx 10upx;
+        background-color: #a5b1a5;
+        border-radius: 11upx;
+      }
+    }
+  }
+
+  .tui-msg-content {
+    width:500upx;
+    overflow: hidden;
+    white-space: nowrap;
+    text-overflow: ellipsis;
+    font-size: 24upx;
+    line-height: 1;
+    color: #9397a4;
+    .debt-amount{
+      margin-left:20upx;
+      .amount_num{
+        color:red;
+        margin-left:6upx;
+        font-weight:bold;
+      }
+    }
+  }
+}
+.tui-msg-right {
+  max-width: 120upx;
+  height: 80upx;
+  margin-left: auto;
+  margin-right: 24upx;
+  text-align: right;
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+}
+.user_tag {
+  border: 1upx solid #cccccc;
+  padding: 5upx 12upx 5upx 12upx;
+  border-radius: 25upx;
+  color: #bbbbbb;
+  margin-right: 10upx;
+  margin-bottom: 12upx;
+  display: inline-block;
+  font-size: 30upx;
+}
+</style>

+ 21 - 9
hdApp/src/pagesPurchase/shopping.vue

@@ -5,9 +5,9 @@
 			<view style="margin-left:60upx;margin-top:110upx;padding-bottom:30upx;position: relative;">
 				<DateSelect @selectDateFn="selectDateFn" defaultShowName='时间' />
         
-        <button class="admin-button-com mini-btn blue" style="position: absolute;right:300upx;top:-8upx;" @click="debtChangeFn()">选供货商</button>
+        <button class="admin-button-com mini-btn blue" style="position: absolute;right:300upx;top:-8upx;" @click="selGhs()">{{ ghsName==''?'选供货商':ghsName }}</button>
 
-        <button class="admin-button-com mini-btn blue" style="position: absolute;right:80upx;top:-8upx;" @click="debtChangeFn()">重置搜索</button>
+        <button class="admin-button-com mini-btn blue" style="position: absolute;right:80upx;top:-8upx;" @click="resetSearch()">重置搜索</button>
 
 			</view>
 
@@ -88,7 +88,7 @@ export default {
   },
   onReachBottom () {
     if (!this.list.finished) {
-      this.getpurchaseList().then(res => {
+      this.getMyPurchase().then(res => {
         uni.stopPullDownRefresh()
       });
     } else {
@@ -97,25 +97,37 @@ export default {
   },
   onPullDownRefresh () {
     this.resetList();
-    this.getpurchaseList().then(res => {
+    this.getMyPurchase().then(res => {
       uni.stopPullDownRefresh()
     })
   },
   onShow(){
     if(this.refreshPage == 1){
       this.resetList()
-      this.getpurchaseList()
+      this.getMyPurchase()
     }else{
       this.refreshPage = 1
     }
   },
   methods: {
+    selGhs(){
+      this.$util.pageTo({ url: "/pagesPurchase/selectGhs"})
+    },
+    resetSearch(){
+      this.ghsId = 0
+      this.ghsName=''
+      this.searchTime = ''
+      this.startTime = ''
+      this.endTime = ''
+      this.resetList()
+      this.getMyPurchase()      
+    },
 		selectDateFn(val) {
 			this.searchTime = val.searchTime
 			this.startTime = val.startTime
 			this.endTime = val.endTime
       this.resetList()
-      this.getpurchaseList()
+      this.getMyPurchase()
 		},	
     change(e) {
 			if (this.tabIndex == e.index) {
@@ -124,13 +136,13 @@ export default {
         this.resetList()
 				this.tabIndex = e.index;
         this.status = e.item.key
-        this.getpurchaseList()
+        this.getMyPurchase()
 			}
 		},
     init() {
-      this.getpurchaseList()
+      this.getMyPurchase()
     },
-    getpurchaseList () {
+    getMyPurchase () {
       return purchaseList({ status: this.status,page: this.list.page,searchTime: this.searchTime,startTime: this.startTime,endTime: this.endTime,ghsId:this.ghsId}).then(res => {
         this.completes(res)
         this.tabs[0].value = res.data.shop.totalPurchaseOrder // 全部