mirror of
https://git.meshkee.com/cssd/cssd-front.git
synced 2026-10-13 18:03:35 +03:30
fix : btn colors and filter btns
This commit is contained in:
+58
-56
@@ -2,43 +2,53 @@
|
||||
<div class>
|
||||
<v-container fluid>
|
||||
<material-card class color="black" title="All Items" text>
|
||||
<v-layout align-center wrap class="my-3 px-3">
|
||||
<v-flex xs12 sm4 md4 lg2 xl2 class="WM-FlexCenter">
|
||||
<v-layout align-center wrap class="px-3">
|
||||
<v-flex xs12 sm4 md4 lg2 xl1 class="WM-FlexCenter">
|
||||
<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.item_id" label="Item ID"
|
||||
<v-text-field class="pt-3 pr-3" v-model="filter.item_id" label="Item ID"
|
||||
color="black"/>
|
||||
</v-flex>
|
||||
<v-flex xs12 sm4 md4 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.name" label="Name" color="black"/>
|
||||
<v-text-field class="pt-3 pr-3" v-model="filter.name" label="Name" color="black"/>
|
||||
</v-flex>
|
||||
<v-flex xs12 sm4 md4 lg3 xl2 class="WM-FlexCenter" 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"
|
||||
<v-autocomplete class="pt-3 pr-3" v-model="filter.medical_center_id" item-text="name"
|
||||
item-value="id" label="Hospital" color="black" :items="medicalCenters"
|
||||
:clearable="true"/>
|
||||
</v-flex>
|
||||
<v-flex xs12 sm4 md4 lg2 xl2 class="WM-FlexCenter">
|
||||
<v-flex xs12 sm3 md3 lg2 xl1 class="WM-FlexCenter">
|
||||
<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.size" label="Size" color="black"/>
|
||||
<v-text-field class="pt-3 pr-3" v-model="filter.size" label="Size" color="black"/>
|
||||
</v-flex>
|
||||
<v-flex xs12 sm4 md3 lg2 xl2 class="WM-FlexCenter">
|
||||
<v-flex xs12 sm3 md3 lg2 xl1 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.udi" label="UDI" color="black"/>
|
||||
<v-text-field class="pt-3 pr-3" v-model="filter.udi" label="UDI" color="black"/>
|
||||
</v-flex>
|
||||
<!--btn-->
|
||||
<v-spacer/>
|
||||
<v-flex class xs12 sm6 md6 lg2 xl1>
|
||||
<v-btn class="WM-CyanBlueGradient-BG" style="padding:10px 30px" @click="load()">
|
||||
<v-icon class="white--text mr-2 caption">fas fa-search</v-icon>
|
||||
<span class="white--text">Filter</span>
|
||||
<v-flex xs12 sm6 md6 lg12 xl3 class="WM-Align-R">
|
||||
<v-tooltip bottom open-on-hover>
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<v-btn v-bind="attrs" v-on="on"
|
||||
color="WM-Tooltip-Btn WM-Outline-Btn WM-Border WM-Margin-BT-0 WM-Border-Black mr-2"
|
||||
@click="load()">
|
||||
<v-icon class="black--text caption">fas fa-search</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
<span>Filter</span>
|
||||
</v-tooltip>
|
||||
|
||||
<v-btn class="WM-Outline-Btn WM-Border mr-2 WM-Margin-BT-0 WM-Border-Black" style="padding: 10px 30px;">
|
||||
<v-icon class="black--text mr-2 caption">fas fa-share-square</v-icon>
|
||||
<span class="black--text">EXPORT</span>
|
||||
</v-btn>
|
||||
</v-flex>
|
||||
<v-flex xs12 sm6 md6 lg1 xl1 class="text-xs-right">
|
||||
|
||||
<router-link :to="{ name: 'AddItem' }">
|
||||
<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 class="WM-CyanBlueGradient-BG WM-Margin-BT-0" style="padding:10px 30px">
|
||||
<v-icon class="white--text mr-2 caption">fas fa-plus</v-icon>
|
||||
<span class="white--text">Add</span>
|
||||
</v-btn>
|
||||
</router-link>
|
||||
</v-flex>
|
||||
@@ -74,7 +84,7 @@
|
||||
<v-btn :color="status.color" class="mr-2"
|
||||
@click="changeStatus(item, status.status)" v-bind="attrs"
|
||||
v-on="on">
|
||||
<v-icon class="white--text mr-1 caption">
|
||||
<v-icon :class="`${status.font_color}--text mr-1 caption`">
|
||||
fas {{ status.icon }}
|
||||
</v-icon>
|
||||
<span>{{ status.label }}</span>
|
||||
@@ -85,20 +95,30 @@
|
||||
</template>
|
||||
<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"
|
||||
<v-btn v-bind="attrs" v-on="on" color="light-gray" class="mr-2"
|
||||
@click="show(item.id)">
|
||||
<v-icon class="white--text mr-1 caption">fas fa-eye</v-icon>
|
||||
<v-icon class="black--text mr-1 caption">fas fa-eye</v-icon>
|
||||
<span>Show</span>
|
||||
</v-btn>
|
||||
</template>
|
||||
<span>Show</span>
|
||||
</v-tooltip>
|
||||
<v-tooltip bottom open-on-hover>
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<v-btn class="mr-2" v-bind="attrs" v-on="on" color="light-gray"
|
||||
@click="generateBarcode(item, 'Item')">
|
||||
<v-icon class="black--text mr-2 caption">fas fa-barcode</v-icon>
|
||||
<span class="CSSD-font">Generate Barcode</span>
|
||||
</v-btn>
|
||||
</template>
|
||||
<span>Generate Barcode</span>
|
||||
</v-tooltip>
|
||||
<v-tooltip bottom open-on-hover>
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<router-link class="LinkBtn"
|
||||
v-if="$hasRole('Admin|Supervisor') ||( item.user_id == $store.state.user.id && !['approved', 'rejected'].includes(item.status))"
|
||||
:to="{ name: 'EditItem', params: { Item: item.id } }">
|
||||
<v-btn v-bind="attrs" v-on="on" color="orange" class="mr-2">
|
||||
<v-btn v-bind="attrs" v-on="on" color="black" class="mr-2">
|
||||
<v-icon class="white--text mr-1 caption">fas fa-pen</v-icon>
|
||||
<span>Edit</span>
|
||||
</v-btn>
|
||||
@@ -108,7 +128,7 @@
|
||||
</v-tooltip>
|
||||
<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"
|
||||
<v-btn v-bind="attrs" v-on="on" color="red" class="WM-ActionButton mr-2"
|
||||
@click="removeModal(item.id)"
|
||||
v-if="$hasRole('Admin|Supervisor') ||( item.user_id == $store.state.user.id && !['approved', 'rejected'].includes(item.status))">
|
||||
<v-icon class="white--text mr-2 caption">fas fa-trash</v-icon>
|
||||
@@ -117,16 +137,6 @@
|
||||
</template>
|
||||
<span>Remove</span>
|
||||
</v-tooltip>
|
||||
<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, 'Item')">
|
||||
<v-icon class="white--text mr-2 caption">fas fa-barcode</v-icon>
|
||||
<span class="CSSD-font">Generate Barcode</span>
|
||||
</v-btn>
|
||||
</template>
|
||||
<span>Generate Barcode</span>
|
||||
</v-tooltip>
|
||||
</td>
|
||||
</template>
|
||||
</v-data-table>
|
||||
@@ -209,12 +219,17 @@ export default {
|
||||
this.loadMedicalCenters();
|
||||
},
|
||||
async generateBarcode(item, type = null) {
|
||||
const result = await ApiService.post(urls.Barcode(item.id, 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(item.id, type));
|
||||
if (result && result.status == 200) {
|
||||
this.changeCurrentModal({
|
||||
modal: "modal-barcode-barcode",
|
||||
properties: {result, item},
|
||||
});
|
||||
}
|
||||
} else {
|
||||
toast.error('An error occurred while generating the barcode . please first set UDI');
|
||||
}
|
||||
},
|
||||
async show(id) {
|
||||
@@ -252,8 +267,8 @@ export default {
|
||||
getStatus(item) {
|
||||
if (item.status === 'pending') {
|
||||
return [
|
||||
{status: 'rejected', label: 'reject', color: 'red', icon: 'fa-close'},
|
||||
{status: 'approved', label: 'approve', color: 'green', icon: 'fa-check'}
|
||||
{status: 'approved', label: 'approve', color: 'cyan', font_color : 'white', icon: 'fa-check'},
|
||||
{status: 'rejected', label: 'reject', color: 'light-gray',font_color : 'black', icon: 'fa-close'},
|
||||
]
|
||||
} else {
|
||||
const nextStatus = item.status === 'rejected' ? 'approved' : 'rejected'
|
||||
@@ -261,7 +276,8 @@ export default {
|
||||
{
|
||||
status: nextStatus,
|
||||
label: nextStatus === 'approved' ? 'approve' : 'reject',
|
||||
color: nextStatus === 'approved' ? 'green' : 'red',
|
||||
color: nextStatus === 'approved' ? 'cyan' : 'light-gray',
|
||||
font_color: nextStatus === 'approved' ? 'white' : 'black',
|
||||
icon: nextStatus === 'approved' ? 'fa-check' : 'fa-close'
|
||||
}
|
||||
]
|
||||
@@ -284,17 +300,3 @@ export default {
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
.v-btn--floating {
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
.theme--light.v-btn.v-btn--flat {
|
||||
color: rgba(0, 0, 0, .87) !important;
|
||||
}
|
||||
|
||||
.v-btn--floating,
|
||||
.v-btn--icon:before {
|
||||
border-radius: 50% !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user