Commit ff17daaf authored by wangqinghua's avatar wangqinghua

update

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