quick_proceed status_changes

This commit is contained in:
venbaittech 2025-12-01 14:57:35 +05:30
parent 485894ba98
commit fcdc9da609
13 changed files with 8893 additions and 589 deletions

File diff suppressed because one or more lines are too long

View File

@ -30,6 +30,7 @@ import '../../presentation/screens/splash/splash_screen.dart';
import '../../presentation/screens/staff/Enquiry/enquiry_inline_Edit_17Nov.dart'; import '../../presentation/screens/staff/Enquiry/enquiry_inline_Edit_17Nov.dart';
import '../../presentation/screens/staff/Enquiry/enquiry_inline_list.dart'; import '../../presentation/screens/staff/Enquiry/enquiry_inline_list.dart';
import '../../presentation/screens/staff/Enquiry/enquiry_list.dart'; import '../../presentation/screens/staff/Enquiry/enquiry_list.dart';
import '../../presentation/screens/staff/Enquiry/staff_policy.dart';
import '../../presentation/screens/staff/policy/policy.dart'; import '../../presentation/screens/staff/policy/policy.dart';
import '../../presentation/screens/staff/policy/policy_list.dart'; import '../../presentation/screens/staff/policy/policy_list.dart';
import '../../presentation/screens/staff/quotations/quotation.dart'; import '../../presentation/screens/staff/quotations/quotation.dart';
@ -176,6 +177,11 @@ final GoRouter appRouter = GoRouter(
builder: (context, state) => const PolicyScreen(), builder: (context, state) => const PolicyScreen(),
), ),
GoRoute(
path: AppRoutes.policyStaffEnq,
builder: (context, state) => PolicyStaffEnqList(),
),
GoRoute( GoRoute(
path: AppRoutes.enquiryForStaff, path: AppRoutes.enquiryForStaff,
builder: (context, state) => const EnquiryListStaffInline(), builder: (context, state) => const EnquiryListStaffInline(),

View File

@ -21,6 +21,7 @@ class AppRoutes {
static const String policylist = '/policylist'; static const String policylist = '/policylist';
static const String quotation = '/QuotationScreen'; static const String quotation = '/QuotationScreen';
static const String policy = '/PolicyScreen'; static const String policy = '/PolicyScreen';
static const String policyStaffEnq = '/policyStaffEnq';
static const String payout = '/payout'; static const String payout = '/payout';
static const String invoiceList = '/invoiceList'; static const String invoiceList = '/invoiceList';

View File

@ -576,6 +576,8 @@ class ApiService {
Future<Map<String, dynamic>> fetchStaffUserList(int managerId, role) async { Future<Map<String, dynamic>> fetchStaffUserList(int managerId, role) async {
// print(_token); // print(_token);
print('rolemanagerId - $managerId');
if (_token == null) { if (_token == null) {
await _initializeToken(); await _initializeToken();
} }
@ -587,6 +589,7 @@ class ApiService {
dynamic url; dynamic url;
if (role == 'manager') { if (role == 'manager') {
print('manager'); print('manager');
// url = Uri.parse('${Env.apiUrl}staff/staffList');
url = Uri.parse('${Env.apiUrl}staff/staffList?manager_id=${managerId}'); url = Uri.parse('${Env.apiUrl}staff/staffList?manager_id=${managerId}');
} else { } else {
print('handler'); print('handler');
@ -770,6 +773,22 @@ class ApiService {
return response; return response;
} }
Future<Map<String, dynamic>> updateEnquiryInProgress(id) async {
// print(_token);
if (_token == null) {
await _initializeToken();
}
final url = Uri.parse(
'${Env.apiUrl}enquiry/updateEnquiryInProgress?enquiry_id=$id',
);
final headers = {
'Authorization': 'Bearer $_token' ?? '',
'app-signature': Env.App_Signature,
};
final response = await _makeGetRequest(url, headers);
return response;
}
Future<Map<String, dynamic>> findEnqQuotePolicyView(id) async { Future<Map<String, dynamic>> findEnqQuotePolicyView(id) async {
print('findEnqQuotePolicyVie2w - $id'); print('findEnqQuotePolicyVie2w - $id');
if (_token == null) { if (_token == null) {

View File

@ -384,11 +384,11 @@ class _AppHeaderState extends ConsumerState<AppHeader> {
onPressed: () { onPressed: () {
SideDrawerPanel.show( SideDrawerPanel.show(
context: context, context: context,
title: 'Proposal Creation', title: 'Quote Creation',
child: CreateProposal_Quick(), child: CreateProposal_Quick(),
); );
}, },
tooltip: 'Create Proposal', tooltip: 'Quick Quote',
), ),
), ),

View File

@ -135,7 +135,12 @@ class MainLayoutState extends ConsumerState<MainLayout> {
// debugPrint("Notifications tapped"); // debugPrint("Notifications tapped");
// }, // },
// ), // ),
appBar: AppHeader(), // appBar: AppHeader(),
appBar: PreferredSize(
preferredSize: AppHeader().preferredSize,
child: ExcludeFocus(child: AppHeader()),
),
body: Row( body: Row(
children: [ children: [
// AnimatedContainer( // AnimatedContainer(

File diff suppressed because it is too large Load Diff

View File

@ -13,6 +13,7 @@ import 'package:intl/intl.dart';
import 'package:nhance_partner/presentation/screens/dashboard/dashboard.dart'; import 'package:nhance_partner/presentation/screens/dashboard/dashboard.dart';
import 'package:nhance_partner/presentation/screens/staff/Enquiry/quotationPopUpAccptReject.dart'; import 'package:nhance_partner/presentation/screens/staff/Enquiry/quotationPopUpAccptReject.dart';
import 'package:nhance_partner/presentation/screens/staff/Enquiry/raise_enq_form.dart'; import 'package:nhance_partner/presentation/screens/staff/Enquiry/raise_enq_form.dart';
import 'package:nhance_partner/presentation/screens/staff/Enquiry/staff_policy.dart';
import 'package:nhance_partner/presentation/screens/staff/Enquiry/tabs/tab.dart'; import 'package:nhance_partner/presentation/screens/staff/Enquiry/tabs/tab.dart';
import 'package:nhance_partner/presentation/themes/indicators/customizd_multi_file_upload.dart'; import 'package:nhance_partner/presentation/themes/indicators/customizd_multi_file_upload.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
@ -134,6 +135,10 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
String? selectedId; String? selectedId;
int selectedIndex = 0;
final List<String> enquiryTabs = ["In Progress", "Completed"];
Map<String, dynamic> dataDetails() { Map<String, dynamic> dataDetails() {
final data = { final data = {
"agent_id": "agent_id":
@ -211,7 +216,7 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
super.initState(); super.initState();
apiService = ApiService(); apiService = ApiService();
timer = Timer.periodic(Duration(seconds: 3), (Timer t) => callRefresh()); timer = Timer.periodic(Duration(seconds: 10), (Timer t) => callRefresh());
for (String field in tabHeader) { for (String field in tabHeader) {
controllers[field] = TextEditingController(); controllers[field] = TextEditingController();
} }
@ -2420,77 +2425,77 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
buildPhNumber(context), buildPhNumber(context),
buildRemarks(context), buildRemarks(context),
Padding( // Padding(
padding: const EdgeInsets.only(top: 8.0), // padding: const EdgeInsets.only(top: 8.0),
child: Builder( // child: Builder(
builder: (buttonContext) => Material( // builder: (buttonContext) => Material(
// color: Color(0xFFFFFCF2), // // color: Color(0xFFFFFCF2),
color: Color(0xFFF8F9FF), // color: Color(0xFFF8F9FF),
child: InkWell( // child: InkWell(
hoverColor: Color(0xFFF8F9FF), // hoverColor: Color(0xFFF8F9FF),
// hoverColor: const Color(0xFFFFFCF2), // // hoverColor: const Color(0xFFFFFCF2),
// hoverColor: const Color(0xFFEAF6F4), // // hoverColor: const Color(0xFFEAF6F4),
onTap: () async { // onTap: () async {
// Get overlay and button position RELATIVE to InkWell // // Get overlay and button position RELATIVE to InkWell
final RenderBox button = // final RenderBox button =
buttonContext.findRenderObject() as RenderBox; // buttonContext.findRenderObject() as RenderBox;
final RenderBox overlay = // final RenderBox overlay =
Overlay.of(buttonContext).context.findRenderObject() // Overlay.of(buttonContext).context.findRenderObject()
as RenderBox; // as RenderBox;
//
final Offset position = button.localToGlobal( // final Offset position = button.localToGlobal(
Offset.zero, // Offset.zero,
ancestor: overlay, // ancestor: overlay,
); // );
//
await showMenu( // await showMenu(
context: buttonContext, // context: buttonContext,
position: RelativeRect.fromLTRB( // position: RelativeRect.fromLTRB(
position.dx, // position.dx,
position.dy + button.size.height, // position.dy + button.size.height,
overlay.size.width, // overlay.size.width,
0, // 0,
), // ),
items: [ // items: [
PopupMenuItem( // PopupMenuItem(
child: Column( // child: Column(
mainAxisSize: MainAxisSize.min, // mainAxisSize: MainAxisSize.min,
children: _buildPopupDownload( // children: _buildPopupDownload(
buttonContext, // buttonContext,
selectId, // selectId,
), // ),
), // ),
), // ),
], // ],
// color: Colors.white, // // color: Colors.white,
// color: Color(0xFFFFFCF2), // // color: Color(0xFFFFFCF2),
color: Color(0xFFF8F9FF), // color: Color(0xFFF8F9FF),
); // );
}, // },
child: Tooltip( // child: Tooltip(
message: 'Click To Upload Documents', // message: 'Click To Upload Documents',
//
waitDuration: const Duration(milliseconds: 500), // waitDuration: const Duration(milliseconds: 500),
showDuration: const Duration(seconds: 2), // showDuration: const Duration(seconds: 2),
child: Container( // child: Container(
padding: EdgeInsets.all(8.0), // padding: EdgeInsets.all(8.0),
decoration: BoxDecoration( // decoration: BoxDecoration(
color: Colors.white, // color: Colors.white,
borderRadius: BorderRadius.circular(50), // borderRadius: BorderRadius.circular(50),
), // ),
child: Icon( // child: Icon(
Icons.upload_file, // Icons.upload_file,
color: Color(0XFF6366F1), // color: Color(0XFF6366F1),
// editing ? Icons.upload_file : Icons.download_for_offline, // // editing ? Icons.upload_file : Icons.download_for_offline,
// color: editing ? Colors.b lue : Colors.green, // // color: editing ? Colors.b lue : Colors.green,
size: 20, // size: 20,
), // ),
), // ),
), // ),
), // ),
), // ),
), // ),
), // ),
Padding( Padding(
padding: const EdgeInsets.only(top: 8.0), padding: const EdgeInsets.only(top: 8.0),
child: IconButton( child: IconButton(
@ -2863,36 +2868,40 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
// ], // ],
// ), // ),
width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width,
// height: MediaQuery.of(context).size.height * 0.1,
// padding: EdgeInsets.all(12.0), // padding: EdgeInsets.all(12.0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
RaiseEnqForm( Container(
key: raiseEnqKey, // height: MediaQuery.of(context).size.height*0.
onSubmit: (dataSet) async { child: RaiseEnqForm(
print('Check checking dataSet $dataSet'); key: raiseEnqKey,
try { onSubmit: (dataSet) async {
await createUserData(dataSet); // <-- API call here print('Check checking dataSet $dataSet');
print("Enquiry saved successfully"); try {
// RESET FORM await createUserData(dataSet); // <-- API call here
raiseEnqKey.currentState?.resetFormFields(); print("Enquiry saved successfully");
} catch (e) { // RESET FORM
showDialog( raiseEnqKey.currentState?.resetFormFields();
context: context, } catch (e) {
builder: (_) => AlertDialog( showDialog(
title: const Text('Error'), context: context,
content: Text(e.toString()), builder: (_) => AlertDialog(
actions: [ title: const Text('Error'),
TextButton( content: Text(e.toString()),
onPressed: () => Navigator.of(context).pop(), actions: [
child: const Text('OK'), TextButton(
), onPressed: () => Navigator.of(context).pop(),
], child: const Text('OK'),
), ),
); ],
} ),
}, );
}
},
),
), ),
// SizedBox(height: 5), // SizedBox(height: 5),
@ -2920,29 +2929,29 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
), ),
// ), // ),
Container( // Container(
// height: 20, // // height: 20,
width: MediaQuery.of(context).size.width, // width: MediaQuery.of(context).size.width,
// color: Colors.green.shade50, // // color: Colors.green.shade50,
child: PaginationControls( // child: PaginationControls(
currentPage: currentPage, // currentPage: currentPage,
itemsPerPage: itemsPerPage, // itemsPerPage: itemsPerPage,
// totalItems: dataVal.length, // // totalItems: dataVal.length,
totalItems: filteredData.length, // totalItems: filteredData.length,
// activeColor: layoutColor, // your theme color // // activeColor: layoutColor, // your theme color
onPageChanged: (page) { // onPageChanged: (page) {
setState(() { // setState(() {
currentPage = page; // currentPage = page;
}); // });
}, // },
onItemsPerPageChanged: (items) { // onItemsPerPageChanged: (items) {
setState(() { // setState(() {
itemsPerPage = items; // itemsPerPage = items;
currentPage = 1; // currentPage = 1;
}); // });
}, // },
), // ),
), // ),
], ],
), ),
), ),
@ -2971,6 +2980,37 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
refrshfilterDateRange(); refrshfilterDateRange();
} }
Future<void> buildPolicyCreatedStatusActions(
BuildContext context,
status,
id,
) async {
print("Actionsstatus - $status -$id");
dynamic val;
if (status == 'Awaiting Proposal' || status == 'Proposal Created') {
val = '';
} else {
val = 'Policy';
}
final result = await showDialog(
context: context,
barrierDismissible:
false, // optional - prevents closing by tapping outside
builder: (context) => PolicyStaffEnqList(),
);
// Code here runs *after* the dialog is closed
print("Dialog closed");
print("Dialog result: $result");
if (result) {
setState(() {
isActionable = false;
});
refrshfilterDateRange();
}
}
Widget _buildContent(BuildContext context) { Widget _buildContent(BuildContext context) {
final isDesktop = !ResponsiveLayout.isMobile(context); final isDesktop = !ResponsiveLayout.isMobile(context);
return Column( return Column(
@ -3076,8 +3116,8 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
), ),
), ),
SizedBox(height: 5), // SizedBox(height: 5),
SizedBox(child: _buildStyledTabs()),
ResponsiveLayout.isMobile(context) ResponsiveLayout.isMobile(context)
? _buildDataTable(context) ? _buildDataTable(context)
: :
@ -3095,59 +3135,135 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
// 1. Add group expansion state tracking // 1. Add group expansion state tracking
Map<String, bool> groupExpanded = { Map<String, bool> groupExpanded = {
'Awaiting Proposal': true, // 'Awaiting Proposal': true,
'Proposal Created': true, // 'Proposal Created': true,
// 'Proposal Accepted': true, // 'Proposal Accepted': true,
// 'Proposal Rejected': true, // 'Proposal Rejected': true,
'Policy Created': true, // 'Awaiting Payment': true,
// 'Policy Created': true,
'To be assigned': true,
'Assigned': true,
'In progress': true,
}; };
Map<String, String> statusGroupMap = { Map<String, String> statusGroupMap = {
'Awaiting Proposal': 'Awaiting Proposal', // 'Awaiting Proposal': 'Awaiting Proposal',
'Proposal Created': 'Proposal Created', // 'Proposal Created': 'Proposal Created',
'Proposal Accepted': 'Proposal Created', // 'Proposal Accepted': 'Proposal Created',
'Proposal Rejected': 'Proposal Created', // 'Proposal Rejected': 'Proposal Created',
'Policy Created': 'Policy Created', // 'Proposal Created': 'Awaiting Payment',
// 'Proposal Accepted': 'Awaiting Payment',
// 'Proposal Rejected': 'Awaiting Payment',
// 'Policy Created': 'Policy Created',
// 'Policy Created': 'Policy Created',
'To be assigned': 'To be assigned',
'Assigned': 'Assigned',
'In progress': 'In progress',
}; };
List<Map<String, dynamic>> get filteredDataByTab {
if (selectedIndex == 0) {
// Progress enquiries
final sortedData = [...filteredData]
..sort((a, b) => int.parse(b['id']) - int.parse(a['id']));
if (sortedData.isEmpty) return [];
return sortedData.where((e) {
return [
"To be assigned",
"Assigned",
"In progress",
].contains(e['enquiry_status']);
}).toList();
} else {
final sortedData = [...filteredData]
..sort((a, b) => int.parse(b['id']) - int.parse(a['id']));
if (sortedData.isEmpty) return [];
// Completed enquiries
return sortedData.where((e) {
return e['enquiry_status'] == "Completed";
}).toList();
}
}
// Add group enquiries by status // Add group enquiries by status
Map<String, List<Map<String, dynamic>>> get _groupedEnquiries { Map<String, List<Map<String, dynamic>>> get _groupedEnquiries {
final grouped = <String, List<Map<String, dynamic>>>{}; final Map<String, List<Map<String, dynamic>>> grouped = {};
// Initialize all status groups if (selectedIndex == 0) {
grouped['Awaiting Proposal'] = []; grouped["To be assigned"] = [];
grouped['Proposal Created'] = []; grouped["Assigned"] = [];
grouped['Proposal Accepted'] = []; grouped["In progress"] = [];
grouped['Proposal Rejected'] = []; } else {
grouped['Policy Created'] = []; grouped["Completed"] = [];
}
// Initialize only the groups you need for (var item in filteredDataByTab) {
grouped['Awaiting Proposal'] = []; final status = (item['enquiry_status'] ?? '').toString();
grouped['Proposal Created'] = []; if (grouped.containsKey(status)) {
grouped['Policy Created'] = []; grouped[status]!.add(item);
// Group the filtered/paginated data by status
// for (var item in _paginatedData) {
// final status = item['status']?.toString() ?? 'Unknown';
// if (grouped.containsKey(status)) {
// grouped[status]!.add(item);
// }
// }
for (var item in _paginatedData) {
final status = item['status']?.toString() ?? 'Unknown';
// Map actual status to grouped status
final groupKey = statusGroupMap[status];
if (groupKey != null) {
grouped[groupKey]!.add(item);
} }
} }
return grouped; return grouped;
} }
// Map<String, List<Map<String, dynamic>>> get _groupedEnquiries {
// final grouped = <String, List<Map<String, dynamic>>>{};
//
// // Initialize all status groups
// // grouped['Awaiting Proposal'] = [];
// // grouped['Proposal Created'] = [];
// // grouped['Proposal Accepted'] = [];
// // grouped['Proposal Rejected'] = [];
// // grouped['Policy Created'] = [];
// // grouped['Awaiting Payment'] = [];
//
// // Initialize only the groups you need
// // grouped['Awaiting Proposal'] = [];
// // grouped['Proposal Created'] = [];
// // grouped['Policy Created'] = [];
//
// grouped['To be assigned'] = [];
// grouped['Assigned'] = [];
// grouped['In progress'] = [];
//
// // Group the filtered/paginated data by status
// // for (var item in _paginatedData) {
// // final status = item['status']?.toString() ?? 'Unknown';
// // if (grouped.containsKey(status)) {
// // grouped[status]!.add(item);
// // }
// // }
//
// for (var item in filteredData) {
// // final status = item['status']?.toString() ?? 'Unknown';
// final status = item['enquiry_status']?.toString() ?? 'Unknown';
//
// // Map actual status to grouped status
// final groupKey = statusGroupMap[status];
//
// if (groupKey != null) {
// grouped[groupKey]!.add(item);
// }
// }
//
// // for (var item in _paginatedData) {
// // // final status = item['status']?.toString() ?? 'Unknown';
// // final status = item['enquiry_status']?.toString() ?? 'Unknown';
// //
// // // Map actual status to grouped status
// // final groupKey = statusGroupMap[status];
// //
// // if (groupKey != null) {
// // grouped[groupKey]!.add(item);
// // }
// // }
//
// return grouped;
// }
Map<String, dynamic> _getStatusConfig(String status) { Map<String, dynamic> _getStatusConfig(String status) {
switch (status) { switch (status) {
case 'Awaiting Proposal': case 'Awaiting Proposal':
@ -3170,7 +3286,12 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
'Proposal Created': const Color(0xFFF0F9FF), // Cyan 50 'Proposal Created': const Color(0xFFF0F9FF), // Cyan 50
'Proposal Accepted': const Color(0xFFF0FDF4), // Green 50 'Proposal Accepted': const Color(0xFFF0FDF4), // Green 50
'Proposal Rejected': const Color(0xFFFEF9C3), // Yellow 50 'Proposal Rejected': const Color(0xFFFEF9C3), // Yellow 50
'Policy Created': const Color(0xFFF3F0FF), // Purple 50 (generated) 'Policy Created': const Color(0xFFF3F0FF),
'To be assigned': const Color(0xFFEFF6FF), // Blue 50
'Assigned': const Color(0xFFFEF9C3), // Cyan 50
'In progress': const Color(0xFFF0FDF4), // Green 50
'Completed': const Color(0xFFF3F0FF), // Purple 50 (generated)
}; };
final Map<String, Color> statusBorderColors = { final Map<String, Color> statusBorderColors = {
@ -3179,6 +3300,11 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
'Proposal Accepted': const Color(0xFFDCFCE7), // Green 100 'Proposal Accepted': const Color(0xFFDCFCE7), // Green 100
'Proposal Rejected': const Color(0xFFFEF3C7), // Yellow 100 'Proposal Rejected': const Color(0xFFFEF3C7), // Yellow 100
'Policy Created': const Color(0xFFF0E4FF), // Purple 200 'Policy Created': const Color(0xFFF0E4FF), // Purple 200
'To be assigned': const Color(0xFFDBEAFE), // Blue 100
'Assigned': const Color(0xFFFEF3C7), // Cyan 100
'In progress': const Color(0xFFDCFCE7), // Green 100
'Completed': const Color(0xFFF0E4FF), // Purple 200
// 'Policy Created': const Color(0xFFE5CCFF), // Purple 200 // 'Policy Created': const Color(0xFFE5CCFF), // Purple 200
}; };
@ -3202,7 +3328,7 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
}); });
}, },
child: Container( child: Container(
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 4), padding: EdgeInsets.symmetric(horizontal: 10, vertical: 2),
child: Row( child: Row(
children: [ children: [
Icon( Icon(
@ -3348,6 +3474,8 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
// Group Header // Group Header
// if (status != 'Proposal Accepted' &&
// status != 'Proposal Rejected') ...[
if (status != 'Proposal Accepted' && if (status != 'Proposal Accepted' &&
status != 'Proposal Rejected') ...[ status != 'Proposal Rejected') ...[
Container( Container(
@ -3487,7 +3615,8 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
final editing = isEditingRow[id] ?? false; final editing = isEditingRow[id] ?? false;
final controllers = rowControllers[id]; final controllers = rowControllers[id];
String status = item['status'] ?? '-'; // String status = item['status'] ?? '-';
String status = item['enquiry_status'] ?? '-';
Color bgColor = statusColors[status] ?? Color(0xFFF9FAFB); Color bgColor = statusColors[status] ?? Color(0xFFF9FAFB);
Color borderColor = statusBorderColors[status] ?? Color(0xFFE2E8F0); Color borderColor = statusBorderColors[status] ?? Color(0xFFE2E8F0);
@ -3774,6 +3903,91 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
), ),
), ),
DataCell(
SizedBox(
width: 120,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
if (item['enquiry_status'] != 'Assigned') ...[
Material(
color: Colors.white,
child: InkWell(
// hoverColor: Color(0xFFEAF6F4),
onTap: null,
// onTap: () async {
// setState(() {
// isActionable = true;
// });
// buildPolicyCreatedStatusActions(
// context,
// item['status'],
// item['id'],
// );
// },
child: Tooltip(
message: 'Click to View or Process Enquiry', //
waitDuration: const Duration(
milliseconds: 500,
), // optional
showDuration: const Duration(seconds: 2), // optional
child: Container(
padding: EdgeInsets.symmetric(vertical: 2.0),
margin: EdgeInsets.symmetric(vertical: 2),
decoration: BoxDecoration(
// color: Color(0xFFF9FAFB),
// border: Border.all(color: Color(0xFFE2E8F0)),
color: bgColor,
border: Border.all(color: borderColor),
borderRadius: BorderRadius.circular(5),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
item['enquiry_status'] ?? '-',
// item['status'] ?? '-',
style: GoogleFonts.inter(
fontSize: 10,
color: Color(0XFF1e293b),
// color: statusTextColors[status] ?? Colors.black,
fontWeight: FontWeight.w500,
),
// overflow: TextOverflow.clip, //
),
],
),
),
),
// child: Text(item['status'] ?? '-', style: _dataBold),
),
),
],
if (item['enquiry_status'] == 'Assigned') ...[
TextButton(
onPressed: () async {
final res = await apiService.updateEnquiryInProgress(id);
if (res['status'] == 'success') {
refrshfilterDateRange();
}
print('updateEnquiryInProgress - $res');
},
child: Text(
'PROCEED',
style: GoogleFonts.poppins(
fontSize: 11,
fontWeight: FontWeight.w500,
color: Colors.green,
),
),
),
],
],
),
),
),
// Assigned Date (formatted) // Assigned Date (formatted)
// DataCell( // DataCell(
// SizedBox( // SizedBox(
@ -4285,65 +4499,65 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
), ),
), ),
DataCell( // DataCell(
SizedBox( // SizedBox(
width: 120, // width: 120,
//
child: Material( // child: Material(
color: Colors.white, // color: Colors.white,
child: InkWell( // child: InkWell(
// hoverColor: Color(0xFFEAF6F4), // // hoverColor: Color(0xFFEAF6F4),
onTap: () async { // onTap: () async {
var status = item['status']; // var status = item['status'];
var enqId = item['id']; // var enqId = item['id'];
//
final prefs = await SharedPreferences.getInstance(); // final prefs = await SharedPreferences.getInstance();
//
// Remove old value (if any) // // Remove old value (if any)
await prefs.remove('enqStaffDataId'); // await prefs.remove('enqStaffDataId');
//
// Save the new id // // Save the new id
await prefs.setString('enqStaffDataId', enqId.toString()); // await prefs.setString('enqStaffDataId', enqId.toString());
ref.read(quotationStaffIdProvider.notifier).state = enqId; // ref.read(quotationStaffIdProvider.notifier).state = enqId;
buildStatusActions(context, status, enqId); // buildStatusActions(context, status, enqId);
}, // },
child: Tooltip( // child: Tooltip(
message: 'Click to View or Process Enquiry', // // message: 'Click to View or Process Enquiry', //
waitDuration: const Duration(milliseconds: 500), // optional // waitDuration: const Duration(milliseconds: 500), // optional
showDuration: const Duration(seconds: 2), // optional // showDuration: const Duration(seconds: 2), // optional
child: Container( // child: Container(
padding: EdgeInsets.symmetric(vertical: 2.0), // padding: EdgeInsets.symmetric(vertical: 2.0),
margin: EdgeInsets.symmetric(vertical: 2), // margin: EdgeInsets.symmetric(vertical: 2),
decoration: BoxDecoration( // decoration: BoxDecoration(
// color: Color(0xFFF9FAFB), // // color: Color(0xFFF9FAFB),
// border: Border.all(color: Color(0xFFE2E8F0)), // // border: Border.all(color: Color(0xFFE2E8F0)),
color: bgColor, // color: bgColor,
border: Border.all(color: borderColor), // border: Border.all(color: borderColor),
borderRadius: BorderRadius.circular(5), // borderRadius: BorderRadius.circular(5),
), // ),
//
child: Row( // child: Row(
mainAxisAlignment: MainAxisAlignment.center, // mainAxisAlignment: MainAxisAlignment.center,
children: [ // children: [
Text( // Text(
item['status'] ?? '-', // item['status'] ?? '-',
style: GoogleFonts.inter( // style: GoogleFonts.inter(
fontSize: 10, // fontSize: 10,
color: Color(0XFF1e293b), // color: Color(0XFF1e293b),
// color: statusTextColors[status] ?? Colors.black, // // color: statusTextColors[status] ?? Colors.black,
fontWeight: FontWeight.w500, // fontWeight: FontWeight.w500,
), // ),
// overflow: TextOverflow.clip, // // // overflow: TextOverflow.clip, //
), // ),
], // ],
), // ),
), // ),
), // ),
// child: Text(item['status'] ?? '-', style: _dataBold), // // child: Text(item['status'] ?? '-', style: _dataBold),
), // ),
), // ),
), // ),
), // ),
], ],
); );
} }
@ -4360,12 +4574,12 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
DataColumn(label: Text('Insured Name *', style: _headerStyle)), DataColumn(label: Text('Insured Name *', style: _headerStyle)),
DataColumn(label: Text('Vehicle No *', style: _headerStyle)), DataColumn(label: Text('Vehicle No *', style: _headerStyle)),
DataColumn(label: Text('Action', style: _headerStyle)), DataColumn(label: Text('Action', style: _headerStyle)),
DataColumn(label: Text('Status', style: _headerStyle)),
// const DataColumn(label: Text('Assigned Date', style: _headerStyle)), // const DataColumn(label: Text('Assigned Date', style: _headerStyle)),
// DataColumn(label: Text('Premium', style: _headerStyle)), // DataColumn(label: Text('Premium', style: _headerStyle)),
DataColumn(label: Text('Payment Mode', style: _headerStyle)), DataColumn(label: Text('Payment Mode', style: _headerStyle)),
DataColumn(label: Text('Plan Type', style: _headerStyle)), DataColumn(label: Text('Plan Type', style: _headerStyle)),
DataColumn(label: Text('Policy Number', style: _headerStyle)), DataColumn(label: Text('Policy', style: _headerStyle)),
DataColumn(label: Text('Status', style: _headerStyle)),
]; ];
} }
@ -4383,14 +4597,14 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
_buildHeaderCell('Insurer *', 90), _buildHeaderCell('Insurer *', 90),
_buildHeaderCell('Insured Name *', 110), _buildHeaderCell('Insured Name *', 110),
_buildHeaderCell('Vehicle No *', 90), _buildHeaderCell('Vehicle No *', 90),
_buildHeaderCell('Action', 80), _buildHeaderCell('Action', 110),
_buildHeaderCell('Status', 100),
// _buildHeaderCell('Assigned Date', 100), // _buildHeaderCell('Assigned Date', 100),
// _buildHeaderCell('Premium', 100), // _buildHeaderCell('Premium', 100),
_buildHeaderCell('Payment Mode', 130), _buildHeaderCell('Payment Mode', 130),
_buildHeaderCell('Plan Type', 130), _buildHeaderCell('Plan Type', 130),
_buildHeaderCell('Policy Number', 120), _buildHeaderCell('Policy', 120),
_buildHeaderCell('Status', 100),
], ],
), ),
); );
@ -4452,6 +4666,76 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
); );
} }
Widget _buildStyledTabs() {
return Container(
padding: const EdgeInsets.symmetric(vertical: 4),
decoration: const BoxDecoration(
color: Colors.white,
// color: Colors.amber,
// border: Border(bottom: BorderSide(color: Color(0xFFE5E5E5), width: 1)),
),
child: Row(
children: List.generate(enquiryTabs.length, (index) {
final bool isSelected = selectedIndex == index;
return MouseRegion(
cursor: SystemMouseCursors.click,
child: GestureDetector(
onTap: () {
setState(() {
selectedIndex = index;
});
},
child: AnimatedContainer(
duration: const Duration(milliseconds: 250),
curve: Curves.easeOut,
padding: const EdgeInsets.symmetric(
vertical: 5,
horizontal: 20,
),
margin: const EdgeInsets.only(right: 24),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6),
color: isSelected
? const Color(0xFF2E7D6E).withOpacity(0.08)
: Colors.transparent,
),
child: Column(
// mainAxisSize: MainAxisSize.min,
children: [
Text(
enquiryTabs[index],
style: GoogleFonts.poppins(
fontSize: 12,
fontWeight: FontWeight.w600,
color: isSelected
? const Color(0xFF2E7D6E)
: Colors.black87,
),
),
// const SizedBox(height: 3),
// Underline Indicator
AnimatedContainer(
duration: const Duration(milliseconds: 250),
height: 3,
width: isSelected ? 40 : 0,
decoration: BoxDecoration(
color: const Color(0xFF2E7D6E),
borderRadius: BorderRadius.circular(50),
),
),
],
),
),
),
);
}),
),
);
}
static final _dataBold = GoogleFonts.inter( static final _dataBold = GoogleFonts.inter(
fontSize: 11, fontSize: 11,

View File

@ -381,28 +381,30 @@ class RaiseEnqFormState extends ConsumerState<RaiseEnqForm> {
), ),
], ],
), ),
child: Form( child: FocusTraversalGroup(
key: _formKey, child: Form(
child: Row( key: _formKey,
mainAxisAlignment: MainAxisAlignment.spaceBetween, child: Row(
crossAxisAlignment: CrossAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ crossAxisAlignment: CrossAxisAlignment.end,
buildAgentName(context, fromHeader: true), children: [
if (roleId != 'staff') ...[buildSelectStaffMem(context)], buildAgentName(context, fromHeader: true),
if (roleId != 'staff') ...[buildSelectStaffMem(context)],
buildBroker(context), buildBroker(context),
buildInsurer(context, fromHeader: true), buildInsurer(context, fromHeader: true),
// buildInsuredName(context, fromHeader: true), // buildInsuredName(context, fromHeader: true),
buildVehicleNumber(context), buildVehicleNumber(context),
Row( Row(
children: [ children: [
buildRefresh(context), buildRefresh(context),
SizedBox(width: 5), SizedBox(width: 5),
buildSave(context), buildSave(context),
], ],
), ),
], ],
),
), ),
), ),
); );

File diff suppressed because it is too large Load Diff

View File

@ -52,7 +52,7 @@ class SideDrawerPanel extends StatelessWidget {
children: [ children: [
if (title != null) if (title != null)
Text( Text(
'Proposal Creation', title!,
style: GoogleFonts.poppins( style: GoogleFonts.poppins(
fontSize: 14, fontSize: 14,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,

View File

@ -31,6 +31,8 @@ class ThemedFormInlineField extends HookWidget {
this.onChanged, this.onChanged,
this.isdense, this.isdense,
this.padVertical, this.padVertical,
this.errFieldFont,
this.errFieldHgt,
}); });
final String? hintText; final String? hintText;
@ -47,6 +49,8 @@ class ThemedFormInlineField extends HookWidget {
final Color? highlightColor; final Color? highlightColor;
final Color? textColr; final Color? textColr;
final double? txtwidth; final double? txtwidth;
final double? errFieldFont;
final double? errFieldHgt;
final bool readOnly; final bool readOnly;
final bool? isdense; final bool? isdense;
final bool? isShowCursor; final bool? isShowCursor;
@ -84,7 +88,16 @@ class ThemedFormInlineField extends HookWidget {
); );
final inputDecoration = InputDecoration( final inputDecoration = InputDecoration(
isDense: isdense ?? false, isDense: isdense ?? false,
errorStyle: TextStyle(color: Color(0xFFD83731)), // errorStyle: const TextStyle(
// fontSize: 9,
//
// // height: 0.0
// ),
errorStyle: TextStyle(
color: Color(0xFFD83731),
fontSize: errFieldFont ?? 12,
height: errFieldHgt ?? 10,
),
errorBorder: OutlineInputBorder( errorBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(5), borderRadius: BorderRadius.circular(5),
borderSide: BorderSide( borderSide: BorderSide(