mirror of
https://git.meshkee.com/cssd/cssd-back.git
synced 2026-10-13 15:11:06 +03:30
save
This commit is contained in:
@@ -1,213 +1,217 @@
|
||||
|
||||
<template>
|
||||
<v-container grid-list-xs>
|
||||
<material-card color="black" title="Show Label">
|
||||
<v-layout align-left justify-left wrap class="px-2 my-3">
|
||||
<h3 class="ml-3">Label</h3>
|
||||
<v-flex xs12>
|
||||
<hr class="v-divider theme--light">
|
||||
</v-flex>
|
||||
<v-layout id="printMe">
|
||||
<v-flex xs10 md12 sm12>
|
||||
<v-layout row wrap class="ml-4">
|
||||
<v-flex xs12 md12 sm12>
|
||||
<div class="WM-d-flex">
|
||||
<p class="headline ml-5" style="letter-spacing:0 !important">{{ (data.user && data.user.medical_center) ? data.user.medical_center.name : "" }}</p>
|
||||
</div>
|
||||
</v-flex>
|
||||
<v-flex xs6 md6 sm6 class="mt-4">
|
||||
<div class="WM-d-flex">
|
||||
<v-icon class="WMi-location"></v-icon>
|
||||
<span class="headline ml-1" style="letter-spacing:0 !important">{{data.package.name}}</span>
|
||||
</div>
|
||||
</v-flex>
|
||||
<v-flex xs6 md5 sm5>
|
||||
<div>
|
||||
<v-flex xs6 md6 sm6 v-if="QRCodeimg">
|
||||
<a :href="'/Show/Package/'+data.package.id+''" target="_blank"><img :src="QRCodeimg"></a>
|
||||
</v-flex>
|
||||
</div>
|
||||
</v-flex>
|
||||
<v-flex xs6 md5 sm5>
|
||||
<div class="WM-d-flex">
|
||||
<v-icon class="WMi-Industry"></v-icon>
|
||||
<span class="headline ml-2" style="letter-spacing:0 !important">{{ data.sterile_date }}</span>
|
||||
</div>
|
||||
</v-flex>
|
||||
<v-flex xs6 md7 sm7>
|
||||
<!-- <div class="WM-d-flex">
|
||||
<span class="title">Lot No :</span>
|
||||
<span class="headline ml-2" style="letter-spacing:0 !important">{{ data.lot_number }}</span>
|
||||
</div> -->
|
||||
</v-flex>
|
||||
<v-flex xs6 md5 sm5>
|
||||
<div class="WM-d-flex">
|
||||
<v-icon class="WMi-hourglass"></v-icon>
|
||||
<span class="headline ml-2" style="letter-spacing:0 !important">{{ data.expire_date }}</span>
|
||||
</div>
|
||||
</v-flex>
|
||||
<v-flex xs6 md7 sm7>
|
||||
<div class>
|
||||
<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 xs6 md5 sm5>
|
||||
<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 xs6 md7 sm7>
|
||||
<div class>
|
||||
<span class="title">Cycle No :</span>
|
||||
<span class="headline ml-2" style="letter-spacing:0 !important">{{ data.cycle_number }}</span>
|
||||
</div>
|
||||
</v-flex>
|
||||
<!-- text-align:center;margin-top:50px ml-4 -->
|
||||
<!-- <v-flex xs3 md3 sm3>
|
||||
</v-flex> -->
|
||||
<v-flex xs9 md9 sm9>
|
||||
<div class="mt-4" style="text-align:center">
|
||||
<v-layout row wrap class="" >
|
||||
<v-flex xs6 md12 sm12 v-if="barcodeimg">
|
||||
<img :src="barcodeimg" style="width:30%"><br />
|
||||
<span>{{data.id}}</span>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</div>
|
||||
</v-flex>
|
||||
|
||||
</v-layout>
|
||||
<v-container grid-list-xs>
|
||||
<material-card color="black" title="Show Label">
|
||||
<v-layout align-left justify-left wrap class="px-2 my-3">
|
||||
<h3 class="ml-3">Label</h3>
|
||||
<v-flex xs12>
|
||||
<hr class="v-divider theme--light">
|
||||
</v-flex>
|
||||
<v-layout id="printMe">
|
||||
<v-flex xs12 md12 sm12>
|
||||
<!-- ________ row1::Begin ________ -->
|
||||
<v-layout row wrap>
|
||||
<!-- ________ Column1::Begin ________ -->
|
||||
<v-flex xs6 md6 sm6>
|
||||
<v-layout row wrap class="ml-4">
|
||||
<v-flex xs12 md12 sm12>
|
||||
<div class="WM-d-flex">
|
||||
<span class="headline ml-1 mb-1" style="letter-spacing:0 !important">{{ (data.user && data.user.medical_center) ? data.user.medical_center.name : "" }}</span>
|
||||
</div>
|
||||
</v-flex>
|
||||
<v-flex xs12 md12 sm12 class="">
|
||||
<div class="WM-d-flex">
|
||||
<v-icon class="WMi-location"></v-icon>
|
||||
<span class="headline ml-1 mb-1" style="letter-spacing:0 !important">{{data.package.name}}</span>
|
||||
</div>
|
||||
</v-flex>
|
||||
<v-flex xs12 md12 sm12>
|
||||
<div class="WM-d-flex">
|
||||
<v-icon class="WMi-Industry"></v-icon>
|
||||
<span class="headline ml-2 mb-1" style="letter-spacing:0 !important">{{ data.sterile_date }}</span>
|
||||
</div>
|
||||
</v-flex>
|
||||
<v-flex xs12 md12 sm12>
|
||||
<div class="WM-d-flex">
|
||||
<v-icon class="WMi-hourglass"></v-icon>
|
||||
<span class="headline ml-2 mb-1" style="letter-spacing:0 !important">{{ data.expire_date }}</span>
|
||||
</div>
|
||||
</v-flex>
|
||||
<v-flex xs12 md12 sm12>
|
||||
<div class="WM-d-flex">
|
||||
<v-icon class="WMi-user"></v-icon>
|
||||
<span class="headline ml-2 mb-1" style="letter-spacing:0 !important">{{ (typeof data.user != 'undefined') ? data.user.name : '' }}</span>
|
||||
</div>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-layout>
|
||||
<v-layout align-left justify-left wrap class="px-2 my-3">
|
||||
<h3 class="ml-3">Package</h3>
|
||||
<v-flex xs12>
|
||||
<hr class="v-divider theme--light">
|
||||
</v-flex>
|
||||
<v-layout row wrap class="mx-3">
|
||||
<template>
|
||||
<v-expansion-panel class="WM-Panel">
|
||||
<v-expansion-panel-content>
|
||||
<template v-slot:header>
|
||||
<div>{{ data.package.name }}</div>
|
||||
</template>
|
||||
<v-card>
|
||||
<v-card-text>note : {{ data.package.note }}</v-card-text>
|
||||
<v-card-text> Items :
|
||||
<v-expansion-panel class="WM-Panel" v-for="item in data.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>
|
||||
</template>
|
||||
|
||||
</v-flex>
|
||||
<!-- ________ Column1::End ________ -->
|
||||
<!-- ________ Column2::Begin ________ -->
|
||||
<v-flex xs6 md6 sm6>
|
||||
<v-layout row wrap class="">
|
||||
<v-flex xs12 md12 sm12>
|
||||
<div>
|
||||
<v-flex xs6 md6 sm6 v-if="QRCodeimg">
|
||||
<a :href="'/Show/Package/'+data.package.id+''" target="_blank"><img :src="QRCodeimg"></a>
|
||||
</v-flex>
|
||||
</div>
|
||||
</v-flex>
|
||||
<v-flex xs12 md12 sm12>
|
||||
<div class>
|
||||
<span class="title">Sterilizer ID :</span>
|
||||
<span class="headline ml-1 mb-1" style="letter-spacing:0 !important">{{ data.sterilizer_id}}</span>
|
||||
</div>
|
||||
</v-flex>
|
||||
<v-flex xs12 md12 sm12>
|
||||
<div class>
|
||||
<span class="title">Cycle No :</span>
|
||||
<span class="headline ml-2 mb-1" style="letter-spacing:0 !important">{{ data.cycle_number }}</span>
|
||||
</div>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
<!-- ________ Column2::End ________ -->
|
||||
</v-layout>
|
||||
<!-- ________ row1::Begin ________ -->
|
||||
|
||||
<v-layout row wrap align-center justify-center style="margin-left: -15%;">
|
||||
<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>
|
||||
|
||||
<!-- ________ row2::Begin ________ -->
|
||||
<v-layout row wrap>
|
||||
<v-flex xs12 md12 sm12>
|
||||
<div class="mt-4" style="text-align:center">
|
||||
<v-layout row wrap>
|
||||
<v-flex xs6 md12 sm12 v-if="barcodeimg">
|
||||
<img :src="barcodeimg" style="width:20%"><br />
|
||||
<span>{{data.id}}</span>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</div>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
</material-card>
|
||||
</v-container>
|
||||
<!-- ________ row2::End ________ -->
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-layout>
|
||||
<v-layout align-left justify-left wrap class="px-2 my-3">
|
||||
<h3 class="ml-3">Package</h3>
|
||||
<v-flex xs12>
|
||||
<hr class="v-divider theme--light">
|
||||
</v-flex>
|
||||
<v-layout row wrap class="mx-3">
|
||||
<template>
|
||||
<v-expansion-panel class="WM-Panel">
|
||||
<v-expansion-panel-content>
|
||||
<template v-slot:header>
|
||||
<div>{{ data.package.name }}</div>
|
||||
</template>
|
||||
<v-card>
|
||||
<v-card-text>note : {{ data.package.note }}</v-card-text>
|
||||
<v-card-text> Items :
|
||||
<v-expansion-panel class="WM-Panel" v-for="item in data.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>
|
||||
</template>
|
||||
</v-layout>
|
||||
</v-layout>
|
||||
<v-layout row wrap align-center justify-center style="margin-left: -15%;">
|
||||
<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>
|
||||
<style media="screen">
|
||||
.WM-d-flex{
|
||||
display: flex;
|
||||
}
|
||||
.WM-d-flex{
|
||||
display: flex;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
import { mapGetters, mapMutations } from "vuex";
|
||||
import { ApiService } from "@/services";
|
||||
import { urls } from "@/config/urls";
|
||||
export default {
|
||||
data: () => ({
|
||||
data : {},
|
||||
QRCodeimg : '',
|
||||
barcodeimg : ''
|
||||
data: () => ({
|
||||
data : {},
|
||||
QRCodeimg : '',
|
||||
barcodeimg : ''
|
||||
|
||||
}),
|
||||
methods: {
|
||||
...mapMutations("modal", ["closeModal", "setResultModal"]),
|
||||
// async verify(id) {
|
||||
// const result = await ApiService.post(urls.verifyPackage(id));
|
||||
// if (result && result.status == 200) {
|
||||
// this.setResultModal(result.data.data);
|
||||
// this.closeModal();
|
||||
// }
|
||||
// },
|
||||
async generateQRcodePackage(packageId) {
|
||||
const result = await ApiService.post(urls.packageQRCode(packageId));
|
||||
if (result && result.status == 200) {
|
||||
this.QRCodeimg = result.data.data.QRCode ? result.data.data.QRCode : null;
|
||||
}
|
||||
},
|
||||
async generateBarcode(labelId) {
|
||||
const result = await ApiService.post(urls.Barcode(labelId, 'Label'));
|
||||
if (result && result.status == 200) {
|
||||
this.barcodeimg = result.data.data.Barcode ? result.data.data.Barcode : null;
|
||||
}
|
||||
},
|
||||
print() {
|
||||
const prtHtml = document.getElementById("printMe").innerHTML;
|
||||
}),
|
||||
methods: {
|
||||
...mapMutations("modal", ["closeModal", "setResultModal"]),
|
||||
// async verify(id) {
|
||||
// const result = await ApiService.post(urls.verifyPackage(id));
|
||||
// if (result && result.status == 200) {
|
||||
// this.setResultModal(result.data.data);
|
||||
// this.closeModal();
|
||||
// }
|
||||
// },
|
||||
async generateQRcodePackage(packageId) {
|
||||
const result = await ApiService.post(urls.packageQRCode(packageId));
|
||||
if (result && result.status == 200) {
|
||||
this.QRCodeimg = result.data.data.QRCode ? result.data.data.QRCode : null;
|
||||
}
|
||||
},
|
||||
async generateBarcode(labelId) {
|
||||
const result = await ApiService.post(urls.Barcode(labelId, 'Label'));
|
||||
if (result && result.status == 200) {
|
||||
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;
|
||||
}
|
||||
// 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"
|
||||
);
|
||||
// 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.write(`<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
${stylesHtml}
|
||||
</head>
|
||||
<body>
|
||||
${prtHtml}
|
||||
</body>
|
||||
</html>`);
|
||||
|
||||
WinPrint.document.close();
|
||||
WinPrint.focus();
|
||||
WinPrint.print();
|
||||
WinPrint.close();
|
||||
}
|
||||
WinPrint.document.close();
|
||||
WinPrint.focus();
|
||||
WinPrint.print();
|
||||
WinPrint.close();
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.data = this.getModalProperties.result.data.data;
|
||||
this.generateQRcodePackage(this.data.package.id);
|
||||
this.generateBarcode(this.data.id);
|
||||
this.data = this.getModalProperties.result.data.data;
|
||||
this.generateQRcodePackage(this.data.package.id);
|
||||
this.generateBarcode(this.data.id);
|
||||
},
|
||||
computed: {
|
||||
...mapGetters("modal", ["getModalProperties"])
|
||||
...mapGetters("modal", ["getModalProperties"])
|
||||
}
|
||||
};
|
||||
</script>
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user