diff --git a/src/app/pages/auth/auth.service.ts b/src/app/pages/auth/auth.service.ts index 204a963..ad3da98 100644 --- a/src/app/pages/auth/auth.service.ts +++ b/src/app/pages/auth/auth.service.ts @@ -12,6 +12,10 @@ export class AuthService { private apiUrl = environment.apiEndpoint; constructor(private _http: HttpClient) { } + update_token(params): Observable { + console.log(params.id) + return this._http.post(this.apiUrl + "updateToken",params) + } getLoginToken(params): Observable { console.log(params.email) @@ -21,7 +25,7 @@ export class AuthService { getForgotToken(params): Observable { console.log(params.email) - return this._http.post(this.apiUrl + "forget-password",{'email':params.email,'password':params.password}) + return this._http.post(this.apiUrl + "_api",{'email':params.email,'password':params.password}) } diff --git a/src/app/pages/customer/customer-form/customer-form.component.html b/src/app/pages/customer/customer-form/customer-form.component.html index dc8e5de..02a5a95 100644 --- a/src/app/pages/customer/customer-form/customer-form.component.html +++ b/src/app/pages/customer/customer-form/customer-form.component.html @@ -93,7 +93,7 @@
- +
Pincode is required.
diff --git a/src/app/pages/order/order-form/order-form.component.html b/src/app/pages/order/order-form/order-form.component.html index d386999..fdaa980 100644 --- a/src/app/pages/order/order-form/order-form.component.html +++ b/src/app/pages/order/order-form/order-form.component.html @@ -1,126 +1,247 @@ - - - -
-
-
{{fieldTitle}}
-
-
-
- - - - - -
-
-
-
- - - -
-
-
-
- {{selectCustomer}} - - - - - {{user['CusDetails.cusName'] - }} - - -
-
Shipping Information
-
-
-
- -
-
-
- -
-
- -
-
- -
-
-
-
- -
-
-
-
-
ORDER ID
- -

{{setData.orderId}}


-
Status
-

({{setData.status}})

- - - Ordered - In Progresss - Out For Delivery - - Delivered - Cancelled - - - - - - - {{user.userName }} - - - -
- - Reason: {{setData.reason}} - -
-
-
-
+ - - - - +
+
+
{{fieldTitle}}
+
+
+
+ -
+ + + +
+
+
+ + + + +
+
+
+
+ {{selectCustomer}} + + + + + {{user['CusDetails.cusName'] + }} + + +
+
Shipping Information
+
+
+
+ +
+
+
+ +
+
+ +
+
+ +
+
+
+
+ +
+
+
+
+
ORDER ID
+ +

{{setData.orderId}}


+
Status
+

({{setData.status}})

+ + + Ordered + In Progresss + Out For Delivery + + Delivered + Cancelled + + + + + + + {{user.userName }} + + + +
+ + Reason: {{setData.reason}} + +
+
+
+
+ + + + + + + +
+
+
Product Information
+
+
+ +
+
+
+
+
+
+ +
+
+
+
+ +
+
+
+
+ +
+
+
+ + +
+
+ + + + + + +
+
+
+ + + + {{user.productName }}({{user.skuId }} ) + + + + + +
+
+
+
+ + + + +
+
+
+
+ + + +
+
+ +
+
+ + + + + + + + +
+
+ + +
+ +
+
+ +
+ +
+
+
+ + + +
+
+
+
+ + +
+
+
+
+ +
+
+
+ + +
+ + +
+
-
Product Information
+
Return Information
- - {{user.productName }}({{user.skuId }} ) - - - - - -
-
-
+ +
- - - - -
-
-
-
- - - -
-
- -
-
- - - - - - - - -
-
- + + -
- -
-
-
- -
-
-
- - - -
-
-
-
- - -
-
-
-
- -
-
-
- - -
- - -
-
-
-
Return Information
-
-
- -
-
-
- - -
+ + +
+
+
+ + + +
+
+
- - - - - - -
-
-
+ +
+ - - -
-
-
-
- -
- - - - -
-
-
-
- - -
-
- -
-
- - - - - -
- -
- -
+ + +
- -
+
+
+ + +
+
+ +
+
+ + + + + +
+ +
+ +
+
+ + -
-
- - +
+
- - - -
-
-
- - - - -
-
-
-
- -
- - - - -
-
-
+ + + + + +
+
- - -
-
- -
-
+ + - - - - - -
-
- - + +
+
+
+
+ +
+ + + + +
- -
-
+
+
+ + +
+
+ +
+
+ + + + + - - -
-
-
- -
-
-
-
- -
-
-
-
- -
-
-
-
- - -
-
+
+
+ + +
+ +
+
+ + + +
+
+
+ +
- - - - +
+
+ +
+
+
+
+ +
+
+
+
+ + +
+
+
+ + +
+ diff --git a/src/app/pages/order/order-form/order-form.component.ts b/src/app/pages/order/order-form/order-form.component.ts index 9e03c2b..6aac981 100644 --- a/src/app/pages/order/order-form/order-form.component.ts +++ b/src/app/pages/order/order-form/order-form.component.ts @@ -56,6 +56,7 @@ fieldTitle:any =' New Order' inputFieldGroups:any = [{id:'', qty: '1', productSpec: '' }]; selectCustomerData :any =[];selectStatus:any =[];CancelReason:any =[];selectDriver:any =[];drivers:any =[]; 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) { this._api.orderDetails_observable$.subscribe((res) => { @@ -133,7 +134,7 @@ fieldTitle:any =' New Order' 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) => { 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(){ diff --git a/src/app/pages/order/order.component.html b/src/app/pages/order/order.component.html index af8331c..66673de 100644 --- a/src/app/pages/order/order.component.html +++ b/src/app/pages/order/order.component.html @@ -312,7 +312,7 @@ - {{user.userName }} diff --git a/src/app/pages/order/order.component.ts b/src/app/pages/order/order.component.ts index 118ed34..5e6f71f 100644 --- a/src/app/pages/order/order.component.ts +++ b/src/app/pages/order/order.component.ts @@ -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 { console.log(event) @@ -485,6 +491,8 @@ onSubmit(){ } + + onSubmit2(){ if(this.selectedRows.length>0){ @@ -515,6 +523,11 @@ onSubmit2(){ this._api.CreateOrder (param).subscribe(res => { 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) this.showToast('success', 'Updated Successfully', ''); this.getorderlistApi(); @@ -661,7 +674,6 @@ refresh(){ manipulateDate(data){ console.log(data) - let start = data.start let end = data.end diff --git a/src/app/pages/pageapi.service.ts b/src/app/pages/pageapi.service.ts index a2d8e0c..2445477 100644 --- a/src/app/pages/pageapi.service.ts +++ b/src/app/pages/pageapi.service.ts @@ -112,14 +112,29 @@ public mixDetails_observable$ = this.mixDetails.asObservable(); } + delOrder(addParams): Observable { + return this._http.post(this.apiUrl + 'delOrderCatogary', addParams) + + } + getProductList(addParams): Observable { return this._http.post(this.apiUrl + 'getProductList', addParams) } + + getProductDropdownList(addParams): Observable { + return this._http.post(this.apiUrl + 'getProductDropdownList', addParams) + + } CreateReturn(addParams:any): Observable { return this._http.post(this.apiUrl + 'CreateReturn', addParams) } + + Notification(addParams:any): Observable { + return this._http.post(this.apiUrl + 'sendNotification', addParams) + + } } diff --git a/src/app/pages/users/user-form/user-form.component.html b/src/app/pages/users/user-form/user-form.component.html index b652d15..a301e73 100644 --- a/src/app/pages/users/user-form/user-form.component.html +++ b/src/app/pages/users/user-form/user-form.component.html @@ -9,7 +9,7 @@ - +
Email is required.
diff --git a/src/app/pages/users/user-form/user-form.component.ts b/src/app/pages/users/user-form/user-form.component.ts index 5aa4b94..4d347c1 100644 --- a/src/app/pages/users/user-form/user-form.component.ts +++ b/src/app/pages/users/user-form/user-form.component.ts @@ -29,7 +29,7 @@ export class UserFormComponent implements OnInit { mobileNo: new FormControl('', [Validators.required, Validators.minLength(10),Validators.maxLength(10)]), // lastName: new FormControl('', [Validators.required, Validators.maxLength(20)]), 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.pattern( diff --git a/src/app/pages/users/users.component.ts b/src/app/pages/users/users.component.ts index 4cbd6f7..37b22cc 100644 --- a/src/app/pages/users/users.component.ts +++ b/src/app/pages/users/users.component.ts @@ -81,6 +81,7 @@ export class UsersComponent { destroyByClick = true; duration = 2000; hasIcon = true; + logUser = JSON.parse(localStorage.getItem('email')).email; admin:any =[]; position: NbGlobalPosition = NbGlobalPhysicalPosition.TOP_RIGHT; preventDuplicates = false; @@ -195,7 +196,7 @@ export class UsersComponent { if(res.status == 200){ 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) => { element.index = index +1 diff --git a/src/environments/environment.ts b/src/environments/environment.ts index 38b7ac7..e3e12b1 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -10,6 +10,7 @@ export const environment = { apiEndpoint:'https://dev.venbait.in/vnms/api/', + // apiEndpoint:'http://localhost:8081/api/', mailUrl:'', production: false, }; diff --git a/vnms_admin_fe.zip b/vnms_admin_fe.zip new file mode 100644 index 0000000..0b8db3a Binary files /dev/null and b/vnms_admin_fe.zip differ