Browse Source

[修改]基本信息可扩展面板加入

develop
邵佳豪 5 years ago
parent
commit
a15f77cfbb
  1. 2
      proxy.config.json
  2. 267
      src/app/ui/basicinfo/basicinfo.component.html
  3. 11
      src/app/ui/basicinfo/basicinfo.component.scss
  4. 6
      src/app/ui/basicinfo/basicinfo.component.ts

2
proxy.config.json

@ -1,6 +1,6 @@
{
"/api": {
"target": "http://39.106.78.171:8008",
"target": "http://39.106.78.171:8088",
"secure": false,
"changeOrigin": true
}

267
src/app/ui/basicinfo/basicinfo.component.html

@ -1,138 +1,133 @@
<!-- <mat-accordion>
<mat-expansion-panel>
<mat-accordion>
<mat-expansion-panel (opened)="panelOpenState = true"
(closed)="panelOpenState = false">
<mat-expansion-panel-header>
<mat-panel-title>
Personal data
企业信息
</mat-panel-title>
<mat-panel-description>
Type your name and age
<mat-icon>
{{panelOpenState ?'expand_more' : 'chevron_right'}}
</mat-icon>
</mat-panel-description>
</mat-expansion-panel-header>
<mat-form-field>
<input matInput placeholder="First name">
</mat-form-field>
<mat-form-field>
<input matInput placeholder="Age">
</mat-form-field>
</mat-expansion-panel>
</mat-accordion> -->
<div class="topbox">
<form (ngSubmit)="onSubmit(form.value)" #form="ngForm" class="example-container" >
<div class="mainbox" >
<div class="mainleft">
<div class="inputbox" >
<span>统一社会信用代码:</span>
<mat-form-field>
<input matInput id="creditcode" name="creditcode" type='text'
required minlength="1" maxlength="18"
[(ngModel)]="unitinfo.usci"
(focus)="closeorganizationbox()">
</mat-form-field>
</div>
<div class="inputbox">
<span>单位类型:</span>
<mat-form-field (click)="closeorganizationbox()">
<mat-select required name="unittype" [(ngModel)]="defaultbuildingTypes">
<mat-option [value]="item.id" *ngFor="let item of allunittype">{{item.name}}</mat-option>
</mat-select>
</mat-form-field>
</div>
<div class="inputbox">
<span>联系人:</span>
<mat-form-field>
<input matInput id="linkman" name="linkman" type='text'
required minlength="1"
[(ngModel)]="unitinfo.contacts"
(focus)="closeorganizationbox()">
</mat-form-field>
</div>
<div class="inputbox">
<span>联系电话:</span>
<mat-form-field>
<input matInput id="linkphone" name="linkphone" type='text'
required minlength="1"
[(ngModel)]="unitinfo.phone"
(focus)="closeorganizationbox()">
</mat-form-field>
</div>
<div class="inputbox">
<span>辖区中队:</span>
<mat-form-field>
<input matInput id="organization" name="organization" type='text'
required minlength="1"
[(ngModel)]="selectedorganization"
(focus)="openorganizationbox()" >
</mat-form-field>
</div>
<div id="organizationbox" class="organizationbox" *ngIf="isorganizationbox">
<mat-tree [dataSource]="dataSource" [treeControl]="treeControl">
<mat-tree-node *matTreeNodeDef="let node" matTreeNodePadding (click)='add(node)' class="organizationlist">
<button type="button" mat-icon-button disabled ></button>
<li>{{node.name}}</li>
</mat-tree-node>
<mat-tree-node *matTreeNodeDef="let node;when: hasChild" matTreeNodePadding (click)='add(node)' class="organizationlist">
<button
type="button"
mat-icon-button
matTreeNodeToggle
[attr.aria-label]="'toggle ' + node.name">
<mat-icon class="mat-icon-rtl-mirror">
{{treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right'}}
</mat-icon>
</button>
<li>{{node.name}}</li>
</mat-tree-node>
</mat-tree>
</div>
<div class="inputbox">
<span>单位地址:</span>
<mat-form-field>
<input matInput id="unitaddress" name="unitaddress" type='text'
required minlength="1"
[(ngModel)]="unitinfo.address"
(focus)="closeorganizationbox()">
</mat-form-field>
</div>
<div class="uploadimg" >
<span>单位照片:</span>
<div class="uploadingimg">
<img [src]="imgsrc" alt="" style="width: 299px; height: 170px;" >
<div class="topbox">
<form (ngSubmit)="onSubmit(form.value)" #form="ngForm" class="example-container" >
<div class="mainbox" >
<div class="mainleft">
<div class="inputbox" >
<span>统一社会信用代码:</span>
<mat-form-field>
<input matInput id="creditcode" name="creditcode" type='text'
required minlength="1" maxlength="18"
[(ngModel)]="unitinfo.usci"
(focus)="closeorganizationbox()">
</mat-form-field>
</div>
<div class="inputbox">
<span>单位类型:</span>
<mat-form-field (click)="closeorganizationbox()">
<mat-select required name="unittype" [(ngModel)]="defaultbuildingTypes">
<mat-option [value]="item.id" *ngFor="let item of allunittype">{{item.name}}</mat-option>
</mat-select>
</mat-form-field>
</div>
<div class="inputbox">
<span>联系人:</span>
<mat-form-field>
<input matInput id="linkman" name="linkman" type='text'
required minlength="1"
[(ngModel)]="unitinfo.contacts"
(focus)="closeorganizationbox()">
</mat-form-field>
</div>
<div class="inputbox">
<span>联系电话:</span>
<mat-form-field>
<input matInput id="linkphone" name="linkphone" type='text'
required minlength="1"
[(ngModel)]="unitinfo.phone"
(focus)="closeorganizationbox()">
</mat-form-field>
</div>
<div class="inputbox">
<span>辖区中队:</span>
<mat-form-field>
<input matInput id="organization" name="organization" type='text'
required minlength="1"
[(ngModel)]="selectedorganization"
(focus)="openorganizationbox()" >
</mat-form-field>
</div>
<div id="organizationbox" class="organizationbox" *ngIf="isorganizationbox">
<mat-tree [dataSource]="dataSource" [treeControl]="treeControl">
<mat-tree-node *matTreeNodeDef="let node" matTreeNodePadding (click)='add(node)' class="organizationlist">
<button type="button" mat-icon-button disabled ></button>
<li>{{node.name}}</li>
</mat-tree-node>
<mat-tree-node *matTreeNodeDef="let node;when: hasChild" matTreeNodePadding (click)='add(node)' class="organizationlist">
<button
type="button"
mat-icon-button
matTreeNodeToggle
[attr.aria-label]="'toggle ' + node.name">
<mat-icon class="mat-icon-rtl-mirror">
{{treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right'}}
</mat-icon>
</button>
<li>{{node.name}}</li>
</mat-tree-node>
</mat-tree>
</div>
<div class="inputbox">
<span>单位地址:</span>
<mat-form-field>
<input matInput id="unitaddress" name="unitaddress" type='text'
required minlength="1"
[(ngModel)]="unitinfo.address"
(focus)="closeorganizationbox()">
</mat-form-field>
</div>
<div class="uploadimg" >
<span>单位照片:</span>
<div class="uploadingimg">
<img [src]="imgsrc" alt="" style="width: 299px; height: 170px;" >
</div>
<mat-spinner *ngIf="isspinner" diameter= 50></mat-spinner>
</div>
<div class="image" (click)="closeorganizationbox()">
<input required id="selectedfile" type="file" ng2FileSelect [uploader]="uploader" (change)="filechange($event)" name="imgFile" accept=".jpg,.png,.jpeg">
</div>
<div class="addbtn">
<!-- <button type="button" mat-raised-button>编辑</button> -->
<button type="submit" class="submit1" mat-button mat-raised-button>保存</button>
</div>
<mat-spinner *ngIf="isspinner" diameter= 50></mat-spinner>
</div>
<div class="image" (click)="closeorganizationbox()">
<input required id="selectedfile" type="file" ng2FileSelect [uploader]="uploader" (change)="filechange($event)" name="imgFile" accept=".jpg,.png,.jpeg">
</div>
<div class="addbtn">
<!-- <button type="button" mat-raised-button>编辑</button> -->
<button type="submit" class="submit1" mat-button mat-raised-button>保存</button>
<div class="mainright" (click)="closeorganizationbox()">
<!-- 地图预留位置 -->
</div>
</div>
<div class="mainright" (click)="closeorganizationbox()">
<!-- 地图预留位置 -->
</div>
</div>
</form>
</div>
</form>
</div>
</mat-expansion-panel>
</mat-accordion>
<div class="bottombox">
<div class="houseinfobox">
<button type="button" mat-icon-button (click)="addhouseinfo()" class="addhouseinfo"><mat-icon style="font-size: 38px;">add_circle_outline</mat-icon></button>
<mat-tab-group (focusChange)="selecttab($event)">
<mat-tab [label]="item.username" *ngFor="let item of houses;let key = index">
<mat-tab-group style="height: 100%;" (focusChange)="selecttab($event)">
<mat-tab style="height: 100%; overflow-y:auto;" [label]="item.username" *ngFor="let item of houses;let key = index">
<form (ngSubmit)="onSubmit2(form.value,item,key,form.invalid)" #form="ngForm" class="example-container">
<div class="highinfo" *ngIf="item.tongyong">
<div class="houseinfoinput" >
@ -278,7 +273,7 @@
罐区 <span style="color: red;">*</span></th>
<td mat-cell *matCellDef="let element;let key = index">
<mat-form-field class="tankinfo">
<input matInput id="floorspace" name="{{www}}tank{{key}}" type='text'
<input matInput id="floorspace" name="{{www}}{{element.tank}}tank{{key}}" type='text'
required
[(ngModel)]="element.tank">
</mat-form-field>
@ -288,7 +283,7 @@
<th mat-header-cell *matHeaderCellDef>罐区编号<span style="color: red;">*</span></th>
<td mat-cell *matCellDef="let element;let key = index">
<mat-form-field class="tankinfo">
<input matInput id="floorspace" name="{{www}}tank{{key}}" type='text'
<input matInput id="floorspace" name="{{www}}{{element.tankid}}tank{{key}}" type='text'
required
[(ngModel)]="element.tankid">
</mat-form-field>
@ -298,7 +293,7 @@
<th mat-header-cell *matHeaderCellDef>储存介质<span style="color: red;">*</span></th>
<td mat-cell *matCellDef="let element;let key = index">
<mat-form-field class="tankinfo">
<input matInput id="floorspace" name="{{www}}tank{{key}}" type='text'
<input matInput id="floorspace" name="{{www}}{{element.tankmedium}}tank{{key}}" type='text'
required
[(ngModel)]="element.tankmedium">
</mat-form-field>
@ -309,7 +304,7 @@
<th mat-header-cell *matHeaderCellDef>储罐类型<span style="color: red;">*</span></th>
<td mat-cell *matCellDef="let element;let key = index">
<mat-form-field class="tankinfo">
<input matInput id="floorspace" name="{{www}}tank{{key}}" type='text'
<input matInput id="floorspace" name="{{www}}{{element.tanktype}}tank{{key}}" type='text'
required
[(ngModel)]="element.tanktype">
</mat-form-field>
@ -319,7 +314,7 @@
<th mat-header-cell *matHeaderCellDef>容量<span style="color: red;">*</span></th>
<td mat-cell *matCellDef="let element;let key = index">
<mat-form-field class="tankinfo">
<input matInput id="floorspace" name="{{www}}tank{{key}}" type='text'
<input matInput id="floorspace" name="{{www}}{{element.tankcapacity}}tank{{key}}" type='text'
required
[(ngModel)]="element.tankcapacity">
</mat-form-field>
@ -329,7 +324,7 @@
<th mat-header-cell *matHeaderCellDef>直径<span style="color: red;">*</span></th>
<td mat-cell *matCellDef="let element;let key = index">
<mat-form-field class="tankinfo">
<input matInput id="floorspace" name="{{www}}tank{{key}}" type='text'
<input matInput id="floorspace" name="{{www}}{{element.tankdiameter}}tank{{key}}" type='text'
required
[(ngModel)]="element.tankdiameter">
</mat-form-field>
@ -339,7 +334,7 @@
<th mat-header-cell *matHeaderCellDef>高度<span style="color: red;">*</span></th>
<td mat-cell *matCellDef="let element;let key = index">
<mat-form-field class="tankinfo">
<input matInput id="floorspace" name="{{www}}tank{{key}}" type='text'
<input matInput id="floorspace" name="{{www}}{{element.tankheight}}tank{{key}}" type='text'
required
[(ngModel)]="element.tankheight">
</mat-form-field>
@ -349,7 +344,7 @@
<th mat-header-cell *matHeaderCellDef>顶盖形式</th>
<td mat-cell *matCellDef="let element;let key = index">
<mat-form-field class="tankinfo">
<input matInput id="floorspace" name="{{www}}tank{{key}}" type='text'
<input matInput id="floorspace" name="{{www}}{{element.tanktectum}}tank{{key}}" type='text'
[(ngModel)]="element.tanktectum">
</mat-form-field>
</td>
@ -358,7 +353,7 @@
<th mat-header-cell *matHeaderCellDef>浮盘材质</th>
<td mat-cell *matCellDef="let element;let key = index">
<mat-form-field class="tankinfo">
<input matInput id="floorspace" name="{{www}}tank{{key}}" type='text'
<input matInput id="floorspace" name="{{www}}{{element.tanktexture}}tank{{key}}" type='text'
[(ngModel)]="element.tanktexture">
</mat-form-field>
@ -368,7 +363,7 @@
<th mat-header-cell *matHeaderCellDef>浮盘类型</th>
<td mat-cell *matCellDef="let element;let key = index">
<mat-form-field class="tankinfo">
<input matInput id="floorspace" name="{{www}}tank{{key}}" type='text'
<input matInput id="floorspace" name="{{www}}{{element.platetype}}tank{{key}}" type='text'
[(ngModel)]="element.platetype">
</mat-form-field>
@ -378,7 +373,7 @@
<th mat-header-cell *matHeaderCellDef>泡沫产生器型号</th>
<td mat-cell *matCellDef="let element;let key = index">
<mat-form-field class="tankinfo">
<input matInput id="floorspace" name="{{www}}tank{{key}}" type='text'
<input matInput id="floorspace" name="{{www}}{{element.foamgeneratorid}}tank{{key}}" type='text'
[(ngModel)]="element.foamgeneratorid">
</mat-form-field>
@ -388,7 +383,7 @@
<th mat-header-cell *matHeaderCellDef>泡沫产生器形式</th>
<td mat-cell *matCellDef="let element;let key = index">
<mat-form-field class="tankinfo">
<input matInput id="floorspace" name="{{www}}tank{{key}}" type='text'
<input matInput id="floorspace" name="{{www}}{{element.foamgeneratortype}}tank{{key}}" type='text'
[(ngModel)]="element.foamgeneratortype">
</mat-form-field>
@ -398,7 +393,7 @@
<th mat-header-cell *matHeaderCellDef>是否设置氮封惰化保护装置</th>
<td mat-cell *matCellDef="let element;let key = index">
<mat-form-field class="tankinfo">
<input matInput id="floorspace" name="{{www}}tank{{key}}" type='text'
<input matInput id="floorspace" name="{{www}}{{element.isprotect}}tank{{key}}" type='text'
[(ngModel)]="element.isprotect">
</mat-form-field>
@ -408,7 +403,7 @@
<th mat-header-cell *matHeaderCellDef>防护堤高度<span style="color: red;">*</span></th>
<td mat-cell *matCellDef="let element;let key = index">
<mat-form-field class="tankinfo">
<input matInput id="floorspace" name="{{www}}tank{{key}}" type='text'
<input matInput id="floorspace" name="{{www}}{{element.fendinggroyneheight}}tank{{key}}" type='text'
required
[(ngModel)]="element.fendinggroyneheight">
</mat-form-field>
@ -418,7 +413,7 @@
<th mat-header-cell *matHeaderCellDef>半固定泡沫灭火接口数量<span style="color: red;">*</span></th>
<td mat-cell *matCellDef="let element;let key = index">
<mat-form-field class="tankinfo">
<input matInput id="floorspace" name="{{www}}tank{{key}}" type='text'
<input matInput id="floorspace" name="{{www}}{{element.portnum}}tank{{key}}" type='text'
required
[(ngModel)]="element.portnum">
</mat-form-field>
@ -428,7 +423,7 @@
<th mat-header-cell *matHeaderCellDef>其他设施<span style="color: red;">*</span></th>
<td mat-cell *matCellDef="let element;let key = index">
<mat-form-field class="tankinfo">
<input matInput id="floorspace" name="{{www}}tank{{key}}" type='text'
<input matInput id="floorspace" name="{{www}}{{element.else}}tank{{key}}" type='text'
required
[(ngModel)]="element.else">
</mat-form-field>

11
src/app/ui/basicinfo/basicinfo.component.scss

@ -41,7 +41,7 @@
.addbtn{
width: 695px;
position: absolute;
bottom: 0px;
bottom: -442px;
text-align: center;
margin-bottom:20px;
button{
@ -91,8 +91,11 @@
}
.mainright{
float: left;
width: 500px;
height: 100%;
width: 800px;
height: 400px;
position: absolute;
right: 170px;
}
}
}
@ -109,7 +112,7 @@
border-bottom: 1px solid black;
}
.houseinfobox{
height:340px;
// height:340px;
overflow: auto;
.addhouseinfo{
float: left;

6
src/app/ui/basicinfo/basicinfo.component.ts

@ -90,7 +90,7 @@ export class BasicinfoComponent implements OnInit {
highhouse = false//控制高层表单的显示
houses: any[] = [//存储当前单位的建筑信息
]
panelOpenState = false;//控制企业信息面板的展开和收起
constructor(private http: HttpClient, private tree: TreeService, private sanitizer: DomSanitizer, public dialog: MatDialog,public snackBar: MatSnackBar) { }
//选择单位类型,使底下表单跟着变化
@ -794,8 +794,8 @@ export class BasicinfoComponent implements OnInit {
name: item.buildtype
}
]
}).subscribe(data=>{
this.getunitallbuilding()
}).subscribe((data:any)=>{
this.houses[item.index].username = item.name
})
if(item.buildtype == "高层建筑类" || item.buildtype == "地下建筑类" || item.buildtype == "大型城市综合体建筑类" || item.buildtype == "人员密集场所建筑类" || item.buildtype == "古建筑类" || item.buildtype == "仓库堆垛类" || item.buildtype == "隧道类" || item.buildtype == "其他类"){
this.houses[key].buildingBasicGroups[0].propertyInfos.forEach(item => {

Loading…
Cancel
Save