版本更新,折扣打印优化
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "vite-electron",
|
"name": "vite-electron",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "1.4.17",
|
"version": "1.4.18",
|
||||||
"main": "dist-electron/main.js",
|
"main": "dist-electron/main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "chcp 65001 && vite",
|
"dev": "chcp 65001 && vite",
|
||||||
|
|||||||
@@ -75,17 +75,20 @@ export default (data) => {
|
|||||||
<div style="margin-top: 6px;margin-bottom: 6px;width: 100%">
|
<div style="margin-top: 6px;margin-bottom: 6px;width: 100%">
|
||||||
<hr/>
|
<hr/>
|
||||||
</div>
|
</div>
|
||||||
<div style="margin-top: 6px; font-size: 22px;display:flex;justify-content: space-between;">
|
<div style="margin-top: 6px; font-size: 12px;display:flex;justify-content: space-between;">
|
||||||
<span>应收</span>
|
<span>原价</span>
|
||||||
<span>¥${data.discountAmount}</span>
|
<span>${data.amount}</span>
|
||||||
</div>
|
</div>
|
||||||
<div style="margin-top: 4px; font-size: 12px;">
|
<div style="margin-top: 6px; font-size: 12px;display:flex;justify-content: space-between;">
|
||||||
<span>共计:</span>
|
<span>折扣</span>
|
||||||
<span>¥${data.amount}</span>
|
<span>-${formatDecimal(data.amount - data.discountAmount)}</span>
|
||||||
<span style="margin-left: 10px;">优惠:</span>
|
</div>
|
||||||
<span>¥${formatDecimal(data.amount - data.discountAmount)}(${
|
<div style="margin-top: 6px;margin-bottom: 6px;width: 100%">
|
||||||
data.discount
|
<hr/>
|
||||||
}折)</span>
|
</div>
|
||||||
|
<div style="margin-top: 6px; font-size: 22px;display:flex;justify-content: space-between;">
|
||||||
|
<span>实付</span>
|
||||||
|
<span>¥${data.discountAmount}</span>
|
||||||
</div>
|
</div>
|
||||||
<div style="margin-top: 6px;margin-bottom: 6px;width: 100%">
|
<div style="margin-top: 6px;margin-bottom: 6px;width: 100%">
|
||||||
<hr/>
|
<hr/>
|
||||||
|
|||||||
@@ -6,10 +6,10 @@
|
|||||||
<span class="num">{{ money }}</span>
|
<span class="num">{{ money }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="t2">
|
<div class="t2">
|
||||||
<span>共计:¥{{ props.amount }}</span>
|
<span>原价:¥{{ formatDecimal(props.amount) }}</span>
|
||||||
<span style="margin-left: 20px;">优惠:¥{{ formatDecimal(props.amount - money) }}</span>
|
<span style="margin-left: 20px;">优惠:¥{{ formatDecimal(props.amount - money) }}</span>
|
||||||
<span v-if="props.discount" @click="cancelDiscount">({{ formatDecimal(props.discount * 10, 1, true) }}折)
|
<span style="margin-left: 20px;" v-if="props.discount" @click="cancelDiscount">折扣:{{ formatDecimal(props.discount * 10, 1, true) }}折
|
||||||
<el-icon>
|
<el-icon style="margin-left: 6px;">
|
||||||
<CircleClose />
|
<CircleClose />
|
||||||
</el-icon>
|
</el-icon>
|
||||||
</span>
|
</span>
|
||||||
@@ -124,7 +124,7 @@ const money = ref('0')
|
|||||||
const scanModalRef = ref(null)
|
const scanModalRef = ref(null)
|
||||||
|
|
||||||
watch(props, (value) => {
|
watch(props, (value) => {
|
||||||
money.value = `${props.amount}`
|
money.value = `${formatDecimal(props.amount)}`
|
||||||
if (props.discount > 0) {
|
if (props.discount > 0) {
|
||||||
money.value = `${formatDecimal(props.amount * props.discount)}`
|
money.value = `${formatDecimal(props.amount * props.discount)}`
|
||||||
}
|
}
|
||||||
@@ -334,7 +334,7 @@ function cancelDiscount() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
money.value = `${props.amount}`
|
money.value = `${formatDecimal(props.amount)}`
|
||||||
queryPayTypeAjax()
|
queryPayTypeAjax()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<!-- 结算订单 -->
|
<!-- 结算订单 -->
|
||||||
<template>
|
<template>
|
||||||
<el-drawer size="100%" :with-header="false" direction="btt" v-model="dialogVisible">
|
<el-drawer size="100%" :with-header="false" direction="btt" v-model="dialogVisible" @closed="drawerClose">
|
||||||
<div class="drawer_wrap">
|
<div class="drawer_wrap">
|
||||||
<div class="cart_list">
|
<div class="cart_list">
|
||||||
<div class="nav_wrap card">
|
<div class="nav_wrap card">
|
||||||
@@ -74,7 +74,7 @@
|
|||||||
<div>
|
<div>
|
||||||
<el-input-number v-model="discount" :min="staffDiscount" :max="0.99" :step="0.1"
|
<el-input-number v-model="discount" :min="staffDiscount" :max="0.99" :step="0.1"
|
||||||
:disabled="staffDiscount == 0" />
|
:disabled="staffDiscount == 0" />
|
||||||
<div class="tips">最低折扣比例:{{ staffDiscount }}折</div>
|
<div class="tips">最低折扣比例:{{ staffDiscount }}</div>
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
@@ -174,6 +174,7 @@ async function getStaffDiscountAjax() {
|
|||||||
staffId: store.userInfo.staffId
|
staffId: store.userInfo.staffId
|
||||||
})
|
})
|
||||||
staffDiscount.value = res
|
staffDiscount.value = res
|
||||||
|
discount.value = res
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
}
|
}
|
||||||
@@ -187,6 +188,11 @@ function discountConfirm() {
|
|||||||
showStaffDiscount.value = false
|
showStaffDiscount.value = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 关闭结算弹窗
|
||||||
|
function drawerClose() {
|
||||||
|
propsDiscount.value = 0
|
||||||
|
}
|
||||||
|
|
||||||
// 预打印操作
|
// 预打印操作
|
||||||
const printHandle = _.throttle(async function () {
|
const printHandle = _.throttle(async function () {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -83,9 +83,9 @@
|
|||||||
</div>
|
</div>
|
||||||
<keyboard v-if="props.membershow == '1'" @consumeFees="consumeFees"></keyboard>
|
<keyboard v-if="props.membershow == '1'" @consumeFees="consumeFees"></keyboard>
|
||||||
<div class="orderbox_right_button" v-if="props.membershow == '0'">
|
<div class="orderbox_right_button" v-if="props.membershow == '0'">
|
||||||
<el-button style="width: 100%;" @click="toHome">创建订单</el-button>
|
<!-- <el-button style="width: 100%;" @click="toHome">创建订单</el-button> -->
|
||||||
<!-- <el-button style="width: 60%;" type="primary" @click="recharge = true">账户充值</el-button> -->
|
<!-- <el-button style="width: 60%;" type="primary" @click="recharge = true">账户充值</el-button> -->
|
||||||
<el-button style="width: 60%;" type="primary" @click="userChargeRef.show()">账户充值</el-button>
|
<el-button style="width: 100%;" type="primary" @click="userChargeRef.show()">账户充值</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div class="orderbox_right_button" v-if="props.membershow == '1'">
|
<div class="orderbox_right_button" v-if="props.membershow == '1'">
|
||||||
<router-link to="/" style="width: 35%;">
|
<router-link to="/" style="width: 35%;">
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<div class="demo_tabs_boxitem_one">
|
<div class="demo_tabs_boxitem_one">
|
||||||
<div class=""
|
<div class=""
|
||||||
style="width: 100px; height: 70px;border-radius: 4px; background:rgb(186 200 239); display: flex; justify-content: center; align-items: center;">
|
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>
|
</div>
|
||||||
<!-- <el-image style="width: 100px; height: 70px;border-radius: 10px;" :src="item.imgUrl" fit="scale-down" /> -->
|
<!-- <el-image style="width: 100px; height: 70px;border-radius: 10px;" :src="item.imgUrl" fit="scale-down" /> -->
|
||||||
<div class="demo_tabs_boxitem_oneone">
|
<div class="demo_tabs_boxitem_oneone">
|
||||||
@@ -30,7 +30,15 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="demo_tabs_boxitem_tow">
|
<div class="demo_tabs_boxitem_tow">
|
||||||
<div>
|
<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>
|
||||||
<div style="color:#ff9e01;">
|
<div style="color:#ff9e01;">
|
||||||
<span v-if="item.status == 'pending'">挂单</span>
|
<span v-if="item.status == 'pending'">挂单</span>
|
||||||
@@ -46,6 +54,7 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
import { dayjs } from 'element-plus'
|
import { dayjs } from 'element-plus'
|
||||||
|
import { formatDecimal } from '@/utils/index.js'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
ordereData: {
|
ordereData: {
|
||||||
|
|||||||
@@ -80,9 +80,23 @@
|
|||||||
<div class="orderbox_right_item">
|
<div class="orderbox_right_item">
|
||||||
<span class="span">流水号:</span><span class="nunber">{{ orderDetaildata.masterId }}</span>
|
<span class="span">流水号:</span><span class="nunber">{{ orderDetaildata.masterId }}</span>
|
||||||
</div>
|
</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">
|
<div class="orderbox_right_top" style="margin-top: 20px; border-bottom: 2px solid #ccc">
|
||||||
<span>合计:</span>
|
<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>
|
||||||
<div class="orderbox_right_top" style="margin-top: 20px; border-bottom: 2px solid #ccc">
|
<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>
|
<span style="font-size: 16px" v-if="orderDetaildata.status == 'pending'">挂单</span>
|
||||||
@@ -390,8 +404,8 @@ async function passwordSuccess(pwd) {
|
|||||||
return item && item;
|
return item && item;
|
||||||
});
|
});
|
||||||
if (arr.length != 0) {
|
if (arr.length != 0) {
|
||||||
// await payreturnOrder(arr, md5(pwd));
|
await payreturnOrder(arr, md5(pwd), isOnline.value);
|
||||||
await payreturnOrder(arr, '', isOnline.value);
|
// await payreturnOrder(arr, '', isOnline.value);
|
||||||
changechecked.value = false;
|
changechecked.value = false;
|
||||||
recharge.value = false;
|
recharge.value = false;
|
||||||
itemboxshow.value = false;
|
itemboxshow.value = false;
|
||||||
@@ -418,8 +432,8 @@ const payreturnOrderclick = lodash.debounce(
|
|||||||
ElMessage.error("退款金额不能为0!");
|
ElMessage.error("退款金额不能为0!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// takeFoodCodeRef.value.show();
|
takeFoodCodeRef.value.show();
|
||||||
passwordSuccess()
|
// passwordSuccess()
|
||||||
},
|
},
|
||||||
500,
|
500,
|
||||||
{ leading: true, trailing: false }
|
{ leading: true, trailing: false }
|
||||||
@@ -463,7 +477,9 @@ const print = lodash.throttle(
|
|||||||
shop_name: store.userInfo.shopName,
|
shop_name: store.userInfo.shopName,
|
||||||
loginAccount: store.userInfo.loginAccount,
|
loginAccount: store.userInfo.loginAccount,
|
||||||
carts: [],
|
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,
|
remark: printLabelOrder.value.remark,
|
||||||
orderInfo: printLabelOrder.value,
|
orderInfo: printLabelOrder.value,
|
||||||
outNumber: printLabelOrder.value.outNumber,
|
outNumber: printLabelOrder.value.outNumber,
|
||||||
@@ -559,7 +575,7 @@ const printLabelOrder = ref("");
|
|||||||
|
|
||||||
const emititemboxshow = async (e) => {
|
const emititemboxshow = async (e) => {
|
||||||
//接收子组件值 并赋值给父组件
|
//接收子组件值 并赋值给父组件
|
||||||
// console.log('emititemboxshow', e);
|
console.log('emititemboxshow', e);
|
||||||
printLabelOrder.value = e;
|
printLabelOrder.value = e;
|
||||||
|
|
||||||
loadingboxshow.value = true;
|
loadingboxshow.value = true;
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
</el-icon>
|
</el-icon>
|
||||||
<span class="t">{{ status[props.tableInfo.status] }}</span>
|
<span class="t">{{ status[props.tableInfo.status] }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="cart" v-if="props.tableInfo.status == 'using'">
|
<div class="cart" v-loading="payLoading" v-if="props.tableInfo.status == 'using'">
|
||||||
<div class="cart_list">
|
<div class="cart_list">
|
||||||
<div class="item" v-for="item in cartList" :key="item.id">
|
<div class="item" v-for="item in cartList" :key="item.id">
|
||||||
<div class="top">
|
<div class="top">
|
||||||
@@ -32,10 +32,10 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="btn_container">
|
<div class="btn_container">
|
||||||
<div class="btn_wrap">
|
<div class="btn_wrap">
|
||||||
<el-button type="success" style="width: 100%;" @click="toOrderMeal(1)">加菜</el-button>
|
<el-button type="success" style="width: 100%;" @click="toOrderMeal(1)">加菜/管理</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div class="btn_wrap">
|
<div class="btn_wrap">
|
||||||
<el-button type="primary" :loading="payLoading" style="width: 100%;" @click="showPayHandle">结算(¥{{
|
<el-button type="primary" style="width: 100%;" @click="showPayHandle">结算(¥{{
|
||||||
orderInfo.orderAmount || 0 }})</el-button>
|
orderInfo.orderAmount || 0 }})</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -111,7 +111,7 @@ function showPayHandle() {
|
|||||||
// 获取订单详情
|
// 获取订单详情
|
||||||
async function getOrderDetail() {
|
async function getOrderDetail() {
|
||||||
try {
|
try {
|
||||||
if (!props.tableInfo.status == 'using') return
|
if (props.tableInfo.orderId) {
|
||||||
payLoading.value = true
|
payLoading.value = true
|
||||||
const res = await orderDetail({
|
const res = await orderDetail({
|
||||||
shopId: store.userInfo.shopId,
|
shopId: store.userInfo.shopId,
|
||||||
@@ -129,6 +129,7 @@ async function getOrderDetail() {
|
|||||||
}
|
}
|
||||||
return obj
|
return obj
|
||||||
})
|
})
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
payLoading.value = false
|
payLoading.value = false
|
||||||
console.log(error);
|
console.log(error);
|
||||||
|
|||||||
Reference in New Issue
Block a user