<div class="content-heading  justify-content-between">
  <div>考务材料-预约统计</div>
  <div class="float-right">
    <div class="btn-group btn-group-sm" dropdown>
      <button class="btn dropdown-toggle btn-secondary btn-sm" type="button" dropdownToggle> 预约管理
        <span class="caret"></span>
      </button>
      <div *dropdownMenu class="dropdown-menu modal-lg" role="menu">
        <a class="dropdown-item" href="#" (click)="ajax.reload()">刷新数据</a>
        <div class="dropdown-divider"></div>
        <a class="dropdown-item" href="#"
           (click)="FuncService.ajaxDownload('frame/report/download.htm', {report_name:'LayoutAgentArrangeTotal', report_title :agent?.ly_agent_name + '预约汇总-', ly_agent_id:  agent?.ly_agent_id, subject_type:'Interview'})">汇总下载</a>
        <div class="dropdown-divider"></div>
        <a class="dropdown-item" href="#" (click)="ajax.optrRecord('layout/group/appointment/auto/agent.htm', {ly_agent_id: agent?.ly_agent_id}, {
          successMsg:'考点【'+ agent?.ly_agent_name +'】所有项目已自动预约完成！', successMsgType: 'Swal', confirmMsg:'确定要对考点【' +  agent?.ly_agent_name +'】所有未预约的考生进行自动预约吗？',showMsg:true
          })">全部预约</a>
        <div class="dropdown-divider"></div>
        <a class="dropdown-item" href="#">冲突名单</a>
        <div class="dropdown-divider"></div>
        <a class="dropdown-item" href="#" (click)="ajax.optrRecord('layout/group/appointment/auto/room.htm', {ly_agent_id: agent?.ly_agent_id}, {
          successMsg:'考点【'+ agent?.ly_agent_name +'】所有项目已经安排考场！', successMsgType: 'Swal', confirmMsg:'确定要对考点【' +  agent?.ly_agent_name +'】所有已经预约的考生安排考场吗？',showMsg:true
          })">安排考场</a>
        <div class="dropdown-divider"></div>
        <a class="dropdown-item" href="#"
        (click)="FuncService.ajaxDownload('frame/report/download.htm', {report_name:'LayoutResultReport', report_title :agent?.ly_agent_name + '考生安排详情-', ly_agent_id:  agent?.ly_agent_id})">详情下载</a>
        <div class="dropdown-divider"></div>
        <a class="dropdown-item" href="#" (click)="cancelAppointment()">取消预约</a>
        <div class="dropdown-divider"></div>
        <a class="dropdown-item" href="#" (click)="downloadByTime()">汇总时段下载</a>
      </div>
    </div>
  </div>
</div>
<table class="table table-striped table-hover table-bordered">
  <thead>
  <tr>
    <th class=""></th>
    <th>分组名称</th>
    <th>预约模式</th>
    <th>开考日期</th>
    <th>结束日期</th>
    <th>总人数</th>
    <th>已预约</th>
    <th>未预约</th>
    <th>考试时段</th>
    <th class="th-b-1"></th>
  </tr>
  </thead>
  <tbody>
  <tr *ngFor="let v of ajax.getArray(); let i = index">
    <td>{{i + 1}}</td>
    <td>{{v.group_name}}</td>
    <td [innerHTML]="v.appointment_type | frameDict:'InterviewAppointmentType'"></td>
    <td>{{FuncService.dateToShortString(v.group_start_date)}}</td>
    <td> {{FuncService.dateToShortString(v.group_end_date)}}</td>
    <td><span [tooltip]="'省内：' + v.province_std_total + '；省外：' + v.outside_std_total" *ngIf="v.group_std_total > 0">{{v.group_std_total}}</span>
    </td>
    <td><span class="{{v.arrange_outside_total>0?'text-warning':'text-success'}}">{{v.arrange_province_total}}</span>
    </td>
    <td>{{v.arrange_outside_total}}</td>
    <td>
      <div class="btn-group btn-group-sm" dropdown>
        <button class="btn dropdown-toggle btn-secondary btn-sm" type="button" dropdownToggle> 管理
          <span class="caret"></span>
        </button>
        <div *dropdownMenu class="dropdown-menu modal-lg" role="menu">
          <a class="dropdown-item" href="#"
             (click)="showModal({'ResponseEntity':v, 'mapUrl': 'layout/group/interview/view.htm', 'mapParam': {ly_group_id: v.ly_group_id}})">查看明细</a>


          <div class="dropdown-divider" *ngIf="v.arrange_outside_total>0"></div>
          <a class="dropdown-item" *ngIf="v.arrange_outside_total>0" href="#" (click)="ajax.optrRecord('layout/group/appointment/auto/group.htm', {ly_group_id: v.ly_group_id}, {
          successMsg:'考试项目【'+ v.group_name +'】已自动预约完成！', successMsgType: 'Swal', confirmMsg:'确定要对考试项目【' + v.group_name +'】所有未预约的考生进行自动预约吗？',showMsg:true
          })">自动预约</a>

        </div>
      </div>
    </td>
  </tr>
  </tbody>
</table>
<frame-ajax [url]="'layout/group/appointment/list.htm'" [autoRequest]="false"
            [requestData]="{subject_type:'Interview',ly_agent_id: agent.ly_agent_id, order: order_field}"
            [requestParam]="{RequestDataType:'array', RequestWithLoading: true}" #ajax></frame-ajax>

