<div class="home">
  <div class="content" nz-row>
    <div class="left" nz-col nzSpan='18'>
      <div class="leftCon">
        <div class="top topHeight">
          <div class="num">
            <div class="item">
              <span>院区： </span>
              <span>{{hosName}}</span>
            </div>
            <div class="item">
              <span>科室数量： </span>
              <span>{{userSituation.detptCount||0}}</span>
            </div>
            <div class="item">
              <span>人员总数： </span>
              <span>{{userSituation.userCount||0}}</span>
            </div>
            <div class="toCompre" (click)="toMenu('compreStatistics','综合统计')">数据统计 >></div>
          </div>
          <div class="orderNum">
            <div class="ing display_flex justify-content_space-between">
              <div>
                <div>
                  当前上班人数
                  <span>{{userSituation.userOnlineCount||0}}</span>
                </div>
                <div>
                  工作中人数
                  <span>{{userSituation.userWorkCount||0}}</span>
                </div>
                <div>
                  空闲中人数
                  <span>{{userSituation.userFreeCount||0}}</span>
                </div>
              </div>
              <div>
                <div>
                  今日建单总数
                  <span>{{orderSituation.totalCount||0}}</span>
                </div>
                <div>
                  执行中工单
                  <span>{{orderSituation.workingCount||0}}</span>
                </div>
                <div>
                  已超时工单
                  <span>{{orderSituation.outTimeCount||0}}</span>
                </div>
                <div>
                  已完成工单
                  <span>{{orderSituation.finishCount||0}}</span>
                </div>
              </div>
            </div>
            <div class="nums display_flex justify-content_space-between">
              <div class="item">
                <i class="icon_transport transport-biaobencaiji"></i>
                <span>标本</span>
                <span>{{orderSituation.specimen||0}}单
                  <!-- /{{orderSituation.speCount||0}}只 -->
                </span>
              </div>
              <div class="item">
                <i class="icon_transport transport-peijianlunyitubiao"></i>
                <span>患者陪检</span>
                <span>{{orderSituation.inspect||0}}单
                  <!-- /{{orderSituation.insCount||0}}只 -->
                </span>
              </div>
              <div class="item">
                <i class="icon_transport transport--"></i>
                <span>静配</span>
                <span>{{orderSituation.jPBag||0}}单
                  <!-- /{{orderSituation.jpCount||0}}只 -->
                </span>
              </div>
              <div class="item">
                <i class="icon_transport transport-ccgl-kuneizhuanyi-1"></i>
                <span>患者转运</span>
                <span>{{orderSituation.patientTransport||0}}单
                  <!-- /{{orderSituation.transCount||0}}只 -->
                </span>
              </div>
              <div class="item">
                <i class="icon_transport transport-yaopin"></i>
                <span>药品</span>
                <span>{{orderSituation.drugsBag||0}}单
                  <!-- /{{orderSituation.drugsCount||0}}只 -->
                </span>
              </div>
              <div class="item">
                <i class="icon_transport transport-shishijiankong_lunxun"></i>
                <span>标本轮巡</span>
                <span>{{orderSituation.specimenPlan||0}}单</span>
              </div>
              <div class="item">
                <i class="icon_transport transport-qita1"></i>
                <span>其他</span>
                <span>{{orderSituation.other||0}}单</span>
              </div>
            </div>
          </div>
        </div>
        <div class="center centerHeight">
          <div class="title">当前各小组工单执行情况</div>
          <div class="table">
            <div class="box">
              <nz-table class="hospitalTable" [nzData]="groupOrders" nzSize="small" [nzShowPagination]="false"
                [nzScroll]="{ y: '123px' }">
                <thead>
                  <tr class="thead">
                    <th nzWidth="25%">小组</th>
                    <th nzWidth="15%">上班人数</th>
                    <th nzWidth="15%">今日接单数</th>
                    <th nzWidth="15%">执行中工单</th>
                    <th nzWidth="15%">已完成工单</th>
                    <th nzWidth="15%">超时工单</th>
                  </tr>
                </thead>
                <tbody>
                  <tr *ngFor="let data of groupOrders">
                    <td>{{data.name}}</td>
                    <td>{{data.objectMap.onlineUser}}</td>
                    <td>{{data.objectMap.orderCount}}</td>
                    <td>{{data.objectMap.workingOrderCount}}</td>
                    <td>{{data.objectMap.finishOrderCount}}</td>
                    <td>{{data.objectMap.outTimeOrderCount}}</td>
                  </tr>
                </tbody>
              </nz-table>
            </div>
          </div>
        </div>
        <div class="bottom" nz-row>
          <div class="echart" nz-col nzSpan="12">
            <div class="box">
              <div class="title">近一周小组好评TOP5</div>
              <div class="echarts" *ngIf='groupInfo.length&&!loading1'>
                <div echarts [options]='groupOption'></div>
              </div>
              <div *ngIf="!groupInfo.length&&!loading1"
                class="none display_flex align-items_center justify-content_flex-center">
                暂无数据
              </div>
              <div class="echarts" *ngIf='loading1'>
                <div class="loadingFull display_flex justify-content_flex-center align-items_center">
                  <div class="loadingFullInner">
                    <img src="../../../assets/images/loading.gif" alt="">
                    <div>加载中...</div>
                  </div>
                </div>
              </div>
            </div>
          </div>
          <div class="table" nz-col nzSpan="12">
            <div>
              <span class="title">近一周异常工单</span>
              <span class="toMenu" (click)="toMenu('orderManagement','工单列表')">工单列表 >></span>
            </div>
            <div class="tableBox">
              <div class="errorTabl">
                <div class="box">
                  <nz-table class="errorTable" [nzData]="abOrders" nzSize="small" [nzScroll]="{ y: '190px' }" [nzShowPagination]="false"
                    [nzLoading]="loading2">
                    <thead>
                      <tr class="thead">
                        <th nzWidth="20%">工单号</th>
                        <th nzWidth="20%">所属小组</th>
                        <th nzWidth="22%">执行配送人员</th>
                        <th nzWidth="18%">操作</th>
                      </tr>
                    </thead>
                    <tbody>
                      <tr *ngFor="let data of abOrders">
                        <td>{{data.gdcode}}</td>
                        <td>{{data.groupId?data.groupId.groupName:'-'}}</td>
                        <td>{{data.worker.name}}</td>
                        <td>
                          <span class="detail" (click)='orderDetail(data.id)'>查看详情</span>
                        </td>
                      </tr>
                    </tbody>
                  </nz-table>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <div class="right" nz-col nzSpan='6'>
      <div class="box">
        <div class="tabs display_flex">
          <div [ngClass]="{'item':true, 'checked':thisTab==1, 'flex_1':true}" (click)='checkTab(1)'>工单差评（ {{badNum}} ）
          </div>
          <div [ngClass]="{'item':true, 'checked':thisTab==2, 'flex_1':true}" (click)='checkTab(2)'>最新意见（ {{adviceNum}}
            ）</div>
        </div>
        <div class="orders">

          <!-- 工单差评 -->
          <overlay-scrollbars #osComponentRef1 *ngIf="thisTab==1" class="ordersBox">
            <div class="items" *ngIf="!Loading&&badList.length">
              <div class="item" *ngFor="let data of badList;">
                <div class="info" (click)="viewDetail(data)">
                  <div nz-row class="title">
                    <div nz-col nzSpan="10">{{data.orderNo}}</div>
                    <div nz-col nzSpan="14">{{data.orderType?data.orderType.name:'-'}}</div>
                  </div>
                  <div nz-row class="title">
                    <div nz-col nzSpan="12">起点科室：{{data.startDept.dept}}</div>
                    <div nz-col nzSpan="12">执行配送人员：{{data.worker?data.worker.name:''}}</div>
                  </div>
                  <div [title]="data.evaluationContent"
                    [ngClass]="{'over':true,'noOver':(isOpen&&coopOpenId==data.id)}">
                    评价内容：{{data.evaluationContent}}</div>
                  <!-- <div class="up">
                    <span (click)="more(data.id)">{{(isOpen&&coopOpenId==data.id)?'收起 <<':'展开>>'}}</span>
                  </div> -->
									 <div class="flex">
										 <div>评价时间：{{data.evaluationTime|date:'yyyy-MM-dd HH:mm:ss' || ''}}</div>
										 <div>评价等级：{{data.evaluationLevel ? data.evaluationLevel.name : '-'}}</div>
									 </div>
                  <!-- <div class="time">发起时间：{{data.startTime|date:'yyyy-MM-dd HH:mm:ss'}}</div> -->
                </div>
                <div class="btns display_flex">
                  <div class="btn flex_1" (click)="designate(data.id,data.hosId)">指派</div>
                  <div class="btn flex_1" (click)="detail(data.id)">调解</div>
                </div>
              </div>
            </div>
            <!-- 加载中 -->
            <div class="loading display_flex align-items_center justify-content_flex-center" *ngIf="Loading">
              <div>
                <img src="../../assets/images/loading.gif" alt="">
                <div>加载中...</div>
              </div>
            </div>
            <!-- 暂无数据 -->
            <div class="none display_flex align-items_center justify-content_flex-center"
              *ngIf="!Loading&&!badList.length">
              暂无数据
            </div>
          </overlay-scrollbars>
          <!-- 最新意见 -->
          <overlay-scrollbars #osComponentRef2 *ngIf="thisTab==2" class="ordersBox">
            <div class="items" *ngIf="!Loading&&adviceList.length">
              <div class="item" *ngFor="let data of adviceList;">
                <div class="info">
                  <div nz-row class="title">
                    <div nz-col nzSpan="24">填写科室：{{ data.creatDepartment.dept }}</div>
                  </div>
                  <div [title]="data.content" [ngClass]="{'over':true,'noOver':(isOpen&&coopOpenId==data.id)}">
                    意见内容：{{data.content}}</div>
                  <div class="up">
                    <span (click)="more(data.id)">{{(isOpen&&coopOpenId==data.id)?'收起 <<':'展开>>'}}</span>
                  </div>
                  <div class="time">发起时间：{{data.createTime}}</div>
                </div>
                <div class="btns">
                  <div class="btn" (click)="reply(data)">回复</div>
                </div>
              </div>
            </div>
            <!-- 加载中 -->
            <div class="loading display_flex align-items_center justify-content_flex-center" *ngIf="Loading">
              <div>
                <img src="../../assets/images/loading.gif" alt="">
                <div>加载中...</div>
              </div>
            </div>
            <!-- 暂无数据 -->
            <div class="none display_flex align-items_center justify-content_flex-center"
              *ngIf="!Loading&&!adviceList.length">
              暂无数据
            </div>
          </overlay-scrollbars>
          <!-- 翻页 -->
          <div class="pageing">
            <div>
              <nz-pagination [(nzPageIndex)]="listIdx" [(nzTotal)]="listLength" (nzPageIndexChange)="getPageList()"
                [nzPageSize]='10' nzSimple>
              </nz-pagination>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>


  <!-- 指派模态框 -->
  <div class="save add display_flex align-items_center justify-content_flex-center" *ngIf="desModal">
    <div class="modalBody">
      <div class="title">产品处理指派调解人员<i class="icon_transport transport-guanbi" (click)="hideDesModal()"></i>
      </div>
      <div class="content">
        <form nz-form [formGroup]="validateForm" class="addForm" (ngSubmit)="submitForm()">
          <nz-form-item>
            <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="user">指派调解人员</nz-form-label>
            <nz-form-control nzErrorTip="请选择指派调解人员!">
              <nz-select [nzDropdownMatchSelectWidth]="false" type="user" nzShowSearch nzAllowClear
                formControlName="user" nzPlaceHolder="请选择指派调解人员">
                <nz-option nzLabel="{{data.name}}" nzValue="{{data.id}}" *ngFor="let data of allDesUser">
                </nz-option>
              </nz-select>
            </nz-form-control>
          </nz-form-item>
        </form>
      </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)="hideDesModal()">取消</button>
      </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)="submitReplyForm()" [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 (deactivate)="refreshList()"></router-outlet>

<!-- <router-outlet (deactivate)="getList()"></router-outlet> -->

<!-- 工单详情 -->
<app-incident-detail [id]="coopData.workOrder" *ngIf="detailModalShow" (closeModelHs)="closeDetailModelOrder($event)" (confirmModelHs)="confirmDetailModelOrder($event)"></app-incident-detail>