mirror of
https://git.meshkee.com/cssd/cssd-back.git
synced 2026-10-10 20:21:05 +03:30
new Changes
This commit is contained in:
@@ -1,192 +1,143 @@
|
||||
|
||||
<template>
|
||||
<v-container grid-list-xs>
|
||||
<material-card color="black" title="Show Test Result" id="printMe">
|
||||
<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">{{ data.device_label || 'AutoclaveID' }} :</span>
|
||||
<span
|
||||
class="headline ml-2"
|
||||
style="letter-spacing:0 !important"
|
||||
>{{ data.device_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"
|
||||
style="letter-spacing:0 !important"
|
||||
>{{ 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"
|
||||
style="letter-spacing:0 !important"
|
||||
>{{ data.verified }}</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"
|
||||
>{{ 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-flex xs12 md6 sm6>
|
||||
<div class>
|
||||
<span class="title">Medical Center :</span>
|
||||
<span
|
||||
class="headline ml-2"
|
||||
style="letter-spacing:0 !important"
|
||||
>{{ data.user.medical_center.name }}</span>
|
||||
</div>
|
||||
</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 class="ml-4">
|
||||
<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"
|
||||
style="letter-spacing:0 !important"
|
||||
>{{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
|
||||
style="letter-spacing:0 !important"
|
||||
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
|
||||
style="letter-spacing:0 !important"
|
||||
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 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 v-for="(img, key) in data.title_image" :key="key">
|
||||
<img :src="'/'+img.path" style="width: 100%" />
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-layout>
|
||||
</material-card>
|
||||
<material-card>
|
||||
<v-layout row wrap align-center justify-center v-if="$hasRole('Admin|Supervisor')">
|
||||
<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-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-flex class xs12 md2 sm2>
|
||||
<v-btn
|
||||
class="WM-NoShadow WM-Outline-Btn WM-Border WM-Border-Gray"
|
||||
@click="print"
|
||||
>
|
||||
<v-icon class="black--text mr-2 caption">fas fa-print</v-icon>
|
||||
<span class="black--text">Print</span>
|
||||
</v-btn>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</material-card>
|
||||
</v-container>
|
||||
<v-container grid-list-xs>
|
||||
<material-card color="black" title="Show Test Result" id="printMe">
|
||||
<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">{{ data.device_label || 'AutoclaveID' }} :</span>
|
||||
<span class="headline ml-2" style="letter-spacing:0 !important">{{ data.device_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" style="letter-spacing:0 !important">{{ 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" style="letter-spacing:0 !important">{{ data.verified }}</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">{{ 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-flex xs12 md6 sm6>
|
||||
<div class>
|
||||
<span class="title">Medical Center :</span>
|
||||
<span
|
||||
class="headline ml-2"
|
||||
style="letter-spacing:0 !important"
|
||||
>{{ data.user.medical_center.name }}</span>
|
||||
</div>
|
||||
</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 class="ml-4">
|
||||
<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" style="letter-spacing:0 !important">{{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
|
||||
style="letter-spacing:0 !important"
|
||||
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
|
||||
style="letter-spacing:0 !important"
|
||||
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 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 v-for="(img, key) in data.title_image" :key="key">
|
||||
<img :src="'/'+img.path" style="width: 100%" />
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-layout>
|
||||
</material-card>
|
||||
<material-card>
|
||||
<v-layout row wrap align-center justify-center v-if="$hasRole('Admin|Supervisor')">
|
||||
<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-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-flex class xs12 md2 sm2>
|
||||
<v-btn class="WM-NoShadow WM-Outline-Btn WM-Border WM-Border-Gray" @click="print">
|
||||
<v-icon class="black--text mr-2 caption">fas fa-print</v-icon>
|
||||
<span class="black--text">Print</span>
|
||||
</v-btn>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</material-card>
|
||||
</v-container>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data: () => ({
|
||||
data: {}
|
||||
})
|
||||
data: () => ({
|
||||
data: {}
|
||||
})
|
||||
};
|
||||
</script>
|
||||
<script>
|
||||
@@ -194,35 +145,38 @@ import { mapGetters, mapMutations } from "vuex";
|
||||
import { ApiService } from "@/services";
|
||||
import { urls } from "@/config/urls";
|
||||
export default {
|
||||
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();
|
||||
}
|
||||
},
|
||||
print() {
|
||||
const prtHtml = document.getElementById("printMe").innerHTML;
|
||||
data: () => ({
|
||||
data: {
|
||||
user: {
|
||||
medical_center: {}
|
||||
}
|
||||
}
|
||||
}),
|
||||
methods: {
|
||||
async verify(id) {
|
||||
const result = await ApiService.post(urls.verifyTestResult(id));
|
||||
if (result && result.status == 200) {
|
||||
}
|
||||
},
|
||||
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>
|
||||
WinPrint.document.write(`<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
${stylesHtml}
|
||||
@@ -232,17 +186,22 @@ export default {
|
||||
</body>
|
||||
</html>`);
|
||||
|
||||
WinPrint.document.close();
|
||||
WinPrint.focus();
|
||||
WinPrint.print();
|
||||
WinPrint.close();
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.data = this.getModalProperties.result.data.data;
|
||||
},
|
||||
computed: {
|
||||
...mapGetters("modal", ["getModalProperties"])
|
||||
}
|
||||
WinPrint.document.close();
|
||||
WinPrint.focus();
|
||||
WinPrint.print();
|
||||
WinPrint.close();
|
||||
},
|
||||
async load() {
|
||||
const result = await ApiService.get(
|
||||
urls.showTestResult(this.$route.params.testResult)
|
||||
);
|
||||
if (result && result.status == 200) {
|
||||
this.data = result.data.data;
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.load();
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -43,8 +43,6 @@ Route::get('oauth/scopes', '\Laravel\Passport\Http\Controllers\ScopeController@a
|
||||
Route::post('oauth/token/refresh', '\Laravel\Passport\Http\Controllers\TransientTokenController@refresh')->middleware('auth:api');
|
||||
Route::get('oauth/tokens', '\Laravel\Passport\Http\Controllers\AuthorizedAccessTokenController@forUser')->middleware('auth:api');
|
||||
Route::delete('oauth/tokens/{token_id}', '\Laravel\Passport\Http\Controllers\AuthorizedAccessTokenController@destroy')->middleware('auth:api');
|
||||
|
||||
Route::get('/ShowTestResult/{id}', 'TestResultController@showTestResult');
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Vue Router
|
||||
|
||||
Reference in New Issue
Block a user