update label show

This commit is contained in:
Fayyazi
2019-11-09 14:13:52 +03:30
parent 2306aca310
commit ac9eae8b5c
27 changed files with 867 additions and 141 deletions
+10 -2
View File
@@ -63,14 +63,22 @@
<v-flex xs12 sm6 md4 class="WM-FlexCenter WM-DuplicateInput" style="position: relative" v-for="(label, key) in formData.labels" :key="key">
<div class="Inner">
<v-icon class="fa fa-check mr-2 WM-Margin-B-8"></v-icon>
<v-autocomplete
<!-- <v-autocomplete
color="black"
:items="labels"
item-text="name"
item-value="id"
v-model="label.id"
label="Select Label For Cycle"
></v-autocomplete>
></v-autocomplete> -->
<v-text-field
name="labels"
label="Label ID"
color="black"
v-model="label.id"
class="py-3 pr-3"
></v-text-field>
<v-btn
absolute
small
+2 -32
View File
@@ -3,17 +3,7 @@
<v-container grid-list-xs fluid>
<material-card color="black" title="Add Label on Set ">
<v-layout wrap class="px-5 my-3">
<v-flex xs12 md3 sm3 class="WM-FlexCenter">
<v-icon class="fa fa-align-left mr-2 WM-Margin-B-8"></v-icon>
<v-text-field
name="name"
label="Name"
color="black"
v-model="formData.name"
:rules="[rules.required, rules.counter]"
class="py-3 pr-3"
></v-text-field>
</v-flex>
<v-flex xs12 md3 sm3 class="WM-FlexCenter pl-3">
<v-icon class="fas fa-sort-numeric-up mr-2 WM-Margin-B-8"></v-icon>
<v-text-field
@@ -57,16 +47,6 @@
class="py-3 pr-3"
></v-autocomplete>
</v-flex>
<v-flex xs12 sm6 md3 class="WM-FlexCenter pl-3">
<v-icon class="fa fa-building mr-2 WM-Margin-B-8"></v-icon>
<v-text-field
name="department"
label="Department"
color="black"
v-model="formData.department"
class="py-3 pr-3"
></v-text-field>
</v-flex>
<v-flex xs12 sm6 md2 class="WM-FlexCenter pl-3">
<v-icon class="far fa-calendar-alt mr-2"></v-icon>
<v-menu
@@ -118,15 +98,7 @@
</v-menu>
</v-flex>
</v-layout>
<v-layout align-center justify-center wrap class="px-5 mb-3">
<v-flex xs12 sm12 md12>
<v-textarea color="black" v-model="formData.note" class="pa-2" name="address">
<template v-slot:label>
<div>Description</div>
</template>
</v-textarea>
</v-flex>
</v-layout>
<v-layout row wrap justify-center align-center>
<v-flex xs12 md2 sm2 class="text-md-center text-xs-center">
<v-btn class="WM-CyanBlueGradient-BG" style="padding:10px 60px" @click="submitForm()">
@@ -158,9 +130,7 @@ export default {
fromMenuSterile: false ,
fromMenuExpire: false,
formData: {
name: "",
result: "",
note: "",
package_id: ""
},
items: [],
+6 -14
View File
@@ -3,10 +3,6 @@
<v-container fluid>
<material-card class color="black" title="All Labels" text>
<v-layout align-center wrap class="my-3">
<v-flex xs12 md3 sm3 class="WM-FlexCenter pl-3">
<v-icon class="fa fa-align-left mr-2 WM-Margin-B-8"></v-icon>
<v-text-field class="py-3 pr-3" v-model="filter.name" label="Name" color="black"></v-text-field>
</v-flex>
<v-flex xs12 md3 sm3 class="WM-FlexCenter pl-3">
<v-icon class="fa fa-hospital-o mr-2 WM-Margin-B-8"></v-icon>
<v-autocomplete
@@ -36,10 +32,6 @@
<v-icon class="fas fa-sort-numeric-up mr-2 WM-Margin-B-8"></v-icon>
<v-text-field class="py-3" v-model="filter.cycle_number" label="Cycle Number" color="black"></v-text-field>
</v-flex>
<v-flex xs12 md3 sm3 class="WM-FlexCenter pl-3">
<v-icon class="fa fa-building mr-2 WM-Margin-B-8"></v-icon>
<v-text-field class="py-3 pr-3" v-model="filter.department" label="Department" color="black"></v-text-field>
</v-flex>
<v-flex class xs12 md2 sm3>
<v-btn class="WM-CyanBlueGradient-BG" style="padding:10px 60px" @click="load()">
<v-icon class="white--text mr-2 caption">fas fa-search</v-icon>
@@ -64,13 +56,13 @@
<span class="subheading font-weight-light text-white text--darken-3" v-text="header.text" />
</template>
<template slot="items" slot-scope="{ item }">
<td class="title font-weight-light">{{ item.name }}</td>
<td class="title font-weight-light">{{ item.id }}</td>
<td
class="title font-weight-light"
>{{ (item.user && item.user.medical_center) ? item.user.medical_center.name : '' }}</td>
<td class="title font-weight-light">{{ item.user ? item.user.name : '' }}</td>
<td class="title font-weight-light">{{ item.cycle_number }}</td>
<td class="title font-weight-light">{{ item.department }}</td>
<td class="title font-weight-light">{{ item.sterilizer_id }}</td>
<td class="text-xs-right">
<v-btn color="cyan" class="mr-2" @click="show(item.id)">
<v-icon class="white--text mr-1 caption">fas fa-eye</v-icon>
@@ -129,8 +121,8 @@ export default {
headers: [
{
sortable: true,
text: "Name",
value: "Name"
text: "LabelID",
value: "LabelID"
},
{
sortable: true,
@@ -149,8 +141,8 @@ export default {
},
{
sortable: false,
text: "Department",
value: "Department"
text: "SterilizerID",
value: "SterilizerID"
},
{
sortable: false,
+6
View File
@@ -50,6 +50,7 @@
<template slot="items" slot-scope="{ item }">
<td class="title font-weight-light">{{ item.unique_id }}</td>
<td class="title font-weight-light">{{ item.name }}</td>
<td class="title font-weight-light">{{ item.user.name }}</td>
<td class="title font-weight-light">{{ item.description }}</td>
<td class="text-xs-right">
<v-btn color="cyan" class="mr-2" @click="show(item.id)">
@@ -117,6 +118,11 @@ export default {
text: "Name",
value: "name"
},
{
sortable: true,
text: "User",
value: "User"
},
{
sortable: true,
text: "Description",
@@ -0,0 +1,176 @@
<template>
<v-container grid-list-xs>
<material-card color="black" title="Show Package">
<v-layout id="printMe" 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>
<v-flex xs12 md6 sm6 v-if="QRCodeimg">
<img :src="QRCodeimg">
</v-flex>
</div>
</v-flex> -->
<v-flex xs12 md6 sm6>
<div class>
<span class="title">Name :</span>
<span class="headline ml-1" style="letter-spacing:0 !important">{{ data.name }}</span>
</div>
</v-flex>
<v-flex xs12 md6 sm6>
<div class>
<span class="title">Description :</span>
<span class="headline ml-1" style="letter-spacing:0 !important">{{ data.note }}</span>
</div>
</v-flex>
<v-flex xs12 md6 sm6>
<div class>
<span class="title">Register User :</span>
<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>
<span class="title">Date :</span>
<span class="headline ml-2" style="letter-spacing:0 !important">{{ data.created_at }}</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">Items</h3>
<v-flex xs12>
<hr class="v-divider theme--light">
</v-flex>
<v-layout row wrap class="ml-4">
<template>
<v-expansion-panel class="WM-Panel">
<v-expansion-panel-content
v-for="(item, key) in data.items" :key="key"
>
<template v-slot:header>
<div>{{ key+1 + ": " + 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>
</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 { 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 load(id) {
const result = await ApiService.get(urls.showPackage(id));
if (result.status == 200) {
this.data = result.data.data;
this.generateBarcode(this.data.unique_id);
}
},
async verify(id) {
const result = await ApiService.post(urls.verifyPackage(id));
if (result && result.status == 200) {
this.setResultModal(result.data.data);
this.closeModal();
}
},
async generateBarcode(packageId) {
const result = await ApiService.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.package) {
this.load(this.$route.params.package);
}
},
computed: {
...mapGetters("modal", ["getModalProperties"])
}
};
</script>