mirror of
https://github.com/inventree/inventree-app.git
synced 2025-05-04 16:28:54 +00:00
Improve supplier part detail screen (#326)
* Improve supplier part detail screen * Update release notes
This commit is contained in:
parent
87994a4912
commit
28ed1ed545
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
- Fix background image transparency for dark mode
|
- Fix background image transparency for dark mode
|
||||||
- Fix link to Bill of Materials from Part screen
|
- Fix link to Bill of Materials from Part screen
|
||||||
|
- Improvements to supplier part detail screen
|
||||||
|
|
||||||
|
|
||||||
### 0.11.4 - April 2023
|
### 0.11.4 - April 2023
|
||||||
|
@ -148,6 +148,8 @@ class InvenTreeSupplierPart extends InvenTreeModel {
|
|||||||
return _filters();
|
return _filters();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int get manufacturerId => (jsondata["manufacturer_detail"]["pk"] ?? -1) as int;
|
||||||
|
|
||||||
String get manufacturerName => (jsondata["manufacturer_detail"]?["name"] ?? "") as String;
|
String get manufacturerName => (jsondata["manufacturer_detail"]?["name"] ?? "") as String;
|
||||||
|
|
||||||
String get MPN => (jsondata["manufacturer_part_detail"]?["MPN"] ?? "") as String;
|
String get MPN => (jsondata["manufacturer_part_detail"]?["MPN"] ?? "") as String;
|
||||||
|
@ -464,6 +464,9 @@
|
|||||||
"inProductionDetail": "This stock item is in production",
|
"inProductionDetail": "This stock item is in production",
|
||||||
"@inProductionDetail": {},
|
"@inProductionDetail": {},
|
||||||
|
|
||||||
|
"internalPart": "Internal Part",
|
||||||
|
"@internalPart": {},
|
||||||
|
|
||||||
"invalidHost": "Invalid hostname",
|
"invalidHost": "Invalid hostname",
|
||||||
"@invalidHost": {},
|
"@invalidHost": {},
|
||||||
|
|
||||||
@ -555,6 +558,12 @@
|
|||||||
"lost": "Lost",
|
"lost": "Lost",
|
||||||
"@lost": {},
|
"@lost": {},
|
||||||
|
|
||||||
|
"manufacturerPartNumber": "Manufacturer Part Number",
|
||||||
|
"@manufacturerPartNumber": {},
|
||||||
|
|
||||||
|
"manufacturer": "Manufacturer",
|
||||||
|
"@manufacturer": {},
|
||||||
|
|
||||||
"manufacturers": "Manufacturers",
|
"manufacturers": "Manufacturers",
|
||||||
"@manufacturers": {},
|
"@manufacturers": {},
|
||||||
|
|
||||||
@ -1146,6 +1155,9 @@
|
|||||||
"supplierPartEdit": "Edit Supplier Part",
|
"supplierPartEdit": "Edit Supplier Part",
|
||||||
"@supplierPartEdit": {},
|
"@supplierPartEdit": {},
|
||||||
|
|
||||||
|
"supplierPartNumber": "Supplier Part Number",
|
||||||
|
"@supplierPartNumber": {},
|
||||||
|
|
||||||
"supplierPartUpdated": "Supplier Part Updated",
|
"supplierPartUpdated": "Supplier Part Updated",
|
||||||
"@supplierPartUpdated": {},
|
"@supplierPartUpdated": {},
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@ import "package:flutter_speed_dial/flutter_speed_dial.dart";
|
|||||||
import "package:font_awesome_flutter/font_awesome_flutter.dart";
|
import "package:font_awesome_flutter/font_awesome_flutter.dart";
|
||||||
|
|
||||||
import "package:inventree/api.dart";
|
import "package:inventree/api.dart";
|
||||||
|
import "package:inventree/app_colors.dart";
|
||||||
import "package:inventree/barcode.dart";
|
import "package:inventree/barcode.dart";
|
||||||
import "package:inventree/l10.dart";
|
import "package:inventree/l10.dart";
|
||||||
|
|
||||||
@ -117,9 +118,10 @@ class _SupplierPartDisplayState extends RefreshableState<SupplierPartDetailWidge
|
|||||||
// Internal Part
|
// Internal Part
|
||||||
tiles.add(
|
tiles.add(
|
||||||
ListTile(
|
ListTile(
|
||||||
title: Text(widget.supplierPart.partName),
|
title: Text(L10().internalPart),
|
||||||
subtitle: Text(widget.supplierPart.partDescription),
|
subtitle: Text(widget.supplierPart.partName),
|
||||||
leading: InvenTreeAPI().getImage(
|
leading: FaIcon(FontAwesomeIcons.shapes, color: COLOR_ACTION),
|
||||||
|
trailing: InvenTreeAPI().getImage(
|
||||||
widget.supplierPart.partImage,
|
widget.supplierPart.partImage,
|
||||||
width: 40,
|
width: 40,
|
||||||
height: 40,
|
height: 40,
|
||||||
@ -140,9 +142,9 @@ class _SupplierPartDisplayState extends RefreshableState<SupplierPartDetailWidge
|
|||||||
// Supplier details
|
// Supplier details
|
||||||
tiles.add(
|
tiles.add(
|
||||||
ListTile(
|
ListTile(
|
||||||
title: Text(widget.supplierPart.SKU),
|
title: Text(L10().supplier),
|
||||||
subtitle: Text(widget.supplierPart.supplierName),
|
subtitle: Text(widget.supplierPart.supplierName),
|
||||||
leading: FaIcon(FontAwesomeIcons.building),
|
leading: FaIcon(FontAwesomeIcons.building, color: COLOR_ACTION),
|
||||||
trailing: InvenTreeAPI().getImage(
|
trailing: InvenTreeAPI().getImage(
|
||||||
widget.supplierPart.supplierImage,
|
widget.supplierPart.supplierImage,
|
||||||
width: 40,
|
width: 40,
|
||||||
@ -162,18 +164,46 @@ class _SupplierPartDisplayState extends RefreshableState<SupplierPartDetailWidge
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// SKU (part number)
|
||||||
|
tiles.add(
|
||||||
|
ListTile(
|
||||||
|
title: Text(L10().supplierPartNumber),
|
||||||
|
subtitle: Text(widget.supplierPart.SKU),
|
||||||
|
leading: FaIcon(FontAwesomeIcons.barcode),
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
// Manufacturer information
|
// Manufacturer information
|
||||||
if (widget.supplierPart.manufacturerPartId > 0) {
|
if (widget.supplierPart.manufacturerPartId > 0) {
|
||||||
tiles.add(
|
tiles.add(
|
||||||
ListTile(
|
ListTile(
|
||||||
|
title: Text(L10().manufacturer),
|
||||||
subtitle: Text(widget.supplierPart.manufacturerName),
|
subtitle: Text(widget.supplierPart.manufacturerName),
|
||||||
title: Text(widget.supplierPart.MPN),
|
leading: FaIcon(FontAwesomeIcons.industry, color: COLOR_ACTION),
|
||||||
leading: FaIcon(FontAwesomeIcons.industry),
|
|
||||||
trailing: InvenTreeAPI().getImage(
|
trailing: InvenTreeAPI().getImage(
|
||||||
widget.supplierPart.manufacturerImage,
|
widget.supplierPart.manufacturerImage,
|
||||||
width: 40,
|
width: 40,
|
||||||
height: 40,
|
height: 40,
|
||||||
|
),
|
||||||
|
onTap: () async {
|
||||||
|
showLoadingOverlay(context);
|
||||||
|
var supplier = await InvenTreeCompany().get(widget.supplierPart.manufacturerId);
|
||||||
|
hideLoadingOverlay();
|
||||||
|
|
||||||
|
if (supplier is InvenTreeCompany) {
|
||||||
|
Navigator.push(context, MaterialPageRoute(
|
||||||
|
builder: (context) => CompanyDetailWidget(supplier)
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
)
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
tiles.add(
|
||||||
|
ListTile(
|
||||||
|
title: Text(L10().manufacturerPartNumber),
|
||||||
|
subtitle: Text(widget.supplierPart.MPN),
|
||||||
|
leading: FaIcon(FontAwesomeIcons.barcode),
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -182,7 +212,7 @@ class _SupplierPartDisplayState extends RefreshableState<SupplierPartDetailWidge
|
|||||||
tiles.add(
|
tiles.add(
|
||||||
ListTile(
|
ListTile(
|
||||||
title: Text(widget.supplierPart.link),
|
title: Text(widget.supplierPart.link),
|
||||||
leading: FaIcon(FontAwesomeIcons.link),
|
leading: FaIcon(FontAwesomeIcons.link, color: COLOR_ACTION),
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
var uri = Uri.tryParse(widget.supplierPart.link);
|
var uri = Uri.tryParse(widget.supplierPart.link);
|
||||||
if (uri != null && await canLaunchUrl(uri)) {
|
if (uri != null && await canLaunchUrl(uri)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user