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-layout row wrap class="ml-4">
<v-flex xs12 md6 sm6 v-if="barcodeimg"> <v-flex xs12 md6 sm6 v-if="barcodeimg">
<img :src="barcodeimg" class="WM-Width-350"><br /> <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> <span v-else>{{ Type + ':' + ID }}</span>
</v-flex> </v-flex>
</v-layout> </v-layout>
+13 -7
View File
@@ -145,6 +145,8 @@
import { ApiService } from "@/services"; import { ApiService } from "@/services";
import { urls } from "@/config/urls"; import { urls } from "@/config/urls";
import { mapMutations, mapGetters } from "vuex"; import { mapMutations, mapGetters } from "vuex";
import toast from "@/services/global/toast.service";
export default { export default {
data: () => ({ data: () => ({
headers: [ headers: [
@@ -226,13 +228,17 @@ export default {
this.loadMedicalCenters(); this.loadMedicalCenters();
}, },
async generateBarcode(item, type = null) { async generateBarcode(item, type = null) {
let code = item.udi ? item.udi : item.id; let code = item.udi;
const result = await ApiService.post(urls.Barcode(code, type)); if (code) {
if (result && result.status == 200) { const result = await ApiService.post(urls.Barcode(code, type));
this.changeCurrentModal({ if (result && result.status == 200) {
modal: "modal-barcode-barcode", this.changeCurrentModal({
properties: { result, item }, modal: "modal-barcode-barcode",
}); properties: { result, item },
});
}
} else {
toast.error('please first set UDI');
} }
}, },
async show(testResultId) { async show(testResultId) {
+11 -1
View File
@@ -23,7 +23,7 @@
<v-flex xs12 sm6 md3 class="WM-FlexCenter"> <v-flex xs12 sm6 md3 class="WM-FlexCenter">
<v-icon class="fas fa-check mr-2 WM-Margin-B-8"></v-icon> <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" <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 }"> <template v-slot:chip="{ item }">
{{ item.name }} - {{ item.udi }} {{ item.name }} - {{ item.udi }}
</template> </template>
@@ -120,6 +120,16 @@ export default {
} }
}, },
methods: { 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) { async load(id) {
const result = await ApiService.get(urls.editLabel(id)); const result = await ApiService.get(urls.editLabel(id));
if (result.status == 200) { if (result.status == 200) {
+19 -1
View File
@@ -26,7 +26,15 @@
<div class="Inner"> <div class="Inner">
<v-icon class="fas fa-check mr-2 WM-Margin-B-8"></v-icon> <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" <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-btn absolute small right bottom color="cyan" @click="duplicateForm(key)">
<v-icon class="white--text mr-2 caption">fas fa-plus</v-icon>ADD <v-icon class="white--text mr-2 caption">fas fa-plus</v-icon>ADD
@@ -113,6 +121,16 @@ export default {
this.loadItems(); this.loadItems();
}, },
methods: { 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) { async load(id) {
const result = await ApiService.get(urls.editPackage(id)); const result = await ApiService.get(urls.editPackage(id));
if (result.status == 200) { if (result.status == 200) {
+15 -8
View File
@@ -101,7 +101,7 @@
<v-tooltip bottom open-on-hover> <v-tooltip bottom open-on-hover>
<template v-slot:activator="{ on, attrs }"> <template v-slot:activator="{ on, attrs }">
<v-btn class="mr-2" v-bind="attrs" v-on="on" color="orange darken-1" <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> <v-icon class="white--text mr-1 caption">fas fa-barcode</v-icon>
<span>Generate Barcode</span> <span>Generate Barcode</span>
</v-btn> </v-btn>
@@ -134,6 +134,8 @@
import { ApiService } from "@/services"; import { ApiService } from "@/services";
import { urls } from "@/config/urls"; import { urls } from "@/config/urls";
import { mapMutations, mapGetters } from "vuex"; import { mapMutations, mapGetters } from "vuex";
import toast from "@/services/global/toast.service";
export default { export default {
data: () => ({ data: () => ({
headers: [ headers: [
@@ -238,13 +240,18 @@ export default {
} }
} }
}, },
async generateBarcode(code, type) { async generateBarcode(item, type) {
const result = await ApiService.post(urls.Barcode(code, type)); const code = item.udi;
if (result && result.status == 200) { if (code) {
this.changeCurrentModal({ const result = await ApiService.post(urls.Barcode(code, type));
modal: "modal-barcode-barcode", if (result && result.status == 200) {
properties: { result } this.changeCurrentModal({
}); modal: "modal-barcode-barcode",
properties: { result }
});
}
} else {
toast.error('please first set UDI');
} }
}, },
async loadMedicalCenters() { async loadMedicalCenters() {