asset fixes

design_3.0_task_module_new
Sikander Saleem 7 months ago
parent be276f327d
commit c4c68fbe8b

@ -526,7 +526,7 @@ class AssetTransfer {
map['destRoomId'] = destRoomId; map['destRoomId'] = destRoomId;
map['comment'] = comment; map['comment'] = comment;
if (attachments != null) { if (attachments != null) {
map['attachment'] = attachments!.map((v) => v.toJson()).toList(); map['attachments'] = attachments!.map((v) => v.toJson()).toList();
} }
return map; return map;
} }
@ -546,7 +546,11 @@ class AssetTransfer {
map['assetTransferEngineerTimers'] = assetTransferEngineerTimers!.map((v) => v.toJson()).toList(); map['assetTransferEngineerTimers'] = assetTransferEngineerTimers!.map((v) => v.toJson()).toList();
} }
if (modelAssistantEmployees != null) { if (modelAssistantEmployees != null) {
map['assetTransferAssistantEmployees'] = [modelAssistantEmployees!.toJson()]; if(modelAssistantEmployees!.employeeId!=null) {
map['assetTransferAssistantEmployees'] = [modelAssistantEmployees!.toJson()];
}else {
map['assetTransferAssistantEmployees'] =[];
}
} }
return map; return map;
} }

@ -129,27 +129,27 @@ class _CreateAssetTransferRequestState extends State<CreateAssetTransferRequest>
backgroundColor: AppColor.white936, backgroundColor: AppColor.white936,
onPick: (asset) async { onPick: (asset) async {
_pickedAsset = asset; _pickedAsset = asset;
await checkAssetForPendingServiceRequest(asset.id!.toInt()); // await checkAssetForPendingServiceRequest(asset.id!.toInt());
if (_pickedAsset != null && pendingAssetServiceRequest != null && pendingAssetServiceRequest!.details!.isNotEmpty) { // if (_pickedAsset != null && pendingAssetServiceRequest != null && pendingAssetServiceRequest!.details!.isNotEmpty) {
showPendingRequestBottomSheet(); // showPendingRequestBottomSheet();
} // }
setState(() {}); setState(() {});
}), }),
if (pendingAssetServiceRequest != null && pendingAssetServiceRequest!.details!.isNotEmpty) ...[ // if (pendingAssetServiceRequest != null && pendingAssetServiceRequest!.details!.isNotEmpty) ...[
8.height, // 8.height,
Row( // Row(
children: [ // children: [
const Icon(Icons.warning, color: Color(0xffEE404C), size: 14), // const Icon(Icons.warning, color: Color(0xffEE404C), size: 14),
8.width, // 8.width,
Text( // Text(
"This asset already have ${pendingAssetServiceRequest!.details!.length} request pending", // "This asset already have ${pendingAssetServiceRequest!.details!.length} request pending",
style: const TextStyle(fontSize: 12, fontWeight: FontWeight.w500, color: Color(0xff7D859A), decoration: TextDecoration.underline), // style: const TextStyle(fontSize: 12, fontWeight: FontWeight.w500, color: Color(0xff7D859A), decoration: TextDecoration.underline),
).expanded, // ).expanded,
], // ],
).onPress(() { // ).onPress(() {
showPendingRequests(); // showPendingRequests();
}), // }),
], // ],
21.height, 21.height,
requestTypeWidget(context), requestTypeWidget(context),
12.height, 12.height,
@ -177,6 +177,7 @@ class _CreateAssetTransferRequestState extends State<CreateAssetTransferRequest>
title: context.translation.building, title: context.translation.building,
initialValue: _assetDestination.building, initialValue: _assetDestination.building,
showShadow: false, showShadow: false,
showAsBottomSheet: true,
backgroundColor: AppColor.neutral100, backgroundColor: AppColor.neutral100,
enabled: _assetDestination.site?.buildings?.isNotEmpty ?? false, enabled: _assetDestination.site?.buildings?.isNotEmpty ?? false,
staticData: _assetDestination.site?.buildings ?? [], staticData: _assetDestination.site?.buildings ?? [],
@ -197,6 +198,7 @@ class _CreateAssetTransferRequestState extends State<CreateAssetTransferRequest>
context: context, context: context,
title: context.translation.floor, title: context.translation.floor,
showShadow: false, showShadow: false,
showAsBottomSheet: true,
initialValue: _assetDestination.floor, initialValue: _assetDestination.floor,
backgroundColor: AppColor.neutral100, backgroundColor: AppColor.neutral100,
enabled: _assetDestination.building?.floors?.isNotEmpty ?? false, enabled: _assetDestination.building?.floors?.isNotEmpty ?? false,
@ -212,6 +214,7 @@ class _CreateAssetTransferRequestState extends State<CreateAssetTransferRequest>
context: context, context: context,
title: context.translation.department, title: context.translation.department,
showShadow: false, showShadow: false,
showAsBottomSheet: true,
initialValue: _assetDestination.department, initialValue: _assetDestination.department,
backgroundColor: AppColor.neutral100, backgroundColor: AppColor.neutral100,
enabled: _assetDestination.floor?.departments?.isNotEmpty ?? false, enabled: _assetDestination.floor?.departments?.isNotEmpty ?? false,

Loading…
Cancel
Save