|
|
|
@ -55,6 +55,7 @@ class WorkListDetailScreen extends StatefulWidget {
|
|
|
|
|
|
|
|
|
|
|
|
class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
|
|
|
|
class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
|
|
|
|
int tabIndex = 0;
|
|
|
|
int tabIndex = 0;
|
|
|
|
|
|
|
|
int animationIndex = 0;
|
|
|
|
PageController controller = PageController();
|
|
|
|
PageController controller = PageController();
|
|
|
|
bool showFabOptions = false;
|
|
|
|
bool showFabOptions = false;
|
|
|
|
|
|
|
|
|
|
|
|
@ -146,7 +147,9 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
|
|
|
|
getPRNotification();
|
|
|
|
getPRNotification();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (controller.hasClients) {
|
|
|
|
controller.jumpToPage(0);
|
|
|
|
controller.jumpToPage(0);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// List dataToFetch = await Future.wait([
|
|
|
|
// List dataToFetch = await Future.wait([
|
|
|
|
//
|
|
|
|
//
|
|
|
|
@ -187,7 +190,6 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
getDataFromState();
|
|
|
|
getDataFromState();
|
|
|
|
|
|
|
|
|
|
|
|
return Scaffold(
|
|
|
|
return Scaffold(
|
|
|
|
appBar: AppBarWidget(context, title: LocaleKeys.details.tr()),
|
|
|
|
appBar: AppBarWidget(context, title: LocaleKeys.details.tr()),
|
|
|
|
backgroundColor: Colors.white,
|
|
|
|
backgroundColor: Colors.white,
|
|
|
|
@ -208,7 +210,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
|
|
|
|
);
|
|
|
|
);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
child: Stack(
|
|
|
|
child: Stack(
|
|
|
|
key: ValueKey(AppState().workListIndex ?? 0),
|
|
|
|
key: ValueKey(animationIndex),
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Column(
|
|
|
|
Column(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
@ -231,9 +233,9 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
child: Row(
|
|
|
|
child: Row(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
myTab(LocaleKeys.info.tr(), 0),
|
|
|
|
(workListData!.iTEMTYPE == "HRSSA" || workListData!.iTEMTYPE == "STAMP") ? myTab(LocaleKeys.details.tr(), 0) : myTab(LocaleKeys.request.tr(), 0),
|
|
|
|
(workListData!.iTEMTYPE == "HRSSA" || workListData!.iTEMTYPE == "STAMP") ? myTab(LocaleKeys.details.tr(), 1) : myTab(LocaleKeys.request.tr(), 1),
|
|
|
|
myTab(LocaleKeys.actions.tr(), 1),
|
|
|
|
myTab(LocaleKeys.actions.tr(), 2),
|
|
|
|
myTab(LocaleKeys.info.tr(), 2),
|
|
|
|
myTab(LocaleKeys.attachments.tr(), 3),
|
|
|
|
myTab(LocaleKeys.attachments.tr(), 3),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -241,25 +243,12 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
|
|
|
|
if ((workListData?.sUBJECT ?? "").isNotEmpty) workListData!.sUBJECT!.toText14().paddingOnly(top: 20, right: 21, left: 21),
|
|
|
|
if ((workListData?.sUBJECT ?? "").isNotEmpty) workListData!.sUBJECT!.toText14().paddingOnly(top: 20, right: 21, left: 21),
|
|
|
|
PageView(
|
|
|
|
PageView(
|
|
|
|
controller: controller,
|
|
|
|
controller: controller,
|
|
|
|
onPageChanged: (int pageIndex) {
|
|
|
|
onPageChanged: (pageIndex) {
|
|
|
|
setState(() {
|
|
|
|
setState(() {
|
|
|
|
tabIndex = pageIndex;
|
|
|
|
tabIndex = pageIndex;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
InfoFragment(
|
|
|
|
|
|
|
|
poHeaderList: getPoNotificationBody?.pOHeader ?? [],
|
|
|
|
|
|
|
|
workListData: workListData,
|
|
|
|
|
|
|
|
itemCreationHeader: getItemCreationNtfBody?.itemCreationHeader ?? [],
|
|
|
|
|
|
|
|
getStampMsNotifications: getStampMsNotifications,
|
|
|
|
|
|
|
|
getStampNsNotifications: getStampNsNotifications,
|
|
|
|
|
|
|
|
getEitCollectionNotificationBodyList: getEitCollectionNotificationBodyList,
|
|
|
|
|
|
|
|
getPhonesNotificationBodyList: getPhonesNotificationBodyList,
|
|
|
|
|
|
|
|
getBasicDetNtfBodyList: getBasicDetNtfBodyList,
|
|
|
|
|
|
|
|
getAbsenceCollectionNotificationBodyList: getAbsenceCollectionNotificationBodyList,
|
|
|
|
|
|
|
|
getContactNotificationBodyList: getContactNotificationBodyList,
|
|
|
|
|
|
|
|
getPrNotificationBodyList: getPrNotificationBody,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
(workListData!.iTEMTYPE == "HRSSA" || workListData!.iTEMTYPE == "STAMP")
|
|
|
|
(workListData!.iTEMTYPE == "HRSSA" || workListData!.iTEMTYPE == "STAMP")
|
|
|
|
? DetailFragment(workListData, memberInformationListModel)
|
|
|
|
? DetailFragment(workListData, memberInformationListModel)
|
|
|
|
: RequestFragment(
|
|
|
|
: RequestFragment(
|
|
|
|
@ -277,6 +266,19 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
|
|
|
|
voidCallback: reloadWorkList,
|
|
|
|
voidCallback: reloadWorkList,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
: showLoadingAnimation(),
|
|
|
|
: showLoadingAnimation(),
|
|
|
|
|
|
|
|
InfoFragment(
|
|
|
|
|
|
|
|
poHeaderList: getPoNotificationBody?.pOHeader ?? [],
|
|
|
|
|
|
|
|
workListData: workListData,
|
|
|
|
|
|
|
|
itemCreationHeader: getItemCreationNtfBody?.itemCreationHeader ?? [],
|
|
|
|
|
|
|
|
getStampMsNotifications: getStampMsNotifications,
|
|
|
|
|
|
|
|
getStampNsNotifications: getStampNsNotifications,
|
|
|
|
|
|
|
|
getEitCollectionNotificationBodyList: getEitCollectionNotificationBodyList,
|
|
|
|
|
|
|
|
getPhonesNotificationBodyList: getPhonesNotificationBodyList,
|
|
|
|
|
|
|
|
getBasicDetNtfBodyList: getBasicDetNtfBodyList,
|
|
|
|
|
|
|
|
getAbsenceCollectionNotificationBodyList: getAbsenceCollectionNotificationBodyList,
|
|
|
|
|
|
|
|
getContactNotificationBodyList: getContactNotificationBodyList,
|
|
|
|
|
|
|
|
getPrNotificationBodyList: getPrNotificationBody,
|
|
|
|
|
|
|
|
),
|
|
|
|
isAttachmentLoaded
|
|
|
|
isAttachmentLoaded
|
|
|
|
? getAttachmentList.isEmpty
|
|
|
|
? getAttachmentList.isEmpty
|
|
|
|
? Utils.getNoDataWidget(context)
|
|
|
|
? Utils.getNoDataWidget(context)
|
|
|
|
@ -350,6 +352,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
myFab(LocaleKeys.skip.tr(), "assets/images/skip.svg").onPress(() {
|
|
|
|
myFab(LocaleKeys.skip.tr(), "assets/images/skip.svg").onPress(() {
|
|
|
|
if (AppState().workList!.length - 1 > AppState().workListIndex!) {
|
|
|
|
if (AppState().workList!.length - 1 > AppState().workListIndex!) {
|
|
|
|
|
|
|
|
animationIndex = animationIndex + 1;
|
|
|
|
AppState().setWorkListIndex = AppState().workListIndex! + 1;
|
|
|
|
AppState().setWorkListIndex = AppState().workListIndex! + 1;
|
|
|
|
workListData = null;
|
|
|
|
workListData = null;
|
|
|
|
showFabOptions = false;
|
|
|
|
showFabOptions = false;
|
|
|
|
@ -564,7 +567,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
|
|
|
|
Future<void> performNetworkCall(BuildContext context, {String? email, String? userId}) async {
|
|
|
|
Future<void> performNetworkCall(BuildContext context, {String? email, String? userId}) async {
|
|
|
|
showDialog(
|
|
|
|
showDialog(
|
|
|
|
context: context,
|
|
|
|
context: context,
|
|
|
|
builder: (BuildContext cxt) => ConfirmDialog(
|
|
|
|
builder: (cxt) => ConfirmDialog(
|
|
|
|
message: LocaleKeys.wantToReject.tr(),
|
|
|
|
message: LocaleKeys.wantToReject.tr(),
|
|
|
|
okTitle: LocaleKeys.reject.tr(),
|
|
|
|
okTitle: LocaleKeys.reject.tr(),
|
|
|
|
onTap: () async {
|
|
|
|
onTap: () async {
|
|
|
|
@ -647,12 +650,12 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
|
|
|
|
print(actionMode);
|
|
|
|
print(actionMode);
|
|
|
|
showDialog(
|
|
|
|
showDialog(
|
|
|
|
context: context,
|
|
|
|
context: context,
|
|
|
|
builder: (BuildContext cxt) => AcceptRejectInputDialog(
|
|
|
|
builder: (cxt) => AcceptRejectInputDialog(
|
|
|
|
message: title != null ? null : LocaleKeys.requestedItems.tr(),
|
|
|
|
message: title != null ? null : LocaleKeys.requestedItems.tr(),
|
|
|
|
title: title,
|
|
|
|
title: title,
|
|
|
|
notificationGetRespond: notificationNoteInput,
|
|
|
|
notificationGetRespond: notificationNoteInput,
|
|
|
|
actionMode: actionMode,
|
|
|
|
actionMode: actionMode,
|
|
|
|
onTap: (String note) {
|
|
|
|
onTap: (note) {
|
|
|
|
Map<String, dynamic> payload = {
|
|
|
|
Map<String, dynamic> payload = {
|
|
|
|
"P_ACTION_MODE": actionMode,
|
|
|
|
"P_ACTION_MODE": actionMode,
|
|
|
|
"P_APPROVER_INDEX": null,
|
|
|
|
"P_APPROVER_INDEX": null,
|
|
|
|
@ -685,6 +688,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
|
|
|
|
GenericResponseModel model = await WorkListApiClient().postNotificationActions(payload);
|
|
|
|
GenericResponseModel model = await WorkListApiClient().postNotificationActions(payload);
|
|
|
|
Utils.hideLoading(context);
|
|
|
|
Utils.hideLoading(context);
|
|
|
|
Utils.showToast(LocaleKeys.yourChangeHasBeenSavedSuccessfully.tr());
|
|
|
|
Utils.showToast(LocaleKeys.yourChangeHasBeenSavedSuccessfully.tr());
|
|
|
|
|
|
|
|
animationIndex=animationIndex+1;
|
|
|
|
AppState().workList!.removeAt(AppState().workListIndex!);
|
|
|
|
AppState().workList!.removeAt(AppState().workListIndex!);
|
|
|
|
if (AppState().workList!.isEmpty) {
|
|
|
|
if (AppState().workList!.isEmpty) {
|
|
|
|
Navigator.pop(context, "delegate_reload");
|
|
|
|
Navigator.pop(context, "delegate_reload");
|
|
|
|
@ -703,6 +707,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void reloadWorkList() {
|
|
|
|
void reloadWorkList() {
|
|
|
|
|
|
|
|
animationIndex = animationIndex + 1;
|
|
|
|
AppState().workList!.removeAt(AppState().workListIndex!);
|
|
|
|
AppState().workList!.removeAt(AppState().workListIndex!);
|
|
|
|
if (AppState().workList!.isEmpty) {
|
|
|
|
if (AppState().workList!.isEmpty) {
|
|
|
|
Navigator.pop(context, "delegate_reload");
|
|
|
|
Navigator.pop(context, "delegate_reload");
|
|
|
|
@ -933,9 +938,9 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
|
|
|
|
apiCallCount++;
|
|
|
|
apiCallCount++;
|
|
|
|
notificationButtonsList = await WorkListApiClient().getNotificationButtons(workListData!.nOTIFICATIONID!);
|
|
|
|
notificationButtonsList = await WorkListApiClient().getNotificationButtons(workListData!.nOTIFICATIONID!);
|
|
|
|
if (notificationButtonsList.isNotEmpty) {
|
|
|
|
if (notificationButtonsList.isNotEmpty) {
|
|
|
|
isCloseAvailable = notificationButtonsList.any((GetNotificationButtonsList element) => element.bUTTONACTION == "CLOSE");
|
|
|
|
isCloseAvailable = notificationButtonsList.any((element) => element.bUTTONACTION == "CLOSE");
|
|
|
|
isApproveAvailable = notificationButtonsList.any((GetNotificationButtonsList element) => element.bUTTONACTION == "APPROVED");
|
|
|
|
isApproveAvailable = notificationButtonsList.any((element) => element.bUTTONACTION == "APPROVED");
|
|
|
|
isRejectAvailable = notificationButtonsList.any((GetNotificationButtonsList element) => element.bUTTONACTION == "REJECTED");
|
|
|
|
isRejectAvailable = notificationButtonsList.any((element) => element.bUTTONACTION == "REJECTED");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
apiCallCount--;
|
|
|
|
apiCallCount--;
|
|
|
|
if (apiCallCount == 0) {
|
|
|
|
if (apiCallCount == 0) {
|
|
|
|
|