Browse Source

[修改]预案模板管理复制功能对接后端接口

tangshan
chenjingyu 4 years ago
parent
commit
e4164883cb
  1. 6
      src/app/plan-management/create-plan-online-five/create-plan-online-five.component.html
  2. 1
      src/app/plan-management/create-plan-online-five/create-plan-online-five.component.scss
  3. 43
      src/app/ui/plan-template/plan-template.component.ts

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

@ -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;
} }
} }

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