<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-item>
                子分类：{{childName}}
            </nz-breadcrumb-item>
        </nz-breadcrumb>
    </div>
    <div nz-col nzSpan="8" class="text-right">
        <button nzType="primary" (click)="returnBack()" nz-button>返回上一页</button>
        <button (click)="ngOnInit()" nz-button nzType="primary"><i class="anticon anticon-sync"></i></button>
        <smart-full-screen></smart-full-screen>
    </div>
</div>
<div nz-row [nzGutter]="4" class="search-form">
    <div nz-col nzSpan="3">
        <button (click)="showAddModal()" nz-button nzType="default"><i class="anticon anticon-plus-circle-o"></i>添加资产
        </button>
    </div>
    <div nz-col nzSpan="18">
        <button (click)="showUploadModal()" nz-button nzType="default"><i class="anticon anticon-upload"></i>导入资产
        </button>
        <button (click)="downLoad()" nz-button nzType="default"><i class="anticon anticon-download"></i>下载模版</button>
        <button (click)="downloadInventory()" [nzLoading]="isDownload" nz-button nzType="default"><i class="anticon anticon-folder"></i>导出资产
        </button>
        <button (click)="batchDeleteInventory()" nz-button nzType="default"><i
                class="anticon anticon-close-circle-o"></i>删除资产
        </button>
    </div>
    <div nz-col nzSpan="3">
    </div>
</div>

<div nz-row [nzGutter]="4" class="search-form">
    <div nz-col nzSpan="4">
        <input type="text" nz-input [(ngModel)]="obj.name" placeholder="资产名称">
    </div>
    <div nz-col nzSpan="3" class="text-center">
        <input type="text" nz-input [(ngModel)]="obj.inventorycount" placeholder="资产数量">
    </div>
    <div nz-col nzSpan="3" class="text-center">
        <input type="text" nz-input [(ngModel)]="obj.mac" placeholder="MAC地址">
    </div>
    <div nz-col nzSpan="3">
        <input type="text" nz-input [(ngModel)]="obj.person" placeholder="负责人">
    </div>
    <div nz-col nzSpan="6" class="text-right">
        <button (click)="search()" nz-button nzType="default"><i class="anticon anticon-search"></i>搜索
        </button>
    </div>
</div>

<nz-table #nzTable [nzData]="childrenList" [nzShowPagination]="false" [nzLoading]="isLoading"
          [nzTotal]="page.totalNum" [nzPageIndex]="page.pageNum"
          [nzPageSize]="page.pageCount" (nzPageIndexChange)="change($event)">
    <thead>
    <tr>
        <th nzShowCheckbox [nzIndeterminate]="indeterminate" [nzChecked]="allChecked"
            (nzCheckedChange)="checkAll($event)"></th>
        <th>资产编号</th>
        <th nzWidth="20%">资产名称</th>
        <th>资产总数</th>
        <th>库存</th>
        <th>使用</th>
        <th>借出</th>
        <th>维修</th>
        <th>报废</th>
        <th>关联事件</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    <tr *ngFor="let data of nzTable.data">
        <td nzShowCheckbox [(nzChecked)]="data.checked" (nzCheckedChange)="selectItem(data,$event)"></td>
        <td class="round-tag tag-form">{{data.inventoryNo}}</td>
        <td>{{data.name}}</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>{{data.eventSum}}</td>
        <td class="handle  main-color">
            <span (click)="goToDetail(data)">查看</span>
            <span class="handle-delete" (click)="deleteInVentory(data)">删除</span>
        </td>
    </tr>
    </tbody>
</nz-table>

<!--新增资产-->
<smart-assets #smartAssets (done)="getList()"></smart-assets>
<!--导入资产-->
<smart-upload #smartUpload></smart-upload>
