<div nz-row class="breadcrumbs" >
    <div nz-col nzSpan="16">
        <nz-breadcrumb class="padding-8-0">
            <nz-breadcrumb-item>
                首页
            </nz-breadcrumb-item>
            <nz-breadcrumb-item>
                <a>运维工作</a>
            </nz-breadcrumb-item>
            <nz-breadcrumb-item>
                资产备件
            </nz-breadcrumb-item>
        </nz-breadcrumb>
    </div>
    <div nz-col nzSpan="8" class="text-right">
        <button nz-button nzType="primary"><i class="anticon anticon-search"></i></button>
        <button nz-button nzType="primary"><i class="anticon anticon-sync"></i></button>
        <button nz-button nzType="primary"><i class="anticon anticon-arrows-alt"></i></button>
    </div>
</div>
<div nz-row [nzGutter]="4" class="search-form">
    <div nz-col nzSpan="4">
        <nz-select style="width: 100%;" [(ngModel)]="obj.type" nzPlaceHolder="选择分类" (ngModelChange)="changeType()">
            <nz-option nzLabel="全部" nzValue="all"></nz-option>
            <ng-container *ngFor="let item of parentList">
                <nz-option [nzLabel]="item.name" [nzValue]="item.id"></nz-option>
            </ng-container>
        </nz-select>
    </div>
    <div nz-col nzSpan="3" class="text-center">
        <button  (click)="showUploadModal()" nz-button nzType="default"><i class="anticon anticon-upload"></i>导入资产</button>
    </div>
    <div nz-col nzSpan="3" class="text-center">
        <button  nz-button nzType="default"><i class="anticon anticon-download"></i>下载模版</button>
    </div>
    <div nz-col nzSpan="8"></div>
    <div nz-col nzSpan="6" class="text-right">
        <button  (click)="showAddModal()" nz-button nzType="default"><i class="anticon anticon-plus"></i>添加</button>
        <button  (click)="showPEditModal()" nz-button nzType="default"><i class="anticon anticon-form"></i>编辑</button>
        <button (click)="deleteParentType()" nz-button nzType="default"><i class="anticon anticon-close-circle-o"></i>删除</button>
    </div>
</div>

<nz-table #nzTable [nzData]="childrenList">
    <thead>
    <tr>
        <th>子分类</th>
        <th>资产总数</th>
        <th>库存</th>
        <th>使用中</th>
        <th>借出</th>
        <th>维修</th>
        <th>报废</th>
        <th>关联事件</th>
        <th style="text-align: center">操作</th>
    </tr>
    </thead>
    <tbody>
    <tr *ngFor="let data of childrenList">
        <td class="round-tag tag-form main-font-color cursor">
            <span (click)="showCEditModal(data.id)">{{data.name}}</span>
        </td>
        <td>
            {{data.inventorycount}}
        </td>
        <td>{{data.stock}}</td>
        <td>
            {{data.usedcount}}
        </td>
        <td>{{data.lendcount}}</td>
        <td>
            {{data.repaircount}}
        </td>
        <td>
           {{data.scrapcount}}
        </td>
        <td>关联事件</td>
        <td class="handle text-center">
            <span (click)="goToChild(data)">明细</span>
            <span (click)="showCEditModal(data)">编辑</span>
            <span (click)="deleteChildType(data)">删除</span>
        </td>
    </tr>
    </tbody>
</nz-table>

<!--新增分类-->
<smart-type-asets #smartTypeAsets (done)="getTypeList()"></smart-type-asets>
<!--倒入资产-->
<smart-upload #smartUpload></smart-upload>