This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
<div v-if="formState.ready">
|
||||
<gz-error :error-box-message="formState.errorBoxMessage"></gz-error>
|
||||
<v-form ref="form">
|
||||
{{ obj.items }}
|
||||
<v-row>
|
||||
<v-col cols="12" sm="6" lg="4" xl="3">
|
||||
<v-text-field
|
||||
@@ -50,9 +51,11 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr
|
||||
v-for="(item, index) in itemList"
|
||||
v-for="item in itemList"
|
||||
:key="item.Id"
|
||||
:class="form().childRowErrorClass(thisVm(), 'Items', index)"
|
||||
:class="
|
||||
form().childRowErrorClass(thisVm(), 'Items', item.index)
|
||||
"
|
||||
>
|
||||
<td class="text-left">
|
||||
{{ item.task }}
|
||||
@@ -66,7 +69,7 @@
|
||||
v-if="!formState.readOnly"
|
||||
large
|
||||
icon
|
||||
@click="editItem(index)"
|
||||
@click="editItem(item.index)"
|
||||
class="ml-4"
|
||||
>
|
||||
<v-icon small>
|
||||
@@ -345,6 +348,29 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
addItem: function() {
|
||||
let newIndex = this.obj.items.length;
|
||||
this.editItemIndex =
|
||||
this.obj.items.push({
|
||||
id: 0,
|
||||
taskGroupId: this.obj.id,
|
||||
sequence: newIndex + 1, //indexes are zero based but sequences are visible to user so 1 based
|
||||
task: null
|
||||
}) - 1;
|
||||
|
||||
this.editItemDialog = true;
|
||||
this.formState.dirty = true;
|
||||
},
|
||||
editItem: function(index) {
|
||||
this.editItemIndex = index;
|
||||
this.editItemDialog = true;
|
||||
},
|
||||
deleteItem: function() {
|
||||
this.editItemDialog = false;
|
||||
this.obj.items.splice(this.editItemIndex, 1);
|
||||
this.editItemIndex = -1;
|
||||
this.formState.dirty = true;
|
||||
},
|
||||
canSave: function() {
|
||||
return this.formState.valid && this.formState.dirty;
|
||||
},
|
||||
@@ -639,7 +665,8 @@ async function fetchTranslatedText() {
|
||||
"TaskGroupNotes",
|
||||
"Task",
|
||||
"TaskList",
|
||||
"Sequence"
|
||||
"Sequence",
|
||||
"TaskGroupList"
|
||||
]);
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user