Browse Source

自助开单核酸检测也要做流调。

lighter 4 years ago
parent
commit
2321a07fa4

+ 2 - 2
src/api/appointment.js

@@ -47,9 +47,9 @@ export function getDoctorInfo(doctorCode, openId) {
   })
 }
 
-export function hasDoneCovidAssessment(patientId) {
+export function hasValidCovidAssessment(patientId) {
   return request({
-    url: '/appointment/hasDoneCovidAssessment',
+    url: '/appointment/hasValidCovidAssessment',
     method: 'get',
     params: { patientId },
   })

+ 8 - 0
src/api/order-covid-exam.js

@@ -1,5 +1,13 @@
 import request from '../utils/request'
 
+export function hasDoneCovidAssessment(patientId) {
+  return request({
+    url: '/orderCovid/hasDoneCovidAssessment',
+    method: 'get',
+    params: { patientId },
+  })
+}
+
 export function savePrescription(patientId) {
   return request({
     url: '/orderCovid/savePrescription',

+ 2 - 2
src/utils/request.js

@@ -3,8 +3,8 @@ import { Toast, Dialog } from 'vant'
 import store from '../store/index'
 
 const service = axios.create({
-  baseURL: 'http://172.16.30.26:8805/wxserver/', // dev
-  // baseURL: 'http://218.104.151.241:8805/wxserver', // prod
+  // baseURL: 'http://172.16.30.26:8805/wxserver/', // dev
+  baseURL: 'http://218.104.151.241:8805/wxserver', // prod
   withCredentials: true,
   timeout: 0,
 })

+ 2 - 2
src/views/hospital-service/appointment/AppointmentConfirm.vue

@@ -68,7 +68,7 @@
 import store from '../../../store'
 import { computed, onMounted, reactive, ref, watchEffect } from 'vue'
 import Cookies from 'js-cookie'
-import { getGhFee, hasDoneCovidAssessment } from '../../../api/appointment'
+import { getGhFee, hasValidCovidAssessment } from '../../../api/appointment'
 import router from '../../../router'
 export default {
   name: 'AppointConfirm',
@@ -97,7 +97,7 @@ export default {
     })
     const confirmAppointment = () => {
       if (Cookies.get('appointmentDeptCode') !== '1260000') {
-        hasDoneCovidAssessment(data.appointment.patientId).then((res) => {
+        hasValidCovidAssessment(data.appointment.patientId).then((res) => {
           if (res === 'no valid assessment') {
             router.push('/assessments/covid/' + data.appointment.patientId)
           } else {

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

@@ -8,7 +8,7 @@
 <script>
 import { Dialog } from 'vant'
 import { useRouter } from 'vue-router'
-import { savePrescription } from '../../../api/order-covid-exam'
+import { hasDoneCovidAssessment, savePrescription } from '../../../api/order-covid-exam'
 export default {
   setup() {
     const router = useRouter()
@@ -21,8 +21,14 @@ export default {
         cancelButtonText: '取消',
       })
         .then(() => {
-          savePrescription(patientId).then(() => {
-            router.push('/unPaidList/' + patientId)
+          hasDoneCovidAssessment(patientId).then((res) => {
+            if (res === 'no') {
+              router.push('/assessments/covid/' + patientId)
+            } else {
+              savePrescription(patientId).then(() => {
+                router.push('/unPaidList/' + patientId)
+              })
+            }
           })
         })
         .catch(() => {})