This commit is contained in:
Jonathan Chevalier
2022-10-21 15:28:24 +02:00
parent 725a0228cd
commit 29e052c9f3
3 changed files with 7 additions and 8 deletions

View File

@@ -84,6 +84,7 @@ export const useMMCMStore = defineStore('counter', {
getters: { getters: {
fullAddress: (state) => state.street + ' ' + state.zipCode + ' ' + state.city, fullAddress: (state) => state.street + ' ' + state.zipCode + ' ' + state.city,
deliveryMethod: (state) => state.productList.filter(p => p.id === state.idProduct)[0].name, deliveryMethod: (state) => state.productList.filter(p => p.id === state.idProduct)[0].name,
deliveryMethodCode: (state) => state.productList.filter(p => p.id === state.idProduct)[0].ref,
dateDeliveryString: (state) => new Date(state.dateDelivery).toLocaleDateString("fr-FR"), dateDeliveryString: (state) => new Date(state.dateDelivery).toLocaleDateString("fr-FR"),
dateCollectString: (state) => new Date(state.dateCollect).toLocaleDateString("fr-FR"), dateCollectString: (state) => new Date(state.dateCollect).toLocaleDateString("fr-FR"),
minDateForDelivery: (state) => (state.productList.filter(p => p.id === state.idProduct)[0].ref === 'MMCM_EXPRESS') ? date.deliveryExpress : date.deliveryFacteur, minDateForDelivery: (state) => (state.productList.filter(p => p.id === state.idProduct)[0].ref === 'MMCM_EXPRESS') ? date.deliveryExpress : date.deliveryFacteur,

View File

@@ -50,6 +50,7 @@ export default {
name: "address-check", name: "address-check",
data() { data() {
return { return {
//query: "",
query: "9 Impasse des Peupliers 13008 Marseill", query: "9 Impasse des Peupliers 13008 Marseill",
searchResults: [], searchResults: [],
isSearching: false, isSearching: false,

View File

@@ -7,8 +7,8 @@
<span v-if="store.withPrescription">Oui</span> <span v-if="store.withPrescription">Oui</span>
<span v-else>Non</span> <span v-else>Non</span>
</div> </div>
<div class="mb-2" v-if="store.withPrescription && store.deliveryMethod === 'MMCM_FACTEUR'"><strong>Date de collect <div class="mb-2" v-if="store.withPrescription && store.dateDelivery !== store.dateCollect"><strong>Date de collecte
de l'orodnnance de l'ordonnnce
: </strong>{{ store.dateCollectString }} : </strong>{{ store.dateCollectString }}
</div> </div>
<div class="mb-2"><strong>Date de livraison des medicaments : </strong>{{ store.dateDeliveryString }}</div> <div class="mb-2"><strong>Date de livraison des medicaments : </strong>{{ store.dateDeliveryString }}</div>
@@ -49,17 +49,14 @@ export default {
+ '&city=' + this.store.city + '&city=' + this.store.city
; ;
if (this.store.withPrescription) { if (this.store.withPrescription) {
if (this.store.deliveryMethod === 'MMCM_FACTEUR') { urlApi += '&date_collect=' + ((this.store.dateCollect !== null) ? this.store.dateCollectTimestampInSecond : this.store.dateDeliveryTimestampInSecond)
urlApi += '&date_collect=' + this.store.dateCollectTimestampInSecond
} else {
urlApi += '&date_collect=' + this.store.dateDeliveryTimestampInSecond
}
} }
if (import.meta.env.DEV) { if (import.meta.env.DEV) {
urlApi += '&ID_SESSION=ch6LyRNw';
console.log(urlApi) console.log(urlApi)
urlApi += '&ID_SESSION=0w1YDpPz';
} }
const result = await fetch(urlApi).then(rep => rep.json()) const result = await fetch(urlApi).then(rep => rep.json())