|
|
|
@ -5,6 +5,7 @@ import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_v
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
|
|
|
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/utils.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/utils.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
|
|
|
|
@ -33,13 +34,25 @@ class OrdersLogDetailsPage extends StatelessWidget {
|
|
|
|
model: model,
|
|
|
|
model: model,
|
|
|
|
onTap: () async {
|
|
|
|
onTap: () async {
|
|
|
|
UpdatePresOrderRequestModel updatePresOrderRequestModel = UpdatePresOrderRequestModel(presOrderID: order.iD, rejectionReason: "", presOrderStatus: 4, editedBy: 3);
|
|
|
|
UpdatePresOrderRequestModel updatePresOrderRequestModel = UpdatePresOrderRequestModel(presOrderID: order.iD, rejectionReason: "", presOrderStatus: 4, editedBy: 3);
|
|
|
|
await model.updateCmcPresOrder(updatePresOrderRequestModel);
|
|
|
|
Future.delayed(new Duration(milliseconds: 300)).then((value) async {
|
|
|
|
if (model.state == ViewState.ErrorLocal) {
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
Utils.showErrorToast(model.error);
|
|
|
|
await model.updateCmcPresOrder(updatePresOrderRequestModel);
|
|
|
|
} else {
|
|
|
|
if (model.state == ViewState.ErrorLocal) {
|
|
|
|
AppToast.showSuccessToast(message: TranslationBase.of(context).processDoneSuccessfully);
|
|
|
|
Utils.showErrorToast(model.error);
|
|
|
|
await model.getCmcAllPresOrders();
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
|
|
|
|
AppToast.showSuccessToast(message: TranslationBase.of(context).processDoneSuccessfully);
|
|
|
|
|
|
|
|
await model.getCmcAllPresOrders();
|
|
|
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
// await model.updateCmcPresOrder(updatePresOrderRequestModel);
|
|
|
|
|
|
|
|
// if (model.state == ViewState.ErrorLocal) {
|
|
|
|
|
|
|
|
// Utils.showErrorToast(model.error);
|
|
|
|
|
|
|
|
// } else {
|
|
|
|
|
|
|
|
// AppToast.showSuccessToast(message: TranslationBase.of(context).processDoneSuccessfully);
|
|
|
|
|
|
|
|
// await model.getCmcAllPresOrders();
|
|
|
|
|
|
|
|
// }
|
|
|
|
},
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
@ -120,7 +133,7 @@ class OrdersLogDetailsPage extends StatelessWidget {
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
Text(
|
|
|
|
TranslationBase.of(context).serviceName + ": ",
|
|
|
|
TranslationBase.of(context).hospital + ": ",
|
|
|
|
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10),
|
|
|
|
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Expanded(
|
|
|
|
Expanded(
|
|
|
|
@ -139,7 +152,7 @@ class OrdersLogDetailsPage extends StatelessWidget {
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
Text(
|
|
|
|
DateUtil.formatDateToDate(DateUtil.convertStringToDate(order.createdOn), projectViewModel.isArabic),
|
|
|
|
DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(order.createdOn)),
|
|
|
|
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.4, height: 16 / 10),
|
|
|
|
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.4, height: 16 / 10),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
SizedBox(height: 12),
|
|
|
|
SizedBox(height: 12),
|
|
|
|
|