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