Browse Source

[新增]重点单位批量审核功能

zhuzhou
chenjingyu 4 years ago
parent
commit
bf09688da5
  1. 83
      src/app/plan-audit/wait-examineer/wait-examineer.component.ts

83
src/app/plan-audit/wait-examineer/wait-examineer.component.ts

@ -4,7 +4,7 @@
* @Author: sueRimn * @Author: sueRimn
* @Date: 2020-12-25 16:13:50 * @Date: 2020-12-25 16:13:50
* @LastEditors: sueRimn * @LastEditors: sueRimn
* @LastEditTime: 2021-03-02 10:29:47 * @LastEditTime: 2021-03-02 15:08:13
*/ */
import { Component, Inject, OnInit } from '@angular/core'; import { Component, Inject, OnInit } from '@angular/core';
import { FormControl } from '@angular/forms'; import { FormControl } from '@angular/forms';
@ -162,8 +162,11 @@ export class WaitExamineerComponent implements OnInit {
this.fetchUrl='' this.fetchUrl=''
this.viewer={} this.viewer={}
if(item.contentType==11){ if(item.contentType==11){
this.showtype=3 window.setTimeout(()=>{
sessionStorage.setItem('companyId',item.itemId) this.showtype=3
sessionStorage.setItem('companyId',item.itemId)
},0)
}else{ }else{
this.http.get(`/api/PlanComponents/${item.itemId}`).subscribe((data:any)=>{ this.http.get(`/api/PlanComponents/${item.itemId}`).subscribe((data:any)=>{
this.companyId=data.companyId this.companyId=data.companyId
@ -311,6 +314,7 @@ export class WaitExamineerComponent implements OnInit {
//同意操作 //同意操作
agree(){ agree(){
var agreeList=[] var agreeList=[]
var companyAgreeList=[]
const config = new MatSnackBarConfig(); const config = new MatSnackBarConfig();
config.verticalPosition = 'top'; config.verticalPosition = 'top';
config.duration = 3000 config.duration = 3000
@ -351,18 +355,34 @@ export class WaitExamineerComponent implements OnInit {
} }
//批量审核 //批量审核
else{ else{
for(var i=0;i<this.shenheTable.length;i++){ if(this.shenheTable[0].contentType==11||this.shenheTable[0].contentType==12){ //批量审批水源和重点单位
var cart={ for(var i=0;i<this.shenheTable.length;i++){
planComponentId:this.shenheTable[i].itemId, var body={
auditStatus:this.shenheTable[i].verifyState==3?2:16, id:this.shenheTable[i].id,
auditOpinion:'' itemId:this.shenheTable[i].itemId,
verifyState:4
}
companyAgreeList.push(body)
}
this.http.put(`/api/ContentVerifies/Batch`,companyAgreeList).subscribe(data=>{
this.snackBar.open('操作成功!','确定',config);
this.getAlltabledate()
})
}else{ //批量审核预案
for(var i=0;i<this.shenheTable.length;i++){
var cart={
planComponentId:this.shenheTable[i].itemId,
auditStatus:this.shenheTable[i].verifyState==3?2:16,
auditOpinion:''
}
agreeList.push(cart)
} }
agreeList.push(cart) this.http.put(`/api/PlanAudits/Batch`,agreeList).subscribe(data=>{
this.snackBar.open('操作成功!','确定',config);
this.getAlltabledate()
})
} }
this.http.put(`/api/PlanAudits/Batch`,agreeList).subscribe(data=>{
this.snackBar.open('操作成功!','确定',config);
this.getAlltabledate()
})
} }
this.shenheTable=[] this.shenheTable=[]
} }
@ -372,6 +392,7 @@ export class WaitExamineerComponent implements OnInit {
config.verticalPosition = 'top'; config.verticalPosition = 'top';
config.duration = 3000 config.duration = 3000
var refuseList=[] var refuseList=[]
var companyrefuseList=[]
if(this.shenheTable.length==0){ if(this.shenheTable.length==0){
this.snackBar.open('请选择要审核的预案!','确定',config); this.snackBar.open('请选择要审核的预案!','确定',config);
} }
@ -408,18 +429,34 @@ export class WaitExamineerComponent implements OnInit {
} }
//批量审核 //批量审核
else{ else{
for(var i=0;i<this.shenheTable.length;i++){ if(this.shenheTable[0].contentType==11||this.shenheTable[0].contentType==12){ //批量审批水源和重点单位
var cart={ for(var i=0;i<this.shenheTable.length;i++){
planComponentId:this.shenheTable[i].itemId, var body={
auditStatus:this.shenheTable[i].verifyState==3?4:32, id:this.shenheTable[i].id,
auditOpinion:'' itemId:this.shenheTable[i].itemId,
verifyState:4
}
companyrefuseList.push(body)
}
this.http.put(`/api/ContentVerifies/Batch`,companyrefuseList).subscribe(data=>{
this.snackBar.open('操作成功!','确定',config);
this.getAlltabledate()
})
}else{
for(var i=0;i<this.shenheTable.length;i++){
var cart={
planComponentId:this.shenheTable[i].itemId,
auditStatus:this.shenheTable[i].verifyState==3?4:32,
auditOpinion:''
}
refuseList.push(cart)
} }
refuseList.push(cart) this.http.put(`/api/PlanAudits/Batch`,refuseList).subscribe(data=>{
this.snackBar.open('操作成功!','确定',config);
this.getAlltabledate()
})
} }
this.http.put(`/api/PlanAudits/Batch`,refuseList).subscribe(data=>{
this.snackBar.open('操作成功!','确定',config);
this.getAlltabledate()
})
} }
this.shenheTable=[] this.shenheTable=[]

Loading…
Cancel
Save