优化打印 订单新增桌号和时间筛选
This commit is contained in:
@@ -143,6 +143,9 @@ import { ElMessage } from "element-plus";
|
||||
import { tbPrintMachinePost, tbPrintMachineDetail } from "@/api/device";
|
||||
import { useUser } from "@/store/user.js";
|
||||
import { Loading } from "element-plus/es/components/loading/src/service";
|
||||
import { usePrint } from "@/store/print.js";
|
||||
|
||||
const printStore = usePrint();
|
||||
const store = useUser();
|
||||
|
||||
const router = useRouter();
|
||||
@@ -236,6 +239,9 @@ async function submitHandle() {
|
||||
await tbPrintMachinePost(form.value, form.value.id ? "put" : "post");
|
||||
Loading.value = false;
|
||||
ElMessage.success(form.value.id ? "编辑成功" : "添加成功");
|
||||
|
||||
printStore.init();
|
||||
|
||||
router.back();
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
|
||||
@@ -121,6 +121,9 @@ import { useUser } from "@/store/user.js";
|
||||
import { Loading } from "element-plus/es/components/loading/src/service";
|
||||
import classify from "@/components/classify/index.vue";
|
||||
import QRCode from 'qrcode'
|
||||
import { usePrint } from "@/store/print.js";
|
||||
|
||||
const printStore = usePrint();
|
||||
|
||||
const store = useUser();
|
||||
|
||||
@@ -193,6 +196,7 @@ async function submitHandle() {
|
||||
await tbPrintMachinePost(form.value, form.value.id ? "put" : "post");
|
||||
Loading.value = false;
|
||||
ElMessage.success(form.value.id ? "编辑成功" : "添加成功");
|
||||
printStore.init();
|
||||
router.back();
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
<template>
|
||||
<div class="device_container">
|
||||
<div class="header" @click="router.back()">
|
||||
<el-icon
|
||||
style="position: relative; top: 2px; margin-right: 4px"
|
||||
size="22"
|
||||
>
|
||||
<el-icon style="position: relative; top: 2px; margin-right: 4px" size="22">
|
||||
<ArrowLeft />
|
||||
</el-icon>
|
||||
<el-text>设备管理</el-text>
|
||||
@@ -16,10 +13,7 @@
|
||||
<div class="item" v-for="item in list" :key="item.id">
|
||||
<div class="left">
|
||||
<div class="icon">
|
||||
<el-image
|
||||
:src="icons[item.subType]"
|
||||
style="width: 40px; height: 40px"
|
||||
></el-image>
|
||||
<el-image :src="icons[item.subType]" style="width: 40px; height: 40px"></el-image>
|
||||
</div>
|
||||
<div class="info">
|
||||
<div class="name">{{ item.name }}</div>
|
||||
@@ -28,27 +22,16 @@
|
||||
</div>
|
||||
<div class="right">
|
||||
<div class="switch">
|
||||
<el-switch
|
||||
v-model="item.status"
|
||||
inline-prompt
|
||||
active-text="开"
|
||||
inactive-text="关"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
width="90"
|
||||
@change="statusChange($event, item)"
|
||||
/>
|
||||
<el-switch v-model="item.status" inline-prompt active-text="开" inactive-text="关" :active-value="1"
|
||||
:inactive-value="0" width="90" @change="statusChange($event, item)" />
|
||||
</div>
|
||||
<div class="editor">
|
||||
<el-text
|
||||
type="primary"
|
||||
@click="
|
||||
router.push({
|
||||
name: deviceRoute[item.subType],
|
||||
query: { id: item.id },
|
||||
})
|
||||
"
|
||||
>
|
||||
<el-text type="primary" @click="
|
||||
router.push({
|
||||
name: deviceRoute[item.subType],
|
||||
query: { id: item.id },
|
||||
})
|
||||
">
|
||||
编辑
|
||||
</el-text>
|
||||
<el-text type="primary" @click="showDelete(item)">删除</el-text>
|
||||
@@ -89,10 +72,7 @@
|
||||
<div class="menu_wrap">
|
||||
<div class="row" @click="router.push({ name: 'add_device' })">
|
||||
<div class="icon" style="background-color: var(--primary-color)">
|
||||
<el-image
|
||||
:src="icons.cash"
|
||||
style="width: 36px; height: 36px"
|
||||
></el-image>
|
||||
<el-image :src="icons.cash" style="width: 36px; height: 36px"></el-image>
|
||||
</div>
|
||||
<div class="info">
|
||||
<div class="name">添加小票打印机</div>
|
||||
@@ -101,10 +81,7 @@
|
||||
</div>
|
||||
<div class="row" @click="router.push({ name: 'add_label' })">
|
||||
<div class="icon" style="background-color: #79c3d5">
|
||||
<el-image
|
||||
:src="icons.label"
|
||||
style="width: 38px; height: 38px"
|
||||
></el-image>
|
||||
<el-image :src="icons.label" style="width: 38px; height: 38px"></el-image>
|
||||
</div>
|
||||
<div class="info">
|
||||
<div class="name">添加标签打印机</div>
|
||||
@@ -113,10 +90,7 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="icon" style="background-color: #8fc783">
|
||||
<el-image
|
||||
:src="icons.kitchen"
|
||||
style="width: 44px; height: 44px"
|
||||
></el-image>
|
||||
<el-image :src="icons.kitchen" style="width: 44px; height: 44px"></el-image>
|
||||
</div>
|
||||
<div class="info">
|
||||
<div class="name">添加出品打印机</div>
|
||||
@@ -131,11 +105,7 @@
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取消</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
:loading="delLoading"
|
||||
@click="tbPrintMachineDeleteAjax"
|
||||
>
|
||||
<el-button type="primary" :loading="delLoading" @click="tbPrintMachineDeleteAjax">
|
||||
确定
|
||||
</el-button>
|
||||
</div>
|
||||
@@ -154,6 +124,9 @@ import { useRouter } from "vue-router";
|
||||
import { useUser } from "@/store/user.js";
|
||||
import { ElMessage } from "element-plus";
|
||||
import icons from "./icons";
|
||||
import { usePrint } from "@/store/print.js";
|
||||
|
||||
const printStore = usePrint();
|
||||
const store = useUser();
|
||||
|
||||
const router = useRouter();
|
||||
@@ -192,6 +165,7 @@ async function tbPrintMachineDeleteAjax() {
|
||||
dialogVisible.value = false;
|
||||
ElMessage.success("删除成功");
|
||||
tbPrintMachineGetAjax();
|
||||
printStore.init();
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
@@ -220,9 +194,11 @@ onMounted(() => {
|
||||
.dialog_content {
|
||||
font-size: var(--el-font-size-base);
|
||||
}
|
||||
|
||||
.dialog-footer {
|
||||
padding: 0 var(--el-font-size-base) var(--el-font-size-base);
|
||||
}
|
||||
|
||||
.device_container {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
|
||||
Reference in New Issue
Block a user