This commit is contained in:
ChenQiuYu 2025-05-09 12:02:58 +08:00
parent c4e690f6ec
commit 2fc45d13a3
3 changed files with 105 additions and 28 deletions

View File

@ -26,5 +26,6 @@ export enum apiConfig{
*
*/
"ChargeListChargeLog"="charge/listChargeLog"//查询收费记录
"ChargeListChargeLog"="charge/listChargeLog",//查询收费记录
"recordGetChargeQueue"="medical/record/getChargeQueue"//查询收费记录
}

View File

@ -1,7 +1,21 @@
<template>
<Panel title="收费队列">
<template #tools>
<el-button type="primary" size="small">新增患者</el-button>
<el-button type="primary" plain size="small">新增患者</el-button>
<el-button type="primary" size="small" plain @click="setDate">
{{ selectedDateStr }}
<el-icon class="el-icon--right">
<CaretBottom/>
</el-icon>
</el-button>
<el-date-picker
v-model="selectedDate"
type="date"
placeholder="选择日期"
ref="datePickerRef"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
/>
</template>
<template #default>
<div class="container">
@ -16,7 +30,7 @@
</div>
<div class="list">
<el-scrollbar>
<ul>
<ul v-loading="loading">
<li class="list-item" :class="curItem.id == item.id ? 'active' : ''"
v-for="(item, index) in ChargeQueueList"
:key="index" @click="clickItem(item)">
@ -44,10 +58,12 @@
</template>
<script setup lang="ts">
import {onMounted, ref} from "vue";
import {onMounted, ref, watch} from "vue";
import {post} from "@/utils/request.ts";
import Panel from "@/components/common/Panel.vue";
import {formatListTime, getToday} from "@/utils/dateUtils.ts";
import {formatListTime, getCurrentDate, getEndOfDay, getToday} from "@/utils/dateUtils.ts";
import {CaretBottom} from "@element-plus/icons-vue";
import {apiConfig} from "@/assets/config/apiConfig.ts";
const curItem = ref<any>({});
const emit = defineEmits(['clickItem'])
@ -55,16 +71,9 @@ const clickItem = (item: any) => {
curItem.value = item
emit('clickItem', item, query.value.status);
}
const data = ref<any>(getToday())
const loading= ref(false)
const ChargeQueueList = ref<any>([]);
const query = ref({
pageSize: 20,
pageNum: 1,
keyword: "",
status: 0,
beginTime: data.value.start,
endTime: data.value.end
})
const addChargeOrder = () => {
const newOrder = {
id: -1,
@ -80,21 +89,39 @@ const addChargeOrder = () => {
const clickFirst = () => {
clickItem(ChargeQueueList.value[0])
}
const getOrderList = () => {
post("medical/record/getChargeQueue", {query: query.value}).then(
(res: any) => {
ChargeQueueList.value = res.list
clickFirst()
}
)
const selectedDate: any = ref('')
const query = ref({
pageSize: 20,
pageNum: 1,
keyword: "",
status: 0,
beginTime: selectedDate.value,
endTime: getEndOfDay(selectedDate.value)
})
const init = async () => {
selectedDateStr.value = setDateTip()
query.value.beginTime = selectedDate.value
query.value.endTime = getEndOfDay(selectedDate.value)
loading.value = true
try {
let data:any = await post(apiConfig.recordGetChargeQueue, {query: query.value}, {catch_error: true})
ChargeQueueList.value = data.list
}
catch {
}
finally {
loading.value = false
}
getTipCount()
}
const delDraft = () => {
ChargeQueueList.value.shift();
clickFirst()
}
defineExpose({delDraft, getOrderList})
defineExpose({delDraft, init})
onMounted(() => {
getOrderList()
selectedDate.value = getCurrentDate()
init()
})
const statusList = ref([
@ -111,14 +138,51 @@ const statusList = ref([
])
const tab = (item: any) => {
query.value.status = item.value
getOrderList()
init()
}
const init = () => {
post('statistics/getTipCount', {beginTime: data.value.start, endTime: data.value.end}).then((res: any) => {
const getTipCount = () => {
post('statistics/getTipCount', {
beginTime: selectedDate.value,
endTime: getEndOfDay(selectedDate.value)
}).then((res: any) => {
statusList.value[0].num = res.unchargedCount
statusList.value[1].num = res.chargedCount
})
}
const selectedDateStr: any = ref('')
const datePickerRef = ref()
const setDate = function () {
if (datePickerRef.value) {
datePickerRef.value.handleOpen()
}
}
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">
.container {
@ -247,4 +311,13 @@ const init = () => {
padding-bottom: 10px;
}
}
:deep(.el-input--prefix) {
visibility: hidden;
width: 0;
height: 0;
position: absolute;
right: 0;
top: 50px;
}
</style>

View File

@ -1,7 +1,10 @@
<template>
<Panel :title="'就诊队列'" style="height: 100%">
<template #tools>
<div @click="setDate">{{selectedDateStr}}</div>
<el-button type="primary" plain @click="setDate">
{{selectedDateStr}}
<el-icon class="el-icon--right"><CaretBottom /></el-icon>
</el-button>
<el-date-picker
v-model="selectedDate"
type="date"
@ -52,6 +55,7 @@ import {post} from "@/utils/request.ts";
import {formatListTime, getToday, getThisMonth, getCurrentDate, getEndOfDay} from "@/utils/dateUtils.ts";
import {apiConfig} from "@/assets/config/apiConfig.ts";
import {ElMessageBox} from "element-plus";
import {CaretBottom} from '@element-plus/icons-vue'
const curStatus = ref(1)
const search = ref('')
const curItem = ref<any>('')
@ -119,7 +123,6 @@ const init = async () => {
}
initStatusList()
}
const data = ref<any>(getToday())
const initStatusList = () => {
post('statistics/getTipCount', {
beginTime: selectedDate.value,