merge-requests/87/head
haroon amjad 3 years ago
parent f63e0e1e7c
commit 62acd531b0

@ -66,6 +66,41 @@ class ItemsForSaleApiClient {
}, url, postParams); }, url, postParams);
} }
Future<dynamic> updateItemsForSale(int itemSaleID) async {
List<GetItemsForSaleList> getItemsForSaleList = [];
String url = "${ApiConsts.cocRest}Mohemm_ITG_UpdateItemForSale";
// request.fields['itemSaleID'] = itemSaleID.toString();
// request.fields['Channel'] = "31";
// request.fields['isActive'] = "false";
// request.fields['LogInToken'] = loginTokenID!;
// request.fields['Token'] = tokenID!;
// request.fields['MobileNo'] = empMobNum!;
// request.fields['EmployeeNumber'] = empNum!;
// request.fields['employeeNumber'] = empNum;
Map<String, dynamic> postParams = {
"EmployeeNumber": AppState().memberInformationList?.eMPLOYEENUMBER,
"employeeNumber": AppState().memberInformationList?.eMPLOYEENUMBER,
"MobileNo": AppState().memberInformationList?.eMPLOYEEMOBILENUMBER,
"itemSaleID": itemSaleID.toString(),
"Channel": "31",
"isActive": "false",
"Token": AppState().postParamsObject?.tokenID
};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((response) {
var body = json.decode(response['Mohemm_ITG_ResponseItem']);
// body['result']['data'].forEach((v) {
// getItemsForSaleList.add(new GetItemsForSaleList.fromJson(v));
// });
return getItemsForSaleList;
}, url, postParams);
}
Future<List<EmployeePostedAds>> getEmployeePostedAds() async { Future<List<EmployeePostedAds>> getEmployeePostedAds() async {
List<EmployeePostedAds> employeePostedAdsList = []; List<EmployeePostedAds> employeePostedAdsList = [];

@ -146,7 +146,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
getPRNotification(); getPRNotification();
} }
if(controller.hasClients) { if (controller.hasClients) {
controller.jumpToPage(0); controller.jumpToPage(0);
} }
@ -210,6 +210,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
); );
}, },
child: Stack( child: Stack(
key: ValueKey(AppState().workListIndex ?? 0),
children: [ children: [
Column( Column(
children: [ children: [
@ -251,19 +252,19 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
(workListData!.iTEMTYPE == "HRSSA" || workListData!.iTEMTYPE == "STAMP") (workListData!.iTEMTYPE == "HRSSA" || workListData!.iTEMTYPE == "STAMP")
? DetailFragment(workListData, memberInformationListModel) ? DetailFragment(workListData, memberInformationListModel)
: RequestFragment( : RequestFragment(
moNotificationBodyList: getMoNotificationBodyList, moNotificationBodyList: getMoNotificationBodyList,
poLinesList: getPoNotificationBody?.pOLines ?? [], poLinesList: getPoNotificationBody?.pOLines ?? [],
itemCreationLines: getItemCreationNtfBody?.itemCreationLines ?? [], itemCreationLines: getItemCreationNtfBody?.itemCreationLines ?? [],
prLinesList: getPrNotificationBody?.pRLines ?? [], prLinesList: getPrNotificationBody?.pRLines ?? [],
), ),
isActionHistoryLoaded isActionHistoryLoaded
? actionHistoryList.isEmpty ? actionHistoryList.isEmpty
? Utils.getNoDataWidget(context) ? Utils.getNoDataWidget(context)
: ActionsFragment( : ActionsFragment(
workListData!.nOTIFICATIONID, workListData!.nOTIFICATIONID,
actionHistoryList, actionHistoryList,
voidCallback: reloadWorkList, voidCallback: reloadWorkList,
) )
: showLoadingAnimation(), : showLoadingAnimation(),
InfoFragment( InfoFragment(
poHeaderList: getPoNotificationBody?.pOHeader ?? [], poHeaderList: getPoNotificationBody?.pOHeader ?? [],
@ -565,7 +566,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 {
@ -648,12 +649,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,
@ -934,9 +935,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) {

@ -20,7 +20,7 @@ AppBar AppBarWidget(BuildContext context,
children: [ children: [
GestureDetector( GestureDetector(
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
onTap: Feedback.wrapForTap(() => Navigator.maybePop(context, true), context), onTap: Feedback.wrapForTap(() => Navigator.maybePop(context), context),
child: const Icon(Icons.arrow_back_ios, color: MyColors.darkIconColor), child: const Icon(Icons.arrow_back_ios, color: MyColors.darkIconColor),
), ),
4.width, 4.width,

Loading…
Cancel
Save