1.新增全部本地打印标签

2.优化订单重但标签小票
This commit is contained in:
gyq
2024-06-21 13:56:16 +08:00
parent c86fff9691
commit 0b2b4b44d0
17 changed files with 2356 additions and 342 deletions

View File

@@ -23,13 +23,14 @@
<div class="item" v-for="item in tableData.list" :key="item.id">
<div class="top">
<div class="left">
{{ item.outCode }} - {{ item.productName }}
<div class="title">取餐号{{ filterCode(item.outCode) }}</div>
<div class="shop">商品{{ item.productName }}</div>
</div>
<div class="state s1" v-if="item.status == 0">
叫号成功
<div class="dot"></div> 叫号成功
</div>
<div class="state s2" v-if="item.status == 1">
叫号失败
<div class="dot"></div> 叫号失败
</div>
</div>
<div class="btm">
@@ -54,6 +55,7 @@
<script setup>
import _ from "lodash";
import dayjs from 'dayjs'
import { ElMessage } from 'element-plus'
import { onMounted, reactive, ref } from 'vue';
import { useUser } from "@/store/user.js";
import { scanSendMessage, getsendMessage } from '@/api/order/index'
@@ -85,8 +87,15 @@ const tableData = reactive({
const emit = defineEmits(['success'])
// 截取字符串
function filterCode(t, c = '#') {
let n = t.split(c)
return n[1]
}
function show() {
dialogVisible.value = true
getsendMessageAjax()
setTimeout(() => {
inputRef.value.focus();
}, 500);
@@ -120,6 +129,7 @@ function handleCurrentChange() {
// 获取叫号记录
async function getsendMessageAjax() {
try {
if (!store.userInfo.shopId) return
tableData.loading = true
const res = await getsendMessage({
page: tableData.page,
@@ -132,6 +142,7 @@ async function getsendMessageAjax() {
tableData.total = res.total
} catch (error) {
console.log(error);
tableData.loading = false
}
}
@@ -145,7 +156,10 @@ const confirmHandle = _.throttle(async function () {
shopId: store.userInfo.shopId,
// shopId: 4
})
ElMessage.success('叫号成功')
loading.value = false
number.value = ''
getsendMessageAjax()
setTimeout(() => {
inputRef.value.focus();
@@ -163,10 +177,6 @@ const confirmHandle = _.throttle(async function () {
defineExpose({
show
})
onMounted(() => {
getsendMessageAjax()
})
</script>
<style scoped lang="scss">
@@ -218,15 +228,42 @@ onMounted(() => {
.left {
color: #000;
.title {
font-weight: bold;
}
.shop {
color: #555;
}
}
.state {
display: flex;
align-items: center;
.dot {
$size: 6px;
width: $size;
height: $size;
border-radius: 50%;
margin-right: 4px;
}
&.s1 {
color: var(--primary-color);
.dot {
background-color: var(--primary-color);
}
}
&.s2 {
color: var(--el-color-error);
.dot {
background-color: var(--el-color-error);
}
}
}
}
@@ -236,7 +273,8 @@ onMounted(() => {
justify-content: space-between;
padding-top: 4px;
.time {
.time,
.info {
color: #999;
}
}

View File

@@ -4,18 +4,9 @@
<div class="row" v-for="(item, index) in categorys" :key="item.id">
<div class="list_title">{{ item.name }}</div>
<div class="item_wrap">
<el-button
:type="item.active ? 'primary' : ''"
@click="selectHandle(item)"
>全部</el-button
>
<el-button
:type="val.active ? 'primary' : ''"
v-for="val in item.childrenList"
:key="val.id"
@click="selectHandle(val, index)"
>{{ val.name }}</el-button
>
<el-button :type="item.active ? 'primary' : ''" @click="selectHandle(item)">全部</el-button>
<el-button :type="val.active ? 'primary' : ''" v-for="val in item.childrenList" :key="val.id"
@click="selectHandle(val, index)">{{ val.name }}</el-button>
</div>
</div>
</div>
@@ -82,15 +73,16 @@ async function tbShopCategoryGetAjax() {
shopId: store.userInfo.shopId,
sort: "sort,desc",
page: 0,
size: 500,
pageSize: 200,
});
res.map((item) => {
console.log(res);
res.list.map((item) => {
item.active = false;
item.childrenList.map((item) => {
item.active = false;
});
});
categorys.value = res;
categorys.value = res.list;
setTimeout(() => {
loading.value = false;