Browse Source

[完善]完善在线编制预案绑定值错误

master
邵佳豪 1 year ago
parent
commit
c5bdcd5fa7
  1. 2
      proxy.config.json
  2. 7
      src/app/plan-management/create-plan-online-five/create-plan-online-five.component.html
  3. 60
      src/app/plan-management/create-plan-online-five/create-plan-online-five.component.ts

2
proxy.config.json

@ -1,6 +1,6 @@
{ {
"/api": { "/api": {
"target": "http://121.36.37.70:8201/", "target": "http://10.81.73.39:8000/",
"生产": "http://10.81.73.39:8000/", "生产": "http://10.81.73.39:8000/",
"测试": "http://121.36.37.70:8201/", "测试": "http://121.36.37.70:8201/",
"生产2": "http://183.194.244.232:8088/", "生产2": "http://183.194.244.232:8088/",

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

@ -758,7 +758,7 @@
[readonly]='info.zdy==undefined'> [readonly]='info.zdy==undefined'>
<input type="text" placeholder="请输入内容" <input type="text" placeholder="请输入内容"
style="width: 40%;background-color: #FFFFFF;" style="width: 40%;background-color: #FFFFFF;"
[(ngModel)]="info.propertyValue" *ngIf="pattern == 'edit'"> [(ngModel)]="info.value" *ngIf="pattern == 'edit'">
<input type="text" <input type="text"
style="width: 27%;background-color: #FFFFFF;color: #999;" style="width: 27%;background-color: #FFFFFF;color: #999;"
*ngIf="pattern == 'edit'&&oldData" *ngIf="pattern == 'edit'&&oldData"
@ -786,7 +786,7 @@
width: 70%; width: 70%;
font-size: 16px; font-size: 16px;
text-align: center;" *ngIf="info.completed"> text-align: center;" *ngIf="info.completed">
<span>{{info.propertyValue}}</span> <span>{{info.value}}</span>
</td> </td>
</tr> </tr>
</table> </table>
@ -1054,7 +1054,8 @@
line-height: 40px; line-height: 40px;
color: #b99a00;">{{element.headName}}</span> color: #b99a00;">{{element.headName}}</span>
<img src="../../../assets/images/delyello.png" <img src="../../../assets/images/delyello.png"
*ngIf="pattern == 'edit'" (click)='delTd2(key,i,uniti,elei)'> *ngIf="pattern == 'edit'"
(click)='delTd2(key,i,uniti,elei)'>
<img src="../../../assets/images/updateyello.png" <img src="../../../assets/images/updateyello.png"
*ngIf="(element.level==1||element.level==2)&&pattern == 'edit'" *ngIf="(element.level==1||element.level==2)&&pattern == 'edit'"
(click)='updataHl(key,uniti,elei,i)'> (click)='updataHl(key,uniti,elei,i)'>

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

@ -94,7 +94,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
planMode; //预案类型 planMode; //预案类型
xiazai; //是否点击下载按钮进来的 xiazai; //是否点击下载按钮进来的
//index //index
orName orName;
async ngOnInit() { async ngOnInit() {
//this.index = this.getArrayIndex(this.planTemplateData,'单位概况') //this.index = this.getArrayIndex(this.planTemplateData,'单位概况')
this.xiazai = this.route.snapshot.queryParams.xiazai; this.xiazai = this.route.snapshot.queryParams.xiazai;
@ -412,26 +412,33 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
if (element.body[0].completed) { if (element.body[0].completed) {
element.body[0].attinf.forEach((arrval, atti, attarr) => { element.body[0].attinf.forEach((arrval, atti, attarr) => {
if (arrval.propertyName == "统一社会信用代码") { if (arrval.propertyName == "统一社会信用代码") {
arrval.value = arrval.olddata = this.unitData.usci; arrval.value
? null
: (arrval.value = arrval.olddata = this.unitData.usci);
} else if (arrval.propertyName == "单位类型") { } else if (arrval.propertyName == "单位类型") {
arrval.value = arrval.olddata = arrval.value
this.unitData.buildingTypes[0].name; ? null
: (arrval.value = arrval.olddata =
this.unitData.buildingTypes[0].name);
} else if (arrval.propertyName == "联系人") { } else if (arrval.propertyName == "联系人") {
arrval.value = arrval.olddata = this.unitData.contacts; arrval.value
? null
: (arrval.value = arrval.olddata = this.unitData.contacts);
} else if (arrval.propertyName == "联系电话") { } else if (arrval.propertyName == "联系电话") {
arrval.value = arrval.olddata = this.unitData.phone; arrval.value
? null
: (arrval.value = arrval.olddata = this.unitData.phone);
} else if (arrval.propertyName == "辖区中队") { } else if (arrval.propertyName == "辖区中队") {
arrval.value = arrval.olddata = this.unitData.organizationName; arrval.value
? null
: (arrval.value = arrval.olddata =
this.unitData.organizationName);
} else if (arrval.propertyName == "单位地址") { } else if (arrval.propertyName == "单位地址") {
arrval.value = arrval.olddata = this.unitData.address; arrval.value
? null
: (arrval.value = arrval.olddata = this.unitData.address);
} }
}); });
/* element.body[0].attinf[0].value = element.body[0].attinf[0].olddata = this.unitData.usci
element.body[0].attinf[1].value = element.body[0].attinf[1].olddata = this.unitData.buildingTypes[0].name
element.body[0].attinf[2].value = element.body[0].attinf[2].olddata = this.unitData.contacts
element.body[0].attinf[3].value = element.body[0].attinf[3].olddata = this.unitData.phone
element.body[0].attinf[4].value = element.body[0].attinf[4].olddata = this.unitData.organizationName
element.body[0].attinf[5].value = element.body[0].attinf[5].olddata = this.unitData.address */
if (element.body.length > 1 && element.body[1].attinf != undefined) { if (element.body.length > 1 && element.body[1].attinf != undefined) {
element.body[1].attinf.forEach((eBuild) => { element.body[1].attinf.forEach((eBuild) => {
@ -737,9 +744,9 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
this.planTemplateData = JSON.parse(data.webTextData).filter( this.planTemplateData = JSON.parse(data.webTextData).filter(
(item) => item.completed == true (item) => item.completed == true
); );
//this.planTemplateData=JSON.parse(data.webTextData)
console.log(888, this.route.snapshot.queryParams.planName); console.log(7891, this.planTemplateData);
console.log(999, this.planTemplateData); // return
if (this.planTemplateData[0].groupName != "封面") { if (this.planTemplateData[0].groupName != "封面") {
let obj = { let obj = {
completed: true, completed: true,
@ -798,6 +805,25 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
} }
} }
if (element.groupName == "单位概况") { if (element.groupName == "单位概况") {
element.building.forEach((item) => {
item.body.forEach((i) => {
if (i.surveyName === "单位基本信息") {
i.attinf.forEach((v) => {
if (v.completed) {
!v.value ? (v.value = v.propertyValue) : null;
}
});
}
if (i.surveyName === "建筑信息") {
i.attinf.forEach((v) => {
if (v.completed) {
v.propertyValue ? (v.value = v.propertyValue) : null;
}
});
}
});
});
this.clickTitleItem(this.planTemplateData[1]); this.clickTitleItem(this.planTemplateData[1]);
} }
}); });

Loading…
Cancel
Save