FIX_Reopen Issues
This commit is contained in:
parent
7908c2278f
commit
c6128dc9a9
File diff suppressed because one or more lines are too long
@ -809,9 +809,12 @@ class ApiService {
|
||||
}
|
||||
final url = Uri.parse(
|
||||
'${Env.apiUrl}dashboard/partnerDashboard?manager_id=$id',
|
||||
// 'http://localhost/nhance_partner_be/dashboard/partnerDashboard?manager_id=$id',
|
||||
);
|
||||
|
||||
// final url = Uri.parse(
|
||||
// // 'http://localhost/nhance_partner_be/dashboard/partnerDashboard?manager_id=$id',
|
||||
// );
|
||||
|
||||
final headers = {
|
||||
'Authorization': 'Bearer $_token' ?? '',
|
||||
'app-signature': Env.App_Signature,
|
||||
@ -1119,6 +1122,10 @@ class ApiService {
|
||||
'${Env.apiUrl}enquiry/enquiryList?$query&from_date=${fromDate ?? ''}&to_date=${toDate ?? ''}&enquiry_status=$selectedStatus',
|
||||
// '${Env.apiUrl}enquiry/enquiryList?$query&from_date=${fromDate ?? ''}&to_date=${toDate ?? ''}&status=$selectedStatus',
|
||||
);
|
||||
} else if (role == 'agent') {
|
||||
url = Uri.parse(
|
||||
'${Env.apiUrl}enquiry/enquiryList?$query&from_date=${fromDate ?? ''}&to_date=${toDate ?? ''}&status=$selectedStatus',
|
||||
);
|
||||
} else {
|
||||
url = Uri.parse(
|
||||
'${Env.apiUrl}enquiry/enquiryList?$query&from_date=${fromDate ?? ''}&to_date=${toDate ?? ''}&enquiry_status=$selectedStatus&staff_id=$selectedStaffId',
|
||||
@ -2013,11 +2020,13 @@ class ApiService {
|
||||
}
|
||||
|
||||
|
||||
Future<void> generateEndorsementExcel(managerId) async {
|
||||
Future<void> generateEndorsementExcel(managerId,searchValue) async {
|
||||
final url = Uri.parse(
|
||||
'${Env.apiUrl}reports/endorsement-excel?manager_id=$managerId',
|
||||
);
|
||||
|
||||
// final url = Uri.parse( 'http://localhost/nhance_partner_be/reports/endorsement-excel?manager_id=$managerId&search=${searchValue ?? ''}', );
|
||||
|
||||
print('getPdfDownload endorsement-excel - $url');
|
||||
await _initializeToken();
|
||||
|
||||
|
||||
@ -732,7 +732,7 @@ class _UpdateEndorsementDialogState extends State<UpdateEndorsementDialog> {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text("End. Premium *", style: _textStyle),
|
||||
Text("End Premium *", style: _textStyle),
|
||||
SizedBox(height: 10),
|
||||
ThemedFormField(
|
||||
backgroundColor: Color(0xFFEDF6F5),
|
||||
|
||||
@ -51,6 +51,7 @@ class EnquiryListState extends ConsumerState<EnquiryList> {
|
||||
super.initState();
|
||||
|
||||
apiService = ApiService();
|
||||
|
||||
for (String field in tabHeader) {
|
||||
controllers[field] = TextEditingController();
|
||||
}
|
||||
@ -62,11 +63,6 @@ class EnquiryListState extends ConsumerState<EnquiryList> {
|
||||
|
||||
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);
|
||||
}
|
||||
@ -189,6 +185,7 @@ class EnquiryListState extends ConsumerState<EnquiryList> {
|
||||
toDt = toDateVal;
|
||||
}
|
||||
|
||||
print("ASSS= $SelectedStatus");
|
||||
try {
|
||||
final response = await apiService.fetchEnquiryList(
|
||||
managerId,
|
||||
|
||||
@ -227,7 +227,8 @@ class endosementState extends ConsumerState<endosement> {
|
||||
}
|
||||
|
||||
Future<void> fetchEndorsementExcelReport() async {
|
||||
final response = await apiService.generateEndorsementExcel(managerId);
|
||||
final String searchValue = _searchStaffController.text;
|
||||
final response = await apiService.generateEndorsementExcel(managerId,searchValue);
|
||||
// Map your controllers and IDs to the API parameters
|
||||
// final String fromDate = controllers['startDate']!.text; // "11-01-2025"
|
||||
// final String toDate = controllers['endDate']!.text; // "20-01-2025"
|
||||
@ -493,19 +494,19 @@ class endosementState extends ConsumerState<endosement> {
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: Text('S.No.', style: _headerStyle),
|
||||
child: Text('S No ', style: _headerStyle),
|
||||
),
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: Text('Policy.From.', style: _headerStyle),
|
||||
child: Text('Policy From ', style: _headerStyle),
|
||||
),
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: Text('Status.', style: _headerStyle),
|
||||
child: Text('Status ', style: _headerStyle),
|
||||
),
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: Text('Vehicle.No.', style: _headerStyle),
|
||||
child: Text('Vehicle No ', style: _headerStyle),
|
||||
),
|
||||
Expanded(
|
||||
flex: 2,
|
||||
@ -513,7 +514,7 @@ class endosementState extends ConsumerState<endosement> {
|
||||
),
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: Text('Policy No.', style: _headerStyle),
|
||||
child: Text('Policy No ', style: _headerStyle),
|
||||
),
|
||||
Expanded(
|
||||
flex: 2,
|
||||
|
||||
@ -749,13 +749,19 @@ class AgentState extends ConsumerState<Agent> {
|
||||
}
|
||||
|
||||
Widget buildSalesExecutive(BuildContext context) {
|
||||
Map<String, dynamic>? selectedroleVal = filteredSalesExecutiveData
|
||||
.firstWhere(
|
||||
(item) => item['id'] == selectedSalesExectv,
|
||||
orElse: () => {},
|
||||
);
|
||||
Map<String, dynamic>? selectedSE;
|
||||
|
||||
print('selectedroleVal - $selectedroleVal');
|
||||
if (selectedSalesExectv != null &&
|
||||
filteredSalesExecutiveData.isNotEmpty) {
|
||||
selectedSE = filteredSalesExecutiveData.firstWhere(
|
||||
(item) =>
|
||||
item['id'].toString() ==
|
||||
selectedSalesExectv.toString(),
|
||||
orElse: () => {}, // ✅ MUST be null
|
||||
);
|
||||
}
|
||||
|
||||
print('selectedSalesExectv = $selectedSalesExectv');
|
||||
|
||||
final isReadOnly = false;
|
||||
// final isReadOnly = widget.id != null;
|
||||
@ -778,7 +784,7 @@ class AgentState extends ConsumerState<Agent> {
|
||||
absorbing: isReadOnly,
|
||||
child: DropdownSearch<Map<String, dynamic>>(
|
||||
key: dropDownKey,
|
||||
selectedItem: selectedroleVal.isNotEmpty ? selectedroleVal : null,
|
||||
selectedItem: selectedSE,
|
||||
items: (filter, infiniteScrollProps) {
|
||||
return filteredSalesExecutiveData;
|
||||
},
|
||||
@ -893,6 +899,7 @@ class AgentState extends ConsumerState<Agent> {
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Widget buildUploadDocument() {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
|
||||
@ -301,7 +301,7 @@ class _DashboardState extends ConsumerState<PartnerDashboard> {
|
||||
scrollDirection: Axis.vertical,
|
||||
child: Column(
|
||||
children: [
|
||||
if (role == 'manager' || role == 'handler')
|
||||
if (role == 'manager' || role == 'handler' || role == 'agent')
|
||||
SizedBox(
|
||||
height: MediaQuery.of(context).size.height * 0.78,
|
||||
// ✅ replace Expanded
|
||||
|
||||
@ -1668,7 +1668,7 @@ class CreateProposal_QuickFormState
|
||||
decoratorProps: DropDownDecoratorProps(
|
||||
decoration:
|
||||
AppInputDecorations.dropdownDecoration(
|
||||
label: "Select Staff Member",
|
||||
label: "Select Plan Type",
|
||||
).copyWith(
|
||||
errorStyle: GoogleFonts.poppins(fontSize: 0, height: 0.0),
|
||||
filled: true,
|
||||
|
||||
@ -226,7 +226,7 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
|
||||
final ScrollController _horizontalScrollController = ScrollController();
|
||||
// late Timer timer;
|
||||
Timer? timer;
|
||||
int selectedSeconds = 30;
|
||||
int selectedSeconds = 3000;
|
||||
bool isActionable = false; // current UI state
|
||||
bool userPreference = false; // memory of what the user chose
|
||||
bool _listened = false;
|
||||
@ -1817,7 +1817,7 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
|
||||
// });
|
||||
},
|
||||
child: ThemedSearchField(
|
||||
hintText: 'Search',
|
||||
hintText: 'Search *',
|
||||
backgroundColor: Color(0xFFFFFFFF),
|
||||
txtHeight: 30,
|
||||
controller: _searchStaffController,
|
||||
@ -2417,13 +2417,16 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
|
||||
);
|
||||
}
|
||||
|
||||
String normalizedStatus(dynamic value) {
|
||||
return value?.toString().trim().toLowerCase() ?? '';
|
||||
}
|
||||
// Helper: Status cell with conditional actions
|
||||
Widget _buildStatusCell(
|
||||
Map<String, dynamic> item,
|
||||
int id,
|
||||
Color bgColor,
|
||||
Color borderColor,
|
||||
) {
|
||||
Map<String, dynamic> item,
|
||||
int id,
|
||||
Color bgColor,
|
||||
Color borderColor,
|
||||
) {
|
||||
return Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
@ -2481,7 +2484,13 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
item['enquiry_status'] ?? '-',
|
||||
(item['enquiry_status'] ?? '-')
|
||||
.toString()
|
||||
.toLowerCase()
|
||||
.split(' ')
|
||||
.where((w) => w.isNotEmpty)
|
||||
.map((w) => w[0].toUpperCase() + w.substring(1))
|
||||
.join(' '),
|
||||
style: GoogleFonts.inter(
|
||||
fontSize: 10,
|
||||
color: Color(0XFF1e293b),
|
||||
|
||||
@ -720,7 +720,7 @@ class CreateProposalFormState extends ConsumerState<CreateProposalForm> {
|
||||
decoratorProps: DropDownDecoratorProps(
|
||||
decoration:
|
||||
AppInputDecorations.dropdownDecoration(
|
||||
label: "Select Staff Member",
|
||||
label: "Select Plan Type",
|
||||
).copyWith(
|
||||
filled: true,
|
||||
fillColor:
|
||||
|
||||
@ -584,7 +584,7 @@ class policylistState extends ConsumerState<policylist> {
|
||||
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: Text('Vehicle.No.', style: _headerStyle),
|
||||
child: Text('Vehicle No ', style: _headerStyle),
|
||||
),
|
||||
Expanded(
|
||||
flex: 3,
|
||||
|
||||
@ -179,7 +179,7 @@ class _DateFilterRowState extends ConsumerState<DateFilterRow> {
|
||||
SizedBox(width: spacing),
|
||||
|
||||
if (widget.dataFrom == null && widget.dataFrom != 'Policy') ...[
|
||||
buildStatusSearch(context),
|
||||
buildStatusSearch(context,widget.role),
|
||||
SizedBox(width: spacing),
|
||||
],
|
||||
|
||||
@ -334,18 +334,27 @@ class _DateFilterRowState extends ConsumerState<DateFilterRow> {
|
||||
);
|
||||
}
|
||||
|
||||
Widget buildStatusSearch(BuildContext context) {
|
||||
final List<Map<String, dynamic>> statusOptions = [
|
||||
// {'id': 1, 'status': 'Awaiting Proposal'},
|
||||
// {'id': 2, 'status': 'Proposal Created'},
|
||||
// {'id': 3, 'status': 'Proposal Accepted'},
|
||||
// {'id': 4, 'status': 'Proposal Rejected'},
|
||||
// {'id': 5, 'status': 'Policy Created'},
|
||||
{'id': 1, 'status': 'To be Assigned'},
|
||||
{'id': 2, 'status': 'Assigned'},
|
||||
{'id': 3, 'status': 'In Progress'},
|
||||
{'id': 4, 'status': 'Completed'},
|
||||
];
|
||||
Widget buildStatusSearch(BuildContext context,role) {
|
||||
|
||||
final List<Map<String, dynamic>> statusOptions;
|
||||
|
||||
if (role == "agent") {
|
||||
statusOptions = [
|
||||
{'id': 1, 'status': 'Awaiting Proposal'},
|
||||
{'id': 2, 'status': 'Proposal Created'},
|
||||
{'id': 3, 'status': 'Proposal Accepted'},
|
||||
{'id': 4, 'status': 'Proposal Rejected'},
|
||||
{'id': 5, 'status': 'Policy Created'},
|
||||
];
|
||||
} else {
|
||||
statusOptions = [
|
||||
{'id': 1, 'status': 'To Be Assigned'},
|
||||
{'id': 2, 'status': 'Assigned'},
|
||||
{'id': 3, 'status': 'In Progress'},
|
||||
{'id': 4, 'status': 'Completed'},
|
||||
];
|
||||
}
|
||||
|
||||
Map<String, dynamic>? selectedStatusMap = statusOptions
|
||||
.where((element) => element['status'] == widget.selectedStatusVal)
|
||||
.cast<Map<String, dynamic>>()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user