From 9504bed5dbdcb81f58f6a47c30d55d0399d4b0fe Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Thu, 1 Jul 2021 13:47:26 +0000 Subject: [PATCH] --- .../src/components/work-order-item-parts.vue | 31 ++++++++++++++----- 1 file changed, 23 insertions(+), 8 deletions(-) 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; } + //---- } };