|
@@ -5,7 +5,7 @@
|
|
|
hr
|
|
|
.payment-amount-item
|
|
|
label.payment-label Monto entregado
|
|
|
- input.payment-input
|
|
|
+ input.payment-input(:value="paid" v-model="paid" autofocus)
|
|
|
.payment-credit-form-separator
|
|
|
h3 Pagos Pendientes
|
|
|
hr
|
|
@@ -18,16 +18,36 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import { mapGetters } from 'vuex'
|
|
|
+ import { mapGetters, mapActions } from 'vuex'
|
|
|
|
|
|
export default {
|
|
|
- computed: mapGetters([
|
|
|
- 'total'
|
|
|
- ]),
|
|
|
+ computed: {
|
|
|
+ paid: {
|
|
|
+ get() {
|
|
|
+ return accounting.formatMoney(this.amountPaid, this.currencySymbol, 0, '.', ',')
|
|
|
+ },
|
|
|
+ set(value) {
|
|
|
+ value = accounting.unformat(value, ',')
|
|
|
+
|
|
|
+ this.changeAmountPaid(value)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ ...mapGetters([
|
|
|
+ 'total',
|
|
|
+ 'currencySymbol',
|
|
|
+ 'amountPaid'
|
|
|
+ ])
|
|
|
+ },
|
|
|
methods: {
|
|
|
formatTotal() {
|
|
|
return accounting.formatMoney(this.total, this.currencySymbol, 0, '.', ',')
|
|
|
- }
|
|
|
+ },
|
|
|
+ ...mapActions([
|
|
|
+ 'changeAmountPaid'
|
|
|
+ ])
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.changeAmountPaid(0)
|
|
|
}
|
|
|
}
|
|
|
</script>
|