diff --git a/src/app/plan-management/entry-plan-look/entry-plan-look.component.html b/src/app/plan-management/entry-plan-look/entry-plan-look.component.html index a98b227..5fc22b0 100644 --- a/src/app/plan-management/entry-plan-look/entry-plan-look.component.html +++ b/src/app/plan-management/entry-plan-look/entry-plan-look.component.html @@ -46,8 +46,8 @@ 预案状态 - 新增 - 维护更新 + 新增 + 维护更新 @@ -66,13 +66,24 @@ 预案级别 - {{element.planCategory=='3'?'Ⅲ级预案':element.planCategory=='4'?'Ⅳ级预案':'Ⅴ级预案'}} + + {{element.planCategory=='3'?'Ⅲ级预案':element.planCategory=='4'?'Ⅳ级预案':'Ⅴ级预案'}} - 预案类型 - {{element.planType | plantype}} + 预案类型 + + {{element.planType + | + plantype}} + + + - 新增审核 @@ -97,18 +108,20 @@ 操作 改名 - 转在线导入 + 转在线导入 编辑 - 查看 - 下载 + 查看 + 下载 删除 审批结果 提交审核 - 撤销审核 + 撤销审核 @@ -127,4 +140,4 @@ - + \ No newline at end of file diff --git a/src/app/plan-management/entry-plan-look/entry-plan-look.component.scss b/src/app/plan-management/entry-plan-look/entry-plan-look.component.scss index 9127ca2..43f4cbb 100644 --- a/src/app/plan-management/entry-plan-look/entry-plan-look.component.scss +++ b/src/app/plan-management/entry-plan-look/entry-plan-look.component.scss @@ -86,9 +86,6 @@ margin: 0 3px; cursor: pointer; } - span:hover{ - text-decoration:underline - } .grey{ color: grey; pointer-events: none; diff --git a/src/app/plan-management/entry-plan-look/entry-plan-look.component.spec.ts b/src/app/plan-management/entry-plan-look/entry-plan-look.component.spec.ts deleted file mode 100644 index 381ed6c..0000000 --- a/src/app/plan-management/entry-plan-look/entry-plan-look.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { EntryPlanLookComponent } from './entry-plan-look.component'; - -describe('EntryPlanLookComponent', () => { - let component: EntryPlanLookComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ EntryPlanLookComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(EntryPlanLookComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/plan-management/entry-plan-look/entry-plan-look.component.ts b/src/app/plan-management/entry-plan-look/entry-plan-look.component.ts index c820c31..63c02ba 100644 --- a/src/app/plan-management/entry-plan-look/entry-plan-look.component.ts +++ b/src/app/plan-management/entry-plan-look/entry-plan-look.component.ts @@ -40,8 +40,8 @@ export class EntryPlanLookComponent implements OnInit { dataSource = new MatTreeFlatDataSource(this.treeControl, this.treeFlattener); myControl = new FormControl(); hasChild = (_: number, node: any) => node.expandable; - IsNewData=true //维护更新活新增 - displayedColumns: string[] = ['state','planname', 'addpeople', 'addtime','planCategory', 'plantype', 'auditstate', 'weihustate','isopen', 'preparethelevel', 'operation']; + IsNewData = true //维护更新活新增 + displayedColumns: string[] = ['state', 'planname', 'addpeople', 'addtime', 'planCategory', 'plantype', 'auditstate', 'weihustate', 'isopen', 'preparethelevel', 'operation']; tabledataSource: any //分页 @ViewChild(MatPaginator, { static: true }) @@ -109,45 +109,43 @@ export class EntryPlanLookComponent implements OnInit { //查看预案 lookPlan(e) { if (e.planType == 16 || e.planType == 4 || e.planType == 8) { - if (e.planType == 16&&e.attachmentUrls == null){ + if (e.planType == 16 && e.attachmentUrls == null) { window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${e.name}&unitName=${this.unitdata.unitname}&planCategory=${e.planCategory}&planId=${e.id}&unitTypeId=${this.compantData.buildingTypes[0].id}&orName=${this.compantData.organizationName}&orId=${this.compantData.organizationId}&pattern=false`) - }else{ - var index = e.attachmentUrls[0].indexOf("\/") - if (e.attachmentUrls[0].substr(0, index) == 'psw') { - const dialogRef = this.dialog.open(PsViewer, { - width: '1500px', - height: '800px', - data: e.attachmentUrls[0] - }); - } else if (e.attachmentUrls[0].substr(e.attachmentUrls[0].length - 3, e.attachmentUrls[0].length) == 'JPG' || e.attachmentUrls[0].substr(e.attachmentUrls[0].length - 3, e.attachmentUrls[0].length) == 'png' || e.attachmentUrls[0].substr(e.attachmentUrls[0].length - 3, e.attachmentUrls[0].length) == 'jpeg' || e.attachmentUrls[0].substr(e.attachmentUrls[0].length - 3, e.attachmentUrls[0].length) == 'jpg') { - let data = e - const dialogRef = this.dialog.open(ImgDetails, {//调用open方法打开对话框并且携带参数过去 - data: data.attachmentUrls, - }); - dialogRef.afterClosed().subscribe(); } else { - - let fetchUrl = e.attachmentUrls[0] - if (fetchUrl) { - let suffix = fetchUrl.split('.')[fetchUrl.split('.').length - 1].toLowerCase() - if (suffix == 'docx' || suffix == 'doc') { - let arr = fetchUrl.split('.') - arr[arr.length - 1] = 'pdf' - window.open(`/api/Objects/PlanPlatform/` + arr.join('.')) - } else if (suffix == 'pdf') { - window.open(`/api/Objects/PlanPlatform/` + fetchUrl) - } else { - let config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('该文件类型暂不支持在线查看', '确定', config); + var index = e.attachmentUrls[0].indexOf("\/") + if (e.attachmentUrls[0].substr(0, index) == 'psw') { + const dialogRef = this.dialog.open(PsViewer, { + width: '1500px', + height: '800px', + data: e.attachmentUrls[0] + }); + } else if (e.attachmentUrls[0].substr(e.attachmentUrls[0].length - 3, e.attachmentUrls[0].length) == 'JPG' || e.attachmentUrls[0].substr(e.attachmentUrls[0].length - 3, e.attachmentUrls[0].length) == 'png' || e.attachmentUrls[0].substr(e.attachmentUrls[0].length - 3, e.attachmentUrls[0].length) == 'jpeg' || e.attachmentUrls[0].substr(e.attachmentUrls[0].length - 3, e.attachmentUrls[0].length) == 'jpg') { + let data = e + const dialogRef = this.dialog.open(ImgDetails, {//调用open方法打开对话框并且携带参数过去 + data: data.attachmentUrls, + }); + dialogRef.afterClosed().subscribe(); + } else { + let fetchUrl = e.attachmentUrls[0] + if (fetchUrl) { + let suffix = fetchUrl.split('.')[fetchUrl.split('.').length - 1].toLowerCase() + if (suffix == 'docx' || suffix == 'doc') { + let arr = fetchUrl.split('.') + arr[arr.length - 1] = 'pdf' + window.open(`/api/Objects/PlanPlatform/` + arr.join('.')) + } else if (suffix == 'pdf') { + window.open(`/api/Objects/PlanPlatform/` + fetchUrl) + } else { + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('该文件类型暂不支持在线查看', '确定', config); + } } - } - } + } } - } - if (e.planType == 1) { //如果是在线编辑 + if (e.planType == 1 && e.planMode == 2) { //如果是在线编辑 let id = e.id sessionStorage.setItem("planId", id) sessionStorage.setItem("companyId", this.companyId) @@ -157,7 +155,7 @@ export class EntryPlanLookComponent implements OnInit { let companyId = sessionStorage.getItem("companyId") window.open(`/keyUnit/viewunitinfoplan?id=${companyId}&orName=${this.route.snapshot.queryParams.orName}&orId=${this.route.snapshot.queryParams.orId}`); } - if (e.planType == 2) { //如果是跳转网页 + if (e.planType == 2 && e.planMode == 3) { //如果是跳转网页 if (e.url.indexOf('app') == 0) { window.location.href = e.url } else { @@ -175,42 +173,12 @@ export class EntryPlanLookComponent implements OnInit { const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 - if(e.openRange!='未公开'||e.auditStatus!=8){ + if (e.openRange != '未公开' || e.auditStatus != 8) { let isTrue = confirm('您确定编辑吗,若是公开预案会变成未公开状态,审核状态也会改变') - if(isTrue){ - if (e.auditStatus == 8) { - if (e.planType == 1) { //如果是在线编辑 - let id = e.id - let body = {}; - let resetAudit = true - let headers = new HttpHeaders({ - 'Content-Type': 'text/json' - }); - let options = { - headers - }; - this.http.put(`/api/PlanComponents/${e.id}?resetAudit=${resetAudit}`, body, options).subscribe(data => { - this.getAllPlanComponents() - // this.lookPlan(e) - }) - sessionStorage.setItem("planId", id) - sessionStorage.setItem("companyId", this.companyId) - sessionStorage.setItem("buildingTypeId", this.unittypeId) - sessionStorage.setItem("editable", "1") - sessionStorage.setItem("planName", e.name) - let companyId = sessionStorage.getItem("companyId") - window.open(`/keyUnit/editunitinfo?id=${companyId}&orName=${this.route.snapshot.queryParams.orName}&orId=${this.route.snapshot.queryParams.orId}`); - } - else if (e.planType == 16) { - if (e.attachmentUrls == null) { - if(e.planMode==4){ - window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${e.name}&unitName=${this.unitdata.unitname}&planCategory=${e.planCategory}&planId=${e.id}&unitTypeId=${this.compantData.buildingTypes[0].id}&orName=${this.compantData.organizationName}&orId=${this.compantData.organizationId}&pattern=true&planMode=${e.planMode}`) - }else{ - window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${e.name}&unitName=${this.unitdata.unitname}&planCategory=${e.planCategory}&planId=${e.id}&unitTypeId=${this.compantData.buildingTypes[0].id}&orName=${this.compantData.organizationName}&orId=${this.compantData.organizationId}&pattern=true&planMode=${e.planMode}`) - } - - } - else { + if (isTrue) { + if (e.auditStatus == 8) { + if (e.planType == 1) { //如果是在线编辑 + let id = e.id let body = {}; let resetAudit = true let headers = new HttpHeaders({ @@ -220,61 +188,9 @@ export class EntryPlanLookComponent implements OnInit { headers }; this.http.put(`/api/PlanComponents/${e.id}?resetAudit=${resetAudit}`, body, options).subscribe(data => { - /* this.getAllPlanComponents() - this.lookPlan(e) */ - const dialogRef = this.dialog.open(editUpload, { - width: "300px", - height: "150px", - data: { id:e.id, companyId: this.companyId, unitType: this.unitdata.unittype, unitName: this.unitdata.unitname }, - disableClose: true - }); - dialogRef.afterClosed().subscribe(data => { - this.getAllPlanComponents() - }) - }/* ,err => { - this.snackBar.open(err,'确定',config); - } */) - } - - } - else if (e.planType == 2) { //三维预案 - const dialogRef = this.dialog.open(ChangeUrl, { - //改网址 - data: { element: e } - }); - dialogRef.afterClosed().subscribe( - data => { - if (data) { - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('修改成功!', '确定', config); - this.getAllPlanComponents() - } - } - ); - - } else { - this.snackBar.open('只有二维预案和文本预案可以编辑!', '确定', config); - } - } else { - //let isTrue = confirm('编辑后审核状态会成为未审核状态,您确定要编辑吗') - if (e.planType == 1) { //如果是在线编辑 - let id = e.id - let body = {}; - let resetAudit = true - let headers = new HttpHeaders({ - 'Content-Type': 'text/json' - }); - let options = { - headers - }; - this.http.put(`/api/PlanComponents/${e.id}?resetAudit=${resetAudit}`, body, options).subscribe(data => { - this.getAllPlanComponents() - // this.lookPlan(e) - }/* ,err => { - this.snackBar.open(err,'确定',config); - } */) + this.getAllPlanComponents() + // this.lookPlan(e) + }) sessionStorage.setItem("planId", id) sessionStorage.setItem("companyId", this.companyId) sessionStorage.setItem("buildingTypeId", this.unittypeId) @@ -285,8 +201,12 @@ export class EntryPlanLookComponent implements OnInit { } else if (e.planType == 16) { if (e.attachmentUrls == null) { - console.log(this.compantData) - window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${e.name}&unitName=${this.unitdata.unitname}&planCategory=${e.planCategory}&planId=${e.id}&unitTypeId=${this.compantData.buildingTypes[0].id}&orName=${this.compantData.organizationName}&orId=${this.compantData.organizationId}&planMode=${e.planMode}`) + if (e.planMode == 4) { + window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${e.name}&unitName=${this.unitdata.unitname}&planCategory=${e.planCategory}&planId=${e.id}&unitTypeId=${this.compantData.buildingTypes[0].id}&orName=${this.compantData.organizationName}&orId=${this.compantData.organizationId}&pattern=true&planMode=${e.planMode}`) + } else { + window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${e.name}&unitName=${this.unitdata.unitname}&planCategory=${e.planCategory}&planId=${e.id}&unitTypeId=${this.compantData.buildingTypes[0].id}&orName=${this.compantData.organizationName}&orId=${this.compantData.organizationId}&pattern=true&planMode=${e.planMode}`) + } + } else { let body = {}; @@ -298,10 +218,12 @@ export class EntryPlanLookComponent implements OnInit { headers }; this.http.put(`/api/PlanComponents/${e.id}?resetAudit=${resetAudit}`, body, options).subscribe(data => { + /* this.getAllPlanComponents() + this.lookPlan(e) */ const dialogRef = this.dialog.open(editUpload, { width: "300px", height: "150px", - data: { id:e.id, companyId: this.companyId, unitType: this.unitdata.unittype, unitName: this.unitdata.unitname }, + data: { id: e.id, companyId: this.companyId, unitType: this.unitdata.unittype, unitName: this.unitdata.unitname }, disableClose: true }); dialogRef.afterClosed().subscribe(data => { @@ -311,11 +233,11 @@ export class EntryPlanLookComponent implements OnInit { this.snackBar.open(err,'确定',config); } */) } - + } else if (e.planType == 2) { //三维预案 - const dialogRef = this.dialog.open(ChangeUrl, { + //改网址 data: { element: e } }); dialogRef.afterClosed().subscribe( @@ -326,20 +248,31 @@ export class EntryPlanLookComponent implements OnInit { config.duration = 3000 this.snackBar.open('修改成功!', '确定', config); this.getAllPlanComponents() - } } ); + } else { - this.snackBar.open('只有二维预案和文本预案可以编辑!', '确定', config); } - - } - } - }else{ + } else { + //let isTrue = confirm('编辑后审核状态会成为未审核状态,您确定要编辑吗') if (e.planType == 1) { //如果是在线编辑 let id = e.id + let body = {}; + let resetAudit = true + let headers = new HttpHeaders({ + 'Content-Type': 'text/json' + }); + let options = { + headers + }; + this.http.put(`/api/PlanComponents/${e.id}?resetAudit=${resetAudit}`, body, options).subscribe(data => { + this.getAllPlanComponents() + // this.lookPlan(e) + }/* ,err => { + this.snackBar.open(err,'确定',config); + } */) sessionStorage.setItem("planId", id) sessionStorage.setItem("companyId", this.companyId) sessionStorage.setItem("buildingTypeId", this.unittypeId) @@ -350,12 +283,8 @@ export class EntryPlanLookComponent implements OnInit { } else if (e.planType == 16) { if (e.attachmentUrls == null) { - if(e.planMode==4){ - window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${e.name}&unitName=${this.unitdata.unitname}&planCategory=${e.planCategory}&planId=${e.id}&unitTypeId=${this.compantData.buildingTypes[0].id}&orName=${this.compantData.organizationName}&orId=${this.compantData.organizationId}&pattern=true&planMode=${e.planMode}`) - }else{ - window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${e.name}&unitName=${this.unitdata.unitname}&planCategory=${e.planCategory}&planId=${e.id}&unitTypeId=${this.compantData.buildingTypes[0].id}&orName=${this.compantData.organizationName}&orId=${this.compantData.organizationId}&pattern=true&planMode=${e.planMode}`) - } - + console.log(this.compantData) + window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${e.name}&unitName=${this.unitdata.unitname}&planCategory=${e.planCategory}&planId=${e.id}&unitTypeId=${this.compantData.buildingTypes[0].id}&orName=${this.compantData.organizationName}&orId=${this.compantData.organizationId}&planMode=${e.planMode}`) } else { let body = {}; @@ -367,26 +296,24 @@ export class EntryPlanLookComponent implements OnInit { headers }; this.http.put(`/api/PlanComponents/${e.id}?resetAudit=${resetAudit}`, body, options).subscribe(data => { - const dialogRef = this.dialog.open(editUpload, { width: "300px", height: "150px", - data: { id:e.id, companyId: this.companyId, unitType: this.unitdata.unittype, unitName: this.unitdata.unitname }, + data: { id: e.id, companyId: this.companyId, unitType: this.unitdata.unittype, unitName: this.unitdata.unitname }, disableClose: true }); dialogRef.afterClosed().subscribe(data => { this.getAllPlanComponents() }) - //this.lookPlan(e) }/* ,err => { - this.snackBar.open(err,'确定',config); - } */) + this.snackBar.open(err,'确定',config); + } */) } - + } else if (e.planType == 2) { //三维预案 + const dialogRef = this.dialog.open(ChangeUrl, { - //改网址 data: { element: e } }); dialogRef.afterClosed().subscribe( @@ -397,79 +324,150 @@ export class EntryPlanLookComponent implements OnInit { config.duration = 3000 this.snackBar.open('修改成功!', '确定', config); this.getAllPlanComponents() + } } ); - /* if (e.url.indexOf('app') == 0) { - window.location.href = e.url - } else { - sessionStorage.setItem("url", e.url) - if ((e.url as string).includes('gis/threeDimensionalHome')) { //三维预案 - window.open(`${e.url}?unitId=${this.companyId}&unitName=${this.unitdata.unitname}&editMode=true`) - } else { - window.open(`/planManagement/webLook`) - } - } */ } else { + this.snackBar.open('只有二维预案和文本预案可以编辑!', '确定', config); } - /* else { - if (e.planType == 1) { //如果是在线编辑 - let id = e.id - sessionStorage.setItem("planId", id) - sessionStorage.setItem("companyId", this.companyId) - sessionStorage.setItem("buildingTypeId", this.unittypeId) - sessionStorage.setItem("editable", "1") - sessionStorage.setItem("planName", e.name) - let companyId = sessionStorage.getItem("companyId") - window.open(`/keyUnit/editunitinfo?id=${companyId}&orName=${this.route.snapshot.queryParams.orName}&orId=${this.route.snapshot.queryParams.orId}`); - } - else if (e.planType == 16) { - if (e.attachmentUrls == null) { - console.log(this.compantData) - window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${e.name}&unitName=${this.unitdata.unitname}&planCategory=${e.planCategory}&planId=${e.id}&unitTypeId=${this.compantData.buildingTypes[0].id}&orName=${this.compantData.organizationName}&orId=${this.compantData.organizationId}`) - } - else { - let body = {}; - let resetAudit = true - let headers = new HttpHeaders({ - 'Content-Type': 'text/json' - }); - let options = { - headers - }; - this.http.put(`/api/PlanComponents/${e.id}?resetAudit=${resetAudit}`, body, options).subscribe(data => { - this.getAllPlanComponents() - this.lookPlan(e) - }) - } - - } - else if (e.planType == 2) { //三维预案 - const dialogRef = this.dialog.open(ChangeUrl, { - data: { element: e } - }); - dialogRef.afterClosed().subscribe( - data => { - if (data) { - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('修改成功!', '确定', config); - this.getAllPlanComponents() - - } - } - ); - } else { - - this.snackBar.open('只有二维预案和文本预案可以编辑!', '确定', config); + + } + } + } else { + if (e.planType == 1) { //如果是在线编辑 + let id = e.id + sessionStorage.setItem("planId", id) + sessionStorage.setItem("companyId", this.companyId) + sessionStorage.setItem("buildingTypeId", this.unittypeId) + sessionStorage.setItem("editable", "1") + sessionStorage.setItem("planName", e.name) + let companyId = sessionStorage.getItem("companyId") + window.open(`/keyUnit/editunitinfo?id=${companyId}&orName=${this.route.snapshot.queryParams.orName}&orId=${this.route.snapshot.queryParams.orId}`); + } + else if (e.planType == 16) { + if (e.attachmentUrls == null) { + if (e.planMode == 4) { + window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${e.name}&unitName=${this.unitdata.unitname}&planCategory=${e.planCategory}&planId=${e.id}&unitTypeId=${this.compantData.buildingTypes[0].id}&orName=${this.compantData.organizationName}&orId=${this.compantData.organizationId}&pattern=true&planMode=${e.planMode}`) + } else { + window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${e.name}&unitName=${this.unitdata.unitname}&planCategory=${e.planCategory}&planId=${e.id}&unitTypeId=${this.compantData.buildingTypes[0].id}&orName=${this.compantData.organizationName}&orId=${this.compantData.organizationId}&pattern=true&planMode=${e.planMode}`) + } + + } + else { + let body = {}; + let resetAudit = true + let headers = new HttpHeaders({ + 'Content-Type': 'text/json' + }); + let options = { + headers + }; + this.http.put(`/api/PlanComponents/${e.id}?resetAudit=${resetAudit}`, body, options).subscribe(data => { + + const dialogRef = this.dialog.open(editUpload, { + width: "300px", + height: "150px", + data: { id: e.id, companyId: this.companyId, unitType: this.unitdata.unittype, unitName: this.unitdata.unitname }, + disableClose: true + }); + dialogRef.afterClosed().subscribe(data => { + this.getAllPlanComponents() + }) + //this.lookPlan(e) + }/* ,err => { + this.snackBar.open(err,'确定',config); + } */) + } + + } + else if (e.planType == 2) { //三维预案 + const dialogRef = this.dialog.open(ChangeUrl, { + //改网址 + data: { element: e } + }); + dialogRef.afterClosed().subscribe( + data => { + if (data) { + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('修改成功!', '确定', config); + this.getAllPlanComponents() } - + } + ); + /* if (e.url.indexOf('app') == 0) { + window.location.href = e.url + } else { + sessionStorage.setItem("url", e.url) + if ((e.url as string).includes('gis/threeDimensionalHome')) { //三维预案 + window.open(`${e.url}?unitId=${this.companyId}&unitName=${this.unitdata.unitname}&editMode=true`) + } else { + window.open(`/planManagement/webLook`) + } } */ - + } else { + this.snackBar.open('只有二维预案和文本预案可以编辑!', '确定', config); + } + /* else { + if (e.planType == 1) { //如果是在线编辑 + let id = e.id + sessionStorage.setItem("planId", id) + sessionStorage.setItem("companyId", this.companyId) + sessionStorage.setItem("buildingTypeId", this.unittypeId) + sessionStorage.setItem("editable", "1") + sessionStorage.setItem("planName", e.name) + let companyId = sessionStorage.getItem("companyId") + window.open(`/keyUnit/editunitinfo?id=${companyId}&orName=${this.route.snapshot.queryParams.orName}&orId=${this.route.snapshot.queryParams.orId}`); + } + else if (e.planType == 16) { + if (e.attachmentUrls == null) { + console.log(this.compantData) + window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${e.name}&unitName=${this.unitdata.unitname}&planCategory=${e.planCategory}&planId=${e.id}&unitTypeId=${this.compantData.buildingTypes[0].id}&orName=${this.compantData.organizationName}&orId=${this.compantData.organizationId}`) + } + else { + let body = {}; + let resetAudit = true + let headers = new HttpHeaders({ + 'Content-Type': 'text/json' + }); + let options = { + headers + }; + this.http.put(`/api/PlanComponents/${e.id}?resetAudit=${resetAudit}`, body, options).subscribe(data => { + this.getAllPlanComponents() + this.lookPlan(e) + }) + } + + } + else if (e.planType == 2) { //三维预案 + const dialogRef = this.dialog.open(ChangeUrl, { + data: { element: e } + }); + dialogRef.afterClosed().subscribe( + data => { + if (data) { + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('修改成功!', '确定', config); + this.getAllPlanComponents() + + } + } + ); + } else { + + this.snackBar.open('只有二维预案和文本预案可以编辑!', '确定', config); + } + + } */ + } - + } allPlanComponents: any //所有预案组件 @@ -495,7 +493,7 @@ export class EntryPlanLookComponent implements OnInit { ); } //获得所有预案组件 - audit:boolean + audit: boolean getAllPlanComponents() { let pagetype = this.route.snapshot.queryParams.pagetype let unitId = this.route.snapshot.queryParams.unitId @@ -531,6 +529,7 @@ export class EntryPlanLookComponent implements OnInit { this.length = data.totalCount this.allPlanComponents = data this.tabledataSource = data.items + console.log('预案列表', data.items) /* if(this.tabledataSource.isNewData){ this.tabledataSource.auditStatus==8?this.audit=true:false }else{ @@ -550,7 +549,7 @@ export class EntryPlanLookComponent implements OnInit { this.http.delete(`/api/PlanComponents2D/${plandata.id}`).subscribe(data => { this.snackBar.open('删除成功!', '确定', config); this.getAllPlanComponents() - },err=>{ + }, err => { this.snackBar.open(err, '确定', config); }) } else { @@ -560,7 +559,7 @@ export class EntryPlanLookComponent implements OnInit { config.duration = 3000 this.snackBar.open('删除成功!', '确定', config); this.getAllPlanComponents() - },err=>{ + }, err => { this.snackBar.open(err, '确定', config); }) } @@ -641,15 +640,15 @@ export class EntryPlanLookComponent implements OnInit { readFile(element) { this.uploadFileLonging = element console.log(element) - if(element.planType==16&&(element.planMode==4||element.planMode==2)){ + if (element.planType == 16 && (element.planMode == 4 || element.planMode == 2)) { const dialogRef = this.dialog.open(wenbenUpload, { width: "180px", - height:"200px", + height: "200px", disableClose: true, - data: {src:`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${element.name}&unitName=${this.unitdata.unitname}&planCategory=${element.planCategory}&planId=${element.id}&unitTypeId=${this.compantData.buildingTypes[0].id}&orName=${this.compantData.organizationName}&orId=${this.compantData.organizationId}&pattern=false&xiazai=true`} + data: { src: `/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${element.name}&unitName=${this.unitdata.unitname}&planCategory=${element.planCategory}&planId=${element.id}&unitTypeId=${this.compantData.buildingTypes[0].id}&orName=${this.compantData.organizationName}&orId=${this.compantData.organizationId}&pattern=false&xiazai=true` } }); //window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${element.name}&unitName=${this.unitdata.unitname}&planCategory=${element.planCategory}&planId=${element.id}&unitTypeId=${this.compantData.buildingTypes[0].id}&orName=${this.compantData.organizationName}&orId=${this.compantData.organizationId}&pattern=false&xiazai=true`) - }else{ + } else { const dialogRef = this.dialog.open(DownloadFile, { width: "435px", // height:"410px", @@ -665,7 +664,7 @@ export class EntryPlanLookComponent implements OnInit { } ); } - + } //初始化下载 @@ -777,60 +776,60 @@ export class EntryPlanLookComponent implements OnInit { ); } //上传word转在线编制 - spinner=false//圈圈是否存在 - async upzhuanMb(element){ - this.spinner=true + spinner = false//圈圈是否存在 + async upzhuanMb(element) { + this.spinner = true const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 let objectName//预案文件名称 let formData = new FormData() //模板导入接口传参 - let type=this.unitdata.unittype=='高层建筑'?1:this.unitdata.unittype=='居民小区'?2:this.unitdata.unittype=='厂房'?3 - :(this.unitdata.unittype=='商市场'||this.unitdata.unittype=='医院'||this.unitdata.unittype=='学校' - ||this.unitdata.unittype=='宾馆'||this.unitdata.unittype=='娱乐场所'||this.unitdata.unittype=='餐饮业' - ||this.unitdata.unittype=='影剧院'||this.unitdata.unittype=='展览建筑'||this.unitdata.unittype=='养老院' - ||this.unitdata.unittype=='会议中心')?4:this.unitdata.unittype=='储罐类'?'StorageTankFivePlan' - :this.unitdata.unittype=='化工生产'?'ChemicalProductionFivePlan':this.unitdata.unittype=='农村'?'CountrysideFivePlan':'' - let blob=[] + let type = this.unitdata.unittype == '高层建筑' ? 1 : this.unitdata.unittype == '居民小区' ? 2 : this.unitdata.unittype == '厂房' ? 3 + : (this.unitdata.unittype == '商市场' || this.unitdata.unittype == '医院' || this.unitdata.unittype == '学校' + || this.unitdata.unittype == '宾馆' || this.unitdata.unittype == '娱乐场所' || this.unitdata.unittype == '餐饮业' + || this.unitdata.unittype == '影剧院' || this.unitdata.unittype == '展览建筑' || this.unitdata.unittype == '养老院' + || this.unitdata.unittype == '会议中心') ? 4 : this.unitdata.unittype == '储罐类' ? 'StorageTankFivePlan' + : this.unitdata.unittype == '化工生产' ? 'ChemicalProductionFivePlan' : this.unitdata.unittype == '农村' ? 'CountrysideFivePlan' : '' + let blob = [] /* 调用下载接口获取文件流,并赋值给blob */ - let fileRuquest=await new Promise((resolve,reject)=>{ - this.http.get(`/api/ObjectMetadata/PlanPlatform/`+element.attachmentUrls[0]).subscribe((obdata: any) => { - objectName=obdata.objectName + let fileRuquest = await new Promise((resolve, reject) => { + this.http.get(`/api/ObjectMetadata/PlanPlatform/` + element.attachmentUrls[0]).subscribe((obdata: any) => { + objectName = obdata.objectName this.http.get(`/api/Objects/PlanPlatform/${objectName}`, { responseType: 'blob' },).subscribe(blobdata => { resolve(blobdata) }) - }) - }) + }) + }) blob.push(fileRuquest)//接收返回的blob类型数据 - let file=new File(blob,objectName)//转化为file类型 - formData.append('file',file) + let file = new File(blob, objectName)//转化为file类型 + formData.append('file', file) let pData//接受返回的模板信息数据 /* 调用模板导入接口,获取在线编制的json,并赋值给pData */ - let pRequest=await new Promise((resolve,rejest)=>{ - this.http.post(`/api/OfficeExtract/ExtractWordPlan?type=${type}`,formData).subscribe((data:any)=>{ + let pRequest = await new Promise((resolve, rejest) => { + this.http.post(`/api/OfficeExtract/ExtractWordPlan?type=${type}`, formData).subscribe((data: any) => { resolve(data) - },err=>{ - this.spinner=false + }, err => { + this.spinner = false this.snackBar.open('解析失败,请确定好格式再重新上传!', '确定', config); }) - }) - pData=pRequest + }) + pData = pRequest /* 调用新建预案接口,新建一条新的预案,并跳转新建在线编制页面 */ - let body={ - name:(element.planCategory==3?'Ⅲ级':element.planCategory==4?'Ⅳ级':element.planCategory==5?'Ⅴ级':'')+ element.name+'转在线编制', + let body = { + name: (element.planCategory == 3 ? 'Ⅲ级' : element.planCategory == 4 ? 'Ⅳ级' : element.planCategory == 5 ? 'Ⅴ级' : '') + element.name + '转在线编制', planType: element.planType, planMode: 2, planLevel: element.planLevel, - planCategory:element.planCategory, - webTextData:JSON.stringify(pData) + planCategory: element.planCategory, + webTextData: JSON.stringify(pData) } let planData - let newyuan=await new Promise((resolve,reject)=>{ + let newyuan = await new Promise((resolve, reject) => { this.http.post('/api/PlanComponents', body, { params: { companyId: this.route.snapshot.queryParams.unitId @@ -839,10 +838,10 @@ export class EntryPlanLookComponent implements OnInit { resolve(plandata) }) }) - planData=newyuan + planData = newyuan window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.route.snapshot.queryParams.unitId}&planName=${planData.name}&unitName=${this.unitdata.unitname}&planCategory=${planData.planCategory}&planId=${planData.id}&&wordChange=true`) this.getAllPlanComponents() - this.spinner=false + this.spinner = false } } @@ -1132,7 +1131,7 @@ export class AddPlanone { inputword: boolean = false //导入文档 onlineedit: boolean = false //在线编辑 website: boolean = false //网页地址 - inputNew :boolean=false //自定义编辑 + inputNew: boolean = false //自定义编辑 next(formdata) { //console.log(formdata.value.firstCtrlthree) //console.log(this.file) @@ -1146,17 +1145,17 @@ export class AddPlanone { this.onlineedit = false this.website = false } - if (formdata.value.firstCtrltwo == '16' ) {//&& formdata.value.firstCtrlthree != '4' + if (formdata.value.firstCtrltwo == '16') {//&& formdata.value.firstCtrlthree != '4' this.localup = true this.inputword = true this.onlineedit = false this.website = false - this.inputNew=true + this.inputNew = true } if (formdata.value.firstCtrltwo == '16' && formdata.value.firstCtrlthree != '4') {//&& formdata.value.firstCtrlthree != '4' this.localup = true this.inputword = true - this.inputNew=true + this.inputNew = true this.onlineedit = false this.website = false } @@ -1165,12 +1164,12 @@ export class AddPlanone { this.inputword = false this.onlineedit = true this.website = true - this.inputNew=false + this.inputNew = false } if (formdata.value.firstCtrltwo == '2' || formdata.value.firstCtrltwo == '4') { this.localup = true this.inputword = false - this.inputNew=false + this.inputNew = false this.onlineedit = false this.website = true this.pswShow = true @@ -1234,7 +1233,7 @@ export class AddPlanone { let open = this.newleftTabledata.filter((value, index, array) => { return value.unitname == this.data.unitType && value.planCategory == this.selectedPLanLevel }) - if(haveNew==true){ + if (haveNew == true) { this.http.post('/api/PlanComponents', { id: "", name: this.selectedPLanName, @@ -1254,7 +1253,7 @@ export class AddPlanone { //console.log(plandata) window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.data.companyId}&planName=${this.planData.name}&unitName=${this.data.unitName}&planCategory=${this.selectedPLanLevel}&planId=${this.planData.id}&haveNew=${haveNew}&planMode=${this.defaultisshow}`) }) - }else{ + } else { if (open.length > 0) { this.http.post('/api/PlanComponents', { id: "", @@ -1279,7 +1278,7 @@ export class AddPlanone { this.snackBar.open('请先创建模板!', '确定', config); } } - + }) @@ -1338,7 +1337,7 @@ export class AddPlanone { //this.snackBar.open('暂不支持导入','确定',config); this.createWord(false) } - if(this.defaultisshow == '4'){ + if (this.defaultisshow == '4') { this.createWord(true) } if (this.defaultisshow == '3' && (this.webaddress == "" || this.webaddress == null)) { //如果是填写网址 @@ -1647,7 +1646,7 @@ export class ImgDetails { templateUrl: './changeurl.html', styleUrls: ['./entry-plan-look.component.scss'] }) -export class ChangeUrl{ +export class ChangeUrl { constructor(private http: HttpClient, public dialogRef: MatDialogRef, @Inject(MAT_DIALOG_DATA) public data, public snackBar: MatSnackBar) { } planUrl: any//预案路径 updata//修改后的data @@ -1667,20 +1666,20 @@ export class ChangeUrl{ }; let body = { url: value.name, - auditStatus:8 + auditStatus: 8 } - this.http.put(`/api/PlanComponents/${this.data.element.id}`, body, options).subscribe(data => { - console.log(data) - this.updata=data - this.dialogRef.close("success"); - sessionStorage.setItem("url", this.updata.url) - if ((this.updata.url as string).includes('gis/threeDimensionalHome')) { //三维预案 - window.open(`${this.updata.url}?unitId=${this.updata.companyId}&unitName=${this.updata.name}&editMode=true`) - } else { - window.open(`/planManagement/webLook`) - } - }) - + this.http.put(`/api/PlanComponents/${this.data.element.id}`, body, options).subscribe(data => { + console.log(data) + this.updata = data + this.dialogRef.close("success"); + sessionStorage.setItem("url", this.updata.url) + if ((this.updata.url as string).includes('gis/threeDimensionalHome')) { //三维预案 + window.open(`${this.updata.url}?unitId=${this.updata.companyId}&unitName=${this.updata.name}&editMode=true`) + } else { + window.open(`/planManagement/webLook`) + } + }) + } } @@ -1690,7 +1689,7 @@ export class ChangeUrl{ templateUrl: './upLoad.html', styleUrls: ['./entry-plan-look.component.scss'] }) -export class editUpload{ +export class editUpload { constructor(private http: HttpClient, public dialogRef: MatDialogRef, @Inject(MAT_DIALOG_DATA) public data, public snackBar: MatSnackBar) { } planName: any//预案名称 ngOnInit(): void { @@ -1711,10 +1710,10 @@ export class editUpload{ upload() { document.getElementById('up').click() } -//上传文件input -filechange(e) { - this.file = e.target.files[0] || null //上传的文件 -} + //上传文件input + filechange(e) { + this.file = e.target.files[0] || null //上传的文件 + } //上传文件 startUploading() { console.log(this.file) @@ -1722,7 +1721,7 @@ filechange(e) { let fileSize = file.size || null //上传文件的总大小 let shardSize = 5 * 1024 * 1024 //5MB一个分片 // console.log(this.psw) - if(this.file!=undefined){ + if (this.file != undefined) { if (file && fileSize <= shardSize) { //上传文件<=5MB时 let formData = new FormData() formData.append("file", file) @@ -1734,8 +1733,8 @@ filechange(e) { let options = { headers }; - - + + this.uploadover = true let level = sessionStorage.getItem("level") // console.log(level) @@ -1753,25 +1752,25 @@ filechange(e) { PlanLevel = 8 } let uploadUrl = "/api/PlanComponents" - this.http.get(`/api/PlanComponents/${this.data.id}`).subscribe(yuandata => { - console.log(yuandata) - this.lastyuanData=yuandata - this.lastyuanData.attachmentUrls[0]=this.objectName - this.http.put(`/api/PlanComponents/${this.data.id}`, this.lastyuanData,options).subscribe(data => { - this.dialogRef.close(data); - }) + this.http.get(`/api/PlanComponents/${this.data.id}`).subscribe(yuandata => { + console.log(yuandata) + this.lastyuanData = yuandata + this.lastyuanData.attachmentUrls[0] = this.objectName + this.http.put(`/api/PlanComponents/${this.data.id}`, this.lastyuanData, options).subscribe(data => { + this.dialogRef.close(data); }) - + }) + }) - + } else if (file && fileSize > shardSize) { //上传文件>5MB时,分块上传 let data = { filename: file.name } //this.uploadisLoading = tru - this.subsectionUploading() - + this.subsectionUploading() + } } - else{ + else { const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 @@ -1851,13 +1850,13 @@ filechange(e) { PlanLevel = 8 } let uploadUrl = "/api/PlanComponents" - + if (this.uploadover) {//如果上次成功了才创建 this.http.get(`/api/PlanComponents/${this.data.id}`).subscribe(yuandata => { console.log(yuandata) - this.lastyuanData=yuandata - this.lastyuanData.attachmentUrls[0]=this.objectName - this.http.put(`/api/PlanComponents/${this.data.id}`, this.lastyuanData,options).subscribe(data => { + this.lastyuanData = yuandata + this.lastyuanData.attachmentUrls[0] = this.objectName + this.http.put(`/api/PlanComponents/${this.data.id}`, this.lastyuanData, options).subscribe(data => { this.dialogRef.close(data); }) }) @@ -1874,13 +1873,13 @@ filechange(e) { templateUrl: './upNew.html', styleUrls: ['./entry-plan-look.component.scss'] }) -export class wenbenUpload{ +export class wenbenUpload { constructor(private http: HttpClient, public dialogRef: MatDialogRef, @Inject(MAT_DIALOG_DATA) public data, public snackBar: MatSnackBar, private sanitizer: DomSanitizer) { } ngOnInit(): void { console.log(this.data) - window.setTimeout(()=>{ + window.setTimeout(() => { this.dialogRef.close(); - },45000) + }, 45000) } - src=this.sanitizer.bypassSecurityTrustResourceUrl(this.data.src); + src = this.sanitizer.bypassSecurityTrustResourceUrl(this.data.src); } diff --git a/src/app/plan-management/entry-plan/entry-plan.component.html b/src/app/plan-management/entry-plan/entry-plan.component.html index 9ac17a9..dfaaade 100644 --- a/src/app/plan-management/entry-plan/entry-plan.component.html +++ b/src/app/plan-management/entry-plan/entry-plan.component.html @@ -153,10 +153,10 @@
- 模板录入预案 + 模板录入预案
- 自定义预案 + 自定义预案
diff --git a/src/app/plan-management/entry-plan/entry-plan.component.ts b/src/app/plan-management/entry-plan/entry-plan.component.ts index 21d745e..828de0f 100644 --- a/src/app/plan-management/entry-plan/entry-plan.component.ts +++ b/src/app/plan-management/entry-plan/entry-plan.component.ts @@ -366,7 +366,18 @@ export class EntryPlanComponent implements OnInit { this.pageEvent.pageIndex = 0 this.getAllPlanInfo() } - + templatePlanChange($event, type) { + if (type == 1) { + this.templatePlan = $event + } else if (type == 2) { + this.customPlan = $event + } + if (this.templatePlan || this.customPlan) { + this.reservePlanType = ['16'] + } else { + this.reservePlanType = [] + } + } companyName: any //单位名称 js: any //所选组织机构 jsId: any //所选组织机构的id diff --git a/src/app/plan-management/open-plan/open-plan.component.html b/src/app/plan-management/open-plan/open-plan.component.html index 41cefa1..d9eb115 100644 --- a/src/app/plan-management/open-plan/open-plan.component.html +++ b/src/app/plan-management/open-plan/open-plan.component.html @@ -67,10 +67,12 @@
- 模板录入预案 + + 模板录入预案
- 自定义预案 + 自定义预案 +
@@ -108,8 +110,17 @@ {{element.creationTime | date:'yyyy-MM-dd'}} - 预案类型 - {{element.planType | plantype}} + 预案类型 + + {{element.planType + | + plantype}} + + + 新增审核 diff --git a/src/app/plan-management/open-plan/open-plan.component.ts b/src/app/plan-management/open-plan/open-plan.component.ts index 4cf33ca..a507031 100644 --- a/src/app/plan-management/open-plan/open-plan.component.ts +++ b/src/app/plan-management/open-plan/open-plan.component.ts @@ -10,6 +10,7 @@ import { MatDialogRef, MatDialog, MAT_DIALOG_DATA } from '@angular/material/dial import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; import { TreeService } from '../../http-interceptors/tree.service' import { Viewer } from 'photo-sphere-viewer'; +import { ImgDetails, PsViewer } from '../entry-plan-look/entry-plan-look.component'; declare var CryptoJS @Component({ selector: 'app-open-plan', @@ -201,39 +202,46 @@ export class OpenPlanComponent implements OnInit { } //跳转查看预案页面 公开预案 routerTo(e) { - /* sessionStorage.setItem("companyName",element.companyName) - window.open(`/planAudit/planpass?id=${element.companyId}&companyName=${element.companyName}&auditPlanId=${element.id}&auditStatus=${element.auditStatus}&type=6&planType=2`); */ - - // console.log(e) - if (e.planMode == 0 || e.planMode == 1) { - //console.log(e.attachmentUrls) - var index = e.attachmentUrls[0].indexOf("\/") - if (e.attachmentUrls[0].substr(0, index) == 'psw') { - const dialogRef = this.dialog.open(GkhtmlPsViewer, { - width: '1500px', - height: '800px', - data: e.attachmentUrls[0] - }); - } - else { - let fetchUrl = e.attachmentUrls[0] - let suffix = fetchUrl.split('.')[fetchUrl.split('.').length - 1].toLowerCase() - if (suffix == 'docx' || suffix == 'doc') { - let arr = fetchUrl.split('.') - arr[arr.length - 1] = 'pdf' - window.open(`/api/Objects/PlanPlatform/` + arr.join('.')) - } else if (suffix == 'pdf') { - window.open(`/api/Objects/PlanPlatform/` + fetchUrl) + console.log(e) + if (e.planType == 16 || e.planType == 4 || e.planType == 8) { + if (e.planType == 16 && e.attachmentUrls == null) { + window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${e.companyId}&planName=${e.name}&unitName=${e.company.name}&planCategory=${e.planCategory}&planId=${e.id}&unitTypeId=${e.company.buildingTypes[0].id}&orName=${e.company.organizationName}&orId=${e.company.organizationId}&pattern=false`) + } else { + var index = e.attachmentUrls[0].indexOf("\/") + if (e.attachmentUrls[0].substr(0, index) == 'psw') { + const dialogRef = this.dialog.open(PsViewer, { + width: '1500px', + height: '800px', + data: e.attachmentUrls[0] + }); + } else if (e.attachmentUrls[0].substr(e.attachmentUrls[0].length - 3, e.attachmentUrls[0].length) == 'JPG' || e.attachmentUrls[0].substr(e.attachmentUrls[0].length - 3, e.attachmentUrls[0].length) == 'png' || e.attachmentUrls[0].substr(e.attachmentUrls[0].length - 3, e.attachmentUrls[0].length) == 'jpeg' || e.attachmentUrls[0].substr(e.attachmentUrls[0].length - 3, e.attachmentUrls[0].length) == 'jpg') { + let data = e + const dialogRef = this.dialog.open(ImgDetails, {//调用open方法打开对话框并且携带参数过去 + data: data.attachmentUrls, + }); + dialogRef.afterClosed().subscribe(); } else { - let config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('该文件类型暂不支持在线查看', '确定', config); + let fetchUrl = e.attachmentUrls[0] + if (fetchUrl) { + let suffix = fetchUrl.split('.')[fetchUrl.split('.').length - 1].toLowerCase() + if (suffix == 'docx' || suffix == 'doc') { + let arr = fetchUrl.split('.') + arr[arr.length - 1] = 'pdf' + window.open(`/api/Objects/PlanPlatform/` + arr.join('.')) + } else if (suffix == 'pdf') { + window.open(`/api/Objects/PlanPlatform/` + fetchUrl) + } else { + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('该文件类型暂不支持在线查看', '确定', config); + } + } } } } - if (e.planMode == 2) { //如果是在线编辑 + if (e.planMode == 2 && e.planType == 1) { //如果是在线编辑 let id = e.id sessionStorage.setItem("planId", id) sessionStorage.setItem("companyId", e.companyId) @@ -248,6 +256,20 @@ export class OpenPlanComponent implements OnInit { window.open(`/planManagement/webLook`) } } + + + templatePlanChange($event, type) { + if (type == 1) { + this.templatePlan = $event + } else if (type == 2) { + this.customPlan = $event + } + if (this.templatePlan || this.customPlan) { + this.reservePlanType = ['16'] + } else { + this.reservePlanType = [] + } + } //分页事件 chagePage(e) { this.PageNumber = e.pageIndex + 1 diff --git a/src/app/plan-management/pass-plan/pass-plan.component.html b/src/app/plan-management/pass-plan/pass-plan.component.html index af8e821..9d743e5 100644 --- a/src/app/plan-management/pass-plan/pass-plan.component.html +++ b/src/app/plan-management/pass-plan/pass-plan.component.html @@ -132,10 +132,12 @@
- 模板录入预案 + + 模板录入预案
- 自定义预案 + 自定义预案 +
@@ -173,8 +175,17 @@ {{element.creationTime | date:'yyyy-MM-dd'}}
- 预案类型 - {{element.planType | plantype}} + 预案类型 + + {{element.planType + | + plantype}} + + + 新增审核 diff --git a/src/app/plan-management/pass-plan/pass-plan.component.ts b/src/app/plan-management/pass-plan/pass-plan.component.ts index 284bfd2..3862e0e 100644 --- a/src/app/plan-management/pass-plan/pass-plan.component.ts +++ b/src/app/plan-management/pass-plan/pass-plan.component.ts @@ -10,6 +10,7 @@ import { MatDialogRef, MatDialog, MAT_DIALOG_DATA } from '@angular/material/dial import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; import { TreeService } from '../../http-interceptors/tree.service' import { Viewer } from 'photo-sphere-viewer'; +import { ImgDetails, PsViewer } from '../entry-plan-look/entry-plan-look.component'; declare var CryptoJS @Component({ selector: 'app-pass-plan', @@ -351,36 +352,46 @@ export class PassPlanComponent implements OnInit { //跳转查看预案页面 审核通过预案 routerTo(e) { - // console.log(e) - if (e.planMode == 0 || e.planMode == 1) { - //console.log(e.attachmentUrls) - var index = e.attachmentUrls[0].indexOf("\/") - if (e.attachmentUrls[0].substr(0, index) == 'psw') { - const dialogRef = this.dialog.open(GkPsViewer, { - width: '1500px', - height: '800px', - data: e.attachmentUrls[0] - }); - } - else { - let fetchUrl = e.attachmentUrls[0] - let suffix = fetchUrl.split('.')[fetchUrl.split('.').length - 1].toLowerCase() - if (suffix == 'docx' || suffix == 'doc') { - let arr = fetchUrl.split('.') - arr[arr.length - 1] = 'pdf' - window.open(`/api/Objects/PlanPlatform/` + arr.join('.')) - } else if (suffix == 'pdf') { - window.open(`/api/Objects/PlanPlatform/` + fetchUrl) + console.log(e) + if (e.planType == 16 || e.planType == 4 || e.planType == 8) { + if (e.planType == 16 && e.attachmentUrls == null) { + window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${e.companyId}&planName=${e.name}&unitName=${e.company.name}&planCategory=${e.planCategory}&planId=${e.id}&unitTypeId=${e.company.buildingTypes[0].id}&orName=${e.company.organizationName}&orId=${e.company.organizationId}&pattern=false`) + } else { + var index = e.attachmentUrls[0].indexOf("\/") + if (e.attachmentUrls[0].substr(0, index) == 'psw') { + const dialogRef = this.dialog.open(PsViewer, { + width: '1500px', + height: '800px', + data: e.attachmentUrls[0] + }); + } else if (e.attachmentUrls[0].substr(e.attachmentUrls[0].length - 3, e.attachmentUrls[0].length) == 'JPG' || e.attachmentUrls[0].substr(e.attachmentUrls[0].length - 3, e.attachmentUrls[0].length) == 'png' || e.attachmentUrls[0].substr(e.attachmentUrls[0].length - 3, e.attachmentUrls[0].length) == 'jpeg' || e.attachmentUrls[0].substr(e.attachmentUrls[0].length - 3, e.attachmentUrls[0].length) == 'jpg') { + let data = e + const dialogRef = this.dialog.open(ImgDetails, {//调用open方法打开对话框并且携带参数过去 + data: data.attachmentUrls, + }); + dialogRef.afterClosed().subscribe(); } else { - let config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('该文件类型暂不支持在线查看', '确定', config); + let fetchUrl = e.attachmentUrls[0] + if (fetchUrl) { + let suffix = fetchUrl.split('.')[fetchUrl.split('.').length - 1].toLowerCase() + if (suffix == 'docx' || suffix == 'doc') { + let arr = fetchUrl.split('.') + arr[arr.length - 1] = 'pdf' + window.open(`/api/Objects/PlanPlatform/` + arr.join('.')) + } else if (suffix == 'pdf') { + window.open(`/api/Objects/PlanPlatform/` + fetchUrl) + } else { + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('该文件类型暂不支持在线查看', '确定', config); + } + } } } } - if (e.planMode == 2) { //如果是在线编辑 + if (e.planMode == 2 && e.planType == 1) { //如果是在线编辑 let id = e.id sessionStorage.setItem("planId", id) sessionStorage.setItem("companyId", e.companyId) @@ -395,7 +406,18 @@ export class PassPlanComponent implements OnInit { window.open(`/planManagement/webLook`) } } - + templatePlanChange($event, type) { + if (type == 1) { + this.templatePlan = $event + } else if (type == 2) { + this.customPlan = $event + } + if (this.templatePlan || this.customPlan) { + this.reservePlanType = ['16'] + } else { + this.reservePlanType = [] + } + } //预案公开 openReserve(e) { this.http.put(`/api/PlanAudits/${e.id}/Public`, []).subscribe(data => { diff --git a/src/app/statistic-analysis/combined-query/combined-query.component.html b/src/app/statistic-analysis/combined-query/combined-query.component.html index d6c29be..7e20b36 100644 --- a/src/app/statistic-analysis/combined-query/combined-query.component.html +++ b/src/app/statistic-analysis/combined-query/combined-query.component.html @@ -134,10 +134,9 @@
- @@ -150,10 +149,9 @@
{{item}}undo - + {{item}}
- diff --git a/src/app/statistic-analysis/combined-query/combined-query.component.ts b/src/app/statistic-analysis/combined-query/combined-query.component.ts index 91add9e..dc8e2cf 100644 --- a/src/app/statistic-analysis/combined-query/combined-query.component.ts +++ b/src/app/statistic-analysis/combined-query/combined-query.component.ts @@ -277,9 +277,6 @@ export class CombinedQueryComponent implements OnInit { } else { this.tabledataSource[i].name.push(bvalue[bi].count) } - /* this.tabledataSource.forEach((td,ti,tval)=>{ - tval[ti].name.push(item.count) - }) */ }); } @@ -369,8 +366,6 @@ export class CombinedQueryComponent implements OnInit { }) } } - // console.log(this.yuanColumns) - // console.log(this.yuanTable) this.isMasklayer = false resolve(this.excelData) } @@ -465,7 +460,7 @@ export class CombinedQueryComponent implements OnInit { let config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 - if (key == 0) { + if (key == 0 && element != '合计') { let clickOr this.allorganizations.forEach(item => { if (element === item.name) { diff --git a/src/assets/images/back.png b/src/assets/images/back.png new file mode 100644 index 0000000..23cdb87 Binary files /dev/null and b/src/assets/images/back.png differ diff --git a/src/assets/images/custom.png b/src/assets/images/custom.png new file mode 100644 index 0000000..cd554cc Binary files /dev/null and b/src/assets/images/custom.png differ diff --git a/src/assets/images/template.png b/src/assets/images/template.png new file mode 100644 index 0000000..36bc230 Binary files /dev/null and b/src/assets/images/template.png differ
{{item}}undo - + {{item}}