diff --git a/src/app/key-unit/key-unit-management/key-unit-management.component.ts b/src/app/key-unit/key-unit-management/key-unit-management.component.ts index 4075e2b..4d195fc 100644 --- a/src/app/key-unit/key-unit-management/key-unit-management.component.ts +++ b/src/app/key-unit/key-unit-management/key-unit-management.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit, ViewChild, Inject } from '@angular/core'; +import { Component, OnInit, ViewChild, Inject } from '@angular/core'; import { HttpClient } from '@angular/common/http' import { MatTreeFlatDataSource, MatTreeFlattener } from '@angular/material/tree'; import { MatPaginator } from '@angular/material/paginator'; @@ -548,8 +548,18 @@ export class KeyUnitManagementComponent implements OnInit { } //编辑单位名称 editUnitName(element){ - console.log(element) + //console.log(element) + const dialogRef = this.dialog.open(upname, { + width: '340px', + height:'280px', + data: element + }); + dialogRef.afterClosed().subscribe(result => { + //console.log(result); + element.name=result + }); } + //跳转查看基本信息页面 unitdetails(element){ console.log(element) @@ -694,4 +704,52 @@ export class CreateUnit { this.snackBar.open(err,'确定',config); }) } +} + +//修改单位名称 +@Component({ + selector: 'upname', + templateUrl: './upname.html', + styleUrls: ['./upname.scss'] +}) +export class upname{ + constructor(private router:Router,private http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data: any) {} + unitname//修改后的名称 + oldname=this.data.name//原名 + oldid=this.data.id + + //取消 + close(){ + this.dialogRef.close(this.oldname); + } + //确定 + updateName(){ + //console.log(this.unitname) + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + if(this.unitname==''||this.unitname==undefined){ + this.snackBar.open('请填写新单位名称','确定',config); + }else if(this.unitname==this.oldname){ + this.snackBar.open('新单位名称不能和旧单位名称一样','确定',config); + } + else{ + let paramsdata:any = { + id:this.oldid, + name: this.unitname, + buildingTypes:[{ + id:this.data.buildingTypes[0].id, + name:this.data.buildingTypes[0].name + }] + } + + this.http.put(`/api/Companies/${this.oldid}`,paramsdata).subscribe((data:any)=>{ + this.snackBar.open("修改名字成功",'确定',config); + },err => { + this.snackBar.open(err,'确定',config); + }) + this.dialogRef.close(this.unitname); + } + + } } \ No newline at end of file diff --git a/src/app/key-unit/key-unit-management/upname.html b/src/app/key-unit/key-unit-management/upname.html new file mode 100644 index 0000000..3d176b9 --- /dev/null +++ b/src/app/key-unit/key-unit-management/upname.html @@ -0,0 +1,27 @@ + +
+
+ 修改预案名称 +
+
+ + +
+
+ + + + +
+
+ + +
+
diff --git a/src/app/key-unit/key-unit-management/upname.scss b/src/app/key-unit/key-unit-management/upname.scss new file mode 100644 index 0000000..7054136 --- /dev/null +++ b/src/app/key-unit/key-unit-management/upname.scss @@ -0,0 +1,38 @@ +.box{ + height: 100%; + width: 100%; + display: flex; + flex-direction: column; +} +.queryField { + margin: 6px 5px; + input { + //width: 50px; + height: 18px; + line-height: 18px; + border-radius: 3px;} + button{ + width: 140px; + font-size: 16px; + } + label{ + font-size: 16px; + } + } + .top{ + width: 100%; + margin-bottom: 20px; + span{ + color: #2196F3; + margin-left: 10px; + font-size: 18px; + } +} +.bottom{ + margin: 15px 35px; + button{ + width: 80px; + height: 36px; + font-size: 16px; + } +} \ No newline at end of file diff --git a/src/app/key-unit/key-unit.module.ts b/src/app/key-unit/key-unit.module.ts index f84d6ad..2431393 100644 --- a/src/app/key-unit/key-unit.module.ts +++ b/src/app/key-unit/key-unit.module.ts @@ -84,9 +84,10 @@ import { EditText, WaterRoadComponent } from './water-road/water-road.component' import { PhotoofthesceneComponent } from './photoofthescene/photoofthescene.component'; import { KnowRouteComponent } from './know-route/know-route.component'; import { FindProblemComponent } from './find-problem/find-problem.component'; +import { upname } from './key-unit-management/key-unit-management.component' @NgModule({ - declarations: [KeyUnitManagementComponent, EditUnitInfoComponent, ViewUnitDetailsComponent,CreateUnit,BasicinfoComponent,LookMaster,AddHouseInfo, EditPlanInfoComponent,BasicinfoLookComponent, ViewUnitDetailsPlanComponent,FunctionDivisionComponent,addPartition,addPartitionAttribute,AllaroundComponent,ImgDetails,RealisticPictureComponent,previewImg,addRealPicture,editRealPicture,KeySiteComponent,KeyImgDetail,KeySiteImgs,UploadingCADComponent,readFile,editFile,KeySiteLookComponent,KeySiteImgs2,FunctionDivisionLookComponent,RealisticPictureLookComponent,previewImg3,UploadingCADLookComponent,FireFightingDeviceComponent,ImagesData,previewBigImg,ImgsDataDetail,FireFightingDeviceLookComponent,ImagesData2,ImgsDataDetail2,previewBigImg2,LookMaster2,addPartitionAttribute2, SixFamiliarityComponent, ActualCombatDrillComponent,routerMapComponent, SixFamiliarListComponent,TrainingRecordinfoComponent,RouterGISComponent,WaterRoadComponent,EditText,PhotoofthesceneComponent,KnowRouteComponent,FindProblemComponent], + declarations: [KeyUnitManagementComponent, EditUnitInfoComponent, ViewUnitDetailsComponent,CreateUnit,BasicinfoComponent,LookMaster,AddHouseInfo, EditPlanInfoComponent,BasicinfoLookComponent, ViewUnitDetailsPlanComponent,FunctionDivisionComponent,addPartition,addPartitionAttribute,AllaroundComponent,ImgDetails,RealisticPictureComponent,previewImg,addRealPicture,editRealPicture,KeySiteComponent,KeyImgDetail,KeySiteImgs,UploadingCADComponent,readFile,editFile,KeySiteLookComponent,KeySiteImgs2,FunctionDivisionLookComponent,RealisticPictureLookComponent,previewImg3,UploadingCADLookComponent,FireFightingDeviceComponent,ImagesData,previewBigImg,ImgsDataDetail,FireFightingDeviceLookComponent,ImagesData2,ImgsDataDetail2,previewBigImg2,LookMaster2,addPartitionAttribute2, SixFamiliarityComponent, ActualCombatDrillComponent,routerMapComponent, SixFamiliarListComponent,TrainingRecordinfoComponent,RouterGISComponent,WaterRoadComponent,EditText,PhotoofthesceneComponent,KnowRouteComponent,FindProblemComponent,upname], exports:[ViewUnitDetailsPlanComponent], imports: [ CommonModule, diff --git a/src/app/plan-audit/basic-info/basic-info.component.html b/src/app/plan-audit/basic-info/basic-info.component.html index 971eeb4..55932d6 100644 --- a/src/app/plan-audit/basic-info/basic-info.component.html +++ b/src/app/plan-audit/basic-info/basic-info.component.html @@ -4,13 +4,13 @@ * @Author: sueRimn * @Date: 2020-12-25 15:29:42 * @LastEditors: sueRimn - * @LastEditTime: 2020-12-25 15:59:18 + * @LastEditTime: 2020-12-27 14:10:41 -->
- + 单位信息 diff --git a/src/app/plan-audit/plan-audit-routing.module.ts b/src/app/plan-audit/plan-audit-routing.module.ts index 5612898..11d4b12 100644 --- a/src/app/plan-audit/plan-audit-routing.module.ts +++ b/src/app/plan-audit/plan-audit-routing.module.ts @@ -4,7 +4,7 @@ * @Author: sueRimn * @Date: 2020-12-24 10:59:48 * @LastEditors: sueRimn - * @LastEditTime: 2020-12-25 16:27:40 + * @LastEditTime: 2020-12-28 09:11:45 */ import { NgModule } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; @@ -18,8 +18,8 @@ const routes: Routes = [ { path: 'detachmentLevel', component: DetachmentLevelComponent }, { path: 'planaudit', component: PlanAuditComponent }, { path: 'planpass', component: PlanPassComponent }, - { path: 'planrecord', component: PlanRecordComponent }, - { path: 'waitexamineer', component: WaitExamineerComponent }, + { path: 'planrecord', component: PlanRecordComponent },//预案审核记录 + { path: 'waitexamineer', component: WaitExamineerComponent },//预案待审核 ]; @NgModule({ diff --git a/src/app/plan-audit/wait-examineer/wait-examineer.component.html b/src/app/plan-audit/wait-examineer/wait-examineer.component.html index 0b474e6..487e759 100644 --- a/src/app/plan-audit/wait-examineer/wait-examineer.component.html +++ b/src/app/plan-audit/wait-examineer/wait-examineer.component.html @@ -55,7 +55,7 @@
- +
@@ -119,15 +119,15 @@
- - + + 基本信息
- + 修改-沃尔玛(上海)职业发展有限公司 @@ -219,7 +219,7 @@
-