优化打印效果

This commit is contained in:
gyq
2024-03-07 09:07:22 +08:00
parent 5d96435125
commit b550cf3fd8
12 changed files with 176 additions and 235 deletions

View File

@@ -52,7 +52,7 @@ router.beforeEach((to, from) => {
}
:root {
--r: 24;
--r:24;
--g: 124;
--b: 170;
--r-lighter: calc(var(--r) + (255 - var(--r)) * 0.2);

View File

@@ -110,7 +110,6 @@ const menus = ref([
.text {
color: #999;
font-size: 22px;
}
}
}

View File

@@ -105,26 +105,30 @@ function payTypeChange(index, item) {
// 结算支付
async function confirmOrder() {
try {
if (money.value < props.amount) return
payLoading.value = true
switch (payList.value[payActive.value].payType) {
case 'deposit':
await accountPay({
orderId: props.orderId,
memberId: 1
})
break;
case 'cash':
await cashPay({
orderId: props.orderId
})
break;
default:
break;
if (payList.value[payActive.value].payType == 'scanCode') {
scanModalRef.value.show()
} else {
if (money.value < props.amount) return
payLoading.value = true
switch (payList.value[payActive.value].payType) {
case 'deposit':
await accountPay({
orderId: props.orderId,
memberId: 1
})
break;
case 'cash':
await cashPay({
orderId: props.orderId
})
break;
default:
break;
}
ElMessage.success('支付成功')
emit('paySuccess')
payLoading.value = false
}
ElMessage.success('支付成功')
emit('paySuccess')
payLoading.value = false
} catch (error) {
console.log(error)
payLoading.value = false

View File

@@ -1,6 +1,6 @@
<template>
<div class="operation_wrap">
<div class="item" @click="numberChange('sub')">
<div class="item" :class="{ disabled: props.item.number <= 1 || !props.item.id }" @click="numberChange('sub')">
<el-icon class="icon">
<SemiSelect />
</el-icon>

View File

@@ -29,8 +29,8 @@
</div>
<div class="search_wrap">
<div class="input">
<el-input placeholder="商品名称或首字母简称" prefix-icon="Search" v-model="commdityName" style="width: 400px;"
clearable @input="inputChange"></el-input>
<el-input placeholder="商品名称或首字母简称" prefix-icon="Search" v-model="commdityName" clearable
@input="inputChange"></el-input>
</div>
<el-button :icon="shopListType == 'text' ? 'PictureRounded' : 'PriceTag'"
@click="changeShopListType"></el-button>
@@ -299,59 +299,57 @@ defineExpose({
width: 20%;
padding: 0 10px;
padding-bottom: 20px;
}
.item {
border: 1px solid #ececec;
border-radius: 10px;
overflow: hidden;
position: relative;
.item {
border: 1px solid #ececec;
border-radius: 10px;
overflow: hidden;
position: relative;
&:hover {
cursor: pointer;
}
&:hover {
cursor: pointer;
}
.dot {
padding: 0 14px;
background-color: var(--el-color-danger);
color: #fff;
border-radius: 20px;
position: absolute;
top: 4px;
right: 4px;
z-index: 1;
font-size: 12px;
font-size: 18px;
}
.cover {
width: 100%;
height: 300px;
}
.name {
padding: 0 10px;
height: 50px;
margin-top: 20px;
span {
font-weight: bold;
.dot {
padding: 0 14px;
background-color: var(--el-color-danger);
color: #fff;
border-radius: 20px;
position: absolute;
top: 4px;
right: 4px;
z-index: 1;
font-size: 12px;
font-size: 18px;
}
}
.empty {
height: 50px;
}
.cover {
width: 100%;
height: 150px;
}
.price {
padding: 10px 20px;
background-color: var(--primary-color);
.name {
padding: 0 10px;
height: 50px;
margin-top: 20px;
span {
color: #fff;
font-weight: bold;
font-size: 18px;
span {
font-weight: bold;
}
}
.empty {
height: 50px;
}
.price {
padding: 10px 20px;
background-color: var(--primary-color);
span {
color: #fff;
font-weight: bold;
}
}
}
}

View File

@@ -66,7 +66,7 @@ import { ipcRenderer } from 'electron'
const emit = defineEmits('paySuccess')
const dialogVisible = ref(false)
const dialogVisible = ref(true)
const props = defineProps({
cart: {
type: Array,
@@ -101,7 +101,7 @@ function printHandle() {
remark: props.remark,
orderId: props.orderId
}
ipcRenderer.sendSync('printerInfoSync', JSON.stringify(data))
ipcRenderer.send('printerInfoSync', JSON.stringify(data))
}
// 订单已支付

View File

@@ -11,7 +11,7 @@
<div class="number" @click="takeFoodCodeRef.show()">
<el-text class="t">{{ masterId }}</el-text>
</div>
<div class="select_user" @click="membershow = true">
<!-- <div class="select_user" @click="membershow = true">
<el-icon class="icon">
<UserFilled />
</el-icon>
@@ -19,7 +19,7 @@
<el-icon class="arrow">
<ArrowRight />
</el-icon>
</div>
</div> -->
</div>
<div class="shop_operation">
<div class="shop_list">
@@ -78,7 +78,7 @@
@click="createOrderHandle">
<div class="js">
<el-text class="t">{{ cartInfo.totalAmount }}</el-text>
<el-text class="t" style="margin-left: 250px;">
<el-text class="t" style="margin-left: 30px">
<span v-if="!createOrderLoading">结算</span>
<span v-else>下单中...</span>
</el-text>
@@ -142,7 +142,6 @@ const createOrderLoading = ref(false)
// 取餐码
const masterId = ref('')
const uuid = ref('')
// 挂单量
const pendingCartNum = ref(0)
@@ -212,7 +211,8 @@ async function delCartHandle(params) {
masterId: params.masterId,
cartId: params.id
})
queryCartAjax()
await queryCartAjax()
cartListActive.value = 0
} catch (error) {
console.log(error)
}
@@ -226,6 +226,7 @@ function giftPackHandle(key, item) {
// 打包全选
const allSelectedHandle = async () => {
if (!cartList.value.length) return
allSelected.value = !allSelected.value
await packall({
shopId: store.userInfo.shopId,
@@ -258,7 +259,8 @@ async function addCart(params, type = 'add') {
isPack: params.isPack || false,
isGift: params.isGift || false,
cartId: type == 'add' ? '' : params.id,
uuid: params.uuid || store.userInfo.uuid
uuid: params.uuid || store.userInfo.uuid,
type: type
})
masterId.value = res
goodsRef.value.updateData()
@@ -287,11 +289,11 @@ async function queryCartAjax() {
// 获取取餐码
async function createCodeAjax() {
try {
const res = await createCode({
shopId: store.userInfo.shopId
})
masterId.value = res.code
// masterId.value = '#13'
// const res = await createCode({
// shopId: store.userInfo.shopId
// })
// masterId.value = res.code
masterId.value = '#50'
queryCartAjax()
} catch (error) {
console.log(error)
@@ -305,7 +307,7 @@ onMounted(() => {
<style scoped lang="scss">
.cart_wrap {
width: 550px;
flex: 1.5;
height: 100%;
display: flex;
flex-direction: column;
@@ -519,7 +521,7 @@ onMounted(() => {
}
.shop_manage {
flex: 1;
flex: 2;
margin-left: 20px;
height: 100%;
}