Browse Source

fix:添加显示字段优化

wangsisi 4 days ago
parent
commit
d5e64eca61
1 changed files with 6 additions and 3 deletions
  1. 6 3
      src/components/recordItem.vue

+ 6 - 3
src/components/recordItem.vue

@@ -80,7 +80,7 @@
                 <div class="rescription info-val">
                     <span v-for="(fertilizer, fertilizerI) in recordItemData.prescriptionList" :key="fertilizerI">
                         <span v-for="(pest, pestI) in fertilizer.pesticideFertilizerList" :key="'sub' + pestI">
-                            {{ pest.defaultName || pest.pesticideFertilizerName }}
+                            {{ pest.defaultName || pest.pesticideFertilizerName || '暂无处方' }}
                             <span
                                 v-if="
                                     pestI !== fertilizer.pesticideFertilizerList.length - 1 ||
@@ -98,15 +98,18 @@
                 v-if="onlyRecipeName && recordItemData?.prescription && recordItemData?.prescription?.id != null"
             >
                 <span class="name-text">药物处方:</span>
-                <div class="rescription info-val">
+                <div class="rescription info-val" v-if="recordItemData?.prescription?.pesticideFertilizerList.length > 0">
                     <span
                         v-for="(pest, pestI) in recordItemData.prescription.pesticideFertilizerList"
                         :key="'sub' + pestI"
                     >
-                        {{ pest.name }}
+                        {{ pest.name || '暂无处方' }}
                         <span v-if="pestI !== recordItemData.prescription.pesticideFertilizerList.length - 1"> + </span>
                     </span>
                 </div>
+                <div class="rescription info-val" v-else>
+                    暂无处方
+                </div>
             </div>
             <div
                 class="info-item"