|
|
|
|
@ -20,6 +20,7 @@ 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/loaders/app_loading.dart';
|
|
|
|
|
import 'package:test_sa/views/widgets/requests/request_status.dart';
|
|
|
|
|
|
|
|
|
|
class SystemInternalAuditDetailPage extends StatefulWidget {
|
|
|
|
|
static const String id = "/details-system-internal-audit";
|
|
|
|
|
@ -79,17 +80,45 @@ class _SystemInternalAuditDetailPageState extends State<SystemInternalAuditDetai
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
assetInformation(),
|
|
|
|
|
Row(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
StatusLabel(
|
|
|
|
|
label: model!.status!.name,
|
|
|
|
|
id: model!.status!.value,
|
|
|
|
|
radius: 4,
|
|
|
|
|
textColor: AppColor.getRequestStatusTextColorByName(
|
|
|
|
|
context,
|
|
|
|
|
model!.status!.name,
|
|
|
|
|
),
|
|
|
|
|
backgroundColor: AppColor.getRequestStatusColorByName(
|
|
|
|
|
context,
|
|
|
|
|
model!.status!.name,
|
|
|
|
|
),
|
|
|
|
|
// textColor: AppColor.green15,
|
|
|
|
|
// backgroundColor: AppColor.greenStatus(context),
|
|
|
|
|
),
|
|
|
|
|
Text(
|
|
|
|
|
model!.createdDate!.toString().toServiceRequestCardFormat,
|
|
|
|
|
textAlign: TextAlign.end,
|
|
|
|
|
style: AppTextStyles.tinyFont.copyWith(color: context.isDark ? AppColor.neutral30 : AppColor.neutral50),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
8.height,
|
|
|
|
|
workOrderInformation(),
|
|
|
|
|
workOrderInfo(),
|
|
|
|
|
const Divider().defaultStyle(context),
|
|
|
|
|
8.height,
|
|
|
|
|
assetInfo(),
|
|
|
|
|
|
|
|
|
|
//TODO need to check for comments
|
|
|
|
|
if (model?.findingDescription?.isNotEmpty ?? false) ...[
|
|
|
|
|
const Divider().defaultStyle(context),
|
|
|
|
|
// Text(
|
|
|
|
|
// "Comments".addTranslation,
|
|
|
|
|
// style: AppTextStyles.heading4.copyWith(color: context.isDark ? AppColor.neutral30 : AppColor.neutral50),
|
|
|
|
|
// ),
|
|
|
|
|
Text(
|
|
|
|
|
"Remarks",
|
|
|
|
|
style: AppTextStyles.heading4.copyWith(color: context.isDark ? AppColor.neutral30 : AppColor.neutral50),
|
|
|
|
|
),
|
|
|
|
|
model!.findingDescription!.bodyText(context),
|
|
|
|
|
],
|
|
|
|
|
//TODO need to check for attachments
|
|
|
|
|
@ -143,10 +172,33 @@ class _SystemInternalAuditDetailPageState extends State<SystemInternalAuditDetai
|
|
|
|
|
6.height,
|
|
|
|
|
labelValueText(context, context.translation.woNumber, details?.workOrderNo),
|
|
|
|
|
labelValueText(context, 'WO Type'.addTranslation, model?.workOrderType?.name),
|
|
|
|
|
labelValueText(context, context.translation.site, details?.woSite),
|
|
|
|
|
labelValueText(context, context.translation.assetName, details?.woAssetName),
|
|
|
|
|
labelValueText(context, context.translation.assetNo, details?.woAssetNo),
|
|
|
|
|
labelValueText(context, context.translation.manufacture, details?.woManufacturer),
|
|
|
|
|
labelValueText(context, context.translation.serialNumber, details?.wosn),
|
|
|
|
|
labelValueText(context, context.translation.model, details?.woModel),
|
|
|
|
|
labelValueText(context, context.translation.site, details?.woSite),
|
|
|
|
|
labelValueText(context, context.translation.department, details?.woDepartment),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget workOrderInfo() {
|
|
|
|
|
final details = model?.workOrderDetails;
|
|
|
|
|
return Column(
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Text(
|
|
|
|
|
"WO Info",
|
|
|
|
|
style: AppTextStyles.heading4.copyWith(color: context.isDark ? AppColor.neutral30 : AppColor.neutral50),
|
|
|
|
|
),
|
|
|
|
|
6.height,
|
|
|
|
|
labelValueText(context, context.translation.requestNo, model?.requestNo),
|
|
|
|
|
labelValueText(context, 'WO Type'.addTranslation, model?.workOrderType?.name),
|
|
|
|
|
labelValueText(context, context.translation.woNumber, details?.workOrderNo),
|
|
|
|
|
labelValueText(context, "Finding Type", model?.findingType?.name),
|
|
|
|
|
labelValueText(context, "Assigned Engineer", model?.workOrderDetails?.woAssignedEngineer),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
@ -187,6 +239,28 @@ class _SystemInternalAuditDetailPageState extends State<SystemInternalAuditDetai
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget assetInfo() {
|
|
|
|
|
final details = model?.workOrderDetails;
|
|
|
|
|
return Column(
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Text(
|
|
|
|
|
"Asset Details",
|
|
|
|
|
style: AppTextStyles.heading4.copyWith(color: context.isDark ? AppColor.neutral30 : AppColor.neutral50),
|
|
|
|
|
),
|
|
|
|
|
6.height,
|
|
|
|
|
labelValueText(context, context.translation.assetName, details?.woAssetName),
|
|
|
|
|
labelValueText(context, context.translation.assetNo, details?.woAssetNo),
|
|
|
|
|
labelValueText(context, context.translation.manufacture, details?.woManufacturer),
|
|
|
|
|
labelValueText(context, context.translation.serialNumber, details?.wosn),
|
|
|
|
|
labelValueText(context, context.translation.model, details?.woModel),
|
|
|
|
|
labelValueText(context, context.translation.site, details?.woSite),
|
|
|
|
|
labelValueText(context, context.translation.department, details?.woDepartment),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget labelValueText(BuildContext context, String label, String? value) {
|
|
|
|
|
if (value == null || value.isEmpty) return const SizedBox.shrink();
|
|
|
|
|
|
|
|
|
|
|