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
+22 -18
View File
@@ -2,7 +2,7 @@
<div class>
<v-container fluid>
<material-card class color="black" title="All Cycles" text>
<v-layout align-center wrap class="px-5 my-3">
<v-layout align-center wrap class="px-3 my-3">
<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"
@@ -51,10 +51,10 @@
</router-link>
</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="px-5 my-3">
<v-layout align-center wrap class="px-3 my-3">
<v-flex md12>
<v-data-table :headers="headers" :items="packages" hide-actions>
<template slot="headerCell" slot-scope="{ header }">
@@ -96,7 +96,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') || item.user_id == $store.state.user.id">
<v-icon class="white--text mr-2 caption">fas fa-trash</v-icon>
<span>Remove</span>
@@ -124,13 +124,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="px-3 mt-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>
@@ -189,10 +190,8 @@ export default {
}
this.loadMedicalCenters();
},
async show(testResultId) {
const result = await ApiService.get(
urls.showCycle(testResultId)
);
async show(id) {
const result = await ApiService.get(urls.showCycle(id));
if (result && result.status == 200) {
this.changeCurrentModal({
modal: "modal-cycle-show",
@@ -209,16 +208,21 @@ export default {
});
}
},
async remove(testResultId) {
const result = await ApiService.delete(
urls.removeCycle(testResultId)
);
removeModal(id) {
this.changeCurrentModal({
modal: "modal-delete-delete",
properties: {
success: () => {
this.remove(id);
},
}
});
},
async remove(id) {
const result = await ApiService.delete(urls.removeCycle(id));
if (result && result.status == 200) {
for (const key in this.packages) {
if (
this.packages.hasOwnProperty(key) &&
this.packages[key].id == testResultId
) {
if (this.packages.hasOwnProperty(key) && this.packages[key].id == id) {
this.packages.splice(key, 1);
}
}