|
|
@@ -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;
|