fix: 代客下单称重商品增加起售数量判断
This commit is contained in:
@@ -639,10 +639,8 @@ export const useCartsStore = defineStore("carts", () => {
|
||||
const delArr = ['skuData', 'coverImg', 'specInfo', 'placeNum', 'update_time', 'create_time', 'packFee', 'memberPrice', 'type']
|
||||
function sendMessage(operate_type: msgType, message: any) {
|
||||
const msg = { ...message, operate_type: operate_type, table_code: table_code.value }
|
||||
if (operate_type == 'edit') {
|
||||
for (let i in delArr) {
|
||||
delete msg[delArr[i]]
|
||||
}
|
||||
for (let i in delArr) {
|
||||
delete msg[delArr[i]]
|
||||
}
|
||||
console.log('send msg', msg)
|
||||
WebSocketManager.sendMessage(msg);
|
||||
|
||||
@@ -73,7 +73,9 @@
|
||||
<template #content>
|
||||
<div class="u-flex color-000 u-font-14 u-row-between">
|
||||
<span class="font-bold">会员优惠</span>
|
||||
<span class="u-m-l-30">{{ carts.giftMoney(carts.vipDiscount) }}</span>
|
||||
<span class="u-m-l-30">
|
||||
{{ customTruncateToTwoDecimals(carts.giftMoney(carts.vipDiscount)) }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="u-flex color-000 u-font-14 u-row-between">
|
||||
<span class="font-bold">赠送</span>
|
||||
@@ -91,8 +93,8 @@
|
||||
<div class="u-flex u-row-between">
|
||||
<el-link type="primary">打印制作单</el-link>
|
||||
<div>
|
||||
<span class="totalNumber">共{{ carts.totalNumber }}件</span>
|
||||
<span class="totalPrice">¥{{ carts.payMoney }}</span>
|
||||
<span class="totalNumber">共{{ customTruncateToTwoDecimals(carts.totalNumber) }}件</span>
|
||||
<span class="totalPrice">¥{{ customTruncateToTwoDecimals(carts.payMoney) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="btn-group" v-if="isXianFuKuan">
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
<template>
|
||||
<div class="select_desk">
|
||||
<el-dialog width="410px" title="套餐" v-model="show">
|
||||
<el-dialog width="410px" :title="title" v-model="show">
|
||||
<div class="u-flex" v-if="min">
|
||||
<span>起售数量</span>
|
||||
<span class="u-m-l-10">{{ min }}</span>
|
||||
<span class="u-m-l-2">{{ item.unitName }}</span>
|
||||
</div>
|
||||
<div class="select_desk_dialog u-p-b-20">
|
||||
<key-board isCanEmpty v-model="number" isFloat @clear="clear">
|
||||
<template #clear>
|
||||
@@ -70,6 +75,8 @@ const state = reactive({
|
||||
item: "",
|
||||
});
|
||||
const { guazhangRen, number, show, hasOpen, loading, tips, focus, data, item } = toRefs(state);
|
||||
const title = ref("称重商品");
|
||||
let min = ref(0);
|
||||
const price = computed(() => {
|
||||
if (!item.value) {
|
||||
return 0;
|
||||
@@ -101,11 +108,16 @@ function confirm() {
|
||||
if (number.value * 1 <= 0) {
|
||||
return ElMessage.error("请输入重量");
|
||||
}
|
||||
if (number.value * 1 < min.value) {
|
||||
return ElMessage.error("最小起售数量为" + min.value + item.value.unitName);
|
||||
}
|
||||
emits("confirm", item.value, (number.value * 1).toFixed(2));
|
||||
close();
|
||||
}
|
||||
function open(data) {
|
||||
item.value = data;
|
||||
min.value = data.skuList[0].suitNum || 0;
|
||||
title.value = data.name;
|
||||
show.value = true;
|
||||
}
|
||||
function close() {
|
||||
|
||||
Reference in New Issue
Block a user