From ae0448a7504fa788808cbbbfd075e8deaf881541 Mon Sep 17 00:00:00 2001 From: TimoxGagarin Date: Fri, 30 Aug 2024 12:55:19 +0300 Subject: [PATCH] Add reciept without styles. --- .eslintrc.js | 9 + components/ReceiptComponent.vue | 119 +++++++ nuxt.config.js | 1 + package.json | 3 +- pages/i/_id.vue | 32 +- plugins/vue-html2pdf.js | 6 + yarn.lock | 531 +++++++++++++++++++++++++++++++- 7 files changed, 689 insertions(+), 12 deletions(-) create mode 100644 components/ReceiptComponent.vue create mode 100644 plugins/vue-html2pdf.js diff --git a/.eslintrc.js b/.eslintrc.js index 203973d..813ee5b 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -29,5 +29,14 @@ module.exports = { }, ], "vue/multi-word-component-names": "off", + "new-cap": [ + "error", + { + newIsCap: true, + capIsNew: false, + properties: true, + newIsCapExceptions: ["jsPDF"], + }, + ], }, } diff --git a/components/ReceiptComponent.vue b/components/ReceiptComponent.vue new file mode 100644 index 0000000..ace84c7 --- /dev/null +++ b/components/ReceiptComponent.vue @@ -0,0 +1,119 @@ + + + diff --git a/nuxt.config.js b/nuxt.config.js index 3926c3c..fb9762f 100644 --- a/nuxt.config.js +++ b/nuxt.config.js @@ -71,6 +71,7 @@ export default { "~/plugins/eventbus.js", { src: "~/plugins/imageinput.js", mode: "client" }, { src: "~/plugins/datetimepicker.js", mode: "client" }, + { src: "~/plugins/vue-html2pdf.js", mode: "client" }, "~/plugins/vueQR.js", ], /* diff --git a/package.json b/package.json index 6033810..ed0c4a4 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,8 @@ "js-cookie": "^3.0.5", "nuxt-start": "^2.15.1", "socks-proxy-agent": "^8.0.0", - "vuex-persistedstate": "^4.1.0" + "vuex-persistedstate": "^4.1.0", + "vue-html2pdf": "^1.8.0" }, "devDependencies": { "@babel/eslint-parser": "^7.16.5", diff --git a/pages/i/_id.vue b/pages/i/_id.vue index e7c0392..21bae68 100644 --- a/pages/i/_id.vue +++ b/pages/i/_id.vue @@ -55,6 +55,32 @@ {{ texts[status].text }} + + + +
+ + +
+
+ Print +
@@ -63,13 +89,16 @@