web/src/views/registration/index.vue

264 lines
5.8 KiB
Vue

<template>
<div class="container-wrapper">
<div class="content">
<div class="left">
<div class="left-top">
<Panel title="日历">
<Calendar></Calendar>
</Panel>
</div>
<div class="left-bottom">
<Panel title="医生列表">
<div class="search">
<el-input v-model="keyword" placeholder="搜索医生"
@keydown.enter="initDoctor"></el-input>
</div>
<div class="content_list">
<div class="role_list">
<ul>
<li v-for="(item, index) in roleList" :key="index"
@click="isShowNum=index">
<span class="name">{{ item.name }}</span>
<span class="section_name">{{ item.sectionName }}</span>
<span class="btn" @click="openDialog(item)">挂号</span>
</li>
</ul>
</div>
</div>
</Panel>
</div>
</div>
<div class="right">
<Panel title="挂号列表">
<div class="right-content">
<div class="top">
<div class="date">
<el-date-picker
v-model="selectedDate"
type="daterange"
range-separator="-"
@change="handleDateChange"
start-placeholder="开始时间"
end-placeholder="结束时间"
/>
</div>
</div>
<div class="middle">
<List :patientList="patientList" @rowClick="rowClick"></List>
</div>
<div class="bottom">
<div class="page_btn_list">
<el-pagination
background
layout="prev, pager, next"
:page-size="size"
:current-page="page"
:total="total"
@current-change="changePage"
/>
</div>
</div>
</div>
</Panel>
</div>
</div>
<Edit ref="editRef" :id="id" :doctor-id="doctorId" :doctorList="roleList" @close="getPatientList"></Edit>
</div>
</template>
<script setup lang="ts">
import {nextTick, onMounted, ref} from 'vue'
import Picker from "@/components/Picker.vue";
import Mask from "@/components/common/Mask.vue";
import Edit from "@/components/registration/Edit.vue";
import List from "@/components/registration/List.vue";
import {post} from "@/utils/request";
import {formatDate, getToday, formatDateArray} from "@/utils/dateUtils.ts";
import Calendar from "@/components/common/Calendar.vue";
import Panel from "@/components/common/Panel.vue";
const isShowNum = ref(0)
const roleList = ref<any>([])
onMounted(() => {
initDoctor()
getPatientList()
})
const keyword = ref<any>('');
const initDoctor = () => {
let query = {
keyword: keyword.value,
role: 1
}
post('organization/member/search', {query: query}).then((res: any) => {
roleList.value = res
})
}
const patientList = ref<any>([])
const selectedDate = ref<any>([getToday().start, getToday().end])
const handleDateChange = (date: any[]) => {
selectedDate.value = formatDateArray(date)
getPatientList()
}
const getPatientList = () => {
id.value = null
post('registration/list', {
page: page.value,
size: size.value,
startDate: selectedDate.value[0],
endDate: selectedDate.value[1]
}).then((res: any) => {
patientList.value = res.list
total.value = res.total_count
})
}
const total = ref(0)
const size = ref(20)
const page = ref(1)
const changePage = (page: any) => {
page.value = page
getPatientList()
}
const id = ref<any>('')
const doctorId = ref<any>('')
const rowClick = (row: any) => {
id.value = row.id
nextTick(() => {
editRef.value?.init()
})
}
const editRef = ref<any>('')
const openDialog = (item: any) => {
doctorId.value = item.id
nextTick(() => {
editRef.value?.init()
})
}
const close = () => {
id.value = null
getPatientList()
}
</script>
<style scoped lang="scss">
.container-wrapper {
background: none;
height: 100%;
padding: 0 24px;
}
.content {
height: 100%;
display: flex;
.left {
height: 100%;
width: 319px;
display: flex;
flex-direction: column;
.left-top {
height: 380px;
}
.left-bottom {
flex: 1;
min-height: 0;
margin-top: 20px;
}
li {
height: 50px;
display: flex;
font-size: 14px;
justify-content: space-between;
align-items: center;
padding: 0 10px;
border-radius: 5px;
.name {
color: #999;
}
.section_name {
color: #999;
}
.btn {
color: #b9b9ba;
border: 1px solid #b9b9ba;
padding: 5px;
border-radius: 3px;
cursor: pointer;
&:hover {
color: #fff;
background: #4D6DE4;
}
}
}
.search {
margin-top: 10px;
}
.content_list {
margin-top: 10px;
}
}
.right {
margin-left: 20px;
flex: 1;
height: 100%;
.right-content {
padding-left: 20px;
display: flex;
flex-direction: column;
height: 100%;
.top {
height: 40px;
}
.middle {
flex: 1;
min-height: 0;
background: #fff;
display: flex;
flex-direction: column;
.date {
margin: 30px auto 0;
height: 60px;
}
.list {
flex: 1;
}
}
}
.bottom {
width: 100%;
height: 60px;
background-color: #FFF;
box-sizing: border-box;
padding: 10px;
position: relative;
border-top: 1px solid #EEE;
display: flex;
justify-content: flex-end;
align-items: center;
}
}
}
</style>