Commit 29665037 authored by Sai Srinivas's avatar Sai Srinivas
Browse files

30-07-2025 By Sai Srinivas

CRM Module
parent 56ca3566
...@@ -149,15 +149,17 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -149,15 +149,17 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
borderRadius: BorderRadius.circular(14), borderRadius: BorderRadius.circular(14),
), ),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Expanded( Expanded(
child: Container( child: Container(
alignment: Alignment.centerLeft, alignment: Alignment.centerLeft,
padding: const EdgeInsets.fromLTRB(0.0, 0.0, 10, 0),
margin: const EdgeInsets.fromLTRB(10.0, 0.0, 10, 10),
child: Text( child: Text(
"Search", "Search",
style: TextStyle( style: TextStyle(
height: 1,
color: AppColors.grey_thick, color: AppColors.grey_thick,
fontSize: 14, fontSize: 14,
), ),
...@@ -232,22 +234,22 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -232,22 +234,22 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
final colors = [ final colors = [
0xFFE7FFE5, 0xFFE7FFE5,
0xFFF3EDFF, 0xFFF3EDFF,
0xFFEEF1FF,
0xFFFFFCD5, 0xFFFFFCD5,
0xFFFFF6F0, 0xFFFFF6F0,
0xFFE7FFE5, 0xFFFFEFEF,
0xFFF3EDFF, 0xFFEDF7FF,
0xFFFFFCD5, 0xFFFFF1CE,
0xFFFFF6F0,
]; ];
final textcolors = [ final textcolors = [
0xFF0D9C00, 0xFF0D9C00,
0xFF493272, 0xFF493272,
0xFF6563FF,
0xFF605C00, 0xFF605C00,
0xFF91481B, 0xFF91481B,
0xFF0D9C00, 0xFFED3424,
0xFF493272, 0xFF586000,
0xFF605C00, 0xFF326D72,
0xFF91481B,
]; ];
return InkResponse( return InkResponse(
...@@ -261,11 +263,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -261,11 +263,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
MaterialPageRoute( MaterialPageRoute(
builder: builder:
(context) => Leadlistbymode( (context) => Leadlistbymode(
pageTitleName: pageTitleName: "${leadTitles[jndex]}",
provider
.allLeads[jndex]
.filter!
.pageName!,
mode: mode:
provider provider
.allLeads[jndex] .allLeads[jndex]
...@@ -278,6 +276,17 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -278,6 +276,17 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
); );
} }
} }
if (leadTitles[jndex] == "Pending Tasks") {
await Navigator.push(
context,
MaterialPageRoute(
builder: (context) => PendingTasksList(),
settings: RouteSettings(
name: "PendingTasksList",
),
),
);
}
}, },
child: Container( child: Container(
padding: EdgeInsets.symmetric(horizontal: 13), padding: EdgeInsets.symmetric(horizontal: 13),
...@@ -441,7 +450,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -441,7 +450,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
// }, // },
// ), // ),
Container( Container(
height: MediaQuery.of(context).size.height * 0.2, height: MediaQuery.of(context).size.height * 0.22,
margin: EdgeInsets.symmetric(horizontal: 10), margin: EdgeInsets.symmetric(horizontal: 10),
child: Row( child: Row(
children: [ children: [
...@@ -492,7 +501,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -492,7 +501,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
), ),
), ),
Text( Text(
"Leads", "Details,\nFollowup",
// "Product and \nservice orders", // "Product and \nservice orders",
style: TextStyle( style: TextStyle(
color: AppColors.grey_semi, color: AppColors.grey_semi,
...@@ -559,7 +568,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -559,7 +568,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
), ),
), ),
Text( Text(
"Accounts", "Account Details,\nLead Details",
// "Assigned agents, \nperformance", // "Assigned agents, \nperformance",
style: TextStyle( style: TextStyle(
color: AppColors.grey_semi, color: AppColors.grey_semi,
...@@ -617,7 +626,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -617,7 +626,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
children: [ children: [
Expanded( Expanded(
child: Text( child: Text(
"Appointment", "Appointment\nCalendar",
style: TextStyle( style: TextStyle(
color: AppColors.app_blue, color: AppColors.app_blue,
fontSize: 14, fontSize: 14,
...@@ -628,7 +637,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -628,7 +637,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
), ),
), ),
Text( Text(
"Calendar", "",
// "Records,\nLedger", // "Records,\nLedger",
style: TextStyle( style: TextStyle(
color: AppColors.grey_semi, color: AppColors.grey_semi,
...@@ -664,7 +673,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -664,7 +673,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
child: Row( child: Row(
children: [ children: [
Text( Text(
"NearBy Leads", "Nearby Leads",
style: TextStyle( style: TextStyle(
fontSize: 16, fontSize: 16,
color: AppColors.grey_semi, color: AppColors.grey_semi,
...@@ -727,16 +736,14 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -727,16 +736,14 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
final longitude = location.lng; final longitude = location.lng;
return InkResponse( return InkResponse(
onTap: () async { onTap: () async {
await Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: builder:
(context) => NearbyOpenLeads( (context) => LeadDetailsByMode(
latitude: latitude, mode: "",
longitude: longitude, pageTitleName: "Lead Details",
), leadId: provider.nearByLeads[index].id,
settings: RouteSettings(
name: "NearbyOpenLeads",
), ),
), ),
); );
...@@ -789,6 +796,22 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -789,6 +796,22 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
), ),
SizedBox(width: 10), SizedBox(width: 10),
Expanded( Expanded(
child: InkResponse(
onTap: () async {
await Navigator.push(
context,
MaterialPageRoute(
builder:
(context) => NearbyOpenLeads(
latitude: latitude,
longitude: longitude,
),
settings: RouteSettings(
name: "NearbyOpenLeads",
),
),
);
},
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border.all( border: Border.all(
...@@ -812,6 +835,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -812,6 +835,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
), ),
), ),
), ),
),
], ],
), ),
), ),
...@@ -929,7 +953,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -929,7 +953,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
Container( Container(
width: double.infinity, width: double.infinity,
child: ListView.builder( child: ListView.builder(
physics: AlwaysScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
shrinkWrap: true, shrinkWrap: true,
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
vertical: 5, vertical: 5,
...@@ -973,8 +997,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -973,8 +997,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
...List.generate(3, (j) { Container(
return Container(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
vertical: 3, vertical: 3,
horizontal: 0, horizontal: 0,
...@@ -982,43 +1005,95 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -982,43 +1005,95 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
child: Column( child: Column(
children: [ children: [
if (j == 2) ...[ Row(
Padding( crossAxisAlignment:
padding: const EdgeInsets.only( CrossAxisAlignment.start,
top: 3.0, children: [
bottom: 3.0, Expanded(
child: Text(
"${provider.pendingTasksLists[index].aname}",
maxLines: 1,
overflow: TextOverflow.visible,
style: TextStyle(
decoration:
TextDecoration.underline,
height: 1,
decorationStyle:
TextDecorationStyle.dotted,
decorationColor: Color(
0xFF676767,
),
color: AppColors.semi_black,
fontFamily: "JakartaRegular",
fontSize: 14,
),
),
),
Expanded(
child: Text(
"${provider.pendingTasksLists[index].appdate}",
textAlign: TextAlign.right,
maxLines: 1,
style: TextStyle(
color: AppColors.grey_semi,
fontFamily: "JakartaRegular",
fontSize: 14,
), ),
child: DottedLine(
dashGapLength: 4,
dashGapColor: Colors.white,
dashColor: AppColors.grey_semi,
dashLength: 4,
lineThickness: 0.5,
), ),
), ),
], ],
Row( ),
SizedBox(height: 10),
Container(
padding: EdgeInsets.symmetric(
vertical: 10,
horizontal: 10,
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(
16,
),
gradient: LinearGradient(
colors: [
Color(0xFFFFFFFF),
Color(0xFFE8F7FF),
],
),
),
child: Row(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
Expanded( Expanded(
child: Text( child: Text(
"${subHeadings[j]}", "Remarks",
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
color: color: AppColors.app_blue,
j == 0 fontFamily: "JakartaRegular",
? AppColors.semi_black fontSize: 14,
: AppColors.grey_semi, ),
),
),
Expanded(
child: Text(
"${provider.pendingTasksLists[index].anote}",
textAlign: TextAlign.right,
maxLines: 1,
style: TextStyle(
color: AppColors.semi_black,
fontFamily: "JakartaRegular",
fontSize: 14, fontSize: 14,
), ),
), ),
), ),
], ],
), ),
),
], ],
), ),
); ),
}),
], ],
), ),
), ),
...@@ -1043,9 +1118,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -1043,9 +1118,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => Addleadsprospectsscreen(), builder: (context) => Addleadsprospectsscreen(),
settings: RouteSettings( settings: RouteSettings(name: 'Addleadsprospectsscreen'),
name: 'Addleadsprospectsscreen'
)
), ),
); );
// } // }
......
...@@ -518,7 +518,7 @@ class _EditProductsListState extends State<EditProductsList> { ...@@ -518,7 +518,7 @@ class _EditProductsListState extends State<EditProductsList> {
.map((ord) => DropdownMenuItem<Products>( .map((ord) => DropdownMenuItem<Products>(
value: ord, value: ord,
child: Text( child: Text(
"(Product Name: ${ord.name})", "${ord.name}",
style: const TextStyle(fontSize: 14), style: const TextStyle(fontSize: 14),
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
), ),
......
This diff is collapsed.
...@@ -61,8 +61,11 @@ class _GeneratequotationaddeditproductState ...@@ -61,8 +61,11 @@ class _GeneratequotationaddeditproductState
if (widget.type == "add") { if (widget.type == "add") {
// Initialize controllers and dropdowns after API call // Initialize controllers and dropdowns after API call
provider.addEditInitializeForm(context); provider.addEditInitializeForm(context);
} else { } else if (widget.type == "edit"){
provider.preFillFormForEdit(widget.product); print(widget.index);
print(widget.product);
provider.preFillFormForEdit(widget.product,widget.index);
} }
}); });
} }
...@@ -149,7 +152,7 @@ class _GeneratequotationaddeditproductState ...@@ -149,7 +152,7 @@ class _GeneratequotationaddeditproductState
) => DropdownMenuItem<Products>( ) => DropdownMenuItem<Products>(
value: ord, value: ord,
child: Text( child: Text(
"(Product Name: ${ord.name})", "${ord.name}",
style: const TextStyle( style: const TextStyle(
fontSize: 14, fontSize: 14,
), ),
...@@ -185,6 +188,7 @@ class _GeneratequotationaddeditproductState ...@@ -185,6 +188,7 @@ class _GeneratequotationaddeditproductState
value!.id!; value!.id!;
provider.selectedAddEditProductName = provider.selectedAddEditProductName =
value.name; value.name;
print(value.id.toString());
provider.crmSelectedProductDetailsApiFunction(context, value.id.toString()); provider.crmSelectedProductDetailsApiFunction(context, value.id.toString());
} }
}, },
...@@ -256,12 +260,13 @@ class _GeneratequotationaddeditproductState ...@@ -256,12 +260,13 @@ class _GeneratequotationaddeditproductState
FloatingActionButtonLocation.centerFloat, FloatingActionButtonLocation.centerFloat,
floatingActionButton: InkWell( floatingActionButton: InkWell(
onTap: () { onTap: () {
if (provider.selectedLeadProducts != null) { if (provider.selectedProducts != null) {
var newProduct; var newProduct;
if (widget.type == "add") { if (widget.type == "add") {
newProduct = LeadProducts( newProduct = LeadProducts(
id: provider.selectedAddEditLeadProductId,
productName: provider.selectedAddEditLeadProductName, productId: provider.selectedAddEditProductId,
productName: provider.selectedAddEditProductName,
price: provider.addEditProductPriceController.text, price: provider.addEditProductPriceController.text,
qty: provider.addEditQuantityController.text, qty: provider.addEditQuantityController.text,
...@@ -269,16 +274,16 @@ class _GeneratequotationaddeditproductState ...@@ -269,16 +274,16 @@ class _GeneratequotationaddeditproductState
); );
provider.leadProductsList.add(newProduct); provider.leadProductsList.add(newProduct);
provider.productRows.add({ provider.productRows.add({
"product_id": provider.selectedAddEditLeadProductId!, "product_id": provider.selectedAddEditProductId!,
"price": provider.addEditProductPriceController.text, "price": provider.addEditProductPriceController.text,
"qty": provider.addEditQuantityController.text, "qty": provider.addEditQuantityController.text,
"net_price": provider.addEditTotalAmountController.text, "net_price": provider.addEditTotalAmountController.text,
}); });
Navigator.pop(context, newProduct); Navigator.pop(context, newProduct);
} else { } else if (widget.type == "edit"){
final updatedProduct = LeadProducts( final updatedProduct = LeadProducts(
id: provider.selectedAddEditLeadProductId, productId: provider.selectedAddEditProductId,
productName: provider.selectedAddEditLeadProductName, productName: provider.selectedAddEditProductName,
price: provider.addEditProductPriceController.text, price: provider.addEditProductPriceController.text,
qty: provider.addEditQuantityController.text, qty: provider.addEditQuantityController.text,
prodTotalPrice: provider.addEditTotalAmountController.text, prodTotalPrice: provider.addEditTotalAmountController.text,
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment