Newer
Older
import {Component, EventEmitter, OnInit, Output, ViewChild} from '@angular/core';
import {TrackInfoComponent} from '../../../project-manager/modal/track-info/track-info.component';
import {FormControl} from '@angular/forms';
import {NzMessageService} from 'ng-zorro-antd';
import {TransforComponent} from '../../../work/modal/transfor/transfor.component';
import {WorkService} from '../../../work/work.service';
import {CommonService} from '../../../shared/common/common.service';
@Component({
selector: 'smart-change-verity',
templateUrl: './change-verity.component.html',
.changeStatus {
padding: 0 15px 15px;
font-size: 20px;
}
.changeStatus > span:first-child {
border-right: 1px solid #dddddd;
}
.changeStatus > span {
padding: 0 15px;
}
.changeStatus > span > span {
font-weight: bold;
}
`
]
@ViewChild('smartTrackInfo') smartTrackInfo: TrackInfoComponent;
@ViewChild('smartTransfor') smartTransfor: TransforComponent;
isVisible: false,
title: '',
isOkLoading: false
};
checkModal = {
isVisible: false,
checkOpinion: '',
title: '审核意见',
status: null,
isOkLoading: false
};
dealObj = {
changeResult: '',
finishTime: null,
fileId: ''
constructor(private sysChangeSer: SystemChangeService,
private message: NzMessageService,
}
showModal(id, title) {
this.modal.title = title;
this.id = id;
this.getDetail();
this.getMsg();
}
//查询变更详情
getDetail() {
this.sysChangeSer.find(this.id).subscribe(
(res) => {
this.changeObj = res.data;
}
);
}
//查询变更跟踪信息
getMsg() {
this.sysChangeSer.findMsg(this.id).subscribe(
(res) => {
this.msgList = res.data;
}
);
}
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
//转派
showTransforModal() {
this.smartTransfor.showTransforModal('变更转派', this.id);
}
//打开checkmodal
openCheckModal(status) {
this.checkModal.isVisible = true;
this.checkModal.status = status;
}
//审核确定
handleOk() {
this.checkModal.isOkLoading = true;
const d = {
id: this.id,
status: this.checkModal.status,
checkOpinion: this.checkModal.checkOpinion
};
this.systemChangeSer.sysChangeCheck(d).subscribe(
(res) => {
if (res.errCode == 10000) {
this.modal.isVisible = false;
this.done.emit();
this.message.success('审核成功');
}
this.checkModal.isOkLoading = false;
}
);
}
//变更处理
dealChange(status) {
if (status == 7 && !this.dealObj.changeResult && !this.dealObj.finishTime) {
this.checkModal.isOkLoading = true;
const d = {
id: this.id,
status: status,
changeResult: this.dealObj.changeResult,
finishTime: new Date(this.dealObj.finishTime).getTime()
};
this.systemChangeSer.sysChangeFinish(d).subscribe(
(res) => {
if (res.errCode == 10000) {
this.modal.isVisible = false;
this.done.emit();
this.message.success('变更成功');
}
this.checkModal.isOkLoading = false;
}
);
}
//取消
handleCancle() {
this.done.emit();
this.modal.isVisible = false;
}
//附件下载
downLoad(file) {
this.workSer.sysFileDownload(file.id).subscribe(
(data) => {
this.commonSer.downloadFile(file.name, data);
}
);
}