From 8b4e2bc60132080f2cc8c6aa17d332b97627400c Mon Sep 17 00:00:00 2001 From: SHAOJIAHAO <55341701@qq.com> Date: Thu, 17 Dec 2020 11:37:46 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=AE=8C=E5=96=84]=E5=AE=8C=E5=96=84=E4=BF=9D?= =?UTF-8?q?=E5=AD=98=E6=8F=90=E9=86=92=EF=BC=8C=E5=AE=8C=E5=96=84=E5=82=A8?= =?UTF-8?q?=E7=BD=90=E5=90=8D=E7=A7=B0=EF=BC=8C=E5=AE=8C=E5=96=84=E5=8B=BE?= =?UTF-8?q?=E9=80=89=E6=95=B0=E9=87=8F=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../create-test-score/addPlanTwo.html | 5 +- .../create-test-score.component.html | 8 +- .../create-test-score.component.ts | 589 ++++++++++-------- .../create-test-score/lookTreeNode.html | 2 +- 4 files changed, 339 insertions(+), 265 deletions(-) diff --git a/src/app/examiner/create-test-score/addPlanTwo.html b/src/app/examiner/create-test-score/addPlanTwo.html index 63fdd29..e509b01 100644 --- a/src/app/examiner/create-test-score/addPlanTwo.html +++ b/src/app/examiner/create-test-score/addPlanTwo.html @@ -3,7 +3,7 @@
添加预案
-
+
@@ -47,6 +47,9 @@
+
+ 该单位暂无审核通过的二维预案 +
diff --git a/src/app/examiner/create-test-score/create-test-score.component.html b/src/app/examiner/create-test-score/create-test-score.component.html index 4a5b95b..a87ec3d 100644 --- a/src/app/examiner/create-test-score/create-test-score.component.html +++ b/src/app/examiner/create-test-score/create-test-score.component.html @@ -49,12 +49,14 @@ 基本信息 - 总分值: 分, 单项 {{unit.basicInfoItemScore ? unit.basicInfoItemScore : 0}} 分 + + (已选择 {{unit.basicInfoSelectedNum}} 项) @@ -97,6 +99,7 @@ 单项 {{unit.aroundItemScore ? unit.aroundItemScore : 0}} 分 + (已选择 {{unit.aroundSelectedNum}} 项) @@ -139,6 +142,7 @@ 单项 {{unit.keySiteItemScore ? unit.keySiteItemScore : 0}} 分 + (已选择 {{unit.keySiteSelectedNum}} 项) @@ -181,6 +185,7 @@ 单项 {{unit.funDivItemScore ? unit.funDivItemScore : 0}} 分 + (已选择 {{unit.funDivSelectedNum}} 项) @@ -223,6 +228,7 @@ 单项 {{unit.fireFacItemScore ? unit.fireFacItemScore : 0}} 分 + (已选择 {{unit.fireFacSelectedNum}} 项) diff --git a/src/app/examiner/create-test-score/create-test-score.component.ts b/src/app/examiner/create-test-score/create-test-score.component.ts index 0b073ba..a9ef808 100644 --- a/src/app/examiner/create-test-score/create-test-score.component.ts +++ b/src/app/examiner/create-test-score/create-test-score.component.ts @@ -127,6 +127,7 @@ export class CreateTestScoreComponent implements OnInit { buildingsData.name = data[i].name buildingsData.buildingType = data[i].buildingTypes[0].name buildingsData[0].buildingBasicGroups.forEach((y,m) => { + let propertyInfosArr = [] let tabledata if(y.type == 1){//如果是表格类 @@ -158,14 +159,38 @@ export class CreateTestScoreComponent implements OnInit { }) y.tabledata = dest tabledata = dest - y.tabledata[0].data.forEach((x,key) => { - if(x.propertyValue){ - x.key = (Math.random()*10000000).toString(16).substr(0,4)+(new Date()).getTime()+Math.random().toString().substr(2,5) - x.isLeaf = true - x.name = x.propertyValue - propertyInfosArr.push(x) + if(y.tabledata[0].propertyName == '罐区'){ + + if(y.tabledata[1].propertyName != '储罐编号'){ + let index + y.tabledata.forEach((element,key) => { + if(element.propertyName == '储罐编号'){ + index = key + } + }) + y.tabledata[1] = y.tabledata.splice(index, 1, y.tabledata[1])[0]; } - }) + + y.tabledata[0].data.forEach((x,key) => { + + if(x.propertyValue){ + x.key = (Math.random()*10000000).toString(16).substr(0,4)+(new Date()).getTime()+Math.random().toString().substr(2,5) + x.isLeaf = true + x.name = x.propertyValue + '-' + y.tabledata[1].data[key].propertyValue + propertyInfosArr.push(x) + } + }) + }else{ + y.tabledata[0].data.forEach((x,key) => { + if(x.propertyValue){ + x.key = (Math.random()*10000000).toString(16).substr(0,4)+(new Date()).getTime()+Math.random().toString().substr(2,5) + x.isLeaf = true + x.name = x.propertyValue + propertyInfosArr.push(x) + } + }) + } + }else{ y.propertyInfos.forEach((x,key) => { if(x.propertyValue){ @@ -581,6 +606,7 @@ export class CreateTestScoreComponent implements OnInit { }else{ this.unitId[key].basicInfoItemScore = 0 } + this.unitId[key].basicInfoSelectedNum = selectedNum.length } if(event.node.origin.type == '四周毗邻' || (event.node.parentNode && event.node.parentNode.origin.type == '四周毗邻')){ let selectedNum = [] @@ -594,6 +620,7 @@ export class CreateTestScoreComponent implements OnInit { }else{ this.unitId[key].aroundItemScore = 0 } + this.unitId[key].aroundSelectedNum = selectedNum.length } if(event.node.origin.type == '重点部位' || (event.node.parentNode && event.node.parentNode.origin.type == '重点部位')){ let selectedNum = [] @@ -607,6 +634,7 @@ export class CreateTestScoreComponent implements OnInit { }else{ this.unitId[key].keySiteItemScore = 0 } + this.unitId[key].keySiteSelectedNum = selectedNum.length } if(event.node.origin.type == '功能分区' || (event.node.parentNode && event.node.parentNode.origin.type == '功能分区')){ let selectedNum = [] @@ -620,6 +648,7 @@ export class CreateTestScoreComponent implements OnInit { }else{ this.unitId[key].funDivItemScore = 0 } + this.unitId[key].funDivSelectedNum = selectedNum.length } if(event.node.origin.type == '消防设施' || (event.node.parentNode && event.node.parentNode.origin.type == '消防设施')){ let selectedNum = [] @@ -633,6 +662,7 @@ export class CreateTestScoreComponent implements OnInit { }else{ this.unitId[key].fireFacItemScore = 0 } + this.unitId[key].fireFacSelectedNum = selectedNum.length } } @@ -730,6 +760,7 @@ export class CreateTestScoreComponent implements OnInit { } }); } + //每条预案分数增加在试卷分数 planItemScore(item){ //计算整个试卷的总分 @@ -750,6 +781,7 @@ export class CreateTestScoreComponent implements OnInit { }) this.examScore = examScore + examScore2 } + //编辑每条预案试卷 edit(item){ const config = new MatSnackBarConfig(); @@ -757,6 +789,7 @@ export class CreateTestScoreComponent implements OnInit { config.duration = 3000 this.snackBar.open('暂不能编辑','确定',config); } + //删除每条预案试卷 deletePlan(item){ this.unitId[this.selectedUnitIndex].planList.forEach((element,key)=>{ @@ -771,271 +804,268 @@ export class CreateTestScoreComponent implements OnInit { } //保存 save(){ - let copyDatas = JSON.parse(JSON.stringify(this.unitId)) - - //循环每个建筑处理数据筛选出选中数据 - copyDatas.forEach(item => { - //建筑的基本信息模块处理 - item.basicInfoNodes.forEach((i,key) => { - //如果顶级节点未选中则需要筛除没有选中的数据 - if(!i.checked){ - // console.log(i) - let newArr = [] - i.children.forEach(element => { - element.checked ? newArr.push(element) : null - }) - let discard = []//即将废弃的数组 - // newArr.length == 0 ? item.basicInfoNodes.splice(key,1) : i.children = newArr - newArr.length == 0 ? discard.push(i) : i.children = newArr - item.basicInfoNodes = item.basicInfoNodes.filter(items => { - if (!discard.includes(items)) return items; - }) - } - //将children处理成指定形式 - if(i.name =='单位信息'){ - let newChildren = [] - i.children.forEach((element,index) => { - let newChildrenItem:any= {} - newChildrenItem.name = element.name//题目名称 - newChildrenItem.result = element.value//题目答案 - newChildrenItem.physicalUnit = element.physicalUnit || ''//计量单位 - newChildrenItem.propertyType = 0//输入框类型 - newChildren.push(newChildrenItem) - }) - i.children = newChildren - }else if(!i.tabledata){ - let newChildren = [] - i.children.forEach((element,index) => { - let newChildrenItem:any= {} - newChildrenItem.name = element.propertyName//题目名称 - newChildrenItem.result = element.propertyValue//题目答案 - newChildrenItem.physicalUnit = element.physicalUnit || ''//计量单位 - newChildrenItem.propertyType = element.propertyType//输入框类型 - newChildren.push(newChildrenItem) - }) - i.children = newChildren - }else if(i.tabledata){//如果是表格类 - let newChildren = [] - i.children.forEach((element,index) => { - let newChildrenItem:any= {} - newChildrenItem.name = element.propertyValue//题目名称 - newChildrenItem.result = element.tag//代表第几行 - newChildrenItem.physicalUnit = ''//计量单位 - newChildrenItem.propertyType = ''//输入框类型 - newChildren.push(newChildrenItem) - }) - i.children = newChildren - i.tabledata.forEach(element => { - let newData = [] - element.data.forEach(ele => { - let newObj:any = {} - newObj.name = ele.propertyName//题目名称 - newObj.result = ele.propertyValue//代表第几行 - newObj.physicalUnit = ele.physicalUnit//计量单位 - newObj.propertyType = ele.propertyType//输入框类型 - newObj.tag = ele.tag//第几行 - newData.push(newObj) - }) - element.data = newData - }) - } - delete i.selected - - }) - //建筑的四周毗邻模块处理 - item.aroundNodes.forEach((i,key) => { - //如果顶级节点未选中则需要筛除没有选中的数据 - if(!i.checked){ - let newArr = [] - i.children.forEach(element => { - element.checked ? newArr.push(element) : null - }) - let discard = []//即将废弃的数组 - newArr.length == 0 ? discard.push(i) : i.children = newArr - item.aroundNodes = item.aroundNodes.filter(items => { - if (!discard.includes(items)) return items; - }) - } - let newChildren = [] - i.children.forEach((element,index) => { - let newChildrenItem:any= {} - newChildrenItem.name = element.title//题目名称 - newChildrenItem.result = element.name//题目答案 - newChildrenItem.physicalUnit = ''//计量单位 - newChildrenItem.propertyType = 0//输入框类型 - newChildren.push(newChildrenItem) - }) - i.children = newChildren - delete i.selected - }) - console.log(111,item) - //建筑的重点部位模块处理 - item.keySiteNodes ? item.keySiteNodes.forEach((i,key) => { - i.selected ? i.selected = null : null - //如果顶级节点未选中则需要筛除没有选中的数据 - if(!i.checked){ - let newArr = [] - i.children.forEach(element => { - element.checked ? newArr.push(element) : null - }) - let discard = []//即将废弃的数组 - newArr.length == 0 ? discard.push(i) : i.children = newArr - item.keySiteNodes = item.keySiteNodes.filter(items => { - if (!discard.includes(items)) return items; - }) - } - i.tabledata = [{propertyName: "重点部位名称",data:[]}, - {propertyName: "重点部位所在位置",data:[]}, - {propertyName: "建筑结构",data:[]}, - {propertyName: "使用性质",data:[]}, - {propertyName: "主要危险性",data:[]}] + let copyDatas = JSON.parse(JSON.stringify(this.unitId)) + //循环每个建筑处理数据筛选出选中数据 + copyDatas.forEach(item => { + //建筑的基本信息模块处理 + item.basicInfoNodes.forEach((i,key) => { + //如果顶级节点未选中则需要筛除没有选中的数据 + if(!i.checked){ + // console.log(i) + let newArr = [] i.children.forEach(element => { - i.tabledata[0].data.push({ - name: "重点部位名称", - physicalUnit: '', - propertyType: 0, - result: element.name, - tag: "" - }) - i.tabledata[1].data.push({ - name: "重点部位所在位置", - physicalUnit: '', - propertyType: 0, - result: element.position, - tag: "" - }) - i.tabledata[2].data.push({ - name: "建筑结构", - physicalUnit: '', - propertyType: 0, - result: element.structure, - tag: "" - }) - i.tabledata[3].data.push({ - name: "使用性质", - physicalUnit: '', - propertyType: 0, - result: element.nature, - tag: "" - }) - i.tabledata[4].data.push({ - name: "主要危险性", - physicalUnit: '', - propertyType: 0, - result: element.hazards, - tag: "" - }) + element.checked ? newArr.push(element) : null + }) + let discard = []//即将废弃的数组 + // newArr.length == 0 ? item.basicInfoNodes.splice(key,1) : i.children = newArr + newArr.length == 0 ? discard.push(i) : i.children = newArr + item.basicInfoNodes = item.basicInfoNodes.filter(items => { + if (!discard.includes(items)) return items; }) + } + //将children处理成指定形式 + if(i.name =='单位信息'){ let newChildren = [] i.children.forEach((element,index) => { let newChildrenItem:any= {} - // newChildrenItem.name = element.name//重点部位题目名称 - // newChildrenItem.position = element.position//重点部位所在位置 - // newChildrenItem.structure = element.structure//重点部位建筑结构 - // newChildrenItem.nature = element.nature//重点部位使用性质 - // newChildrenItem.hazards = element.hazards//重点部位主要危险性 newChildrenItem.name = element.name//题目名称 - newChildrenItem.result = element.position + element.structure + element.nature + element.hazards//题目答案 + newChildrenItem.result = element.value//题目答案 newChildrenItem.physicalUnit = element.physicalUnit || ''//计量单位 newChildrenItem.propertyType = 0//输入框类型 newChildren.push(newChildrenItem) }) i.children = newChildren - delete i.selected - - - }) : null - //建筑的功能分区模块处理 - item.funDivNodes ? item.funDivNodes.forEach((i,key) => { - - //如果顶级节点未选中则需要筛除没有选中的数据 - if(!i.checked){ - let newArr = [] - i.children.forEach(element => { - element.checked ? newArr.push(element) : null - }) - let discard = []//即将废弃的数组 - newArr.length == 0 ? discard.push(i) : i.children = newArr - item.funDivNodes = item.funDivNodes.filter(items => { - if (!discard.includes(items)) return items; - }) - } - - i.tabledata = [{propertyName: "区域",data:[]}, - {propertyName: "面积",data:[]}, - {propertyName: "基本情况",data:[]}] - i.children.forEach(element => { - i.tabledata[0].data.push({ - name: "区域", - physicalUnit: '', - propertyType: 0, - result: element.region, - tag: "" - }) - i.tabledata[1].data.push({ - name: "面积", - physicalUnit: '', - propertyType: 0, - result: element.area, - tag: "" - }) - i.tabledata[2].data.push({ - name: "基本情况", - physicalUnit: '', - propertyType: 0, - result: element.details, - tag: "" - }) - }) + }else if(!i.tabledata){ let newChildren = [] i.children.forEach((element,index) => { let newChildrenItem:any= {} - // newChildrenItem.name = element.region//功能分区题目名称 - // newChildrenItem.area = element.area//功能分区面积 - // newChildrenItem.details = element.details//功能分区基本情况 - newChildrenItem.name = element.region//题目名称 - newChildrenItem.result = element.area + element.details//题目答案 + newChildrenItem.name = element.propertyName//题目名称 + newChildrenItem.result = element.propertyValue//题目答案 newChildrenItem.physicalUnit = element.physicalUnit || ''//计量单位 - newChildrenItem.propertyType = 0//输入框类型 + newChildrenItem.propertyType = element.propertyType//输入框类型 newChildren.push(newChildrenItem) }) i.children = newChildren - delete i.selected - }) : null - //建筑的数据核验模块处理 - item.fireFacNodes ? item.fireFacNodes.forEach((i,key) => { - i.selected ? i.selected = null : null - //如果顶级节点未选中则需要筛除没有选中的数据 - if(!i.checked){ - let newArr = [] - i.children.forEach(element => { - element.checked ? newArr.push(element) : null - }) - let discard = []//即将废弃的数组 - newArr.length == 0 ? discard.push(i) : i.children = newArr - item.fireFacNodes = item.fireFacNodes.filter(items => { - if (!discard.includes(items)) return items; - }) - } + }else if(i.tabledata){//如果是表格类 let newChildren = [] i.children.forEach((element,index) => { let newChildrenItem:any= {} - newChildrenItem.name = element.name//题目名称 - newChildrenItem.result = element.total//题目答案 + newChildrenItem.name = element.propertyValue//题目名称 + newChildrenItem.result = element.tag//代表第几行 newChildrenItem.physicalUnit = ''//计量单位 - newChildrenItem.propertyType = 0//输入框类型 + newChildrenItem.propertyType = ''//输入框类型 newChildren.push(newChildrenItem) }) i.children = newChildren - delete i.selected - }) : null - }) + i.tabledata.forEach(element => { + let newData = [] + element.data.forEach(ele => { + let newObj:any = {} + newObj.name = ele.propertyName//题目名称 + newObj.result = ele.propertyValue//代表第几行 + newObj.physicalUnit = ele.physicalUnit//计量单位 + newObj.propertyType = ele.propertyType//输入框类型 + newObj.tag = ele.tag//第几行 + newData.push(newObj) + }) + element.data = newData + }) + } + delete i.selected - //循环每个建筑处理数据 - console.log(copyDatas) - - let paperDataInfo = [] - copyDatas.forEach((item,key) =>{ + }) + //建筑的四周毗邻模块处理 + item.aroundNodes.forEach((i,key) => { + //如果顶级节点未选中则需要筛除没有选中的数据 + if(!i.checked){ + let newArr = [] + i.children.forEach(element => { + element.checked ? newArr.push(element) : null + }) + let discard = []//即将废弃的数组 + newArr.length == 0 ? discard.push(i) : i.children = newArr + item.aroundNodes = item.aroundNodes.filter(items => { + if (!discard.includes(items)) return items; + }) + } + let newChildren = [] + i.children.forEach((element,index) => { + let newChildrenItem:any= {} + newChildrenItem.name = element.title//题目名称 + newChildrenItem.result = element.name//题目答案 + newChildrenItem.physicalUnit = ''//计量单位 + newChildrenItem.propertyType = 0//输入框类型 + newChildren.push(newChildrenItem) + }) + i.children = newChildren + delete i.selected + }) + console.log(111,item) + //建筑的重点部位模块处理 + item.keySiteNodes ? item.keySiteNodes.forEach((i,key) => { + i.selected ? i.selected = null : null + //如果顶级节点未选中则需要筛除没有选中的数据 + if(!i.checked){ + let newArr = [] + i.children.forEach(element => { + element.checked ? newArr.push(element) : null + }) + let discard = []//即将废弃的数组 + newArr.length == 0 ? discard.push(i) : i.children = newArr + item.keySiteNodes = item.keySiteNodes.filter(items => { + if (!discard.includes(items)) return items; + }) + } + i.tabledata = [{propertyName: "重点部位名称",data:[]}, + {propertyName: "重点部位所在位置",data:[]}, + {propertyName: "建筑结构",data:[]}, + {propertyName: "使用性质",data:[]}, + {propertyName: "主要危险性",data:[]}] + i.children.forEach(element => { + i.tabledata[0].data.push({ + name: "重点部位名称", + physicalUnit: '', + propertyType: 0, + result: element.name, + tag: "" + }) + i.tabledata[1].data.push({ + name: "重点部位所在位置", + physicalUnit: '', + propertyType: 0, + result: element.position, + tag: "" + }) + i.tabledata[2].data.push({ + name: "建筑结构", + physicalUnit: '', + propertyType: 0, + result: element.structure, + tag: "" + }) + i.tabledata[3].data.push({ + name: "使用性质", + physicalUnit: '', + propertyType: 0, + result: element.nature, + tag: "" + }) + i.tabledata[4].data.push({ + name: "主要危险性", + physicalUnit: '', + propertyType: 0, + result: element.hazards, + tag: "" + }) + }) + let newChildren = [] + i.children.forEach((element,index) => { + let newChildrenItem:any= {} + // newChildrenItem.name = element.name//重点部位题目名称 + // newChildrenItem.position = element.position//重点部位所在位置 + // newChildrenItem.structure = element.structure//重点部位建筑结构 + // newChildrenItem.nature = element.nature//重点部位使用性质 + // newChildrenItem.hazards = element.hazards//重点部位主要危险性 + newChildrenItem.name = element.name//题目名称 + newChildrenItem.result = element.position + element.structure + element.nature + element.hazards//题目答案 + newChildrenItem.physicalUnit = element.physicalUnit || ''//计量单位 + newChildrenItem.propertyType = 0//输入框类型 + newChildren.push(newChildrenItem) + }) + i.children = newChildren + delete i.selected + + + }) : null + //建筑的功能分区模块处理 + item.funDivNodes ? item.funDivNodes.forEach((i,key) => { + + //如果顶级节点未选中则需要筛除没有选中的数据 + if(!i.checked){ + let newArr = [] + i.children.forEach(element => { + element.checked ? newArr.push(element) : null + }) + let discard = []//即将废弃的数组 + newArr.length == 0 ? discard.push(i) : i.children = newArr + item.funDivNodes = item.funDivNodes.filter(items => { + if (!discard.includes(items)) return items; + }) + } + + i.tabledata = [{propertyName: "区域",data:[]}, + {propertyName: "面积",data:[]}, + {propertyName: "基本情况",data:[]}] + i.children.forEach(element => { + i.tabledata[0].data.push({ + name: "区域", + physicalUnit: '', + propertyType: 0, + result: element.region, + tag: "" + }) + i.tabledata[1].data.push({ + name: "面积", + physicalUnit: '', + propertyType: 0, + result: element.area, + tag: "" + }) + i.tabledata[2].data.push({ + name: "基本情况", + physicalUnit: '', + propertyType: 0, + result: element.details, + tag: "" + }) + }) + let newChildren = [] + i.children.forEach((element,index) => { + let newChildrenItem:any= {} + // newChildrenItem.name = element.region//功能分区题目名称 + // newChildrenItem.area = element.area//功能分区面积 + // newChildrenItem.details = element.details//功能分区基本情况 + newChildrenItem.name = element.region//题目名称 + newChildrenItem.result = element.area + element.details//题目答案 + newChildrenItem.physicalUnit = element.physicalUnit || ''//计量单位 + newChildrenItem.propertyType = 0//输入框类型 + newChildren.push(newChildrenItem) + }) + i.children = newChildren + delete i.selected + }) : null + //建筑的数据核验模块处理 + item.fireFacNodes ? item.fireFacNodes.forEach((i,key) => { + i.selected ? i.selected = null : null + //如果顶级节点未选中则需要筛除没有选中的数据 + if(!i.checked){ + let newArr = [] + i.children.forEach(element => { + element.checked ? newArr.push(element) : null + }) + let discard = []//即将废弃的数组 + newArr.length == 0 ? discard.push(i) : i.children = newArr + item.fireFacNodes = item.fireFacNodes.filter(items => { + if (!discard.includes(items)) return items; + }) + } + let newChildren = [] + i.children.forEach((element,index) => { + let newChildrenItem:any= {} + newChildrenItem.name = element.name//题目名称 + newChildrenItem.result = element.total//题目答案 + newChildrenItem.physicalUnit = ''//计量单位 + newChildrenItem.propertyType = 0//输入框类型 + newChildren.push(newChildrenItem) + }) + i.children = newChildren + delete i.selected + }) : null + }) + + //将筛选出来的数据变为服务器提交数据 + let paperDataInfo = [] + copyDatas.forEach((item,key) =>{ paperDataInfo[key] = {} paperDataInfo[key].id = null paperDataInfo[key].paperId = null @@ -1050,19 +1080,48 @@ export class CreateTestScoreComponent implements OnInit { paperDataInfo[key].functionalDivisionScore = item.funDivScore paperDataInfo[key].facilityData = item.fireFacNodes ? JSON.stringify(item.fireFacNodes) : '[]' paperDataInfo[key].facilityScore = item.fireFacScore - }) - - console.log(paperDataInfo) - - const dialogRef = this.dialog.open(FinishDialog, { - width: '650px', - data: paperDataInfo - }); + }) - dialogRef.afterClosed().subscribe(result => { - + // console.log(123456,paperDataInfo) + //判断是否存在总分填写后没有勾选 或者勾选了没有填写总分的情况 + paperDataInfo.forEach(element => { + //判断存在总分填写后没有勾选题目 + if( (element.basicInfoScore != 0 && JSON.parse(element.basicInfoData).length == 0) || + (element.adjoinScore != 0 && JSON.parse(element.adjoinData).length == 0) || + (element.importLocationScore != 0 && JSON.parse(element.importLocationData).length == 0) || + (element.functionalDivisionScore != 0 && JSON.parse(element.functionalDivisionData).length == 0) || + (element.facilityScore != 0 && JSON.parse(element.facilityData).length == 0) ){ + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('存在填写过总分,但未勾选题目的分组','确定',config); + return + }else + //勾选了题目存在没有填写总分 + if( + (element.basicInfoScore == 0 && JSON.parse(element.basicInfoData).length != 0) || + (element.adjoinScore == 0 && JSON.parse(element.adjoinData).length != 0) || + (element.importLocationScore == 0 && JSON.parse(element.importLocationData).length != 0) || + (element.functionalDivisionScore == 0 && JSON.parse(element.functionalDivisionData).length != 0) || + (element.facilityScore == 0 && JSON.parse(element.facilityData).length != 0) ){ + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('存在勾选过题目,但未填写总分的分组','确定',config); + return + }else{ + const dialogRef = this.dialog.open(FinishDialog, { + width: '650px', + data: paperDataInfo + }); + dialogRef.afterClosed().subscribe(result => { + + }); + } - }); + + }) + } //上一步 goBack(){ @@ -1142,7 +1201,8 @@ export class AddPlanTwoDialog { companyId:this.data.companyData.companyData.id }}).subscribe((data:any) => { data.items.forEach(item => { - item.planType == 1 ? planArr.push(item) : null + //二维预案并且审核通过 + (item.planType == 1 && item.auditStatus == 2) ? planArr.push(item) : null }) this.dataSource = planArr }) @@ -1162,10 +1222,15 @@ export class AddPlanTwoDialog { sessionStorage.setItem('companyId',this.data.companyData.companyData.id) window.open('/canvasTool') }else{ - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('请选择要添加的预案','确定',config); + if(this.dataSource.length == 0){ + this.dialogRef.close(); + }else{ + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('请选择要添加的预案','确定',config); + } + } }else{//如果选择的是自定义预案 diff --git a/src/app/examiner/create-test-score/lookTreeNode.html b/src/app/examiner/create-test-score/lookTreeNode.html index f05b3eb..fb85e7e 100644 --- a/src/app/examiner/create-test-score/lookTreeNode.html +++ b/src/app/examiner/create-test-score/lookTreeNode.html @@ -14,7 +14,7 @@ {{item.propertyName}} - {{i.data[key]. propertyValue}} + {{i.data[key]. propertyValue ? i.data[key]. propertyValue : '无'}}