shish 4 лет назад
Родитель
Сommit
f7abe8e372

+ 0 - 1
hdPad/src/admin/home/components/leftGroup.vue

@@ -49,7 +49,6 @@ export default {
     },
     methods:{
         reachBottom() {
-            console.log('eeeeeee')
             if (!this.list.finished) {
                 this.getGroupList().then((res) => {
                     uni.stopPullDownRefresh();

+ 38 - 19
hdPad/src/admin/work/components/order-info.vue

@@ -1,20 +1,19 @@
 <template>
     <view class="work-info">
         <view class="work-detail">
-          <view class="order-title">工单信息</view>
           <view class="order-img">
             <image src="https://img.hzghd.com/item/mg/jsha.png"></image>
           </view>
           <view class="order-item">
-            <view><text class="left">分类</text><text class="right">花束</text></view>
-            <view><text class="left">名称</text><text class="right">花束</text></view>
-            <view><text class="left">数量</text><text class="right">花束</text></view>
-            <view><text class="left">商品编号</text><text class="right">花束</text></view>
-            <view><text class="left">售价</text><text class="right">花束</text></view>
-            <view><text class="left">工单号</text><text class="right">花束</text></view>
-            <view><text class="left">订单号</text><text class="right">花束</text></view>
-            <view><text class="left">状态</text><text class="right">花束</text></view>
-            <view><text class="left">备注</text><text class="right">花束</text></view>
+            <view><text class="left">分类</text><text class="right">{{orderDetail.info.catName}}</text></view>
+            <view><text class="left">名称</text><text class="right">{{orderDetail.info.name}}</text></view>
+            <view><text class="left">数量</text><text class="right">{{orderDetail.info.num}}</text></view>
+            <view><text class="left">商品编号</text><text class="right">{{orderDetail.info.goodsId}}</text></view>
+            <view><text class="left">售价</text><text class="right">{{orderDetail.info.price||''}}</text></view>
+            <view><text class="left">工单号</text><text class="right">{{orderDetail.info.workSn}}</text></view>
+            <view><text class="left">订单号</text><text class="right">{{orderDetail.info.orderSn}}</text></view>
+            <view><text class="left">状态</text><text class="right">待制作</text></view>
+            <view><text class="left">备注</text><text class="right">{{orderDetail.info.remark}}</text></view>
           </view>
         </view>
         <view class="work-item-detail">
@@ -23,7 +22,7 @@
           
           <view class="unit-use-item">
             <view class="commodity-list">
-              <view v-for="(s, idx) in detailInfo.product" :key="idx" class="commodity-item" >
+              <view v-for="(s, idx) in orderDetail.item" :key="idx" class="commodity-item" >
                 <image class="item-icon" :src="s.cover" @click="pageTo({url:'/admin/item/detail',query:{id: s.id}})"></image>
                 <view class="item-info">
                   <view class="info-line">
@@ -50,7 +49,7 @@
           
           <view class="total-use-item">
             <view class="commodity-list">
-              <view v-for="(s, idx) in detailInfo.product" :key="idx" class="commodity-item" >
+              <view v-for="(s, idx) in orderDetail.item" :key="idx" class="commodity-item" >
                 <image class="item-icon" :src="s.cover" @click="pageTo({url:'/admin/item/detail',query:{id: s.id}})" />
                 <view class="item-info">
                   <view class="info-line">
@@ -82,11 +81,36 @@
     </view>
 </template>
 <script>
+import { getFullInfo } from '@/api/work'
 export default {
   data() {
     return {
-      detailInfo:{product:[{id:0,cover:'https://img.hzghd.com/item/mg/jsha.png',name:'红色桔梗',xhUnitName:'扎',xhUnitPrice:20,xhNum:2},
-      {id:0,cover:'https://img.hzghd.com/item/mg/jsha.png',name:'绿色康乃馨',xhUnitName:'扎',xhUnitPrice:20,xhNum:2}],book:0,stockChange:1}
+      orderDetail:[]
+    }
+  },
+  props: {
+    selectOrderId: {
+      type: Number,
+      default: 0
+    }
+  },
+  watch:{
+      selectOrderId:{
+          handler(newId){
+            if(Number(newId)>0){
+              this.getOrderDetail(newId)
+            }
+          },
+          immediate:true
+      }
+  },
+  methods:{
+    getOrderDetail(id){
+      getFullInfo({id}).then(res=>{
+        if(res.code == 1){
+          this.orderDetail = res.data
+        }
+      })
     }
   }
 }
@@ -97,11 +121,6 @@ export default {
   height: 100%;
   & .work-detail{
         flex: 40;
-        .order-title{
-          font-size:11upx;
-          font-weight:bold;
-          margin-left:5upx;
-        }
         .order-img{
           display:flex;
           margin:5upx;

+ 86 - 48
hdPad/src/admin/work/components/order-list.vue

@@ -1,44 +1,31 @@
 <template>
     <view class="itemList-box">
-        <view class="title">花材列表</view>
-        <view class="itemList-item_box">
-            <view v-for="item in selectList" :key="item.id" class="show-item_box">
+        <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('')" :class="[{'checked':status===''}]">全部</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" :class="[{'selected':selectOrderId==item.id}]" @click="getOrder(item)">
                 <view class="item-body_box not-active">
                     <view class="flower-name_box">
-                        <view class="current-item-title"><text class="name">{{item.name}}</text><text @click.stop="delItem(item)" class="del">删除</text></view>
-                    </view>
-                    <view class="item-price-num">
-                        <template v-if="item.property && item.property == 1">
-                            <view v-if="item.unitType == 0">{{parseFloat(item.bigPrice)}}元/{{item.bigUnit}}</view>
-                            <view v-else>{{parseFloat(item.smallPrice)}}元/{{item.smallUnit}}</view>
-                            <view>{{item.buyNum}} {{item.unitType == 0 ? item.bigUnit : item.smallUnit}}</view>
-                        </template>
-                        <template v-else>
-                            <view>{{parseFloat(item.unitPrice)}}/份</view>
-                            <view>{{item.buyNum}}份</view>
-                        </template>
-                        <view>¥{{parseFloat((item.buyNum * item.unitPrice).toFixed(2))}}</view>
+                        <view class="current-item-title"><text class="name">{{item.name}}</text></view>
+                        <image class="flower-image" :src="item.cover"></image>
                     </view>
+                    <view class="item-price-num"> <view>今天 12:00</view> <view>待完成</view></view>
                 </view>
             </view>
-        </view>
-        <view class="itemList-footer_box">
-            <view> 数量
-                <text style="margin-left:5upx;">
-                    <text v-if="Number(allCount.bigNum)>0">{{allCount.bigNum}}扎</text>
-                    <text v-if="Number(allCount.smallNum)>0">{{allCount.smallNum}}支</text>
-                </text>
-            </view>
-            <view> 合计 <text style="margin-left:5upx;">¥{{allPrice}}</text> </view>
-        </view>
+        </scroll-view>
     </view>
 </template>
 <script>
-import productMins from "@/mixins/product";
+import {getWorkList} from "@/api/work"
+import { list } from "@/mixins";
 export default {
     name:'leftItem',
     components:{},
-	mixins: [productMins],
+	mixins: [list],
 	props: {
 		customId: {
 			type: Number,
@@ -50,11 +37,12 @@ export default {
             totalShop:{ bigUnit: 0, smallUnit:0, totalPrice: 0 },
             itemList:[],
             selectJobType:'bill',
-            selectJobId:0
+            selectJobId:0,
+            groupList:[],
+            status:0,
+            selectOrderId:0
         }
     },
-    created(){
-    },
     watch:{
         customId:{
             handler(newCustomId){
@@ -63,11 +51,37 @@ export default {
             immediate:true
         }
     },
+    created(){
+        this.getWorkInfo()
+    },
     methods:{
-        delItem(item){
-            this.$util.hitRemind()
-            item.buyNum = 0
-            this.replaceItemFn(item,1,'sub')
+        getOrder(item){
+            this.selectOrderId = item.id
+            this.$emit('getOrder',item)
+        },
+        changeStatus(status){
+            this.status = status
+            this.resetList()
+            this.getWorkInfo()
+        },
+        reachBottom() {
+            if (!this.list.finished) {
+                this.getWorkInfo().then((res) => {
+                    uni.stopPullDownRefresh();
+                });
+            } else {
+                uni.stopPullDownRefresh();
+            }
+        },
+        getWorkInfo(){
+            return getWorkList({page: this.list.page,status:this.status}).then(res=>{
+                if(res.code == 1){
+                    this.completes(res)
+                    if(this.list.data && this.list.data[0]){
+                        this.getOrder(this.list.data[0])
+                    }
+                }
+            })
         }
     }
 }
@@ -83,10 +97,29 @@ export default {
         background-color: rgba(72, 91, 107, 1);
         color: #FFFFFF;
     }
+    & .order-status{
+        display: flex;
+        font-size:10upx;
+        view{
+            height:22upx;
+            line-height: 22upx;
+            flex:1;
+            font-size:10upx;
+            border:1upx solid #EEEEEE;
+            text-align:center;
+        }
+        .checked{
+            background-color: #CCCCCC;
+            color:white;
+        }
+    }
     & .itemList-item_box {
         overflow-y: auto;
         flex: 1;
         border: 1px solid #eee;
+        & .selected{
+            border:1upx solid rgb(133, 209, 133);
+        }
         & .show-item_box {
             padding: 2upx;
             & .item-body_box {
@@ -94,46 +127,51 @@ export default {
                 padding: 2upx;
                 font-size: 14upx;
                 color:#666666;
+                height:58upx;
                 &.active {
                     background-color: #d4d6d6;
                 }
                 &.not-active {
                     background-color: #e7e9e9;
                 }
-                .item-price-num{
-                    color:#afaeae;
-                    font-size:10upx;
-                }
                 & .flower-name_box {
                     padding: 0 5upx;
+                    position: relative;
                     .current-item-title {
                         .name{
+                            font-size:12upx;
                             color: #333333;
                             font-weight: bold;
                             overflow: hidden;
                             text-overflow:ellipsis;
                             white-space: nowrap;
-                            width:50upx;
-                        }
-                        .del{
-                            color:orange;
-                            font-size:12upx;
-                            float:right;
+                            width:60upx;
                         }
                     }
+                    .flower-image{
+                        position: absolute;
+                        right:1upx;
+                        top:2upx;
+                        width:50upx;
+                        height:50upx;
+                        border-radius:5upx;
+                    }
                 }
-                & > view:nth-child(2) {
+                .item-price-num{
+                    color:#afaeae;
+                    font-size:10upx;
                     display: flex;
                     align-items: center;
                     justify-content: space-between;
-                    padding-top: 15upx;
+                    padding: 15upx 2upx 0 2upx;
+                    width:120upx;
                 }
             }
         }
     }
     & .itemList-footer_box {
         height: 20upx;
-        border: 1upx solid #eee;
+        border: 1px solid #eee;
         font-size: 10upx;
         display: flex;
         align-items: center;

+ 6 - 2
hdPad/src/admin/work/index.vue

@@ -6,10 +6,10 @@
                 <casherNav></casherNav>
             </view>
             <view class="work-order-list">
-                <orderList></orderList>
+                <orderList @getOrder="getOrder"></orderList>
             </view>
             <view class="work-order-info">
-                <orderInfo></orderInfo>
+                <orderInfo :selectOrderId.sync="selectOrderId"></orderInfo>
             </view>
         </view>
     </view>
@@ -27,6 +27,7 @@ export default {
 	mixins: [productMins],
 	data() {
 		return {
+			selectOrderId:0
 		}
 	},
 	computed: {
@@ -36,6 +37,9 @@ export default {
 		//this.initDataFromStorage()
 	},
 	methods: {
+		getOrder(item){
+			this.selectOrderId = item.id
+		}
 	}
 };
 </script>

+ 11 - 0
hdPad/src/api/work/index.js

@@ -0,0 +1,11 @@
+import https from '@/plugins/luch-request_0.0.7/request'
+
+//工单列表
+export const getWorkList = data => {
+	return https.get('/work/list', data)
+}
+
+//工单详情
+export const getFullInfo = data => {
+	return https.get('/work/full-info', data)
+}