visa order

This commit is contained in:
string 2025-05-17 20:01:47 +05:30
parent 0de40a6d6d
commit 6ed78bc5f4
14 changed files with 1174 additions and 13 deletions

View File

@ -8,16 +8,20 @@ import { Forgotresetpassword1Component } from './forgotresetpassword1/forgotrese
import { LoginPageComponent } from './login-page/login-page.component';
import { EmailverificationComponent } from './emailverification/emailverification.component';
import { AboutWorkComponent } from './about-work/about-work.component';
import { Visa_applicationComponent } from '../main/BuilderComponents/vpspack/Visa_application/Visa_application.component';
import { EditstepperTfComponent } from '../main/fnd/Visa_application/VisaOrderWorkflow/editstepperTf.component';
const routes: Routes = [
{ path: 'login', component: LoginPageComponent },
{path: 'forgotpass', component:ForgotpasswordComponent},
{path:'forgotresetpassword/:id', component:ForgotresetpasswordComponent},
{path:'adduser/:id', component:Forgotresetpassword1Component},
{path:'addguest/:id', component:AddguestComponent},
{ path: 'forgotpass', component: ForgotpasswordComponent },
{ path: 'forgotresetpassword/:id', component: ForgotresetpasswordComponent },
{ path: 'adduser/:id', component: Forgotresetpassword1Component },
{ path: 'addguest/:id', component: AddguestComponent },
{ path: 'visaOrder', component: EditstepperTfComponent },
{ path: 'email-verification', component: EmailverificationComponent },
{path: 'about-work', component:AboutWorkComponent},
{ path: 'about-work', component: AboutWorkComponent },
];
@NgModule({

View File

@ -130,6 +130,11 @@ export class TreeNodeComponent implements OnInit, OnDestroy, AfterViewInit {
type: 'Footer',
description: 'Bottom site footer',
content: 'Contact information, links, and copyright details.'
},
{
type: 'visa application section',
description: 'Visa Application',
content: 'Visa Order.'
}
];

View File

@ -1746,6 +1746,28 @@ body {
background-color: #111;
color: #fff;
}
.visa-order-btn-section {
padding: 60px 20px;
text-align: center;
background-color: #f9f9f9;
}
.visa-order-btn {
padding: 12px 28px;
font-size: 15px;
font-weight: 600;
color: #fff;
background-color: #0072f5;
border: none;
border-radius: 6px;
cursor: pointer;
transition: background-color 0.3s ease;
box-shadow: 0 4px 8px rgba(0, 114, 245, 0.2);
}
.visa-order-btn:hover {
background-color: #005fcc;
}
`;

View File

@ -1745,6 +1745,28 @@ body {
background-color: #111;
color: #fff;
}
.visa-order-btn-section {
padding: 60px 20px;
text-align: center;
background-color: #f9f9f9;
}
.visa-order-btn {
padding: 12px 28px;
font-size: 15px;
font-weight: 600;
color: #fff;
background-color: #0072f5;
border: none;
border-radius: 6px;
cursor: pointer;
transition: background-color 0.3s ease;
box-shadow: 0 4px 8px rgba(0, 114, 245, 0.2);
}
.visa-order-btn:hover {
background-color: #005fcc;
}
`;

View File

@ -385,13 +385,13 @@ HTML Only. No CSS.
return resolve(this.promptHashCache[hash]);
}
const enhanced = await this.callLlm(enhancedPrompt);
// const enhanced = await this.callLlm(enhancedPrompt);
console.log('enhanced prmpt ',enhanced);
this.promptHashCache[hash] = enhanced;
// console.log('enhanced prmpt ',enhanced);
// this.promptHashCache[hash] = enhanced;
// resolve(baseJsonString);
resolve(this.promptHashCache[hash]);
resolve(baseJsonString);
// resolve(this.promptHashCache[hash]);
} catch (err) {
console.error('❌ JSON parse error:', err);
resolve('{}');
@ -594,11 +594,13 @@ HTML Only. No CSS.
const html = section.FullPage?.toString() || '';
pageHtmlMap[pageName] = html;
}
console.log('name nad pages ', this.sitename ,' and ',pageHtmlMap )
this.siteTreeService.createHtmlfile(this.sitename, pageHtmlMap).subscribe(
(data) => {
console.log(data);
console.log('after create file ', data);
if (data || data.status >= 200 && data.status <= 299) {
this.toastr.success("file Created");
this.toastr.success("File Created");
}
// setTimeout(() => {
// this.ngOnInit();

View File

@ -0,0 +1,90 @@
import { Injectable } from '@angular/core';
import { delay, Observable, of } from "rxjs";
import { HttpClient, HttpHeaders, HttpParams, } from "@angular/common/http";
import { ApiRequestService } from "src/app/services/api/api-request.service";
import { environment } from 'src/environments/environment';
@Injectable({
providedIn: 'root'
})
export class Visa_applicationTfservice {
private baseURL = "token/Visa_application/Visa_application"; constructor(
private http: HttpClient,
private apiRequest: ApiRequestService,
) { }
getAll(page?: number, size?: number): Observable<any> {
return this.apiRequest.get(this.baseURL);
}
getById(id: number): Observable<any> {
const _http = this.baseURL + "/" + id;
return this.apiRequest.get(_http);
}
create(data: any): Observable<any> {
return this.apiRequest.post(this.baseURL, data);
}
update(id: number, data: any): Observable<any> {
const _http = this.baseURL + "/" + id;
return this.apiRequest.put(_http, data);
}
delete(id: number): Observable<any> {
const _http = this.baseURL + "/" + id;
return this.apiRequest.delete(_http);
}
getAllvisa_entry_type(): Observable<any> {
return this.apiRequest.get("token/Visa_entry_ListFilter1/Visa_entry_ListFilter1");
}
getAllvisa_duration(): Observable<any> {
return this.apiRequest.get("token/Visa_duration_ListFilter1/Visa_duration_ListFilter1");
}
getAllvisa_processing(): Observable<any> {
return this.apiRequest.get("token/Visa_processing_ListFilter1/Visa_processing_ListFilter1");
}
getAllgender(): Observable<any> {
return this.apiRequest.get("token/Gender_ListFilter1/Gender_ListFilter1");
}
getAllreferrer(): Observable<any> {
return this.apiRequest.get("token/Referrer_ListFilter1/Referrer_ListFilter1");
}
getAllnationality(): Observable<any> {
return this.apiRequest.get("token/Nationality_ListFilter1/Nationality_ListFilter1");
}
getAllsupplier(): Observable<any> {
return this.apiRequest.get("token/Supplier_ListFilter1/Supplier_ListFilter1");
}
getAllagent(): Observable<any> {
return this.apiRequest.get("token/Agent_ListFilter1/Agent_ListFilter1");
}
uploadDocument(ref: any, Forma: any, file: any): Observable<any> {
const formData = new FormData();
formData.append('file', file);
return this.apiRequest.postFormData(`FileUpload/Uploadeddocs/${ref}/${Forma}`, formData);
}
uploadfilegetByIdfileupload_field(ref: any, Forma: any,): Observable<any> {
return this.apiRequest.get(`FileUpload/Uploadeddocs/${ref}/${Forma}`);
}
uploadfiledeletefileupload_field(id: number): Observable<any> {
return this.apiRequest.delete(`FileUpload/Uploadeddocs/${id}`);
}
finalizeOrder(id: string) {
// return this.http.post(`/api/customer/${id}/finalize`, {});
return of({ success: true }).pipe(delay(1000));
}
// updateaction
}

View File

@ -0,0 +1,52 @@
.horizontal {
width: 25%;
padding: 5px;
}
.horizontal1 {
width: 50%;
padding: 10px;
}
.middle {
width: 33%;
padding: 10px;
}
.middle1 {
width: 75%;
padding: 10px;
}
.full {
width: 100%;
padding: 10px;
}
input[type=text], [type=date], select {
width: 100%;
padding: 12px 20px;
margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
}
.required-field {
color: red;
}
.center {
text-align: center;
}
.center {
color: blue;
}
@media (max-width: 600px) {
.horizontal, .middle, .horizontal1, .middle1 {
width: 100%;
}
}/*# sourceMappingURL=editstepper.component.css.map */

View File

@ -0,0 +1 @@
{"version":3,"sources":["editstepper.component.scss","editstepper.component.css"],"names":[],"mappings":"AAAA;EACE,UAAA;EACA,YAAA;ACCF;;ADCA;EACE,UAAA;EACA,aAAA;ACEF;;ADAA;EACE,UAAA;EACA,aAAA;ACGF;;ADDA;EACE,UAAA;EACA,aAAA;ACIF;;ADDA;EACE,WAAA;EACA,aAAA;ACIF;;ADDA;EACE,WAAA;EACA,kBAAA;EACA,aAAA;EACA,qBAAA;EACA,sBAAA;EACA,kBAAA;EACA,sBAAA;ACIF;;ADFA;EACE,UAAA;ACKF;;ADHA;EACE,kBAAA;ACMF;;ADHA;EACE,WAAA;ACMF;;ADJA;EACA;IACA,WAAA;ECOE;AACF","file":"editstepper.component.css"}

View File

@ -0,0 +1,418 @@
<ol class="breadcrumb breadcrumb-arrow font-trirong">
<li><a href="javascript://" [routerLink]="['/']">Home</a></li>
<li><a href="javascript://">stepper</a></li>
</ol>
<div class="button-bar">
<span class="spacer"></span>
<button class="btn btn-sm btn-primary" (click)="reset()">Reset</button>
<button class="btn btn-sm btn-primary" (click)="changeToHorizonTal()"
*ngIf="layout.direction === 'vertical'">HorizonTal Layout</button>
<button class="btn btn-sm btn-primary" (click)="changeToVertical()" *ngIf="layout.direction === 'horizontal'">Vertical
Layout</button>
</div>
<div class="clr-row">
<div [class]="layout.block1">
<div class="card">
<div class="card-header">
<h3 style="text-align: center;"> Customer Information</h3>
</div>
<div class=" card-block container">
<clr-timeline [clrLayout]="layout.direction">
<clr-timeline-step [clrState]="timelineStyle.step0.state">
<clr-timeline-step-header>Step 0</clr-timeline-step-header>
<clr-timeline-step-title> <span *ngIf="!appToUpdate">Application</span><span *ngIf="appToUpdate"> Update
Datagrid</span> </clr-timeline-step-title>
<clr-timeline-step-description> <span>Create/Add Customer Information<br> Information Of
Customer</span></clr-timeline-step-description>
</clr-timeline-step>
<clr-timeline-step [clrState]="timelineStyle.step1.state">
<clr-timeline-step-header>Step 1</clr-timeline-step-header>
<clr-timeline-step-title>Document Upload</clr-timeline-step-title>
<clr-timeline-step-description> <span>Upload Your <br>
Document.</span></clr-timeline-step-description>
</clr-timeline-step>
<clr-timeline-step [clrState]="timelineStyle.step2.state">
<clr-timeline-step-header>Step 2</clr-timeline-step-header>
<clr-timeline-step-title>Review And <br>Confirmation</clr-timeline-step-title>
<clr-timeline-step-description>
Finish .
</clr-timeline-step-description>
</clr-timeline-step>
</clr-timeline>
</div>
</div>
</div>
<div [class]="layout.block2">
<!--STEP 0-->
<div class="card" *ngIf="timelineStyle.step0.open">
<div class="card-header">
<h3 style="text-align: center;" *ngIf="!appToUpdate">Customer Information Form</h3>
<h3 style="text-align: center;" *ngIf="appToUpdate"> Update {{entryForm.name}}</h3>
<div class="container">
<br />
<!-- entry form-->
<!-- <form #contactForm="ngForm" (ngSubmit)="onSave()"> -->
<form [formGroup]="entryForm">
<div class="container">
<div class="clr-row">
<div class="clr-col-sm-12">
<label> Name</label>
<input class="clr-input" type="text" formControlName="name" />
</div>
<div class="clr-col-sm-12">
<label> Description</label>
<textarea cols="10" rows="2" formControlName="description" placeholder="Textarea"> </textarea>
</div>
<div class="clr-col-sm-12">
<label> Active</label>
<input type="checkbox" formControlName="active" clrToggle />
</div>
<div class="clr-col-sm-12">
<label> Visa Entry Type</label>
<select formControlName="visa_entry_type">
<option [value]="null">Choose Visa Entry Type</option>
<option *ngFor="let item of selectvisa_entry_type" [value]="item.id">{{item.name}}</option>
</select>
</div>
<div class="clr-col-sm-12">
<label> Visa Duration</label>
<select formControlName="visa_duration">
<option [value]="null">Choose Visa Duration</option>
<option *ngFor="let item of selectvisa_duration" [value]="item.id">{{item.name}}</option>
</select>
</div>
<div class="clr-col-sm-12">
<label> Visa Processing</label>
<select formControlName="visa_processing">
<option [value]="null">Choose Visa Processing</option>
<option *ngFor="let item of selectvisa_processing" [value]="item.id">{{item.name}}</option>
</select>
</div>
<div class="clr-col-sm-12">
<label> Travel start date</label>
<input class="clr-input" type="date" formControlName="travel_start_date" />
</div>
<div class="clr-col-sm-12">
<label> Travel end date</label>
<input class="clr-input" type="date" formControlName="travel_end_date" />
</div>
<div class="clr-col-sm-12">
<label> passport Number</label>
<input class="clr-input" type="number" formControlName="passport_number" />
<div *ngIf="submitted && entryForm.controls.passport_number.errors" class="error_mess">
<div *ngIf="submitted && entryForm.controls.passport_number.errors.required" class="error_mess">
*This field
is Required</div>
</div>
</div>
<div class="clr-col-sm-12">
<label> Passport issue date</label>
<input class="clr-input" type="date" formControlName="passport_issue_date" />
</div>
<div class="clr-col-sm-12">
<label> Passport expiry date</label>
<input class="clr-input" type="date" formControlName="passport_expiry_date" />
</div>
<div class="clr-col-sm-12">
<label> Email</label>
<input class="clr-input" type="email" formControlName="email"
pattern="[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$">
<div *ngIf="entryForm.controls['email'].errors" class="error_mess">
<div *ngIf="entryForm.controls['email'].hasError('pattern')" class="error_mess">* Email must be a
valid
email address
</div>
</div>
</div>
<div class="clr-col-sm-12">
<label> Phone Number</label>
<input class="clr-input" type="text" formControlName="phone_number"
pattern="((\+)?([1-9]{2}))?[1-9]{1}[0-9]{9}$" />
<div *ngIf="submitted && entryForm.controls['phone_number'].errors" class="error_mess">
<div *ngIf="submitted && entryForm.controls['phone_number'].hasError('pattern')" class="error_mess">
* Please
Follow your pattern,+91 Enter 10 digit Mobile Number.
</div>
</div>
</div>
<div class="clr-col-sm-12">
<label> Birth Place</label>
<input class="clr-input" type="text" formControlName="birth_place" />
</div>
<div class="clr-col-sm-12">
<label> Date of Birth</label>
<input class="clr-input" type="date" formControlName="date_of_birth" />
</div>
<div class="clr-col-sm-12">
<label> Gender</label>
<select formControlName="gender">
<option [value]="null">Choose Gender</option>
<option *ngFor="let item of selectgender" [value]="item.id">{{item.name}}</option>
</select>
</div>
<div class="clr-col-sm-12">
<label> Profession</label>
<input class="clr-input" type="text" formControlName="profession" />
</div>
<!-- currency field start -->
<div class="clr-col-sm-12">
<label> Visa cost</label>
<input type="number" class="clr-input" formControlName="visa_cost"
[value]="entryForm.value.visa_cost | number:'1.2-2' | removeCommas">
</div>
<!-- currency field end -->
<div class="clr-col-sm-12">
<label> Referrer</label>
<select formControlName="referrer">
<option [value]="null">Choose Referrer</option>
<option *ngFor="let item of selectreferrer" [value]="item.id">{{item.name}}</option>
</select>
</div>
<div class="clr-col-sm-12">
<label> Nationality</label>
<select formControlName="nationality">
<option [value]="null">Choose Nationality</option>
<option *ngFor="let item of selectnationality" [value]="item.id">{{item.name}}</option>
</select>
</div>
<div class="clr-col-sm-12">
<label> Supplier</label>
<select formControlName="supplier">
<option [value]="null">Choose Supplier</option>
<option *ngFor="let item of selectsupplier" [value]="item.id">{{item.name}}</option>
</select>
</div>
<div class="clr-col-sm-12">
<label> Agent</label>
<select formControlName="agent">
<option [value]="null">Choose Agent</option>
<option *ngFor="let item of selectagent" [value]="item.id">{{item.name}}</option>
</select>
</div>
</div>
<div class="clr-row">
</div>
<!-- end row -->
<br>
<div class="button">
<button type="submit" class="btn btn-primary" (click)="onSave()">Submit</button>
<button type="button" class="btn btn-primary"
(click)="this.timelineStyle.step0 ={ state: 'success', open: false };this.timelineStyle.step1 ={ state: 'current', open: true }; this.current()">Complete</button>
<button type="button" class="btn btn-primary"
(click)=" this.timelineStyle.step0 ={state:'current',open:false};this.timelineStyle.step1 ={state:'not-started',open:true}">Next</button>
</div>
</div>
</form>
</div>
</div>
</div>
<!--STEP 1-->
<div class="card" *ngIf="timelineStyle.step1.open">
<div class="card-header">
<h3 style="text-align: center;" *ngIf="!appToUpdate">File Upload</h3>
<div class="container">
<!-- File upload form -->
<form (ngSubmit)="onFileUpload()" #uploadForm="ngForm" enctype="multipart/form-data">
<!-- <div class="clr-row">
<div class="clr-col-12">
<label for="fileInput">Choose File<span class="required-field">*</span></label>
<input type="file" id="fileInput" (change)="onFileSelected($event)" required class="form-control">
</div>
</div>
<div class="clr-row" *ngIf="selectedFile">
<div class="clr-col-12 mt-2">
<strong>Selected File:</strong> {{ selectedFile.name }}
</div>
</div> -->
<h6> List of Uploaded file</h6>
<div class="clr-row" style="margin-top: 10px;">
<table class="table">
<thead>
<tr>
<th>No</th>
<th> File</th>
<th>File Name</th>
<th>Preview</th>
<th>Cancel</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let attach of FileDatafileupload_field; let i=index">
<td style="width: 70px;"><input type="text" class="clr-input" value={{i+1}} [readonly]="true"> </td>
<td><input type="file" (change)="onFileChangedfileupload_field($event, i)"
accept="application/pdf,.csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel" /><!--accept=".pdf,.doc,.docx,.jpg,.msg"-->
</td>
<td>{{attach.uploadedfile_name}}</td>
<td> <img [src]="attach.filePreview" alt="File Preview" [ngModelOptions]="{standalone: true}"
name="filePreview" width="100px" height="100px"></td>
<td>
<a (click)="deleteRowfileupload_field(i)">
<clr-icon shape="trash" class="is-error"></clr-icon>
</a>
</td>
</tr>
</tbody>
<button type="button" class="btn btn-primary button1" style="margin-left: 20px;"
(click)="onAddLinesfileupload_field()">
<clr-icon shape="plus"></clr-icon>
</button>
</table>
</div>
<br>
<div class="button">
<button type="submit" class="btn btn-success" [disabled]="!selectedfileupload_field">Upload</button>
<button type="button" class="btn btn-primary"
(click)="timelineStyle.step1 = { state: 'success', open: false }; timelineStyle.step2 = { state: 'current', open: true }">Complete</button>
<button class="btn btn-primary-outline"
(click)="timelineStyle.step0 = { state: 'current', open: true }; timelineStyle.step1 = { state: 'not-started', open: false }">Back</button>
</div>
</form>
</div>
</div>
</div>
<!--STEP 2-->
<div class="card" *ngIf="timelineStyle.step2.open">
<div class="card-header">
<h3 style="text-align: center;" *ngIf="!appToUpdate">Customer Information Review And Confirmation</h3>
<div class="container">
<!-- Customer Info -->
<div class="clr-row mb-3">
<div class="clr-col-12">
<h5>Customer Details:</h5>
<p><strong>Name:</strong> {{ rowSelected.name }}</p>
<p><strong>Active:</strong> {{ rowSelected.active }}</p>
<p><strong>Visa Entry Type:</strong> {{ rowSelected.visa_entry_typename }}</p>
<p><strong>Visa Duration:</strong> {{ rowSelected.visa_durationname }}</p>
<p><strong>Visa Processing:</strong> {{ rowSelected.visa_processingname }}</p>
<p><strong>Travel Start Date:</strong> {{ rowSelected.travel_start_date }}</p>
<p><strong>Travel End Date:</strong> {{ rowSelected.travel_end_date }}</p>
<p><strong>Passport Number:</strong> {{ rowSelected.passport_number }}</p>
<p><strong>Passport Issue Date:</strong> {{ rowSelected.passport_issue_date }}</p>
<p><strong>Passport Expiry Date:</strong> {{ rowSelected.passport_expiry_date }}</p>
<p><strong>Email:</strong> {{ rowSelected.email }}</p>
<p><strong>Phone Number:</strong> {{ rowSelected.phone_number }}</p>
<p><strong>Birth Place:</strong> {{ rowSelected.birth_place }}</p>
<p><strong>Date of Birth:</strong> {{ rowSelected.date_of_birth }}</p>
<p><strong>Gender:</strong> {{ rowSelected.gendername }}</p>
<p><strong>Profession:</strong> {{ rowSelected.profession }}</p>
<p><strong>Visa Cost:</strong> {{ rowSelected.visa_cost }}</p>
<p><strong>Referrer:</strong> {{ rowSelected.referrername }}</p>
<p><strong>Nationality:</strong> {{ rowSelected.nationalityname }}</p>
<p><strong>Supplier:</strong> {{ rowSelected.suppliername }}</p>
<p><strong>Agent:</strong> {{ rowSelected.agentname }}</p>
</div>
</div>
<!-- Uploaded File -->
<div class="clr-row mb-3" *ngIf="uploadedFileName">
<div class="clr-col-12">
<h5>Uploaded Document:</h5>
<p>{{ uploadedFileName }}</p>
</div>
</div>
<div class="button">
<button class="btn btn-primary-outline"
(click)="timelineStyle.step1 = { state: 'current', open: true }; timelineStyle.step2 = { state: 'not-started', open: false }">Back</button>
<button class="btn btn-primary"
(click)="timelineStyle.step2 = { state: 'success', open: false }; current(); alert('Process Finished Successfully!')">Finish</button>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,46 @@
.horizontal{
width: 25%;
padding: 5px;
}
.horizontal1{
width: 50%;
padding: 10px;
}
.middle{
width: 33%;
padding: 10px;
}
.middle1{
width: 75%;
padding: 10px;
}
.full{
width: 100%;
padding: 10px;
}
input[type=text],[type=date], select {
width: 100%;
padding: 12px 20px;
margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
}
.required-field{
color: red;
}
.center {
text-align: center;
}
.center{
color: blue;
}
@media (max-width: 600px){
.horizontal,.middle,.horizontal1,.middle1 {
width: 100%;
}}

View File

@ -0,0 +1,25 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { EditstepperTfComponent } from './editstepperTf.component';
describe('EditstepperComponent', () => {
let component: EditstepperTfComponent;
let fixture: ComponentFixture<EditstepperTfComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ EditstepperTfComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(EditstepperTfComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,463 @@
import { Component, OnInit } from '@angular/core';
import { ToastrService } from 'ngx-toastr';
import { ActivatedRoute, Router } from '@angular/router';
import { College } from 'src/app/models/fnd/play';
import { student } from 'src/app/models/fnd/Studentadd';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { ValidationError } from 'src/app/models/fnd/ValidationError';
import { Visa_applicationTfservice } from './Visa_applicationTf.service';
@Component({
selector: 'app-editstepper',
templateUrl: './editstepperTf.component.html',
styleUrls: ['./editstepperTf.component.scss']
})
export class EditstepperTfComponent implements OnInit {
updated = false;
// college: College;
stringJson: any;
customerId: string = '';
selectedFile!: File;
fileName = '';
id: number;
errorFields: ValidationError[] = [];
appToUpdate: College = null;
trained = false;
json: string = "";
luisApp =
{
name: '',
created: 1,
trained: 1,
tested: 1,
updated: 1,
published: 1,
};
// Layout direction changing
layout = {
direction: "vertical",
block1: "clr-col-lg-3 clr-col-12 ",
block2: "clr-col-lg-9 clr-col-12 ",
};
timelineStyle = {
step0: { state: "current", open: true, failed: false },
step1: { state: "not-started", open: false, failed: false },
step2: { state: "not-started", open: false, failed: false },
};
public entryForm: FormGroup;
submitted = false;
rowSelected: any = {};
modalcomplete = false;
constructor(private mainService: Visa_applicationTfservice,
private _fb: FormBuilder,
private router: Router,
private route: ActivatedRoute,
private toastr: ToastrService,) { }
ngOnInit(): void {
// this.college = new College();
this.id = this.route.snapshot.params["id"];
console.log("update with id = ", this.id);
this.entryForm = this._fb.group({
name: [null],
description: [null],
active: [false],
visa_entry_type: [null],
visa_duration: [null],
visa_processing: [null],
travel_start_date: [null],
travel_end_date: [null],
passport_number: [null, [Validators.required]],
passport_issue_date: [null],
passport_expiry_date: [null],
email: [null],
phone_number: ['+91'],
birth_place: [null],
date_of_birth: [null],
gender: [null],
profession: [null],
visa_cost: [null, { updateOn: 'blur' }],
referrer: [null],
nationality: [null],
supplier: [null],
agent: [null],
});
this.getallvisa_entry_type();
this.getallvisa_duration();
this.getallvisa_processing();
this.getallgender();
this.getallreferrer();
this.getallnationality();
this.getallsupplier();
this.getallagent();
}
// Change to Horizontal Layout
changeToHorizonTal() {
this.layout = {
direction: "horizontal",
block1: "clr-col-lg-12 clr-col-12 height container",
block2: "clr-col-lg-12 clr-col-12 container",
}
}
// Change to Vertical Layout
changeToVertical() {
this.layout = {
direction: "vertical",
block1: "clr-col-lg-3 clr-col-12 ",
block2: "clr-col-lg-9 clr-col-12 ",
}
}
getById(id: number) {
// this.mainService.getBywfId(id).subscribe(
// (data) => {
// this.college = data;
// },
// (err) => {
// console.log(err);
// }
// );
// this.currentservice.getById(id).subscribe(
// (data) => {
// this.student = data;
// var current = JSON.parse(data.current_json);
// this.timelineStyle = current;
// console.log("data", data);
// },
// (err) => {
// console.log(err);
// }
// );
}
onSave() {
console.log('Form Submitted:', this.entryForm.value);
this.submitted = true;
if (this.entryForm.invalid) {
console.log('invalid form ..');
// Log all form errors
Object.keys(this.entryForm.controls).forEach(field => {
const control = this.entryForm.get(field);
if (control && control.invalid) {
console.log(`Error in field: ${field}`, control.errors);
}
}
);
return;
}
this.onCreate();
}
onCreate() {
this.mainService.create(this.entryForm.value).subscribe(
(data) => {
console.log('adding data ', data);
this.customerId = data.id;
console.log('id is ', this.customerId);
if (data || data.status >= 200 && data.status <= 299) {
this.toastr.success("Added Successfully");
}
setTimeout(() => {
this.ngOnInit();
}, 500);
}, (error) => {
console.log(error);
if (error.status >= 200 && error.status <= 299) {
// this.toastr.success("Added Succesfully");
}
if (error.status >= 400 && error.status <= 499) {
this.toastr.error("Not Added");
}
if (error.status >= 500 && error.status <= 599) {
this.toastr.error("Not Added");
}
});
this.rowSelected = this.entryForm.value;
setTimeout(() => {
this.ngOnInit();
}, 500);
}
onnext() {
this.router.navigate(["../../main/workflow"], { relativeTo: this.route });
}
reset() {
this.json = "";
this.luisApp =
{
name: '',
trained: 1,
tested: 1,
updated: 1,
published: 1,
created: 1,
};
this.timelineStyle = {
step0: { state: "current", open: true, failed: false },
step1: { state: "not-started", open: false, failed: false },
step2: { state: "not-started", open: false, failed: false },
};
}
current() {
console.log(this.timelineStyle)
this.stringJson = JSON.stringify(this.timelineStyle);
console.log("String json object :", this.stringJson);
// this.mainService.update(this.id, this.college, this.stringJson).subscribe(
// (data) => {
// console.log(data);
// },
// );
}
onFileUpload(): void {
for (let i = 0; i < this.selectedfileupload_field.length; i++) {
this.mainService.uploadDocument(this.customerId, 'visa order', this.selectedfileupload_field[i]).subscribe(uploaddata => {
console.log(uploaddata);
console.log('id is ', this.customerId);
if (uploaddata || uploaddata.status >= 200 && uploaddata.status <= 299) {
// alert('File uploaded successfully!');
this.toastr.success("File uploaded successfully!");
}
setTimeout(() => {
this.ngOnInit();
}, 500);
}, (error) => {
console.log(error);
if (error.status >= 200 && error.status <= 299) {
// this.toastr.success("Added Succesfully");
}
if (error.status >= 400 && error.status <= 499) {
this.toastr.error("Not Added");
}
if (error.status >= 500 && error.status <= 599) {
this.toastr.error("Not Added");
}
}
)
}
this.selectedFile = null;
}
filePreviewfileupload_field: string | ArrayBuffer | null = null;
FileDatafileupload_field: { uploadedfile_name?: any, filePreview: string | ArrayBuffer | null }[] = []; // Initialize the array
selectedfileupload_field: File[] = [];
public onFileChangedfileupload_field(event, index) {
const files = event.target.files;
for (let i = 0; i < files.length; i++) {
const file = files[i];
this.FileDatafileupload_field[index].uploadedfile_name = files[i].name;
this.selectedfileupload_field.push(files[i]);
if (file.type.startsWith('file/')) {
const reader = new FileReader();
reader.onload = (e) => {
// Set the file preview source
const filePreview = e.target?.result as string;
this.FileDatafileupload_field[index] = {
...this.FileDatafileupload_field[index], // Preserve existing properties
filePreview: filePreview // Update only the filePreview property
};
};
reader.readAsDataURL(file);
}
}
}
onAddLinesfileupload_field() {
this.FileDatafileupload_field.push({
uploadedfile_name: "",
filePreview: "",
// f3: "",
});
}
deleteRowfileupload_field(index, id) {
this.FileDatafileupload_field.splice(index, 1);
if (id) {
this.mainService.uploadfiledeletefileupload_field(id).subscribe(data => {
console.log(data);
})
}
}
updategender(gender: string): void {
this.entryForm.get('gender').setValue(gender);
}
updategenderEdit(gender: string): void { this.rowSelected.gender = gender }
rsModaldescription = false;
goToReplaceStringdescription(row) {
this.rowSelected = row; this.rsModaldescription = true;
}
selectvisa_entry_type;
getallvisa_entry_type() {
this.mainService.getAllvisa_entry_type().subscribe(data => {
this.selectvisa_entry_type = data;
console.log(data);
}, (error) => { console.log(error); });
}
selectvisa_duration;
getallvisa_duration() {
this.mainService.getAllvisa_duration().subscribe(data => {
this.selectvisa_duration = data;
console.log(data);
}, (error) => { console.log(error); });
}
selectvisa_processing;
getallvisa_processing() {
this.mainService.getAllvisa_processing().subscribe(data => {
this.selectvisa_processing = data;
console.log('visa processing ', data);
}, (error) => { console.log(error); });
}
isValidemail(email: string): boolean {
const emailPattern = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
return emailPattern.test(email);
}
isValidPhone_number(phone: string): boolean {
const phonePattern = /^(\+[1-9][0-9]{0,2})?[1-9][0-9]{9}$/;
return phonePattern.test(phone);
}
selectgender;
getallgender() {
this.mainService.getAllgender().subscribe(data => {
this.selectgender = data;
console.log(data);
}, (error) => { console.log(error); });
}
//currency field start
formatCurrencyvisa_cost() {
// Format the currency with two decimal places
this.rowSelected.visa_cost = Number(this.rowSelected.visa_cost).toFixed(2);
// Remove commas from the formatted currency
this.rowSelected.visa_cost = this.rowSelected.visa_cost?.replace(/,/g, '');
}
//currency field end
selectreferrer;
getallreferrer() {
this.mainService.getAllreferrer().subscribe(data => {
this.selectreferrer = data;
console.log(data);
}, (error) => { console.log(error); });
}
selectnationality;
getallnationality() {
this.mainService.getAllnationality().subscribe(data => {
this.selectnationality = data;
console.log(data);
}, (error) => { console.log(error); });
}
selectsupplier;
getallsupplier() {
this.mainService.getAllsupplier().subscribe(data => {
this.selectsupplier = data;
console.log(data);
}, (error) => { console.log(error); });
}
selectagent;
getallagent() {
this.mainService.getAllagent().subscribe(data => {
this.selectagent = data;
console.log(data);
}, (error) => { console.log(error); });
}
}

View File

@ -0,0 +1,9 @@
export class College {
public studentid: number;
public wf_instance_id:number;
public studentname: string;
public department: string;
public joiningDate: string;
public phone: number;
public emailId:string;
}

View File

@ -127,6 +127,7 @@ import { TreeNodeComponent } from './fnd/SiteTreeBuilder/TreeNode/tree-node.comp
import { EditstepperComponent } from './BuilderComponents/vpspack/Visa_application/VisaOrderWorkflow/editstepper.component';
import { Design_lbraryComponent } from './fnd/SiteTreeBuilder/Design_lbrary/Design_lbrary.component';
import { Dlf_headerComponent } from './fnd/SiteTreeBuilder/Dlf_header/Dlf_header.component';
import { EditstepperTfComponent } from './fnd/Visa_application/VisaOrderWorkflow/editstepperTf.component';
@NgModule({
@ -147,6 +148,7 @@ import { Dlf_headerComponent } from './fnd/SiteTreeBuilder/Dlf_header/Dlf_header
// buildercomponents
EditstepperTfComponent,
Dlf_headerComponent,
Design_lbraryComponent,
SiteTreeComponent,