<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.gd_total || 0}}</div>
          <div class="describe">工单总数</div>
        </div>
        <div class="special-box-right">
          <div class="sign-describe">已完成: <span class="sign-num">{{workData.gd_close || 0}}</span></div>
          <div class="sign-describe">待接单: <span class="sign-num">{{workData.gd_todo || 0}}</span></div>
          <div class="sign-describe">处理中: <span class="sign-num">{{workData.gd_doing || 0}}</span></div>
        </div>
        <div class="border"></div>
      </div>
      <div class="top-list">
        <div class="special-box">
          <div class="num">{{workData.sum_price || 0}}</div>
          <div class="describe">总费用 (元)</div>
        </div>
        <div class="special-box-right">
          <div class="sign-describe">工时: <span class="sign-num">{{workData.workHourPrice || 0}}</span></div>
          <div class="sign-describe">耗材: <span class="sign-num">{{workData.consumablesPrice || 0}}</span></div>
        </div>
        <div class="border"></div>
      </div>
      <div class="top-list">
        <div class="special-box cursor" (click)="viewDetail2()">
          <div class="num">{{workData.gd_postpone || 0}}</div>
          <div class="describe">挂起单数</div>
        </div>
        <div class="border"></div>
      </div>
      <div class="top-list">
        <div class="special-box cursor" (click)="viewDetail3()">
          <div class="num">{{workData.gd_overtime || 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.gd_degree}}</div>
          <div class="describe">差评单数</div>
        </div>
      </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="statistics-select">
            <div class="statistics-select-list" [ngClass]="{'activeClass': activeIndex == 0}" (click)="selectCheck(0)">维修人员</div>
            <div class="statistics-select-list" [ngClass]="{'activeClass': activeIndex == 1}" (click)="selectCheck(1)">维修组</div>
          </div>
          <div class="more" *ngIf="showMore(activeIndex == 0 ? 'userStatistics' : 'groupStatistics')" (click)="toPath(activeIndex == 0 ? '/newStatistics/maintenanceStatistics/userStatistics' : '/newStatistics/maintenanceStatistics/groupStatistics')">更多></div>
        </div>
        <div class="table">
          <div class="td">
            <div class="table-td">排名</div>
            <div class="table-td" *ngIf="activeIndex==0">人员姓名</div>
            <div class="table-td" *ngIf="activeIndex==1">维修组</div>
            <div class="table-td">工单量</div>
            <div class="table-td">平均接单时长</div>
            <div class="table-td">平均解决时长</div>
            <div class="table-td">超时单</div>
          </div>
          <div class="th" *ngFor="let item of maintainData; let index = index;">
            <div class="table-list">
              <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">{{item.name}}</div>
            <div class="table-list text-sign" (click)="viewMaintain1(item)">{{item.count || 0}}</div>
            <div class="table-list">{{item.avg_response}}分</div>
            <div class="table-list">{{item.avg_handle }}分</div>
            <div class="table-list text-sign" (click)="viewMaintain2(item)">{{item.overtime || 0}}</div>
          </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('categorySourceStatistics')" (click)="toPath('/newStatistics/maintenanceStatistics/categorySourceStatistics')">更多></div>
        </div>
        <div class="echarts-repairs">
          <div echarts class="echarts" [options]='repairsOptions'></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('categoryOneStatistics')" (click)="toPath('/newStatistics/maintenanceStatistics/categoryOneStatistics')">更多></div>
        </div>
        <div class="echarts-repairs">
          <div echarts class="echarts" [options]='malfunctionOptions'></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('buildingStatistics')" (click)="toPath('/newStatistics/maintenanceStatistics/buildingStatistics')">更多></div>
        </div>
        <div class="echarts-repairs">
          <div echarts class="echarts" [options]='buildingOptions'></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('departmentIncidentStatistics')" (click)="toPath('/newStatistics/maintenanceStatistics/departmentIncidentStatistics')">更多></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 deptCostData; let index = index;">
            <div class="table-list-4">{{index+1}}</div>
            <div class="table-list-4 ellipsis-oneline" title="{{item.dept}}">{{item.dept}}</div>
            <div class="table-list-4 text-sign" (click)="viewDept(item)">{{item.sum || 0}}</div>
            <div class="table-list-4">{{item.sum_price || 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('consumableStatistics')" (click)="toPath('/newStatistics/maintenanceStatistics/consumableStatistics')">更多></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 consumableData; let index = index;">
            <div class="table-list-4">{{index+1}}</div>
            <div class="table-list-4 ellipsis-oneline" title="{{item.name}}({{item.spd_code}})">{{item.name}}<ng-container *ngIf="item.spd_code">({{item.spd_code}})</ng-container></div>
            <div class="table-list-4">{{item.sum || 0}}</div>
            <div class="table-list-4">{{item.sum_price || 0}}</div>
          </div>
        </div>
      </div>
    </div>
  </ng-container>
</div>
<div class="mask-style" *ngIf="isLoading">
	<nz-spin nzSimple class="spin-style"></nz-spin>
</div>
