Amr 5 years ago
parent
commit
3ed4e82460
16 changed files with 92 additions and 53 deletions
  1. 2 2
      src/app/dashboard/model-vehicle/model-vehicle-add/model-vehicle-add.component.html
  2. 8 14
      src/app/dashboard/model-vehicle/model-vehicle-list/model-vehicle-list.component.html
  3. 29 2
      src/app/dashboard/model-vehicle/model-vehicle-list/model-vehicle-list.component.ts
  4. 1 1
      src/app/dashboard/register-movement-vehicle/register-movement-vehicle-add/register-movement-vehicle-add.component.html
  5. 17 3
      src/app/dashboard/register-movement-vehicle/register-movement-vehicle-add/register-movement-vehicle-add.component.ts
  6. 3 3
      src/app/dashboard/register-movement-vehicle/register-movement-vehicle-list/register-movement-vehicle-list.component.html
  7. 4 4
      src/app/dashboard/registration-vehicle/registration-vehicle-add/registration-vehicle-add.component.html
  8. 4 4
      src/app/dashboard/registration-vehicle/registration-vehicle-list/registration-vehicle-list.component.html
  9. 4 4
      src/app/dashboard/reports-existing-vehicles/existing-report/existing-report.component.html
  10. 2 2
      src/app/dashboard/vehicle-maintenance/vehicle-maintenance-add/vehicle-maintenance-add.component.html
  11. 2 2
      src/app/dashboard/vehicle-maintenance/vehicle-maintenance-add/vehicle-maintenance-add.component.ts
  12. 6 4
      src/app/dashboard/vehicle-maintenance/vehicle-maintenance-list/vehicle-maintenance-list.component.html
  13. 3 3
      src/app/dashboard/vehicle-movement-report/vehicle-movement-report/vehicle-movement-report.component.html
  14. 1 1
      src/app/dashboard/vehicle/vehicle-add/vehicle-add.component.html
  15. 3 3
      src/app/dashboard/vehicle/vehicle-list/vehicle-list.component.html
  16. 3 1
      src/app/dashboard/vehicle/vehicle-list/vehicle-list.component.ts

+ 2 - 2
src/app/dashboard/model-vehicle/model-vehicle-add/model-vehicle-add.component.html

@@ -4,7 +4,7 @@
       <div class="col-12">
         <ul class="list-unstyled titileLi-w">
           <li class="headingText-w">خدمه الحركه  </li>
-          <li class="headingText-w" style="cursor:pointer" (click)="authSer.perviousLocation()">  تسجبل موديلات المركبات</li>
+          <li class="headingText-w" style="cursor:pointer" (click)="authSer.perviousLocation()">  تسجبل أنواع المركبات</li>
           <li class="headingText-w activeLi-w" style="margin-right:5px"> {{typePage}} </li>
         </ul>
       </div>
@@ -19,7 +19,7 @@
             
             <div class="col-12 col-sm-12 col-md-4">
              <div class="form-group">
-               <label style="float: right; margin-right: 5px">النوع</label>
+               <label style="float: right; margin-right: 5px">الصنف</label>
                  <select class="form-control" name="vehicle_type_id" [ngModel]="formData.vehicle_type_id" required>
                    <option *ngFor="let type of vehicle_types" [value]="type.id">{{type.name}}</option>
                 </select>

+ 8 - 14
src/app/dashboard/model-vehicle/model-vehicle-list/model-vehicle-list.component.html

@@ -4,7 +4,7 @@
     <div class="col-12">
       <ul class="list-unstyled titileLi-w">
         <li class="headingText-w">خدمه المركبات  </li>
-        <li class="headingText-w activeLi-w" style="margin-right:5px"> تسجيل موديلات المركبات</li>
+        <li class="headingText-w activeLi-w" style="margin-right:5px"> تسجيل أنواع المركبات</li>
       </ul>
     </div>
   </div>
@@ -17,7 +17,7 @@
       </div>
       <div class="col-12 col-sm-12 col-md-6 col-lg-6">
         <div class="form-group">
-          <input type="text" placeholder="البحث (باسم الموديل)" class="form-control inputSearchTable-w" style="margin-top:13px;" (input)="filtterFunc($event)"/>
+          <input type="text" placeholder="البحث (باسم النوع)" class="form-control inputSearchTable-w" style="margin-top:13px;" (input)="filtterFunc($event)"/>
           <hr>
         </div>
       </div>
@@ -27,22 +27,22 @@
         <div class="col-12 col-sm-12 col-md-12 col-lg-12">
           <div class="form-group" style="float:right;">
             <span class="spanSelect-w" style="margin-right:10px;">
+                من العناصر يتم عرضها
               <select [ngModel]="dataTableNumber" class="form-control selectButton-w" (input)="onGetValue($event)">
                 <option value="5">5</option>
                 <option value="10">10</option>
                 <option value="15">15</option>
                 <option value="20">20</option>
               </select>
-              من العناصر يتم عرضها
             </span>
           </div>
           <div class="form-group" style="float: right; margin: 0 20px;">
             <span class="spanSelect-w" >
+              النوع
               <select [ngModel]="filtterStatus" style="width:134px;" class="form-control selectButton-w" (input)="onGetValueFiltter($event)">
                   <option value="all"> الكل </option>
                 <option *ngFor="let type of vehicle_types" [value]="type.id">{{type.name}}</option>
               </select>
-                 النوع
             </span>
           </div>
         </div>
@@ -58,27 +58,21 @@
               <input type="checkbox" class="custom-control-input" [(ngModel)]="selectedAll" (change)="selectAll();" id="customCheck" name="example1">
             </div>
           </th>
-          <th>نوع المركبة</th>
-          <th>إسم الموديل</th>
+          <th>صنف المركبة</th>
+          <th>إسم النوع</th>
           <th>الحاله</th>
           <th *ngIf="authSer.showEditBtn">تعديل</th>
         </tr>
       </thead>
       <tbody>
-        <tr *ngFor="let data of dataList | paginate: { itemsPerPage: perPagePagenation, currentPage: currentPage, totalItems: count }; let i = index ">
+        <tr *ngFor="let data of mergedData | paginate: { itemsPerPage: perPagePagenation, currentPage: currentPage, totalItems: count }; let i = index ">
           
           <td>
             <div class="custom-control custom-checkbox centerIneerItem">
               <input type="checkbox" class="custom-control-input" id="{{data.id}}" [(ngModel)]="data.selected" [value]='data' (change)="checkIfAllSelected();">
             </div>
           </td>
-          <td>
-            {{data.vehicle_type_id == '1' ? 'سيارات اسعاف' 
-            : data.vehicle_type_id == '2' ? 'سيارات وانيت' 
-            : data.vehicle_type_id == '5' ? 'سياره مرضي' 
-            : data.vehicle_type_id == '6' ? 'سياره إسعاف' 
-            : 'not found'}} 
-          </td>
+          <td>{{data.vehicle_type_name}}</td>
           <td>{{data.name}}</td>
           <td>{{data.status == '0' ? 'غير فعال' : data.status == '1' ? ' فعال' : 'not found'}}</td>
         <td *ngIf="authSer.showEditBtn"><button type="button" class="btn btn-outline-secondary" (click)="onEdit(data.id)"><i class="fas fa-edit"></i></button></td>

+ 29 - 2
src/app/dashboard/model-vehicle/model-vehicle-list/model-vehicle-list.component.ts

@@ -29,6 +29,8 @@ export class ModelVehicleListComponent implements OnInit {
   dataTableNumber: number = 5;
   pages = [];
   vehicle_types:any[] = [];
+  mergedData = []
+
 
   constructor(private route: ActivatedRoute,
     private userSer: UserService,
@@ -107,14 +109,36 @@ export class ModelVehicleListComponent implements OnInit {
         this.count = response['count'];
         this.perPagePagenation = response['per_page'];
         console.log('xxx', this.dataList)
+        this.mergeToGether()
+
       },
       (error) => {
         console.log(error);
       }
     )
-
+    
   }
 
+  mergeToGether() {
+
+    for (let i = 0, n = this.dataList.length ; i < n ; i++) {
+          for(let ii = 0, m = this.vehicle_types.length; ii < m ; ii++ ){
+            if (this.dataList[i].vehicle_type_id == this.vehicle_types[ii].id) {
+              this.mergedData.push({
+                id: this.dataList[i].id,
+                name: this.dataList[i].name,
+                status: this.dataList[i].status,
+                vehicle_type_id: this.dataList[i].vehicle_type_id,
+                vehicle_type_name: this.vehicle_types[ii].name
+                
+              })
+              console.log('done');
+            }
+          }
+    }
+    console.log(this.mergedData);
+    
+  }
     //make all checkbox of user checked
     selectAll() {
       for (var i = 0; i < this.dataList.length; i++) {
@@ -261,8 +285,11 @@ export class ModelVehicleListComponent implements OnInit {
                 );
               },
               (error) => {
-                console.log(error);
+                // console.log(error);
                 this.spinner.hide();
+                if(error.error.status == 'vehicle type id is already taken'){
+                  this.toastr.warning(' لا يمكن مسح  هذا النوع')
+                }
                 },
               )
           );

+ 1 - 1
src/app/dashboard/register-movement-vehicle/register-movement-vehicle-add/register-movement-vehicle-add.component.html

@@ -19,7 +19,7 @@
 
               <div class="col-12 col-sm-12 col-md-4">
                 <div class="form-group">
-                  <label for="vehicle_type_id" style="float: right; margin-right: 5px">نوع المركبه</label>
+                  <label for="vehicle_type_id" style="float: right; margin-right: 5px">صنف المركبه</label>
                   <select class="form-control" name="vehicle_type_id" (input)="onChangeVehicleType($event)" [disabled]="checkEdit" [(ngModel)]="formData.vehicle_type_id" required>
                     <option *ngFor="let type of vehicle_types" [value]="type.id">{{type.name}}</option>
                   </select>

+ 17 - 3
src/app/dashboard/register-movement-vehicle/register-movement-vehicle-add/register-movement-vehicle-add.component.ts

@@ -282,8 +282,15 @@ export class RegisterMovementVehicleAddComponent implements OnInit {
             },
             (error) => {
               console.log(error);
-              this.toastr.error('خطأ في الخادم ، حاول لاحقاً');
+             
               this.checkSaveclick = false;
+              console.log(error.error.error);
+              if(error.error.error == 'start_mileage_recording can not be greater than end_mileage_recording'){
+                this.toastr.warning('يجب ان يكون عدد كيلو متر البداية اقل من النهاية')
+              }else{
+                this.toastr.error('خطأ في الخادم ، حاول لاحقاً');
+              }
+
             }
           );
         }
@@ -313,9 +320,16 @@ export class RegisterMovementVehicleAddComponent implements OnInit {
               console.log(this.vehicleForm.value['phone'].length);
               if(this.vehicleForm.value['phone'].length < 10) {
                 this.toastr.warning('رقم الجوال يجب أن يكون مكون 10 أرقام')
-              } else {
-                this.toastr.error('خطأ في الخادم ، برجاء المحاوله لاحقا');
+                
+              }else if(error.error.error == 'start_mileage_recording can not be greater than end_mileage_recording'){
+                this.toastr.warning('يجب ان يكون عدد كيلو متر البداية اقل من النهاية')
+              }else{
+                this.toastr.error('خطأ في الخادم ، حاول لاحقاً');
               }
+
+          
+             
+              
             }
           );
         }

+ 3 - 3
src/app/dashboard/register-movement-vehicle/register-movement-vehicle-list/register-movement-vehicle-list.component.html

@@ -2,8 +2,8 @@
     <div class="row">
       <div class="col-12">
           <ul class="list-unstyled titileLi-w">
-            <li class="headingText-w">خدمه التدريب</li>
-            <li class="headingText-w activeLi-w" style="margin-right:5px">تسجيل حركه المتدرب</li>
+            <li class="headingText-w">خدمه الحركة</li>
+            <li class="headingText-w activeLi-w" style="margin-right:5px">تسجيل حركة المركبة</li>
           </ul>
       </div>
     </div>
@@ -50,7 +50,7 @@
               </th>
             <th> إسم الموظف</th>
             <th>الجوال</th>
-            <th> نوع المركبه</th>
+            <th> صنف المركبه</th>
             <th>رقم اللوحه</th>
             <th *ngIf="authSer.showEditBtn">تعديل</th>
           </tr>

+ 4 - 4
src/app/dashboard/registration-vehicle/registration-vehicle-add/registration-vehicle-add.component.html

@@ -4,7 +4,7 @@
       <div class="col-12">
         <ul class="list-unstyled titileLi-w">
           <li class="headingText-w">خدمه الحركه  </li>
-          <li class="headingText-w" style="cursor:pointer" (click)="authSer.perviousLocation()">  تعريف أنواع المركبات</li>
+          <li class="headingText-w" style="cursor:pointer" (click)="authSer.perviousLocation()">  تعريف أصناف المركبات</li>
           <li class="headingText-w activeLi-w" style="margin-right:5px"> {{typePage}} </li>
         </ul>
       </div>
@@ -19,7 +19,7 @@
           
             <div class="col-12 col-sm-12 col-md-4">
               <div class="form-group">
-                <label for="vehicle_type_id" style="float: right; margin-right: 5px">نوع المركبه</label>
+                <label for="vehicle_type_id" style="float: right; margin-right: 5px">صنف المركبه</label>
                 <select class="form-control" name="vehicle_type_id" [ngModel]="formData.vehicle_type_id" (input)="onChangeVehicleType($event)" required>
                   <option *ngFor="let type of vehicle_types" [value]="type.id">{{type.name}}</option>
                 </select>
@@ -28,7 +28,7 @@
 
             <div class="col-12 col-sm-12 col-md-4">
               <div class="form-group">
-                <label for="vehicle_model_id" style="float: right; margin-right: 5px">إسم الموديل <span class="spanReqired-w">*</span></label>
+                <label for="vehicle_model_id" style="float: right; margin-right: 5px">إسم نوع <span class="spanReqired-w">*</span></label>
                 <select class="form-control" name="vehicle_model_id" [ngModel]="formData.vehicle_model_id" required>
                   <option *ngFor="let nameModel of modelNames" [value]="nameModel.id">{{nameModel.name}}</option>
                 </select>
@@ -37,7 +37,7 @@
             
             <div class="col-12 col-sm-12 col-md-4">
               <div class="form-group">
-                <label for="sub_name" style="float: right; margin-right: 5px"> إسم الموديل الفرعي</label>
+                <label for="sub_name" style="float: right; margin-right: 5px"> إسم نوع الفرعي</label>
                 <input type="text" class="form-control" id="sub_name" name="sub_name" placeholder="الأسم" ngModel [ngModel]="formData.sub_name" #name="ngModel"/>
               </div>
             </div>

+ 4 - 4
src/app/dashboard/registration-vehicle/registration-vehicle-list/registration-vehicle-list.component.html

@@ -27,22 +27,22 @@
       <div class="col-12 col-sm-12 col-md-12 col-lg-6">
         <div class="form-group" style="float: right;">
           <span class="spanSelect-w" style="margin-right:10px;">
+              من العناصر يتم عرضها
             <select [ngModel]="dataTableNumber" class="form-control selectButton-w" (input)="onGetValue($event)">
               <option value="5">5</option>
               <option value="10">10</option>
               <option value="15">15</option>
               <option value="20">20</option>
             </select>
-            من العناصر يتم عرضها
           </span>
         </div>
         <div class="form-group">
           <span class="spanSelect-w" style="float: right; margin: 0 20px;">
+              النوع
             <select [ngModel]="filtterStatus" style="width:134px;" class="form-control selectButton-w" (input)="onGetValueFiltter($event)">
                 <option  value="all">الكل</option>
               <option *ngFor="let type of vehicle_types" [value]="type.id">{{type.name}}</option>
             </select>
-                النوع
           </span>
         </div>
       </div>
@@ -56,8 +56,8 @@
               <input type="checkbox" class="custom-control-input" [(ngModel)]="selectedAll" (change)="selectAll();" id="customCheck" name="example1">
             </div>
           </th>
-          <th>نوع المركبه</th>
-          <th>إسم الموديل</th>
+          <th>صنف المركبه</th>
+          <th>إسم نوع</th>
           <th>رقم اللوحه</th>
           <th>اللون</th>
           <th>الحاله</th>

+ 4 - 4
src/app/dashboard/reports-existing-vehicles/existing-report/existing-report.component.html

@@ -16,7 +16,7 @@
         <div class="row">
           <div class="col-12 col-sm-12 col-md-4">
             <div class="form-group">
-              <label style="float: right;margin-right: 5px">نوع المركبه</label>
+              <label style="float: right;margin-right: 5px">صنف المركبه</label>
               <select class="form-control" (input)="typeVehicle($event)">
                 <option>أختر نوع المركبه</option>
                 <option class="form-control" *ngFor="let type of vehicle_types" name="type" [value]="type.id">{{type.name}}</option>
@@ -25,7 +25,7 @@
           </div>
           <div class="col-12 col-sm-12 col-md-4" *ngIf="vehicleTypeId">
             <div class="form-group">
-              <label style="float: right;margin-right: 5px">نوع الموديل</label>
+              <label style="float: right;margin-right: 5px"> النوع</label>
               <select class="form-control" (input)="getReport($event)">
                 <option>أختر نوع الموديل</option>
                 <option value="all"> الكل</option>
@@ -51,8 +51,8 @@
             <table class="table table-bordered">
                 <thead class="headBackground-w">
                   <tr>
-                    <th>نوع المركيه</th>
-                    <th>موديل المركبه</th>
+                    <th>صنف المركيه</th>
+                    <th>نوع المركبه</th>
                     <th>رقم اللوحه</th>
                     <th>الحاله</th>
                     <th>رقم الهيكل</th>

+ 2 - 2
src/app/dashboard/vehicle-maintenance/vehicle-maintenance-add/vehicle-maintenance-add.component.html

@@ -21,7 +21,7 @@
 
             <div class="col-12 col-sm-12 col-md-4">
               <div class="form-group">
-                <label for="vehicle_type_id" style="float: right; margin-right: 5px">نوع المركبه</label>
+                <label for="vehicle_type_id" style="float: right; margin-right: 5px">صنف المركبه</label>
                 <select class="form-control" name="vehicle_type_id" (input)="onChangeVehicleType($event)" [disabled]="checkEdit" [ngModel]="formData.vehicle_type_id" required>
                   <option *ngFor="let type of vehicle_types" [value]="type.id">{{type.name}}</option>
                 </select>
@@ -69,7 +69,7 @@
               </div>
             </div>
 
-            <div class="col-12 col-sm-12 col-md-4" *ngIf="typeMode">
+            <div class="col-12 col-sm-12 col-md-4">
               <div class="form-group">
                 <label for="maintenance_notes" style="float: right;margin-right: 5px">هل تمت الصيانه ؟ <span class="spanReqired-w">*</span></label>
                 ,<select name="is_maintained" class="form-control" ngModel [ngModel]="formData.is_maintained" required>

+ 2 - 2
src/app/dashboard/vehicle-maintenance/vehicle-maintenance-add/vehicle-maintenance-add.component.ts

@@ -238,7 +238,7 @@ export class VehicleMaintenanceAddComponent implements OnInit {
 
     delete this.vehicleForm.value['vehicle_type_id'];
 
-    console.log(this.vehicleForm.value);
+    console.log(this.formData);
 
     const startDateData = this.startDate.split('-');
     const endDateData = this.endDate.split('-');
@@ -254,7 +254,7 @@ export class VehicleMaintenanceAddComponent implements OnInit {
         this.toastr.warning(' يوم تاريخ الإنتهاء يجب أن يكون أكبر من يوم تاريخ الإبتداء!');
         this.checkSaveclick = false;
       } else {
-        this.dashBoardSer.editItem(this.maintenanceVehicleId,this.vehicleForm.value, 'vehicleMaintenance').subscribe(
+        this.dashBoardSer.editItem(this.maintenanceVehicleId,this.formData, 'vehicleMaintenance').subscribe(
           (responce) => {
             console.log(responce);
             this.toastr.success('تم التعديل بنجاح');

+ 6 - 4
src/app/dashboard/vehicle-maintenance/vehicle-maintenance-list/vehicle-maintenance-list.component.html

@@ -27,22 +27,22 @@
       <div class="col-12 col-sm-12 col-md-12">
         <div class="form-group" style="float: right;">
           <span class="spanSelect-w">
+            من العناصر يتم عرضها
             <select [ngModel]="dataTableNumber" class="form-control selectButton-w" (input)="onGetValue($event)">
               <option value="5">5</option>
               <option value="10">10</option>
               <option value="15">15</option>
               <option value="20">20</option>
             </select>
-            من العناصر يتم عرضها
           </span>
         </div>
         <div class="form-group" style="float: right; margin: 0 20px;">
-          <span class="spanSelect-w" >
+            <span class="spanSelect-w" >
+                النوع
             <select [ngModel]="filtterStatus" style="width:134px;" class="form-control selectButton-w" (input)="onGetValueFiltter($event)">
                 <option value="all"> الكل </option>
               <option *ngFor="let type of vehicle_types" [value]="type.id">{{type.name}}</option>
             </select>
-              النوع
           </span>
         </div>
       </div>
@@ -56,8 +56,9 @@
                   <input type="checkbox" class="custom-control-input" [(ngModel)]="selectedAll" (change)="selectAll();" id="customCheck" name="example1">
                 </div>
             </th>
-          <th> نوع المركبه</th>
+          <th> صنف المركبه</th>
           <th>رقم اللوحه</th>
+          <th>هل تمت الصيانة</th>
           <th *ngIf="authSer.showEditBtn">تعديل</th>
         </tr>
       </thead>
@@ -71,6 +72,7 @@
           </td>
           <td>{{data.vehicle_type_name}}</td>
           <td>{{data.vehicle_plate_number}}</td>
+          <td>{{data.is_maintained == 0 ? 'لا' : 'نعم'}}</td>
           <td *ngIf="authSer.showEditBtn"><button type="button" class="btn btn-outline-secondary" (click)="onEdit(data.id)"><i class="fas fa-edit"></i></button></td>
         </tr>
       </tbody>

+ 3 - 3
src/app/dashboard/vehicle-movement-report/vehicle-movement-report/vehicle-movement-report.component.html

@@ -26,11 +26,11 @@
             <div class="col-12">
               <div class="row v3" style="margin: 20px" >
                   <div class="col-4 pull-right d3">
-                      <span class="title"> نوع المركيه:</span>
+                      <span class="title"> صنف المركيه:</span>
                       <span class="result">{{ vehicleData[0].vehicle_type_name }}</span>
                   </div>
                   <div class="col-4 d3">
-                      <span  class="title"> موديل المركبه:</span>
+                      <span  class="title"> نوع المركبه:</span>
                       <span class="result">{{ vehicleData[0].vehicle_model_name }}</span>
                   </div>
                   <div class="col-4 d3">
@@ -75,7 +75,7 @@
                 </tbody>
               </table> 
 
-              <h2 style="float:right; font-size: 18px; margin: 20px 10px;">تقرير الصيانه</h2>
+              <!-- <h2 style="float:right; font-size: 18px; margin: 20px 10px;">تقرير الصيانه</h2> -->
               <table class="table table-bordered" *ngIf='showTableData2'>
                   <thead class="headBackground-w">
                     <tr>

+ 1 - 1
src/app/dashboard/vehicle/vehicle-add/vehicle-add.component.html

@@ -4,7 +4,7 @@
       <div class="col-12">
         <ul class="list-unstyled titileLi-w">
           <li class="headingText-w">خدمه الحركه  </li>
-          <li class="headingText-w" style="cursor:pointer" (click)="authSer.perviousLocation()">  تعريف أنواع المركبات</li>
+          <li class="headingText-w" style="cursor:pointer" (click)="authSer.perviousLocation()">  تعريف أصناف المركبات</li>
           <li class="headingText-w activeLi-w" style="margin-right:5px"> {{typePage}} </li>
         </ul>
       </div>

+ 3 - 3
src/app/dashboard/vehicle/vehicle-list/vehicle-list.component.html

@@ -4,7 +4,7 @@
     <div class="col-12">
       <ul class="list-unstyled titileLi-w">
         <li class="headingText-w">خدمه المركبات  </li>
-        <li class="headingText-w activeLi-w" style="margin-right:5px"> تعريف أنواع المركبات</li>
+        <li class="headingText-w activeLi-w" style="margin-right:5px"> تعريف أصناف المركبات</li>
       </ul>
     </div>
   </div>
@@ -17,7 +17,7 @@
       </div>
       <div class="col-12 col-sm-12 col-md-6 col-lg-6">
         <div class="form-group">
-          <input type="text" placeholder="البحث (نوع المركبة)" class="form-control inputSearchTable-w" style="margin-top:13px;" (input)="filtterFunc($event)"/>
+          <input type="text" placeholder="البحث (صنف المركبة)" class="form-control inputSearchTable-w" style="margin-top:13px;" (input)="filtterFunc($event)"/>
           <hr>
         </div>
       </div>
@@ -50,7 +50,7 @@
               <input type="checkbox" class="custom-control-input" [(ngModel)]="selectedAll" (change)="selectAll();" id="customCheck" name="example1">
             </div>
           </th>
-          <th>إسم النوع</th>
+          <th>إسم الصنف</th>
           <th>الحاله</th>
           <th *ngIf="authSer.showEditBtn">تعديل</th>
         </tr>

+ 3 - 1
src/app/dashboard/vehicle/vehicle-list/vehicle-list.component.ts

@@ -228,8 +228,10 @@ export class VehicleListComponent implements OnInit {
               );
             },
             (error) => {
-              console.log(error);
               this.spinner.hide();
+              if(error.error.status == 'vehicle type id is already taken'){
+                this.toastr.warning(' لا يمكن مسح  هذا الصنف')
+              }
               },
             )
         );