Jelajahi Sumber

传染病统计修复

hsh 1 bulan lalu
induk
melakukan
61e2f831a8
1 mengubah file dengan 17 tambahan dan 37 penghapusan
  1. 17 37
      src/views/reports/InfectiousDisease.vue

+ 17 - 37
src/views/reports/InfectiousDisease.vue

@@ -67,23 +67,14 @@ const queryTerm = reactive({
   type: "1",
 });
 
-const dept = ref([])
-const doctor = ref([])
-const admNo = ref('');
+const dept = ref('')
+const doctor = ref('')
+const admNo = ref('')
 
 onMounted(() => {
   queryTerm.startTime = start + '00:00:00';
   queryTerm.endTime = end + " 23:59:59";
   dateRange.value = [start, end];
-  const param = {
-    str: '',
-  }
-  selectAllDept(param).then((res) => {
-    deptOptions.value = res
-  })
-  selectAllDoctor(param).then((res) => {
-    doctorOptions.value = res
-  })
 });
 
 const deptOptions = ref([])
@@ -97,19 +88,9 @@ const selectDeptMultiple = (ks) => {
       str: ks,
     }
     selectAllDept(param).then((res) => {
+      loadingDept.value = false
       deptOptions.value = res
     })
-
-    if (deptOptions.value) {
-      setTimeout(() => {
-        loadingDept.value = false
-        dept.value = deptOptions.value.filter((item) => {
-          return item.label.toLowerCase().includes(ks.toLowerCase())
-        })
-      }, 1000)
-    } else {
-      deptOptions.value = []
-    }
   } else {
     deptOptions.value = []
   }
@@ -124,18 +105,9 @@ const selectDoctorMultiple = (ys) => {
       dept: d,
     }
     selectAllDoctor(paramF).then((res) => {
+      loadingDoctor.value = false
       doctorOptions.value = res
     })
-    if (doctorOptions.value) {
-      setTimeout(() => {
-        loadingDoctor.value = false
-        doctor.value = doctorOptions.value.filter((item) => {
-          return item.label.toLowerCase().includes(ys.toLowerCase())
-        })
-      }, 1000)
-    } else {
-      doctorOptions.value = []
-    }
   } else {
     doctorOptions.value = []
   }
@@ -163,8 +135,12 @@ const query = async () => {
       showClose: true,
     });
   }
-  queryTerm.dept = dept.value;
-  queryTerm.doctor = doctor.value;
+  if(dept.value){
+    queryTerm.dept = dept.value;
+  }
+  if(doctor.value){
+    queryTerm.doctor = doctor.value;
+  }
   queryTerm.zyh = admNo.value
   await selectReportPortalMenu(queryTerm)
       .then((res) => {
@@ -196,8 +172,12 @@ const exportData = () => {
       showClose: true,
     })
   }
-  queryTerm.dept = dept.value;
-  queryTerm.doctor = doctor.value;
+  if(dept.value){
+    queryTerm.dept = dept.value;
+  }
+  if(doctor.value){
+    queryTerm.doctor = doctor.value;
+  }
   // 导出excel表格标题
   queryTerm.exportName = '传染病统计';
   exportReportPortalData(queryTerm)