This commit is contained in:
魏啾
2024-06-24 09:05:09 +08:00
5 changed files with 189 additions and 7 deletions

12
src/store/print.js Normal file
View File

@@ -0,0 +1,12 @@
import { defineStore } from "pinia";
export const usePrint = defineStore({
id: "print",
state: () => ({
data: "", // 要打印的数据
}),
actions: {
// 执行打印操作
printHandle(state) {},
},
});

View File

@@ -226,14 +226,14 @@ const printLabel = (list) => {
async function printHandle() {
try {
if (!isPrint.value) return;
if (printList.value.length) {
if (printLabelList.value.length) {
const data = {
shop_name: store.userInfo.merchantName,
carts: props.cart,
amount: props.amount,
remark: props.remark,
orderInfo: props.orderInfo,
deviceName: printList.value[0].config.deviceName,
deviceName: printLabelList.value[0].config.deviceName,
createdAt: dayjs(props.orderInfo.createdAt).format(
"YYYY-MM-DD HH:mm:ss"
),