initial test done

design_3.0_internal_audit_module
waseemabbasi22 2 weeks ago
parent 542070c791
commit b4943aff3d

@ -2,14 +2,13 @@ class URLs {
URLs._();
static const String appReleaseBuildNumber = "26";
// static const host1 = "https://atomsm.hmg.com"; // production url
static const host1 = "https://atomsmdev.hmg.com"; // local DEV url
// static const host1 = "https://atomsmuat.hmg.com"; // local UAT url
// static String _baseUrl = "$_host/mobile";
static final String _baseUrl = "$_host/v2/mobile"; // new V2 apis
// static final String _baseUrl = "$_host/mobile"; // host local UAT
// static final String _baseUrl = "$_host/v2/mobile"; // new V2 apis
static final String _baseUrl = "$_host/mobile"; // host local UAT
// static final String _baseUrl = "$_host/v3/mobile"; // v3 for production CM,PM,TM
static String _host = host1;

@ -103,7 +103,7 @@ class _EquipmentInternalAuditDetailPageState extends State<EquipmentInternalAudi
],
).paddingAll(0).toShadowContainer(context),
).expanded,
if (context.userProvider.isEngineer)
if (context.userProvider.isEngineer&&model?.status?.value!=3)
FooterActionButton.footerContainer(
context: context,
child: AppFilledButton(

@ -133,17 +133,22 @@ class _UpdateEquipmentInternalAuditPageState extends State<UpdateEquipmentIntern
}
final success = await provider.updateEquipmentInternalAudit(model: formModel);
Navigator.pop(context);
if (formModel.isComplete == true) {
//Navigate to List screen.
} else if (formModel.isComplete == false) {
//Navigate to Detail screen.
// if (formModel.isComplete == true) {
if (success) {
Navigator.of(context).pop(true);
} else {
Fluttertoast.showToast(msg: 'Failed to update');
}
//Navigate to List screen.
// } else if (formModel.isComplete == false) {
// //Navigate to Detail screen.
// if (success) {
// Navigator.of(context).pop(true);
// } else {
// Fluttertoast.showToast(msg: 'Failed to update');
// }
}
// }
}
@override

@ -105,7 +105,7 @@ class _SystemInternalAuditDetailPageState extends State<SystemInternalAuditDetai
],
).paddingAll(0).toShadowContainer(context),
).expanded,
if (context.userProvider.isEngineer)
if (context.userProvider.isEngineer && model?.status?.value != 3)
FooterActionButton.footerContainer(
context: context,
child: AppFilledButton(

@ -103,6 +103,7 @@ class _UpdateSystemInternalAuditPageState extends State<UpdateSystemInternalAudi
id: 0,
startDate: formModel.auditTimePicker!.startAt!.toIso8601String(), // Handle potential null
endDate: formModel.auditTimePicker!.endAt?.toIso8601String(), // Handle potential null
// endDate: formModel.auditTimePicker!.startAt?.add(const Duration(hours: 1)).toIso8601String(), // Handle potential null
totalWorkingHour: ((durationInSecond) / 60 / 60),
),
);
@ -131,20 +132,14 @@ class _UpdateSystemInternalAuditPageState extends State<UpdateSystemInternalAudi
),
);
}
log('submit press');
log('data ${formModel.toJson()}');
final success = await provider.updateSystemInternalAudit(model: formModel);
Navigator.pop(context);
if (formModel.isComplete == true) {
//Navigate to List screen.
} else if (formModel.isComplete == false) {
if (success) {
Navigator.of(context).pop(true);
} else {
Fluttertoast.showToast(msg: 'Failed to update');
}
}
}
@override
void dispose() {
@ -162,6 +157,9 @@ class _UpdateSystemInternalAuditPageState extends State<UpdateSystemInternalAudi
formModel.startTime = start;
formModel.endTime = end;
formModel.totalHours = totalHours;
setState(() {
});
}
}
@ -231,7 +229,6 @@ class _UpdateSystemInternalAuditPageState extends State<UpdateSystemInternalAudi
buttonColor: context.isDark ? AppColor.neutral70 : AppColor.white60,
textColor: context.isDark ? AppColor.white10 : AppColor.black10,
onPressed: () {
log('button press ');
formModel.isComplete = false;
_onSubmit(context);
}).expanded,
@ -285,6 +282,7 @@ class _UpdateSystemInternalAuditPageState extends State<UpdateSystemInternalAudi
label: context.translation.workingHours,
showPicker: false,
timer: formModel.auditTimerModel,
// enabled:formModel.endTime==null,
pickerFromDate: DateTime.tryParse(widget.model?.createdDate ?? ''),
pickerTimer: formModel.auditTimePicker,
onPick: (time) {

@ -58,7 +58,6 @@ class _MyRequestsPageState extends State<MyRequestsPage> {
requestsList.add(Request(9, 'TRAF'));
}
if (context.userProvider.isEngineer) {
// TODO need to replace with actual number.
requestsList.add(Request(10, 'Equipment Internal Audit'));
requestsList.add(Request(11, 'System Internal Audit'));
}
@ -72,7 +71,6 @@ class _MyRequestsPageState extends State<MyRequestsPage> {
if (context.userProvider.isQualityUser) {
requestsList = [
Request(null, context.translation.allWorkOrder),
//TODO need to replace with actual number.
Request(10, 'Equipment Internal Audit'),
Request(11, 'System Internal Audit'),
];

Loading…
Cancel
Save