<nz-modal [nzWidth]="780" [(nzVisible)]="isVisiable" [nzTitle]="title" (nzOnCancel)="handleCancel()"
          (nzOnOk)="handleOk()" [nzFooter]="showModalFooter">
    <div *ngIf="title == '团队成员'" class="padding-10">
        <button (click)="showAddModal()" nz-button nzType="default"><i class="anticon anticon-plus-circle-o"></i>新增人员
        </button>
        <button (click)="showDeleteModal()" nz-button nzType="default"><i class="anticon anticon-minus-circle-o"></i>减少人员
        </button>
    </div>
    <nz-table #basicTable [nzData]="page.list"
              [nzFrontPagination]="false" [nzTotal]="page.totalNum" [nzPageIndex]="page.pageNum"
              [nzPageSize]="page.pageCount"
              (nzCurrentPageDataChange)="PageDataChange($event)"
              (nzPageIndexChange)="changePage($event)">
        <thead>
        <tr>
            <th>序号</th>
            <th>姓名</th>
            <th>角色</th>
            <th>职称</th>
            <th>手机号</th>
            <th>到岗日期</th>
        </tr>
        </thead>
        <tbody>
        <tr *ngFor="let data of basicTable.data">
            <td nzShowCheckbox [(nzChecked)]="data.checked" (nzCheckedChange)="selectItem(data,$event)"></td>
            <td>{{data.userName}}</td>
            <td>
                <span *ngIf="data.principal == 0">团队成员</span>
                <span *ngIf="data.principal == 1">团队负责人</span>
            </td>
            <td>
                <span *ngIf="data.title == '0'">无</span>
                <span *ngIf="data.title == '1'">中级职称以上</span>
                <span *ngIf="data.title == '2'">程序员</span>
                <span *ngIf="data.title == '3'">本科</span>
                <span *ngIf="data.title == '4'">专科</span>
            </td>
            <td>{{data.phone}}</td>
            <td>{{data.arrivalDate | date:'yyyy-MM-dd'}}</td>
        </tr>
        </tbody>
    </nz-table>

    <ng-template #modalFooter>
        <button nz-button nzType="default" (click)="handleCancel()">取消</button>
        <button nz-button nzType="primary" (click)="handleOk()">确定</button>
    </ng-template>
</nz-modal>

<nz-modal [(nzVisible)]="delete.isVisiable" nzTitle="减少人员" (nzOnCancel)="delete.isVisiable = false"
          (nzOnOk)="deleteTaamPeople()" [nzOkLoading]="delete.isOkLoading">
    <div nz-form>
        <nz-form-item>
            <nz-form-label [nzSpan]="7" nzRequired nzFor="name">离岗时间</nz-form-label>
            <nz-form-control [nzSpan]="12">
                <nz-date-picker [nzFormat]="'yyyy-MM-dd'" [(ngModel)]="delete.leaveDate" nzShowTime></nz-date-picker>
            </nz-form-control>
        </nz-form-item>
    </div>
</nz-modal>

<smart-team-people #smartTeamPeople (done)="getList()"></smart-team-people>
