|
|
|
|
@ -29,7 +29,6 @@ import 'new_text_Field.dart';
|
|
|
|
|
|
|
|
|
|
enum BeneficiaryType { MyAccount, MyFamilyFiles, OtherAccount, NON }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class AdvancePaymentPage extends StatefulWidget {
|
|
|
|
|
@override
|
|
|
|
|
_AdvancePaymentPageState createState() => _AdvancePaymentPageState();
|
|
|
|
|
@ -238,13 +237,35 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
|
|
|
|
|
_fileTextController.text.isEmpty ||
|
|
|
|
|
_selectedHospital == null,
|
|
|
|
|
onTap: () {
|
|
|
|
|
var mobileNum;
|
|
|
|
|
var patientName;
|
|
|
|
|
|
|
|
|
|
if (beneficiaryType == BeneficiaryType.MyFamilyFiles) {
|
|
|
|
|
mobileNum = selectedPatientFamily.mobileNumber;
|
|
|
|
|
patientName = selectedPatientFamily.patientName;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (beneficiaryType == BeneficiaryType.MyAccount) {
|
|
|
|
|
mobileNum = model.user.mobileNumber;
|
|
|
|
|
patientName = model.user.firstName;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (beneficiaryType == BeneficiaryType.OtherAccount) {
|
|
|
|
|
mobileNum = _selectedPatientInfo.mobileNumber;
|
|
|
|
|
patientName = _selectedPatientInfo.fullName;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
advanceModel.fileNumber = _fileTextController.text;
|
|
|
|
|
advanceModel.hospitalsModel = _selectedHospital;
|
|
|
|
|
advanceModel.note = _notesTextController.text;
|
|
|
|
|
advanceModel.email = email ?? model.user.emailAddress;
|
|
|
|
|
advanceModel.amount = amount;
|
|
|
|
|
advanceModel.mobileNumber = mobileNum;
|
|
|
|
|
advanceModel.patientName = patientName;
|
|
|
|
|
|
|
|
|
|
model.getPatientInfoByPatientIDAndMobileNumber().then((value) {
|
|
|
|
|
model
|
|
|
|
|
.getPatientInfoByPatientIDAndMobileNumber(advanceModel)
|
|
|
|
|
.then((value) {
|
|
|
|
|
if (model.state != ViewState.Error &&
|
|
|
|
|
model.state != ViewState.ErrorLocal) {
|
|
|
|
|
Utils.hideKeyboard(context);
|
|
|
|
|
@ -269,8 +290,8 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}).showProgressBar(
|
|
|
|
|
text: "Loading",
|
|
|
|
|
backgroundColor: Colors.blue.withOpacity(0.6));
|
|
|
|
|
text: "Loading",
|
|
|
|
|
backgroundColor: Colors.blue.withOpacity(0.6));
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
)),
|
|
|
|
|
@ -331,22 +352,22 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
|
|
|
|
|
|
|
|
|
|
void confirmSelectFamilyDialog(
|
|
|
|
|
List<GetAllSharedRecordsByStatusList> getAllSharedRecordsByStatusList) {
|
|
|
|
|
if(getAllSharedRecordsByStatusList.isNotEmpty)
|
|
|
|
|
showDialog(
|
|
|
|
|
context: context,
|
|
|
|
|
child: SelectPatientFamilyDialog(
|
|
|
|
|
getAllSharedRecordsByStatusList: getAllSharedRecordsByStatusList,
|
|
|
|
|
selectedPatientFamily: selectedPatientFamily,
|
|
|
|
|
onValueSelected: (value) {
|
|
|
|
|
setState(() {
|
|
|
|
|
selectedPatientFamily = value;
|
|
|
|
|
_fileTextController.text =
|
|
|
|
|
selectedPatientFamily.patientID.toString();
|
|
|
|
|
advanceModel.depositorName = value.patientName;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
if (getAllSharedRecordsByStatusList.isNotEmpty)
|
|
|
|
|
showDialog(
|
|
|
|
|
context: context,
|
|
|
|
|
child: SelectPatientFamilyDialog(
|
|
|
|
|
getAllSharedRecordsByStatusList: getAllSharedRecordsByStatusList,
|
|
|
|
|
selectedPatientFamily: selectedPatientFamily,
|
|
|
|
|
onValueSelected: (value) {
|
|
|
|
|
setState(() {
|
|
|
|
|
selectedPatientFamily = value;
|
|
|
|
|
_fileTextController.text =
|
|
|
|
|
selectedPatientFamily.responseID.toString();
|
|
|
|
|
advanceModel.depositorName = value.patientName;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String getBeneficiaryType() {
|
|
|
|
|
|