From 017da903801ff991886e47eb75740bf29f3cddce Mon Sep 17 00:00:00 2001 From: TemuulenBM Date: Thu, 30 Nov 2023 18:00:03 +0800 Subject: [PATCH] created resources of Warehouse dependecies and generated createRecord and updateRecord function --- addon/components/cell/product-info.js | 4 +- addon/components/inventory-form-panel.hbs | 17 +--- addon/components/warehouse-editor.js | 74 +++++++---------- addon/components/warehouse-form-panel.js | 4 - addon/controllers/inventory/index/new.js | 12 ++- addon/controllers/warehouses/index.js | 2 + addon/routes/inventory/index.js | 2 +- addon/serializers/inventory.js | 1 + addon/serializers/warehouse.js | 3 - .../Http/Controllers/InventoryController.php | 27 ++++++ .../Http/Controllers/WarehouseController.php | 60 +++++++++++++- server/src/Http/Resources/Batch.php | 31 +++++++ server/src/Http/Resources/IndexInventory.php | 1 + server/src/Http/Resources/Warehouse.php | 83 +++++++++++++++++++ server/src/Http/Resources/WarehouseAisle.php | 30 +++++++ server/src/Http/Resources/WarehouseBin.php | 30 +++++++ server/src/Http/Resources/WarehouseRack.php | 31 +++++++ .../src/Http/Resources/WarehouseSection.php | 30 +++++++ server/src/Models/Batch.php | 2 + server/src/Models/Inventory.php | 4 + server/src/Models/Warehouse.php | 2 + 21 files changed, 378 insertions(+), 72 deletions(-) create mode 100644 server/src/Http/Resources/Batch.php create mode 100644 server/src/Http/Resources/Warehouse.php create mode 100644 server/src/Http/Resources/WarehouseAisle.php create mode 100644 server/src/Http/Resources/WarehouseBin.php create mode 100644 server/src/Http/Resources/WarehouseRack.php create mode 100644 server/src/Http/Resources/WarehouseSection.php diff --git a/addon/components/cell/product-info.js b/addon/components/cell/product-info.js index 7cb945af..d44a6d64 100644 --- a/addon/components/cell/product-info.js +++ b/addon/components/cell/product-info.js @@ -2,14 +2,14 @@ import Component from '@glimmer/component'; import { action, computed, get } from '@ember/object'; export default class CellProductInfoComponent extends Component { - @computed('args.{column.modelPath,row}') get product() { + @computed('args.row', 'args.column.{modelPath}') get product() { const { column, row } = this.args; if (typeof column?.modelPath === 'string') { return get(row, column.modelPath); } - return row; + return row } @action onClick(event) { diff --git a/addon/components/inventory-form-panel.hbs b/addon/components/inventory-form-panel.hbs index 02488c3f..c7cc5f3e 100644 --- a/addon/components/inventory-form-panel.hbs +++ b/addon/components/inventory-form-panel.hbs @@ -46,21 +46,6 @@ {{model.name}} - - - {{model.name}} - - -