mirror of
https://git.meshkee.com/cssd/cssd-back.git
synced 2026-10-10 19:31:07 +03:30
223 lines
8.9 KiB
Vue
223 lines
8.9 KiB
Vue
|
|
<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">Cycle - {{ (data.user && data.user.medical_center) ? data.user.medical_center.name : "" }}</h3>
|
|
<v-flex xs12>
|
|
<hr class="v-divider theme--light">
|
|
</v-flex>
|
|
<v-layout row wrap class="ml-4">
|
|
<v-flex xs12 md3 sm3>
|
|
<!-- class="WM-d-flex" -->
|
|
<div>
|
|
<span class="title">Cycle ID :</span>
|
|
<span class="headline ml-1" style="letter-spacing:0 !important">{{ data.id }}</span>
|
|
</div>
|
|
</v-flex>
|
|
<v-flex xs12 md3 sm3>
|
|
<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 md3 sm3>
|
|
<div class="WM-d-flex">
|
|
<v-icon class="WMi-user"></v-icon>
|
|
<span class="headline ml-2" style="letter-spacing:0 !important">{{ data.user ? data.user.name : '' }}</span>
|
|
</div>
|
|
</v-flex>
|
|
<v-flex xs12 md3 sm3>
|
|
<div>
|
|
<span class="title">Cycle Number :</span>
|
|
<span class="headline ml-2" style="letter-spacing:0 !important">{{ data.cycle_number }}</span>
|
|
</div>
|
|
</v-flex>
|
|
<v-flex xs12 md3 sm3>
|
|
<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-flex xs12 md3 sm3>
|
|
<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-layout>
|
|
<v-layout align-left justify-left wrap class="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" class="WM-Width-350"><br />
|
|
<span>Cycle ID : {{data.id}}</span>
|
|
</v-flex>
|
|
</v-layout>
|
|
<v-layout row wrap class="ml-4">
|
|
<v-flex xs12 md6 sm6 v-if="QRCodeimg">
|
|
<a :href="'/Show/Cycle/'+data.id+''" target="_blank"><img :src="QRCodeimg" class="WM-Width-150"></a>
|
|
</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>
|
|
export default {
|
|
data: () => ({
|
|
data: {}
|
|
})
|
|
};
|
|
</script>
|
|
<script>
|
|
import { mapGetters, mapMutations } from "vuex";
|
|
import { ApiService } from "@/services";
|
|
import { urls } from "@/config/urls";
|
|
export default {
|
|
data: () => ({
|
|
data : {},
|
|
barcodeimg : '',
|
|
QRCodeimg : ''
|
|
}),
|
|
methods: {
|
|
...mapMutations("modal", ["closeModal", "setResultModal"]),
|
|
async generateBarcode(cycleId) {
|
|
const result = await ApiService.post(urls.Barcode(cycleId, 'Cycle'));
|
|
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() {
|
|
this.data = this.getModalProperties.result.data.data;
|
|
this.generateBarcode(this.data.id);
|
|
},
|
|
computed: {
|
|
...mapGetters("modal", ["getModalProperties"])
|
|
}
|
|
};
|
|
</script>
|
|
<style media="screen">
|
|
.v-expansion-panel.WM-Panel {
|
|
box-shadow: none;
|
|
border-top: 1px solid #aaa;
|
|
border-right: 1px solid #aaa;
|
|
border-bottom: 1px solid #aaa;
|
|
border-left: 4px solid #e91e63;
|
|
padding: 5px 10px;
|
|
margin: 10px 0;
|
|
}
|
|
.v-expansion-panel.WM-Panel .v-expansion-panel__header {
|
|
font-weight:300;
|
|
font-size: 24px;
|
|
padding: 5px 10px;
|
|
margin: 7px 0;
|
|
}
|
|
.v-expansion-panel.WM-Panel .v-card__text {
|
|
padding: 0 0 0 30px;
|
|
font-weight: 600;
|
|
font-size: 18px;
|
|
}
|
|
.v-expansion-panel.WM-Panel .v-expansion-panel__body>.v-card {
|
|
margin: 5px 0 8px 0 !important;
|
|
}
|
|
</style>
|