邵佳豪 4 years ago
parent
commit
9113bd28ce
  1. 4
      src/app/app-routing.module.ts
  2. 6
      src/app/plan-audit/wait-examineer/wait-examineer.component.ts
  3. 16
      src/app/plan-management/create-plan-online-five/create-plan-online-five.component.html
  4. 1
      src/app/plan-management/create-plan-online-five/create-plan-online-five.component.scss
  5. 8
      src/app/plan-management/create-plan-online-five/create-plan-online-five.component.ts
  6. 4
      src/app/plan-management/entry-plan-look/entry-plan-look.component.html
  7. 12
      src/app/plan-management/entry-plan-look/entry-plan-look.component.ts
  8. 43
      src/app/ui/plan-template/plan-template.component.ts

4
src/app/app-routing.module.ts

@ -4,7 +4,7 @@
* @Author: sueRimn
* @Date: 2021-01-11 14:48:03
* @LastEditors: sueRimn
* @LastEditTime: 2021-03-26 15:18:46
* @LastEditTime: 2021-07-29 10:26:58
*/
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
@ -19,6 +19,7 @@ import {MTokenK1Component} from './m-token-k1/m-token-k1.component' //K1秘钥
import {ViewUnitDetailsPlanComponent} from './key-unit/view-unit-details-plan/view-unit-details-plan.component'
import { TestComponent } from './test/test.component';
import { ExternalLinksPlanComponent } from './external-links-plan/external-links-plan.component';
import { CreatePlanOnlineFiveComponent } from './plan-management/create-plan-online-five/create-plan-online-five.component'
const routes: Routes = [
@ -42,6 +43,7 @@ const routes: Routes = [
{path:'planAudit/planpass', component: PlanPassComponent , canActivate: [AuthGuard]},
{path:'test', component: TestComponent },
{path:'linksPlan', component: ExternalLinksPlanComponent },
{path:'CreatePlanOnlineFive',component:CreatePlanOnlineFiveComponent}
];
@NgModule({

6
src/app/plan-audit/wait-examineer/wait-examineer.component.ts

@ -4,7 +4,7 @@
* @Author: sueRimn
* @Date: 2020-12-25 16:13:50
* @LastEditors: sueRimn
* @LastEditTime: 2021-07-24 14:34:24
* @LastEditTime: 2021-07-29 10:27:36
*/
import { Component, Inject, OnInit } from '@angular/core';
import { FormControl } from '@angular/forms';
@ -296,8 +296,10 @@ export class WaitExamineerComponent implements OnInit {
this.companyName = data.companyName
if (data.planType != 2 && data.planType != 1) {
if (data.planMode == 2) {
this.showtype = 0
this.bianzhi = true
this.src = `/planManagement/createplanonlinefive?navIsOpen=false&companyId=${data.companyId}&planName=${data.name}&unitName=${data.companyName}&planCategory=${data.planCategory}&planId=${data.id}&unitTypeId=${data.company.buildingTypes[0].id}&orName=${data.company.organizationName}&orId=${data.company.organizationId}&pattern=false`
this.src = `/CreatePlanOnlineFive?navIsOpen=false&companyId=${data.companyId}&planName=${data.name}&unitName=${data.companyName}&planCategory=${data.planCategory}&planId=${data.id}&unitTypeId=${data.company.buildingTypes[0].id}&orName=${data.company.organizationName}&orId=${data.company.organizationId}&pattern=false`
this.iframeSrc = this.sanitizer.bypassSecurityTrustResourceUrl(this.src);
//this.src=`/keyUnit/viewunitinfoplan?id=${data.companyId}&orName=${data.company.organizationId}&orId=${data.company.organizationName}`
} else {
this.bianzhi = false

16
src/app/plan-management/create-plan-online-five/create-plan-online-five.component.html

@ -15,7 +15,7 @@
</button>
</div>
</div>
<button mat-stroked-button (click)="quitPreview()" class="quitPreview">
<button mat-stroked-button (click)="quitPreview()" class="quitPreview" *ngIf="blockyl">
<mat-icon>visibility</mat-icon> 退出预览
</button>
<div class="contentbox" [ngClass]="{'noPadding': pattern == 'look'}">
@ -395,7 +395,7 @@
<th *ngFor="let itemth of element.tableth;let tablethi=index;TrackBy:trackByFn" style="border: 1px solid #999;
height: 40px;
font-size: 16px;
text-align: center;" >
text-align: center;width: 185px;" >
{{element.tableth[tablethi]}}
</th>
</thead>
@ -414,7 +414,7 @@
<td *ngFor="let itemtd of itemtr.tabletd;let tabletdi=index;TrackBy:trackByFn" style="border: 1px solid #999;
height: 40px;
font-size: 16px;
text-align: center;">
text-align: center;width: 185px;">
{{itemtr.tabletd[tabletdi]}}
</td>
</tr>
@ -440,11 +440,11 @@
<th style="border: 1px solid #999;
height: 40px;
font-size: 16px;
text-align: center; white-space:pre-wrap; width: 100px;">{{itemthj.head}}</th>
text-align: center; white-space:pre-wrap; width: 185px;">{{itemthj.head}}</th>
<td style="border: 1px solid #999;
height: 40px;
font-size: 16px;
text-align: center;white-space:pre-wrap;width: 100px;">{{itemthj.body}}</td>
text-align: center;white-space:pre-wrap;width: 185px;">{{itemthj.body}}</td>
</tr>
</table>
</div>
@ -711,7 +711,8 @@
<input type="text" placeholder="请输入内容" style="width: 30%;background-color: #e8e9e9;text-align: center;" [(ngModel)]="info.propertyName" readonly *ngIf="pattern == 'edit'">
<input type="text" placeholder="请输入内容" style="width: 40%;background-color: #FFFFFF;" [(ngModel)]="info.value" *ngIf="pattern == 'edit'">
<!-- <input type="text" style="width: 30%;background-color: #FFFFFF;color: #999;" [(ngModel)]="info.olddata" *ngIf="pattern == 'edit'&&oldData" readonly> -->
<span style="width: 30%;background-color: #FFFFFF;color: #999;" *ngIf="pattern == 'edit'&&oldData">{{info.olddata||'无原数据'}}</span>
<!-- <span style="width: 30%;background-color: #FFFFFF;color: #999;" *ngIf="pattern == 'edit'&&oldData">{{info.olddata||'无原数据'}}</span> -->
<input type="text" style="width: 30%;background-color: #FFFFFF;color: #999;" *ngIf="pattern == 'edit'&&oldData" readonly [value]="info.olddata||'无原数据'">
<table *ngIf="pattern == 'look'" style="width: 100%;border-collapse: collapse;">
<tr>
<th style="border: 1px solid #999;
@ -735,7 +736,8 @@
<input type="text" placeholder="请输入内容" style="width: 30%;background-color: #e8e9e9;text-align: center;" [(ngModel)]="info.propertyName" readonly *ngIf="pattern == 'edit'">
<input type="text" placeholder="请输入内容" style="width: 40%;background-color: #FFFFFF;" [(ngModel)]="info.propertyValue" *ngIf="pattern == 'edit'">
<!-- <input type="text" style="width: 30%;background-color: #FFFFFF;color: #999;" [(ngModel)]="info.olddata" *ngIf="pattern == 'edit'&&oldData" readonly> -->
<span style="width: 30%;background-color: #FFFFFF;color: #999;" *ngIf="pattern == 'edit'&&oldData">{{info.olddata||'无原数据'}}</span>
<!-- <span style="width: 30%;background-color: #FFFFFF;color: #999;" *ngIf="pattern == 'edit'&&oldData">{{info.olddata||'无原数据'}}</span> -->
<input type="text" style="width: 30%;background-color: #FFFFFF;color: #999;" *ngIf="pattern == 'edit'&&oldData" readonly [value]="info.olddata||'无原数据'">
<table *ngIf="pattern == 'look'" style="width: 100%;border-collapse: collapse;">
<tr>
<th style="border: 1px solid #999;

1
src/app/plan-management/create-plan-online-five/create-plan-online-five.component.scss

@ -887,3 +887,4 @@
right: 15px;
}
}

8
src/app/plan-management/create-plan-online-five/create-plan-online-five.component.ts

@ -4,7 +4,7 @@
* @Author: sueRimn
* @Date: 2021-06-16 13:56:54
* @LastEditors: sueRimn
* @LastEditTime: 2021-07-08 09:36:32
* @LastEditTime: 2021-07-30 14:56:55
*/
import { HttpClient } from '@angular/common/http';
import { Component, Inject, OnInit, Renderer2, ViewChild, Input } from '@angular/core';
@ -24,10 +24,12 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
planLevel: string//预案级别
blockyl=true
ngOnInit(): void {
this.planLevel = this.route.snapshot.queryParams.planCategory
if(this.route.snapshot.queryParams.pattern=='false'){
this.pattern='look'
this.blockyl=false
}else{
this.pattern='edit'
}
@ -561,7 +563,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
}
//生成word
generatingDoc() {
changeImgToDataurl()
/* changeImgToDataurl()
function changeImgToDataurl() {
let charImg = document.getElementsByTagName("img");
console.log(charImg)
@ -589,7 +591,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
}
function condataurl(dataURL, charImg) {
charImg.src = dataURL;
}
} */
$(".mainbox").wordExport('word文档');
}

4
src/app/plan-management/entry-plan-look/entry-plan-look.component.html

@ -4,7 +4,7 @@
* @Author: sueRimn
* @Date: 2020-12-24 10:59:48
* @LastEditors: sueRimn
* @LastEditTime: 2021-07-24 16:58:31
* @LastEditTime: 2021-07-29 10:44:58
-->
<!-- <p>录入预案</p> -->
<div style="overflow: auto;height: 100%;">
@ -86,7 +86,7 @@
<span (click)="deletePlan(element)" *ngIf="element.auditStatus==8">删除</span>
<span (click)="auditResult(element)">审批结果</span>
<span (click)="submitAudit(element)"
*ngIf="element.auditStatus!=1&&element.auditStatus!=16">提交审核</span>
*ngIf="element.auditStatus==8">提交审核</span>
<span (click)="cancelAudit(element)" *ngIf="element.auditStatus == 1||element.auditStatus == 16">撤销审核</span>
</td>
</ng-container>

12
src/app/plan-management/entry-plan-look/entry-plan-look.component.ts

@ -108,7 +108,10 @@ export class EntryPlanLookComponent implements OnInit {
lookPlan(e) {
console.log(e)
if (e.planType == 16 || e.planType == 4 || e.planType == 8) {
var index = e.attachmentUrls[0].indexOf("\/")
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',
@ -123,6 +126,7 @@ export class EntryPlanLookComponent implements OnInit {
dialogRef.afterClosed().subscribe();
} else {
let fetchUrl = e.attachmentUrls[0]
//console.log(fetchUrl)
if (fetchUrl) {
let suffix = fetchUrl.split('.')[fetchUrl.split('.').length - 1].toLowerCase()
if (suffix == 'docx' || suffix == 'doc') {
@ -137,10 +141,10 @@ export class EntryPlanLookComponent implements OnInit {
config.duration = 3000
this.snackBar.open('该文件类型暂不支持在线查看', '确定', config);
}
} 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}`)
}
}
}
}
if (e.planType == 1) { //如果是在线编辑
let id = e.id
@ -179,7 +183,7 @@ export class EntryPlanLookComponent implements OnInit {
}
else if (e.planType == 16) {
if (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}`)
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`)
}
else {
let body = {};

43
src/app/ui/plan-template/plan-template.component.ts

@ -4,7 +4,7 @@
* @Author: sueRimn
* @Date: 2021-05-31 10:40:01
* @LastEditors: sueRimn
* @LastEditTime: 2021-07-05 15:15:36
* @LastEditTime: 2021-07-28 14:37:50
*/
import { Component, Inject, OnInit,ViewEncapsulation } from '@angular/core';
@ -132,6 +132,9 @@ export class PlanTemplateComponent implements OnInit {
}
//修改模板
upPlan(item,i,operation){
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
const dialogRef = this.dialog.open(upPlanname, {//调用open方法打开对话框并且携带参数过去
width: '340px',
height:'340px',
@ -147,16 +150,48 @@ export class PlanTemplateComponent implements OnInit {
this.newleftTabledata[i].planCategory=result.planCategory
this.newleftTabledata[i].buildingTypeId=result.buildingTypeId
this.newleftTabledata[i].unitname=result.unitname
let body={
id:this.Id,
basicCategoryId:result.basicCategoryId,
buildingTypeId:result.buildingTypeId,
planCategory:Number(result.planCategory),
data:JSON.stringify(this.newleftTabledata[this.leftclicki].data)
}
this.http.put(`/api/PlanTemplate/${this.Id}`,body).subscribe((data:any)=>{
this.snackBar.open('修改成功!','确定',config);
console.log(data)
})
}else{
let newdata={
/* let newdata={
basicCategoryId:result.basicCategoryId,
buildingTypeId:result.buildingTypeId,
data:item.data,
planCategory:result.planCategory,
unitname:result.unitname
}
this.newleftTabledata.push(newdata)
this.save()
this.newleftTabledata.push(newdata) */
let savaData={
basicCategoryId:result.basicCategoryId,
buildingTypeId:result.buildingTypeId,
planCategory:Number(result.planCategory),
data:null
}
this.http.post("/api/PlanTemplate",savaData).subscribe((data:any)=>{
this.newleftTabledata[this.newleftTabledata.length-1].id=''
this.newleftTabledata[this.newleftTabledata.length-1].id=data.id
let body={
id:data.id,
basicCategoryId:result.basicCategoryId,
buildingTypeId:result.buildingTypeId,
planCategory:Number(result.planCategory),
data:JSON.stringify(this.newleftTabledata[this.leftclicki].data)
}
this.http.put(`/api/PlanTemplate/${data.id}`,body).subscribe((data:any)=>{
this.snackBar.open('复制成功!','确定',config);
console.log(data)
})
this.getLeftdata()
})
}
}

Loading…
Cancel
Save