Newer
Older
import {Router} from '@angular/router';
import {TypeAsetsComponent} from '../modal/type-asets/type-asets.component';
import {UploadComponent} from '../modal/upload/upload.component';
import {CommonService} from '../../shared/common/common.service';
@Component({
selector: 'smart-asset-part',
templateUrl: './asset-part.component.html',
styles: []
})
export class AssetPartComponent implements OnInit {
constructor(private workSer:WorkService,private router:Router,private commonSer:CommonService,
private message:NzMessageService,private systemSer:SystemService) { }
goToChild(data){
this.router.navigate(['app/main/assetChild'],
{
queryParams:{
}
})
}
showAddModal(){
this.smartTypeAsets.showAddModal("新增分类");
}
const data = {
inventoryTypeIds:[]
};
data.inventoryTypeIds.push(this.obj.type);
this.workSer.deleteType(data).subscribe(
(res)=>{
if(res.errCode == 10000){
//编辑子级分类
showCEditModal(id){
this.smartTypeAsets.showEditModal("编辑分类",id);
}
this.workSer.findInventory(item.id).subscribe(
(res) => {
if(res.data.length > 0 ){
}else{
const data = {
inventoryTypeIds:[]
};
data.inventoryTypeIds.push(item.id);
this.commonSer.confirmThing("删除","确定删除该子级分类",()=>{
this.workSer.deleteType(data).subscribe(
(res)=>{
if(res.errCode == 10000){
this.smartUpload.showModal("上传资产文件");
}
//下载模版
downLoad(){
this.systemSer.downloadTemplate("inventory",SERVER_API_URL + "/api/template/download/").subscribe(