susee
This commit is contained in:
parent
cfc62c68d5
commit
4d5ae99c73
@ -12,6 +12,10 @@ export class AuthService {
|
|||||||
private apiUrl = environment.apiEndpoint;
|
private apiUrl = environment.apiEndpoint;
|
||||||
constructor(private _http: HttpClient) { }
|
constructor(private _http: HttpClient) { }
|
||||||
|
|
||||||
|
update_token(params): Observable<any> {
|
||||||
|
console.log(params.id)
|
||||||
|
return this._http.post<any>(this.apiUrl + "updateToken",params)
|
||||||
|
}
|
||||||
|
|
||||||
getLoginToken(params): Observable<any> {
|
getLoginToken(params): Observable<any> {
|
||||||
console.log(params.email)
|
console.log(params.email)
|
||||||
@ -21,7 +25,7 @@ export class AuthService {
|
|||||||
|
|
||||||
getForgotToken(params): Observable<any> {
|
getForgotToken(params): Observable<any> {
|
||||||
console.log(params.email)
|
console.log(params.email)
|
||||||
return this._http.post<any>(this.apiUrl + "forget-password",{'email':params.email,'password':params.password})
|
return this._http.post<any>(this.apiUrl + "_api",{'email':params.email,'password':params.password})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -79,7 +79,7 @@
|
|||||||
<p> {{setData.orderId}} </p> <br />
|
<p> {{setData.orderId}} </p> <br />
|
||||||
<div style="font-size: larger;font-weight: 600;"> Status</div>
|
<div style="font-size: larger;font-weight: 600;"> Status</div>
|
||||||
<p style="text-transform: capitalize;" *ngIf="fieldTitle == 'View Order' " [ngStyle] = "{'color':setData.status =='ordered'?'#1f1dc9f5':setData.status =='Delivered' ?'green':'red' }" > ({{setData.status}}) </p>
|
<p style="text-transform: capitalize;" *ngIf="fieldTitle == 'View Order' " [ngStyle] = "{'color':setData.status =='ordered'?'#1f1dc9f5':setData.status =='Delivered' ?'green':'red' }" > ({{setData.status}}) </p>
|
||||||
<nb-select selected="" *ngIf="fieldTitle != 'View Order' " placeholder="Change Status" clearable style="width: 57% !important;margin-top: 1rem;" [(ngModel)]="selectStatus" >
|
<nb-select selected="" *ngIf="fieldTitle != 'View Order'" (ngModelChange)="onSelectChange($event)" placeholder="Change Status" clearable style="width: 57% !important;margin-top: 1rem;" [(ngModel)]="selectStatus" >
|
||||||
<!-- <nb-option value="">Change Status</nb-option> -->
|
<!-- <nb-option value="">Change Status</nb-option> -->
|
||||||
<nb-option value="ordered" >Ordered</nb-option>
|
<nb-option value="ordered" >Ordered</nb-option>
|
||||||
<nb-option value="In Progress" >In Progresss</nb-option>
|
<nb-option value="In Progress" >In Progresss</nb-option>
|
||||||
@ -90,7 +90,7 @@
|
|||||||
|
|
||||||
</nb-select>
|
</nb-select>
|
||||||
|
|
||||||
<nb-select selected="" placeholder="Select Drivers" *ngIf="fieldTitle != 'View Order' && selectStatus == 'Out For Delivery'" [(ngModel)]="selectDriver" style="width: 57% !important;margin-right: 1rem;margin-top: 1rem;" >
|
<nb-select (ngModelChange)="onSelectChange1($event)" selected="" placeholder="Select Drivers" *ngIf="fieldTitle != 'View Order' && selectStatus == 'Out For Delivery'" [(ngModel)]="selectDriver" style="width: 57% !important;margin-right: 1rem;margin-top: 1rem;" >
|
||||||
<!-- <nb-option value="">Select Drivers</nb-option> -->
|
<!-- <nb-option value="">Select Drivers</nb-option> -->
|
||||||
|
|
||||||
<nb-option *ngFor="let user of drivers; index as i; first as isFirst " [value]="user.id
|
<nb-option *ngFor="let user of drivers; index as i; first as isFirst " [value]="user.id
|
||||||
@ -99,7 +99,7 @@
|
|||||||
|
|
||||||
</nb-select>
|
</nb-select>
|
||||||
<input nbInput *ngIf="fieldTitle != 'View Order' && selectStatus == 'Cancelled'" [(ngModel)]="CancelReason" placeholder="Reason" style=" margin-right: 2%;margin-top: 1rem;" id="text"> <br />
|
<input nbInput *ngIf="fieldTitle != 'View Order' && selectStatus == 'Cancelled'" [(ngModel)]="CancelReason" placeholder="Reason" style=" margin-right: 2%;margin-top: 1rem;" id="text"> <br />
|
||||||
<button *ngIf="fieldTitle != 'View Order' " (click)="onSubmit2()" style="margin-top: 1rem;" type="submit" nbButton status="success" hero>
|
<button *ngIf="fieldTitle != 'View Order'" [disabled]="hiddenBtn" (click)="onSubmit2()" style="margin-top: 1rem;" type="submit" nbButton status="success" hero>
|
||||||
Save
|
Save
|
||||||
</button>
|
</button>
|
||||||
<span *ngIf="setData.status =='Cancelled'">Reason: {{setData.reason}} </span>
|
<span *ngIf="setData.status =='Cancelled'">Reason: {{setData.reason}} </span>
|
||||||
|
|||||||
@ -56,6 +56,7 @@ fieldTitle:any =' New Order'
|
|||||||
inputFieldGroups:any = [{id:'', qty: '1', productSpec: '' }];
|
inputFieldGroups:any = [{id:'', qty: '1', productSpec: '' }];
|
||||||
selectCustomerData :any =[];selectStatus:any =[];CancelReason:any =[];selectDriver:any =[];drivers:any =[];
|
selectCustomerData :any =[];selectStatus:any =[];CancelReason:any =[];selectDriver:any =[];drivers:any =[];
|
||||||
invoice = new Invoice();
|
invoice = new Invoice();
|
||||||
|
hiddenBtn= false;
|
||||||
constructor(private dialogService: NbDialogService,private route :ActivatedRoute,private router: Router,public _api:PageapiService,private toastrService: NbToastrService,private service: SmartTableData ,private windowService: NbWindowService) {
|
constructor(private dialogService: NbDialogService,private route :ActivatedRoute,private router: Router,public _api:PageapiService,private toastrService: NbToastrService,private service: SmartTableData ,private windowService: NbWindowService) {
|
||||||
|
|
||||||
this._api.orderDetails_observable$.subscribe((res) => {
|
this._api.orderDetails_observable$.subscribe((res) => {
|
||||||
@ -133,7 +134,7 @@ fieldTitle:any =' New Order'
|
|||||||
|
|
||||||
let passData = res.data
|
let passData = res.data
|
||||||
|
|
||||||
let customer = passData.filter(arr=>{return arr.role == 'CUSTOMER'})
|
let customer = passData.filter(arr=>{return arr.role == 'CUSTOMER' && arr.isActive == 1})
|
||||||
customer.forEach((element:any, index) => {
|
customer.forEach((element:any, index) => {
|
||||||
element.index = index +1
|
element.index = index +1
|
||||||
|
|
||||||
@ -736,6 +737,29 @@ getDriverlistApi(){
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
onSelectChange(newValue: string) {
|
||||||
|
// Handle the selected value change here
|
||||||
|
this.selectDriver = []
|
||||||
|
console.log(newValue);
|
||||||
|
if(newValue == 'Out For Delivery'){
|
||||||
|
this.hiddenBtn = true;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
this.hiddenBtn = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onSelectChange1(newValue: string) {
|
||||||
|
// Handle the selected value change here
|
||||||
|
console.log(newValue);
|
||||||
|
if(!newValue){
|
||||||
|
this.hiddenBtn = true;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
this.hiddenBtn = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
onSubmit2(){
|
onSubmit2(){
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -195,6 +195,12 @@ export class OrderComponent {
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
notify(id,ordId,cusName){
|
||||||
|
let obj = { "id" : id , "ordId" : ordId , 'cusName' : cusName }
|
||||||
|
this._api.Notification(obj).subscribe(res => { console.log( "success");
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
onDeleteConfirm(event): void {
|
onDeleteConfirm(event): void {
|
||||||
console.log(event)
|
console.log(event)
|
||||||
@ -485,6 +491,8 @@ onSubmit(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
onSubmit2(){
|
onSubmit2(){
|
||||||
if(this.selectedRows.length>0){
|
if(this.selectedRows.length>0){
|
||||||
|
|
||||||
@ -515,6 +523,11 @@ onSubmit2(){
|
|||||||
|
|
||||||
this._api.CreateOrder (param).subscribe(res => {
|
this._api.CreateOrder (param).subscribe(res => {
|
||||||
if (res.status == 200) {
|
if (res.status == 200) {
|
||||||
|
if(this.selectStatus == "Out For Delivery"){
|
||||||
|
this.selectedRows.forEach(async(element) => {
|
||||||
|
this.notify(this.selectDriver , element.orderId , element.customer )
|
||||||
|
});
|
||||||
|
}
|
||||||
console.log(res)
|
console.log(res)
|
||||||
this.showToast('success', 'Updated Successfully', '');
|
this.showToast('success', 'Updated Successfully', '');
|
||||||
this.getorderlistApi();
|
this.getorderlistApi();
|
||||||
@ -661,7 +674,6 @@ refresh(){
|
|||||||
|
|
||||||
manipulateDate(data){
|
manipulateDate(data){
|
||||||
console.log(data)
|
console.log(data)
|
||||||
|
|
||||||
let start = data.start
|
let start = data.start
|
||||||
let end = data.end
|
let end = data.end
|
||||||
|
|
||||||
|
|||||||
@ -112,14 +112,29 @@ public mixDetails_observable$ = this.mixDetails.asObservable();
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
delOrder(addParams): Observable<any> {
|
||||||
|
return this._http.post(this.apiUrl + 'delOrderCatogary', addParams)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
getProductList(addParams): Observable<any> {
|
getProductList(addParams): Observable<any> {
|
||||||
return this._http.post(this.apiUrl + 'getProductList', addParams)
|
return this._http.post(this.apiUrl + 'getProductList', addParams)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getProductDropdownList(addParams): Observable<any> {
|
||||||
|
return this._http.post(this.apiUrl + 'getProductDropdownList', addParams)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
CreateReturn(addParams:any): Observable<any> {
|
CreateReturn(addParams:any): Observable<any> {
|
||||||
return this._http.post(this.apiUrl + 'CreateReturn', addParams)
|
return this._http.post(this.apiUrl + 'CreateReturn', addParams)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Notification(addParams:any): Observable<any> {
|
||||||
|
return this._http.post(this.apiUrl + 'sendNotification', addParams)
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -9,7 +9,7 @@
|
|||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
<label for="subject">E-mail:</label>
|
<label for="subject">E-mail:</label>
|
||||||
<input formControlName="email" nbInput id="email" type="text" [status]="userForm.get('email').invalid && userForm.get('email').touched? 'danger' : 'basic'">
|
<input formControlName="email" nbInput id="email" type="email" [status]="userForm.get('email').invalid && userForm.get('email').touched? 'danger' : 'basic'">
|
||||||
<ng-container nbInputErrorMessage>
|
<ng-container nbInputErrorMessage>
|
||||||
<div style="color:#7c0e0e" *ngIf="userForm.get('email').hasError('required') && userForm.get('email').touched">Email is required.</div>
|
<div style="color:#7c0e0e" *ngIf="userForm.get('email').hasError('required') && userForm.get('email').touched">Email is required.</div>
|
||||||
|
|
||||||
|
|||||||
@ -29,7 +29,7 @@ export class UserFormComponent implements OnInit {
|
|||||||
mobileNo: new FormControl('', [Validators.required, Validators.minLength(10),Validators.maxLength(10)]),
|
mobileNo: new FormControl('', [Validators.required, Validators.minLength(10),Validators.maxLength(10)]),
|
||||||
// lastName: new FormControl('', [Validators.required, Validators.maxLength(20)]),
|
// lastName: new FormControl('', [Validators.required, Validators.maxLength(20)]),
|
||||||
email: new FormControl('', [Validators.required, Validators.email,Validators.pattern(
|
email: new FormControl('', [Validators.required, Validators.email,Validators.pattern(
|
||||||
'[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,63}$',
|
/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,63}$/
|
||||||
)]),
|
)]),
|
||||||
// password: new FormControl('', [Validators.required, Validators.minLength(6)]),
|
// password: new FormControl('', [Validators.required, Validators.minLength(6)]),
|
||||||
password: new FormControl('', [Validators.required,Validators.pattern(
|
password: new FormControl('', [Validators.required,Validators.pattern(
|
||||||
|
|||||||
@ -81,6 +81,7 @@ export class UsersComponent {
|
|||||||
destroyByClick = true;
|
destroyByClick = true;
|
||||||
duration = 2000;
|
duration = 2000;
|
||||||
hasIcon = true;
|
hasIcon = true;
|
||||||
|
logUser = JSON.parse(localStorage.getItem('email')).email;
|
||||||
admin:any =[];
|
admin:any =[];
|
||||||
position: NbGlobalPosition = NbGlobalPhysicalPosition.TOP_RIGHT;
|
position: NbGlobalPosition = NbGlobalPhysicalPosition.TOP_RIGHT;
|
||||||
preventDuplicates = false;
|
preventDuplicates = false;
|
||||||
@ -195,7 +196,7 @@ export class UsersComponent {
|
|||||||
if(res.status == 200){
|
if(res.status == 200){
|
||||||
|
|
||||||
let passData = res.data
|
let passData = res.data
|
||||||
let admin = passData.filter(arr=>{return arr.role == 'ADMIN' || arr.role == 'FRONT-OFFICE'})
|
let admin = passData.filter(arr=>{return ( arr.role == 'ADMIN' || arr.role == 'FRONT-OFFICE' ) && arr.email != this.logUser })
|
||||||
|
|
||||||
admin.forEach((element:any, index) => {
|
admin.forEach((element:any, index) => {
|
||||||
element.index = index +1
|
element.index = index +1
|
||||||
|
|||||||
@ -10,6 +10,7 @@
|
|||||||
|
|
||||||
export const environment = {
|
export const environment = {
|
||||||
apiEndpoint:'https://dev.venbait.in/vnms/api/',
|
apiEndpoint:'https://dev.venbait.in/vnms/api/',
|
||||||
|
// apiEndpoint:'http://localhost:8081/api/',
|
||||||
mailUrl:'',
|
mailUrl:'',
|
||||||
production: false,
|
production: false,
|
||||||
};
|
};
|
||||||
|
|||||||
BIN
vnms_admin_fe.zip
Normal file
BIN
vnms_admin_fe.zip
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user