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

23-07-2025 By Sai Srinivas

CRM Lead Details, Generate Quotation & Followup and Prospect List.
parent c0252747
...@@ -33,7 +33,7 @@ class _PendingTasksListState extends State<PendingTasksList> { ...@@ -33,7 +33,7 @@ class _PendingTasksListState extends State<PendingTasksList> {
WidgetsBinding.instance.addPostFrameCallback((timeStamp) { WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
var prov = Provider.of<Crmdashboardprovider>(context, listen: false); var prov = Provider.of<Crmdashboardprovider>(context, listen: false);
prov.accessPagesAPIFunction(context); prov.accessPagesAPIFunction(context);
prov.crmDashboardAPIFunction(context, "executive", "", "", ""); prov.crmDashboardAPIFunction(context);
prov.crmPendingTasksAPIFunction(context); prov.crmPendingTasksAPIFunction(context);
}); });
} }
......
...@@ -53,3 +53,4 @@ export 'package:generp/Notifiers/crmProvider/crmNearbyOpenLeadsProvider.dart'; ...@@ -53,3 +53,4 @@ export 'package:generp/Notifiers/crmProvider/crmNearbyOpenLeadsProvider.dart';
export 'package:generp/Notifiers/crmProvider/crmGenerateQuotationProvider.dart'; export 'package:generp/Notifiers/crmProvider/crmGenerateQuotationProvider.dart';
export 'package:generp/Notifiers/crmProvider/crmEditProspectAccountProvider.dart'; export 'package:generp/Notifiers/crmProvider/crmEditProspectAccountProvider.dart';
export 'package:generp/Notifiers/crmProvider/addProspectLeadsProvider.dart'; export 'package:generp/Notifiers/crmProvider/addProspectLeadsProvider.dart';
export 'package:generp/Notifiers/crmProvider/followUpUpdateProvider.dart';
...@@ -35,7 +35,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -35,7 +35,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
WidgetsBinding.instance.addPostFrameCallback((timeStamp) { WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
var prov = Provider.of<Crmdashboardprovider>(context, listen: false); var prov = Provider.of<Crmdashboardprovider>(context, listen: false);
prov.accessPagesAPIFunction(context); prov.accessPagesAPIFunction(context);
prov.crmDashboardAPIFunction(context, "executive", "", "", ""); prov.crmDashboardAPIFunction(context);
prov.crmPendingTasksAPIFunction(context); prov.crmPendingTasksAPIFunction(context);
}); });
} }
......
This diff is collapsed.
...@@ -61,6 +61,7 @@ import '../Models/UpdatePasswordResponse.dart'; ...@@ -61,6 +61,7 @@ import '../Models/UpdatePasswordResponse.dart';
import '../Models/VersionsResponse.dart'; import '../Models/VersionsResponse.dart';
import '../Models/ViewVisitDetailsResponse.dart'; import '../Models/ViewVisitDetailsResponse.dart';
import '../Models/commonModels/commonAddAccountsSubmitResponse.dart'; import '../Models/commonModels/commonAddAccountsSubmitResponse.dart';
import '../Models/crmModels/crmAddFollowUpResponse.dart';
import '../Models/crmModels/crmDashboardResponse.dart'; import '../Models/crmModels/crmDashboardResponse.dart';
import '../Models/crmModels/crmPendingTasksResponse.dart'; import '../Models/crmModels/crmPendingTasksResponse.dart';
import '../Models/crmModels/crmUniversalSearchResponse.dart'; import '../Models/crmModels/crmUniversalSearchResponse.dart';
...@@ -3319,24 +3320,18 @@ class ApiCalling { ...@@ -3319,24 +3320,18 @@ class ApiCalling {
static Future<crmDashboardResponse?> crmDashboardAPI( static Future<crmDashboardResponse?> crmDashboardAPI(
empId, empId,
session, session,
mode, emp_loc
from,
to,
teamemployee,
) async { ) async {
try { try {
Map<String, String> data = { Map<String, String> data = {
'emp_id': (empId).toString(), 'emp_id': (empId).toString(),
'session_id': (session).toString(), 'session_id': (session).toString(),
'mode': (mode).toString(), 'emp_loc':emp_loc.toString()
'from': (from).toString(),
'to': (to).toString(),
'teamemployee': (teamemployee).toString(),
}; };
final res = await post(data, crmDashboardUrl, {}); final res = await post(data, crmDashboardUrl, {});
if (res != null) { if (res != null) {
print(data); print(data);
debugPrint(res.body); print(jsonDecode(res.body)['nearby_leads']);
return crmDashboardResponse.fromJson(jsonDecode(res.body)); return crmDashboardResponse.fromJson(jsonDecode(res.body));
} else { } else {
debugPrint("Null Response"); debugPrint("Null Response");
...@@ -3412,7 +3407,7 @@ class ApiCalling { ...@@ -3412,7 +3407,7 @@ class ApiCalling {
final res = await post(data, crmLeadListViewUrl, {}); final res = await post(data, crmLeadListViewUrl, {});
if (res != null) { if (res != null) {
print(data); print(data);
debugPrint("ListView: ${res.body}"); debugPrint("ListView2: ${res.body}");
return LeadListViewResponse.fromJson(jsonDecode(res.body)); return LeadListViewResponse.fromJson(jsonDecode(res.body));
} else { } else {
debugPrint("Null Response"); debugPrint("Null Response");
...@@ -3634,6 +3629,92 @@ class ApiCalling { ...@@ -3634,6 +3629,92 @@ class ApiCalling {
} }
} }
static Future<CommonResponse?> crmLeadDetailsAddEditProductsAPI(
empId,
session,
lead_id,
type,lead_product_id,product_id,qty,amount
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'lead_id': (lead_id).toString(),
'type': (type).toString(),
'lead_product_id': (lead_product_id).toString(),
'product_id': (product_id).toString(),
'qty': (qty).toString(),
'amount': (amount).toString(),
};
final res = await post(data, crmLeadDetailsAddEditProductsUrl, {});
if (res != null) {
print("AddEditProducts $data");
debugPrint("AddEditProducts: ${res.body}");
return CommonResponse.fromJson(jsonDecode(res.body));
} else {
debugPrint("Null Response");
return null;
}
} catch (e) {
debugPrint('hello bev=bug $e ');
return null;
}
}
static Future<crmAddFollowUpResponse?> crmLeadDetailsAddFollowUpAPI(
session_id,
emp_id,
nextapp,
orderstatus,
lead_id,
followup_feedback,
followup_type,
followupintime,
loc,
competitor,
reason,
followup_status,
next_appointment_date,
appointment_type,
sms,
app_note,
) async {
try {
Map<String, String> data = {
'session_id':session_id.toString(),
'emp_id':emp_id.toString(),
'nextapp':nextapp.toString(),
'orderstatus':orderstatus.toString(),
'lead_id':lead_id.toString(),
'followup_feedback':followup_feedback.toString(),
'followup_type':followup_type.toString(),
'followupintime':followupintime.toString(),
'loc':loc.toString(),
'competitor':competitor.toString(),
'reason':reason.toString(),
'followup_status':followup_status.toString(),
'next_appointment_date':next_appointment_date.toString(),
'appointment_type':appointment_type.toString(),
'sms':sms.toString(),
'app_note':app_note.toString(),
};
final res = await post(data, crmLeadDetailsAddFollowUpUrl, {});
if (res != null) {
print("crmAddFollowUp: $data");
debugPrint("crmAddFollowUp: ${res.body}");
return crmAddFollowUpResponse.fromJson(jsonDecode(res.body));
} else {
debugPrint("Null Response");
return null;
}
} catch (e) {
debugPrint('hello bev=bug $e ');
return null;
}
}
static Future<crmLeadDetailsEditAccountViewResponse?> static Future<crmLeadDetailsEditAccountViewResponse?>
crmLeadDetailsEditAccountViewAPI(empId, session, lead_id, mode) async { crmLeadDetailsEditAccountViewAPI(empId, session, lead_id, mode) async {
try { try {
...@@ -3865,7 +3946,7 @@ class ApiCalling { ...@@ -3865,7 +3946,7 @@ class ApiCalling {
final res = await post(data, crmLeadDetailsGenerateQuotationViewUrl, {}); final res = await post(data, crmLeadDetailsGenerateQuotationViewUrl, {});
if (res != null) { if (res != null) {
print(data); print(data);
debugPrint("ListView: ${res.body}"); debugPrint("ListView1: ${res.body}");
return crmLeadDetailsGenerateQuotationViewResponse.fromJson( return crmLeadDetailsGenerateQuotationViewResponse.fromJson(
jsonDecode(res.body), jsonDecode(res.body),
); );
...@@ -3915,7 +3996,7 @@ class ApiCalling { ...@@ -3915,7 +3996,7 @@ class ApiCalling {
{}, {},
); );
if (res != null) { if (res != null) {
print("Filter:${data}"); print("Filter: ${data}");
debugPrint(res.body); debugPrint(res.body);
return crmLeadDetailsGenerateQuotationSubmitResponse.fromJson( return crmLeadDetailsGenerateQuotationSubmitResponse.fromJson(
jsonDecode(res.body), jsonDecode(res.body),
...@@ -3944,7 +4025,7 @@ class ApiCalling { ...@@ -3944,7 +4025,7 @@ class ApiCalling {
final res = await post(data, crmProspectListViewUrl, {}); final res = await post(data, crmProspectListViewUrl, {});
if (res != null) { if (res != null) {
print(data); print(data);
debugPrint("ListView: ${res.body}"); debugPrint("ListView3: ${res.body}");
return ProspectListViewResponse.fromJson(jsonDecode(res.body)); return ProspectListViewResponse.fromJson(jsonDecode(res.body));
} else { } else {
debugPrint("Null Response"); debugPrint("Null Response");
......
...@@ -137,6 +137,8 @@ const crmLeadListDistrictOnStateUrl = "${baseUrl_test}get_district_on_state"; ...@@ -137,6 +137,8 @@ const crmLeadListDistrictOnStateUrl = "${baseUrl_test}get_district_on_state";
const crmLeadListSubLocOnDistrictUrl = "${baseUrl_test}get_sublocation_on_district"; const crmLeadListSubLocOnDistrictUrl = "${baseUrl_test}get_sublocation_on_district";
const crmLeadListContactPopUpUrl = "${baseUrl_test}crm_lead_list_contact_popup"; const crmLeadListContactPopUpUrl = "${baseUrl_test}crm_lead_list_contact_popup";
const crmLeadDetailsUrl = "${baseUrl_test}crm_lead_details"; const crmLeadDetailsUrl = "${baseUrl_test}crm_lead_details";
const crmLeadDetailsAddEditProductsUrl = "${baseUrl_test}crm_lead_details_add_edit_product";
const crmLeadDetailsAddFollowUpUrl = "${baseUrl_test}crm_lead_details_add_followup";
const crmLeadDetailsEditAccountViewUrl = "${baseUrl_test}crm_lead_details_edit_account_view"; const crmLeadDetailsEditAccountViewUrl = "${baseUrl_test}crm_lead_details_edit_account_view";
const crmLeadDetailsEditProductsUrl = "${baseUrl_test}crm_lead_details_edit_products"; const crmLeadDetailsEditProductsUrl = "${baseUrl_test}crm_lead_details_edit_products";
const crmLeadDetailsEditProductsViewUrl = "${baseUrl_test}crm_lead_details_edit_products_view"; const crmLeadDetailsEditProductsViewUrl = "${baseUrl_test}crm_lead_details_edit_products_view";
......
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