|
@@ -0,0 +1,99 @@
|
|
|
+<template>
|
|
|
+ <window-size :show-back-nav="false">
|
|
|
+ <div style="display: flex">
|
|
|
+ <div>
|
|
|
+ <van-image width="120" height="60" :src="logo"></van-image>
|
|
|
+ </div>
|
|
|
+ <div class="logo">黄码免费核酸检测</div>
|
|
|
+ </div>
|
|
|
+ <div v-for="item in cards" :key="item.patientId">
|
|
|
+ <van-cell icon="user-o" :label="item.patientId" is-link @click="confirmFreeExam(item)" >
|
|
|
+ <template #title>
|
|
|
+ <span class="custom-title">{{ item.name }}</span>
|
|
|
+ <van-tag type="primary" plain v-if="item.isDefault === 1">默认</van-tag>
|
|
|
+ </template>
|
|
|
+ </van-cell>
|
|
|
+ </div>
|
|
|
+ <div style="height: 5px"></div>
|
|
|
+ <van-cell
|
|
|
+ v-if="showAddCard"
|
|
|
+ icon="add"
|
|
|
+ title="添加就诊人"
|
|
|
+ :label="addCardText"
|
|
|
+ is-link
|
|
|
+ @click="showCreatedCardMethod = true"
|
|
|
+ ></van-cell>
|
|
|
+ <van-dialog
|
|
|
+ v-model:show="showCreatedCardMethod"
|
|
|
+ title="请选择绑定方式"
|
|
|
+ :show-confirm-button="false"
|
|
|
+ show-cancel-button
|
|
|
+ >
|
|
|
+ <div style="padding: 20px">
|
|
|
+ <van-button type="primary" block to="/bindPatientCard">绑定已有的诊疗卡</van-button>
|
|
|
+ <div style="height: 10px"></div>
|
|
|
+ <van-button type="primary" plain block to="/createPatientCard">我没有诊疗卡</van-button>
|
|
|
+ </div>
|
|
|
+ </van-dialog>
|
|
|
+ </window-size>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import logo from '../../assets/thyylogo.png'
|
|
|
+import store from '../../store'
|
|
|
+import { computed, ref } from 'vue'
|
|
|
+import WindowSize from "../../components/window-size";
|
|
|
+import {Dialog} from "vant";
|
|
|
+import {yellowHealthCardFreeCovidExam} from '../../api/order-covid-exam'
|
|
|
+
|
|
|
+export default {
|
|
|
+ components: {WindowSize},
|
|
|
+ setup() {
|
|
|
+ const cards = computed(() => {
|
|
|
+ return store.state.patientCards
|
|
|
+ })
|
|
|
+ const showAddCard = computed(() => {
|
|
|
+ return cards.value.length < 5
|
|
|
+ })
|
|
|
+ const addCardText = computed(() => {
|
|
|
+ return '还可添加' + (5 - cards.value.length) + '人'
|
|
|
+ })
|
|
|
+ const showCreatedCardMethod = ref(false)
|
|
|
+ const confirmFreeExam = (ptnt) => {
|
|
|
+ Dialog.confirm({
|
|
|
+ message: '【姓名:' + ptnt.name + '】是否确认预定新冠核酸检测?',
|
|
|
+ title: '提示',
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ }).then(() => {
|
|
|
+ yellowHealthCardFreeCovidExam(ptnt.patientId).then((res) => {
|
|
|
+ Dialog.alert({
|
|
|
+ title: '提示',
|
|
|
+ message: res,
|
|
|
+ }).then(() => {
|
|
|
+ WeixinJSBridge.call('closeWindow');
|
|
|
+ });
|
|
|
+ })
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ return {
|
|
|
+ logo,
|
|
|
+ cards,
|
|
|
+ showAddCard,
|
|
|
+ addCardText,
|
|
|
+ showCreatedCardMethod,
|
|
|
+ confirmFreeExam,
|
|
|
+ }
|
|
|
+ },
|
|
|
+}
|
|
|
+</script>
|
|
|
+<style scoped>
|
|
|
+.logo {
|
|
|
+ color: #00525e;
|
|
|
+ height: 60px;
|
|
|
+ line-height: 60px;
|
|
|
+ font-weight: bold;
|
|
|
+ font-size: 18px;
|
|
|
+}
|
|
|
+</style>
|