mirror of
https://github.com/inventree/inventree-app.git
synced 2025-04-28 13:36:50 +00:00
Add more details to the part page
- "on order" count - "used in" count - "supplier" count - "bill of material" count
This commit is contained in:
parent
1f3e73fdd1
commit
77532a4026
2
lib/l10n
2
lib/l10n
@ -1 +1 @@
|
|||||||
Subproject commit b1cbc0ded4c29c84f5714e73872d5c665b2265e0
|
Subproject commit b49ea65800fd9e6bd96f59ae89e41829f4dd640a
|
@ -288,6 +288,7 @@ class _PartDisplayState extends RefreshableState<PartDetailWidget> {
|
|||||||
tiles.add(
|
tiles.add(
|
||||||
ListTile(
|
ListTile(
|
||||||
title: Text(L10().stock),
|
title: Text(L10().stock),
|
||||||
|
subtitle: Text(L10().stockDetails),
|
||||||
leading: FaIcon(FontAwesomeIcons.boxes, color: COLOR_CLICK),
|
leading: FaIcon(FontAwesomeIcons.boxes, color: COLOR_CLICK),
|
||||||
trailing: Text("${part.inStockString}"),
|
trailing: Text("${part.inStockString}"),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
@ -298,81 +299,20 @@ class _PartDisplayState extends RefreshableState<PartDetailWidget> {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
if (false && part.isPurchaseable) {
|
|
||||||
|
|
||||||
if (part.supplier_count > 0) {
|
|
||||||
tiles.add(
|
|
||||||
ListTile(
|
|
||||||
title: Text(L10().suppliers),
|
|
||||||
leading: FaIcon(FontAwesomeIcons.industry),
|
|
||||||
trailing: Text("${part.supplier_count}"),
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO - Add link to parts on order
|
|
||||||
// Parts on order
|
|
||||||
if (false && part.isPurchaseable) {
|
|
||||||
tiles.add(
|
|
||||||
ListTile(
|
|
||||||
title: Text("On Order"),
|
|
||||||
leading: FaIcon(FontAwesomeIcons.shoppingCart),
|
|
||||||
trailing: Text("${part.onOrder}"),
|
|
||||||
onTap: () {
|
|
||||||
// TODO: Click through to show items on order
|
|
||||||
},
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO
|
|
||||||
// Parts being built
|
|
||||||
if (false && part.isAssembly) {
|
|
||||||
|
|
||||||
tiles.add(ListTile(
|
|
||||||
title: Text(L10().billOfMaterials),
|
|
||||||
leading: FaIcon(FontAwesomeIcons.thList),
|
|
||||||
trailing: Text("${part.bomItemCount}"),
|
|
||||||
onTap: null,
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
tiles.add(
|
|
||||||
ListTile(
|
|
||||||
title: Text(L10().building),
|
|
||||||
leading: FaIcon(FontAwesomeIcons.tools),
|
|
||||||
trailing: Text("${part.building}"),
|
|
||||||
onTap: null,
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO - Do we want to use the app to display "used in"?
|
|
||||||
if (false && part.isComponent) {
|
|
||||||
tiles.add(ListTile(
|
|
||||||
title: Text("Used In"),
|
|
||||||
leading: FaIcon(FontAwesomeIcons.sitemap),
|
|
||||||
trailing: Text("${part.usedInCount}"),
|
|
||||||
onTap: null,
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Keywords?
|
// Keywords?
|
||||||
if (part.keywords.isNotEmpty) {
|
if (part.keywords.isNotEmpty) {
|
||||||
tiles.add(
|
tiles.add(
|
||||||
ListTile(
|
ListTile(
|
||||||
title: Text("${part.keywords}"),
|
title: Text("${part.keywords}"),
|
||||||
leading: FaIcon(FontAwesomeIcons.key),
|
leading: FaIcon(FontAwesomeIcons.key),
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// External link?
|
// External link?
|
||||||
if (part.link.isNotEmpty) {
|
if (part.link.isNotEmpty) {
|
||||||
tiles.add(
|
tiles.add(
|
||||||
ListTile(
|
ListTile(
|
||||||
title: Text("${part.link}"),
|
title: Text("${part.link}"),
|
||||||
leading: FaIcon(FontAwesomeIcons.link, color: COLOR_CLICK),
|
leading: FaIcon(FontAwesomeIcons.link, color: COLOR_CLICK),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
@ -382,6 +322,84 @@ class _PartDisplayState extends RefreshableState<PartDetailWidget> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Tiles for "purchaseable" parts
|
||||||
|
if (part.isPurchaseable) {
|
||||||
|
|
||||||
|
// Suppliers (TODO)
|
||||||
|
if (part.supplier_count > 0) {
|
||||||
|
tiles.add(
|
||||||
|
ListTile(
|
||||||
|
title: Text(L10().suppliers),
|
||||||
|
leading: FaIcon(FontAwesomeIcons.industry),
|
||||||
|
trailing: Text("${part.supplier_count}"),
|
||||||
|
onTap: () {
|
||||||
|
// TODO
|
||||||
|
},
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// On order
|
||||||
|
if (part.onOrder > 0) {
|
||||||
|
tiles.add(
|
||||||
|
ListTile(
|
||||||
|
title: Text(L10().onOrder),
|
||||||
|
subtitle: Text(L10().onOrderDetails),
|
||||||
|
leading: FaIcon(FontAwesomeIcons.shoppingCart),
|
||||||
|
trailing: Text("${part.onOrder}"),
|
||||||
|
onTap: () {
|
||||||
|
// TODO - Order views
|
||||||
|
},
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Tiles for an "assembly" part
|
||||||
|
if (part.isAssembly) {
|
||||||
|
|
||||||
|
if (part.bomItemCount > 0) {
|
||||||
|
tiles.add(
|
||||||
|
ListTile(
|
||||||
|
title: Text(L10().billOfMaterials),
|
||||||
|
leading: FaIcon(FontAwesomeIcons.thList),
|
||||||
|
trailing: Text("${part.bomItemCount}"),
|
||||||
|
onTap: () {
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (part.building > 0) {
|
||||||
|
tiles.add(
|
||||||
|
ListTile(
|
||||||
|
title: Text(L10().building),
|
||||||
|
leading: FaIcon(FontAwesomeIcons.tools),
|
||||||
|
trailing: Text("${part.building}"),
|
||||||
|
onTap: () {
|
||||||
|
// TODO
|
||||||
|
},
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Tiles for "component" part
|
||||||
|
if (part.isComponent) {
|
||||||
|
tiles.add(ListTile(
|
||||||
|
title: Text(L10().usedIn),
|
||||||
|
subtitle: Text(L10().usedInDetails),
|
||||||
|
leading: FaIcon(FontAwesomeIcons.sitemap),
|
||||||
|
trailing: Text("${part.usedInCount}"),
|
||||||
|
onTap: () {
|
||||||
|
// TODO
|
||||||
|
},
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// TODO - Add request tests?
|
// TODO - Add request tests?
|
||||||
if (false && part.isTrackable) {
|
if (false && part.isTrackable) {
|
||||||
tiles.add(ListTile(
|
tiles.add(ListTile(
|
||||||
@ -429,14 +447,6 @@ class _PartDisplayState extends RefreshableState<PartDetailWidget> {
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
/*
|
|
||||||
if (loading) {
|
|
||||||
tiles.add(progressIndicator());
|
|
||||||
} else if (part.stockItems.length > 0) {
|
|
||||||
tiles.add(PartStockList(part.stockItems));
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
return tiles;
|
return tiles;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -449,7 +459,9 @@ class _PartDisplayState extends RefreshableState<PartDetailWidget> {
|
|||||||
ListTile(
|
ListTile(
|
||||||
title: Text(L10().stockItemCreate),
|
title: Text(L10().stockItemCreate),
|
||||||
leading: FaIcon(FontAwesomeIcons.box),
|
leading: FaIcon(FontAwesomeIcons.box),
|
||||||
onTap: null,
|
onTap: () {
|
||||||
|
// TODO
|
||||||
|
},
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -458,7 +470,9 @@ class _PartDisplayState extends RefreshableState<PartDetailWidget> {
|
|||||||
title: Text(L10().barcodeScanItem),
|
title: Text(L10().barcodeScanItem),
|
||||||
leading: FaIcon(FontAwesomeIcons.box),
|
leading: FaIcon(FontAwesomeIcons.box),
|
||||||
trailing: FaIcon(FontAwesomeIcons.qrcode),
|
trailing: FaIcon(FontAwesomeIcons.qrcode),
|
||||||
onTap: null,
|
onTap: () {
|
||||||
|
// TODO
|
||||||
|
},
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user