diff --git a/assets/langs/ar-SA.json b/assets/langs/ar-SA.json index 3f122fd..2427f5c 100644 --- a/assets/langs/ar-SA.json +++ b/assets/langs/ar-SA.json @@ -268,6 +268,9 @@ "summaryOfInformation": "ملخص المعلومات", "totalPayAmount": "المبلغ الإجمالي للدفع", "paymentInformation": "معلومات الدفع", + "performance": "تقييم الاداء", + "performanceEvaluation": "تقييم الأداء في", + "performanceEvaluationIn": "تقييم أدائك في", "amount": "مقدار", "correctCurrentDatails": "تعديل او اكمال التفاصيل الحالية", "selectType": " حدد نوع التغيير الذي تريد القيام به", @@ -313,7 +316,6 @@ "employeeDigitalID": "هويةالموظف الرقمية", "businessCard": "بطاقة العمل", "viewBusinessCard": "عرض بطاقة العمل", - "performanceEvaluation": "تقييم الأداء", "logout": "تسجيل خروج", "checkOut": "وقت الخروج", "regular": "منتظم", diff --git a/assets/langs/en-US.json b/assets/langs/en-US.json index faccbe7..01e878f 100644 --- a/assets/langs/en-US.json +++ b/assets/langs/en-US.json @@ -312,12 +312,14 @@ "wantToReject": "Are you sure want to reject?", "employeeDigitalID": "Employee Digital ID", "businessCard": "Business Card", - "viewBusinessCard": "View Business Card", - "performanceEvaluation": "Performance Evaluation", - "logout": "Logout", "checkOut": "Check Out", "regular": "Regular", "mark": "Mark", + "performance": "Performance Evaluation", + "performanceEvaluationIn": "Your performance Evaluation in ", + "viewBusinessCard": "View Business Card", + "performanceEvaluation": "Performance Evaluation", + "logout": "Logout", "selectMethodOfAttendance": "Select the method to mark the attendance", "comeNearHMGWifi": "Please come near to HMG wifi", "deliverNotificationToMeRegardless": "Deliver notifications to me regardless of any general rules", diff --git a/lib/api/profile_api_client.dart b/lib/api/profile_api_client.dart index b332499..7b4acd8 100644 --- a/lib/api/profile_api_client.dart +++ b/lib/api/profile_api_client.dart @@ -10,6 +10,7 @@ import 'package:mohem_flutter_app/models/get_employee_address_model.dart'; import 'package:mohem_flutter_app/models/get_employee_basic_details.model.dart'; import 'package:mohem_flutter_app/models/get_employee_contacts.model.dart'; import 'package:mohem_flutter_app/models/get_employee_phones_model.dart'; +import 'package:mohem_flutter_app/models/performance.dart'; import 'package:mohem_flutter_app/models/profile/get_countries_list_model.dart'; import 'package:mohem_flutter_app/models/profile/phone_number_types_model.dart'; import 'package:mohem_flutter_app/models/profile/start_address_approval_process_model.dart'; @@ -379,7 +380,7 @@ class ProfileApiClient { }, url, postParams); } - Future submetConatctTransactionAddAndUpdate(String actionType, int relationId, List> list) async { + Future submitContactTransactionAddAndUpdate(String actionType, int relationId, List> list) async { String url = "${ApiConsts.erpRest}SUBMIT_CONTACT_TRANSACTION"; Map postParams = { "P_MENU_TYPE": "E", @@ -395,4 +396,15 @@ class ProfileApiClient { return responseData.submitContactTransactionList; }, url, postParams); } + + Future?> getPerformanceAppraisal() async { + String url = "${ApiConsts.erpRest}GET_Performance_Appraisal"; + Map postParams = {}; + + postParams.addAll(AppState().postParamsJson); + return await ApiClient().postJsonForObject((json) { + GenericResponseModel? responseData = GenericResponseModel.fromJson(json); + return responseData.getPerformanceAppraisalList; + }, url, postParams); + } } diff --git a/lib/config/routes.dart b/lib/config/routes.dart index 4917314..587b43f 100644 --- a/lib/config/routes.dart +++ b/lib/config/routes.dart @@ -25,6 +25,7 @@ import 'package:mohem_flutter_app/ui/my_team/subordinate_leave.dart'; import 'package:mohem_flutter_app/ui/my_team/team_members.dart'; import 'package:mohem_flutter_app/ui/my_team/view_attendance.dart'; import 'package:mohem_flutter_app/ui/payslip/monthly_pay_slip_screen.dart'; +import 'package:mohem_flutter_app/ui/performance/performance.dart'; import 'package:mohem_flutter_app/ui/profile/add_update_family_member.dart'; import 'package:mohem_flutter_app/ui/profile/basic_details.dart'; import 'package:mohem_flutter_app/ui/profile/contact_details.dart'; @@ -144,6 +145,9 @@ class AppRoutes { //Pay slip static const String monthlyPaySlip = "/monthlyPaySlip"; + //performance evaluation + + static const String performanceEvaluation = "/performanceEvaluation"; //My Team static const String myTeam = "/myTeam"; static const String employeeDetails = "/employeeDetails"; @@ -153,7 +157,6 @@ class AppRoutes { static const String createRequest = "/createRequest"; static const String subordinateLeave = "/subordinateLeave"; - static final Map routes = { login: (context) => LoginScreen(), verifyLogin: (context) => VerifyLoginScreen(), @@ -234,6 +237,7 @@ class AppRoutes { //pay slip monthlyPaySlip: (context) => MonthlyPaySlipScreen(), + performanceEvaluation: (context) => PerformanceAppraisal(), //My Team myTeam: (context) => MyTeam(), @@ -243,9 +247,5 @@ class AppRoutes { teamMembers: (context) => TeamMembers(), createRequest: (context) => CreateRequest(), subordinateLeave: (context) => SubordinateLeave(), - - - - }; -} \ No newline at end of file +} diff --git a/lib/generated/codegen_loader.g.dart b/lib/generated/codegen_loader.g.dart index c4a10d4..c9e2ec5 100644 --- a/lib/generated/codegen_loader.g.dart +++ b/lib/generated/codegen_loader.g.dart @@ -284,6 +284,9 @@ class CodegenLoader extends AssetLoader{ "summaryOfInformation": "ملخص المعلومات", "totalPayAmount": "المبلغ الإجمالي للدفع", "paymentInformation": "معلومات الدفع", + "performance": "تقييم الاداء", + "performanceEvaluation": "تقييم الأداء في", + "performanceEvaluationIn": "تقييم أدائك في", "amount": "مقدار", "correctCurrentDatails": "تعديل او اكمال التفاصيل الحالية", "selectType": " حدد نوع التغيير الذي تريد القيام به", @@ -329,7 +332,6 @@ class CodegenLoader extends AssetLoader{ "employeeDigitalID": "هويةالموظف الرقمية", "businessCard": "بطاقة العمل", "viewBusinessCard": "عرض بطاقة العمل", - "performanceEvaluation": "تقييم الأداء", "logout": "تسجيل خروج", "checkOut": "وقت الخروج", "regular": "منتظم", @@ -748,12 +750,14 @@ static const Map en_US = { "wantToReject": "Are you sure want to reject?", "employeeDigitalID": "Employee Digital ID", "businessCard": "Business Card", - "viewBusinessCard": "View Business Card", - "performanceEvaluation": "Performance Evaluation", - "logout": "Logout", "checkOut": "Check Out", "regular": "Regular", "mark": "Mark", + "performance": "Performance Evaluation", + "performanceEvaluationIn": "Your performance Evaluation in ", + "viewBusinessCard": "View Business Card", + "performanceEvaluation": "Performance Evaluation", + "logout": "Logout", "selectMethodOfAttendance": "Select the method to mark the attendance", "comeNearHMGWifi": "Please come near to HMG wifi", "deliverNotificationToMeRegardless": "Deliver notifications to me regardless of any general rules", diff --git a/lib/generated/locale_keys.g.dart b/lib/generated/locale_keys.g.dart index 5cf6ba7..eb3fca2 100644 --- a/lib/generated/locale_keys.g.dart +++ b/lib/generated/locale_keys.g.dart @@ -269,6 +269,9 @@ abstract class LocaleKeys { static const summaryOfInformation = 'summaryOfInformation'; static const totalPayAmount = 'totalPayAmount'; static const paymentInformation = 'paymentInformation'; + static const performance = 'performance'; + static const performanceEvaluation = 'performanceEvaluation'; + static const performanceEvaluationIn = 'performanceEvaluationIn'; static const amount = 'amount'; static const correctCurrentDatails = 'correctCurrentDatails'; static const selectType = 'selectType'; @@ -314,7 +317,6 @@ abstract class LocaleKeys { static const employeeDigitalID = 'employeeDigitalID'; static const businessCard = 'businessCard'; static const viewBusinessCard = 'viewBusinessCard'; - static const performanceEvaluation = 'performanceEvaluation'; static const logout = 'logout'; static const checkOut = 'checkOut'; static const regular = 'regular'; diff --git a/lib/models/generic_response_model.dart b/lib/models/generic_response_model.dart index 11d7ec2..ccc53c1 100644 --- a/lib/models/generic_response_model.dart +++ b/lib/models/generic_response_model.dart @@ -66,6 +66,7 @@ import 'package:mohem_flutter_app/models/notification_action_model.dart'; import 'package:mohem_flutter_app/models/notification_get_respond_attributes_list_model.dart'; import 'package:mohem_flutter_app/models/pending_transactions/get_pending_transactions_details.dart'; import 'package:mohem_flutter_app/models/pending_transactions/get_req_functions.dart'; +import 'package:mohem_flutter_app/models/performance.dart'; import 'package:mohem_flutter_app/models/privilege_list_model.dart'; import 'package:mohem_flutter_app/models/profile/basic_details_cols_structions.dart'; import 'package:mohem_flutter_app/models/profile/basic_details_dff_structure.dart'; @@ -206,7 +207,11 @@ class GenericResponseModel { List? getOrganizationsSalariesList; List? getPaymentInformationList; List? getPayslipList; - List? getPerformanceAppraisalList; + + // List? getPendingReqDetailsList; + // List? getPendingReqFunctionsList; + List? getPerformanceAppraisalList; + List? getPhonesNotificationBodyList; List? getPoItemHistoryList; GetPoNotificationBodyList? getPoNotificationBodyList; @@ -227,7 +232,7 @@ class GenericResponseModel { List? getCCPDFFStructureModel; List? getSubordinatesAttdStatusList; List? getSubordinatesLeavesList; - List?getSubordinatesLeavesTotalVacationsList; + List? getSubordinatesLeavesTotalVacationsList; List? getSummaryOfPaymentList; List? getSwipesList; List? getTermColsStructureList; @@ -940,7 +945,8 @@ class GenericResponseModel { } // getPendingReqDetailsList = json['GetPendingReqDetailsList']; // getPendingReqFunctionsList = json['GetPendingReqFunctionsList']; - getPerformanceAppraisalList = json['GetPerformanceAppraisalList']; + getPerformanceAppraisalList = + json['GetPerformanceAppraisalList'] == null ? null : List.from(json["GetPerformanceAppraisalList"].map((x) => GetPerformanceAppraisalList.fromJson(x))); getPhonesNotificationBodyList = json["GetPhonesNotificationBodyList"] == null ? null : List.from(json["GetPhonesNotificationBodyList"].map((x) => GetPhonesNotificationBodyList.fromJson(x))); if (json['GetPoItemHistoryList'] != null) { @@ -993,11 +999,9 @@ class GenericResponseModel { } if (json['GetSubordinatesLeavesTotalVacationsList'] != null) { - getSubordinatesLeavesTotalVacationsList = - []; + getSubordinatesLeavesTotalVacationsList = []; json['GetSubordinatesLeavesTotalVacationsList'].forEach((v) { - getSubordinatesLeavesTotalVacationsList! - .add(new GetSubordinatesLeavesTotalVacationsList.fromJson(v)); + getSubordinatesLeavesTotalVacationsList!.add(new GetSubordinatesLeavesTotalVacationsList.fromJson(v)); }); } if (json['GetSummaryOfPaymentList'] != null) { @@ -1577,10 +1581,7 @@ class GenericResponseModel { } if (this.getSubordinatesLeavesTotalVacationsList != null) { - data['GetSubordinatesLeavesTotalVacationsList'] = this - .getSubordinatesLeavesTotalVacationsList! - .map((v) => v.toJson()) - .toList(); + data['GetSubordinatesLeavesTotalVacationsList'] = this.getSubordinatesLeavesTotalVacationsList!.map((v) => v.toJson()).toList(); } if (this.getSummaryOfPaymentList != null) { data['GetSummaryOfPaymentList'] = this.getSummaryOfPaymentList!.map((v) => v.toJson()).toList(); diff --git a/lib/models/performance.dart b/lib/models/performance.dart new file mode 100644 index 0000000..2fe8a5f --- /dev/null +++ b/lib/models/performance.dart @@ -0,0 +1,18 @@ +class GetPerformanceAppraisalList { + String? aPPRAISALSCORE; + int? aPPRAISALYEAR; + + GetPerformanceAppraisalList({this.aPPRAISALSCORE, this.aPPRAISALYEAR}); + + GetPerformanceAppraisalList.fromJson(Map json) { + aPPRAISALSCORE = json['APPRAISAL_SCORE']; + aPPRAISALYEAR = json['APPRAISAL_YEAR']; + } + + Map toJson() { + Map data = new Map(); + data['APPRAISAL_SCORE'] = this.aPPRAISALSCORE; + data['APPRAISAL_YEAR'] = this.aPPRAISALYEAR; + return data; + } +} diff --git a/lib/provider/dashboard_provider_model.dart b/lib/provider/dashboard_provider_model.dart index dca964d..a98d091 100644 --- a/lib/provider/dashboard_provider_model.dart +++ b/lib/provider/dashboard_provider_model.dart @@ -148,7 +148,7 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin { List drawerMenuItemList = [ DrawerMenuItem("assets/images/drawer/my_profile.svg", LocaleKeys.myProfile.tr(), AppRoutes.profile), - DrawerMenuItem("assets/images/drawer/performance_evaluation.svg", LocaleKeys.performanceEvaluation.tr(), ""), + DrawerMenuItem("assets/images/drawer/performance_evaluation.svg", LocaleKeys.performanceEvaluation.tr(), AppRoutes.performanceEvaluation), DrawerMenuItem("assets/images/drawer/mowadhafi.svg", LocaleKeys.mowadhafhi.tr(), AppRoutes.mowadhafhi), DrawerMenuItem("assets/images/drawer/pending_trasactions.svg", LocaleKeys.pendingTransactions.tr(), AppRoutes.pendingTransactions), DrawerMenuItem("assets/images/drawer/change_password.svg", LocaleKeys.changePassword.tr(), ""), diff --git a/lib/ui/landing/widget/services_widget.dart b/lib/ui/landing/widget/services_widget.dart index 719155c..d2e9208 100644 --- a/lib/ui/landing/widget/services_widget.dart +++ b/lib/ui/landing/widget/services_widget.dart @@ -115,6 +115,9 @@ class ServicesWidget extends StatelessWidget { } else if (menuEntry.requestType == "VACATION_RULE") { Navigator.pushNamed(context, AppRoutes.vacationRule); return; + } else if (menuEntry.menuName == "MBL_PERINFO_SS") { + Navigator.of(context).pushNamed(AppRoutes.profile); + return; } List menuList = pro.getMenuEntriesList?.where((element) => element.parentMenuName == menuEntry.menuName && element.menuEntryType == "FUNCTION").toList() ?? []; menuEntry.icon = ""; diff --git a/lib/ui/performance/performance.dart b/lib/ui/performance/performance.dart new file mode 100644 index 0000000..1d5e19c --- /dev/null +++ b/lib/ui/performance/performance.dart @@ -0,0 +1,114 @@ +import 'dart:io'; + +import 'package:easy_localization/easy_localization.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:mohem_flutter_app/api/profile_api_client.dart'; +import 'package:mohem_flutter_app/classes/colors.dart'; +import 'package:mohem_flutter_app/classes/utils.dart'; +import 'package:mohem_flutter_app/generated/locale_keys.g.dart'; +import 'package:mohem_flutter_app/models/performance.dart'; +import 'package:mohem_flutter_app/widgets/app_bar_widget.dart'; + +class PerformanceAppraisal extends StatefulWidget { + const PerformanceAppraisal({Key? key}) : super(key: key); + + @override + _PerformanceAppraisalState createState() => _PerformanceAppraisalState(); +} + +class _PerformanceAppraisalState extends State { + List performance = []; + @override + void initState() { + getPerformanceAppraisal(); + super.initState(); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: MyColors.backgroundColor, + appBar: AppBarWidget( + context, + title: LocaleKeys.performance.tr(), + ), + body: performance.isNotEmpty + ? SingleChildScrollView( + child: Container( + width: double.infinity, + padding: const EdgeInsets.only(left: 12, right: 12, top: 10, bottom: 10), + child: Column(children: [ + Row(children: [Expanded(flex: 1, child: getPerformanceCard(performance.first))]), + GridView.count( + crossAxisCount: 2, + shrinkWrap: true, + childAspectRatio:1.3, + children: performance + .where((GetPerformanceAppraisalList el) => performance.indexOf(el) != 0) + .map( + (GetPerformanceAppraisalList item) => getPerformanceCard(item), + ) + .toList(), + ) + ]))) + : Utils.getNoDataWidget(context), + ); + } + + Widget getPerformanceCard(GetPerformanceAppraisalList performance) { + return Card( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + child: Padding( + padding: const EdgeInsets.all(15), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + LocaleKeys.performanceEvaluationIn.tr() + performance.aPPRAISALYEAR.toString(), + style: const TextStyle(fontWeight: FontWeight.bold), + ), + const SizedBox( + height: 10, + ), + SliderTheme( + data: SliderThemeData(trackHeight: 3, thumbShape: SliderComponentShape.noThumb, overlayShape: SliderComponentShape.noOverlay), + child: Slider( + max: 100, + min: 0, + inactiveColor: Colors.grey.withOpacity(.4), + activeColor: Colors.green, + value: double.parse(performance.aPPRAISALSCORE!), + onChanged: (value) {}, + semanticFormatterCallback: (double newValue) { + return '${newValue.round()}'; + })), + const SizedBox( + height: 10, + ), + Text( + performance.aPPRAISALSCORE.toString() + '%', + style: const TextStyle( + fontWeight: FontWeight.bold, + fontSize: 18, + color: Colors.green, + ), + ), + ], + ))); + } + + void getPerformanceAppraisal() async { + try { + Utils.showLoading(context); + performance = (await ProfileApiClient().getPerformanceAppraisal())!; + setState(() {}); + Utils.hideLoading(context); + } catch (ex) { + Utils.hideLoading(context); + Utils.handleException(ex, context, null); + } + } +} diff --git a/lib/ui/profile/add_update_family_member.dart b/lib/ui/profile/add_update_family_member.dart index 224bfce..78d99de 100644 --- a/lib/ui/profile/add_update_family_member.dart +++ b/lib/ui/profile/add_update_family_member.dart @@ -448,9 +448,9 @@ class _AddUpdateFamilyMemberState extends State { Utils.showLoading(context); if (args['actionType'] == "ADD") { var relationID = null; - submitContactTransactionList = await ProfileApiClient().submetConatctTransactionAddAndUpdate(args['actionType'], relationID, valuesFinal); + submitContactTransactionList = await ProfileApiClient().submitContactTransactionAddAndUpdate(args['actionType'], relationID, valuesFinal); } else if (args['actionType'] == "UPDATE") { - submitContactTransactionList = await ProfileApiClient().submetConatctTransactionAddAndUpdate(args['actionType'], args['relationID'], valuesFinal); + submitContactTransactionList = await ProfileApiClient().submitContactTransactionAddAndUpdate(args['actionType'], args['relationID'], valuesFinal); } var transactionId = submitContactTransactionList!.pTRANSACTIONID; var itemKey = submitContactTransactionList!.pITEMKEY;