|
|
|
|
@ -40,7 +40,6 @@ import 'package:mohem_flutter_app/widgets/dialogs/accept_reject_input_dialog.dar
|
|
|
|
|
import 'package:mohem_flutter_app/widgets/dialogs/confirm_dialog.dart';
|
|
|
|
|
|
|
|
|
|
class WorkListDetailScreen extends StatefulWidget {
|
|
|
|
|
|
|
|
|
|
WorkListDetailScreen({Key? key}) : super(key: key);
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
@ -100,8 +99,8 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
|
|
|
|
|
getUserInformation();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getNotificationButtons();
|
|
|
|
|
notificationGetRespondAttributes();
|
|
|
|
|
getNotificationButtons();
|
|
|
|
|
getAttachments();
|
|
|
|
|
getActionHistory();
|
|
|
|
|
|
|
|
|
|
@ -503,7 +502,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
};
|
|
|
|
|
if (actionMode == "APPROVED" || actionMode == "APPROVE" || actionMode == "CLOSE") {
|
|
|
|
|
if (actionMode == "APPROVED" || actionMode == "APPROVE") {
|
|
|
|
|
performNotificationAction(payload);
|
|
|
|
|
} else if (note.isNotEmpty && (actionMode != "APPROVED" || actionMode != "APPROVE")) {
|
|
|
|
|
performNotificationAction(payload);
|
|
|
|
|
@ -540,34 +539,34 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
|
|
|
|
|
|
|
|
|
|
void getEitNotificationBody() async {
|
|
|
|
|
try {
|
|
|
|
|
// if (apiCallCount == 0) Utils.showLoading(context);
|
|
|
|
|
// apiCallCount++;
|
|
|
|
|
if (apiCallCount == 0) Utils.showLoading(context);
|
|
|
|
|
apiCallCount++;
|
|
|
|
|
getEitCollectionNotificationBodyList = await WorkListApiClient().GetEitNotificationBody(workListData!.nOTIFICATIONID);
|
|
|
|
|
// apiCallCount--;
|
|
|
|
|
// if (apiCallCount == 0) {
|
|
|
|
|
// Utils.hideLoading(context);
|
|
|
|
|
apiCallCount--;
|
|
|
|
|
if (apiCallCount == 0) {
|
|
|
|
|
Utils.hideLoading(context);
|
|
|
|
|
setState(() {});
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
} catch (ex) {
|
|
|
|
|
// apiCallCount--;
|
|
|
|
|
// Utils.hideLoading(context);
|
|
|
|
|
apiCallCount--;
|
|
|
|
|
Utils.hideLoading(context);
|
|
|
|
|
Utils.handleException(ex, context, null);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void getUserInformation() async {
|
|
|
|
|
try {
|
|
|
|
|
// if (apiCallCount == 0) Utils.showLoading(context);
|
|
|
|
|
// apiCallCount++;
|
|
|
|
|
if (apiCallCount == 0) Utils.showLoading(context);
|
|
|
|
|
apiCallCount++;
|
|
|
|
|
memberInformationListModel = await WorkListApiClient().getUserInformation(-999, workListData!.sELECTEDEMPLOYEENUMBER!);
|
|
|
|
|
// apiCallCount--;
|
|
|
|
|
// if (apiCallCount == 0) {
|
|
|
|
|
// Utils.hideLoading(context);
|
|
|
|
|
apiCallCount--;
|
|
|
|
|
if (apiCallCount == 0) {
|
|
|
|
|
Utils.hideLoading(context);
|
|
|
|
|
setState(() {});
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
} catch (ex) {
|
|
|
|
|
// apiCallCount--;
|
|
|
|
|
// Utils.hideLoading(context);
|
|
|
|
|
apiCallCount--;
|
|
|
|
|
Utils.hideLoading(context);
|
|
|
|
|
Utils.handleException(ex, context, null);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -608,17 +607,17 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
|
|
|
|
|
|
|
|
|
|
void getAbsenceNotificationBody() async {
|
|
|
|
|
try {
|
|
|
|
|
// if (apiCallCount == 0) Utils.showLoading(context);
|
|
|
|
|
// apiCallCount++;
|
|
|
|
|
if (apiCallCount == 0) Utils.showLoading(context);
|
|
|
|
|
apiCallCount++;
|
|
|
|
|
getAbsenceCollectionNotificationBodyList = await WorkListApiClient().getAbsenceNotificationBody(workListData!.nOTIFICATIONID);
|
|
|
|
|
// apiCallCount--;
|
|
|
|
|
// if (apiCallCount == 0) {
|
|
|
|
|
// Utils.hideLoading(context);
|
|
|
|
|
apiCallCount--;
|
|
|
|
|
if (apiCallCount == 0) {
|
|
|
|
|
Utils.hideLoading(context);
|
|
|
|
|
setState(() {});
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
} catch (ex) {
|
|
|
|
|
// apiCallCount--;
|
|
|
|
|
// Utils.hideLoading(context);
|
|
|
|
|
apiCallCount--;
|
|
|
|
|
Utils.hideLoading(context);
|
|
|
|
|
Utils.handleException(ex, context, null);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -731,20 +730,20 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
|
|
|
|
|
|
|
|
|
|
void notificationGetRespondAttributes() async {
|
|
|
|
|
try {
|
|
|
|
|
// if (apiCallCount == 0) Utils.showLoading(context);
|
|
|
|
|
// apiCallCount++;
|
|
|
|
|
if (apiCallCount == 0) Utils.showLoading(context);
|
|
|
|
|
apiCallCount++;
|
|
|
|
|
getNotificationRespondAttributes = await WorkListApiClient().notificationGetRespondAttributes(workListData!.nOTIFICATIONID!);
|
|
|
|
|
if (getNotificationRespondAttributes.isNotEmpty) {
|
|
|
|
|
notificationNoteInput = getNotificationRespondAttributes.first;
|
|
|
|
|
}
|
|
|
|
|
// apiCallCount--;
|
|
|
|
|
// if (apiCallCount == 0) {
|
|
|
|
|
// Utils.hideLoading(context);
|
|
|
|
|
apiCallCount--;
|
|
|
|
|
if (apiCallCount == 0) {
|
|
|
|
|
Utils.hideLoading(context);
|
|
|
|
|
setState(() {});
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
} catch (ex) {
|
|
|
|
|
// apiCallCount--;
|
|
|
|
|
// Utils.hideLoading(context);
|
|
|
|
|
apiCallCount--;
|
|
|
|
|
Utils.hideLoading(context);
|
|
|
|
|
Utils.handleException(ex, context, null);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|