new Changes

This commit is contained in:
saeid
2019-08-21 13:59:18 +04:30
parent b9cadbedc5
commit f7c3e87e5f
127 changed files with 216 additions and 21 deletions
@@ -127,6 +127,12 @@ export default {
text: 'Packages', text: 'Packages',
role: 'Admin' role: 'Admin'
}, },
{
to: {name: 'All Cycle'},
icon: 'done',
text: 'Cycles',
role: 'Admin'
},
{ {
to: {name: 'Statistics'}, to: {name: 'Statistics'},
icon: 'fas fa-chart-bar', icon: 'fas fa-chart-bar',
@@ -1,18 +1,18 @@
<template> <template>
<v-container grid-list-xs> <v-container grid-list-xs>
<material-card color="black" title="Barcode Image"> <material-card color="black" title="Barcode Image">
<v-layout align-left justify-left wrap class="px-5 my-3"> <v-layout id="printMe" align-left justify-left wrap class="px-5 my-3">
<h3 class="ml-3">Barcode And QRCode Image</h3> <h3 class="ml-3">Barcode And QRCode Image</h3>
<v-flex xs12> <v-flex xs12>
<hr class="v-divider theme--light"> <hr class="v-divider theme--light">
</v-flex> </v-flex>
<v-layout row wrap class="ml-4"> <v-layout row wrap class="ml-4">
<v-flex xs12 md6 sm6> <v-flex xs12 md6 sm6 v-if="barcodeimg">
<img :src="barcodeimg"> <img :src="barcodeimg">
</v-flex> </v-flex>
</v-layout> </v-layout>
<v-layout row wrap class="ml-4"> <v-layout row wrap class="ml-4">
<v-flex xs12 md6 sm6> <v-flex xs12 md6 sm6 v-if="QRCodeimg">
<img :src="QRCodeimg"> <img :src="QRCodeimg">
</v-flex> </v-flex>
</v-layout> </v-layout>
@@ -32,22 +32,49 @@
import { mapGetters } from "vuex"; import { mapGetters } from "vuex";
export default { export default {
data: () => ({ data: () => ({
barcodeimg : {}, barcodeimg : null,
QRCodeimg : {} QRCodeimg : null
}), }),
created() { created() {
this.barcodeimg = this.getModalProperties.result.data.data.Barcode; this.barcodeimg = this.getModalProperties.result.data.data.Barcode ? this.getModalProperties.result.data.data.Barcode : null;
this.QRCodeimg = this.getModalProperties.result.data.data.QRCode; this.QRCodeimg = this.getModalProperties.result.data.data.QRCode ? this.getModalProperties.result.data.data.QRCode : null;
}, },
computed: { computed: {
...mapGetters("modal", ["getModalProperties"]) ...mapGetters("modal", ["getModalProperties"])
}, },
methods: { methods: {
print() { print() {
let popup = window.open(); const prtHtml = document.getElementById("printMe").innerHTML;
popup.document.write(`<img src="${this.barcodeimg}" style="padding:50px" /><img src="${this.QRCodeimg}" />`);
popup.focus(); // Get all stylesheets HTML
popup.print(); let stylesHtml = "";
for (const node of [
...document.querySelectorAll('link[rel="stylesheet"], style')
]) {
stylesHtml += node.outerHTML;
}
// Open the print window
const WinPrint = window.open(
"",
"",
"left=0,top=0,width=800,height=900,toolbar=0,scrollbars=0,status=0"
);
WinPrint.document.write(`<!DOCTYPE html>
<html>
<head>
${stylesHtml}
</head>
<body>
${prtHtml}
</body>
</html>`);
WinPrint.document.close();
WinPrint.focus();
WinPrint.print();
WinPrint.close();
} }
} }
}; };

Some files were not shown because too many files have changed in this diff Show More