This commit is contained in:
Jonathan Chevalier
2022-11-24 18:11:47 +01:00
parent 07dec08fdd
commit bb0f6cb030
3 changed files with 27 additions and 3 deletions

View File

@@ -82,6 +82,7 @@ export const useMMCMStore = defineStore('counter', {
dateCollect: null,
methodDelivery: 'Main propre',
methodCollect: 'Main propre',
timeSlot : '09h30-11h00',
}),
getters: {
fullAddress: (state) => (state.street !== null) ? state.street + ' ' + state.zipCode + ' ' + state.city : null,
@@ -89,6 +90,7 @@ export const useMMCMStore = defineStore('counter', {
deliveryMethodCode: (state) => state.productList.filter(p => p.id === state.idProduct)[0].ref,
dateDeliveryString: (state) => new Date(state.dateDelivery).toLocaleDateString("fr-FR"),
dateCollectString: (state) => new Date(state.dateCollect).toLocaleDateString("fr-FR"),
displayTimeSlot: (state) => (state.productList.filter(p => p.id === state.idProduct)[0].ref === 'MMCM_EXPRESS') ? 'entre ' +state.timeSlot : 'entre 09h00-17h00',
minDateForDelivery: (state) => (state.productList.filter(p => p.id === state.idProduct)[0].ref === 'MMCM_EXPRESS') ? date.deliveryExpress : date.deliveryFacteur,
minDateForCollect: (state) => (state.productList.filter(p => p.id === state.idProduct)[0].ref === 'MMCM_EXPRESS') ? date.collectExpress : date.collectFacteur,
needPrescriptionDateCollect: (state) => !!(state.productList.filter(p => p.id === state.idProduct)[0].ref === 'MMCM_FACTEUR' && state.withPrescription),
@@ -152,6 +154,9 @@ export const useMMCMStore = defineStore('counter', {
},
setIdProduct(id) {
this.idProduct = id
},
setTimeSlot(timeSlot) {
this.timeSlot = timeSlot
}
},
})