Browse Source

refused status

Hima 6 years ago
parent
commit
45603c4ed0

+ 10 - 3
src/app/dashboard/reivew-trainee-data/review-trainee-add/review-trainee-add.component.html

@@ -140,7 +140,7 @@
                         <label for="file{{i}}" class="iconUpload-w"><i class="fas fa-upload"></i></label>
                         <span class="fileName-w">{{file.nameFile}}</span>
                       </td>
-                      <th *ngIf="typeMode" style="text-align:center"><a href="{{authSer.pathImg + file.nameFile}}" target="_blank"><i class="fas fa-download"></i></a></th>
+                      <th *ngIf="typeMode" style="text-align:center"><a *ngIf="file.nameFile" href="{{authSer.pathImg + file.nameFile}}" target="_blank"><i class="fas fa-download"></i></a></th>
                       <td><button type="button" class="btn btn-danger form-control deleteRow-w" (click)="onDeleteRow(i)">حذف</button></td>
                     </tr>
                   </tbody>
@@ -276,7 +276,7 @@
                 </div>
                 <div class="col-12 col-sm-12 col-md-4 col-lg-4"  *ngIf="editMode">
                   <div class="form-group">
-                    <label for="department4" style="float:right;">القسم المناسب</label>
+                    <label for="department4" style="float:right;">القسم المناسب للتدريب</label>
                     <select class="form-control selectStyle-w" id="department4" name="department4" [(ngModel)]="formData.department4">
                       <option *ngFor="let department of chosenDepartments" [value]="department.department_id">{{department.department_name}}</option>
                     </select>
@@ -290,7 +290,14 @@
                     <button type="button" class="btn btn-success statusBtn-w" (click)="statusShow('accepted')">قبول</button>
                     <button type="button" class="btn btn-danger statusBtn-w" (click)="statusShow('refused')">رفض</button>
                     <button type="button" class="btn btn-default statusBtn-w" (click)="statusShow('asked_for_opinion')">طلب رأي</button>
-                    <input type="text" placeholder="سبب الرفض" class="form-control" name="status_description" ngModel [(ngModel)]="formData.status_description" *ngIf="showRefusedCause" required>
+                    <div class="row" *ngIf="showRefusedCause">
+                      <div class="col-12">
+                        <div class="form-group">
+                          <label for="department4" style="float:right;">سبب الرفض</label>
+                          <input type="text" placeholder="سبب الرفض" class="form-control" name="status_description" ngModel [(ngModel)]="formData.status_description" required>
+                        </div>
+                      </div>
+                    </div>
                   </div>
                 </div>
 

+ 3 - 1
src/app/dashboard/reivew-trainee-data/review-trainee-add/review-trainee-add.component.ts

@@ -242,7 +242,7 @@ export class ReviewTraineeAddComponent implements OnInit {
     statusData.status = typeStatus;
   
 
-    if(typeStatus == 'refused') {
+    if(typeStatus == 'refused' && this.formData['department4'] != '') {
       this.showRefusedCause = true;
     }
 
@@ -254,6 +254,7 @@ export class ReviewTraineeAddComponent implements OnInit {
     
       if(typeStatus == 'accepted') {
         this.formData.status = typeStatus;
+        this.formData.status_description = '';
         this.toastr.success('تم تسجيل الحاله مقبول');
         this.showRefusedCause = false;
       } else if(typeStatus == 'refused') {
@@ -264,6 +265,7 @@ export class ReviewTraineeAddComponent implements OnInit {
       } else if(typeStatus == 'asked_for_opinion') {
         this.formData.status = typeStatus;
         this.showRefusedCause = false;
+        this.formData.status_description = '';
         this.toastr.warning('تم تسجيل الحاله طلب رأي ');
       }
 

+ 62 - 52
src/app/dashboard/reivew-trainee-data/review-trainee-data-list/review-trainee-data-list.component.html

@@ -60,59 +60,69 @@
         </div>
       </div>
   
-      <table class="table table-bordered">
-        <thead class="headBackground-w">
-          <tr>
-            <th>
-              <div class="custom-control custom-checkbox">
-                  <input type="checkbox" class="custom-control-input" [(ngModel)]="selectedAll" (change)="selectAll();" id="customCheck" name="example1">
-                  <!-- <label class="custom-control-label fixedWidthLabel-w checkAll-w" for="customCheck" style="margin-bottom:20px; cursor: pointer;"></label> -->
-              </div>
-            </th>
-            <th> إسم المتدرب</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 ">
-            <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();">
-                <!-- <label class="custom-control-label disblayBlock-w" for="{{news.id}}" style="color:#2a2a2a;cursor: pointer;"></label> -->
-              </div>
-            </td>
-            <td>{{data.trainee_name}}</td>
-            <td> {{data.specialization_name}}</td>
-            <td>{{data.country_arNationality}}</td>
-            <td>{{data.university}}</td>
-            <!-- <td>{{data.type == 'trainees' ? 'متدربين' 
-              : data.type == 'fellowship' ? 'زماله' 
-              : data.type == 'university_administrators' : 'مشرفي الجامعات'
-              : 'لايوجد'}}
-            </td> -->
-            <td>{{data.type == 'trainees' ? 'متدربين' 
-                : data.type == 'fellowship' ? 'زماله' 
-                : data.type == 'university_administrators' ? 'مشرفي الجامعات'
-                : 'لايوجد'}}
-            </td>
+      <div class="row" *ngIf="dataList.length == 0">
+        <div class="col-12">
+          <h2>لايوجد بيانات لعرضها</h2>
+        </div>
+      </div>
 
-            <td>{{data.status == 'pending' ? 'تحت الإجراء' 
-              : data.status == 'accepted' ? 'مقبول' 
-              : data.status == 'replayed_opinion' ? 'رأي القسم'
-              : data.status == 'refused' ? 'مرفوض' 
-              : data.status == 'canceled' ? 'ملغي'
-              : data.status == 'asked_for_opinion' ? 'طلب رأي'
-              : data.status == 'asked_for_opinion' ? 'طلب رأي' : 'لايوجد'}}</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>
-      </table>
-      <pagination-controls nextLabel="التالي" previousLabel="السابق" (pageChange)="onPageChange($event)"></pagination-controls>
+      <div class="row" *ngIf="dataList.length > 0">
+        <div class="col-12">
+          <table class="table table-bordered">
+              <thead class="headBackground-w">
+                <tr>
+                  <th>
+                    <div class="custom-control custom-checkbox">
+                        <input type="checkbox" class="custom-control-input" [(ngModel)]="selectedAll" (change)="selectAll();" id="customCheck" name="example1">
+                        <!-- <label class="custom-control-label fixedWidthLabel-w checkAll-w" for="customCheck" style="margin-bottom:20px; cursor: pointer;"></label> -->
+                    </div>
+                  </th>
+                  <th> إسم المتدرب</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 ">
+                  <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();">
+                      <!-- <label class="custom-control-label disblayBlock-w" for="{{news.id}}" style="color:#2a2a2a;cursor: pointer;"></label> -->
+                    </div>
+                  </td>
+                  <td>{{data.trainee_name}}</td>
+                  <td> {{data.specialization_name}}</td>
+                  <td>{{data.country_arNationality}}</td>
+                  <td>{{data.university}}</td>
+                  <!-- <td>{{data.type == 'trainees' ? 'متدربين' 
+                    : data.type == 'fellowship' ? 'زماله' 
+                    : data.type == 'university_administrators' : 'مشرفي الجامعات'
+                    : 'لايوجد'}}
+                  </td> -->
+                  <td>{{data.type == 'trainees' ? 'متدربين' 
+                      : data.type == 'fellowship' ? 'زماله' 
+                      : data.type == 'university_administrators' ? 'مشرفي الجامعات'
+                      : 'لايوجد'}}
+                  </td>
+      
+                  <td>{{data.status == 'pending' ? 'تحت الإجراء' 
+                    : data.status == 'accepted' ? 'مقبول' 
+                    : data.status == 'replayed_opinion' ? 'رأي القسم'
+                    : data.status == 'refused' ? 'مرفوض' 
+                    : data.status == 'canceled' ? 'ملغي'
+                    : data.status == 'asked_for_opinion' ? 'طلب رأي'
+                    : data.status == 'asked_for_opinion' ? 'طلب رأي' : 'لايوجد'}}</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>
+            </table>
+            <pagination-controls nextLabel="التالي" previousLabel="السابق" (pageChange)="onPageChange($event)"></pagination-controls>        
+        </div>
+      </div>
     </div>