Merge branch 'gyq' of https://e.coding.net/g-cphe0354/pczhuomianduan/cashierdesktop into wwz
This commit is contained in:
12
src/store/print.js
Normal file
12
src/store/print.js
Normal file
@@ -0,0 +1,12 @@
|
||||
import { defineStore } from "pinia";
|
||||
|
||||
export const usePrint = defineStore({
|
||||
id: "print",
|
||||
state: () => ({
|
||||
data: "", // 要打印的数据
|
||||
}),
|
||||
actions: {
|
||||
// 执行打印操作
|
||||
printHandle(state) {},
|
||||
},
|
||||
});
|
||||
@@ -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"
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user