|
|
|
@ -47,7 +47,7 @@ class _DeviceTransferDetailsState extends State<DeviceTransferDetails> {
|
|
|
|
_userProvider ??= Provider.of<UserProvider>(context);
|
|
|
|
_userProvider ??= Provider.of<UserProvider>(context);
|
|
|
|
|
|
|
|
|
|
|
|
return Scaffold(
|
|
|
|
return Scaffold(
|
|
|
|
appBar: DefaultAppBar(title: context.translation.deviceTransferDetails),
|
|
|
|
appBar: DefaultAppBar(title: context.translation.transferDetails),
|
|
|
|
key: _scaffoldKey,
|
|
|
|
key: _scaffoldKey,
|
|
|
|
body: SafeArea(
|
|
|
|
body: SafeArea(
|
|
|
|
child: FutureBuilder(
|
|
|
|
child: FutureBuilder(
|
|
|
|
@ -69,59 +69,17 @@ class _DeviceTransferDetailsState extends State<DeviceTransferDetails> {
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Row(
|
|
|
|
Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Column(
|
|
|
|
Row(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
StatusLabel(
|
|
|
|
"Transfer Details".addTranslation,
|
|
|
|
label: _model?.transferType?.name,
|
|
|
|
style: AppTextStyles.heading6.copyWith(color: context.isDark ? AppColor.neutral30 : AppColor.neutral50),
|
|
|
|
id: _model?.transferType?.id?.toInt(),
|
|
|
|
),
|
|
|
|
textColor: AppColor.getRequestStatusTextColorByName(context, _model?.transferType?.name),
|
|
|
|
_buildTextWidget('${context.translation.requestNo} : ${_model?.transferCode ?? ""}'),
|
|
|
|
backgroundColor: AppColor.getRequestStatusColorByName(context, _model?.transferType?.name),
|
|
|
|
_buildTextWidget('${context.translation.transferType} : ${_model?.transferType?.name ?? ""}'),
|
|
|
|
|
|
|
|
_buildTextWidget('${context.translation.createdBy} : ${_model?.name ?? ""}'),
|
|
|
|
|
|
|
|
const Divider().defaultStyle(context),
|
|
|
|
|
|
|
|
Text(
|
|
|
|
|
|
|
|
"Asset Info".addTranslation,
|
|
|
|
|
|
|
|
style: AppTextStyles.heading6.copyWith(color: context.isDark ? AppColor.neutral30 : AppColor.neutral50),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
_buildTextWidget('${context.translation.assetName} : ${_model?.assetName?.cleanupWhitespace.capitalizeFirstOfEach ?? ""}'),
|
|
|
|
|
|
|
|
_buildTextWidget('${context.translation.assetNumber} : ${_model?.assetNumber ?? ""}'),
|
|
|
|
|
|
|
|
_buildTextWidget('${context.translation.model} : ${_model?.modelName ?? ""}'),
|
|
|
|
|
|
|
|
_buildTextWidget('${context.translation.sn} : ${_model?.assetSerialNo ?? ""}'),
|
|
|
|
|
|
|
|
Column(
|
|
|
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
_contactInfo(),
|
|
|
|
|
|
|
|
if ((_model?.comment ?? "").isNotEmpty) ...[
|
|
|
|
|
|
|
|
const Divider().defaultStyle(context),
|
|
|
|
|
|
|
|
Text(
|
|
|
|
|
|
|
|
"Comments".addTranslation,
|
|
|
|
|
|
|
|
style: AppTextStyles.heading6.copyWith(color: context.isDark ? AppColor.neutral30 : AppColor.neutral50),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
8.height,
|
|
|
|
|
|
|
|
_buildTextWidget(_model!.comment!),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
if (_attachments.isNotEmpty) ...[
|
|
|
|
|
|
|
|
const Divider().defaultStyle(context),
|
|
|
|
|
|
|
|
Text(
|
|
|
|
|
|
|
|
"Attachments".addTranslation,
|
|
|
|
|
|
|
|
style: AppTextStyles.heading6.copyWith(color: context.isDark ? AppColor.neutral30 : AppColor.neutral50),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
8.height,
|
|
|
|
|
|
|
|
FilesList(images: _model?.assetTransferAttachments?.map((e) => URLs.getFileUrl(e.attachmentName ?? '') ?? '').toList() ?? []),
|
|
|
|
|
|
|
|
//attachmentWidget(),
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
|
|
|
|
).expanded,
|
|
|
|
|
|
|
|
Column(
|
|
|
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
1.width,
|
|
|
|
|
|
|
|
Text(
|
|
|
|
Text(
|
|
|
|
_model?.createdOn != null ? _model!.createdOn!.toServiceRequestCardFormat : "",
|
|
|
|
_model?.createdOn != null ? _model!.createdOn!.toServiceRequestCardFormat : "",
|
|
|
|
textAlign: TextAlign.end,
|
|
|
|
textAlign: TextAlign.end,
|
|
|
|
@ -129,20 +87,47 @@ class _DeviceTransferDetailsState extends State<DeviceTransferDetails> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
8.height,
|
|
|
|
|
|
|
|
context.translation.callDetails.heading6(context).custom(color: context.isDark ? AppColor.neutral30 : AppColor.neutral50),
|
|
|
|
|
|
|
|
_buildTextWidget('${context.translation.trNumber} : ${_model?.transferCode ?? "-"}'),
|
|
|
|
|
|
|
|
_buildTextWidget('${context.translation.createdBy} : ${_model?.name ?? "-"}'),
|
|
|
|
|
|
|
|
const Divider().defaultStyle(context),
|
|
|
|
|
|
|
|
context.translation.assetInformation.heading6(context).custom(color: context.isDark ? AppColor.neutral30 : AppColor.neutral50),
|
|
|
|
|
|
|
|
_buildTextWidget('${context.translation.assetName} : ${_model?.assetName?.cleanupWhitespace.capitalizeFirstOfEach ?? ""}'),
|
|
|
|
|
|
|
|
_buildTextWidget('${context.translation.assetNumber} : ${_model?.assetNumber ?? "-"}'),
|
|
|
|
|
|
|
|
_buildTextWidget('${context.translation.model} : ${_model?.modelName ?? "-"}'),
|
|
|
|
|
|
|
|
_buildTextWidget('${context.translation.sn} : ${_model?.assetSerialNo ?? "-"}'),
|
|
|
|
|
|
|
|
_buildTextWidget('${context.translation.site} : ${_model?.senderSiteName ?? "-"}'),
|
|
|
|
|
|
|
|
_buildTextWidget('${context.translation.building} : ${_model?.senderBuildingName ?? "-"}'),
|
|
|
|
|
|
|
|
_buildTextWidget('${context.translation.floor} : ${_model?.senderFloorName ?? "-"}'),
|
|
|
|
|
|
|
|
_buildTextWidget('${context.translation.department} : ${_model?.senderDepartmentName ?? "-"}'),
|
|
|
|
|
|
|
|
Column(
|
|
|
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
_contactInfo(),
|
|
|
|
|
|
|
|
if ((_model?.comment ?? "").isNotEmpty) ...[
|
|
|
|
|
|
|
|
const Divider().defaultStyle(context),
|
|
|
|
|
|
|
|
context.translation.callComments.heading6(context).custom(color: context.isDark ? AppColor.neutral30 : AppColor.neutral50),
|
|
|
|
|
|
|
|
8.height,
|
|
|
|
|
|
|
|
_buildTextWidget(_model!.comment!),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
if (_attachments.isNotEmpty) ...[
|
|
|
|
|
|
|
|
const Divider().defaultStyle(context),
|
|
|
|
|
|
|
|
Text(
|
|
|
|
|
|
|
|
"Attachments".addTranslation,
|
|
|
|
|
|
|
|
style: AppTextStyles.heading6.copyWith(color: context.isDark ? AppColor.neutral30 : AppColor.neutral50),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
8.height,
|
|
|
|
|
|
|
|
FilesList(images: _model?.assetTransferAttachments?.map((e) => URLs.getFileUrl(e.attachmentName ?? '') ?? '').toList() ?? []),
|
|
|
|
|
|
|
|
//attachmentWidget(),
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
).toShadowContainer(context),
|
|
|
|
).toShadowContainer(context),
|
|
|
|
8.height,
|
|
|
|
8.height,
|
|
|
|
if (_model?.transferType?.value == 1) ...[
|
|
|
|
if (_model?.transferType?.value == 1) ...[
|
|
|
|
_internalRequestDetailsCard(
|
|
|
|
_internalRequestDetailsCard()
|
|
|
|
statusLabel: _model?.senderMachineStatusName != null
|
|
|
|
|
|
|
|
? StatusLabel(
|
|
|
|
|
|
|
|
label: _model!.senderMachineStatusName!,
|
|
|
|
|
|
|
|
id: _model!.senderMachineStatusId!.toInt(),
|
|
|
|
|
|
|
|
textColor: AppColor.getRequestStatusTextColorByName(context, _model!.senderMachineStatusName!),
|
|
|
|
|
|
|
|
backgroundColor: AppColor.getRequestStatusColorByName(context, _model!.senderMachineStatusName!),
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
: null,
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
] else ...[
|
|
|
|
] else ...[
|
|
|
|
// sender card
|
|
|
|
// sender card
|
|
|
|
_buildCard(
|
|
|
|
_buildCard(
|
|
|
|
@ -151,6 +136,7 @@ class _DeviceTransferDetailsState extends State<DeviceTransferDetails> {
|
|
|
|
dept: _model?.senderDepartmentName?.cleanupWhitespace.capitalizeFirstOfEach ?? "",
|
|
|
|
dept: _model?.senderDepartmentName?.cleanupWhitespace.capitalizeFirstOfEach ?? "",
|
|
|
|
building: _model?.senderBuildingName?.cleanupWhitespace.capitalizeFirstOfEach ?? "",
|
|
|
|
building: _model?.senderBuildingName?.cleanupWhitespace.capitalizeFirstOfEach ?? "",
|
|
|
|
floor: _model?.senderFloorName?.cleanupWhitespace.capitalizeFirstOfEach ?? "",
|
|
|
|
floor: _model?.senderFloorName?.cleanupWhitespace.capitalizeFirstOfEach ?? "",
|
|
|
|
|
|
|
|
assignTo: _model?.senderAssignedEmployeeName,
|
|
|
|
comment: _model?.senderComment ?? "",
|
|
|
|
comment: _model?.senderComment ?? "",
|
|
|
|
statusLabel: _model?.senderMachineStatusName != null
|
|
|
|
statusLabel: _model?.senderMachineStatusName != null
|
|
|
|
? StatusLabel(
|
|
|
|
? StatusLabel(
|
|
|
|
@ -169,6 +155,7 @@ class _DeviceTransferDetailsState extends State<DeviceTransferDetails> {
|
|
|
|
dept: _model?.destDepartmentName?.cleanupWhitespace.capitalizeFirstOfEach ?? "",
|
|
|
|
dept: _model?.destDepartmentName?.cleanupWhitespace.capitalizeFirstOfEach ?? "",
|
|
|
|
building: _model?.destBuildingName?.cleanupWhitespace.capitalizeFirstOfEach ?? "",
|
|
|
|
building: _model?.destBuildingName?.cleanupWhitespace.capitalizeFirstOfEach ?? "",
|
|
|
|
floor: _model?.destFloorName?.cleanupWhitespace.capitalizeFirstOfEach ?? "",
|
|
|
|
floor: _model?.destFloorName?.cleanupWhitespace.capitalizeFirstOfEach ?? "",
|
|
|
|
|
|
|
|
assignTo: _model?.receiverAssignedEmployeeName,
|
|
|
|
comment: _model?.receiverComment ?? "",
|
|
|
|
comment: _model?.receiverComment ?? "",
|
|
|
|
statusLabel: _model?.receiverMachineStatusName != null
|
|
|
|
statusLabel: _model?.receiverMachineStatusName != null
|
|
|
|
? StatusLabel(
|
|
|
|
? StatusLabel(
|
|
|
|
@ -198,7 +185,7 @@ class _DeviceTransferDetailsState extends State<DeviceTransferDetails> {
|
|
|
|
return text.bodyText(context);
|
|
|
|
return text.bodyText(context);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
_internalRequestDetailsCard({StatusLabel? statusLabel}) {
|
|
|
|
_internalRequestDetailsCard() {
|
|
|
|
bool isCurrentEngineerEligibleForEdit = _model?.senderAssignedEmployeeId == _userProvider!.user?.userID;
|
|
|
|
bool isCurrentEngineerEligibleForEdit = _model?.senderAssignedEmployeeId == _userProvider!.user?.userID;
|
|
|
|
bool isCurrentRequestEditAble = (!(_model?.senderMachineStatusValue == 3));
|
|
|
|
bool isCurrentRequestEditAble = (!(_model?.senderMachineStatusValue == 3));
|
|
|
|
return Column(
|
|
|
|
return Column(
|
|
|
|
@ -210,8 +197,23 @@ class _DeviceTransferDetailsState extends State<DeviceTransferDetails> {
|
|
|
|
Column(
|
|
|
|
Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
statusLabel ?? Container(),
|
|
|
|
Row(
|
|
|
|
if (statusLabel != null) 8.height,
|
|
|
|
children: [
|
|
|
|
|
|
|
|
StatusLabel(
|
|
|
|
|
|
|
|
label: _model!.senderMachineStatusName!,
|
|
|
|
|
|
|
|
id: _model!.senderMachineStatusId!.toInt(),
|
|
|
|
|
|
|
|
textColor: AppColor.getRequestStatusTextColorByName(context, _model!.senderMachineStatusName!),
|
|
|
|
|
|
|
|
backgroundColor: AppColor.getRequestStatusColorByName(context, _model!.senderMachineStatusName!),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
// 8.width,
|
|
|
|
|
|
|
|
// StatusLabel(
|
|
|
|
|
|
|
|
// label: _model?.transferType?.name,
|
|
|
|
|
|
|
|
// id: _model?.transferType?.id?.toInt(),
|
|
|
|
|
|
|
|
// textColor: AppColor.getRequestStatusTextColorByName(context, _model?.transferType?.name),
|
|
|
|
|
|
|
|
// backgroundColor: AppColor.getRequestStatusColorByName(context, _model?.transferType?.name),
|
|
|
|
|
|
|
|
// )
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
if ((_userProvider!.user?.type == UsersTypes.engineer))
|
|
|
|
if ((_userProvider!.user?.type == UsersTypes.engineer))
|
|
|
|
@ -224,14 +226,15 @@ class _DeviceTransferDetailsState extends State<DeviceTransferDetails> {
|
|
|
|
}),
|
|
|
|
}),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
context.translation.details.heading5(context),
|
|
|
|
8.height,
|
|
|
|
infoText(label: context.translation.site, value: _model?.senderSiteName),
|
|
|
|
context.translation.workOrderDetails.heading5(context),
|
|
|
|
infoText(label: "Sender Building".addTranslation, value: _model?.senderBuildingName),
|
|
|
|
infoText(label: context.translation.destinationSite, value: _model?.senderSiteName),
|
|
|
|
infoText(label: "Sender Floor".addTranslation, value: _model?.senderFloorName),
|
|
|
|
// infoText(label: "Sender Building".addTranslation, value: _model?.senderBuildingName),
|
|
|
|
infoText(label: "Sender Department".addTranslation, value: _model?.senderDepartmentName),
|
|
|
|
// infoText(label: "Sender Floor".addTranslation, value: _model?.senderFloorName),
|
|
|
|
infoText(label: "Receiver Building".addTranslation, value: _model?.destBuildingName),
|
|
|
|
// infoText(label: "Sender Department".addTranslation, value: _model?.senderDepartmentName),
|
|
|
|
infoText(label: "Receiver Floor".addTranslation, value: _model?.destFloorName),
|
|
|
|
infoText(label: "Building".addTranslation, value: _model?.destBuildingName),
|
|
|
|
infoText(label: "Receiver Department".addTranslation, value: _model?.destDepartmentName),
|
|
|
|
infoText(label: "Floor".addTranslation, value: _model?.destFloorName),
|
|
|
|
|
|
|
|
infoText(label: "Department".addTranslation, value: _model?.destDepartmentName),
|
|
|
|
if (_model!.senderComment != null && _model!.senderComment!.isNotEmpty) ...[
|
|
|
|
if (_model!.senderComment != null && _model!.senderComment!.isNotEmpty) ...[
|
|
|
|
8.height,
|
|
|
|
8.height,
|
|
|
|
const Divider().defaultStyle(context),
|
|
|
|
const Divider().defaultStyle(context),
|
|
|
|
@ -245,11 +248,10 @@ class _DeviceTransferDetailsState extends State<DeviceTransferDetails> {
|
|
|
|
).toShadowContainer(context);
|
|
|
|
).toShadowContainer(context);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
_buildCard({required String site, String? building, String? dept, String? floor, required String comment, required bool isSender, StatusLabel? statusLabel}) {
|
|
|
|
_buildCard({required String site, String? building, String? dept, String? floor, required String comment, required bool isSender, StatusLabel? statusLabel, String? assignTo}) {
|
|
|
|
bool isCurrentEngineerEligibleForEdit = isSender ? _model?.senderAssignedEmployeeId == _userProvider!.user?.userID : _model?.receiverAssignedEmployeeId == _userProvider!.user?.userID;
|
|
|
|
bool isCurrentEngineerEligibleForEdit = isSender ? _model?.senderAssignedEmployeeId == _userProvider!.user?.userID : _model?.receiverAssignedEmployeeId == _userProvider!.user?.userID;
|
|
|
|
|
|
|
|
|
|
|
|
bool isCurrentRequestClosed = isSender ? ((_model?.senderMachineStatusValue == 3)) : ((_model?.receiverMachineStatusValue == 3));
|
|
|
|
bool isCurrentRequestClosed = isSender ? ((_model?.senderMachineStatusValue == 3)) : ((_model?.receiverMachineStatusValue == 3));
|
|
|
|
|
|
|
|
|
|
|
|
return Column(
|
|
|
|
return Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
@ -283,6 +285,7 @@ class _DeviceTransferDetailsState extends State<DeviceTransferDetails> {
|
|
|
|
infoText(label: context.translation.building, value: building),
|
|
|
|
infoText(label: context.translation.building, value: building),
|
|
|
|
infoText(label: context.translation.floor, value: floor),
|
|
|
|
infoText(label: context.translation.floor, value: floor),
|
|
|
|
infoText(label: context.translation.department, value: dept),
|
|
|
|
infoText(label: context.translation.department, value: dept),
|
|
|
|
|
|
|
|
infoText(label: context.translation.assignedTo, value: assignTo),
|
|
|
|
if (comment.isNotEmpty) ...[
|
|
|
|
if (comment.isNotEmpty) ...[
|
|
|
|
8.height,
|
|
|
|
8.height,
|
|
|
|
const Divider().defaultStyle(context),
|
|
|
|
const Divider().defaultStyle(context),
|
|
|
|
|