|
|
@ -307,7 +307,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
myFab("Skip", "assets/images/skip.svg").onPress(() {
|
|
|
|
myFab(LocaleKeys.pleaseEnterComments.tr(), "assets/images/skip.svg").onPress(() {
|
|
|
|
if (AppState().workList!.length - 1 > AppState().workListIndex!) {
|
|
|
|
if (AppState().workList!.length - 1 > AppState().workListIndex!) {
|
|
|
|
AppState().setWorkListIndex = AppState().workListIndex! + 1;
|
|
|
|
AppState().setWorkListIndex = AppState().workListIndex! + 1;
|
|
|
|
workListData = null;
|
|
|
|
workListData = null;
|
|
|
@ -481,6 +481,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
|
|
|
|
|
|
|
|
|
|
|
|
void performAction(String actionMode) {
|
|
|
|
void performAction(String actionMode) {
|
|
|
|
TextEditingController textEditingController = TextEditingController();
|
|
|
|
TextEditingController textEditingController = TextEditingController();
|
|
|
|
|
|
|
|
print("actionMode:$actionMode");
|
|
|
|
showDialog(
|
|
|
|
showDialog(
|
|
|
|
context: context,
|
|
|
|
context: context,
|
|
|
|
builder: (cxt) => AcceptRejectInputDialog(
|
|
|
|
builder: (cxt) => AcceptRejectInputDialog(
|
|
|
@ -488,24 +489,26 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
|
|
|
|
notificationGetRespond: notificationNoteInput,
|
|
|
|
notificationGetRespond: notificationNoteInput,
|
|
|
|
textEditingController: textEditingController,
|
|
|
|
textEditingController: textEditingController,
|
|
|
|
onTap: (note) {
|
|
|
|
onTap: (note) {
|
|
|
|
if (note.isNotEmpty && (actionMode == "APPROVED" || actionMode == "APPROVE")) {
|
|
|
|
Map<String, dynamic> payload = {
|
|
|
|
Map<String, dynamic> payload = {
|
|
|
|
"P_ACTION_MODE": actionMode,
|
|
|
|
"P_ACTION_MODE": actionMode,
|
|
|
|
"P_APPROVER_INDEX": null,
|
|
|
|
"P_APPROVER_INDEX": null,
|
|
|
|
"P_COMMENTS": note,
|
|
|
|
"P_COMMENTS": note,
|
|
|
|
"P_FORWARD_TO_USER_NAME": "",
|
|
|
|
"P_FORWARD_TO_USER_NAME": "",
|
|
|
|
"P_NOTIFICATION_ID": workListData!.nOTIFICATIONID,
|
|
|
|
"P_NOTIFICATION_ID": workListData!.nOTIFICATIONID,
|
|
|
|
"RespondAttributeList": [
|
|
|
|
"RespondAttributeList": [
|
|
|
|
if (notificationNoteInput != null)
|
|
|
|
if (notificationNoteInput != null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
"ATTRIBUTE_NAME": notificationNoteInput!.attributeName,
|
|
|
|
"ATTRIBUTE_NAME": notificationNoteInput!.attributeName,
|
|
|
|
if (notificationNoteInput!.attributeType == "number") "ATTRIBUTE_NUMBER_VALUE": note else if (notificationNoteInput!.attributeType == "VARCHAR2") "ATTRIBUTE_TEXT_VALUE": note
|
|
|
|
if (notificationNoteInput!.attributeType == "number") "ATTRIBUTE_NUMBER_VALUE": note else if (notificationNoteInput!.attributeType == "VARCHAR2") "ATTRIBUTE_TEXT_VALUE": note
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
],
|
|
|
|
};
|
|
|
|
};
|
|
|
|
if (actionMode == "APPROVED" || actionMode == "APPROVE") {
|
|
|
|
|
|
|
|
performNotificationAction(payload);
|
|
|
|
|
|
|
|
} else if (note.isNotEmpty && (actionMode != "APPROVED" || actionMode != "APPROVE")) {
|
|
|
|
performNotificationAction(payload);
|
|
|
|
performNotificationAction(payload);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
Utils.showToast("Please enter comments");
|
|
|
|
Utils.showToast(LocaleKeys.pleaseEnterComments.tr());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
@ -518,7 +521,17 @@ 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());
|
|
|
|
Navigator.pop(context, true);
|
|
|
|
AppState().workList!.removeAt(AppState().workListIndex!);
|
|
|
|
|
|
|
|
if (AppState().workList!.isEmpty) {
|
|
|
|
|
|
|
|
Navigator.pop(context, "delegate_reload");
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
if (AppState().workList!.length <= AppState().workListIndex!) {
|
|
|
|
|
|
|
|
Navigator.pop(context, "delegate_reload");
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
workListData = null;
|
|
|
|
|
|
|
|
getDataFromState();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
} catch (ex) {
|
|
|
|
} catch (ex) {
|
|
|
|
Utils.hideLoading(context);
|
|
|
|
Utils.hideLoading(context);
|
|
|
|
Utils.handleException(ex, context, null);
|
|
|
|
Utils.handleException(ex, context, null);
|
|
|
|