|
|
@ -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() |
|
|
|
|
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|