版本更新,折扣打印优化

This commit is contained in:
gyq
2024-08-28 09:53:27 +08:00
parent fbfee69b25
commit 3047fe0404
8 changed files with 85 additions and 50 deletions

View File

@@ -7,12 +7,12 @@
<div class="demo_tabs_boxitem_one">
<div class=""
style="width: 100px; height: 70px;border-radius: 4px; background:rgb(186 200 239); display: flex; justify-content: center; align-items: center;">
<div>{{ item.tableName || "pos" }}</div>
<div>{{ item.tableName || "POS" }}</div>
</div>
<!-- <el-image style="width: 100px; height: 70px;border-radius: 10px;" :src="item.imgUrl" fit="scale-down" /> -->
<div class="demo_tabs_boxitem_oneone">
<div>
{{ dayjs(item.createAt).format(" HH:mm:ss") }}
{{ dayjs(item.createAt).format("HH:mm:ss") }}
</div>
<div style="color: #757575;">
{{ dayjs(item.createAt).format("YYYY-MM-DD") }}
@@ -30,7 +30,15 @@
</div>
<div class="demo_tabs_boxitem_tow">
<div>
{{ item.orderAmount }}
<template v-if="item.discountAmount <= 0">
{{ formatDecimal(item.orderAmount) }}
</template>
<template v-else>
<span>{{ formatDecimal(item.orderAmount - item.discountAmount) }}</span>
<span style="text-decoration: line-through;color: #999;font-size: 14px;">
{{ formatDecimal(item.orderAmount) }}
</span>
</template>
</div>
<div style="color:#ff9e01;">
<span v-if="item.status == 'pending'">挂单</span>
@@ -46,6 +54,7 @@
<script setup>
import { ref } from 'vue'
import { dayjs } from 'element-plus'
import { formatDecimal } from '@/utils/index.js'
const props = defineProps({
ordereData: {

View File

@@ -80,9 +80,23 @@
<div class="orderbox_right_item">
<span class="span">流水号</span><span class="nunber">{{ orderDetaildata.masterId }}</span>
</div>
<div class="orderbox_right_item" v-if="orderDetaildata.discountAmount > 0">
<span class="span">折扣</span><span class="nunber">{{ formatDecimal(orderDetaildata.discountRatio *
10, 1, true) }}</span>
</div>
<div class="orderbox_right_top" style="margin-top: 20px; border-bottom: 2px solid #ccc">
<span>合计</span>
<span>{{ orderDetaildata.orderAmount }}</span>
<div>
<template v-if="orderDetaildata.discountAmount <= 0">
{{ formatDecimal(orderDetaildata.orderAmount) }}
</template>
<template v-else>
<span>{{ formatDecimal(orderDetaildata.orderAmount - orderDetaildata.discountAmount) }}</span>
<span style="text-decoration: line-through;color: #999;font-size: 14px;">
{{ formatDecimal(orderDetaildata.orderAmount) }}
</span>
</template>
</div>
</div>
<div class="orderbox_right_top" style="margin-top: 20px; border-bottom: 2px solid #ccc">
<span style="font-size: 16px" v-if="orderDetaildata.status == 'pending'">挂单</span>
@@ -390,8 +404,8 @@ async function passwordSuccess(pwd) {
return item && item;
});
if (arr.length != 0) {
// await payreturnOrder(arr, md5(pwd));
await payreturnOrder(arr, '', isOnline.value);
await payreturnOrder(arr, md5(pwd), isOnline.value);
// await payreturnOrder(arr, '', isOnline.value);
changechecked.value = false;
recharge.value = false;
itemboxshow.value = false;
@@ -418,8 +432,8 @@ const payreturnOrderclick = lodash.debounce(
ElMessage.error("退款金额不能为0");
return false;
}
// takeFoodCodeRef.value.show();
passwordSuccess()
takeFoodCodeRef.value.show();
// passwordSuccess()
},
500,
{ leading: true, trailing: false }
@@ -463,7 +477,9 @@ const print = lodash.throttle(
shop_name: store.userInfo.shopName,
loginAccount: store.userInfo.loginAccount,
carts: [],
amount: printLabelOrder.value.orderAmount,
amount: formatDecimal(printLabelOrder.value.orderAmount),
discountAmount: printLabelOrder.value.discountAmount > 0 ? formatDecimal(printLabelOrder.value.orderAmount - printLabelOrder.value.discountAmount) : formatDecimal(printLabelOrder.value.orderAmount),
discount: printLabelOrder.value.discountRatio ? formatDecimal(printLabelOrder.value.discountRatio * 10, 1, true) : 0,
remark: printLabelOrder.value.remark,
orderInfo: printLabelOrder.value,
outNumber: printLabelOrder.value.outNumber,
@@ -559,7 +575,7 @@ const printLabelOrder = ref("");
const emititemboxshow = async (e) => {
//接收子组件值 并赋值给父组件
// console.log('emititemboxshow', e);
console.log('emititemboxshow', e);
printLabelOrder.value = e;
loadingboxshow.value = true;