CHANGE_TICKET_FLOW

This commit is contained in:
venbaittech 2025-08-21 14:36:28 +05:30
parent 3d6e9656b4
commit 925e6e7624
6 changed files with 419 additions and 300 deletions

36
ation - Inprogress Normal file
View File

@ -0,0 +1,36 @@
SSUUMMMMAARRYY OOFF LLEESSSS CCOOMMMMAANNDDSS
Commands marked with * may be preceded by a number, _N.
Notes in parentheses indicate the behavior if _N is given.
A key preceded by a caret indicates the Ctrl key; thus ^K is ctrl-K.
h H Display this help.
q :q Q :Q ZZ Exit.
---------------------------------------------------------------------------
MMOOVVIINNGG
e ^E j ^N CR * Forward one line (or _N lines).
y ^Y k ^K ^P * Backward one line (or _N lines).
f ^F ^V SPACE * Forward one window (or _N lines).
b ^B ESC-v * Backward one window (or _N lines).
z * Forward one window (and set window to _N).
w * Backward one window (and set window to _N).
ESC-SPACE * Forward one window, but don't stop at end-of-file.
d ^D * Forward one half-window (and set half-window to _N).
u ^U * Backward one half-window (and set half-window to _N).
ESC-) RightArrow * Right one half screen width (or _N positions).
ESC-( LeftArrow * Left one half screen width (or _N positions).
ESC-} ^RightArrow Right to last column displayed.
ESC-{ ^LeftArrow Left to first column.
F Forward forever; like "tail -f".
ESC-F Like F but stop when search pattern is found.
r ^R ^L Repaint screen.
R Repaint screen, discarding buffered input.
---------------------------------------------------
Default "window" is the screen height.
Default "half-window" is half of the screen height.
---------------------------------------------------------------------------
SSEEAARRCCHHIINNGG

View File

@ -34,6 +34,7 @@ class _claimtracklistformState extends State<claimtracklist> {
dynamic policyDataIsEmpty = 1; dynamic policyDataIsEmpty = 1;
dynamic policyHeading; dynamic policyHeading;
dynamic policyName; dynamic policyName;
dynamic name;
dynamic policyType; dynamic policyType;
dynamic policyTickID; dynamic policyTickID;
dynamic policyDate; dynamic policyDate;
@ -188,6 +189,7 @@ class _claimtracklistformState extends State<claimtracklist> {
print(claimTrackMasterList[0]['thz_id']); print(claimTrackMasterList[0]['thz_id']);
policyTickID = claimTrackMasterList[0]['thz_id']; policyTickID = claimTrackMasterList[0]['thz_id'];
policyName = claimTrackMasterList[0]['policy_no']; policyName = claimTrackMasterList[0]['policy_no'];
// name = claimTrackMasterList[0]['name'];
policyType = claimTrackMasterList[0]['ticket_type']; policyType = claimTrackMasterList[0]['ticket_type'];
policyStatus = claimTrackMasterList[0]['status']; policyStatus = claimTrackMasterList[0]['status'];
member = claimTrackMasterList[0]['assignee_name']; member = claimTrackMasterList[0]['assignee_name'];
@ -305,8 +307,15 @@ class _claimtracklistformState extends State<claimtracklist> {
flex: 1, flex: 1,
child: InkWell( child: InkWell(
onTap: () { onTap: () {
// Navigator.pushNamed(
// context, 'claims');
Navigator.pushNamed( Navigator.pushNamed(
context, 'claims'); context,
'help',
arguments: {
'ticketTabSelected': 0
},
);
}, },
child: Icon( child: Icon(
Icons Icons
@ -325,7 +334,7 @@ class _claimtracklistformState extends State<claimtracklist> {
: MainAxisAlignment.start, : MainAxisAlignment.start,
children: [ children: [
Text( Text(
policyName ?? '', policyType ?? '',
textAlign: TextAlign.start, textAlign: TextAlign.start,
style: GoogleFonts.poppins( style: GoogleFonts.poppins(
fontSize: fontSize:
@ -441,6 +450,8 @@ class _claimtracklistformState extends State<claimtracklist> {
dynamic messagername; dynamic messagername;
messagername = messagername =
message['notes_by']; message['notes_by'];
dynamic name;
name = message['name'];
// if (isUserMessage) { // if (isUserMessage) {
// messagername = empName; // messagername = empName;
// } else { // } else {
@ -511,7 +522,7 @@ class _claimtracklistformState extends State<claimtracklist> {
SizedBox( SizedBox(
width: 5), width: 5),
Text( Text(
messagername, name,
style: GoogleFonts style: GoogleFonts
.poppins( .poppins(
fontSize: fontSize:
@ -601,7 +612,7 @@ class _claimtracklistformState extends State<claimtracklist> {
Responsive.isDesktop( Responsive.isDesktop(
context) context)
? 2 ? 2
: 3, : 4,
child: Container( child: Container(
alignment: Alignment alignment: Alignment
.centerRight, .centerRight,
@ -634,13 +645,6 @@ class _claimtracklistformState extends State<claimtracklist> {
formData); formData);
} }
}, },
child: Text(
'Reply',
style: GoogleFonts
.poppins(
color: Colors
.white),
),
style: ElevatedButton style: ElevatedButton
.styleFrom( .styleFrom(
backgroundColor: backgroundColor:
@ -654,6 +658,13 @@ class _claimtracklistformState extends State<claimtracklist> {
5), 5),
), ),
), ),
child: Text(
'Reply',
style: GoogleFonts
.poppins(
color: Colors
.white),
),
), ),
), ),
), ),
@ -749,15 +760,17 @@ class _claimtracklistformState extends State<claimtracklist> {
Widget buildDesktopLayout(BuildContext context) { Widget buildDesktopLayout(BuildContext context) {
return Column( return Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Row( Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
buildExpandedColumn(context, 'Policy No', policyTickID), buildExpandedColumn(context, 'Ticket No', policyTickID),
buildExpandedColumn(context, 'Policy Name', policyName), if (policyType != "Sales")
buildExpandedColumn(context, 'Ticket Type', policyType), buildExpandedColumn(context, 'Policy No', policyName),
// buildExpandedColumn(context, 'Ticket Type', policyType),
buildExpandedColumn(context, 'Status', policyStatus), buildExpandedColumn(context, 'Status', policyStatus),
buildExpandedColumn(context, 'Assign To', member), buildExpandedColumn(context, 'Message', policyMessage),
], ],
), ),
if (departmentID == '4') // Conditional check for policy_type if (departmentID == '4') // Conditional check for policy_type
@ -808,24 +821,28 @@ class _claimtracklistformState extends State<claimtracklist> {
Row( Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
buildExpandedColumn(context, 'Policy No', policyTickID), buildExpandedColumn(context, 'Ticket No', policyTickID),
buildExpandedColumn(context, 'Policy Name', policyName), if (policyType != "Sales")
buildExpandedColumn(context, 'Policy No', policyName),
if (policyType == "Sales")
buildExpandedColumn(context, 'Status', policyStatus),
], ],
), ),
SizedBox(height: 20), SizedBox(height: 20),
if (policyType != "Sales")
Row( Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
buildExpandedColumn(context, 'Status', policyStatus), buildExpandedColumn(context, 'Status', policyStatus),
buildExpandedColumn(context, 'Ticket Type', policyType), // buildExpandedColumn(context, 'Ticket Type', policyType),
], ],
), ),
SizedBox(height: 20), if (policyType != "Sales") SizedBox(height: 20),
Row( Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
buildExpandedColumn(context, 'Subject', policySubject), buildExpandedColumn(context, 'Subject', policySubject),
buildExpandedColumn(context, 'Assigned To', member), buildExpandedColumn(context, 'Message', policyMessage),
], ],
), ),
if (departmentID == '4') if (departmentID == '4')

View File

@ -75,6 +75,29 @@ class _helpState extends State<help> {
super.initState(); super.initState();
apiService = ApiService(context); // Initialize ApiService here apiService = ApiService(context); // Initialize ApiService here
_loadToken(); _loadToken();
print('initState');
getTicketList();
// handleTicketRefrsh();
}
void handleTicketRefrsh() {
print('handleTicketRefrsh');
final args =
ModalRoute.of(context)?.settings.arguments as Map<String, dynamic>?;
if (args != null && args.containsKey('ticketTabSelected')) {
print('ARGSDATA');
setState(() {
tickets = args['ticketTabSelected']; // e.g. 0 from TicketForm
closedTrackActive = 1;
allClaimsActive = 1;
tickets = 0;
ticketsActive = 0;
isActive = false;
getTicketList();
});
}
} }
@override @override
@ -85,21 +108,29 @@ class _helpState extends State<help> {
@override @override
void didChangeDependencies() { void didChangeDependencies() {
super.didChangeDependencies(); super.didChangeDependencies();
print('didChangeDependencies');
if (!_isArgsHandled) { // if (!_isArgsHandled) {
final args = ModalRoute.of(context)?.settings.arguments as Map<String, dynamic>?; final args =
ModalRoute.of(context)?.settings.arguments as Map<String, dynamic>?;
print('args - $args');
if (args != null && args.containsKey('ticketTabSelected')) { if (args != null && args.containsKey('ticketTabSelected')) {
print('args1');
setState(() { setState(() {
tickets = args['ticketTabSelected']; // e.g. 0 from TicketForm tickets = args['ticketTabSelected']; // e.g. 0 from TicketForm
print('args2- $tickets');
closedTrackActive = 1; closedTrackActive = 1;
allClaimsActive = 1; allClaimsActive = 1;
tickets = 0;
ticketsActive = 0;
isActive = false; isActive = false;
if (tickets == 0) getTicketList();
}); });
} }
_isArgsHandled = true; // only apply once // _isArgsHandled = true; // only apply once
} // }
} }
Future<void> _loadToken() async { Future<void> _loadToken() async {
@ -122,6 +153,7 @@ class _helpState extends State<help> {
print(client_id); print(client_id);
getSelfEmployeeProfile(); getSelfEmployeeProfile();
getTrackClaimsList(); getTrackClaimsList();
getTicketList();
} else { } else {
// Token is empty or null, handle accordingly (e.g., navigate to login screen) // Token is empty or null, handle accordingly (e.g., navigate to login screen)
ToastHelper.showErrorToast(context, 'Session Out'); ToastHelper.showErrorToast(context, 'Session Out');
@ -637,6 +669,7 @@ class _helpState extends State<help> {
ticketsActive = 0; ticketsActive = 0;
allClaimsActive = 1; allClaimsActive = 1;
closedTrackActive = 1; closedTrackActive = 1;
tickets = 0;
// isActive = false; // isActive = false;
// allClaimsActive = 1; // allClaimsActive = 1;
// closedTrackActive = 1; // closedTrackActive = 1;

View File

@ -111,10 +111,10 @@ class ApiService {
await _initializeToken(); await _initializeToken();
} }
final url2 = final url =
Uri.parse('${Environment.apiUrl}ticketList?mobile=$empMobileNo'); Uri.parse('${Environment.apiUrl}ticketList?mobile=$empMobileNo');
final url = Uri.parse('${Environment.apiUrl}ticketList?mobile=1234567890'); final url1 = Uri.parse('${Environment.apiUrl}ticketList?mobile=1234567890');
final headers = { final headers = {
'Authorization': 'Bearer $_token' ?? '', 'Authorization': 'Bearer $_token' ?? '',
}; };

View File

@ -191,9 +191,7 @@ class _ticketsState extends State<tickets> {
} }
}); });
if (isServiceValid && if (isServiceValid && isPolicyValid && isSubjectValid && isMessageValid) {
isPolicyValid &&
isSubjectValid && isMessageValid) {
// Proceed to submit // Proceed to submit
} else { } else {
ToastHelper.showErrorToast(context, 'Please Fill Required Fields'); ToastHelper.showErrorToast(context, 'Please Fill Required Fields');
@ -215,7 +213,8 @@ class _ticketsState extends State<tickets> {
'email': decodedToken['email_corporate'] != null 'email': decodedToken['email_corporate'] != null
? decodedToken['email_corporate'] ? decodedToken['email_corporate']
: '', : '',
'empcode': decodedToken['emp_code'] != null ? decodedToken['emp_code'] : '', 'empcode':
decodedToken['emp_code'] != null ? decodedToken['emp_code'] : '',
'message': messageController.text, 'message': messageController.text,
'mobile': decodedToken['mobile'] != null ? decodedToken['mobile'] : '', 'mobile': decodedToken['mobile'] != null ? decodedToken['mobile'] : '',
'name': decodedToken['name'] != null ? decodedToken['name'] : '', 'name': decodedToken['name'] != null ? decodedToken['name'] : '',
@ -250,7 +249,7 @@ class _ticketsState extends State<tickets> {
setState(() { setState(() {
isLoading = false; isLoading = false;
}); });
Navigator.pushNamed(context, 'help'); // Navigator.pushNamed(context, 'help');
Navigator.pushNamed( Navigator.pushNamed(
context, context,
'help', 'help',
@ -405,19 +404,31 @@ class _ticketsState extends State<tickets> {
child: Column( child: Column(
children: [ children: [
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment:
CrossAxisAlignment
.start,
children: [ children: [
buildDropdownField<
buildDropdownField<int>( int>(
'Service', 'Type',
(value) { (value) {
setState(() { setState(() {
serviceId = value; serviceId =
selectedServiceName = serviceList.firstWhere( value;
(serList) => serList['id'] == value, selectedServiceName =
orElse: () => {'name': ''}, serviceList
.firstWhere(
(serList) =>
serList[
'id'] ==
value,
orElse: () =>
{
'name': ''
},
)['name']; )['name'];
isServiceValid = true; isServiceValid =
true;
}); });
}, },
false, false,
@ -427,52 +438,74 @@ class _ticketsState extends State<tickets> {
valueKey: 'id', valueKey: 'id',
), ),
if (!isServiceValid) if (!isServiceValid)
Text('Please select a Service', Text(
style: TextStyle(color: Colors.red)), 'Please select a Service',
style: TextStyle(
color: Colors
.red)),
], ],
), ),
SizedBox(height: 15), SizedBox(height: 15),
if (selectedServiceName != "Sales") if (selectedServiceName !=
"Sales")
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment:
CrossAxisAlignment
.start,
children: [ children: [
buildDropdownField<
buildDropdownField<String>( String>(
'Policy Number', 'Policy Number',
(value) { (value) {
setState(() { setState(() {
policyNumberId = value; policyNumberId =
isPolicyValid = true; value;
isPolicyValid =
true;
}); });
}, },
false, false,
policyList, policyList,
'policy_no', 'policy_no',
policyNumberId, policyNumberId,
valueKey: 'policy_no', valueKey:
'policy_no',
), ),
if (!isPolicyValid) if (!isPolicyValid)
Text('Please select a policy', Text(
style: TextStyle(color: Colors.red)), 'Please select a policy',
style: TextStyle(
color: Colors
.red)),
], ],
), ),
SizedBox(height: 15), SizedBox(height: 15),
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment:
CrossAxisAlignment
.start,
children: [ children: [
buildTextField('Subject', buildTextField(
'Subject',
subjectController), subjectController),
if (!isSubjectValid) if (!isSubjectValid)
Text('Please enter the Subject', style: TextStyle(color: Colors.red)), Text(
SizedBox(height: 15), 'Please enter the Subject',
style: TextStyle(
color: Colors
.red)),
SizedBox(
height: 15),
buildTextAreaField( buildTextAreaField(
'Message', 'Message',
messageController), messageController),
if (!isMessageValid) if (!isMessageValid)
Text('Please enter the Message', style: TextStyle(color: Colors.red)), Text(
] 'Please enter the Message',
), style: TextStyle(
color: Colors
.red)),
]),
], ],
), ),
), ),

View File

@ -27,7 +27,7 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
FLTFirebaseMessagingPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseMessagingPlugin")) FLTFirebaseMessagingPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseMessagingPlugin"))
InAppWebViewFlutterPlugin.register(with: registry.registrar(forPlugin: "InAppWebViewFlutterPlugin")) InAppWebViewFlutterPlugin.register(with: registry.registrar(forPlugin: "InAppWebViewFlutterPlugin"))
FLTGoogleSignInPlugin.register(with: registry.registrar(forPlugin: "FLTGoogleSignInPlugin")) FLTGoogleSignInPlugin.register(with: registry.registrar(forPlugin: "FLTGoogleSignInPlugin"))
FLALocalAuthPlugin.register(with: registry.registrar(forPlugin: "FLALocalAuthPlugin")) LocalAuthPlugin.register(with: registry.registrar(forPlugin: "LocalAuthPlugin"))
FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin")) FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))