This commit is contained in:
ChenQiuYu 2025-04-29 13:44:33 +08:00
parent 46447bf75d
commit 5caab6347d
2 changed files with 26 additions and 21 deletions

View File

@ -1,7 +1,7 @@
<template> <template>
<Mask :is-show="isShow" width="800" :height="500" title="挂号" @close="close" :show-footer="true"> <Mask :is-show="isShow" width="800" :height="500" title="挂号" @close="close" :show-footer="true">
<div style="padding:0 24px 24px" v-loading="isShowCard"> <div style="padding:0 24px 24px">
<el-form <el-form
:model="edit_data" :model="edit_data"
label-width="auto" label-width="auto"
@ -97,10 +97,11 @@
<template #footer> <template #footer>
<div class="bottom"> <div class="bottom">
<el-dropdown placement="top-start"> <el-dropdown placement="top-start">
<el-button type="primary">读卡</el-button> <el-button type="primary" v-if="!isShowCard">读卡</el-button>
<el-button text v-else>已读卡</el-button>
<template #dropdown> <template #dropdown>
<CardDefault v-model="socialCard" @socialCardUpdate="socialCardUpdate" <CardDefault v-model="socialCard" @socialCardUpdate="socialCardUpdate"
@close="edit_data={}"/> @close="deleteCard"/>
</template> </template>
</el-dropdown> </el-dropdown>
<div class="bottom-right"> <div class="bottom-right">
@ -129,14 +130,14 @@ interface Doctor {
// Props // Props
const props = defineProps({ const props = defineProps({
id: {
type: Number,
default: ''
},
doctorList: { doctorList: {
type: Array as () => Doctor[], // type: Array as () => Doctor[], //
default: () => [] default: () => []
}, },
id: {
type: [String, Number],
default: ''
},
doctorId: { doctorId: {
type: String, type: String,
default: '' default: ''
@ -180,7 +181,6 @@ const close = () => {
edit_data.value = {} edit_data.value = {}
emit('close') emit('close')
} }
const id = ref<any>(props.id)
const form = ref() const form = ref()
const save = () => { const save = () => {
let data = { let data = {
@ -224,9 +224,11 @@ const socialCard: any = ref({
payInfo: {}, payInfo: {},
lastUse: null lastUse: null
}) })
const id = ref<any>(null)
const init = () => { const init = () => {
isShow.value = true isShow.value = true
edit_data.value.organizationDoctorId = props.doctorId edit_data.value.organizationDoctorId = props.doctorId
id.value = props.id
if (id.value) { if (id.value) {
post('registration/getById', {id: id.value}).then((res: any) => { post('registration/getById', {id: id.value}).then((res: any) => {
edit_data.value = res edit_data.value = res
@ -234,13 +236,9 @@ const init = () => {
} }
} }
const isShowCard = ref<any>(false) const isShowCard = ref<any>(false)
const openCard = () => {
isShowCard.value = true
}
const socialCardUpdate = (e: any) => { const socialCardUpdate = (e: any) => {
if (e) {
isShowCard.value = true isShowCard.value = true
if(e){
isShowCard.value = false
edit_data.value = e.data.baseinfo edit_data.value = e.data.baseinfo
edit_data.value.gender = e.data.baseinfo.gend edit_data.value.gender = e.data.baseinfo.gend
edit_data.value.name = e.data.baseinfo.psn_name edit_data.value.name = e.data.baseinfo.psn_name
@ -250,6 +248,10 @@ const socialCardUpdate = (e: any) => {
} }
} }
const deleteCard = () => {
isShowCard.value = false
edit_data.value = {}
}
defineExpose({init}) defineExpose({init})
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">

View File

@ -49,7 +49,7 @@
</div> </div>
</div> </div>
</div> </div>
<Edit :id="id" ref="editRef" :doctor-id="doctorId" :doctorList="roleList" @close=" getPatientList"></Edit> <Edit ref="editRef" :id="id" :doctor-id="doctorId" :doctorList="roleList" @close="getPatientList"></Edit>
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -64,8 +64,6 @@ import {formatDate, getToday, formatDateArray} from "@/utils/dateUtils.ts";
const isShowNum = ref(0) const isShowNum = ref(0)
const roleList = ref<any>([]) const roleList = ref<any>([])
const isShow = ref(false)
onMounted(() => { onMounted(() => {
initDoctor() initDoctor()
getPatientList() getPatientList()
@ -82,6 +80,7 @@ const handleDateChange = (date: any[]) => {
getPatientList() getPatientList()
} }
const getPatientList = () => { const getPatientList = () => {
id.value = null
post('registration/list', { post('registration/list', {
page: page.value, page: page.value,
size: size.value, size: size.value,
@ -99,21 +98,25 @@ const changePage = (page: any) => {
page.value = page page.value = page
getPatientList() getPatientList()
} }
const id = ref('') const id = ref<any>('')
const doctorId= ref<any>('') const doctorId = ref<any>('')
const rowClick = (row: any) => { const rowClick = (row: any) => {
id.value = row.id id.value = row.id
nextTick(()=>{ nextTick(() => {
editRef.value?.init() editRef.value?.init()
}) })
} }
const editRef = ref<any>('') const editRef = ref<any>('')
const openDialog = (item: any) => { const openDialog = (item: any) => {
doctorId.value = item.id doctorId.value = item.id
nextTick(()=>{ nextTick(() => {
editRef.value?.init() editRef.value?.init()
}) })
} }
const close=()=>{
id.value = null
getPatientList()
}
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.container-wrapper { .container-wrapper {