mirror of
https://git.meshkee.com/cssd/cssd-back.git
synced 2026-10-14 00:01:05 +03:30
change label show
This commit is contained in:
@@ -0,0 +1,191 @@
|
||||
<template>
|
||||
<v-container grid-list-xs>
|
||||
<material-card id="printMe" color="black" title="Show Cycle">
|
||||
<v-layout align-left justify-left wrap class="px-5 my-3">
|
||||
<h3 class="ml-3">Info</h3>
|
||||
<v-flex xs12>
|
||||
<hr class="v-divider theme--light">
|
||||
</v-flex>
|
||||
<v-layout row wrap class="ml-4">
|
||||
<v-flex xs12 md6 sm6>
|
||||
<div class="WM-d-flex">
|
||||
<v-icon class="WMi-sort-numeric-up"></v-icon>
|
||||
<span class="headline ml-1" style="letter-spacing:0 !important">{{ data.id }}</span>
|
||||
</div>
|
||||
</v-flex>
|
||||
|
||||
|
||||
<v-flex xs12 md6 sm6>
|
||||
<div>
|
||||
<span class="title">Sterilizer ID :</span>
|
||||
<span class="headline ml-1" style="letter-spacing:0 !important">{{ data.sterilizer_id }}</span>
|
||||
</div>
|
||||
</v-flex>
|
||||
<v-flex xs12 md6 sm6>
|
||||
<div class="WM-d-flex">
|
||||
<v-icon class="WMi-user"></v-icon>
|
||||
<span class="headline ml-2" style="letter-spacing:0 !important">{{ (typeof data.user != 'undefined') ? data.user.name : '' }}</span>
|
||||
</div>
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs12 md6 sm6>
|
||||
<div class="WM-d-flex">
|
||||
<v-icon class="WMi-pencil"></v-icon>
|
||||
<span class="headline ml-1" style="letter-spacing:0 !important">{{ data.note }}</span>
|
||||
</div>
|
||||
</v-flex>
|
||||
<v-flex xs12 md6 sm6>
|
||||
<div class="WM-d-flex">
|
||||
<v-icon class="WMi-Industry"></v-icon>
|
||||
<span class="headline ml-2" style="letter-spacing:0 !important">{{ data.date }}</span>
|
||||
</div>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout 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="barcodeimg">
|
||||
<img :src="barcodeimg"><br />
|
||||
<span>{{data.unique_id}}</span>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout row wrap class="ml-4">
|
||||
<v-flex xs12 md6 sm6 v-if="QRCodeimg">
|
||||
<img :src="QRCodeimg">
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-layout>
|
||||
|
||||
</v-layout>
|
||||
<v-layout align-left justify-left wrap class="px-5 my-3">
|
||||
<h3 class="ml-3">Labels</h3>
|
||||
<v-flex xs12>
|
||||
<hr class="v-divider theme--light">
|
||||
</v-flex>
|
||||
<v-layout row wrap style="margin-left: 20px !important;">
|
||||
|
||||
<template>
|
||||
<v-expansion-panel class="WM-Panel" v-for="(label, key) in data.labels" :key="key">
|
||||
<v-expansion-panel-content>
|
||||
<template v-slot:header>
|
||||
<div>{{ label.id }} ({{ label.pivot.count }})</div>
|
||||
</template>
|
||||
<v-card>
|
||||
<v-card-text> Package :
|
||||
<v-expansion-panel class="WM-Panel">
|
||||
<v-expansion-panel-content>
|
||||
<template v-slot:header>
|
||||
<div>{{ label.package.name }} </div>
|
||||
</template>
|
||||
<v-card>
|
||||
<v-card-text>note : {{ label.package.note }}</v-card-text>
|
||||
<v-card-text>
|
||||
Items :
|
||||
<v-expansion-panel class="WM-Panel" v-for="item in label.package.items" :key="item.key">
|
||||
<v-expansion-panel-content>
|
||||
<template v-slot:header>
|
||||
<div>{{ item.name }} ({{ item.pivot.count }})</div>
|
||||
</template>
|
||||
<v-card>
|
||||
<v-card-text>note : {{ item.note }}</v-card-text>
|
||||
</v-card>
|
||||
</v-expansion-panel-content>
|
||||
</v-expansion-panel>
|
||||
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</v-expansion-panel-content>
|
||||
</v-expansion-panel>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</v-expansion-panel-content>
|
||||
</v-expansion-panel>
|
||||
</template>
|
||||
|
||||
</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>
|
||||
|
||||
<script>
|
||||
import axios from "axios";
|
||||
import { urls } from "@show/config/urls";
|
||||
export default {
|
||||
data: () => ({
|
||||
data : {},
|
||||
barcodeimg : '',
|
||||
QRCodeimg : ''
|
||||
}),
|
||||
methods: {
|
||||
async load(id) {
|
||||
const result = await axios.get(urls.showCycle(id));
|
||||
if (result.status == 200) {
|
||||
this.data = result.data.data;
|
||||
this.generateBarcode(this.data.unique_id);
|
||||
}
|
||||
},
|
||||
|
||||
async generateBarcode(packageId) {
|
||||
const result = await axios.post(urls.Barcode(packageId));
|
||||
if (result && result.status == 200) {
|
||||
this.QRCodeimg = result.data.data.QRCode ? result.data.data.QRCode : null;
|
||||
this.barcodeimg = result.data.data.Barcode ? result.data.data.Barcode : null;
|
||||
}
|
||||
},
|
||||
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() {
|
||||
if (this.$route.params.cycle) {
|
||||
this.load(this.$route.params.cycle);
|
||||
}
|
||||
|
||||
},
|
||||
};
|
||||
</script>
|
||||
Reference in New Issue
Block a user