@@ -123,7 +123,10 @@ export default {
console.log("获取横向对比 SumItems", res.data);
if (res.code != -1) {
this.RegisterCheckList = res.data;
- if (res.data.length > 0) this.rowClick(res.data[0])
+ if (this.RegisterCheckList && this.RegisterCheckList.length > 0){
+ this.rowClick(this.RegisterCheckList[0])
+ this.$refs['registerCheckList'].setCurrentRow(this.RegisterCheckList[0])
+ }
}
})
.catch((err) => {
@@ -159,44 +162,7 @@ export default {
});
},
- //交叉报表
- crossTableOld(tableData) {
-
- this.tableData = [] //显示数据
- this.tableRows = [] //动态行
- this.tableCols = [] //动态列
-
- // console.log('tableData', tableData)
- tableData.forEach(e => {
- if (this.tableRows.indexOf(e.itemName) == - 1) this.tableRows.push(e.itemName)
- let checkDate = e.checkDate.substring(0, 10)
- if (this.tableCols.indexOf(checkDate) == - 1) this.tableCols.push(checkDate)
- });
- this.tableCols.sort();
-
- this.tableRows.forEach(r => {
- let item = {}
- let resultValue = ''
- item['itemName'] = r
- this.tableCols.forEach(c => {
- for (let i = 0; i < tableData.length; i++) {
- if (tableData[i].itemName == r) {
- item['unitName'] = tableData[i].unitName
- item['referenceRangeValue'] = tableData[i].referenceRangeValue
- }
- if (tableData[i].itemName == r && tableData[i].checkDate == c) {
- resultValue = tableData[i].resultValue
- break;
- }
- }
- item[c] = resultValue
- });
- this.tableData.push(item)
- });
- // console.log('this.tableRows', this.tableRows)
- // console.log('this.tableCols', this.tableCols)
- // console.log('this.tableData', this.tableData)
- },
+ //交叉报表
crossTable(tableData) {
// [
// {