فهرست منبع

检验报告单开一个路由给门诊做跳转

lighter 1 سال پیش
والد
کامیت
51d7ef3fb9
2فایلهای تغییر یافته به همراه21 افزوده شده و 8 حذف شده
  1. 1 1
      src/router/modules/dashboard.ts
  2. 20 7
      src/views/examination/InspectionReportIndex.vue

+ 1 - 1
src/router/modules/dashboard.ts

@@ -81,7 +81,7 @@ const route: Array<RouteRecordRaw> = [
         meta: {title: '患者360', hideTabs: true},
     },
     {
-        path: '/inspectionReportV2',
+        path: '/inspectionReportV2/:patNo?/:start?/:end?',
         name: 'inspectionReportV2',
         component: () => import('@/views/examination/InspectionReportIndex.vue'),
         meta: { title: '检验报告'}

+ 20 - 7
src/views/examination/InspectionReportIndex.vue

@@ -449,16 +449,29 @@ const beforePrint = async () => {
 
 onMounted(() => {
   initLodop()
-  if (props.patNo && props.start && props.end) {
-    patType.value = 'InPatient'
-    patNo.value = props.patNo
-    datePeriod.value[0] = props.start
-    datePeriod.value[1] = props.end
-    queryIndex()
+  const vueName = router.currentRoute.value.name
+  if (vueName === 'inspectionReportV2') {
+    checkPathParams()
+  } else {
+    checkPropsParams()
   }
 })
 
 onActivated(() => {
+  checkPathParams()
+})
+
+function checkPropsParams() {
+  if (props.patNo && props.start && props.end) {
+    patType.value = 'InPatient';
+    patNo.value = props.patNo;
+    datePeriod.value[0] = props.start;
+    datePeriod.value[1] = props.end;
+    queryIndex();
+  }
+}
+
+function checkPathParams() {
   const params = router.currentRoute.value.params
   if (params.patNo && params.start && params.end) {
     patType.value = params.patNo.indexOf('-') === -1 ?
@@ -468,7 +481,7 @@ onActivated(() => {
     datePeriod.value[1] = params.end
     queryIndex()
   }
-})
+}
 
 function doPrint() {
   return new Promise((resolve) => {