fix : style & resposive

This commit is contained in:
zeinab.ashrafi
2025-03-30 11:56:46 +03:30
parent 0fcb9a3b2f
commit 9625674f79
9 changed files with 194 additions and 260 deletions
+35 -59
View File
@@ -6,33 +6,33 @@
<v-flex xs12 sm6 md6 lg3 xl2 class="WM-FlexCenter">
<v-icon class="fa fa-align-left mr-2 WM-Margin-B-8"/>
<v-text-field class="py-3 pr-3" v-model="filter.cycle_id" label="Cycle ID"
color="black"/>
color="black"/>
</v-flex>
<v-flex xs12 sm6 md6 lg3 xl2 class="WM-FlexCenter pl-3">
<v-icon class="fas fa-sort-numeric-up mr-2 WM-Margin-B-8"/>
<v-text-field class="py-3 pr-3" v-model="filter.sterilizer_id" label="Sterilizer ID"
color="black"/>
color="black"/>
</v-flex>
<v-flex xs12 sm6 md6 lg3 xl2 class="WM-FlexCenter pl-3">
<v-icon class="fas fa-sort-numeric-up mr-2 WM-Margin-B-8"/>
<v-text-field class="py-3 pr-3" v-model="filter.cycle_number" label="Cycle Number"
color="black"/>
color="black"/>
</v-flex>
<v-flex xs12 sm6 md6 lg3 xl2 class="WM-FlexCenter pl-3" v-if="$hasRole('Admin')">
<v-icon class="fa fa-hospital-o mr-2 WM-Margin-B-8"/>
<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"
:clearable="true"/>
item-value="id" label="Hospital" color="black" :items="medicalCenters"
:clearable="true"/>
</v-flex>
<v-flex xs12 sm6 md6 lg3 xl2 class="WM-FlexCenter pl-3">
<v-icon class="far fa-calendar-alt mr-2 WM-Margin-B-8"/>
<v-menu lazy :close-on-content-click="true" transition="v-scale-transition" offset-y
v-model="Menu">
v-model="Menu">
<v-text-field style="padding-top:0 !important" required slot="activator" label="Date"
color="black" class="" v-model="filter.date">
color="black" class="" v-model="filter.date">
</v-text-field>
<v-date-picker color="pink" no-title v-model="filter.date"
:date-format="date => new Date(date).toDateString()"/>
:date-format="date => new Date(date).toDateString()"/>
</v-menu>
</v-flex>
<v-spacer/>
@@ -59,10 +59,10 @@
<v-data-table :headers="headers" :items="packages" hide-actions>
<template slot="headerCell" slot-scope="{ header }">
<span class="subheading font-weight-light text-white text--darken-3"
v-text="header.text" />
v-text="header.text"/>
</template>
<template slot="items" slot-scope="{ item }">
<td class="headline font-weight-light">{{ item.id }}</td>
<td class="title font-weight-light">{{ item.id }}</td>
<td class="title font-weight-light">
{{ (item.user && item.user.medical_center) ? item.user.medical_center.name : '' }}
</td>
@@ -73,7 +73,7 @@
<v-tooltip bottom open-on-hover>
<template v-slot:activator="{ on, attrs }">
<v-btn v-bind="attrs" v-on="on" color="cyan" class="mr-2"
@click="show(item.id)">
@click="show(item.id)">
<v-icon class="white--text mr-1 caption">fas fa-eye</v-icon>
<span>Show</span>
</v-btn>
@@ -83,8 +83,8 @@
<v-tooltip bottom open-on-hover>
<template v-slot:activator="{ on, attrs }">
<router-link class="LinkBtn"
v-if="$hasRole('Admin') || item.user_id == $store.state.user.id"
:to="{ name: 'EditCycle', params: { cycle: item.id } }">
v-if="$hasRole('Admin') || item.user_id == $store.state.user.id"
:to="{ name: 'EditCycle', params: { cycle: item.id } }">
<v-btn v-bind="attrs" v-on="on" color="orange" class="mr-2">
<v-icon class="white--text mr-1 caption">fas fa-pen</v-icon>
<span>Edit</span>
@@ -96,8 +96,8 @@
<v-tooltip bottom open-on-hover>
<template v-slot:activator="{ on, attrs }">
<v-btn v-bind="attrs" v-on="on" color="pink" class="WM-ActionButton mr-2"
@click="remove(item.id)"
v-if="$hasRole('Admin') || item.user_id == $store.state.user.id">
@click="remove(item.id)"
v-if="$hasRole('Admin') || item.user_id == $store.state.user.id">
<v-icon class="white--text mr-2 caption">fas fa-times</v-icon>
<span>Remove</span>
</v-btn>
@@ -107,7 +107,7 @@
<v-tooltip bottom open-on-hover>
<template v-slot:activator="{ on, attrs }">
<v-btn v-bind="attrs" v-on="on" color="orange darken-1"
@click="generateBarcode(item.id, 'Cycle')">
@click="generateBarcode(item.id, 'Cycle')">
<v-icon class="white--text mr-1 caption">fas fa-barcode</v-icon>
<span>Generate Barcode</span>
</v-btn>
@@ -122,7 +122,7 @@
<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"/>
:total-visible="6"/>
</div>
<v-layout row wrap align-center justify-center class="mt-3">
<router-link to="/dashboard">
@@ -138,43 +138,19 @@
</template>
<script>
import { ApiService } from "@/services";
import { urls } from "@/config/urls";
import { mapMutations, mapGetters } from "vuex";
import {ApiService} from "@/services";
import {urls} from "@/config/urls";
import {mapMutations, mapGetters} from "vuex";
export default {
data: () => ({
headers: [
{
sortable: true,
text: "Cycle ID",
value: "Cycle ID"
},
{
sortable: true,
text: "Hospital",
value: "Hospital"
},
{
sortable: true,
text: "Sterilizer ID",
value: "Sterilizer ID"
},
{
sortable: false,
text: "Cycle Number",
value: "Cycle Number"
},
{
sortable: false,
text: "Date",
value: "date"
},
{
sortable: false,
text: "Action",
value: "action",
align: "left"
}
{sortable: false, text: "Cycle ID", value: "Cycle ID"},
{sortable: false, text: "Hospital", value: "Hospital"},
{sortable: false, text: "Sterilizer ID", value: "Sterilizer ID"},
{sortable: false, text: "Cycle Number", value: "Cycle Number"},
{sortable: false, text: "Date", value: "date"},
{sortable: false, text: "Action", value: "action", align: "left"}
],
filter: {},
Menu: false,
@@ -197,10 +173,10 @@ export default {
}
filter += (page) ? `page=${page}` : `page=1`;
const result = await ApiService.get(
urls.listCycle(filter)
urls.listCycle(filter)
);
if (result && result.status == 200) {
const { data, meta } = result.data;
const {data, meta} = result.data;
this.packages = data;
this.currentPage = meta.current_page;
this.lastPage = meta.last_page;
@@ -209,12 +185,12 @@ export default {
},
async show(testResultId) {
const result = await ApiService.get(
urls.showCycle(testResultId)
urls.showCycle(testResultId)
);
if (result && result.status == 200) {
this.changeCurrentModal({
modal: "modal-cycle-show",
properties: { result }
properties: {result}
});
}
},
@@ -223,19 +199,19 @@ export default {
if (result && result.status == 200) {
this.changeCurrentModal({
modal: "modal-barcode-barcode",
properties: { result }
properties: {result}
});
}
},
async remove(testResultId) {
const result = await ApiService.delete(
urls.removeCycle(testResultId)
urls.removeCycle(testResultId)
);
if (result && result.status == 200) {
for (const key in this.packages) {
if (
this.packages.hasOwnProperty(key) &&
this.packages[key].id == testResultId
this.packages.hasOwnProperty(key) &&
this.packages[key].id == testResultId
) {
this.packages.splice(key, 1);
}