This commit is contained in:
ChenQiuYu 2025-05-28 10:25:14 +08:00
parent 9b999fe6c6
commit 6d4a580b25
4 changed files with 76 additions and 119 deletions

View File

@ -2,13 +2,16 @@
<div class="container"> <div class="container">
<div class="content"> <div class="content">
<div class="title"> <div class="title">
<!-- <el-date-picker--> <el-date-picker
<!-- v-model="dateArray"--> v-model="dateArray"
<!-- type="daterange"--> type="daterange"
<!-- range-separator="~"--> range-separator="~"
<!-- start-placeholder="开始日期"--> start-placeholder="开始日期"
<!-- end-placeholder="结束日期"--> end-placeholder="结束日期"
<!-- />--> format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
@change="getDailyReport"
/>
</div> </div>
<div class="content-box"> <div class="content-box">
<el-table :data="list" style="width: 100%" :summary-method="getSummaries" show-summary> <el-table :data="list" style="width: 100%" :summary-method="getSummaries" show-summary>
@ -36,26 +39,28 @@
<script setup lang="ts"> <script setup lang="ts">
import {h, onMounted, ref, type VNode} from 'vue' import {h, onMounted, ref, type VNode} from 'vue'
import {post} from "@/utils/request.ts"; import {post} from "@/utils/request.ts";
import {getThisWeek} from "@/utils/dateUtils.ts"; import {getCurrentDate, getEndOfDay, getToday} from "@/utils/dateUtils.ts";
import type { TableColumnCtx } from 'element-plus' import type {TableColumnCtx} from 'element-plus'
import {API} from "@/assets/config/API.ts";
const dateArray = ref<any>([]) const dateArray = ref<any>([getToday().start, getToday().end])
const list = ref<any>([]) const list = ref<any>([])
const getDailyReport = () => {
const getDailyReport = ()=>{ console.log(dateArray.value)
post(API.Charge."charge/dailyChargingReport",{startDate:dateArray.value[0],endDate:dateArray.value[1]} ).then((res:any)=>{ post(API.Charge.Log.ReportWithDays, {startDate: dateArray.value[0], endDate: dateArray.value[1]}).then((res: any) => {
list.value = res list.value = res
}) })
} }
interface SummaryMethodProps<T> { interface SummaryMethodProps<T> {
columns: TableColumnCtx<T>[] columns: TableColumnCtx<T>[]
data: T[] data: T[]
} }
const getSummaries = (param: SummaryMethodProps<any>) => { const getSummaries = (param: SummaryMethodProps<any>) => {
const { columns, data } = param const {columns, data} = param
const sums: (string | VNode)[] = [] const sums: (string | VNode)[] = []
columns.forEach((column, index) => { columns.forEach((column, index) => {
if (index === 0) { if (index === 0) {
@ -64,18 +69,18 @@ const getSummaries = (param: SummaryMethodProps<any>) => {
]) ])
return return
} }
const values = data.map((item:any) => Number(item[column.property])) const values = data.map((item: any) => Number(item[column.property]))
if (!values.every((value) => Number.isNaN(value))) { if (!values.every((value) => Number.isNaN(value))) {
sums[index] = `${values.reduce((prev, curr) => { sums[index] = `${values.reduce((prev, curr) => {
const value = Number(curr) const value = Number(curr)
if (!Number.isNaN(value)) { if (!Number.isNaN(value)) {
return prev + curr return(prev + curr)
} else { } else {
return prev return prev
} }
}, 0)}` }, 0)}`
} else { } else {
sums[index] = '-' sums[index] = ''
} }
}) })
@ -83,16 +88,12 @@ const getSummaries = (param: SummaryMethodProps<any>) => {
} }
onMounted(() => {
onMounted(()=>{
let thisWeek = getThisWeek()
dateArray.value[0] = thisWeek.start
dateArray.value[1] = thisWeek.end
getDailyReport() getDailyReport()
}) })
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.title{ .title {
margin-bottom: 20px; margin-bottom: 20px;
} }
</style> </style>

View File

@ -2,69 +2,20 @@
<div class="container"> <div class="container">
<div class="content"> <div class="content">
<div class="title"> <div class="title">
<!-- <el-date-picker--> <el-date-picker
<!-- v-model="date"--> v-model="date"
<!-- type="daterange"--> type="daterange"
<!-- range-separator="~"--> range-separator="~"
<!-- start-placeholder="开始日期"--> start-placeholder="开始日期"
<!-- end-placeholder="结束日期"--> end-placeholder="结束日期"
<!-- />--> format="YYYY-MM-DD"
<!-- <el-select--> value-format="YYYY-MM-DD"
<!-- v-model="salesPerson"--> @change="getDate"
<!-- placeholder="销售人"--> />
<!-- style="width: 100px;margin: 0 10px"-->
<!-- >-->
<!-- <el-option-->
<!-- v-for="item in salesPersonOptions"-->
<!-- :key="item.value"-->
<!-- :label="item.label"-->
<!-- :value="item.value"-->
<!-- />-->
<!-- </el-select>-->
<!-- <el-select v-model="type" placeholder="类型" style="width: 100px">-->
<!-- <el-option-->
<!-- v-for="item in typeOptions"-->
<!-- :key="item.value"-->
<!-- :label="item.label"-->
<!-- :value="item.value"-->
<!-- />-->
<!-- </el-select>-->
<!-- <el-select v-model="source" placeholder="开单来源" style="width: 100px;margin-left: 10px">-->
<!-- <el-option-->
<!-- v-for="item in sourceOptions"-->
<!-- :key="item.value"-->
<!-- :label="item.label"-->
<!-- :value="item.value"-->
<!-- />-->
<!-- </el-select>-->
<!-- <el-select-->
<!-- v-model="chargeMan"-->
<!-- placeholder="收费员"-->
<!-- style="width: 100px;margin-left: 10px"-->
<!-- >-->
<!-- <el-option-->
<!-- v-for="item in chargeManOptions"-->
<!-- :key="item.value"-->
<!-- :label="item.label"-->
<!-- :value="item.value"-->
<!-- />-->
<!-- </el-select>-->
<!-- <el-select-->
<!-- v-model="pay"-->
<!-- placeholder="支付方式"-->
<!-- style="width: 100px;margin-left: 10px"-->
<!-- >-->
<!-- <el-option-->
<!-- v-for="item in payOptions"-->
<!-- :key="item.value"-->
<!-- :label="item.label"-->
<!-- :value="item.value"-->
<!-- />-->
<!-- </el-select>-->
</div> </div>
<div class="content-box"> <div class="content-box">
<el-table :data="tableData" style="width: 100%"> <el-table :data="tableData" style="width: 100%">
<el-table-column prop="chargeTime" label="收费时间" align="center" show-overflow-tooltip/> <el-table-column prop="chargeTime" label="收费时间" show-overflow-tooltip/>
<el-table-column label="销售单号" prop="projectCode" show-overflow-tooltip></el-table-column> <el-table-column label="销售单号" prop="projectCode" show-overflow-tooltip></el-table-column>
<el-table-column label="患者姓名" prop="customer" show-overflow-tooltip></el-table-column> <el-table-column label="患者姓名" prop="customer" show-overflow-tooltip></el-table-column>
<el-table-column prop="source" label="开单来源" show-overflow-tooltip /> <el-table-column prop="source" label="开单来源" show-overflow-tooltip />
@ -72,10 +23,10 @@
<el-table-column prop="originalPrice" label="原价" align="center" show-overflow-tooltip></el-table-column> <el-table-column prop="originalPrice" label="原价" align="center" show-overflow-tooltip></el-table-column>
<el-table-column prop="discount" label="优惠" align="center" show-overflow-tooltip></el-table-column> <el-table-column prop="discount" label="优惠" align="center" show-overflow-tooltip></el-table-column>
<el-table-column prop="receivable" label="应收" align="center" show-overflow-tooltip></el-table-column> <el-table-column prop="receivable" label="应收" align="center" show-overflow-tooltip></el-table-column>
<el-table-column prop="netReceipts" label="实收" align="center" show-overflow-tooltip></el-table-column> <el-table-column prop="netReceipts" label="实收" align="center" show-overflow-tooltip></el-table-column>
<el-table-column prop="payType" label="支付类型" align="center" show-overflow-tooltip></el-table-column> <el-table-column prop="payType" label="支付类型" align="center" show-overflow-tooltip></el-table-column>
<el-table-column label="销售人" prop="salePersonId" show-overflow-tooltip></el-table-column> <el-table-column label="销售人" prop="salePersonId" show-overflow-tooltip>
</el-table-column>
</el-table> </el-table>
</div> </div>
</div> </div>
@ -85,8 +36,11 @@
import {onMounted, ref} from 'vue' import {onMounted, ref} from 'vue'
import {post} from "@/utils/request.ts"; import {post} from "@/utils/request.ts";
import {API} from "@/assets/config/API.ts"; import {API} from "@/assets/config/API.ts";
import {getCurrentDate, getPrevious30Days} from "@/utils/dateUtils.ts";
const tableData = ref<any[]>([]) const tableData = ref<any[]>([])
const date = ref<any>([]) const date = ref<any>([
getPrevious30Days() ,getCurrentDate()
])
const salesPerson = ref<any>('') const salesPerson = ref<any>('')
const salesPersonOptions = [{} const salesPersonOptions = [{}
] ]
@ -118,7 +72,7 @@ const payOptions = [{
] ]
const getDate = () => { const getDate = () => {
post(API.Statistics.Base.GetQueueCount).then((res:any)=>{ post(API.Charge.Log.List,{beginTime:date.value[0],endTime:date.value[1]}).then((res:any)=>{
tableData.value = res.list tableData.value = res.list
}) })
} }

View File

@ -2,30 +2,33 @@
<div class="container"> <div class="container">
<div class="content"> <div class="content">
<div class="title"> <div class="title">
<!-- <el-date-picker--> <!-- <el-date-picker-->
<!-- v-model="date"--> <!-- v-model="date"-->
<!-- type="daterange"--> <!-- type="daterange"-->
<!-- range-separator="~"--> <!-- range-separator="~"-->
<!-- start-placeholder="开始日期"--> <!-- start-placeholder="开始日期"-->
<!-- end-placeholder="结束日期"--> <!-- end-placeholder="结束日期"-->
<!-- />--> <!-- />-->
<!-- <el-select--> <!-- <el-select-->
<!-- v-model="chargeMan"--> <!-- v-model="chargeMan"-->
<!-- placeholder="收费员"--> <!-- placeholder="收费员"-->
<!-- style="width: 100px;margin-left: 10px"--> <!-- style="width: 100px;margin-left: 10px"-->
<!-- >--> <!-- >-->
<!-- <el-option--> <!-- <el-option-->
<!-- v-for="item in chargeManOptions"--> <!-- v-for="item in chargeManOptions"-->
<!-- :key="item.value"--> <!-- :key="item.value"-->
<!-- :label="item.label"--> <!-- :label="item.label"-->
<!-- :value="item.value"--> <!-- :value="item.value"-->
<!-- />--> <!-- />-->
<!-- </el-select>--> <!-- </el-select>-->
</div> </div>
<div class="content-box"> <div class="content-box">
<el-table :data="tableData" style="width: 100%"> <el-table :data="tableData" style="width: 100%">
<el-table-column prop="salePersonName" label="收费员" align="center"/> <el-table-column prop="salePersonName" label="收费员" align="center"></el-table-column>
<el-table-column prop="totalIncome" label="营业收入/总金额" align="center"> <el-table-column prop="totalIncome" label="营业收入/总金额" align="center">
<template #default="scope">
{{ scope.row.totalIncome ? scope.row.totalIncome : 0 }}
</template>
</el-table-column> </el-table-column>
<el-table-column label="支付方式" align="center"> <el-table-column label="支付方式" align="center">
<el-table-column prop="socialIncome" label="医保" align="center"/> <el-table-column prop="socialIncome" label="医保" align="center"/>
@ -34,7 +37,10 @@
<el-table-column prop="cashIncome" label="现金" align="center"/> <el-table-column prop="cashIncome" label="现金" align="center"/>
<el-table-column prop="otherIncome" label="其他" align="center"/> <el-table-column prop="otherIncome" label="其他" align="center"/>
</el-table-column> </el-table-column>
<el-table-column label="收费人次" align="center"> <el-table-column prop="count" label="收费人次" align="center">
<template #default="scope">
{{ scope.row.count ? scope.row.count : 0 }}
</template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
@ -54,12 +60,11 @@ const chargeMan = ref<any>('');
const chargeManOptions = ref<any>([]); const chargeManOptions = ref<any>([]);
const getSalePersonCharge = () => { const getSalePersonCharge = () => {
post(API.Statistics.Base.SalePerson).then((res:any)=>{ post(API.Statistics.Base.SalePerson).then((res: any) => {
tableData.value = res tableData.value = res
}) })
} }
onMounted(()=>{ onMounted(() => {
getSalePersonCharge() getSalePersonCharge()
}) })

View File

@ -399,7 +399,6 @@ const initIncomeChart = () => {
date.start = selectIncomeDate.value[0] date.start = selectIncomeDate.value[0]
date.end = selectIncomeDate.value[1] date.end = selectIncomeDate.value[1]
} }
post(API.Statistics.Base.GetPayOverview, {beginTime: date.start, endTime: date.end}).then((res: any) => { post(API.Statistics.Base.GetPayOverview, {beginTime: date.start, endTime: date.end}).then((res: any) => {
incomeDateList.value = res.dateList incomeDateList.value = res.dateList
incomeCommonData.value = res.commonPrice incomeCommonData.value = res.commonPrice
@ -446,7 +445,6 @@ const changeSelectIncomeDate = (date: any) => {
} }
const curCountDate = ref<any>(weekAndMonth[0]); const curCountDate = ref<any>(weekAndMonth[0]);
const selectCountDate = ref(); const selectCountDate = ref();
const changeCountDate = (dateItem: any) => { const changeCountDate = (dateItem: any) => {
@ -466,7 +464,7 @@ const countDateList = ref([
'2024-03-06', '2024-03-06',
'2024-03-02', '2024-03-02',
]) ])
const countDataList = ref([5, 20, 36, 10, 10, 20]) const countDataList = ref([5, 20, 36, 10, 10, 20])
const changeSelectCountDate = (date: any) => { const changeSelectCountDate = (date: any) => {
curCountDate.value = null curCountDate.value = null
selectCountDate.value = date selectCountDate.value = date
@ -496,8 +494,7 @@ const initCountChart = () => {
data: countDateList.value data: countDateList.value
}, },
yAxis: { yAxis: {},
},
series: [ series: [
{ {
name: '销量', name: '销量',
@ -529,7 +526,7 @@ const initCountChart = () => {
&:hover { &:hover {
color: #fff; color: #fff;
background: rgba(#4D6DE4,0.5); background: rgba(#4D6DE4, 0.5);
} }
} }