更新订单列表详情,更新商品管理,更新代客下单
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
<view class="u-m-l-16">{{formatTime(data.createdAt)}}</view>
|
||||
</view>
|
||||
<view class="u-m-t-32">
|
||||
<view class="u-font-32">1种商品,共1件</view>
|
||||
<view class="u-font-32">{{goosZhonglei}}种商品,共{{goodsNumber}}件</view>
|
||||
<view class="border-bottom u-p-b-32">
|
||||
<view class="u-flex u-row-between u-m-t-24" v-for="(item,index) in data.detailList" :key="index">
|
||||
<view>
|
||||
@@ -32,12 +32,12 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-flex">
|
||||
<view>×1</view>
|
||||
<view class="u-m-l-24">¥15.00</view>
|
||||
<view>×{{item.num}}</view>
|
||||
<view class="u-m-l-24">¥{{item.price}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
</view>
|
||||
<view class="u-flex u-row-between border-bottom u-m-t-32 u-p-b-32">
|
||||
<view>订单备注</view>
|
||||
@@ -49,7 +49,7 @@
|
||||
<text class="font-bold u-font-32">{{data.orderAmount}}</text>
|
||||
</view>
|
||||
<view class="u-flex u-row-right u-m-t-24">
|
||||
<view class="print">重新打印</view>
|
||||
<view class="print" @click.stop="print(item)">重新打印</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -60,19 +60,51 @@
|
||||
import dayjs from 'dayjs';
|
||||
import orderEnum from '@/commons/orderEnum.js'
|
||||
import go from '@/commons/utils/go.js'
|
||||
import {
|
||||
computed,
|
||||
reactive,
|
||||
ref,
|
||||
watch
|
||||
} from 'vue';
|
||||
const emits=defineEmits(['printOrder'])
|
||||
const props = defineProps({
|
||||
data: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
default: () => {
|
||||
detailList: []
|
||||
}
|
||||
},
|
||||
index: {
|
||||
type: [String, Number],
|
||||
default: 0
|
||||
}
|
||||
})
|
||||
function formatTime(time){
|
||||
let $goodsMap = {}
|
||||
let goosZhonglei =ref(0)
|
||||
let goodsNumber = ref(0)
|
||||
function goodsMapInit(){
|
||||
for (let i in props.data.detailList) {
|
||||
const goods = props.data.detailList[i]
|
||||
if ($goodsMap.hasOwnProperty(goods.productId)) {
|
||||
$goodsMap[goods.productId] += goods.num*1
|
||||
goodsNumber.value+=goods.num*1
|
||||
} else {
|
||||
$goodsMap[goods.productId] = goods.num*1
|
||||
goosZhonglei.value+=1
|
||||
goodsNumber.value+=goods.num*1
|
||||
}
|
||||
}
|
||||
}
|
||||
goodsMapInit()
|
||||
watch(() => props.data.detailList, (newval) => {
|
||||
goodsMapInit()
|
||||
})
|
||||
|
||||
|
||||
function formatTime(time) {
|
||||
return dayjs(time).format('YYYY-MM-DD HH:mm:ss');
|
||||
}
|
||||
|
||||
function returnStatus(status) {
|
||||
const item = orderEnum.status.find(v => v.key == status)
|
||||
return item ? item.label : ''
|
||||
@@ -85,11 +117,15 @@
|
||||
return t;
|
||||
}
|
||||
}
|
||||
function toDetail(){
|
||||
go.to('PAGES_ORDER_DETAIL',{
|
||||
id:props.data.id
|
||||
|
||||
function toDetail() {
|
||||
go.to('PAGES_ORDER_DETAIL', {
|
||||
id: props.data.id
|
||||
})
|
||||
}
|
||||
function print(item) {
|
||||
emits('printOrder',props.data)
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@@ -110,10 +146,11 @@
|
||||
.unpaid {
|
||||
color: #FD7B49;
|
||||
}
|
||||
.print{
|
||||
|
||||
.print {
|
||||
padding: 6rpx 14rpx 8rpx 18rpx;
|
||||
border:1px solid $my-main-color;
|
||||
color:$my-main-color;
|
||||
border: 1px solid $my-main-color;
|
||||
color: $my-main-color;
|
||||
font-size: 24rpx;
|
||||
border-radius: 100rpx;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<view class="list">
|
||||
<view v-for="(item,index) in list" :key="index">
|
||||
<order-item :data="item" :index="index"></order-item>
|
||||
<order-item @printOrder="print" :data="item" :index="index"></order-item>
|
||||
</view>
|
||||
<view v-if="hasAjax&&!list.length">
|
||||
<my-img-empty tips="亲,你还没有订单哦~"></my-img-empty>
|
||||
@@ -21,7 +21,10 @@
|
||||
default:false
|
||||
}
|
||||
})
|
||||
|
||||
const emits=defineEmits(['printOrder'])
|
||||
function print(item) {
|
||||
emits('printOrder',item)
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
Reference in New Issue
Block a user