WIP MMCM
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
|
||||
<div class="step_title">{{ picker.title }}</div>
|
||||
<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"
|
||||
monthNameFormat="long" format="dd MMMM yyyy" :minDate="picker.minDate"
|
||||
:enableTimePicker="false"
|
||||
@@ -41,6 +41,7 @@ export default {
|
||||
let pickerList = []
|
||||
if (store.needPrescriptionDateCollect) {
|
||||
pickerList.push(reactive({
|
||||
id: 1,
|
||||
title: 'Date de collecte de l\'ordonnance :',
|
||||
vModel: dateCollect,
|
||||
error: false,
|
||||
@@ -49,6 +50,7 @@ export default {
|
||||
}
|
||||
|
||||
pickerList.push(reactive({
|
||||
id: 2,
|
||||
title: 'Date de livraison des médicaments :',
|
||||
vModel: dateDelivery,
|
||||
error: false,
|
||||
@@ -75,6 +77,21 @@ export default {
|
||||
if (this.pickerList.filter(p => p.error).length === 0) {
|
||||
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