- aggiunta campi Gas data + fix

This commit is contained in:
Surya Paolo
2023-12-28 23:48:09 +01:00
parent ed76b9c1dd
commit 42d37d8209
11 changed files with 61 additions and 12 deletions

View File

@@ -70,6 +70,8 @@ export default defineComponent({
const timerInterval = ref(<any>null)
const timerLabelScadenza = ref('')
const labelDataRitiro = ref('')
const labelDataArrivoMerce = ref('')
const openlistorders = ref(false)
const endload = ref(false)
@@ -137,6 +139,7 @@ export default defineComponent({
const mygas = gasordine
if (mygas)
return mygas.name + ' (' + mygas.city + ') ' + t('gas.dataora_chiusura_ordini') + ': ' + tools.getstrDateShort(mygas.dataora_chiusura_ordini)
+ ' ' + t('gas.data_arrivo_merce') + ': ' + tools.getstrDateShort(mygas.data_arrivo_merce)
+ ' ' + t('gas.dataora_ritiro') + ': ' + tools.getstrDateShort(mygas.dataora_ritiro)
else
return ''
@@ -220,11 +223,19 @@ export default defineComponent({
})
watch(() => gasordineSelected.value, (newval, oldval) => {
myorder.idGasordine = newval
recgasordineSelected.value = myproduct.value.gasordines.find((rec: any) => rec._id === gasordineSelected.value)
if (newval) {
myorder.idGasordine = newval
recgasordineSelected.value = myproduct.value.gasordines.find((rec: any) => rec._id === gasordineSelected.value)
updateLabel()
}
})
function updateLabel() {
//labelDataRitiro.value = tools.getstrDateTime(recgasordineSelected.value.dataora_ritiro)
labelDataArrivoMerce.value = tools.getstrDateShort(recgasordineSelected.value.data_arrivo_merce)
labelDataRitiro.value = tools.getstrDateTime(recgasordineSelected.value.dataora_ritiro)
}
function mounted() {
load()
// Start the timer when the component is mounted
@@ -264,7 +275,7 @@ export default defineComponent({
if (myproduct.value.gasordines && myproduct.value.gasordines.length === 1) {
myorder.idGasordine = myproduct.value.gasordines[0]._id
gasordineSelected.value = myorder.idGasordine!
}
}
const ord = products.getOrderProductInCart(myproduct.value._id)
if (ord) {
@@ -274,6 +285,7 @@ export default defineComponent({
if (ord.idGasordine) {
gasordineSelected.value = ord.idGasordine!
recgasordineSelected.value = myproduct.value.gasordines.find((rec: IGasordine) => rec._id === ord.idGasordine!)
updateLabel()
}
// Seleziona il Negozio che avevo già scelto nell'ordine !
@@ -284,6 +296,7 @@ export default defineComponent({
if (gasordineSelected.value) {
recgasordineSelected.value = myproduct.value.gasordines.find((rec: IGasordine) => rec._id === gasordineSelected.value)
updateLabel()
}
}
@@ -355,6 +368,8 @@ export default defineComponent({
getGasordines,
recgasordineSelected,
timerLabelScadenza,
labelDataRitiro,
labelDataArrivoMerce,
}
}
})

View File

@@ -145,6 +145,34 @@
</q-item-label>
</q-item-section>
</q-item>
<q-item v-if="labelDataArrivoMerce">
<q-item-section avatar>
<q-icon color="red" name="fas fa-shipping-fast" />
</q-item-section>
<q-item-section>
<q-item-label>
{{ t('gas.data_arrivo_merce') }}
</q-item-label>
<q-item-label class="countdown_scadenza">
{{ labelDataArrivoMerce }}
</q-item-label>
</q-item-section>
</q-item>
<q-item v-if="labelDataRitiro">
<q-item-section avatar>
<q-icon color="green" name="fas fa-people-carry" />
</q-item-section>
<q-item-section>
<q-item-label>
{{ t('gas.dataora_ritiro') }}
</q-item-label>
<q-item-label class="countdown_scadenza">
{{ labelDataRitiro }}
</q-item-label>
</q-item-section>
</q-item>
</q-list>
<div v-if="true">
<div v-if="complete && myproduct.producer && myproduct.producer.city">
@@ -249,7 +277,7 @@
<div
class="text-blue text-title row items-center q-mr-md centeritems"
>
<q-icon size="sm" name="fas fa-shipping-fast" class="q-mr-sm" />
<q-icon size="sm" name="fas fa-people-carry" class="q-mr-sm" />
{{ t('products.ritiro_presso') }}:
</div>
<div