mirror of
https://git.meshkee.com/cssd/cssd-back.git
synced 2026-10-13 17:11:05 +03:30
Show And Barcode
This commit is contained in:
@@ -1,203 +1,169 @@
|
||||
<!-- <template>
|
||||
<div>
|
||||
<v-container fluid>
|
||||
<material-card class color="black" title="Show Test Resualt" text>
|
||||
<v-layout align-center wrap class="my-3">
|
||||
|
||||
<v-layout row wrap class="">
|
||||
<h2>Common Info</h2>
|
||||
</v-layout>
|
||||
<v-divider></v-divider>
|
||||
<v-layout row wrap class="ml-3">
|
||||
<v-flex xs12 md12 sm12>
|
||||
<div>Auto Clave Id : {{ data.autoclave_id }}</div>
|
||||
<template>
|
||||
<v-container grid-list-xs>
|
||||
<material-card color="black" title="Submit Test Result">
|
||||
<v-layout align-left justify-left wrap class="px-5 my-3">
|
||||
<h3 class="ml-3">Common 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>
|
||||
<span class="title">Auto Clave Id :</span>
|
||||
<span class="headline ml-2">{{ data.autoclave_id }}</span>
|
||||
</div>
|
||||
</v-flex>
|
||||
<v-flex xs12 md12 sm12>
|
||||
<div>Result : {{ data.result }}</div>
|
||||
<v-flex xs12 md6 sm6>
|
||||
<div class>
|
||||
<span class="title">Result :</span>
|
||||
<v-icon class="green--text ml-2 caption">fas fa-check</v-icon>
|
||||
<span class="headline ml-1">{{ data.result }}</span>
|
||||
</div>
|
||||
</v-flex>
|
||||
<v-flex xs12 md12 sm12>
|
||||
<div>verify : {{ data.verified }}</div>
|
||||
<v-flex xs12 md6 sm6>
|
||||
<div class>
|
||||
<span class="title">verify :</span>
|
||||
<v-icon class="pink--text ml-2 caption">fas fa-times</v-icon>
|
||||
<span class="headline ml-1">{{ data.verified }}</span>
|
||||
</div>
|
||||
</v-flex>
|
||||
<v-flex xs12 md12 sm12>
|
||||
<div>Register User : {{ data.user.name }}</div>
|
||||
<v-flex xs12 md6 sm6>
|
||||
<div class>
|
||||
<span class="title">Register User :</span>
|
||||
<span class="headline ml-2">{{ data.user.name }}</span>
|
||||
</div>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
</v-layout>
|
||||
</v-layout>
|
||||
<v-layout align-left justify-left wrap class="px-5 my-3">
|
||||
<h3 class="ml-3">Special Info</h3>
|
||||
<v-flex xs12>
|
||||
<hr class="v-divider theme--light">
|
||||
</v-flex>
|
||||
<v-layout row wrap>
|
||||
<template v-if="data.inputs">
|
||||
<v-flex xs12 md12 sm12 v-for="(inputData, keyInputs) in data.inputs" :key="keyInputs">
|
||||
<div>{{keyInputs}} : {{inputData}}</div>
|
||||
<v-flex
|
||||
xs12
|
||||
md12
|
||||
sm12
|
||||
v-for="(inputData, keyInputs) in data.inputs"
|
||||
:key="keyInputs"
|
||||
>
|
||||
<span class="title">{{keyInputs}} :</span>
|
||||
<span class="headline ml-2">{{inputData}}</span>
|
||||
</v-flex>
|
||||
</template>
|
||||
<template v-if="data.options">
|
||||
<v-flex xs12 md12 sm12 v-for="(optionData, keyOptions) in data.options" :key="keyOptions">
|
||||
<div>{{keyOptions}} : <span v-for="(data, dataKey) in optionData" :key="dataKey">{{data}}, </span></div>
|
||||
<v-flex
|
||||
xs12
|
||||
md12
|
||||
sm12
|
||||
v-for="(optionData, keyOptions) in data.options"
|
||||
:key="keyOptions"
|
||||
>
|
||||
<span class="title">{{keyOptions}} :</span>
|
||||
<span
|
||||
class="headline ml-2"
|
||||
v-for="(data, dataKey) in optionData"
|
||||
:key="dataKey"
|
||||
>{{data}},</span>
|
||||
</v-flex>
|
||||
</template>
|
||||
<template v-if="data.children">
|
||||
<v-flex xs12 md12 sm12 v-for="(formData, keyForm) in data.children" :key="keyForm">
|
||||
<h1>{{keyForm}}</h1>
|
||||
<v-flex
|
||||
xs12
|
||||
md12
|
||||
sm12
|
||||
v-for="(formData, keyForm) in data.children"
|
||||
:key="keyForm"
|
||||
>
|
||||
<h3 class="ml-3">{{keyForm}}</h3>
|
||||
<div v-for="(childData, keyChild) in formData" :key="keyChild">
|
||||
<div>{{keyChild}} :
|
||||
<template v-if="Array.isArray(childData)"><span v-for="(data, dataKey) in childData" :key="dataKey">{{data}}, </span> </template>
|
||||
<template v-else > <span>{{childData}}</span> </template>
|
||||
<div class="ml-4">
|
||||
<span class="title">{{keyChild}} :</span>
|
||||
<template v-if="Array.isArray(childData)">
|
||||
<span
|
||||
class="headline ml-2"
|
||||
v-for="(data, dataKey) in childData"
|
||||
:key="dataKey"
|
||||
>{{data}},</span>
|
||||
</template>
|
||||
<template v-else>
|
||||
<span class="headline ml-2">{{childData}}</span>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</v-flex>
|
||||
</template>
|
||||
</v-layout>
|
||||
<v-divider></v-divider>
|
||||
<v-layout align-center wrap class="my-3">
|
||||
<v-flex md12>
|
||||
</v-layout>
|
||||
<v-layout align-left justify-left wrap class="px-5 my-3">
|
||||
<h3 class="ml-3">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>
|
||||
<img :src="'/'+data.imagePath" style="width: 100%">
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout row wrap>
|
||||
<v-flex xs12 md2 sm2 class="text-xs-center text-sm-center text-md-center">
|
||||
<v-btn
|
||||
class="WM-NoShadow WM-Outline-Btn WM-Border WM-Border-Black"
|
||||
style="padding:10px 60px;"
|
||||
>
|
||||
<v-icon class="black--text mr-2 caption">fas fa-chevron-right</v-icon>
|
||||
<span class="black--text">Verify</span>
|
||||
</v-layout>
|
||||
<v-layout row wrap align-center justify-center>
|
||||
<v-flex
|
||||
class
|
||||
xs12
|
||||
md2
|
||||
sm2
|
||||
v-if="data.verified == 'NotVerified'"
|
||||
@click="verify(data.id)"
|
||||
>
|
||||
<v-btn class="WM-CyanBlueGradient-BG" style="padding:10px 60px">
|
||||
<v-icon class="white--text mr-2 caption">fas fa-check</v-icon>
|
||||
<span class="white--text">Verify</span>
|
||||
</v-btn>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</material-card>
|
||||
</v-flex>
|
||||
<v-flex class xs12 md2 sm2 v-else>
|
||||
<v-btn
|
||||
class="WM-NoShadow WM-Outline-Btn WM-Border WM-Border-Gray"
|
||||
@click="verify(data.id)"
|
||||
>
|
||||
<v-icon class="black--text mr-2 caption">fas fa-check</v-icon>
|
||||
<span class="black--text">UnVerify</span>
|
||||
</v-btn>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</material-card>
|
||||
</v-container>
|
||||
</div>
|
||||
</template> -->
|
||||
<template>
|
||||
<v-container grid-list-xs>
|
||||
<material-card color="black" title="Submit Test Result">
|
||||
<v-layout
|
||||
align-left
|
||||
justify-left
|
||||
wrap
|
||||
class="px-5 my-3"
|
||||
>
|
||||
<h3 class="ml-3">Common 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="">
|
||||
<span class="title">Auto Clave Id : </span>
|
||||
<span class="headline ml-2">{{ data.autoclave_id }}</span>
|
||||
</div>
|
||||
</v-flex>
|
||||
<v-flex xs12 md6 sm6>
|
||||
<div class="">
|
||||
<span class="title">Result : </span>
|
||||
<v-icon class="green--text ml-2 caption">fas fa-check</v-icon>
|
||||
<span class="headline ml-1">{{ data.result }}</span>
|
||||
</div>
|
||||
</v-flex>
|
||||
<v-flex xs12 md6 sm6>
|
||||
<div class="">
|
||||
<span class="title">verify : </span>
|
||||
<v-icon class="pink--text ml-2 caption">fas fa-times</v-icon>
|
||||
<span class="headline ml-1">{{ data.verified }}</span>
|
||||
</div>
|
||||
</v-flex>
|
||||
<v-flex xs12 md6 sm6>
|
||||
<div class="">
|
||||
<span class="title">Register User : </span>
|
||||
<span class="headline ml-2">{{ data.user.name }}</span>
|
||||
</div>
|
||||
</v-flex>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-layout>
|
||||
<v-layout
|
||||
align-left
|
||||
justify-left
|
||||
wrap
|
||||
class="px-5 my-3"
|
||||
>
|
||||
<h3 class="ml-3">Special Info</h3>
|
||||
<v-flex xs12>
|
||||
<hr class="v-divider theme--light">
|
||||
</v-flex>
|
||||
<v-layout row wrap>
|
||||
<template v-if="data.inputs">
|
||||
<v-flex xs12 md12 sm12 v-for="(inputData, keyInputs) in data.inputs" :key="keyInputs">
|
||||
<span class="title">{{keyInputs}} :</span>
|
||||
<span class="headline ml-2">{{inputData}}</span>
|
||||
</v-flex>
|
||||
</template>
|
||||
<template v-if="data.options">
|
||||
<v-flex xs12 md12 sm12 v-for="(optionData, keyOptions) in data.options" :key="keyOptions">
|
||||
<span class="title">{{keyOptions}} : </span>
|
||||
<span class="headline ml-2" v-for="(data, dataKey) in optionData" :key="dataKey">{{data}}, </span>
|
||||
</v-flex>
|
||||
</template>
|
||||
<template v-if="data.children">
|
||||
<v-flex xs12 md12 sm12 v-for="(formData, keyForm) in data.children" :key="keyForm">
|
||||
<h3 class="ml-3">{{keyForm}}</h3>
|
||||
<div v-for="(childData, keyChild) in formData" :key="keyChild">
|
||||
<div class="ml-4">
|
||||
<span class="title">{{keyChild}} :</span>
|
||||
<template v-if="Array.isArray(childData)"><span class="headline ml-2" v-for="(data, dataKey) in childData" :key="dataKey">{{data}}, </span></template>
|
||||
<template v-else > <span class="headline ml-2">{{childData}}</span> </template>
|
||||
</div>
|
||||
</div>
|
||||
</v-flex>
|
||||
</template>
|
||||
</v-layout>
|
||||
</v-layout>
|
||||
<v-layout row wrap align-center justify-center>
|
||||
<v-flex class xs12 md2 sm2>
|
||||
<v-btn class="WM-CyanBlueGradient-BG" style="padding:10px 60px">
|
||||
<v-icon class="white--text mr-2 caption">fas fa-check</v-icon>
|
||||
<span class="white--text">Verify</span>
|
||||
</v-btn>
|
||||
</v-flex>
|
||||
<!-- <v-flex class="" xs12 md2 sm2>
|
||||
<v-btn class="WM-NoShadow WM-Outline-Btn WM-Border WM-Border-Gray">
|
||||
<v-icon class="black--text mr-2 caption">fas fa-check</v-icon>
|
||||
<span class="black--text">Verify</span>
|
||||
</v-btn>
|
||||
</v-flex> -->
|
||||
</v-layout>
|
||||
</material-card>
|
||||
</v-container>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: "",
|
||||
data: () => ({
|
||||
|
||||
})
|
||||
}
|
||||
data: () => ({
|
||||
data: {}
|
||||
})
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
</style>
|
||||
<script>
|
||||
import { mapGetters, mapMutations } from "vuex";
|
||||
// import { ApiService } from "@/services";
|
||||
// import { urls } from "@/config/urls";
|
||||
import { ApiService } from "@/services";
|
||||
import { urls } from "@/config/urls";
|
||||
export default {
|
||||
data: () => ({
|
||||
|
||||
}),
|
||||
methods: {
|
||||
// ...mapMutations("modal", ["closeModal", "setResultModal"]),
|
||||
// async changeRole() {
|
||||
// const result = await ApiService.post(
|
||||
// urls.changeRoleUser(this.getModalProperties.user.id),
|
||||
// this.data
|
||||
// );
|
||||
// if (result && result.status == 200) {
|
||||
// this.setResultModal(result.data.data);
|
||||
// this.closeModal();
|
||||
// }
|
||||
// }
|
||||
},
|
||||
created(){
|
||||
this.data = this.getModalProperties.result.data.data;
|
||||
},
|
||||
computed: {
|
||||
...mapGetters("modal", ["getModalProperties"]),
|
||||
}
|
||||
data: () => ({}),
|
||||
methods: {
|
||||
...mapMutations("modal", ["closeModal", "setResultModal"]),
|
||||
async verify(id) {
|
||||
const result = await ApiService.post(urls.verifyTestResult(id));
|
||||
if (result && result.status == 200) {
|
||||
this.setResultModal(result.data.data);
|
||||
this.closeModal();
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.data = this.getModalProperties.result.data.data;
|
||||
},
|
||||
computed: {
|
||||
...mapGetters("modal", ["getModalProperties"])
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
<template>
|
||||
<v-container grid-list-xs>
|
||||
<material-card color="black" title="Barcode Image">
|
||||
<v-layout align-left justify-left wrap class="px-5 my-3">
|
||||
<h3 class="ml-3">Barcode 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>
|
||||
<img :src="image">
|
||||
</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>
|
||||
<script>
|
||||
import { mapGetters } from "vuex";
|
||||
export default {
|
||||
data: () => ({
|
||||
image : {}
|
||||
}),
|
||||
created() {
|
||||
this.image = this.getModalProperties.result.data.data;
|
||||
},
|
||||
computed: {
|
||||
...mapGetters("modal", ["getModalProperties"])
|
||||
},
|
||||
methods: {
|
||||
print() {
|
||||
let popup = window.open();
|
||||
popup.document.write(`<img src="${this.image}" >`);
|
||||
popup.focus();
|
||||
popup.print();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
Vendored
+6
@@ -14,6 +14,9 @@ const urls = {
|
||||
listTestType : function(page) {
|
||||
return "/TestTypes?page=" + page;
|
||||
},
|
||||
TestTypeBarcode : function(id) {
|
||||
return `/TestTypes/Barcode/${id}`;
|
||||
},
|
||||
deleteTestType : function(id) {
|
||||
return `/TestTypes/${id}`;
|
||||
},
|
||||
@@ -29,6 +32,9 @@ const urls = {
|
||||
}
|
||||
return "/TestResults?page=" + page;
|
||||
},
|
||||
verifyTestResult : function(id) {
|
||||
return `/TestResults/Verify/${id}`;
|
||||
},
|
||||
editTestResult : function(id) {
|
||||
return `/TestResults/${id}/edit`;
|
||||
},
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
<td class="title font-weight-light">{{ item.user.name }}</td>
|
||||
<td class="title font-weight-light">{{ item.result }}</td>
|
||||
<td class="title font-weight-light">{{ item.created_at }}</td>
|
||||
<td class="title font-weight-light">{{ item.verified }}</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>
|
||||
@@ -59,7 +60,11 @@
|
||||
<span>Edit</span>
|
||||
</v-btn>
|
||||
</router-link>
|
||||
<v-btn color="pink" class="WM-ActionButton" @click="remove(item.id)" >
|
||||
<v-btn
|
||||
color="pink"
|
||||
class="WM-ActionButton"
|
||||
@click="remove(item.id)"
|
||||
>
|
||||
<v-icon class="white--text mr-2 caption">fas fa-times</v-icon>
|
||||
<span>Remove</span>
|
||||
</v-btn>
|
||||
@@ -88,7 +93,7 @@
|
||||
<script>
|
||||
import { ApiService } from "@/services";
|
||||
import { urls } from "@/config/urls";
|
||||
import { mapMutations } from "vuex";
|
||||
import { mapMutations, mapGetters } from "vuex";
|
||||
export default {
|
||||
data: () => ({
|
||||
headers: [
|
||||
@@ -117,6 +122,11 @@ export default {
|
||||
text: "Date",
|
||||
value: "date"
|
||||
},
|
||||
{
|
||||
sortable: false,
|
||||
text: "Verify",
|
||||
value: "verify"
|
||||
},
|
||||
{
|
||||
sortable: false,
|
||||
text: "Action",
|
||||
@@ -129,17 +139,18 @@ export default {
|
||||
lastPage: 1
|
||||
}),
|
||||
created() {
|
||||
if(this.$route.name == 'NotVerifyTestResult') {
|
||||
this.load(1, 'NotVerified');
|
||||
if (this.$route.name == "NotVerifyTestResult") {
|
||||
this.load(1, "NotVerified");
|
||||
} else {
|
||||
this.load();
|
||||
}
|
||||
|
||||
},
|
||||
methods: {
|
||||
...mapMutations("modal", ["changeCurrentModal"]),
|
||||
async load(page = 1, verified = null) {
|
||||
const result = await ApiService.get(urls.listTestResult(page, verified));
|
||||
const result = await ApiService.get(
|
||||
urls.listTestResult(page, verified)
|
||||
);
|
||||
if (result && result.status == 200) {
|
||||
this.items = result.data.data.data;
|
||||
this.currentPage = result.data.data.current_page;
|
||||
@@ -173,9 +184,19 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters("modal", ["getModalResult"])
|
||||
},
|
||||
watch: {
|
||||
currentPage(page) {
|
||||
this.load(page);
|
||||
},
|
||||
getModalResult(testResult) {
|
||||
for (const key in this.items) {
|
||||
if (this.items.hasOwnProperty(key) && this.items[key].id == testResult.id) {
|
||||
this.items[key] = testResult;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
<span>Edit</span>
|
||||
</v-btn>
|
||||
</router-link>
|
||||
<v-btn color="orange darken-1">
|
||||
<v-btn color="orange darken-1" @click="generateBarcode(item.id)">
|
||||
<v-icon class="white--text mr-1 caption">fas fa-barcode</v-icon>
|
||||
<span>Generate Barcode</span>
|
||||
</v-btn>
|
||||
@@ -79,6 +79,7 @@
|
||||
<script>
|
||||
import { ApiService } from "@/services";
|
||||
import { urls } from "@/config/urls";
|
||||
import { mapMutations } from "vuex";
|
||||
export default {
|
||||
data: () => ({
|
||||
headers: [
|
||||
@@ -117,6 +118,7 @@ export default {
|
||||
this.getData();
|
||||
},
|
||||
methods: {
|
||||
...mapMutations("modal", ["changeCurrentModal"]),
|
||||
async getData(page = 1) {
|
||||
const result = await ApiService.get(urls.listTestType(page));
|
||||
if (result && result.status == 200) {
|
||||
@@ -137,6 +139,15 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
async generateBarcode(id) {
|
||||
const result = await ApiService.post(urls.TestTypeBarcode(id));
|
||||
if (result && result.status == 200) {
|
||||
this.changeCurrentModal({
|
||||
modal: "modal-testtype-barcode",
|
||||
properties: { result }
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
||||
Reference in New Issue
Block a user