Newer
Older
import {WorkService} from '../../work.service';
import {ActivatedRoute, Router} from '@angular/router';
import {CommonService} from '../../../shared/common/common.service';
import {NzMessageService} from 'ng-zorro-antd';
import {AssetsComponent} from '../../modal/assets/assets.component';
import {UploadComponent} from '../../modal/upload/upload.component';
selector: 'smart-child-assets',
templateUrl: './child-assets.component.html',
styles: []
constructor(private workSer: WorkService, private routerInfo: ActivatedRoute,private router:Router,
private conmonSer:CommonService,private message:NzMessageService) {
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(item){
const data = {
inventoryIds:[]
};
data.inventoryIds.push(item.id);
this.workSer.deleteInventory(data).subscribe(
(res)=>{
if(res.errCode == 10000){
this.getList();
this.message.success("删除资产成功");
}else{
this.message.error(res.errMsg);
}
}
)
//添加资产
showAddModal() {
this.smartAssets.showAddModal("添加资产");
}
//查看详情
goToDetail(data){
this.router.navigate(['app/main/assetsDetail'],{
queryParams:{
invertoryId:data.id
}
})
}
//导入资产
showUploadModal(){
this.smartUpload.showModal();
}