Commit ff17daaf authored by wangqinghua's avatar wangqinghua

update

parent b4d98539
...@@ -70,6 +70,9 @@ import {DeviceComponent} from './netTopology/model/device/device.component'; ...@@ -70,6 +70,9 @@ import {DeviceComponent} from './netTopology/model/device/device.component';
import {IconComponent} from './netTopology/model/icon/icon.component'; import {IconComponent} from './netTopology/model/icon/icon.component';
import {ToUtilPipe} from './shared/common/toUtil.pipe'; import {ToUtilPipe} from './shared/common/toUtil.pipe';
import {JhiTranslateComponent} from 'ng-jhipster'; import {JhiTranslateComponent} from 'ng-jhipster';
import {LookPlanComponent} from './work/modal/look-plan/look-plan.component';
import {PlanModalComponent} from './work/modal/plan-modal/plan-modal.component';
import {SelectPersonComponent} from './modal/select-person/select-person.component';
@NgModule({ @NgModule({
imports: [ imports: [
...@@ -140,6 +143,9 @@ import {JhiTranslateComponent} from 'ng-jhipster'; ...@@ -140,6 +143,9 @@ import {JhiTranslateComponent} from 'ng-jhipster';
DeviceComponent, DeviceComponent,
IconComponent, IconComponent,
ToUtilPipe, ToUtilPipe,
LookPlanComponent,
PlanModalComponent,
SelectPersonComponent
], ],
providers:[ providers:[
OverAllService, OverAllService,
......
<!--添加资源--> <!--添加资源-->
<nz-modal [nzWidth]="1080" [(nzVisible)]="isVisiable" [nzTitle]="title" (nzOnCancel)="handleEditCancel()" (nzOnOk)="handEditleOk()"> <nz-modal [nzWidth]="1080" [(nzVisible)]="isVisible" [nzTitle]="title" (nzOnCancel)="handleEditCancel()" (nzOnOk)="handleEditCancel()">
<form nz-form [formGroup]="validateForm"> <form nz-form>
<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]="12"> <div nz-col [nzSpan]="12">
<nz-form-item nzFlex> <nz-form-item nzFlex>
<nz-form-label [nzOffset]="4" [nzSpan]="6" nzRequired nzFor="title">计划类型</nz-form-label> <nz-form-label [nzOffset]="4" [nzSpan]="6" nzRequired nzFor="title">计划类型</nz-form-label>
<nz-form-control [nzSpan]="14"> <nz-form-control [nzSpan]="14">
{{plan.title}} {{plan?.title}}
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
</div> </div>
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
开始日期 开始日期
</nz-form-label> </nz-form-label>
<nz-form-control [nzSpan]="14"> <nz-form-control [nzSpan]="14">
{{plan.startTime}} {{plan?.startTime}}
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
</div> </div>
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
<nz-form-item nzFlex> <nz-form-item nzFlex>
<nz-form-label [nzSpan]="6" nzFor="serialnoA">终止日期</nz-form-label> <nz-form-label [nzSpan]="6" nzFor="serialnoA">终止日期</nz-form-label>
<nz-form-control [nzSpan]="14"> <nz-form-control [nzSpan]="14">
{{plan.endTime}} {{plan?.endTime}}
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
</div> </div>
...@@ -51,10 +51,10 @@ ...@@ -51,10 +51,10 @@
循环周期 循环周期
</nz-form-label> </nz-form-label>
<nz-form-control [nzSpan]="7"> <nz-form-control [nzSpan]="7">
{{plan.cycleType}} {{plan?.cycleType}}
</nz-form-control> </nz-form-control>
<nz-form-control [nzSpan]="6"> <nz-form-control [nzSpan]="6">
{{plan.cycleNum}} {{plan?.cycleNum}}
</nz-form-control> </nz-form-control>
<nz-form-control [nzSpan]="6"> <nz-form-control [nzSpan]="6">
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
<nz-form-item nzFlex> <nz-form-item nzFlex>
<nz-form-label [nzSpan]="6" nzFor="serialnoA">巡检人数</nz-form-label> <nz-form-label [nzSpan]="6" nzFor="serialnoA">巡检人数</nz-form-label>
<nz-form-control [nzSpan]="14"> <nz-form-control [nzSpan]="14">
{{plan.number}} {{plan?.number}}
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
</div> </div>
...@@ -75,21 +75,21 @@ ...@@ -75,21 +75,21 @@
<nz-form-item> <nz-form-item>
<nz-form-label [nzSpan]="4" nzRequired nzFor="serviceid">参与人</nz-form-label> <nz-form-label [nzSpan]="4" nzRequired nzFor="serviceid">参与人</nz-form-label>
<nz-form-control [nzSpan]="14"> <nz-form-control [nzSpan]="14">
<span *ngFor="let item of plan.participants">{{item.username}}</span> <span *ngFor="let item of plan?.participants">{{item.username}}</span>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
<nz-form-item> <nz-form-item>
<nz-form-label [nzSpan]="4" nzRequired nzFor="serviceid">负责人</nz-form-label> <nz-form-label [nzSpan]="4" nzRequired nzFor="serviceid">负责人</nz-form-label>
<nz-form-control [nzSpan]="14"> <nz-form-control [nzSpan]="14">
<span *ngFor="let item of plan.principals">{{item.username}}</span> <span *ngFor="let item of plan?.principals">{{item.username}}</span>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
<nz-form-item> <nz-form-item>
<nz-form-label [nzSpan]="4" nzRequired nzFor="description">计划描述</nz-form-label> <nz-form-label [nzSpan]="4" nzRequired nzFor="description">计划描述</nz-form-label>
<nz-form-control [nzSpan]="14"> <nz-form-control [nzSpan]="14">
{{plan.description}} {{plan?.description}}
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
......
...@@ -18,6 +18,7 @@ export class LookPlanComponent implements OnInit { ...@@ -18,6 +18,7 @@ export class LookPlanComponent implements OnInit {
} }
showModal(id){ showModal(id){
this.isVisible = true;
this.workSer.findPlan(id).subscribe( this.workSer.findPlan(id).subscribe(
(res)=>{ (res)=>{
if(res.errCode == 10000){ if(res.errCode == 10000){
...@@ -27,4 +28,8 @@ export class LookPlanComponent implements OnInit { ...@@ -27,4 +28,8 @@ export class LookPlanComponent implements OnInit {
) )
} }
handleEditCancel(){
this.isVisible = false;
}
} }
...@@ -108,7 +108,7 @@ ...@@ -108,7 +108,7 @@
<nz-form-item> <nz-form-item>
<nz-form-label [nzSpan]="4" nzRequired nzFor="serviceid">计划工作量</nz-form-label> <nz-form-label [nzSpan]="4" nzRequired nzFor="serviceid">计划工作量</nz-form-label>
<nz-form-control [nzSpan]="14"> <nz-form-control [nzSpan]="14">
<input id="host4" type="text" nz-input name="host1" [(ngModel)]="validateForm.r_longdata" >
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
......
...@@ -40,17 +40,17 @@ export class PlanModalComponent implements OnInit { ...@@ -40,17 +40,17 @@ export class PlanModalComponent implements OnInit {
}); });
} }
getPlanType(){ getPlanType() {
const data = { const data = {
type:1 type: 1
}; };
this.workSer.findByType(data).subscribe( this.workSer.findByType(data).subscribe(
(res)=>{ (res) => {
if(res.errCode == 10000){ if (res.errCode == 10000) {
this.planList = res.data; this.planList = res.data;
} }
} }
) );
} }
beforeUpload = (file: UploadFile): boolean => { beforeUpload = (file: UploadFile): boolean => {
...@@ -65,11 +65,13 @@ export class PlanModalComponent implements OnInit { ...@@ -65,11 +65,13 @@ export class PlanModalComponent implements OnInit {
showAddModal() { showAddModal() {
this.title = '添加计划'; this.title = '添加计划';
this.isVisiable = true;
} }
showEditModal(id) { showEditModal(id) {
this.title = '编辑计划'; this.title = '编辑计划';
this.planId = id; this.planId = id;
this.isVisiable = true;
} }
handEditleOk() { handEditleOk() {
...@@ -80,10 +82,10 @@ export class PlanModalComponent implements OnInit { ...@@ -80,10 +82,10 @@ export class PlanModalComponent implements OnInit {
if (this.validateForm.invalid) { if (this.validateForm.invalid) {
return false; return false;
} }
if(this.title == '添加计划') { if (this.title == '添加计划') {
this.create(); this.create();
} }
if(this.title = '编辑计划') { if (this.title = '编辑计划') {
this.update(); this.update();
} }
} }
...@@ -95,19 +97,19 @@ export class PlanModalComponent implements OnInit { ...@@ -95,19 +97,19 @@ export class PlanModalComponent implements OnInit {
}); });
formData.append('json', JSON.stringify(this.validateForm.value)); formData.append('json', JSON.stringify(this.validateForm.value));
this.workSer.createPlan(formData).subscribe( this.workSer.createPlan(formData).subscribe(
(res)=>{ (res) => {
if(res.errCode == 10000){ if (res.errCode == 10000) {
this.initForm(); this.initForm();
this.isVisiable = false; this.isVisiable = false;
this.message.success("新增计划成功"); this.message.success('新增计划成功');
}else{ } else {
this.message.error(res.errMsg); this.message.error(res.errMsg);
} }
} }
) );
} }
update(){ update() {
let formData = new FormData(); let formData = new FormData();
this.fileList.forEach((file: any) => { this.fileList.forEach((file: any) => {
formData.append('file', file); formData.append('file', file);
...@@ -115,16 +117,16 @@ export class PlanModalComponent implements OnInit { ...@@ -115,16 +117,16 @@ export class PlanModalComponent implements OnInit {
formData.append('json', JSON.stringify(this.validateForm.value)); formData.append('json', JSON.stringify(this.validateForm.value));
formData.append('id', this.planId); formData.append('id', this.planId);
this.workSer.createPlan(formData).subscribe( this.workSer.createPlan(formData).subscribe(
(res)=>{ (res) => {
if(res.errCode == 10000){ if (res.errCode == 10000) {
this.message.success("修改计划成功"); this.message.success('修改计划成功');
this.initForm(); this.initForm();
this.isVisiable = false; this.isVisiable = false;
}else{ } else {
this.message.error(res.errMsg); this.message.error(res.errMsg);
} }
} }
) );
} }
handleEditCancel() { handleEditCancel() {
......
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