improvements

main_production_spare_part
WaseemAbbasi22 6 days ago
parent c88b5770c9
commit 86aa0f67d8

@ -73,6 +73,8 @@ class SparePartHelperModel {
data['partCatalogItemId'] = sparePart?.id; data['partCatalogItemId'] = sparePart?.id;
data['quantity'] = quantity; data['quantity'] = quantity;
data['comment'] = comment; data['comment'] = comment;
data['installQty'] = installQty;
data['returnQty'] = returnQty;
if (sparePartAttachments.isNotEmpty) { if (sparePartAttachments.isNotEmpty) {
data['acitiySparePartAttachments'] = sparePartAttachments!.map((v) => v.toJson()).toList(); data['acitiySparePartAttachments'] = sparePartAttachments!.map((v) => v.toJson()).toList();
} }

@ -1,4 +1,3 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:test_sa/controllers/api_routes/urls.dart'; import 'package:test_sa/controllers/api_routes/urls.dart';
@ -77,8 +76,7 @@ class _PmActivitiesListViewState extends State<PmActivitiesListView> {
return sparePartActivityCard(pmProvider: pmProvider, userProvider: userProvider, context: context, activity: activities[index]); return sparePartActivityCard(pmProvider: pmProvider, userProvider: userProvider, context: context, activity: activities[index]);
}, },
).expanded, ).expanded,
if (userProvider.user!.type == UsersTypes.engineer && if (userProvider.user!.type == UsersTypes.engineer && (pmProvider.planPreventiveVisit?.visitStatus?.value != 5 && pmProvider.planPreventiveVisit?.visitStatus?.value != 3))
(pmProvider.planPreventiveVisit?.visitStatus?.value != 5 && pmProvider.planPreventiveVisit?.visitStatus?.value != 3))
FooterActionButton.footerContainer( FooterActionButton.footerContainer(
context: context, context: context,
child: AppFilledButton( child: AppFilledButton(
@ -165,6 +163,21 @@ class _PmActivitiesListViewState extends State<PmActivitiesListView> {
label: context.translation.oracleCode, label: context.translation.oracleCode,
value: activity.partCatalogItem?.oracleCode, value: activity.partCatalogItem?.oracleCode,
), ),
if (activity.quantity != null && activity.quantity! > 0)
InfoTextWidget(
label: context.translation.quantity,
value: activity.quantity.toString(),
),
if (activity.installQty != null && activity.installQty! > 0)
InfoTextWidget(
label: context.translation.installedQty,
value: activity.installQty.toString(),
),
if (activity.returnQty != null && activity.returnQty! > 0)
InfoTextWidget(
label: context.translation.returnQty,
value: activity.returnQty.toString(),
),
if (activity.comment?.isNotEmpty ?? false) ...[ if (activity.comment?.isNotEmpty ?? false) ...[
const Divider().defaultStyle(context), const Divider().defaultStyle(context),
InfoTextLabelWidget(label: activity.comment ?? ""), InfoTextLabelWidget(label: activity.comment ?? ""),

Loading…
Cancel
Save