浏览代码

Merge branch 'main' of 192.168.1.121:yp_web/wkx-his-web

Huanyi 3 周之前
父节点
当前提交
06aa0ace66

+ 63 - 0
src/api/settlement/accountSettlementAccounts/index.ts

@@ -0,0 +1,63 @@
+import request from '@/utils/request';
+import { AxiosPromise } from 'axios';
+import { AccountVO, AccountForm, AccountQuery } from '@/api/settlement/accountSettlementAccounts/types';
+
+/**
+ * 查询患者账户信息列表
+ * @param query
+ * @returns {*}
+ */
+
+export const listAccount = (query?: AccountQuery): AxiosPromise<AccountVO[]> => {
+  return request({
+    url: '/settlement/accountSettleAccounts/list',
+    method: 'get',
+    params: query
+  });
+};
+
+/**
+ * 查询患者账户信息详细
+ * @param id
+ */
+export const getAccount = (id: string | number): AxiosPromise<AccountVO> => {
+  return request({
+    url: '/settlement/accountSettleAccounts/' + id,
+    method: 'get'
+  });
+};
+
+/**
+ * 新增患者账户信息
+ * @param data
+ */
+export const addAccount = (data: AccountForm) => {
+  return request({
+    url: '/settlement/accountSettleAccounts',
+    method: 'post',
+    data: data
+  });
+};
+
+/**
+ * 修改患者账户信息
+ * @param data
+ */
+export const updateAccount = (data: AccountForm) => {
+  return request({
+    url: '/settlement/accountSettleAccounts',
+    method: 'put',
+    data: data
+  });
+};
+
+/**
+ * 删除患者账户信息
+ * @param id
+ */
+export const delAccount = (id: string | number | Array<string | number>) => {
+  return request({
+    url: '/settlement/accountSettleAccounts/' + id,
+    method: 'delete'
+  });
+};

+ 311 - 0
src/api/settlement/accountSettlementAccounts/types.ts

@@ -0,0 +1,311 @@
+export interface AccountVO {
+  /**
+   * 主键ID
+   */
+  id: string | number;
+
+  /**
+   * 患者ID
+   */
+  patientId: string | number;
+
+  /**
+   * 患者姓名
+   */
+  patientName: string;
+
+  /**
+   * 患者病例ID
+   */
+  patientCaseId: string | number;
+
+  /**
+   * 身份证号
+   */
+  idCard: string | number;
+
+  /**
+   * 性别:1-男,2-女
+   */
+  sex: string ;
+
+  /**
+   * 联系电话
+   */
+  phone: string;
+
+  /**
+   * 账户
+   */
+  serialNo: string;
+
+  /**
+   * 账户余额
+   */
+  totalAmount: number;
+
+  /**
+   * 账户充值
+   */
+  totalIncome: number;
+
+  /**
+   * 账户消费
+   */
+  totalExpand: number;
+
+  /**
+   * 待缴金额
+   */
+  unpaidAmount: string | number;
+
+  /**
+   * 可用金额
+   */
+  availableAmount: number;
+
+  /**
+   * 授信金额
+   */
+  creditAmount: number;
+
+  /**
+   * 可用授信额度
+   */
+  creditLimit: number;
+
+  /**
+   * 状态:0-正常,1-禁用
+   */
+  status: number;
+
+  /**
+   * 激活状态:0-未激活,1-已激活
+   */
+  activated: number;
+
+  /**
+   * 备注
+   */
+  remark: string;
+
+  /**
+   * 待处理事项
+   */
+  waitingTask: string;
+
+  visitType: string;
+
+  doorId: number;
+
+  deptName: string;
+
+  patientNo: string | number;
+
+  treatNum: string | number;
+
+  wardName: string;
+}
+
+export interface AccountForm extends BaseEntity {
+  /**
+   * 主键ID
+   */
+  id?: string | number;
+
+  /**
+   * 患者ID
+   */
+  patientId?: string | number;
+
+  /**
+   * 患者姓名
+   */
+  patientName?: string;
+
+  /**
+   * 患者病例ID
+   */
+  patientCaseId?: string | number;
+
+  /**
+   * 身份证号
+   */
+  idCard?: string | number;
+
+  /**
+   * 性别:1-男,2-女
+   */
+  sex?: string | number;
+
+  /**
+   * 联系电话
+   */
+  phone?: string;
+
+  /**
+   * 账户
+   */
+  serialNo?: string;
+
+  /**
+   * 账户余额
+   */
+  totalAmount?: number;
+
+  /**
+   * 账户充值
+   */
+  totalIncome?: number;
+
+  /**
+   * 账户消费
+   */
+  totalExpand?: number;
+
+  /**
+   * 待缴金额
+   */
+  unpaidAmount?: string | number;
+
+  /**
+   * 可用金额
+   */
+  availableAmount?: number;
+
+  /**
+   * 授信金额
+   */
+  creditAmount?: number;
+
+  /**
+   * 可用授信额度
+   */
+  creditLimit?: number;
+
+  /**
+   * 状态:0-正常,1-禁用
+   */
+  status?: number;
+
+  /**
+   * 激活状态:0-未激活,1-已激活
+   */
+  activated?: number;
+
+  /**
+   * 备注
+   */
+  remark?: string;
+
+  /**
+   * 待处理事项
+   */
+  waitingTask?: string;
+
+  visitType?: string;
+
+  doorId?: number;
+
+  deptName?: string;
+
+  patientNo?: string | number;
+
+  treatNum?: string | number;
+
+  wardName?: string;
+}
+
+export interface AccountQuery extends PageQuery {
+  /**
+   * 患者ID
+   */
+  patientId?: string | number;
+
+  /**
+   * 患者姓名
+   */
+  patientName?: string;
+
+  /**
+   * 患者病例ID
+   */
+  patientCaseId?: string | number;
+
+  /**
+   * 身份证号
+   */
+  idCard?: string | number;
+
+  /**
+   * 性别:1-男,2-女
+   */
+  sex?: string | number;
+
+  /**
+   * 联系电话
+   */
+  phone?: string;
+
+  /**
+   * 账户
+   */
+  serialNo?: string;
+
+  /**
+   * 账户余额
+   */
+  totalAmount?: number;
+
+  /**
+   * 账户充值
+   */
+  totalIncome?: number;
+
+  /**
+   * 账户消费
+   */
+  totalExpand?: number;
+
+  /**
+   * 待缴金额
+   */
+  unpaidAmount?: string | number;
+
+  /**
+   * 可用金额
+   */
+  availableAmount?: number;
+
+  /**
+   * 授信金额
+   */
+  creditAmount?: number;
+
+  /**
+   * 可用授信额度
+   */
+  creditLimit?: number;
+
+  /**
+   * 状态:0-正常,1-禁用
+   */
+  status?: number;
+
+  /**
+   * 激活状态:0-未激活,1-已激活
+   */
+  activated?: number;
+
+  /**
+   * 待处理事项
+   */
+  waitingTask?: string;
+
+  searchValue?: string;
+
+  /**
+   * 日期范围参数
+   */
+  params?: any;
+}

+ 7 - 9
src/api/settlement/chargeRecord/types.ts

@@ -113,7 +113,6 @@ export interface ChrageRecordVO {
    * 备注
    */
   remark: string;
-
 }
 
 export interface ChrageRecordForm extends BaseEntity {
@@ -231,11 +230,9 @@ export interface ChrageRecordForm extends BaseEntity {
    * 备注
    */
   remark?: string;
-
 }
 
 export interface ChrageRecordQuery extends PageQuery {
-
   /**
    * 处方id
    */
@@ -341,11 +338,12 @@ export interface ChrageRecordQuery extends PageQuery {
    */
   treatNum?: string;
 
-    /**
-     * 日期范围参数
-     */
-    params?: any;
-}
-
+  searchValue?: string;
 
+  createTime?:string,
 
+  /**
+   * 日期范围参数
+   */
+  params?: any;
+}

+ 21 - 0
src/store/modules/settlementAccount.ts

@@ -0,0 +1,21 @@
+import {defineStore} from 'pinia';
+import {AccountVO} from '@/api/settlement/accountSettlementAccounts/types';
+
+export const usePatientAccountStore = defineStore('account', () => {
+  const accountInfoList = ref<AccountVO[]>([]);
+  const accountInfo = ref<AccountVO>();
+  const setAccountInfoList = (val) => {
+    accountInfoList.value = val;
+  };
+
+  const setAccountInfo = (val: AccountVO) => {
+    accountInfo.value = val;
+  };
+
+  return {
+    accountInfoList,
+    accountInfo,
+    setAccountInfo,
+    setAccountInfoList
+  };
+});

+ 396 - 0
src/views/settlement/accountSettleAccounts/accountDetail.vue

@@ -0,0 +1,396 @@
+<template>
+    <div class="account-detail-container">
+        <el-card shadow="always" class="back-card">
+            <el-button type="primary" plain size="large" @click="goBack">返回</el-button>
+            <span style="margin-left: 20px;">账户详情</span>
+        </el-card>
+        <!-- 患者基本信息卡片 -->
+        <el-card shadow="never" class="patient-info-card">
+
+            <div class="patient-basic-info">
+                <el-row :gutter="10">
+                    <el-col :span="4">
+                        <div class="info-item">
+                            <span class="label">患者姓名:</span>
+                            <span class="value">{{ useAccountStore.accountInfo.patientName || '' }}</span>
+                        </div>
+                    </el-col>
+                    <el-col :span="5">
+                        <div class="info-item">
+                            <span class="label">性别:</span>
+                            <span class="value">{{ useAccountStore.accountInfo.sex=='1'?'男':'女'}}</span>
+                        </div>
+                    </el-col>
+                    <el-col :span="5">
+                        <div class="info-item">
+                            <span class="label">身份证号:</span>
+                            <span class="value">{{ useAccountStore.accountInfo.idCard || '' }}</span>
+                        </div>
+                    </el-col>
+                    <el-col :span="5">
+                        <div class="info-item">
+                            <span class="label">病区:</span>
+                            <span class="value">{{ useAccountStore.accountInfo.wardName || '--' }}</span>
+                        </div>
+                    </el-col>
+                    <el-col :span="5">
+                        <div class="info-item">
+                            <span class="label">科室:</span>
+                            <span class="value">{{ useAccountStore.accountInfo.deptName || '' }}</span>
+                        </div>
+                    </el-col>
+                </el-row>
+
+                <el-row :gutter="10">
+                    <el-col :span="4">
+                        <div class="info-item">
+                            <span class="label">看诊类型:</span>
+                            <span class="value">{{getDictLabel(treatment_user_type,useAccountStore.accountInfo.visitType) || '' }}</span>
+                        </div>
+                    </el-col>
+                    <el-col :span="5">
+                        <div class="info-item">
+                            <span class="label">门诊/住院号:</span>
+                            <span class="value">{{ useAccountStore.accountInfo.patientNo || '' }}</span>
+                        </div>
+                    </el-col>
+                    <el-col :span="5">
+                        <div class="info-item">
+                            <span class="label">诊疗卡号:</span>
+                            <span class="value">{{ useAccountStore.accountInfo.treatNum || '' }}</span>
+                        </div>
+                    </el-col>
+                    <el-col :span="5">
+                        <div class="info-item">
+                            <span class="label">账户:</span>
+                            <span class="value">{{ useAccountStore.accountInfo.serialNo || '' }}</span>
+                        </div>
+                    </el-col>
+                    <el-col :span="5">
+                        <div class="info-item">
+                            <span class="label">账户授信额度(元):</span>
+                            <span class="value">{{ (useAccountStore.accountInfo.creditLimit || 0).toFixed(2) }}</span>
+                        </div>
+                    </el-col>
+                </el-row>
+            </div>
+        </el-card>
+
+        <!-- 账户统计信息卡片 -->
+        <div class="account-stats-section">
+            <el-row :gutter="10">
+                <el-col :span="3">
+                    <div class="stat-card">
+                        <div class="stat-label">账户充值(元)</div>
+                        <div class="stat-value">{{ (useAccountStore.accountInfo.totalIncome || 0).toFixed(2) }}</div>
+                    </div>
+                </el-col>
+                <el-col :span="3">
+                    <div class="stat-card">
+                        <div class="stat-label">账户余额(元)</div>
+                        <div class="stat-value">{{ (useAccountStore.accountInfo.totalAmount || 0).toFixed(2) }}</div>
+                    </div>
+                </el-col>
+                <el-col :span="3">
+                    <div class="stat-card">
+                        <div class="stat-label">可用授信额度(元)</div>
+                        <div class="stat-value">{{ (useAccountStore.accountInfo.creditAmount || 0).toFixed(2) }}</div>
+                    </div>
+                </el-col>
+                <el-col :span="3">
+                    <div class="stat-card">
+                        <div class="stat-label">账户消费(元)</div>
+                        <div class="stat-value">{{ (useAccountStore.accountInfo.totalExpand || 0).toFixed(2) }}</div>
+                    </div>
+                </el-col>
+                <el-col :span="3">
+                    <div class="stat-card">
+                        <div class="stat-label">待缴金额(元)</div>
+                        <div class="stat-value">{{ (useAccountStore.accountInfo.unpaidAmount || 0).toFixed(2) }}</div>
+                    </div>
+                </el-col>
+                <el-col :span="3">
+                    <div class="stat-card">
+                        <div class="stat-label">退户费用(元)</div>
+                        <div class="stat-value">{{ (0).toFixed(2) }}</div>
+                    </div>
+                </el-col>
+            </el-row>
+        </div>
+
+        <!-- 查询条件 -->
+        <el-card shadow="never" class="query-card">
+            <el-form :model="queryParams" :inline="true" label-width="90">
+                <el-form-item label="操作日期:">
+                    <el-date-picker v-model="createTime" value-format="YYYY-MM-DD HH:mm:ss" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="[new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 1, 1, 23, 59, 59)]"></el-date-picker>
+                </el-form-item>
+                <el-form-item>
+                    <el-button type="primary" @click="handleQuery">查询</el-button>
+                    <el-button @click="resetQuery">重置</el-button>
+                </el-form-item>
+            </el-form>
+
+            <div class="action-buttons">
+                <el-button type="primary" >打印交易记录</el-button>
+                <el-button type="primary" @click="handleExport">导出数据</el-button>
+            </div>
+        </el-card>
+
+        <!-- 交易记录表格 -->
+        <el-card shadow="never">
+            <el-table v-loading="loading" :data="recordList" stripe>
+                <el-table-column label="序号" type="index" width="60" align="center" />
+                <el-table-column label="操作日期" prop="createTime" align="center" />
+                <el-table-column label="收费分类" prop="chargeType" align="center">
+                    <template #default="scope">
+                        <span>{{ getDictLabel(fee_type, scope.row.chargeType) }}</span>
+                    </template>
+                </el-table-column>
+                <el-table-column label="订单类型" prop="chargeType" align="center">
+                    <template #default="scope">
+                        <span>{{ getDictLabel(fee_type, scope.row.chargeType) }}</span>
+                    </template>
+                </el-table-column>
+                <el-table-column label="支付方式" prop="paymentMethod" align="center">
+                    <template #default="scope">
+                        <span>{{ getDictLabel(charge_way, scope.row.paymentMethod) }}</span>
+                    </template>
+                </el-table-column>
+                <el-table-column label="支付渠道" prop="paymentMethod" align="center">
+                    <template #default="scope">
+                        <span>{{ getDictLabel(charge_way, scope.row.paymentMethod) }}</span>
+                    </template>
+                </el-table-column>
+                <el-table-column label="交易金额" prop="fundsReceived" align="center" />
+                <el-table-column label="交易状态" prop="status" align="center">
+                    <template #default="scope">
+                        <span>{{ getDictLabel(action_status, scope.row.status) }}</span>
+                    </template>
+                </el-table-column>
+                <el-table-column label="处方ID" prop="settlementId" align="center" />
+                <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="200px">
+
+                </el-table-column>
+            </el-table>
+
+            <!-- 分页 -->
+            <div class="pagination-container">
+                <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getTransactionList" />
+            </div>
+        </el-card>
+    </div>
+</template>
+
+<script setup name="AccountDetail" lang="ts">
+    import { ref, reactive, onMounted, computed } from 'vue';
+    import { useRouter, useRoute } from 'vue-router';
+    import { listRecord } from '@/api/settlement/chargeRecord';
+    import { ChrageRecordVO, ChrageRecordQuery, ChrageRecordForm } from '@/api/settlement/chargeRecord/types';
+    const { proxy } = getCurrentInstance() as ComponentInternalInstance;
+    const { treatment_user_type, user_sex, charge_way, fee_type, action_status } = toRefs < any > (proxy ?.useDict('treatment_user_type', 'user_sex', 'charge_way', 'fee_type', 'action_status'));
+    const route = useRoute();
+    const router = useRouter();
+    const loading = ref(false);
+    const total = ref(0);
+    const dateRange = ref([]);
+    import { usePatientAccountStore } from '@/store/modules/settlementAccount';
+    import { param } from '@/utils';
+    const useAccountStore = usePatientAccountStore();
+    // 患者信息
+    const recordList = ref < ChrageRecordVO[] > ([]);
+    // 账户统计信息
+
+    // 查询参数
+    const queryParams = reactive({
+        pageNum: 1,
+        pageSize: 10,
+        patientId: useAccountStore.accountInfo.patientId,
+        param: {}
+    });
+    const createTime = ref < [DateModelType, DateModelType] > (['', '']);
+
+    // 字典label工具
+    function getDictLabel(dictList: any[], value: string) {
+        if (!dictList || !Array.isArray(dictList)) return value || '--';
+        const found = dictList.find((item) => item.value === value);
+        return found ? found.label : value || '--';
+    }
+
+    /** 获取账户详情 */
+    const getAccountDetail = async () => {
+        try {
+            const accountId = route.params.id as string;
+            if (!accountId) return;
+
+
+        } catch (error) {
+            console.error('获取账户详情失败:', error);
+        }
+    };
+
+    /** 获取交易记录列表 */
+    const getTransactionList = async () => {
+        loading.value = true;
+        try {
+            // 这里应该调用获取交易记录的API
+            const res = await listRecord(proxy ?.addDateRange(queryParams, createTime.value));
+            recordList.value = res.rows;
+            total.value = res.total;
+            // 临时模拟数据
+        } catch (error) {
+            console.error('获取交易记录失败:', error);
+        } finally {
+            loading.value = false;
+        }
+    };
+
+    // 返回按钮
+    const goBack = () => {
+        router.back();
+    };
+
+    /** 查询按钮操作 */
+    const handleQuery = () => {
+
+        queryParams.pageNum = 1;
+        getTransactionList();
+    };
+
+    /** 重置按钮操作 */
+    const resetQuery = () => {
+        createTime.value = undefined;
+        queryParams.pageNum = 1;
+        getTransactionList();
+    };
+
+    /** 导出按钮操作 */
+    const handleExport = () => {
+        proxy ?.download('settlement/chargeRecord/export', {
+            ...queryParams
+        }, `record_${new Date().getTime()}.xlsx`)
+    }
+
+    /** 导入按钮操作 */
+    const handleImport = () => {
+        proxy ?.$modal.msgInfo('导出功能开发中...');
+    };
+
+    onMounted(() => {
+        getAccountDetail();
+        getTransactionList();
+    });
+</script>
+
+<style lang="scss" scoped>
+    .account-detail-container {
+        padding: 20px;
+        background-color: #f5f7fa;
+        min-height: calc(100vh - 84px);
+    }
+
+    .patient-info-card {
+        margin-bottom: 20px;
+
+        .card-header {
+            .header-title {
+                font-size: 16px;
+                font-weight: 600;
+                color: #303133;
+            }
+        }
+    }
+
+    .patient-basic-info {
+        .info-item {
+            display: flex;
+            align-items: center;
+            margin-bottom: 16px;
+
+            .label {
+                font-weight: 500;
+                color: #606266;
+                min-width: 120px;
+                flex-shrink: 0;
+            }
+
+            .value {
+                color: #303133;
+                flex: 1;
+            }
+        }
+    }
+
+    .account-stats-section {
+        margin-bottom: 20px;
+
+        .stat-card {
+            background: white;
+            border: 1px solid #dcdfe6;
+            border-radius: 4px;
+            padding: 20px;
+            text-align: center;
+            transition: all 0.3s;
+
+            &:hover {
+                box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
+            }
+
+            .stat-label {
+                font-size: 14px;
+                color: #909399;
+                margin-bottom: 8px;
+            }
+
+            .stat-value {
+                font-size: 24px;
+                font-weight: 600;
+                color: #e6a23c;
+            }
+        }
+    }
+
+    .query-card {
+        margin-bottom: 20px;
+
+        .el-form {
+            display: flex;
+            align-items: center;
+            justify-content: space-between;
+
+            .el-form-item {
+                margin-bottom: 0;
+            }
+        }
+
+        .action-buttons {
+            margin-top: 15px;
+
+            .el-button {
+                margin-left: 10px;
+            }
+        }
+    }
+
+    .pagination-container {
+        display: flex;
+        justify-content: right;
+        margin-top: 20px;
+    }
+
+    :deep(.el-card__header) {
+        background-color: #fafafa;
+        border-bottom: 1px solid #ebeef5;
+    }
+
+    :deep(.el-table) {
+        .el-table__header {
+            background-color: #fafafa;
+
+            th {
+                background-color: #fafafa !important;
+                color: #606266;
+                font-weight: 600;
+            }
+        }
+    }
+</style>

+ 588 - 0
src/views/settlement/accountSettleAccounts/index.vue

@@ -0,0 +1,588 @@
+<template>
+    <div class="p-2">
+        <transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
+            <div v-show="showSearch" class="mb-[10px]">
+                <el-card shadow="hover">
+                    <el-form ref="queryFormRef" :model="queryParams" :inline="true" :label-width="120">
+                        <el-form-item label="账户余额范围:" prop="patientId">
+                            <el-input v-model="queryParams.patientId" placeholder="请输入患者ID" clearable @keyup.enter="handleQuery" />
+                        </el-form-item>
+                        <el-form-item>
+                            <el-input v-model="queryParams.searchValue" placeholder="患者姓名/身份证号" style="width: 240px; " clearable />
+                        </el-form-item>
+                        <el-form-item>
+                            <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
+                            <el-button icon="Refresh" @click="resetQuery">重置</el-button>
+                        </el-form-item>
+                    </el-form>
+                </el-card>
+            </div>
+        </transition>
+
+        <el-card shadow="never">
+            <template #header>
+                <el-row :gutter="10" class="mb8">
+                    <el-col :span="1.5">
+                        <el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['settlement:accountSettleAccounts:add']">新增</el-button>
+                    </el-col>
+                    <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
+                </el-row>
+            </template>
+
+            <el-table v-loading="loading" border :data="accountList" @selection-change="handleSelectionChange">
+                <el-table-column type="selection" width="55" align="center" />
+                <el-table-column label="主键ID" align="center" prop="id" v-if="false" />
+                <el-table-column label="账户" align="center" prop="serialNo" />
+                <el-table-column label="患者姓名" align="center" prop="patientName" />
+                <el-table-column label="联系电话" align="center" prop="phone" />
+                <el-table-column label="身份证号" align="center" prop="idCard" />
+                <el-table-column label="授信金额" align="center" prop="creditAmount" />
+                <el-table-column label="可用授信额度" align="center" prop="creditLimit" />
+                <el-table-column label="账户充值" align="center" prop="totalIncome" />
+                <el-table-column label="账户余额" align="center" prop="totalAmount" />
+                <el-table-column label="账户消费" align="center" prop="totalExpand" />
+                <el-table-column label="待缴金额" align="center" prop="unpaidAmount" />
+                <el-table-column label="待处理事项" align="center" prop="waitingTask" />
+                <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="260px">
+                    <template #default="scope">
+                        <el-tooltip content="充值" placement="top">
+                            <el-button link type="primary" @click="handleIncome(scope.row)" v-hasPermi="['settlement:accountSettleAccounts:edit']">充值</el-button>
+                        </el-tooltip>
+                        <el-tooltip content="详情" placement="top">
+                            <el-button link type="primary" @click="handleDetail(scope.row)" v-hasPermi="['settlement:accountSettleAccounts:add']">详情</el-button>
+                        </el-tooltip>
+                        <el-tooltip content="出院结算" placement="top">
+                            <el-button link type="primary"  v-hasPermi="['settlement:accountSettleAccounts:remove']">出院结算</el-button>
+                        </el-tooltip>
+                        <el-tooltip content="授信额度" placement="top">
+                            <el-button link type="primary" @click="handleCredit(scope.row)" v-hasPermi="['settlement:accountSettleAccounts:remove']">授信额度</el-button>
+                        </el-tooltip>
+                    </template>
+                </el-table-column>
+            </el-table>
+
+            <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
+        </el-card>
+        <!-- 账户充值对话框 -->
+        <el-dialog :title="dialog.title" v-model="dialog.visible" width="40%" append-to-body>
+            <el-form ref="accountIncomeFormRef" :model="{ totalIncome, rechargeIncome, currentChargeMode, remark: form.remark }" :rules="incomeRules" label-width="80px">
+                <div class="patient-info">
+                    <el-row :gutter="20">
+                        <el-col :span="5">
+                            <div class="info-item">
+                                <span class="label">姓名:</span>
+                                <span class="value">{{ form.patientName  || '' }}</span>
+                            </div>
+                        </el-col>
+                        <el-col :span="5">
+                            <div class="info-item">
+                                <span class="label">性别:</span>
+                                <span class="value">{{ form.sex=='1'?'男':'女' }}</span>
+                            </div>
+                        </el-col>
+                        <el-col :span="5">
+                            <div class="info-item">
+                                <span class="label">身份证号:</span>
+                                <span class="value">{{ form.idCard || '' }}</span>
+                            </div>
+                        </el-col>
+
+                    </el-row>
+
+                    <el-row :gutter="20">
+                        <el-col :span="4">
+                            <div class="info-item">
+                                <span class="label">余额(元):</span>
+                                <span class="value">{{ form.totalAmount || '0.00' }}</span>
+                            </div>
+                        </el-col>
+                        <el-col :span="5">
+                            <div class="info-item">
+                                <span class="label">待缴金额(元):</span>
+                                <span class="value">{{ form.unpaidAmount || '0.00' }}</span>
+                            </div>
+                        </el-col>
+                    </el-row>
+                    <el-form-item prop="currentChargeMode">
+                        <div class="setting-group">
+                            <label class="setting-label">
+                                <span class="required">*</span>
+                                充值方式:
+                            </label>
+                            <el-radio-group v-model="currentChargeMode">
+                                <el-radio v-for="dict in filteredChargeWay" :key="dict.value" :value="dict.value">
+                                    {{ dict.label }}
+                                </el-radio>
+                            </el-radio-group>
+                        </div>
+                    </el-form-item>
+                    <el-form-item prop="totalIncome">
+                        <div class="setting-group">
+                            <label class="setting-label">
+                                <span class="required">*</span>
+                                充值金额(元):
+                            </label>
+                            <el-input style="width:260px" v-model="totalIncome" placeholder="请输入" />
+                        </div>
+                    </el-form-item>
+                    <el-form-item prop="rechargeIncome">
+                        <div class="setting-group">
+                            <label class="setting-label">
+                                <span class="required">*</span>
+                                确认充值金额(元):
+                            </label>
+                            <el-input style="width:260px" v-model="rechargeIncome" placeholder="请输入" />
+                        </div>
+                    </el-form-item>
+                    <el-form-item prop="remark">
+                        <div class="setting-group">
+                            <label class="setting-label">
+                                备注:
+                            </label>
+                            <el-input style="width:260px" v-model="form.remark" type="textarea" :rows="5" placeholder="请输入" />
+                        </div>
+                    </el-form-item>
+                </div>
+            </el-form>
+            <template #footer>
+                <div class="dialog-footer">
+                    <el-button v-if="showQRCodeButton" :loading="buttonLoading" type="primary">二维码支付</el-button>
+                    <el-button v-if="showQRCodeButton" :loading="buttonLoading" type="primary">扫码枪支付</el-button>
+                    <el-button :loading="buttonLoading" type="primary" @click="handleAddIncome">确认</el-button>
+                    <el-button :loading="buttonLoading" @click="incomeDialogCancel">取消</el-button>
+                </div>
+            </template>
+        </el-dialog>
+        <!-- 授信对话框 -->
+        <el-dialog :title="creditDialog.title" v-model="creditDialog.visible" width="40%" append-to-body>
+            <el-form ref="creditFormRef" :model="{ creditAmount: form.creditAmount }" :rules="creditRules" label-width="80px">
+                <div class="patient-info">
+                    <el-row :gutter="20">
+                        <el-col :span="5">
+                            <div class="info-item">
+                                <span class="label">姓名:</span>
+                                <span class="value">{{ form.patientName  || '' }}</span>
+                            </div>
+                        </el-col>
+                        <el-col :span="5">
+                            <div class="info-item">
+                                <span class="label">性别:</span>
+                                <span class="value">{{ form.sex=='1'?'男':'女' }}</span>
+                            </div>
+                        </el-col>
+                        <el-col :span="5">
+                            <div class="info-item">
+                                <span class="label">身份证号:</span>
+                                <span class="value">{{ form.idCard || '' }}</span>
+                            </div>
+                        </el-col>
+                    </el-row>
+                
+                    <el-form-item prop="creditAmount">
+                        <div class="setting-group">
+                            <label class="setting-label">
+                                <span class="required">*</span>
+                                原授信额度(元):
+                            </label>
+                            <span>{{ form.creditAmount||'0.00' }}</span>
+                        </div>
+                    </el-form-item>
+                    <el-form-item>
+                        <div class="setting-group">
+                            <label class="setting-label">
+                                <span class="required">*</span>
+                                修改后授信额度(元):
+                            </label>
+                            <el-input style="width:260px" v-model="creditAmount" placeholder="请输入" />
+                        </div>
+                    </el-form-item>
+
+                </div>
+            </el-form>
+            <template #footer>
+                <div class="dialog-footer">
+                    <el-button :loading="buttonLoading" type="primary" @click="handleAddCredit">确认</el-button>
+                    <el-button :loading="buttonLoading" @click="creditDialogCancel">取消</el-button>
+                </div>
+            </template>
+        </el-dialog>
+
+    </div>
+</template>
+
+<script setup name="Account" lang="ts">
+    import { listAccount, getAccount, delAccount, addAccount, updateAccount } from '@/api/settlement/accountSettlementAccounts';
+    import { AccountVO, AccountQuery, AccountForm } from '@/api/settlement/accountSettlementAccounts/types';
+    import { ChargeSetVO } from '@/api/parameter/chargeSet/types';
+    const { proxy } = getCurrentInstance() as ComponentInternalInstance;
+    const { user_sex, charge_way } = toRefs < any > (proxy ?.useDict('user_sex', 'charge_way'));
+    import { useChargeSetStore } from '@/store/modules/chargeSet';
+    const useStore = useChargeSetStore();
+    import { usePatientAccountStore } from '@/store/modules/settlementAccount';
+    const useAccountStore = usePatientAccountStore();
+    const chargeSetInfo = computed(() => useStore.chargeSetInfo as ChargeSetVO || {} as ChargeSetVO);
+    const accountList = ref < AccountVO[] > ([]);
+    const buttonLoading = ref(false);
+    const loading = ref(true);
+    const showSearch = ref(true);
+    const ids = ref < Array < string | number >> ([]);
+    const single = ref(true);
+    const multiple = ref(true);
+    const total = ref(0);
+    const rowData = ref < AccountVO > ({} as any)
+    const router = useRouter();
+    const currentChargeMode = ref('1'); // 当前选择的充值方式,默认为现金收费
+    // 是否显示二维码支付按钮 - 只有选择银联支付(值为2)时才显示
+    const showQRCodeButton = computed(() => currentChargeMode.value === '2');
+    const queryFormRef = ref < ElFormInstance > ();
+    const accountFormRef = ref < ElFormInstance > ();
+    const accountIncomeFormRef = ref < ElFormInstance > ();
+    const creditFormRef = ref < ElFormInstance > ();
+    const totalIncome = ref(0); //定义充值金额
+    const rechargeIncome = ref(0); //定义确认充值金额
+    const creditAmount = ref(0); //定义修改后授信额度
+    const dialog = reactive < DialogOption > ({
+        visible: false,
+        title: ''
+    });
+    const creditDialog = reactive < DialogOption > ({
+        visible: false,
+        title: ''
+    });
+
+    const initFormData: AccountForm = {
+        id: undefined,
+        patientId: undefined,
+        patientName: undefined,
+        patientCaseId: undefined,
+        idCard: undefined,
+        sex: undefined,
+        phone: undefined,
+        serialNo: undefined,
+        totalAmount: undefined,
+        totalIncome: undefined,
+        totalExpand: undefined,
+        unpaidAmount: undefined,
+        availableAmount: undefined,
+        creditAmount: undefined,
+        creditLimit: undefined,
+        status: undefined,
+        activated: undefined,
+        remark: undefined,
+        waitingTask: undefined
+    }
+    const data = reactive < PageData < AccountForm,
+        AccountQuery >> ({
+            form: { ...initFormData },
+            queryParams: {
+                pageNum: 1,
+                pageSize: 10,
+                searchValue: undefined,
+                params: {}
+            },
+            rules: {
+                id: [
+                    { required: true, message: "主键ID不能为空", trigger: "blur" }
+                ],
+            },
+        });
+
+    // 充值表单验证规则
+    const incomeRules = reactive({
+        totalIncome: [
+            { required: true, message: "充值金额不能为空", trigger: "blur" },
+            { pattern: /^\d+(\.\d{1,2})?$/, message: "请输入正确的金额格式", trigger: "blur" }
+        ],
+        rechargeIncome: [
+            { required: true, message: "确认充值金额不能为空", trigger: "blur" },
+            { pattern: /^\d+(\.\d{1,2})?$/, message: "请输入正确的金额格式", trigger: "blur" },
+            {
+                validator: (rule: any, value: any, callback: any) => {
+                    const totalAmount = parseFloat(String(totalIncome.value)) || 0;
+                    const rechargeAmount = parseFloat(String(value)) || 0;
+                    if (rechargeAmount !== totalAmount) {
+                        callback(new Error('输入的两次充值金额不一样,请重新输入'));
+                    } else {
+                        callback();
+                    }
+                },
+                trigger: "blur"
+            }
+        ],
+        currentChargeMode: [
+            { required: true, message: "请选择充值方式", trigger: "change" }
+        ],
+    });
+    // 充值表单验证规则
+    const creditRules = reactive({
+        creditAmount: [
+            { required: true, message: "修改后授信额度不能为空", trigger: "blur" },
+            { pattern: /^\d+(\.\d{1,2})?$/, message: "请输入正确的金额格式", trigger: "blur" }
+
+        ],
+
+    });
+
+    const { queryParams, form, rules } = toRefs(data);
+
+    /** 查询患者账户信息列表 */
+    const getList = async () => {
+        loading.value = true;
+        const res = await listAccount(queryParams.value);
+        accountList.value = res.rows;
+        total.value = res.total;
+        loading.value = false;
+    }
+    // 字典label工具
+    function getDictLabel(dictList: any[], value: string) {
+        if (!dictList || !Array.isArray(dictList)) return value || '--';
+        const found = dictList.find((item) => item.value === value);
+        return found ? found.label : value || '--';
+    }
+    /** 取消按钮 */
+    const cancel = () => {
+        reset();
+        dialog.visible = false;
+    }
+
+    /** 表单重置 */
+    const reset = () => {
+        form.value = { ...initFormData };
+        totalIncome.value = 0;
+        rechargeIncome.value = 0;
+        currentChargeMode.value = '1';
+        accountFormRef.value ?.resetFields();
+        accountIncomeFormRef.value ?.resetFields();
+    }
+
+    // 过滤收费方式选项
+    const filteredChargeWay = computed(() => {
+        if (!charge_way.value) return [];
+
+        return charge_way.value.filter(dict => {
+            // 银联支付(值为2)始终显示
+            if (dict.value === '2') {
+                return true;
+            }
+            // 现金收费(值为1)只有在 chargeSetInfo.moneyCharge = 1 时才显示
+            if (dict.value === '1') {
+                return chargeSetInfo.value ?.moneyCharge === 1 || chargeSetInfo.value ?.moneyCharge === '1';
+            }
+            // 其他选项不显示
+            return false;
+        });
+    });
+
+    const handleDetail = (row ? : AccountVO) => {
+        useAccountStore.setAccountInfo(row)
+        router.push('/settlement/accountDetail/' + row.id);
+    }
+
+    /** 搜索按钮操作 */
+    const handleQuery = () => {
+        queryParams.value.pageNum = 1;
+        getList();
+    }
+
+    /** 重置按钮操作 */
+    const resetQuery = () => {
+        queryFormRef.value ?.resetFields();
+        handleQuery();
+    }
+
+    /** 多选框选中数据 */
+    const handleSelectionChange = (selection: AccountVO[]) => {
+        ids.value = selection.map(item => item.id);
+        single.value = selection.length != 1;
+        multiple.value = !selection.length;
+    }
+
+    /** 新增按钮操作 */
+    const handleAdd = () => {
+        reset();
+        dialog.visible = true;
+        dialog.title = "添加患者账户信息";
+    }
+
+    /** 充值按钮操作 */
+    const handleIncome = async (row ? : AccountVO) => {
+        reset();
+        const _id = row ?.id || ids.value[0]
+        const res = await getAccount(_id);
+        Object.assign(form.value, res.data);
+        // 设置默认收费方式为现金收费(值为1),如果现金收费可选的话
+        const availableOptions = filteredChargeWay.value;
+        const cashOption = availableOptions.find(option => option.value === '1');
+        if (cashOption) {
+            currentChargeMode.value = '1';
+        } else if (availableOptions.length > 0) {
+            // 如果没有现金收费选项,默认选择第一个可用选项
+            currentChargeMode.value = availableOptions[0].value;
+        }
+        dialog.visible = true;
+        dialog.title = "充值";
+    }
+
+    const handleAddIncome = () => {
+        // 先进行表单验证
+        accountIncomeFormRef.value ?.validate(async (valid: boolean) => {
+            if (valid) {
+                try {
+                    buttonLoading.value = true;
+
+                    // 构建充值数据
+                    const incomeData = {
+                        ...form.value,
+                        totalIncome: Number(totalIncome.value),
+                        totalAmount: (form.value.totalAmount || 0) + Number(totalIncome.value),
+                        paymentMethod: currentChargeMode.value
+                    };
+
+                    // 发送充值请求
+                    if (form.value.id) {
+                        await updateAccount(incomeData);
+                    }
+
+                    proxy ?.$modal.msgSuccess('充值成功');
+                    dialog.visible = false;
+                    await getList();
+                } catch (error) {
+                    console.error('充值失败:', error);
+                    proxy ?.$modal.msgError('充值失败,请重试');
+                } finally {
+                    buttonLoading.value = false;
+                }
+            } else {
+                proxy ?.$modal.msgWarning('请完善表单信息');
+            }
+        });
+    }
+    const incomeDialogCancel = () => {
+        dialog.visible = false
+    }
+    const creditDialogCancel = () => {
+        creditDialog.visible = false
+    }
+    /** 充值按钮操作 */
+    const handleCredit = async (row ? : AccountVO) => {
+        reset();
+        const _id = row ?.id || ids.value[0]
+        const res = await getAccount(_id);
+        Object.assign(form.value, res.data);
+        creditDialog.visible = true;
+        creditDialog.title = "授信额度";
+    }
+
+    const handleAddCredit = () => {
+        // 先进行表单验证
+        creditFormRef.value ?.validate(async (valid: boolean) => {
+            if (valid) {
+                try {
+                    buttonLoading.value = true;
+
+                    // 构建授信数据
+                    const creditData = {
+                        ...form.value,
+                        creditAmount: Number(creditAmount.value)
+                    };
+
+                    // 发送充值请求
+                    if (form.value.id) {
+                        await updateAccount(creditData);
+                    }
+
+                    proxy ?.$modal.msgSuccess('操作成功');
+                    creditDialog.visible = false;
+                    creditAmount.value = 0;
+                    await getList();
+                } catch (error) {
+                    console.error('操作失败:', error);
+                    proxy ?.$modal.msgError('操作失败,请重试');
+                } finally {
+                    buttonLoading.value = false;
+                }
+            }
+        });
+    }
+
+    /** 提交按钮 */
+    const submitForm = () => {
+        accountFormRef.value ?.validate(async (valid: boolean) => {
+            if (valid) {
+                buttonLoading.value = true;
+                if (form.value.id) {
+                    await updateAccount(form.value).finally(() => buttonLoading.value = false);
+                } else {
+                    await addAccount(form.value).finally(() => buttonLoading.value = false);
+                }
+                proxy ?.$modal.msgSuccess("操作成功");
+                dialog.visible = false;
+                await getList();
+            }
+        });
+    }
+
+    /** 删除按钮操作 */
+    const handleDelete = async (row ? : AccountVO) => {
+        const _ids = row ?.id || ids.value;
+        await proxy ?.$modal.confirm('是否确认删除患者账户信息编号为"' + _ids + '"的数据项?').finally(() => loading.value = false);
+        await delAccount(_ids);
+        proxy ?.$modal.msgSuccess("删除成功");
+        await getList();
+    }
+
+    /** 导出按钮操作 */
+    const handleExport = () => {
+        proxy ?.download('system/account/export', {
+            ...queryParams.value
+        }, `account_${new Date().getTime()}.xlsx`)
+    }
+
+    onMounted(() => {
+        getList();
+    });
+</script>
+<style lang="scss" scoped>
+    .patient-info {
+        background-color: #f5f7fa;
+        padding: 16px;
+        border-radius: 4px;
+        margin-bottom: 20px;
+    }
+
+    .info-item {
+        display: flex;
+        margin-bottom: 12px;
+    }
+
+    .info-item .label {
+        font-weight: bold;
+        color: #606266;
+        min-width: 100px;
+        flex-shrink: 0;
+    }
+
+    .info-item .value {
+        color: #303133;
+        flex: 1;
+    }
+
+    .setting-group {
+        display: flex;
+        align-items: center;
+        margin-bottom: 20px;
+
+        .setting-label {
+            width: 180px;
+            color: #606266;
+            font-size: 14px;
+            flex-shrink: 0;
+            text-align: right;
+
+            .required {
+                color: #f56c6c;
+                margin-right: 4px;
+            }
+        }
+    }
+</style>

+ 422 - 40
src/views/settlement/chargeRecord/index.vue

@@ -4,14 +4,14 @@
             <div v-show="showSearch" class="mb-[10px]">
                 <el-card shadow="hover">
                     <el-form ref="queryFormRef" :model="queryParams" :inline="true" :label-width="85">
-                        <el-form-item label="开单时间:" prop="orderTimeRange">
-                            <el-date-picker clearable v-model="queryParams.orderTimeRange" type="date" value-format="YYYY-MM-DD" placeholder="请选择开单时间" />
+                        <el-form-item label="开单时间:" prop="orderTime">
+                            <el-date-picker v-model="orderTime" value-format="YYYY-MM-DD HH:mm:ss" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="[new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 1, 1, 23, 59, 59)]"></el-date-picker>
                         </el-form-item>
-                        <el-form-item label="付款时间:" prop="orderTime">
-                            <el-date-picker clearable v-model="queryParams.createTimeRange" type="date" value-format="YYYY-MM-DD" placeholder="请选择开单时间" />
+                        <el-form-item label="付款时间:" prop="createTime">
+                            <el-date-picker v-model="createTime" value-format="YYYY-MM-DD HH:mm:ss" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="[new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 1, 1, 23, 59, 59)]"></el-date-picker>
                         </el-form-item>
                         <el-form-item label="退费时间:" prop="refundTime">
-                            <el-date-picker clearable v-model="queryParams.refundTimeRange" type="date" value-format="YYYY-MM-DD" placeholder="请选择开单时间" />
+                            <el-date-picker v-model="refundTime" value-format="YYYY-MM-DD HH:mm:ss" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="[new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 1, 1, 23, 59, 59)]"></el-date-picker>
                         </el-form-item>
                         <el-form-item label="收费类型:" prop="chargeType">
                             <el-select v-model="queryParams.chargeType">
@@ -27,12 +27,12 @@
                             </el-select>
                         </el-form-item>
                         <el-form-item label="支付方式:">
-                            <el-select v-model="queryParams.visitType">
+                            <el-select v-model="queryParams.paymentMethod">
                                 <el-option v-for="dict in charge_way" :key="dict.value" :label="dict.label" :value="dict.value" />
                             </el-select>
                         </el-form-item>
                         <el-form-item label="支付状态:">
-                            <el-select v-model="queryParams.visitType">
+                            <el-select v-model="queryParams.paymentStatus">
                                 <el-option v-for="dict in payment_status" :key="dict.value" :label="dict.label" :value="dict.value" />
                             </el-select>
                         </el-form-item>
@@ -52,7 +52,7 @@
 
         <el-card shadow="never">
             <template #header>
-                <el-row :gutter="10" class="mb8">
+                <!-- <el-row :gutter="10" class="mb8">
                     <el-col :span="1.5">
                         <el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['system:record:add']">新增</el-button>
                     </el-col>
@@ -66,12 +66,12 @@
                         <el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['system:record:export']">导出</el-button>
                     </el-col>
                     <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
-                </el-row>
+                </el-row> -->
             </template>
 
             <el-table v-loading="loading" border :data="recordList" @selection-change="handleSelectionChange">
                 <el-table-column type="selection" width="55" align="center" />
-                <el-table-column label="主键ID" align="center" prop="id" v-if="false" />
+                <el-table-column label="主键ID" align="center" prop="chargeId" v-if="false" />
                 <el-table-column label="处方id" align="center" prop="settlementId" v-if="false" />
                 <el-table-column label="开单时间" align="center" prop="orderTime" width="180">
                     <template #default="scope">
@@ -100,29 +100,33 @@
                 <el-table-column label="身份证号" align="center" prop="idCard" />
                 <el-table-column label="订单金额(元)" align="center" prop="receivableAmount" />
                 <el-table-column label="实收金额(元)" align="center" prop="fundsReceived" />
-                <el-table-column label="退费金额(元)" align="center" prop="refundAmount" />
-                <el-table-column label="支付状态" align="center" prop="paymentStatus" >
+                <el-table-column label="退费金额(元)" align="center" prop="refundAmount">
+                    <template #default="scope">
+                        <span>{{ scope.row.refundAmount||'--' }}</span>
+                    </template>
+                </el-table-column>
+                <el-table-column label="支付状态" align="center" prop="paymentStatus">
                     <template #default="scope">
                         <span>{{getDictLabel(payment_status,scope.row.paymentStatus)||'--' }}</span>
                     </template>
                 </el-table-column>
-                <el-table-column label="支付方式" align="center" prop="paymentMethod" >
+                <el-table-column label="支付方式" align="center" prop="paymentMethod">
                     <template #default="scope">
                         <span>{{getDictLabel(charge_way,scope.row.paymentMethod)||'--' }}</span>
                     </template>
                 </el-table-column>
                 <el-table-column label="退费时间" align="center" prop="refundTime" width="180">
                     <template #default="scope">
-                        <span>{{ scope.row.refundTime }}</span>
+                        <span>{{ scope.row.refundTime||'--' }}</span>
                     </template>
                 </el-table-column>
-                <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+                <el-table-column label="操作" align="center" width="150" class-name="small-padding fixed-width">
                     <template #default="scope">
-                        <el-tooltip content="修改" placement="top">
-                            <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:record:edit']"></el-button>
+                        <el-tooltip content="详情" placement="top">
+                            <el-button link type="primary" icon="Edit" @click="handleDetail(scope.row)" v-hasPermi="['settlement:chargeRecord:edit']">详情</el-button>
                         </el-tooltip>
                         <el-tooltip content="删除" placement="top">
-                            <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:record:remove']"></el-button>
+                            <el-button link type="primary" icon="Delete" >打印</el-button>
                         </el-tooltip>
                     </template>
                 </el-table-column>
@@ -130,11 +134,220 @@
 
             <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
         </el-card>
-        <!-- 添加或修改收费记录对话框 -->
-        <el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
-            <el-form ref="ChrageRecordFormRef" :model="form" :rules="rules" label-width="80px">
+        <!-- 详情对话框 -->
+        <el-dialog :title="dialog.title" v-model="dialog.visible" width="65%" append-to-body>
+            <!-- 患者信息 -->
+            <div class="patient-info">
+                <el-row :gutter="20">
+                    <el-col :span="4">
+                        <div class="info-item">
+                            <span class="label">开方日期:</span>
+                            <span class="value">{{ parseTime(form.orderTime, '{y}-{m}-{d}') || '' }}</span>
+                        </div>
+                    </el-col>
+                    <el-col :span="5">
+                        <div class="info-item">
+                            <span class="label">患者姓名:</span>
+                            <span class="value">{{ rowData.patientName || '' }}</span>
+                        </div>
+                    </el-col>
+                    <el-col :span="5">
+                        <div class="info-item">
+                            <span class="label">身份证号:</span>
+                            <span class="value">{{ rowData.idCard || '' }}</span>
+                        </div>
+                    </el-col>
+                    <el-col :span="5">
+                        <div class="info-item">
+                            <span class="label">门诊/住院号:</span>
+                            <span class="value">{{ rowData.patientNo || '' }}</span>
+                        </div>
+                    </el-col>
+
+                    <el-col :span="5">
+                        <div class="info-item">
+                            <span class="label">看诊类型:</span>
+                            <span class="value">{{ getDictLabel(treatment_user_type, rowData.visitType) || '' }}</span>
+                        </div>
+                    </el-col>
+                </el-row>
+
+                <el-row :gutter="20">
+                    <el-col :span="4">
+                        <div class="info-item">
+                            <span class="label">联系电话:</span>
+                            <span class="value">{{ rowData.phone || '' }}</span>
+                        </div>
+                    </el-col>
+                    <el-col :span="5">
+                        <div class="info-item">
+                            <span class="label">诊疗卡号:</span>
+                            <span class="value">{{ rowData.treatNum || '' }}</span>
+                        </div>
+                    </el-col>
+                    <el-col :span="5">
+                        <div class="info-item">
+                            <span class="label">病区:</span>
+                            <span class="value">{{ rowData.wardName || '--' }}</span>
+                        </div>
+                    </el-col>
+                    <el-col :span="5">
+                        <div class="info-item">
+                            <span class="label">患者科室:</span>
+                            <span class="value">{{ rowData.patientDepartment || '' }}</span>
+                        </div>
+                    </el-col>
+                    <el-col :span="5">
+                        <div class="info-item">
+                            <span class="label">处方Id:</span>
+                            <span class="value">{{ rowData.id  || '' }}</span>
+                        </div>
+                    </el-col>
+                </el-row>
+            </div>
+
+            <!-- 处方明细表格 -->
+            <!-- 处方表格 -->
+            <div class="prescription-table-wrapper">
+                <!-- 处方数据表格 -->
+                <table v-if="recipeDetailData.length > 0" class="prescription-table">
+                    <thead>
+                        <tr>
+                            <th>组号</th>
+                            <th>产品名称</th>
+                            <th>规格</th>
+                            <th>销售价格(元)</th>
+                            <th>用量/次</th>
+                            <th>频次</th>
+                            <th>使用天数</th>
+                            <th>首日</th>
+                            <th>用量/总</th>
+                            <th>应收金额(元)</th>
+                            <th>操作人</th>
+                        </tr>
+                    </thead>
+                    <tbody>
+                        <tr v-for="(product, index) in recipeDetailData" :key="index">
+                            <td>{{ Number(product.groupNo) + 1 || '--' }}</td>
+                            <td>{{ product.nutritionProduct || '--' }}</td>
+                            <td>{{ product.specification || '--' }}</td>
+                            <td>{{ product.salePrice || '--' }}</td>
+                            <td>{{ product.dosePerTime || '--' }}</td>
+                            <td>{{ product.frequency || '--' }}</td>
+                            <td>{{ product.usageDays || '--' }}</td>
+                            <td>{{ product.firstDay || '--' }}</td>
+                            <td>{{ product.totalDose || '--' }}</td>
+                            <td>{{ product.amount || '--' }}</td>
+                            <td>{{ product.createByName || '--' }}</td>
+                        </tr>
+                    </tbody>
+                </table>
+
+                <!-- 筛查数据表格 -->
+                <table v-if="screeningData.length > 0" class="prescription-table" style="margin-top: 10px;">
+                    <thead>
+                        <tr>
+                            <th>项目名称</th>
+                            <th>销售单位</th>
+                            <th>销售价格</th>
+                            <th>数量</th>
+                            <th>应收金额(元)</th>
+                            <th>操作人</th>
+                        </tr>
+                    </thead>
+                    <tbody>
+                        <tr v-for="(item, index) in screeningData" :key="index">
+                            <td>{{ getDictLabel(fee_type,rowData.chargeType) || '--' }}</td>
+                            <td>次</td>
+                            <td>{{ rowData.receivableAmount || '--' }}</td>
+                            <td>1</td>
+                            <td>{{ rowData.receivableAmount || '--' }}</td>
+                            <td>{{ item.createByName || '--' }}</td>
+                        </tr>
+                    </tbody>
+                </table>
+
+                <!-- 评估数据表格 -->
+                <table v-if="evaluationData.length > 0" class="prescription-table" style="margin-top: 10px;">
+                    <thead>
+                        <tr>
+                            <th>项目名称</th>
+                            <th>销售单位</th>
+                            <th>销售价格</th>
+                            <th>数量</th>
+                            <th>应收金额(元)</th>
+                            <th>操作人</th>
+                        </tr>
+                    </thead>
+                    <tbody>
+                        <tr v-for="(item, index) in evaluationData" :key="index">
+                            <td>{{ getDictLabel(fee_type,rowData.chargeType) || '--' }}</td>
+                            <td>次</td>
+                            <td>{{ rowData.receivableAmount || '--' }}</td>
+                            <td>1</td>
+                            <td>{{ rowData.receivableAmount || '--' }}</td>
+                            <td>{{ item.createByName || '--' }}</td>
+                        </tr>
+                    </tbody>
+                </table>
+
+                <!-- 无数据提示 -->
+                <div v-if="recipeDetailData.length === 0 && screeningData.length === 0 && evaluationData.length === 0" style="text-align: center; color: #909399; padding: 40px 0;">
+                    暂无数据
+                </div>
+
+                <!-- 金额统计 -->
+                 <div style="margin-top:10px;" v-if="rowData.chargeType=='0'||rowData.chargeType=='1'">
+                    <el-row :gutter="20">
+                        <el-col :span="4">
+                            <span>项目总金额:<span style="color: #f56c6c;">¥{{rowData.receivableAmount}}</span></span>
+                        </el-col>
+                        <el-col :span="4">
+                             <span>实收金额:<span style="color: #f56c6c;">¥{{rowData.fundsReceived}}</span></span><span style="margin-left:5px">  退费金额:<span style="color: #f56c6c;">¥{{ rowData.refundAmount||'0.00' }}</span></span>
+                        </el-col>
+                    </el-row>
+                </div>
+                <div style="margin-top:10px;" v-else>
+                    <el-row :gutter="20">
+                        <el-col :span="6">
+                            <span>处方总金额:<span style="color: #f56c6c;">¥{{rowData.receivableAmount}}</span></span><span>(营养配置费:<span>¥{{ prescriptionFee||'0' }}</span>)</span>
+                        </el-col>
+                        <el-col :span="4">
+                             <span>实收金额:<span style="color: #f56c6c;">¥{{rowData.fundsReceived}}</span></span><span style="margin-left:5px">  退费金额:<span style="color: #f56c6c;">¥{{ rowData.refundAmount||'0.00' }}</span></span>
+                        </el-col>
+                    </el-row>
+                </div>
+               
+                 <!-- 筛查数据表格 -->
+                 <span>操作记录</span>
+                <table v-if="recordLogData.length > 0" class="prescription-table" style="margin-top: 10px;">
+                    <thead>
+                        <tr>
+                            <th>操作日期</th>
+                            <th>交易单号</th>
+                            <th>产品名称</th>
+                            <th>操作</th>
+                            <th>交易金额(元)</th>
+                            <th>交易状态</th>
+                            <th>备注</th>
+                            <th>操作人</th>
+                        </tr>
+                    </thead>
+                    <tbody>
+                        <tr v-for="(item, index) in recordLogData" :key="index">
+                            <td>{{ item.createTime || '--' }}</td>
+                            <td>{{item.settlementId}}</td>
+                             <td>{{ item.productName || '--' }}</td>
+                              <td>{{getDictLabel(charge_way,item.paymentMethod) || '--' }}</td>
+                            <td>{{ rowData.receivableAmount || '--' }}</td>
+                            <td>{{getDictLabel(action_status,item.status)  || '--' }}</td>
+                            <td>{{ rowData.remark || '--' }}</td>
+                            <td>{{ item.createByName || '--' }}</td>
+                        </tr>
+                    </tbody>
+                </table>
+            </div>
 
-            </el-form>
             <template #footer>
                 <div class="dialog-footer">
                     <el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
@@ -150,8 +363,11 @@
     import { ChrageRecordVO, ChrageRecordQuery, ChrageRecordForm } from '@/api/settlement/chargeRecord/types';
     import { listDept } from '@/api/system/dept'; // 部门列表
     const { proxy } = getCurrentInstance() as ComponentInternalInstance;
-    const { treatment_user_type, check_status, recipe_type, fee_type, charge_way, payment_status } = toRefs < any > (proxy ?.useDict('treatment_user_type', 'check_status', 'recipe_type', 'fee_type', 'charge_way', 'payment_status'));
+    const { treatment_user_type, check_status, recipe_type, fee_type, charge_way, payment_status,action_status } = toRefs < any > (proxy ?.useDict('treatment_user_type', 'check_status', 'recipe_type', 'fee_type', 'charge_way', 'payment_status','action_status'));
 
+    const orderTime = ref < [DateModelType, DateModelType] > (['', '']);
+    const createTime = ref < [DateModelType, DateModelType] > (['', '']);
+    const refundTime = ref < [DateModelType, DateModelType] > (['', '']);
     const recordList = ref < ChrageRecordVO[] > ([]);
     const buttonLoading = ref(false);
     const loading = ref(true);
@@ -160,7 +376,12 @@
     const single = ref(true);
     const multiple = ref(true);
     const total = ref(0);
-
+    // 处方明细数据
+    const recipeDetailData = ref([]);
+    const evaluationData = ref([]);
+    const screeningData = ref([]);
+    const recordLogData = ref([]);
+    const prescriptionFee = ref(0)
     const queryFormRef = ref < ElFormInstance > ();
     const ChrageRecordFormRef = ref < ElFormInstance > ();
     const treeData = ref([]); // 定义 treeData
@@ -173,7 +394,7 @@
         visible: false,
         title: ''
     });
-
+    const rowData = ref < ChrageRecordVO > ({})
     const initFormData: ChrageRecordForm = {
         id: undefined,
         settlementId: undefined,
@@ -205,27 +426,20 @@
             queryParams: {
                 pageNum: 1,
                 pageSize: 10,
-                settlementId: undefined,
                 orderTime: undefined,
+                createTime: undefined,
                 visitType: undefined,
                 chargeType: undefined,
-                patientId: undefined,
-                patientName: undefined,
                 doorId: undefined,
+                patientId:undefined,
                 patientNo: undefined,
-                phone: undefined,
-                idCard: undefined,
                 receivableAmount: undefined,
                 fundsReceived: undefined,
                 refundAmount: undefined,
                 paymentStatus: undefined,
                 paymentMethod: undefined,
-                bedNo: undefined,
                 refundTime: undefined,
-                status: undefined,
-                wardId: undefined,
-                wardName: undefined,
-                treatNum: undefined,
+                searchValue: undefined,
                 params: {}
             },
             rules: {
@@ -247,10 +461,37 @@
         return found ? found.label : value || '--';
     }
 
+    /** 添加多个日期范围 */
+    const addMultipleDateRanges = (params: any, dateRanges: {
+        [key: string]: any[]
+    }) => {
+        const search = { ...params };
+        search.params = typeof search.params === 'object' && search.params !== null && !Array.isArray(search.params) ? search.params : {};
+
+        // 添加各个时间范围
+        Object.keys(dateRanges).forEach(propName => {
+            const dateRange = Array.isArray(dateRanges[propName]) ? dateRanges[propName] : [];
+            if (dateRange.length >= 2 && dateRange[0] && dateRange[1]) {
+                search.params['beginTime'] = dateRange[0];
+                search.params['endTime'] = dateRange[1];
+            }
+        });
+
+        return search;
+    };
+
     /** 查询收费记录列表 */
     const getList = async () => {
         loading.value = true;
-        const res = await listRecord(queryParams.value);
+
+        // 构建多个时间范围参数
+        const dateRanges = {
+            OrderTime: orderTime.value,
+            CreateTime: createTime.value,
+            RefundTime: refundTime.value
+        };
+
+        const res = await listRecord(addMultipleDateRanges(queryParams.value, dateRanges));
         recordList.value = res.rows;
         total.value = res.total;
         loading.value = false;
@@ -304,6 +545,12 @@
     /** 重置按钮操作 */
     const resetQuery = () => {
         queryFormRef.value ?.resetFields();
+        queryParams.value.searchValue = undefined;
+        queryParams.value.visitType = undefined;
+        queryParams.value.chargeType = undefined;
+        queryParams.value.doorId = undefined;
+        queryParams.value.paymentMethod = undefined;
+        queryParams.value.paymentStatus = undefined;
         handleQuery();
     }
 
@@ -322,13 +569,21 @@
     }
 
     /** 修改按钮操作 */
-    const handleUpdate = async (row ? : ChrageRecordVO) => {
+    const handleDetail = async (row ? : ChrageRecordVO) => {
         reset();
-        const _id = row ?.id || ids.value[0]
+        rowData.value = row || {} as ChrageRecordVO;
+        console.log(JSON.stringify(row));
+        const _id = row ?.id
         const res = await getRecord(_id);
+        recipeDetailData.value = res.data.enteralNutritionList
+        evaluationData.value = res.data.nutritionEvaluationList
+        screeningData.value = res.data.nutritionScreeningList
+        recordLogData.value = res.data.recordLogList
+
+        prescriptionFee.value = res.data.prescriptionFee
         Object.assign(form.value, res.data);
         dialog.visible = true;
-        dialog.title = "修改收费记录";
+        dialog.title = "收费详情";
     }
 
     /** 提交按钮 */
@@ -364,8 +619,135 @@
         }, `record_${new Date().getTime()}.xlsx`)
     }
 
+    function formatDate(date) {
+        const pad = (n) => (n < 10 ? '0' + n : n);
+        return date.getFullYear() + '-' + pad(date.getMonth() + 1) + '-' + pad(date.getDate());
+    }
+
     onMounted(() => {
         getList();
         getDeptList()
+        let now = new Date();
+        let start = formatDate(now);
+        let end = formatDate(new Date(now.getTime() - 24 * 60 * 60 * 1000 * 30));
+        // orderTime.value = [end + ' 00:00:00', start + ' 23:59:59'];
+        // createTime.value = [end + ' 00:00:00', start + ' 23:59:59'];
     });
-</script>
+</script>
+<style lang="scss" scoped>
+ .patient-info {
+        background-color: #f5f7fa;
+        padding: 16px;
+        border-radius: 4px;
+        margin-bottom: 20px;
+    }
+
+    .info-item {
+        display: flex;
+        margin-bottom: 12px;
+    }
+
+    .info-item .label {
+        font-weight: bold;
+        color: #606266;
+        min-width: 100px;
+        flex-shrink: 0;
+    }
+
+    .info-item .value {
+        color: #303133;
+        flex: 1;
+    }
+
+    .recipe-detail {
+        margin-top: 20px;
+    }
+
+    .dialog-footer {
+        text-align: center;
+    }
+
+    .dialog-footer .el-button {
+        margin: 0 10px;
+    }
+
+    .prescription-table-wrapper {
+        overflow-x: auto;
+
+        .prescription-table {
+            width: 100%;
+            border-collapse: collapse;
+            border: 1px solid #ddd;
+            background: white;
+            font-size: 14px;
+
+            th,
+            td {
+                border: 1px solid #ddd;
+                padding: 10px 12px;
+                text-align: center;
+                vertical-align: middle;
+                min-width: 90px;
+                white-space: nowrap;
+                overflow: hidden;
+                text-overflow: ellipsis;
+            }
+
+            th {
+                background: #e8f4fd !important;
+                color: #303133 !important;
+                font-weight: 600 !important;
+                font-size: 14px !important;
+                height: 40px !important;
+            }
+
+            td {
+                color: #303133;
+                font-size: 14px;
+                height: 36px;
+
+                &:first-child {
+                    font-weight: 500;
+                }
+            }
+
+            // 斑马纹
+            tbody tr:nth-child(even) {
+                background: #fafbfc;
+            }
+
+            // 悬停效果
+            tbody tr:hover {
+                background: #f0f9ff;
+            }
+        }
+    }
+
+    .setting-group {
+        display: flex;
+        align-items: center;
+        margin-bottom: 20px;
+
+        .setting-label {
+            width: 180px;
+            color: #606266;
+            font-size: 14px;
+            flex-shrink: 0;
+            text-align: right;
+
+            .required {
+                color: #f56c6c;
+                margin-right: 4px;
+            }
+        }
+
+        .amount-value {
+            color: #303133;
+            font-size: 14px;
+            font-weight: 500;
+            min-width: 80px;
+            text-align: left;
+        }
+    }
+
+</style>

+ 41 - 32
src/views/settlement/waitCharge/index.vue

@@ -5,7 +5,7 @@
                 <el-card shadow="hover">
                     <el-form ref="queryFormRef" :model="queryParams" :inline="true" :label-width="85">
                         <el-form-item label="开方时间" prop="orderTime">
-                            <el-date-picker v-model="queryParams.dateRange" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" />
+                            <el-date-picker v-model="orderTime" value-format="YYYY-MM-DD HH:mm:ss" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="[new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 1, 1, 23, 59, 59)]"></el-date-picker>
                         </el-form-item>
                         <el-form-item label="收费类型" prop="chargeType">
                             <el-select v-model="queryParams.chargeType">
@@ -47,7 +47,7 @@
                 <el-table-column label="主键ID" align="center" prop="id" v-if="false" />
                 <el-table-column label="开单时间" align="center" prop="orderTime" width="180">
                     <template #default="scope">
-                        <span>{{ parseTime(scope.row.orderTime, '{y}-{m}-{d}') }}</span>
+                        <span>{{ scope.row.orderTime }}</span>
                     </template>
                 </el-table-column>
                 <el-table-column label="看诊类型" align="center" prop="visitType">
@@ -75,7 +75,7 @@
                             <el-button link type="primary" @click="handleCharge(scope.row)" v-hasPermi="['system:settlement:edit']">收费</el-button>
                         </el-tooltip>
                         <el-tooltip content="打印" placement="top">
-                            <el-button link type="primary" @click="handleDelete(scope.row)" v-hasPermi="['system:settlement:edit']">打印</el-button>
+                            <el-button link type="primary" v-hasPermi="['system:settlement:edit']">打印</el-button>
                         </el-tooltip>
                     </template>
                 </el-table-column>
@@ -307,24 +307,26 @@
                         </el-radio>
                     </el-radio-group>
                 </div>
-                <div class="setting-group">
-                    <label class="setting-label">
-                        应收金额(元):
-                    </label>
-                    <span class="amount-value">{{ rowData.receivableAmount || '0.00' }}</span>
-                </div>
-                <div class="setting-group">
-                    <label class="setting-label">
-                        <span class="required">*</span>
-                        收到金额(元):
-                    </label>
-                    <el-input style="width:260px" v-model="fundsReceived" @change="changeFundsReceived" placeholder="请输入" />
-                </div>
-                <div class="setting-group">
-                    <label class="setting-label">
-                        找零金额(元):
-                    </label>
-                    <span class="amount-value">{{ changeFund.toFixed(2) }}</span>
+                <div v-show="currentChargeMode=='1'">
+                    <div class="setting-group">
+                        <label class="setting-label">
+                            应收金额(元):
+                        </label>
+                        <span class="amount-value">{{ rowData.receivableAmount || '0.00' }}</span>
+                    </div>
+                    <div class="setting-group">
+                        <label class="setting-label">
+                            <span class="required">*</span>
+                            收到金额(元):
+                        </label>
+                        <el-input style="width:260px" v-model="fundsReceived" @change="changeFundsReceived" placeholder="请输入" />
+                    </div>
+                    <div class="setting-group">
+                        <label class="setting-label">
+                            找零金额(元):
+                        </label>
+                        <span class="amount-value">{{ changeFund.toFixed(2) }}</span>
+                    </div>
                 </div>
             </el-form>
             <div>
@@ -345,14 +347,13 @@
     import { listSettlement, getSettlement, delSettlement, addSettlement, updateSettlement } from '@/api/patients/settlement';
     import { SettlementVO, SettlementQuery, SettlementForm } from '@/api/patients/settlement/types';
     import { addRecord } from '@/api/settlement/chargeRecord';
-    import { ChrageRecordVO, ChrageRecordQuery, ChrageRecordForm } from '@/api/settlement/chargeRecord/types';
     import { listDept } from '@/api/system/dept'; // 部门列表
     import { listSet } from '@/api/parameter/chargeSet';
     import { ChargeSetVO } from '@/api/parameter/chargeSet/types';
     import { computed } from 'vue';
-
+    const orderTime = ref < [DateModelType, DateModelType] > (['', '']);
     const { proxy } = getCurrentInstance() as ComponentInternalInstance;
-    const { treatment_user_type, check_status, recipe_type, fee_type, charge_way } = toRefs < any > (proxy ?.useDict('treatment_user_type', 'check_status', 'recipe_type', 'fee_type', 'charge_way'));
+    const { treatment_user_type, fee_type, charge_way } = toRefs < any > (proxy ?.useDict('treatment_user_type', 'fee_type', 'charge_way'));
     import { useChargeSetStore } from '@/store/modules/chargeSet';
     const useStore = useChargeSetStore();
     const settlementList = ref < SettlementVO[] > ([]);
@@ -364,7 +365,7 @@
     const multiple = ref(true);
     const total = ref(0);
     const fundsReceived = ref(0); //定义收到金额
-    const changeFund = ref(0); //定义收到金额
+    const changeFund = ref(0); //定义找零金额
     const treeData = ref([]); // 定义 treeData
     const rowData = ref < SettlementVO > ({})
     const currentChargeMode = ref('1'); // 当前选择的收费方式,默认为现金收费
@@ -457,7 +458,7 @@
     /** 查询结算管理列表 */
     const getList = async () => {
         loading.value = true;
-        const res = await listSettlement(queryParams.value);
+        const res = await listSettlement(proxy?.addDateRange(queryParams.value, orderTime.value));
         settlementList.value = res.rows;
         // 获取部门数据
         const deptMap = new Map();
@@ -556,7 +557,6 @@
     const handleDetail = async (row ? : SettlementVO) => {
         reset();
         rowData.value = row || {} as SettlementVO;
-
         const _id = row ?.id || ids.value[0]
         const res = await getSettlement(_id);
         recipeDetailData.value = res.data.enteralNutritionList
@@ -586,18 +586,18 @@
     }
 
     /** 现金收费 */
-    const handleMoney = async (row ? : SettlementVO) => {
+    const handleMoney = async () => {
         moneyDialog.visible = true;
         moneyDialog.title = "收费"
     }
 
     /** 银联支付 */
-    const handleUnionPay = async (row ? : SettlementVO) => {
+    const handleUnionPay = async () => {
 
     }
 
     /** 二维码支付 */
-    const handleQRCode = async (row ? : SettlementVO) => {
+    const handleQRCode = async () => {
 
     }
     const moneyDialogCancel = () => {
@@ -616,7 +616,6 @@
     const handleAddCharge = () => {
         const received = parseFloat(String(fundsReceived.value)) || 0;
         const receivable = parseFloat(String(rowData.value.receivableAmount)) || 0;
-
         if (received < receivable) {
             proxy ?.$modal.msgWarning('收到金额小于应收金额,请重新核对!');
             return;
@@ -630,6 +629,8 @@
                 await addRecord(rowData.value).finally();
                 proxy ?.$modal.msgSuccess('收费成功');
                 moneyDialog.visible = false;
+                dialog.visible = false;
+                fundsReceived.value = 0
                 await getList();
             }
         });
@@ -678,10 +679,18 @@
         }, `settlement_${new Date().getTime()}.xlsx`)
     }
 
+    function formatDate(date) {
+        const pad = (n) => (n < 10 ? '0' + n : n);
+        return date.getFullYear() + '-' + pad(date.getMonth() + 1) + '-' + pad(date.getDate());
+    }
+
     onMounted(() => {
         getList();
         getDeptList()
-
+        let now = new Date();
+        let start = formatDate(now);
+        let end = formatDate(new Date(now.getTime() - 24 * 60 * 60 * 1000 * 30));
+        orderTime.value = [end + ' 00:00:00', start + ' 23:59:59'];
 
     });
 </script>