Commit 4cb63820 authored by wangqinghua's avatar wangqinghua

update

parent 15e305a6
...@@ -85,7 +85,7 @@ ...@@ -85,7 +85,7 @@
<td>{{item.hostname}}</td> <td>{{item.hostname}}</td>
<td>{{item.groupname}}</td> <td>{{item.groupname}}</td>
<td>{{item.description}}</td> <td>{{item.description}}</td>
<td>{{item.priority}}</td> <td>{{item.priorityName}}</td>
<td>{{item.count}}</td> <td>{{item.count}}</td>
</tr> </tr>
</ng-container> </ng-container>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
(nzOnOk)="handEditleOk()"> (nzOnOk)="handEditleOk()">
<div nz-form class="ant-advanced-search-form form-select"> <div nz-form class="ant-advanced-search-form form-select">
<div nz-row [nzGutter]="24"> <div nz-row [nzGutter]="24">
<div nz-col [nzSpan]="8"> <div nz-col [nzSpan]="8" class="padding-8-0">
<nz-tree [(ngModel)]="nodes"></nz-tree> <nz-tree [(ngModel)]="nodes"></nz-tree>
</div> </div>
......
...@@ -110,7 +110,7 @@ export class SelectPersonComponent implements OnInit { ...@@ -110,7 +110,7 @@ export class SelectPersonComponent implements OnInit {
}; };
this.systemSer.user(data).subscribe( this.systemSer.user(data).subscribe(
(res) => { (res) => {
this.userList = res.data; this.userList = res.data.data;
} }
); );
} }
......
...@@ -20,8 +20,14 @@ ...@@ -20,8 +20,14 @@
<div nz-row class="search-form"> <div nz-row class="search-form">
<div nz-col nzSpan="16"> <div nz-col nzSpan="16">
<button (click)="approvalPass()" nz-button nzType="default"><i class="anticon anticon-check-circle-o"></i>通过</button> <ng-container *ngIf="roleType == 2 || roleType == 3">
<button (click)="approvalUnPass()" nz-button nzType="default"><i class="anticon anticon-close-circle-o"></i>退回</button> <button (click)="approvalPass()" nz-button nzType="default"><i class="anticon anticon-check-circle-o"></i>通过</button>
<button (click)="approvalUnPass()" nz-button nzType="default"><i class="anticon anticon-close-circle-o"></i>退回</button>
</ng-container>
<!--系统管理员-->
<ng-container *ngIf="roleType == 1 || roleType == 3">
<button (click)="approvalCancle()" nz-button nzType="default"><i class="anticon anticon-close-circle-o"></i>撤回</button>
</ng-container>
</div> </div>
<div nz-col nzSpan="8" class="text-right"> <div nz-col nzSpan="8" class="text-right">
<input nz-input placeholder="操作用户" [(ngModel)]="name"> <input nz-input placeholder="操作用户" [(ngModel)]="name">
......
...@@ -150,6 +150,10 @@ export class ExamineComponent implements OnInit { ...@@ -150,6 +150,10 @@ export class ExamineComponent implements OnInit {
//审批通过 //审批通过
approvalPass(){ approvalPass(){
if(this.selectList.length == 0){
this.message.warning("请选择需要审核数据")
return false;
}
this.commonSer.confirmThing("通过","确定通过所选请求",()=>{ this.commonSer.confirmThing("通过","确定通过所选请求",()=>{
this.systemSer.approvalPass(this.selectList).subscribe( this.systemSer.approvalPass(this.selectList).subscribe(
(res)=>{ (res)=>{
...@@ -168,8 +172,12 @@ export class ExamineComponent implements OnInit { ...@@ -168,8 +172,12 @@ export class ExamineComponent implements OnInit {
//审批不通过 //审批不通过
approvalUnPass(){ approvalUnPass(){
if(this.selectList.length == 0){
this.message.warning("请选择需要审核数据")
return false;
}
this.commonSer.confirmThing("退回","确定拒绝所选请求",()=>{ this.commonSer.confirmThing("退回","确定拒绝所选请求",()=>{
this.systemSer.approvCancle(this.selectList).subscribe( this.systemSer.approvUnPass(this.selectList).subscribe(
(res)=>{ (res)=>{
if(res.errCode == 10000){ if(res.errCode == 10000){
this.message.success("退回成功"); this.message.success("退回成功");
...@@ -184,6 +192,27 @@ export class ExamineComponent implements OnInit { ...@@ -184,6 +192,27 @@ export class ExamineComponent implements OnInit {
} }
//审批取消
approvalCancle(){
if(this.selectList.length == 0){
this.message.warning("请选择需要审核数据")
return false;
}
this.commonSer.confirmThing("撤回","确定取消所选请求",()=>{
this.systemSer.approvCancle(this.selectList).subscribe(
(res)=>{
if(res.errCode == 10000){
this.message.success("撤回成功");
this.getListNo();
this.getListAlready();
}else{
this.message.error(res.errMsg);
}
}
)
})
}
changeIndex(e){ changeIndex(e){
this.tabNum = e; this.tabNum = e;
} }
......
...@@ -97,6 +97,7 @@ export class UserComponent implements OnInit { ...@@ -97,6 +97,7 @@ export class UserComponent implements OnInit {
this.isVisible = false; this.isVisible = false;
this.initForm(); this.initForm();
this.done.emit(); this.done.emit();
this.message.success("新增用户成功");
}else{ }else{
this.message.error(res.errMsg); this.message.error(res.errMsg);
} }
...@@ -112,6 +113,7 @@ export class UserComponent implements OnInit { ...@@ -112,6 +113,7 @@ export class UserComponent implements OnInit {
this.isVisible = false; this.isVisible = false;
this.initForm(); this.initForm();
this.done.emit(); this.done.emit();
this.message.success("更新用户成功");
}else{ }else{
this.message.error(res.errMsg); this.message.error(res.errMsg);
} }
......
...@@ -160,7 +160,12 @@ export class SystemService { ...@@ -160,7 +160,12 @@ export class SystemService {
return this.http.post(SERVER_API_URL_COMS + '/approve/pass', data ); return this.http.post(SERVER_API_URL_COMS + '/approve/pass', data );
} }
//审批退回 //审批不通过
approvUnPass(data): Observable<any>{
return this.http.post(SERVER_API_URL_COMS + '/approve/unPass', data);
}
//审批取消
approvCancle(data): Observable<any>{ approvCancle(data): Observable<any>{
return this.http.post(SERVER_API_URL_COMS + '/approve/cancle', data); return this.http.post(SERVER_API_URL_COMS + '/approve/cancle', data);
} }
......
...@@ -131,7 +131,6 @@ ...@@ -131,7 +131,6 @@
<ng-container *ngFor="let item1 of participantsList;let i = index;"> <ng-container *ngFor="let item1 of participantsList;let i = index;">
<span>{{item1.username}}</span><span (click)="delete1(i)">X</span> <span>{{item1.username}}</span><span (click)="delete1(i)">X</span>
</ng-container> </ng-container>
<nz-form-explain *ngIf="validateForm.get('participants').dirty && validateForm.get('participants').errors">请选择参与人</nz-form-explain>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
...@@ -143,7 +142,6 @@ ...@@ -143,7 +142,6 @@
<ng-container *ngFor="let item2 of principalsList;let i = index;"> <ng-container *ngFor="let item2 of principalsList;let i = index;">
<span>{{item2.username}}</span><span (click)="delete2(i)">X</span> <span>{{item2.username}}</span><span (click)="delete2(i)">X</span>
</ng-container> </ng-container>
<nz-form-explain *ngIf="validateForm.get('principals').dirty && validateForm.get('principals').errors">请选择负责人</nz-form-explain>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
......
...@@ -21,8 +21,8 @@ export class PlanModalComponent implements OnInit { ...@@ -21,8 +21,8 @@ export class PlanModalComponent implements OnInit {
fileList: UploadFile[] = []; fileList: UploadFile[] = [];
modalTitle; modalTitle;
participantsList; //参与人 participantsList = []; //参与人
principalsList; //负责人 principalsList = []; //负责人
constructor(private workSer: WorkService, private message: NzMessageService, constructor(private workSer: WorkService, private message: NzMessageService,
private fb: FormBuilder) { private fb: FormBuilder) {
...@@ -34,13 +34,15 @@ export class PlanModalComponent implements OnInit { ...@@ -34,13 +34,15 @@ export class PlanModalComponent implements OnInit {
} }
initForm() { initForm() {
this.participantsList = [];
this.principalsList = [];
this.validateForm = this.fb.group({ this.validateForm = this.fb.group({
title: [null, [Validators.required]], title: [null, [Validators.required]],
typeId: [null, [Validators.required]], typeId: [null, [Validators.required]],
startTime: [null, [Validators.required]], startTime: [null, [Validators.required]],
endTime: [null, [Validators.required]], endTime: [null, [Validators.required]],
cycleType: [null, [Validators.required]], cycleType: [null, [Validators.required]],
cycleNum: [null, [Validators.required]], cycleNum: [null],
number: [null, [Validators.required]], number: [null, [Validators.required]],
workload: [null], workload: [null],
description: [null], description: [null],
...@@ -81,18 +83,34 @@ export class PlanModalComponent implements OnInit { ...@@ -81,18 +83,34 @@ export class PlanModalComponent implements OnInit {
this.title = '编辑计划'; this.title = '编辑计划';
this.planId = id; this.planId = id;
this.isVisiable = true; this.isVisiable = true;
this.workSer.findPlan(id).subscribe(
(res)=>{
this.validateForm.patchValue(res.data);
}
)
} }
handEditleOk() { handEditleOk() {
this.validateForm.value.principals = this.principalsList.length > 0 ? this.principalsList:null;
this.validateForm.value.participants = this.participantsList.length > 0 ?this.participantsList:null;
for (let i in this.validateForm.controls) { for (let i in this.validateForm.controls) {
this.validateForm.controls[i].markAsDirty(); this.validateForm.controls[i].markAsDirty();
this.validateForm.controls[i].updateValueAndValidity(); this.validateForm.controls[i].updateValueAndValidity();
} }
if (this.validateForm.invalid) { if (this.validateForm.invalid) {
return false; return false;
} }
if(this.participantsList.length == 0){
this.message.error("请选择参与人");
return false;
}
if(this.principalsList.length == 0){
this.message.error("请选择负责人");
return false;
}
this.validateForm.value.principals = this.principalsList;
this.validateForm.value.participants = this.participantsList;
if (this.title == '添加计划') { if (this.title == '添加计划') {
this.create(); this.create();
} }
...@@ -164,7 +182,7 @@ export class PlanModalComponent implements OnInit { ...@@ -164,7 +182,7 @@ export class PlanModalComponent implements OnInit {
userId : res.id userId : res.id
} }
arr.push(data); arr.push(data);
}) });
if (this.modalTitle == '选择参与人') { if (this.modalTitle == '选择参与人') {
this.participantsList = arr; this.participantsList = arr;
} }
......
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