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

View File

@ -2,69 +2,20 @@
<div class="container">
<div class="content">
<div class="title">
<!-- <el-date-picker-->
<!-- v-model="date"-->
<!-- type="daterange"-->
<!-- range-separator="~"-->
<!-- start-placeholder="开始日期"-->
<!-- end-placeholder="结束日期"-->
<!-- />-->
<!-- <el-select-->
<!-- v-model="salesPerson"-->
<!-- 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>-->
<el-date-picker
v-model="date"
type="daterange"
range-separator="~"
start-placeholder="开始日期"
end-placeholder="结束日期"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
@change="getDate"
/>
</div>
<div class="content-box">
<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="customer" show-overflow-tooltip></el-table-column>
<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="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="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 label="销售人" prop="salePersonId" show-overflow-tooltip></el-table-column>
<el-table-column label="销售人" prop="salePersonId" show-overflow-tooltip>
</el-table-column>
</el-table>
</div>
</div>
@ -85,8 +36,11 @@
import {onMounted, ref} from 'vue'
import {post} from "@/utils/request.ts";
import {API} from "@/assets/config/API.ts";
import {getCurrentDate, getPrevious30Days} from "@/utils/dateUtils.ts";
const tableData = ref<any[]>([])
const date = ref<any>([])
const date = ref<any>([
getPrevious30Days() ,getCurrentDate()
])
const salesPerson = ref<any>('')
const salesPersonOptions = [{}
]
@ -118,7 +72,7 @@ const payOptions = [{
]
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
})
}

View File

@ -2,30 +2,33 @@
<div class="container">
<div class="content">
<div class="title">
<!-- <el-date-picker-->
<!-- v-model="date"-->
<!-- type="daterange"-->
<!-- range-separator="~"-->
<!-- start-placeholder="开始日期"-->
<!-- end-placeholder="结束日期"-->
<!-- />-->
<!-- <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-date-picker-->
<!-- v-model="date"-->
<!-- type="daterange"-->
<!-- range-separator="~"-->
<!-- start-placeholder="开始日期"-->
<!-- end-placeholder="结束日期"-->
<!-- />-->
<!-- <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>-->
</div>
<div class="content-box">
<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">
<template #default="scope">
{{ scope.row.totalIncome ? scope.row.totalIncome : 0 }}
</template>
</el-table-column>
<el-table-column 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="otherIncome" label="其他" align="center"/>
</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>
</div>
@ -54,12 +60,11 @@ const chargeMan = ref<any>('');
const chargeManOptions = ref<any>([]);
const getSalePersonCharge = () => {
post(API.Statistics.Base.SalePerson).then((res:any)=>{
post(API.Statistics.Base.SalePerson).then((res: any) => {
tableData.value = res
})
}
onMounted(()=>{
onMounted(() => {
getSalePersonCharge()
})

View File

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