diff --git a/ayanova/src/components/work-order-item-units.vue b/ayanova/src/components/work-order-item-units.vue index 5436773e..dcec8f29 100644 --- a/ayanova/src/components/work-order-item-units.vue +++ b/ayanova/src/components/work-order-item-units.vue @@ -20,6 +20,12 @@ $ayiPlus {{ $ay.t("New") }} + + + + $ayiFan + + {{ $ay.t("UnitList") }} @@ -322,6 +328,56 @@ export default { } }, methods: { + async bulkUnitsSearch() { + this.selectedBulkUnits.splice(0); + this.availableBulkUnits.splice(0); + + let res = await window.$gz.api.post(`unit/bulk-add-selection-list`, { + tags: [], + restrictToCustomerId: null + }); + if (res.error) { + window.$gz.eventBus.$emit( + "notify-warning", + window.$gz.errorHandler.errorToString(res, this) + ); + } else { + this.availableBulkUnits = res.data; + } + }, + addSelectedBulkUnits() { + if (res.data && res.data.items) { + let newIndex = this.value.items[this.activeWoItemIndex].parts.length; + res.data.items.forEach(z => { + newIndex++; + this.value.items[this.activeWoItemIndex].parts.push({ + id: 0, + concurrency: 0, + userId: null, + description: null, + serials: null, + partId: z.partId, + partWarehouseId: this.selectedPartWarehouse, + quantity: z.quantity, + taxPartSaleId: null, + price: 0, + priceOverride: null, + cost: 0, + listPrice: 0, + isDirty: true, + workOrderItemId: this.value.items[this.activeWoItemIndex].id, + uid: Date.now(), + partWarehouseViz: null, + partViz: z.partViz, + taxCodeViz: null + }); + }); + this.$emit("change"); + this.selectedRow = [{ index: newIndex }]; + this.activeItemIndex = newIndex; + } + this.partAssemblyDialog = false; + }, unitChange(newName) { this.value.items[this.activeWoItemIndex].units[ this.activeItemIndex