|
|
@@ -129,6 +129,7 @@
|
|
|
<view class="accordion-section">
|
|
|
<view class="accordion-header" @tap="toggleAccordion('gut')">
|
|
|
<text class="accordion-title">肠道功能与代谢物</text>
|
|
|
+ <text class="accordion-stats" v-if="gutStats.total > 0">有效 {{ gutStats.valid }} / 异常 {{ gutStats.abnormal }} / 共 {{ gutStats.total }} 项</text>
|
|
|
<text class="accordion-arrow">{{ accordionOpen.gut ? '收起' : '展开' }}</text>
|
|
|
</view>
|
|
|
<view class="accordion-body" v-if="accordionOpen.gut">
|
|
|
@@ -160,6 +161,7 @@
|
|
|
<view class="accordion-section">
|
|
|
<view class="accordion-header" @tap="toggleAccordion('nutri')">
|
|
|
<text class="accordion-title">营养指标</text>
|
|
|
+ <text class="accordion-stats" v-if="nutriStats.total > 0">有效 {{ nutriStats.valid }} / 异常 {{ nutriStats.abnormal }} / 共 {{ nutriStats.total }} 项</text>
|
|
|
<text class="accordion-arrow">{{ accordionOpen.nutri ? '收起' : '展开' }}</text>
|
|
|
</view>
|
|
|
<view class="accordion-body" v-if="accordionOpen.nutri">
|
|
|
@@ -277,6 +279,32 @@ export default {
|
|
|
parsing: false
|
|
|
}
|
|
|
},
|
|
|
+ computed: {
|
|
|
+ gutStats: function() {
|
|
|
+ var list = this.gutIndicators || []
|
|
|
+ var valid = 0, abnormal = 0
|
|
|
+ for (var i = 0; i < list.length; i++) {
|
|
|
+ var item = list[i]
|
|
|
+ if (item.indicatorValue && String(item.indicatorValue).trim() !== '') valid++
|
|
|
+ if (item.status && item.status !== '正常') abnormal++
|
|
|
+ }
|
|
|
+ return { total: list.length, valid: valid, abnormal: abnormal }
|
|
|
+ },
|
|
|
+ nutriStats: function() {
|
|
|
+ var list = [], groups = this.nutritionGroups || []
|
|
|
+ for (var g = 0; g < groups.length; g++) {
|
|
|
+ var items = groups[g].items
|
|
|
+ if (items) for (var i = 0; i < items.length; i++) list.push(items[i])
|
|
|
+ }
|
|
|
+ var valid = 0, abnormal = 0
|
|
|
+ for (var i = 0; i < list.length; i++) {
|
|
|
+ var item = list[i]
|
|
|
+ if (item.indicatorValue && String(item.indicatorValue).trim() !== '') valid++
|
|
|
+ if (item.status && item.status !== '正常') abnormal++
|
|
|
+ }
|
|
|
+ return { total: list.length, valid: valid, abnormal: abnormal }
|
|
|
+ }
|
|
|
+ },
|
|
|
onLoad: function(options) {
|
|
|
this.reportId = options.reportId ? parseInt(options.reportId) : null
|
|
|
this.draftId = options.draftId ? parseInt(options.draftId) : null
|
|
|
@@ -679,6 +707,7 @@ export default {
|
|
|
.accordion-section { background: #fff; margin-bottom: 16rpx; }
|
|
|
.accordion-header { display: flex; justify-content: space-between; padding: 30rpx; border-bottom: 1rpx solid #f0f0f0; }
|
|
|
.accordion-title { font-size: 30rpx; font-weight: 600; color: #333; }
|
|
|
+.accordion-stats { font-size: 22rpx; color: #999; margin-left: 16rpx; }
|
|
|
.accordion-arrow { font-size: 24rpx; color: #999; }
|
|
|
.accordion-body { padding: 10rpx 30rpx 20rpx; }
|
|
|
|