diff --git a/src/app/modules/manufacturing/manufacturing-routing.module.ts b/src/app/modules/manufacturing/manufacturing-routing.module.ts
index bb4972f..a8cf7c1 100644
--- a/src/app/modules/manufacturing/manufacturing-routing.module.ts
+++ b/src/app/modules/manufacturing/manufacturing-routing.module.ts
@@ -3,6 +3,8 @@ import { RouterModule, Routes } from '@angular/router';
import { ManufacturingComponent } from './manufacturing.component';
import { NewdcComponent } from './newdc/newdc.component';
import { NewgrnComponent } from './newgrn/newgrn.component';
+import { PurchaseOrderListComponent } from './purchase-order/purchase-order-list/purchase-order-list.component';
+import { PurchaseOrderComponent } from './purchase-order/purchase-order/purchase-order.component';
import { ViewdcComponent } from './viewdc/viewdc.component';
import { ViewgrnComponent } from './viewgrn/viewgrn.component';
@@ -15,6 +17,8 @@ const routes: Routes = [
{ path: 'viewdc', component: ViewdcComponent },
{ path: 'newgrn', component: NewgrnComponent },
{ path: 'viewgrn', component: ViewgrnComponent },
+ { path: 'purchase-order/purchase-order-list', component: PurchaseOrderListComponent },
+ { path: 'purchase-order/new-purchase-order', component: PurchaseOrderComponent },
{ path: '', redirectTo: 'newdc', pathMatch: 'full' },
],
},
diff --git a/src/app/modules/manufacturing/manufacturing.component.ts b/src/app/modules/manufacturing/manufacturing.component.ts
index c1b2e61..9da69f6 100644
--- a/src/app/modules/manufacturing/manufacturing.component.ts
+++ b/src/app/modules/manufacturing/manufacturing.component.ts
@@ -11,6 +11,7 @@ export class ManufacturingComponent implements OnInit {
{ name: 'View DC', path: '/home/mfg/viewdc' },
{ name: 'New GRN', path: '/home/mfg/newgrn' },
{ name: 'View GRN', path: '/home/mfg/viewgrn' },
+ { name: 'Purchase Order', path: '/home/mfg/purchase-order/purchase-order-list' }
];
constructor() {}
diff --git a/src/app/modules/manufacturing/manufacturing.module.ts b/src/app/modules/manufacturing/manufacturing.module.ts
index ae60dea..fc89040 100644
--- a/src/app/modules/manufacturing/manufacturing.module.ts
+++ b/src/app/modules/manufacturing/manufacturing.module.ts
@@ -1,6 +1,5 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
-
import { ManufacturingRoutingModule } from './manufacturing-routing.module';
import { ManufacturingComponent } from './manufacturing.component';
import { NewdcComponent } from './newdc/newdc.component';
@@ -8,6 +7,11 @@ import { ViewdcComponent } from './viewdc/viewdc.component';
import { NewgrnComponent } from './newgrn/newgrn.component';
import { ViewgrnComponent } from './viewgrn/viewgrn.component';
import { NavbarModule } from 'src/app/shared/navbar/navbar.module';
+import { PurchaseOrderListComponent } from './purchase-order/purchase-order-list/purchase-order-list.component';
+import { PurchaseOrderComponent } from './purchase-order/purchase-order/purchase-order.component';
+import { FormsModule, ReactiveFormsModule } from '@angular/forms';
+import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
+import { NgMultiSelectDropDownModule } from 'ng-multiselect-dropdown';
@NgModule({
@@ -16,12 +20,18 @@ import { NavbarModule } from 'src/app/shared/navbar/navbar.module';
NewdcComponent,
ViewdcComponent,
NewgrnComponent,
- ViewgrnComponent
+ ViewgrnComponent,
+ PurchaseOrderListComponent,
+ PurchaseOrderComponent
],
imports: [
CommonModule,
ManufacturingRoutingModule,
- NavbarModule
+ NavbarModule,
+ NgbModule,
+ ReactiveFormsModule,
+ FormsModule,
+ NgMultiSelectDropDownModule.forRoot()
]
})
export class ManufacturingModule { }
diff --git a/src/app/modules/manufacturing/purchase-order/purchase-order-list/purchase-order-list.component.html b/src/app/modules/manufacturing/purchase-order/purchase-order-list/purchase-order-list.component.html
new file mode 100644
index 0000000..9dbbe19
--- /dev/null
+++ b/src/app/modules/manufacturing/purchase-order/purchase-order-list/purchase-order-list.component.html
@@ -0,0 +1,12 @@
+
+
+
+
Purchase Order
+
+
+
+
+
\ No newline at end of file
diff --git a/src/app/modules/manufacturing/purchase-order/purchase-order-list/purchase-order-list.component.scss b/src/app/modules/manufacturing/purchase-order/purchase-order-list/purchase-order-list.component.scss
new file mode 100644
index 0000000..e69de29
diff --git a/src/app/modules/manufacturing/purchase-order/purchase-order-list/purchase-order-list.component.spec.ts b/src/app/modules/manufacturing/purchase-order/purchase-order-list/purchase-order-list.component.spec.ts
new file mode 100644
index 0000000..937e0be
--- /dev/null
+++ b/src/app/modules/manufacturing/purchase-order/purchase-order-list/purchase-order-list.component.spec.ts
@@ -0,0 +1,25 @@
+import { ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { PurchaseOrderListComponent } from './purchase-order-list.component';
+
+describe('PurchaseOrderListComponent', () => {
+ let component: PurchaseOrderListComponent;
+ let fixture: ComponentFixture;
+
+ beforeEach(async () => {
+ await TestBed.configureTestingModule({
+ declarations: [ PurchaseOrderListComponent ]
+ })
+ .compileComponents();
+ });
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(PurchaseOrderListComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/src/app/modules/manufacturing/purchase-order/purchase-order-list/purchase-order-list.component.ts b/src/app/modules/manufacturing/purchase-order/purchase-order-list/purchase-order-list.component.ts
new file mode 100644
index 0000000..4dfbadf
--- /dev/null
+++ b/src/app/modules/manufacturing/purchase-order/purchase-order-list/purchase-order-list.component.ts
@@ -0,0 +1,21 @@
+import { Component, OnInit } from '@angular/core';
+import { Router } from '@angular/router';
+
+@Component({
+ selector: 'app-purchase-order-list',
+ templateUrl: './purchase-order-list.component.html',
+ styleUrls: ['./purchase-order-list.component.scss']
+})
+export class PurchaseOrderListComponent implements OnInit {
+
+ constructor(private router: Router) { }
+
+ ngOnInit(): void {
+ }
+ navigateToPO(){
+ var previous_url = this.router.url.substr(this.router.url.lastIndexOf('/') + 1) + '$';
+ var current_url = this.router.url.replace( new RegExp(previous_url), 'new-purchase-order' );
+ this.router.navigateByUrl(current_url);
+ }
+
+}
diff --git a/src/app/modules/manufacturing/purchase-order/purchase-order/purchase-order.component.html b/src/app/modules/manufacturing/purchase-order/purchase-order/purchase-order.component.html
new file mode 100644
index 0000000..8cfc25d
--- /dev/null
+++ b/src/app/modules/manufacturing/purchase-order/purchase-order/purchase-order.component.html
@@ -0,0 +1,452 @@
+
+
+
+
+
New Purchase Order
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/app/modules/manufacturing/purchase-order/purchase-order/purchase-order.component.scss b/src/app/modules/manufacturing/purchase-order/purchase-order/purchase-order.component.scss
new file mode 100644
index 0000000..d3af4d6
--- /dev/null
+++ b/src/app/modules/manufacturing/purchase-order/purchase-order/purchase-order.component.scss
@@ -0,0 +1,3 @@
+td {
+ word-break:break-all;
+ }
\ No newline at end of file
diff --git a/src/app/modules/manufacturing/purchase-order/purchase-order/purchase-order.component.spec.ts b/src/app/modules/manufacturing/purchase-order/purchase-order/purchase-order.component.spec.ts
new file mode 100644
index 0000000..f1c76c2
--- /dev/null
+++ b/src/app/modules/manufacturing/purchase-order/purchase-order/purchase-order.component.spec.ts
@@ -0,0 +1,25 @@
+import { ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { PurchaseOrderComponent } from './purchase-order.component';
+
+describe('PurchaseOrderComponent', () => {
+ let component: PurchaseOrderComponent;
+ let fixture: ComponentFixture;
+
+ beforeEach(async () => {
+ await TestBed.configureTestingModule({
+ declarations: [ PurchaseOrderComponent ]
+ })
+ .compileComponents();
+ });
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(PurchaseOrderComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/src/app/modules/manufacturing/purchase-order/purchase-order/purchase-order.component.ts b/src/app/modules/manufacturing/purchase-order/purchase-order/purchase-order.component.ts
new file mode 100644
index 0000000..e2cbf24
--- /dev/null
+++ b/src/app/modules/manufacturing/purchase-order/purchase-order/purchase-order.component.ts
@@ -0,0 +1,114 @@
+import { Component, OnInit, ViewChild } from '@angular/core';
+import { FormBuilder, FormGroup, Validators } from '@angular/forms';
+import { IDropdownSettings } from 'ng-multiselect-dropdown';
+import {NgbTypeahead} from '@ng-bootstrap/ng-bootstrap';
+import {Observable, Subject, merge, OperatorFunction} from 'rxjs';
+import {debounceTime, distinctUntilChanged, filter, map} from 'rxjs/operators';
+import { ToastService } from 'src/app/core/services/toast/toast.service';
+
+const items = [ 'Test Item 1',
+ 'Test Item 2',
+ 'Test Item 3',
+ 'Test Item 4',
+ 'Test Item 5',
+ 'Test Item 6'];
+@Component({
+ selector: 'app-purchase-order',
+ templateUrl: './purchase-order.component.html',
+ styleUrls: ['./purchase-order.component.scss']
+})
+export class PurchaseOrderComponent implements OnInit {
+ poDetailsForm!: FormGroup;
+ itemCommentForm!: FormGroup;
+ itemDetailsSectionCollapsed = false;
+ rowCollapsed = true;
+ commentForm!: FormGroup;
+ lotDropdownSettings!: IDropdownSettings;
+ selectedLot = [];
+ lot_list = [
+ { lot_id: 1, lot_text: 'LOT-0001' },
+ { lot_id: 2, lot_text: 'LOT-0002' },
+ { lot_id: 3, lot_text: 'LOT-0003' },
+ { lot_id: 4, lot_text: 'LOT-0004' },
+ { lot_id: 5, lot_text: 'LOT-0005' }
+ ];
+ itemTableMapping: Array = [];
+ selectedItemRow: any = {};
+ lotTableMapping: Array = [];
+ selectedLotRow: any = {};
+ deliveryTableMapping: Array = [];
+ selectedDeliveryRow: any = {};
+
+ constructor(private fb: FormBuilder, public toast: ToastService) {
+ this.poDetailsForm = this.fb.group({
+ series: ['', [Validators.required]],
+ po_date: ['', [Validators.required]],
+ supplier: ['', [Validators.required]],
+ supplier_address: ['', []],
+ lot: ['', [Validators.required]],
+ delivery_location: ['', []]
+ });
+ this.commentForm = this.fb.group({
+ comment: ['', []]
+ });
+ }
+
+ ngOnInit(): void {
+ this.lotDropdownSettings = {
+ singleSelection: false,
+ idField: 'lot_id',
+ textField: 'lot_text',
+ selectAllText: 'Select All',
+ unSelectAllText: 'UnSelect All',
+ itemsShowLimit: 3,
+ allowSearchFilter: true
+ };
+ }
+
+ @ViewChild('instance', { static: true })
+ instance!: NgbTypeahead;
+ focus$ = new Subject();
+ click$ = new Subject();
+
+ search: OperatorFunction = (text$: Observable) => {
+ const debouncedText$ = text$.pipe(debounceTime(200), distinctUntilChanged());
+ const clicksWithClosedPopup$ = this.click$.pipe(filter(() => !this.instance.isPopupOpen()));
+ const inputFocus$ = this.focus$;
+
+ return merge(debouncedText$, inputFocus$, clicksWithClosedPopup$).pipe(
+ map(term => (term === '' ? items
+ : items.filter(v => v.toLowerCase().indexOf(term.toLowerCase()) > -1)).slice(0, 10))
+ );
+ }
+ addItemTableRow() {
+ this.selectedItemRow['expanded'] = false
+ this.itemTableMapping.push(this.selectedItemRow)
+ this.selectedItemRow = {};
+ }
+ addLotTableRow() {
+ this.lotTableMapping.push(this.selectedLotRow)
+ this.selectedLotRow = {};
+ }
+ addDeliveryTableRow() {
+ this.deliveryTableMapping.push(this.selectedDeliveryRow)
+ this.selectedDeliveryRow = {};
+ }
+ deleteItemTableRow(index: number) {
+ this.itemTableMapping.splice(index, 1);
+ }
+ deleteLotTableRow(index: number) {
+ this.lotTableMapping.splice(index, 1);
+ }
+ deleteDeliveryTableRow(index: number) {
+ this.deliveryTableMapping.splice(index, 1);
+ }
+ submitPo(){
+ if (this.poDetailsForm.invalid) {
+ this.toast.showDanger('Please enter required details');
+ return;
+ }
+ }
+ on_supplier_selection(e: any){
+ this.poDetailsForm.controls['supplier_address'].setValue('123, Test Address');
+ }
+}
\ No newline at end of file
diff --git a/src/app/modules/master/item/item-list/item-list.component.html b/src/app/modules/master/item/item-list/item-list.component.html
new file mode 100644
index 0000000..4e11626
--- /dev/null
+++ b/src/app/modules/master/item/item-list/item-list.component.html
@@ -0,0 +1,12 @@
+
+
+
+
Item
+
+
+
+
+
\ No newline at end of file
diff --git a/src/app/modules/master/item/item-list/item-list.component.scss b/src/app/modules/master/item/item-list/item-list.component.scss
new file mode 100644
index 0000000..e69de29
diff --git a/src/app/modules/master/item/item-list/item-list.component.spec.ts b/src/app/modules/master/item/item-list/item-list.component.spec.ts
new file mode 100644
index 0000000..20727f6
--- /dev/null
+++ b/src/app/modules/master/item/item-list/item-list.component.spec.ts
@@ -0,0 +1,25 @@
+import { ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { ItemListComponent } from './item-list.component';
+
+describe('ItemListComponent', () => {
+ let component: ItemListComponent;
+ let fixture: ComponentFixture;
+
+ beforeEach(async () => {
+ await TestBed.configureTestingModule({
+ declarations: [ ItemListComponent ]
+ })
+ .compileComponents();
+ });
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(ItemListComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/src/app/modules/master/item/item-list/item-list.component.ts b/src/app/modules/master/item/item-list/item-list.component.ts
new file mode 100644
index 0000000..7da2451
--- /dev/null
+++ b/src/app/modules/master/item/item-list/item-list.component.ts
@@ -0,0 +1,21 @@
+import { Component, OnInit } from '@angular/core';
+import { Router } from '@angular/router';
+
+@Component({
+ selector: 'app-item-list',
+ templateUrl: './item-list.component.html',
+ styleUrls: ['./item-list.component.scss']
+})
+export class ItemListComponent implements OnInit {
+
+ constructor(private router: Router) { }
+
+ ngOnInit(): void {
+ }
+ navigateToItem(){
+ var previous_url = this.router.url.substr(this.router.url.lastIndexOf('/') + 1) + '$';
+ var current_url = this.router.url.replace( new RegExp(previous_url), 'new-item' );
+ this.router.navigateByUrl(current_url);
+ }
+
+}
\ No newline at end of file
diff --git a/src/app/modules/master/item/item/item.component.html b/src/app/modules/master/item/item/item.component.html
new file mode 100644
index 0000000..5d38a68
--- /dev/null
+++ b/src/app/modules/master/item/item/item.component.html
@@ -0,0 +1,442 @@
+
+
+
+
+
New Item
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ | Attribute |
+ Attribute Value |
+ Action |
+
+
+
+
+ |
+
+ |
+
+
+
+ |
+
+
+ |
+
+
+ |
+
+ |
+
+
+
+ |
+
+
+ |
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/app/modules/master/item/item/item.component.scss b/src/app/modules/master/item/item/item.component.scss
new file mode 100644
index 0000000..d3af4d6
--- /dev/null
+++ b/src/app/modules/master/item/item/item.component.scss
@@ -0,0 +1,3 @@
+td {
+ word-break:break-all;
+ }
\ No newline at end of file
diff --git a/src/app/modules/master/item/item/item.component.spec.ts b/src/app/modules/master/item/item/item.component.spec.ts
new file mode 100644
index 0000000..0516e6b
--- /dev/null
+++ b/src/app/modules/master/item/item/item.component.spec.ts
@@ -0,0 +1,25 @@
+import { ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { ItemComponent } from './item.component';
+
+describe('ItemComponent', () => {
+ let component: ItemComponent;
+ let fixture: ComponentFixture;
+
+ beforeEach(async () => {
+ await TestBed.configureTestingModule({
+ declarations: [ ItemComponent ]
+ })
+ .compileComponents();
+ });
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(ItemComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/src/app/modules/master/item/item/item.component.ts b/src/app/modules/master/item/item/item.component.ts
new file mode 100644
index 0000000..53976cc
--- /dev/null
+++ b/src/app/modules/master/item/item/item.component.ts
@@ -0,0 +1,189 @@
+import { Component, OnInit, ViewChild } from '@angular/core';
+import { FormBuilder, FormGroup, Validators } from '@angular/forms';
+import { IDropdownSettings } from 'ng-multiselect-dropdown/multiselect.model';
+import {NgbTypeahead} from '@ng-bootstrap/ng-bootstrap';
+import {Observable, Subject, merge, OperatorFunction} from 'rxjs';
+import {debounceTime, distinctUntilChanged, filter, map} from 'rxjs/operators';
+import { ToastService } from 'src/app/core/services/toast/toast.service';
+
+const items = ['Test Item 1',
+ 'Test Item 2',
+ 'Test Item 3',
+ 'Test Item 4',
+ 'Test Item 5',
+ 'Test Item 6'];
+@Component({
+ selector: 'app-item',
+ templateUrl: './item.component.html',
+ styleUrls: ['./item.component.scss']
+})
+export class ItemComponent implements OnInit {
+ itemDetailsForm!: FormGroup;
+ rowCollapsed = true;
+ bomDetailsSectionCollapsed = false;
+ itemAttrDetailsSectionCollapsed = false;
+ uomSectionCollapsed = false;
+ disableAttribute = true;
+ itemAttributeDetails: Array = [];
+ selectedItemAttributeRow: any = {};
+ uomDetails: Array = [];
+ selectedUomRow: any = {};
+ bomDetails: Array = [];
+ selectedBomRow: any = {};
+ attributeMappings: Array = [];
+ selectedAttrMappingRow: any = {};
+ category_list = [
+ { category_id: 1, category_text: 'Raw Material' },
+ { category_id: 2, category_text: 'Products' },
+ { category_id: 3, category_text: 'Sub Assemblies' },
+ { category_id: 4, category_text: 'Consumable' },
+ { category_id: 5, category_text: 'Services' }
+ ];
+ uom_list = [
+ { uom_id: 1, uom_text: 'Nos' },
+ { uom_id: 2, uom_text: 'Box' },
+ { uom_id: 3, uom_text: 'Meter' },
+ { uom_id: 4, uom_text: 'Unit' },
+ { uom_id: 5, uom_text: 'Set' }
+ ];
+ attribute_list = [
+ { attr_id: 1, attr_text: 'Size' },
+ { attr_id: 2, attr_text: 'Colour' },
+ { attr_id: 3, attr_text: 'Part' },
+ { attr_id: 4, attr_text: 'Dia' }
+ ];
+ attribute_value_list = [
+ { attr_val_id: 1, attr_val_text: 'S' },
+ { attr_val_id: 2, attr_val_text: 'M' },
+ { attr_val_id: 3, attr_val_text: 'L' },
+ { attr_val_id: 4, attr_val_text: 'XL' }
+ ];
+ categoryDropdownSettings!: IDropdownSettings;
+ selectedCategory = [];
+ uomDropdownSettings!: IDropdownSettings;
+ selectedUom = [];
+ attributeDropdownSettings!: IDropdownSettings;
+ selectedAttribute = [];
+ attributeValueDropdownSettings!: IDropdownSettings;
+ selected_attr = ''
+ selected_attr_value = []
+
+ constructor(private fb: FormBuilder, public toast: ToastService) {
+ this.itemDetailsForm = this.fb.group({
+ item_name: ['', [Validators.required]],
+ category: ['', [Validators.required]],
+ hsn_code: ['', []],
+ disabled: ['', []],
+ default_uom: ['', [Validators.required]],
+ default_attribute: ['', [Validators.required]]
+ });
+ }
+
+ ngOnInit(): void {
+ this.categoryDropdownSettings = {
+ singleSelection: false,
+ idField: 'category_id',
+ textField: 'category_text',
+ selectAllText: 'Select All',
+ unSelectAllText: 'UnSelect All',
+ itemsShowLimit: 3,
+ allowSearchFilter: true
+ };
+ this.uomDropdownSettings = {
+ singleSelection: false,
+ idField: 'uom_id',
+ textField: 'uom_text',
+ selectAllText: 'Select All',
+ unSelectAllText: 'UnSelect All',
+ itemsShowLimit: 3,
+ allowSearchFilter: true
+ };
+ this.attributeDropdownSettings = {
+ singleSelection: false,
+ idField: 'attr_id',
+ textField: 'attr_text',
+ selectAllText: 'Select All',
+ unSelectAllText: 'UnSelect All',
+ itemsShowLimit: 3,
+ allowSearchFilter: true
+ };
+ this.attributeValueDropdownSettings = {
+ singleSelection: false,
+ idField: 'attr_val_id',
+ textField: 'attr_val_text',
+ selectAllText: 'Select All',
+ unSelectAllText: 'UnSelect All',
+ itemsShowLimit: 3,
+ allowSearchFilter: true
+ };
+ }
+ @ViewChild('instance', { static: true })
+ instance!: NgbTypeahead;
+ focus$ = new Subject();
+ click$ = new Subject();
+
+ search: OperatorFunction = (text$: Observable) => {
+ const debouncedText$ = text$.pipe(debounceTime(200), distinctUntilChanged());
+ const clicksWithClosedPopup$ = this.click$.pipe(filter(() => !this.instance.isPopupOpen()));
+ const inputFocus$ = this.focus$;
+
+ return merge(debouncedText$, inputFocus$, clicksWithClosedPopup$).pipe(
+ map(term => (term === '' ? items
+ : items.filter(v => v.toLowerCase().indexOf(term.toLowerCase()) > -1)).slice(0, 10))
+ );
+ }
+ on_attribute_selection(e: any){
+ this.disableAttribute = false
+ if(e.target.value == 'Size'){
+ this.attribute_value_list = [
+ { attr_val_id: 1, attr_val_text: 'S' },
+ { attr_val_id: 2, attr_val_text: 'M' },
+ { attr_val_id: 3, attr_val_text: 'L' },
+ { attr_val_id: 4, attr_val_text: 'XL' }
+ ];
+ }
+ if(e.target.value == 'Colour'){
+ this.attribute_value_list = [
+ { attr_val_id: 1, attr_val_text: 'Red' },
+ { attr_val_id: 2, attr_val_text: 'Green' },
+ { attr_val_id: 3, attr_val_text: 'Blue' },
+ { attr_val_id: 4, attr_val_text: 'White' }
+ ];
+ }
+ }
+ addAttributeDetails() {
+ this.itemAttributeDetails.push(this.selectedItemAttributeRow)
+ this.selectedItemAttributeRow = {};
+ }
+ deleteAttributeDetails(index: number) {
+ this.itemAttributeDetails.splice(index, 1);
+ }
+ addUomDetails() {
+ this.uomDetails.push(this.selectedUomRow)
+ this.selectedUomRow = {};
+ }
+ deleteUomDetails(index: number) {
+ this.uomDetails.splice(index, 1);
+ }
+ addBomDetails() {
+ this.selectedBomRow['expanded'] = false
+ this.bomDetails.push(this.selectedBomRow)
+ this.selectedBomRow = {};
+ }
+ deleteBomDetails(index: number) {
+ this.bomDetails.splice(index, 1);
+ }
+ addAttributeMapping() {
+ this.attributeMappings.push(this.selectedAttrMappingRow)
+ this.selectedAttrMappingRow = {};
+ }
+ deleteAttributeMapping(index: number) {
+ this.attributeMappings.splice(index, 1);
+ }
+ saveItem(){
+ if (this.itemDetailsForm.invalid) {
+ this.toast.showDanger('Please enter required details');
+ return;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/app/modules/master/master-routing.module.ts b/src/app/modules/master/master-routing.module.ts
index e92b7bd..362aad6 100644
--- a/src/app/modules/master/master-routing.module.ts
+++ b/src/app/modules/master/master-routing.module.ts
@@ -1,5 +1,7 @@
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
+import { ItemListComponent } from './item/item-list/item-list.component';
+import { ItemComponent } from './item/item/item.component';
import { MasterComponent } from './master.component';
import { SupplierComponent } from './supplier/supplier.component';
@@ -9,6 +11,8 @@ const routes: Routes = [
component: MasterComponent,
children: [
{ path: 'supplier', component: SupplierComponent },
+ { path: 'item/item-list', component: ItemListComponent },
+ { path: 'item/new-item', component: ItemComponent },
{ path: '', redirectTo: 'supplier', pathMatch: 'full'}
]
}
diff --git a/src/app/modules/master/master.component.ts b/src/app/modules/master/master.component.ts
index 863606a..620549f 100644
--- a/src/app/modules/master/master.component.ts
+++ b/src/app/modules/master/master.component.ts
@@ -8,6 +8,7 @@ import { Component, OnInit } from '@angular/core';
export class MasterComponent implements OnInit {
links = [
{ name: 'Supplier', path: '/home/master/supplier' },
+ { name: 'Item', path: '/home/master/item/item-list' }
];
constructor() {}
diff --git a/src/app/modules/master/master.module.ts b/src/app/modules/master/master.module.ts
index 3072b7e..48bc4b7 100644
--- a/src/app/modules/master/master.module.ts
+++ b/src/app/modules/master/master.module.ts
@@ -5,17 +5,28 @@ import { MasterRoutingModule } from './master-routing.module';
import { MasterComponent } from './master.component';
import { SupplierComponent } from './supplier/supplier.component';
import { NavbarModule } from 'src/app/shared/navbar/navbar.module';
+import { ItemListComponent } from './item/item-list/item-list.component';
+import { ItemComponent } from './item/item/item.component';
+import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
+import { FormsModule, ReactiveFormsModule } from '@angular/forms';
+import { NgMultiSelectDropDownModule } from 'ng-multiselect-dropdown';
@NgModule({
declarations: [
MasterComponent,
- SupplierComponent
+ SupplierComponent,
+ ItemListComponent,
+ ItemComponent
],
imports: [
CommonModule,
MasterRoutingModule,
- NavbarModule
+ NavbarModule,
+ NgbModule,
+ FormsModule,
+ ReactiveFormsModule,
+ NgMultiSelectDropDownModule.forRoot()
]
})
export class MasterModule { }