Browse Source

收费相关

HuRongxin 3 weeks ago
parent
commit
6f55343a18

+ 63 - 0
src/api/parameter/chargeSet/index.ts

@@ -0,0 +1,63 @@
+import request from '@/utils/request';
+import { AxiosPromise } from 'axios';
+import { ChargeSetVO, ChargeSetForm, ChargeSetQuery } from '@/api/parameter/chargeSet/types';
+
+/**
+ * 查询收费设置列表
+ * @param query
+ * @returns {*}
+ */
+
+export const listSet = (query?: ChargeSetQuery): AxiosPromise<ChargeSetVO[]> => {
+  return request({
+    url: '/parameter/chargeSet/list',
+    method: 'get',
+    params: query
+  });
+};
+
+/**
+ * 查询收费设置详细
+ * @param chargeId
+ */
+export const getSet = (chargeId: string | number): AxiosPromise<ChargeSetVO> => {
+  return request({
+    url: '/parameter/chargeSet/' + chargeId,
+    method: 'get'
+  });
+};
+
+/**
+ * 新增收费设置
+ * @param data
+ */
+export const addSet = (data: ChargeSetForm) => {
+  return request({
+    url: '/parameter/chargeSet',
+    method: 'post',
+    data: data
+  });
+};
+
+/**
+ * 修改收费设置
+ * @param data
+ */
+export const updateSet = (data: ChargeSetForm) => {
+  return request({
+    url: '/parameter/chargeSet',
+    method: 'put',
+    data: data
+  });
+};
+
+/**
+ * 删除收费设置
+ * @param chargeId
+ */
+export const delSet = (chargeId: string | number | Array<string | number>) => {
+  return request({
+    url: '/parameter/chargeSet/' + chargeId,
+    method: 'delete'
+  });
+};

+ 189 - 0
src/api/parameter/chargeSet/types.ts

@@ -0,0 +1,189 @@
+export interface ChargeSetVO {
+  /**
+   * 主键id
+   */
+  chargeId: string | string;
+
+  /**
+   * 服务商
+   */
+  servicer: number | string;
+
+  /**
+   * 是否开启现金收费
+   */
+  moneyCharge: number | string;
+
+  /**
+   * 收费模式
+   */
+  chargeMode: number | string;
+
+  /**
+   * 收费方式 1单项收费 2 组合收费
+   */
+  chargeType: number | string;
+
+  /**
+   * 单项收费配置
+   */
+  oneWayCharge: string;
+
+  /**
+   * 组合收费配置
+   */
+  groupCharge: string;
+
+  /**
+   * 营养配置收费设置
+   */
+  nutritionChargeSet: string | number;
+
+  /**
+   * 适合处方类型
+   */
+  suitRecipe: string;
+
+  /**
+   * 患者订单配置
+   */
+  patientOrderSet: string | number;
+
+  /**
+   * 订单有效期
+   */
+  orderIndate: number;
+
+  /**
+   * 多模式收费配置
+   */
+  multiModeCharge: string;
+
+  chargeItemArr: any[];
+}
+
+export interface ChargeSetForm extends BaseEntity {
+  /**
+   * 主键id
+   */
+  chargeId?: string | string;
+
+  /**string
+   * 服务商
+   */
+  servicer?: number | string;
+
+  /**
+   * 是否开启现金收费
+   */
+  moneyCharge?: number | string;
+
+  /**
+   * 收费模式
+   */
+  chargeMode?: number | string;
+
+  /**
+   * 收费方式 1单项收费 2 组合收费
+   */
+  chargeType?: number | string;
+
+  /**
+   * 单项收费配置
+   */
+  oneWayCharge?: string;
+
+  /**
+   * 组合收费配置
+   */
+  groupCharge?: string;
+
+  /**
+   * 营养配置收费设置
+   */
+  nutritionChargeSet?: string | number;
+
+  /**
+   * 适合处方类型
+   */
+  suitRecipe?: string;
+
+  /**
+   * 患者订单配置
+   */
+  patientOrderSet?: string | number;
+
+  /**
+   * 订单有效期
+   */
+  orderIndate?: number;
+
+  /**
+   * 多模式收费配置
+   */
+  multiModeCharge?: string;
+
+  chargeItemArr?: any[];
+}
+
+export interface ChargeSetQuery extends PageQuery {
+  /**
+   * 服务商
+   */
+  servicer?: number | string;
+
+  /**
+   * 是否开启现金收费
+   */
+  moneyCharge?: number | string;
+
+  /**
+   * 收费模式
+   */
+  chargeMode?: number | string;
+
+  /**
+   * 收费方式 1单项收费 2 组合收费
+   */
+  chargeType?: number | string;
+
+  /**
+   * 单项收费配置
+   */
+  oneWayCharge?: string;
+
+  /**
+   * 组合收费配置
+   */
+  groupCharge?: string;
+
+  /**
+   * 营养配置收费设置
+   */
+  nutritionChargeSet?: string | number;
+
+  /**
+   * 适合处方类型
+   */
+  suitRecipe?: string;
+
+  /**
+   * 患者订单配置
+   */
+  patientOrderSet?: string | number;
+
+  /**
+   * 订单有效期
+   */
+  orderIndate?: number;
+
+  /**
+   * 多模式收费配置
+   */
+  multiModeCharge?: string;
+
+  /**
+   * 日期范围参数
+   */
+  params?: any;
+}

+ 9 - 1
src/api/patients/settlement/index.ts

@@ -1,6 +1,6 @@
 import request from '@/utils/request';
 import { AxiosPromise } from 'axios';
-import { SettlementVO, SettlementForm, SettlementQuery } from '@/api/system/settlement/types';
+import { SettlementVO, SettlementForm, SettlementQuery } from '@/api/patients/settlement/types';
 
 /**
  * 查询结算管理列表
@@ -16,6 +16,14 @@ export const listSettlement = (query?: SettlementQuery): AxiosPromise<Settlement
   });
 };
 
+export const listRecipeCheck= (query?: SettlementQuery): AxiosPromise<SettlementVO[]> => {
+  return request({
+    url: '/system/settlement/queryRecipeCheckList',
+    method: 'get',
+    params: query
+  });
+};
+
 /**
  * 查询结算管理详细
  * @param id

+ 29 - 6
src/api/patients/settlement/types.ts

@@ -29,6 +29,8 @@ export interface SettlementVO {
    */
   patientName: string;
 
+  bedNo: string;
+
   /**
    * 患者科室
    */
@@ -69,6 +71,14 @@ export interface SettlementVO {
    */
   status: string;
 
+  /*审核状态 1待审核 2 审核通过*/
+  checkStatus: string;
+
+  treatNum: string;
+
+  wardName: string;
+
+  remark: string;
 }
 
 export interface SettlementForm extends BaseEntity {
@@ -142,10 +152,17 @@ export interface SettlementForm extends BaseEntity {
    */
   status?: string;
 
+  /*审核状态 1待审核 2 审核通过*/
+  checkStatus?: string;
+
+  treatNum?: string;
+
+  wardName?: string;
+
+  remark?: string;
 }
 
 export interface SettlementQuery extends PageQuery {
-
   /**
    * 开单时间
    */
@@ -176,6 +193,8 @@ export interface SettlementQuery extends PageQuery {
    */
   patientDepartment?: string;
 
+  doorId: number;
+
   /**
    * 门诊/住院号
    */
@@ -211,11 +230,15 @@ export interface SettlementQuery extends PageQuery {
    */
   status?: string;
 
-    /**
-     * 日期范围参数
-     */
-    params?: any;
-}
+  /*审核状态 1待审核 2 审核通过*/
+  checkStatus: string;
 
+  searchValue: string;
 
+  /**
+   * 日期范围参数
+   */
+  params?: any;
 
+  dateRange: [];
+}

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

@@ -0,0 +1,63 @@
+import request from '@/utils/request';
+import { AxiosPromise } from 'axios';
+import { ChrageRecordVO, ChrageRecordForm, ChrageRecordQuery } from '@/api/settlement/chargeRecord/types';
+
+/**
+ * 查询收费记录列表
+ * @param query
+ * @returns {*}
+ */
+
+export const listRecord = (query?: ChrageRecordQuery): AxiosPromise<ChrageRecordVO[]> => {
+  return request({
+    url: '/settlement/chargeRecord/list',
+    method: 'get',
+    params: query
+  });
+};
+
+/**
+ * 查询收费记录详细
+ * @param id
+ */
+export const getRecord = (id: string | number): AxiosPromise<ChrageRecordVO> => {
+  return request({
+    url: '/settlement/chargeRecord/' + id,
+    method: 'get'
+  });
+};
+
+/**
+ * 新增收费记录
+ * @param data
+ */
+export const addRecord = (data: ChrageRecordForm) => {
+  return request({
+    url: '/settlement/chargeRecord',
+    method: 'post',
+    data: data
+  });
+};
+
+/**
+ * 修改收费记录
+ * @param data
+ */
+export const updateRecord = (data: ChrageRecordForm) => {
+  return request({
+    url: '/settlement/chargeRecord',
+    method: 'put',
+    data: data
+  });
+};
+
+/**
+ * 删除收费记录
+ * @param id
+ */
+export const delRecord = (id: string | number | Array<string | number>) => {
+  return request({
+    url: '/settlement/chargeRecord/' + id,
+    method: 'delete'
+  });
+};

+ 351 - 0
src/api/settlement/chargeRecord/types.ts

@@ -0,0 +1,351 @@
+export interface ChrageRecordVO {
+  /**
+   * 主键ID
+   */
+  id: string | number;
+
+  /**
+   * 处方id
+   */
+  settlementId: string | number;
+
+  /**
+   * 开单时间
+   */
+  orderTime: string;
+
+  /**
+   * 看诊类型
+   */
+  visitType: string;
+
+  /**
+   * 收费类型
+   */
+  chargeType: string;
+
+  /**
+   * 患者ID
+   */
+  patientId: string | number;
+
+  /**
+   * 患者姓名
+   */
+  patientName: string;
+
+  /**
+   * 患者科室
+   */
+  doorId: string | number;
+
+  /**
+   * 门诊/住院号
+   */
+  patientNo: string;
+
+  /**
+   * 联系电话
+   */
+  phone: string;
+
+  /**
+   * 身份证号
+   */
+  idCard: string | number;
+
+  /**
+   * 订单金额
+   */
+  receivableAmount: number;
+
+  /**
+   * 实收金额
+   */
+  fundsReceived: number;
+
+  /**
+   * 退费金额
+   */
+  refundAmount: number;
+
+  /**
+   * 支付状态(未支付/已支付/已退款)
+   */
+  paymentStatus: string;
+
+  /**
+   * 支付方式
+   */
+  paymentMethod: string;
+
+  /**
+   * 床号
+   */
+  bedNo: string;
+
+  /**
+   * 退费时间
+   */
+  refundTime: string;
+
+  /**
+   * 状态(0正常 1停用)
+   */
+  status: string;
+
+  /**
+   * 病区
+   */
+  wardId: string | number;
+
+  /**
+   * 病区名称
+   */
+  wardName: string;
+
+  /**
+   * 诊疗卡号
+   */
+  treatNum: string;
+
+  /**
+   * 备注
+   */
+  remark: string;
+
+}
+
+export interface ChrageRecordForm extends BaseEntity {
+  /**
+   * 主键ID
+   */
+  id?: string | number;
+
+  /**
+   * 处方id
+   */
+  settlementId?: string | number;
+
+  /**
+   * 开单时间
+   */
+  orderTime?: string;
+
+  /**
+   * 看诊类型
+   */
+  visitType?: string;
+
+  /**
+   * 收费类型
+   */
+  chargeType?: string;
+
+  /**
+   * 患者ID
+   */
+  patientId?: string | number;
+
+  /**
+   * 患者姓名
+   */
+  patientName?: string;
+
+  /**
+   * 患者科室
+   */
+  doorId?: string | number;
+
+  /**
+   * 门诊/住院号
+   */
+  patientNo?: string;
+
+  /**
+   * 联系电话
+   */
+  phone?: string;
+
+  /**
+   * 身份证号
+   */
+  idCard?: string | number;
+
+  /**
+   * 订单金额
+   */
+  receivableAmount?: number;
+
+  /**
+   * 实收金额
+   */
+  fundsReceived?: number;
+
+  /**
+   * 退费金额
+   */
+  refundAmount?: number;
+
+  /**
+   * 支付状态(未支付/已支付/已退款)
+   */
+  paymentStatus?: string;
+
+  /**
+   * 支付方式
+   */
+  paymentMethod?: string;
+
+  /**
+   * 床号
+   */
+  bedNo?: string;
+
+  /**
+   * 退费时间
+   */
+  refundTime?: string;
+
+  /**
+   * 状态(0正常 1停用)
+   */
+  status?: string;
+
+  /**
+   * 病区
+   */
+  wardId?: string | number;
+
+  /**
+   * 病区名称
+   */
+  wardName?: string;
+
+  /**
+   * 诊疗卡号
+   */
+  treatNum?: string;
+
+  /**
+   * 备注
+   */
+  remark?: string;
+
+}
+
+export interface ChrageRecordQuery extends PageQuery {
+
+  /**
+   * 处方id
+   */
+  settlementId?: string | number;
+
+  /**
+   * 开单时间
+   */
+  orderTime?: string;
+
+  /**
+   * 看诊类型
+   */
+  visitType?: string;
+
+  /**
+   * 收费类型
+   */
+  chargeType?: string;
+
+  /**
+   * 患者ID
+   */
+  patientId?: string | number;
+
+  /**
+   * 患者姓名
+   */
+  patientName?: string;
+
+  /**
+   * 患者科室
+   */
+  doorId?: string | number;
+
+  /**
+   * 门诊/住院号
+   */
+  patientNo?: string;
+
+  /**
+   * 联系电话
+   */
+  phone?: string;
+
+  /**
+   * 身份证号
+   */
+  idCard?: string | number;
+
+  /**
+   * 订单金额
+   */
+  receivableAmount?: number;
+
+  /**
+   * 实收金额
+   */
+  fundsReceived?: number;
+
+  /**
+   * 退费金额
+   */
+  refundAmount?: number;
+
+  /**
+   * 支付状态(未支付/已支付/已退款)
+   */
+  paymentStatus?: string;
+
+  /**
+   * 支付方式
+   */
+  paymentMethod?: string;
+
+  /**
+   * 床号
+   */
+  bedNo?: string;
+
+  /**
+   * 退费时间
+   */
+  refundTime?: string;
+
+  /**
+   * 状态(0正常 1停用)
+   */
+  status?: string;
+
+  /**
+   * 病区
+   */
+  wardId?: string | number;
+
+  /**
+   * 病区名称
+   */
+  wardName?: string;
+
+  /**
+   * 诊疗卡号
+   */
+  treatNum?: string;
+
+    /**
+     * 日期范围参数
+     */
+    params?: any;
+}
+
+
+

+ 7 - 1
src/api/workbench/treatmentUser/types.ts

@@ -98,6 +98,9 @@ export interface TreatmentUserVo {
 
     bmi: string | number;
 
+    wardId?: number|string;
+
+
 }
 
 export interface TreatmentUserForm extends BaseEntity {
@@ -198,6 +201,9 @@ export interface TreatmentUserForm extends BaseEntity {
 
     bmi?: string | number;
 
+    wardId?: number|string;
+
+
 }
 
 export interface TreatmentUserQuery extends PageQuery {
@@ -285,7 +291,7 @@ export interface TreatmentUserQuery extends PageQuery {
     /**
      * 病区
      */
-    inpatientWard?: string;
+    wardId?: number|string;
 
     /**
      * 入院时间

+ 15 - 0
src/store/modules/chargeSet.ts

@@ -0,0 +1,15 @@
+import {defineStore} from 'pinia';
+import {ChargeSetVO} from '@/api/parameter/chargeSet/types';
+
+export const useChargeSetStore = defineStore('Set', () => {
+  const chargeSetInfo = ref<ChargeSetVO>();
+
+  const setChargeInfo = (val: ChargeSetVO) => {
+    chargeSetInfo.value = val;
+  };
+
+  return {
+    chargeSetInfo,
+    setChargeInfo
+  };
+});

+ 630 - 0
src/views/parameter/chargeSet/index.vue

@@ -0,0 +1,630 @@
+<template>
+    <div class="charge-set-container">
+        <!-- Tab栏 -->
+        <el-tabs v-model="activeTab" class="charge-tabs">
+            <el-tab-pane label="收费设置" name="charge">
+                <!-- 收费设置 -->
+                <div class="charge-content">
+                    <!-- 服务商选择 -->
+                    <div class="setting-group">
+                        <label class="setting-label">
+                            <span class="required">*</span>
+                            服务商选择:
+                        </label>
+                        <el-radio-group v-model="form.servicer">
+                            <el-radio v-for="dict in charge_set_servicer" :key="dict.value" :value="dict.value">
+                                {{ dict.label }}
+                            </el-radio>
+                        </el-radio-group>
+                    </div>
+
+                    <!-- 是否开启预定金收费 -->
+                    <div class="setting-group">
+                        <label class="setting-label">
+                            <span class="required">*</span>
+                            是否开启预定金收费:
+                        </label>
+                        <el-radio-group v-model="form.moneyCharge">
+                            <el-radio v-for="dict in money_charge" :key="dict.value" :value="dict.value">
+                                {{ dict.label }}
+                            </el-radio>
+                        </el-radio-group>
+                    </div>
+
+                    <!-- 收费模式设置 -->
+                    <div class="setting-group">
+                        <label class="setting-label">
+                            <span class="required">*</span>
+                            收费模式设置:
+                        </label>
+                        <el-radio-group v-model="form.chargeMode">
+                            <el-radio value='1'>单项收费</el-radio>
+                            <el-radio value="2">组合收费</el-radio>
+                        </el-radio-group>
+                    </div>
+
+                    <!-- 项目表格 -->
+                    <div class="table-container">
+                        <table v-if="form.chargeMode === '1'" class="charge-table">
+                            <thead>
+                                <tr>
+                                    <th>编号</th>
+                                    <th>项目名称 <span class="required">*</span></th>
+                                    <th>项目编码</th>
+                                    <th>计价单位</th>
+                                    <th>价格 <span class="required">*</span></th>
+                                </tr>
+                            </thead>
+                            <tbody>
+                                <tr v-for="(item, index) in chargeForm.forwardChargeItems" :key="index">
+                                    <td>{{ index + 1 }}</td>
+                                    <td>{{ item.name }}</td>
+                                    <td>
+                                        <input type="text" v-model="item.code" placeholder="请输入" class="table-input" />
+                                    </td>
+                                    <td>次</td>
+                                    <td class="price-cell">
+                                        <input type="number" v-model="item.price" class="table-input price-input" />
+                                        <span class="unit">元</span>
+                                    </td>
+                                </tr>
+                            </tbody>
+                        </table>
+
+                        <!-- 组合收费表格 -->
+                        <table v-else-if="form.chargeMode === '2'" class="charge-table">
+                            <thead>
+                                <tr>
+                                    <th>编号</th>
+                                    <th>项目名称 <span class="required">*</span></th>
+                                    <th>项目编码</th>
+                                    <th>计价单位</th>
+                                    <th>价格 <span class="required">*</span></th>
+                                </tr>
+                            </thead>
+                            <tbody>
+                                <tr v-for="(item, index) in chargeForm.combinedChargeItems" :key="index">
+                                    <td>{{ index + 1 }}</td>
+                                    <td>{{ item.name }}</td>
+                                    <td>
+                                        <input type="text" v-model="item.code" placeholder="请输入" class="table-input" />
+                                    </td>
+                                    <td>次</td>
+                                    <td class="price-cell">
+                                        <input type="number" v-model="item.price" class="table-input price-input" />
+                                        <span class="unit">元</span>
+                                    </td>
+                                </tr>
+                            </tbody>
+                        </table>
+                    </div>
+
+                    <!-- 营养筛查收费设置 -->
+                    <div class="setting-group">
+                        <label class="setting-label">
+                            <span class="required">*</span>
+                            营养筛查收费设置:
+                        </label>
+                        <div class="input-with-unit">
+                            <el-input v-model="form.nutritionChargeSet" type="number" class="number-input" placeholder="请输入金额" />
+                            <span class="unit">元/次</span>
+                        </div>
+                    </div>
+
+                    <!-- 适合处方类型 -->
+                    <div class="setting-group">
+                        <label class="setting-label">
+                            <span class="required">*</span>
+                            适合处方类型:
+                        </label>
+                        <el-checkbox-group v-model="chargeForm.prescriptionTypes">
+                            <el-checkbox v-for="dict in fee_type.filter(item => ['3', '4'].includes(item.value))" :key="dict.value" :value="dict.value">
+                                {{ dict.label }}
+                            </el-checkbox>
+                        </el-checkbox-group>
+                    </div>
+
+                    <!-- 住院患者订单设置 -->
+                    <div class="setting-group">
+                        <label class="setting-label">住院患者订单设置:</label>
+                        <el-radio-group v-model="form.patientOrderSet">
+                            <el-radio value="1">开启</el-radio>
+                            <el-radio value="2">关闭</el-radio>
+                        </el-radio-group>
+                    </div>
+
+                    <!-- 订单有效时长 -->
+                    <div class="setting-group">
+                        <label class="setting-label">订单有效时长:</label>
+                        <div class="duration-setting">
+                            <el-button class="duration-btn" @click="decreaseDuration">−</el-button>
+                            <el-input v-model="form.orderIndate" class="duration-input" :min="1" :max="365" />
+                            <el-button class="duration-btn" @click="increaseDuration">+</el-button>
+                            <span class="unit">天</span>
+                        </div>
+                    </div>
+
+                    <!-- 保存按钮 -->
+                    <div class="save-button-container">
+                        <button class="save-btn" @click="submitForm">保存</button>
+                    </div>
+                </div>
+            </el-tab-pane>
+
+            <el-tab-pane label="账户设置" name="account">
+                <!-- 账户设置 -->
+                <div class="account-content">
+                    <!-- 是否开启账户 -->
+                    <div class="setting-group">
+                        <label class="setting-label">是否开启账户:</label>
+                        <el-radio-group v-model="accountForm.enableAccount">
+                            <el-radio value="1">是</el-radio>
+                            <el-radio value="0">否</el-radio>
+                        </el-radio-group>
+                    </div>
+
+                    <!-- 账户扣费设置 -->
+                    <div class="setting-group">
+                        <label class="setting-label">账户扣费设置:</label>
+                        <el-radio-group v-model="accountForm.chargeSetting">
+                            <el-radio value="inpatient">住院</el-radio>
+                        </el-radio-group>
+                    </div>
+
+                    <!-- 信用额度 -->
+                    <div class="setting-group">
+                        <label class="setting-label">信用额度:</label>
+                        <div class="input-with-unit">
+                            <el-input v-model="accountForm.creditLimit" type="number" class="number-input" placeholder="0.00" />
+                            <span class="unit">元</span>
+                        </div>
+                    </div>
+
+                    <!-- 最低充值额度 -->
+                    <div class="setting-group">
+                        <label class="setting-label">最低充值额度:</label>
+                        <div class="input-with-unit">
+                            <el-input v-model="accountForm.minRechargeAmount" type="number" class="number-input" placeholder="0.00" />
+                            <span class="unit">元</span>
+                        </div>
+                    </div>
+
+                    <!-- 自动扣费设置 -->
+                    <div class="setting-group">
+                        <label class="setting-label">自动扣费设置:</label>
+                        <el-radio-group v-model="accountForm.autoDeduction">
+                            <el-radio value="1">开启</el-radio>
+                            <el-radio value="0">关闭</el-radio>
+                        </el-radio-group>
+                    </div>
+
+                    <!-- 充值方式 -->
+                    <div class="setting-group">
+                        <label class="setting-label">充值方式:</label>
+                        <el-checkbox-group v-model="accountForm.rechargeMethod">
+                            <el-checkbox value="cash">现金充值</el-checkbox>
+                            <el-checkbox value="unionpay">银联充值</el-checkbox>
+                        </el-checkbox-group>
+                    </div>
+
+                    <!-- 保存按钮 -->
+                    <div class="save-button-container">
+                        <button class="save-btn" @click="saveAccountSettings">保存</button>
+                    </div>
+                </div>
+            </el-tab-pane>
+        </el-tabs>
+    </div>
+</template>
+
+<script setup name="Set" lang="ts">
+    import { listSet, getSet, delSet, addSet, updateSet } from '@/api/parameter/chargeSet';
+    import { ChargeSetVO, ChargeSetQuery, ChargeSetForm } from '@/api/parameter/chargeSet/types';
+
+    const { proxy } = getCurrentInstance() as ComponentInternalInstance;
+    const { charge_set_servicer, money_charge, fee_type } = toRefs < any > (proxy ?.useDict('charge_set_servicer', 'money_charge', 'fee_type'));
+
+    import { useChargeSetStore } from '@/store/modules/chargeSet';
+    const useStore = useChargeSetStore();
+    const setList = ref < ChargeSetVO[] > ([]);
+    const buttonLoading = ref(false);
+    const loading = ref(true);
+    const ids = ref < Array < string | number >> ([]);
+    const single = ref(true);
+    const multiple = ref(true);
+    const total = ref(0);
+
+    const queryFormRef = ref < ElFormInstance > ();
+    const ChargeSetFormRef = ref < ElFormInstance > ();
+
+    const dialog = reactive < DialogOption > ({
+        visible: false,
+        title: ''
+    });
+
+    import { ref, reactive } from 'vue';
+
+    // Tab状态
+    const activeTab = ref('charge');
+
+    // 表单数据
+    const chargeForm = reactive({
+        forwardChargeItems: [
+            { name: '营养筛查', code: '', price: null },
+            { name: '营养评估', code: '', price: null },
+            { name: '心理筛查', code: '', price: null },
+            { name: '过敏性疾病评估', code: '', price: null },
+            { name: '预后评估', code: '', price: null }
+        ],
+        // 组合收费项目
+        combinedChargeItems: [{ name: '营养综合评估', code: '', price: null }],
+        prescriptionTypes: ['3', '4'],
+    });
+
+    // 账户设置表单数据
+    const accountForm = reactive({
+        enableAccount: '1',
+        chargeSetting: 'inpatient',
+        creditLimit: '0.00',
+        minRechargeAmount: '0.00',
+        autoDeduction: '1',
+        rechargeMethod: ['cash', 'unionpay']
+    });
+
+    // 订单有效时长增加
+    const increaseDuration = () => {
+        if (form.value.orderIndate < 365) {
+            form.value.orderIndate++;
+        }
+    };
+
+    // 订单有效时长减少
+    const decreaseDuration = () => {
+        if (form.value.orderIndate > 1) {
+            form.value.orderIndate--;
+        }
+    };
+
+    const initFormData: ChargeSetForm = {
+        chargeId: undefined,
+        servicer: '1',
+        moneyCharge: '1',
+        chargeMode: '1',
+        chargeType: 1,
+        oneWayCharge: undefined,
+        groupCharge: undefined,
+        nutritionChargeSet: '1',
+        suitRecipe: undefined,
+        patientOrderSet: '1',
+        orderIndate: undefined,
+        multiModeCharge: undefined,
+        chargeItemArr: []
+    }
+    const data = reactive < PageData < ChargeSetForm,
+        ChargeSetQuery >> ({
+            form: { ...initFormData },
+            queryParams: {
+                pageNum: 1,
+                pageSize: 10,
+                servicer: undefined,
+                params: {}
+            },
+            rules: {
+                servicer: [
+                    { required: true, message: "服务商不能为空", trigger: "blur" }
+                ],
+                moneyCharge: [
+                    { required: true, message: "是否开启现金收费不能为空", trigger: "blur" }
+                ],
+                chargeMode: [
+                    { required: true, message: "收费模式不能为空", trigger: "blur" }
+                ],
+                chargeType: [
+                    { required: true, message: "收费方式 1单项收费 2 组合收费不能为空", trigger: "change" }
+                ],
+                nutritionChargeSet: [
+                    { required: true, message: "营养配置收费设置不能为空", trigger: "blur" }
+                ],
+                suitRecipe: [
+                    { required: true, message: "适合处方类型不能为空", trigger: "blur" }
+                ],
+            }
+        });
+
+    const { queryParams, form, rules } = toRefs(data);
+
+    /** 查询收费设置列表 */
+    const getList = async () => {
+        loading.value = true;
+        const res = await listSet(queryParams.value);
+        setList.value = res.rows;
+
+        if (res.rows.length > 0) {
+            useStore.setChargeInfo(res.rows[0]);
+            // 回显数据到表单
+            loadFormData(res.rows[0]);
+        } else {
+            // 如果没有数据,重置为默认值
+            reset();
+        }
+
+        total.value = res.total;
+        loading.value = false;
+    };
+
+    /** 表单重置 */
+    const reset = () => {
+        form.value = { ...initFormData };
+        ChargeSetFormRef.value ?.resetFields();
+    };
+
+    /** 加载表单数据(回显) */
+    const loadFormData = (data: ChargeSetVO) => {
+        if (!data) {
+            console.warn('loadFormData: 数据为空');
+            return;
+        }
+
+        // 回显基本表单数据
+        Object.assign(form.value, data);
+
+        // 确保关键字段正确回显(处理数字和字符串兼容性)
+        form.value.servicer = String(data.servicer || '1');
+        form.value.moneyCharge = String(data.moneyCharge || '1');
+        form.value.chargeMode = String(data.chargeMode || '1');
+        form.value.nutritionChargeSet = data.nutritionChargeSet || '1';
+        form.value.patientOrderSet = String(data.patientOrderSet || '1');
+        // 回显收费项目数据(兼容数字和字符串类型的chargeMode)
+        if ((data as any).chargeItemArr && (data as any).chargeItemArr.length > 0) {
+            const chargeMode = String(data.chargeMode);
+            if (chargeMode === '1') {
+                chargeForm.forwardChargeItems = (data as any).chargeItemArr;
+            } else if (chargeMode === '2') {
+                chargeForm.combinedChargeItems = (data as any).chargeItemArr;
+            }
+        }
+
+        // 回显其他复杂字段
+        if (data.suitRecipe) {
+            chargeForm.prescriptionTypes = data.suitRecipe.split(',');
+        } else {
+            // 如果没有处方类型数据,设置默认值
+            chargeForm.prescriptionTypes = ['1', '2'];
+        }
+
+    };
+
+    /** 搜索按钮操作 */
+    const handleQuery = () => {
+        queryParams.value.pageNum = 1;
+        getList();
+    }
+
+
+
+    /** 多选框选中数据 */
+    const handleSelectionChange = (selection: ChargeSetVO[]) => {
+        ids.value = selection.map(item => item.chargeId);
+        single.value = selection.length != 1;
+        multiple.value = !selection.length;
+    }
+
+
+
+    /** 提交按钮 */
+    const submitForm = async () => {
+        if (form.value.chargeMode == '1') {
+            (form.value as any).chargeItemArr = chargeForm.forwardChargeItems;
+        } else {
+            (form.value as any).chargeItemArr = chargeForm.combinedChargeItems;
+        }
+        // 根据页面选择的复选框动态拼接适合处方类型
+        form.value.suitRecipe = chargeForm.prescriptionTypes.join(',');
+
+        buttonLoading.value = true;
+
+        try {
+            // 单例配置表:如果已存在数据,则更新;如果不存在,则添加
+            if (setList.value.length > 0) {
+                // 更新现有的第一条数据
+                form.value.chargeId = setList.value[0].chargeId;
+                await updateSet(form.value);
+            } else {
+                // 添加新数据
+                await addSet(form.value);
+            }
+
+            proxy ?.$modal.msgSuccess("操作成功");
+            // 重新获取数据并回显
+            await getList();
+        } catch (error) {
+            console.error('保存失败:', error);
+        } finally {
+            buttonLoading.value = false;
+        }
+    };
+
+    /** 保存账户设置 */
+    const saveAccountSettings = () => {
+        console.log('保存账户设置:', accountForm);
+        proxy ?.$modal.msgSuccess('账户设置保存成功');
+    };
+
+    onMounted(() => {
+        getList();
+    });
+</script>
+<style lang="scss">
+    .charge-set-container {
+        padding: 20px;
+        background: #fff;
+
+        .charge-tabs {
+            .el-tabs__content {
+                padding: 0;
+            }
+        }
+
+        .charge-content,
+        .account-content {
+            .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;
+                    }
+                }
+
+                .input-with-unit {
+                    display: flex;
+                    align-items: center;
+
+                    .number-input {
+                        width: 100px;
+                    }
+
+                    .unit {
+                        margin-left: 8px;
+                        color: #606266;
+                    }
+                }
+
+                .duration-setting {
+                    display: flex;
+                    align-items: center;
+
+                    .duration-btn {
+                        width: 32px;
+                        height: 32px;
+                        padding: 0;
+                        border-radius: 0;
+
+                        &:first-child {
+                            border-top-left-radius: 4px;
+                            border-bottom-left-radius: 4px;
+                        }
+
+                        &:last-of-type {
+                            border-top-right-radius: 4px;
+                            border-bottom-right-radius: 4px;
+                            border-left: none;
+                        }
+                    }
+
+                    .duration-input {
+                        width: 60px;
+
+                        :deep(.el-input__wrapper) {
+                            border-radius: 0;
+                            border-left: none;
+                            border-right: none;
+                            text-align: center;
+                        }
+                    }
+
+                    .unit {
+                        margin-left: 8px;
+                        color: #606266;
+                    }
+                }
+            }
+        }
+
+        .table-container {
+            margin: 30px 0;
+
+            .charge-table {
+                width: 100%;
+                border-collapse: collapse;
+                border: 1px solid #ebeef5;
+
+                th,
+                td {
+                    padding: 12px;
+                    text-align: left;
+                    border-bottom: 1px solid #ebeef5;
+                    border-right: 1px solid #ebeef5;
+
+                    &:last-child {
+                        border-right: none;
+                    }
+                }
+
+                th {
+                    background: #f5f7fa;
+                    color: #909399;
+                    font-weight: 500;
+
+                    .required {
+                        color: #f56c6c;
+                    }
+                }
+
+                .table-input {
+                    width: 100%;
+                    padding: 6px 8px;
+                    border: 1px solid #dcdfe6;
+                    border-radius: 4px;
+                    outline: none;
+
+                    &:focus {
+                        border-color: #409eff;
+                    }
+                }
+
+                .price-cell {
+                    display: flex;
+                    align-items: center;
+
+                    .price-input {
+                        width: 80px;
+                        margin-right: 8px;
+                    }
+
+                    .unit {
+                        color: #606266;
+                    }
+                }
+            }
+        }
+
+        .save-button-container {
+            display: flex;
+            justify-content: center;
+            margin-top: 40px;
+
+            .save-btn {
+                padding: 12px 40px;
+                background: #409eff;
+                color: #fff;
+                border: none;
+                border-radius: 4px;
+                cursor: pointer;
+                font-size: 14px;
+
+                &:hover {
+                    background: #66b1ff;
+                }
+            }
+        }
+
+        .account-content {
+            .placeholder {
+                text-align: center;
+                color: #909399;
+                padding: 60px 0;
+                font-size: 16px;
+            }
+        }
+    }
+</style>

+ 30 - 5
src/views/patients/medicalRecord/editDialog.vue

@@ -73,8 +73,10 @@
                         <el-form-item label="床号:" prop="bedNo" v-if="form.type === '1'">
                             <el-input v-model="form.bedNo" placeholder="请输入" />
                         </el-form-item>
-                        <el-form-item label="病区:" prop="inpatientWard" v-if="form.type === '1'">
-                            <el-input v-model="form.inpatientWard" placeholder="请输入" />
+                        <el-form-item label="病区:" prop="wardId" v-if="form.type === '1'">
+                            <el-select v-model="form.wardId" placeholder="请选择">
+                                <el-option v-for="item in inpatientWardList" :key="item.value" :label="item.label" :value="item.value" />
+                            </el-select>
                         </el-form-item>
                         <el-form-item label="入院日期:" prop="admissionDate" v-if="form.type === '1'">
                             <el-date-picker v-model="form.admissionDate" type="date" placeholder="请选择" value-format="YYYY-MM-DD" style="width: 100%" />
@@ -93,9 +95,10 @@
 <script setup lang="ts">
     import { ref, watch, getCurrentInstance, toRefs } from 'vue';
     import { ElDialog, ElForm, ElFormItem, ElInput, ElButton, ElSelect, ElOption, ElCol, ElRow, ElDatePicker } from 'element-plus';
-    
+
     const { proxy } = getCurrentInstance() as ComponentInternalInstance;
-    const { physical_activity } = toRefs(proxy?.useDict('physical_activity'));
+    const { physical_activity } = toRefs(proxy ?.useDict('physical_activity'));
+    import { listWard } from '@/api/system/ward';
 
     const props = defineProps({
         visible: Boolean,
@@ -105,7 +108,7 @@
         }
     });
     const emit = defineEmits(['update:visible', 'save', 'close']);
-
+    const inpatientWardList = ref([]);
     const formRef = ref();
     const form = ref({ ...props.editData });
 
@@ -131,6 +134,25 @@
         });
     }
 
+    // 获取病区列表数据
+    const getWardList = async () => {
+        try {
+            const res = await listWard({
+                pageNum: 1,
+                pageSize: 999
+            });
+            if (res.rows && Array.isArray(res.rows)) {
+                inpatientWardList.value = res.rows.map(item => ({
+                    value: item.wardId,
+                    label: item.wardName
+                }));
+            }
+        } catch (error) {
+            console.error('获取病区列表失败:', error);
+            inpatientWardList.value = [];
+        }
+    };
+
     function handleClose() {
         emit('update:visible', false);
         emit('close');
@@ -139,6 +161,9 @@
     defineOptions({
         name: 'EditDialog'
     });
+    onMounted(() => {
+        getWardList(); // 初始化时加载病区数据
+    });
 </script>
 
 <style scoped>

+ 249 - 243
src/views/patients/nutritionSetting/addForm.vue

@@ -27,7 +27,7 @@
                 <el-col :span="3" v-if="title === '烧伤公式'"><span>烧伤面积:</span>
                     <el-input v-model="form.burnArea" style="width: 120px;" /> <span>%</span>
                 </el-col>
-                <el-col :span="3"><span>体重:</span>
+                <el-col :span="3"><span class="required">*</span><span>体重:</span>
                     <el-input v-model="form.weight" style="width: 120px;" /> <span>kg</span>
                 </el-col>
                 <el-col :span="3"><span>上臂围:</span>
@@ -39,7 +39,7 @@
                     <el-input v-model="form.calfCircumference" style="width: 120px;" /> <span>cm</span>
                 </el-col>
                 <el-col :span="20" style="text-align:right;">
-                    <el-button type="primary" class="recalc-btn" @click="()=>recalculate(form.gender, form.age, form.height, form.weight, form.activity, form.stressType)">重新计算</el-button>
+                    <el-button type="primary" class="recalc-btn" @click="()=>recalculate(form.settingType,form.gender, form.age, form.height, form.weight, form.activity, form.stressType,form.burnArea)">重新计算</el-button>
                 </el-col>
             </el-row>
         </div>
@@ -258,275 +258,281 @@
                             </el-form-item>
                         </el-col>
 
-            <el-col :span="8">
-              <el-form-item label="维生素D:" class="right-label">
-                <el-input v-model="form.vitaminD" style="width: 200px" />
-                <span class="unit">μg/d</span>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="维生素E:" class="right-label">
-                <el-input v-model="form.vitaminE" style="width: 200px" />
-                <span class="unit">mgα-TE/d</span>
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row :gutter="20" style="margin-top: 8px">
-            <el-col :span="8">
-              <el-form-item label="维生素K:" class="right-label">
-                <el-input v-model="form.vitaminK" style="width: 200px" />
-                <span class="unit">μg/d</span>
-              </el-form-item>
-            </el-col>
-          </el-row>
-        </div>
-        <!-- 水溶性维生素 -->
-        <div class="group-card">
-          <div class="group-title">水溶性维生素</div>
-          <el-row :gutter="20">
-            <el-col :span="8">
-              <el-form-item label="维生素B1:" class="right-label">
-                <el-input v-model="form.vitaminBOne" style="width: 200px" />
-                <span class="unit">mg/d</span>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="维生素B2:" class="right-label">
-                <el-input v-model="form.vitaminBTwo" style="width: 200px" />
-                <span class="unit">mg/d</span>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="维生素B6:" class="right-label">
-                <el-input v-model="form.vitaminBSix" style="width: 200px" />
-                <span class="unit">mg/d</span>
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row :gutter="20" style="margin-top: 8px">
-            <el-col :span="8">
-              <el-form-item label="维生素B12:" class="right-label">
-                <el-input v-model="form.vitaminBTwelve" style="width: 200px" />
-                <span class="unit">μg/d</span>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="烟酸(尼克酸):" class="right-label">
-                <el-input v-model="form.niacin" style="width: 200px" />
-                <span class="unit">mgNE/d</span>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="维生素C:" class="right-label">
-                <el-input v-model="form.vitaminC" style="width: 200px" />
-                <span class="unit">mg/d</span>
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row :gutter="20" style="margin-top: 8px">
-            <el-col :span="8">
-              <el-form-item label="叶酸:" class="right-label">
-                <el-input v-model="form.folicAcid" style="width: 200px" />
-                <span class="unit">μgDFE/d</span>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="生物素:" class="right-label">
-                <el-input v-model="form.biotin" style="width: 200px" />
-                <span class="unit">μg/d</span>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="胆碱:" class="right-label">
-                <el-input v-model="form.choline" style="width: 200px" />
-                <span class="unit">mg/d</span>
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row :gutter="20" style="margin-top: 8px">
-            <el-col :span="8">
-              <el-form-item label="泛酸:" class="right-label">
-                <el-input v-model="form.pantothenicAcid" style="width: 200px" />
-                <span class="unit">mg/d</span>
-              </el-form-item>
-            </el-col>
-          </el-row>
-        </div>
-        <!-- 其他 -->
-        <div class="group-card">
-          <div class="group-title">其他</div>
-          <el-row :gutter="20">
-            <el-col :span="8">
-              <el-form-item label="膳食纤维:" class="right-label">
-                <el-input v-model="form.dietaryFiber" style="width: 200px" />
-                <span class="unit">g/d</span>
-              </el-form-item>
-            </el-col>
-          </el-row>
+                        <el-col :span="8">
+                            <el-form-item label="维生素D:" class="right-label">
+                                <el-input v-model="form.vitaminD" style="width: 200px;" />
+                                <span class="unit">μg/d</span>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="8">
+                            <el-form-item label="维生素E:" class="right-label">
+                                <el-input v-model="form.vitaminE" style="width: 200px;" />
+                                <span class="unit">mgα-TE/d</span>
+                            </el-form-item>
+                        </el-col>
+                    </el-row>
+                    <el-row :gutter="20" style="margin-top: 8px;">
+                        <el-col :span="8">
+                            <el-form-item label="维生素K:" class="right-label">
+                                <el-input v-model="form.vitaminK" style="width: 200px;" />
+                                <span class="unit">μg/d</span>
+                            </el-form-item>
+                        </el-col>
+                    </el-row>
+                </div>
+                <!-- 水溶性维生素 -->
+                <div class="group-card">
+                    <div class="group-title">水溶性维生素</div>
+                    <el-row :gutter="20">
+                        <el-col :span="8">
+                            <el-form-item label="维生素B1:" class="right-label">
+                                <el-input v-model="form.vitaminBOne" style="width: 200px;" />
+                                <span class="unit">mg/d</span>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="8">
+                            <el-form-item label="维生素B2:" class="right-label">
+                                <el-input v-model="form.vitaminBTwo" style="width: 200px;" />
+                                <span class="unit">mg/d</span>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="8">
+                            <el-form-item label="维生素B6:" class="right-label">
+                                <el-input v-model="form.vitaminBSix" style="width: 200px;" />
+                                <span class="unit">mg/d</span>
+                            </el-form-item>
+                        </el-col>
+
+                    </el-row>
+                    <el-row :gutter="20" style="margin-top: 8px;">
+                        <el-col :span="8">
+                            <el-form-item label="维生素B12:" class="right-label">
+                                <el-input v-model="form.vitaminBTwelve" style="width: 200px;" />
+                                <span class="unit">μg/d</span>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="8">
+                            <el-form-item label="烟酸(尼克酸):" class="right-label">
+                                <el-input v-model="form.niacin" style="width: 200px;" />
+                                <span class="unit">mgNE/d</span>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="8">
+                            <el-form-item label="维生素C:" class="right-label">
+                                <el-input v-model="form.vitaminC" style="width: 200px;" />
+                                <span class="unit">mg/d</span>
+                            </el-form-item>
+                        </el-col>
+                    </el-row>
+                    <el-row :gutter="20" style="margin-top: 8px;">
+                        <el-col :span="8">
+                            <el-form-item label="叶酸:" class="right-label">
+                                <el-input v-model="form.folicAcid" style="width: 200px;" />
+                                <span class="unit">μgDFE/d</span>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="8">
+                            <el-form-item label="生物素:" class="right-label">
+                                <el-input v-model="form.biotin" style="width: 200px;" />
+                                <span class="unit">μg/d</span>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="8">
+                            <el-form-item label="胆碱:" class="right-label">
+                                <el-input v-model="form.choline" style="width: 200px;" />
+                                <span class="unit">mg/d</span>
+                            </el-form-item>
+                        </el-col>
+                    </el-row>
+                    <el-row :gutter="20" style="margin-top: 8px;">
+                        <el-col :span="8">
+                            <el-form-item label="泛酸:" class="right-label">
+                                <el-input v-model="form.pantothenicAcid" style="width: 200px;" />
+                                <span class="unit">mg/d</span>
+                            </el-form-item>
+                        </el-col>
+
+                    </el-row>
+                </div>
+                <!-- 其他 -->
+                <div class="group-card">
+                    <div class="group-title">其他</div>
+                    <el-row :gutter="20">
+                        <el-col :span="8">
+                            <el-form-item label="膳食纤维:" class="right-label">
+                                <el-input v-model="form.dietaryFiber" style="width: 200px;" />
+                                <span class="unit">g/d</span>
+                            </el-form-item>
+                        </el-col>
+                    </el-row>
+                </div>
+            </el-form>
+            <div class="flex justify-center gap-2 mt-4">
+                <el-button :loading="buttonLoading" type="primary" @click="submitForm">保 存</el-button>
+            </div>
         </div>
-      </el-form>
-      <div class="flex justify-center gap-2 mt-4">
-        <el-button :loading="buttonLoading" type="primary" @click="submitForm">保 存</el-button>
-      </div>
+
     </div>
-  </div>
 </template>
 
 <script setup lang="ts">
-import {ref, toRefs, getCurrentInstance} from 'vue';
-import {addSetting, updateSetting, recalculateValue} from '@/api/patients/nutritionSetting';
-import type {FormInstance} from 'element-plus';
-const {proxy} = getCurrentInstance() as any;
-const {physical_activity, stress_level} = toRefs(proxy?.useDict('physical_activity', 'stress_level'));
-const emit = defineEmits(['change']);
-const props = defineProps({
-  form: {type: Object, required: true},
-  rules: {type: Object, required: true},
-  buttonLoading: {type: Boolean, required: true},
-  cancel: {type: Function, required: true},
-  handleCancelOne: {type: Function, required: true},
-  title: {type: String}
-});
-const {handleCancelOne, form, rules} = props;
-const {title} = toRefs(props);
-const showFlag = ref('false');
-const buttonLoading = ref(false);
-const NutritionSettingFormRef = ref<FormInstance>();
+    import { ref, toRefs, getCurrentInstance } from 'vue';
+    import { addSetting, updateSetting, recalculateValue } from '@/api/patients/nutritionSetting';
+    import type { FormInstance } from 'element-plus';
+    const { proxy } = getCurrentInstance() as any;
+    const { physical_activity, stress_level } = toRefs(proxy ?.useDict('physical_activity', 'stress_level'));
+    const emit = defineEmits(['change'])
+    const props = defineProps({
+        form: { type: Object, required: true },
+        rules: { type: Object, required: true },
+        buttonLoading: { type: Boolean, required: true },
+        cancel: { type: Function, required: true },
+        handleCancelOne: { type: Function, required: true },
+        title: { type: String }
+    });
+    const { handleCancelOne, form, rules } = props;
+    const { title } = toRefs(props);
+    const showFlag = ref('false');
+    const buttonLoading = ref(false);
+    const NutritionSettingFormRef = ref < FormInstance > ();
+
 
-    const recalculate = async (gender, age, height, weight, activity, stressType) => {
-        const res = await recalculateValue({ gender, age, height, weight, activity, stressType });
+    const recalculate = async (settingType,gender, age, height, weight, activity, stressType,burnArea) => {
+        const res = await recalculateValue({settingType, gender, age, height, weight, activity, stressType ,burnArea});
+        
         if (res) {
             const keepSettingType = form.settingType;
             Object.assign(form, res);
             form.settingType = keepSettingType; // 恢复settingType的值
-
         }
         showFlag.value = 'true';
     };
 
-/** 提交按钮 */
-const submitForm = async () => {
-  if (!NutritionSettingFormRef.value) return;
-  await NutritionSettingFormRef.value.validate(async (valid: boolean) => {
-    if (valid) {
-      buttonLoading.value = true;
-      try {
-        if (form.id) {
-          await updateSetting(form);
-        } else {
-          console.log(form.settingType);
-          await addSetting(form);
-        }
-        proxy?.$modal.msgSuccess('操作成功');
-        onBack();
-      } catch (error) {
-        console.error('提交失败', error);
-      } finally {
-        buttonLoading.value = false;
-      }
-    }
-  });
-};
-const close = async () => {};
+    /** 提交按钮 */
+    const submitForm = async () => {
+        if (!NutritionSettingFormRef.value) return;
+        await NutritionSettingFormRef.value.validate(async (valid: boolean) => {
+            if (valid) {
+                buttonLoading.value = true;
+                try {
+                    if (form.id) {
+                        await updateSetting(form);
+                    } else {
+                        console.log(form.settingType);
+                        await addSetting(form);
+                    }
+                    proxy ?.$modal.msgSuccess('操作成功');
+                    onBack();
+                } catch (error) {
+                    console.error('提交失败', error);
+                } finally {
+                    buttonLoading.value = false;
+                }
+            }
+        });
+    };
+    const close = async () => {
+
+    };
 
-const onBack = () => {
-  showFlag.value = 'false';
-  emit('change', 'nutritionSetting');
-  handleCancelOne();
-};
+    const onBack = () => {
+        showFlag.value = 'false';
+        emit('change', 'nutritionSetting');
+        handleCancelOne();
+    };
 </script>
 
 <style scoped>
-.page-current {
-  display: flex;
-  align-items: center;
-  padding: 20px;
-  background: #fff;
-  border-bottom: 1px solid #e6e6e6;
-}
+    .page-current {
+        display: flex;
+        align-items: center;
+        padding: 20px;
+        background: #fff;
+        border-bottom: 1px solid #e6e6e6;
+    }
 
-.question-main {
-  padding: 20px 0 100px;
-}
+    .question-main {
+        padding: 20px 0 100px;
+    }
 
-.info-card-bee {
-  margin-bottom: 16px;
-  background: #f8fafc;
-  border-radius: 8px;
-  box-shadow: 0 2px 8px #f0f1f2;
-  padding: 18px 24px 10px 24px;
-  border: none;
-}
+    .info-card-bee {
+        margin-bottom: 16px;
+        background: #f8fafc;
+        border-radius: 8px;
+        box-shadow: 0 2px 8px #f0f1f2;
+        padding: 18px 24px 10px 24px;
+        border: none;
+    }
 
-.info-title {
-  font-weight: bold;
-  font-size: 16px;
-  color: #409eff;
-  margin-bottom: 8px;
-  padding-left: 2px;
-}
+    .info-title {
+        font-weight: bold;
+        font-size: 16px;
+        color: #409EFF;
+        margin-bottom: 8px;
+        padding-left: 2px;
+    }
 
-.bee-title {
-  border-left: 4px solid #409eff;
-  padding-left: 8px;
-  font-size: 16px;
-  font-weight: bold;
-  color: #409eff;
-}
+    .bee-title {
+        border-left: 4px solid #409EFF;
+        padding-left: 8px;
+        font-size: 16px;
+        font-weight: bold;
+        color: #409EFF;
+    }
 
-.info-row {
-  background: #f8fafc;
-  font-size: 16px;
-  padding: 0 0 0 0;
-  margin: 0;
-}
+    .info-row {
+        background: #f8fafc;
+        font-size: 16px;
+        padding: 0 0 0 0;
+        margin: 0;
+    }
 
-.required {
-  color: #f56c6c;
-  margin-right: 2px;
-}
+    .required {
+        color: #f56c6c;
+        margin-right: 2px;
+    }
 
-.recalc-btn {
-  margin-left: 12px;
-}
+    .recalc-btn {
+        margin-left: 12px;
+    }
 
-.tips-box {
-  color: #ff5e4c;
-  margin: 16px 0;
-  font-size: 14px;
-}
+    .tips-box {
+        color: #ff5e4c;
+        margin: 16px 0;
+        font-size: 14px;
+    }
 
-.group-card {
-  background: #fff;
-  border-radius: 8px;
-  margin-bottom: 24px;
-  box-shadow: 0 2px 8px #f0f1f2;
-  padding: 16px 24px;
-}
+    .group-card {
+        background: #fff;
+        border-radius: 8px;
+        margin-bottom: 24px;
+        box-shadow: 0 2px 8px #f0f1f2;
+        padding: 16px 24px;
+    }
 
-.group-title {
-  background: #f5f7fa;
-  padding: 8px 16px;
-  font-weight: bold;
-  border-radius: 4px;
-  margin-bottom: 16px;
-  font-size: 16px;
-}
+    .group-title {
+        background: #f5f7fa;
+        padding: 8px 16px;
+        font-weight: bold;
+        border-radius: 4px;
+        margin-bottom: 16px;
+        font-size: 16px;
+    }
 
-.unit {
-  margin-left: 4px;
-  color: #888;
-}
+    .unit {
+        margin-left: 4px;
+        color: #888;
+    }
 
-.right-label .el-form-item__label {
-  text-align: right !important;
-  justify-content: flex-end;
-  display: flex;
-}
+    .right-label .el-form-item__label {
+        text-align: right !important;
+        justify-content: flex-end;
+        display: flex;
+    }
 
-::v-deep .el-form-item__label {
-  text-align: right !important;
-  justify-content: flex-end;
-  display: flex;
-}
-</style>
+    ::v-deep .el-form-item__label {
+        text-align: right !important;
+        justify-content: flex-end;
+        display: flex;
+    }
+</style>

+ 601 - 0
src/views/recipeCheck/index.vue

@@ -0,0 +1,601 @@
+<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="85">
+                        <el-form-item label="开方时间" prop="orderTime">
+                            <el-date-picker v-model="queryParams.dateRange" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" />
+                        </el-form-item>
+                        <el-form-item label="看诊类型:">
+                            <el-select v-model="queryParams.visitType">
+                                <el-option v-for="dict in treatment_user_type" :key="dict.value" :label="dict.label" :value="dict.value" />
+                            </el-select>
+                        </el-form-item>
+                        <el-form-item label="科室" prop="doorId">
+                            <el-tree-select v-model="queryParams.doorId" :data="treeData" :props="treeProps" placeholder="请选择" check-strictly node-key="id" @keyup.enter="handleQuery" />
+                        </el-form-item>
+                        <el-form-item label="审核状态" prop="checkStatus">
+                            <el-select v-model="queryParams.checkStatus">
+                                <el-option v-for="dict in check_status" :key="dict.value" :label="dict.label" :value="dict.value" />
+                            </el-select>
+                        </el-form-item>
+                        <el-form-item label="处方类型" prop="recipeType">
+                            <el-select v-model="queryParams.chargeType">
+                                <el-option v-for="dict in fee_type" :key="dict.value" :label="dict.label" :value="dict.value" />
+                            </el-select>
+                        </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">
+            <span>待审核数量:<span style="color:red">{{total}}</span></span>
+            <el-table v-loading="loading" border :data="settlementList" @selection-change="handleSelectionChange">
+                <el-table-column type="selection" width="55" align="center" />
+                <el-table-column label="开方时间" align="center" prop="orderTime" width="180">
+                    <template #default="scope">
+                        <span>{{ parseTime(scope.row.orderTime, '{y}-{m}-{d}') }}</span>
+                    </template>
+                </el-table-column>
+                <el-table-column label="开方医生" align="center" prop="createByUser" />
+                <el-table-column label="处方ID" align="center" prop="id" />
+                <el-table-column label="处方类型" align="center" prop="chargeType">
+                    <template #default="scope">
+                        <span>{{ getDictLabel(fee_type, scope.row.chargeType) || '--' }}</span>
+                    </template>
+                </el-table-column>
+                <!-- <el-table-column label="处方类型" align="center" prop="recipeType">
+                    <template #default="scope">
+                        <span>{{ getDictLabel(recipe_type, scope.row.recipeType) || '--' }}</span>
+                    </template>
+                </el-table-column> -->
+                <el-table-column label="处方明细" align="center" prop="recipeDetail" />
+                <el-table-column label="患者科室" align="center" prop="patientDepartment" />
+                <el-table-column label="患者姓名" align="center" prop="patientName" />
+                <el-table-column label="看诊类型" align="center" prop="visitType">
+                    <template #default="scope">
+                        <span>{{ getDictLabel(treatment_user_type, scope.row.visitType) || '--' }}</span>
+                    </template>
+                </el-table-column>
+                <el-table-column label="身份证号" align="center" prop="idCard" />
+                <el-table-column label="诊疗卡号" align="center" prop="treatNum" />
+                <el-table-column label="住院/门诊号" align="center" prop="patientNo" />
+                <el-table-column label="病区" align="center" prop="wardName">
+                    <template #default="scope">
+                        <span>{{ scope.row.wardName || '--' }}</span>
+                    </template>
+                </el-table-column>
+                <el-table-column label="床号" align="center" prop="bedNo">
+                    <template #default="scope">
+                        <span>{{ scope.row.bedNo || '--' }}</span>
+                    </template>
+                </el-table-column>
+                <el-table-column label="审核状态" align="center" prop="checkStatus">
+                    <template #default="scope">
+                        <span>{{ getDictLabel(check_status, scope.row.checkStatus) || '--' }}</span>
+                    </template>
+                </el-table-column>
+                <el-table-column label="审核医生" align="center" prop="updateByUser">
+                    <template #default="scope">
+                        <span>{{ scope.row.updateByUser || '--' }}</span>
+                    </template>
+                </el-table-column>
+                <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+                    <template #default="scope">
+                        <div v-if="scope.row.checkStatus=='1'||scope.row.checkStatus=='3'">
+                            <el-tooltip content="审核" placement="top">
+                                <el-button link type="primary" @click="handleCheck(scope.row)" v-hasPermi="['system:settlement:edit']">审核</el-button>
+                            </el-tooltip>
+                        </div>
+                        <div v-else>
+                            <el-tooltip content="详情" placement="top">
+                                <el-button link type="primary" @click="handleDetail(scope.row)" v-hasPermi="['system:settlement:edit']">详情</el-button>
+                            </el-tooltip>
+                        </div>
+                    </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="65%" append-to-body @close="cancel">
+            <!-- 患者信息 -->
+            <div class="patient-info">
+                <el-row :gutter="20">
+                    <el-col :span="5">
+                        <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">{{ form.patientName || '' }}</span>
+                        </div>
+                    </el-col>
+                    <el-col :span="5">
+                        <div class="info-item">
+                            <span class="label">身份证号:</span>
+                            <span class="value">{{ form.idCard || '469026200211076747' }}</span>
+                        </div>
+                    </el-col>
+
+
+                    <el-col :span="4">
+                        <div class="info-item">
+                            <span class="label">看诊类型:</span>
+                            <span class="value">{{ getDictLabel(treatment_user_type, form.visitType) || '住院' }}</span>
+                        </div>
+                    </el-col>
+                    <el-col :span="5">
+                        <div class="info-item">
+                            <span class="label">诊疗卡号:</span>
+                            <span class="value">{{ form.treatNum || '' }}</span>
+                        </div>
+                    </el-col>
+                </el-row>
+
+                <el-row :gutter="20">
+                    <el-col :span="5">
+                        <div class="info-item">
+                            <span class="label">门诊/住院号:</span>
+                            <span class="value">{{ form.patientNo || '' }}</span>
+                        </div>
+                    </el-col>
+                    <el-col :span="5">
+                        <div class="info-item">
+                            <span class="label">患者科室:</span>
+                            <span class="value">{{ form.patientDepartment || '' }}</span>
+                        </div>
+                    </el-col>
+                    <el-col :span="5">
+                        <div class="info-item">
+                            <span class="label">处方类型:</span>
+                            <span class="value">{{ getDictLabel(fee_type, form.chargeType) || '' }}</span>
+                        </div>
+                    </el-col>
+                    <el-col :span="5">
+                        <div class="info-item">
+                            <span class="label">病区:</span>
+                            <span class="value">{{ form.wardName || '--' }}</span>
+                        </div>
+                    </el-col>
+                </el-row>
+            </div>
+
+            <!-- 处方明细表格 -->
+            <!-- 处方表格 -->
+            <div class="prescription-table-wrapper">
+                <table class="prescription-table">
+                    <thead>
+                        <tr>
+                            <th>组号</th>
+                            <th>产品名称</th>
+                            <th>规格</th>
+                            <th>用量/次</th>
+                            <th>流量/次(ml)</th>
+                            <th>浓度/次(%)</th>
+                            <th>能量密度/次(kcal/ml)</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.dosagePerTime || '--' }}</td>
+                            <td>{{ product.preparationVolumePerTime || '--' }}</td>
+                            <td>{{ product.preparationConcentrationPerTime || '--' }}</td>
+                            <td>{{ product.energyDensityPerTime || '--' }}</td>
+                            <td>{{ product.mealTime || '--' }}</td>
+                            <td>{{ product.frequency || '--' }}</td>
+                            <td>{{ product.firstDay || '--' }}</td>
+                            <td>{{ product.usageDays || '--' }}</td>
+                            <td>{{ product.usage || '--' }}</td>
+                            <td>{{ product.prescriptionRemark || '--' }}</td>
+                        </tr>
+
+                        <!-- 无数据提示 -->
+                        <tr v-if="recipeDetailData.length === 0">
+                            <td colspan="14" style="text-align: center; color: #909399">暂无处方数据</td>
+                        </tr>
+                    </tbody>
+                </table>
+            </div>
+
+            <template #footer v-if="buttonShow.visible">
+                <div class="dialog-footer">
+                    <el-button :loading="buttonLoading" @click="handleRecalculate">处方重申</el-button>
+                    <el-button :loading="buttonLoading" type="primary" @click="handleApprove">审核通过</el-button>
+                </div>
+            </template>
+        </el-dialog>
+        <!-- 处方重审dialog框 -->
+        <el-dialog :title="reCheckDialog.title" v-model="reCheckDialog.visible" width="20%" append-to-body >
+            <el-input v-model="form.remark" type="textarea" placeholder="请输入重审原因" :rows="5"></el-input>
+            <template #footer>
+                <div class="dialog-footer">
+                    <el-button :loading="buttonLoading" @click="handleRecheck">提交</el-button>
+                </div>
+            </template>
+        </el-dialog>
+    </div>
+</template>
+
+<script setup name="Settlement" lang="ts">
+    import { listRecipeCheck, getSettlement, delSettlement, addSettlement, updateSettlement } from '@/api/patients/settlement';
+    import { SettlementVO, SettlementQuery, SettlementForm } from '@/api/patients/settlement/types';
+    import { listDept } from '@/api/system/dept'; // 部门列表
+
+    const { proxy } = getCurrentInstance() as ComponentInternalInstance;
+    const { treatment_user_type, check_status, recipe_type, fee_type } = toRefs < any > (proxy ?.useDict('treatment_user_type', 'check_status', 'recipe_type', 'fee_type'));
+
+    const settlementList = ref < SettlementVO[] > ([]);
+    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 treeData = ref([]); // 定义 treeData
+    const queryFormRef = ref < ElFormInstance > ();
+    const settlementFormRef = ref < ElFormInstance > ();
+
+    // 处方明细数据
+    const recipeDetailData = ref([]);
+
+    const dialog = reactive < DialogOption > ({
+        visible: false,
+        title: ''
+    });
+    // 处方重审
+    const reCheckDialog = reactive < DialogOption > ({
+        visible: false,
+        title: ''
+    });
+
+    const buttonShow = reactive < DialogOption > ({
+        visible: true,
+        title: ''
+    });
+
+    const initFormData: SettlementForm = {
+        id: undefined,
+        orderTime: undefined,
+        visitType: undefined,
+        chargeType: undefined,
+        patientId: undefined,
+        patientName: undefined,
+        patientDepartment: undefined,
+        patientNo: undefined,
+        phone: undefined,
+        idCard: undefined,
+        receivableAmount: undefined,
+        paymentStatus: undefined,
+        paymentMethod: undefined,
+        status: undefined,
+        wardName: undefined,
+        checkStatus: undefined,
+        treatNum: undefined
+    }
+    const data = reactive < PageData < SettlementForm,
+        SettlementQuery >> ({
+            form: { ...initFormData },
+            queryParams: {
+                pageNum: 1,
+                pageSize: 10,
+                orderTime: undefined,
+                visitType: undefined,
+                chargeType: undefined,
+                doorId: undefined,
+                checkStatus: '1',
+                searchValue: undefined,
+                dateRange: [],
+                params: {}
+            },
+            rules: {
+                id: [
+                    { required: true, message: "主键ID不能为空", trigger: "blur" }
+                ],
+            }
+        });
+
+    const { queryParams, form, rules } = toRefs(data);
+    const treeProps = ref({
+        value: 'deptId', // 对应部门的 deptId
+        label: 'deptName', // 对应部门的 deptName
+        children: 'children' // 保持原有的父子结构
+    });
+    /** 查询结算管理列表 */
+    const getList = async () => {
+        loading.value = true;
+        const res = await listRecipeCheck(queryParams.value);
+        settlementList.value = res.rows;
+
+        // 获取部门数据
+        const deptMap = new Map();
+        treeData.value.forEach(dept => {
+            deptMap.set(dept.deptId, dept.deptName);
+            if (dept.children) {
+                dept.children.forEach(child => {
+                    deptMap.set(child.deptId, child.deptName);
+                });
+            }
+        });
+        total.value = res.total;
+        loading.value = false;
+    }
+
+    /** 取消按钮 */
+    const cancel = () => {
+        reset();
+        dialog.visible = false;
+        buttonShow.visible = true;
+    }
+
+    const getDeptList = async () => {
+        loading.value = true;
+        try {
+            const res = await listDept({ pageNum: 1, pageSize: 999 });
+            if (!res.data) {
+                console.warn("部门数据为空");
+                treeData.value = [];
+                return;
+            }
+
+            // 处理树形数据
+            const processedData = proxy ?.handleTree(res.data, 'deptId');
+            if (!processedData) {
+                console.warn("树形数据处理失败");
+                treeData.value = [];
+                return;
+            }
+
+            treeData.value = processedData;
+
+        } catch (error) {
+            console.error('获取部门列表失败:', error);
+            treeData.value = [];
+        } finally {
+            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 reset = () => {
+        form.value = { ...initFormData };
+        settlementFormRef.value ?.resetFields();
+
+    }
+
+    /** 搜索按钮操作 */
+    const handleQuery = () => {
+        queryParams.value.pageNum = 1;
+        getList();
+    }
+
+    /** 重置按钮操作 */
+    const resetQuery = () => {
+        queryFormRef.value ?.resetFields();
+        queryParams.value.dateRange = undefined;
+        queryParams.value.searchValue = undefined;
+        queryParams.value.visitType = undefined;
+        queryParams.value.chargeType = undefined;
+        queryParams.value.doorId = undefined;
+        queryParams.value.pageNum = 1;
+        queryParams.value.pageSize = 10;
+        handleQuery();
+    }
+
+    /** 多选框选中数据 */
+    const handleSelectionChange = (selection: SettlementVO[]) => {
+        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 handleCheck = async (row ? : SettlementVO) => {
+        reset();
+        const _id = row ?.id || ids.value[0]
+        const res = await getSettlement(_id);
+        recipeDetailData.value = res.data.enteralNutritionList
+        Object.assign(form.value, res.data);
+        dialog.visible = true;
+        dialog.title = "处方审核";
+    }
+
+    /** 详情 */
+    const handleDetail = async (row ? : SettlementVO) => {
+        reset();
+        const _id = row ?.id || ids.value[0]
+        const res = await getSettlement(_id);
+        recipeDetailData.value = res.data.enteralNutritionList
+        Object.assign(form.value, res.data);
+        buttonShow.visible = false
+        dialog.visible = true;
+        dialog.title = "处方详情";
+
+    }
+
+    /** 提交按钮 */
+    const submitForm = () => {
+        settlementFormRef.value ?.validate(async (valid: boolean) => {
+            if (valid) {
+                buttonLoading.value = true;
+                if (form.value.id) {
+                    await updateSettlement(form.value).finally(() => buttonLoading.value = false);
+                } else {
+                    await addSettlement(form.value).finally(() => buttonLoading.value = false);
+                }
+                proxy ?.$modal.msgSuccess("操作成功");
+                dialog.visible = false;
+                await getList();
+            }
+        });
+    }
+
+    /** 删除按钮操作 */
+    const handleDelete = async (row ? : SettlementVO) => {
+        const _ids = row ?.id || ids.value;
+        await proxy ?.$modal.confirm('是否确认删除结算管理编号为"' + _ids + '"的数据项?').finally(() => loading.value = false);
+        await delSettlement(_ids);
+        proxy ?.$modal.msgSuccess("删除成功");
+        await getList();
+    }
+
+    /** 处方重审 */
+    const handleRecalculate = async () => {
+        reCheckDialog.visible = true;
+        reCheckDialog.title = "重审原因";
+
+
+    }
+    /** 新增按钮操作 */
+    const handleRecheck = async () => {
+        form.value.checkStatus = "3" //处方重审
+        await updateSettlement(form.value).finally(() => buttonLoading.value = false);
+        reCheckDialog.visible=false
+        dialog.visible=false
+         proxy ?.$modal.msgSuccess("操作成功");
+        await getList();
+    }
+
+    /** 审核通过 */
+    const handleApprove = async () => {
+        form.value.checkStatus = "2" //审核通过
+        await proxy ?.$modal.confirm('是否确定审核通过该条处方?').finally(() => loading.value = false);
+        await updateSettlement(form.value).finally(() => dialog.visible = false);
+        proxy ?.$modal.msgSuccess("操作成功");
+        await getList();
+    }
+
+
+
+    onMounted(() => {
+        getList();
+        getDeptList(); // 初始化时加载部门数据
+    });
+</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;
+            }
+        }
+    }
+</style>

+ 371 - 0
src/views/settlement/chargeRecord/index.vue

@@ -0,0 +1,371 @@
+<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="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>
+                        <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>
+                        <el-form-item label="退费时间:" prop="refundTime">
+                            <el-date-picker clearable v-model="queryParams.refundTimeRange" type="date" value-format="YYYY-MM-DD" placeholder="请选择开单时间" />
+                        </el-form-item>
+                        <el-form-item label="收费类型:" prop="chargeType">
+                            <el-select v-model="queryParams.chargeType">
+                                <el-option v-for="dict in fee_type" :key="dict.value" :label="dict.label" :value="dict.value" />
+                            </el-select>
+                        </el-form-item>
+                        <el-form-item label="患者科室" prop="doorId">
+                            <el-tree-select v-model="queryParams.doorId" :data="treeData" :props="treeProps" placeholder="请选择" check-strictly node-key="id" @keyup.enter="handleQuery" />
+                        </el-form-item>
+                        <el-form-item label="看诊类型:">
+                            <el-select v-model="queryParams.visitType">
+                                <el-option v-for="dict in treatment_user_type" :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-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-option v-for="dict in payment_status" :key="dict.value" :label="dict.label" :value="dict.value" />
+                            </el-select>
+                        </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="['system:record:add']">新增</el-button>
+                    </el-col>
+                    <el-col :span="1.5">
+                        <el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['system:record:edit']">修改</el-button>
+                    </el-col>
+                    <el-col :span="1.5">
+                        <el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['system:record:remove']">删除</el-button>
+                    </el-col>
+                    <el-col :span="1.5">
+                        <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>
+            </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="settlementId" v-if="false" />
+                <el-table-column label="开单时间" align="center" prop="orderTime" width="180">
+                    <template #default="scope">
+                        <span>{{ scope.row.orderTime }}</span>
+                    </template>
+                </el-table-column>
+                <el-table-column label="付款时间" align="center" prop="orderTime" width="180">
+                    <template #default="scope">
+                        <span>{{ scope.row.createTime }}</span>
+                    </template>
+                </el-table-column>
+                <el-table-column label="看诊类型" align="center" prop="visitType">
+                    <template #default="scope">
+                        <span>{{getDictLabel(treatment_user_type,scope.row.createTime)||'--' }}</span>
+                    </template>
+                </el-table-column>
+                <el-table-column label="收费类型" align="center" prop="chargeType">
+                    <template #default="scope">
+                        <span>{{getDictLabel(fee_type,scope.row.chargeType)||'--' }}</span>
+                    </template>
+                </el-table-column>
+                <el-table-column label="患者姓名" align="center" prop="patientName" />
+                <el-table-column label="患者科室" align="center" prop="patientDepartment" />
+                <el-table-column label="门诊/住院号" align="center" prop="patientNo" />
+                <el-table-column label="联系电话" align="center" prop="phone" />
+                <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" >
+                    <template #default="scope">
+                        <span>{{getDictLabel(payment_status,scope.row.paymentStatus)||'--' }}</span>
+                    </template>
+                </el-table-column>
+                <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>
+                    </template>
+                </el-table-column>
+                <el-table-column label="操作" align="center" 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>
+                        <el-tooltip content="删除" placement="top">
+                            <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:record: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="500px" append-to-body>
+            <el-form ref="ChrageRecordFormRef" :model="form" :rules="rules" label-width="80px">
+
+            </el-form>
+            <template #footer>
+                <div class="dialog-footer">
+                    <el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
+                    <el-button @click="cancel">取 消</el-button>
+                </div>
+            </template>
+        </el-dialog>
+    </div>
+</template>
+
+<script setup name="Record" lang="ts">
+    import { listRecord, getRecord, delRecord, addRecord, updateRecord } from '@/api/settlement/chargeRecord';
+    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 recordList = ref < ChrageRecordVO[] > ([]);
+    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 queryFormRef = ref < ElFormInstance > ();
+    const ChrageRecordFormRef = ref < ElFormInstance > ();
+    const treeData = ref([]); // 定义 treeData
+    const treeProps = ref({
+        value: 'deptId', // 对应部门的 deptId
+        label: 'deptName', // 对应部门的 deptName
+        children: 'children' // 保持原有的父子结构
+    });
+    const dialog = reactive < DialogOption > ({
+        visible: false,
+        title: ''
+    });
+
+    const initFormData: ChrageRecordForm = {
+        id: undefined,
+        settlementId: undefined,
+        orderTime: undefined,
+        visitType: undefined,
+        chargeType: undefined,
+        patientId: undefined,
+        patientName: undefined,
+        doorId: 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,
+        remark: undefined,
+    }
+    const data = reactive < PageData < ChrageRecordForm,
+        ChrageRecordQuery >> ({
+            form: { ...initFormData },
+            queryParams: {
+                pageNum: 1,
+                pageSize: 10,
+                settlementId: undefined,
+                orderTime: undefined,
+                visitType: undefined,
+                chargeType: undefined,
+                patientId: undefined,
+                patientName: undefined,
+                doorId: 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,
+                params: {}
+            },
+            rules: {
+                id: [
+                    { required: true, message: "主键ID不能为空", trigger: "blur" }
+                ],
+                settlementId: [
+                    { required: true, message: "处方id不能为空", trigger: "blur" }
+                ],
+            }
+        });
+
+    const { queryParams, form, rules } = toRefs(data);
+
+    // 字典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 getList = async () => {
+        loading.value = true;
+        const res = await listRecord(queryParams.value);
+        recordList.value = res.rows;
+        total.value = res.total;
+        loading.value = false;
+    }
+    const getDeptList = async () => {
+        loading.value = true;
+        try {
+            const res = await listDept({ pageNum: 1, pageSize: 999 });
+            if (!res.data) {
+                console.warn("部门数据为空");
+                treeData.value = [];
+                return;
+            }
+
+            // 处理树形数据
+            const processedData = proxy ?.handleTree(res.data, 'deptId');
+            if (!processedData) {
+                console.warn("树形数据处理失败");
+                treeData.value = [];
+                return;
+            }
+
+            treeData.value = processedData;
+
+        } catch (error) {
+            console.error('获取部门列表失败:', error);
+            treeData.value = [];
+        } finally {
+            loading.value = false;
+        }
+    };
+
+    /** 取消按钮 */
+    const cancel = () => {
+        reset();
+        dialog.visible = false;
+    }
+
+    /** 表单重置 */
+    const reset = () => {
+        form.value = { ...initFormData };
+        ChrageRecordFormRef.value ?.resetFields();
+    }
+
+    /** 搜索按钮操作 */
+    const handleQuery = () => {
+        queryParams.value.pageNum = 1;
+        getList();
+    }
+
+    /** 重置按钮操作 */
+    const resetQuery = () => {
+        queryFormRef.value ?.resetFields();
+        handleQuery();
+    }
+
+    /** 多选框选中数据 */
+    const handleSelectionChange = (selection: ChrageRecordVO[]) => {
+        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 handleUpdate = async (row ? : ChrageRecordVO) => {
+        reset();
+        const _id = row ?.id || ids.value[0]
+        const res = await getRecord(_id);
+        Object.assign(form.value, res.data);
+        dialog.visible = true;
+        dialog.title = "修改收费记录";
+    }
+
+    /** 提交按钮 */
+    const submitForm = () => {
+        ChrageRecordFormRef.value ?.validate(async (valid: boolean) => {
+            if (valid) {
+                buttonLoading.value = true;
+                if (form.value.id) {
+                    await updateRecord(form.value).finally(() => buttonLoading.value = false);
+                } else {
+                    await addRecord(form.value).finally(() => buttonLoading.value = false);
+                }
+                proxy ?.$modal.msgSuccess("操作成功");
+                dialog.visible = false;
+                await getList();
+            }
+        });
+    }
+
+    /** 删除按钮操作 */
+    const handleDelete = async (row ? : ChrageRecordVO) => {
+        const _ids = row ?.id || ids.value;
+        await proxy ?.$modal.confirm('是否确认删除收费记录编号为"' + _ids + '"的数据项?').finally(() => loading.value = false);
+        await delRecord(_ids);
+        proxy ?.$modal.msgSuccess("删除成功");
+        await getList();
+    }
+
+    /** 导出按钮操作 */
+    const handleExport = () => {
+        proxy ?.download('system/record/export', {
+            ...queryParams.value
+        }, `record_${new Date().getTime()}.xlsx`)
+    }
+
+    onMounted(() => {
+        getList();
+        getDeptList()
+    });
+</script>

+ 785 - 0
src/views/settlement/waitCharge/index.vue

@@ -0,0 +1,785 @@
+<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="85">
+                        <el-form-item label="开方时间" prop="orderTime">
+                            <el-date-picker v-model="queryParams.dateRange" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" />
+                        </el-form-item>
+                        <el-form-item label="收费类型" prop="chargeType">
+                            <el-select v-model="queryParams.chargeType">
+                                <el-option v-for="dict in fee_type" :key="dict.value" :label="dict.label" :value="dict.value" />
+                            </el-select>
+                        </el-form-item>
+                        <el-form-item label="患者科室" prop="doorId">
+                            <el-tree-select v-model="queryParams.doorId" :data="treeData" :props="treeProps" placeholder="请选择" check-strictly node-key="id" @keyup.enter="handleQuery" />
+                        </el-form-item>
+                        <el-form-item label="看诊类型:">
+                            <el-select v-model="queryParams.visitType">
+                                <el-option v-for="dict in treatment_user_type" :key="dict.value" :label="dict.label" :value="dict.value" />
+                            </el-select>
+                        </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 @click="handleAdd" v-hasPermi="['system:settlement: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="settlementList" @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="orderTime" width="180">
+                    <template #default="scope">
+                        <span>{{ parseTime(scope.row.orderTime, '{y}-{m}-{d}') }}</span>
+                    </template>
+                </el-table-column>
+                <el-table-column label="看诊类型" align="center" prop="visitType">
+                    <template #default="scope">
+                        <span>{{ getDictLabel(treatment_user_type, scope.row.visitType) || '--' }}</span>
+                    </template>
+                </el-table-column>
+                <el-table-column label="收费类型" align="center" prop="chargeType">
+                    <template #default="scope">
+                        <span>{{ getDictLabel(fee_type, scope.row.chargeType) || '--' }}</span>
+                    </template>
+                </el-table-column>
+                <el-table-column label="患者姓名" align="center" prop="patientName" />
+                <el-table-column label="患者科室" align="center" prop="patientDepartment" />
+                <el-table-column label="门诊/住院号" align="center" prop="patientNo" />
+                <el-table-column label="联系电话" align="center" prop="phone" />
+                <el-table-column label="身份证号" align="center" prop="idCard" />
+                <el-table-column label="应收金额" align="center" prop="receivableAmount" />
+                <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+                    <template #default="scope">
+                        <el-tooltip content="详情" placement="top">
+                            <el-button link type="primary" @click="handleDetail(scope.row)" v-hasPermi="['system:settlement:edit']">详情</el-button>
+                        </el-tooltip>
+                        <el-tooltip content="收费" placement="top">
+                            <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-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="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.dosagePerTime || '--' }}</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.createByUser || '--' }}</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;margin-bottom:130px">
+                    <el-row>
+                        <el-col style="text-align: right;">
+                            <span>(营养配置费:<span>¥0</span>)</span>
+                        </el-col>
+                    </el-row>
+                    <el-row>
+                        <el-col style="text-align: right;">
+                            <span>合计金额:<span style="color: #f56c6c;">¥{{rowData.receivableAmount}}</span></span>
+                        </el-col>
+                    </el-row>
+                </div>
+            </div>
+
+            <template #footer>
+                <div class="dialog-footer">
+                    <el-button :loading="buttonLoading" type="primary" @click="handleMoney">现金收费</el-button>
+                    <el-button :loading="buttonLoading" type="success" @click="handleUnionPay">银联支付</el-button>
+                    <el-button :loading="buttonLoading" type="success" @click="handleQRCode">二维码支付</el-button>
+                </div>
+            </template>
+        </el-dialog>
+        <!-- 现金收费dialog -->
+        <el-dialog :title="moneyDialog.title" v-model="moneyDialog.visible" width="30%" append-to-body>
+            <div>
+                <el-row :gutter="10">
+                    <el-col :span="7">
+                        <div class="info-item">
+                            <span>姓名:</span>
+                            <span>{{ rowData.patientName || '' }}</span>
+                        </div>
+                    </el-col>
+                    <el-col :span="7">
+                        <div class="info-item">
+                            <span class="label">联系电话:</span>
+                            <span class="value">{{ rowData.phone || '' }}</span>
+                        </div>
+                    </el-col>
+                    <el-col :span="7">
+                        <div class="info-item">
+                            <span class="label">身份证号:</span>
+                            <span class="value">{{ rowData.idCard || '' }}</span>
+                        </div>
+                    </el-col>
+                </el-row>
+                <el-row>
+                    <el-col :span="24">
+
+                    </el-col>
+                </el-row>
+                <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>
+                <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>
+            <template #footer>
+                <div class="dialog-footer">
+                    <el-button v-if="showQRCodeButton" :loading="buttonLoading" type="primary" @click="handleRecheck">二维码支付</el-button>
+                    <el-button :loading="buttonLoading" type="primary" @click="handleRecheck">确认</el-button>
+                    <el-button :loading="buttonLoading" @click="moneyDialogCancel">取消</el-button>
+                </div>
+            </template>
+        </el-dialog>
+    </div>
+</template>
+
+<script setup name="Settlement" lang="ts">
+    import { listSettlement, getSettlement, delSettlement, addSettlement, updateSettlement } from '@/api/patients/settlement';
+    import { SettlementVO, SettlementQuery, SettlementForm } from '@/api/patients/settlement/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 { 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'));
+    import { useChargeSetStore } from '@/store/modules/chargeSet';
+    const useStore = useChargeSetStore();
+    const settlementList = ref < SettlementVO[] > ([]);
+    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 fundsReceived = ref(0); //定义收到金额
+    const changeFund = ref(0); //定义收到金额
+    const treeData = ref([]); // 定义 treeData
+    const rowData=ref< SettlementVO >({})
+    const currentChargeMode = ref('1'); // 当前选择的收费方式,默认为现金收费
+
+    const queryFormRef = ref < ElFormInstance > ();
+    const chargeSetInfo = computed(() => useStore.chargeSetInfo as ChargeSetVO || {} as ChargeSetVO);
+    const settlementFormRef = ref < ElFormInstance > ();
+    // 处方明细数据
+    const recipeDetailData = ref([]);
+    const evaluationData = ref([]);
+    const screeningData = ref([]);
+    const dialog = reactive < DialogOption > ({
+        visible: false,
+        title: ''
+    });
+    // 现金收费
+    const moneyDialog = reactive < DialogOption > ({
+        visible: false,
+        title: ''
+    });
+
+    const initFormData: SettlementForm = {
+        id: undefined,
+        orderTime: undefined,
+        visitType: undefined,
+        chargeType: undefined,
+        patientId: undefined,
+        patientName: undefined,
+        patientDepartment: undefined,
+        patientNo: undefined,
+        phone: undefined,
+        idCard: undefined,
+        receivableAmount: undefined,
+        paymentStatus: undefined,
+        paymentMethod: undefined,
+        status: undefined,
+    }
+    const data = reactive < PageData < SettlementForm,
+        SettlementQuery >> ({
+            form: { ...initFormData },
+            queryParams: {
+                pageNum: 1,
+                pageSize: 10,
+                checkStatus: undefined,
+                orderTime: undefined,
+                doorId: undefined,
+                visitType: undefined,
+                chargeType: undefined,
+                dateRange: [],
+                searchValue: undefined,
+                params: {}
+            },
+            rules: {
+                id: [
+                    { required: true, message: "主键ID不能为空", trigger: "blur" }
+                ],
+            }
+        });
+
+    const { queryParams, form, rules } = toRefs(data);
+    const treeProps = ref({
+        value: 'deptId', // 对应部门的 deptId
+        label: 'deptName', // 对应部门的 deptName
+        children: 'children' // 保持原有的父子结构
+    });
+
+        // 过滤收费方式选项
+    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;
+        });
+    });
+
+    // 是否显示二维码支付按钮 - 只有选择银联支付(值为2)时才显示
+    const showQRCodeButton = computed(() => currentChargeMode.value === '2');
+    /** 查询结算管理列表 */
+    const getList = async () => {
+        loading.value = true;
+        const res = await listSettlement(queryParams.value);
+        settlementList.value = res.rows;
+        // 获取部门数据
+        const deptMap = new Map();
+        treeData.value.forEach(dept => {
+            deptMap.set(dept.deptId, dept.deptName);
+            if (dept.children) {
+                dept.children.forEach(child => {
+                    deptMap.set(child.deptId, child.deptName);
+                });
+            }
+        });
+        getSetList()
+        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 getDeptList = async () => {
+        loading.value = true;
+        try {
+            const res = await listDept({ pageNum: 1, pageSize: 999 });
+            if (!res.data) {
+                console.warn("部门数据为空");
+                treeData.value = [];
+                return;
+            }
+
+            // 处理树形数据
+            const processedData = proxy ?.handleTree(res.data, 'deptId');
+            if (!processedData) {
+                console.warn("树形数据处理失败");
+                treeData.value = [];
+                return;
+            }
+
+            treeData.value = processedData;
+
+        } catch (error) {
+            console.error('获取部门列表失败:', error);
+            treeData.value = [];
+        } finally {
+            loading.value = false;
+        }
+    };
+
+    /** 取消按钮 */
+    const cancel = () => {
+        reset();
+        dialog.visible = false;
+    }
+
+    /** 表单重置 */
+    const reset = () => {
+        form.value = { ...initFormData };
+        settlementFormRef.value ?.resetFields();
+    }
+
+    /** 搜索按钮操作 */
+    const handleQuery = () => {
+        queryParams.value.pageNum = 1;
+        getList();
+    }
+
+    /** 重置按钮操作 */
+    const resetQuery = () => {
+        queryFormRef.value ?.resetFields();
+        queryParams.value.dateRange = undefined;
+        queryParams.value.searchValue = undefined;
+        queryParams.value.visitType = undefined;
+        queryParams.value.chargeType = undefined;
+        queryParams.value.doorId = undefined;
+        handleQuery();
+    }
+
+    /** 多选框选中数据 */
+    const handleSelectionChange = (selection: SettlementVO[]) => {
+        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 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
+        evaluationData.value = res.data.nutritionEvaluationList
+        screeningData.value = res.data.nutritionScreeningList
+        Object.assign(form.value, res.data);
+        dialog.visible = true;
+        dialog.title = "收费详情";
+    }
+
+    /** 收费 */
+    const handleCharge = async (row ? : SettlementVO) => {
+        // 设置默认收费方式为现金收费(值为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;
+        }
+        
+        moneyDialog.visible = true;
+        moneyDialog.title = "收费"
+    }
+
+    /** 现金收费 */
+    const handleMoney = async (row ? : SettlementVO) => {
+        moneyDialog.visible = true;
+        moneyDialog.title = "收费"
+    }
+
+    /** 银联支付 */
+    const handleUnionPay = async (row ? : SettlementVO) => {
+
+    }
+
+    /** 二维码支付 */
+    const handleQRCode = async (row ? : SettlementVO) => {
+
+    }
+    const moneyDialogCancel = () => {
+        moneyDialog.visible = false
+    }
+
+    /** 收到金额变化处理 */
+    const changeFundsReceived = () => {
+        const received = parseFloat(String(fundsReceived.value)) || 0;
+        const receivable = parseFloat(String(rowData.value.receivableAmount)) || 0;
+        const change = received - receivable;
+        changeFund.value = change < 0 ? 0 : change;
+    }
+
+    /** 确认收费 - 添加金额验证 */
+    const handleRecheck = () => {
+        const received = parseFloat(String(fundsReceived.value)) || 0;
+        const receivable = parseFloat(String(rowData.value.receivableAmount)) || 0;
+        
+        if (received < receivable) {
+            proxy?.$modal.msgWarning('收到金额小于应收金额,请重新核对!');
+            return;
+        }
+        
+        // 这里可以添加确认收费的逻辑
+        proxy?.$modal.msgSuccess('收费成功');
+        moneyDialog.visible = false;
+    }
+
+    /** 提交按钮 */
+    const submitForm = () => {
+        settlementFormRef.value ?.validate(async (valid: boolean) => {
+            if (valid) {
+                buttonLoading.value = true;
+                if (form.value.id) {
+                    await updateSettlement(form.value).finally(() => buttonLoading.value = false);
+                } else {
+                    await addSettlement(form.value).finally(() => buttonLoading.value = false);
+                }
+                proxy ?.$modal.msgSuccess("操作成功");
+                dialog.visible = false;
+                await getList();
+            }
+        });
+    }
+
+    /** 删除按钮操作 */
+    const handleDelete = async (row ? : SettlementVO) => {
+        const _ids = row ?.id || ids.value;
+        await proxy ?.$modal.confirm('是否确认删除结算管理编号为"' + _ids + '"的数据项?').finally(() => loading.value = false);
+        await delSettlement(_ids);
+        proxy ?.$modal.msgSuccess("删除成功");
+        await getList();
+    }
+
+
+    const getSetList = async () => {
+        loading.value = true;
+        const res = await listSet(queryParams.value);
+        if (res.rows.length > 0) {
+            useStore.setChargeInfo(res.rows[0]);
+        }
+        console.log(JSON.stringify(chargeSetInfo.value));
+    };
+
+    /** 导出按钮操作 */
+    const handleExport = () => {
+        proxy ?.download('system/settlement/export', {
+            ...queryParams.value
+        }, `settlement_${new Date().getTime()}.xlsx`)
+    }
+
+    onMounted(() => {
+        getList();
+        getDeptList()
+
+
+    });
+</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>

+ 0 - 0
src/views/settlement/waitReturn/index.vue


+ 2 - 2
src/views/workbench/treatmentUser/index.vue

@@ -131,8 +131,8 @@
                             </el-form-item>
                         </el-col>
                         <el-col :span="12">
-                            <el-form-item label="病区" prop="inpatientWard">
-                                <el-select v-model="form.inpatientWard" placeholder="请选择">
+                            <el-form-item label="病区" prop="wardId">
+                                <el-select v-model="form.wardId" placeholder="请选择">
                                     <el-option v-for="item in inpatientWardList" :key="item.value" :label="item.label" :value="item.value" />
                                 </el-select>
                             </el-form-item>