|
|
|
|
@ -22,6 +22,7 @@ import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
|
|
class AddSickLeavScreen extends StatelessWidget {
|
|
|
|
|
PatiantInformtion patient;
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
ProjectViewModel projectsProvider = Provider.of<ProjectViewModel>(context);
|
|
|
|
|
@ -31,8 +32,10 @@ class AddSickLeavScreen extends StatelessWidget {
|
|
|
|
|
bool isInpatient = routeArgs['isInpatient'];
|
|
|
|
|
return BaseView<SickLeaveViewModel>(
|
|
|
|
|
onModelReady: (model) async {
|
|
|
|
|
await model.getSickLeavePatient(patient.patientMRN ?? patient.patientId);
|
|
|
|
|
await model.getSickLeaveDoctor(patient.patientMRN ?? patient.patientId);
|
|
|
|
|
await model
|
|
|
|
|
.getSickLeavePatient(patient.patientMRN ?? patient.patientId);
|
|
|
|
|
await model
|
|
|
|
|
.getSickLeaveDoctor(patient.patientMRN ?? patient.patientId);
|
|
|
|
|
},
|
|
|
|
|
builder: (_, model, w) => AppScaffold(
|
|
|
|
|
baseViewModel: model,
|
|
|
|
|
@ -79,17 +82,21 @@ class AddSickLeavScreen extends StatelessWidget {
|
|
|
|
|
},
|
|
|
|
|
child: Container(
|
|
|
|
|
width: SizeConfig.screenWidth,
|
|
|
|
|
margin: EdgeInsets.only(left: 20, right: 20, top: 10, bottom: 10),
|
|
|
|
|
margin: EdgeInsets.only(
|
|
|
|
|
left: 20, right: 20, top: 10, bottom: 10),
|
|
|
|
|
padding: EdgeInsets.all(20),
|
|
|
|
|
decoration:
|
|
|
|
|
BoxDecoration(borderRadius: BorderRadius.circular(10), color: HexColor('#EAEAEA')),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius: BorderRadius.circular(10),
|
|
|
|
|
color: HexColor('#EAEAEA')),
|
|
|
|
|
child: Column(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
child: Container(
|
|
|
|
|
decoration:
|
|
|
|
|
BoxDecoration(color: Colors.grey, borderRadius: BorderRadius.circular(10)),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: Colors.grey,
|
|
|
|
|
borderRadius:
|
|
|
|
|
BorderRadius.circular(10)),
|
|
|
|
|
padding: EdgeInsets.all(3),
|
|
|
|
|
child: IconButton(
|
|
|
|
|
icon: Icon(
|
|
|
|
|
@ -106,7 +113,9 @@ class AddSickLeavScreen extends StatelessWidget {
|
|
|
|
|
),
|
|
|
|
|
)),
|
|
|
|
|
Padding(
|
|
|
|
|
child: AppText(TranslationBase.of(context).noSickLeaveApplied,
|
|
|
|
|
child: AppText(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.noSickLeaveApplied,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
@ -122,7 +131,8 @@ class AddSickLeavScreen extends StatelessWidget {
|
|
|
|
|
: SizedBox(),
|
|
|
|
|
model.getAllSIckLeavePatient.length > 0
|
|
|
|
|
? Column(
|
|
|
|
|
children: model.getAllSIckLeavePatient.map<Widget>((SickLeavePatientModel item) {
|
|
|
|
|
children: model.getAllSIckLeavePatient
|
|
|
|
|
.map<Widget>((SickLeavePatientModel item) {
|
|
|
|
|
return RoundedContainer(
|
|
|
|
|
margin: EdgeInsets.all(10),
|
|
|
|
|
child: Column(
|
|
|
|
|
@ -141,7 +151,8 @@ class AddSickLeavScreen extends StatelessWidget {
|
|
|
|
|
// ))),
|
|
|
|
|
padding: EdgeInsets.all(10),
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 4,
|
|
|
|
|
@ -150,7 +161,8 @@ class AddSickLeavScreen extends StatelessWidget {
|
|
|
|
|
// MainAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
padding: EdgeInsets.all(3),
|
|
|
|
|
@ -168,7 +180,8 @@ class AddSickLeavScreen extends StatelessWidget {
|
|
|
|
|
// : TranslationBase
|
|
|
|
|
// .of(context)
|
|
|
|
|
// .all,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
fontWeight:
|
|
|
|
|
FontWeight.bold,
|
|
|
|
|
// color: item.status == 1
|
|
|
|
|
// ? Colors.yellow[800]
|
|
|
|
|
// : item.status == 2
|
|
|
|
|
@ -179,25 +192,48 @@ class AddSickLeavScreen extends StatelessWidget {
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
AppText(TranslationBase.of(context).daysSickleave + ": "),
|
|
|
|
|
AppText(TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.daysSickleave +
|
|
|
|
|
": "),
|
|
|
|
|
AppText(
|
|
|
|
|
item.sickLeaveDays.toString() ?? item.noOfDays.toString(),
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
(item.sickLeaveDays
|
|
|
|
|
.toString() !=
|
|
|
|
|
null &&
|
|
|
|
|
item.sickLeaveDays
|
|
|
|
|
.toString() !=
|
|
|
|
|
"null")
|
|
|
|
|
? item.sickLeaveDays
|
|
|
|
|
.toString()
|
|
|
|
|
: item.noOfDays
|
|
|
|
|
.toString(),
|
|
|
|
|
fontWeight:
|
|
|
|
|
FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
TranslationBase.of(context).startDate + ' ' ?? "",
|
|
|
|
|
TranslationBase.of(
|
|
|
|
|
context)
|
|
|
|
|
.startDate +
|
|
|
|
|
' ' ??
|
|
|
|
|
"",
|
|
|
|
|
),
|
|
|
|
|
Flexible(
|
|
|
|
|
child: AppText(
|
|
|
|
|
AppDateUtils.getDayMonthYearDateFormatted(
|
|
|
|
|
item.startDate.contains("/Date(")
|
|
|
|
|
? AppDateUtils.convertStringToDate(item.startDate)
|
|
|
|
|
: DateTime.parse(item.startDate)),
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
AppDateUtils.getDayMonthYearDateFormatted(item
|
|
|
|
|
.startDate
|
|
|
|
|
.contains(
|
|
|
|
|
"/Date(")
|
|
|
|
|
? AppDateUtils
|
|
|
|
|
.convertStringToDate(item
|
|
|
|
|
.startDate)
|
|
|
|
|
: DateTime.parse(
|
|
|
|
|
item.startDate)),
|
|
|
|
|
fontWeight:
|
|
|
|
|
FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
@ -205,18 +241,30 @@ class AddSickLeavScreen extends StatelessWidget {
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
TranslationBase.of(context).endDate + ' ' ?? "",
|
|
|
|
|
TranslationBase.of(
|
|
|
|
|
context)
|
|
|
|
|
.endDate +
|
|
|
|
|
' ' ??
|
|
|
|
|
"",
|
|
|
|
|
),
|
|
|
|
|
Flexible(
|
|
|
|
|
child: AppText(
|
|
|
|
|
AppDateUtils.getDayMonthYearDateFormatted(
|
|
|
|
|
item.startDate.contains("/Date(")
|
|
|
|
|
? AppDateUtils.convertStringToDate(item.endDate ?? "")
|
|
|
|
|
.add(Duration(
|
|
|
|
|
days: item.noOfDays ?? item.sickLeaveDays))
|
|
|
|
|
: DateTime.parse(item.startDate ?? "")
|
|
|
|
|
.add(Duration(days: item.noOfDays ?? ""))),
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
AppDateUtils.getDayMonthYearDateFormatted(item
|
|
|
|
|
.startDate
|
|
|
|
|
.contains(
|
|
|
|
|
"/Date(")
|
|
|
|
|
? AppDateUtils.convertStringToDate(
|
|
|
|
|
item.endDate ??
|
|
|
|
|
"")
|
|
|
|
|
.add(Duration(
|
|
|
|
|
days: item.noOfDays ??
|
|
|
|
|
item
|
|
|
|
|
.sickLeaveDays))
|
|
|
|
|
: DateTime.parse(
|
|
|
|
|
item.startDate ?? "")
|
|
|
|
|
.add(Duration(days: item.noOfDays ?? ""))),
|
|
|
|
|
fontWeight:
|
|
|
|
|
FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
@ -246,7 +294,8 @@ class AddSickLeavScreen extends StatelessWidget {
|
|
|
|
|
Image.asset('assets/images/no-data.png'),
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.all(8.0),
|
|
|
|
|
child: AppText(TranslationBase.of(context).noSickLeave),
|
|
|
|
|
child: AppText(
|
|
|
|
|
TranslationBase.of(context).noSickLeave),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
@ -255,7 +304,8 @@ class AddSickLeavScreen extends StatelessWidget {
|
|
|
|
|
]))));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
openSickLeave(BuildContext context, isExtend, {GetAllSickLeaveResponse extendedData}) {
|
|
|
|
|
openSickLeave(BuildContext context, isExtend,
|
|
|
|
|
{GetAllSickLeaveResponse extendedData}) {
|
|
|
|
|
// showModalBottomSheet(
|
|
|
|
|
// context: context,
|
|
|
|
|
// builder: (context) {
|
|
|
|
|
@ -265,9 +315,13 @@ class AddSickLeavScreen extends StatelessWidget {
|
|
|
|
|
context,
|
|
|
|
|
FadePage(
|
|
|
|
|
page: SickLeaveScreen(
|
|
|
|
|
appointmentNo:
|
|
|
|
|
isExtend == true ? extendedData.appointmentNo : patient.appointmentNo, //extendedData.appointmentNo,
|
|
|
|
|
patientMRN: isExtend == true ? extendedData.patientMRN : patient.patientMRN,
|
|
|
|
|
appointmentNo: isExtend == true
|
|
|
|
|
? extendedData.appointmentNo
|
|
|
|
|
: patient.appointmentNo,
|
|
|
|
|
//extendedData.appointmentNo,
|
|
|
|
|
patientMRN: isExtend == true
|
|
|
|
|
? extendedData.patientMRN
|
|
|
|
|
: patient.patientMRN,
|
|
|
|
|
isExtended: isExtend,
|
|
|
|
|
extendedData: extendedData,
|
|
|
|
|
patient: patient)));
|
|
|
|
|
|