This commit is contained in:
2019-03-11 22:43:10 +00:00
parent a8bc4e5471
commit a6823fff76
3 changed files with 24 additions and 14 deletions

View File

@@ -54,7 +54,8 @@ export default {
"Print",
"WikiPage",
"Duplicate",
"RecordHistory"
"RecordHistory",
"ErrorFieldLengthExceeded"
],
decimalValidate(required) {
return { required: required, decimal: [2, this.formats.decimalSeparator] };

View File

@@ -16,6 +16,7 @@ import dayjs from "dayjs";
import lodash from "./libs/lodash.min.js";
import locale from "./api/locale";
import gzapi from "./api/apiutil";
import gzvalidate from "./api/gzvalidate";
/////////////////////////////////////////////////////////////////
// LIBS AND GLOBAL ITEMS
@@ -25,6 +26,7 @@ Object.defineProperty(Vue.prototype, "$dayjs", { value: dayjs });
Object.defineProperty(Vue.prototype, "$_", { value: lodash });
Object.defineProperty(Vue.prototype, "$gzlocale", { value: locale });
Object.defineProperty(Vue.prototype, "$gzapi", { value: gzapi });
Object.defineProperty(Vue.prototype, "$gzv", { value: gzvalidate });
Object.defineProperty(Vue.prototype, "$gzerror", {
value: errorHandler.handleFormError
});

View File

@@ -1,5 +1,5 @@
<template>
<v-layout>
<v-layout v-if="this.formReady">
<v-flex>
<form>
<v-layout align-center justify-left row wrap>
@@ -17,6 +17,7 @@
v-model="obj.serial"
:counter="10"
:label="this.$gzlocale.get('WidgetSerial')"
:rules="[this.$gzv.MaxLength('WidgetSerial',obj.serial,10)]"
name="serial"
required
></v-text-field>
@@ -90,7 +91,6 @@
required
></v-checkbox>
</v-flex>
</v-layout>
<v-layout align-center justify-space-around row wrap mt-5>
@@ -142,7 +142,13 @@ export default {
"WidgetCustom15",
"WidgetCustom16"
].concat(this.$gzlocale.commonKeysEditForm);
this.$gzlocale.fetch(ltKeysRequired);
this.$gzlocale
.fetch(ltKeysRequired)
.then(() => (this.formReady = true))
.catch(err => {
this.formReady = true;
this.$gzerror(err);
});
},
created() {
this.getDataFromApi();
@@ -151,6 +157,7 @@ export default {
data() {
return {
obj: {},
formReady: false,
theDate: new Date(),
date: new Date().toISOString().substr(0, 10),
menu: false,