提交merge1.3
This commit is contained in:
@@ -1,5 +1,12 @@
|
||||
<template>
|
||||
<el-dialog title="确认收费" v-model="props.open" width="700px" append-to-body destroy-on-close>
|
||||
<el-dialog
|
||||
title="确认收费"
|
||||
v-model="props.open"
|
||||
@close="close"
|
||||
width="700px"
|
||||
append-to-body
|
||||
destroy-on-close
|
||||
>
|
||||
<div v-loading="dialogLoading">
|
||||
<el-text size="large" style="display: block; margin-bottom: 15px">
|
||||
收费日期:{{ currentDate }}
|
||||
@@ -27,7 +34,7 @@
|
||||
:key="payEnum.value"
|
||||
:label="payEnum.label"
|
||||
:value="payEnum.value"
|
||||
:disabled="isMethodDisabled(payEnum.value)"
|
||||
:disabled="isMethodDisabled(payEnum)"
|
||||
/>
|
||||
</el-select>
|
||||
<span>支付金额:</span>
|
||||
@@ -66,6 +73,17 @@
|
||||
</el-text>
|
||||
</div>
|
||||
</div>
|
||||
<div class="payment-item">
|
||||
<span>{{ payTypeText }}支付:</span>
|
||||
<el-input
|
||||
ref="txtCodeRef"
|
||||
v-model="txtCode"
|
||||
style="width: 300px"
|
||||
:placeholder="payTypePlaceholder"
|
||||
/>
|
||||
<el-button link type="primary" @click="handleWxPay()">扫码支付</el-button>
|
||||
<el-button link type="primary" @click="getWxPayResult()">查看结果</el-button>
|
||||
</div>
|
||||
<!-- 金额汇总 -->
|
||||
<div class="summary">
|
||||
<el-space :size="30">
|
||||
@@ -90,12 +108,13 @@
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
|
||||
<script setup>
|
||||
import { savePayment } from './outpatientregistration';
|
||||
import { savePayment, wxPay, WxPayResult } from './outpatientregistration';
|
||||
import { computed, watch, reactive, ref, getCurrentInstance, nextTick } from 'vue';
|
||||
import { Delete } from '@element-plus/icons-vue';
|
||||
import { debounce } from 'lodash-es';
|
||||
import printUtils, { PRINT_TEMPLATE } from '@/utils/printUtils';
|
||||
|
||||
// 获取费用性质文本
|
||||
const getFeeTypeText = computed(() => {
|
||||
@@ -147,6 +166,7 @@ const props = defineProps({
|
||||
type: Object,
|
||||
default: undefined,
|
||||
},
|
||||
<<<<<<< HEAD
|
||||
medfee_paymtd_code: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
@@ -155,10 +175,21 @@ const props = defineProps({
|
||||
type: String,
|
||||
default: '',
|
||||
}
|
||||
=======
|
||||
orgId: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
orgName: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
>>>>>>> v1.3
|
||||
});
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
const dialogLoading = ref(false);
|
||||
const txtCode = ref('');
|
||||
const throttledGetList = debounce(submit, 300);
|
||||
const formData = reactive({
|
||||
totalAmount: 0,
|
||||
@@ -182,114 +213,231 @@ watch(
|
||||
|
||||
const emit = defineEmits(['close']);
|
||||
|
||||
// 根据printUtils实现的打印方法
|
||||
async function printReceipt(param) {
|
||||
console.log(param, 'param');
|
||||
console.log(props.patientInfo, 'props.patientInfo');
|
||||
console.log('打印收费小票数据:', param);
|
||||
console.log('患者信息:', props.patientInfo);
|
||||
|
||||
// 构造一个新的对象,添加头 "data"
|
||||
const result = {
|
||||
data: [
|
||||
{
|
||||
...param,
|
||||
// 基础支付类型
|
||||
YB_FUND_PAY: param.detail.find((t) => t.payEnum === 100000)?.amount ?? 0, // 基金支付总额
|
||||
SELF_PAY: param.detail.find((t) => t.payEnum === 200000)?.amount ?? 0, // 个人负担总金额
|
||||
OTHER_PAY: param.detail.find((t) => t.payEnum === 300000)?.amount ?? 0, // 其他(如医院负担金额)
|
||||
try {
|
||||
// 构造打印数据
|
||||
const printData = {
|
||||
data: [
|
||||
{
|
||||
...param,
|
||||
// 基础支付类型
|
||||
YB_FUND_PAY: param.detail.find((t) => t.payEnum === 100000)?.amount ?? 0, // 基金支付总额
|
||||
SELF_PAY: param.detail.find((t) => t.payEnum === 200000)?.amount ?? 0, // 个人负担总金额
|
||||
OTHER_PAY: param.detail.find((t) => t.payEnum === 300000)?.amount ?? 0, // 其他(如医院负担金额)
|
||||
|
||||
// 基本医保统筹基金支出
|
||||
YB_TC_FUND_AMOUNT: param.detail.find((t) => t.payEnum === 110000)?.amount ?? 0, // 基本医保统筹基金支出
|
||||
YB_BC_FUND_AMOUNT: param.detail.find((t) => t.payEnum === 120000)?.amount ?? 0, // 补充医疗保险基金支出
|
||||
YB_JZ_FUND_AMOUNT: param.detail.find((t) => t.payEnum === 130000)?.amount ?? 0, // 医疗救助基金支出
|
||||
YB_OTHER_AMOUNT: param.detail.find((t) => t.payEnum === 140000)?.amount ?? 0, // 其他支出
|
||||
// 基本医保统筹基金支出
|
||||
YB_TC_FUND_AMOUNT: param.detail.find((t) => t.payEnum === 110000)?.amount ?? 0, // 基本医保统筹基金支出
|
||||
YB_BC_FUND_AMOUNT: param.detail.find((t) => t.payEnum === 120000)?.amount ?? 0, // 补充医疗保险基金支出
|
||||
YB_JZ_FUND_AMOUNT: param.detail.find((t) => t.payEnum === 130000)?.amount ?? 0, // 医疗救助基金支出
|
||||
YB_OTHER_AMOUNT: param.detail.find((t) => t.payEnum === 140000)?.amount ?? 0, // 其他支出
|
||||
|
||||
// 职工基本医疗保险
|
||||
YB_TC_ZG_FUND_VALUE: param.detail.find((t) => t.payEnum === 110100)?.amount ?? 0, // 职工基本医疗保险
|
||||
YB_TC_JM_FUND_VALUE: param.detail.find((t) => t.payEnum === 110200)?.amount ?? 0, // 居民基本医疗保险(修正原错误注释)
|
||||
// 职工基本医疗保险
|
||||
YB_TC_ZG_FUND_VALUE: param.detail.find((t) => t.payEnum === 110100)?.amount ?? 0, // 职工基本医疗保险
|
||||
YB_TC_JM_FUND_VALUE: param.detail.find((t) => t.payEnum === 110200)?.amount ?? 0, // 居民基本医疗保险
|
||||
|
||||
// 补充医疗保险基金支出细分
|
||||
YB_BC_JM_DB_VALUE: param.detail.find((t) => t.payEnum === 120100)?.amount ?? 0, // 全体参保人的居民大病保险
|
||||
YB_BC_DE_BZ_VALUE: param.detail.find((t) => t.payEnum === 120200)?.amount ?? 0, // 大额医疗费用补助
|
||||
YB_BC_ZG_DE_BZ_VALUE: param.detail.find((t) => t.payEnum === 120300)?.amount ?? 0, // 企业职工大额医疗费用补助
|
||||
YB_BC_GWY_BZ_VALUE: param.detail.find((t) => t.payEnum === 120400)?.amount ?? 0, // 公务员医疗补助
|
||||
// 补充医疗保险基金支出细分
|
||||
YB_BC_JM_DB_VALUE: param.detail.find((t) => t.payEnum === 120100)?.amount ?? 0, // 全体参保人的居民大病保险
|
||||
YB_BC_DE_BZ_VALUE: param.detail.find((t) => t.payEnum === 120200)?.amount ?? 0, // 大额医疗费用补助
|
||||
YB_BC_ZG_DE_BZ_VALUE: param.detail.find((t) => t.payEnum === 120300)?.amount ?? 0, // 企业职工大额医疗费用补助
|
||||
YB_BC_GWY_BZ_VALUE: param.detail.find((t) => t.payEnum === 120400)?.amount ?? 0, // 公务员医疗补助
|
||||
|
||||
// 其他支出细分
|
||||
OTHER_PAY_DD_FUND_VALUE: param.detail.find((t) => t.payEnum === 300001)?.amount ?? 0, // 兜底基金支出
|
||||
OTHER_PAY_YW_SH_FUND_VALUE: param.detail.find((t) => t.payEnum === 300002)?.amount ?? 0, // 意外伤害基金支出
|
||||
OTHER_PAY_LX_YL_FUND_VALUE: param.detail.find((t) => t.payEnum === 300003)?.amount ?? 0, // 离休人员医疗保障金支出
|
||||
OTHER_PAY_LX_YH_FUND_VALUE: param.detail.find((t) => t.payEnum === 300004)?.amount ?? 0, // 离休人员优惠金支出
|
||||
OTHER_PAY_CZ_FUND_VALUE: param.detail.find((t) => t.payEnum === 300005)?.amount ?? 0, // 财政基金支出
|
||||
OTHER_PAY_CZ_YZ_FUND_VALUE: param.detail.find((t) => t.payEnum === 300006)?.amount ?? 0, // 财政预支支出
|
||||
OTHER_PAY_ZG_DB_FUND_VALUE: param.detail.find((t) => t.payEnum === 300007)?.amount ?? 0, // 职工大病基金支出
|
||||
OTHER_PAY_EY_FUND_VALUE: param.detail.find((t) => t.payEnum === 300008)?.amount ?? 0, // 二乙基金支出
|
||||
OTHER_PAY_QX_JZ_FUND_VALUE: param.detail.find((t) => t.payEnum === 300009)?.amount ?? 0, // 倾斜救助支出
|
||||
OTHER_PAY_YL_JZ_FUND_VALUE: param.detail.find((t) => t.payEnum === 300010)?.amount ?? 0, // 医疗救助再救助基金
|
||||
HOSP_PART_AMT: param.detail.find((t) => t.payEnum === 300011)?.amount ?? 0, // 医院负担金额
|
||||
// 其他支出细分
|
||||
OTHER_PAY_DD_FUND_VALUE: param.detail.find((t) => t.payEnum === 300001)?.amount ?? 0, // 兜底基金支出
|
||||
OTHER_PAY_YW_SH_FUND_VALUE: param.detail.find((t) => t.payEnum === 300002)?.amount ?? 0, // 意外伤害基金支出
|
||||
OTHER_PAY_LX_YL_FUND_VALUE: param.detail.find((t) => t.payEnum === 300003)?.amount ?? 0, // 离休人员医疗保障金支出
|
||||
OTHER_PAY_LX_YH_FUND_VALUE: param.detail.find((t) => t.payEnum === 300004)?.amount ?? 0, // 离休人员优惠金支出
|
||||
OTHER_PAY_CZ_FUND_VALUE: param.detail.find((t) => t.payEnum === 300005)?.amount ?? 0, // 财政基金支出
|
||||
OTHER_PAY_CZ_YZ_FUND_VALUE: param.detail.find((t) => t.payEnum === 300006)?.amount ?? 0, // 财政预支支出
|
||||
OTHER_PAY_ZG_DB_FUND_VALUE: param.detail.find((t) => t.payEnum === 300007)?.amount ?? 0, // 职工大病基金支出
|
||||
OTHER_PAY_EY_FUND_VALUE: param.detail.find((t) => t.payEnum === 300008)?.amount ?? 0, // 二乙基金支出
|
||||
OTHER_PAY_QX_JZ_FUND_VALUE: param.detail.find((t) => t.payEnum === 300009)?.amount ?? 0, // 倾斜救助支出
|
||||
OTHER_PAY_YL_JZ_FUND_VALUE: param.detail.find((t) => t.payEnum === 300010)?.amount ?? 0, // 医疗救助再救助基金
|
||||
HOSP_PART_AMT: param.detail.find((t) => t.payEnum === 300011)?.amount ?? 0, // 医院负担金额
|
||||
|
||||
// 医保结算返回值
|
||||
FULAMT_OWNPAY_AMT: param.detail.find((t) => t.payEnum === 1)?.amount ?? 0, // 全自费金额
|
||||
OVERLMT_SELFPAY: param.detail.find((t) => t.payEnum === 3)?.amount ?? 0, // 超限价自费费用
|
||||
PRESELFPAY_AMT: param.detail.find((t) => t.payEnum === 4)?.amount ?? 0, // 先行自付金额
|
||||
INSCP_SCP_AMT: param.detail.find((t) => t.payEnum === 5)?.amount ?? 0, // 符合政策范围金额
|
||||
ACT_PAY_DEDC: param.detail.find((t) => t.payEnum === 6)?.amount ?? 0, // 实际支付起付线
|
||||
POOL_PROP_SELFPAY: param.detail.find((t) => t.payEnum === 7)?.amount ?? 0, // 基本医疗保险统筹基金支付比例
|
||||
BALC: param.detail.find((t) => t.payEnum === 8)?.amount ?? 0, // 余额
|
||||
// 医保结算返回值 - 修复运算符优先级问题,添加括号确保正确拼接'元'
|
||||
FULAMT_OWNPAY_AMT: (param.detail?.find((t) => t.payEnum === 1)?.amount ?? 0) + '元', // 全自费金额
|
||||
OVERLMT_SELFPAY: (param.detail?.find((t) => t.payEnum === 3)?.amount ?? 0) + '元', // 超限价自费费用
|
||||
PRESELFPAY_AMT: (param.detail?.find((t) => t.payEnum === 4)?.amount ?? 0) + '元', // 先行自付金额
|
||||
INSCP_SCP_AMT: (param.detail?.find((t) => t.payEnum === 5)?.amount ?? 0) + '元', // 符合政策范围金额
|
||||
ACT_PAY_DEDC: (param.detail?.find((t) => t.payEnum === 6)?.amount ?? 0) + '元', // 实际支付起付线
|
||||
POOL_PROP_SELFPAY: (param.detail?.find((t) => t.payEnum === 7)?.amount ?? 0) + '元', // 基本医疗保险统筹基金支付比例
|
||||
BALC: (param.detail?.find((t) => t.payEnum === 8)?.amount ?? 0) + '元', // 余额
|
||||
|
||||
// 特殊支付方式
|
||||
SELF_YB_ZH_PAY: param.detail.find((t) => t.payEnum === 210000)?.amount ?? 0, // 个人医保账户支付
|
||||
SELF_YB_ZH_GJ_VALUE: param.detail.find((t) => t.payEnum === 210100)?.amount ?? 0, // 账户共济支付金额
|
||||
SELF_CASH_PAY: param.detail.find((t) => t.payEnum === 220000)?.amount ?? 0, // 个人现金支付金额
|
||||
SELF_VX_PAY: param.detail.find((t) => t.payEnum === 230000)?.amount ?? 0, // 微信支付金额
|
||||
SELF_ALI_PAY: param.detail.find((t) => t.payEnum === 240000)?.amount ?? 0, // 阿里支付金额
|
||||
// 特殊支付方式
|
||||
SELF_YB_ZH_PAY:
|
||||
(param.detail?.find((t) => t.payEnum === 210000)?.amount ?? 0) > 0
|
||||
? (param.detail?.find((t) => t.payEnum === 210000)?.amount ?? 0) + '元'
|
||||
: '', // 个人医保账户支付
|
||||
SELF_YB_ZH_GJ_VALUE:
|
||||
(param.detail?.find((t) => t.payEnum === 210100)?.amount ?? 0) > 0
|
||||
? (param.detail?.find((t) => t.payEnum === 210100)?.amount ?? 0) + '元'
|
||||
: '', // 账户共济支付金额
|
||||
SELF_CASH_PAY:
|
||||
(param.detail?.find((t) => t.payEnum === 220000)?.amount ?? 0) > 0
|
||||
? (param.detail?.find((t) => t.payEnum === 220000)?.amount ?? 0) + '元'
|
||||
: '', // 个人现金支付金额
|
||||
SELF_VX_PAY:
|
||||
(param.detail?.find((t) => t.payEnum === 230000)?.amount ?? 0) > 0
|
||||
? (param.detail?.find((t) => t.payEnum === 230000)?.amount ?? 0) + '元'
|
||||
: '', // 微信支付金额
|
||||
SELF_ALI_PAY:
|
||||
(param.detail?.find((t) => t.payEnum === 240000)?.amount ?? 0) > 0
|
||||
? (param.detail?.find((t) => t.payEnum === 240000)?.amount ?? 0) + '元'
|
||||
: '', // 阿里支付金额
|
||||
|
||||
// 现金支付细分
|
||||
SELF_CASH_VALUE: param.detail.find((t) => t.payEnum === 220400)?.amount ?? 0, // 个人现金支付金额(现金)
|
||||
SELF_CASH_VX_VALUE: param.detail.find((t) => t.payEnum === 220100)?.amount ?? 0, // 个人现金支付金额(微信)
|
||||
SELF_CASH_ALI_VALUE: param.detail.find((t) => t.payEnum === 220200)?.amount ?? 0, // 个人现金支付金额(支付宝)
|
||||
SELF_CASH_UNION_VALUE: param.detail.find((t) => t.payEnum === 220300)?.amount ?? 0, // 个人现金支付金额(银联)
|
||||
// 现金支付细分
|
||||
SELF_CASH_VALUE:
|
||||
(param.detail?.find((t) => t.payEnum === 220400)?.amount ?? 0) > 0
|
||||
? (param.detail?.find((t) => t.payEnum === 220400)?.amount ?? 0) + '元'
|
||||
: '', // 个人现金支付金额(现金)
|
||||
SELF_CASH_VX_VALUE:
|
||||
(param.detail?.find((t) => t.payEnum === 220100)?.amount ?? 0) > 0
|
||||
? (param.detail?.find((t) => t.payEnum === 220100)?.amount ?? 0) + '元'
|
||||
: '', // 个人现金支付金额(微信)
|
||||
SELF_CASH_ALI_VALUE:
|
||||
(param.detail?.find((t) => t.payEnum === 220200)?.amount ?? 0) > 0
|
||||
? (param.detail?.find((t) => t.payEnum === 220200)?.amount ?? 0) + '元'
|
||||
: '', // 个人现金支付金额(支付宝)
|
||||
SELF_CASH_UNION_VALUE:
|
||||
(param.detail?.find((t) => t.payEnum === 220300)?.amount ?? 0) > 0
|
||||
? (param.detail?.find((t) => t.payEnum === 220300)?.amount ?? 0) + '元'
|
||||
: '', // 个人现金支付金额(银联)
|
||||
|
||||
// 基金类型(扩展)
|
||||
BIRTH_FUND: param.detail.find((t) => t.payEnum === 510100)?.amount ?? 0, // 生育基金
|
||||
RETIREE_MEDICAL: param.detail.find((t) => t.payEnum === 340100)?.amount ?? 0, // 离休人员医疗保障基金
|
||||
URBAN_BASIC_MEDICAL: param.detail.find((t) => t.payEnum === 390100)?.amount ?? 0, // 城乡居民基本医疗保险基金
|
||||
URBAN_SERIOUS_ILLNESS: param.detail.find((t) => t.payEnum === 390200)?.amount ?? 0, // 城乡居民大病医疗保险基金
|
||||
MEDICAL_ASSISTANCE: param.detail.find((t) => t.payEnum === 610100)?.amount ?? 0, // 医疗救助基金
|
||||
GOVERNMENT_SUBSIDY: param.detail.find((t) => t.payEnum === 640100)?.amount ?? 0, // 政府兜底基金
|
||||
ACCIDENT_INSURANCE: param.detail.find((t) => t.payEnum === 390400)?.amount ?? 0, // 意外伤害基金
|
||||
CARE_INSURANCE: param.detail.find((t) => t.payEnum === 620100)?.amount ?? 0, // 照护保险基金
|
||||
FINANCIAL_FUND: param.detail.find((t) => t.payEnum === 360100)?.amount ?? 0, // 财政基金
|
||||
HOSPITAL_ADVANCE: param.detail.find((t) => t.payEnum === 999900)?.amount ?? 0, // 医院垫付
|
||||
SUPPLEMENTARY_INSURANCE: param.detail.find((t) => t.payEnum === 390300)?.amount ?? 0, // 城乡居民大病补充保险基金
|
||||
HEALTHCARE_PREPAYMENT: param.detail.find((t) => t.payEnum === 360300)?.amount ?? 0, // 保健预支基金
|
||||
Mr_QR_Code: param.regNo,
|
||||
sex: props.patientInfo.genderEnum_enumText,
|
||||
age: props.patientInfo.age,
|
||||
personType: '职工医保',
|
||||
fixmedinsName: param.fixmedinsName + '门诊收费明细',
|
||||
},
|
||||
],
|
||||
// feeDetial: param.detail, //收费项目,后端还未返回
|
||||
};
|
||||
// 将对象转换为 JSON 字符串
|
||||
let jsonString = JSON.stringify(result, null, 2);
|
||||
console.log(jsonString, 'jsonString');
|
||||
await CefSharp.BindObjectAsync('boundAsync');
|
||||
await boundAsync.printReport(
|
||||
'门诊收费明细单.grf',
|
||||
jsonString
|
||||
)
|
||||
// 基金类型(扩展)
|
||||
BIRTH_FUND:
|
||||
(param.detail?.find((t) => t.payEnum === 510100)?.amount ?? 0) > 0
|
||||
? (param.detail?.find((t) => t.payEnum === 510100)?.amount ?? 0) + '元'
|
||||
: '', // 生育基金
|
||||
RETIREE_MEDICAL:
|
||||
(param.detail?.find((t) => t.payEnum === 340100)?.amount ?? 0) > 0
|
||||
? (param.detail?.find((t) => t.payEnum === 340100)?.amount ?? 0) + '元'
|
||||
: '', // 离休人员医疗保障基金
|
||||
URBAN_BASIC_MEDICAL:
|
||||
(param.detail?.find((t) => t.payEnum === 390100)?.amount ?? 0) > 0
|
||||
? (param.detail?.find((t) => t.payEnum === 390100)?.amount ?? 0) + '元'
|
||||
: '', // 城乡居民基本医疗保险基金
|
||||
URBAN_SERIOUS_ILLNESS:
|
||||
(param.detail?.find((t) => t.payEnum === 390200)?.amount ?? 0) > 0
|
||||
? (param.detail?.find((t) => t.payEnum === 390200)?.amount ?? 0) + '元'
|
||||
: '', // 城乡居民大病医疗保险基金
|
||||
MEDICAL_ASSISTANCE:
|
||||
(param.detail?.find((t) => t.payEnum === 610100)?.amount ?? 0) > 0
|
||||
? (param.detail?.find((t) => t.payEnum === 610100)?.amount ?? 0) + '元'
|
||||
: '', // 医疗救助基金
|
||||
GOVERNMENT_SUBSIDY:
|
||||
(param.detail?.find((t) => t.payEnum === 640100)?.amount ?? 0) > 0
|
||||
? (param.detail?.find((t) => t.payEnum === 640100)?.amount ?? 0) + '元'
|
||||
: '', // 政府兜底基金
|
||||
ACCIDENT_INSURANCE:
|
||||
(param.detail?.find((t) => t.payEnum === 390400)?.amount ?? 0) > 0
|
||||
? (param.detail?.find((t) => t.payEnum === 390400)?.amount ?? 0) + '元'
|
||||
: '', // 意外伤害基金
|
||||
CARE_INSURANCE:
|
||||
(param.detail?.find((t) => t.payEnum === 620100)?.amount ?? 0) > 0
|
||||
? (param.detail?.find((t) => t.payEnum === 620100)?.amount ?? 0) + '元'
|
||||
: '', // 照护保险基金
|
||||
FINANCIAL_FUND:
|
||||
(param.detail?.find((t) => t.payEnum === 360100)?.amount ?? 0) > 0
|
||||
? (param.detail?.find((t) => t.payEnum === 360100)?.amount ?? 0) + '元'
|
||||
: '', // 财政基金
|
||||
HOSPITAL_ADVANCE:
|
||||
(param.detail?.find((t) => t.payEnum === 999900)?.amount ?? 0) > 0
|
||||
? (param.detail?.find((t) => t.payEnum === 999900)?.amount ?? 0) + '元'
|
||||
: '', // 医院垫付
|
||||
SUPPLEMENTARY_INSURANCE:
|
||||
(param.detail?.find((t) => t.payEnum === 390300)?.amount ?? 0) > 0
|
||||
? (param.detail?.find((t) => t.payEnum === 390300)?.amount ?? 0) + '元'
|
||||
: '', // 城乡居民大病补充保险基金
|
||||
HEALTHCARE_PREPAYMENT:
|
||||
(param.detail?.find((t) => t.payEnum === 360300)?.amount ?? 0) > 0
|
||||
? (param.detail?.find((t) => t.payEnum === 360300)?.amount ?? 0) + '元'
|
||||
: '', // 保健预支基金
|
||||
//微信刷卡支付
|
||||
SELF_CASH_VX_VALUE: (() => {
|
||||
// const cashValue = param.detail.find((t) => t.payEnum === 220400)?.amount ?? 0;
|
||||
const vxValue = param.detail.find((t) => t.payEnum === 220100)?.amount ?? 0;
|
||||
const unionValue = param.detail.find((t) => t.payEnum === 220300)?.amount ?? 0;
|
||||
const aliValue = param.detail.find((t) => t.payEnum === 220200)?.amount ?? 0;
|
||||
return vxValue + unionValue + aliValue + '元';
|
||||
})(),
|
||||
|
||||
// 患者信息
|
||||
patientName: param.patientName || '',
|
||||
sex: param.sex === 1 ? '女' : param.sex === 0 ? '男' : param.sex || '',
|
||||
age: param.age ? param.age + '岁' : '',
|
||||
personType: param.contractName, //病人类型
|
||||
|
||||
// 挂号和就诊信息
|
||||
encounterId: props.patientInfo?.encounterId || '',
|
||||
busNo: props.patientInfo?.busNo || '',
|
||||
Mr_QR_Code: param.regNo || props.registerBusNo,
|
||||
// 科室和医生信息
|
||||
organizationName: props.orgName || props.patientInfo?.organizationName || '',
|
||||
practitionerName: props.patientInfo?.practitionerName || '',
|
||||
healthcareName: props.patientInfo?.healthcareName || '',
|
||||
// 费用信息
|
||||
fixmedinsName: param.fixmedinsName
|
||||
? param.fixmedinsName + '门诊收费明细'
|
||||
: '门诊收费明细',
|
||||
// 收费员
|
||||
cashier: param.paymentEmployee,
|
||||
|
||||
// 收费时间
|
||||
chargeTime: new Date().toLocaleString(),
|
||||
//电子收据二维码
|
||||
pictureUrl: param.pictureUrl || 'https://chinaebill.com/img/xiaochengxu.png',
|
||||
},
|
||||
],
|
||||
};
|
||||
// 选择门诊挂号打印模板
|
||||
console.log('printDataprintDataprintDataprintDataprintData', printData.data[0]);
|
||||
await printUtils.print(PRINT_TEMPLATE.OUTPATIENT_REGISTRATION, printData.data[0]);
|
||||
console.log('打印成功');
|
||||
} catch (error) {
|
||||
console.error('打印失败:', error);
|
||||
proxy.$modal.msgError('打印失败: ' + error.message);
|
||||
}
|
||||
}
|
||||
|
||||
function handleWxPay() {
|
||||
console.log('开始微信支付,当前支付详情:', formData.selfPay);
|
||||
console.log(
|
||||
'支付金额详情:',
|
||||
formData.selfPay.map((item) => ({ payEnum: item.payEnum, amount: item.amount }))
|
||||
);
|
||||
wxPay({
|
||||
txtCode: txtCode.value,
|
||||
//chargeItemIds: props.chargeItemIds,
|
||||
//encounterId: props.patientInfo.encounterId,
|
||||
id: props.paymentId,
|
||||
paymentDetails: formData.selfPay,
|
||||
// ybMdtrtCertType: props.userCardInfo.psnCertType,
|
||||
// busiCardInfo: props.userCardInfo.busiCardInfo,
|
||||
})
|
||||
.then((response) => {
|
||||
//返回结果是jsonString,可判断其调用是否成功
|
||||
console.log(response, 'response');
|
||||
var res = JSON.parse(response);
|
||||
if (!res.IsSuccess) {
|
||||
proxy.$modal.msgError('调用打印插件失败:' + res.ErrorMessage);
|
||||
}
|
||||
console.log('微信支付请求成功:', response);
|
||||
})
|
||||
.catch((error) => {
|
||||
proxy.$modal.msgError('调用打印插件失败:' + error);
|
||||
console.error('微信支付请求失败:', error);
|
||||
});
|
||||
}
|
||||
|
||||
function getWxPayResult() {
|
||||
WxPayResult({
|
||||
txtCode: txtCode.value,
|
||||
chargeItemIds: props.chargeItemIds,
|
||||
encounterId: props.patientInfo.encounterId,
|
||||
id: props.paymentId,
|
||||
paymentDetails: formData.selfPay,
|
||||
ybMdtrtCertType: props.userCardInfo.psnCertType,
|
||||
busiCardInfo: props.userCardInfo.busiCardInfo,
|
||||
});
|
||||
}
|
||||
|
||||
function submit() {
|
||||
if (parseFloat(displayAmount.value) < formData.totalAmount) {
|
||||
proxy.$modal.msgError('请输入正确的结算金额');
|
||||
@@ -311,8 +459,8 @@ function submit() {
|
||||
.then((res) => {
|
||||
if (res.code == 200) {
|
||||
printReceipt(res.data);
|
||||
(formData.selfPay = [{ payEnum: 220100, amount: 0.0, payLevelEnum: 2 }]),
|
||||
emit('close', 'success');
|
||||
formData.selfPay = [{ payEnum: 220100, amount: 0.0, payLevelEnum: 2 }];
|
||||
emit('close', 'success');
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
@@ -323,10 +471,10 @@ function submit() {
|
||||
const currentDate = ref(new Date().toLocaleString());
|
||||
|
||||
const selfPayMethods = [
|
||||
{ label: '现金', value: 220400 },
|
||||
{ label: '微信', value: 220100 },
|
||||
{ label: '支付宝', value: 220200 },
|
||||
{ label: '银联', value: 220300 },
|
||||
{ label: '现金', value: 220400, isWebPay: false },
|
||||
{ label: '微信', value: 220100, isWebPay: true },
|
||||
{ label: '支付宝', value: 220200, isWebPay: true },
|
||||
{ label: '银联', value: 220300, isWebPay: true },
|
||||
];
|
||||
|
||||
// 计算剩余可输入金额
|
||||
@@ -349,10 +497,27 @@ const getMax = (index) => {
|
||||
};
|
||||
|
||||
// 检查支付方式是否已使用
|
||||
const isMethodDisabled = (payEnum) => {
|
||||
return formData.selfPay.some((item) => item.payEnum === payEnum);
|
||||
const isMethodDisabled = (option) => {
|
||||
if (formData.selfPay.length > 1) {
|
||||
// 禁用已被选择的相同方式,避免重复选择
|
||||
const selectedEnums = formData.selfPay.map((item) => item.payEnum);
|
||||
debugger;
|
||||
if (selectedEnums.includes(option.value)) {
|
||||
return true;
|
||||
}
|
||||
// 若已经选择了任一线上支付方式,则其他线上方式不可再选,仅允许现金等线下方式
|
||||
const hasSelectedWebPay = selectedEnums.some((val) => {
|
||||
const found = selfPayMethods.find((m) => m.value === val);
|
||||
return found ? found.isWebPay === true : false;
|
||||
});
|
||||
if (hasSelectedWebPay && option.isWebPay) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
const handleAmountChange = () => {
|
||||
// 不需要在这里直接设置 returnedAmount,依赖 computed 属性
|
||||
};
|
||||
@@ -367,9 +532,21 @@ const addPayment = () => {
|
||||
const removePayment = (index) => {
|
||||
formData.selfPay.splice(index, 1);
|
||||
};
|
||||
|
||||
const payTypeText = ref('微信');
|
||||
const payTypePlaceholder = computed(() => {
|
||||
if (payTypeText.value === '现金') {
|
||||
return '请输入现金金额';
|
||||
}
|
||||
return payTypeText.value + '支付二维码';
|
||||
});
|
||||
const clearAmount = (index) => {
|
||||
// formData.selfPay[index].amount = 0;
|
||||
const selectedOption = selfPayMethods.find(
|
||||
(item) => item.value === formData.selfPay[index].payEnum
|
||||
);
|
||||
if (selectedOption) {
|
||||
payTypeText.value = selectedOption.label;
|
||||
}
|
||||
};
|
||||
|
||||
// 计算属性
|
||||
@@ -387,6 +564,8 @@ const returnedAmount = computed(() => {
|
||||
});
|
||||
|
||||
function close() {
|
||||
//清空表单数据
|
||||
txtCode.value = '';
|
||||
emit('close', 'cancel');
|
||||
}
|
||||
</script>
|
||||
@@ -486,4 +665,4 @@ function close() {
|
||||
color: #999;
|
||||
pointer-events: none; /* 避免点击干扰 */
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import request from '@/utils/request'
|
||||
import { parseStrEmpty } from "@/utils/openhis";
|
||||
import request from '@/utils/request';
|
||||
import { parseStrEmpty } from '@/utils/openhis';
|
||||
|
||||
// 查询初期所需数据
|
||||
export function getInit() {
|
||||
return request({
|
||||
url: '/charge-manage/register/init',
|
||||
method: 'get'
|
||||
})
|
||||
method: 'get',
|
||||
});
|
||||
}
|
||||
|
||||
// 查询患者信息
|
||||
@@ -14,16 +14,16 @@ export function getOutpatientRegistrationList(query) {
|
||||
return request({
|
||||
url: '/charge-manage/register/patient-metadata',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
|
||||
// 查询费用性质
|
||||
export function getContractList() {
|
||||
return request({
|
||||
url: '/app-common/contract-list',
|
||||
method: 'get'
|
||||
})
|
||||
method: 'get',
|
||||
});
|
||||
}
|
||||
|
||||
// 查询诊断信息
|
||||
@@ -31,8 +31,8 @@ export function getConditionDefinitionMetadata(query) {
|
||||
return request({
|
||||
url: '/charge-manage/register/condition-definition-metadata',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
|
||||
// // 查询就诊位置
|
||||
@@ -49,8 +49,8 @@ export function getLocationTree(query) {
|
||||
return request({
|
||||
url: '/charge-manage/register/org-list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
|
||||
// 根据位置id筛选医生
|
||||
@@ -58,8 +58,8 @@ export function getPractitionerMetadata(query) {
|
||||
return request({
|
||||
url: '/charge-manage/register/practitioner-metadata',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
|
||||
// 根据机构id筛选服务项目
|
||||
@@ -67,8 +67,17 @@ export function getHealthcareMetadata(query) {
|
||||
return request({
|
||||
url: '/charge-manage/register/healthcare-metadata',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
|
||||
// 更新患者手机号
|
||||
export function updatePatientPhone(data) {
|
||||
return request({
|
||||
url: '/patient-manage/information/update-patient-phone',
|
||||
method: 'post',
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
|
||||
// 门诊挂号查询
|
||||
@@ -76,8 +85,8 @@ export function getOutpatientRegistrationCurrent(query) {
|
||||
return request({
|
||||
url: '/charge-manage/register/current-day-encounter',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
|
||||
// 新增门诊挂号信息
|
||||
@@ -85,8 +94,8 @@ export function addOutpatientRegistration(data) {
|
||||
return request({
|
||||
url: '/payment/payment/reg-pre-pay',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
|
||||
// 新增病人信息
|
||||
@@ -94,83 +103,79 @@ export function addPatient(data) {
|
||||
return request({
|
||||
url: '/patient-manage/information/patient-information',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
export function listmaritalstatus() {
|
||||
return request({
|
||||
url: '/patientmanage/information/list-maritalstatus',
|
||||
method: 'get',
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
export function listoccupationtype() {
|
||||
return request({
|
||||
url: '/patientmanage/information/list-occupationtype',
|
||||
method: 'get',
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
export function lisadministrativegender() {
|
||||
return request({
|
||||
url: '/patientmanage/information/list-administrativegender',
|
||||
method: 'get',
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
export function listbloodtypeabo() {
|
||||
return request({
|
||||
url: '/patientmanage/information/list-bloodtypeabo',
|
||||
method: 'get',
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
export function listbloodtypearh() {
|
||||
return request({
|
||||
url: '/patientmanage/information/list-bloodtypearh',
|
||||
method: 'get',
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
export function listfamilyrelationshiptype() {
|
||||
return request({
|
||||
url: '/patientmanage/information/list-familyrelationshiptype',
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
return request({
|
||||
url: '/patientmanage/information/list-familyrelationshiptype',
|
||||
method: 'get',
|
||||
});
|
||||
}
|
||||
|
||||
// 查询患者相关
|
||||
export function patientlLists() {
|
||||
return request({
|
||||
url: '/patient-manage/information/init',
|
||||
method: 'get',
|
||||
});
|
||||
}
|
||||
|
||||
// 查询患者相关
|
||||
export function patientlLists() {
|
||||
return request({
|
||||
url: '/patient-manage/information/init',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
// 患者退号
|
||||
export function returnRegister(encounterId) {
|
||||
return request({
|
||||
url: '/charge-manage/register/return?encounterId=' + encounterId,
|
||||
method: 'put',
|
||||
});
|
||||
}
|
||||
|
||||
// 患者退号
|
||||
export function returnRegister(encounterId) {
|
||||
return request({
|
||||
url: '/charge-manage/register/return?encounterId=' + encounterId,
|
||||
method: 'put'
|
||||
})
|
||||
}
|
||||
/**
|
||||
* 收费
|
||||
*/
|
||||
export function savePayment(data) {
|
||||
return request({
|
||||
url: '/payment/payment/reg-pay',
|
||||
method: 'post',
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 收费
|
||||
*/
|
||||
export function savePayment(data) {
|
||||
return request({
|
||||
url: '/payment/payment/reg-pay',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 收费预结算
|
||||
*/
|
||||
@@ -178,8 +183,8 @@ export function precharge(data) {
|
||||
return request({
|
||||
url: '/payment/payment/precharge',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -189,8 +194,20 @@ export function refund(data) {
|
||||
return request({
|
||||
url: '/payment/payment/uncharge',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 退费预检(挂号预取消)
|
||||
* GET /payment/payment/pre-cancel-reg?encounterId=xxx
|
||||
*/
|
||||
export function preCancelReg(encounterId) {
|
||||
return request({
|
||||
url: '/payment/payment/pre-cancel-reg',
|
||||
method: 'get',
|
||||
params: { encounterId },
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -200,8 +217,8 @@ export function cancelRegister(data) {
|
||||
return request({
|
||||
url: '/charge-manage/register/return',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -211,6 +228,7 @@ export function gerPreInfo(userMaessage) {
|
||||
return request({
|
||||
url: '/yb-request/per-info',
|
||||
method: 'post',
|
||||
<<<<<<< HEAD
|
||||
params: userMaessage
|
||||
})
|
||||
}
|
||||
@@ -240,4 +258,31 @@ export function reprintRegistration(data) {
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
}
|
||||
=======
|
||||
params: userMaessage,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 微信支付
|
||||
*/
|
||||
export function wxPay(data) {
|
||||
return request({
|
||||
url: '/three-part/pay/pay-for',
|
||||
method: 'post',
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 微信支付
|
||||
*/
|
||||
export function WxPayResult(data) {
|
||||
return request({
|
||||
url: '/three-part/pay/pay-query',
|
||||
method: 'get',
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
>>>>>>> v1.3
|
||||
|
||||
@@ -10,8 +10,63 @@
|
||||
<el-input v-model="form.name" clearable :disabled="isViewMode" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<<<<<<< HEAD
|
||||
<el-col :span="6">
|
||||
<el-form-item label="民族" prop="nationalityCode" label-width="80px">
|
||||
=======
|
||||
<el-col :span="8">
|
||||
<el-form-item label="性别" prop="genderEnum">
|
||||
<el-radio-group v-model="form.genderEnum" :disabled="isViewMode">
|
||||
<el-radio
|
||||
v-for="item in administrativegenderList"
|
||||
:key="item.value"
|
||||
:label="item.value"
|
||||
>
|
||||
{{ item.info }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="活动标识" prop="tempFlag">
|
||||
<el-radio-group v-model="form.tempFlag" :disabled="isViewMode">
|
||||
<el-radio v-for="dict in patient_temp_flag" :key="dict.value" :label="dict.value">
|
||||
{{ dict.label }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="联系方式" prop="phone">
|
||||
<el-input v-model="form.phone" clearable :disabled="isViewMode" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="8">
|
||||
<el-form-item label="证件类型" prop="typeCode">
|
||||
<el-select
|
||||
v-model="form.typeCode"
|
||||
placeholder="证件类型"
|
||||
clearable
|
||||
:disabled="isViewMode"
|
||||
@change="typeChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in sys_idtype"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
<el-col :span="8">
|
||||
<el-form-item label="身份证号码" prop="idCard">
|
||||
<el-input v-model="form.idCard" clearable :disabled="isViewMode" @blur="onBlur" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="民族" prop="nationalityCode">
|
||||
>>>>>>> v1.3
|
||||
<el-select v-model="form.nationalityCode" clearable filterable :disabled="isViewMode">
|
||||
<el-option
|
||||
v-for="item in nationality_code"
|
||||
@@ -51,6 +106,7 @@
|
||||
<!-- 第二行:证件类别、证件号码、*年龄 -->
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="8">
|
||||
<<<<<<< HEAD
|
||||
<el-form-item label="证件类别" prop="typeCode" label-width="80px">
|
||||
<el-select
|
||||
v-model="form.typeCode"
|
||||
@@ -123,10 +179,27 @@
|
||||
<!-- 第三行:就诊卡号、职业、邮政编码 -->
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
=======
|
||||
>>>>>>> v1.3
|
||||
<el-form-item label="就诊卡号" prop="identifierNo">
|
||||
<el-input v-model="form.identifierNo" clearable :disabled="isViewMode" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
<!-- <el-col :span="8">
|
||||
<el-form-item label="国家编码" prop="countryCode">
|
||||
<el-input v-model="form.countryCode" clearable :disabled="isViewMode" />
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
</el-row>
|
||||
<!-- <el-col :span="6">
|
||||
<el-form-item label="年龄" prop="age">
|
||||
<el-input v-model="form.age" clearable :disabled="isViewMode"/>
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
<el-row>
|
||||
>>>>>>> v1.3
|
||||
<el-col :span="8">
|
||||
<el-form-item label="职业" prop="prfsEnum">
|
||||
<el-select v-model="form.prfsEnum" placeholder="职业" clearable :disabled="isViewMode">
|
||||
@@ -350,10 +423,20 @@
|
||||
</template>
|
||||
|
||||
<script setup name="PatientAddDialog">
|
||||
<<<<<<< HEAD
|
||||
import { watch, defineProps } from "vue";
|
||||
=======
|
||||
import { watch } from 'vue';
|
||||
>>>>>>> v1.3
|
||||
import pcas from 'china-division/dist/pcas-code.json';
|
||||
import { addPatient, patientlLists, getOutpatientRegistrationList } from './outpatientregistration';
|
||||
import {
|
||||
isValidCNPhoneNumber,
|
||||
isValidCNidCardNumber,
|
||||
getGenderAndAge,
|
||||
} from '../../../../utils/validate';
|
||||
import { fromPairs } from 'lodash';
|
||||
import { ElMessage } from 'element-plus';
|
||||
|
||||
const router = useRouter();
|
||||
const { proxy } = getCurrentInstance();
|
||||
@@ -606,6 +689,7 @@ const validateGuardianInfo = (rule, value, callback) => {
|
||||
const data = reactive({
|
||||
isViewMode: false,
|
||||
form: {
|
||||
<<<<<<< HEAD
|
||||
typeCode: '08',
|
||||
birthDate: undefined,
|
||||
age: undefined,
|
||||
@@ -615,6 +699,11 @@ const data = reactive({
|
||||
postalCode: undefined,
|
||||
companyAddress: undefined,
|
||||
patientDerived: undefined,
|
||||
=======
|
||||
typeCode: '01',
|
||||
tempFlag: '1',
|
||||
// genderEnum: 0,
|
||||
>>>>>>> v1.3
|
||||
},
|
||||
rules: {
|
||||
name: [{ required: true, message: '姓名不能为空', trigger: 'change' },
|
||||
@@ -631,6 +720,7 @@ const data = reactive({
|
||||
genderEnum: [{ required: true, message: '请选择性别', trigger: 'change' }],
|
||||
age: [{ required: true, message: '年龄不能为空', trigger: 'change' }],
|
||||
phone: [{ required: true, message: '联系方式不能为空', trigger: 'change' }],
|
||||
<<<<<<< HEAD
|
||||
identifierNo: [{ required: true, message: '就诊卡号不能为空', trigger: 'change' }],
|
||||
idCard: [
|
||||
{ required: false, message: '证件号码不能为空', trigger: 'change' },
|
||||
@@ -643,6 +733,9 @@ const data = reactive({
|
||||
guardianRelation: [{ validator: validateGuardianInfo, trigger: 'blur' }],
|
||||
guardianPhone: [{ validator: validateGuardianInfo, trigger: 'blur' }],
|
||||
guardianIdNo: [{ validator: validateGuardianInfo, trigger: 'blur' }],
|
||||
=======
|
||||
idCard: [{ required: true, message: '证件号不能为空', trigger: 'change' }],
|
||||
>>>>>>> v1.3
|
||||
},
|
||||
});
|
||||
|
||||
@@ -664,6 +757,7 @@ const props = defineProps({
|
||||
}
|
||||
});
|
||||
|
||||
<<<<<<< HEAD
|
||||
// 处理出生日期变化,自动计算年龄
|
||||
function handleBirthDateChange() {
|
||||
if (form.value.birthDate) {
|
||||
@@ -732,6 +826,32 @@ watch(
|
||||
}
|
||||
}
|
||||
);
|
||||
=======
|
||||
// watch(
|
||||
// () => form.value.idCard,
|
||||
// (newIdCard) => {
|
||||
// if (newIdCard && newIdCard.length === 18) {
|
||||
// const birthYear = parseInt(newIdCard.substring(6, 10));
|
||||
// const birthMonth = parseInt(newIdCard.substring(10, 12));
|
||||
// const birthDay = parseInt(newIdCard.substring(12, 14));
|
||||
|
||||
// const today = new Date();
|
||||
// const currentYear = today.getFullYear();
|
||||
// const currentMonth = today.getMonth() + 1;
|
||||
// const currentDay = today.getDate();
|
||||
|
||||
// let age = currentYear - birthYear;
|
||||
|
||||
// // 如果当前月份小于出生月份,或者月份相同但当前日期小于出生日期,则年龄减1
|
||||
// if (currentMonth < birthMonth || (currentMonth === birthMonth && currentDay < birthDay)) {
|
||||
// age--;
|
||||
// }
|
||||
|
||||
// form.value.age = age;
|
||||
// }
|
||||
// }
|
||||
// );
|
||||
>>>>>>> v1.3
|
||||
/** 查询菜单列表 */
|
||||
function getList() {
|
||||
patientlLists().then((response) => {
|
||||
@@ -742,6 +862,7 @@ function getList() {
|
||||
bloodtypearhList.value = response.data.bloodTypeRH;
|
||||
familyrelationshiptypeList.value = response.data.familyRelationshipType;
|
||||
maritalstatusList.value = response.data.maritalStatus;
|
||||
console.log('administrativegenderList======>', JSON.stringify(administrativegenderList.value));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1217,7 +1338,7 @@ function reset() {
|
||||
menuName: undefined,
|
||||
age: undefined,
|
||||
genderEnum: undefined,
|
||||
typeCode: '08',
|
||||
typeCode: '01',
|
||||
idCard: undefined,
|
||||
phone: undefined,
|
||||
prfsEnum: undefined,
|
||||
@@ -1245,14 +1366,45 @@ function reset() {
|
||||
}
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
if (!isValidCNPhoneNumber(form.value.phone)) {
|
||||
ElMessage({
|
||||
type: 'error',
|
||||
message: '手机号有误,请重新输入',
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (form.value.typeCode === '01') {
|
||||
if (!isValidCNidCardNumber(form.value.idCard)) {
|
||||
ElMessage({
|
||||
type: 'error',
|
||||
message: '身份证号有误,请重新输入',
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
// 活动标识 2 启用 3 停用
|
||||
if (form.value.tempFlag == '1') {
|
||||
form.value.activeFlag = 2;
|
||||
} else {
|
||||
form.value.activeFlag = 3;
|
||||
}
|
||||
form.value.patientIdInfoList = [
|
||||
{
|
||||
typeCode: form.value.typeCode,
|
||||
},
|
||||
];
|
||||
if (form.value.idCard) {
|
||||
form.value.birthDate =
|
||||
form.value.idCard.toString().substring(6, 10) +
|
||||
'-' +
|
||||
form.value.idCard.toString().substring(10, 12) +
|
||||
'-' +
|
||||
form.value.idCard.toString().substring(12, 14);
|
||||
console.log(form.value.birthDate, 123);
|
||||
if (form.value.typeCode === '01') {
|
||||
form.value.birthDate =
|
||||
form.value.idCard.toString().substring(6, 10) +
|
||||
'-' +
|
||||
form.value.idCard.toString().substring(10, 12) +
|
||||
'-' +
|
||||
form.value.idCard.toString().substring(12, 14);
|
||||
console.log(form.value.birthDate, 123);
|
||||
} else {
|
||||
form.value.birthDate = undefined;
|
||||
}
|
||||
}
|
||||
// 进行表单验证
|
||||
proxy.$refs['patientRef'].validate((valid) => {
|
||||
@@ -1293,6 +1445,22 @@ function cancel() {
|
||||
visible.value = false;
|
||||
reset();
|
||||
}
|
||||
// 身份证号失去焦点获取年龄和性别
|
||||
const onBlur = () => {
|
||||
if (form.value.typeCode === '01') {
|
||||
const info = getGenderAndAge(form.value.idCard || '');
|
||||
form.value.age = info.age;
|
||||
form.value.genderEnum = info.gender;
|
||||
}
|
||||
};
|
||||
//切换证件类型
|
||||
const typeChange = () => {
|
||||
if (form.value.typeCode === '01') {
|
||||
const info = getGenderAndAge(form.value.idCard || '');
|
||||
form.value.age = info.age;
|
||||
form.value.genderEnum = info.gender;
|
||||
}
|
||||
};
|
||||
defineExpose({
|
||||
show,
|
||||
});
|
||||
|
||||
@@ -1,63 +1,50 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="确认退费"
|
||||
:title="eventType == '1' ? '确认退费' : '挂号详情'"
|
||||
v-model="props.open"
|
||||
width="700px"
|
||||
append-to-body
|
||||
destroy-on-close
|
||||
@close="close"
|
||||
>
|
||||
<div>
|
||||
<div v-loading="loading">
|
||||
<el-text size="large" style="display: block; margin-bottom: 15px">
|
||||
退费日期:{{ currentDate }}
|
||||
</el-text>
|
||||
<<<<<<< HEAD
|
||||
<el-text size="large">费用性质:{{ getFeeTypeText }}</el-text>
|
||||
=======
|
||||
<el-text size="large">费用性质:{{ props.category || '自费' }}</el-text>
|
||||
>>>>>>> v1.3
|
||||
<div class="amount-row">
|
||||
<el-text size="large">应退金额:</el-text>
|
||||
<el-text size="large" type="primary" class="amount">
|
||||
{{ props.totalAmount.toFixed(2) + ' 元' }}
|
||||
{{ (calculatedTotalAmount || 0) + ' 元' }}
|
||||
</el-text>
|
||||
</div>
|
||||
<div class="amount-row" v-if="calculatedReturnAmount > 0">
|
||||
<el-text size="large">退费金额:</el-text>
|
||||
<el-text size="large" type="primary" class="amount">
|
||||
{{ (calculatedReturnAmount || 0) + ' 元' }}
|
||||
</el-text>
|
||||
</div>
|
||||
|
||||
<!-- 自费支付 -->
|
||||
<!-- 退费方式列表(从接口数据中筛选) -->
|
||||
<div class="payment-container">
|
||||
<div v-for="(item, index) in formData.selfPay" :key="index" class="payment-item">
|
||||
<div v-for="(item, index) in refundMethodsFromApi" :key="index" class="payment-item">
|
||||
<span>退费方式:</span>
|
||||
<el-select
|
||||
v-model="item.payEnum"
|
||||
placeholder="选择退费方式"
|
||||
style="width: 160px"
|
||||
@change="clearAmount(index)"
|
||||
>
|
||||
<el-option
|
||||
v-for="payEnum in selfPayMethods"
|
||||
:key="payEnum.value"
|
||||
:label="payEnum.label"
|
||||
:value="payEnum.value"
|
||||
:disabled="isMethodDisabled(payEnum.value)"
|
||||
/>
|
||||
</el-select>
|
||||
<el-input :value="getPayMethodLabel(item.payEnum)" readonly style="width: 160px" />
|
||||
<span>退费金额:</span>
|
||||
<div class="suffix-wrapper">
|
||||
<el-input-number
|
||||
v-model="item.amount"
|
||||
:model-value="(Number(item.amount) || 0) - (Number(item.returnAmount) || 0)"
|
||||
:precision="2"
|
||||
:min="0"
|
||||
:max="getMax(index)"
|
||||
:controls="false"
|
||||
placeholder="金额"
|
||||
disabled
|
||||
class="amount-input"
|
||||
@change="handleAmountChange"
|
||||
/>
|
||||
<span class="suffix-text">元</span>
|
||||
</div>
|
||||
<el-button
|
||||
type="danger"
|
||||
circle
|
||||
:icon="Delete"
|
||||
@click="removePayment(index)"
|
||||
v-if="index > 0"
|
||||
/>
|
||||
</div>
|
||||
<div class="payment-container" style="position: relative">
|
||||
<span style="position: absolute; top: 5px">退费原因:</span>
|
||||
@@ -67,29 +54,27 @@
|
||||
v-model="reason"
|
||||
placeholder="退费原因"
|
||||
class="reason-textarea"
|
||||
@change="handleAmountChange"
|
||||
:disabled="eventType == '1' ? false : true"
|
||||
/>
|
||||
</div>
|
||||
<div class="add-payment">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
@click="addPayment"
|
||||
:disabled="formData.selfPay.length >= 4 || remainingAmount <= 0"
|
||||
>
|
||||
<!-- 添加退费方式功能暂时注释 -->
|
||||
<!-- <div class="add-payment">
|
||||
<el-button type="primary" plain @click="addPayment" :disabled="canAddPayment">
|
||||
添加退费方式
|
||||
</el-button>
|
||||
<el-text v-if="remainingAmount <= 0" type="danger" class="tip">
|
||||
金额已满足应退,不可继续添加
|
||||
<el-text v-if="canAddPayment" type="danger" class="tip">
|
||||
退费金额已等于应退金额,不可继续添加
|
||||
</el-text>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
<!-- 金额汇总 -->
|
||||
<div class="summary">
|
||||
<el-space :size="30">
|
||||
<div class="summary-item">
|
||||
<el-text type="info">实退合计:</el-text>
|
||||
<el-text type="success">{{ displayAmount + ' 元' }}</el-text>
|
||||
<el-text type="success">{{
|
||||
displayAmount > 0 ? displayAmount + ' 元' : props.totalAmount + ' 元'
|
||||
}}</el-text>
|
||||
</div>
|
||||
<!-- <div class="summary-item">
|
||||
<el-text type="info">应找零:</el-text>
|
||||
@@ -97,10 +82,32 @@
|
||||
</div> -->
|
||||
</el-space>
|
||||
</div>
|
||||
|
||||
<!-- 退费明细表格 -->
|
||||
<div v-if="preCancelData && preCancelData.length > 0" class="pre-cancel-table-wrapper">
|
||||
<el-table :data="preCancelData" border stripe max-height="300" style="width: 100%">
|
||||
<el-table-column prop="payEnum_dictText" label="支付方式" min-width="200" />
|
||||
<el-table-column prop="amount" label="金额" width="120" align="right">
|
||||
<template #default="{ row }">
|
||||
{{ row.amount ? Number(row.amount) : '0.00' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="returnAmount" label="退费金额" width="120" align="right">
|
||||
<template #default="{ row }">
|
||||
{{ row.returnAmount ? Number(row.returnAmount) : '0.00' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="chargeAmount" label="收费金额" min-width="120" align="right">
|
||||
<template #default="{ row }">
|
||||
{{ row.chargeAmount ? Number(row.chargeAmount) : '0.00' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submit">确 定</el-button>
|
||||
<el-button v-if="eventType == 1" type="primary" @click="submit">确 定</el-button>
|
||||
<el-button @click="close">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
@@ -108,7 +115,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { cancelRegister } from './outpatientregistration';
|
||||
import { cancelRegister, preCancelReg } from './outpatientregistration';
|
||||
import { computed, watch, reactive, ref, getCurrentInstance } from 'vue';
|
||||
import { Delete } from '@element-plus/icons-vue';
|
||||
import useUserStore from '@/store/modules/user';
|
||||
@@ -153,6 +160,7 @@ const props = defineProps({
|
||||
type: [],
|
||||
default: [],
|
||||
},
|
||||
<<<<<<< HEAD
|
||||
medfee_paymtd_code: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
@@ -169,11 +177,22 @@ const props = defineProps({
|
||||
type: Object,
|
||||
default: () => ({}), // 原挂号记录信息
|
||||
}
|
||||
=======
|
||||
eventType: {
|
||||
type: String,
|
||||
default: 1,
|
||||
},
|
||||
>>>>>>> v1.3
|
||||
});
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
const reason = ref('');
|
||||
<<<<<<< HEAD
|
||||
const userStore = useUserStore();
|
||||
=======
|
||||
const preCancelData = ref([]);
|
||||
const loading = ref(false);
|
||||
>>>>>>> v1.3
|
||||
|
||||
const formData = reactive({
|
||||
totalAmount: 0,
|
||||
@@ -195,9 +214,48 @@ watch(
|
||||
|
||||
const emit = defineEmits(['close']);
|
||||
|
||||
watch(
|
||||
() => props.open,
|
||||
async (val) => {
|
||||
if (val && props.patientInfo && props.patientInfo.encounterId) {
|
||||
loading.value = true;
|
||||
try {
|
||||
const res = await preCancelReg(props.patientInfo.encounterId);
|
||||
if (res && res.code === 200 && res.data) {
|
||||
preCancelData.value = res.data;
|
||||
// 计算应退金额并更新表单数据
|
||||
const targetPayEnums = [220500, 220400, 220100, 220200, 220300];
|
||||
const sum = res.data
|
||||
.filter((item) => targetPayEnums.includes(item.payEnum))
|
||||
.reduce((total, item) => total + (Number(item.amount) || 0), 0);
|
||||
if (sum > 0) {
|
||||
formData.totalAmount = sum;
|
||||
// 如果第一个退费方式的金额为0或等于原来的totalAmount,则自动填充
|
||||
if (
|
||||
formData.selfPay[0].amount === 0 ||
|
||||
formData.selfPay[0].amount === props.totalAmount
|
||||
) {
|
||||
formData.selfPay[0].amount = sum;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('pre-cancel-reg error', err);
|
||||
preCancelData.value = [];
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
} else {
|
||||
preCancelData.value = [];
|
||||
loading.value = false;
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
function submit() {
|
||||
console.log(props.chargeItemIds);
|
||||
|
||||
<<<<<<< HEAD
|
||||
if (parseFloat(displayAmount.value) < formData.totalAmount) {
|
||||
proxy.$modal.msgError('请输入正确的金额');
|
||||
return;
|
||||
@@ -214,6 +272,12 @@ function submit() {
|
||||
// 计算退款总金额
|
||||
const refundAmount = formData.selfPay.reduce((sum, item) => sum + (Number(item.amount) || 0), 0);
|
||||
|
||||
=======
|
||||
// if (parseFloat(displayAmount.value) < formData.totalAmount) {
|
||||
// proxy.$modal.msgError('请输入正确的金额');
|
||||
// return;
|
||||
// }
|
||||
>>>>>>> v1.3
|
||||
cancelRegister({
|
||||
paymentEnum: 0,
|
||||
kindEnum: 1,
|
||||
@@ -254,23 +318,16 @@ const selfPayMethods = [
|
||||
{ label: '银联', value: 220300 },
|
||||
];
|
||||
|
||||
// 计算剩余可输入金额
|
||||
const remainingAmount = computed(() => {
|
||||
return (
|
||||
formData.totalAmount - formData.selfPay.reduce((sum, item) => sum + Number(item.amount), 0)
|
||||
);
|
||||
});
|
||||
|
||||
// 获取单个支付方式的最大可输入金额
|
||||
const getMax = (index) => {
|
||||
const otherSum = formData.selfPay.reduce(
|
||||
(sum, item, i) => (i !== index ? sum + Number(item.amount) : sum),
|
||||
(sum, item, i) => (i !== index ? sum + (Number(item.amount) || 0) : sum),
|
||||
0
|
||||
);
|
||||
const maxAmount = calculatedTotalAmount.value - otherSum;
|
||||
if (formData.selfPay[index].payEnum == 220400) {
|
||||
return formData.totalAmount + 100 - otherSum;
|
||||
return maxAmount + 100;
|
||||
}
|
||||
return formData.totalAmount - otherSum;
|
||||
return maxAmount;
|
||||
};
|
||||
|
||||
// 检查支付方式是否已使用
|
||||
@@ -283,10 +340,11 @@ const handleAmountChange = () => {
|
||||
};
|
||||
|
||||
const addPayment = () => {
|
||||
if (remainingAmount.value <= 0) {
|
||||
if (canAddPayment.value) {
|
||||
return;
|
||||
}
|
||||
formData.selfPay.push({ payEnum: '', amount: remainingAmount.value });
|
||||
// 添加新的退费方式,初始金额为0,由用户输入
|
||||
formData.selfPay.push({ payEnum: '', amount: 0 });
|
||||
};
|
||||
|
||||
const removePayment = (index) => {
|
||||
@@ -297,9 +355,16 @@ const clearAmount = (index) => {
|
||||
// formData.selfPay[index].amount = 0;
|
||||
};
|
||||
|
||||
// 计算属性
|
||||
// 计算属性 - 实退合计(使用接口返回的退费方式数据)
|
||||
const displayAmount = computed(() => {
|
||||
return formData.selfPay.reduce((sum, item) => sum + (Number(item.amount) || 0), 0).toFixed(2);
|
||||
if (!preCancelData.value || preCancelData.value.length === 0) {
|
||||
return '0.00';
|
||||
}
|
||||
const targetPayEnums = [220500, 220400, 220100, 220200, 220300];
|
||||
const sum = preCancelData.value
|
||||
.filter((item) => targetPayEnums.includes(item.payEnum))
|
||||
.reduce((sum, item) => sum + (Number(item.amount) || 0), 0);
|
||||
return sum.toFixed(2);
|
||||
});
|
||||
|
||||
const returnedAmount = computed(() => {
|
||||
@@ -311,6 +376,72 @@ const returnedAmount = computed(() => {
|
||||
return returned >= 0 ? returned.toFixed(2) : '0.00';
|
||||
});
|
||||
|
||||
const calculatedTotalAmount = computed(() => {
|
||||
if (!preCancelData.value || preCancelData.value.length === 0) {
|
||||
return props.totalAmount || 0;
|
||||
}
|
||||
const targetPayEnums = [220500, 220400, 220100, 220200, 220300];
|
||||
// 应退金额 = (amount - returnAmount) 的总和,即剩余应退金额
|
||||
const sum = preCancelData.value
|
||||
.filter((item) => targetPayEnums.includes(item.payEnum))
|
||||
.reduce(
|
||||
(total, item) => total + ((Number(item.amount) || 0) - (Number(item.returnAmount) || 0)),
|
||||
0
|
||||
);
|
||||
return sum > 0 ? sum : props.totalAmount || 0;
|
||||
});
|
||||
|
||||
const calculatedReturnAmount = computed(() => {
|
||||
if (!preCancelData.value || preCancelData.value.length === 0) {
|
||||
return 0;
|
||||
}
|
||||
const targetPayEnums = [220500, 220400, 220100, 220200, 220300];
|
||||
const sum = preCancelData.value
|
||||
.filter((item) => targetPayEnums.includes(item.payEnum))
|
||||
.reduce((total, item) => total + (Number(item.returnAmount) || 0), 0);
|
||||
return sum || 0;
|
||||
});
|
||||
|
||||
// 从接口数据中筛选符合条件的退费方式
|
||||
const refundMethodsFromApi = computed(() => {
|
||||
if (!preCancelData.value || preCancelData.value.length === 0) {
|
||||
return [];
|
||||
}
|
||||
const targetPayEnums = [220500, 220400, 220100, 220200, 220300];
|
||||
return preCancelData.value.filter(
|
||||
(item) =>
|
||||
targetPayEnums.includes(item.payEnum) &&
|
||||
item.payEnum_dictText &&
|
||||
item.payEnum_dictText.trim() !== ''
|
||||
);
|
||||
});
|
||||
|
||||
// 根据 payEnum 获取支付方式标签
|
||||
const getPayMethodLabel = (payEnum) => {
|
||||
const method = selfPayMethods.find((m) => m.value === payEnum);
|
||||
if (method) {
|
||||
return method.label;
|
||||
}
|
||||
// 如果找不到,尝试从接口返回的 dictText 中获取
|
||||
const apiItem = preCancelData.value?.find((item) => item.payEnum === payEnum);
|
||||
return apiItem?.payEnum_dictText || `支付方式${payEnum}`;
|
||||
};
|
||||
|
||||
// 计算所有退费方式的总和
|
||||
const totalRefundAmount = computed(() => {
|
||||
return refundMethodsFromApi.value.reduce((sum, item) => sum + (Number(item.amount) || 0), 0);
|
||||
});
|
||||
|
||||
// 计算剩余可输入金额(应退金额 - 已输入的退费金额总和)
|
||||
const remainingAmount = computed(() => {
|
||||
return calculatedTotalAmount.value - totalRefundAmount.value;
|
||||
});
|
||||
|
||||
// 判断是否可以添加退费方式:退费金额总和等于或大于应退金额时不能添加
|
||||
const canAddPayment = computed(() => {
|
||||
return totalRefundAmount.value >= calculatedTotalAmount.value || formData.selfPay.length >= 10;
|
||||
});
|
||||
|
||||
function close() {
|
||||
emit('close');
|
||||
}
|
||||
@@ -420,4 +551,21 @@ function close() {
|
||||
.amount-input .el-input__inner {
|
||||
padding-right: 30px !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
.pre-cancel-table-wrapper {
|
||||
margin-top: 20px;
|
||||
width: 100%;
|
||||
border: 1px solid #dcdfe6;
|
||||
border-radius: 4px;
|
||||
overflow: hidden;
|
||||
|
||||
:deep(.el-table) {
|
||||
width: 100%;
|
||||
|
||||
.el-table__body-wrapper {
|
||||
max-height: 300px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user