bug fixes.

design_3.0_asset_inventory_module
Sikander Saleem 2 months ago
parent 3d2e908613
commit 5c8e1d5763

@ -310,7 +310,7 @@ class _CreateTRAFRequestPageState extends State<CreateTRAFRequestPage> {
initialValue: isUsedSolelyOrShared,
onSelect: (value) {
isUsedSolelyOrShared = value;
trafRequest?.usingSolelyOrSharedId = value?.value;
trafRequest?.usingSolelyOrSharedId = value?.id;
if (isUsedSolelyOrShared?.value != 1) {
departments = [];
trafRequest?.trafDepartments = [];
@ -353,7 +353,7 @@ class _CreateTRAFRequestPageState extends State<CreateTRAFRequestPage> {
initialValue: otherServicesEffects,
onSelect: (value) {
otherServicesEffects = value;
trafRequest?.isEffectedId = value?.value;
trafRequest?.isEffectedId = value?.id;
if (otherServicesEffects?.value != 1) {
trafRequest?.effectedServices = null;
FocusScope.of(context).unfocus();
@ -395,7 +395,7 @@ class _CreateTRAFRequestPageState extends State<CreateTRAFRequestPage> {
initialValue: useInCombination,
onSelect: (value) {
useInCombination = value;
trafRequest?.isCombinationId = value?.value;
trafRequest?.isCombinationId = value?.id;
if (useInCombination?.value != 1) {
trafRequest?.usedWithCombination = null;
FocusScope.of(context).unfocus();
@ -483,11 +483,25 @@ class _CreateTRAFRequestPageState extends State<CreateTRAFRequestPage> {
"Please specify users going to use technology".showToast;
return;
}
if (isUsedSolelyOrShared == null) {
"Please specify technology solely or shared".showToast;
return;
}
if (isUsedSolelyOrShared?.value == 1 && (trafRequest?.trafDepartments ?? []).isEmpty) {
"Please specify departments and relations".showToast;
return;
}
if (otherServicesEffects == null) {
"Please specify other services will be effected or not".showToast;
return;
}
if (useInCombination == null) {
"Please specify equipment used in combination or not".showToast;
return;
}
Utils.showLoading(context);
bool isSuccess = await Provider.of<TrafRequestProvider>(context, listen: false).addTraf(trafRequest!.toJson());
Utils.hideLoading(context);

@ -93,14 +93,14 @@ class _TrafRequestDetailPageState extends State<TrafRequestDetailPage> {
),
8.height,
'${context.translation.employeeId}: ${data.employeeIdForDisplay ?? '-'}'.bodyText(context),
'${context.translation.name}: ${data.employeeName ?? '-'}'.bodyText(context), // todo ask shaheer
'${context.translation.email}: ${data.employeeEmail ?? '-'}'.bodyText(context), // todo ask shaheer
'Position: ${data.positionName ?? '-'}'.bodyText(context), // todo ask shaheer
'${context.translation.name}: ${data.employeeName ?? '-'}'.bodyText(context),
'${context.translation.email}: ${data.employeeEmail ?? '-'}'.bodyText(context),
'Position: ${data.positionName ?? '-'}'.bodyText(context),
'${context.translation.site}: ${data.siteName ?? '-'}'.bodyText(context),
'${context.translation.department}: ${data.departments?.map((item) => item.departmentName).toList() ?? '-'}'.bodyText(context),
'Requester Extension: ${data.requesterExtensionName ?? '-'}'.bodyText(context),
'${context.translation.extensionNo}: ${data.requesterExtensionNumber ?? '-'}'.bodyText(context),
'${context.translation.phoneNumber}: ${data.requesterContactNumber ?? '-'}'.bodyText(context),
'${context.translation.department}: ${data.departmentName}'.bodyText(context),
// 'Requester Extension: ${data.requesterExtensionName ?? '-'}'.bodyText(context),
'Number/Contact Information: ${data.requesterContactNumber ?? '-'}'.bodyText(context),
'Extension: ${data.requesterExtensionNumber ?? '-'}'.bodyText(context),
],
).toShadowContainer(context, borderRadius: 20, padding: 12);
}
@ -131,10 +131,22 @@ class _TrafRequestDetailPageState extends State<TrafRequestDetailPage> {
.bodyText(context),
4.height,
'Is the requesting department going to use the technology solely or shared with other departments?:\n${data.usingSolelyOrSharedName ?? '-'}'.bodyText(context),
if ((data.departments ?? []).isNotEmpty) ...[
4.height,
'Technology used with other departments:\n${data.departments?.map((item) => item.departmentName).toList() ?? '-'}'.bodyText(context),
],
4.height,
'Would other services be effected by acquiring the new equipment?:\n${data.effectedServices ?? '-'}'.bodyText(context),
'Would other services be effected by acquiring the new equipment?:\n${data.isEffectedName ?? '-'}'.bodyText(context),
if ((data.effectedServices ?? "").isNotEmpty) ...[
4.height,
'List of services would it be effected:\n${data.effectedServices ?? '-'}'.bodyText(context),
],
4.height,
'Is the equipment going to be used with combination of other equipment to accomplish a specific procedure?:\n${data.usedWithCombination ?? '-'}'.bodyText(context),
'Is the equipment going to be used with combination of other equipment to accomplish a specific procedure?:\n${data.isCombinationName ?? '-'}'.bodyText(context),
if ((data.usedWithCombination ?? "").isNotEmpty) ...[
4.height,
'Equipment going to be used with combination of other equipments:\n${data.usedWithCombination ?? '-'}'.bodyText(context),
],
],
).toShadowContainer(context, borderRadius: 20, padding: 12);
}

@ -51,6 +51,8 @@ class TrafRequestDataModel {
String? employeeEmail;
int? positionId;
String? positionName;
String? departmentId;
String? departmentName;
List<Departments>? departments;
List<Departments>? trafDepartments;
int? siteId;
@ -147,6 +149,8 @@ class TrafRequestDataModel {
this.employeeEmail,
this.positionId,
this.positionName,
this.departmentId,
this.departmentName,
this.departments,
this.trafDepartments,
this.siteId,
@ -243,6 +247,8 @@ class TrafRequestDataModel {
employeeEmail = json['employeeEmail'];
positionId = json['positionId'];
positionName = json['positionName'];
departmentId = json['departmentId'];
departmentName = json['departmentName'];
if (json['departments'] != null) {
departments = <Departments>[];
json['departments'].forEach((v) {
@ -366,6 +372,8 @@ class TrafRequestDataModel {
data['employeeEmail'] = this.employeeEmail;
data['positionId'] = this.positionId;
data['positionName'] = this.positionName;
data['departmentId'] = this.departmentId;
data['departmentName'] = this.departmentName;
if (this.departments != null) {
data['departments'] = this.departments!.map((v) => v.toJson()).toList();
}

Loading…
Cancel
Save