Devansh Vakharia 1 周之前
父節點
當前提交
3fc3941f26

+ 4 - 1
src/app/contact/contact.component.html

@@ -31,7 +31,7 @@
                     </a>
                 </li>
                 <li style="text-align:center" *ngIf="role == 'admin'">
-                    <a routerLink="/customer"><span class="fa fa-file-text "></span>
+                    <a routerLink="/customer"><span class="fa fa-building"></span>
                         <p style="font-size:15px;margin-bottom: 0px;">Customer</p>
                     </a>
                 </li>
@@ -191,6 +191,9 @@
                                         <input type="email" class="form-control " formControlName='email_Id'
                                             name="email_Id" pattern="^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,4}$">
                                         <label for="Id" class="animated-label">Email ID<span style="color: red;"> *</span></label>
+                                    <app-field-error-display [displayError]="isFieldValid('email_Id')"
+                                        errorMsg="Please enter Email ID">
+                                    </app-field-error-display>
                                     </div>
 
 

+ 25 - 9
src/app/contact/contact.component.ts

@@ -329,7 +329,23 @@ $(document).on('click', function () {
       if (response.status == 'falsetoken') {
         this.router.navigate(['/login'])
       } else {
+        // this.cust_data = response.data[0].customerData;
         this.cust_data = response.data[0].customerData;
+        if(this.role === 'users') {
+          this.cust_data = this.cust_data.filter(item => item.first_name + " " + item.last_name === this.login_name);
+        }
+        this.cust_data = Array.from(
+        new Map(
+          this.cust_data.map(item => [
+            `${item.customer_id}-${item.customer_name}`,
+            {
+              customer_id: item.customer_id,
+              customer_name: item.customer_name
+            }
+          ])
+        ).values()
+      );
+        console.log(this.cust_data);
         console.log("yyyyyyyyyyyyyy");
 
       }
@@ -433,7 +449,7 @@ $(document).on('click', function () {
                 console.log("inside if")
                 this.openPopup();
                 this.status_msg = "Warning";
-                this.error_msg = response.errors;
+                this.error_msg = response.error;
               } else if (response.data.length > 0) {
                 console.log("inside else condition ")
 
@@ -447,7 +463,7 @@ $(document).on('click', function () {
                 if (response.data[0].exception.errorid != '') {
                   this.openPopup();
                   this.status_msg = "Warning";
-                  this.error_msg = response.errors;
+                  this.error_msg = response.error;
                 }
               }
               else {
@@ -460,7 +476,7 @@ $(document).on('click', function () {
                 console.log("inside if")
                 this.openPopup();
                 this.status_msg = "Warning";
-                this.error_msg = response.errors;
+                this.error_msg = response.error;
               }
               else if (response.data.length > 0) {
                 console.log("inside if(response.message== '') 99999999999")
@@ -480,13 +496,13 @@ $(document).on('click', function () {
                   if (response.data[0].exception.errorid != '') {
                     this.openPopup();
                     this.status_msg = "Warning";
-                    this.error_msg = response.errors;
+                    this.error_msg = response.error;
                   }
                 }
               } else if (response.data[0].createStatus == 1 && response.data[0].exception.errorid == 400) {
                 this.openPopup();
                 this.status_msg = "Warning";
-                this.error_msg = response.errors;
+                this.error_msg = response.error;
               }
               else {
                 this.status_msg = "";
@@ -538,7 +554,7 @@ $(document).on('click', function () {
                 console.log("inside if")
                 this.openPopup();
                 this.status_msg = "Warning";
-                this.error_msg = response.errors;
+                this.error_msg = response.error;
               } else if (response.data.length > 0) {
                 console.log("inside if(response.message== '')6666666666 ")
                 this.openPopup();
@@ -561,7 +577,7 @@ $(document).on('click', function () {
                 if (response.data[0].exception.errorid != '') {
                   this.openPopup();
                   this.status_msg = "Warning";
-                  this.error_msg = response.errors;
+                  this.error_msg = response.error;
                 }
               }
               else {
@@ -574,7 +590,7 @@ $(document).on('click', function () {
                 console.log("inside if")
                 this.openPopup();
                 this.status_msg = "Warning";
-                this.error_msg = response.errors;
+                this.error_msg = response.error || response.data[0].exception.errormessage;
               }
               else if (response.data.length > 0) {
                 console.log("inside if(response.message== '')222222222222 ")
@@ -603,7 +619,7 @@ $(document).on('click', function () {
                   if (response.data[0].exception.errorid != '') {
                     this.openPopup();
                     this.status_msg = "Warning";
-                    this.error_msg = response.errors;
+                    this.error_msg = response.error || response.data[0].exception.errormessage;
                   }
                 }
 

+ 12 - 9
src/app/createentry/dvrentry.component.html

@@ -31,7 +31,7 @@
           </a>
         </li>
         <li style="text-align:center" *ngIf="role == 'admin'">
-          <a routerLink="/customer"><span class="fa fa-file-text "></span>
+          <a routerLink="/customer"><span class="fa fa-building"></span>
             <p style="font-size:15px;margin-bottom: 0px;">Customer</p>
           </a>
         </li>
@@ -221,10 +221,10 @@
                       <div class="input-group" style="margin-top: 10px;">
 
                         <div class="switch-field">
-                          <input type="radio" id="radio-one1" name="switch-one1" value="yes" formControlName="ph_meet"
+                          <input type="radio" id="radio-one1" name="ph_meet" value="yes" formControlName="ph_meet"
                             checked />
                           <label for="radio-one1">Yes</label>
-                          <input type="radio" id="radio-two1" name="switch-one1" value="no" formControlName="ph_meet" />
+                          <input type="radio" id="radio-two1" name="ph_meet" value="no" formControlName="ph_meet" />
                           <label for="radio-two1">No</label>
                         </div>
                       </div>
@@ -405,27 +405,30 @@
                 <td>{{current.customer_name }}</td>
                 <td>{{current.contact_name }}</td>
                 <td>{{current.second_contact }}</td>
-                <td style="    width: 85%;
+                <!-- <td style="    width: 85%;
              
                 min-height: 150px !important;
               
                 display: block;
-                overflow-x: auto;">{{current.nextstep }}</td>
+                overflow-x: auto;">{{current.nextstep }}</td> -->
+                <td>{{ current.nextstep }}</td>
                 <td>{{current.physical_meeting | titlecase}}</td>
-                <td style="    width: auto;
+                <!-- <td style="    width: auto;
              
                 min-height: 150px !important;
               
                 display: block;
-                overflow-x: auto;">{{current.message }}</td>
+                overflow-x: auto;">{{current.message }}</td> -->
+                <td>{{ current.message }}</td>
                 <td>{{current.stage_desc }}</td>
                 <td>{{current.est_Date | datePipe}}</td>
-                <td style="    width: auto;
+                <!-- <td style="    width: auto;
              
                 min-height: 150px !important;
               
                 display: block;
-                overflow-x: auto;">{{current.objective}}</td>
+                overflow-x: auto;">{{current.objective}}</td> -->
+                <td>{{current.objective}}</td>
                 <td>{{current.estvalue}}</td>
                 <td>{{current.func}}</td>
                 <td>{{current.person}}</td>

+ 21 - 21
src/app/createentry/dvrentry.component.ts

@@ -295,12 +295,12 @@ export class DvrEntryComponent implements OnInit, OnDestroy {
     console.log("min date------>", this.mincurrent_date);
     document.getElementById("Date").setAttribute("min", this.mincurrent_date);
 
-
-
-
-
-
-
+    this.logindata.push(JSON.parse(localStorage.getItem("loginData")));
+    this.username = this.logindata[0]["user_name"];
+    this.last_login_date = this.logindata[0]["last_loginDate"];
+    this.login_id = this.logindata[0]["user_id"];
+    this.role = this.logindata[0]["role"];
+    console.log(" this.logindata=========>", this.login_id, this.role);
 
     this.commonservice.getAllData(this.commonservice.projectpath + "/getselectionData").subscribe(response => {
       if (response.status == 'falsetoken') {
@@ -309,6 +309,21 @@ export class DvrEntryComponent implements OnInit, OnDestroy {
       }
       else {
         this.cust_data = response.data[0].customerData;
+        if(this.role === 'users') {
+          this.cust_data = this.cust_data.filter(item => item.first_name + " " + item.last_name === this.username);
+        }
+        this.cust_data = Array.from(
+        new Map(
+          this.cust_data.map(item => [
+            `${item.customer_id}-${item.customer_name}`,
+            {
+              customer_id: item.customer_id,
+              customer_name: item.customer_name
+            }
+          ])
+        ).values()
+      );
+        console.log(this.cust_data);
         this.contact_data = response.data[1].contactData;
         console.log(" this.contact_data ", this.contact_data);
         this.stage_data = response.data[2].stageData;
@@ -318,21 +333,6 @@ export class DvrEntryComponent implements OnInit, OnDestroy {
       }
     });
 
-
-
-
-
-
-    this.logindata.push(JSON.parse(localStorage.getItem("loginData")));
-    this.username = this.logindata[0]["user_name"];
-    this.last_login_date = this.logindata[0]["last_loginDate"];
-    this.login_id = this.logindata[0]["user_id"];
-    this.role = this.logindata[0]["role"];
-    console.log(" this.logindata=========>", this.login_id, this.role);
-
-
-
-
     this.commonservice.getAllData(this.commonservice.projectpath + "/getlastestdvr?role=" + this.role + "&login_id=" + this.login_id).subscribe(response => {
       if (response.status == 'falsetoken') {
         this.router.navigate(['/login'])

+ 3 - 3
src/app/customer/customer.component.html

@@ -18,7 +18,7 @@
                         <p style="font-size:15px;margin-bottom: 0px;"> Home</p>
                     </a>
                 </li>
-                <li style="text-align:center;background: #d9d5d5">
+                <li style="text-align:center;">
                     <a routerLink="/contactDetails"><span class="fa fa-user "></span>
 
                         <p style="font-size:15px;margin-bottom: 0px;">Contact</p>
@@ -30,8 +30,8 @@
                         <p style="font-size:15px;margin-bottom: 0px;"> DVR Entry</p>
                     </a>
                 </li>
-                <li style="text-align:center" *ngIf="role == 'admin'">
-                    <a routerLink="/customer"><span class="fa fa-file-text "></span>
+                <li style="text-align:center; background: #d9d5d5" *ngIf="role == 'admin'">
+                    <a routerLink="/customer"><span class="fa fa-building"></span>
                         <p style="font-size:15px;margin-bottom: 0px;">Customer</p>
                     </a>
                 </li>

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

@@ -1,7 +1,7 @@
 export const environment = {
-//  projectpath: "http://localhost:9000/api"
+ 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"
+// projectpath:"https://dvr.mindcraft.in/api"
 
 }

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

@@ -26,7 +26,7 @@
         </a>
       </li>
       <li style="text-align:center" *ngIf="role_check == 'admin'">
-        <a routerLink="/customer"><span class="fa fa-user "></span>
+        <a routerLink="/customer"><span class="fa fa-building"></span>
           <p style="font-size:15px;margin-bottom: 0px;">Customer</p>
         </a>
       </li>

+ 24 - 13
src/app/home/home.component.ts

@@ -153,17 +153,6 @@ export class HomeComponent implements OnInit {
       }
     });
 
-
-    this.commonservice.getAllData(this.commonservice.projectpath + "/getselectionData").subscribe(response => {
-      if (response.status == 'falsetoken') {
-        this.router.navigate(['/login'])
-
-      }
-      else {
-        this.cust_data = response.data[0].customerData;
-      }
-    });
-
     this.logindata.push(JSON.parse(localStorage.getItem("loginData")));
     this.username = this.logindata[0]["user_name"];
     this.last_login_date = this.logindata[0]["last_loginDate"];
@@ -176,9 +165,31 @@ export class HomeComponent implements OnInit {
       this.check_role = true
     }
 
+    this.commonservice.getAllData(this.commonservice.projectpath + "/getselectionData").subscribe(response => {
+      if (response.status == 'falsetoken') {
+        this.router.navigate(['/login'])
 
-
-
+      }
+      else {
+        // this.cust_data = response.data[0].customerData;
+        this.cust_data = response.data[0].customerData;
+        if(!this.check_role) {
+          this.cust_data = this.cust_data.filter(item => item.first_name + " " + item.last_name === this.username);
+        }
+        this.cust_data = Array.from(
+        new Map(
+          this.cust_data.map(item => [
+            `${item.customer_id}-${item.customer_name}`,
+            {
+              customer_id: item.customer_id,
+              customer_name: item.customer_name
+            }
+          ])
+        ).values()
+      );
+        console.log(this.cust_data);
+      }
+    });
 
     this.commonservice.getAllData(this.commonservice.projectpath + "/getdashboarddetails?login_id=" + this.user_id).subscribe(response => {