Newer
Older
import {WorkService} from '../work.service';
import {pageSize} from '../../app.constants';
import {NzMessageService, NzModalService} from 'ng-zorro-antd';
import {PlanModalComponent} from '../modal/plan-modal/plan-modal.component';
import {LookPlanComponent} from '../modal/look-plan/look-plan.component';
selector: 'smart-inspect-plan',
templateUrl: './inspect-plan.component.html',
styles: []
@ViewChild('smartPlanMoadl') smartPlanMoadl: PlanModalComponent;
@ViewChild('smartLookPlan') smartLookPlan: LookPlanComponent;
timeBegin;
timeEnd;
pageCount = pageSize;
pageNum = 1;
totalNum;
pageNum: '',
pageCount: '',
searchStr: '',
typeId: null,
status: null,
constructor(private workSer: WorkService, private message: NzMessageService,
private modalSer: NzModalService) {
}
this.getPlanType();
}
//获取计划分类
getPlanType() {
const data = {
type: 1
};
this.workSer.findByType(data).subscribe(
(res) => {
if (res.errCode == 10000) {
this.planTypeList = res.data;
}
}
);
pageNum: this.pageNum,
pageCount: this.pageCount,
searchStr: this.obj.searchStr,
typeId: this.obj.typeId,
status: this.obj.status,
this.planList = res.data.data;
this.totalNum = res.data.totalNum;
//新增计划
addPlan() {
this.smartPlanMoadl.showAddModal();
}
//编辑计划
editPlan(id) {
this.smartPlanMoadl.showEditModal(id);
}
//查看计划
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
}
//删除计划
deletePlan(data) {
this.modalSer.confirm({
nzTitle: '删除',
nzContent: '<b style="color: red;">确认删除该计划吗?</b>',
nzOkText: '确定',
nzOkType: 'danger',
nzOnOk: () => {
const arr = {
ids: []
};
arr.ids.push(data.id);
this.workSer.deletePlan(arr).subscribe(
(res) => {
if (res.errCode == 10000) {
this.message.success('删除成功');
this.getList();
} else {
this.message.error(res.errMsg);
}
}
);
},
nzCancelText: '取消',
nzOnCancel: () => console.log('Cancel')
}
);
}