瀏覽代碼

feedback changes

ashwini 1 月之前
父節點
當前提交
c02be6b96b
共有 5 個文件被更改,包括 489 次插入253 次删除
  1. 409 193
      package-lock.json
  2. 3 2
      package.json
  3. 70 51
      src/app/contact/contact.component.ts
  4. 1 1
      src/app/environments/environment.ts
  5. 6 6
      src/app/home/home.component.html

File diff suppressed because it is too large
+ 409 - 193
package-lock.json


+ 3 - 2
package.json

@@ -26,16 +26,17 @@
     "datatables.net-dt": "^1.13.4",
     "jquery": "^3.6.4",
     "jszip": "^3.10.1",
+    "parse5-html-rewriting-stream": "^7.0.0",
     "rxjs": "~7.5.0",
     "scss": "^0.2.4",
     "sweetalert": "^2.1.2",
     "tslib": "^2.3.0",
-    "xml2js": "^0.4.23",
+    "xml2js": "^0.6.2",
     "zone.js": "~0.12.0"
   },
   "devDependencies": {
     "@angular-devkit/build-angular": "^15.0.2",
-    "@angular/cli": "~15.0.2",
+    "@angular/cli": "^15.2.11",
     "@angular/compiler-cli": "^15.0.0",
     "@types/datatables.net": "^1.10.24",
     "@types/datatables.net-buttons": "^1.4.7",

+ 70 - 51
src/app/contact/contact.component.ts

@@ -16,7 +16,7 @@ import { ViewChild } from '@angular/core'
 })
 export class ContactComponent implements OnInit {
 
-  @ViewChild(DataTableDirective, {static: false})
+  @ViewChild(DataTableDirective, { static: false })
   dtElement: DataTableDirective;
 
 
@@ -47,10 +47,10 @@ export class ContactComponent implements OnInit {
   contactList: any = [];
   contactList1: any = [];
 
-  dtOptions= {};
+  dtOptions = {};
   dtTrigger: Subject<any> = new Subject();
 
-  
+
 
   sucess_flag: boolean = false;
   backtodvr_flag: boolean = false;
@@ -66,7 +66,7 @@ export class ContactComponent implements OnInit {
 
 
   constructor(private commonservice: CommonFunctionService, private router: Router, private fb: FormBuilder) {
-    
+
     this.dtOptions = {
       pagingType: 'full_numbers',
       pageLength: 15,
@@ -76,7 +76,7 @@ export class ContactComponent implements OnInit {
 
       ordering: false,
       dom: 'Blfrtip',
-      
+
       buttons: [
         {
           extend: 'print',
@@ -89,10 +89,10 @@ export class ContactComponent implements OnInit {
 
       ]
     }
- 
-    
-    
-    
+
+
+
+
     console.log("in contact");
     console.log(this.router.url);
     var url = this.router.url;
@@ -155,12 +155,12 @@ export class ContactComponent implements OnInit {
 
 
 
-  
 
 
-    
+
+
     this.contactList = [];
-   
+
 
     this.loginData.push(JSON.parse(localStorage.getItem("loginData")));
     console.log("", this.loginData[0]["user_name"]);
@@ -188,13 +188,13 @@ export class ContactComponent implements OnInit {
 
       this.commonservice.getAllData(this.commonservice.projectpath + "/getcustcontactdetails?customer_id=0&passid=number").subscribe(response => {
         if (response.status == 'falsetoken') {
-              this.router.navigate(['/login'])
-            } else {
-              this.contactList = response.data[0].conrtactData;
-              console.log("aaaaaaaaaaa------------>", this.contactList);
-              this.dtTrigger.next(this.dtOptions)
-    
-            }
+          this.router.navigate(['/login'])
+        } else {
+          this.contactList = response.data[0].conrtactData;
+          console.log("aaaaaaaaaaa------------>", this.contactList);
+          this.dtTrigger.next(this.dtOptions)
+
+        }
       });
     }
 
@@ -208,7 +208,7 @@ export class ContactComponent implements OnInit {
       }
     });
 
-   
+
 
 
     this.contactForm = new FormGroup({
@@ -314,18 +314,29 @@ export class ContactComponent implements OnInit {
               }
               else if (response.data.length > 0) {
                 console.log("inside if(response.message== '') 99999999999")
-                this.backtodvr_flag = true;
-                console.log("response.data[0].lastinsertedData", response.data[0].lastinsertedData);
-                localStorage.setItem('contactlastinsert', response.data[0].lastinsertedData);
-                this.openPopup();
-                this.status_msg = "Success";
-                this.error_msg = response.data[0].message;
-                // console.log("response.data.message", response.data[0].exception.errorid);
-                if (response.data[0].exception.errorid != '') {
+                if (response.data[0].createStatus == 1 && response.data[0].exception.errorid == 400) {
+                  console.log("duplicate contact");
+                   this.openPopup();
+                    this.status_msg = "Warning";
+                    this.error_msg = response.data[0].exception.errormessage;
+                }else{
+                  this.backtodvr_flag = true;
+                  console.log("response.data[0].lastinsertedData", response.data[0].lastinsertedData);
+                  localStorage.setItem('contactlastinsert', response.data[0].lastinsertedData);
                   this.openPopup();
-                  this.status_msg = "Warning";
-                  this.error_msg = response.errors;
+                  this.status_msg = "Success";
+                  this.error_msg = response.data[0].message;
+                  // console.log("response.data.message", response.data[0].exception.errorid);
+                  if (response.data[0].exception.errorid != '') {
+                    this.openPopup();
+                    this.status_msg = "Warning";
+                    this.error_msg = response.errors;
+                  }
                 }
+              } else if (response.data[0].createStatus == 1 && response.data[0].exception.errorid == 400) {
+                this.openPopup();
+                this.status_msg = "Warning";
+                this.error_msg = response.errors;
               }
               else {
                 this.status_msg = "";
@@ -415,26 +426,34 @@ export class ContactComponent implements OnInit {
               }
               else if (response.data.length > 0) {
                 console.log("inside if(response.message== '')222222222222 ")
-                this.openPopup();
-                this.status_msg = "Success";
-                this.error_msg = response.data[0].message;
-                this.checkfirstnm_flag = true;
-                this.mySelect = "";
-                this.contactForm = new FormGroup({
-                  first_name: new FormControl('', Validators.required),
-                  last_name: new FormControl('', Validators.required),
-                  mobile_number: new FormControl('', [Validators.required, Validators.maxLength(10)]),
-                  designation: new FormControl(null, Validators.required),
-                  email_Id: new FormControl('', Validators.required),
-                  department: new FormControl('', Validators.required),
-                  function: new FormControl('', Validators.required),
-                })
-                // console.log("response.data.message", response.data[0].exception.errorid);
-                if (response.data[0].exception.errorid != '') {
+                if (response.data[0].createStatus == 1 && response.data[0].exception.errorid == 400) {
+                  console.log("duplicate contact");
+                   this.openPopup();
+                    this.status_msg = "Warning";
+                    this.error_msg = response.data[0].exception.errormessage;
+                } else {
                   this.openPopup();
-                  this.status_msg = "Warning";
-                  this.error_msg = response.errors;
+                  this.status_msg = "Success";
+                  this.error_msg = response.data[0].message;
+                  this.checkfirstnm_flag = true;
+                  this.mySelect = "";
+                  this.contactForm = new FormGroup({
+                    first_name: new FormControl('', Validators.required),
+                    last_name: new FormControl('', Validators.required),
+                    mobile_number: new FormControl('', [Validators.required, Validators.maxLength(10)]),
+                    designation: new FormControl(null, Validators.required),
+                    email_Id: new FormControl('', Validators.required),
+                    department: new FormControl('', Validators.required),
+                    function: new FormControl('', Validators.required),
+                  })
+                  // console.log("response.data.message", response.data[0].exception.errorid);
+                  if (response.data[0].exception.errorid != '') {
+                    this.openPopup();
+                    this.status_msg = "Warning";
+                    this.error_msg = response.errors;
+                  }
                 }
+
               }
               else {
                 this.status_msg = "";
@@ -520,7 +539,7 @@ export class ContactComponent implements OnInit {
       dtInstance.destroy();
       // Call the dtTrigger to rerender again
     });
-  
+
     console.log("data---->", value);
     console.log("customer_id", value.customer_id);
 
@@ -542,7 +561,7 @@ export class ContactComponent implements OnInit {
         this.router.navigate(['/login'])
       } else {
 
-         this.dtTrigger.next(this.dtOptions)
+        this.dtTrigger.next(this.dtOptions)
 
         //console.log("check length",response.data[0]);
         if (response.data[0].getdvrDataStatus == '1') {
@@ -577,7 +596,7 @@ export class ContactComponent implements OnInit {
     });
 
 
-    
+
   }
 
 

+ 1 - 1
src/app/environments/environment.ts

@@ -1,5 +1,5 @@
 export const environment = {
- //projectpath: "http://localhost:9000"
+ //projectpath: "http://localhost:9000/api"
  //projectpath:"http://54.225.129.95:31165",
 //projectpath:"http://52.221.194.168:8000"
 projectpath:"https://dvr.mindcraft.in/api"

+ 6 - 6
src/app/home/home.component.html

@@ -36,7 +36,7 @@
   <div id="content" class="p-4 p-md-5 pt-5">
 
     <!-- admin div -->
-    <div class="col-lg-12  panelcss" *ngIf="role_check=='admin'" style="padding-right:10px;padding-left:10px">
+    <div class="col-lg-12  panelcss"  style="padding-right:10px;padding-left:10px">
       <div class="col-lg-12 row mobilepadding">
         <div class="smm smm1">
           <div class="w3-black pull-left">
@@ -51,7 +51,7 @@
             <div class="col-lg-3" style="margin-bottom:6px;margin-bottom:6px">
 
 
-              <select id='saleperson' *ngIf="check_role==true" name='saleperson' [(ngModel)]="sale_person"
+              <select id='saleperson'  name='saleperson' [(ngModel)]="sale_person"
                 class="form-control" placeholder="Sales Person">
 
                 <option class="dropdown-item"  selected value="undefined">Sales Person</option>
@@ -67,7 +67,7 @@
             <div class="col-lg-3" style="margin-bottom:6px;margin-bottom:6px">
 
 
-              <select id="customer" *ngIf="check_role==true" name='customer' class="form-control" [(ngModel)]="customer"
+              <select id="customer"  name='customer' class="form-control" [(ngModel)]="customer"
                 placeholder="Customer">
                 <option class="dropdown-item" selected value="undefined">Customers</option>
 
@@ -241,7 +241,7 @@
     <!-- admin div -->
 
     <!-- other users -->
-    <div class="col-lg-12  panelcss" *ngIf="role_check=='users'" style="padding-right:10px;padding-left:10px">
+    <!-- <div class="col-lg-12  panelcss" *ngIf="role_check=='users'" style="padding-right:10px;padding-left:10px">
       <div class="col-lg-12 row mobilepadding">
         <div class="smm smm1">
           <div class="w3-black pull-left">
@@ -252,7 +252,7 @@
         </div>
         <div class="smm smm4">
           <div class="pull-right smm2 col-lg-12 row">
-            <!-- <div class="col-lg-0"></div> -->
+            
          
 
             <div class="col-lg-2" style="margin-bottom:6px;padding:0px;margin-bottom:6px">
@@ -402,7 +402,7 @@
         </div>
       </div>
 
-    </div>
+    </div> -->
     <!-- other users -->
 
     <br>

Some files were not shown because too many files changed in this diff