import {Component, OnInit} from '@angular/core';
import {WorkService} from '../../work.service';
import {ActivatedRoute, Router} from '@angular/router';
import {CommonService} from '../../../shared/common/common.service';

@Component({
    selector: 'smart-child-assets',
    templateUrl: './child-assets.component.html',
    styles: []
})
export class ChildAssetsComponent implements OnInit {

    childId;
    childrenList;

    constructor(private workSer: WorkService, private routerInfo: ActivatedRoute,
                private conmonSer:CommonService) {
        this.routerInfo.queryParams.subscribe(
            (res) => {
                this.childId = res.id;
            }
        );
    }

    ngOnInit() {
        this.getList();
    }

    getList() {
        this.workSer.findInventory(this.childId).subscribe(
            (res) => {
                this.childrenList = res.data;
            }
        );
    }

    //删除资产
    deleteInVentory(){
        this.conmonSer.deleteThing("确定删除该资产？",()=>{
            // this.workSer.
        })
    }

}
