|
|
|
@@ -17,6 +17,7 @@ import {MatTableDataSource} from "@angular/material/table"; |
|
|
|
import {OrderFilter} from "@app/_models/orderFilter"; |
|
|
|
import {NewProductComponent} from "@app/_views/products/new-product/new-product.component"; |
|
|
|
import {AssignProductComponent} from "@app/_views/products/assign-product/assign-product.component"; |
|
|
|
import {TranslateService} from "@ngx-translate/core"; |
|
|
|
|
|
|
|
@Component({ |
|
|
|
selector: 'app-product-list', |
|
|
|
@@ -41,13 +42,14 @@ export class ProductListComponent implements OnInit, AfterViewInit { |
|
|
|
constructor( |
|
|
|
private router: Router, |
|
|
|
private productService: ProductService, |
|
|
|
private translateService: TranslateService, |
|
|
|
private userProductService: UserProductService, |
|
|
|
private partnerProductService: PartnerProductService, |
|
|
|
private contactPartnerProductService: ContactPartnerProductService, |
|
|
|
protected appHelperService: AppHelperService, |
|
|
|
) { |
|
|
|
this.sort = new MatSort(); |
|
|
|
this.displayedColumns = ['details', 'pos', 'image', 'name', 'storage', 'number']; |
|
|
|
this.displayedColumns = ['details', 'pos', 'image', 'name', 'storage', 'number', 'unassign']; |
|
|
|
|
|
|
|
this.productsSub = new Subscription(); |
|
|
|
this.products = []; |
|
|
|
@@ -214,4 +216,15 @@ export class ProductListComponent implements OnInit, AfterViewInit { |
|
|
|
throw new Error('data not found') |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
unassignProduct(element: any) { |
|
|
|
let confirmMessage = ""; |
|
|
|
this.translateService.get('system.confirm-unassign').subscribe((translation: string) => { |
|
|
|
confirmMessage = translation; |
|
|
|
}); |
|
|
|
const userConfirmed = window.confirm(confirmMessage); |
|
|
|
if (userConfirmed) { |
|
|
|
console.log(element); |
|
|
|
} |
|
|
|
} |
|
|
|
} |