Browse Source

[新增]水源同意审核和拒绝审核功能

zhuzhou
邵佳豪 4 years ago
parent
commit
8207a876ad
  1. 231
      src/app/plan-audit/wait-examineer/wait-examineer.component.ts

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

@ -334,40 +334,159 @@ export class WaitExamineerComponent implements OnInit {
config.duration = 3000
console.log(this.shenheTable)
if(this.shenheTable.length==0){
this.snackBar.open('请选择要审核的预案!','确定',config);
this.snackBar.open('请勾选要审核的条目!','确定',config);
}
//单个审核
else if(this.shenheTable.length==1){
//重点单位审核
if(this.shenheTable[0].contentType==11){
else if(this.shenheTable.length == 1){
let isTrue = window.confirm('确定同意选中条目的审核吗?')
if(isTrue){
//重点单位审核
if(this.shenheTable[0].contentType == 11){
let body:any = {
id:this.shenheTable[0].id,
itemId:this.shenheTable[0].itemId,
verifyState:4,
contentType:11,
title:this.shenheTable[0].title+'基本信息'
}
this.http.put(`/api/ContentVerifies`,body).subscribe(data=>{
this.snackBar.open('操作成功!','确定',config);
this.getAlltabledate()
})
}else if(this.shenheTable[0].contentType == 12){
let body:any = {
id:this.shenheTable[0].id,
itemId:this.shenheTable[0].itemId,
verifyState:4,
contentType:12,
title:this.shenheTable[0].title
}
this.http.put(`/api/ContentVerifies`,body).subscribe(data=>{
this.snackBar.open('操作成功!','确定',config);
this.showtype = -1
this.getAlltabledate()
})
}else if(this.shenheTable[0].contentType == 13){
}else if(this.shenheTable[0].contentType == 14){
}else{
//预案审核
if(this.shenheTable[0].verifyState==0){
this.http.put(`/api/PlanAudits/${this.shenheTable[0].itemId}/First`,{auditStatus:16}).subscribe(data=>{
this.snackBar.open('操作成功!','确定',config);
this.getAlltabledate()
})
}else if(this.shenheTable[0].verifyState==3){
this.http.put(`/api/PlanAudits/${this.radioid}`,{auditStatus:2}).subscribe(data=>{
this.snackBar.open('操作成功!','确定',config);
this.getAlltabledate()
})
}
}
}
}
//批量审核
else{
let isTrue = window.confirm('确定同意选中条目的审核吗?')
if(isTrue){
if(this.shenheTable[0].contentType==11||this.shenheTable[0].contentType==12){ //批量审批水源和重点单位
for(var i=0;i<this.shenheTable.length;i++){
var body={
id:this.shenheTable[i].id,
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)
}
this.http.put(`/api/PlanAudits/Batch`,agreeList).subscribe(data=>{
this.snackBar.open('操作成功!','确定',config);
this.getAlltabledate()
})
}
}
}
this.shenheTable=[]
}
//拒绝操作
refuse(){
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
var refuseList = []
var companyrefuseList=[]
if(this.shenheTable.length==0){
this.snackBar.open('请选择要审核的预案!','确定',config);
}
//单个审核拒绝
else if(this.shenheTable.length==1){
let isTrue = window.confirm('确定拒绝选中条目的审核吗?')
if(isTrue){
//重点单位审核拒绝
if(this.shenheTable[0].contentType == 11){
let body:any = {
id:this.shenheTable[0].id,
itemId:this.shenheTable[0].itemId,
verifyState:4,
verifyState:5,
contentType:11,
title:this.shenheTable[0].title+'基本信息'
}
}
this.http.put(`/api/ContentVerifies`,body).subscribe(data=>{
this.snackBar.open('操作成功!','确定',config);
this.getAlltabledate()
})
}else if(this.shenheTable[0].contentType == 12){
let body:any = {
id:this.shenheTable[0].id,
itemId:this.shenheTable[0].itemId,
verifyState:5,
contentType:12,
title:this.shenheTable[0].title
}
this.http.put(`/api/ContentVerifies`,body).subscribe(data=>{
this.showtype = -1
this.snackBar.open('操作成功!','确定',config);
this.getAlltabledate()
})
}else if(this.shenheTable[0].contentType == 13){
}else if(this.shenheTable[0].contentType == 14){
}else{
//预案审核
//预案审核拒绝
if(this.shenheTable[0].verifyState==0){
this.http.put(`/api/PlanAudits/${this.shenheTable[0].itemId}/First`,{auditStatus:16}).subscribe(data=>{
this.http.put(`/api/PlanAudits/${this.shenheTable[0].itemId}/First`,{auditStatus:32}).subscribe(data=>{
this.snackBar.open('操作成功!','确定',config);
this.getAlltabledate()
})
}else if(this.shenheTable[0].verifyState==3){
this.http.put(`/api/PlanAudits/${this.radioid}`,{auditStatus:2}).subscribe(data=>{
this.http.put(`/api/PlanAudits/${this.radioid}`,{auditStatus:4}).subscribe(data=>{
this.snackBar.open('操作成功!','确定',config);
this.getAlltabledate()
})
}
}
}
//批量审核
else{
}
//批量审核
else{
let isTrue = window.confirm('确定拒绝选中条目的审核吗?')
if(isTrue){
if(this.shenheTable[0].contentType==11||this.shenheTable[0].contentType==12){ //批量审批水源和重点单位
for(var i=0;i<this.shenheTable.length;i++){
var body={
@ -375,106 +494,32 @@ export class WaitExamineerComponent implements OnInit {
itemId:this.shenheTable[i].itemId,
verifyState:4
}
companyAgreeList.push(body)
companyrefuseList.push(body)
}
this.http.put(`/api/ContentVerifies/Batch`,companyAgreeList).subscribe(data=>{
this.http.put(`/api/ContentVerifies/Batch`,companyrefuseList).subscribe(data=>{
this.snackBar.open('操作成功!','确定',config);
this.getAlltabledate()
})
}else{ //批量审核预案
}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,
auditStatus:this.shenheTable[i].verifyState==3?4:32,
auditOpinion:''
}
agreeList.push(cart)
refuseList.push(cart)
}
this.http.put(`/api/PlanAudits/Batch`,agreeList).subscribe(data=>{
this.http.put(`/api/PlanAudits/Batch`,refuseList).subscribe(data=>{
this.snackBar.open('操作成功!','确定',config);
this.getAlltabledate()
})
}
}
this.shenheTable=[]
}
//拒绝操作
refuse(){
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
var refuseList=[]
var companyrefuseList=[]
if(this.shenheTable.length==0){
this.snackBar.open('请选择要审核的预案!','确定',config);
}
//单个审核拒绝
else if(this.shenheTable.length==1){
//重点单位审核拒绝
if(this.shenheTable[0].contentType==11){
let body:any = {
id:this.shenheTable[0].id,
itemId:this.shenheTable[0].itemId,
verifyState:5,
contentType:11,
title:this.shenheTable[0].title+'基本信息'
}
this.http.put(`/api/ContentVerifies`,body).subscribe(data=>{
this.snackBar.open('操作成功!','确定',config);
this.getAlltabledate()
})
}else{
//预案审核拒绝
if(this.shenheTable[0].verifyState==0){
this.http.put(`/api/PlanAudits/${this.shenheTable[0].itemId}/First`,{auditStatus:32}).subscribe(data=>{
this.snackBar.open('操作成功!','确定',config);
this.getAlltabledate()
})
}else if(this.shenheTable[0].verifyState==3){
this.http.put(`/api/PlanAudits/${this.radioid}`,{auditStatus:4}).subscribe(data=>{
this.snackBar.open('操作成功!','确定',config);
this.getAlltabledate()
})
}
}
}
//批量审核
else{
if(this.shenheTable[0].contentType==11||this.shenheTable[0].contentType==12){ //批量审批水源和重点单位
for(var i=0;i<this.shenheTable.length;i++){
var body={
id:this.shenheTable[i].id,
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)
}
this.http.put(`/api/PlanAudits/Batch`,refuseList).subscribe(data=>{
this.snackBar.open('操作成功!','确定',config);
this.getAlltabledate()
})
}
this.shenheTable=[]
}
this.shenheTable=[]
}
}
//分数饼状图
bar(){

Loading…
Cancel
Save