Selaa lähdekoodia

客户列表优化

shish 1 vuosi sitten
vanhempi
commit
b9fcb35133

+ 10 - 0
hdPad/src/api/custom/index.js

@@ -1,5 +1,15 @@
 import https from '@/plugins/luch-request_0.0.7/request'
 
+//商家端客户详情
+export const getDetail = data => {
+	return https.get("/custom/detail", data);
+};
+
+//客户列表
+export const getCustomList = data => {
+	return https.get("/custom/list", data);
+};
+
 /** *
  * 修改欠款额度
  */

+ 64 - 0
hdPad/src/pages/home/components/customButton.vue

@@ -0,0 +1,64 @@
+<template>
+<view class="button-area">
+	<view class="active" @click="gatheringFn()" style="color:#3385FF;border:1upx solid #3385FF;">收款</view>
+    <view class="active" @click="clearItemFn" style="color:#636161;border:1upx solid #636161;">清空</view>
+</view>
+</template>
+<script>
+import { mapGetters } from "vuex";
+export default {
+    name:'console',
+	mixins: [],
+    components:{},
+	props: {
+
+    },
+    data(){
+        return {
+
+        }
+    },
+	computed: {
+		...mapGetters(["getLoginInfo","getMyShopInfo"])
+	},
+    watch:{
+
+    },
+	created(){
+
+	},
+	mounted(){
+
+	},
+	destroyed(){
+	},
+    methods:{
+    }
+}
+</script>
+<style lang="scss" scoped>
+.button-area {
+    height: 100vh;
+    display: flex;
+    flex-direction: column;
+	justify-content: space-around;
+    padding: 5upx;
+    padding-top: 12upx;
+    & > view {
+        border: 1upx solid #CCCCCC;
+        border-radius: 5upx;
+        text-align: center;
+        padding: 10upx 0;
+        color: #666666;
+        margin-bottom:7upx;
+        font-size: 10upx;
+        text-align: center;
+    }
+	& .active {
+		color: #09C567;
+		border-color: #09C567;
+		font-size: 10upx;
+		font-weight:bold;
+	}
+}
+</style>

+ 305 - 0
hdPad/src/pages/home/components/customInfo.vue

@@ -0,0 +1,305 @@
+<template>
+<view>
+  <view v-if="$util.isEmpty(customInfo)" class="work-empty">
+    <text>暂无订单</text>
+  </view>  
+  <view class="custom-info" v-else>
+    <view class="custom-detail">
+      <view class="order-item">
+        <view><text class="left">开单人</text><text class="right">{{customInfo.shopAdminName||''}}</text></view>
+        <view><text class="left">订单号</text><text class="right">{{customInfo.orderSn||''}}</text></view>
+        <view><text class="left">状态</text><text class="right">132</text></view>
+        <view>
+          <text class="left">创建时间</text>
+          <text class="right">{{customInfo.addTime ? customInfo.addTime.substr(5,11):''}}</text>
+        </view>
+      </view>
+    </view>
+  </view>
+</view>
+</template>
+<script>
+import { getDetail } from '@/api/custom'
+import { mapGetters } from "vuex";
+import productMins from "@/mixins/product";
+export default {
+	name: "customInfo",
+	components: {},
+  data() {
+    return {
+      customInfo:[],
+      currentJobType:'modify',
+      currentJobId:0
+    }
+  },
+	props: {
+      selectCustomId:{
+        type: Number,
+        default: 0
+      }
+    },
+	mixins: [productMins],
+	computed:{
+		...mapGetters(["getMyShopInfo"]),
+	},
+	watch:{
+		selectCustomId: {
+			handler(newId,oldId) {
+				this.currentJobId = Number(oldId)
+		    this.currentJobId = Number(newId)
+			}
+		}
+	},
+  methods:{
+    getCustomDetail(id){
+      getDetail({userId:id}).then(res=>{
+        if(res.code == 1){
+          this.customInfo = res.data
+          console.log('customInfo')
+          console.log(this.customInfo)
+        }
+      })
+    }
+  }
+}
+</script>
+<style lang="scss" scoped>
+.work-empty{
+  display:flex;
+  font-size:13upx;
+  justify-content:center;
+  align-items:center;
+  height:90vh;
+}
+.custom-info{
+  display:flex;
+  height: 100vh;
+  & .custom-detail{
+      height: 100vh;
+      overflow: scroll;
+      border-right:1upx solid #EEEEEE;
+      flex: 40;
+      .order-img{
+        display:flex;
+        margin:5upx;
+        justify-content:center;
+        image{
+          width:180upx;
+          height:180upx;
+          border-radius:3upx;
+        }
+      }
+      .order-item{
+        display:flex;
+        font-size:11upx;
+        margin-top:10upx;
+        justify-content: center;
+        flex-wrap:wrap;
+        view{
+          justify-content:space-between;
+          align-items:center;
+          display:flex;
+          border-bottom:1upx solid #EEEEEE;
+          width:180upx;
+          height:20upx;
+          padding:0 10upx 0 10upx;
+          .left{
+            color:#CCCCCC;
+          }
+          .right{
+            color:#666666;
+          }
+        }
+      }
+    }
+	& .button-area {
+		flex: 9;
+		height: 100vh;
+    display: flex;
+    flex-direction: column;
+    justify-content: space-around;
+    padding: 5upx;
+    border-left:1upx solid #EEEEEE;
+    & > view {
+        border: 1upx solid #EEEEEE;
+        border-radius: 5upx;
+        text-align: center;
+        padding: 10upx 0;
+        color: #CCCCCC;
+        margin-bottom: 10upx;
+        font-size: 12upx;
+        text-align: center;
+        font-weight:bold;
+    }
+    & .active {
+      color: #09C567;
+      border-color: #09C567;
+      font-size: 12upx;
+      font-weight:bold;
+    }
+	}
+	& .work-item-detail {
+		flex: 40;
+		height: 100%;
+    & .right-detail-title{
+      font-size:10upx;
+      font-weight:bold;
+      margin-left:5upx;
+      margin-top:10upx;
+    }
+    & .unit-use-item {
+      flex: 40;
+      display: flex;
+      flex-direction: column;
+      .commodity-list {
+        padding: 5upx;
+        .commodity-item {
+          display: flex;
+          margin-top:5upx;
+          .item-icon {
+            flex-shrink: 0;
+            width: 38upx;
+            height: 38upx;
+            border-radius:2upx;
+          }
+          .item-info {
+            display: flex;
+            flex-direction: column;
+            flex: 1;
+            margin-left:6upx;
+            .info-line {
+              display: flex;
+              justify-content: space-between;
+              align-items: flex-start;
+              position: relative;
+              .item-name {
+                font-size:11upx;
+                color: black;
+                overflow: hidden;
+                white-space: nowrap;
+                text-overflow: ellipsis;
+              }
+              .item-price {
+                color: #333;
+                font-size: 10upx;
+              }
+              .item-type {
+                color: #999;
+                font-size: 8upx;
+              }
+              .item-count {
+                color: #666;
+                font-size: 11upx;
+              }
+            }
+          }
+        }
+      }
+      .summary-bar {
+        padding: 0 10upx;
+        height: 30upx;
+        display: flex;
+        align-items: center;
+        justify-content: space-between;
+        border-top: 1upx solid #eeeeee;
+        .operate-view {
+          display: flex;
+          align-items: center;
+          color: #09C567;
+          font-size: 12upx;
+          .iconfont {
+            margin-right: 20upx;
+            font-size: 10upx;
+          }
+        }
+        .describe-view {
+          display: flex;
+          align-items: center;
+          color: #333;
+          font-size: 9upx;
+        }
+      }
+    }
+    & .total-use-item {
+      flex: 40;
+      display: flex;
+      flex-direction: column;
+      .commodity-list {
+        padding: 5upx;
+        .commodity-item {
+          display: flex;
+          margin-top:5upx;
+          .item-icon {
+            flex-shrink: 0;
+            width: 38upx;
+            height: 38upx;
+            border-radius:2upx;
+          }
+          .item-info {
+            display: flex;
+            flex-direction: column;
+            flex: 1;
+            margin-left:6upx;
+            .info-line {
+              display: flex;
+              justify-content: space-between;
+              align-items: flex-start;
+              position: relative;
+              .item-name {
+                font-size:11upx;
+                color: black;
+                overflow: hidden;
+                white-space: nowrap;
+                text-overflow: ellipsis;
+              }
+              .item-price {
+                color: #333;
+                font-size: 10upx;
+              }
+              .item-type {
+                color: #999;
+                font-size: 8upx;
+              }
+              .item-count {
+                color: #666;
+                font-size: 11upx;
+              }
+              .wastage{
+                position: absolute;
+                right:0upx;
+                font-size:9upx;
+                top:4upx;
+                color:#666666;
+              }
+            }
+          }
+        }
+      }
+      .summary-bar {
+        padding: 0 10upx;
+        height: 30upx;
+        display: flex;
+        align-items: center;
+        justify-content: space-between;
+        border-top: 1upx solid #eeeeee;
+        .operate-view {
+          display: flex;
+          align-items: center;
+          color: #09C567;
+          font-size: 12upx;
+          .iconfont {
+            margin-right: 20upx;
+            font-size: 10upx;
+          }
+        }
+        .describe-view {
+          display: flex;
+          align-items: center;
+          color: #333;
+          font-size: 9upx;
+        }
+      }
+    }
+	}
+}
+</style>

+ 25 - 13
hdPad/src/pages/home/components/cumList.vue → hdPad/src/pages/home/components/customList.vue

@@ -3,22 +3,22 @@
         <view class="title">列表</view>
         <view class="order-status">
             <view @tap="changeStatus(0)" :class="[{'checked':status===0}]">全部</view>
-            <view @tap="changeStatus(1)" :class="[{'checked':status===1}]">待完成</view>
-            <view @tap="changeStatus(4)" :class="[{'checked':status===4}]">已完成</view>
+            <view @tap="changeStatus(1)" :class="[{'checked':status===1}]">消费排行</view>
+            <view @tap="changeStatus(4)" :class="[{'checked':status===4}]">赊账排行</view>
         </view>
         <scroll-view class="itemList-item_box" scroll-y="true" @scrolltolower="reachBottom" lower-threshold="50">
-            <view v-for="item in list.data" :key="item.id" class="show-item_box" @click="">
-                <view :class="[selectOrderId==item.id ? 'active' : 'not-active', 'item-body_box']">
+            <view v-for="item in list.data" :key="item.id" class="show-item_box" @click="getCustomInfo(item,1)">
+                <view :class="[selCustomId==item.id ? 'active' : 'not-active', 'item-body_box']">
                     <view class="flower-name_box">
                         <view class="current-item-title">
-                            <text>{{item.actPrice}}</text>                           
+                            <text>{{ item.name }}</text>                           
                         </view>
-                        <image class="flower-image" :src="item.cover"></image>
-                        <text v-if="item.fromType!=4" style="position:absolute;top:2upx;left:90upx;font-size:11upx;">{{item.sn}}</text>
+                        <image class="flower-image" :src="item.avatar"></image>
+                        <text style="position:absolute;top:2upx;left:90upx;font-size:11upx;">3333</text>
                     </view>
                     <view class="item-price-num">
                         <view>
-                            <text>{{item.orderSn}}</text>
+                            <text>xsd555611</text>
                         </view>
                         <view>{{item.status == 1 ? '待付款':item.status==2?'待配送':item.status==3?'配送中':item.status==4?'已完成':item.status==5?'已取消':'待付款'}}</view>
                     </view>
@@ -28,7 +28,7 @@
     </view>
 </template>
 <script>
-import { getList } from "@/api/order"
+import { getCustomList } from "@/api/custom"
 import { list } from "@/mixins";
 export default {
     name:'cumList',
@@ -40,7 +40,7 @@ export default {
         return {
             groupList:[],
             status:0,
-            selectOrderId:0,
+            selCustomId:0,
             sn:'',
         }
     },
@@ -70,13 +70,25 @@ export default {
             }
         },
         getCustomData(){
-            let params = {page: this.list.page,pageSize:30,status:this.status,sn:this.sn,isCashier:1}
-            return getList(params).then(res=>{
+            let params = {page: this.list.page,pageSize:30}
+            return getCustomList(params).then(res=>{
                 if(res.code == 1){
                     this.completes(res)
+
+                    if(this.list.data && this.list.data[0]){
+                        this.getCustomInfo(this.list.data[0])
+                    }
+
                 }
             })
-        }
+        },
+        getCustomInfo(item,click=0){
+            if(click == 1){
+                this.$util.hitVoice()
+            }
+            this.selCustomId = item.id
+            this.$emit('getCustomInfo',item)
+        },
     }
 }
 </script>

+ 69 - 48
hdPad/src/pages/home/custom.vue

@@ -1,56 +1,77 @@
 <template>
+<view>
     <view>
-        <view>
-            <view class="app-casher-area">
-                <view class="nav-left">
-                    <casherNav navType="custom"></casherNav>
-                </view>
-                <view class="cum-list">
-                    <cumList ref="cumListRef"></cumList>
-                </view>
-                <view class="index-son">
-                    <indexSon ref="indexSonrRef"></indexSon>
-                </view>
+        <view class="app-casher-area">
+            <view class="nav-left">
+                <casherNav navType="custom"></casherNav>
+            </view>
+            <view class="custom-list">
+                <customList ref="customListRef" @getCustomInfo="getCustomInfo"></customList>
+            </view>
+            <view class="custom-info">
+                <customInfo ref="customInforRef" :selectCustomId="selectCustomId" @calcFn="calcFn" @finishNotice="finishNotice"></customInfo>
+            </view>
+            <view class="custom-asset">
+                aaaa
             </view>
-        </view>
-    </view>
-    </template>
-    <script>
-    import { mapGetters } from "vuex";
-    import productMins from "@/mixins/product";
-    import casherNav from './components/nav.vue'
-    import cumList from './components/cumList.vue'
-    import indexSon from './components/indexSon.vue'
-    export default {
-        name: "order",
-        components: {casherNav,cumList,indexSon},
-        mixins: [productMins],
-        data() {
-            return {
 
-            }
-        },
-        computed: {
-            ...mapGetters(["getLoginInfo"])
-        },
-        methods: {
+			<view class="open-box">
+				<consoleButton></consoleButton>
+			</view>
 
+        </view>
+    </view>
+</view>
+</template>
+<script>
+import { mapGetters } from "vuex";
+import productMins from "@/mixins/product";
+import casherNav from './components/nav.vue'
+import customList from './components/customList.vue'
+import customInfo from './components/customInfo.vue'
+import consoleButton from './components/customButton.vue'
+export default {
+    name: "custom",
+    components: {casherNav,customList,customInfo,consoleButton},
+    mixins: [productMins],
+    data() {
+        return {
+            currentJobType:'custom',
+            currentJobId:0,
+            selectCustomId:0,
         }
-    };
-    </script>
-    <style lang="scss" scoped>
-    .app-casher-area {
-        display: flex;
-        height: 100vh;
-        & .nav-left {
-            flex: 5;
-            background-color: #09C567;
-        }
-        & .cum-list {
-            flex: 30;
-        }
-        & .index-son{
-            flex: 65;
+    },
+    computed: {
+        ...mapGetters(["getLoginInfo"])
+    },
+    methods: {
+        getCustomInfo(item){
+            this.selectCustomId = Number(item.id)
+            this.currentJobId = Number(item.id)
+            this.$refs.customInforRef.getCustomDetail(this.selectCustomId)
         }
     }
-    </style>
+};
+</script>
+<style lang="scss" scoped>
+.app-casher-area {
+    display: flex;
+    height: 100vh;
+    & .nav-left {
+        flex: 5;
+        background-color: #09C567;
+    }
+    & .custom-list {
+        flex: 32;
+    }
+    & .custom-info{
+        flex: 32;
+    }
+    & .custom-asset{
+        flex: 32;
+    }
+    & .open-box{
+        flex: 8;
+    }
+}
+</style>