This commit is contained in:
sajjad
2023-10-09 05:02:38 -07:00
parent 87770eb552
commit f3188c8b6d
15 changed files with 65 additions and 24 deletions
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -9,7 +9,7 @@
<v-layout row wrap class="ml-4">
<v-flex xs12 md6 sm6 v-if="barcodeimg">
<img :src="barcodeimg" class="WM-Width-350"><br />
<span v-if="Type != 'TestType'">{{ `${Type} ${item.udi ? 'UDI :' : 'ID :'} ${ID}` }}</span>
<span v-if="Type != 'TestType'">{{ `${Type} UDI : ${ID}` }}</span>
<span v-else>{{ Type + ':' + ID }}</span>
</v-flex>
</v-layout>
+13 -7
View File
@@ -145,6 +145,8 @@
import { ApiService } from "@/services";
import { urls } from "@/config/urls";
import { mapMutations, mapGetters } from "vuex";
import toast from "@/services/global/toast.service";
export default {
data: () => ({
headers: [
@@ -226,13 +228,17 @@ export default {
this.loadMedicalCenters();
},
async generateBarcode(item, type = null) {
let code = item.udi ? item.udi : item.id;
const result = await ApiService.post(urls.Barcode(code, type));
if (result && result.status == 200) {
this.changeCurrentModal({
modal: "modal-barcode-barcode",
properties: { result, item },
});
let code = item.udi;
if (code) {
const result = await ApiService.post(urls.Barcode(code, type));
if (result && result.status == 200) {
this.changeCurrentModal({
modal: "modal-barcode-barcode",
properties: { result, item },
});
}
} else {
toast.error('please first set UDI');
}
},
async show(testResultId) {
+11 -1
View File
@@ -23,7 +23,7 @@
<v-flex xs12 sm6 md3 class="WM-FlexCenter">
<v-icon class="fas fa-check mr-2 WM-Margin-B-8"></v-icon>
<v-autocomplete color="black" :items="items" item-text="name" v-model="formData.package_id"
item-value="id" label="Package ID" class="py-3 pr-3">
item-value="id" label="Package ID" class="py-3 pr-3" :filter="customFilter">
<template v-slot:chip="{ item }">
{{ item.name }} - {{ item.udi }}
</template>
@@ -120,6 +120,16 @@ export default {
}
},
methods: {
customFilter(item, queryText) {
const name = item.name.toLowerCase();
const udi = item.udi ? item.udi.toLowerCase() : null;
const searchText = queryText.toLowerCase();
if (udi) {
return name.indexOf(searchText) > -1 ||
udi.indexOf(searchText) > -1
}
return name.indexOf(searchText) > -1
},
async load(id) {
const result = await ApiService.get(urls.editLabel(id));
if (result.status == 200) {
+19 -1
View File
@@ -26,7 +26,15 @@
<div class="Inner">
<v-icon class="fas fa-check mr-2 WM-Margin-B-8"></v-icon>
<v-autocomplete class="py-3 pr-3" :items="items" item-text="name" v-model="item.id"
item-value="id" label="Select Items For Package" color="black"></v-autocomplete>
item-value="id" label="Select Items For Package" color="black" :filter="customFilter">
<template v-slot:selection="{ item }">
{{ item.name }} - {{ item.udi }}
</template>
<template v-slot:item="{ item }">
{{ item.name }} - {{ item.udi }}
</template>
</v-autocomplete>
<v-btn absolute small right bottom color="cyan" @click="duplicateForm(key)">
<v-icon class="white--text mr-2 caption">fas fa-plus</v-icon>ADD
@@ -113,6 +121,16 @@ export default {
this.loadItems();
},
methods: {
customFilter(item, queryText) {
const name = item.name.toLowerCase();
const udi = item.udi ? item.udi.toLowerCase() : null;
const searchText = queryText.toLowerCase();
if (udi) {
return name.indexOf(searchText) > -1 ||
udi.indexOf(searchText) > -1
}
return name.indexOf(searchText) > -1
},
async load(id) {
const result = await ApiService.get(urls.editPackage(id));
if (result.status == 200) {
+15 -8
View File
@@ -101,7 +101,7 @@
<v-tooltip bottom open-on-hover>
<template v-slot:activator="{ on, attrs }">
<v-btn class="mr-2" v-bind="attrs" v-on="on" color="orange darken-1"
@click="generateBarcode(item.id, 'Package')">
@click="generateBarcode(item, 'Package')">
<v-icon class="white--text mr-1 caption">fas fa-barcode</v-icon>
<span>Generate Barcode</span>
</v-btn>
@@ -134,6 +134,8 @@
import { ApiService } from "@/services";
import { urls } from "@/config/urls";
import { mapMutations, mapGetters } from "vuex";
import toast from "@/services/global/toast.service";
export default {
data: () => ({
headers: [
@@ -238,13 +240,18 @@ export default {
}
}
},
async generateBarcode(code, type) {
const result = await ApiService.post(urls.Barcode(code, type));
if (result && result.status == 200) {
this.changeCurrentModal({
modal: "modal-barcode-barcode",
properties: { result }
});
async generateBarcode(item, type) {
const code = item.udi;
if (code) {
const result = await ApiService.post(urls.Barcode(code, type));
if (result && result.status == 200) {
this.changeCurrentModal({
modal: "modal-barcode-barcode",
properties: { result }
});
}
} else {
toast.error('please first set UDI');
}
},
async loadMedicalCenters() {