<div class="list-template">
  <div class="list-template__content">
    <div class="list-template__top" nz-row>
      <div nz-col nzXl='20' class="list-template__searchBox">
        <div class="list-template__searchItem">
          <span class="label">所属科室</span>：
          <nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
            (nzOnSearch)="changeInp($event)" nzAllowClear nzPlaceHolder="请选择所属科室" [(ngModel)]="department">
            <ng-container *ngFor="let option of alldepart">
              <nz-option *ngIf="!isLoading" [nzLabel]="option.dept" [nzValue]="option.id"></nz-option>
            </ng-container>
            <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
              <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
            </nz-option>
          </nz-select>
        </div>
        <div class="list-template__searchItem">
          <span class="label">状态</span>：
          <nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" [nzShowSearch]="false" nzAllowClear
            nzPlaceHolder="请选择状态" [(ngModel)]="replyType">
            <nz-option nzLabel="{{data.label}}" nzValue="{{data.value}}" *ngFor="let data of replyTypes"></nz-option>
          </nz-select>
        </div>
      </div>
      <div nz-col nzXl='4' class="list-template__btns">
        <button nz-button class="btn default" (click)='search()'>搜索</button>
        <button nz-button class="btn default ml8" (click)='reset()'>重置</button>
      </div>
    </div>
    <div class="list-template__bottom">
      <nz-table class="list-template__nzTable" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false"
        [nzLoading]="loading1">
        <thead>
          <tr class="thead">
            <th nzWidth="5%">序号</th>
            <th nzWidth="15%">填写科室</th>
            <th nzWidth="18%">填写时间</th>
            <th nzWidth="35%">意见内容</th>
            <th nzWidth="10%">状态</th>
            <th nzWidth="18%">操作</th>
          </tr>
        </thead>
        <tbody>
          <tr *ngFor="let data of listOfData;let index=index;">
            <td>{{index+(pageIndex-1) * pageSize + 1}}</td>
            <td>{{ data.creatDepartment.dept }}</td>
            <td>{{ data.createTime|date:'yyyy-MM-dd HH:mm'}}</td>
            <td>
              <span style="overflow: hidden;text-overflow: ellipsis;">
                {{ spliceContent(data.content) }}
              </span>
            </td>
            <td>{{data.replaceFlag==0?'未回复':'已回复'}}</td>
            <td>
              <div class="coop">
                <span *ngIf="coopBtns.look" (click)="detail(data.id)">查看</span>
                <span *ngIf="coopBtns.reply&&data.replaceFlag==0" (click)="reply(data)">回复</span>
              </div>
            </td>
          </tr>
        </tbody>
      </nz-table>
      <div class="list-template__pagination">
        <nz-pagination [(nzPageIndex)]="pageIndex" [(nzTotal)]="listLength" nzShowSizeChanger [(nzPageSize)]="pageSize"
          (nzPageIndexChange)="getList()" (nzPageSizeChange)="getList()">
        </nz-pagination>
      </div>
    </div>
  </div>
  <!-- 意见箱查看 -->
  <div class="save display_flex align-items_center justify-content_flex-center advice" *ngIf="modal">
    <div class="modalBody">
      <div class="title">意见箱 - 回复<i class="icon_transport transport-guanbi" (click)="hideModal()"></i></div>
      <div class="content">
        <div class="conItem">
          <div class="jiTit borderB color3" nz-row>
            <div nz-col nzSpan="8" class="txtL">填写科室：{{replyCon.creatDepartment.dept}}
            </div>
            <div nz-col nzSpan="6" class="txtL">填写人：{{replyCon.createUser.name}}
            </div>
            <div nz-col nzSpan="10" class="txtR">填写时间：{{replyCon.createTime}}</div>
          </div>
          <div class="defeat">意见内容：{{replyCon.content}}</div>
        </div>
        <div class="conItem noCon">
          <div class="title">回复内容：</div>
          <textarea rows="4" maxlength="255" nz-input [(ngModel)]="adviceSubContent" placeholder="请填写回复内容"></textarea>
        </div>
      </div>
      <div class=" display_flex justify-content_flex-center">
        <button nzType="primary" nz-button (click)="submitForm()" [nzLoading]="btnLoading">回复</button>
        <button class="btn cancel" nz-button nzType="default" (click)="hideModal()">取消</button>
      </div>
    </div>
  </div>

</div>
<!-- 操作成功/失败提示框 -->
<app-prompt-modal *ngIf="promptModalShow" [content]="promptContent" [success]="ifSuccess" [show]="promptModalShow"
  [info]="promptInfo"></app-prompt-modal>

<!-- 查看详情 -->
<router-outlet></router-outlet>
