|
|
@@ -417,7 +417,6 @@ export default {
|
|
|
return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())} ${pad(d.getHours())}:${pad(d.getMinutes())}:${pad(d.getSeconds())}`
|
|
|
},
|
|
|
startPrint () {
|
|
|
- console.log('currentTicket', this.currentTicket)
|
|
|
const webview = document.querySelector('#printWebview')
|
|
|
let printDoc = this.$refs.printMe.outerHTML
|
|
|
// if (this.preview) {
|
|
|
@@ -456,8 +455,11 @@ export default {
|
|
|
handler (val) {
|
|
|
if (!val) return
|
|
|
let target
|
|
|
- if (val.print_model_id !== 0) {
|
|
|
- target = this.$store.state.app.printTemplateList.find(i => i.id === val.print_model_id)
|
|
|
+ const printTemplateId = val.printTemplateId || val.print_model_id
|
|
|
+ console.log('current ticket printTemplateId', printTemplateId)
|
|
|
+
|
|
|
+ if (printTemplateId !== 0) {
|
|
|
+ target = this.$store.state.app.printTemplateList.find(i => i.id === printTemplateId)
|
|
|
} else {
|
|
|
let id = this.$localStore.get('defaultTemplate')
|
|
|
target = this.$store.state.app.printTemplateList.find(i => i.id === id)
|
|
|
@@ -485,7 +487,7 @@ export default {
|
|
|
if (this.currentTicket.allInvoiceQrcode) {
|
|
|
this.afpImg = await QRCode.toDataURL(this.currentTicket.allInvoiceQrcode, opts)
|
|
|
}
|
|
|
- console.warn(this.currentTicket)
|
|
|
+ console.warn('print ticket', this.currentTicket)
|
|
|
if (this.preview) return
|
|
|
|
|
|
setTimeout(() => {
|