|
|
|
@ -1,6 +1,6 @@
|
|
|
|
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
|
|
|
|
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
|
|
|
|
|
|
|
|
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/GetCMCAllOrdersResponseModel.dart';
|
|
|
|
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.dart';
|
|
|
|
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.dart';
|
|
|
|
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_order_detail_by_order_iD_response_model.dart';
|
|
|
|
|
|
|
|
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/update_pres_oreder_request_model.dart';
|
|
|
|
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/update_pres_oreder_request_model.dart';
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart';
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart';
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
|
|
|
@ -10,8 +10,7 @@ import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.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/widgets/dialogs/ConfirmWithMessageDialog.dart';
|
|
|
|
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
|
|
|
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:geolocator/geolocator.dart';
|
|
|
|
import 'package:geolocator/geolocator.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
@ -85,13 +84,13 @@ class _NewCMCPageState extends State<NewCMCPage> with TickerProviderStateMixin {
|
|
|
|
_context = context;
|
|
|
|
_context = context;
|
|
|
|
ProjectViewModel projectViewModel = Provider.of(context);
|
|
|
|
ProjectViewModel projectViewModel = Provider.of(context);
|
|
|
|
|
|
|
|
|
|
|
|
void showConfirmMessage(CMCViewModel model, GetOrderDetailByOrderIDResponseModel order) {
|
|
|
|
void showConfirmMessage(CMCViewModel model, GetCMCAllOrdersResponseModel order) {
|
|
|
|
showDialog(
|
|
|
|
showDialog(
|
|
|
|
context: context,
|
|
|
|
context: context,
|
|
|
|
child: ConfirmCancelOrderDialog(
|
|
|
|
child: ConfirmWithMessageDialog(
|
|
|
|
model: model,
|
|
|
|
message: TranslationBase.of(context).cancelOrderMsg,
|
|
|
|
onTap: () async {
|
|
|
|
onTap: () async {
|
|
|
|
UpdatePresOrderRequestModel updatePresOrderRequestModel = UpdatePresOrderRequestModel(presOrderID: order.presOrderID, rejectionReason: "", presOrderStatus: 4, editedBy: 3);
|
|
|
|
UpdatePresOrderRequestModel updatePresOrderRequestModel = UpdatePresOrderRequestModel(presOrderID: order.iD, rejectionReason: "", presOrderStatus: 4, editedBy: 3);
|
|
|
|
Future.delayed(new Duration(milliseconds: 300)).then((value) async {
|
|
|
|
Future.delayed(new Duration(milliseconds: 300)).then((value) async {
|
|
|
|
GifLoaderDialogUtils.showMyDialog(_context);
|
|
|
|
GifLoaderDialogUtils.showMyDialog(_context);
|
|
|
|
await model.updateCmcPresOrder(updatePresOrderRequestModel);
|
|
|
|
await model.updateCmcPresOrder(updatePresOrderRequestModel);
|
|
|
|
@ -108,39 +107,62 @@ class _NewCMCPageState extends State<NewCMCPage> with TickerProviderStateMixin {
|
|
|
|
));
|
|
|
|
));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ' ' +
|
|
|
|
int status = widget.model.pendingOrder != null ? widget.model.pendingOrder.statusId : 0;
|
|
|
|
|
|
|
|
String _statusDisp = widget.model.pendingOrder != null ? widget.model.pendingOrder.statusText : "";
|
|
|
|
|
|
|
|
Color _color;
|
|
|
|
|
|
|
|
if (status == 1) {
|
|
|
|
|
|
|
|
//pending
|
|
|
|
|
|
|
|
_color = Color(0xffCC9B14);
|
|
|
|
|
|
|
|
} else if (status == 2) {
|
|
|
|
|
|
|
|
//processing
|
|
|
|
|
|
|
|
_color = Color(0xff2E303A);
|
|
|
|
|
|
|
|
} else if (status == 3) {
|
|
|
|
|
|
|
|
//completed
|
|
|
|
|
|
|
|
_color = Color(0xff359846);
|
|
|
|
|
|
|
|
} else if (status == 4 || status == 6 || status == 7) {
|
|
|
|
|
|
|
|
//cancel // Rejected
|
|
|
|
|
|
|
|
_color = Color(0xffD02127);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return Scaffold(
|
|
|
|
return Scaffold(
|
|
|
|
body: SafeArea(
|
|
|
|
body: SafeArea(
|
|
|
|
child: Container(
|
|
|
|
child: Container(
|
|
|
|
child: widget.model.cmcAllOrderDetail.length != 0 && widget.model.pendingOrder != null
|
|
|
|
child: widget.model.pendingOrder != null
|
|
|
|
? Column(
|
|
|
|
? Column(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
Padding(
|
|
|
|
width: double.infinity,
|
|
|
|
padding: const EdgeInsets.all(21.0),
|
|
|
|
padding: EdgeInsets.only(left: 12, right: 12, top: 12),
|
|
|
|
child: Container(
|
|
|
|
child: Card(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
shape: cardRadius(12),
|
|
|
|
color: _color,
|
|
|
|
elevation: 2,
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
margin: EdgeInsets.zero,
|
|
|
|
Radius.circular(10.0),
|
|
|
|
color: Color(0xffcd9e1b),
|
|
|
|
),
|
|
|
|
clipBehavior: Clip.antiAlias,
|
|
|
|
boxShadow: [
|
|
|
|
|
|
|
|
BoxShadow(
|
|
|
|
|
|
|
|
color: Color(0xff000000).withOpacity(.05),
|
|
|
|
|
|
|
|
blurRadius: 27,
|
|
|
|
|
|
|
|
offset: Offset(0, -3),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
child: Container(
|
|
|
|
child: Container(
|
|
|
|
// decoration: containerColorRadiusLeft(Colors.white, 12),
|
|
|
|
// decoration: containerColorRadiusLeft(Colors.white, 12),
|
|
|
|
margin: EdgeInsets.only(left: projectViewModel.isArabic ? 0 : 8, right: projectViewModel.isArabic ? 8 : 0),
|
|
|
|
margin: EdgeInsets.only(left: projectViewModel.isArabic ? 0 : 6, right: projectViewModel.isArabic ? 6 : 0),
|
|
|
|
padding: EdgeInsets.all(12),
|
|
|
|
padding: EdgeInsets.symmetric(vertical: 14, horizontal: 12),
|
|
|
|
// color: Colors.white,
|
|
|
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
shape: BoxShape.rectangle,
|
|
|
|
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|
|
|
|
|
border: Border.all(color: Colors.white, width: 1),
|
|
|
|
borderRadius: BorderRadius.only(
|
|
|
|
borderRadius: BorderRadius.only(
|
|
|
|
topLeft: projectViewModel.isArabic ? Radius.zero : Radius.circular(12.0),
|
|
|
|
bottomRight: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10.0),
|
|
|
|
topRight: projectViewModel.isArabic ? Radius.circular(12.0) : Radius.zero,
|
|
|
|
topRight: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10.0),
|
|
|
|
bottomLeft: projectViewModel.isArabic ? Radius.zero : Radius.circular(12.0),
|
|
|
|
bottomLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0),
|
|
|
|
bottomRight: projectViewModel.isArabic ? Radius.circular(12.0) : Radius.zero,
|
|
|
|
topLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
// clipBehavior: Clip.antiAlias,
|
|
|
|
// clipBehavior: Clip.antiAlias,
|
|
|
|
child: Row(
|
|
|
|
child: Row(
|
|
|
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
Expanded(
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
@ -148,69 +170,82 @@ class _NewCMCPageState extends State<NewCMCPage> with TickerProviderStateMixin {
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
Text(
|
|
|
|
// TranslationBase.of(context).OrderStatus +
|
|
|
|
_statusDisp,
|
|
|
|
widget.model.pendingOrder.statusText,
|
|
|
|
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: _color, letterSpacing: -0.4, height: 16 / 10),
|
|
|
|
style: TextStyle(
|
|
|
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
|
|
|
letterSpacing: -0.48,
|
|
|
|
|
|
|
|
color: Color(0xffcd9e1b),
|
|
|
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
mHeight(12),
|
|
|
|
SizedBox(height: 6),
|
|
|
|
Text(
|
|
|
|
Text(
|
|
|
|
TranslationBase.of(context).requestID + ' ' + widget.model.pendingOrder.iD.toString(),
|
|
|
|
'${TranslationBase.of(context).requestID}: ${widget.model.pendingOrder.iD}',
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
|
|
|
|
fontSize: 16,
|
|
|
|
|
|
|
|
letterSpacing: -0.48,
|
|
|
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Text(
|
|
|
|
Row(
|
|
|
|
TranslationBase.of(context).serviceName,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
style: TextStyle(
|
|
|
|
children: [
|
|
|
|
fontSize: 12,
|
|
|
|
Text(
|
|
|
|
letterSpacing: -0.48,
|
|
|
|
TranslationBase.of(context).hospital + ": ",
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
Expanded(
|
|
|
|
|
|
|
|
child: Text(
|
|
|
|
|
|
|
|
// !projectViewModel.isArabic ? order.nearestProjectDescription.trim().toString() : order.nearestProjectDescriptionN.toString(),
|
|
|
|
|
|
|
|
widget.model.pendingOrder.projectName.trim().toString(),
|
|
|
|
|
|
|
|
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Text(
|
|
|
|
Row(
|
|
|
|
!projectViewModel.isArabic ? widget.model.cmcAllOrderDetail[0].description.toString() : widget.model.cmcAllOrderDetail[0].descriptionN.toString(),
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
style: TextStyle(
|
|
|
|
children: [
|
|
|
|
fontSize: 12,
|
|
|
|
Text(
|
|
|
|
letterSpacing: -0.48,
|
|
|
|
TranslationBase.of(context).serviceName + ": ",
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
Expanded(
|
|
|
|
|
|
|
|
child: Text(
|
|
|
|
|
|
|
|
widget.model.pendingOrder.serviceText.trim().toString(),
|
|
|
|
|
|
|
|
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Column(
|
|
|
|
Column(
|
|
|
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
Text(
|
|
|
|
DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.model.cmcAllOrderDetail[0].createdOn)),
|
|
|
|
DateUtil.getDayMonthYearDateFormatted(DateTime.tryParse(widget.model.pendingOrder.created)),
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.4, height: 16 / 10),
|
|
|
|
fontSize: 12,
|
|
|
|
|
|
|
|
letterSpacing: -0.48,
|
|
|
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
mHeight(8),
|
|
|
|
SizedBox(height: 12),
|
|
|
|
SecondaryButton(
|
|
|
|
if (widget.model.pendingOrder.statusId == 1 || widget.model.pendingOrder.statusId == 2)
|
|
|
|
onTap: () {
|
|
|
|
InkWell(
|
|
|
|
showConfirmMessage(widget.model, widget.model.cmcAllOrderDetail[0]);
|
|
|
|
onTap: () {
|
|
|
|
},
|
|
|
|
showConfirmMessage(widget.model, widget.model.pendingOrder);
|
|
|
|
label: TranslationBase.of(context).cancel,
|
|
|
|
},
|
|
|
|
color: Colors.red[900],
|
|
|
|
child: Container(
|
|
|
|
small: true,
|
|
|
|
padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14),
|
|
|
|
)
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
|
|
|
color: Color(0xffD02127),
|
|
|
|
|
|
|
|
border: Border.all(color: Colors.white, width: 1),
|
|
|
|
|
|
|
|
borderRadius: BorderRadius.circular(10),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
child: Text(
|
|
|
|
|
|
|
|
TranslationBase.of(context).cancel_nocaps,
|
|
|
|
|
|
|
|
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.4),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
],
|
|
|
|
)
|
|
|
|
)
|
|
|
|
: Container(
|
|
|
|
: Container(
|
|
|
|
|