This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
clearable
|
||||
@click:clear="onChange('name')"
|
||||
:counter="255"
|
||||
:label="this.$gzlocale.get('WidgetName')"
|
||||
:label="lt('WidgetName')"
|
||||
:rules="[
|
||||
this.$gzform.max255(this, 'name'),
|
||||
this.$gzform.required(this, 'name')
|
||||
@@ -40,7 +40,7 @@
|
||||
clearable
|
||||
@click:clear="onChange('serial')"
|
||||
:counter="10"
|
||||
:label="this.$gzlocale.get('WidgetSerial')"
|
||||
:label="lt('WidgetSerial')"
|
||||
:rules="[this.$gzform.maxLength(this, 'serial', 10)]"
|
||||
:error-messages="this.$gzform.serverErrors(this, 'serial')"
|
||||
ref="serial"
|
||||
@@ -54,7 +54,7 @@
|
||||
clearable
|
||||
@click:clear="onChange('count')"
|
||||
:counter="10"
|
||||
:label="this.$gzlocale.get('WidgetCount')"
|
||||
:label="lt('WidgetCount')"
|
||||
ref="count"
|
||||
:rules="[
|
||||
this.$gzform.integerValid(this, 'count'),
|
||||
@@ -71,8 +71,8 @@
|
||||
<v-text-field
|
||||
v-model="obj.dollarAmount"
|
||||
:readonly="this.formState.readOnly"
|
||||
:prefix="this.$gzlocale.format().currencySymbol"
|
||||
:label="this.$gzlocale.get('WidgetDollarAmount')"
|
||||
:prefix="ltFormat().currencySymbol"
|
||||
:label="lt('WidgetDollarAmount')"
|
||||
ref="dollarAmount"
|
||||
required
|
||||
:rules="[
|
||||
@@ -87,7 +87,7 @@
|
||||
|
||||
<v-flex xs12 sm6 lg4 xl3 px-2>
|
||||
<gz-date-time-picker
|
||||
:label="this.$gzlocale.get('WidgetStartDate')"
|
||||
:label="lt('WidgetStartDate')"
|
||||
v-model="obj.startDate"
|
||||
:readonly="this.formState.readOnly"
|
||||
ref="startDate"
|
||||
@@ -98,7 +98,7 @@
|
||||
|
||||
<v-flex xs12 sm6 lg4 xl3 px-2>
|
||||
<gz-date-time-picker
|
||||
:label="this.$gzlocale.get('WidgetEndDate')"
|
||||
:label="lt('WidgetEndDate')"
|
||||
:rules="[
|
||||
this.$gzform.datePrecedence(this, 'startDate', 'endDate')
|
||||
]"
|
||||
@@ -113,7 +113,7 @@
|
||||
<v-checkbox
|
||||
v-model="obj.active"
|
||||
:readonly="this.formState.readOnly"
|
||||
:label="this.$gzlocale.get('Active')"
|
||||
:label="lt('Active')"
|
||||
ref="active"
|
||||
:error-messages="this.$gzform.serverErrors(this, 'active')"
|
||||
required
|
||||
@@ -127,7 +127,7 @@
|
||||
item-text="name"
|
||||
item-value="id"
|
||||
:readonly="this.formState.readOnly"
|
||||
:label="this.$gzlocale.get('WidgetRoles')"
|
||||
:label="lt('WidgetRoles')"
|
||||
ref="roles"
|
||||
:rules="[
|
||||
this.$gzform.integerValid(this, 'roles'),
|
||||
@@ -143,7 +143,7 @@
|
||||
<v-textarea
|
||||
v-model="obj.notes"
|
||||
:readonly="this.formState.readOnly"
|
||||
:label="this.$gzlocale.get('WidgetNotes')"
|
||||
:label="lt('WidgetNotes')"
|
||||
:error-messages="this.$gzform.serverErrors(this, 'notes')"
|
||||
ref="notes"
|
||||
@change="onChange('notes')"
|
||||
@@ -153,7 +153,7 @@
|
||||
|
||||
<v-flex xs12 px-2>
|
||||
<gz-tag-picker
|
||||
:label="this.$gzlocale.get('Tags')"
|
||||
:label="lt('Tags')"
|
||||
v-model="obj.tags"
|
||||
:readonly="this.formState.readOnly"
|
||||
ref="tags"
|
||||
@@ -389,6 +389,12 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
lt(ltKey) {
|
||||
return window.$gz.locale.get(ltKey);
|
||||
},
|
||||
ltFormat() {
|
||||
return window.$gz.locale.format();
|
||||
},
|
||||
onChange(ref) {
|
||||
if (!this.formState.loading && !this.formState.readOnly) {
|
||||
this.$gzform.onChange(this, ref);
|
||||
@@ -403,7 +409,7 @@ export default {
|
||||
var vm = this;
|
||||
this.$gzform.deleteAllErrorBoxErrors(this);
|
||||
|
||||
this.$gzapi
|
||||
window.$gz.api
|
||||
.get(url)
|
||||
.then(res => {
|
||||
if (res.error != undefined) {
|
||||
@@ -450,7 +456,7 @@ export default {
|
||||
|
||||
//clear any errors vm might be around from previous submit
|
||||
this.$gzform.deleteAllErrorBoxErrors(this);
|
||||
this.$gzapi
|
||||
window.$gz.api
|
||||
.upsert(url, this.obj)
|
||||
.then(res => {
|
||||
vm.formState.loading = false;
|
||||
@@ -504,7 +510,7 @@ export default {
|
||||
var url = FORM_BASE_URL + vm.$route.params.id;
|
||||
|
||||
vm.$gzform.deleteAllErrorBoxErrors(vm);
|
||||
vm.$gzapi
|
||||
window.$gz.api
|
||||
.remove(url)
|
||||
.then(res => {
|
||||
if (res.error != undefined) {
|
||||
@@ -538,7 +544,7 @@ export default {
|
||||
|
||||
//clear any errors vm might be around from previous submit
|
||||
this.$gzform.deleteAllErrorBoxErrors(this);
|
||||
this.$gzapi
|
||||
window.$gz.api
|
||||
.duplicate(url)
|
||||
.then(res => {
|
||||
// debugger;
|
||||
@@ -549,7 +555,10 @@ export default {
|
||||
} else {
|
||||
//Navigate to new record
|
||||
vm.$router.push(
|
||||
vm.$gzapi.replaceAfterLastSlash(vm.$route.fullPath, res.data.id)
|
||||
window.$gz.api.replaceAfterLastSlash(
|
||||
vm.$route.fullPath,
|
||||
res.data.id
|
||||
)
|
||||
);
|
||||
}
|
||||
})
|
||||
@@ -612,7 +621,7 @@ function generateMenu(vm) {
|
||||
var menuOptions = {
|
||||
isMain: false,
|
||||
icon: "fa-splotch",
|
||||
title: vm.$gzlocale.get("Widget"),
|
||||
title: window.$gz.locale.get("Widget"),
|
||||
helpUrl: "intro/#searching",
|
||||
formData: { formKey: FORM_KEY, ayaType: window.$gz.type.Widget },
|
||||
menuItems: []
|
||||
@@ -620,7 +629,7 @@ function generateMenu(vm) {
|
||||
|
||||
if (vm.rights.change) {
|
||||
menuOptions.menuItems.push({
|
||||
title: vm.$gzlocale.get("Save"),
|
||||
title: window.$gz.locale.get("Save"),
|
||||
icon: "save",
|
||||
surface: true,
|
||||
key: FORM_KEY + ":save",
|
||||
@@ -630,7 +639,7 @@ function generateMenu(vm) {
|
||||
|
||||
if (vm.rights.delete) {
|
||||
menuOptions.menuItems.push({
|
||||
title: vm.$gzlocale.get("Delete"),
|
||||
title: window.$gz.locale.get("Delete"),
|
||||
icon: "trash-alt",
|
||||
surface: true,
|
||||
key: FORM_KEY + ":delete",
|
||||
@@ -640,7 +649,7 @@ function generateMenu(vm) {
|
||||
|
||||
if (vm.rights.change) {
|
||||
menuOptions.menuItems.push({
|
||||
title: vm.$gzlocale.get("Duplicate"),
|
||||
title: window.$gz.locale.get("Duplicate"),
|
||||
icon: "clone",
|
||||
key: FORM_KEY + ":duplicate",
|
||||
vm: vm
|
||||
@@ -650,7 +659,7 @@ function generateMenu(vm) {
|
||||
//STUB REPORTS
|
||||
|
||||
menuOptions.menuItems.push({
|
||||
title: vm.$gzlocale.get("Print"),
|
||||
title: window.$gz.locale.get("Print"),
|
||||
icon: "print",
|
||||
key: FORM_KEY + ":report",
|
||||
vm: vm
|
||||
@@ -680,12 +689,14 @@ function initForm(vm) {
|
||||
//
|
||||
//
|
||||
function populatePickLists(vm) {
|
||||
return vm.$gzapi.get("AyaEnumPickList/list/authorizationroles").then(res => {
|
||||
if (res.error) {
|
||||
throw res.error;
|
||||
}
|
||||
vm.pickLists.roles = res.data;
|
||||
});
|
||||
return window.$gz.api
|
||||
.get("AyaEnumPickList/list/authorizationroles")
|
||||
.then(res => {
|
||||
if (res.error) {
|
||||
throw res.error;
|
||||
}
|
||||
vm.pickLists.roles = res.data;
|
||||
});
|
||||
}
|
||||
|
||||
//////////////////////
|
||||
@@ -721,7 +732,7 @@ function populatePickLists(vm) {
|
||||
// "WidgetCustom16"
|
||||
// ];
|
||||
|
||||
// return vm.$gzlocale.fetch(ltKeysRequired);
|
||||
// return window.$gz.locale.fetch(ltKeysRequired);
|
||||
// }
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user