#69 feat(Reconciliation): improve datetime on form.
This commit is contained in:
parent
9aa543662b
commit
bd6d4221b2
@ -8,9 +8,10 @@
|
|||||||
<v-text-field
|
<v-text-field
|
||||||
v-model="reconciliation.datetime"
|
v-model="reconciliation.datetime"
|
||||||
label="Fecha"
|
label="Fecha"
|
||||||
type="date"
|
type="datetime-local"
|
||||||
:rules="[rules.required]"
|
:rules="[rules.required]"
|
||||||
required
|
required
|
||||||
|
readonly
|
||||||
></v-text-field>
|
></v-text-field>
|
||||||
<v-text-field
|
<v-text-field
|
||||||
v-model="reconciliation.cashman"
|
v-model="reconciliation.cashman"
|
||||||
@ -115,6 +116,7 @@
|
|||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.reconciliation.total_cash_purchases = this.totalByMethod('cash');
|
this.reconciliation.total_cash_purchases = this.totalByMethod('cash');
|
||||||
|
this.reconciliation.datetime = this.getCurrentDate();
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
'reconciliation.cash_taken'() {
|
'reconciliation.cash_taken'() {
|
||||||
@ -130,7 +132,15 @@
|
|||||||
},
|
},
|
||||||
updateDiscrepancy() {
|
updateDiscrepancy() {
|
||||||
this.reconciliation.cash_discrepancy = (this.reconciliation.total_cash_purchases || 0 ) - (this.reconciliation.cash_taken || 0);
|
this.reconciliation.cash_discrepancy = (this.reconciliation.total_cash_purchases || 0 ) - (this.reconciliation.cash_taken || 0);
|
||||||
}
|
},
|
||||||
|
getCurrentDate() {
|
||||||
|
const today = new Date();
|
||||||
|
const gmtOffSet = -5;
|
||||||
|
const localDate = new Date(today.getTime() + (gmtOffSet * 60 * 60 * 1000));
|
||||||
|
// Formatear la fecha y hora en el formato YYYY-MM-DDTHH:MM
|
||||||
|
const formattedDate = localDate.toISOString().slice(0,16);
|
||||||
|
return formattedDate;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
Reference in New Issue
Block a user