邵佳豪 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 * @Author: sueRimn
* @Date: 2021-01-11 14:48:03 * @Date: 2021-01-11 14:48:03
* @LastEditors: sueRimn * @LastEditors: sueRimn
* @LastEditTime: 2021-03-26 15:18:46 * @LastEditTime: 2021-07-29 10:26:58
*/ */
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router'; 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 {ViewUnitDetailsPlanComponent} from './key-unit/view-unit-details-plan/view-unit-details-plan.component'
import { TestComponent } from './test/test.component'; import { TestComponent } from './test/test.component';
import { ExternalLinksPlanComponent } from './external-links-plan/external-links-plan.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 = [ const routes: Routes = [
@ -42,6 +43,7 @@ const routes: Routes = [
{path:'planAudit/planpass', component: PlanPassComponent , canActivate: [AuthGuard]}, {path:'planAudit/planpass', component: PlanPassComponent , canActivate: [AuthGuard]},
{path:'test', component: TestComponent }, {path:'test', component: TestComponent },
{path:'linksPlan', component: ExternalLinksPlanComponent }, {path:'linksPlan', component: ExternalLinksPlanComponent },
{path:'CreatePlanOnlineFive',component:CreatePlanOnlineFiveComponent}
]; ];
@NgModule({ @NgModule({

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

@ -4,7 +4,7 @@
* @Author: sueRimn * @Author: sueRimn
* @Date: 2020-12-25 16:13:50 * @Date: 2020-12-25 16:13:50
* @LastEditors: sueRimn * @LastEditors: sueRimn
* @LastEditTime: 2021-07-24 14:34:24 * @LastEditTime: 2021-07-29 10:27:36
*/ */
import { Component, Inject, OnInit } from '@angular/core'; import { Component, Inject, OnInit } from '@angular/core';
import { FormControl } from '@angular/forms'; import { FormControl } from '@angular/forms';
@ -296,8 +296,10 @@ export class WaitExamineerComponent implements OnInit {
this.companyName = data.companyName this.companyName = data.companyName
if (data.planType != 2 && data.planType != 1) { if (data.planType != 2 && data.planType != 1) {
if (data.planMode == 2) { if (data.planMode == 2) {
this.showtype = 0
this.bianzhi = true 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}` //this.src=`/keyUnit/viewunitinfoplan?id=${data.companyId}&orName=${data.company.organizationId}&orId=${data.company.organizationName}`
} else { } else {
this.bianzhi = false this.bianzhi = false

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

@ -15,7 +15,7 @@
</button> </button>
</div> </div>
</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> 退出预览 <mat-icon>visibility</mat-icon> 退出预览
</button> </button>
<div class="contentbox" [ngClass]="{'noPadding': pattern == 'look'}"> <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; <th *ngFor="let itemth of element.tableth;let tablethi=index;TrackBy:trackByFn" style="border: 1px solid #999;
height: 40px; height: 40px;
font-size: 16px; font-size: 16px;
text-align: center;" > text-align: center;width: 185px;" >
{{element.tableth[tablethi]}} {{element.tableth[tablethi]}}
</th> </th>
</thead> </thead>
@ -414,7 +414,7 @@
<td *ngFor="let itemtd of itemtr.tabletd;let tabletdi=index;TrackBy:trackByFn" style="border: 1px solid #999; <td *ngFor="let itemtd of itemtr.tabletd;let tabletdi=index;TrackBy:trackByFn" style="border: 1px solid #999;
height: 40px; height: 40px;
font-size: 16px; font-size: 16px;
text-align: center;"> text-align: center;width: 185px;">
{{itemtr.tabletd[tabletdi]}} {{itemtr.tabletd[tabletdi]}}
</td> </td>
</tr> </tr>
@ -440,11 +440,11 @@
<th style="border: 1px solid #999; <th style="border: 1px solid #999;
height: 40px; height: 40px;
font-size: 16px; 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; <td style="border: 1px solid #999;
height: 40px; height: 40px;
font-size: 16px; 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> </tr>
</table> </table>
</div> </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: 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" 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> --> <!-- <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;"> <table *ngIf="pattern == 'look'" style="width: 100%;border-collapse: collapse;">
<tr> <tr>
<th style="border: 1px solid #999; <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: 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" 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> --> <!-- <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;"> <table *ngIf="pattern == 'look'" style="width: 100%;border-collapse: collapse;">
<tr> <tr>
<th style="border: 1px solid #999; <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; right: 15px;
} }
} }

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

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

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

@ -4,7 +4,7 @@
* @Author: sueRimn * @Author: sueRimn
* @Date: 2020-12-24 10:59:48 * @Date: 2020-12-24 10:59:48
* @LastEditors: sueRimn * @LastEditors: sueRimn
* @LastEditTime: 2021-07-24 16:58:31 * @LastEditTime: 2021-07-29 10:44:58
--> -->
<!-- <p>录入预案</p> --> <!-- <p>录入预案</p> -->
<div style="overflow: auto;height: 100%;"> <div style="overflow: auto;height: 100%;">
@ -86,7 +86,7 @@
<span (click)="deletePlan(element)" *ngIf="element.auditStatus==8">删除</span> <span (click)="deletePlan(element)" *ngIf="element.auditStatus==8">删除</span>
<span (click)="auditResult(element)">审批结果</span> <span (click)="auditResult(element)">审批结果</span>
<span (click)="submitAudit(element)" <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> <span (click)="cancelAudit(element)" *ngIf="element.auditStatus == 1||element.auditStatus == 16">撤销审核</span>
</td> </td>
</ng-container> </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) { lookPlan(e) {
console.log(e) console.log(e)
if (e.planType == 16 || e.planType == 4 || e.planType == 8) { 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') { if (e.attachmentUrls[0].substr(0, index) == 'psw') {
const dialogRef = this.dialog.open(PsViewer, { const dialogRef = this.dialog.open(PsViewer, {
width: '1500px', width: '1500px',
@ -123,6 +126,7 @@ export class EntryPlanLookComponent implements OnInit {
dialogRef.afterClosed().subscribe(); dialogRef.afterClosed().subscribe();
} else { } else {
let fetchUrl = e.attachmentUrls[0] let fetchUrl = e.attachmentUrls[0]
//console.log(fetchUrl)
if (fetchUrl) { if (fetchUrl) {
let suffix = fetchUrl.split('.')[fetchUrl.split('.').length - 1].toLowerCase() let suffix = fetchUrl.split('.')[fetchUrl.split('.').length - 1].toLowerCase()
if (suffix == 'docx' || suffix == 'doc') { if (suffix == 'docx' || suffix == 'doc') {
@ -137,10 +141,10 @@ export class EntryPlanLookComponent implements OnInit {
config.duration = 3000 config.duration = 3000
this.snackBar.open('该文件类型暂不支持在线查看', '确定', config); 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) { //如果是在线编辑 if (e.planType == 1) { //如果是在线编辑
let id = e.id let id = e.id
@ -179,7 +183,7 @@ export class EntryPlanLookComponent implements OnInit {
} }
else if (e.planType == 16) { else if (e.planType == 16) {
if (e.attachmentUrls == null) { 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 { else {
let body = {}; let body = {};

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

@ -4,7 +4,7 @@
* @Author: sueRimn * @Author: sueRimn
* @Date: 2021-05-31 10:40:01 * @Date: 2021-05-31 10:40:01
* @LastEditors: sueRimn * @LastEditors: sueRimn
* @LastEditTime: 2021-07-05 15:15:36 * @LastEditTime: 2021-07-28 14:37:50
*/ */
import { Component, Inject, OnInit,ViewEncapsulation } from '@angular/core'; import { Component, Inject, OnInit,ViewEncapsulation } from '@angular/core';
@ -132,6 +132,9 @@ export class PlanTemplateComponent implements OnInit {
} }
//修改模板 //修改模板
upPlan(item,i,operation){ upPlan(item,i,operation){
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
const dialogRef = this.dialog.open(upPlanname, {//调用open方法打开对话框并且携带参数过去 const dialogRef = this.dialog.open(upPlanname, {//调用open方法打开对话框并且携带参数过去
width: '340px', width: '340px',
height:'340px', height:'340px',
@ -147,16 +150,48 @@ export class PlanTemplateComponent implements OnInit {
this.newleftTabledata[i].planCategory=result.planCategory this.newleftTabledata[i].planCategory=result.planCategory
this.newleftTabledata[i].buildingTypeId=result.buildingTypeId this.newleftTabledata[i].buildingTypeId=result.buildingTypeId
this.newleftTabledata[i].unitname=result.unitname 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{ }else{
let newdata={ /* let newdata={
basicCategoryId:result.basicCategoryId, basicCategoryId:result.basicCategoryId,
buildingTypeId:result.buildingTypeId, buildingTypeId:result.buildingTypeId,
data:item.data, data:item.data,
planCategory:result.planCategory, planCategory:result.planCategory,
unitname:result.unitname unitname:result.unitname
} }
this.newleftTabledata.push(newdata) this.newleftTabledata.push(newdata) */
this.save() 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