Newer
Older
import {Component, EventEmitter, Input, OnInit, Output, ViewChild} from '@angular/core';
import {SendLogComponent} from '../../../alarm/modal/send-log/send-log.component';
import {pageSize} from '../../../app.constants';
import {AlarmService} from '../../../alarm/alarm.service';
import {NzMessageService} from 'ng-zorro-antd';
import {ProjectService} from '../../project.service';
import {SystemChangeService} from '../../../system-change/system-change.service';
import {CreateTrackInfoComponent} from '../create-track-info/create-track-info.component';
@Component({
selector: 'smart-track-info',
templateUrl: './track-info.component.html',
styles: []
})
export class TrackInfoComponent implements OnInit {
@Input() maintainType;
@ViewChild('smartCreateTrackInfo') smartCreateTrackInfo: CreateTrackInfoComponent;
@Output() total = new EventEmitter<any>();
warnList = [];
page = {
pageNum: 1,
pageCount: pageSize,
totalNum: 0,
loading: false,
};
constructor(public alarmSer: AlarmService, public message: NzMessageService,
}
ngOnInit() {
}
outGet() {
this.page.pageNum = 1;
if (this.title.includes('跟踪信息')) this.getList();
if (this.title.includes('配件盘点')) this.getInvoList();
}
if (this.title.includes('跟踪信息')) this.getList();
if (this.title.includes('配件盘点')) this.getInvoList();
getList() {
this.page.loading = true;
const data = {
pageNum: this.page.pageNum,
pageCount: this.page.pageCount,
obj: {
maintainType: this.maintainType
}
};
this.projectSer.selectMaintainProjectTrackMsg(data).subscribe(
(res) => {
if (res.errCode == 10000) {
if (res.data) {
this.warnList = res.data.data;
this.page.totalNum = res.data.totalNum;
}
}
this.page.loading = false;
}
);
}
//配件盘点
getInvoList() {
this.page.loading = true;
const data = {
pageNum: this.page.pageNum,
pageCount: this.page.pageCount,
};
this.workSer.selectTrackMsg(data).subscribe(
(res) => {
if (res.errCode == 10000) {
if (res.data) {
this.warnList = res.data.data;
this.page.totalNum = res.data.totalNum;
}
}
this.page.loading = false;
}
);
}
this.page.loading = true;
this.systemSer.findMsg(this.sysChangeId).subscribe(
if (res.errCode == 10000) {
if (res.data) {
this.warnList = res.data;
// this.page.totalNum = res.data.totalNum;
}
}
this.page.loading = false;
}
handleAddTrack() {
this.smartCreateTrackInfo.showAddModal(`添加${this.title}`);
if (e > 0) {
this.page.pageNum = e;
if (this.title.includes('跟踪信息')) this.getList();
if (this.title.includes('配件盘点')) this.getInvoList();
if (this.title.includes('变更跟踪信息')) this.getChangeList();
}