This commit is contained in:
2021-05-24 19:09:28 +00:00
parent da2b01713d
commit d5f961e539
3 changed files with 77 additions and 15 deletions

View File

@@ -10,7 +10,6 @@
}"
:readonly="readonly"
:disabled="disabled"
:clearable="!readonly && canClear"
:label="label"
:rules="rules"
:error-messages="errorMessages"
@@ -20,11 +19,16 @@
</div>
</template>
<script>
/* Xeslint-disable //@click:append-outer="appendOuter"*/
/* Xeslint-disable //@click:append-outer="appendOuter" */
//https://dm4t2.github.io/vue-currency-input/guide/#introduction :value="formattedValue"
//https://codesandbox.io/s/vue-template-kd7d1?fontsize=14&module=%2Fsrc%2FApp.vue
//https://github.com/dm4t2/vue-currency-input
//https://github.com/dm4t2/vue-currency-input/releases
//NOTE: when get sick of this not working, can look into this: https://github.com/phiny1/v-currency-field
//which is purported to be exactly what I'm trying to do here with a v-text-field but better I guess??
//or look at the source for ideas?
import { setValue, parseCurrency } from "vue-currency-input";
export default {
data() {
@@ -41,8 +45,7 @@ export default {
readonly: { type: Boolean, default: false },
disabled: { type: Boolean, default: false },
errorMessages: { type: Array, default: null },
appendOuterIcon: { type: String, default: null },
canClear: { type: Boolean, default: true }
appendOuterIcon: { type: String, default: null }
},
computed: {
currencyValue() {
@@ -60,21 +63,12 @@ export default {
return;
}
let val = this.$refs.textField.$refs.input.value;
// //_value contains the actual underlying numeric value without text
// //value contains the entered text
// if (this.$refs.textField.$refs.input._value == this.value) {
// return;
// }
let parsedValue = parseCurrency(val, {
currency: this.currencyName,
locale: this.languageName
});
// //this.value on init is a very long string of digits / decimal places triggering a variance once rounded
// let parsedOldValue = parseCurrency(this.value.toString(), {
// currency: this.currencyName,
// locale: this.languageName
// });
if (parsedValue != this.value) {
this.$emit("input", parsedValue);
}

View File

@@ -5,7 +5,9 @@
<v-menu offset-y>
<template v-slot:activator="{ on, attrs }">
<div class="text-h6">
<v-icon large color="primary" class="mr-2">$ayiHammer</v-icon>
<v-icon large color="primary" class="mr-2"
>$ayiTruckMonster</v-icon
>
{{ $ay.t("WorkOrderItemTravelList") }}
<v-btn v-if="!parentDeleted" large icon v-bind="attrs" v-on="on">
<v-icon small color="primary">$ayiEllipsisV</v-icon>