diff --git a/src/app/plan-management/create-plan-online-five/create-plan-online-five.component.html b/src/app/plan-management/create-plan-online-five/create-plan-online-five.component.html index 80afea4..3eacb0d 100644 --- a/src/app/plan-management/create-plan-online-five/create-plan-online-five.component.html +++ b/src/app/plan-management/create-plan-online-five/create-plan-online-five.component.html @@ -188,7 +188,7 @@
-
- +
+
+
+
+
+ +
+
+ {{item.organizationName}} +
+
+ 录入员:{{item.creatorName}} +
+
+ +
+
+ + + +
@@ -415,7 +437,7 @@ flex-direction: column;">
{ this.organizationName = data.organizationName if (this.organizationName) { @@ -125,7 +125,8 @@ export class CreatePlanOnlineFiveComponent implements OnInit { this.dataSource.data = this.tree.toTree(this.treedata); } } - ) + ) */ + this.dataSource.data = this.tree.toTree(this.treedata); } //获得所有组织机构 @@ -138,7 +139,11 @@ export class CreatePlanOnlineFiveComponent implements OnInit { } ) } - + //清空查询条件数据 + clearSearch(){ + this.zdysearch='' + this.js='' + } //获得单位信息 @@ -151,7 +156,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit { data.items.forEach(element => { if (element.id == this.route.snapshot.queryParams.companyId) { this.unitData = element - console.log('单位列表信息', this.unitData) + //console.log('单位列表信息', this.unitData) this.getTemplateData() } }); @@ -161,6 +166,87 @@ export class CreatePlanOnlineFiveComponent implements OnInit { selectedItem: string = '封面' async clickTitleItem(item) { this.addNumber = -1 + this.yinruData={ + items:[] + } + this.yinJson={ + //组织指挥 + organizationCommands:{ + tableCount: { + totalCount: 0, + tables: [ + ] + }, + inputCount: { + totalCount: 0, + inputs: [ + ] + }, + textAreaCount: { + totalCount: 0 + }, + treeCount: { + totalCount: 0 + } + }, + //社会联动 + socialLinkages:{ + tableCount: { + totalCount: 0, + tables: [ + ] + }, + inputCount: { + totalCount: 0, + inputs: [ + ] + }, + textAreaCount: { + totalCount: 0 + }, + treeCount: { + totalCount: 0 + } + }, + //勤务保障 + serviceSupports:{ + tableCount: { + totalCount: 0, + tables: [ + ] + }, + inputCount: { + totalCount: 0, + inputs: [ + ] + }, + textAreaCount: { + totalCount: 0 + }, + treeCount: { + totalCount: 0 + } + }, + //辅助决策 + decisionSupports:{ + tableCount: { + totalCount: 0, + tables: [ + ] + }, + inputCount: { + totalCount: 0, + inputs: [ + ] + }, + textAreaCount: { + totalCount: 0 + }, + treeCount: { + totalCount: 0 + } + }, + } this.selectedItem = item.groupName if (this.selectedItem == '重点图示') { this.getAllBuildings() @@ -320,7 +406,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit { //获得模板信息 getTemplateData() { this.http.get(`/api/PlanComponents/${this.route.snapshot.queryParams.planId}/WebText`).subscribe((data: any) => { - console.log('预案内容', data) + //console.log('预案内容', data) this.planTemplateData = JSON.parse(data.webTextData).filter(item => item.completed == true ) @@ -385,7 +471,402 @@ export class CreatePlanOnlineFiveComponent implements OnInit { }) } - + //引入数据json + yinJson={ + //组织指挥 + organizationCommands:{ + tableCount: { + totalCount: 0, + tables: [ + ] + }, + inputCount: { + totalCount: 0, + inputs: [ + ] + }, + textAreaCount: { + totalCount: 0 + }, + treeCount: { + totalCount: 0 + } + }, + //社会联动 + socialLinkages:{ + tableCount: { + totalCount: 0, + tables: [ + ] + }, + inputCount: { + totalCount: 0, + inputs: [ + ] + }, + textAreaCount: { + totalCount: 0 + }, + treeCount: { + totalCount: 0 + } + }, + //勤务保障 + serviceSupports:{ + tableCount: { + totalCount: 0, + tables: [ + ] + }, + inputCount: { + totalCount: 0, + inputs: [ + ] + }, + textAreaCount: { + totalCount: 0 + }, + treeCount: { + totalCount: 0 + } + }, + //辅助决策 + decisionSupports:{ + tableCount: { + totalCount: 0, + tables: [ + ] + }, + inputCount: { + totalCount: 0, + inputs: [ + ] + }, + textAreaCount: { + totalCount: 0 + }, + treeCount: { + totalCount: 0 + } + }, + } + async yinRu(type){ + if(type==0){ + this.yinJson={ + //组织指挥 + organizationCommands:{ + tableCount: { + totalCount: 0, + tables: [ + ] + }, + inputCount: { + totalCount: 0, + inputs: [ + ] + }, + textAreaCount: { + totalCount: 0 + }, + treeCount: { + totalCount: 0 + } + }, + //社会联动 + socialLinkages:{ + tableCount: { + totalCount: 0, + tables: [ + ] + }, + inputCount: { + totalCount: 0, + inputs: [ + ] + }, + textAreaCount: { + totalCount: 0 + }, + treeCount: { + totalCount: 0 + } + }, + //勤务保障 + serviceSupports:{ + tableCount: { + totalCount: 0, + tables: [ + ] + }, + inputCount: { + totalCount: 0, + inputs: [ + ] + }, + textAreaCount: { + totalCount: 0 + }, + treeCount: { + totalCount: 0 + } + }, + //辅助决策 + decisionSupports:{ + tableCount: { + totalCount: 0, + tables: [ + ] + }, + inputCount: { + totalCount: 0, + inputs: [ + ] + }, + textAreaCount: { + totalCount: 0 + }, + treeCount: { + totalCount: 0 + } + }, + } + var orgtableCount=0 + var orginputCount=0 + var orgtextAreaCount=0 + var orgtreeCount=0 + this.planTemplateData[4].attribute.forEach((orgvalue,orgi,orgArr) => { + if(orgArr[orgi].level=='1'){ + orgtableCount++ + this.yinJson.organizationCommands.tableCount.tables.push({itemCount:orgArr[orgi].tableth.length}) + }else if(orgArr[orgi].level=='2'){ + orginputCount++ + this.yinJson.organizationCommands.inputCount.inputs.push({colCount:orgArr[orgi].lieNumber,rowCount:orgArr[orgi].hNumber}) + }else if(orgArr[orgi].level=='3'){ + orgtextAreaCount++ + }else if(orgArr[orgi].level=='4'){ + orgtreeCount++ + } + }); + this.yinJson.organizationCommands.tableCount.totalCount=orgtableCount + this.yinJson.organizationCommands.inputCount.totalCount=orginputCount + this.yinJson.organizationCommands.textAreaCount.totalCount=orgtextAreaCount + this.yinJson.organizationCommands.treeCount.totalCount=orgtreeCount + var shetableCount=0 + var sheinputCount=0 + var shetextAreaCount=0 + var shetreeCount=0 + this.planTemplateData[6].attribute.forEach((orgvalue,orgi,orgArr) => { + if(orgArr[orgi].level=='1'){ + shetableCount++ + //this.yinJson.organizationCommands.tableCount.tables.push({itemCount:orgtableCount}) + }else if(orgArr[orgi].level=='2'){ + sheinputCount++ + this.yinJson.socialLinkages.inputCount.inputs.push({colCount:orgArr[orgi].lieNumber,rowCount:orgArr[orgi].hNumber}) + }else if(orgArr[orgi].level=='3'){ + shetextAreaCount++ + }else if(orgArr[orgi].level=='4'){ + shetreeCount++ + } + }); + this.yinJson.socialLinkages.tableCount.totalCount=shetableCount + this.yinJson.socialLinkages.inputCount.totalCount=sheinputCount + this.yinJson.socialLinkages.textAreaCount.totalCount=shetextAreaCount + this.yinJson.socialLinkages.treeCount.totalCount=shetreeCount + var qintableCount=0 + var qininputCount=0 + var qintextAreaCount=0 + var qintreeCount=0 + this.planTemplateData[7].attribute.forEach((orgvalue,orgi,orgArr) => { + if(orgArr[orgi].level=='1'){ + qintableCount++ + //this.yinJson.organizationCommands.tableCount.tables.push({itemCount:orgtableCount}) + }else if(orgArr[orgi].level=='2'){ + qininputCount++ + this.yinJson.serviceSupports.inputCount.inputs.push({colCount:orgArr[orgi].lieNumber,rowCount:orgArr[orgi].hNumber}) + }else if(orgArr[orgi].level=='3'){ + qintextAreaCount++ + }else if(orgArr[orgi].level=='4'){ + qintreeCount++ + } + }); + this.yinJson.serviceSupports.tableCount.totalCount=qintableCount + this.yinJson.serviceSupports.inputCount.totalCount=qininputCount + this.yinJson.serviceSupports.textAreaCount.totalCount=qintextAreaCount + this.yinJson.serviceSupports.treeCount.totalCount=qintreeCount + var futableCount=0 + var fuinputCount=0 + var futextAreaCount=0 + var futreeCount=0 + this.planTemplateData[9].attribute.forEach((orgvalue,orgi,orgArr) => { + if(orgArr[orgi].level=='1'){ + futableCount++ + //this.yinJson.organizationCommands.tableCount.tables.push({itemCount:orgtableCount}) + }else if(orgArr[orgi].level=='2'){ + fuinputCount++ + this.yinJson.decisionSupports.inputCount.inputs.push({colCount:orgArr[orgi].lieNumber,rowCount:orgArr[orgi].hNumber}) + }else if(orgArr[orgi].level=='3'){ + futextAreaCount++ + }else if(orgArr[orgi].level=='4'){ + futreeCount++ + } + }); + this.yinJson.decisionSupports.tableCount.totalCount=futableCount + this.yinJson.decisionSupports.inputCount.totalCount=fuinputCount + this.yinJson.decisionSupports.textAreaCount.totalCount=futextAreaCount + this.yinJson.decisionSupports.treeCount.totalCount=futreeCount + } + if(type==5){ + var orgtableCount=0 + var orginputCount=0 + var orgtextAreaCount=0 + var orgtreeCount=0 + this.planTemplateData[4].attribute.forEach((orgvalue,orgi,orgArr) => { + if(orgArr[orgi].level=='1'){ + orgtableCount++ + this.yinJson.organizationCommands.tableCount.tables.push({itemCount:orgArr[orgi].tableth.length}) + }else if(orgArr[orgi].level=='2'){ + orginputCount++ + this.yinJson.organizationCommands.inputCount.inputs.push({colCount:orgArr[orgi].lieNumber,rowCount:orgArr[orgi].hNumber}) + }else if(orgArr[orgi].level=='3'){ + orgtextAreaCount++ + }else if(orgArr[orgi].level=='4'){ + orgtreeCount++ + } + }); + this.yinJson.organizationCommands.tableCount.totalCount=orgtableCount + this.yinJson.organizationCommands.inputCount.totalCount=orginputCount + this.yinJson.organizationCommands.textAreaCount.totalCount=orgtextAreaCount + this.yinJson.organizationCommands.treeCount.totalCount=orgtreeCount + this.yinJson.decisionSupports=null + this.yinJson.serviceSupports=null + this.yinJson.socialLinkages=null + }if(type==7){ + var orgtableCount=0 + var orginputCount=0 + var orgtextAreaCount=0 + var orgtreeCount=0 + this.planTemplateData[6].attribute.forEach((orgvalue,orgi,orgArr) => { + if(orgArr[orgi].level=='1'){ + orgtableCount++ + //this.yinJson.organizationCommands.tableCount.tables.push({itemCount:orgtableCount}) + }else if(orgArr[orgi].level=='2'){ + orginputCount++ + this.yinJson.socialLinkages.inputCount.inputs.push({colCount:orgArr[orgi].lieNumber,rowCount:orgArr[orgi].hNumber}) + }else if(orgArr[orgi].level=='3'){ + orgtextAreaCount++ + }else if(orgArr[orgi].level=='4'){ + orgtreeCount++ + } + }); + this.yinJson.socialLinkages.tableCount.totalCount=orgtableCount + this.yinJson.socialLinkages.inputCount.totalCount=orginputCount + this.yinJson.socialLinkages.textAreaCount.totalCount=orgtextAreaCount + this.yinJson.socialLinkages.treeCount.totalCount=orgtreeCount + this.yinJson.serviceSupports=null + this.yinJson.organizationCommands=null + this.yinJson.decisionSupports=null + }if(type==8){ + var orgtableCount=0 + var orginputCount=0 + var orgtextAreaCount=0 + var orgtreeCount=0 + this.planTemplateData[7].attribute.forEach((orgvalue,orgi,orgArr) => { + if(orgArr[orgi].level=='1'){ + orgtableCount++ + //this.yinJson.organizationCommands.tableCount.tables.push({itemCount:orgtableCount}) + }else if(orgArr[orgi].level=='2'){ + orginputCount++ + this.yinJson.serviceSupports.inputCount.inputs.push({colCount:orgArr[orgi].lieNumber,rowCount:orgArr[orgi].hNumber}) + }else if(orgArr[orgi].level=='3'){ + orgtextAreaCount++ + }else if(orgArr[orgi].level=='4'){ + orgtreeCount++ + } + }); + this.yinJson.serviceSupports.tableCount.totalCount=orgtableCount + this.yinJson.serviceSupports.inputCount.totalCount=orginputCount + this.yinJson.serviceSupports.textAreaCount.totalCount=orgtextAreaCount + this.yinJson.serviceSupports.treeCount.totalCount=orgtreeCount + this.yinJson.decisionSupports=null + this.yinJson.organizationCommands=null + this.yinJson.socialLinkages=null + }if(type==10){ + var orgtableCount=0 + var orginputCount=0 + var orgtextAreaCount=0 + var orgtreeCount=0 + this.planTemplateData[9].attribute.forEach((orgvalue,orgi,orgArr) => { + if(orgArr[orgi].level=='1'){ + orgtableCount++ + //this.yinJson.organizationCommands.tableCount.tables.push({itemCount:orgtableCount}) + }else if(orgArr[orgi].level=='2'){ + orginputCount++ + this.yinJson.decisionSupports.inputCount.inputs.push({colCount:orgArr[orgi].lieNumber,rowCount:orgArr[orgi].hNumber}) + }else if(orgArr[orgi].level=='3'){ + orgtextAreaCount++ + }else if(orgArr[orgi].level=='4'){ + orgtreeCount++ + } + }); + this.yinJson.decisionSupports.tableCount.totalCount=orgtableCount + this.yinJson.decisionSupports.inputCount.totalCount=orginputCount + this.yinJson.decisionSupports.textAreaCount.totalCount=orgtextAreaCount + this.yinJson.decisionSupports.treeCount.totalCount=orgtreeCount + this.yinJson.organizationCommands=null + this.yinJson.serviceSupports=null + this.yinJson.socialLinkages=null + } + console.log(this.yinJson) + } + //查询能引入的预案 + yinruData={ + items:[] + } + searchYuan(){ + this.yinRu(this.selectedItem=='组织指挥'?5:this.selectedItem=='社会联动'?7:this.selectedItem=='勤务保障'?8:10) + //console.log(JSON.stringify(this.yinJson)) + var urlbm=encodeURI(JSON.stringify(this.yinJson)) + let paramsdata:any={ + planCategory:this.planLevel, + buildingTypeId :this.route.snapshot.queryParams.unitTypeId, + OrganizationId:this.searchType=='0'?'':this.jsId, + CustomKeyword:this.searchType=='0'?this.zdysearch:'', + webTextStatistics:urlbm, + PageNumber: this.PageNumber || '1', + PageSize: this.pageSizeOptions[0], + } + + this.http.get("/api/PlanComponents/WebText",{params:paramsdata}).subscribe((data:any)=>{ + this.yinruData=null + this.yinruData=data + console.log(this.yinruData) + }) + } + //可引入预案点击事件 + clickYinru(clicki){ + const dialogRef = this.dialog.open(yinYong, { + width: '750px', + height: '700px', + //disableClose: true + data: {selectedItem:this.selectedItem,yinruData:this.yinruData.items[clicki].webTextData} + }); + dialogRef.afterClosed().subscribe(result => { + console.log(result) + if(result!=undefined){ + this.planTemplateData.forEach(element => { + if(element.groupName==this.selectedItem){ + element.attribute=result + } + }); + } + } + ); + } + //分页事件 + changePage(e) { + this.PageNumber = e.pageIndex + 1 + this.searchYuan() + } //重点图示增加分组 addkeyImgItem(item) { @@ -707,10 +1188,12 @@ export class CreatePlanOnlineFiveComponent implements OnInit { this.pattern = 'edit' } //提交 - submit() { + async submit() { + await this.yinRu(0) console.log('提交信息', this.planTemplateData) let body = { - webTextData: JSON.stringify(this.planTemplateData) + webTextData: JSON.stringify(this.planTemplateData), + webTextStatistics:this.yinJson } this.http.put(`/api/PlanComponents/${this.route.snapshot.queryParams.planId}`, body).subscribe(data => { // console.log('提交成功',data) @@ -813,4 +1296,50 @@ export class OpenPlanToolDialog { this.dialogRef.close() } +} +//查看引用 +@Component({ + selector: 'yinYong', + templateUrl: './yinyong.html', + styleUrls: ['./create-plan-online-five.component.scss'] +}) +export class yinYong{ + constructor(public http: HttpClient, public snackBar: MatSnackBar, public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data, public dialog: MatDialog) { } + ngOnInit(){ + this.selectedItem=this.data.selectedItem + this.planTemplateData=JSON.parse(this.data.yinruData) + this.yinData() + console.log(this.planTemplateData) + } + selectedItem//传来的组织指挥或者。。。 + planTemplateData//传来的数据 + selectData + xuanze:boolean + //imgUrl + //看看查的是哪个标题下的内容 + yinData(){ + this.planTemplateData.forEach((pvale,pi,parr) => { + if(pvale.groupName==this.selectedItem){ + this.selectData=pvale.attribute + } + }); + } + trackByFn(index) { + return index + } + //关闭弹窗 + closeDiv() { + let isTrue = confirm('您确定要引用该条预案吗') + if(isTrue){ + this.xuanze=true + this.dialogRef.close(this.selectData) + } + else{ + this.xuanze=false + this.dialogRef.close() + } + + } + } \ No newline at end of file diff --git a/src/app/plan-management/create-plan-online-five/yinyong.html b/src/app/plan-management/create-plan-online-five/yinyong.html new file mode 100644 index 0000000..5235ab9 --- /dev/null +++ b/src/app/plan-management/create-plan-online-five/yinyong.html @@ -0,0 +1,75 @@ + +
+
+ {{selectedItem}} + +
+
+
+ {{element.headName}} +
+
+ + + + + + + + + + +
+ {{element.tableth[tablethi]}} +
+ {{itemtr.tabletd[tabletdi]}} + +
+ + + +
+
+
+ + + +
+
+
+
+ +
+
+ +
+ +
+
+ +
+
+
\ No newline at end of file diff --git a/src/app/plan-management/plan-management.module.ts b/src/app/plan-management/plan-management.module.ts index 4037c81..b8bfe71 100644 --- a/src/app/plan-management/plan-management.module.ts +++ b/src/app/plan-management/plan-management.module.ts @@ -69,11 +69,12 @@ import { CreatePlanOnlineThreeComponent } from './create-plan-online-three/creat import { UiModule } from '../ui/ui.module'; import { TreeDiagramModule } from '../ui/ng-tree-diagram/src/ng-tree-diagram'; import { KeyUnitModule } from '../key-unit/key-unit.module'; +import { yinYong } from './create-plan-online-five/create-plan-online-five.component' @NgModule({ declarations: [EntryPlanComponent, PassPlanComponent, OpenPlanComponent, EntryPlanLookComponent, AddPlanone, PlanType, AuditSatus, PlanLevel, DownloadFile, AuditResult, ChangeName, WebLookComponent, OnetwoEntryPlanComponent, newunitComponent, MeetPlanComponent, newunitMeet, TypePlanComponent, newunitType, PsViewer, onetwoAuditResult, meetAuditResult, - typeAuditResult, MaintainUpComponent, GkPsViewer, GkhtmlPsViewer, UnitInfo, ReinforcePlanComponent, state, ImgDetails, CreatePlanOnlineFiveComponent, CreatePlanOnlineThreeComponent, OpenPlanToolDialog], + typeAuditResult, MaintainUpComponent, GkPsViewer, GkhtmlPsViewer, UnitInfo, ReinforcePlanComponent, state, ImgDetails, CreatePlanOnlineFiveComponent, CreatePlanOnlineThreeComponent, OpenPlanToolDialog,yinYong], imports: [ CommonModule, PlanManagementRoutingModule, diff --git a/src/assets/images/yr.png b/src/assets/images/yr.png new file mode 100644 index 0000000..1ce8963 Binary files /dev/null and b/src/assets/images/yr.png differ