cashier_desktop/public/print.html

109 lines
2.5 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!--
~ Copyright (c) 2023. Author Hubert Formin <2399270194@qq.com>
-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Print preview</title>
<style>
@page {
size: auto;
}
html {
padding-bottom: 100px;
}
.title_wrap {
font-weight: bold;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
padding: 50px 0;
}
.title {
font-size: 24px;
}
.min_title {
font-size: 18px;
padding-top: 10px;
}
.item {
padding: 20px 0;
}
.item.b {
font-weight: bold;
}
.img {
width: 100%;
display: block;
}
</style>
</head>
<body>
<br />
<section id="app">
<div class="title_wrap">
<div class="title">
<b>{{data.shop_name}}</b>
</div>
<div class="min_title">结账单</div>
</div>
<div class="item b">NO:{{data.orderId}}</div>
<div class="item b">开始时间2023-3-4 16:32:54</div>
<div class="item b">结束时间2023-3-4 16:32:54</div>
<div class="item b">打印人002-蔡紫薇 打印次数:第一次打印</div>
<div class="item b">品相费450</div>
<div class="item b">服务费280</div>
<div v-for="(item,index) in data.carts" :key="index">
<div class="item">{{item.name}} {{item.number}}</div>
<br />
</div>
<div class="item b">收银员:张三</div>
</section>
<div class="item b">电话</div>
<br />
<div class="item b">地址:陕西省西安市灞桥区后海餐厅一二三</div>
<br />
<div class="item b">--------------------------------</div>
<br />
<div class="item b">--------------------------------</div>
<br />
<div class="item b">--------------------------------</div>
<br />
<script type="module">
const { ipcRenderer } = require("electron");
import {
createApp,
ref,
onMounted,
} from "../node_modules/vue/dist/vue.esm-browser.js";
createApp({
setup() {
const data = ref({});
onMounted(() => {
ipcRenderer.on("getParams", (event, arg) => {
data.value = JSON.parse(arg);
});
ipcRenderer.send("printStart");
});
return {
data,
};
},
}).mount("#app");
</script>
</body>
</html>