张田田 10 месяцев назад
Родитель
Сommit
e3da548d05
2 измененных файлов с 15 добавлено и 11 удалено
  1. 9 3
      src/pages/index/care/issueService.vue
  2. 6 8
      src/service/CareProgress.vue

+ 9 - 3
src/pages/index/care/issueService.vue

@@ -184,13 +184,14 @@ onMounted(async () => {
   // 获取患者列表
   const res: any = await getPatientListMethod();
   if (res && res.length > 0) {
+    patients.value = res;
     if (id) {
       let index = res.findIndex((item: any) => item.patientId === id);
       currentPatient.value = res[index];
     } else {
       currentPatient.value = res[0];
     }
-    patients.value = res;
+   
   }
   if (currentPatient.value?.patientId) {
     // 获取患者列表
@@ -214,7 +215,12 @@ function loadTags(patientId: string) {
 }
 
 // 展示的患者数据
-const filteredPatients: any = computed(() => patients.value.filter((p: any) => p.patientName.includes(searchName.value)));
+const filteredPatients: any = computed(() => {
+  if(patients.value.length > 0){
+    return patients.value.filter((p: any) => (p.patientName || '').includes(searchName.value));
+  }
+  return [];
+});
 // 默认显示第一个患者
 const currentPatient = ref<PatientModel>();
 // 点击切换患者
@@ -928,7 +934,7 @@ function openPatientHealthRecord(row: { id: string }, showType: 'analysis' | 'sc
           :class="{ active: currentPatient?.id === item.id }"
           style="cursor: pointer"
         >
-          {{ item.patientName }} {{ item.patientAge }}岁
+          <span>{{ item.patientName }}</span><span v-if="item.patientAge">{{ item.patientAge }}岁</span>
           <span v-if="item.status === '0'" style="color: #aaa">(已开)</span>
         </div>
       </div>

+ 6 - 8
src/service/CareProgress.vue

@@ -42,13 +42,11 @@ async function getCareProgress() {
   // console.log('调养效果数据:', careProcessList.value?.patientConditioningScores);
 }
 onMounted(async () => {
-  // console.log(props.data, 'props.data');
   if (props.data.id) {
     await getCareProgress();
   }
 });
 function openIndicatorRecordsPreview() {
-  // console.log(patient.value, 'patient9999');
   const component = defineAsyncComponent(() => import('@/components/RecordsIndicatorPreview.vue'));
   const id = `modal:record-indicator:preview`;
   const onDestroy = () => {
@@ -70,7 +68,6 @@ function openIndicatorRecordsPreview() {
     title: `指标信息更新记录`,
     slots: {
       default() {
-        // console.log(patient.value, 'patient9999');
         return h(component, {
           patient: patient.value,
           onDestroy,
@@ -209,12 +206,13 @@ function open(row: Model) {
                     : ''
       }}</span>
       <span
-        >姓名:<b>{{ careProcessList?.patientName }}</b></span
+         v-if="careProcessList?.patientName"
+         >姓名:<b>{{ careProcessList?.patientName }}</b></span
       >
-      <span>疾病名称:{{ careProcessList?.diagnosis }}</span>
-      <span>证型:{{ careProcessList?.symptom }}</span>
-      <span>开具医生:{{ careProcessList?.createBy }}</span>
-      <span>调养周期:{{ careProcessList?.estimatedStartDate }} ~ {{ careProcessList?.estimatedEndDate }}</span>
+      <span v-if="careProcessList?.diagnosis">疾病名称:{{ careProcessList?.diagnosis }}</span>
+      <span v-if="careProcessList?.symptom">证型:{{ careProcessList?.symptom }}</span>
+      <span v-if="careProcessList?.createBy">开具医生:{{ careProcessList?.createBy }}</span>
+      <span v-if="careProcessList?.estimatedStartDate && careProcessList?.estimatedEndDate">调养周期:{{ careProcessList?.estimatedStartDate }} ~ {{ careProcessList?.estimatedEndDate }}</span>
     </div>
     <div v-if="careProcessList?.isDelivery === 'Y'" class="delivery-info">
       <a-checkbox checked disabled style="color: #52c41a; margin-right: 8px" />