FIX_bug fixes
This commit is contained in:
parent
7f6e79ceb8
commit
35ab0f994b
@ -154,7 +154,7 @@ class ApiService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> getPdfDownload(String path, String id) async {
|
Future<void> getPdfDownload(BuildContext context,String path, String id) async {
|
||||||
print('getPdfDownload 1');
|
print('getPdfDownload 1');
|
||||||
print('getPdfDownload 1 - $path');
|
print('getPdfDownload 1 - $path');
|
||||||
|
|
||||||
@ -175,7 +175,17 @@ class ApiService {
|
|||||||
|
|
||||||
final response = await _makeGethttpRequest(url, headers);
|
final response = await _makeGethttpRequest(url, headers);
|
||||||
print('getPdfDownload 3');
|
print('getPdfDownload 3');
|
||||||
|
|
||||||
|
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
|
final contentType = response.headers['content-type'] ?? '';
|
||||||
|
if (contentType.contains('application/json')) {
|
||||||
|
final jsonResponse = jsonDecode(response.body);
|
||||||
|
if (jsonResponse['code'] == 404 || jsonResponse['code'] == 500)
|
||||||
|
{ ToastHelper.showInfoToast(context, 'File Not Found'); }
|
||||||
|
else { ToastHelper.showInfoToast(context, 'No File Found'); }
|
||||||
|
return;
|
||||||
|
}else{
|
||||||
final blob = html.Blob([response.bodyBytes]);
|
final blob = html.Blob([response.bodyBytes]);
|
||||||
final blobUrl = html.Url.createObjectUrlFromBlob(blob);
|
final blobUrl = html.Url.createObjectUrlFromBlob(blob);
|
||||||
print('getPdfDownload $blobUrl');
|
print('getPdfDownload $blobUrl');
|
||||||
@ -199,6 +209,7 @@ class ApiService {
|
|||||||
..click();
|
..click();
|
||||||
print('getPdfDownloadcontentDisp..4');
|
print('getPdfDownloadcontentDisp..4');
|
||||||
html.Url.revokeObjectUrl(blobUrl);
|
html.Url.revokeObjectUrl(blobUrl);
|
||||||
|
}
|
||||||
} else if (response.statusCode == 404) {
|
} else if (response.statusCode == 404) {
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
@ -245,7 +256,7 @@ class ApiService {
|
|||||||
} else if (apiUrl != null) {
|
} else if (apiUrl != null) {
|
||||||
print("Download from API: $apiUrl");
|
print("Download from API: $apiUrl");
|
||||||
print("Download from API: $apiId!");
|
print("Download from API: $apiId!");
|
||||||
await getPdfDownload(apiUrl, apiId!);
|
await getPdfDownload(context,apiUrl, apiId!);
|
||||||
} else {
|
} else {
|
||||||
print("⚠️ No file available to download");
|
print("⚠️ No file available to download");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -93,7 +93,7 @@ class EnquiryTabState extends ConsumerState<EnquiryTab> {
|
|||||||
|
|
||||||
Map<String, dynamic> dataDetails() {
|
Map<String, dynamic> dataDetails() {
|
||||||
final data = {
|
final data = {
|
||||||
"agent_id": 1,
|
"agent_id": userId,
|
||||||
"name": controllers["name"]?.text,
|
"name": controllers["name"]?.text,
|
||||||
"mobile": controllers["mobile"]?.text,
|
"mobile": controllers["mobile"]?.text,
|
||||||
"email": controllers["email"]?.text,
|
"email": controllers["email"]?.text,
|
||||||
@ -282,38 +282,89 @@ class EnquiryTabState extends ConsumerState<EnquiryTab> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Future<void> handleSave() async {
|
||||||
|
// if (!_formKey.currentState!.validate()) return;
|
||||||
|
// setState(() {
|
||||||
|
// if (_formKey.currentState!.validate()) {
|
||||||
|
// isSaving = true;
|
||||||
|
// dataDetails();
|
||||||
|
// final dataSet = dataDetails();
|
||||||
|
// print("dataSetAgent - $dataSet");
|
||||||
|
// print("managerId - $managerId ,userId - $userId ");
|
||||||
|
//
|
||||||
|
// if ((docUploadedRCFile == null ||
|
||||||
|
// (docUploadedRCFile?.bytes == null &&
|
||||||
|
// docUploadedRCFile?.path == null)) &&
|
||||||
|
// (rcFileUrlFromApi == null || rcFileUrlFromApi!.isEmpty)) {
|
||||||
|
// ToastHelper.showErrorToast(context, "Please upload RC Document");
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// if ((docUploadedIDProof == null ||
|
||||||
|
// (docUploadedIDProof?.bytes == null &&
|
||||||
|
// docUploadedIDProof?.path == null)) &&
|
||||||
|
// (idProofFileUrlFromApi == null || idProofFileUrlFromApi!.isEmpty)) {
|
||||||
|
// ToastHelper.showErrorToast(context, "Please upload ID Proof");
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
// createUserData(dataSet);
|
||||||
|
// } else {
|
||||||
|
// // isDisable = false;
|
||||||
|
//
|
||||||
|
// setState(() => isSaving = false);
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
|
||||||
Future<void> handleSave() async {
|
Future<void> handleSave() async {
|
||||||
if (!_formKey.currentState!.validate()) return;
|
if (!_formKey.currentState!.validate()) return;
|
||||||
|
|
||||||
setState(() {
|
setState(() {
|
||||||
if (_formKey.currentState!.validate()) {
|
isSaving = true; // start saving
|
||||||
isSaving = true;
|
|
||||||
dataDetails();
|
|
||||||
final dataSet = dataDetails();
|
|
||||||
print("dataSetAgent - $dataSet");
|
|
||||||
print("managerId - $managerId ,userId - $userId ");
|
|
||||||
|
|
||||||
if ((docUploadedRCFile == null ||
|
|
||||||
(docUploadedRCFile?.bytes == null &&
|
|
||||||
docUploadedRCFile?.path == null)) &&
|
|
||||||
(rcFileUrlFromApi == null || rcFileUrlFromApi!.isEmpty)) {
|
|
||||||
ToastHelper.showErrorToast(context, "Please upload RC Document");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((docUploadedIDProof == null ||
|
|
||||||
(docUploadedIDProof?.bytes == null &&
|
|
||||||
docUploadedIDProof?.path == null)) &&
|
|
||||||
(idProofFileUrlFromApi == null || idProofFileUrlFromApi!.isEmpty)) {
|
|
||||||
ToastHelper.showErrorToast(context, "Please upload ID Proof");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
createUserData(dataSet);
|
|
||||||
} else {
|
|
||||||
// isDisable = false;
|
|
||||||
|
|
||||||
setState(() => isSaving = false);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
final dataSet = dataDetails();
|
||||||
|
|
||||||
|
// check RC file
|
||||||
|
if ((docUploadedRCFile == null ||
|
||||||
|
(docUploadedRCFile?.bytes == null &&
|
||||||
|
docUploadedRCFile?.path == null)) &&
|
||||||
|
(rcFileUrlFromApi == null || rcFileUrlFromApi!.isEmpty)) {
|
||||||
|
setState(() => isSaving = false); // reset button
|
||||||
|
ToastHelper.showErrorToast(context, "Please upload RC Document");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// check ID proof
|
||||||
|
if ((docUploadedIDProof == null ||
|
||||||
|
(docUploadedIDProof?.bytes == null &&
|
||||||
|
docUploadedIDProof?.path == null)) &&
|
||||||
|
(idProofFileUrlFromApi == null || idProofFileUrlFromApi!.isEmpty)) {
|
||||||
|
setState(() => isSaving = false); // reset button
|
||||||
|
ToastHelper.showErrorToast(context, "Please upload ID Proof");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
await createUserData(dataSet); // API call
|
||||||
|
ToastHelper.showInfoToast(context, "Enquiry saved successfully");
|
||||||
|
} catch (e) {
|
||||||
|
showDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (_) => AlertDialog(
|
||||||
|
title: const Text('Error'),
|
||||||
|
content: Text(e.toString()),
|
||||||
|
actions: [
|
||||||
|
TextButton(
|
||||||
|
onPressed: () => Navigator.of(context).pop(),
|
||||||
|
child: const Text('OK'),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
} finally {
|
||||||
|
setState(() => isSaving = false); // re-enable button after save
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> attachFiles(http.MultipartRequest request) async {
|
Future<void> attachFiles(http.MultipartRequest request) async {
|
||||||
|
|||||||
@ -441,7 +441,7 @@ class PolicyTabState extends ConsumerState<PolicyTab> {
|
|||||||
// 'api/agent/downloadAgentIncentiveFile?id=$selectedId';
|
// 'api/agent/downloadAgentIncentiveFile?id=$selectedId';
|
||||||
final path =
|
final path =
|
||||||
'api/policy/downloadPolicyFile?policy_id=$selectedId&file_type=policy_pdf';
|
'api/policy/downloadPolicyFile?policy_id=$selectedId&file_type=policy_pdf';
|
||||||
apiService.getPdfDownload(path, selectedId);
|
apiService.getPdfDownload(context,path, selectedId);
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: const EdgeInsets.all(8),
|
padding: const EdgeInsets.all(8),
|
||||||
@ -480,7 +480,7 @@ class PolicyTabState extends ConsumerState<PolicyTab> {
|
|||||||
// 'api/agent/downloadAgentIncentiveFile?id=$selectedId';
|
// 'api/agent/downloadAgentIncentiveFile?id=$selectedId';
|
||||||
final path =
|
final path =
|
||||||
'api/policy/downloadPolicyFile?policy_id=$selectedId&file_type=policy_payment_receipt';
|
'api/policy/downloadPolicyFile?policy_id=$selectedId&file_type=policy_payment_receipt';
|
||||||
apiService.getPdfDownload(path, selectedId);
|
apiService.getPdfDownload(context,path, selectedId);
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: const EdgeInsets.all(8),
|
padding: const EdgeInsets.all(8),
|
||||||
|
|||||||
@ -698,6 +698,7 @@ class QuotationTabState extends ConsumerState<QuotationTab> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Widget buildDocuments(BuildContext context) {
|
Widget buildDocuments(BuildContext context) {
|
||||||
return buildResponsiveUploadField(
|
return buildResponsiveUploadField(
|
||||||
label: 'Quotation Documents',
|
label: 'Quotation Documents',
|
||||||
|
|||||||
@ -51,11 +51,17 @@ class EnquiryListState extends ConsumerState<EnquiryList> {
|
|||||||
Future.microtask(() {
|
Future.microtask(() {
|
||||||
final id = ref.read(managerIdProvider);
|
final id = ref.read(managerIdProvider);
|
||||||
final roleId = ref.read(userRoleProvider);
|
final roleId = ref.read(userRoleProvider);
|
||||||
|
final userId = ref.read(userIdProvider);
|
||||||
|
|
||||||
|
print("A56 => r : $roleId | mId: $id | uId: $userId ");
|
||||||
|
|
||||||
|
// Staff - sanjeev.p@venbainfotech.com - T E S T S - 9 evarukku 8th id is manager
|
||||||
|
// Manager - venbalap08@gmail.com - T E S T M - 8 evarukku 8th id is manager
|
||||||
|
// Agent - venba2026@gmail.com - T E S T A - 5 evarkku 8th id is manager
|
||||||
|
// so here i used userId
|
||||||
|
|
||||||
|
if (userId != null) { getStaffList(userId, roleId); }
|
||||||
|
|
||||||
print("ENQroleId - $roleId");
|
|
||||||
if (id != null) {
|
|
||||||
getStaffList(id, roleId);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -63,7 +69,7 @@ class EnquiryListState extends ConsumerState<EnquiryList> {
|
|||||||
void refrshfilterDateRange() {}
|
void refrshfilterDateRange() {}
|
||||||
|
|
||||||
Future<void> getStaffList(int managerId, role) async {
|
Future<void> getStaffList(int managerId, role) async {
|
||||||
print('getClaimList called MagId - $managerId - $role');
|
print('A72 => Fns called => $managerId | $role');
|
||||||
setState(() {
|
setState(() {
|
||||||
isLoading = true;
|
isLoading = true;
|
||||||
});
|
});
|
||||||
@ -73,7 +79,7 @@ class EnquiryListState extends ConsumerState<EnquiryList> {
|
|||||||
|
|
||||||
if (response['status'] == 'success') {
|
if (response['status'] == 'success') {
|
||||||
final data = response['data'];
|
final data = response['data'];
|
||||||
print('getStaffListData - ${response['data']}');
|
print('A82 => getStaffListData => ${response['data']}');
|
||||||
setState(() {
|
setState(() {
|
||||||
if (data is List) {
|
if (data is List) {
|
||||||
// Already a list of maps
|
// Already a list of maps
|
||||||
@ -159,19 +165,22 @@ class EnquiryListState extends ConsumerState<EnquiryList> {
|
|||||||
filteredData = getStaffData.where((item) {
|
filteredData = getStaffData.where((item) {
|
||||||
// final isActiveStatus = item['is_active'] == "1" ? "active" : "inactive";
|
// final isActiveStatus = item['is_active'] == "1" ? "active" : "inactive";
|
||||||
|
|
||||||
return (_formatDate(item['created_on']) ?? '').toLowerCase().contains(
|
return (_formatDate(item['created_on']) ?? '-').toLowerCase().contains(
|
||||||
query.toLowerCase(),
|
query.toLowerCase(),
|
||||||
) ||
|
) ||
|
||||||
(item['reg_no'] ?? '').toLowerCase().contains(
|
(_formatDate(item['updated_on']) ?? '-').toLowerCase().contains(
|
||||||
query.toLowerCase(),
|
query.toLowerCase(),
|
||||||
) ||
|
) ||
|
||||||
(item['insurer_name'] ?? '').toLowerCase().contains(
|
(item['reg_no'] ?? '-').toLowerCase().contains(
|
||||||
query.toLowerCase(),
|
query.toLowerCase(),
|
||||||
) ||
|
) ||
|
||||||
(item['status'] ?? '').toLowerCase().contains(
|
(item['insurer_name'] ?? '-').toLowerCase().contains(
|
||||||
query.toLowerCase(),
|
query.toLowerCase(),
|
||||||
) ||
|
) ||
|
||||||
(item['remarks'] ?? '').toLowerCase().contains(query.toLowerCase());
|
(item['status'] ?? '-').toLowerCase().contains(
|
||||||
|
query.toLowerCase(),
|
||||||
|
) ||
|
||||||
|
(item['remarks'] ?? '-').toLowerCase().contains(query.toLowerCase());
|
||||||
}).toList();
|
}).toList();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -316,6 +325,7 @@ class EnquiryListState extends ConsumerState<EnquiryList> {
|
|||||||
headers: [
|
headers: [
|
||||||
"id",
|
"id",
|
||||||
"created_on",
|
"created_on",
|
||||||
|
"updated_on",
|
||||||
"reg_no",
|
"reg_no",
|
||||||
"insurer_name",
|
"insurer_name",
|
||||||
"status",
|
"status",
|
||||||
@ -402,7 +412,14 @@ class EnquiryListState extends ConsumerState<EnquiryList> {
|
|||||||
Expanded(
|
Expanded(
|
||||||
flex: 2,
|
flex: 2,
|
||||||
child: Text(
|
child: Text(
|
||||||
'Received Date & Time',
|
'Created Date',
|
||||||
|
style: _headerStyle,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
flex: 2,
|
||||||
|
child: Text(
|
||||||
|
'Updated Date',
|
||||||
style: _headerStyle,
|
style: _headerStyle,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -521,6 +538,13 @@ class EnquiryListState extends ConsumerState<EnquiryList> {
|
|||||||
style: _dataBold,
|
style: _dataBold,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
Expanded(
|
||||||
|
flex: 2,
|
||||||
|
child: Text(
|
||||||
|
_formatDate(item['updated_on']) ?? '-',
|
||||||
|
style: _dataBold,
|
||||||
|
),
|
||||||
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
flex: 1,
|
flex: 1,
|
||||||
child: Text(item['reg_no'] ?? '-', style: _dataBold),
|
child: Text(item['reg_no'] ?? '-', style: _dataBold),
|
||||||
|
|||||||
@ -43,16 +43,15 @@ class claimListState extends ConsumerState<claimList> {
|
|||||||
Future.microtask(() {
|
Future.microtask(() {
|
||||||
final id = ref.read(managerIdProvider);
|
final id = ref.read(managerIdProvider);
|
||||||
final roleId = ref.read(userRoleProvider);
|
final roleId = ref.read(userRoleProvider);
|
||||||
|
final userId = ref.read(userIdProvider);
|
||||||
|
print("G47 => r : $roleId | mId: $id | uId: $userId ");
|
||||||
|
if (userId != null) { getStaffList(userId, roleId); }
|
||||||
|
|
||||||
print("ENQroleId - $roleId");
|
|
||||||
if (id != null) {
|
|
||||||
getStaffList(id, roleId);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> getStaffList(int managerId, role) async {
|
Future<void> getStaffList(int managerId, role) async {
|
||||||
print('getClaimList called MagId - $managerId - $role');
|
print('G54 => Fns called => $managerId | $role');
|
||||||
setState(() {
|
setState(() {
|
||||||
isLoading = true;
|
isLoading = true;
|
||||||
});
|
});
|
||||||
@ -62,7 +61,7 @@ class claimListState extends ConsumerState<claimList> {
|
|||||||
|
|
||||||
if (response['status'] == 'success') {
|
if (response['status'] == 'success') {
|
||||||
final data = response['data'];
|
final data = response['data'];
|
||||||
print('clImlist - ${response['data']}');
|
print('F64 => clImlist => ${response['data']}');
|
||||||
setState(() {
|
setState(() {
|
||||||
if (data is List) {
|
if (data is List) {
|
||||||
// Already a list of maps
|
// Already a list of maps
|
||||||
@ -114,23 +113,23 @@ class claimListState extends ConsumerState<claimList> {
|
|||||||
filteredData = getStaffData.where((item) {
|
filteredData = getStaffData.where((item) {
|
||||||
// final isActiveStatus = item['is_active'] == "1" ? "active" : "inactive";
|
// final isActiveStatus = item['is_active'] == "1" ? "active" : "inactive";
|
||||||
|
|
||||||
return (item['reg_no'] ?? '').toLowerCase().contains(
|
return (item['reg_no'] ?? '-').toLowerCase().contains(
|
||||||
query.toLowerCase(),
|
query.toLowerCase(),
|
||||||
) ||
|
) ||
|
||||||
(item['insurer_name'] ?? '').toLowerCase().contains(
|
(item['insurer_name'] ?? '-').toLowerCase().contains(
|
||||||
query.toLowerCase(),
|
query.toLowerCase(),
|
||||||
) ||
|
) ||
|
||||||
(item['policy_no'] ?? '').toLowerCase().contains(
|
(item['policy_no'] ?? '-').toLowerCase().contains(
|
||||||
query.toLowerCase(),
|
query.toLowerCase(),
|
||||||
) ||
|
) ||
|
||||||
(item['claim_type_value'] ?? '').toLowerCase().contains(
|
(item['claim_type_value'] ?? '-').toLowerCase().contains(
|
||||||
query.toLowerCase(),
|
query.toLowerCase(),
|
||||||
) ||
|
) ||
|
||||||
(item['claim_number'] ?? '').toLowerCase().contains(
|
(item['claim_number'] ?? '-').toLowerCase().contains(
|
||||||
query.toLowerCase(),
|
query.toLowerCase(),
|
||||||
) ||
|
) ||
|
||||||
(_formatDate(
|
(_formatDate(
|
||||||
item['policy_end_date'],
|
item['policy_end_date'] ?? '-',
|
||||||
).toLowerCase()).contains(query.toLowerCase());
|
).toLowerCase()).contains(query.toLowerCase());
|
||||||
}).toList();
|
}).toList();
|
||||||
});
|
});
|
||||||
@ -248,7 +247,7 @@ class claimListState extends ConsumerState<claimList> {
|
|||||||
"policy_no",
|
"policy_no",
|
||||||
"policy_end_date",
|
"policy_end_date",
|
||||||
"claim_number",
|
"claim_number",
|
||||||
"claim_type",
|
"claim_type_value",
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
||||||
|
|||||||
@ -41,16 +41,15 @@ class endosementState extends ConsumerState<endosement> {
|
|||||||
Future.microtask(() {
|
Future.microtask(() {
|
||||||
final id = ref.read(managerIdProvider);
|
final id = ref.read(managerIdProvider);
|
||||||
final roleId = ref.read(userRoleProvider);
|
final roleId = ref.read(userRoleProvider);
|
||||||
|
final userId = ref.read(userIdProvider);
|
||||||
|
print("F46 => r : $roleId | mId: $id | uId: $userId ");
|
||||||
|
if (userId != null) { getStaffList(userId, roleId); }
|
||||||
|
|
||||||
print("ENQroleId - $roleId");
|
|
||||||
if (id != null) {
|
|
||||||
getStaffList(id, roleId);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> getStaffList(int managerId, role) async {
|
Future<void> getStaffList(int managerId, role) async {
|
||||||
print('getClaimList called MagId - $managerId - $role');
|
print('F53 => Fns called => $managerId | $role');
|
||||||
setState(() {
|
setState(() {
|
||||||
isLoading = true;
|
isLoading = true;
|
||||||
});
|
});
|
||||||
@ -60,7 +59,7 @@ class endosementState extends ConsumerState<endosement> {
|
|||||||
|
|
||||||
if (response['status'] == 'success') {
|
if (response['status'] == 'success') {
|
||||||
final data = response['data'];
|
final data = response['data'];
|
||||||
print('getStaffListData - ${response['data']}');
|
print('F62 => End rse mnt List => ${response['data']}');
|
||||||
setState(() {
|
setState(() {
|
||||||
if (data is List) {
|
if (data is List) {
|
||||||
// Already a list of maps
|
// Already a list of maps
|
||||||
@ -112,19 +111,19 @@ class endosementState extends ConsumerState<endosement> {
|
|||||||
filteredData = getStaffData.where((item) {
|
filteredData = getStaffData.where((item) {
|
||||||
// final isActiveStatus = item['is_active'] == "1" ? "active" : "inactive";
|
// final isActiveStatus = item['is_active'] == "1" ? "active" : "inactive";
|
||||||
|
|
||||||
return (item['reg_no'] ?? '').toLowerCase().contains(
|
return (item['reg_no'] ?? '-').toLowerCase().contains(
|
||||||
query.toLowerCase(),
|
query.toLowerCase(),
|
||||||
) ||
|
) ||
|
||||||
(item['insurer_name'] ?? '').toLowerCase().contains(
|
(item['insurer_name'] ?? '-').toLowerCase().contains(
|
||||||
query.toLowerCase(),
|
query.toLowerCase(),
|
||||||
) ||
|
) ||
|
||||||
(item['policy_number'] ?? '').toLowerCase().contains(
|
(item['policy_number'] ?? '-').toLowerCase().contains(
|
||||||
query.toLowerCase(),
|
query.toLowerCase(),
|
||||||
) ||
|
) ||
|
||||||
(item['endorsement_type'] ?? '').toLowerCase().contains(
|
(item['endorsement_type_value'] ?? '-').toLowerCase().contains(
|
||||||
query.toLowerCase(),
|
query.toLowerCase(),
|
||||||
) ||
|
) ||
|
||||||
(item['endorsement_no'] ?? '').toLowerCase().contains(
|
(item['endorsement_no'] ?? '-').toLowerCase().contains(
|
||||||
query.toLowerCase(),
|
query.toLowerCase(),
|
||||||
);
|
);
|
||||||
}).toList();
|
}).toList();
|
||||||
@ -243,7 +242,7 @@ class endosementState extends ConsumerState<endosement> {
|
|||||||
"reg_no",
|
"reg_no",
|
||||||
"insurer_name",
|
"insurer_name",
|
||||||
"policy_number",
|
"policy_number",
|
||||||
"endorsement_type",
|
"endorsement_type_value",
|
||||||
"endorsement_no",
|
"endorsement_no",
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@ -172,10 +172,10 @@ class ClaimsSubListState extends ConsumerState<ClaimsSubList> {
|
|||||||
child: Text('Status', style: _headerStyle),
|
child: Text('Status', style: _headerStyle),
|
||||||
),
|
),
|
||||||
|
|
||||||
Expanded(
|
// Expanded(
|
||||||
flex: 1,
|
// flex: 1,
|
||||||
child: Text('Action', style: _headerStyle),
|
// child: Text('Action', style: _headerStyle),
|
||||||
),
|
// ),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -285,38 +285,38 @@ class ClaimsSubListState extends ConsumerState<ClaimsSubList> {
|
|||||||
child: Text(item['claim_status_value'] ?? '-', style: _dataBold),
|
child: Text(item['claim_status_value'] ?? '-', style: _dataBold),
|
||||||
),
|
),
|
||||||
|
|
||||||
Expanded(
|
// Expanded(
|
||||||
flex: 1,
|
// flex: 1,
|
||||||
child: Row(
|
// child: Row(
|
||||||
children: [
|
// children: [
|
||||||
PopupMenuButton<int>(
|
// PopupMenuButton<int>(
|
||||||
color: Colors.white,
|
// color: Colors.white,
|
||||||
padding: EdgeInsets.zero,
|
// padding: EdgeInsets.zero,
|
||||||
offset: Offset(0, 30),
|
// offset: Offset(0, 30),
|
||||||
icon: Icon(
|
// icon: Icon(
|
||||||
Icons.more_vert,
|
// Icons.more_vert,
|
||||||
color: Color(0xFF475569),
|
// color: Color(0xFF475569),
|
||||||
size: 14,
|
// size: 14,
|
||||||
),
|
// ),
|
||||||
itemBuilder: (context) => [
|
// itemBuilder: (context) => [
|
||||||
CustomPopupMenuEntry(
|
// CustomPopupMenuEntry(
|
||||||
child: Container(
|
// child: Container(
|
||||||
padding: EdgeInsets.symmetric(
|
// padding: EdgeInsets.symmetric(
|
||||||
horizontal: 8,
|
// horizontal: 8,
|
||||||
vertical: 8,
|
// vertical: 8,
|
||||||
),
|
// ),
|
||||||
child: Column(
|
// child: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
// mainAxisSize: MainAxisSize.min,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
// mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: _buildPopupMenuActions(context, item),
|
// children: _buildPopupMenuActions(context, item),
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
],
|
// ],
|
||||||
),
|
// ),
|
||||||
],
|
// ],
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@ -134,7 +134,7 @@ class UploadIncentiveModalState extends ConsumerState<UploadIncentiveModal> {
|
|||||||
print("FilterDAta - $query");
|
print("FilterDAta - $query");
|
||||||
setState(() {
|
setState(() {
|
||||||
filteredIncentiveData = getAgentIncentiveFileData.where((item) {
|
filteredIncentiveData = getAgentIncentiveFileData.where((item) {
|
||||||
return (item['incentive_month'] ?? '').toLowerCase().contains(
|
return (item['incentive_month'] ?? '-').toLowerCase().contains(
|
||||||
query.toLowerCase(),
|
query.toLowerCase(),
|
||||||
);
|
);
|
||||||
}).toList();
|
}).toList();
|
||||||
@ -664,7 +664,7 @@ class UploadIncentiveModalState extends ConsumerState<UploadIncentiveModal> {
|
|||||||
final selectedId = file['id'];
|
final selectedId = file['id'];
|
||||||
final path =
|
final path =
|
||||||
'api/agent/downloadAgentIncentiveFile?id=$selectedId';
|
'api/agent/downloadAgentIncentiveFile?id=$selectedId';
|
||||||
apiService.getPdfDownload(path, selectedId);
|
apiService.getPdfDownload(context,path, selectedId);
|
||||||
},
|
},
|
||||||
onDelete: () async {
|
onDelete: () async {
|
||||||
print("Delete ${file['id']}");
|
print("Delete ${file['id']}");
|
||||||
|
|||||||
@ -83,11 +83,11 @@ class AgentListState extends ConsumerState<AgentList> {
|
|||||||
setState(() {
|
setState(() {
|
||||||
filteredData = getAgentData.where((item) {
|
filteredData = getAgentData.where((item) {
|
||||||
final isActiveStatus = item['is_active'] == "1" ? "active" : "inactive";
|
final isActiveStatus = item['is_active'] == "1" ? "active" : "inactive";
|
||||||
return item['name'].toLowerCase().contains(query.toLowerCase()) ||
|
return (item['name'] ?? '-').toLowerCase().contains(query.toLowerCase()) ||
|
||||||
item['email'].toLowerCase().contains(query.toLowerCase()) ||
|
(item['email'] ?? '-').toLowerCase().contains(query.toLowerCase()) ||
|
||||||
item['mobile'].toLowerCase().contains(query.toLowerCase()) ||
|
(item['mobile'] ?? '-').toLowerCase().contains(query.toLowerCase()) ||
|
||||||
item['address'].toLowerCase().contains(query.toLowerCase()) ||
|
(item['address'] ?? '-').toLowerCase().contains(query.toLowerCase()) ||
|
||||||
item['agent_code'].toLowerCase().contains(query.toLowerCase()) ||
|
(item['agent_code'] ?? '-').toLowerCase().contains(query.toLowerCase()) ||
|
||||||
(isActiveStatus.contains(query.toLowerCase()));
|
(isActiveStatus.contains(query.toLowerCase()));
|
||||||
}).toList();
|
}).toList();
|
||||||
});
|
});
|
||||||
|
|||||||
@ -292,7 +292,7 @@ class ProfileState extends ConsumerState<Profile> {
|
|||||||
path =
|
path =
|
||||||
'api/agent/downloadAgentIncentiveFile?id=$latestId';
|
'api/agent/downloadAgentIncentiveFile?id=$latestId';
|
||||||
}
|
}
|
||||||
apiService.getPdfDownload(
|
apiService.getPdfDownload(context,
|
||||||
path,
|
path,
|
||||||
latestId,
|
latestId,
|
||||||
);
|
);
|
||||||
@ -386,7 +386,7 @@ class ProfileState extends ConsumerState<Profile> {
|
|||||||
path =
|
path =
|
||||||
'api/agent/downloadAgentIncentiveFile?id=$selectedId';
|
'api/agent/downloadAgentIncentiveFile?id=$selectedId';
|
||||||
}
|
}
|
||||||
apiService.getPdfDownload(
|
apiService.getPdfDownload(context,
|
||||||
path,
|
path,
|
||||||
selectedId,
|
selectedId,
|
||||||
);
|
);
|
||||||
@ -549,7 +549,7 @@ class ProfileState extends ConsumerState<Profile> {
|
|||||||
path =
|
path =
|
||||||
'api/agent/downloadAgentIncentiveFile?id=$latestId';
|
'api/agent/downloadAgentIncentiveFile?id=$latestId';
|
||||||
}
|
}
|
||||||
apiService.getPdfDownload(
|
apiService.getPdfDownload(context,
|
||||||
path,
|
path,
|
||||||
latestId,
|
latestId,
|
||||||
);
|
);
|
||||||
@ -643,7 +643,7 @@ class ProfileState extends ConsumerState<Profile> {
|
|||||||
path =
|
path =
|
||||||
'api/agent/downloadAgentIncentiveFile?id=$selectedId';
|
'api/agent/downloadAgentIncentiveFile?id=$selectedId';
|
||||||
}
|
}
|
||||||
apiService.getPdfDownload(
|
apiService.getPdfDownload(context,
|
||||||
path,
|
path,
|
||||||
selectedId,
|
selectedId,
|
||||||
);
|
);
|
||||||
|
|||||||
@ -285,7 +285,7 @@ class ProfilePopUpState extends ConsumerState<ProfilePopUp> {
|
|||||||
path =
|
path =
|
||||||
'api/agent/downloadAgentIncentiveFile?id=$latestId';
|
'api/agent/downloadAgentIncentiveFile?id=$latestId';
|
||||||
}
|
}
|
||||||
apiService.getPdfDownload(path, latestId);
|
apiService.getPdfDownload(context,path, latestId);
|
||||||
},
|
},
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
@ -368,7 +368,7 @@ class ProfilePopUpState extends ConsumerState<ProfilePopUp> {
|
|||||||
path =
|
path =
|
||||||
'api/agent/downloadAgentIncentiveFile?id=$selectedId';
|
'api/agent/downloadAgentIncentiveFile?id=$selectedId';
|
||||||
}
|
}
|
||||||
apiService.getPdfDownload(
|
apiService.getPdfDownload(context,
|
||||||
path,
|
path,
|
||||||
selectedId,
|
selectedId,
|
||||||
);
|
);
|
||||||
|
|||||||
@ -40,6 +40,7 @@ class StaffListState extends ConsumerState<StaffList> {
|
|||||||
|
|
||||||
Future.microtask(() {
|
Future.microtask(() {
|
||||||
final id = ref.read(managerIdProvider);
|
final id = ref.read(managerIdProvider);
|
||||||
|
print("E43 => mId: $id");
|
||||||
if (id != null) {
|
if (id != null) {
|
||||||
getStaffList(id);
|
getStaffList(id);
|
||||||
}
|
}
|
||||||
@ -79,17 +80,17 @@ class StaffListState extends ConsumerState<StaffList> {
|
|||||||
filteredData = getStaffData.where((item) {
|
filteredData = getStaffData.where((item) {
|
||||||
final isActiveStatus = item['is_active'] == "1" ? "active" : "inactive";
|
final isActiveStatus = item['is_active'] == "1" ? "active" : "inactive";
|
||||||
|
|
||||||
return (item['name'] ?? '').toLowerCase().contains(
|
return (item['name'] ?? '-').toLowerCase().contains(
|
||||||
query.toLowerCase(),
|
query.toLowerCase(),
|
||||||
) ||
|
) ||
|
||||||
(item['email'] ?? '').toLowerCase().contains(query.toLowerCase()) ||
|
(item['email'] ?? '-').toLowerCase().contains(query.toLowerCase()) ||
|
||||||
(item['mobile'] ?? '').toLowerCase().contains(
|
(item['mobile'] ?? '-').toLowerCase().contains(
|
||||||
query.toLowerCase(),
|
query.toLowerCase(),
|
||||||
) ||
|
) ||
|
||||||
(item['address'] ?? '').toLowerCase().contains(
|
(item['address'] ?? '-').toLowerCase().contains(
|
||||||
query.toLowerCase(),
|
query.toLowerCase(),
|
||||||
) ||
|
) ||
|
||||||
(item['emp_id'] ?? item['agent_code'] ?? '').toLowerCase().contains(
|
(item['emp_id'] ?? item['agent_code'] ?? '-').toLowerCase().contains(
|
||||||
query.toLowerCase(),
|
query.toLowerCase(),
|
||||||
) ||
|
) ||
|
||||||
isActiveStatus.contains(query.toLowerCase());
|
isActiveStatus.contains(query.toLowerCase());
|
||||||
@ -100,7 +101,7 @@ class StaffListState extends ConsumerState<StaffList> {
|
|||||||
final TextEditingController _searchStaffController = TextEditingController();
|
final TextEditingController _searchStaffController = TextEditingController();
|
||||||
|
|
||||||
Future<void> getStaffList(int managerId) async {
|
Future<void> getStaffList(int managerId) async {
|
||||||
print('getClaimList called MagId - $managerId');
|
print('E104 => Fns called => $managerId');
|
||||||
setState(() {
|
setState(() {
|
||||||
isLoading = true;
|
isLoading = true;
|
||||||
});
|
});
|
||||||
@ -109,7 +110,7 @@ class StaffListState extends ConsumerState<StaffList> {
|
|||||||
final response = await apiService.fetchStaffUserList(managerId);
|
final response = await apiService.fetchStaffUserList(managerId);
|
||||||
|
|
||||||
if (response['status'] == 'success') {
|
if (response['status'] == 'success') {
|
||||||
print('getStaffListData - ${response['data']}');
|
print('E113 => getStaffListData => ${response['data']}');
|
||||||
setState(() {
|
setState(() {
|
||||||
getStaffData = List<Map<String, dynamic>>.from(response['data']);
|
getStaffData = List<Map<String, dynamic>>.from(response['data']);
|
||||||
originalData = getStaffData;
|
originalData = getStaffData;
|
||||||
|
|||||||
@ -78,7 +78,7 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
|
|||||||
final id = ref.read(userIdProvider);
|
final id = ref.read(userIdProvider);
|
||||||
final roleId = ref.read(userRoleProvider);
|
final roleId = ref.read(userRoleProvider);
|
||||||
|
|
||||||
print("ENQroleId - $roleId");
|
print("B81 => roleId: $roleId | userId: $id ");
|
||||||
if (id != null) {
|
if (id != null) {
|
||||||
getStaffList(id, roleId);
|
getStaffList(id, roleId);
|
||||||
}
|
}
|
||||||
@ -86,7 +86,7 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<void> getStaffList(int managerId, role) async {
|
Future<void> getStaffList(int managerId, role) async {
|
||||||
print('getClaimList called MagId - $managerId - $role');
|
print('B89 => Fns called => $managerId | $role');
|
||||||
setState(() {
|
setState(() {
|
||||||
isLoading = true;
|
isLoading = true;
|
||||||
});
|
});
|
||||||
@ -96,7 +96,7 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
|
|||||||
|
|
||||||
if (response['status'] == 'success') {
|
if (response['status'] == 'success') {
|
||||||
final data = response['data'];
|
final data = response['data'];
|
||||||
print('go to 81 - getStaffListData - ${response['data']}');
|
print('B99 => getStaffListData => ${response['data']}');
|
||||||
setState(() {
|
setState(() {
|
||||||
policiesIssuedToday = data['policies_issued']['today'].toString();
|
policiesIssuedToday = data['policies_issued']['today'].toString();
|
||||||
policiesIssuedYear = data['policies_issued']['year'].toString();
|
policiesIssuedYear = data['policies_issued']['year'].toString();
|
||||||
|
|||||||
@ -67,25 +67,26 @@ class EnquiryStaffState extends ConsumerState<EnquiryStaff> {
|
|||||||
Future.microtask(() {
|
Future.microtask(() {
|
||||||
final id = ref.read(managerIdProvider);
|
final id = ref.read(managerIdProvider);
|
||||||
roleId = ref.read(userRoleProvider);
|
roleId = ref.read(userRoleProvider);
|
||||||
|
final userId = ref.read(userIdProvider);
|
||||||
|
|
||||||
print("ENQroleId - $roleId");
|
print("C72 => r : $roleId | mId: $id | uId: $userId ");
|
||||||
if (id != null) {
|
if (userId != null) { getStaffList(userId, roleId); }
|
||||||
getStaffList(id, roleId);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void refresh() {
|
void refresh() {
|
||||||
final id = ref.read(managerIdProvider);
|
final id = ref.read(managerIdProvider);
|
||||||
final roleId = ref.read(userRoleProvider);
|
final roleId = ref.read(userRoleProvider);
|
||||||
|
final userId = ref.read(userIdProvider);
|
||||||
|
|
||||||
|
print("C82 => r : $roleId | mId: $id | uId: $userId ");
|
||||||
|
if (userId != null) { getStaffList(userId, roleId); }
|
||||||
|
|
||||||
if (id != null) {
|
|
||||||
getStaffList(id, roleId);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> getStaffList(int managerId, role) async {
|
Future<void> getStaffList(int managerId, role) async {
|
||||||
print('getClaimList called MagId - $managerId - $role');
|
|
||||||
|
print('C89 => Fns called => $managerId | $role');
|
||||||
setState(() {
|
setState(() {
|
||||||
isLoading = true;
|
isLoading = true;
|
||||||
});
|
});
|
||||||
@ -95,7 +96,7 @@ class EnquiryStaffState extends ConsumerState<EnquiryStaff> {
|
|||||||
|
|
||||||
if (response['status'] == 'success') {
|
if (response['status'] == 'success') {
|
||||||
final data = response['data'];
|
final data = response['data'];
|
||||||
print('getStaffListData - ${response['data']}');
|
print('C99 => getStaffListData => ${response['data']}');
|
||||||
setState(() {
|
setState(() {
|
||||||
if (data is List) {
|
if (data is List) {
|
||||||
// Already a list of maps
|
// Already a list of maps
|
||||||
@ -159,34 +160,37 @@ class EnquiryStaffState extends ConsumerState<EnquiryStaff> {
|
|||||||
filteredData = getStaffData.where((item) {
|
filteredData = getStaffData.where((item) {
|
||||||
// final isActiveStatus = item['is_active'] == "1" ? "active" : "inactive";
|
// final isActiveStatus = item['is_active'] == "1" ? "active" : "inactive";
|
||||||
|
|
||||||
return (item['agent_name'] ?? '').toLowerCase().contains(
|
return (item['agent_name'] ?? '-').toLowerCase().contains(
|
||||||
query.toLowerCase(),
|
query.toLowerCase(),
|
||||||
) ||
|
) ||
|
||||||
(item['reg_no'] ?? '').toLowerCase().contains(
|
(item['reg_no'] ?? '-').toLowerCase().contains(
|
||||||
query.toLowerCase(),
|
query.toLowerCase(),
|
||||||
) ||
|
) ||
|
||||||
(item['insurer_name'] ?? '').toLowerCase().contains(
|
(item['insurer_name'] ?? '-').toLowerCase().contains(
|
||||||
query.toLowerCase(),
|
query.toLowerCase(),
|
||||||
) ||
|
) ||
|
||||||
(item['assigned_to_name'] ?? '').toLowerCase().contains(
|
(item['assigned_to_name'] ?? '-').toLowerCase().contains(
|
||||||
query.toLowerCase(),
|
query.toLowerCase(),
|
||||||
) ||
|
) ||
|
||||||
(item['insured_name'] ?? '').toLowerCase().contains(
|
(item['insured_name'] ?? '-').toLowerCase().contains(
|
||||||
query.toLowerCase(),
|
query.toLowerCase(),
|
||||||
) ||
|
) ||
|
||||||
(item['premium_amount'] ?? '').toLowerCase().contains(
|
(item['premium_amount'] ?? '-').toLowerCase().contains(
|
||||||
query.toLowerCase(),
|
query.toLowerCase(),
|
||||||
) ||
|
) ||
|
||||||
(item['payment_mode'] ?? '').toLowerCase().contains(
|
(item['payment_mode'] ?? '-').toLowerCase().contains(
|
||||||
query.toLowerCase(),
|
query.toLowerCase(),
|
||||||
) ||
|
) ||
|
||||||
(_formatDate(item['updated_on']) ?? '').toLowerCase().contains(
|
(_formatDate(item['created_on']) ?? '-').toLowerCase().contains(
|
||||||
query.toLowerCase(),
|
query.toLowerCase(),
|
||||||
) ||
|
) ||
|
||||||
(item['policy_number'] ?? '').toLowerCase().contains(
|
(_formatDate(item['updated_on']) ?? '-').toLowerCase().contains(
|
||||||
query.toLowerCase(),
|
query.toLowerCase(),
|
||||||
) ||
|
) ||
|
||||||
(item['status'] ?? '').toLowerCase().contains(query.toLowerCase());
|
(item['policy_number'] ?? '-').toLowerCase().contains(
|
||||||
|
query.toLowerCase(),
|
||||||
|
) ||
|
||||||
|
(item['status'] ?? '-').toLowerCase().contains(query.toLowerCase());
|
||||||
}).toList();
|
}).toList();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -211,7 +215,7 @@ class EnquiryStaffState extends ConsumerState<EnquiryStaff> {
|
|||||||
regNum,
|
regNum,
|
||||||
) {
|
) {
|
||||||
return [
|
return [
|
||||||
if (roleId == 'manager') ...[
|
if (roleId == 'manager' && data['status'] != 'Quotation Created') ...[
|
||||||
Material(
|
Material(
|
||||||
color: Colors.transparent,
|
color: Colors.transparent,
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
@ -424,6 +428,7 @@ class EnquiryStaffState extends ConsumerState<EnquiryStaff> {
|
|||||||
? true
|
? true
|
||||||
: false,
|
: false,
|
||||||
headers: [
|
headers: [
|
||||||
|
"created_on",
|
||||||
"updated_on",
|
"updated_on",
|
||||||
"reg_no",
|
"reg_no",
|
||||||
"agent_name",
|
"agent_name",
|
||||||
@ -493,9 +498,12 @@ class EnquiryStaffState extends ConsumerState<EnquiryStaff> {
|
|||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
flex: 3,
|
flex: 3,
|
||||||
child: Text('Date', style: _headerStyle),
|
child: Text('Created Date', style: _headerStyle),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
flex: 3,
|
||||||
|
child: Text('Updated Date', style: _headerStyle),
|
||||||
),
|
),
|
||||||
|
|
||||||
Expanded(
|
Expanded(
|
||||||
flex: 2,
|
flex: 2,
|
||||||
child: Text('Reg.No', style: _headerStyle),
|
child: Text('Reg.No', style: _headerStyle),
|
||||||
@ -630,6 +638,15 @@ class EnquiryStaffState extends ConsumerState<EnquiryStaff> {
|
|||||||
),
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
|
Expanded(
|
||||||
|
flex: 3,
|
||||||
|
child: Text(
|
||||||
|
_formatDate(item['created_on']) ?? '-',
|
||||||
|
style: _dataBold,
|
||||||
|
softWrap: true,
|
||||||
|
maxLines: 3,
|
||||||
|
),
|
||||||
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
flex: 3,
|
flex: 3,
|
||||||
child: Text(
|
child: Text(
|
||||||
@ -639,7 +656,6 @@ class EnquiryStaffState extends ConsumerState<EnquiryStaff> {
|
|||||||
maxLines: 3,
|
maxLines: 3,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
Expanded(
|
Expanded(
|
||||||
flex: 2,
|
flex: 2,
|
||||||
child: Text(item['reg_no'] ?? '-', style: _dataBold),
|
child: Text(item['reg_no'] ?? '-', style: _dataBold),
|
||||||
|
|||||||
@ -757,7 +757,7 @@ class PolicyScreenState extends ConsumerState<PolicyScreen> {
|
|||||||
// 'api/agent/downloadAgentIncentiveFile?id=$selectedId';
|
// 'api/agent/downloadAgentIncentiveFile?id=$selectedId';
|
||||||
final path =
|
final path =
|
||||||
'api/enquiry/downloadEnquiryFile?enquiry_id=$selectedId&file_type=rc';
|
'api/enquiry/downloadEnquiryFile?enquiry_id=$selectedId&file_type=rc';
|
||||||
apiService.getPdfDownload(path, selectedId);
|
apiService.getPdfDownload(context,path, selectedId);
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: const EdgeInsets.all(8),
|
padding: const EdgeInsets.all(8),
|
||||||
@ -798,7 +798,7 @@ class PolicyScreenState extends ConsumerState<PolicyScreen> {
|
|||||||
// 'api/agent/downloadAgentIncentiveFile?id=$selectedId';
|
// 'api/agent/downloadAgentIncentiveFile?id=$selectedId';
|
||||||
final path =
|
final path =
|
||||||
'api/enquiry/downloadEnquiryFile?enquiry_id=$selectedId&file_type=id_proof';
|
'api/enquiry/downloadEnquiryFile?enquiry_id=$selectedId&file_type=id_proof';
|
||||||
apiService.getPdfDownload(path, selectedId);
|
apiService.getPdfDownload(context,path, selectedId);
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: const EdgeInsets.all(8),
|
padding: const EdgeInsets.all(8),
|
||||||
@ -835,7 +835,7 @@ class PolicyScreenState extends ConsumerState<PolicyScreen> {
|
|||||||
// 'api/agent/downloadAgentIncentiveFile?id=$selectedId';
|
// 'api/agent/downloadAgentIncentiveFile?id=$selectedId';
|
||||||
final path =
|
final path =
|
||||||
'api/enquiry/downloadEnquiryFile?enquiry_id=$selectedId&file_type=previous_policy';
|
'api/enquiry/downloadEnquiryFile?enquiry_id=$selectedId&file_type=previous_policy';
|
||||||
apiService.getPdfDownload(path, selectedId);
|
apiService.getPdfDownload(context,path, selectedId);
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: const EdgeInsets.all(8),
|
padding: const EdgeInsets.all(8),
|
||||||
@ -875,7 +875,7 @@ class PolicyScreenState extends ConsumerState<PolicyScreen> {
|
|||||||
final path =
|
final path =
|
||||||
'api/quotation/downloadAdditionalUploadedFile?id=$acceptedQuotationId';
|
'api/quotation/downloadAdditionalUploadedFile?id=$acceptedQuotationId';
|
||||||
|
|
||||||
apiService.getPdfDownload(path, selectedId);
|
apiService.getPdfDownload(context,path, selectedId);
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: const EdgeInsets.all(8),
|
padding: const EdgeInsets.all(8),
|
||||||
|
|||||||
@ -44,10 +44,11 @@ class policylistState extends ConsumerState<policylist> {
|
|||||||
Future.microtask(() {
|
Future.microtask(() {
|
||||||
final id = ref.read(managerIdProvider);
|
final id = ref.read(managerIdProvider);
|
||||||
roleId = ref.read(userRoleProvider);
|
roleId = ref.read(userRoleProvider);
|
||||||
|
final userId = ref.read(userIdProvider);
|
||||||
|
|
||||||
print("ENQroleId - $roleId");
|
print("D49 => r : $roleId | mId: $id | uId: $userId ");
|
||||||
if (id != null) {
|
if (userId != null) {
|
||||||
getStaffList(id, roleId);
|
getStaffList(userId, roleId);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -55,14 +56,16 @@ class policylistState extends ConsumerState<policylist> {
|
|||||||
void refresh() {
|
void refresh() {
|
||||||
final id = ref.read(managerIdProvider);
|
final id = ref.read(managerIdProvider);
|
||||||
final roleId = ref.read(userRoleProvider);
|
final roleId = ref.read(userRoleProvider);
|
||||||
|
final userId = ref.read(userIdProvider);
|
||||||
|
|
||||||
if (id != null) {
|
print("D61 => r : $roleId | mId: $id | uId: $userId");
|
||||||
getStaffList(id, roleId);
|
if (userId != null) {
|
||||||
|
getStaffList(userId, roleId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> getStaffList(int managerId, role) async {
|
Future<void> getStaffList(int managerId, role) async {
|
||||||
print('getClaimList called MagId - $managerId - $role');
|
print('D68 => Fns called => $managerId | $role');
|
||||||
setState(() {
|
setState(() {
|
||||||
isLoading = true;
|
isLoading = true;
|
||||||
});
|
});
|
||||||
@ -75,7 +78,7 @@ class policylistState extends ConsumerState<policylist> {
|
|||||||
|
|
||||||
if (response['status'] == 'success') {
|
if (response['status'] == 'success') {
|
||||||
final data = response['data'];
|
final data = response['data'];
|
||||||
print('getStaffListData - ${response['data']}');
|
print('D81 => getStaffListData => ${response['data']}');
|
||||||
setState(() {
|
setState(() {
|
||||||
if (data is List) {
|
if (data is List) {
|
||||||
// Already a list of maps
|
// Already a list of maps
|
||||||
@ -127,34 +130,34 @@ class policylistState extends ConsumerState<policylist> {
|
|||||||
filteredData = getStaffData.where((item) {
|
filteredData = getStaffData.where((item) {
|
||||||
// final isActiveStatus = item['is_active'] == "1" ? "active" : "inactive";
|
// final isActiveStatus = item['is_active'] == "1" ? "active" : "inactive";
|
||||||
|
|
||||||
return (item['agent_name'] ?? '').toLowerCase().contains(
|
return (item['agent_name'] ?? '-').toLowerCase().contains(
|
||||||
query.toLowerCase(),
|
query.toLowerCase(),
|
||||||
) ||
|
) ||
|
||||||
(item['reg_no'] ?? '').toLowerCase().contains(
|
(item['reg_no'] ?? '-').toLowerCase().contains(
|
||||||
query.toLowerCase(),
|
query.toLowerCase(),
|
||||||
) ||
|
) ||
|
||||||
(item['insurer_name'] ?? '').toLowerCase().contains(
|
(item['insurer_name'] ?? '-').toLowerCase().contains(
|
||||||
query.toLowerCase(),
|
query.toLowerCase(),
|
||||||
) ||
|
) ||
|
||||||
(item['assigned_to_name'] ?? '').toLowerCase().contains(
|
(item['assigned_to_name'] ?? '-').toLowerCase().contains(
|
||||||
query.toLowerCase(),
|
query.toLowerCase(),
|
||||||
) ||
|
) ||
|
||||||
(item['insured_name'] ?? '').toLowerCase().contains(
|
(item['insured_name'] ?? '-').toLowerCase().contains(
|
||||||
query.toLowerCase(),
|
query.toLowerCase(),
|
||||||
) ||
|
) ||
|
||||||
(item['premium_amount'] ?? '').toLowerCase().contains(
|
(item['premium_amount'] ?? '-').toLowerCase().contains(
|
||||||
query.toLowerCase(),
|
query.toLowerCase(),
|
||||||
) ||
|
) ||
|
||||||
(item['payment_mode'] ?? '').toLowerCase().contains(
|
(item['payment_mode'] ?? '-').toLowerCase().contains(
|
||||||
query.toLowerCase(),
|
query.toLowerCase(),
|
||||||
) ||
|
) ||
|
||||||
(_formatDate(item['updated_on']) ?? '').toLowerCase().contains(
|
(_formatDate(item['updated_on']) ?? '-').toLowerCase().contains(
|
||||||
query.toLowerCase(),
|
query.toLowerCase(),
|
||||||
) ||
|
) ||
|
||||||
(item['policy_number'] ?? '').toLowerCase().contains(
|
(item['policy_number'] ?? '-').toLowerCase().contains(
|
||||||
query.toLowerCase(),
|
query.toLowerCase(),
|
||||||
) ||
|
) ||
|
||||||
(item['status'] ?? '').toLowerCase().contains(query.toLowerCase());
|
(item['status'] ?? '-').toLowerCase().contains(query.toLowerCase());
|
||||||
;
|
;
|
||||||
}).toList();
|
}).toList();
|
||||||
});
|
});
|
||||||
@ -374,6 +377,7 @@ class policylistState extends ConsumerState<policylist> {
|
|||||||
"premium_amount",
|
"premium_amount",
|
||||||
"payment_mode",
|
"payment_mode",
|
||||||
"updated_on",
|
"updated_on",
|
||||||
|
"policy_number",
|
||||||
"status",
|
"status",
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@ -522,7 +522,7 @@ class QuotationScreenState extends ConsumerState<QuotationScreen> {
|
|||||||
// 'api/agent/downloadAgentIncentiveFile?id=$selectedId';
|
// 'api/agent/downloadAgentIncentiveFile?id=$selectedId';
|
||||||
final path =
|
final path =
|
||||||
'api/enquiry/downloadEnquiryFile?enquiry_id=$selectedId&file_type=rc';
|
'api/enquiry/downloadEnquiryFile?enquiry_id=$selectedId&file_type=rc';
|
||||||
apiService.getPdfDownload(path, selectedId);
|
apiService.getPdfDownload(context,path, selectedId);
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: const EdgeInsets.all(8),
|
padding: const EdgeInsets.all(8),
|
||||||
@ -563,7 +563,7 @@ class QuotationScreenState extends ConsumerState<QuotationScreen> {
|
|||||||
// 'api/agent/downloadAgentIncentiveFile?id=$selectedId';
|
// 'api/agent/downloadAgentIncentiveFile?id=$selectedId';
|
||||||
final path =
|
final path =
|
||||||
'api/enquiry/downloadEnquiryFile?enquiry_id=$selectedId&file_type=id_proof';
|
'api/enquiry/downloadEnquiryFile?enquiry_id=$selectedId&file_type=id_proof';
|
||||||
apiService.getPdfDownload(path, selectedId);
|
apiService.getPdfDownload(context,path, selectedId);
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: const EdgeInsets.all(8),
|
padding: const EdgeInsets.all(8),
|
||||||
@ -594,13 +594,13 @@ class QuotationScreenState extends ConsumerState<QuotationScreen> {
|
|||||||
Widget buildDocPrevPolicy(BuildContext context, bool isMobile) {
|
Widget buildDocPrevPolicy(BuildContext context, bool isMobile) {
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
print("Upload $selectedEnquiryId");
|
print("QD597 Upload $selectedEnquiryId");
|
||||||
final selectedId = selectedEnquiryId;
|
final selectedId = selectedEnquiryId;
|
||||||
// final path =
|
// final path =
|
||||||
// 'api/agent/downloadAgentIncentiveFile?id=$selectedId';
|
// 'api/agent/downloadAgentIncentiveFile?id=$selectedId';
|
||||||
final path =
|
final path =
|
||||||
'api/enquiry/downloadEnquiryFile?enquiry_id=$selectedId&file_type=previous_policy';
|
'api/enquiry/downloadEnquiryFile?enquiry_id=$selectedId&file_type=previous_policy';
|
||||||
apiService.getPdfDownload(path, selectedId);
|
apiService.getPdfDownload(context,path, selectedId);
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: const EdgeInsets.all(8),
|
padding: const EdgeInsets.all(8),
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user