basic details

merge-requests/1/merge
Sultan Khan 3 years ago
parent b10e6184d6
commit 3c777d220e

@ -17,6 +17,7 @@ import 'package:mohem_flutter_app/models/profile/submit_address_transaction.dart
import 'package:mohem_flutter_app/models/profile/basic_details_dff_structure.dart'; import 'package:mohem_flutter_app/models/profile/basic_details_dff_structure.dart';
import 'package:mohem_flutter_app/models/profile/get_contact_clos_structure_list.dart'; import 'package:mohem_flutter_app/models/profile/get_contact_clos_structure_list.dart';
import 'package:mohem_flutter_app/models/profile/get_contact_details_list.dart'; import 'package:mohem_flutter_app/models/profile/get_contact_details_list.dart';
import 'package:mohem_flutter_app/models/profile/submit_basic_details_transaction_model.dart';
import 'package:mohem_flutter_app/models/profile/submit_contact_transaction_list_model.dart'; import 'package:mohem_flutter_app/models/profile/submit_contact_transaction_list_model.dart';
import 'package:mohem_flutter_app/models/profile/submit_phone_transactions.dart'; import 'package:mohem_flutter_app/models/profile/submit_phone_transactions.dart';
import 'package:mohem_flutter_app/models/start_phone_approval_process_model.dart'; import 'package:mohem_flutter_app/models/start_phone_approval_process_model.dart';
@ -94,7 +95,7 @@ class ProfileApiClient {
Future<GenericResponseModel> getDffStructure(String pFunctionName, String uRL, String requestType) async { Future<GenericResponseModel> getDffStructure(String pFunctionName, String uRL, String requestType) async {
String url = ApiConsts.erpRest + uRL; String url = ApiConsts.erpRest + uRL;
Map<String, dynamic> postParams = {"P_SELECTED_RESP_ID": -999, "P_MENU_TYPE": "E", "P_FUNCTION_NAME": pFunctionName, "P_COUNTRY_CODE": "SA"}; Map<String, dynamic> postParams = {"P_SELECTED_RESP_ID": -999, "P_MENU_TYPE": "E", "P_REQUEST_TYPE": pFunctionName, "P_COUNTRY_CODE": "SA"};
postParams.addAll(AppState().postParamsJson); postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) { return await ApiClient().postJsonForObject((json) {
GenericResponseModel? responseData = GenericResponseModel.fromJson(json); GenericResponseModel? responseData = GenericResponseModel.fromJson(json);
@ -244,7 +245,7 @@ class ProfileApiClient {
}, url, postParams); }, url, postParams);
} }
Future<Map<String, dynamic>> submitBasicDetailsTransaction(String pDescFlexContextCode, String pFunctionName, List<Map<String, dynamic>> list, int correctOrNew) async { Future<SubmitBasicDetailsTransactionList> submitBasicDetailsTransaction(String pDescFlexContextCode, String pFunctionName, List<Map<String, dynamic>> list, int correctOrNew) async {
String url = "${ApiConsts.erpRest}SUBMIT_BASIC_DET_TRANSACTION"; String url = "${ApiConsts.erpRest}SUBMIT_BASIC_DET_TRANSACTION";
Map<String, dynamic> postParams = { Map<String, dynamic> postParams = {
"P_SELECTED_RESP_ID": -999, "P_SELECTED_RESP_ID": -999,
@ -264,6 +265,23 @@ class ProfileApiClient {
}, url, postParams); }, url, postParams);
} }
Future<StartAddressApprovalProcess?> startBasicDetailsApprovalProcess(String action, String comments, String itemKey, int transactionId) async {
String url = "${ApiConsts.erpRest}START_BASIC_DET_APPR_PROCESS";
Map<String, dynamic> postParams = {
"P_SELECTED_RESP_ID": -999,
"P_MENU_TYPE": "E",
"P_ACTION_MODE": action,
"P_COMMENTS": comments,
"P_ITEM_KEY": itemKey,
"P_TRANSACTION_ID": transactionId,
};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) {
GenericResponseModel? responseData = GenericResponseModel.fromJson(json);
return responseData.startAddressApprovalProcessList;
}, url, postParams);
}
Future<SubmitAddressTransaction> submitAddressTransaction( Future<SubmitAddressTransaction> submitAddressTransaction(
String pDescFlexContextCode, String pFunctionName, List<Map<String, dynamic>> list, int correctOrNew, String countryCode, String effectiveDate) async { String pDescFlexContextCode, String pFunctionName, List<Map<String, dynamic>> list, int correctOrNew, String countryCode, String effectiveDate) async {
String url = "${ApiConsts.erpRest}SUBMIT_ADDRESS_TRANSACTION"; String url = "${ApiConsts.erpRest}SUBMIT_ADDRESS_TRANSACTION";

@ -291,7 +291,9 @@ class CodegenLoader extends AssetLoader{
"basicDetails": "تفاصيل أساسية", "basicDetails": "تفاصيل أساسية",
"address": "تبوك", "address": "تبوك",
"contactDetails": "بيانات التواصل", "contactDetails": "بيانات التواصل",
"familyDetails": "تفاصيل عائلية" "familyDetails": "تفاصيل عائلية",
"effectiveDate": "تاريخ النفاذ",
"country": "دولة"
}, },
"clicked": { "clicked": {
"zero": "You clicked {} times!", "zero": "You clicked {} times!",
@ -589,7 +591,9 @@ static const Map<String,dynamic> en_US = {
"basicDetails": "Basic Details", "basicDetails": "Basic Details",
"address": "Address", "address": "Address",
"contactDetails": "Contact Details", "contactDetails": "Contact Details",
"familyDetails": "Family Members" "familyDetails": "Family Members",
"effectiveDate": "Effective Date",
"country": "Country"
}, },
"clicked": { "clicked": {
"zero": "You clicked {} times!", "zero": "You clicked {} times!",

@ -265,8 +265,6 @@ abstract class LocaleKeys {
static const paymentInformation = 'paymentInformation'; static const paymentInformation = 'paymentInformation';
static const amount = 'amount'; static const amount = 'amount';
static const profile_reset_password_label = 'profile.reset_password.label'; static const profile_reset_password_label = 'profile.reset_password.label';
static const profile_effectiveDate = 'profile.effectiveDate';
static const profile_country = 'profile.country';
static const profile_reset_password_username = 'profile.reset_password.username'; static const profile_reset_password_username = 'profile.reset_password.username';
static const profile_reset_password_password = 'profile.reset_password.password'; static const profile_reset_password_password = 'profile.reset_password.password';
static const profile_reset_password = 'profile.reset_password'; static const profile_reset_password = 'profile.reset_password';
@ -277,9 +275,12 @@ abstract class LocaleKeys {
static const profile_address = 'profile.address'; static const profile_address = 'profile.address';
static const profile_contactDetails = 'profile.contactDetails'; static const profile_contactDetails = 'profile.contactDetails';
static const profile_familyDetails = 'profile.familyDetails'; static const profile_familyDetails = 'profile.familyDetails';
static const profile_effectiveDate = 'profile.effectiveDate';
static const profile_country = 'profile.country';
static const profile = 'profile'; static const profile = 'profile';
static const clicked = 'clicked'; static const clicked = 'clicked';
static const gender_with_arg = 'gender.with_arg'; static const gender_with_arg = 'gender.with_arg';
static const gender = 'gender'; static const gender = 'gender';
static const reset_locale = 'reset_locale'; static const reset_locale = 'reset_locale';
} }

@ -61,6 +61,7 @@ import 'package:mohem_flutter_app/models/profile/start_address_approval_process_
import 'package:mohem_flutter_app/models/profile/submit_address_transaction.dart'; import 'package:mohem_flutter_app/models/profile/submit_address_transaction.dart';
import 'package:mohem_flutter_app/models/profile/get_contact_clos_structure_list.dart'; import 'package:mohem_flutter_app/models/profile/get_contact_clos_structure_list.dart';
import 'package:mohem_flutter_app/models/profile/get_contact_details_list.dart'; import 'package:mohem_flutter_app/models/profile/get_contact_details_list.dart';
import 'package:mohem_flutter_app/models/profile/submit_basic_details_transaction_model.dart';
import 'package:mohem_flutter_app/models/start_eit_approval_process_model.dart'; import 'package:mohem_flutter_app/models/start_eit_approval_process_model.dart';
import 'package:mohem_flutter_app/models/start_phone_approval_process_model.dart'; import 'package:mohem_flutter_app/models/start_phone_approval_process_model.dart';
import 'package:mohem_flutter_app/models/submit_eit_transaction_list_model.dart'; import 'package:mohem_flutter_app/models/submit_eit_transaction_list_model.dart';
@ -304,7 +305,7 @@ class GenericResponseModel {
String? startSitApprovalProcess; String? startSitApprovalProcess;
String? startTermApprovalProcessList; String? startTermApprovalProcessList;
SubmitAddressTransaction? submitAddressTransactionList; SubmitAddressTransaction? submitAddressTransactionList;
Map<String, dynamic>? submitBasicDetTransactionList; SubmitBasicDetailsTransactionList? submitBasicDetTransactionList;
String? submitCEITransactionList; String? submitCEITransactionList;
String? submitCcpTransactionList; String? submitCcpTransactionList;
SubmitContactTransactionList? submitContactTransactionList; SubmitContactTransactionList? submitContactTransactionList;
@ -1153,7 +1154,7 @@ class GenericResponseModel {
startTermApprovalProcessList = json['StartTermApprovalProcessList']; startTermApprovalProcessList = json['StartTermApprovalProcessList'];
submitAddressTransactionList = json['SubmitAddressTransactionList'] != null ? new SubmitAddressTransaction.fromJson(json['SubmitAddressTransactionList']) : null; submitAddressTransactionList = json['SubmitAddressTransactionList'] != null ? new SubmitAddressTransaction.fromJson(json['SubmitAddressTransactionList']) : null;
submitBasicDetTransactionList = json['SubmitBasicDetTransactionList']; submitBasicDetTransactionList = json['SubmitBasicDetTransactionList'] != null ? new SubmitBasicDetailsTransactionList.fromJson(json['SubmitBasicDetTransactionList']) : null;
submitCEITransactionList = json['SubmitCEITransactionList']; submitCEITransactionList = json['SubmitCEITransactionList'];
submitCcpTransactionList = json['SubmitCcpTransactionList']; submitCcpTransactionList = json['SubmitCcpTransactionList'];
submitContactTransactionList = json['SubmitContactTransactionList'] != null ? new SubmitContactTransactionList.fromJson(json['SubmitContactTransactionList']) : null; submitContactTransactionList = json['SubmitContactTransactionList'] != null ? new SubmitContactTransactionList.fromJson(json['SubmitContactTransactionList']) : null;
@ -1545,7 +1546,10 @@ class GenericResponseModel {
if (this.submitAddressTransactionList != null) { if (this.submitAddressTransactionList != null) {
data['SubmitAddressTransactionList'] = this.submitAddressTransactionList!.toJson(); data['SubmitAddressTransactionList'] = this.submitAddressTransactionList!.toJson();
} }
data['SubmitBasicDetTransactionList'] = this.submitBasicDetTransactionList; if (this.submitBasicDetTransactionList != null) {
data['SubmitBasicDetTransactionList'] = this.submitBasicDetTransactionList!.toJson();
}
data['SubmitCEITransactionList'] = this.submitCEITransactionList; data['SubmitCEITransactionList'] = this.submitCEITransactionList;
data['SubmitCcpTransactionList'] = this.submitCcpTransactionList; data['SubmitCcpTransactionList'] = this.submitCcpTransactionList;
data['SubmitContactTransactionList'] = this.submitContactTransactionList; data['SubmitContactTransactionList'] = this.submitContactTransactionList;

@ -0,0 +1,24 @@
class SubmitBasicDetailsTransactionList {
String? pITEMKEY;
String? pRETURNMSG;
String? pRETURNSTATUS;
int? pTRANSACTIONID;
SubmitBasicDetailsTransactionList({this.pITEMKEY, this.pRETURNMSG, this.pRETURNSTATUS, this.pTRANSACTIONID});
SubmitBasicDetailsTransactionList.fromJson(Map<String, dynamic> json) {
pITEMKEY = json['P_ITEM_KEY'];
pRETURNMSG = json['P_RETURN_MSG'];
pRETURNSTATUS = json['P_RETURN_STATUS'];
pTRANSACTIONID = json['P_TRANSACTION_ID'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['P_ITEM_KEY'] = this.pITEMKEY;
data['P_RETURN_MSG'] = this.pRETURNMSG;
data['P_RETURN_STATUS'] = this.pRETURNSTATUS;
data['P_TRANSACTION_ID'] = this.pTRANSACTIONID;
return data;
}
}

@ -1,5 +1,6 @@
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:mohem_flutter_app/models/dashboard/menu_entries.dart';
class ProfileMenu { class ProfileMenu {
final String name; final String name;
@ -8,5 +9,6 @@ class ProfileMenu {
final String dynamicUrl; final String dynamicUrl;
final String functionName; final String functionName;
final String requestID; final String requestID;
ProfileMenu({this.name = '', this.icon = '', this.route = '', this.dynamicUrl = '', this.functionName = '', this.requestID = ''}); final GetMenuEntriesList menuEntries;
ProfileMenu({this.name = '', this.icon = '', this.route = '', this.dynamicUrl = '', this.functionName = '', this.requestID = '', required this.menuEntries});
} }

@ -106,6 +106,13 @@ class _RequestSubmitScreenState extends State<RequestSubmitScreen> {
params!.transactionId!.toInt(), params!.transactionId!.toInt(),
params!.pItemId.toString(), params!.pItemId.toString(),
); );
} else if (params!.approvalFlag == 'basicDetails') {
await ProfileApiClient().startBasicDetailsApprovalProcess(
"SUBMIT",
comments.text,
params!.pItemId,
params!.transactionId,
);
} else { } else {
await MyAttendanceApiClient().startEitApprovalProcess( await MyAttendanceApiClient().startEitApprovalProcess(
"SUBMIT", "SUBMIT",

@ -66,7 +66,6 @@ class _AddUpdateFamilyMemberState extends State<AddUpdateFamilyMember> {
getContactColsStructureList = await ProfileApiClient().getContactColsStructureList(args['actionType']); getContactColsStructureList = await ProfileApiClient().getContactColsStructureList(args['actionType']);
getContactDffStructureList = await ProfileApiClient().getContactDffStructureList(); getContactDffStructureList = await ProfileApiClient().getContactDffStructureList();
if (args['actionType'] == "ADD") { if (args['actionType'] == "ADD") {
getBasicDetDffStructureList?.forEach((element) { getBasicDetDffStructureList?.forEach((element) {
element?.getContactDetailsList = new GetContactDetailsList(); element?.getContactDetailsList = new GetContactDetailsList();
}); });
@ -76,8 +75,7 @@ if(args['actionType']== "ADD"){
getContactDffStructureList?.forEach((element) { getContactDffStructureList?.forEach((element) {
element?.getContactDetailsList = new GetContactDetailsList(); element?.getContactDetailsList = new GetContactDetailsList();
}); });
} } else if (args['actionType'] == "UPDATE") {
else if(args['actionType']== "UPDATE") {
getContactDetailsList = await ProfileApiClient().getContactDetailsList(args['relationID']); getContactDetailsList = await ProfileApiClient().getContactDetailsList(args['relationID']);
getBasicDetDffStructureList?.forEach((element) { getBasicDetDffStructureList?.forEach((element) {
@ -87,7 +85,6 @@ else if(args['actionType']== "UPDATE") {
element?.getContactDetailsList = getContactDetailsList?.singleWhere((userDetail) => userDetail?.aPPLICATIONCOLUMNNAME == element?.aPPLICATIONCOLUMNNAME); element?.getContactDetailsList = getContactDetailsList?.singleWhere((userDetail) => userDetail?.aPPLICATIONCOLUMNNAME == element?.aPPLICATIONCOLUMNNAME);
}); });
getContactDffStructureList?.forEach((element) { getContactDffStructureList?.forEach((element) {
element?.getContactDetailsList = getContactDetailsList?.singleWhere((userDetail) => userDetail?.aPPLICATIONCOLUMNNAME == element?.aPPLICATIONCOLUMNNAME); element?.getContactDetailsList = getContactDetailsList?.singleWhere((userDetail) => userDetail?.aPPLICATIONCOLUMNNAME == element?.aPPLICATIONCOLUMNNAME);
}); });
@ -100,13 +97,11 @@ else if(args['actionType']== "UPDATE") {
} }
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
if (args == null) { if (args == null) {
args = ModalRoute.of(context)!.settings.arguments; args = ModalRoute.of(context)!.settings.arguments;
callAddAndUpdateFamilyMember(); callAddAndUpdateFamilyMember();
} }
return Scaffold( return Scaffold(
appBar: AppBarWidget( appBar: AppBarWidget(
@ -205,8 +200,7 @@ else if(args['actionType']== "UPDATE") {
isEnable: false, isEnable: false,
isPopup: true, isPopup: true,
).paddingOnly(bottom: 12), ).paddingOnly(bottom: 12),
itemBuilder: (_) => itemBuilder: (_) => <PopupMenuItem<int>>[
<PopupMenuItem<int>>[
for (int i = 0; i < getContactColsStructureList[index]!.objectValuesList!.length; i++) for (int i = 0; i < getContactColsStructureList[index]!.objectValuesList!.length; i++)
PopupMenuItem<int>(child: Text(getContactColsStructureList[index]!.objectValuesList![i].mEANING.toString()), value: i), PopupMenuItem<int>(child: Text(getContactColsStructureList[index]!.objectValuesList![i].mEANING.toString()), value: i),
], ],
@ -372,7 +366,7 @@ else if(args['actionType']== "UPDATE") {
return time; return time;
} }
footer() { Widget footer() {
return Row( return Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
@ -456,8 +450,7 @@ else if(args['actionType']== "UPDATE") {
dateVal = null; dateVal = null;
vatcherVal = null; vatcherVal = null;
numberVal = e!.getContactDetailsList!.nUMBERVALUE; numberVal = e!.getContactDetailsList!.nUMBERVALUE;
}else{ } else {}
}
return ValidateEitTransactionModel(dATEVALUE: dateVal, nAME: e.aPPLICATIONCOLUMNNAME, nUMBERVALUE: numberVal, tRANSACTIONNUMBER: 1, vARCHAR2VALUE: vatcherVal.toString()).toJson(); return ValidateEitTransactionModel(dATEVALUE: dateVal, nAME: e.aPPLICATIONCOLUMNNAME, nUMBERVALUE: numberVal, tRANSACTIONNUMBER: 1, vARCHAR2VALUE: vatcherVal.toString()).toJson();
}).toList(); }).toList();
List<Map<String, dynamic>> valuesFinal = [...values1, ...values2, ...values3]; List<Map<String, dynamic>> valuesFinal = [...values1, ...values2, ...values3];
@ -473,8 +466,7 @@ else if(args['actionType']== "UPDATE") {
Utils.hideLoading(context); Utils.hideLoading(context);
Navigator.pushNamed(context, AppRoutes.requestSubmitScreen, Navigator.pushNamed(context, AppRoutes.requestSubmitScreen,
arguments: RequestSubmitScreenParams(LocaleKeys.profile_familyDetails.tr(), transactionId!.toInt(), itemKey.toString(), 'family_member')); arguments: RequestSubmitScreenParams(LocaleKeys.profile_familyDetails.tr(), transactionId!.toInt(), itemKey.toString(), 'family_member'));
setState(() {} setState(() {});
);
} catch (ex) { } catch (ex) {
Utils.hideLoading(context); Utils.hideLoading(context);
Utils.handleException(ex, context, null); Utils.handleException(ex, context, null);

@ -48,7 +48,8 @@ class _DeleteFamilyMemberState extends State<DeleteFamilyMember> {
var itemKey = submitContactTransactionList!.pITEMKEY; var itemKey = submitContactTransactionList!.pITEMKEY;
Utils.hideLoading(context); Utils.hideLoading(context);
// getApprovesList = await ProfileApiClient().getApproves(transactionId!.toInt(), itemKey.toString() ); // getApprovesList = await ProfileApiClient().getApproves(transactionId!.toInt(), itemKey.toString() );
Navigator.pushNamed(context, AppRoutes.requestSubmitScreen,arguments: RequestSubmitScreenParams(LocaleKeys.profile_familyDetails.tr(), transactionId!.toInt(), itemKey.toString(), 'family_member')); Navigator.pushNamed(context, AppRoutes.requestSubmitScreen,
arguments: RequestSubmitScreenParams(LocaleKeys.profile_familyDetails.tr(), transactionId!.toInt(), itemKey.toString(), 'family_member'));
setState(() {}); setState(() {});
} catch (ex) { } catch (ex) {
@ -88,7 +89,7 @@ class _DeleteFamilyMemberState extends State<DeleteFamilyMember> {
)); ));
} }
footer() { Widget footer() {
return Row( return Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
@ -104,7 +105,6 @@ class _DeleteFamilyMemberState extends State<DeleteFamilyMember> {
), ),
onPressed: () { onPressed: () {
deleteFamilyMember(datePar); deleteFamilyMember(datePar);
}, },
child: Text( child: Text(
LocaleKeys.next.tr(), LocaleKeys.next.tr(),

@ -194,7 +194,7 @@ class _DynamicInputScreenState extends State<DynamicInputScreenAddress> {
for (int i = 0; i < model.eSERVICESVS!.length; i++) PopupMenuItem<int>(child: Text(model.eSERVICESVS![i].vALUECOLUMNNAME!), value: i), for (int i = 0; i < model.eSERVICESVS!.length; i++) PopupMenuItem<int>(child: Text(model.eSERVICESVS![i].vALUECOLUMNNAME!), value: i),
], ],
onSelected: (int popupIndex) { onSelected: (int popupIndex) {
model?.getEmployeeAddressList!.sEGMENTVALUEDSP = model.eSERVICESVS![popupIndex].vALUECOLUMNNAME!; model?.getEmployeeAddressList!.sEGMENTVALUEDSP = model.eSERVICESVS![popupIndex].vALUECOLUMNNAME;
model?.getEmployeeAddressList!.vARCHAR2VALUE = model.eSERVICESVS![popupIndex].dESCRIPTION; model?.getEmployeeAddressList!.vARCHAR2VALUE = model.eSERVICESVS![popupIndex].dESCRIPTION;
setState(() {}); setState(() {});
}); });
@ -218,8 +218,8 @@ class _DynamicInputScreenState extends State<DynamicInputScreenAddress> {
for (int i = 0; i < model.eSERVICESVS!.length; i++) PopupMenuItem<int>(child: Text(model.eSERVICESVS![i].dESCRIPTION!), value: i), for (int i = 0; i < model.eSERVICESVS!.length; i++) PopupMenuItem<int>(child: Text(model.eSERVICESVS![i].dESCRIPTION!), value: i),
], ],
onSelected: (int popupIndex) { onSelected: (int popupIndex) {
model?.getEmployeeAddressList!.sEGMENTVALUEDSP = model.eSERVICESVS![popupIndex].dESCRIPTION!; model?.getEmployeeAddressList!.sEGMENTVALUEDSP = model.eSERVICESVS![popupIndex].dESCRIPTION;
model?.getEmployeeAddressList!.vARCHAR2VALUE = model.eSERVICESVS![popupIndex].vALUECOLUMNNAME!; model?.getEmployeeAddressList!.vARCHAR2VALUE = model.eSERVICESVS![popupIndex].vALUECOLUMNNAME;
setState(() {}); setState(() {});
}); });
} }

@ -19,6 +19,7 @@ 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_contacts.model.dart';
import 'package:mohem_flutter_app/models/profile/basic_details_cols_structions.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'; import 'package:mohem_flutter_app/models/profile/basic_details_dff_structure.dart';
import 'package:mohem_flutter_app/models/profile/submit_basic_details_transaction_model.dart';
import 'package:mohem_flutter_app/ui/misc/request_submit_screen.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/ui/my_attendance/dynamic_screens/dynamic_listview_screen.dart';
import 'package:mohem_flutter_app/widgets/app_bar_widget.dart'; import 'package:mohem_flutter_app/widgets/app_bar_widget.dart';
@ -62,7 +63,7 @@ class _DynamicInputScreenState extends State<DynamicInputScreenProfile> {
void getTransactionsStructure() async { void getTransactionsStructure() async {
try { try {
Utils.showLoading(context); Utils.showLoading(context);
genericResponseModel = await ProfileApiClient().getDffStructure(dynamicParams!.dynamicId, dynamicParams!.uRL, dynamicParams!.requestID); genericResponseModel = await ProfileApiClient().getDffStructure("BASIC_DETAILS", dynamicParams!.uRL, dynamicParams!.requestID);
getBasicDetDffStructureList = genericResponseModel?.getBasicDetDffStructureList ?? []; getBasicDetDffStructureList = genericResponseModel?.getBasicDetDffStructureList ?? [];
getBasicDetDffStructureList?.forEach((element) { getBasicDetDffStructureList?.forEach((element) {
@ -156,7 +157,7 @@ class _DynamicInputScreenState extends State<DynamicInputScreenProfile> {
// 12.height, // 12.height,
DefaultButton( DefaultButton(
LocaleKeys.next.tr(), LocaleKeys.next.tr(),
(getBasicDetDffStructureList ?? []).isEmpty ? null : () => {validateTransaction()}, () => {validateTransaction()},
).insideContainer, ).insideContainer,
], ],
), ),
@ -174,7 +175,7 @@ class _DynamicInputScreenState extends State<DynamicInputScreenProfile> {
return PopupMenuButton( return PopupMenuButton(
child: DynamicTextFieldWidget( child: DynamicTextFieldWidget(
(model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""), (model.sEGMENTPROMPT ?? "") + (model.rEQUIREDFLAG == "Y" ? "*" : ""),
model.userBasicDetail?.sEGMENTVALUEDSP ?? "", model.userBasicDetail?.aPPLICATIONCOLUMNNAME ?? "",
isEnable: false, isEnable: false,
isPopup: true, isPopup: true,
).paddingOnly(bottom: 12), ).paddingOnly(bottom: 12),
@ -183,6 +184,7 @@ class _DynamicInputScreenState extends State<DynamicInputScreenProfile> {
], ],
onSelected: (int popupIndex) { onSelected: (int popupIndex) {
getBasicDetDffStructureList![index].userBasicDetail!.sEGMENTVALUEDSP = model.eSERVICESVS![popupIndex].vALUECOLUMNNAME; getBasicDetDffStructureList![index].userBasicDetail!.sEGMENTVALUEDSP = model.eSERVICESVS![popupIndex].vALUECOLUMNNAME;
getBasicDetDffStructureList![index].userBasicDetail!.aPPLICATIONCOLUMNNAME = model.eSERVICESVS![popupIndex].dESCRIPTION;
setState(() {}); setState(() {});
}); });
} }
@ -245,11 +247,20 @@ class _DynamicInputScreenState extends State<DynamicInputScreenProfile> {
for (int i = 0; i < model.objectValuesList!.length; i++) PopupMenuItem<int>(child: Text(model.objectValuesList![i].mEANING!), value: i), for (int i = 0; i < model.objectValuesList!.length; i++) PopupMenuItem<int>(child: Text(model.objectValuesList![i].mEANING!), value: i),
], ],
onSelected: (int popupIndex) { onSelected: (int popupIndex) {
if (model.objectValuesList![popupIndex].cODE != '') {
ESERVICESDV eservicesdv =
ESERVICESDV(pIDCOLUMNNAME: model.objectValuesList![popupIndex].mEANING, pRETURNMSG: "null", pRETURNSTATUS: model.oBJECTNAME, pVALUECOLUMNNAME: model.aPPLICATIONCOLUMNNAME);
getBasicDetColsStructureList![index].userBasicDetail!.sEGMENTVALUEDSP = model.objectValuesList![popupIndex].mEANING;
getBasicDetColsStructureList![index].userBasicDetail!.vARCHAR2VALUE = model.objectValuesList![popupIndex].cODE;
} else {
ESERVICESDV eservicesdv = ESERVICESDV eservicesdv =
ESERVICESDV(pIDCOLUMNNAME: model.objectValuesList![index].dESCRIPTION, pRETURNMSG: "null", pRETURNSTATUS: model.oBJECTNAME, pVALUECOLUMNNAME: model.aPPLICATIONCOLUMNNAME); ESERVICESDV(pIDCOLUMNNAME: model.objectValuesList![popupIndex].dESCRIPTION, pRETURNMSG: "null", pRETURNSTATUS: model.oBJECTNAME, pVALUECOLUMNNAME: model.aPPLICATIONCOLUMNNAME);
getBasicDetDffStructureList![index].userBasicDetail!.sEGMENTVALUEDSP = model.objectValuesList![popupIndex].dESCRIPTION; getBasicDetColsStructureList![index].userBasicDetail!.sEGMENTVALUEDSP = model.objectValuesList![popupIndex].dESCRIPTION;
getBasicDetColsStructureList![index].userBasicDetail!.vARCHAR2VALUE = model.objectValuesList![popupIndex].mEANING;
}
setState(() {}); setState(() {});
}); },
);
} }
return DynamicTextFieldWidget( return DynamicTextFieldWidget(
@ -328,8 +339,10 @@ class _DynamicInputScreenState extends State<DynamicInputScreenProfile> {
void validateTransaction() async { void validateTransaction() async {
try { try {
Utils.showLoading(context); Utils.showLoading(context);
int numberValue = 0;
List<Map<String, dynamic>> values = getBasicDetDffStructureList!.map((e) { List<Map<String, dynamic>> values = getBasicDetDffStructureList!.map((e) {
String tempVar = e.userBasicDetail!.vARCHAR2VALUE ?? ""; String tempVar = e.userBasicDetail!.vARCHAR2VALUE ?? "";
if (e.fORMATTYPE == "X") { if (e.fORMATTYPE == "X") {
// for date format type, date format is changed // for date format type, date format is changed
tempVar = e.eSERVICESDV?.pVALUECOLUMNNAME ?? ""; tempVar = e.eSERVICESDV?.pVALUECOLUMNNAME ?? "";
@ -343,30 +356,25 @@ class _DynamicInputScreenState extends State<DynamicInputScreenProfile> {
values.add(ValidateEitTransactionModel(dATEVALUE: null, nAME: "PEI_ACTION", nUMBERVALUE: null, tRANSACTIONNUMBER: 1, vARCHAR2VALUE: "NEW_ROW").toJson()); values.add(ValidateEitTransactionModel(dATEVALUE: null, nAME: "PEI_ACTION", nUMBERVALUE: null, tRANSACTIONNUMBER: 1, vARCHAR2VALUE: "NEW_ROW").toJson());
values.add(ValidateEitTransactionModel(dATEVALUE: null, nAME: "PEI_EXTRA_INFO_ID", nUMBERVALUE: -1, tRANSACTIONNUMBER: 1, vARCHAR2VALUE: null).toJson()); values.add(ValidateEitTransactionModel(dATEVALUE: null, nAME: "PEI_EXTRA_INFO_ID", nUMBERVALUE: -1, tRANSACTIONNUMBER: 1, vARCHAR2VALUE: null).toJson());
values.add(ValidateEitTransactionModel(dATEVALUE: null, nAME: "PEI_OBJECT_VERSION_NUMBER", nUMBERVALUE: 0, tRANSACTIONNUMBER: 1, vARCHAR2VALUE: null).toJson()); //values.add(ValidateEitTransactionModel(dATEVALUE: null, nAME: "PEI_OBJECT_VERSION_NUMBER", nUMBERVALUE: 0, tRANSACTIONNUMBER: 1, vARCHAR2VALUE: null).toJson());
List<Map<String, dynamic>> valuesCols = getBasicDetColsStructureList!.map((e) { List<Map<String, dynamic>> valuesCols = getBasicDetColsStructureList!.map((e) {
// String tempVar = e.userBasicDetail!.vARCHAR2VALUE ?? ""; if (e.dATATYPE == 'NUMBER') {
// if (e.dATATYPE == "DATE") { numberValue = e.userBasicDetail!.nUMBERVALUE!;
// // for date format type, date format is changed }
// tempVar = e.userBasicDetail!.dATEVALUE ?? "";
// // if (tempVar.isNotEmpty) {
// // DateTime date = DateFormat('dd-MM-yyyy').parse(tempVar);
// // tempVar = DateFormat('yyyy/MM/dd HH:mm:ss').format(date);
// // }
// }
return ValidateEitTransactionModel( return ValidateEitTransactionModel(
dATEVALUE: e.userBasicDetail!.dATEVALUE ?? "", nAME: e.aPPLICATIONCOLUMNNAME, nUMBERVALUE: null, tRANSACTIONNUMBER: 1, vARCHAR2VALUE: e.userBasicDetail!.vARCHAR2VALUE ?? "") dATEVALUE: e.userBasicDetail!.dATEVALUE ?? "", nAME: e.aPPLICATIONCOLUMNNAME, nUMBERVALUE: numberValue, tRANSACTIONNUMBER: 1, vARCHAR2VALUE: e.userBasicDetail!.vARCHAR2VALUE ?? "")
.toJson(); .toJson();
}).toList(); }).toList();
List<Map<String, dynamic>> transactionValues = new List.from(values)..addAll(valuesCols); List<Map<String, dynamic>> transactionValues = new List.from(values)..addAll(valuesCols);
print(transactionValues); print(transactionValues);
//genericResponseModel = await MyAttendanceApiClient().validateEitTransaction(dESCFLEXCONTEXTCODE, dynamicParams!.dynamicId, values); SubmitBasicDetailsTransactionList submitBasicDetails =
Map<String, dynamic> submitBasicDetails = await ProfileApiClient().submitBasicDetailsTransaction(dESCFLEXCONTEXTCODE, dynamicParams!.dynamicId, transactionValues, dynamicParams!.correctOrNew); await ProfileApiClient().submitBasicDetailsTransaction(dESCFLEXCONTEXTCODE, dynamicParams!.dynamicId, transactionValues, dynamicParams!.correctOrNew);
print(submitBasicDetails); print(submitBasicDetails);
Utils.hideLoading(context); Utils.hideLoading(context);
// Navigator.pushNamed(context, AppRoutes.requestSubmitScreen, arguments: RequestSubmitScreenParams("title", submitEITTransactionList.pTRANSACTIONID!, submitEITTransactionList.pITEMKEY!, 'eit')); Navigator.pushNamed(context, AppRoutes.requestSubmitScreen,
arguments: RequestSubmitScreenParams(dynamicParams!.title, submitBasicDetails.pTRANSACTIONID!, submitBasicDetails.pITEMKEY!, 'basicDetails'));
} catch (ex) { } catch (ex) {
Utils.hideLoading(context); Utils.hideLoading(context);
Utils.handleException(ex, context, null); Utils.handleException(ex, context, null);

@ -3,39 +3,52 @@ import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:mohem_flutter_app/config/routes.dart'; import 'package:mohem_flutter_app/config/routes.dart';
import 'package:mohem_flutter_app/generated/locale_keys.g.dart'; import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
import 'package:mohem_flutter_app/models/dashboard/menu_entries.dart';
import 'package:mohem_flutter_app/models/member_information_list_model.dart'; import 'package:mohem_flutter_app/models/member_information_list_model.dart';
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';
import 'package:mohem_flutter_app/models/profile_menu.model.dart'; import 'package:mohem_flutter_app/models/profile_menu.model.dart';
import 'package:mohem_flutter_app/provider/dashboard_provider_model.dart';
import 'package:mohem_flutter_app/ui/my_attendance/dynamic_screens/dynamic_input_screen.dart'; import 'package:mohem_flutter_app/ui/my_attendance/dynamic_screens/dynamic_input_screen.dart';
import 'package:mohem_flutter_app/ui/my_attendance/dynamic_screens/dynamic_listview_screen.dart'; import 'package:mohem_flutter_app/ui/my_attendance/dynamic_screens/dynamic_listview_screen.dart';
import 'package:provider/provider.dart';
// todo '@sultan' kindly follow structure of code written. use extension methods for widgets, also format code // todo '@sultan' kindly follow structure of code written. use extension methods for widgets, also format code
class ProfileInFo extends StatelessWidget { class ProfileInFo extends StatefulWidget {
ProfileInFo(this.memberInfo); ProfileInFo(this.memberInfo);
MemberInformationListModel memberInfo; MemberInformationListModel memberInfo;
@override
State<ProfileInFo> createState() => _ProfileInFoState();
}
class _ProfileInFoState extends State<ProfileInFo> {
static List<GetMenuEntriesList> menuData = [];
String data = '.'; String data = '.';
double sliderValue = 75; double sliderValue = 75;
List<ProfileMenu> menu = [ List<ProfileMenu> menu = [
ProfileMenu(name: LocaleKeys.profile_personalInformation.tr(), icon: 'personal-info.svg', route: AppRoutes.personalInfo, dynamicUrl: ''), ProfileMenu(name: LocaleKeys.profile_personalInformation.tr(), icon: 'personal-info.svg', route: AppRoutes.personalInfo, dynamicUrl: '', menuEntries: getMenuEntries('')),
ProfileMenu( ProfileMenu(name: LocaleKeys.profile_basicDetails.tr(), icon: 'basic-details.svg', route: AppRoutes.basicDetails, menuEntries: getMenuEntries('BASIC_DETAILS')),
name: LocaleKeys.profile_basicDetails.tr(), ProfileMenu(name: LocaleKeys.profile_contactDetails.tr(), icon: 'contact-details.svg', route: AppRoutes.contactDetails, dynamicUrl: '', menuEntries: getMenuEntries('ADDRESS')),
icon: 'basic-details.svg', ProfileMenu(name: LocaleKeys.profile_familyDetails.tr(), icon: 'family-members.svg', route: AppRoutes.familyMembers, dynamicUrl: '', menuEntries: getMenuEntries('CONTACT')),
route: AppRoutes.basicDetails,
),
ProfileMenu(name: LocaleKeys.profile_contactDetails.tr(), icon: 'contact-details.svg', route: AppRoutes.contactDetails, dynamicUrl: ''),
ProfileMenu(name: LocaleKeys.profile_familyDetails.tr(), icon: 'family-members.svg', route: AppRoutes.familyMembers, dynamicUrl: ''),
]; ];
@override
void setState(VoidCallback fn) {
List<GetMenuEntriesList> menuData = Provider.of<DashboardProviderModel>(context, listen: false).getMenuEntriesList!;
super.setState(fn);
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
child: Column(crossAxisAlignment: CrossAxisAlignment.center, children: [ child: Column(crossAxisAlignment: CrossAxisAlignment.center, children: [
/// card header /// card header
customLabel(memberInfo.eMPLOYEENAME.toString(), 22, Colors.black, true), customLabel(widget.memberInfo.eMPLOYEENAME.toString(), 22, Colors.black, true),
customLabel(memberInfo.eMPLOYEENUMBER.toString() + ' | ' + memberInfo.jOBNAME.toString(), 14, Colors.grey, false), customLabel(widget.memberInfo.eMPLOYEENUMBER.toString() + ' | ' + widget.memberInfo.jOBNAME.toString(), 14, Colors.grey, false),
customLabel(memberInfo.eMPLOYEEEMAILADDRESS.toString(), 13, Colors.black, true), customLabel(widget.memberInfo.eMPLOYEEEMAILADDRESS.toString(), 13, Colors.black, true),
Divider(height: 40, thickness: 8, color: const Color(0xffefefef)), Divider(height: 40, thickness: 8, color: const Color(0xffefefef)),
@ -45,13 +58,13 @@ class ProfileInFo extends StatelessWidget {
Container( Container(
child: Row(mainAxisAlignment: MainAxisAlignment.spaceAround, crossAxisAlignment: CrossAxisAlignment.center, children: [ child: Row(mainAxisAlignment: MainAxisAlignment.spaceAround, crossAxisAlignment: CrossAxisAlignment.center, children: [
Column( Column(
children: [customLabel(LocaleKeys.year.tr(), 14, const Color(0xff808080), true), customLabel(memberInfo.sERVICEYEARS.toString().padLeft(2, '0'), 22, Color(0xff2BB8A6), true)], children: [customLabel(LocaleKeys.year.tr(), 14, const Color(0xff808080), true), customLabel(widget.memberInfo.sERVICEYEARS.toString().padLeft(2, '0'), 22, Color(0xff2BB8A6), true)],
), ),
Column( Column(
children: [customLabel(LocaleKeys.month.tr(), 14, const Color(0xff808080), true), customLabel(memberInfo.sERVICEMONTHS.toString().padLeft(2, '0'), 22, Color(0xff2BB8A6), true)], children: [customLabel(LocaleKeys.month.tr(), 14, const Color(0xff808080), true), customLabel(widget.memberInfo.sERVICEMONTHS.toString().padLeft(2, '0'), 22, Color(0xff2BB8A6), true)],
), ),
Column( Column(
children: [customLabel(LocaleKeys.day.tr(), 14, const Color(0xff808080), true), customLabel(memberInfo.sERVICEDAYS.toString().padLeft(2, '0'), 22, Color(0xff2BB8A6), true)], children: [customLabel(LocaleKeys.day.tr(), 14, const Color(0xff808080), true), customLabel(widget.memberInfo.sERVICEDAYS.toString().padLeft(2, '0'), 22, Color(0xff2BB8A6), true)],
) )
])), ])),
@ -131,3 +144,12 @@ class ProfileInFo extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [Text(label, style: TextStyle(color: color, fontSize: size, fontWeight: isBold ? FontWeight.bold : FontWeight.normal))])); children: [Text(label, style: TextStyle(color: color, fontSize: size, fontWeight: isBold ? FontWeight.bold : FontWeight.normal))]));
} }
GetMenuEntriesList getMenuEntries(String type) {
List<GetMenuEntriesList> data = _ProfileInFoState.menuData.where((GetMenuEntriesList test) => test.functionName == type).toList();
if (data.isNotEmpty) {
return data[0];
} else {
return GetMenuEntriesList();
}
}

Loading…
Cancel
Save