- 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,
}
}
})