Recherche de Fiche SAV V2
This commit is contained in:
@@ -12,6 +12,7 @@ import FormReply from "@/components/FormReply.vue";
|
||||
import TicketApi from "@/services/TicketApi.js";
|
||||
import FetchIcon from "@/components/base/FetchIcon.vue";
|
||||
import FormSearch from "@/components/FormSearch.vue";
|
||||
import {apiCounter} from "@/setup/global.js";
|
||||
|
||||
const store = useGlobalStore()
|
||||
const storeTicket = useTicketStore();
|
||||
@@ -25,7 +26,7 @@ const {
|
||||
currentTicket,
|
||||
} = storeToRefs(storeTicket)
|
||||
|
||||
const apiCounter = ref(0)
|
||||
|
||||
const archivePeriod = ref('ALL')
|
||||
const archiveFetching = ref(false)
|
||||
|
||||
@@ -177,7 +178,7 @@ const refreshTicketList = async () => {
|
||||
</li>
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link" data-bs-toggle="tab" data-bs-target="#search" type="button">Recherche de fiche <span
|
||||
class="badge text-bg-secondary">0</span></button>
|
||||
class="badge text-bg-secondary">{{ searchTickets.length }}</span></button>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content" id="ticketsListContent">
|
||||
|
||||
@@ -2,31 +2,35 @@
|
||||
import BaseInput from "@/components/BaseElements/BaseInput.vue";
|
||||
import {ref} from "vue";
|
||||
import TicketApi from "@/services/TicketApi.js";
|
||||
import {useTicketStore} from "@/stores/ticket.js";
|
||||
const storeTicket = useTicketStore();
|
||||
import {apiCounter} from "@/setup/global.js";
|
||||
|
||||
const lastName = ref(null)
|
||||
const firstName = ref(null)
|
||||
const email = ref(null)
|
||||
const id = ref(null)
|
||||
const dateFrom = ref(null)
|
||||
const dateTo = ref(null)
|
||||
const lastName = ref('')
|
||||
const firstName = ref('')
|
||||
const email = ref('')
|
||||
const codeFiche = ref('')
|
||||
const dateFrom = ref('')
|
||||
const dateTo = ref('')
|
||||
|
||||
const search =async () => {
|
||||
await TicketApi.searchTickets(lastName.value, firstName.value, email.value, id.value, null, null)
|
||||
storeTicket.ticketList['search_tickets'] = await TicketApi.searchTickets(lastName.value, firstName.value, email.value, codeFiche.value, dateFrom.value, dateTo.value)
|
||||
apiCounter.value++
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="col-lg-4">
|
||||
<base-input label="Nom" :model-value="lastName"></base-input>
|
||||
<base-input label="Prenom" :model-value="firstName"></base-input>
|
||||
<base-input label="Email" :model-value="email" type="email"></base-input>
|
||||
<base-input label="Id Fiche" :model-value="id"></base-input>
|
||||
<base-input label="Nom" v-model="lastName"></base-input>
|
||||
<base-input label="Prenom" v-model="firstName"></base-input>
|
||||
<base-input label="Email" v-model="email" type="email"></base-input>
|
||||
<base-input label="Code Fiche" v-model="codeFiche"></base-input>
|
||||
<button class="btn btn-primary mt-4" @click="search()">Valider</button>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -177,7 +177,7 @@ export default {
|
||||
async archiveTickets(archivePeriod) {
|
||||
return Api.get('TicketingController', 'archiveTickets', '&archivage_from='+archivePeriod)
|
||||
},
|
||||
async searchTickets(lastName, firstName, email, id, dateFrom, dateTo) {
|
||||
return Api.get('TicketingController', 'searchTickets', '&lastName='+lastName+'&firstName='+firstName+'&email='+email+'&id='+id+'&dateFrom='+dateFrom+'&dateTo='+dateTo)
|
||||
async searchTickets(lastName, firstName, email, codeFiche, dateFrom, dateTo) {
|
||||
return Api.get('TicketingController', 'searchTickets', '&lastName='+lastName+'&firstName='+firstName+'&email='+email+'&codeFiche='+codeFiche+'&dateFrom='+dateFrom+'&dateTo='+dateTo)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,8 @@ export const hideModal = ref(0)
|
||||
export const suspens = ref(false)
|
||||
export const messages = ref([])
|
||||
|
||||
export const apiCounter = ref(0)
|
||||
|
||||
export const moveToBottom = async (id) => {
|
||||
await nextTick()
|
||||
const objDiv = document.getElementById(id);
|
||||
|
||||
@@ -11,9 +11,9 @@ export const useTicketStore = defineStore('ticket', {
|
||||
originFilter: 'ALL',
|
||||
idTicket: 0,
|
||||
codeTicket: 0,
|
||||
searchTickets: [],
|
||||
}),
|
||||
getters: {
|
||||
searchTickets: (state) => splitTicketList(state.ticketList, 'search_tickets', state.originFilter),
|
||||
newTickets: (state) => splitTicketList(state.ticketList, 'new_tickets', state.originFilter),
|
||||
pendingTickets: (state) => splitTicketList(state.ticketList, 'pending_tickets', state.originFilter),
|
||||
myTickets: (state) => splitTicketList(state.ticketList, 'my_tickets', state.originFilter),
|
||||
|
||||
Reference in New Issue
Block a user