fix : update delete confirmation modal and test result style

This commit is contained in:
zeinab.ashrafi
2025-04-21 14:27:47 +03:30
parent 69e44905ff
commit 32e8bb910f
13 changed files with 149 additions and 267 deletions
+14 -17
View File
@@ -176,7 +176,7 @@ export default {
this.load();
},
methods: {
...mapMutations("modal", ["changeCurrentModal"]),
...mapMutations("modal", ["changeCurrentModal", "closeModal"]),
async load(page = 1) {
let filter = '?';
for (const key in this.filter) {
@@ -216,23 +216,20 @@ export default {
},
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 == id) {
this.packages.splice(key, 1);
modal: "modal-user-confirmation",
properties: {width: '30'},
success: async () => {
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 == id) {
this.packages.splice(key, 1);
}
}
}
}
}
this.closeModal();
},
});
},
async loadMedicalCenters() {
const result = await ApiService.get(urls.listFilterItemsTestResult);
+14 -17
View File
@@ -191,7 +191,7 @@ export default {
this.load();
},
methods: {
...mapMutations("modal", ["changeCurrentModal"]),
...mapMutations("modal", ["changeCurrentModal", "closeModal"]),
async load(page = 1) {
let filter = '?';
for (const key in this.filter) {
@@ -228,23 +228,20 @@ export default {
},
removeModal(id) {
this.changeCurrentModal({
modal: "modal-delete-delete",
properties: {
success: () => {
this.remove(id);
},
}
});
},
async remove(id) {
const result = await ApiService.delete(urls.removeItem(id));
if (result && result.status == 200) {
for (const key in this.items) {
if (this.items.hasOwnProperty(key) && this.items[key].id == id) {
this.items.splice(key, 1);
modal: "modal-user-confirmation",
properties: {width: '30'},
success: async () => {
const result = await ApiService.delete(urls.removeItem(id));
if (result && result.status == 200) {
for (const key in this.items) {
if (this.items.hasOwnProperty(key) && this.items[key].id == id) {
this.items.splice(key, 1);
}
}
}
}
}
this.closeModal();
},
});
},
async loadMedicalCenters() {
const result = await ApiService.get(urls.listFilterItemsTestResult);
+15 -15
View File
@@ -174,7 +174,7 @@ export default {
this.load();
},
methods: {
...mapMutations("modal", ["changeCurrentModal"]),
...mapMutations("modal", ["changeCurrentModal", "closeModal"]),
async load(page = 1) {
let filter = "?";
for (const key in this.filter) {
@@ -215,23 +215,23 @@ export default {
},
removeModal(id) {
this.changeCurrentModal({
modal: "modal-delete-delete",
properties: {
success: () => {
this.remove(id);
},
}
modal: "modal-user-confirmation",
properties: {width: '30'},
success: async () => {
const result = await ApiService.delete(urls.removeLabel(id));
if (result && result.status == 200) {
for (const key in this.items) {
if (this.items.hasOwnProperty(key) && this.items[key].id == id) {
this.items.splice(key, 1);
}
}
}
this.closeModal();
},
});
},
async remove(id) {
const result = await ApiService.delete(urls.removeLabel(id));
if (result && 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));
-10
View File
@@ -130,16 +130,6 @@ export default {
this.lastPage = result.data.data.last_page;
},
removeModal(id) {
this.changeCurrentModal({
modal: "modal-delete-delete",
properties: {
success: () => {
this.remove(id);
},
}
});
},
async remove(id) {
this.changeCurrentModal({
modal: "modal-user-confirmation",
properties: {width: '30'},
+14 -17
View File
@@ -211,7 +211,7 @@ export default {
},
methods: {
...mapMutations('myItems', ["SET_FILTER"]),
...mapMutations("modal", ["changeCurrentModal"]),
...mapMutations("modal", ["changeCurrentModal",'closeModal']),
...mapActions('myItems', ['loadMyItem', 'removeItem', 'showItem', 'generateBarcode']),
onFilterClick() {
this.loadMyItem();
@@ -247,23 +247,20 @@ export default {
},
removeModal(id) {
this.changeCurrentModal({
modal: "modal-delete-delete",
properties: {
success: () => {
this.remove(id);
},
}
});
},
async remove(id) {
const result = await ApiService.delete(urls.removeItem(id));
if (result && result.status == 200) {
for (const key in this.items) {
if (this.items.hasOwnProperty(key) && this.items[key].id == id) {
this.items.splice(key, 1);
modal: "modal-user-confirmation",
properties: {width: '30'},
success: async () => {
const result = await ApiService.delete(urls.removeItem(id));
if (result && result.status == 200) {
for (const key in this.items) {
if (this.items.hasOwnProperty(key) && this.items[key].id == id) {
this.items.splice(key, 1);
}
}
}
}
}
this.closeModal();
},
});
},
async loadMedicalCenters() {
const result = await ApiService.get(urls.listFilterItemsTestResult);
+14 -17
View File
@@ -189,7 +189,7 @@ export default {
this.load();
},
methods: {
...mapMutations("modal", ["changeCurrentModal"]),
...mapMutations("modal", ["changeCurrentModal", "closeModal"]),
async load(page = 1) {
let filter = '?';
for (const key in this.filter) {
@@ -218,23 +218,20 @@ export default {
},
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 == id) {
this.items.splice(key, 1);
modal: "modal-user-confirmation",
properties: {width: '30'},
success: async () => {
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 == id) {
this.items.splice(key, 1);
}
}
}
}
}
this.closeModal();
},
});
},
async generateBarcode(id, type) {
const result = await ApiService.post(urls.Barcode(id, type));
+15 -18
View File
@@ -192,7 +192,7 @@ export default {
this.load();
},
methods: {
...mapMutations("modal", ["changeCurrentModal"]),
...mapMutations("modal", ["changeCurrentModal",'closeModal']),
async load(page = 1) {
let filter = '?';
for (const key in this.filter) {
@@ -221,25 +221,22 @@ export default {
});
}
},
removeModal(id) {
removeModal(testResultId) {
this.changeCurrentModal({
modal: "modal-delete-delete",
properties: {
success: () => {
this.remove(id);
},
}
});
},
async remove(testResultId) {
const result = await ApiService.delete(urls.removePackage(testResultId));
if (result && result.status == 200) {
for (const key in this.items) {
if (this.items.hasOwnProperty(key) && this.items[key].id == testResultId) {
this.items.splice(key, 1);
modal: "modal-user-confirmation",
properties: {width: '30'},
success: async () => {
const result = await ApiService.delete(urls.removePackage(testResultId));
if (result && result.status == 200) {
for (const key in this.items) {
if (this.items.hasOwnProperty(key) && this.items[key].id == testResultId) {
this.items.splice(key, 1);
}
}
}
}
}
this.closeModal();
},
});
},
async generateBarcode(id, type) {
const result = await ApiService.post(urls.Barcode(id, type));
+4 -4
View File
@@ -52,8 +52,7 @@
/>
</v-flex> -->
<v-flex xs12 sm2 md2>
<v-menu
lazy
<v-menu lazy style="z-index: 12;"
:close-on-content-click="true"
transition="v-scale-transition"
offset-y
@@ -67,7 +66,7 @@
v-model="formData.date"
color="black"/>
<v-date-picker
min="2020-01-01"
:min="today"
color="pink"
no-title
v-model="formData.date"
@@ -423,6 +422,7 @@ export default {
'wm-Dropzone': Dropzone,
},
data: () => ({
today : new Date().toISOString().substr(0, 10),
galleryDataLoaded: false,
galleries: [],
file_batch_id: Math.floor(Math.random() * 9000000000) + 1000000000,
@@ -442,7 +442,7 @@ export default {
result: "Reject",
img: null,
test_type_id: "",
date: "2020-01-01"
date: new Date().toISOString().substr(0, 10),
},
images: [],
menu: "",
+14 -17
View File
@@ -280,7 +280,7 @@ export default {
}
},
methods: {
...mapMutations("modal", ["changeCurrentModal"]),
...mapMutations("modal", ["changeCurrentModal", "closeModal"]),
async load(page = 1, verified = null) {
let filter = '?';
for (const key in this.filter) {
@@ -313,23 +313,20 @@ export default {
},
removeModal(id) {
this.changeCurrentModal({
modal: "modal-delete-delete",
properties: {
success: () => {
this.remove(id);
},
}
});
},
async remove(id) {
const result = await ApiService.delete(urls.removeTestResult(id));
if (result && result.status == 200) {
for (const key in this.items) {
if (this.items.hasOwnProperty(key) && this.items[key].id == id) {
this.items.splice(key, 1);
modal: "modal-user-confirmation",
properties: {width: '30'},
success: async () => {
const result = await ApiService.delete(urls.removeTestResult(id));
if (result && result.status == 200) {
for (const key in this.items) {
if (this.items.hasOwnProperty(key) && this.items[key].id == id) {
this.items.splice(key, 1);
}
}
}
}
}
this.closeModal();
},
});
},
async fillSelectFilter() {
const result = await ApiService.get(urls.listFilterItemsTestResult);
+12 -46
View File
@@ -63,12 +63,11 @@
<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 }}
<br>
<span class="WM-Font-14">{{ item.cell_number }}</span>
<td class="title font-weight-light">{{ item.name }}</td>
<td class="title font-weight-light">{{ item.cell_number }}</td>
<td class="title font-weight-light">
<span class="WM-Font-14">{{ $d(new Date(item.created_at), 'long') }}</span>
</td>
<td class="title font-weight-light">{{ $d(new Date(item.created_at), 'long') }}</td>
<td class="title font-weight-light">
<span v-for="(role, key) in item.roles" :key="key">{{ role.name }}</span>
</td>
@@ -153,32 +152,12 @@ export default {
},
data: () => ({
headers: [
{
sortable: true,
text: "Operator",
value: "name"
},
{
sortable: false,
text: "Date",
value: "date"
},
{
sortable: false,
text: "Role",
value: "role"
},
{
sortable: true,
text: "Hospital",
value: "hospital"
},
{
sortable: false,
text: "Action",
value: "action",
align: "right",
}
{sortable: false, text: "Operator", value: "name",width:'25%'},
{sortable: false, text: "Cell Number", value: "cell number"},
{sortable: false, text: "Date", value: "date" ,width:'20%'},
{sortable: false, text: "Role", value: "role"},
{sortable: false, text: "Hospital", value: "hospital"},
{sortable: false, text: "Action", value: "action", align: "right",}
],
filter: {
name: "",
@@ -237,23 +216,10 @@ export default {
properties: {user}
});
},
removeModal(id) {
this.changeCurrentModal({
modal: "modal-delete-delete",
properties: {
success: () => {
this.remove(id);
},
}
});
},
async remove(userId) {
removeModal(userId) {
this.changeCurrentModal({
modal: "modal-user-confirmation",
properties: {
userId,
width: '30'
},
properties: {userId, width: '30'},
success: async () => {
const result = await ApiService.delete(urls.deleteUser(userId));
this.closeModal();