Compare commits

...

3 Commits

Author SHA1 Message Date
waseemabbasi22 de48ca97bd initial test done 2 weeks ago
waseemabbasi22 c9d2df4ea7 Merge remote-tracking branch 'origin/design_3.0_internal_audit_module' into design_3.0_internal_audit_module
# Conflicts:
#	lib/controllers/api_routes/urls.dart
2 weeks ago
waseemabbasi22 b4943aff3d initial test done 2 weeks ago

@ -9,9 +9,8 @@ class URLs {
// static const host1 = "http://10.201.111.125:9495"; // temporary Server UAT url
// static String _baseUrl = "$_host/mobile";
static final String _baseUrl = "$_host/v2/mobile"; // new V2 apis
// static final String _baseUrl = "$_host/v4/mobile"; // for asset inventory on UAT
// 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 and for internal audit dev
// static final String _baseUrl = "$_host/v3/mobile"; // v3 for production CM,PM,TM
// static final String _baseUrl = "$_host/v5/mobile"; // v5 for data segregation

@ -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,18 +132,12 @@ 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');
}
if (success) {
Navigator.of(context).pop(true);
} else {
Fluttertoast.showToast(msg: 'Failed to update');
}
}
@ -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) {

@ -63,7 +63,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'));
}
@ -77,7 +76,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