Compare commits

..

2 Commits

Author SHA1 Message Date
LiJianZhao 63d0c2f15a Merge branch 'main' of ssh://git.jizhiweb.cn:2222/clinic-v2/web 2025-05-17 16:06:16 +08:00
LiJianZhao 5900170466 dev 2025-05-17 16:06:08 +08:00
1 changed files with 18 additions and 38 deletions

View File

@ -2,14 +2,15 @@
<Panel title="收费队列">
<template #tools>
<div @click="setDate" class="date-btn">
<span>{{ selectedDateStr }}</span>
<span>筛选</span>
<el-icon style="margin-left: 21px">
<Calendar/>
</el-icon>
</div>
<el-date-picker
v-model="selectedDate"
type="date"
type="daterange"
@change="dateChangeHandler"
placeholder="选择日期"
ref="datePickerRef"
format="YYYY-MM-DD"
@ -80,7 +81,7 @@
import {nextTick, onMounted, ref, watch} from "vue";
import {post} from "@/utils/request.ts";
import Panel from "@/components/common/Panel.vue";
import {formatListTime, getCurrentDate, getEndOfDay} from "@/utils/dateUtils.ts";
import {formatListTime, getCurrentDate, getEndOfDay, getToday} from "@/utils/dateUtils.ts";
import { Search,Calendar} from "@element-plus/icons-vue";
import {apiConfig} from "@/assets/config/apiConfig.ts";
import Edit from "@/components/registration/Edit.vue";
@ -103,19 +104,18 @@ const addChargeOrder = () => {
const clickFirst = () => {
clickItem(ChargeQueueList.value[0])
}
const selectedDate: any = ref('')
const selectedDate: any = ref()
const query = ref({
pageSize: 20,
pageNum: 1,
keyword: "",
status: 0,
beginTime: selectedDate.value,
endTime: getEndOfDay(selectedDate.value)
beginTime: "",
endTime: ""
})
const init = async () => {
selectedDateStr.value = setDateTip()
query.value.beginTime = selectedDate.value
query.value.endTime = getEndOfDay(selectedDate.value)
query.value.beginTime = selectedDate.value[0]
query.value.endTime = getEndOfDay(selectedDate.value[1])
loading.value = true
try {
let data: any = await post(apiConfig.RecordGetChargeQueue, {query: query.value}, {catch_error: true})
@ -133,7 +133,8 @@ const delDraft = () => {
}
defineExpose({delDraft, init})
onMounted(() => {
selectedDate.value = getCurrentDate()
let today = getToday()
selectedDate.value =[today.start,getEndOfDay(today.end)]
init()
})
const statusList = ref([
@ -161,8 +162,8 @@ const tab = (item: any) => {
}
const getTipCount = () => {
post('statistics/getTipCount', {
beginTime: selectedDate.value,
endTime: getEndOfDay(selectedDate.value)
beginTime: query.value.beginTime,
endTime: query.value.endTime
}).then((res: any) => {
statusList.value[0].num = res.unchargedCount
statusList.value[1].num = res.chargedCount
@ -170,39 +171,18 @@ const getTipCount = () => {
})
}
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;
}
const dateChangeHandler =(seDate:any)=>{
let date = formatListTime(seDate);
query.value.beginTime = date[0]
query.value.endTime = getEndOfDay(seDate)
init()
})
}
const searchInput = (v: any) => {
query.value.keyword = v
init()