diff --git a/ayanova/src/components/work-order-item-units.vue b/ayanova/src/components/work-order-item-units.vue
index 313fa736..e3e598e2 100644
--- a/ayanova/src/components/work-order-item-units.vue
+++ b/ayanova/src/components/work-order-item-units.vue
@@ -21,17 +21,25 @@
{{ $ay.t("New") }}
+
+
+ $ayiTrashRestoreAlt
+
+ {{ $ay.t("Undelete") }}
+
$ayiTrashAlt
{{ $ay.t("SoftDelete") }}
-
+
- $ayiTrashRestoreAlt
+ $ayiTrashAlt
- {{ $ay.t("Undelete") }}
+ {{
+ $ay.t("SoftDeleteAll")
+ }}
@@ -327,6 +335,13 @@ export default {
this.setDefaultView();
this.$emit("change");
},
+ deleteAllItem() {
+ this.value.items[this.activeWoItemIndex].units.forEach(
+ z => (z.deleted = true)
+ );
+ this.setDefaultView();
+ this.$emit("change");
+ },
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].units.length == 1) {
@@ -450,11 +465,10 @@ export default {
return this.pvm.rights.change && this.pvm.subRights.units.create;
},
canDelete: function() {
- return (
- this.activeItemIndex != null &&
- this.pvm.rights.change &&
- this.pvm.subRights.units.delete
- );
+ return this.activeItemIndex != null && this.canDeleteAll;
+ },
+ canDeleteAll: function() {
+ return this.pvm.rights.change && this.pvm.subRights.units.delete;
}
}
};