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

View File

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

View File

@ -111,10 +111,10 @@ class ApiService {
await _initializeToken();
}
final url2 =
final url =
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 = {
'Authorization': 'Bearer $_token' ?? '',
};

View File

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