Commit f7b4b2a4 authored by wangqinghua's avatar wangqinghua

style update

parent 8dd4e7ca
......@@ -6,27 +6,30 @@ import {LinkInventoryComponent} from '../../modal/link-inventory/link-inventory.
import {DatePipe, Location} from '@angular/common';
import {TransforComponent} from '../../modal/transfor/transfor.component';
import {CommonService} from '../../../shared/common/common.service';
import {DomSanitizer} from '@angular/platform-browser';
@Component({
selector: 'smart-handle-event',
templateUrl: './handle-event.component.html',
styles: [
`
:host ::ng-deep .ant-row{
margin: 20px 0;
}
:host ::ng-deep .ant-col-4{
text-align: right;
}
h2{
`
:host ::ng-deep .ant-row {
margin: 20px 0;
}
:host ::ng-deep .ant-col-4 {
text-align: right;
}
h2 {
font-weight: 400;
}
`
]
})
export class HandleEventComponent implements OnInit {
@ViewChild('smartLinkInventory') smartLinkInventory:LinkInventoryComponent;
@ViewChild('smartTransfor') smartTransfor:TransforComponent;
@ViewChild('smartLinkInventory') smartLinkInventory: LinkInventoryComponent;
@ViewChild('smartTransfor') smartTransfor: TransforComponent;
eventId;
event;
......@@ -35,14 +38,15 @@ export class HandleEventComponent implements OnInit {
format;
obj = {
operateStatus:null,
operateResult:null,
operateStatus: null,
operateResult: null,
};
date;
time;
constructor(private routrInfo: ActivatedRoute, private workSer: WorkService,private location:Location,
private message: NzMessageService,private datePipe:DatePipe,private commonSer:CommonService) {
constructor(private routrInfo: ActivatedRoute, private workSer: WorkService, private location: Location,
private sanitizer:DomSanitizer,
private message: NzMessageService, private datePipe: DatePipe, private commonSer: CommonService) {
this.routrInfo.queryParams.subscribe(
(res) => {
this.eventId = res.eventId;
......@@ -60,88 +64,114 @@ export class HandleEventComponent implements OnInit {
this.workSer.findByNo(this.eventId).subscribe(
(res) => {
this.event = res.data;
if(this.event.operateResult){
let con = this.event.operateResult.replace(/\r?\n/g, "<br />");
this.event.operateResult = this.sanitizer.bypassSecurityTrustHtml(con);
}
}
);
}
//查询事件流转信息
findTransferAndInventory(){
findTransferAndInventory() {
this.workSer.findTransferAndInventory(this.eventId).subscribe(
(res)=>{
this.transforsList = res.data.transfers;
this.transforsList.forEach(e=>{
e.operatorInfo = e.operatorInfo.replace(/\"/g,"").replace("{","").replace("}","").split(":");
})
(res) => {
this.transforsList = res.data.transfers;
this.transforsList.forEach(e => {
e.operatorInfo = e.operatorInfo.replace(/\"/g, '').replace('{', '').replace('}', '').split(':');
});
}
)
);
}
selectPerson(){
selectPerson() {
}
//选择关联弹窗
showInventoryModal(){
this.smartLinkInventory.showModal("添加关联资产");
showInventoryModal() {
this.smartLinkInventory.showModal('添加关联资产');
}
//选择管理返回值
setLink(e){
setLink(e) {
this.linkList = e;
}
//保存处理
save(){
if(!this.obj.operateStatus){
this.message.error("请选择处理结果");
save() {
if (!this.obj.operateStatus) {
this.message.error('请选择处理结果');
return false;
}
if(!this.date || !this.time){
this.message.error("请选择完成时间");
if (!this.date || !this.time) {
this.message.error('请选择完成时间');
return false;
}
if(!this.obj.operateResult){
this.message.error("请填写处理情况");
if (!this.obj.operateResult) {
this.message.error('请填写处理情况');
return false;
}
const data = {
id:this.eventId,
operateStatus:Number(this.obj.operateStatus),
inventoryId:this.linkList.map(e=>{
return e.id;
}),
operateResult:this.obj.operateResult,
completeTimeStr:this.datePipe.transform(this.date,"yyyy-MM-dd") + " " + this.datePipe.transform(this.time,"HH:mm:ss")
};
this.workSer.deal(data).subscribe(
(res)=>{
if(res.errCode == 10000){
this.location.back();
this.message.success("事件处理成功");
}else{
this.message.error(res.errMsg);
this.commonSer.confirmThing('确认', '确定提交处理结果?', () => {
const data = {
id: this.eventId,
operateStatus: Number(this.obj.operateStatus),
inventoryId: this.linkList.map(e => {
return e.id;
}),
operateResult: this.obj.operateResult,
completeTimeStr: this.datePipe.transform(this.date, 'yyyy-MM-dd') + ' ' + this.datePipe.transform(this.time, 'HH:mm:ss')
};
this.workSer.deal(data).subscribe(
(res) => {
if (res.errCode == 10000) {
this.location.back();
this.message.success('事件处理成功');
} else {
this.message.error(res.errMsg);
}
}
}
)
);
});
}
//转派
showTransforModal(){
this.smartTransfor.showTransforModal("事件转派",this.eventId);
showTransforModal() {
this.smartTransfor.showTransforModal('事件转派', this.eventId);
}
//转派成功
success(e){
success(e) {
this.location.back();
}
downLoad(){
this.workSer.downloadTemplate("event",this.eventId).subscribe(
(data)=>{
this.commonSer.downloadFile(this.event.fileName+".xlsx",data)
//确认完成
done() {
this.commonSer.confirmThing('确认', '确认事件完成?', () => {
const data = {
ids: []
};
data.ids.push(this.eventId);
this.workSer.confirmEvent(data).subscribe(
(res) => {
if (res.errCode == 10000) {
this.location.back();
this.message.success('事件确认成功');
} else {
this.message.error(res.errMsg);
}
}
);
});
}
//下载
downLoad() {
this.workSer.downloadTemplate('event', this.eventId).subscribe(
(data) => {
this.commonSer.downloadFile(this.event.fileName + '.xlsx', data);
}
)
);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment