提交merge1.3

This commit is contained in:
2025-12-27 15:30:25 +08:00
parent 8c607c8749
commit 088861f66e
1245 changed files with 220442 additions and 77616 deletions

View File

@@ -129,4 +129,29 @@ export function getChargeInfo(param) {
method: 'get',
params: param
})
}
<<<<<<< HEAD
}
=======
}
/**
* 微信支付
*/
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'+data.paymentId,
method: 'get',
});
}
>>>>>>> v1.3

View File

@@ -31,6 +31,7 @@
<template v-for="(item, index) in formData.selfPay" :key="index">
<div v-show="item.payEnum != 220500" class="payment-item">
<span>支付方式</span>
<<<<<<< HEAD
<el-select
v-model="item.payEnum"
placeholder="选择支付方式"
@@ -66,6 +67,48 @@
@click="removePayment(index)"
v-if="index > 0"
/>
=======
<img
v-if="item.payEnum == 220100 || item.payEnum == 220200"
:src="imgs[item.payEnum == 220100 ? 0 : 1]"
style="width: 20px; height: 20px"
/>
<el-select
v-model="item.payEnum"
placeholder="选择支付方式"
style="width: 160px"
@change="(value) => clearAmount(index, value)"
>
<el-option
v-for="payEnum in selfPayMethods"
:key="payEnum.value"
:label="payEnum.label"
:value="payEnum.value"
:disabled="isMethodDisabled(payEnum)"
/>
</el-select>
<span>支付金额</span>
<div class="suffix-wrapper">
<el-input-number
v-model="item.amount"
:precision="2"
:min="0"
:max="getMax(index)"
:controls="false"
placeholder="金额"
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"
/>
>>>>>>> v1.3
</div>
</template>
<div class="add-payment">
@@ -93,6 +136,20 @@
/>
</el-radio-group>
</div>
<<<<<<< HEAD
=======
</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>
>>>>>>> v1.3
</div>
<div>
<el-table :data="props.details" max-height="200" border>
@@ -137,14 +194,29 @@
</template>
<script setup>
<<<<<<< HEAD
import { savePayment, unprecharge, dispenseMedicalConsumables, getChargeInfo } from './api';
=======
import {
savePayment,
unprecharge,
dispenseMedicalConsumables,
wxPay,
WxPayResult,
getChargeInfo,
} from './api';
>>>>>>> v1.3
import { computed, watch, reactive, ref, getCurrentInstance, nextTick } from 'vue';
import { Delete } from '@element-plus/icons-vue';
import { debounce } from 'lodash-es';
import useUserStore from '@/store/modules/user';
import { hiprint } from 'vue-plugin-hiprint';
import templateJson from './template.json';
import { pa } from 'element-plus/es/locales.mjs';
import printUtils, { PRINT_TEMPLATE } from '@/utils/printUtils';
import image1 from '../../../../assets/images/weixinzhifu.png';
import image2 from '../../../../assets/images/zhifubaozhifu.png';
const imgs = ref([image1, image2]);
const props = defineProps({
open: {
type: Boolean,
@@ -168,34 +240,45 @@ const props = defineProps({
default: undefined,
},
chargeItemIds: {
type: [],
default: [],
type: Array,
default: () => [],
},
consumablesIdList: {
type: [],
default: [],
type: Array,
default: () => [],
},
chrgBchnoList: {
type: [],
default: [],
type: Array,
default: () => [],
},
details: {
type: Object,
default: undefined,
},
chargedItems: {
type: [],
default: [],
type: Array,
default: () => [],
},
});
const { proxy } = getCurrentInstance();
<<<<<<< HEAD
const { charge_discount } = proxy.useDict('charge_discount');
const userStore = useUserStore();
const discountRadio = ref(undefined);
const discountAmount = ref(0);
=======
// 单位字典
const { unit_code } = proxy.useDict('unit_code');
const userStore = useUserStore();
const discountRadio = ref();
const discountAmount = ref(0);
const txtCode = ref('');
>>>>>>> v1.3
const formData = reactive({
totalAmount: 0,
@@ -218,6 +301,7 @@ watch(
const emit = defineEmits(['close']);
let displayAmountTemp = 0;
<<<<<<< HEAD
// 打印小票
function printReceipt(param) {
@@ -331,10 +415,370 @@ function printReceipt(param) {
printer: 'xp',
title: '门诊收费结算单',
});
}
=======
// 获取单位字典数据的方法
const getUnitLabel = (unitCode) => {
if (!unitCode) return '';
// 从已加载的 unit_code 字典中查找对应项
const unit = unit_code.value?.find((item) => item.value === unitCode);
return unit ? unit.label : ''; // 如果找不到则返回空字符串
};
async function printReceipt(param) {
// 打印收费小票数据
console.log('打印收费小票数据:', param.chargeItem);
// console.log('!!!!!!!!!选中的收费项目:', param.chargedItems);
console.log('患者信息:', props.patientInfo);
// formData.totalAmount = props.totalAmount;
// 确保第一个支付方式的金额与总金额一致;
if (formData.selfPay.length > 0) {
formData.selfPay[0].amount = props.totalAmount;
}
formData.selfPay = [
{
payEnum: 220100, // 现金支付
amount: props.totalAmount,
payLevelEnum: 2,
},
];
try {
// 处理param.chargedItems添加quantityWithUnit字段
const processedChargeItems = (param.chargeItem || []).map((item) => {
// 获取单位标签
const unitLabel = getUnitLabel(item.quantityUnit);
// 拼接数量和单位
const quantityWithUnit = unitLabel
? `${item.quantityValue} ${unitLabel}`
: item.quantityValue;
return {
...item,
quantityWithUnit, // 添加带单位的数量字段供打印使用
};
});
// 构造打印数据,整合选中行信息
const printData = {
data: [
{
...param,
// 收费项目列表
chargeItemsList: processedChargeItems,
// chargeItemsList: param.chargeItem,
// 基础支付类型
// 金额大于0时显示金额和单位等于0时不显示单位
YB_FUND_PAY: (() => {
const amount = param.detail.find((t) => t.payEnum === 100000)?.amount ?? 0;
return amount > 0 ? amount + ' 元' : amount;
})(), // 基金支付总额
SELF_PAY: (() => {
const amount = param.detail.find((t) => t.payEnum === 200000)?.amount ?? 0;
return amount > 0 ? amount + ' 元' : amount;
})(), // 个人负担总金额
OTHER_PAY: (() => {
const amount = param.detail.find((t) => t.payEnum === 300000)?.amount ?? 0;
return amount > 0 ? amount + ' 元' : amount;
})(), // 其他(如医院负担金额)
// 基本医保统筹基金支出
YB_TC_FUND_AMOUNT: (() => {
const amount = param.detail.find((t) => t.payEnum === 110000)?.amount ?? 0;
return amount > 0 ? amount + ' 元' : amount;
})(), // 基本医保统筹基金支出
YB_BC_FUND_AMOUNT: (() => {
const amount = param.detail.find((t) => t.payEnum === 120000)?.amount ?? 0;
return amount > 0 ? amount + ' 元' : amount;
})(), // 补充医疗保险基金支出
YB_JZ_FUND_AMOUNT: (() => {
const amount = param.detail.find((t) => t.payEnum === 130000)?.amount ?? 0;
return amount > 0 ? amount + ' 元' : amount;
})(), // 医疗救助基金支出
YB_OTHER_AMOUNT: (() => {
const amount = param.detail.find((t) => t.payEnum === 140000)?.amount ?? 0;
return amount > 0 ? amount + ' 元' : amount;
})(), // 其他支出
// 职工基本医疗保险
YB_TC_ZG_FUND_VALUE: (() => {
const amount = param.detail.find((t) => t.payEnum === 110100)?.amount ?? 0;
return amount > 0 ? amount + ' 元' : amount;
})(), // 职工基本医疗保险
YB_TC_JM_FUND_VALUE: (() => {
const amount = param.detail.find((t) => t.payEnum === 110200)?.amount ?? 0;
return amount > 0 ? amount + ' 元' : amount;
})(), // 居民基本医疗保险
// 补充医疗保险基金支出细分
YB_BC_JM_DB_VALUE: (() => {
const amount = param.detail.find((t) => t.payEnum === 120100)?.amount ?? 0;
return amount > 0 ? amount + ' 元' : amount;
})(), // 全体参保人的居民大病保险
YB_BC_DE_BZ_VALUE: (() => {
const amount = param.detail.find((t) => t.payEnum === 120200)?.amount ?? 0;
return amount > 0 ? amount + ' 元' : amount;
})(), // 大额医疗费用补助
YB_BC_ZG_DE_BZ_VALUE: (() => {
const amount = param.detail.find((t) => t.payEnum === 120300)?.amount ?? 0;
return amount > 0 ? amount + ' 元' : amount;
})(), // 企业职工大额医疗费用补助
YB_BC_GWY_BZ_VALUE: (() => {
const amount = param.detail.find((t) => t.payEnum === 120400)?.amount ?? 0;
return amount > 0 ? amount + ' 元' : amount;
})(), // 公务员医疗补助
// 其他支出细分
OTHER_PAY_DD_FUND_VALUE: (() => {
const amount = param.detail.find((t) => t.payEnum === 300001)?.amount ?? 0;
return amount > 0 ? amount + ' 元' : amount;
})(), // 兜底基金支出
OTHER_PAY_YW_SH_FUND_VALUE: (() => {
const amount = param.detail.find((t) => t.payEnum === 300002)?.amount ?? 0;
return amount > 0 ? amount + ' 元' : amount;
})(), // 意外伤害基金支出
OTHER_PAY_LX_YL_FUND_VALUE: (() => {
const amount = param.detail.find((t) => t.payEnum === 300003)?.amount ?? 0;
return amount > 0 ? amount + ' 元' : amount;
})(), // 离休人员医疗保障金支出
OTHER_PAY_LX_YH_FUND_VALUE: (() => {
const amount = param.detail.find((t) => t.payEnum === 300004)?.amount ?? 0;
return amount > 0 ? amount + ' 元' : amount;
})(), // 离休人员优惠金支出
OTHER_PAY_CZ_FUND_VALUE: (() => {
const amount = param.detail.find((t) => t.payEnum === 300005)?.amount ?? 0;
return amount > 0 ? amount + ' 元' : amount;
})(), // 财政基金支出
OTHER_PAY_CZ_YZ_FUND_VALUE: (() => {
const amount = param.detail.find((t) => t.payEnum === 300006)?.amount ?? 0;
return amount > 0 ? amount + ' 元' : amount;
})(), // 财政预支支出
OTHER_PAY_ZG_DB_FUND_VALUE: (() => {
const amount = param.detail.find((t) => t.payEnum === 300007)?.amount ?? 0;
return amount > 0 ? amount + ' 元' : amount;
})(), // 职工大病基金支出
OTHER_PAY_EY_FUND_VALUE: (() => {
const amount = param.detail.find((t) => t.payEnum === 300008)?.amount ?? 0;
return amount > 0 ? amount + ' 元' : amount;
})(), // 二乙基金支出
OTHER_PAY_QX_JZ_FUND_VALUE: (() => {
const amount = param.detail.find((t) => t.payEnum === 300009)?.amount ?? 0;
return amount > 0 ? amount + ' 元' : amount;
})(), // 倾斜救助支出
OTHER_PAY_YL_JZ_FUND_VALUE: (() => {
const amount = param.detail.find((t) => t.payEnum === 300010)?.amount ?? 0;
return amount > 0 ? amount + ' 元' : amount;
})(), // 医疗救助再救助基金
HOSP_PART_AMT: (() => {
const amount = param.detail.find((t) => t.payEnum === 300011)?.amount ?? 0;
return amount > 0 ? amount + ' 元' : amount;
})(), // 医院负担金额
// 医保结算返回值
FULAMT_OWNPAY_AMT: (() => {
const amount = param.detail.find((t) => t.payEnum === 1)?.amount ?? 0;
return amount > 0 ? amount + ' 元' : amount;
})(), // 全自费金额
OVERLMT_SELFPAY: (() => {
const amount = param.detail.find((t) => t.payEnum === 3)?.amount ?? 0;
return amount > 0 ? amount + ' 元' : amount;
})(), // 超限价自费费用
PRESELFPAY_AMT: (() => {
const amount = param.detail.find((t) => t.payEnum === 4)?.amount ?? 0;
return amount > 0 ? amount + ' 元' : amount;
})(), // 先行自付金额
INSCP_SCP_AMT: (() => {
const amount = param.detail.find((t) => t.payEnum === 5)?.amount ?? 0;
return amount > 0 ? amount + ' 元' : amount;
})(), // 符合政策范围金额
ACT_PAY_DEDC: (() => {
const amount = param.detail.find((t) => t.payEnum === 6)?.amount ?? 0;
return amount > 0 ? amount + ' 元' : amount;
})(), // 实际支付起付线
POOL_PROP_SELFPAY: (() => {
const amount = param.detail.find((t) => t.payEnum === 7)?.amount ?? 0;
return amount > 0 ? amount + ' 元' : amount;
})(), // 基本医疗保险统筹基金支付比例
BALC: (() => {
const amount = param.detail.find((t) => t.payEnum === 8)?.amount ?? 0;
return amount > 0 ? amount + ' 元' : amount;
})(), // 余额
// 特殊支付方式
SELF_YB_ZH_PAY: (() => {
const amount = param.detail.find((t) => t.payEnum === 210000)?.amount ?? 0;
return amount > 0 ? amount + ' 元' : amount;
})(), // 个人医保账户支付
SELF_YB_ZH_GJ_VALUE: (() => {
const amount = param.detail.find((t) => t.payEnum === 210100)?.amount ?? 0;
return amount > 0 ? amount + ' 元' : amount;
})(), // 账户共济支付金额
SELF_CASH_PAY: (() => {
const amount = param.detail.find((t) => t.payEnum === 220000)?.amount ?? 0;
return amount > 0 ? amount + ' 元' : amount;
})(), // 个人现金支付金额
SELF_VX_PAY: (() => {
const amount = param.detail.find((t) => t.payEnum === 230000)?.amount ?? 0;
return amount > 0 ? amount + ' 元' : amount;
})(), // 微信支付金额
SELF_ALI_PAY: (() => {
const amount = param.detail.find((t) => t.payEnum === 240000)?.amount ?? 0;
return amount > 0 ? amount + ' 元' : amount;
})(), // 阿里支付金额
// 现金支付细分
SELF_CASH_VALUE: (() => {
const amount = param.detail.find((t) => t.payEnum === 220400)?.amount ?? 0;
return amount > 0 ? amount + ' 元' : amount;
})(), // 个人现金支付金额(现金)
SELF_CASH_VX_VALUE: (() => {
const amount = param.detail.find((t) => t.payEnum === 220100)?.amount ?? 0;
return amount > 0 ? amount + ' 元' : amount;
})(), // 个人现金支付金额(微信)
SELF_CASH_ALI_VALUE: (() => {
const amount = param.detail.find((t) => t.payEnum === 220200)?.amount ?? 0;
return amount > 0 ? amount + ' 元' : amount;
})(), // 个人现金支付金额(支付宝)
SELF_CASH_UNION_VALUE: (() => {
const amount = param.detail.find((t) => t.payEnum === 220300)?.amount ?? 0;
return amount > 0 ? amount + ' 元' : amount;
})(), // 个人现金支付金额(银联)
// 基金类型(扩展)
BIRTH_FUND: (() => {
const amount = param.detail.find((t) => t.payEnum === 510100)?.amount ?? 0;
return amount > 0 ? amount + ' 元' : amount;
})(), // 生育基金
RETIREE_MEDICAL: (() => {
const amount = param.detail.find((t) => t.payEnum === 340100)?.amount ?? 0;
return amount > 0 ? amount + ' 元' : amount;
})(), // 离休人员医疗保障基金
URBAN_BASIC_MEDICAL: (() => {
const amount = param.detail.find((t) => t.payEnum === 390100)?.amount ?? 0;
return amount > 0 ? amount + ' 元' : amount;
})(), // 城乡居民基本医疗保险基金
URBAN_SERIOUS_ILLNESS: (() => {
const amount = param.detail.find((t) => t.payEnum === 390200)?.amount ?? 0;
return amount > 0 ? amount + ' 元' : amount;
})(), // 城乡居民大病医疗保险基金
MEDICAL_ASSISTANCE: (() => {
const amount = param.detail.find((t) => t.payEnum === 610100)?.amount ?? 0;
return amount > 0 ? amount + ' 元' : amount;
})(), // 医疗救助基金
GOVERNMENT_SUBSIDY: (() => {
const amount = param.detail.find((t) => t.payEnum === 640100)?.amount ?? 0;
return amount > 0 ? amount + ' 元' : amount;
})(), // 政府兜底基金
ACCIDENT_INSURANCE: (() => {
const amount = param.detail.find((t) => t.payEnum === 390400)?.amount ?? 0;
return amount > 0 ? amount + ' 元' : amount;
})(), // 意外伤害基金
CARE_INSURANCE: (() => {
const amount = param.detail.find((t) => t.payEnum === 620100)?.amount ?? 0;
return amount > 0 ? amount + ' 元' : amount;
})(), // 照护保险基金
FINANCIAL_FUND: (() => {
const amount = param.detail.find((t) => t.payEnum === 360100)?.amount ?? 0;
return amount > 0 ? amount + ' 元' : amount;
})(), // 财政基金
HOSPITAL_ADVANCE: (() => {
const amount = param.detail.find((t) => t.payEnum === 999900)?.amount ?? 0;
return amount > 0 ? amount + ' 元' : amount;
})(), // 医院垫付
SUPPLEMENTARY_INSURANCE: (() => {
const amount = param.detail.find((t) => t.payEnum === 390300)?.amount ?? 0;
return amount > 0 ? amount + ' 元' : amount;
})(), // 城乡居民大病补充保险基金
HEALTHCARE_PREPAYMENT: (() => {
const amount = param.detail.find((t) => t.payEnum === 360300)?.amount ?? 0;
return amount > 0 ? amount + ' 元' : amount;
})(), // 保健预支基金
//微信刷卡支付
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 + ' 元';
})(),
Mr_QR_Code: param.regNo,
sex: props.patientInfo?.genderEnum_enumText || '',
age: props.patientInfo?.age || '',
personType: param.contractName,
fixmedinsName: param.fixmedinsName + '门诊收费明细',
//电子收据二维码
pictureUrl: param.pictureUrl || 'https://chinaebill.com/img/xiaochengxu.png',
// 添加本地患者信息,注意安全访问
name: props.patientInfo?.patientName || '',
gender: props.patientInfo?.genderEnum_enumText || '',
encounterBusNo: props.patientInfo?.encounterBusNo || '',
currentDate: currentDate.value,
// chargedItems: props.chargedItems,
// 优先使用选中行的金额字段值(从图片中获取)
totalAmount:
(param.selectedRow?.receivableAmount
? param.selectedRow.receivableAmount.toFixed(2)
: props.totalAmount.toFixed(2)) + ' 元',
displayAmount:
(param.selectedRow?.receivedAmount
? param.selectedRow.receivedAmount.toFixed(2)
: displayAmount.value) + ' 元',
returnedAmount: returnedAmount.value + ' 元',
userName: userStore.nickName,
},
],
};
// 使用printUtils进行打印
// 选择门诊收费打印模板并传递正确的数据格式
console.log('789797987897', printData.data[0]);
await printUtils.print(PRINT_TEMPLATE.OUTPATIENT_CHARGE, printData.data[0]);
console.log('打印成功');
} catch (error) {
console.error('打印失败:', error);
proxy.$modal.msgError('打印失败: ' + error.message);
}
>>>>>>> v1.3
}
const throttledGetList = debounce(submit, 300);
<<<<<<< HEAD
=======
function handleWxPay() {
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,
});
}
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,
});
}
>>>>>>> v1.3
function handleOpen() {
formData.totalAmount = props.totalAmount;
formData.selfPay[0].amount = props.totalAmount;
@@ -342,8 +786,11 @@ function handleOpen() {
async function submit() {
displayAmountTemp = displayAmount.value;
<<<<<<< HEAD
console.log(parseFloat(displayAmount.value), 'parseFloat(displayAmount.value)');
console.log(formData.totalAmount, 'formData.totalAmount');
=======
>>>>>>> v1.3
let amount = formData.selfPay
.reduce((sum, item) => {
@@ -366,12 +813,17 @@ async function submit() {
.then((res) => {
if (res.code == 200) {
getChargeInfo({ paymentId: props.paymentId }).then((res) => {
<<<<<<< HEAD
printReceipt(res.data);
=======
// 传递完整的选中数据信息到打印方法
printReceipt({ ...res.data, chargedItems: props.chargedItems });
>>>>>>> v1.3
});
formData.selfPay = [{ payEnum: 220100, amount: 0.0, payLevelEnum: 2 }];
emit('close', 'success', res.msg);
emit('refresh'); // 发送刷新事件给父组件
// 长春大学自动发耗材
// 长春市朝阳区中医院自动发耗材
if (userStore.fixmedinsCode == 'H22010200672' && props.consumablesIdList.length > 0) {
dispenseMedicalConsumables(props.consumablesIdList);
}
@@ -422,11 +874,19 @@ async function print() {
const currentDate = ref(new Date().toLocaleString());
const selfPayMethods = [
<<<<<<< HEAD
{ label: '现金', value: 220400 },
{ label: '微信', value: 220100 },
{ label: '支付宝', value: 220200 },
{ label: '银联', value: 220300 },
{ label: '优惠', value: 220500 },
=======
{ label: '现金', value: 220400, isWebPay: false },
{ label: '微信', value: 220100, isWebPay: true },
{ label: '支付宝', value: 220200, isWebPay: true },
{ label: '银联', value: 220300, isWebPay: true },
{ label: '优惠', value: 220500, isWebPay: false },
>>>>>>> v1.3
];
// 计算剩余可输入金额
@@ -459,8 +919,25 @@ function handleDiscountChange(value) {
}
// 检查支付方式是否已使用
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);
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 = () => {
@@ -478,8 +955,18 @@ const removePayment = (index) => {
formData.selfPay.splice(index, 1);
};
const clearAmount = (index) => {
// formData.selfPay[index].amount = 0;
const payTypeText = ref('微信');
const payTypePlaceholder = computed(() => {
if (payTypeText.value === '现金') {
return '请输入现金金额';
}
return payTypeText.value + '支付二维码';
});
const clearAmount = (index, value) => {
const selectedOption = selfPayMethods.find((item) => item.value === value);
if (selectedOption) {
payTypeText.value = selectedOption.label;
}
};
// 计算属性

View File

@@ -83,6 +83,7 @@
:disabled="buttonDisabled">
自费转医保
</el-button>
<<<<<<< HEAD
<el-button type="primary" @click="studentPayTosStudentSelf()" style="margin-left: 20px"
:disabled="buttonDisabled">
学生医保转学生自费
@@ -95,6 +96,38 @@
</div>
<el-table ref="chargeListRef" height="530" :data="chargeList" row-key="id"
@selection-change="handleSelectionChange" v-loading="chargeLoading" :span-method="objectSpanMethod" border>
=======
<el-button
type="primary"
@click="studentPayTosStudentSelf()"
style="margin-left: 20px"
:disabled="buttonDisabled"
>
学生医保转学生自费
</el-button>
<el-button
type="primary"
@click="studentSelfToStudentPay()"
style="margin-left: 20px"
:disabled="buttonDisabled"
>
学生自费转学生医保
</el-button>
<span style="float: right"
>合计金额{{ totalAmounts ? totalAmounts.toFixed(2) : 0 }}</span
>
</div>
<el-table
ref="chargeListRef"
height="530"
:data="chargeList"
row-key="id"
@selection-change="handleSelectionChange"
v-loading="chargeLoading"
:span-method="objectSpanMethod"
border
>
>>>>>>> v1.3
<el-table-column type="selection" :selectable="checkSelectable" width="55" />
<el-table-column label="单据号" align="center" prop="busNo" width="180" />
<el-table-column label="收费项目" align="center" prop="itemName" width="200" />
@@ -104,7 +137,20 @@
<el-table-column label="费用性质" align="center" prop="contractName" />
<el-table-column label="收费状态" align="center" prop="statusEnum_enumText" width="150">
<template #default="scope">
<<<<<<< HEAD
<el-tag :type="scope.row.statusEnum === 1 ? 'default' : 'success'" disable-transitions>
=======
<el-tag v-if="scope.row.statusEnum === 1" disable-transitions>
{{ scope.row.statusEnum_enumText }}
</el-tag>
<el-tag v-else-if="scope.row.statusEnum === 5" type="success" disable-transitions>
{{ scope.row.statusEnum_enumText }}
</el-tag>
<el-tag v-else-if="scope.row.statusEnum === 8" type="danger" disable-transitions>
{{ scope.row.statusEnum_enumText }}
</el-tag>
<el-tag v-else type="warning" disable-transitions>
>>>>>>> v1.3
{{ scope.row.statusEnum_enumText }}
</el-tag>
</template>
@@ -115,9 +161,26 @@
</template>
</el-table-column>
<el-table-column label="收款人" align="center" prop="entererId_dictText" />
<<<<<<< HEAD
<el-table-column label="操作" align="center" fixed="right" header-align="center" class-name="no-hover-column">
<template #default="scope">
<el-button :disabled="!scope.row.paymentId" link type="primary" @click="printCharge(scope.row)">
=======
<el-table-column
label="操作"
align="center"
fixed="right"
header-align="center"
class-name="no-hover-column"
>
<template #default="scope">
<el-button
:disabled="!scope.row.paymentId"
link
type="primary"
@click="printCharge(scope.row)"
>
>>>>>>> v1.3
打印
</el-button>
</template>
@@ -127,6 +190,7 @@
</div>
<ChargeDialog
ref="chargeDialogRef"
:open="openDialog"
@close="handleClose"
:category="patientInfo.categoryEnum"
@@ -158,7 +222,7 @@ import {
changeStudentPayTosStudentSelf,
changeStudentSelfToStudentPay,
} from './components/api';
import { invokeYbPlugin } from '@/api/public';
import { invokeYbPlugin5000, invokeYbPlugin5001 } from '@/api/public';
import ChargeDialog from './components/chargeDialog.vue';
import { formatDateStr } from '@/utils';
import useUserStore from '@/store/modules/user';
@@ -228,7 +292,10 @@ function handleTotalAmount() {
totalAmounts.value = chargeList.value.reduce((accumulator, currentRow) => {
return new Decimal(accumulator).add(currentRow.totalPrice.toFixed(2) || 0);
}, new Decimal(0));
<<<<<<< HEAD
=======
>>>>>>> v1.3
} else {
totalAmounts.value = selectedRows.value.reduce((accumulator, currentRow) => {
return new Decimal(accumulator).add(currentRow.totalPrice.toFixed(2) || 0);
@@ -298,7 +365,6 @@ const consumablesIdList = ref([]);
// 确认收费
function confirmCharge() {
let selectRows = chargeListRef.value.getSelectionRows();
console.log('selectRows:', selectRows);
if (selectRows.length == 0) {
proxy.$modal.msgWarning('请选择一条收费项目');
return;
@@ -315,6 +381,9 @@ function confirmCharge() {
});
chargedItems.value = selectRows;
// 将选中的行数据赋值给chargedItems
chargedItems.value = selectRows;
// totalAmount.value = selectRows.reduce((accumulator, currentRow) => {
// return accumulator + (currentRow.totalPrice || 0);
// }, 0);
@@ -364,7 +433,7 @@ async function handleReadCard(value) {
switch (value) {
case '01': // 电子凭证
// readCardLoading.value = true;
await invokeYbPlugin({
await invokeYbPlugin5000({
FunctionId: 3,
url: 'http://10.47.0.67:8089/localcfc/api/hsecfc/localQrCodeQuery',
orgId: 'H22010200672',
@@ -386,7 +455,7 @@ async function handleReadCard(value) {
readCardLoading.value = false;
});
cardInfo = JSON.parse(JSON.stringify(jsonResult));
let message = JSON.parse(cardInfo.message);
let message = JSON.parse(cardInfo.data);
userMessage = {
certType: '02', // 证件类型
certNo: message.data.idNo, // 身份证号
@@ -406,7 +475,7 @@ async function handleReadCard(value) {
case '03': // 社保卡
readCardLoading.value = true;
loadingText.value = '正在读取...';
await invokeYbPlugin(
await invokeYbPlugin5001(
JSON.stringify({
FunctionId: 1,
IP: 'ddjk.jlhs.gov.cn',
@@ -583,6 +652,22 @@ function objectSpanMethod({ row, column, rowIndex, columnIndex }) {
return [1, 1];
}
<<<<<<< HEAD
=======
// function printCharge(row) {
// // 打印功能实现
// let rows = [];
// chargeList.value.forEach((item, index) => {
// if (item.paymentId === row.paymentId) {
// rows.push(item);
// }
// });
// chargedItems.value = rows;
// getChargeInfo({ paymentId: row.paymentId }).then((res) => {
// proxy.$refs['chargeDialogRef'].printReceipt(res.data);
// });
// }
>>>>>>> v1.3
function printCharge(row) {
// 打印功能实现
let rows = [];
@@ -593,7 +678,41 @@ function printCharge(row) {
});
chargedItems.value = rows;
getChargeInfo({ paymentId: row.paymentId }).then((res) => {
<<<<<<< HEAD
proxy.$refs['chargeDialogRef'].printReceipt(res.data);
=======
// 设置实收金额
if (res.data && res.data.detail) {
const amountDetail = res.data.detail.find((item) => item.payEnum == 220000);
if (amountDetail) {
totalAmount.value = amountDetail.amount;
// 为合并的行设置金额相关字段值
rows.forEach((item) => {
if (item.actualPrice === undefined || item.actualPrice === null) {
item.actualPrice = 0;
}
if (item.discountAmount === undefined || item.discountAmount === null) {
item.discountAmount = 0;
}
if (item.discountRate === undefined || item.discountRate === null) {
item.discountRate = 100;
}
});
}
// 增强打印数据,包含选中行的完整信息
const enhancedPrintData = {
...res.data,
selectedRow: row, // 添加选中行的完整数据
chargedItems: rows, // 添加所有相关的收费项目
};
// 通知子组件更新内部状态
// 通过 nextTick 确保 DOM 更新后再调用打印
nextTick(() => {
proxy.$refs['chargeDialogRef'].printReceipt(enhancedPrintData);
});
}
>>>>>>> v1.3
});
}
</script>
@@ -605,4 +724,8 @@ function printCharge(row) {
:deep(.el-table__body) tr:hover td.no-hover-column {
background-color: inherit !important;
}
</style>
<<<<<<< HEAD
</style>
=======
</style>
>>>>>>> v1.3

View File

@@ -197,8 +197,15 @@ const emit = defineEmits(['close']);
function submit() {
console.log(props.chargeItemIds);
if (parseFloat(displayAmount.value) < formData.totalAmount) {
console.log(
displayAmount.value,
parseFloat(displayAmount.value),
formData.totalAmount,
formData,
'feeRefund'
);
//比较时,将金额都转换为两位小数的字符串再转换为浮点数,避免浮点数精度问题
if (parseFloat(displayAmount.value) < parseFloat(formData.totalAmount.toFixed(2))) {
proxy.$modal.msgError('请输入正确的金额');
return;
}
@@ -255,7 +262,7 @@ function submit() {
// returnedAmount: parseFloat(returnedAmount.value),
}).then((res) => {
if (res.code == 200) {
// 长春大学自动退耗材
// 长春市朝阳区中医院自动退耗材
emit('close', 'success');
}
@@ -457,4 +464,4 @@ const getFeeTypeText = computed(() => {
.amount-input .el-input__inner {
padding-right: 30px !important;
}
</style>
</style>

View File

@@ -139,16 +139,6 @@
prop="chargeStatus_enumText"
width="100"
/>
<!-- <el-table-column
label="发药/执行状态"
align="center"
prop="dispenseStatus_enumText"
width="130"
>
<template #default="scope">
{{ scope.row.dispenseStatus_enumText || scope.row.serviceStatus_enumText }}
</template>
</el-table-column> -->
<el-table-column label="数量" align="center" width="100">
<template #default="scope">
{{ scope.row.quantityValue + ' ' + scope.row.quantityUnit_dictText }}

View File

@@ -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>

View File

@@ -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

View File

@@ -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,
});

View File

@@ -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>

View File

@@ -43,6 +43,41 @@
</el-popover>
</el-form-item>
</el-col>
<<<<<<< HEAD
=======
<el-col :span="6" style="padding: 0">
<el-button type="primary" icon="Plus" @click="handleAddPatient" style="width: 65px">
新建
</el-button>
<el-button
type="primary"
plain
icon="Search"
@click="handleSearch"
style="width: 65px"
>
查询
</el-button>
<el-button type="primary" plain @click="handleReadCard('01')" style="width: 65px">
电子凭证
</el-button>
<el-button type="primary" plain @click="handleReadCard('02')" style="width: 65px">
身份证
</el-button>
<el-button type="primary" plain @click="handleReadCard('03')" style="width: 65px">
医保卡
</el-button>
<!-- <el-button
type="primary"
plain
@click="handleReadCard('99')"
style="width: 65px"
:disabled="true"
>
学生卡
</el-button> -->
</el-col>
>>>>>>> v1.3
<el-col :span="5">
<el-form-item label="姓名:" prop="name">
<el-input v-model="form.name" placeholder="姓名" :disabled="true" />
@@ -245,7 +280,10 @@
setchargeItem;
}
"
<<<<<<< HEAD
@clear="handleOrgClear"
=======
>>>>>>> v1.3
clearable
/>
</el-form-item>
@@ -516,6 +554,7 @@
<span>{{ parseTime(scope.row.registerTime) }}</span>
</template>
</el-table-column>
<<<<<<< HEAD
<!-- 退号记录相关列 -->
<el-table-column
v-if="queryType === 'returned'"
@@ -608,6 +647,35 @@
>
退号
</el-button>
=======
<el-table-column label="操作" align="center" key="registerTime" prop="registerTime" do>
<template #default="scope">
<!-- <el-tooltip
:content="
scope.row.statusEnum == 6
? '已退号'
: scope.row.statusEnum == 2
? '已接诊,不允许退号'
: ''
"
placement="top"
:disabled="scope.row.statusEnum != 6"
> -->
<div style="display: flex">
<el-button
link
type="primary"
@click="handleReturn(scope.row, 1)"
:disabled="scope.row.statusEnum == 6"
>
退号
</el-button>
<el-button link type="primary" @click="handleReturn(scope.row, 0)">
详情
</el-button>
</div>
<!-- </el-tooltip> -->
>>>>>>> v1.3
</template>
</el-table-column>
</el-table>
@@ -657,6 +725,7 @@
:patientInfo="patientInfo"
:paymentId="paymentId"
:chargeItemIds="chargeItemIdList"
<<<<<<< HEAD
:feeType="patientInfo.medfeePaymtdCode || ''"
:contractName="patientInfo.contractName || ''"
:medfee_paymtd_code="medfee_paymtd_code"
@@ -672,6 +741,9 @@
openReprintDialog = false;
}
"
=======
:eventType="eventType"
>>>>>>> v1.3
/>
</div>
</template>
@@ -691,8 +763,9 @@ import {
precharge,
cancelRegister,
gerPreInfo,
updatePatientPhone,
} from './components/outpatientregistration';
import { invokeYbPlugin } from '@/api/public';
import { invokeYbPlugin5000, invokeYbPlugin5001 } from '@/api/public';
import patientInfoDialog from './components/patientInfoDialog';
import PatientAddDialog from './components/patientAddDialog';
import patientList from './components/patientList';
@@ -703,6 +776,7 @@ import ReprintDialog from './components/reprintDialog.vue';
import { handleColor } from '@/utils/his';
import useUserStore from '@/store/modules/user';
import { formatDate, formatDateStr } from '@/utils/index';
<<<<<<< HEAD
import { getConfigKey } from '@/api/system/config';
const patientInfo = ref({});
@@ -715,6 +789,13 @@ const guardianAgeConfig = ref(null);
router.push('/system/basicmanage/patientmanagement');
};
=======
import { isValidCNPhoneNumber } from '../../../utils/validate';
import { ElMessage } from 'element-plus';
const patientInfo = ref({});
const eventType = ref(0);
>>>>>>> v1.3
const router = useRouter();
const { proxy } = getCurrentInstance();
const { sys_normal_disable, sys_user_sex, med_chrgitm_type,medfee_paymtd_code } = proxy.useDict(
@@ -765,9 +846,14 @@ const patientInfoList = ref(undefined);
// 费用性质
const contractList = ref(undefined);
// const locationOptions = ref(undefined); // 地点树选项
<<<<<<< HEAD
const doctorList = ref(undefined); // 医生选项(过滤后的)
const allDoctorList = ref(undefined); // 所有医生选项(用于过滤)
const healthcareList = ref(undefined); // 挂号项目选项
=======
const doctorList = ref(undefined); // 医生选项
const healthcareList = ref([]); // 挂号项目选项
>>>>>>> v1.3
const orgOptions = ref(undefined); // 科室选项
const readCardLoading = ref(false);
const transformedData = ref({});
@@ -801,11 +887,10 @@ const data = reactive({
serviceTypeId: [{ required: true, message: '挂号类型不能为空', trigger: 'blur' }],
organizationId: [{ required: true, message: '优先级不能为空', trigger: 'blur' }],
orgId: [{ required: true, message: '就诊科室不能为空', trigger: 'blur' }],
// practitionerId: [
// { required: true, message: "医生不能为空", trigger: "blur" },
// ],
practitionerId: [{ required: true, message: '医生不能为空', trigger: 'blur' }],
typeCode: [{ required: true, message: '账户类型不能为空', trigger: 'blur' }],
definitionId: [{ required: true, message: '费用定价不能为空', trigger: 'blur' }],
phone: [{ required: true, message: '联系电话不能为空', trigger: 'blur' }],
// totalPrice: [{ required: true, message: "总价不能为空", trigger: "blur" }],
},
});
@@ -932,10 +1017,10 @@ async function handleReadCard(value) {
// .getInfoByQrCodeAsync(
// )
await invokeYbPlugin({
await invokeYbPlugin5000({
FunctionId: 3,
url: 'http://10.47.0.67:8089/localcfc/api/hsecfc/localQrCodeQuery',
orgId: 'H22010200672',
orgId: 'H22010402403',
businessType: '01101',
operatorId: userStore.id.toString(),
operatorName: userStore.name,
@@ -952,7 +1037,7 @@ async function handleReadCard(value) {
readCardLoading.value = false;
});
cardInfo = JSON.parse(JSON.stringify(jsonResult));
let message = JSON.parse(cardInfo.message);
let message = JSON.parse(cardInfo.data);
userMessage = {
certType: '02', // 证件类型
certNo: message.data.idNo, // 身份证号
@@ -972,7 +1057,7 @@ async function handleReadCard(value) {
case '03': // 社保卡
readCardLoading.value = true;
loadingText.value = '正在读取...';
await invokeYbPlugin(
await invokeYbPlugin5001(
JSON.stringify({
FunctionId: 1,
IP: 'ddjk.jlhs.gov.cn',
@@ -1086,6 +1171,7 @@ function setchargeItem() {
healthcareData.length > 0 ? healthcareData[0].price + healthcareData[0].activityPrice : '';
form.value.definitionId = healthcareData.length > 0 ? healthcareData[0].definitionId : '';
}
<<<<<<< HEAD
}
/** 处理挂号类型变化 */
@@ -1109,6 +1195,8 @@ function handleOrgClear() {
if (allDoctorList.value) {
doctorList.value = allDoctorList.value;
}
=======
>>>>>>> v1.3
}
/** 查询患者信息 */
function getList() {
@@ -1386,13 +1474,42 @@ function reset() {
/** 新增按钮操作 */
function handleAdd() {
console.log('isValidCNPhoneNumber=======>', isValidCNPhoneNumber(form.value.phone));
transformedData.value = transformFormData(form.value);
console.log(transformedData, 'transformedData门诊挂号');
chargeItemIdList.value = [];
<<<<<<< HEAD
patientInfo.value.patientId = form.value.patientId;
patientInfo.value.medfeePaymtdCode = form.value.contractNo; // 设置费用性质
=======
// patientInfo.value.patientId = form.value.patientId;
patientInfo.value = {
patientId: form.value.patientId,
patientName: form.value.name,
genderEnum_enumText: form.value.genderEnum_enumText,
age: form.value.age,
contractName: form.value.contractNo
? contractList.value.find((item) => item.busNo === form.value.contractNo)?.contractName ||
'自费'
: '自费',
idCard: form.value.idCard,
phone: form.value.phone,
categoryEnum: form.value.categoryEnum || '门诊',
organizationName: form.value.locationId_dictText || '',
practitionerName: form.value.doctorName || '',
healthcareName: '', // 可根据实际情况补充
};
>>>>>>> v1.3
proxy.$refs['outpatientRegistrationRef'].validate((valid) => {
if (valid) {
if (!isValidCNPhoneNumber(patientInfo.value.phone)) {
ElMessage({
type: 'error',
message: '手机号格式不正确,请重新输入!',
});
return;
}
readCardLoading.value = true;
transformedData.value.busiCardInfo = userCardInfo.busiCardInfo;
transformedData.value.certType = userCardInfo.certType;
@@ -1401,13 +1518,20 @@ function handleAdd() {
addOutpatientRegistration(transformedData.value)
.then((res) => {
if (res.code == 200) {
<<<<<<< HEAD
console.log('挂号成功,返回数据:', res.data);
// 立即刷新列表,确保挂号信息显示在当日已挂号列表中
getList();
=======
console.log('78989798', 'res', res);
// proxy.$modal.msgSuccess('挂号成功');
>>>>>>> v1.3
chrgBchno.value = res.data.chrgBchno;
registerBusNo.value = res.data.busNo;
totalAmount.value = res.data.psnCashPay;
patientInfo.value.encounterId = res.data.encounterId || '';
patientInfo.value.busNo = res.data.busNo || '';
readCardLoading.value = false;
openDialog.value = true;
// chargeItemIdList.value = res.data;
@@ -1459,6 +1583,7 @@ function handleSearchPatient(value) {
patientSearchKey.value = value;
}
<<<<<<< HEAD
function getReturnTooltip(row) {
if (!row) {
return '';
@@ -1477,12 +1602,16 @@ function handleReturn(row) {
proxy.$modal.msgError('该患者医生已接诊,不能退号!');
return;
}
=======
function handleReturn(row, type = '1') {
>>>>>>> v1.3
openRefundDialog.value = true;
patientInfo.value.patientId = row.patientId;
patientInfo.value.encounterId = row.encounterId;
totalAmount.value = row.totalPrice;
chargeItemIdList.value = row.chargeItemIds.split(',');
paymentId.value = row.paymentId;
<<<<<<< HEAD
// 从挂号记录中获取正确的费用性质
patientInfo.value.medfeePaymtdCode = row.contractNo; // 使用挂号记录中的费用性质代码
patientInfo.value.contractName = row.contractName; // 保存费用性质名称用于显示
@@ -1500,6 +1629,10 @@ function handleReturn(row) {
};
console.log('退号费用性质:', row.contractNo, row.contractName);
=======
eventType.value = type;
console.log(paymentId.value);
>>>>>>> v1.3
}
function handleReturnRegister() {
@@ -1565,13 +1698,31 @@ function transformFormData(form) {
},
};
}
// 更新患者手机号
async function updatePhone() {
const params = {
id: patientInfo.value.patientId,
phone: patientInfo.value.phone,
};
console.log('params========>', JSON.stringify(params));
try {
await updatePatientPhone(params);
getList();
reset();
} catch (error) {
console.log(error);
}
}
function handleClose(value) {
openDialog.value = false;
if (value == 'success') {
proxy.$modal.msgSuccess('操作成功');
getList();
reset();
// 更新患者手机号
updatePhone();
// getList();
// reset();
// addOutpatientRegistration(transformedData.value).then((response) => {
// reset();
// proxy.$modal.msgSuccess('新增成功');

View File

@@ -0,0 +1,39 @@
import request from '@/utils/request';
import { dateEquals } from 'element-plus';
// 获取网银支付参数列表
export function getList (data) {
return request ({
url: '/three-part/pay/page',
method: 'get',
params:data,
});
}
export function getPayinfo (data) {
return request ({
url: '/three-part/pay/pay-query?paymentId='+data.paymentId,
method: 'get',
});
}
export function returnfee (data) {
return request ({
url: '/three-part/pay/return-bill?paymentId='+data.paymentId,
method: 'get',
});
}
export function returnFeednext (data) {
return request ({
url: '/three-part/pay/return-goods?paymentId='+data.paymentId,
method: 'get',
});
}
export function returnResult (data) {
return request ({
url: '/three-part/pay/return-query?id='+data.id,
method: 'get',
});
}

View File

@@ -0,0 +1,119 @@
<template>
<div class="app-continer">
<el-form :model="queryParams" ref="queryRef" :inline="true">
<el-form-item label="患者姓名" prop="patientName">
<el-input v-model="queryParams.searchKey" placeholder="请输入患者姓名" />
</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-table :data="recordList" v-loading="loading" border ref="tableRef">
<el-table-column label="患者姓名" align="center" prop="patientName" :show-overflow-tooltip="true" />
<el-table-column label="支付单号" align="center" prop="paymentBusNo" :show-overflow-tooltip="true" />
<el-table-column label="交易金额(元)" align="right" prop="txnAmt" header-align="center" width="100"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column label="交易类型" align="center" prop="tranType" :show-overflow-tooltip="true" />
<el-table-column label="支付方式" align="center" prop="payType" :show-overflow-tooltip="true" />
<el-table-column label="交易时间" align="center" prop="txnTime" :show-overflow-tooltip="true">
<template #default="scope">
<span>{{ parseTime(scope.row.txnTime) }}</span>
</template>
</el-table-column>
<el-table-column label="原交易类型" align="center" prop="orgTranType" :show-overflow-tooltip="true" />
<el-table-column label="原交易类型" align="center" prop="orgTranType" :show-overflow-tooltip="true" />
<el-table-column label="第三方优惠说明" align="center" prop="otherMsg" :show-overflow-tooltip="true" />
<el-table-column label="错误信息" align="center" prop="errMsg" :show-overflow-tooltip="true" />
<el-table-column label="查询结果" align="center" prop="queryResult" :show-overflow-tooltip="true" />
<el-table-column label="查询结果说明" align="center" prop="queryResultMsg" :show-overflow-tooltip="true" />
<el-table-column label="操作" align="center" prop="paymentEnum_enumText" width="340">
<template #default="scope">
<el-button type="primary" link :disabled="!scope.row.paymentId"
@click="getPayInfo(scope.row.paymentId)">支付结果查询</el-button>
<el-button type="warning" link :disabled="!scope.row.paymentId"
@click="returnFee(scope.row.paymentId)">退费</el-button>
<el-button type="danger" link auto-insert-space :disabled="!scope.row.paymentId"
@click="returnFeeNext(scope.row.paymentId)">隔天退费</el-button>
<el-button type="success" link @click="returnFeeResultQuery(scope.row.id)">退费结果查询</el-button>
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNo" v-model:limit="queryParams.pageSize"
@pagination="getLists" />
</div>
</template>
<script setup name="ClinicRecord">
const { proxy } = getCurrentInstance();
import { getList, getPayinfo, returnfee, returnFeednext, returnResult } from './components/api.js';
const total = ref(0);
const queryParams = ref({
pageNo: 1,
pageSize: 100,
searchKey: '',
});
const recordList = ref([]);
const loading = ref(false);
const getPayInfo = (paymentId) => {
console
getPayinfo({ paymentId }).then((res) => {
proxy.$message.success('支付结果查询成功');
console.log(res);
});
};
const returnFee = (paymentId) => {
returnfee({ paymentId }).then((res) => {
proxy.$message.success('退费成功');
console.log(res);
});
};
const returnFeeNext = (paymentId) => {
returnFeednext({ paymentId }).then((res) => {
proxy.$message.success('隔天退费成功');
console.log(res);
});
};
const returnFeeResultQuery = (id) => {
returnResult({ id }).then((res) => {
proxy.$message.success(res.data);
console.log(res);
});
};
const handleQuery = () => {
//queryParams.value.pageNum = 1;
getList(queryParams.value);
};
const resetQuery = () => {
proxy.resetForm('queryRef');
handleQuery();
};
const getLists = async () => {
loading.value = true;
getList(queryParams.value).then((res) => {
loading.value = false;
recordList.value = res.data.records;
total.value = res.data.total;
});
};
getLists();
</script>
<style scoped>
.app-continer {
padding: 20px;
}
.el-dialog {
height: 90vh !important;
}
.dialog-footer {
text-align: right;
}
.el-textarea__inner {
resize: none;
}
</style>