fix : delete confirm modal and style

This commit is contained in:
Ashrafi
2025-04-12 14:30:59 +03:30
parent 47d81a2aa6
commit 90b0e0dc65
25 changed files with 782 additions and 12074 deletions
+23 -14
View File
@@ -2,7 +2,7 @@
<div class>
<v-container fluid>
<material-card class color="black" title="My Packages" text>
<v-layout align-center wrap class="mt-3 px-5">
<v-layout align-center wrap class="mt-3 px-3">
<v-flex xs12 sm6 md4 lg3 xl2 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.package_id" label="Package ID"
@@ -35,10 +35,10 @@
</v-flex>
</v-layout>
<v-layout class="px-4 my-3">
<v-layout class="px-3 my-3">
<v-divider/>
</v-layout>
<v-layout align-center wrap class="my-3 px-5">
<v-layout align-center wrap class="my-3 px-3">
<v-flex md12>
<v-data-table :headers="headers" :items="items" hide-actions>
<template slot="headerCell" slot-scope="{ header }">
@@ -62,9 +62,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">fas {{
status.icon
}}
<v-icon class="white--text mr-1 caption">fas {{ status.icon }}
</v-icon>
<span>{{ status.label }}</span>
</v-btn>
@@ -101,7 +99,7 @@
<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)"
@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>
<span>Remove</span>
@@ -140,13 +138,14 @@
<v-pagination color="black" v-model="currentPage" :length="lastPage"
:total-visible="6"/>
</div>
<v-layout row wrap align-center justify-center class="mt-3">
<v-layout row wrap align-center justify-center class="mt-3 px-3">
<router-link to="/dashboard">
<v-btn class="WM-NoShadow WM-Outline-Btn WM-Border WM-Border-Black ml-5">
<v-btn class="WM-NoShadow WM-Outline-Btn WM-Border WM-Border-Black">
<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-spacer/>
</v-layout>
</material-card>
</v-container>
@@ -208,8 +207,8 @@ export default {
}
this.loadMedicalCenters();
},
async show(testResultId) {
const result = await ApiService.get(urls.showPackage(testResultId));
async show(id) {
const result = await ApiService.get(urls.showPackage(id));
if (result && result.status == 200) {
this.changeCurrentModal({
modal: "modal-package-show",
@@ -217,11 +216,21 @@ export default {
});
}
},
async remove(testResultId) {
const result = await ApiService.delete(urls.removePackage(testResultId));
removeModal(id) {
this.changeCurrentModal({
modal: "modal-delete-delete",
properties: {
success: () => {
this.remove(id);
},
}
});
},
async remove(id) {
const result = await ApiService.delete(urls.removePackage(id));
if (result && result.status == 200) {
for (const key in this.items) {
if (this.items.hasOwnProperty(key) && this.items[key].id == testResultId) {
if (this.items.hasOwnProperty(key) && this.items[key].id == id) {
this.items.splice(key, 1);
}
}