WIP MMCM
This commit is contained in:
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
<div class="step_title">{{ picker.title }}</div>
|
<div class="step_title">{{ picker.title }}</div>
|
||||||
<div class="input-group has-validation">
|
<div class="input-group has-validation">
|
||||||
<Datepicker v-model="picker.vModel" autoApply @update:modelValue="picker.error = false" model-type="timestamp"
|
<Datepicker v-model="picker.vModel" autoApply @update:modelValue="pickerUpdate(picker)" model-type="timestamp"
|
||||||
select-text="Choisir" cancel-text="Annuler"
|
select-text="Choisir" cancel-text="Annuler"
|
||||||
monthNameFormat="long" format="dd MMMM yyyy" :minDate="picker.minDate"
|
monthNameFormat="long" format="dd MMMM yyyy" :minDate="picker.minDate"
|
||||||
:enableTimePicker="false"
|
:enableTimePicker="false"
|
||||||
@@ -41,6 +41,7 @@ export default {
|
|||||||
let pickerList = []
|
let pickerList = []
|
||||||
if (store.needPrescriptionDateCollect) {
|
if (store.needPrescriptionDateCollect) {
|
||||||
pickerList.push(reactive({
|
pickerList.push(reactive({
|
||||||
|
id: 1,
|
||||||
title: 'Date de collecte de l\'ordonnance :',
|
title: 'Date de collecte de l\'ordonnance :',
|
||||||
vModel: dateCollect,
|
vModel: dateCollect,
|
||||||
error: false,
|
error: false,
|
||||||
@@ -49,6 +50,7 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pickerList.push(reactive({
|
pickerList.push(reactive({
|
||||||
|
id: 2,
|
||||||
title: 'Date de livraison des médicaments :',
|
title: 'Date de livraison des médicaments :',
|
||||||
vModel: dateDelivery,
|
vModel: dateDelivery,
|
||||||
error: false,
|
error: false,
|
||||||
@@ -75,6 +77,21 @@ export default {
|
|||||||
if (this.pickerList.filter(p => p.error).length === 0) {
|
if (this.pickerList.filter(p => p.error).length === 0) {
|
||||||
this.$router.push({path: '/delivery-option-summary'});
|
this.$router.push({path: '/delivery-option-summary'});
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
pickerUpdate(picker) {
|
||||||
|
picker.error = false
|
||||||
|
|
||||||
|
if (this.pickerList.length > 1 && picker.id === 1) {
|
||||||
|
|
||||||
|
const minDateTs = picker.vModel + 24 * 60 * 60 * 1000
|
||||||
|
|
||||||
|
if(minDateTs > this.pickerList[1].vModel){
|
||||||
|
this.pickerList[1].vModel = null
|
||||||
|
}
|
||||||
|
|
||||||
|
this.pickerList[1].minDate = new Date(minDateTs)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user