<div class="incident_handle_order" [hidden]="summaryLoading">
  <!-- 耗材 -->
  <div class="orderList consumable">
    <div class="title">耗材清单</div>
    <ng-container *ngIf="summaryObj.consumableList.length">
      <div class="orderItem" *ngFor="let item of summaryObj.consumableList">
        <div class="row">
          <div class="name">{{ item.consumableName }}<ng-container v-if="item.consumableBrandModel">({{ item.consumableBrandModel }})</ng-container></div>
          <div class="value">
            <span class="unitPrice">单价：{{ item.consumableEndPrice }}元</span>
            <button nz-button class="btn default ml8" (click)="editConsumable(item)">编辑</button>
						<button nz-button class="btn default ml8" (click)="logView(1,item)">日志</button>
					</div>
        </div>

        <div class="row">
          <div class="name"></div>
          <div class="value">
            <div class="num">
              <span>X{{ item.consumablesNum }}{{ item.consumablesUnit }}</span>
              <span class="unitPrice">总价：{{item.consumablesNum * item.consumableEndPrice}}元</span>
            </div>
            <button nz-button class="btn default ml8" (click)="showDelModal(item,'您确认要删除吗？','删除','delConsumable')">删除</button>
          </div>
        </div>
      </div>
    </ng-container>


    <div class="totalPrice">耗材总价：{{summaryObj.consumablePrice}}元</div>
    <div class="add" (click)="addConsumable()"><i class="icon_transport transport-tag27fuben"></i></div>
  </div>
  <!-- 工时 -->
  <div class="orderList manHour">
    <div class="title">工时清单</div>
    <ng-container *ngIf="summaryObj.workHourManagementList.length">
      <div class="orderItem" *ngFor="let item of summaryObj.workHourManagementList">
        <div class="row">
          <div class="name">{{ item.workName }}</div>
          <div class="value">
            <span class="unitPrice">单价：{{ item.wage }}元</span>
            <button nz-button class="btn default ml8" (click)="editWorkHourManagement(item)">编辑</button>
						<button nz-button class="btn default ml8" (click)="logView(2,item)">日志</button>
					</div>
        </div>

        <div class="row">
          <div class="name"></div>
          <div class="value">
            <div class="num">
              <span>X{{ item.workHourNum2 }}{{ item.workUnit }}</span>
              <span class="unitPrice">总价：{{item.workHourNum2 * item.wage}}元</span>
            </div>
            <button nz-button class="btn default ml8" (click)="showDelModal(item,'您确认要删除吗？','删除','delWorkHourManagement')">删除</button>
          </div>
        </div>
      </div>
    </ng-container>
    <div class="totalPrice">工时总价：{{summaryObj.workHourPrice}}元</div>
    <div class="add" (click)="addWorkHourManagement()"><i class="icon_transport transport-tag27fuben"></i></div>
  </div>

  <div class="allTotalPrice">汇总单总价：{{summaryObj.totalMaintenancePrice}}元</div>
</div>
<nz-spin nzSimple [nzSpinning]="summaryLoading" class="mt8 text_align_center"></nz-spin>

<!-- 新增/编辑耗材模态框 -->
<div class="save display_flex justify-content_flex-center align-items_center add" *ngIf="modalConsumable">
  <div class="modalBody">
    <div class="title">{{modelName}}耗材<i class="icon_transport transport-guanbi" (click)="hideConsumableModal()"></i></div>
    <div class="content">
      <form nz-form [formGroup]="validateConsumableForm" class="addForm">
        <nz-form-item>
          <nz-form-label [nzSpan]="6" nzRequired nzFor="consumablesId">耗&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;材</nz-form-label>
          <nz-form-control [nzSpan]="18" nzErrorTip="请选择耗材!">
            <nz-select *ngIf="add" (nzOnSearch)="changeInp('consumable', $event)" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch nzAllowClear formControlName="consumablesId" nzPlaceHolder="请选择耗材">
              <ng-container *ngFor="let option of consumableList">
                <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>
            <span *ngIf="!add">{{coopData.consumableName}} ({{coopData.consumableBrandModel}}) {{coopData.consumableEndPrice}}元</span>
          </nz-form-control>
        </nz-form-item>
        <nz-form-item>
          <nz-form-label [nzSpan]="6" nzRequired nzFor="consumablesNum">数&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;量</nz-form-label>
          <nz-form-control [nzSpan]="18" nzErrorTip="请输入数量!">
            <nz-input-group>
              <nz-input-number class="w100" formControlName="consumablesNum" nzPlaceHolder="请输入数量" [nzMin]="1" [nzStep]="1" [nzPrecision]="0"></nz-input-number>
            </nz-input-group>
          </nz-form-control>
        </nz-form-item>
      </form>
    </div>
    <div class=" display_flex justify-content_flex-center">
      <button nzType="primary" nz-button (click)="submitConsumableForm()" [nzLoading]="btnLoading">确认</button>
      <button class="btn cancel" nz-button nzType="default" (click)="hideConsumableModal()">取消</button>
    </div>
  </div>
</div>

<!-- 新增/编辑工时模态框 -->
<div class="save display_flex justify-content_flex-center align-items_center add" *ngIf="modalWorkHourManagement">
  <div class="modalBody">
    <div class="title">{{modelName}}工时<i class="icon_transport transport-guanbi" (click)="hideWorkHourManagementModal()"></i></div>
    <div class="content">
      <form nz-form [formGroup]="validateWorkHourManagementForm" class="addForm">
        <nz-form-item>
          <nz-form-label [nzSpan]="6" nzRequired nzFor="workHourId">工&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;时</nz-form-label>
          <nz-form-control [nzSpan]="18" nzErrorTip="请选择工时!">
            <nz-cascader *ngIf="add" [nzOptions]="workHourManagementList" formControlName="workHourId" nzPlaceHolder="请选择工时"></nz-cascader>
            <span *ngIf="!add">{{coopData.workName}} {{coopData.wage}}元</span>
          </nz-form-control>
        </nz-form-item>
        <nz-form-item>
          <nz-form-label [nzSpan]="6" nzRequired nzFor="workHourNum">数&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;量</nz-form-label>
          <nz-form-control [nzSpan]="18" nzErrorTip="请输入数量!">
            <nz-input-group>
              <nz-input-number class="w100" formControlName="workHourNum" nzPlaceHolder="请输入数量" [nzMin]="1" [nzStep]="1" [nzPrecision]="0"></nz-input-number>
            </nz-input-group>
          </nz-form-control>
        </nz-form-item>
      </form>
    </div>
    <div class=" display_flex justify-content_flex-center">
      <button nzType="primary" nz-button (click)="submitWorkHourManagementForm()" [nzLoading]="btnLoading">确认</button>
      <button class="btn cancel" nz-button nzType="default" (click)="hideWorkHourManagementModal()">取消</button>
    </div>
  </div>
</div>

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

<!-- 删除模态框 -->
<app-dialog-delete [delModal]="delModal" (hideDelModalEvent)="hideDelModal()" [btnLoading]="btnLoading"
(confirmDelEvent)="confirmDel()" [content]="tipsMsg1"></app-dialog-delete>

<!-- 日志查看模态框 -->
	<div class="save add display_flex align-items_center justify-content_flex-center" *ngIf="logModal">
	  <div class="modalBody modalLogBody">
	    <div class="title">日志查看<i class="icon_transport transport-guanbi" (click)="hideModal()"></i>
	    </div>
	    <div class="content">
	      <div class="list-template__bottom">
	        <nz-table class="list-template__nzTable" [nzData]="listLogOfData" nzSize="middle" [nzShowPagination]="false"
	          [nzLoading]="loading2">
	          <thead>
	            <tr class="thead">
								<th>动作</th>
	              <th>操作时间</th>
	              <th>操作人</th>
	              <th>调整记录</th>
	            </tr>
	          </thead>
	          <tbody>
	            <tr *ngFor="let data of listLogOfData">
								<td>{{ data.operationType ? data.operationType.name : '-' }}</td>
								<td *ngIf="operationType==1">{{ data.time|date:'yyyy-MM-dd HH:mm'}}</td>
								<td *ngIf="operationType==2">{{ data.operationTime|date:'yyyy-MM-dd HH:mm'}}</td>
								<td *ngIf="operationType==1">{{ data.operator ? data.operator.name : '-' }}</td>
								<td *ngIf="operationType==2">{{ data.operationUserDTO ? data.operationUserDTO.name : '-' }}</td>
								<td>{{ data.logRemark ? data.logRemark : '-' }} <span *ngIf="data.operationType.value==6">单价:{{ data.currentPrice }} &nbsp;&nbsp;积分:{{ data.currentScore.value }}</span></td>
	            </tr>
	          </tbody>
	        </nz-table>
	      </div>
			<!-- 	<div class="list-template__pagination">
				  <nz-pagination [(nzPageIndex)]="pageLogIndex" [(nzTotal)]="listLogLength" nzShowSizeChanger [(nzPageSize)]="pageLogSize"
				    (nzPageIndexChange)="getLogList()" (nzPageSizeChange)="getLogList()">
				  </nz-pagination>
				</div> -->
	    </div>
	    <div class="display_flex justify-content_flex-center">
	      <button class="btn" nz-button nzType="primary" (click)="hideModal()">知道了</button>
	    </div>
	  </div>
	</div>