update cssd

This commit is contained in:
Fayyazi
2019-10-09 13:33:18 +03:30
parent 65666d7919
commit d8dd6f7bcf
17 changed files with 116 additions and 14 deletions
+2 -2
View File
@@ -130,9 +130,9 @@ export default {
role: 'Admin'
},
{
to: {name: 'AllPack'},
to: {name: 'AllLabels'},
icon: 'fas fa-inbox',
text: 'Packs'
text: 'Labels'
},
{
to: {name: 'AllCycle'},
@@ -1,7 +1,7 @@
<template>
<v-container grid-list-xs>
<material-card color="black" title="Show Package">
<material-card color="black" id="printMe" title="Show Label">
<v-layout align-left justify-left wrap class="px-5 my-3">
<h3 class="ml-3">Info</h3>
<v-flex xs12>
@@ -53,6 +53,31 @@
</v-flex>
</v-layout>
</v-layout>
<v-layout id="printMe" align-left justify-left wrap class="px-5 my-3">
<h3 class="ml-3">Barcode And QRCode Image</h3>
<v-flex xs12>
<hr class="v-divider theme--light">
</v-flex>
<v-layout row wrap class="ml-4">
<v-flex xs12 md6 sm6 v-if="data.bar_code">
<img :src="data.bar_code">
</v-flex>
</v-layout>
<v-layout row wrap class="ml-4">
<v-flex xs12 md6 sm6 v-if="data.qr_code">
<img :src="data.qr_code">
</v-flex>
</v-layout>
</v-layout>
<v-layout row wrap align-center justify-center>
<v-flex class xs12 md2 sm2 @click="print" >
<v-btn class="WM-CyanBlueGradient-BG" style="padding:10px 60px">
<v-icon class="white--text mr-2 caption">fas fa-print</v-icon>
<span class="white--text">Print</span>
</v-btn>
</v-flex>
</v-layout>
</material-card>
</v-container>
</template>
@@ -79,6 +104,39 @@ export default {
this.setResultModal(result.data.data);
this.closeModal();
}
},
print() {
const prtHtml = document.getElementById("printMe").innerHTML;
// Get all stylesheets HTML
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();
}
},
created() {