diff --git a/src/components/doctorCheck/CheckItemList.vue b/src/components/doctorCheck/CheckItemList.vue index 618d35c..b227ef6 100644 --- a/src/components/doctorCheck/CheckItemList.vue +++ b/src/components/doctorCheck/CheckItemList.vue @@ -6,7 +6,7 @@ @@ -57,7 +84,7 @@ export default { //挂载完成 mounted() { - this.registerCheckList(this.patientId) + this.registerCheckList(this.patientId) }, computed: { @@ -85,8 +112,8 @@ export default { registerCheckList(patientId) { this.RegisterCheckList = [] if (!patientId) return - console.log(`/api/app/sumsummaryreport/gethorizontalcomparisonasbitemlist?PatientId=${patientId}`) - getapi(`/api/app/sumsummaryreport/gethorizontalcomparisonasbitemlist?PatientId=${patientId}`) + // console.log(`/api/app/sumsummaryreport/gethorizontalcomparisonasbitemlist?PatientId=${patientId}`) + postapi('/api/app/SumSummaryReport/GetHorizontalComparisonAsbitems', { patientId }) .then((res) => { console.log("获取横向对比 SumItems", res.data); if (res.code != -1) { @@ -114,8 +141,8 @@ export default { // "checkDate": "2023-07-14", // "resultValue": "阴性" SumItems(patientId, asbitemId) { - console.log(`/api/app/sumsummaryreport/gethorizontalcomparisonlist?PatientId=${patientId}&AsbitemId=${asbitemId}`) - getapi(`/api/app/sumsummaryreport/gethorizontalcomparisonlist?PatientId=${patientId}&AsbitemId=${asbitemId}`) + // console.log(`/api/app/sumsummaryreport/gethorizontalcomparisonlist?PatientId=${patientId}&AsbitemId=${asbitemId}`) + postapi('/api/app/SumSummaryReport/GetHorizontalComparisons', { patientId, asbitemId }) .then((res) => { console.log("获取横向对比 SumItems", res.data); if (res.code != -1) { @@ -128,8 +155,8 @@ export default { }, //交叉报表 + crossTableOld(tableData) { - crossTable(tableData) { this.tableData = [] //显示数据 this.tableRows = [] //动态行 this.tableCols = [] //动态列 @@ -137,7 +164,8 @@ export default { // console.log('tableData', tableData) tableData.forEach(e => { if (this.tableRows.indexOf(e.itemName) == - 1) this.tableRows.push(e.itemName) - if (this.tableCols.indexOf(e.checkDate) == - 1) this.tableCols.push(e.checkDate) + let checkDate = e.checkDate.substring(0, 10) + if (this.tableCols.indexOf(checkDate) == - 1) this.tableCols.push(checkDate) }); this.tableCols.sort(); @@ -164,19 +192,82 @@ export default { // console.log('this.tableCols', this.tableCols) // console.log('this.tableData', this.tableData) }, + crossTable(tableData) { + // [ + // { + // "regsterCheckId": "00000000-0000-0000-0000-000000000000", + // "checkDate": "2018-06-08T00:00:00", + // "summarys": [ + // { + // "summary": "体重指数:23.89 诊断为:正常" + // } + // ], + // "registerCheckItems": [ + // { + // "itemName": "身高", + // "unitName": "", + // "referenceRangeValue": "", + // "resultValue": "176", + // "reportFontColor": 0 + // } + this.tableData = [] //显示数据 + this.tableCols = [] //动态列 + + // console.log('tableData', tableData) + // this.tableCols.push('itemName') + // this.tableCols.push('unitName') + // this.tableCols.push('referenceRangeValue') + let summary = { itemName: '小结', unitName: '', referenceRangeValue: '' } + tableData.forEach((e, i) => { + + let lsummary = '' + e.summarys.forEach((s, i) => { + let splitStr = '
' + if (i == 0) splitStr = '' + lsummary += splitStr + (s.summary || '') + }); + summary[e.checkDate] = lsummary + + // 获取列数 + if (this.tableCols.indexOf(e.checkDate) == - 1) this.tableCols.push(e.checkDate) + + // 获取行及数据 + let row = {} + e.registerCheckItems.forEach(r => { + let lfind = arrayExistObj(this.tableData, 'itemName', r.itemName) + if (lfind > -1) { + this.tableData[lfind][e.checkDate] = r.resultValue + this.tableData[lfind][e.checkDate + '_color'] = r.reportFontColor + } else { + row = { + itemName: r.itemName, + unitName: r.unitName, + referenceRangeValue: r.referenceRangeValue + } + row[e.checkDate] = r.resultValue + row[e.checkDate + '_color'] = r.reportFontColor + this.tableData.push(row) + } + }) + + }); + + this.tableData.push(summary) + + }, }, //监听事件 - watch: { + watch: { // 虚拟表 触发强制刷新 (sumDoctor.M 合并包含:综述、建议、对比、历史等,不包含总检诊断) - "dataTransOpts.refresh.sumDoctor.M":{ + "dataTransOpts.refresh.sumDoctor.M": { // immediate:true, handler(newVal, oldVal) { - console.log(`watch 总检--横向对比 newVal: ${newVal}, oldVal: ${oldVal} patientId: ${this.patientId}`); - this.registerCheckList(this.patientId) + console.log(`watch 总检--横向对比 newVal: ${newVal}, oldVal: ${oldVal} patientId: ${this.patientId}`); + this.registerCheckList(this.patientId) } }, }, diff --git a/src/views/doctorCheck/sumDoctorCheck.vue b/src/views/doctorCheck/sumDoctorCheck.vue index 07e180c..2077e37 100644 --- a/src/views/doctorCheck/sumDoctorCheck.vue +++ b/src/views/doctorCheck/sumDoctorCheck.vue @@ -36,12 +36,12 @@ + - + --> +