fix : pagination of my-items -list packages display item.udi -items details

This commit is contained in:
zeinab.ashrafi
2025-04-30 12:47:32 +03:30
parent 35d8327a77
commit 70b6ce503d
5 changed files with 31 additions and 20 deletions
+23 -13
View File
@@ -31,17 +31,19 @@
<v-flex xs12 sm6 md6 lg2 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-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&#45;&#45;text mr-2 caption">fas fa-share-square</v-icon>
<span class="black&#45;&#45;text">EXPORT</span>
</v-btn>-->
<!-- <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&#45;&#45;text mr-2 caption">fas fa-share-square</v-icon>
<span class="black&#45;&#45;text">EXPORT</span>
</v-btn>-->
<router-link :to="{ name: 'AddItem' }">
<v-btn class="WM-CyanBlueGradient-BG WM-Margin-BT-0" style="padding:10px 30px">
@@ -207,16 +209,22 @@ export default {
items() {
return this.getMyItems;
},
currentPage() {
return this.getCurrentPage;
currentPage: {
get() {
return this.getCurrentPage;
},
set(val) {
this.$store.commit('myItems/SET_MY_ITEMS_CURRENT_PAGE', val);
this.$store.dispatch('myItems/loadMyItem', val);
}
},
lastPage() {
return this.getLastPage;
},
}
},
methods: {
...mapMutations('myItems', ["SET_FILTER"]),
...mapMutations("modal", ["changeCurrentModal",'closeModal']),
...mapMutations("modal", ["changeCurrentModal", 'closeModal']),
...mapActions('myItems', ['loadMyItem', 'removeItem', 'showItem', 'generateBarcode']),
onFilterClick() {
this.loadMyItem();
@@ -281,8 +289,8 @@ export default {
getStatus(item) {
if (item.status === 'pending') {
return [
{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'},
{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'
@@ -307,10 +315,12 @@ export default {
}
}
},
watch: {
currentPage(page) {
this.loadMyItem(page);
},
this.$store.dispatch('myItems/loadMyItem', page);
}
}
};
</script>