Bladeren bron

做完新冠流调后直接进行下一步。

lighter 3 jaren geleden
bovenliggende
commit
cd0b0904e3

+ 64 - 0
src/data/index.js

@@ -0,0 +1,64 @@
+export const assessmentItems = [
+  {
+    key: 1,
+    label: '1. 您14天内是否有到过以下地方吗?',
+    options: [
+      { key: 11, label: '中高风险地区' },
+      { key: 12, label: '境外其他国家' },
+      { key: 13, label: '新冠肺炎确诊病例社区' },
+      { key: 14, label: '都没有' },
+    ],
+  },
+  {
+    key: 2,
+    label: '2. 您14天内是否接触过以下地区来的人员吗?',
+    options: [
+      { key: 21, label: '中高风险地区' },
+      { key: 22, label: '境外其他国家' },
+      { key: 23, label: '新冠肺炎确诊病例社区' },
+      { key: 24, label: '都没有' },
+    ],
+  },
+  {
+    key: 3,
+    label: '3. 您14天内是否接触过新型冠状病毒感染者(核酸检测阳性者)吗?',
+    options: [
+      { key: 31, label: '有' },
+      { key: 32, label: '没有' },
+    ],
+  },
+  {
+    key: 4,
+    label: '4. 14天内您有无家庭或办公室等小范围出现内2例及以上发热和呼吸道症状的病例?',
+    options: [
+      { key: 41, label: '有' },
+      { key: 42, label: '没有' },
+    ],
+  },
+  {
+    key: 5,
+    label: '5. 您14天内是否有发热或咳嗽或感冒等不适?',
+    options: [
+      {
+        key: 51,
+        label: '有',
+        children: [
+          { key: 511, label: '发热' },
+          { key: 512, label: '咳嗽' },
+          { key: 513, label: '乏力' },
+          { key: 514, label: '腹泻/呕吐' },
+        ],
+      },
+      { key: 52, label: '没有' },
+    ],
+  },
+  {
+    key: 6,
+    label: '6. 您的健康码颜色是什么?',
+    options: [
+      { key: 61, label: '绿色', color: 'green' },
+      { key: 62, label: '黄色', color: 'orange' },
+      { key: 63, label: '红色', color: 'red' },
+    ],
+  },
+]

+ 6 - 1
src/router/index.js

@@ -263,7 +263,7 @@ export const constantRoutes = [
     },
   },
   {
-    path: '/assessments/covid/:patientId?',
+    path: '/assessments/covid/:patientId?/:from?',
     component: () => import('../views/hospital-service/assessments/Covid19Assessment.vue'),
     meta: {
       title: '新型冠状病毒感染流行病学史问卷',
@@ -297,6 +297,11 @@ export const constantRoutes = [
       title: '网页未找到',
     },
   },
+  {
+    // 找不到路由重定向到404页面
+    path: '/:pathMatch(.*)',
+    redirect: '/404',
+  },
 ]
 
 const router = createRouter({

+ 2 - 2
src/utils/dev-prod.js

@@ -1,5 +1,5 @@
 // 测试
-// export const apiUrl = 'http://172.16.30.26:8805/wxserver/'
+export const apiUrl = 'http://172.16.30.26:8805/wxserver/'
 
 // 线上
-export const apiUrl = 'http://218.104.151.241:8805/wxserver'
+// export const apiUrl = 'http://218.104.151.241:8805/wxserver'

+ 10 - 12
src/views/hospital-service/appointment/AppointmentConfirm.vue

@@ -91,27 +91,25 @@ export default {
       fetchGhFee()
     }
     const confirmAppointment = () => {
+      patientCards.value.forEach((item) => {
+        if (item.patientId === appointment.patientId) {
+          appointment.patientName = item.name
+        }
+      })
+      store.commit('SET_APPOINTMENTINFO', appointment)
       if (Cookies.get('appointmentDeptCode') !== '1260000' && Cookies.get('appointmentDeptCode') !== '1700001') {
         hasValidCovidAssessment(appointment.patientId, Cookies.get('appointmentDeptCode')).then((res) => {
           if (res === 'no valid assessment') {
-            router.push('/assessments/covid/' + appointment.patientId)
+            router.push(`/assessments/covid/${appointment.patientId}/register`)
           } else {
-            toPayPage()
+            router.push('/payAppointmentFee')
           }
         })
       } else {
-        toPayPage()
+        router.push('/payAppointmentFee')
       }
     }
-    const toPayPage = () => {
-      patientCards.value.forEach((item) => {
-        if (item.patientId === appointment.patientId) {
-          appointment.patientName = item.name
-        }
-      })
-      store.commit('SET_APPOINTMENTINFO', appointment)
-      router.push('/payAppointmentFee')
-    }
+
     const disableGhBtn = ref(true)
 
     const fetchGhFee = () => {

+ 1 - 1
src/views/hospital-service/assessments/AssessmentsEntrance.vue

@@ -18,4 +18,4 @@ export default {
     }
   },
 }
-</script>
+</script>

+ 28 - 77
src/views/hospital-service/assessments/Covid19Assessment.vue

@@ -86,9 +86,11 @@
 
 <script>
 import { onMounted, reactive, ref, watchEffect } from 'vue'
+import { assessmentItems } from '../../../data/index'
 import { getDate } from '../../../utils/date'
 import { getPatientInfo, submitCovidAssessment } from '../../../api/assessments'
 import { validateCovid19Answer } from '../../../utils/validate'
+import { savePrescription } from '../../../api/order-covid-exam'
 import { Dialog } from 'vant'
 import allArea from '../../../utils/area'
 import { useRouter } from 'vue-router'
@@ -132,19 +134,9 @@ export default {
         })
       }
     }
+    const from = ref('')
     const router = useRouter()
-    onMounted(() => {
-      const patientId = router.currentRoute.value.params.patientId
-      if (patientId !== ':patientId') {
-        answer.patientId = patientId
-        getPatientInfo(patientId).then((res) => {
-          answer.name = res.name
-          answer.phone = res.phone
-          answer.idcard = res.idcard
-          answer.date = getDate()
-        })
-      }
-    })
+
     const mFocus = ref(null)
     watchEffect(() => {
       if (answer.temperature == 2) {
@@ -165,70 +157,6 @@ export default {
         answer.symptoms = []
       }
     })
-    const assessmentItems = [
-      {
-        key: 1,
-        label: '1. 您14天内是否有到过以下地方吗?',
-        options: [
-          { key: 11, label: '中高风险地区' },
-          { key: 12, label: '境外其他国家' },
-          { key: 13, label: '新冠肺炎确诊病例社区' },
-          { key: 14, label: '都没有' },
-        ],
-      },
-      {
-        key: 2,
-        label: '2. 您14天内是否接触过以下地区来的人员吗?',
-        options: [
-          { key: 21, label: '中高风险地区' },
-          { key: 22, label: '境外其他国家' },
-          { key: 23, label: '新冠肺炎确诊病例社区' },
-          { key: 24, label: '都没有' },
-        ],
-      },
-      {
-        key: 3,
-        label: '3. 您14天内是否接触过新型冠状病毒感染者(核酸检测阳性者)吗?',
-        options: [
-          { key: 31, label: '有' },
-          { key: 32, label: '没有' },
-        ],
-      },
-      {
-        key: 4,
-        label: '4. 14天内您有无家庭或办公室等小范围出现内2例及以上发热和呼吸道症状的病例?',
-        options: [
-          { key: 41, label: '有' },
-          { key: 42, label: '没有' },
-        ],
-      },
-      {
-        key: 5,
-        label: '5. 您14天内是否有发热或咳嗽或感冒等不适?',
-        options: [
-          {
-            key: 51,
-            label: '有',
-            children: [
-              { key: 511, label: '发热' },
-              { key: 512, label: '咳嗽' },
-              { key: 513, label: '乏力' },
-              { key: 514, label: '腹泻/呕吐' },
-            ],
-          },
-          { key: 52, label: '没有' },
-        ],
-      },
-      {
-        key: 6,
-        label: '6. 您的健康码颜色是什么?',
-        options: [
-          { key: 61, label: '绿色', color: 'green' },
-          { key: 62, label: '黄色', color: 'orange' },
-          { key: 63, label: '红色', color: 'red' },
-        ],
-      },
-    ]
     const submit = () => {
       const message = validateCovid19Answer(answer)
       if (message === '') {
@@ -237,7 +165,15 @@ export default {
             title: '提示',
             message: '提交成功!',
           }).then(() => {
-            if (answer.patientId) {
+            if (answer.patientId && from.value !== '') {
+              if (from.value === 'register') {
+                router.push('/payAppointmentFee')
+              } else {
+                savePrescription(answer.patientId).then(() => {
+                  router.push(`/unPaidList/${answer.patientId}`)
+                })
+              }
+            } else {
               router.go(-1)
             }
           })
@@ -249,6 +185,21 @@ export default {
         })
       }
     }
+
+    onMounted(() => {
+      const patientId = router.currentRoute.value.params.patientId
+      from.value = router.currentRoute.value.params.from
+      if (patientId && patientId !== ':patientId') {
+        answer.patientId = patientId
+        getPatientInfo(patientId).then((res) => {
+          answer.name = res.name
+          answer.phone = res.phone
+          answer.idcard = res.idcard
+          answer.date = getDate()
+        })
+      }
+    })
+
     return {
       mFocus,
       areaList,

+ 3 - 3
src/views/hospital-service/covid-exam/SelectCovidBranch.vue

@@ -43,11 +43,11 @@ export default {
         .then(() => {
           hasDoneCovidAssessment(patientId).then((res) => {
             if (res === 'no') {
-              router.push('/assessments/covid/' + patientId)
+              router.push(`/assessments/covid/${patientId}/covidExam`)
             } else {
               savePrescription(patientId)
                 .then(() => {
-                  router.push('/unPaidList/' + patientId)
+                  router.push(`/unPaidList/${patientId}`)
                 })
                 .catch(() => {
                   showInputIdCard.value = true
@@ -66,4 +66,4 @@ export default {
     }
   },
 }
-</script>
+</script>