|
|
@@ -2,17 +2,82 @@
|
|
|
<window-size>
|
|
|
<van-cell title="检查" is-link :to="'/bookableExaminations/jc/' + patientId"></van-cell>
|
|
|
<van-cell title="检验" is-link :to="'/bookableExaminations/jy/' + patientId"></van-cell>
|
|
|
+ <van-cell title="核酸检测" is-link @click="beforeCovidExam"></van-cell>
|
|
|
</window-size>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import { useRouter } from 'vue-router'
|
|
|
+import {Dialog} from "vant";
|
|
|
+import store from "../../../store";
|
|
|
+import {getDoctorSources} from "../../../api/appointment.js";
|
|
|
+import {getTodayAndWeek} from "../../../utils/date";
|
|
|
+import {selectValidRegForCovidExam,savePrescription} from "../../../api/order-covid-exam";
|
|
|
+import {getPatientNameByPatientId} from "../../../utils/check-patient-id";
|
|
|
export default {
|
|
|
setup() {
|
|
|
const router = useRouter()
|
|
|
const patientId = router.currentRoute.value.params.patientId
|
|
|
+ const dateAndWeek = getTodayAndWeek()
|
|
|
+ const beforeCovidExam = () => {
|
|
|
+ Dialog.confirm({
|
|
|
+ title: '温馨提示',
|
|
|
+ message: '核酸检测前需要挂号简易门诊,是否继续?',
|
|
|
+ confirmButtonText: '继续',
|
|
|
+ cancelButtonText: '取消'
|
|
|
+ }).then(() => {
|
|
|
+ getTodaySimpleClinic()
|
|
|
+ }).catch(() => {
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ const getTodaySimpleClinic = () => {
|
|
|
+ selectValidRegForCovidExam(patientId).then(res => {
|
|
|
+ if (res === 0) {
|
|
|
+ const params = {date: dateAndWeek.today, deptCode: '3110000'}
|
|
|
+ getDoctorSources(params).then(res2 => {
|
|
|
+ simpleClinic(res2[0])
|
|
|
+ }).catch(() => {
|
|
|
+ Dialog.alert({
|
|
|
+ title: '提示',
|
|
|
+ message: '没有获取到今日简易门诊号源,请稍后再试。',
|
|
|
+ }).then(() => {})
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ savePrescription(patientId, 1).then(() => {
|
|
|
+ router.push(`/unPaidList/${patientId}`)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ const simpleClinic = (row) => {
|
|
|
+ const appointment = {
|
|
|
+ leftNum: row.leftNum,
|
|
|
+ doctorName: '自助',
|
|
|
+ doctorTitle: '无',
|
|
|
+ ampm: '全天',
|
|
|
+ fee: row.fee,
|
|
|
+ doctorCode: '99999',
|
|
|
+ chargeType: '简易门诊号',
|
|
|
+ deptCode: '3110000',
|
|
|
+ deptName: '简易门诊',
|
|
|
+ date: dateAndWeek.today,
|
|
|
+ week: dateAndWeek.week,
|
|
|
+ startTime: '00:00',
|
|
|
+ endTime: '00:00',
|
|
|
+ patientId: patientId,
|
|
|
+ patientName: getPatientNameByPatientId(patientId),
|
|
|
+ extra: 'covid19-exam',
|
|
|
+ mzyRequestId: row.mzyRequestId
|
|
|
+ }
|
|
|
+ store.commit('SET_APPOINTMENTINFO', appointment)
|
|
|
+ router.push('/payAppointmentFee')
|
|
|
+ }
|
|
|
+
|
|
|
return {
|
|
|
patientId,
|
|
|
+ beforeCovidExam,
|
|
|
}
|
|
|
},
|
|
|
}
|