<div class="synthesize-box">
	<div class="searchDataWrap">
		<div class="searchData">
			<app-custom-change-date #customChangeDate [isShowType]="true" name="选择日期"></app-custom-change-date>
		</div>
		<div class="operation">
			<button nz-button class="btn default" (click)="search()">搜索</button>
			<button nz-button class="btn default ml8" (click)="reset()">重置</button>
		</div>
	</div>
  <ng-container *ngIf="!isLoading">
    <div class="top1-statistics">
      <div class="top-list">
        <div class="special-box cursor" (click)="viewDetail1()">
          <div class="num">{{workData.totalCount || 0}}</div>
          <div class="describe">工单总数</div>
        </div>
        <div class="special-box-right">
          <div class="sign-describe">已完成: <span class="sign-num">{{workData.doneCount || 0}}</span></div>
          <div class="sign-describe">待接单: <span class="sign-num">{{workData.waitCount || 0}}</span></div>
          <div class="sign-describe">处理中: <span class="sign-num">{{workData.doingCount || 0}}</span></div>
        </div>
        <div class="border"></div>
      </div>
      <div class="top-list">
        <div class="special-box">
          <div class="num">{{workData.workerCount || 0}}</div>
          <div class="describe">总人数</div>
        </div>
        <div class="border"></div>
      </div>
      <div class="top-list">
        <div class="special-box">
          <div class="num">{{workData.totalGrade || 0}}</div>
          <div class="describe">总积分</div>
        </div>
        <div class="border"></div>
      </div>
      <div class="top-list">
        <div class="special-box cursor" (click)="viewDetail4()">
          <div class="num">{{workData.badCount || 0}}</div>
          <div class="describe">差评单数</div>
        </div>
        <div class="border"></div>
      </div>
      <div class="top-list">
        <div class="special-box">
          <div class="num">{{workData.doneRate || 0}}%</div>
          <div class="describe">按时完成率</div>
        </div>
      </div>
    </div>
    <!--  <div class="top0-statistics">
      <div>标本<span class="num">{{businessData.specimenCount || 0}}</span></div>
      <div>病理<span class="num">{{businessData.pathologyCount || 0}}</span></div>
      <div>陪检<span class="num">{{businessData.inspectCount || 0}}</span></div>
      <div>药品<span class="num">{{businessData.drugsCount || 0}}</span></div>
      <div>静配<span class="num">{{businessData.drugsJpCount || 0}}</span></div>
      <div>中药<span class="num">{{businessData.drugsHerbalCount || 0}}</span></div>
      <div>血制品<span class="num">{{businessData.bloodCount || 0}}</span></div>
    </div> -->
    <div class="top2-statistics">
      <div class="statistics width-60 mar-right-8">
        <div class="statistics-box">
          <div class="sign-green"></div>
          <div class="statistics-title">业务分类top5</div>
          <div class="more" *ngIf="showMore('businessClassifyStatistics')" (click)="toPath('/newStatistics/distributionInspectionStatistics/businessClassifyStatistics')">更多></div>
        </div>
        <div class="echarts-repairs">
          <div echarts class="echarts" [options]='businessOptions'></div>
        </div>
      </div>
      <div class="statistics width-40">
        <div class="statistics-box">
          <div class="sign-green"></div>
          <div class="statistics-title">申请来源</div>
          <div class="more" *ngIf="showMore('sourceStatistics')" (click)="toPath('/newStatistics/distributionInspectionStatistics/sourceStatistics')">更多></div>
        </div>
        <div class="echarts-repairs">
          <div echarts class="echarts" [options]='applyOptions'></div>
        </div>
      </div>
    </div>
    <div class="top2-statistics">
      <div class="statistics width-49 mar-right-8">
        <div class="statistics-box">
          <div class="sign-green"></div>
          <div class="statistics-title">科室Top5</div>
          <div class="more" *ngIf="showMore('departmentQualityControlStatistics')" (click)="toPath('/newStatistics/distributionInspectionStatistics/departmentQualityControlStatistics')">更多></div>
        </div>
        <div class="table">
          <div class="td">
            <div class="table-td-4">排名</div>
            <div class="table-td-4">科室名称</div>
            <div class="table-td-4">工单量</div>
            <div class="table-td-4">好评率</div>
          </div>
          <div class="th" *ngFor="let item of deptTopData; let index = index;">
            <div class="table-list-4">
              <img src="../../assets/images/top1.png" alt="" class="img" *ngIf="index==0">
              <img src="../../assets/images/top2.png" alt="" class="img" *ngIf="index==1">
              <img src="../../assets/images/top3.png" alt="" class="img" *ngIf="index==2">
              <span *ngIf="index !=0 && index !=1 && index !=2">{{index+1}}</span>
            </div>
            <div class="table-list-4 ellipsis-oneline" title="{{item.dept}}">{{item.dept}}</div>
            <div class="table-list-4 text-sign" (click)="viewMaintain1(item)">{{item.sum || 0}}</div>
            <div class="table-list-4">{{item.goodRate || '0%'}}</div>
          </div>
        </div>
      </div>
      <div class="statistics width-50">
        <div class="statistics-box">
          <div class="sign-green"></div>
          <div class="statistics-title">人员Top5</div>
          <div class="more" *ngIf="showMore('userQualityControlStatistics')" (click)="toPath('/newStatistics/distributionInspectionStatistics/userQualityControlStatistics')">更多></div>
        </div>
        <div class="table">
          <div class="td">
            <div class="table-td-4">排名</div>
            <div class="table-td-4">人员名称</div>
            <div class="table-td-4">工单量</div>
            <div class="table-td-4">积分总数</div>
          </div>
          <div class="th" *ngFor="let item of userTopData; let index = index;">
            <div class="table-list-4">
              <img src="../../assets/images/top1.png" alt="" class="img" *ngIf="index==0">
              <img src="../../assets/images/top2.png" alt="" class="img" *ngIf="index==1">
              <img src="../../assets/images/top3.png" alt="" class="img" *ngIf="index==2">
              <span *ngIf="index !=0 && index !=1 && index !=2">{{index+1}}</span>
            </div>
            <div class="table-list-4 ellipsis-oneline" title="{{item.userName}}({{item.userAccount}})">{{item.userName}}<ng-container *ngIf="item.userAccount">({{item.userAccount}})</ng-container></div>
            <div class="table-list-4 text-sign" (click)="viewMaintain2(item)">{{item.sum || 0}}</div>
            <div class="table-list-4">{{item.totalGrade || 0}}</div>
          </div>
        </div>
      </div>
    </div>
    <div class="top2-statistics">
      <div class="statistics width-100">
        <div class="statistics-box">
          <div class="sign-green"></div>
          <div class="statistics-title">日趋势图</div>
          <div class="statistics-select">
            <div class="statistics-select-list" [ngClass]="{'activeClass': activeIndex == 'day'}" (click)="selectCheck('day')">日</div>
            <div class="statistics-select-list" [ngClass]="{'activeClass': activeIndex == 'hour'}" (click)="selectCheck('hour')">时</div>
          </div>
          <div class="searchDataItem ml8">
            <span class="label">统计分类</span>：
            <nz-select class="selectItem" [nzDropdownMatchSelectWidth]="false" nzAllowClear nzPlaceHolder="请选择统计分类" [(ngModel)]="statisticsTypeId" (ngModelChange)="changeStatisticsType($event)">
              <ng-container *ngFor="let option of statisticsTypeList">
                <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [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="more" *ngIf="showMore(activeIndex == 'hour' ? 'hourQualityControlStatistics' : 'dateQualityControlStatistics')" (click)="toPath(activeIndex == 'hour' ? '/newStatistics/distributionInspectionStatistics/hourQualityControlStatistics' : '/newStatistics/distributionInspectionStatistics/dateQualityControlStatistics')">更多></div>
        </div>
        <div class="echarts-repairs">
          <div echarts class="echarts" [options]='trendOptions'></div>
        </div>
      </div>
    </div>
  </ng-container>
</div>
<div class="mask-style" *ngIf="isLoading">
	<nz-spin nzSimple class="spin-style"></nz-spin>
</div>
