|
|
|
@ -24,6 +24,8 @@ import 'package:test_sa/new_views/common_widgets/app_filled_button.dart';
|
|
|
|
import 'package:test_sa/new_views/common_widgets/app_lazy_loading.dart';
|
|
|
|
import 'package:test_sa/new_views/common_widgets/app_lazy_loading.dart';
|
|
|
|
import 'package:test_sa/new_views/common_widgets/default_app_bar.dart';
|
|
|
|
import 'package:test_sa/new_views/common_widgets/default_app_bar.dart';
|
|
|
|
import 'package:test_sa/views/widgets/images/files_list.dart';
|
|
|
|
import 'package:test_sa/views/widgets/images/files_list.dart';
|
|
|
|
|
|
|
|
import 'package:test_sa/views/widgets/item_views/info_header_widget.dart';
|
|
|
|
|
|
|
|
import 'package:test_sa/views/widgets/item_views/info_text_widget.dart';
|
|
|
|
import 'package:test_sa/views/widgets/loaders/no_data_found.dart';
|
|
|
|
import 'package:test_sa/views/widgets/loaders/no_data_found.dart';
|
|
|
|
import 'package:test_sa/views/widgets/requests/request_status.dart';
|
|
|
|
import 'package:test_sa/views/widgets/requests/request_status.dart';
|
|
|
|
|
|
|
|
|
|
|
|
@ -127,11 +129,8 @@ class _ActivitiesListViewState extends State<ActivitiesListView> {
|
|
|
|
StatusLabel(
|
|
|
|
StatusLabel(
|
|
|
|
label: activity.activityStatus?.name,
|
|
|
|
label: activity.activityStatus?.name,
|
|
|
|
textColor: AppColor.white10,
|
|
|
|
textColor: AppColor.white10,
|
|
|
|
// textColor: AppColor.getHistoryLogStatusTextColorByName(activity.activityStatus!.name!),
|
|
|
|
|
|
|
|
// backgroundColor: AppColor.getHistoryLogStatusColorByName(activity.activityStatus!.name!),
|
|
|
|
|
|
|
|
backgroundColor: AppColor.primary10,
|
|
|
|
backgroundColor: AppColor.primary10,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
// "drag_icon".toSvgAsset(height: 12, width: 23, color: AppColor.neutral160),
|
|
|
|
|
|
|
|
if (showActionButtons)
|
|
|
|
if (showActionButtons)
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
@ -140,7 +139,7 @@ class _ActivitiesListViewState extends State<ActivitiesListView> {
|
|
|
|
"edit_icon".toSvgAsset(height: 24, width: 24, color: AppColor.icon2Color(context)).onPress(() {
|
|
|
|
"edit_icon".toSvgAsset(height: 24, width: 24, color: AppColor.icon2Color(context)).onPress(() {
|
|
|
|
editSparePartRequest(context: context, requestDetailProvider: requestDetailProvider, activity: activity);
|
|
|
|
editSparePartRequest(context: context, requestDetailProvider: requestDetailProvider, activity: activity);
|
|
|
|
}),
|
|
|
|
}),
|
|
|
|
24.width,
|
|
|
|
12.width,
|
|
|
|
"delete_icon".toSvgAsset(height: 24, width: 24).onPress(() async {
|
|
|
|
"delete_icon".toSvgAsset(height: 24, width: 24).onPress(() async {
|
|
|
|
showDialog(context: context, barrierDismissible: false, builder: (context) => const AppLazyLoading());
|
|
|
|
showDialog(context: context, barrierDismissible: false, builder: (context) => const AppLazyLoading());
|
|
|
|
int status = await requestDetailProvider.deleteActivitySparePart(id: activity.id!, workOrderId: requestDetailProvider.currentWorkOrder!.data!.requestId!);
|
|
|
|
int status = await requestDetailProvider.deleteActivitySparePart(id: activity.id!, workOrderId: requestDetailProvider.currentWorkOrder!.data!.requestId!);
|
|
|
|
@ -157,28 +156,18 @@ class _ActivitiesListViewState extends State<ActivitiesListView> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
6.height,
|
|
|
|
6.height,
|
|
|
|
//activity type...
|
|
|
|
//activity type...
|
|
|
|
Text(
|
|
|
|
InfoHeaderWidget(activity.activityType?.cleanupWhitespace.capitalizeFirstOfEach ?? '-'),
|
|
|
|
'${activity.activityType?.cleanupWhitespace.capitalizeFirstOfEach}',
|
|
|
|
InfoTextWidget(
|
|
|
|
style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral50),
|
|
|
|
label: context.translation.partName,
|
|
|
|
|
|
|
|
value: activity.activitySparePart?.partCatalogItem?.partName,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
3.height,
|
|
|
|
InfoTextWidget(
|
|
|
|
Text(
|
|
|
|
label: context.translation.partNo,
|
|
|
|
'${context.translation.partName}: ${activity.activitySparePart?.partCatalogItem?.partName}',
|
|
|
|
value: activity.activitySparePart?.partCatalogItem?.partNumber,
|
|
|
|
style: AppTextStyles.bodyText2.copyWith(color: AppColor.neutral120),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
2.height,
|
|
|
|
|
|
|
|
Text(
|
|
|
|
|
|
|
|
'${context.translation.partNo}: ${activity.activitySparePart?.partCatalogItem?.partNumber}',
|
|
|
|
|
|
|
|
style: AppTextStyles.bodyText2.copyWith(color: AppColor.neutral120),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
2.height,
|
|
|
|
|
|
|
|
if (activity.activitySparePart?.comment?.isNotEmpty ?? false) ...[
|
|
|
|
if (activity.activitySparePart?.comment?.isNotEmpty ?? false) ...[
|
|
|
|
const Divider().defaultStyle(context),
|
|
|
|
const Divider().defaultStyle(context),
|
|
|
|
2.height,
|
|
|
|
InfoTextLabelWidget(label: activity.activitySparePart?.comment ?? ''),
|
|
|
|
Text(
|
|
|
|
|
|
|
|
activity.activitySparePart?.comment ?? "",
|
|
|
|
|
|
|
|
style: AppTextStyles.bodyText2.copyWith(color: AppColor.neutral120),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
],
|
|
|
|
if (activity.activitySparePart?.acitiySparePartAttachments?.isNotEmpty ?? false) ...[
|
|
|
|
if (activity.activitySparePart?.acitiySparePartAttachments?.isNotEmpty ?? false) ...[
|
|
|
|
2.height,
|
|
|
|
2.height,
|
|
|
|
@ -212,28 +201,22 @@ class _ActivitiesListViewState extends State<ActivitiesListView> {
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
//TODO will be here when fixed from backend..
|
|
|
|
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
StatusLabel(
|
|
|
|
StatusLabel(
|
|
|
|
label: activity.activityStatus?.name,
|
|
|
|
label: activity.activityStatus?.name,
|
|
|
|
textColor: AppColor.white10,
|
|
|
|
textColor: AppColor.white10,
|
|
|
|
// textColor: AppColor.getHistoryLogStatusTextColorByName(activity.activityStatus!.name!),
|
|
|
|
|
|
|
|
// backgroundColor: AppColor.getHistoryLogStatusColorByName(activity.activityStatus!.name!),
|
|
|
|
|
|
|
|
backgroundColor: AppColor.primary10,
|
|
|
|
backgroundColor: AppColor.primary10,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
5.width,
|
|
|
|
5.width,
|
|
|
|
StatusLabel(
|
|
|
|
StatusLabel(
|
|
|
|
label: activity.activityMaintenance?.activityType,
|
|
|
|
label: activity.activityMaintenance?.activityType,
|
|
|
|
// textColor: AppColor.white10,
|
|
|
|
|
|
|
|
textColor: AppColor.getActivityTypeTextColor(activity.activityMaintenance?.activityType ?? ''),
|
|
|
|
textColor: AppColor.getActivityTypeTextColor(activity.activityMaintenance?.activityType ?? ''),
|
|
|
|
backgroundColor: AppColor.getActivityTypeBgColor(activity.activityMaintenance?.activityType ?? ''),
|
|
|
|
backgroundColor: AppColor.getActivityTypeBgColor(activity.activityMaintenance?.activityType ?? ''),
|
|
|
|
// backgroundColor: AppColor.primary10,
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
|
|
// "drag_icon".toSvgAsset(height: 12, width: 23, color: AppColor.neutral160),
|
|
|
|
|
|
|
|
if (showActionButtons)
|
|
|
|
if (showActionButtons)
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
@ -242,7 +225,7 @@ class _ActivitiesListViewState extends State<ActivitiesListView> {
|
|
|
|
"edit_icon".toSvgAsset(height: 24, width: 24, color: AppColor.icon2Color(context)).onPress(() {
|
|
|
|
"edit_icon".toSvgAsset(height: 24, width: 24, color: AppColor.icon2Color(context)).onPress(() {
|
|
|
|
editMaintenanceRequest(context: context, requestDetailProvider: requestDetailProvider, activity: activity);
|
|
|
|
editMaintenanceRequest(context: context, requestDetailProvider: requestDetailProvider, activity: activity);
|
|
|
|
}),
|
|
|
|
}),
|
|
|
|
24.width,
|
|
|
|
12.width,
|
|
|
|
"delete_icon".toSvgAsset(height: 24, width: 24).onPress(() async {
|
|
|
|
"delete_icon".toSvgAsset(height: 24, width: 24).onPress(() async {
|
|
|
|
showDialog(context: context, barrierDismissible: false, builder: (context) => const AppLazyLoading());
|
|
|
|
showDialog(context: context, barrierDismissible: false, builder: (context) => const AppLazyLoading());
|
|
|
|
int status = await requestDetailProvider.deleteActivityMaintenance(id: activity.id!, workOrderId: requestDetailProvider.currentWorkOrder!.data!.requestId!);
|
|
|
|
int status = await requestDetailProvider.deleteActivityMaintenance(id: activity.id!, workOrderId: requestDetailProvider.currentWorkOrder!.data!.requestId!);
|
|
|
|
@ -258,37 +241,26 @@ class _ActivitiesListViewState extends State<ActivitiesListView> {
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
6.height,
|
|
|
|
6.height,
|
|
|
|
//activity type...
|
|
|
|
InfoHeaderWidget(activity.activityType?.cleanupWhitespace.capitalizeFirstOfEach ?? ''),
|
|
|
|
Text(
|
|
|
|
InfoTextWidget(
|
|
|
|
'${activity.activityType?.cleanupWhitespace.capitalizeFirstOfEach}',
|
|
|
|
label: context.translation.workingHours,
|
|
|
|
style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral50),
|
|
|
|
value: totalWorkingHours > 0.0 ? CMRequestUtils.formatTimerDuration(totalWorkingHours.round()) : '-',
|
|
|
|
),
|
|
|
|
|
|
|
|
3.height,
|
|
|
|
|
|
|
|
Text(
|
|
|
|
|
|
|
|
'${context.translation.workingHours}: ${totalWorkingHours > 0.0 ? CMRequestUtils.formatTimerDuration(totalWorkingHours.round()) : '-'}',
|
|
|
|
|
|
|
|
style: AppTextStyles.bodyText2.copyWith(color: AppColor.neutral120),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
2.height,
|
|
|
|
|
|
|
|
if (activity.activityMaintenance?.assistantEmployees != null && activity.activityMaintenance!.assistantEmployees!.isNotEmpty) ...[
|
|
|
|
if (activity.activityMaintenance?.assistantEmployees != null && activity.activityMaintenance!.assistantEmployees!.isNotEmpty) ...[
|
|
|
|
Text(
|
|
|
|
InfoTextWidget(
|
|
|
|
'${context.translation.assistantEmployee}: ${activity.activityMaintenance?.assistantEmployees?.first.user?.userName}',
|
|
|
|
label: context.translation.assistantEmployee,
|
|
|
|
style: AppTextStyles.bodyText2.copyWith(color: AppColor.neutral120),
|
|
|
|
value: activity.activityMaintenance?.assistantEmployees?.first.user?.userName,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
|
|
] else ...[
|
|
|
|
] else ...[
|
|
|
|
Text(
|
|
|
|
InfoTextWidget(
|
|
|
|
'${context.translation.assignedEmployee}: ${activity.activityMaintenance?.assignedEmployee?.userName}',
|
|
|
|
label: context.translation.assignedEmployee,
|
|
|
|
style: AppTextStyles.bodyText2.copyWith(color: AppColor.neutral120),
|
|
|
|
value: activity.activityMaintenance?.assignedEmployee?.userName,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
|
|
|
|
|
|
|
|
2.height,
|
|
|
|
|
|
|
|
if (activity.activityMaintenance?.technicalComment?.isNotEmpty ?? false) ...[
|
|
|
|
if (activity.activityMaintenance?.technicalComment?.isNotEmpty ?? false) ...[
|
|
|
|
const Divider().defaultStyle(context),
|
|
|
|
const Divider().defaultStyle(context),
|
|
|
|
2.height,
|
|
|
|
InfoTextLabelWidget(label: activity.activityMaintenance?.technicalComment ?? ""),
|
|
|
|
Text(
|
|
|
|
|
|
|
|
activity.activityMaintenance?.technicalComment ?? "",
|
|
|
|
|
|
|
|
style: AppTextStyles.bodyText2.copyWith(color: AppColor.neutral120),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
],
|
|
|
|
//need to add all info here...
|
|
|
|
//need to add all info here...
|
|
|
|
// if(requestDetailProvider.currentWorkOrder?.data?.status?.id==3498)...[
|
|
|
|
// if(requestDetailProvider.currentWorkOrder?.data?.status?.id==3498)...[
|
|
|
|
|