diff --git a/ayanova/devdocs/todo.txt b/ayanova/devdocs/todo.txt index 356bd3e6..b652d583 100644 --- a/ayanova/devdocs/todo.txt +++ b/ayanova/devdocs/todo.txt @@ -21,6 +21,7 @@ OK, I can make it display and take entry the way I want, but - Value comes back as text, I need to parse it whatever the case Maybe I can just allow free form entry and handle parsing, display in my own code?? +What about native components instead?? Find out how to do a currency and other types of numeric input Make the currency and numeric fields work, then do the next stuff below: diff --git a/ayanova/src/api/locale.js b/ayanova/src/api/locale.js index 9fa2ff98..4fa34c5c 100644 --- a/ayanova/src/api/locale.js +++ b/ayanova/src/api/locale.js @@ -54,5 +54,12 @@ export default { "WikiPage", "Duplicate", "RecordHistory" - ] + ], + decimalValidate(required) { + return { required: required, decimal: [2, this.formats.decimalSeparator] }; + }, + formats: { + decimalSeparator: "#", + currencySymbol: "CA$" + } }; diff --git a/ayanova/src/views/inventory-widget-edit.vue b/ayanova/src/views/inventory-widget-edit.vue index 16fbb55b..751049e8 100644 --- a/ayanova/src/views/inventory-widget-edit.vue +++ b/ayanova/src/views/inventory-widget-edit.vue @@ -39,25 +39,15 @@ - - - + + --> - + TEST @@ -101,7 +91,7 @@ /* eslint-disable */ // type="checkbox" //import store from "../store"; -import lt from "../api/locale"; +import locale from "../api/locale"; //import _ from "../utils/libs/lodash.js"; export default { components: {}, @@ -114,7 +104,8 @@ export default { name: "Fantastic Wooden Chips 122", serial: 100, dollarAmount: 584.83, - dollarAmount2: 123.56, + dollarAmount2: 987.65, + dollarAmount3: 123.45, active: true, roles: 8212, startDate: "2019-02-12T10:12:39.594206", @@ -125,12 +116,8 @@ export default { customFields: null, tags: ["brown", "red"] }, - locale:{ - currencySymbol: "CAD", - decimalSeparator: "*" - } - - }; + lc: locale + }; }, beforeRouteEnter(to, from, next) { //Cache all required lt keys @@ -160,39 +147,40 @@ export default { "WidgetCustom14", "WidgetCustom15", "WidgetCustom16" - ].concat(lt.commonKeysEditForm); - lt.fetch(ltKeysRequired).then(() => { + ].concat(locale.commonKeysEditForm); + locale.fetch(ltKeysRequired).then(() => { next(); }); }, - mounted() {}, + mounted() { + //debugger; + }, methods: { - lt: function(key) { - return lt.get(key); - }, + // t: function(key) { + // return locale.get(key); + // }, + // lc: function() { + // return locale; + // }, + // localDecimalValidate: function() { + // return locale.decimalValidate(true); + // //return { required: true, decimal: [2, locale.formats.decimalSeparator] }; + // }, submit() { //alert("VALIDATING>>>"); debugger; console.log(obj.dollarAmount2); - alert(obj.dollarAmount2); + alert(obj.dollarAmount2); this.$validator.validateAll(); - }, - localeDecimalSeparator(){ + clear() { debugger; - return ','; + console.log(this.data().obj.dollarAmount); + alert(data().obj.dollarAmount); }, - localeCurrencySymbol(){ - return 'Eur'; - }, - clear(){ - debugger; - console.log(this.data().obj.dollarAmount2); - alert(data().obj.dollarAmount2); - }, - test(){ - console.log(this.obj.dollarAmount2); - debugger; + test() { + //debugger; + console.log(this.obj.dollarAmount); } } };