瀏覽代碼

fix(print): update printTemplateId truthiness check

Change the condition for `printTemplateId` from a strict non-zero check to a truthy check to correctly handle cases where the ID might be null or undefined.
LaveyD 6 天之前
父節點
當前提交
729f2ec26b
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/components/PrintTemplate.vue

+ 1 - 1
src/components/PrintTemplate.vue

@@ -458,7 +458,7 @@ export default {
         const printTemplateId = val.printTemplateId || val.print_model_id
         console.log('current ticket printTemplateId', printTemplateId)
 
-        if (printTemplateId !== 0) {
+        if (printTemplateId) {
           target = this.$store.state.app.printTemplateList.find(i => i.id === printTemplateId)
         } else {
           let id = this.$localStore.get('defaultTemplate')