This commit is contained in:
@@ -39,7 +39,7 @@
|
||||
<v-data-table
|
||||
:headers="headerList"
|
||||
:items="itemList"
|
||||
item-key="id"
|
||||
item-key="index"
|
||||
v-model="selectedRow"
|
||||
class="elevation-1"
|
||||
disable-pagination
|
||||
@@ -122,7 +122,7 @@ export default {
|
||||
|
||||
methods: {
|
||||
newItem() {
|
||||
this.pvm.selectedItemIndex =
|
||||
this.pvm.selectItem(
|
||||
this.value.items.push({
|
||||
id: 0,
|
||||
concurrency: 0,
|
||||
@@ -147,18 +147,21 @@ export default {
|
||||
travels: [],
|
||||
units: [],
|
||||
outsideServices: []
|
||||
}) - 1;
|
||||
}) - 1
|
||||
);
|
||||
},
|
||||
async deleteItem() {
|
||||
if ((await window.$gz.dialog.confirmDelete()) != true) {
|
||||
return;
|
||||
}
|
||||
this.value.items.splice(this.pvm.selectedItemIndex, 1);
|
||||
if (this.value.items.length > 0) {
|
||||
this.pvm.selectedItemIndex = this.value.items.length - 1;
|
||||
} else {
|
||||
this.pvm.selectedItemIndex = null;
|
||||
}
|
||||
this.pvm.selectIndex(null); //select nothing in essence resetting a child selects and this one too clearing form
|
||||
|
||||
// if (this.value.items.length > 0) {
|
||||
// this.pvm.selectedItemIndex = this.value.items.length - 1;
|
||||
// } else {
|
||||
// this.pvm.selectedItemIndex = null;
|
||||
// }
|
||||
},
|
||||
selectItem: function(item) {
|
||||
this.selectedRow = [item];
|
||||
|
||||
Reference in New Issue
Block a user