chenyc
2025-11-14 5d6c0e614bab737842e402077bee47a9d4e18733
src/views/report/index.vue
@@ -1,7 +1,7 @@
<template>
    <div class="report">
        <div style="border: 1pt solid #707070;">
            <van-nav-bar title="" :left-text="typeName">
        <div>
            <van-nav-bar @click="fanhui" title="" left-arrow :left-text="typeName">
                <template #right>
                    <van-button
                        icon="todo-list-o"
@@ -63,6 +63,8 @@
    import itembody from './item/index.vue'
    import { ajaxPost } from '@/utils/axios'
    import { AxiosRequestConfig } from 'axios'
    import {useRouter} from 'vue-router'
    const router=useRouter()
    const showPopup = ref(false)
    const userInfo = userInfoStore()
    const typeName=ref('近三个月')
@@ -125,8 +127,7 @@
    }
    const getDatas=(dataDate)=>{
        console.log('获取数据', dataDate)
    const getDatas=()=>{
        console.log(userInfo.patient.patientInfo.code)
        // const pagedata={
        // patCode :'PAT9121102427442HIiL',
@@ -143,7 +144,10 @@
                'Content-Type': 'application/x-www-form-urlencoded',
            },
        }
        const pasm=`date1=${dataDate.value.startDate}&date2=${dataDate.value.endDate}&isGroupByFeeItem=1&patCode=PAT9121102427442HIiL`
        let pasm=`date1=${dataDate.value.startDate}&date2=${dataDate.value.endDate}&isGroupByFeeItem=1&patCode=${userInfo.patient.patientInfo.code}`
        if (!dataDate.value.startDate||!dataDate.value.endDate){
            pasm=`date1=2020-01-01&date2=2030-01-01&isGroupByFeeItem=1&patCode=${userInfo.patient.patientInfo.code}`
        }
        loading.value = true // 开始加载
        reportList.value=[]
        const toast = Toast.loading({
@@ -167,13 +171,15 @@
            console.error('获取数据失败', error)
        })
    }
    const fanhui=()=>{
        router.go(-1)
    }
    onMounted(() => {
        const now = new Date()
        const threeMonthsAgo = new Date(now)
        threeMonthsAgo.setMonth(now.getMonth() - 3)
        dataDate.value.startDate = formatDate(threeMonthsAgo)
        dataDate.value.endDate = formatDate(now)
        console.log('dataDate', dataDate.value)
        getDatas()
    })
</script>
@@ -238,6 +244,7 @@
    border-radius: 5pt;
    margin-bottom: 10pt;
    padding: 7pt;
    border-bottom: 1px solid #b4afaf;
}
.icon {