This commit is contained in:
ChenQiuYu 2025-05-09 11:25:04 +08:00
parent 7dc1cd81b0
commit 69d835a428
10 changed files with 240 additions and 127 deletions

View File

@ -11,6 +11,7 @@ export enum apiConfig{
*/
"RegistrationDetail" ="medical/record/getDetailByRegisId",//详情
"RegistrationList" ="registration/getListByType",//患者列表
"RegistrationChangeStatus"="registration/changeStatus",
/**
*

View File

@ -1,7 +1,7 @@
<script setup lang="ts">
import Panel from "@/components/common/Panel.vue";
import {onMounted, ref} from "vue";
import {getThisWeek} from "@/utils/dateUtils.ts";
import {formatDateArray, getThisMonth, getThisWeek, getToday, getYesterday} from "@/utils/dateUtils.ts";
import {post} from "@/utils/request.ts";
onMounted(() => {
@ -36,18 +36,73 @@ const background = ref<any>([
'#FFEEEE',
'#E5F9FF'
]);
const getDateRange = () => {
let beginTime = ''
let endTime = ''
if (curDate.value == null) {
let dateArray = selectDate.value
beginTime = dateArray[0]
endTime = dateArray[1]
} else {
const date = curDate.value?.func
beginTime = date.start
endTime = date.end
}
return {begin: beginTime, end: endTime}
}
const getRevenueOverview = () => {
const thisWeek = getThisWeek();
post("statistics/getRevenueOverview", {beginTime: thisWeek.start, endTime: thisWeek.end}).then((res: any) => {
let date=getDateRange()
post("statistics/getRevenueOverview", {
beginTime: date.begin,
endTime: date.end}).then((res: any) => {
if (res.payTypeRevenue.length === 0) return
payTypeRevenue.value = res.payTypeRevenue
})
}
const dataSelector = [
{name: '今天', func: getToday()},
{name: '昨天', func: getYesterday()},
{name: '本周', func: getThisWeek()},
{name: '本月', func: getThisMonth()},
]
const selectDate = ref();
const curDate = ref<any>(dataSelector[0])
const changeCheckDate = (dateItem: any) => {
curDate.value = dateItem
selectDate.value = null
getRevenueOverview()
}
const changeDate = (date: any) => {
curDate.value = null
selectDate.value = formatDateArray(date)
getRevenueOverview()
}
</script>
<template>
<Panel title="支付明细" class="detail-price">
<template #tools>
<div class="time">
<div class="time_box"
v-for="(item,index) in dataSelector"
:key="index"
:class="{active:curDate?.name==item.name}"
@click="changeCheckDate(item)"
>
<span>{{ item.name }}</span>
</div>
<el-date-picker
v-model="selectDate"
type="daterange"
@change="changeDate"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
style="margin-left: 24px"
/>
</div>
</template>
<div class="detail-price-content">
<div class="detail-price-content-item" v-for="(item,index) in payTypeRevenue"
:style="`background:${background[index]}`">
@ -63,6 +118,30 @@ const getRevenueOverview = () => {
</template>
<style scoped lang="scss">
.time {
display: flex;
align-items: center;
.time_box {
padding: 0 5px;
height: 30px;
border: 1px solid #d7d9da;
color: #000;
font-size: 15px;
display: flex;
align-items: center;
cursor: pointer;
&:hover {
color: #fff;
background: #409EFF;
}
}
}
.active{
color: #fff !important;
background: #409EFF;
}
.detail-price {
height: 194px;

View File

@ -35,8 +35,9 @@ const isExpire = (item: any) => {
</template>
<div style="padding: 0 24px 24px">
<div class="box">
<div class="item" style="margin-right: 8px" v-for="(item,index) in expireDateWarningList" :class="isExpire(item) ? 'item__danger' : 'item__warn'">
<div class="image" />
<div class="item" style="margin-right: 8px" v-for="(item,index) in expireDateWarningList"
:class="isExpire(item) ? 'item__danger' : 'item__warn'">
<div class="image"/>
<div class="item-content">
<el-tooltip
effect="dark"
@ -53,9 +54,12 @@ const isExpire = (item: any) => {
</div>
</div>
<div class="item-right" style="margin-right: 10px">
<div v-if="item.remaining_days<0">已过期<span class="item-right-num">{{
Math.abs(item.remaining_days)
}}</span>
<div v-if="item.remaining_days<0">
已过期
<span class="item-right-num">{{
Math.abs(item.remaining_days) > 99 ? '99+' : Math.abs(item.remaining_days)
}}</span>
</div>
<div v-else>剩余<span class="item-right-num">{{ Math.abs(item.remaining_days) }}</span>
</div>
@ -74,27 +78,30 @@ const isExpire = (item: any) => {
flex-direction: column;
.box {
.item__danger{
.image{
background-image: url("/static/images/home/danger.png") ;
}
.item-right{
color: #FF282E;
}
}
.item__warn{
.image{
background-image: url("/static/images/home/warn.png") ;
}
.item-right{
color: #F69C51;
}
.item__danger {
.image {
background-image: url("/static/images/home/danger.png");
}
.item-right {
color: #FF282E;
}
}
.item__warn {
.image {
background-image: url("/static/images/home/warn.png");
}
.item-right {
color: #F69C51;
}
}
.item {
float: left;
width: 48%;
@ -116,6 +123,7 @@ const isExpire = (item: any) => {
flex: 1;
.item-name {
width: 80px;
font-weight: 400;
font-size: 14px;
color: #333333;
@ -137,7 +145,8 @@ const isExpire = (item: any) => {
}
.item-right {
width: 100px;
width: 120px;
display: flex;
.item-right-num {
font-size: 28px;
font-weight: bold;

View File

@ -1,6 +1,18 @@
<template>
<Panel :title="'就诊队列'" style="height: 100%">
<template #tools>
<div @click="setDate">{{selectedDateStr}}</div>
<el-date-picker
v-model="selectedDate"
type="date"
placeholder="选择日期"
ref="datePickerRef"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
/>
</template>
<div class="panel-content" style="display: flex;flex-direction: column;height: 100%">
<div class="tabs">
<span v-for="(item,index) in statusList" :class="curStatus == item.status ? 'tabs-item' : ''"
@click="clickTab(item)">{{ item.label }}&nbsp;{{ item.num }}</span>
@ -33,22 +45,31 @@
</Panel>
</template>
<script setup lang="ts">
import {nextTick, onMounted, ref, watch} from "vue";
import Panel from "@/components/common/Panel.vue";
import {post} from "@/utils/request.ts";
import {formatListTime, getToday, getThisMonth} from "@/utils/dateUtils.ts";
import {formatListTime, getToday, getThisMonth, getCurrentDate, getEndOfDay} from "@/utils/dateUtils.ts";
import {apiConfig} from "@/assets/config/apiConfig.ts";
import {ElMessageBox} from "element-plus";
const curStatus = ref(1)
const search = ref('')
const curItem = ref<any>('')
const selectedDate:any = ref('')
const selectedDateStr:any = ref('')
const emit = defineEmits(['clickItem', 'changeTab'])
const datePickerRef = ref()
const clickTab = (item: any) => {
curStatus.value = item.status
emit('changeTab')
curItem.value = {}
}
const setDate=function (){
if (datePickerRef.value) {
datePickerRef.value.handleOpen()
}
}
const list = ref<any>([])
const statusList = ref<any>([
{
@ -69,6 +90,7 @@ const statusList = ref<any>([
])
const itemId = defineModel()
onMounted(() => {
selectedDate.value=getCurrentDate()
initStatusList()
curItem.value = itemId
if(curStatus.value==1){
@ -76,23 +98,32 @@ onMounted(() => {
}
})
const loading = ref(true)
const init = () => {
const init = async () => {
selectedDateStr.value=setDateTip()
loading.value = true
post(apiConfig.RegistrationList, {
query: {
status: curStatus.value,
beginTime: '2024-05-07 23:59:59',
endTime: data.value.end
}
}).then((res: any) => {
try{
let data:any=await post(apiConfig.RegistrationList, {
query: {
status: curStatus.value,
beginTime: selectedDate.value,
endTime: getEndOfDay(new Date(selectedDate.value))
}
}, {catch_error:true});
list.value=data.list
}
catch (e){
}finally {
loading.value = false
list.value = res.list
initStatusList()
})
}
initStatusList()
}
const data = ref<any>(getToday())
const initStatusList = () => {
post('statistics/getTipCount', {beginTime: '2024-05-07 23:59:59', endTime: data.value.end}).then((res: any) => {
post('statistics/getTipCount', {
beginTime: selectedDate.value,
endTime: getEndOfDay(new Date(selectedDate.value))}).then((res: any) => {
statusList.value[0].num = res.waitDiagnosisCount
statusList.value[1].num = res.diagnosingCount
statusList.value[2].num = res.completeDiaCount
@ -126,14 +157,37 @@ const changeCurItemOrStatus = (item:any, status:any) => {
if (curStatus != null){
curStatus.value = status
}
}
defineExpose({changeCurItemOrStatus})
watch(() => curStatus.value, () => {
console.log('status', curStatus.value)
init() //
})
const setDateTip=()=>{
const seletctedDateObj = new Date(selectedDate.value);
//
if(seletctedDateObj.getFullYear()==new Date().getFullYear() && seletctedDateObj.getMonth()==new Date().getMonth() && seletctedDateObj.getDate()==new Date().getDate()){
return '今天'
}
if(seletctedDateObj.getFullYear()==new Date().getFullYear() && seletctedDateObj.getMonth()==new Date().getMonth() && seletctedDateObj.getDate()==new Date().getDate()-1){
return '昨天'
}
//
if(seletctedDateObj.getFullYear()==new Date().getFullYear()){
return `${seletctedDateObj.getMonth()+1}-${seletctedDateObj.getDate()}`
}
return seletctedDateObj.getFullYear();
}
watch(() => selectedDate.value, (newValue, oldValue) => {
if(newValue==oldValue){
return;
}
if(newValue==null){
return;
}
init()
})
</script>
<style scoped lang="scss">
.tabs {
@ -272,5 +326,13 @@ watch(() => curStatus.value, () => {
}
}
:deep(.el-input){
visibility: hidden;
width: 0;
height: 0;
position: absolute;
right: 0;
top: 50px;
}
</style>

View File

@ -21,12 +21,12 @@
<el-descriptions-item label="姓名">
<el-form-item prop="name" style="margin-bottom: 2px">
<el-input v-model="edit_data.name" placeholder="请输入姓名" clearable
:disabled="edit_data.status==1||edit_data.status==3"></el-input>
:disabled="edit_data.status==1||edit_data.status==3||edit_data.status==0"></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="性别">
<el-form-item prop="gender">
<el-radio-group v-model="edit_data.gender" :disabled="edit_data.status==1||edit_data.status==3">
<el-radio-group v-model="edit_data.gender" :disabled="edit_data.status==1||edit_data.status==3||edit_data.status==0">
<el-radio :value="1"></el-radio>
<el-radio :value="2"></el-radio>
</el-radio-group>
@ -35,12 +35,12 @@
<el-descriptions-item label="年龄">
<el-form-item prop="age">
<el-input v-model.number="edit_data.age" placeholder="请输入年龄"
:disabled="edit_data.status==1||edit_data.status==3"></el-input>
:disabled="edit_data.status==1||edit_data.status==3||edit_data.status==0"></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="手机号">
<el-form-item prop="phone">
<el-input v-model="edit_data.phone" placeholder="手机号" :disabled="edit_data.status==3"></el-input>
<el-input v-model="edit_data.phone" placeholder="手机号" :disabled="edit_data.status==3||edit_data.status==0"></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="医生">
@ -49,7 +49,7 @@
v-model="edit_data.organizationDoctorId"
placeholder="请选择医生"
@change="getSectionList"
:disabled="edit_data.status==3"
:disabled="edit_data.status==3||edit_data.status==0"
>
<el-option
v-for="item in doctorList"
@ -66,7 +66,7 @@
<el-select
v-model="edit_data.organizationSectionId"
placeholder="选择科室"
:disabled="edit_data.status==3"
:disabled="edit_data.status==3||edit_data.status==0"
>
<el-option
v-for="item in sectionList"
@ -82,7 +82,7 @@
<el-descriptions-item label="证件类型">
<el-form-item prop="certType">
<el-select v-model="edit_data.certType" placeholder="证件类型"
:disabled="edit_data.status==1||edit_data.status==3">
:disabled="edit_data.status==1||edit_data.status==3||edit_data.status==0">
<el-option
v-for="item in certTypeList"
:key="item.id"
@ -95,14 +95,14 @@
<el-descriptions-item label="证件码">
<el-form-item prop="certNo">
<el-input v-model="edit_data.certNo" placeholder="请输入证件码"
:disabled="edit_data.status==1||edit_data.status==3"></el-input>
:disabled="edit_data.status==1||edit_data.status==3||edit_data.status==0"></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="初/复诊">
<el-form-item prop="visitType">
<el-select v-model="edit_data.visitType" placeholder="就诊类型">
<el-select v-model="edit_data.visitType" placeholder="就诊类型" :disabled="edit_data.status==0">
<el-option label="初诊" :value="0"></el-option>
<el-option label="复诊" :value="1"></el-option>
</el-select>
@ -111,7 +111,7 @@
<el-descriptions-item
label="备注">
<el-form-item>
<el-input v-model="edit_data.memo" placeholder="备注"></el-input>
<el-input v-model="edit_data.memo" placeholder="备注" :disabled="edit_data.status==0"></el-input>
</el-form-item>
</el-descriptions-item>
</el-descriptions>
@ -143,10 +143,10 @@
<template #footer>
<div class="bottom">
<el-dropdown v-if="isShowCard" placement="top-start" @show="showCardBtn" @hide="hide">
<el-dropdown v-if="isShowCard" placement="top-start" @show="showCardBtn" @hide="hide" :disabled="edit_data.status==0">
<div class="left" style="outline: none;">
<span class="btnCard" type="primary">
<img class="image" src="/static/images/registration/card.png" alt="" srcset="">进行读卡
<img class="image" src="/static/images/registration/card.png" alt="" srcset="">{{edit_data.status==0?'不能读卡':'进行读卡'}}
<img class="image1" :src="'/static/images/registration/'+(showBtn?2:1)+'.png'" alt="" srcset="">
</span>
</div>
@ -160,9 +160,9 @@
退出医保
</div>
<div class="bottom-right">
<el-button type="primary" @click="save">保存</el-button>
<el-button type="primary" @click="save" :disabled="edit_data.status==0">保存</el-button>
<el-button @click="close">取消</el-button>
<el-button v-if="edit_data.status==1" type="danger" @click="deleteDetail">退号</el-button>
<el-button v-if="edit_data.status==1" type="danger" @click="registrationCancel">退号</el-button>
</div>
</div>
</template>
@ -181,7 +181,6 @@ import insutypes from "@/assets/config/directory/insutypes.json"
import depts from "@/assets/config/directory/depts.json";
import {apiConfig} from "@/assets/config/apiConfig.ts";
const height = ref(470)
const certTypeList = ref<any>(
Object.entries(psnCertTypes)
@ -255,7 +254,7 @@ const save = () => {
mdtrtCertNo: socialCard.value.mdtrtCertNo,
mdtrtCertType: socialCard.value.mdtrtCertType
}).then(() => {
ElMessage.success('新建成功')
ElMessage.success('挂号成功')
close()
})
}
@ -263,9 +262,10 @@ const save = () => {
})
}
const deleteDetail = () => {
post('registration/delete', {id: edit_data.value.id}).then(() => {
ElMessage.success('删除成功')
//退
const registrationCancel = () => {
post(apiConfig.RegistrationChangeStatus, {id: edit_data.value.id, status: 0}).then(() => {
ElMessage.success('退号成功')
close()
})
}

View File

@ -22,7 +22,7 @@
:type="scope.row.status === 1 ? 'warning' : scope.row.status === 2 ? 'success' : scope.row.status === 3 ? 'info' : 'danger'"
>
{{
scope.row.status === 1 ? '待诊' : scope.row.status === 2 ? '在诊' : scope.row.status === 3 ? '已诊' : '-'
scope.row.status === 1 ? '待诊' : scope.row.status === 2 ? '在诊' : scope.row.status === 3 ? '已诊' : scope.row.status ===0 ? '已取消' : '-'
}}
</el-tag>
</template>

View File

@ -10,7 +10,7 @@
:class="{active:curDate?.name==item.name}"
@click="changeCheckDate(item)"
>
<span :style="{color:curDate?.name==item.name?'#000':''}">{{ item.name }}</span>
<span>{{ item.name }}</span>
</div>
<el-date-picker
v-model="selectDate"
@ -120,48 +120,6 @@ const dataSelector = [
{name: '本周', func: getThisWeek()},
{name: '本月', func: getThisMonth()},
]
const changeCheck = (index: number) => {
changeNum.value = index
timeList.value = []
const now = new Date();
const year = now.getFullYear();
let month = String(now.getMonth() + 1).padStart(2, '0'); // 01
const day = String(now.getDate()).padStart(2, '0'); //
if (index == 0) {
const day1 = String(now.getDate() + 1).padStart(2, '0'); //
beginTime.value = `${year}-${month}-${day}`;
endTime.value = `${year}-${month}-${day1}`
}
if (index == 1) {
const yesterday = new Date(now);
yesterday.setDate(now.getDate() - 1);//
const yesterday_year = yesterday.getFullYear();
const yesterday_month = String(yesterday.getMonth() + 1).padStart(2, '0'); // 0 1
const yesterday_day = String(yesterday.getDate()).padStart(2, '0');
beginTime.value = `${yesterday_year}-${yesterday_month}-${yesterday_day}`;
endTime.value = `${year}-${month}-${day}`
}
if (index == 2) {
const dayOfWeek = now.getDay(); // 0 1
const diff = now.getDate() - dayOfWeek + (dayOfWeek === 0 ? -6 : 1); //
const startOfWeek = new Date(now.setDate(diff));//
const beginYear = startOfWeek.getFullYear();
const beginMonth = String(startOfWeek.getMonth() + 1).padStart(2, '0'); // 01
const beginDay = String(startOfWeek.getDate()).padStart(2, '0'); //
beginTime.value = `${beginYear}-${beginMonth}-${beginDay}`;
endTime.value = `${year}-${month}-${day}`;
}
if (index == 3) {
//
let startOfMonth = new Date(now.getFullYear(), now.getMonth(), 1);
const startYear = startOfMonth.getFullYear();
const startMonth = String(startOfMonth.getMonth() + 1).padStart(2, '0'); // 01
const startDay = String(startOfMonth.getDate()).padStart(2, '0');
beginTime.value = `${startYear}-${startMonth}-${startDay}`;
endTime.value = `${year}-${month}-${day}`;
}
initChart();
}
const formatDate = (dateString: any) => {
const date = new Date(dateString);
const year = date.getFullYear();
@ -169,11 +127,6 @@ const formatDate = (dateString: any) => {
const day = String(date.getDate()).padStart(2, '0');
return `${year}-${month}-${day}`;
};
const changeTime = () => {
beginTime.value = formatDate(timeList.value[0])
endTime.value = formatDate(timeList.value[1])
initChart()
}
// ref
const centerRef = ref<HTMLElement | null>(null)
const centerItemRef = ref<HTMLElement | null>(null)
@ -396,12 +349,22 @@ const changeCheckDate = (dateItem: any) => {
padding: 0 5px;
height: 30px;
border: 1px solid #d7d9da;
color: #d7d9da;
color: #000;
font-size: 15px;
display: flex;
align-items: center;
cursor: pointer;
&:hover {
color: #fff;
background: #409EFF;
}
}
}
.active{
color: #fff !important;
background: #409EFF;
}
.container {
display: flex;
flex-direction: column;
@ -498,11 +461,13 @@ const changeCheckDate = (dateItem: any) => {
.statistics-chart {
height: 382px;
display: flex;
.business-map{
.business-map {
flex: 1;
margin-right: 24px;
}
.consumption-map{
.consumption-map {
flex: 1;
}
}

View File

@ -120,4 +120,12 @@ export const getEndOfDay = (date: Date | string): string => {
dateDetail.setHours(23, 59, 59, 0); // 设置为当天 23:59:00
return formatDate(dateDetail).slice(0, 19); //
};
};
export const getCurrentDate=()=> {
const date = new Date();
const year = date.getFullYear();
// 月份从0开始所以要加1
const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份从0开始需要+1并补0
const day = String(date.getDate()).padStart(2, '0'); // 补0操作
return `${year}-${month}-${day}`;
}

View File

@ -139,7 +139,7 @@ const clickItem = (item: any) => {
}
const medicalQueueRef =ref();
const cancelReception = () => {
post('registration/changeStatus', {id: registerId.value, status: 1}).then((res: any) => {
post(apiConfig.RegistrationChangeStatus, {id: registerId.value, status: 1}).then((res: any) => {
medicalQueueRef.value?.changeCurItemOrStatus(res,1);
})
}

View File

@ -1,11 +0,0 @@
<script setup lang="ts">
</script>
<template>
</template>
<style scoped lang="scss">
</style>