diff --git a/ayanova/src/components/work-order-item-parts.vue b/ayanova/src/components/work-order-item-parts.vue
index 7188c784..44872179 100644
--- a/ayanova/src/components/work-order-item-parts.vue
+++ b/ayanova/src/components/work-order-item-parts.vue
@@ -21,17 +21,25 @@
{{ $ay.t("New") }}
+
+
+ $ayiTrashRestoreAlt
+
+ {{ $ay.t("Undelete") }}
+
$ayiTrashAlt
{{ $ay.t("SoftDelete") }}
-
+
- $ayiTrashRestoreAlt
+ $ayiTrashAlt
- {{ $ay.t("Undelete") }}
+ {{
+ $ay.t("SoftDeleteAll")
+ }}
@@ -530,6 +538,13 @@ export default {
this.setDefaultView();
this.$emit("change");
},
+ deleteAllItem() {
+ this.value.items[this.activeWoItemIndex].parts.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].parts.length == 1) {
@@ -836,12 +851,12 @@ export default {
return this.pvm.rights.change && this.pvm.subRights.parts.create;
},
canDelete: function() {
- return (
- this.activeItemIndex != null &&
- this.pvm.rights.change &&
- this.pvm.subRights.parts.delete
- );
+ return this.activeItemIndex != null && this.canDeleteAll;
+ },
+ canDeleteAll: function() {
+ return this.pvm.rights.change && this.pvm.subRights.parts.delete;
}
+
//----
}
};