订单,商品,代客下单,分组,分类页面调整

删除批量修改库存数量
This commit is contained in:
2024-10-16 18:10:29 +08:00
parent 2b85d19453
commit 2800569b47
24 changed files with 283 additions and 156 deletions

View File

@@ -1,15 +1,21 @@
<template>
<view class="bg-fff item" @click="toDetail">
<view class="u-flex u-p-b-22 border-bottom u-col-bottom u-row-between">
<view class="u-flex u-col-bottom">
<view class="u-font-40 color-333">{{data.tableName}}</view>
<view class="u-m-l-22">{{data.masterId}}</view>
<view class="u-flex u-p-b-22 border-bottom u-row-between u-col-center">
<view class="u-flex u-col-bottom">
<template v-if="data.tableName">
<view class="u-flex u-col-center">
<view class="u-font-40 color-333">{{data.tableName}}</view>
<view class="line" style="height: 16px;"></view>
</view>
</template>
<view class="">{{data.masterId}}</view>
</view>
<view class="u-flex">
<view>
<text :class="[data.status]">{{returnStatus(data.status)}}</text>
</view>
<view class="color-main u-m-l-24">
<view class="line"></view>
<view class=" color-main">
<text>
{{sendTypeFilter(data.sendType)}}
</text>
@@ -24,7 +30,8 @@
<view class="u-m-t-32">
<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 class="u-flex u-row-between u-col-top u-m-t-24" v-for="(item,index) in data.detailList"
:key="index">
<view>
<view class="color-666"> {{item.productName}}</view>
<view class="color-999 u-font-24 u-m-t-8">
@@ -33,7 +40,7 @@
</view>
<view class="u-flex">
<view>×{{item.num}}</view>
<view class="u-m-l-24">{{item.price}}</view>
<view class="u-m-l-24 u-text-right" :style="computedPriceStyle()">{{item.price}}</view>
</view>
</view>
</view>
@@ -66,7 +73,7 @@
ref,
watch
} from 'vue';
const emits=defineEmits(['printOrder'])
const emits = defineEmits(['printOrder'])
const props = defineProps({
data: {
type: Object,
@@ -80,27 +87,44 @@
}
})
let $goodsMap = {}
let goosZhonglei =ref(0)
let goosZhonglei = ref(0)
let goodsNumber = ref(0)
function goodsMapInit(){
const priceSize = 9
function computedPriceStyle() {
const item = props.data.detailList.reduce((prev, current) => (`${prev.price}`.length > `${current.price}`
.length) ? prev : current)
if (!item) {
return ''
}
return {
width: `${item.price}`.length * priceSize + 'px'
}
}
// const computedPriceStyle = computed(() => {
// })
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
$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
$goodsMap[goods.productId] = goods.num * 1
goosZhonglei.value += 1
goodsNumber.value += goods.num * 1
}
}
}
goodsMapInit()
watch(() => props.data.detailList.length, (newval) => {
goodsNumber.value=0
goodsNumber.value = 0
goodsMapInit()
})
function formatTime(time) {
return dayjs(time).format('YYYY-MM-DD HH:mm:ss');
@@ -114,8 +138,8 @@
function sendTypeFilter(t) {
console.log(t);
if (t) {
const item=orderEnum.sendType.find(item => item.key == t)
return item?item.label:'';
const item = orderEnum.sendType.find(item => item.key == t)
return item ? item.label : '';
} else {
return t;
}
@@ -126,8 +150,9 @@
id: props.data.id
})
}
function print(item) {
emits('printOrder',props.data)
emits('printOrder', props.data)
}
</script>
@@ -157,4 +182,33 @@
font-size: 24rpx;
border-radius: 100rpx;
}
.line {
height: 14px;
width: 1px;
background-color: #E5E5E5;
margin: 0 12rpx;
}
.row {
.top {
display: flex;
.name {
width: 50%;
}
.num {
width: 20%;
display: flex;
justify-content: flex-end;
}
.price {
width: 30%;
display: flex;
justify-content: flex-end;
}
}
}
</style>