Worklist updates
							parent
							
								
									37ff4db9f6
								
							
						
					
					
						commit
						21d396b3bb
					
				
											
												
													File diff suppressed because one or more lines are too long
												
											
										
									
								| @ -0,0 +1,48 @@ | ||||
| class GetRFCEmployeeList { | ||||
|   String? aCTION; | ||||
|   String? eMPLOYEEDISPLAYNAME; | ||||
|   String? eMPLOYEEIMAGE; | ||||
|   int? fROMROWNUM; | ||||
|   int? nOOFROWS; | ||||
|   int? rOWNUM; | ||||
|   int? sEQ; | ||||
|   int? tOROWNUM; | ||||
|   String? uSERNAME; | ||||
| 
 | ||||
|   GetRFCEmployeeList( | ||||
|       {this.aCTION, | ||||
|         this.eMPLOYEEDISPLAYNAME, | ||||
|         this.eMPLOYEEIMAGE, | ||||
|         this.fROMROWNUM, | ||||
|         this.nOOFROWS, | ||||
|         this.rOWNUM, | ||||
|         this.sEQ, | ||||
|         this.tOROWNUM, | ||||
|         this.uSERNAME}); | ||||
| 
 | ||||
|   GetRFCEmployeeList.fromJson(Map<String, dynamic> json) { | ||||
|     aCTION = json['ACTION']; | ||||
|     eMPLOYEEDISPLAYNAME = json['EMPLOYEE_DISPLAY_NAME']; | ||||
|     eMPLOYEEIMAGE = json['EMPLOYEE_IMAGE']; | ||||
|     fROMROWNUM = json['FROM_ROW_NUM']; | ||||
|     nOOFROWS = json['NO_OF_ROWS']; | ||||
|     rOWNUM = json['ROW_NUM']; | ||||
|     sEQ = json['SEQ']; | ||||
|     tOROWNUM = json['TO_ROW_NUM']; | ||||
|     uSERNAME = json['USER_NAME']; | ||||
|   } | ||||
| 
 | ||||
|   Map<String, dynamic> toJson() { | ||||
|     Map<String, dynamic> data = new Map<String, dynamic>(); | ||||
|     data['ACTION'] = this.aCTION; | ||||
|     data['EMPLOYEE_DISPLAY_NAME'] = this.eMPLOYEEDISPLAYNAME; | ||||
|     data['EMPLOYEE_IMAGE'] = this.eMPLOYEEIMAGE; | ||||
|     data['FROM_ROW_NUM'] = this.fROMROWNUM; | ||||
|     data['NO_OF_ROWS'] = this.nOOFROWS; | ||||
|     data['ROW_NUM'] = this.rOWNUM; | ||||
|     data['SEQ'] = this.sEQ; | ||||
|     data['TO_ROW_NUM'] = this.tOROWNUM; | ||||
|     data['USER_NAME'] = this.uSERNAME; | ||||
|     return data; | ||||
|   } | ||||
| } | ||||
| @ -0,0 +1,22 @@ | ||||
| class ResubmitEITRequestResponse { | ||||
|   String? pRETURNMSG; | ||||
|   String? pRETURNSTATUS; | ||||
|   int? pTRANSACTIONID; | ||||
| 
 | ||||
|   ResubmitEITRequestResponse( | ||||
|       {this.pRETURNMSG, this.pRETURNSTATUS, this.pTRANSACTIONID}); | ||||
| 
 | ||||
|   ResubmitEITRequestResponse.fromJson(Map<String, dynamic> json) { | ||||
|     pRETURNMSG = json['P_RETURN_MSG']; | ||||
|     pRETURNSTATUS = json['P_RETURN_STATUS']; | ||||
|     pTRANSACTIONID = json['P_TRANSACTION_ID']; | ||||
|   } | ||||
| 
 | ||||
|   Map<String, dynamic> toJson() { | ||||
|     Map<String, dynamic> data = new Map<String, dynamic>(); | ||||
|     data['P_RETURN_MSG'] = this.pRETURNMSG; | ||||
|     data['P_RETURN_STATUS'] = this.pRETURNSTATUS; | ||||
|     data['P_TRANSACTION_ID'] = this.pTRANSACTIONID; | ||||
|     return data; | ||||
|   } | ||||
| } | ||||
| @ -0,0 +1,131 @@ | ||||
| import 'package:easy_localization/easy_localization.dart'; | ||||
| import 'package:flutter/material.dart'; | ||||
| import 'package:mohem_flutter_app/api/my_attendance_api_client.dart'; | ||||
| import 'package:mohem_flutter_app/classes/utils.dart'; | ||||
| import 'package:mohem_flutter_app/config/routes.dart'; | ||||
| import 'package:mohem_flutter_app/extensions/int_extensions.dart'; | ||||
| import 'package:mohem_flutter_app/extensions/string_extensions.dart'; | ||||
| import 'package:mohem_flutter_app/extensions/widget_extensions.dart'; | ||||
| import 'package:mohem_flutter_app/generated/locale_keys.g.dart'; | ||||
| import 'package:mohem_flutter_app/models/worklist/hr/eit_otification_body_model.dart'; | ||||
| import 'package:mohem_flutter_app/models/worklist/resubmit_eit_response_model.dart'; | ||||
| import 'package:mohem_flutter_app/models/worklist_response_model.dart'; | ||||
| import 'package:mohem_flutter_app/ui/misc/request_submit_screen.dart'; | ||||
| import 'package:mohem_flutter_app/ui/my_attendance/dynamic_screens/dynamic_listview_screen.dart'; | ||||
| import 'package:mohem_flutter_app/widgets/button/default_button.dart'; | ||||
| import 'package:mohem_flutter_app/widgets/item_detail_view_widget.dart'; | ||||
| 
 | ||||
| class UpdateContinueSheet extends StatefulWidget { | ||||
|   WorkListResponseModel? workListData; | ||||
|   List<GetEitCollectionNotificationBodyList>? getEitCollectionNotificationBodyList; | ||||
|   DynamicListViewParams? dynamicParams; | ||||
| 
 | ||||
|   UpdateContinueSheet({this.workListData, this.getEitCollectionNotificationBodyList, this.dynamicParams, Key? key}) : super(key: key); | ||||
| 
 | ||||
|   @override | ||||
|   State<UpdateContinueSheet> createState() => _UpdateContinueSheetState(); | ||||
| } | ||||
| 
 | ||||
| class _UpdateContinueSheetState extends State<UpdateContinueSheet> { | ||||
|   double itemHeight = 0; | ||||
|   double itemWidth = 0; | ||||
| 
 | ||||
|   @override | ||||
|   Widget build(BuildContext context) { | ||||
|     var size = MediaQuery.of(context).size; | ||||
|     itemHeight = (size.height - kToolbarHeight - 24) / 9; | ||||
|     itemWidth = size.width / 2; | ||||
|     return Column( | ||||
|       children: [ | ||||
|         if ((widget.workListData?.sUBJECT ?? "").isNotEmpty) widget.workListData!.sUBJECT!.toText14().paddingOnly(top: 10, right: 21, left: 21, bottom: 21), | ||||
|         ListView.separated( | ||||
|           shrinkWrap: true, | ||||
|           physics: const NeverScrollableScrollPhysics(), | ||||
|           itemBuilder: (cxt, index) { | ||||
|             List<CollectionNotificationEit> dataList = widget.getEitCollectionNotificationBodyList!.isEmpty ? [] : (widget.getEitCollectionNotificationBodyList![index].collectionNotification ?? []); | ||||
|             dataList = dataList.where((o) => o.displayFlag == "Y").toList(); | ||||
|             bool isOdd = false; | ||||
|             if (dataList.length % 2 != 0) { | ||||
|               isOdd = true; | ||||
|               dataList.add(new CollectionNotificationEit()); | ||||
|             } | ||||
|             return GridView.builder( | ||||
|               itemCount: dataList.length, | ||||
|               shrinkWrap: true, | ||||
|               physics: const NeverScrollableScrollPhysics(), | ||||
|               itemBuilder: (context, index) => ItemDetailViewGridItem( | ||||
|                 index, | ||||
|                 dataList[index].segmentPrompt, | ||||
|                 dataList[index].segmentValueDsp, | ||||
|                 isNeedToShowEmptyDivider: (dataList.length == index + 1) | ||||
|                     ? isOdd | ||||
|                         ? true | ||||
|                         : false | ||||
|                     : false, | ||||
|               ), | ||||
|               gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( | ||||
|                 crossAxisCount: 2, | ||||
|                 childAspectRatio: (itemWidth / itemHeight), | ||||
|               ), | ||||
|             ).objectContainerView(); | ||||
|           }, | ||||
|           separatorBuilder: (cxt, index) => 12.height, | ||||
|           itemCount: widget.getEitCollectionNotificationBodyList!.length, | ||||
|         ), | ||||
|         Padding( | ||||
|           padding: const EdgeInsets.only(right: 21, left: 21, bottom: 21), | ||||
|           child: Row( | ||||
|             children: [ | ||||
|               DefaultButton( | ||||
|                 LocaleKeys.edit.tr(), | ||||
|                 () => performEditAction(), | ||||
|                 colors: const [Color(0xffE47A7E), Color(0xffDE6D71)], | ||||
|               ).expanded, | ||||
|               8.width, | ||||
|               DefaultButton( | ||||
|                 LocaleKeys.next.tr(), | ||||
|                 () => performNextAction(), | ||||
|                 colors: const [Color(0xff28C884), Color(0xff1BB271)], | ||||
|               ).expanded, | ||||
|             ], | ||||
|           ), | ||||
|         ), | ||||
|       ], | ||||
|     ); | ||||
|   } | ||||
| 
 | ||||
|   void performNextAction() async { | ||||
|     //Resubmit EIT Transaction | ||||
|     try { | ||||
|       Utils.showLoading(context); | ||||
|       List<Map<String, dynamic>> values = []; | ||||
|       for (GetEitCollectionNotificationBodyList element in widget.getEitCollectionNotificationBodyList!) { | ||||
|         for (CollectionNotificationEit collectionElement in element.collectionNotification!) { | ||||
|           values.add({ | ||||
|             "TRANSACTION_NUMBER": collectionElement.transactionNumber, | ||||
|             "NAME": collectionElement.applicationColumnName, | ||||
|             "VARCHAR2_VALUE": collectionElement.varchar2Value, | ||||
|             "NUMBER_VALUE": collectionElement.numberValue, | ||||
|             "DATE_VALUE": collectionElement.dateValue, | ||||
|           }); | ||||
|         } | ||||
|       } | ||||
|       ResubmitEITRequestResponse resubmitEITRequestResponse = await MyAttendanceApiClient().reSubmitEitTransaction(widget.workListData!.iTEMKEY!, widget.workListData!.nOTIFICATIONID, values); | ||||
|       Utils.hideLoading(context); | ||||
|       await Navigator.pushNamed( | ||||
|         context, | ||||
|         AppRoutes.requestSubmitScreen, | ||||
|         arguments: RequestSubmitScreenParams(LocaleKeys.submit.tr(), resubmitEITRequestResponse.pTRANSACTIONID!, widget.workListData!.iTEMKEY!, 'eit'), | ||||
|       ); | ||||
|     } catch (ex) { | ||||
|       Utils.hideLoading(context); | ||||
|       Utils.handleException(ex, context, null); | ||||
|     } | ||||
|   } | ||||
| 
 | ||||
|   void performEditAction() { | ||||
|     //Open EIT Edit Screen | ||||
| 
 | ||||
|     Navigator.pushNamed(context, AppRoutes.addDynamicInput, arguments: widget.dynamicParams); | ||||
|   } | ||||
| } | ||||
					Loading…
					
					
				
		Reference in New Issue