This commit is contained in:
2021-06-01 18:45:55 +00:00
parent 77c4ec1fb9
commit 8ee2586dda
12 changed files with 58 additions and 13 deletions

View File

@@ -72,7 +72,8 @@
</template>
</v-data-table>
</v-col>
</template>
<template v-if="hasData && hasSelection">
<v-btn
v-if="canDelete && isDeleted"
large
@@ -507,7 +508,10 @@ export default {
},
setDefaultView: function() {
//if only one record left then display it otherwise just let the datatable show what the user can click on
if (this.value.items[this.activeWoItemIndex].expenses.length == 1) {
if (
this.hasData &&
this.value.items[this.activeWoItemIndex].expenses.length == 1
) {
this.selectedRow = [{ index: 0 }];
this.activeItemIndex = 0;
} else {
@@ -722,9 +726,11 @@ export default {
return this.pvm.formCustomTemplateKey;
},
hasData: function() {
return this.value.items[this.activeWoItemIndex].expenses.length > 0;
},
hasSelection: function() {
return this.activeItemIndex != null;
},
canAdd: function() {
return this.pvm.rights.change && this.pvm.subRights.expenses.create;
},

View File

@@ -59,7 +59,8 @@
>
</v-data-table>
</v-col>
</template>
<template v-if="hasData && hasSelection">
<v-btn
v-if="canDelete && isDeleted"
large
@@ -799,6 +800,9 @@ export default {
return this.pvm.formCustomTemplateKey;
},
hasData: function() {
return this.value.items[this.activeWoItemIndex].labors.length > 0;
},
hasSelection: function() {
return this.activeItemIndex != null;
},
canAdd: function() {

View File

@@ -59,7 +59,8 @@
>
</v-data-table>
</v-col>
</template>
<template v-if="hasData && hasSelection">
<v-btn
v-if="canDelete && isDeleted"
large
@@ -822,6 +823,9 @@ export default {
return this.pvm.formCustomTemplateKey;
},
hasData: function() {
return this.value.items[this.activeWoItemIndex].loans.length > 0;
},
hasSelection: function() {
return this.activeItemIndex != null;
},
canAdd: function() {

View File

@@ -59,7 +59,8 @@
>
</v-data-table>
</v-col>
</template>
<template v-if="hasData && hasSelection">
<v-btn
v-if="canDelete && isDeleted"
large
@@ -1025,6 +1026,11 @@ export default {
return this.pvm.formCustomTemplateKey;
},
hasData: function() {
return (
this.value.items[this.activeWoItemIndex].outsideServices.length > 0
);
},
hasSelection: function() {
return this.activeItemIndex != null;
},
canAdd: function() {

View File

@@ -59,7 +59,8 @@
</template>
</v-data-table>
</v-col>
</template>
<template v-if="hasData && hasSelection">
<v-btn
v-if="canDelete && isDeleted"
large
@@ -380,6 +381,9 @@ export default {
return this.pvm.formCustomTemplateKey;
},
hasData: function() {
return this.value.items[this.activeWoItemIndex].partRequests.length > 0;
},
hasSelection: function() {
return this.activeItemIndex != null;
},
// canAdd: function() {

View File

@@ -59,7 +59,8 @@
>
</v-data-table>
</v-col>
</template>
<template v-if="hasData && hasSelection">
<v-btn
v-if="canDelete && isDeleted"
large
@@ -684,6 +685,9 @@ export default {
return this.pvm.formCustomTemplateKey;
},
hasData: function() {
return this.value.items[this.activeWoItemIndex].parts.length > 0;
},
hasSelection: function() {
return this.activeItemIndex != null;
},
canAdd: function() {

View File

@@ -59,7 +59,8 @@
>
</v-data-table>
</v-col>
</template>
<template v-if="hasData && hasSelection">
<v-btn
v-if="canDelete && isDeleted"
large
@@ -522,6 +523,9 @@ export default {
return this.pvm.formCustomTemplateKey;
},
hasData: function() {
return this.value.items[this.activeWoItemIndex].scheduledUsers.length > 0;
},
hasSelection: function() {
return this.activeItemIndex != null;
},
canAdd: function() {

View File

@@ -66,7 +66,8 @@
>
</v-data-table>
</v-col>
</template>
<template v-if="hasData && hasSelection">
<v-btn
v-if="canDelete && isDeleted"
large
@@ -581,6 +582,9 @@ export default {
return this.pvm.formCustomTemplateKey;
},
hasData: function() {
return this.value.items[this.activeWoItemIndex].tasks.length > 0;
},
hasSelection: function() {
return this.activeItemIndex != null;
},
canAdd: function() {

View File

@@ -59,7 +59,8 @@
>
</v-data-table>
</v-col>
</template>
<template v-if="hasData && hasSelection">
<v-btn
v-if="canDelete && isDeleted"
large
@@ -799,6 +800,9 @@ export default {
return this.pvm.formCustomTemplateKey;
},
hasData: function() {
return this.value.items[this.activeWoItemIndex].travels.length > 0;
},
hasSelection: function() {
return this.activeItemIndex != null;
},
canAdd: function() {

View File

@@ -59,7 +59,8 @@
>
</v-data-table>
</v-col>
</template>
<template v-if="hasData && hasSelection">
<v-btn
v-if="canDelete && isDeleted"
large
@@ -452,6 +453,9 @@ export default {
return this.pvm.formCustomTemplateKey;
},
hasData: function() {
return this.value.items[this.activeWoItemIndex].units.length > 0;
},
hasSelection: function() {
return this.activeItemIndex != null;
},
canAdd: function() {