This commit is contained in:
2020-03-28 19:52:26 +00:00
parent c559d09cd0
commit 78e1527f0d

View File

@@ -27,7 +27,11 @@
>
</v-select>
</v-col>
template:
{{ obj }}
available fields:
{{ availableFields }}
<!-- <template v-for="item in obj">
<v-col :key="item.key" cols="12" sm="6" lg="4" xl="3" px-2>
<v-card>
@@ -130,6 +134,7 @@ export default {
selectLists: {
pickListTemplates: []
},
availableFields: [],
templateId: 0,
formState: {
ready: false,
@@ -165,29 +170,40 @@ export default {
if (!vm.templateId || vm.templateId == 0) {
return;
}
var url = API_BASE_URL + vm.templateId;
window.$gz.form.deleteAllErrorBoxErrors(vm);
//get available fields
window.$gz.api
.get(url)
.get(API_BASE_URL + "ListFields/" + vm.templateId)
.then(res => {
if (res.error != undefined) {
vm.formState.serverError = res.error;
window.$gz.form.setErrorBoxErrors(vm);
} else {
vm.obj = res.data;
//Update the form status
window.$gz.form.setFormState({
vm: vm,
dirty: false,
valid: true,
loading: false,
readOnly: res.readOnly ? true : false
});
vm.availableFields = res.data;
}
})
.then(
//get current edited template
window.$gz.api.get(API_BASE_URL + vm.templateId).then(res => {
if (res.error != undefined) {
vm.formState.serverError = res.error;
window.$gz.form.setErrorBoxErrors(vm);
} else {
vm.obj = res.data;
//Update the form status
window.$gz.form.setFormState({
vm: vm,
dirty: false,
valid: true,
loading: false,
readOnly: res.readOnly ? true : false
});
}
})
)
.catch(function handleGetDataFromAPIError(error) {
//Update the form status
window.$gz.form.setFormState({