|
|
|
|
@ -79,6 +79,7 @@ class _DeviceTransferDetailsState extends State<DeviceTransferDetails> {
|
|
|
|
|
),
|
|
|
|
|
_buildTextWidget('${context.translation.requestNo} : ${_model?.transferCode ?? ""}'),
|
|
|
|
|
_buildTextWidget('${context.translation.transferType} : ${_model?.transferType?.name ?? ""}'),
|
|
|
|
|
|
|
|
|
|
const Divider().defaultStyle(context),
|
|
|
|
|
Text(
|
|
|
|
|
"Asset Info".addTranslation,
|
|
|
|
|
@ -91,16 +92,7 @@ class _DeviceTransferDetailsState extends State<DeviceTransferDetails> {
|
|
|
|
|
Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
const Divider().defaultStyle(context),
|
|
|
|
|
Text(
|
|
|
|
|
"Contact Info".addTranslation,
|
|
|
|
|
style: AppTextStyles.heading6.copyWith(color: context.isDark ? AppColor.neutral30 : AppColor.neutral50),
|
|
|
|
|
),
|
|
|
|
|
if (_model?.receiverEndUserName != null) _buildTextWidget('${context.translation.receiverName} : ${_model?.receiverEndUserName ?? ""}'),
|
|
|
|
|
infoText(label: context.translation.employeeId, value: _model?.employeeId),
|
|
|
|
|
infoText(label: context.translation.name, value: _model?.name),
|
|
|
|
|
// infoText(label: context.translation.telephone, value: _model?.te),
|
|
|
|
|
|
|
|
|
|
_contactInfo(),
|
|
|
|
|
if ((_model?.comment ?? "").isNotEmpty) ...[
|
|
|
|
|
const Divider().defaultStyle(context),
|
|
|
|
|
Text(
|
|
|
|
|
@ -197,14 +189,13 @@ class _DeviceTransferDetailsState extends State<DeviceTransferDetails> {
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_buildTextWidget(String text) {
|
|
|
|
|
return text.bodyText(context);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_internalRequestDetailsCard({StatusLabel? statusLabel}) {
|
|
|
|
|
bool isCurrentEngineerEligibleForEdit = _model?.senderAssignedEmployeeId == _userProvider!.user?.userID;
|
|
|
|
|
bool isCurrentRequestEditAble = (!(_model?.senderMachineStatusValue==3));
|
|
|
|
|
bool isCurrentRequestEditAble = (!(_model?.senderMachineStatusValue == 3));
|
|
|
|
|
return Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
@ -216,17 +207,16 @@ class _DeviceTransferDetailsState extends State<DeviceTransferDetails> {
|
|
|
|
|
children: [
|
|
|
|
|
statusLabel ?? Container(),
|
|
|
|
|
if (statusLabel != null) 8.height,
|
|
|
|
|
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
if ((_userProvider!.user?.type == UsersTypes.engineer))
|
|
|
|
|
if (isCurrentEngineerEligibleForEdit && isCurrentRequestEditAble)
|
|
|
|
|
"edit".toSvgAsset(height: 40, width: 40).onPress(() async {
|
|
|
|
|
bool isReload = (await Navigator.of(context).push(MaterialPageRoute(builder: (_) => UpdateDeviceTransfer(model: _model!, isSender: true)))) as bool;
|
|
|
|
|
if (isReload ?? false) {
|
|
|
|
|
setState(() {});
|
|
|
|
|
}
|
|
|
|
|
}),
|
|
|
|
|
"edit".toSvgAsset(height: 40, width: 40).onPress(() async {
|
|
|
|
|
bool isReload = (await Navigator.of(context).push(MaterialPageRoute(builder: (_) => UpdateDeviceTransfer(model: _model!, isSender: true)))) as bool;
|
|
|
|
|
if (isReload ?? false) {
|
|
|
|
|
setState(() {});
|
|
|
|
|
}
|
|
|
|
|
}),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
context.translation.details.heading5(context),
|
|
|
|
|
@ -237,14 +227,14 @@ class _DeviceTransferDetailsState extends State<DeviceTransferDetails> {
|
|
|
|
|
infoText(label: "Receiver Building".addTranslation, value: _model?.destBuildingName),
|
|
|
|
|
infoText(label: "Receiver Floor".addTranslation, value: _model?.destFloorName),
|
|
|
|
|
infoText(label: "Receiver Department".addTranslation, value: _model?.destDepartmentName),
|
|
|
|
|
if (_model!.comment != null && _model!.comment!.isNotEmpty) ...[
|
|
|
|
|
if (_model!.senderComment != null && _model!.senderComment!.isNotEmpty) ...[
|
|
|
|
|
8.height,
|
|
|
|
|
const Divider().defaultStyle(context),
|
|
|
|
|
Text(
|
|
|
|
|
"Technical Comments".addTranslation,
|
|
|
|
|
style: AppTextStyles.heading6.copyWith(color: context.isDark ? AppColor.neutral30 : AppColor.neutral50),
|
|
|
|
|
),
|
|
|
|
|
_buildTextWidget(_model?.comment ?? ''),
|
|
|
|
|
_buildTextWidget(_model?.senderComment ?? ''),
|
|
|
|
|
]
|
|
|
|
|
],
|
|
|
|
|
).toShadowContainer(context);
|
|
|
|
|
@ -253,8 +243,7 @@ class _DeviceTransferDetailsState extends State<DeviceTransferDetails> {
|
|
|
|
|
_buildCard({required String site, String? building, String? dept, String? floor, required String comment, required bool isSender, StatusLabel? statusLabel}) {
|
|
|
|
|
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(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
@ -302,6 +291,42 @@ class _DeviceTransferDetailsState extends State<DeviceTransferDetails> {
|
|
|
|
|
).toShadowContainer(context);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget _contactInfo() {
|
|
|
|
|
if (_model?.assetTransferContactPersons != null && _model!.assetTransferContactPersons!.isNotEmpty) {
|
|
|
|
|
return Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
const Divider().defaultStyle(context),
|
|
|
|
|
Text(
|
|
|
|
|
"Contact Info".addTranslation,
|
|
|
|
|
style: AppTextStyles.heading6.copyWith(
|
|
|
|
|
color: context.isDark ? AppColor.neutral30 : AppColor.neutral50,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
..._model!.assetTransferContactPersons!.asMap().entries.map((entry) {
|
|
|
|
|
final index = entry.key;
|
|
|
|
|
final person = entry.value;
|
|
|
|
|
final isLast = index == _model!.assetTransferContactPersons!.length - 1;
|
|
|
|
|
|
|
|
|
|
return Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
const SizedBox(height: 8),
|
|
|
|
|
infoText(label: context.translation.employeeId, value: person.employeeNumber),
|
|
|
|
|
infoText(label: context.translation.name, value: person.employeeName),
|
|
|
|
|
infoText(label: context.translation.email, value: person.email),
|
|
|
|
|
infoText(label: context.translation.phoneNumber, value: person.mobileNo),
|
|
|
|
|
infoText(label: context.translation.extensionNo, value: person.extension),
|
|
|
|
|
if (!isLast && _model!.assetTransferContactPersons!.length > 1) const Divider().defaultStyle(context),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
}).toList(),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
return const SizedBox();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget infoText({
|
|
|
|
|
String? label,
|
|
|
|
|
String? value,
|
|
|
|
|
|