mirror of
https://git.meshkee.com/cssd/cssd-back.git
synced 2026-10-10 19:01:05 +03:30
fix : image and udi in item details
This commit is contained in:
@@ -31,6 +31,14 @@
|
||||
</span>
|
||||
</div>
|
||||
</v-flex>
|
||||
<v-flex xs12 md6 sm6>
|
||||
<div class>
|
||||
<span class="title CSSD-font">UDI :</span>
|
||||
<span class="headline ml-1 CSSD-font" style="letter-spacing:0 !important">
|
||||
{{ data.udi }}
|
||||
</span>
|
||||
</div>
|
||||
</v-flex>
|
||||
<v-flex xs12 md6 sm6>
|
||||
<div class>
|
||||
<span class="title CSSD-font">Specific :</span>
|
||||
@@ -55,7 +63,26 @@
|
||||
</span>
|
||||
</div>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout align-left justify-left wrap class="my-3" v-if="data.files.length">
|
||||
<h3 class="CSSD-font">Image</h3>
|
||||
<v-flex xs12>
|
||||
<hr class="v-divider theme--light"/>
|
||||
</v-flex>
|
||||
<v-layout row wrap class="">
|
||||
<!-- <LightBox :media="data.images.map(img => ({thumb: img.path, src: img.path}))" style="width: 20%"></LightBox> -->
|
||||
<v-flex xs6 md2 sm2 v-for="(file, key) in data.files" :key="key">
|
||||
<template v-if="file.file_type == 'document'">
|
||||
<a target="_blank" :href="'/'+file.thumbnail">
|
||||
<v-icon class="mr-2 caption">fas fa-check</v-icon>
|
||||
{{ file.file_name }}</a>
|
||||
</template>
|
||||
|
||||
<template v-else>
|
||||
<img :src="file.thumbnail" style="width: 100%"/>
|
||||
</template>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-layout>
|
||||
<v-layout align-left justify-left wrap class="my-3">
|
||||
<h3 class="ml-3 CSSD-font">Barcode And QRCode Image</h3>
|
||||
@@ -97,6 +124,8 @@
|
||||
|
||||
import {urls} from "@show/config/urls";
|
||||
import axios from "axios";
|
||||
import toast from "@/services/global/toast.service";
|
||||
|
||||
|
||||
export default {
|
||||
data: () => ({
|
||||
@@ -112,7 +141,7 @@ export default {
|
||||
if (result.status == 200) {
|
||||
this.data = result.data.data;
|
||||
if (this.data) {
|
||||
this.generateBarcode(this.data.id);
|
||||
this.generateBarcode(this.data);
|
||||
this.MedicalCenter = this.data.user.medical_center.name;
|
||||
}
|
||||
}
|
||||
@@ -121,11 +150,16 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
async generateBarcode(itemId) {
|
||||
const result = await axios.post(urls.Barcode(itemId, 'Item'));
|
||||
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;
|
||||
async generateBarcode(item) {
|
||||
let code = item.udi;
|
||||
if (code) {
|
||||
const result = await axios.post(urls.Barcode(code, 'Item'));
|
||||
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;
|
||||
}
|
||||
} else {
|
||||
toast.error('An error occurred while generating the barcode . please first set UDI');
|
||||
}
|
||||
},
|
||||
editItem(itemId) {
|
||||
|
||||
Reference in New Issue
Block a user