mirror of
https://git.meshkee.com/cssd/cssd-back.git
synced 2026-10-12 17:41:06 +03:30
new update
This commit is contained in:
@@ -102,6 +102,11 @@ export default {
|
||||
icon: 'mdi-account',
|
||||
text: 'My Info'
|
||||
},
|
||||
{
|
||||
to: {name: 'SubmitTestResult'},
|
||||
icon: 'fas fa-vial',
|
||||
text: 'Add a Test Result'
|
||||
},
|
||||
{
|
||||
to: {name: 'AllResultTest'},
|
||||
icon: 'description',
|
||||
|
||||
@@ -9,7 +9,8 @@
|
||||
<v-layout row wrap class="ml-4">
|
||||
<v-flex xs12 md6 sm6 v-if="barcodeimg">
|
||||
<img :src="barcodeimg" class="WM-Width-350"><br />
|
||||
<span>{{ Type+ ' ID :' + ID }}</span>
|
||||
<span v-if = "Type != 'TestType'">{{ Type+ ' ID :' + ID }}</span>
|
||||
<span v-else>{{ Type+ ':' + ID }}</span>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout row wrap class="ml-4">
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<hr class="v-divider theme--light" />
|
||||
</v-flex>
|
||||
<v-layout row wrap class="ml-4">
|
||||
<v-flex xs6 md6 sm6>
|
||||
<!-- <v-flex xs6 md6 sm6>
|
||||
<div class>
|
||||
<span class="subtitle-1">{{ data.device_label || 'AutoclaveID' }} :</span>
|
||||
<span
|
||||
@@ -16,7 +16,7 @@
|
||||
style="letter-spacing:0 !important"
|
||||
>{{ data.device_id }}</span>
|
||||
</div>
|
||||
</v-flex>
|
||||
</v-flex> -->
|
||||
<v-flex xs6 md6 sm6>
|
||||
<div class>
|
||||
<span class="subtitle-1">Result :</span>
|
||||
|
||||
@@ -30,6 +30,18 @@
|
||||
color="black"
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs12 md3 sm3 class="WM-FlexCenter pl-3" v-if="$hasRole('Admin')">
|
||||
<v-icon class="fa fa-hospital-o mr-2 WM-Margin-B-8"></v-icon>
|
||||
<v-autocomplete
|
||||
class="py-3 pr-3"
|
||||
v-model="filter.medical_center_id"
|
||||
item-text="name"
|
||||
item-value="id"
|
||||
label="Hospital"
|
||||
color="black"
|
||||
:items="medicalCenters"
|
||||
></v-autocomplete>
|
||||
</v-flex>
|
||||
<v-flex xs12 sm2 md2 class="WM-FlexCenter pl-3">
|
||||
<v-icon class="far fa-calendar-alt mr-2 WM-Margin-B-8"></v-icon>
|
||||
<v-menu
|
||||
@@ -55,7 +67,7 @@
|
||||
></v-date-picker>
|
||||
</v-menu>
|
||||
</v-flex>
|
||||
<v-flex class xs12 md1 sm3>
|
||||
<v-flex class xs12 md12 sm12>
|
||||
<v-btn class="WM-CyanBlueGradient-BG" style="padding:10px 60px" @click="load()">
|
||||
<v-icon class="white--text mr-2 caption">fas fa-search</v-icon>
|
||||
<span class="white--text">Filter</span>
|
||||
@@ -174,6 +186,7 @@ export default {
|
||||
packages: [],
|
||||
currentPage: 1,
|
||||
lastPage: 1,
|
||||
medicalCenters: []
|
||||
}),
|
||||
created() {
|
||||
this.load();
|
||||
@@ -196,6 +209,7 @@ export default {
|
||||
this.currentPage = result.data.data.current_page;
|
||||
this.lastPage = result.data.data.last_page;
|
||||
}
|
||||
this.loadMedicalCenters();
|
||||
},
|
||||
async show(testResultId) {
|
||||
const result = await ApiService.get(
|
||||
@@ -232,6 +246,12 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
async loadMedicalCenters() {
|
||||
const result = await ApiService.get(urls.listFilterItemsTestResult);
|
||||
if (result && result.status == 200) {
|
||||
this.medicalCenters = result.data.data.MedicalCenters;
|
||||
}
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
...mapGetters("modal", ["getModalResult"])
|
||||
|
||||
@@ -21,6 +21,18 @@
|
||||
color="black"
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs12 md3 sm3 class="WM-FlexCenter pl-3" v-if="$hasRole('Admin')">
|
||||
<v-icon class="fa fa-hospital-o mr-2 WM-Margin-B-8"></v-icon>
|
||||
<v-autocomplete
|
||||
class="py-3 pr-3"
|
||||
v-model="filter.medical_center_id"
|
||||
item-text="name"
|
||||
item-value="id"
|
||||
label="Hospital"
|
||||
color="black"
|
||||
:items="medicalCenters"
|
||||
></v-autocomplete>
|
||||
</v-flex>
|
||||
<v-flex xs12 md3 sm3 class="WM-FlexCenter pl-3">
|
||||
<v-icon class="fas fa-sort-numeric-up mr-2 WM-Margin-B-8"></v-icon>
|
||||
<v-text-field
|
||||
@@ -147,11 +159,13 @@ export default {
|
||||
filter: {
|
||||
name: '',
|
||||
size: '',
|
||||
item_id : ''
|
||||
item_id : '',
|
||||
medical_center_id : ''
|
||||
},
|
||||
items: [],
|
||||
currentPage: 1,
|
||||
lastPage: 1,
|
||||
medicalCenters: []
|
||||
|
||||
}),
|
||||
created() {
|
||||
@@ -175,6 +189,7 @@ export default {
|
||||
this.currentPage = result.data.data.current_page;
|
||||
this.lastPage = result.data.data.last_page;
|
||||
}
|
||||
this.loadMedicalCenters();
|
||||
},
|
||||
async generateBarcode(code, type = null) {
|
||||
const result = await ApiService.post(urls.Barcode(code, type));
|
||||
@@ -210,7 +225,13 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
async loadMedicalCenters() {
|
||||
const result = await ApiService.get(urls.listFilterItemsTestResult);
|
||||
if (result && result.status == 200) {
|
||||
this.medicalCenters = result.data.data.MedicalCenters;
|
||||
}
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
currentPage(page) {
|
||||
|
||||
@@ -21,15 +21,19 @@
|
||||
color="black"
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs12 md3 sm3 class="WM-FlexCenter pl-3">
|
||||
<v-icon class="fas fa-sort-numeric-up mr-2 WM-Margin-B-8"></v-icon>
|
||||
<v-text-field
|
||||
class="py-3 pr-3"
|
||||
v-model="filter.unique_id"
|
||||
label="uniqueID"
|
||||
color="black"
|
||||
></v-text-field>
|
||||
<v-flex xs12 md3 sm3 class="WM-FlexCenter pl-3" v-if="$hasRole('Admin')">
|
||||
<v-icon class="fa fa-hospital-o mr-2 WM-Margin-B-8"></v-icon>
|
||||
<v-autocomplete
|
||||
class="py-3 pr-3"
|
||||
v-model="filter.medical_center_id"
|
||||
item-text="name"
|
||||
item-value="id"
|
||||
label="Hospital"
|
||||
color="black"
|
||||
:items="medicalCenters"
|
||||
></v-autocomplete>
|
||||
</v-flex>
|
||||
|
||||
<v-flex class xs12 md2 sm3>
|
||||
<v-btn class="WM-CyanBlueGradient-BG" style="padding:10px 60px" @click="load()">
|
||||
<v-icon class="white--text mr-2 caption">fas fa-search</v-icon>
|
||||
@@ -151,14 +155,15 @@ export default {
|
||||
}
|
||||
],
|
||||
filter: {
|
||||
unique_id: '',
|
||||
name: '',
|
||||
package_id : ''
|
||||
package_id : '',
|
||||
medical_center_id : ''
|
||||
},
|
||||
result: ['Pass', 'Fail'],
|
||||
items: [],
|
||||
currentPage: 1,
|
||||
lastPage: 1,
|
||||
medicalCenters: []
|
||||
}),
|
||||
created() {
|
||||
this.load();
|
||||
@@ -181,6 +186,7 @@ export default {
|
||||
this.currentPage = result.data.data.current_page;
|
||||
this.lastPage = result.data.data.last_page;
|
||||
}
|
||||
this.loadMedicalCenters();
|
||||
},
|
||||
async show(testResultId) {
|
||||
const result = await ApiService.get(
|
||||
@@ -216,7 +222,13 @@ export default {
|
||||
properties: { result }
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
async loadMedicalCenters() {
|
||||
const result = await ApiService.get(urls.listFilterItemsTestResult);
|
||||
if (result && result.status == 200) {
|
||||
this.medicalCenters = result.data.data.MedicalCenters;
|
||||
}
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
...mapGetters("modal", ["getModalResult"])
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
<v-flex xs12 sm12 md12>
|
||||
<h3 class="WM-BorderLeftTitle">{{testTypeNameSelected}}</h3>
|
||||
</v-flex>
|
||||
<v-flex xs12 sm3 md3>
|
||||
<!-- <v-flex xs12 sm3 md3>
|
||||
<v-text-field
|
||||
name="id"
|
||||
v-model="formData.device_id"
|
||||
@@ -53,7 +53,7 @@
|
||||
class="pa-2"
|
||||
prepend-icon="fas fa-sort-numeric-up"
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
</v-flex> -->
|
||||
<v-flex xs12 sm2 md2>
|
||||
<v-menu
|
||||
lazy
|
||||
@@ -437,7 +437,7 @@ export default {
|
||||
},
|
||||
result: false,
|
||||
formData: {
|
||||
device_id: "",
|
||||
// device_id: "",
|
||||
device_label: "ID",
|
||||
result: "Reject",
|
||||
img: null,
|
||||
|
||||
@@ -137,7 +137,7 @@
|
||||
/>
|
||||
</template>
|
||||
<template slot="items" slot-scope="{ item }">
|
||||
<td class="headline font-weight-light">{{ item.device_id }}</td>
|
||||
<td class="headline font-weight-light">{{ item.id }}</td>
|
||||
<td
|
||||
class="title font-weight-light"
|
||||
>{{ item.test_type ? item.test_type.name : 'Archived Test' }}</td>
|
||||
@@ -263,18 +263,18 @@ export default {
|
||||
testTypes: [],
|
||||
medicalCenters: [],
|
||||
deviceLabels: [
|
||||
{ name: "ID Washer", id: "ID Washer" },
|
||||
{ name: "Autoclave ID", id: "Autoclave ID" },
|
||||
{ name: "Sterilizer ID", id: "Sterilizer ID" },
|
||||
{ name: "ID WasherMachine", id: "ID WasherMachine" },
|
||||
{ name: "ID SealMachine", id: "ID SealMachine" },
|
||||
{ name: "ID Patient", id: "ID Patient" },
|
||||
{ name: "ID Set/Pack", id: "ID Set/Pack" },
|
||||
{ name: "MD ID", id: "MD ID" },
|
||||
{ name: "OR ID", id: "OR ID" },
|
||||
{ name: "Personal ID", id: "Personal ID" },
|
||||
{ name: "ID Instrument", id: "ID Instrument" },
|
||||
{ name: "ID", id: "ID" },
|
||||
{ name: "Washer ID", id: "Washer ID" },
|
||||
{ name: "Autoclave ID", id: "Autoclave ID" },
|
||||
{ name: "Sterilizer ID", id: "Sterilizer ID" },
|
||||
{ name: "WasherMachine ID", id: "WasherMachine ID" },
|
||||
{ name: "SealMachine ID", id: "SealMachine ID" },
|
||||
{ name: "Patient ID", id: "Patient ID" },
|
||||
{ name: "Set/Pack ID", id: "Set/Pack ID" },
|
||||
{ name: "MD ID", id: "MDID" },
|
||||
{ name: "OR ID", id: "ORID" },
|
||||
{ name: "Personal ID", id: "Personal ID" },
|
||||
{ name: "Instrument ID", id: "Instrument ID" },
|
||||
{ name: "ID", id: "ID" },
|
||||
]
|
||||
}),
|
||||
created() {
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
class="py-3 pr-3"
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs12 md3 sm3 class="WM-FlexCenter pl-3">
|
||||
<!-- <v-flex xs12 md3 sm3 class="WM-FlexCenter pl-3">
|
||||
<v-icon class="fas fa-sort-numeric-up mr-2 WM-Margin-B-8"></v-icon>
|
||||
<v-autocomplete
|
||||
:rules="[rules.required]"
|
||||
@@ -37,7 +37,7 @@
|
||||
color="black"
|
||||
class="py-3 pr-3"
|
||||
></v-autocomplete>
|
||||
</v-flex>
|
||||
</v-flex> -->
|
||||
</v-layout>
|
||||
<v-layout
|
||||
row
|
||||
@@ -548,7 +548,7 @@ export default {
|
||||
);
|
||||
}
|
||||
if (result && result.status == 200) {
|
||||
this.$router.push({ name: `Dashboard` });
|
||||
this.$router.push({ name: `ListTestType` });
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1,144 +1,144 @@
|
||||
<template>
|
||||
<v-container fluid>
|
||||
<material-card class color="black" title="TestType List" text>
|
||||
<v-layout wrap class="px-5 mb-3">
|
||||
<v-flex xs12 md3 sm3 class="WM-FlexCenter pl-3">
|
||||
<v-icon class="fa fa-align-left mr-2 WM-Margin-B-8"></v-icon>
|
||||
<v-text-field class="py-3 pr-3" label="Name" v-model="filter.name" color="black"></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs12 md3 sm3 class="WM-FlexCenter pl-3">
|
||||
<v-icon class="fas fa-sort-numeric-up mr-2 WM-Margin-B-8"></v-icon>
|
||||
<v-text-field class="py-3 pr-3" label="UniqueId" v-model="filter.unique_id" color="black"></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs12 md36 sm3 class="WM-FlexCenter pl-3">
|
||||
<v-icon class="fa fa-align-left mr-2 WM-Margin-B-8"></v-icon>
|
||||
<v-text-field class="py-3 pr-3" label="UserName" v-model="filter.user_name" color="black"></v-text-field>
|
||||
</v-flex>
|
||||
<v-spacer></v-spacer>
|
||||
<v-flex xs12 md2 sm2 class="text-xs-right">
|
||||
<router-link :to="{name: 'AddTestType'}">
|
||||
<v-btn class="WM-NoShadow WM-Outline-Btn WM-Border WM-Border-Black">
|
||||
<v-icon class="black--text mr-2 caption">fas fa-plus</v-icon>
|
||||
<span class="black--text">Add</span>
|
||||
</v-btn>
|
||||
</router-link>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout wrap class="px-5 mb-3">
|
||||
<v-flex xs12 sm6 md2 class="WM-FlexCenter pl-3">
|
||||
<v-icon class="far fa-calendar-alt mr-2"></v-icon>
|
||||
<v-menu
|
||||
lazy
|
||||
:close-on-content-click="true"
|
||||
transition="v-scale-transition"
|
||||
offset-y
|
||||
v-model="fromMenu"
|
||||
>
|
||||
<v-text-field
|
||||
required
|
||||
slot="activator"
|
||||
label="FromDate"
|
||||
v-model="filter.fromPicker"
|
||||
color="black"
|
||||
></v-text-field>
|
||||
<v-date-picker
|
||||
color="pink"
|
||||
no-title
|
||||
v-model="filter.fromPicker"
|
||||
:date-format="date => new Date(date).toDateString()"
|
||||
></v-date-picker>
|
||||
</v-menu>
|
||||
</v-flex>
|
||||
<v-flex xs12 sm6 md2 class="WM-FlexCenter pl-3">
|
||||
<v-icon class="far fa-calendar-alt mr-2"></v-icon>
|
||||
<v-menu
|
||||
lazy
|
||||
:close-on-content-click="true"
|
||||
transition="v-scale-transition"
|
||||
offset-y
|
||||
v-model="upToMenu"
|
||||
>
|
||||
<v-text-field
|
||||
required
|
||||
slot="activator"
|
||||
label="UpToDate"
|
||||
v-model="filter.upToPicker"
|
||||
color="black"
|
||||
></v-text-field>
|
||||
<v-date-picker
|
||||
color="pink"
|
||||
no-title
|
||||
v-model="filter.upToPicker"
|
||||
:date-format="date => new Date(date).toDateString()"
|
||||
></v-date-picker>
|
||||
</v-menu>
|
||||
</v-flex>
|
||||
<v-spacer></v-spacer>
|
||||
<v-flex xs12 md2 sm2 class="text-xs-right">
|
||||
<v-btn
|
||||
class="WM-CyanBlueGradient-BG"
|
||||
style="padding:10px 60px"
|
||||
@click="load(undefined)"
|
||||
>
|
||||
<v-icon class="white--text mr-2 caption">fas fa-search</v-icon>
|
||||
<span class="white--text">Filter</span>
|
||||
</v-btn>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout class="px-4 my-3">
|
||||
<v-divider></v-divider>
|
||||
</v-layout>
|
||||
<v-layout align-center justify-center wrap class="px-5 mt-3">
|
||||
<v-flex md12>
|
||||
<v-data-table :headers="headers" :items="items" hide-actions>
|
||||
<template slot="headerCell" slot-scope="{ header }">
|
||||
<span
|
||||
class="subheading font-weight-light text-white text--darken-3"
|
||||
v-text="header.text"
|
||||
/>
|
||||
</template>
|
||||
<template slot="items" slot-scope="{ item }">
|
||||
<td class="headline font-weight-light">{{ item.name }}</td>
|
||||
<td class="title font-weight-light">{{ item.unique_code }}</td>
|
||||
<td class="title font-weight-light">{{ item.user.name }}</td>
|
||||
<td class="title font-weight-light">{{ item.created_at }}</td>
|
||||
<td class="text-xs-right">
|
||||
<router-link
|
||||
v-if="item.test_results_count == 0"
|
||||
:to="{name : 'EditTestType', params : {testType : item.id}}"
|
||||
>
|
||||
<v-btn color="cyan" class="mr-2 WM-ActionButton">
|
||||
<v-icon class="white--text mr-2 caption">fas fa-pen</v-icon>
|
||||
<span>Edit</span>
|
||||
</v-btn>
|
||||
</router-link>
|
||||
<v-btn color="black" class="mr-2" @click="remove(item.id)">
|
||||
<v-icon class="white--text mr-1 caption">fas fa-folder</v-icon>
|
||||
<span>Archive</span>
|
||||
</v-btn>
|
||||
<v-btn color="orange darken-1" @click="generateBarcode(item.id, 'TestType')">
|
||||
<v-icon class="white--text mr-1 caption">fas fa-barcode</v-icon>
|
||||
<span>Generate Barcode</span>
|
||||
</v-btn>
|
||||
</td>
|
||||
</template>
|
||||
</v-data-table>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-divider></v-divider>
|
||||
<div class="text-xs-center mt-2" v-if="lastPage > 1">
|
||||
<v-pagination color="black" v-model="currentPage" :length="lastPage" :total-visible="6"></v-pagination>
|
||||
</div>
|
||||
<v-layout row wrap align-center justify-center class="mt-3">
|
||||
<router-link to="/dashboard">
|
||||
<v-btn class="WM-NoShadow WM-Outline-Btn WM-Border WM-Border-Black ml-5">
|
||||
<v-icon class="black--text mr-2 caption">fas fa-chevron-left</v-icon>
|
||||
<span class="black--text">Back</span>
|
||||
</v-btn>
|
||||
</router-link>
|
||||
</v-layout>
|
||||
</material-card>
|
||||
</v-container>
|
||||
<template>
|
||||
<v-container fluid>
|
||||
<material-card class color="black" title="TestType List" text>
|
||||
<v-layout wrap class="px-5 mb-3">
|
||||
<v-flex xs12 md3 sm3 class="WM-FlexCenter pl-3">
|
||||
<v-icon class="fa fa-align-left mr-2 WM-Margin-B-8"></v-icon>
|
||||
<v-text-field class="py-3 pr-3" label="Name" v-model="filter.name" color="black"></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs12 md3 sm3 class="WM-FlexCenter pl-3">
|
||||
<v-icon class="fas fa-sort-numeric-up mr-2 WM-Margin-B-8"></v-icon>
|
||||
<v-text-field class="py-3 pr-3" label="UniqueId" v-model="filter.unique_id" color="black"></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs12 md36 sm3 class="WM-FlexCenter pl-3">
|
||||
<v-icon class="fa fa-align-left mr-2 WM-Margin-B-8"></v-icon>
|
||||
<v-text-field class="py-3 pr-3" label="UserName" v-model="filter.user_name" color="black"></v-text-field>
|
||||
</v-flex>
|
||||
<v-spacer></v-spacer>
|
||||
<v-flex xs12 md2 sm2 class="text-xs-right">
|
||||
<router-link :to="{name: 'AddTestType'}">
|
||||
<v-btn class="WM-NoShadow WM-Outline-Btn WM-Border WM-Border-Black">
|
||||
<v-icon class="black--text mr-2 caption">fas fa-plus</v-icon>
|
||||
<span class="black--text">Add</span>
|
||||
</v-btn>
|
||||
</router-link>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout wrap class="px-5 mb-3">
|
||||
<v-flex xs12 sm6 md2 class="WM-FlexCenter pl-3">
|
||||
<v-icon class="far fa-calendar-alt mr-2"></v-icon>
|
||||
<v-menu
|
||||
lazy
|
||||
:close-on-content-click="true"
|
||||
transition="v-scale-transition"
|
||||
offset-y
|
||||
v-model="fromMenu"
|
||||
>
|
||||
<v-text-field
|
||||
required
|
||||
slot="activator"
|
||||
label="FromDate"
|
||||
v-model="filter.fromPicker"
|
||||
color="black"
|
||||
></v-text-field>
|
||||
<v-date-picker
|
||||
color="pink"
|
||||
no-title
|
||||
v-model="filter.fromPicker"
|
||||
:date-format="date => new Date(date).toDateString()"
|
||||
></v-date-picker>
|
||||
</v-menu>
|
||||
</v-flex>
|
||||
<v-flex xs12 sm6 md2 class="WM-FlexCenter pl-3">
|
||||
<v-icon class="far fa-calendar-alt mr-2"></v-icon>
|
||||
<v-menu
|
||||
lazy
|
||||
:close-on-content-click="true"
|
||||
transition="v-scale-transition"
|
||||
offset-y
|
||||
v-model="upToMenu"
|
||||
>
|
||||
<v-text-field
|
||||
required
|
||||
slot="activator"
|
||||
label="UpToDate"
|
||||
v-model="filter.upToPicker"
|
||||
color="black"
|
||||
></v-text-field>
|
||||
<v-date-picker
|
||||
color="pink"
|
||||
no-title
|
||||
v-model="filter.upToPicker"
|
||||
:date-format="date => new Date(date).toDateString()"
|
||||
></v-date-picker>
|
||||
</v-menu>
|
||||
</v-flex>
|
||||
<v-spacer></v-spacer>
|
||||
<v-flex xs12 md2 sm2 class="text-xs-right">
|
||||
<v-btn
|
||||
class="WM-CyanBlueGradient-BG"
|
||||
style="padding:10px 60px"
|
||||
@click="load(undefined)"
|
||||
>
|
||||
<v-icon class="white--text mr-2 caption">fas fa-search</v-icon>
|
||||
<span class="white--text">Filter</span>
|
||||
</v-btn>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout class="px-4 my-3">
|
||||
<v-divider></v-divider>
|
||||
</v-layout>
|
||||
<v-layout align-center justify-center wrap class="px-5 mt-3">
|
||||
<v-flex md12>
|
||||
<v-data-table :headers="headers" :items="items" hide-actions>
|
||||
<template slot="headerCell" slot-scope="{ header }">
|
||||
<span
|
||||
class="subheading font-weight-light text-white text--darken-3"
|
||||
v-text="header.text"
|
||||
/>
|
||||
</template>
|
||||
<template slot="items" slot-scope="{ item }">
|
||||
<td class="headline font-weight-light">{{ item.name }}</td>
|
||||
<td class="title font-weight-light">{{ item.unique_code }}</td>
|
||||
<td class="title font-weight-light">{{ item.user.name }}</td>
|
||||
<td class="title font-weight-light">{{ item.created_at }}</td>
|
||||
<td class="text-xs-right">
|
||||
<router-link
|
||||
v-if="item.test_results_count == 0"
|
||||
:to="{name : 'EditTestType', params : {testType : item.id}}"
|
||||
>
|
||||
<v-btn color="cyan" class="mr-2 WM-ActionButton">
|
||||
<v-icon class="white--text mr-2 caption">fas fa-pen</v-icon>
|
||||
<span>Edit</span>
|
||||
</v-btn>
|
||||
</router-link>
|
||||
<v-btn color="black" class="mr-2" @click="remove(item.id)">
|
||||
<v-icon class="white--text mr-1 caption">fas fa-folder</v-icon>
|
||||
<span>Archive</span>
|
||||
</v-btn>
|
||||
<v-btn color="orange darken-1" @click="generateBarcode(item.unique_code, 'TestType')">
|
||||
<v-icon class="white--text mr-1 caption">fas fa-barcode</v-icon>
|
||||
<span>Generate Barcode</span>
|
||||
</v-btn>
|
||||
</td>
|
||||
</template>
|
||||
</v-data-table>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-divider></v-divider>
|
||||
<div class="text-xs-center mt-2" v-if="lastPage > 1">
|
||||
<v-pagination color="black" v-model="currentPage" :length="lastPage" :total-visible="6"></v-pagination>
|
||||
</div>
|
||||
<v-layout row wrap align-center justify-center class="mt-3">
|
||||
<router-link to="/dashboard">
|
||||
<v-btn class="WM-NoShadow WM-Outline-Btn WM-Border WM-Border-Black ml-5">
|
||||
<v-icon class="black--text mr-2 caption">fas fa-chevron-left</v-icon>
|
||||
<span class="black--text">Back</span>
|
||||
</v-btn>
|
||||
</router-link>
|
||||
</v-layout>
|
||||
</material-card>
|
||||
</v-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -147,110 +147,110 @@ import { urls } from "@/config/urls";
|
||||
import { mapMutations, mapGetters } from "vuex";
|
||||
|
||||
export default {
|
||||
data: () => ({
|
||||
headers: [
|
||||
{
|
||||
sortable: false,
|
||||
text: "TestType Name",
|
||||
value: "name"
|
||||
},
|
||||
{
|
||||
sortable: false,
|
||||
text: "TestType UniqueId",
|
||||
value: "uniqueId"
|
||||
},
|
||||
{
|
||||
sortable: false,
|
||||
text: "Register TestType",
|
||||
value: "users"
|
||||
},
|
||||
{
|
||||
sortable: false,
|
||||
text: "Date",
|
||||
value: "date"
|
||||
},
|
||||
{
|
||||
sortable: false,
|
||||
text: "Action",
|
||||
value: "action",
|
||||
align: "right"
|
||||
}
|
||||
],
|
||||
items: [],
|
||||
filter: {
|
||||
name: "",
|
||||
unique_id: "",
|
||||
user_name: "",
|
||||
fromPicker: "",
|
||||
upToPicker: ""
|
||||
},
|
||||
fromMenu: "",
|
||||
upToMenu: "",
|
||||
currentPage: 1,
|
||||
lastPage: 1
|
||||
}),
|
||||
created() {
|
||||
this.load();
|
||||
},
|
||||
methods: {
|
||||
...mapMutations("modal", ["changeCurrentModal"]),
|
||||
async load(page = 1) {
|
||||
let filter = "?";
|
||||
for (const key in this.filter) {
|
||||
if (this.filter.hasOwnProperty(key)) {
|
||||
filter += `${key}=${this.filter[key]}&`;
|
||||
}
|
||||
}
|
||||
filter += page ? `page=${page}` : `page=1`;
|
||||
const result = await ApiService.get(urls.listTestType(filter));
|
||||
if (result && result.status == 200) {
|
||||
this.items = result.data.data.data;
|
||||
this.currentPage = result.data.data.current_page;
|
||||
this.lastPage = result.data.data.last_page;
|
||||
}
|
||||
},
|
||||
async remove(id) {
|
||||
const result = await ApiService.delete(urls.deleteTestType(id));
|
||||
if (result.status == 200) {
|
||||
for (const key in this.items) {
|
||||
if (
|
||||
this.items.hasOwnProperty(key) &&
|
||||
this.items[key].id == id
|
||||
) {
|
||||
this.items.splice(key, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
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 }
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
currentPage(page) {
|
||||
this.load(page);
|
||||
}
|
||||
}
|
||||
data: () => ({
|
||||
headers: [
|
||||
{
|
||||
sortable: false,
|
||||
text: "TestType Name",
|
||||
value: "name"
|
||||
},
|
||||
{
|
||||
sortable: false,
|
||||
text: "TestType UniqueId",
|
||||
value: "uniqueId"
|
||||
},
|
||||
{
|
||||
sortable: false,
|
||||
text: "Register TestType",
|
||||
value: "users"
|
||||
},
|
||||
{
|
||||
sortable: false,
|
||||
text: "Date",
|
||||
value: "date"
|
||||
},
|
||||
{
|
||||
sortable: false,
|
||||
text: "Action",
|
||||
value: "action",
|
||||
align: "right"
|
||||
}
|
||||
],
|
||||
items: [],
|
||||
filter: {
|
||||
name: "",
|
||||
unique_id: "",
|
||||
user_name: "",
|
||||
fromPicker: "",
|
||||
upToPicker: ""
|
||||
},
|
||||
fromMenu: "",
|
||||
upToMenu: "",
|
||||
currentPage: 1,
|
||||
lastPage: 1
|
||||
}),
|
||||
created() {
|
||||
this.load();
|
||||
},
|
||||
methods: {
|
||||
...mapMutations("modal", ["changeCurrentModal"]),
|
||||
async load(page = 1) {
|
||||
let filter = "?";
|
||||
for (const key in this.filter) {
|
||||
if (this.filter.hasOwnProperty(key)) {
|
||||
filter += `${key}=${this.filter[key]}&`;
|
||||
}
|
||||
}
|
||||
filter += page ? `page=${page}` : `page=1`;
|
||||
const result = await ApiService.get(urls.listTestType(filter));
|
||||
if (result && result.status == 200) {
|
||||
this.items = result.data.data.data;
|
||||
this.currentPage = result.data.data.current_page;
|
||||
this.lastPage = result.data.data.last_page;
|
||||
}
|
||||
},
|
||||
async remove(id) {
|
||||
const result = await ApiService.delete(urls.deleteTestType(id));
|
||||
if (result.status == 200) {
|
||||
for (const key in this.items) {
|
||||
if (
|
||||
this.items.hasOwnProperty(key) &&
|
||||
this.items[key].id == id
|
||||
) {
|
||||
this.items.splice(key, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
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 }
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
currentPage(page) {
|
||||
this.load(page);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="css" scoped>
|
||||
.WM-ActionButton {
|
||||
padding: 8px 22px;
|
||||
padding: 8px 22px;
|
||||
}
|
||||
.v-btn--floating {
|
||||
padding: 0!important;
|
||||
padding: 0!important;
|
||||
}
|
||||
.theme--light.v-btn.v-btn--flat {
|
||||
color: rgba(0,0,0,.87)!important;
|
||||
color: rgba(0,0,0,.87)!important;
|
||||
}
|
||||
.v-btn--floating, .v-btn--icon:before {
|
||||
border-radius: 50%!important;
|
||||
border-radius: 50%!important;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user