Browse Source

[完善]修改bug

master
邵佳豪 3 years ago
parent
commit
b75735564c
  1. 2
      src/app/examiner/create-test-score/create-test-score.component.html
  2. 47
      src/app/examiner/create-test-score/create-test-score.component.ts
  3. 8
      src/app/examiner/examiner-index/examiner-index.component.ts

2
src/app/examiner/create-test-score/create-test-score.component.html

@ -267,7 +267,7 @@
<div class="addPlan" (click)="addPlan()" *ngIf="!(pattern=='look')"> <div class="addPlan" (click)="addPlan()" *ngIf="!(pattern=='look')">
<mat-icon style="vertical-align: text-top">add_circle_outline</mat-icon>添加预案 <mat-icon style="vertical-align: text-top">add_circle_outline</mat-icon>添加预案
</div> </div>
<div class="planList" *ngIf="unitId[selectedUnitIndex]"> <div class="planList" *ngIf="unitId && unitId[selectedUnitIndex]">
<table> <table>
<tr > <tr >
<td>预案名称</td> <td>预案名称</td>

47
src/app/examiner/create-test-score/create-test-score.component.ts

@ -29,13 +29,11 @@ export class CreateTestScoreComponent implements OnInit {
} }
pattern: any = this.route.snapshot.queryParams.pattern || '' pattern: any = this.route.snapshot.queryParams.pattern || ''
ngOnInit(): void { ngOnInit(): void {
if (this.route.snapshot.queryParams.status == 0) {
//已创建完成未开考
if(this.route.snapshot.queryParams.pattern){
this.getSoloPaper() this.getSoloPaper()
} else { } else {
console.log('this.unitId',this.unitId)
this.unitId = JSON.parse(sessionStorage.getItem(sessionStorage.getItem('paperId'))) this.unitId = JSON.parse(sessionStorage.getItem(sessionStorage.getItem('paperId')))
for (let y = 0, length = this.unitId.length; y < length; y++) { for (let y = 0, length = this.unitId.length; y < length; y++) {
let element = this.unitId[y] let element = this.unitId[y]
@ -70,6 +68,11 @@ export class CreateTestScoreComponent implements OnInit {
this.planItemScore() this.planItemScore()
}) })
} }
if (this.route.snapshot.queryParams.pattern) {
} else {
}
} }
@ -80,11 +83,15 @@ export class CreateTestScoreComponent implements OnInit {
this.http.get(`/api/Papers/${sessionStorage.getItem('paperId')}`).subscribe((data: any) => { this.http.get(`/api/Papers/${sessionStorage.getItem('paperId')}`).subscribe((data: any) => {
this.editdata = data this.editdata = data
console.log('试卷信息', this.editdata) console.log('试卷信息', this.editdata)
if (data.paperDataInfo) {
data.paperDataInfo.forEach(item => { data.paperDataInfo.forEach(item => {
this.unitId.push(JSON.parse(item.originalData)) this.unitId.push(JSON.parse(item.originalData))
}) })
// console.log('试卷信息',this.unitId) // console.log('试卷信息',this.unitId)
this.planItemScore() this.planItemScore()
} else {
}
}) })
} }
@ -95,10 +102,12 @@ export class CreateTestScoreComponent implements OnInit {
for (let y = 0, length = this.unitId.length; y < length; y++) { for (let y = 0, length = this.unitId.length; y < length; y++) {
let element = this.unitId[y] let element = this.unitId[y]
await new Promise((resolve, reject) => { await new Promise((resolve, reject) => {
this.http.get('/api/PaperPlans',{params:{ this.http.get('/api/PaperPlans', {
params: {
paperId: sessionStorage.getItem('paperId'), paperId: sessionStorage.getItem('paperId'),
companyId: element.id companyId: element.id
}}).subscribe(data => { }
}).subscribe(data => {
console.log('当前试卷的预案列表', data) console.log('当前试卷的预案列表', data)
element.planList = data element.planList = data
resolve(1) resolve(1)
@ -553,9 +562,11 @@ export class CreateTestScoreComponent implements OnInit {
}) })
//获取各建筑消防设施 //获取各建筑消防设施
this.http.get('/api/Buildings',{params:{ this.http.get('/api/Buildings', {
params: {
companyId: companyId companyId: companyId
}}).subscribe((data:any)=>{ }
}).subscribe((data: any) => {
if (data.length != 0) { getAllBuildingFireFac(data) } if (data.length != 0) { getAllBuildingFireFac(data) }
}) })
@ -1267,9 +1278,11 @@ export class CreateTestScoreComponent implements OnInit {
for (let i = 0; i < element.planList.length; i++) { for (let i = 0; i < element.planList.length; i++) {
await new Promise((resolve, reject) => { await new Promise((resolve, reject) => {
const item = element.planList[i]; const item = element.planList[i];
_this.http.put(`/api/PaperPlans/ModifyScore/${item.id}`,'',{params:{ _this.http.put(`/api/PaperPlans/ModifyScore/${item.id}`, '', {
params: {
score: item.score score: item.score
}}).subscribe(((data) => { }
}).subscribe(((data) => {
resolve(i) resolve(i)
console.log('修改分数成功' + i, item.score) console.log('修改分数成功' + i, item.score)
})) }))
@ -1379,9 +1392,11 @@ export class AddPlanTwoDialog {
//获取当前公司的二维预案 //获取当前公司的二维预案
get2DPlan() { get2DPlan() {
let planArr = [] let planArr = []
this.http.get('/api/PlanComponents',{params:{ this.http.get('/api/PlanComponents', {
params: {
companyId: this.data.companyData.companyData.id companyId: this.data.companyData.companyData.id
}}).subscribe((data:any) => { }
}).subscribe((data: any) => {
data.items.forEach(item => { data.items.forEach(item => {
//二维预案并且审核通过 //二维预案并且审核通过
(item.planType == 1 && item.auditStatus == 2) ? planArr.push(item) : null (item.planType == 1 && item.auditStatus == 2) ? planArr.push(item) : null
@ -1458,9 +1473,11 @@ export class AddPlanTwoDialog {
url: null, url: null,
attachmentUrls: null attachmentUrls: null
} }
this.http.post("/api/ExamPlanComponents2D",body,{params:{ this.http.post("/api/ExamPlanComponents2D", body, {
params: {
companyId: this.data.companyData.companyData.id companyId: this.data.companyData.companyData.id
}}).subscribe((data:any)=>{ }
}).subscribe((data: any) => {
console.log("创建自定义二维成功") console.log("创建自定义二维成功")
let paperPlansBody = { let paperPlansBody = {

8
src/app/examiner/examiner-index/examiner-index.component.ts

@ -139,17 +139,13 @@ export class ExaminerIndexComponent implements OnInit {
this.snackBar.open('开考中,不能编辑','确定',config); this.snackBar.open('开考中,不能编辑','确定',config);
} }
else{ else{
/* const dialogRef = this.dialog.open(editorsDia, {
width: '650px',
data: item
}); */
sessionStorage.setItem("paperId",item.id) sessionStorage.setItem("paperId",item.id)
this.router.navigateByUrl("/examiner/create-test-score?pattern=edit") this.router.navigateByUrl(`/examiner/create-test-score?pattern=edit&status=${item.status}`)
} }
} }
lookPaper(item){ lookPaper(item){
sessionStorage.setItem("paperId",item.id) sessionStorage.setItem("paperId",item.id)
this.router.navigateByUrl("/examiner/create-test-score?pattern=look") this.router.navigateByUrl(`/examiner/create-test-score?pattern=look&status=${item.status}`)
} }
//获得所有组织机构 //获得所有组织机构
getOrganizations(){ getOrganizations(){

Loading…
Cancel
Save