Newer
Older
import {pageSize} from '../../app.constants';
import {WorkService} from '../work.service';
import {NzMessageService} from 'ng-zorro-antd';
import {Router} from '@angular/router';
import {CommonService} from '../../shared/common/common.service';
import {SelectPersonComponent} from '../../modal/select-person/select-person.component';
import {TransforComponent} from '../modal/transfor/transfor.component';
selector: 'smart-work-handle',
templateUrl: './work-handle.component.html',
styles: []
@ViewChild('smartTransfor') smartTransfor: TransforComponent;
@ViewChild('smartSelectPerson') smartSelectPerson: SelectPersonComponent;
status: null,
source: null,
startTime: '',
endTime: '',
constructor(private workSer: WorkService, private message: NzMessageService,
private router: Router, private commonSer: CommonService, private datePipe: DatePipe) {
const obj = {
pageCount: this.pageCount,
pageNum: this.pageNum,
searchStr: this.obj.searchStr,
type: this.obj.type,
status: this.obj.status,
source: this.obj.source,
startTime: this.obj.startTime,
endTime: this.obj.endTime,
};
this.workSer.find(obj).subscribe(
(res) => {
if (res.errCode == 10000) {
this.eventList = res.data.data;
this.totalNum = res.data.totalNum;
lookEvent(item) {
this.router.navigate(['app/main/handleDetail'], {
queryParams: {
eventId: item.id
}
});
this.router.navigate(['app/main/handleEvent'], {
queryParams: {
eventId: item.id
}
});
}
showAddModal() {
this.smartEvent.showAddModal('新增事件');
}
//编辑事件
showEditModal(item) {
this.smartEvent.showEditModal('编辑事件', item.id);
}
//删除事件
deleteHandle(data) {
const arr = {
ids: []
};
arr.ids.push(data.id);
this.workSer.deleteEvent(arr).subscribe(
(res) => {
if (res.errCode == 10000) {
this.message.success('删除成功');
this.getList();
}
}
);
});
}
showTransforModal(item) {
this.smartTransfor.showTransforModal('事件转派', item.id);
this.obj.startTime = this.datePipe.transform(this.startTime, 'yyyy-MM-dd HH:mm:ss');
this.obj.endTime = this.datePipe.transform(this.endTime, 'yyyy-MM-dd HH:mm:ss');