提交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

@@ -18,24 +18,31 @@
<el-text size="large">
<!-- <el-form-item label="费用性质:" prop="currentDate"> {{ '自费' }} </el-form-item> -->
</el-text>
<!-- 支付方式选择 -->
<div class="payment-method-container">
<el-form-item label="支付方式:">
<div class="payment-type-list">
<div
class="payment-type-item"
:class="{ active: currentPayType === item.value }"
v-for="item in payTypeOptions"
:key="item.value"
@click="selectPayType(item.value)"
>
<svg-icon
:icon-class="item.iconClass || item.value"
class="payment-icon"
:style="{ color: currentPayType === item.value ? '#13C0B3' : '#666666' }"
/>
<span class="payment-label">{{ item.label }}</span>
</div>
</div>
</el-form-item>
</div>
<!-- 自费支付 -->
<div class="payment-container">
<!-- <el-form-item label="支付方式:" prop="payEnum" style="display: flex">
<el-select
v-model="form.payEnum"
placeholder="选择支付方式"
style="width: 160px"
@change="clearAmount(index)"
>
<el-option
v-for="payEnum in props.payLists"
:key="payEnum.value"
:label="payEnum.label"
:value="payEnum.value"
:disabled="isMethodDisabled(payEnum.value)"
/>
</el-select>
</el-form-item> -->
<el-form-item label="支付金额:" prop="amount">
<div class="suffix-wrapper">
<el-input-number
@@ -51,6 +58,7 @@
</div>
</el-form-item>
</div>
<!-- 金额汇总 -->
<div class="summary">
<el-space :size="30">
@@ -65,6 +73,7 @@
</div>
</el-form>
</div>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="submit"> </el-button>
@@ -73,11 +82,12 @@
</template>
</el-dialog>
</template>
<script setup>
// 原有逻辑代码保持不变
import { savePayment } from './api';
import { computed, watch, reactive, ref, getCurrentInstance, nextTick } from 'vue';
import { ElMessage } from 'element-plus';
const props = defineProps({
open: {
type: Boolean,
@@ -99,58 +109,92 @@ const props = defineProps({
const { proxy } = getCurrentInstance();
const data = reactive({
form: {},
rules: {},
form: {
amount: undefined,
displayAmount: 0,
payLevelEnum: undefined,
},
rules: {
amount: [
{ required: true, message: '请输入支付金额', trigger: 'blur' },
{ type: 'number', min: 0.01, message: '支付金额必须大于0', trigger: 'blur' },
],
},
});
const { queryParams, form, rules } = toRefs(data);
const { form, rules } = toRefs(data);
// 支付方式选项
const payTypeOptions = [
{ label: '现金', value: 220400 },
{ label: '微信', value: 220100 },
{ label: '支付宝', value: 220200 },
{ label: '银联', value: 220300 },
];
// 定义当前选中的支付方式,默认选中现金
const currentPayType = ref(220400);
// 选择支付方式方法
const selectPayType = (value) => {
currentPayType.value = value;
form.value.payLevelEnum = value;
};
const emit = defineEmits(['close']);
const payMethods = ref(undefined);
async function submit() {
form.value.patientId = props.patientInfo.patientId;
form.value.encounterId = props.patientInfo.encounterId;
form.value.accountId = props.patientInfo.accountId;
console.log(props.patientInfo, 'patientInfo');
savePayment(form.value).then((res) => {
// 表单验证
if (!form.value.amount || form.value.amount <= 0) {
ElMessage.error('请输入有效的支付金额');
return;
}
if (!form.value.payLevelEnum) {
ElMessage.error('请选择支付方式');
return;
}
form.value.patientId = props.patientInfo?.patientId;
form.value.encounterId = props.patientInfo?.encounterId;
form.value.accountId = props.patientInfo?.accountId;
console.log('表单数据:', form.value);
try {
const res = await savePayment(form.value);
if (res.code == 200) {
ElMessage.success('收费成功');
reset();
emit('close', 'success');
emit('close', {
status: 'success',
busNo: props.patientInfo?.busNo,
});
} else {
ElMessage.error(res.msg || '收费失败');
}
});
} catch (error) {
ElMessage.error('网络错误,请重试');
console.error(error);
}
}
/** 重置操作表单 */
function reset() {
form.value = {
patientId: undefined,
encounterId: undefined,
displayAmount: 0,
payEnum: undefined,
amount: undefined,
};
proxy.resetForm('chargeDialogRef');
form.value.amount = undefined;
form.value.displayAmount = 0;
form.value.payLevelEnum = undefined;
currentPayType.value = 220400; // 重置选中状态为现金
if (proxy && proxy.resetForm) {
proxy.resetForm('chargeDialogRef');
}
}
// 检查支付方式是否已使用
const isMethodDisabled = (payEnum) => {
return null;
};
/**
* 处理金额变化事件
*
* 当表单中的金额发生变化时,将显示金额设置为实际金额
*/
function handleAmountChange() {
form.value.displayAmount = form.value.amount;
form.value.displayAmount = form.value.amount || 0;
}
/**
* 变化支付方式事件
*
*/
function clearAmount() {
form.value.amount = 0;
}
@@ -160,12 +204,24 @@ function close() {
emit('close');
}
// 监听总金额变化,如果有默认值则自动填充
watch(
() => props.totalAmount,
(newVal) => {
if (newVal && newVal > 0) {
form.value.amount = newVal;
form.value.displayAmount = newVal;
}
},
{ immediate: true }
);
</script>
<style scoped>
:deep(.pagination-container .el-pagination) {
right: 20px !important;
}
.charge-container {
max-width: 600px;
margin: 20px auto;
@@ -188,10 +244,49 @@ function close() {
font-weight: bold;
}
.payment-type {
/* 支付方式容器样式 */
.payment-method-container {
margin: 15px 0;
}
.payment-type-list {
display: flex;
gap: 16px;
flex-wrap: wrap;
}
.payment-type-item {
display: flex;
align-items: center;
gap: 8px;
padding: 12px 20px;
background-color: #f5f7fa;
border-radius: 8px;
cursor: pointer;
transition: all 0.3s ease;
border: 2px solid transparent;
}
.payment-type-item:hover {
background-color: #eef2f7;
}
.payment-type-item.active {
background-color: #e8f8f5;
border-color: #13c0b3;
color: #13c0b3;
}
.payment-icon {
width: 20px;
height: 20px;
transition: color 0.3s ease;
}
.payment-label {
font-size: 14px;
}
.payment-container {
margin: 15px 0;
}
@@ -248,7 +343,7 @@ function close() {
.suffix-wrapper {
position: relative;
display: inline-block; /* 保持行内布局 */
display: inline-block;
}
.suffix-text {
@@ -257,10 +352,9 @@ function close() {
top: 50%;
transform: translateY(-50%);
color: #999;
pointer-events: none; /* 避免点击干扰 */
pointer-events: none;
}
/* 调整输入框内边距 */
.amount-input .el-input__inner {
padding-right: 30px !important;
}

View File

@@ -47,7 +47,7 @@
<el-table-column label="操作" width="80" align="center">
<template #default="scope">
<el-button link type="primary" size="small" @click.stop="viewPatient(scope.row)">
查看
选择
</el-button>
</template>
</el-table-column>
@@ -66,6 +66,7 @@
<script setup>
import { reactive } from 'vue';
import { getWardList } from '../../../../drug/inpatientMedicationDispensing/components/api';
import { getDepositInfo } from './api';
// Props
@@ -78,10 +79,6 @@ const props = defineProps({
type: Boolean,
default: false,
},
wardListOptions: {
type: Array,
default: () => [],
},
});
const data = reactive({
@@ -97,7 +94,7 @@ const data = reactive({
const { queryParams, form, rules } = toRefs(data);
// Emits
const emits = defineEmits(['confirm', 'cancel', 'patientSelected']);
const emits = defineEmits(['confirm', 'cancel', 'patientSelected', 'triggerSearch']);
const total = ref(0);
// // v-model for drawer visibility
// const drawerVisible = defineModel('drawerVisible', {
@@ -156,6 +153,7 @@ function viewPatient(patient) {
console.log('View patient:', patient);
selectedPatient.value = patient; // 选中患者
emits('patientSelected', selectedPatient.value); // 发送选中的患者数据
emits('triggerSearch', patient.busNo); // 触发预交金查询事件
drawerVisible.value = false;
reset(); // 重置筛选条件
// 可以在这里做一些操作比如高亮行或者如果“查看”是选择并关闭则触发confirm
@@ -187,7 +185,20 @@ function show() {
console.log('show', props);
wardListOptions.value = props.wardListOptions;
drawerVisible.value = props.drawerVisible;
getList();
getWardList()
.then((res) => {
if (res.length > 0) {
wardListOptions.value = res.map((ward) => ({
label: ward.name,
value: ward.id,
}));
}
getList();
})
.catch((error) => {
console.error('获取病区列表失败:', error);
getList();
});
}
/**
@@ -195,8 +206,8 @@ function show() {
*/
function getList() {
console.log('queryParams', queryParams.value);
getDepositInfo().then((res) => {
patientData.value = res.data.records;
getDepositInfo(queryParams.value).then((res) => {
patientData.value = res.data?.records || [];
total.value = res.data.total;
});
}

View File

@@ -118,7 +118,10 @@ async function submit() {
refund(form.value).then((res) => {
if (res.code == 200) {
reset();
emit('close', 'success');
emit('close', {
status: 'success',
busNo: props.patientInfo?.busNo,
});
}
});
}

View File

@@ -139,6 +139,7 @@
ref="showPatientRef"
:wardListOptions="wardListOptions"
@patientSelected="handlePatientSelected"
@triggerSearch="handleTriggerSearch"
/>
<ChargeDialog
ref="chargeListRef"
@@ -178,7 +179,6 @@ const queryParams = ref({
pageNo: 1,
pageSize: 10,
searchKey: undefined, // 供应商名称
searchKey: 'ZY202507310001',
});
const tableRowClassName = ({ row, rowIndex }) => {
if (row.amount < 0) {
@@ -201,6 +201,7 @@ function getPatientInfo() {
}
console.log(queryParams.value, 'queryParams.value');
getDepositInfo({ busNo: queryParams.value.searchKey }).then((res) => {
queryParams.value.searchKey = '';
if (res.code == 200 && res.data.records[0].encounterId) {
patientInfo.value = res.data.records[0];
getDepositInfoPage({ encounterId: res.data.records[0].encounterId }).then((res) => {
@@ -240,12 +241,12 @@ function refund() {
/** 选择病人 */
function handlePatientSelected(row) {
console.log(row, 'rowwwwwwwwhandlePatientSelected');
queryParams.value.searchKey = row.admissionNo;
// console.log(row, 'rowwwwwwwwhandlePatientSelected');
// queryParams.value.searchKey = row.admissionNo;
patientInfo.value = row;
nextTick(() => {
getPatientInfo();
});
// nextTick(() => {
// getPatientInfo();
// });
}
/** 重置操作表单 */
function reset() {
@@ -286,14 +287,19 @@ function formatValue(value) {
*
* @returns {void} 无返回值
*/
function handleClose(str) {
function handleClose(data) {
openDialog.value = false;
openRefundDialog.value = false;
if (str === 'success') {
if (data?.status === 'success' && data?.busNo) {
queryParams.value.searchKey = data.busNo;
getPatientInfo();
proxy.$modal.msgSuccess('操作成功!');
}
}
//在院患者查询
function handleTriggerSearch(busNo) {
queryParams.value.searchKey = busNo; // 将选中患者的住院号赋值给搜索参数
getPatientInfo(); // 调用现有查询方法
}
</script>
<style lang="scss" scoped>

View File

@@ -1,100 +1,166 @@
import request from '@/utils/request'
import request from '@/utils/request';
/**
* 收费患者列表
*/
export function getList(queryParams) {
return request({
url: '/charge-manage/inpa-charge/encounter-patient-page',
method: 'get',
params: queryParams
})
return request({
url: '/charge-manage/inpa-charge/encounter-patient-page',
method: 'get',
params: queryParams,
});
}
/**
* 收费患者列表 新
*/
export function getList1(queryParams) {
return request({
url: '/charge-manage/inpatient-charge/encounter-patient-page',
method: 'get',
params: queryParams,
});
}
/**
* 患者处方列表
*/
export function getChargeList(row) {
return request({
url: `/charge-manage/inpa-charge/patient-prescription?encounterId=${row.encounterId}&startTime=${row.startTime}&endTime=${row.endTime}`,
method: 'get',
})
export function getChargeList(encounterId) {
return request({
url: '/charge-manage/inpatient-charge/patient-prescription?encounterId=' + encounterId,
method: 'get',
});
}
/**
* 医保转自费
*/
export function changeToSelfPay(encounterId) {
return request({
url: '/charge-manage/inpa-charge/self-pay?encounterId=' + encounterId,
method: 'put',
})
return request({
url: '/charge-manage/inpatient-charge/self-pay?encounterId=' + encounterId,
method: 'put',
});
}
/**
* 自费转医保
*/
export function changeToMedicalInsurance(encounterId) {
return request({
url: '/charge-manage/inpa-charge/medical-insurance?encounterId=' + encounterId,
method: 'put',
})
return request({
url: '/charge-manage/charge/medical-insurance?encounterId=' + encounterId,
method: 'put',
});
}
/**
*
* 学生医保转学生自
*/
export function changeStudentPayTosStudentSelf(encounterId) {
return request({
url: '/charge-manage/charge/student-self-pay?encounterId=' + encounterId,
method: 'put',
});
}
/**
* 学生自费转学生医保
*/
export function changeStudentSelfToStudentPay(encounterId) {
return request({
url: '/charge-manage/charge/student-yb-pay?encounterId=' + encounterId,
method: 'put',
});
}
/**
* 住院结算
*/
export function savePayment(data) {
return request({
url: '/payment/payment/inpa-pay',
method: 'post',
data: data
})
return request({
url: '/payment/payment/inpa-pay',
method: 'post',
data: data,
});
}
/**
* 初始化
*/
export function init() {
return request({
url: '/charge-manage/charge/init',
method: 'get',
})
return request({
url: '/charge-manage/charge/init',
method: 'get',
});
}
export function init1() {
return request({
url: '/charge-manage/inpatient-charge/init',
method: 'get',
});
}
/**
* 收费预结算
* 住院预结算
*/
export function precharge(data) {
return request({
url: '/payment/payment/inpa-pre-pay',
method: 'post',
data: data
})
return request({
url: '/payment/payment/inpa-pre-pay',
method: 'post',
data: data,
});
}
/**
* 取消预结算
*/
export function unprecharge(data) {
return request({
url: '/payment/payment/unprecharge',
method: 'post',
params: data
})
return request({
url: '/payment/payment/inpa-un-pay',
method: 'post',
params: data,
});
}
/**
* 发耗材
*/
export function dispenseMedicalConsumables(data) {
return request({
url: '/pharmacy-manage/medical-consumables-dispense/consumables-dispense',
method: 'put',
data: data
})
return request({
url: '/pharmacy-manage/device-dispense/consumables-dispense',
method: 'put',
data: data,
});
}
/**
* 补打小票
*/
export function getChargeInfo(param) {
return request({
url: '/payment/bill/getDetail',
method: 'get',
params: param,
});
}
/**
* 微信支付
*/
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: 'post',
data: data,
});
}

View File

@@ -1,10 +1,11 @@
<template>
<el-dialog
:title="props.paymentEnum == 1 ? '确认退费' : '确认收费'"
title="确认收费"
v-model="props.open"
width="700px"
append-to-body
destroy-on-close
@open="handleOpen"
@close="close"
>
<div v-loading="dialogLoading">
@@ -18,47 +19,60 @@
{{ props.totalAmount.toFixed(2) + ' 元' }}
</el-text>
</div>
<div class="amount-row">
<el-text size="large">折扣金额</el-text>
<el-text size="large" type="warning" class="amount">
{{ discountAmount.toFixed(2) + ' 元' }}
</el-text>
</div>
<!-- 自费支付 -->
<div class="payment-container">
<div v-for="(item, index) in formData.selfPay" :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)"
<template v-for="(item, index) in formData.selfPay" :key="index">
<div v-show="item.payEnum != 220500" class="payment-item">
<span>支付方式</span>
<img
v-if="item.payEnum == 220100 || item.payEnum == 220200"
:src="imgs[item.payEnum == 220100 ? 0 : 1]"
style="width: 20px; height: 20px"
/>
</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"
<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"
/>
<span class="suffix-text"></span>
</div>
<el-button
type="danger"
circle
:icon="Delete"
@click="removePayment(index)"
v-if="index > 0"
/>
</div>
</template>
<div class="add-payment">
<el-button
type="primary"
@@ -72,6 +86,29 @@
金额已满足应收不可继续添加
</el-text>
</div>
<div style="margin-top: 10px" v-if="userStore.hospitalName == '长春市朝阳区中医院'">
<span>折扣</span>
<el-radio-group v-model="discountRadio" @change="handleDiscountChange">
<el-radio-button
v-for="item in charge_discount"
:key="item.value"
link
:label="item.label"
:value="item.value"
/>
</el-radio-group>
</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>
<el-table :data="props.details" max-height="200" border>
@@ -93,7 +130,7 @@
<div class="summary">
<el-space :size="30">
<div class="summary-item">
<el-text type="info">{{ props.paymentEnum == 1 ? '退费合计:' : '收费合计:' }}</el-text>
<el-text type="info">实收合计</el-text>
<el-text type="success">{{ displayAmount + ' 元' }}</el-text>
</div>
<div class="summary-item">
@@ -105,9 +142,10 @@
</div>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="throttledGetList" :disabled="dialogLoading"
> </el-button
>
<el-button type="primary" @click="throttledGetList" :disabled="dialogLoading">
</el-button>
<!-- <el-button type="primary" @click="print()" :disabled="dialogLoading"> </el-button> -->
<el-button @click="close" :disabled="dialogLoading"> </el-button>
</div>
</template>
@@ -115,12 +153,24 @@
</template>
<script setup>
import { savePayment, unprecharge, dispenseMedicalConsumables } from './api';
import {
savePayment,
unprecharge,
dispenseMedicalConsumables,
wxPay,
WxPayResult,
getChargeInfo,
} from './api';
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 image1 from '../../../../../assets/images/weixinzhifu.png';
import image2 from '../../../../../assets/images/zhifubaozhifu.png';
const imgs = ref([image1, image2]);
const props = defineProps({
open: {
type: Boolean,
@@ -144,36 +194,43 @@ 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,
},
paymentEnum: {
type: String,
chargedItems: {
type: Array,
default: () => [],
},
newId: {
type: String,
default: '',
},
oldId: {
type: String,
}
default: '',
},
});
const { proxy } = getCurrentInstance();
const userStore = useUserStore();
const { charge_discount } = proxy.useDict('charge_discount');
const userStore = useUserStore();
const discountRadio = ref();
const discountAmount = ref(0);
const txtCode = ref('');
const formData = reactive({
totalAmount: 0,
selfPay: [{ payEnum: 220100, amount: 0.0, payLevelEnum: 2 }],
@@ -195,154 +252,186 @@ watch(
);
const emit = defineEmits(['close']);
async function printReceipt(param) {
console.log(param, 'param');
console.log(props.patientInfo, 'props.patientInfo');
let displayAmountTemp = 0;
// 打印小票
function printReceipt(param) {
let total = 0;
props.chargedItems.forEach((item) => {
total += item.totalPrice || 0;
});
// 构造一个新的对象,添加头 "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, // 其他(如医院负担金额
YB_FUND_PAY:
param.detail?.find((t) => t.payEnum === 100000)?.amount.toFixed(2) + ' 元' ?? 0, // 基金支付总
SELF_PAY: param.detail?.find((t) => t.payEnum === 200000)?.amount.toFixed(2) + ' 元' ?? 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.toFixed(2) + ' 元' ?? 0, // 基本医保统筹基金支出
YB_BC_FUND_AMOUNT:
param.detail?.find((t) => t.payEnum === 120000)?.amount.toFixed(2) + ' 元' ?? 0, // 补充医疗保险基金支出
YB_JZ_FUND_AMOUNT:
param.detail?.find((t) => t.payEnum === 130000)?.amount.toFixed(2) + ' 元' ?? 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.toFixed(2) + ' 元' ?? 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.toFixed(2) + ' 元' ?? 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.toFixed(2) + ' 元' ?? 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_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, // 个人现金支付金额(现金)
// 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, // 个人现金支付金额(银联)
// 基金类型(扩展)
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, // 保健预支基金
// 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 + '门诊收费明细',
name: props.patientInfo.patientName, // 姓名
gender: props.patientInfo.genderEnum_enumText, // 性别
age: props.patientInfo.age, // 年龄
encounterBusNo: props.patientInfo.encounterBusNo, // 病例号
currentDate: currentDate.value, // 收费日期
chargedItems: props.chargedItems, // 收费项目
totalAmount: props.totalAmount.toFixed(2) + ' 元', // 应收金额
itemTotalAmount: total.toFixed(2) + ' 元', // 应收金额
displayAmount: displayAmountTemp + ' 元', // 实收金额
returnedAmount: returnedAmount.value + ' 元', // 应找零
userName: userStore.nickName,
},
],
// feeDetial: param.detail, //收费项目,后端还未返回
};
// 将对象转换为 JSON 字符串
let jsonString = JSON.stringify(result, null, 2);
console.log(jsonString, 'jsonString');
await CefSharp.BindObjectAsync('boundAsync');
await boundAsync.printReport(
'门诊收费明细单.grf',
jsonString
)
.then((response) => {
//返回结果是jsonString可判断其调用是否成功
console.log(response, 'response');
var res = JSON.parse(response);
if (!res.IsSuccess) {
proxy.$modal.msgError('调用打印插件失败:' + res.ErrorMessage);
}
})
.catch((error) => {
proxy.$modal.msgError('调用打印插件失败:' + error);
});
const printElements = templateJson;
var hiprintTemplate = new hiprint.PrintTemplate({ template: printElements }); // 定义模板
hiprintTemplate.print2(result.data[0], {
printer: 'xp',
title: '门诊收费结算单',
});
}
const throttledGetList = debounce(submit, 300);
async function submit() {
console.log(parseFloat(displayAmount.value), 'parseFloat(displayAmount.value)');
console.log(formData.totalAmount, 'formData.totalAmount');
if (parseFloat(displayAmount.value) < formData.totalAmount.toFixed(2)) {
proxy.$modal.msgError('请输入正确的结算金额');
return;
}
// if(chrome.webview === undefined) {
// alert('当前版本不支持银联支付');
// }
// else {
// try {
// let jsonResult = await window.chrome.webview.hostObjects.CSharpAccessor.ReadCardAsync();
// let cardInfo = JSON.parse(jsonResult);
// console.log(cardInfo.CardType);
// } catch (error) {
// console.error('调用失败:', error);
// }
// }
dialogLoading.value = true;
savePayment({
function handleWxPay() {
wxPay({
txtCode: txtCode.value,
chargeItemIds: props.chargeItemIds,
encounterId: props.patientInfo.encounterId,
id: props.paymentId,
oldId: props.oldId,
newId: props.newId,
chargeItemIds: props.chargeItemIds,
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,
});
}
function handleOpen() {
formData.totalAmount = props.totalAmount;
formData.selfPay[0].amount = props.totalAmount;
}
async function submit() {
displayAmountTemp = displayAmount.value;
let amount = formData.selfPay
.reduce((sum, item) => {
return sum + (Number(item.amount) || 0);
}, 0)
.toFixed(2);
if (parseFloat(amount) < formData.totalAmount.toFixed(2)) {
proxy.$modal.msgError('请输入正确的结算金额');
return;
}
dialogLoading.value = true;
console.log(props.newId, props.oldId);
savePayment({
chargeItemIds: props.chargeItemIds,
encounterId: props.patientInfo.encounterId,
id: props.paymentId,
paymentDetails: formData.selfPay,
ybMdtrtCertType: props.userCardInfo.psnCertType,
busiCardInfo: props.userCardInfo.busiCardInfo,
newId: props.newId,
oldId: props.oldId,
})
.then((res) => {
if (res.code == 200) {
printReceipt(res.data);
(formData.selfPay = [{ payEnum: 220100, amount: 0.0, payLevelEnum: 2 }]),
emit('close', 'success', res.msg);
// 长春大学自动发耗材
getChargeInfo({ paymentId: props.paymentId }).then((res) => {
// printReceipt(res.data);
});
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);
}
@@ -353,13 +442,51 @@ async function submit() {
});
}
/** 打印收费结算单 */
async function print() {
console.log('patientInfo', props.patientInfo);
console.log('category', props.category);
console.log('totalAmount', props.totalAmount);
console.log('chargeItemIds', props.chargeItemIds);
console.log('consumablesIdList', props.consumablesIdList);
console.log('userCardInfo', props.userCardInfo);
console.log('paymentId', props.paymentId);
console.log('details', props.details);
console.log('chargedItems', props.chargedItems);
const result = {
data: [
{
name: props.patientInfo.patientName, // 姓名
gender: props.patientInfo.genderEnum_enumText, // 性别
age: props.patientInfo.age, // 年龄
encounterBusNo: props.patientInfo.encounterBusNo, // 病例号
currentDate: currentDate.value, // 收费日期
chargedItems: props.chargedItems, // 收费项目
totalAmount: props.totalAmount.toFixed(2) + ' 元', // 应收金额
displayAmount: displayAmount.value + ' 元', // 实收金额
returnedAmount: returnedAmount.value + ' 元', // 应找零
},
],
};
console.log(result, '==result.data==');
const printElements = templateJson;
var hiprintTemplate = new hiprint.PrintTemplate({ template: printElements }); // 定义模板
const printerList = hiprintTemplate.getPrinterList();
console.log(hiprintTemplate, '打印机列表');
hiprintTemplate.print2(result.data[0], {
title: '门诊收费结算单',
});
}
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 },
{ label: '优惠', value: 220500, isWebPay: false },
];
// 计算剩余可输入金额
@@ -381,9 +508,36 @@ const getMax = (index) => {
return formData.totalAmount - otherSum;
};
// 折扣计算
function handleDiscountChange(value) {
let amount = props.totalAmount * Number(value);
discountAmount.value = props.totalAmount - amount;
formData.selfPay = [
{ payEnum: 220100, amount: amount, payLevelEnum: 2 },
{ payEnum: 220500, amount: discountAmount.value, payLevelEnum: 2 },
];
}
// 检查支付方式是否已使用
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 = () => {
@@ -401,15 +555,31 @@ 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;
}
};
// 计算属性
const displayAmount = computed(() => {
return formData.selfPay.reduce((sum, item) => sum + (Number(item.amount) || 0), 0).toFixed(2);
return formData.selfPay
.reduce((sum, item) => {
if (item.payEnum !== 220500) {
return sum + (Number(item.amount) || 0);
}
return sum;
}, 0)
.toFixed(2);
});
const returnedAmount = computed(() => {
const display = parseFloat(displayAmount.value);
if (isNaN(display) || display <= 0) {
@@ -427,8 +597,25 @@ function close() {
// proxy.$modal.msgError(res.message);
// }
// });
txtCode.value = '';
formData.totalAmount = 0;
formData.selfPay = [{ payEnum: 220100, amount: 0.0, payLevelEnum: 2 }];
formData.medicalInsurance = {
account: '',
poolPay: 0,
personalPay: 0,
};
// 重置折扣相关状态
discountRadio.value = undefined;
discountAmount.value = 0;
emit('close');
}
defineExpose({
printReceipt,
});
</script>
<style scoped>

View File

@@ -0,0 +1,433 @@
{
"panels": [
{
"index": 0,
"name": 1,
"paperType": "自定义",
"height": 160,
"width": 80,
"paperHeader": 0,
"paperFooter": 450.7086614173229,
"paperNumberDisabled": true,
"paperNumberContinue": true,
"expandCss": "",
"overPrintOptions": {
"content": "",
"opacity": 0.7,
"type": 1
},
"watermarkOptions": {
"content": "",
"fillStyle": "rgba(184, 184, 184, 0.3)",
"fontSize": "36px",
"rotate": 25,
"width": 413,
"height": 310,
"timestamp": false,
"format": "YYYY-MM-DD HH:mm"
},
"panelLayoutOptions": {
"layoutType": "column",
"layoutRowGap": 0,
"layoutColumnGap": 0
},
"printElements": [
{
"options": {
"left": 45,
"top": 15,
"height": 16.5,
"width": 142.5,
"title": "长春市朝阳区中医院门诊收费结算单",
"coordinateSync": false,
"widthHeightSync": false,
"fontWeight": "bold",
"letterSpacing": 0.75,
"textAlign": "center",
"qrCodeLevel": 0,
"fontSize": 12
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 15,
"top": 39,
"height": 14,
"width": 80,
"title": "姓名",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0,
"field": "name"
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 99,
"top": 39,
"height": 14,
"width": 60,
"title": "性别",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0,
"field": "gender"
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 163.5,
"top": 39,
"height": 14,
"width": 60,
"title": "年龄",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0,
"field": "age"
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 15,
"top": 60,
"height": 14,
"width": 120,
"title": "病人类型",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0,
"field": "medType"
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 13.5,
"top": 82.5,
"height": 14,
"width": 120,
"title": "病历号",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0,
"field": "encounterBusNo"
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 13.5,
"top": 102,
"height": 37.5,
"width": 208.5,
"title": "undefined+beforeDragIn",
"field": "chargedItems",
"coordinateSync": false,
"widthHeightSync": false,
"textAlign": "center",
"tableBodyRowBorder": "border",
"tableBodyCellBorder": "border",
"columns": [
[
{
"title": "项目名称",
"titleSync": false,
"tableQRCodeLevel": 0,
"tableSummaryTitle": true,
"tableSummary": "",
"width": 61.93559159547676,
"field": "itemName",
"checked": true,
"columnId": "itemName",
"fixed": false,
"rowspan": 1,
"colspan": 1
},
{
"title": "单价",
"titleSync": false,
"tableQRCodeLevel": 0,
"tableSummaryTitle": true,
"tableSummary": "",
"width": 37.1097311853845,
"field": "unitPrice",
"checked": true,
"columnId": "unitPrice",
"fixed": false,
"rowspan": 1,
"colspan": 1
},
{
"title": "数量",
"titleSync": false,
"tableQRCodeLevel": 0,
"tableSummaryTitle": true,
"tableSummary": "",
"width": 37.12571954521698,
"field": "quantityValue",
"checked": true,
"columnId": "quantityValue",
"fixed": false,
"rowspan": 1,
"colspan": 1
},
{
"title": "总价",
"titleSync": false,
"tableQRCodeLevel": 0,
"tableSummaryTitle": true,
"tableSummary": "",
"width": 35.15170328143829,
"field": "totalPrice",
"checked": true,
"columnId": "totalPrice",
"fixed": false,
"rowspan": 1,
"colspan": 1
},
{
"title": "费用性质",
"titleSync": false,
"tableQRCodeLevel": 0,
"tableSummaryTitle": true,
"tableSummary": "",
"width": 37.17725439248345,
"field": "contractName",
"checked": true,
"columnId": "contractName",
"fixed": false,
"rowspan": 1,
"colspan": 1
},
{
"title": "收费名称",
"titleSync": false,
"tableQRCodeLevel": 0,
"tableSummaryTitle": true,
"tableSummary": "",
"width": 56.86712269302148,
"field": "chargeItem",
"checked": false,
"columnId": "chargeItem",
"fixed": false,
"rowspan": 1,
"colspan": 1
}
]
]
},
"printElementType": {
"title": "表格",
"type": "table",
"editable": true,
"columnDisplayEditable": true,
"columnDisplayIndexEditable": true,
"columnTitleEditable": true,
"columnResizable": true,
"columnAlignEditable": true,
"isEnableEditField": true,
"isEnableContextMenu": true,
"isEnableInsertRow": true,
"isEnableDeleteRow": true,
"isEnableInsertColumn": true,
"isEnableDeleteColumn": true,
"isEnableMergeCell": true
}
},
{
"options": {
"left": 99,
"top": 147,
"height": 15,
"width": 123,
"title": "合计金额",
"field": "itemTotalAmount",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 6,
"top": 171,
"height": 14,
"width": 108,
"title": "应收金额",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0,
"field": "totalAmount"
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 124.5,
"top": 171,
"height": 14,
"width": 97.5,
"title": "实收金额",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0,
"field": "displayAmount"
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 6,
"top": 193.5,
"height": 14,
"width": 108,
"title": "全自费金额",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0,
"field": "FULAMT_OWNPAY_AMT"
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 124.5,
"top": 193.5,
"height": 13.5,
"width": 97.5,
"title": "医保政策金额",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0,
"field": "INSCP_SCP_AMT"
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 6,
"top": 216,
"height": 14,
"width": 108,
"title": "基金支付",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0,
"field": "YB_FUND_PAY"
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 124.5,
"top": 216,
"height": 13.5,
"width": 97.5,
"title": "统筹支付",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0,
"field": "YB_TC_FUND_AMOUNT"
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 6,
"top": 240,
"height": 14,
"width": 216,
"title": "个人医保账户支付",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0,
"field": "SELF_YB_ZH_PAY"
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 6,
"top": 268.5,
"height": 14,
"width": 106.5,
"title": "收费员",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0,
"field": "userName"
},
"printElementType": {
"title": "文本",
"type": "text"
}
},
{
"options": {
"left": 6,
"top": 294,
"height": 14,
"width": 214.5,
"title": "收费时间",
"coordinateSync": false,
"widthHeightSync": false,
"qrCodeLevel": 0,
"field": "currentDate"
},
"printElementType": {
"title": "文本",
"type": "text"
}
}
]
}
]
}

View File

@@ -12,7 +12,7 @@
<div style="width: 100%">
<el-input
v-model="queryParams.searchKey"
placeholder="请输入患者名/病历号"
placeholder="请输入患者名/住院号/床号"
clearable
style="width: 48%; margin-bottom: 10px; margin-right: 10px"
@keyup.enter="getPatientList"
@@ -22,9 +22,9 @@
</template>
</el-input>
<el-select
v-model="queryParams.statusEnum"
v-model="queryParams.encounterStatus"
style="width: 48%; margin-bottom: 10px; margin-right: 10px"
placeholder="收费状态"
placeholder="结算状态"
@change="getPatientList"
>
<el-option
@@ -44,6 +44,7 @@
placement="bottom"
value-format="YYYY-MM-DD"
style="width: 84%; margin-bottom: 10px; margin-right: 10px"
@change="getPatientList"
/>
<el-button type="primary" style="margin-bottom: 10px" @click="getPatientList">
搜索
@@ -57,14 +58,17 @@
@cell-click="clickRow"
highlight-current-row
>
<el-table-column label="病历号" align="center" prop="encounterBusNo" />
<el-table-column label="住院号" align="center" prop="encounterBusNo" />
<!-- <el-table-column label="床号" align="center" prop="bedNo" /> -->
<el-table-column label="姓名" align="center" prop="patientName" />
<el-table-column label="账户余额" align="center" prop="balanceAmount" />
<!-- <el-table-column label="时间" align="center" prop="receptionTime" width="160">
<template #default="scope">
{{ formatDate(scope.row.receptionTime) }}
</template>
</el-table-column> -->
<el-table-column label="收费状态" align="center" prop="statusEnum_enumText" />
<el-table-column label="结算状态" align="center" prop="encounterStatus_enumText" />
</el-table>
</div>
</el-card>
@@ -73,21 +77,39 @@
<template #header>
<span style="vertical-align: middle">基本信息</span>
</template>
<el-descriptions :column="4">
<el-descriptions :column="5">
<el-descriptions-item label="姓名:">{{ patientInfo.patientName }}</el-descriptions-item>
<el-descriptions-item label="性别:">
{{ patientInfo.genderEnum_enumText }}
</el-descriptions-item>
<el-descriptions-item label="年龄:">{{ patientInfo.age }}</el-descriptions-item>
<el-descriptions-item label="合同类型:">
{{ patientInfo.categoryEnum_enumText }}
<!-- <el-descriptions-item label="科室:">
{{ patientInfo.organizationName }}
</el-descriptions-item> -->
<!-- <el-descriptions-item label="床号:">
{{ patientInfo.bedNo }}
</el-descriptions-item>
<!-- <el-descriptions-item label="身份证号:">{{ patientInfo.idCard }}</el-descriptions-item> -->
<!-- <el-descriptions-item label="手机号">{{ patientInfo.name }}</el-descriptions-item>
<el-descriptions-item label="出生日期">{{ patientInfo.name }}</el-descriptions-item> -->
<el-descriptions-item label="就诊时间:">
{{ formatDateStr(patientInfo.receptionTime, 'YYYY-MM-DD HH:mm:ss') }}
</el-descriptions-item> -->
</el-descriptions>
</el-card>
<el-card style="min-width: 1100px">
<el-card>
<el-date-picker
v-model="costSearchTime"
type="daterange"
range-separator="~"
start-placeholder="开始时间"
end-placeholder="结束时间"
placement="bottom"
value-format="YYYY-MM-DD"
style="width: 40%; margin-bottom: 10px; margin-right: 10px"
@change="getPatientList"
/>
<el-button type="primary" style="margin-bottom: 10px" @click="costSearch"> 搜索 </el-button>
</el-card>
<el-card style="min-width: 1100px; margin-top: 20px">
<template #header>
<span style="vertical-align: middle">收费项目</span>
</template>
@@ -126,6 +148,22 @@
>
自费转医保
</el-button>
<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
>
@@ -133,25 +171,35 @@
<el-table
ref="chargeListRef"
height="530"
:data="chargeList"
:data="chargeFilterList"
row-key="id"
@selection-change="handleSelectionChange"
v-loading="chargeLoading"
:span-method="objectSpanMethod"
border
>
<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="requestingOrgId" width="180" />
<el-table-column label="处方号" align="center" prop="prescriptionNo" width="180" />
<el-table-column label="收费项目" align="center" prop="itemName" width="200" />
<el-table-column label="数量" align="center" prop="quantityValue" width="80" />
<el-table-column label="医疗类型" align="center" prop="medTypeCode_dictText" />
<el-table-column label="医保编码" align="center" prop="ybNo" />
<el-table-column label="费用性质" align="center" prop="contractName" />
<el-table-column label="收费状态" align="center" prop="statusEnum_enumText" width="150">
<el-table-column label="结算状态" align="center" prop="statusEnum_enumText" width="150">
<template #default="scope">
<el-tag
:type="scope.row.statusEnum === 1 ? 'default' : 'success'"
disable-transitions
>
<!-- 1代收费 2代结算 5已收费 8已退费 -->
<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>
{{ scope.row.statusEnum_enumText }}
</el-tag>
</template>
@@ -162,10 +210,66 @@
</template>
</el-table-column>
<el-table-column label="收款人" align="center" prop="entererId_dictText" />
<el-table-column label="收费时间" align="center" prop="billDate" width="180" />
<el-table-column
label="应收金额"
align="right"
prop="receivableAmount"
header-align="center"
>
<template #default="scope">
{{ scope.row.receivableAmount.toFixed(2) + ' 元' || '0.00' + ' 元' }}
</template>
</el-table-column>
<el-table-column
label="实收金额"
align="right"
prop="receivedAmount"
header-align="center"
>
<template #default="scope">
{{ scope.row.receivedAmount.toFixed(2) + ' 元' || '0.00' + ' 元' }}
</template>
</el-table-column>
<el-table-column
label="优惠金额"
align="right"
prop="discountAmount"
header-align="center"
>
<template #default="scope">
{{ scope.row.discountAmount.toFixed(2) + ' 元' || '0.00' + ' 元' }}
</template>
</el-table-column>
<el-table-column label="折扣率" align="right" prop="discountRate" header-align="center">
<template #default="scope">
<!-- discountRate是一个字符串类型的 -->
{{ Number(scope.row.discountRate).toFixed(2) + '%' || '0.00' + '%' }}
</template>
</el-table-column>
<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-button>
</template>
</el-table-column>
</el-table>
</el-card>
</div>
<ChargeDialog
ref="chargeDialogRef"
:open="openDialog"
@close="handleClose"
:category="patientInfo.categoryEnum"
@@ -176,66 +280,122 @@
:chrgBchnoList="chrgBchnoList"
:userCardInfo="userCardInfo"
:paymentId="paymentId"
:details="details"
:chargedItems="chargedItems"
@refresh="getPatientList"
:newId="newId"
:oldId="oldId"
:details="details"
:paymentEnum="paymentEnum"
/>
</div>
</template>
<script setup name="ClinicCharge">
import {
getList,
getList1,
getChargeList,
changeToSelfPay,
changeToMedicalInsurance,
init,
init1,
precharge,
getChargeInfo,
changeStudentPayTosStudentSelf,
changeStudentSelfToStudentPay,
} from './components/api';
import { invokeYbPlugin5001 } from '@/api/public';
import ChargeDialog from './components/chargeDialog.vue';
import { formatDateStr } from '@/utils';
import useUserStore from '@/store/modules/user';
import Decimal from 'decimal.js';
import moment from 'moment';
import { onMounted } from 'vue';
const { proxy } = getCurrentInstance();
const userStore = useUserStore();
const queryParams = ref({
pageNum: 1,
pageSize: 50,
statusEnum: 1,
encounterStatus: 4,
});
const totalAmounts = ref(0);
const selectedRows = ref([]);
const patientList = ref([]);
// 收费项目列表
const chargeList = ref([]);
// 根据时间过滤的收费项目列表
const chargeFilterList = ref([]);
const chargeItemIdList = ref([]);
const chrgBchnoList = ref([]);
const chargeLoading = ref(false);
const encounterId = ref('');
const paymentId = ref('');
const newId = ref('');
const oldId = ref('');
const patientInfo = ref({});
const openDialog = ref(false);
const totalAmount = ref(0);
const chargeListRef = ref();
const details = ref({});
const chargeStatusOptions = ref([]);
const consumablesIdList = ref([]);
const receptionTime = ref([
formatDateStr(new Date(), 'YYYY-MM-DD'),
formatDateStr(new Date(), 'YYYY-MM-DD'),
]);
const newId = ref('');
const oldId = ref('');
const paymentEnum = ref(1);
// 计算当前时间+6天
const accumulateDay = () => {
// 获取当前时间
let now = moment();
// 在当前时间上加一天
let tomorrow = now.add(6, 'days');
// 格式化为年-月-日的格式
let formattedDate = tomorrow.format('YYYY-MM-DD');
return formattedDate;
};
// 收费项目时间段搜索
const costSearchTime = ref([formatDateStr(new Date(), 'YYYY-MM-DD'), accumulateDay()]);
// 测试数据
const items = [
{ id: 1, name: 'Item 1', date: '2025-12-15' },
{ id: 2, name: 'Item 2', date: '2025-12-18' },
{ id: 3, name: 'Item 3', date: '2025-12-20' },
];
// 根据时间短搜索
const costSearch = () => {
console.log(costSearchTime.value === null);
if (costSearchTime.value === null) {
chargeFilterList.value = chargeList.value;
} else {
const startTime = moment(costSearchTime.value[0], 'YYYY-MM-DD');
const endTime = moment(costSearchTime.value[1], 'YYYY-MM-DD');
const filterData = chargeList.value.filter((item) => {
const itemDate = moment(item.billDate || '', 'YYYY-MM-DD'); // 将数据项的日期也格式化为moment对象
return itemDate.isBetween(startTime, endTime, null, '[]'); // 使用isBetween方法进行范围判断'[]'表示包含边界值
});
chargeFilterList.value = filterData;
}
};
const buttonDisabled = computed(() => {
return Object.keys(patientInfo.value).length === 0;
});
const chargedItems = ref([]);
watch(
() => selectedRows.value,
(newVlaue) => {
if (newVlaue && newVlaue.length > 0) {
handleTotalAmount();
} else {
totalAmounts.value = 0;
}
},
{ immediate: true }
);
watch(
() => chargeList.value,
(newVlaue) => {
if (newVlaue && newVlaue.length > 0) {
chargeFilterList.value = newVlaue;
}
},
{ immediate: true }
@@ -245,7 +405,7 @@ function handleSelectionChange(selection) {
}
function handleTotalAmount() {
totalAmounts.value = selectedRows.value.reduce((accumulator, currentRow) => {
return accumulator + (Number(currentRow.totalPrice) || 0);
return new Decimal(accumulator).add(currentRow.totalPrice.toFixed(2) || 0);
}, 0);
}
getPatientList();
@@ -261,20 +421,23 @@ function getPatientList() {
queryParams.value.startTimeSTime = undefined;
queryParams.value.startTimeETime = undefined;
}
getList(queryParams.value).then((res) => {
patientList.value = res.data.data.records;
getList1(queryParams.value).then((res) => {
console.log('患者列表', res);
patientList.value = res.data.records;
});
}
function initOption() {
init().then((res) => {
chargeStatusOptions.value = res.data.chargeItemStatusOptions;
init1().then((res) => {
console.log('初始化收费项目状态', res);
chargeStatusOptions.value = res.data.encounterStatusOptions;
console.log('res.data.chargeItemStatusOptions======>', JSON.stringify(res.data));
});
}
function checkSelectable(row, index) {
// 已结算时禁用选择框
return row.statusEnum === 1;
return row.statusEnum == 1 || row.statusEnum == 2;
}
/**
@@ -284,8 +447,7 @@ function clickRow(row) {
patientInfo.value = row;
chargeLoading.value = true;
encounterId.value = row.encounterId;
const date = row.startTime.split('T')[0].split('-').join('');
getChargeList({encounterId: row.encounterId, startTime:date, endTime: formatDateStr(new Date(), 'YYYYMMDD'),}).then((res) => {
getChargeList(row.encounterId).then((res) => {
chargeList.value = res.data;
setTimeout(() => {
chargeLoading.value = false;
@@ -299,7 +461,7 @@ function handleClose(value, msg) {
if (value == 'success') {
proxy.$modal.msgSuccess(msg);
chargeLoading.value = true;
getChargeList({encounterId: patientInfo.value.encounterId, startTime:date, endTime: formatDateStr(new Date(), 'YYYYMMDD'),}).then((res) => {
getChargeList(patientInfo.value.encounterId).then((res) => {
chargeList.value = res.data;
setTimeout(() => {
chargeLoading.value = false;
@@ -308,7 +470,7 @@ function handleClose(value, msg) {
}
}
const consumablesIdList = ref([]);
// 确认收费
function confirmCharge() {
let selectRows = chargeListRef.value.getSelectionRows();
@@ -319,6 +481,7 @@ function confirmCharge() {
chargeItemIdList.value = selectRows.map((item) => {
return item.id;
});
//wor_device_request 器材
consumablesIdList.value = selectRows
.filter((item) => {
return item.serviceTable == 'wor_device_request';
@@ -326,6 +489,7 @@ function confirmCharge() {
.map((item) => {
return item.id;
});
chargedItems.value = selectRows;
// totalAmount.value = selectRows.reduce((accumulator, currentRow) => {
// return accumulator + (currentRow.totalPrice || 0);
@@ -336,21 +500,18 @@ function confirmCharge() {
chargeItemIds: chargeItemIdList.value,
}).then((res) => {
if (res.code == 200) {
// totalAmount.value = res.data.psnCashPay;
if(res.data.newPayment) {
paymentEnum.value = res.data.newPayment.paymentEnum;
paymentId.value = res.data.id.toString();
newId.value = res.data.newId.toString();
oldId.value = res.data.oldId.toString();
encounterId.value = patientInfo.value.encounterId,
chrgBchnoList.value = res.data.paymentRecDetailDtoList;
totalAmount.value = res.data.newPayment.tenderedAmount;
details.value = res.data.paymentRecDetailDtoList;
openDialog.value = true;
}else {
}
const item = res.data.paymentRecDetailDtoList.find((i) => {
return i.payEnum == 220000;
});
totalAmount.value = item?.amount;
paymentId.value = res.data.id;
newId.value = res.data.newId;
oldId.value = res.data.oldId;
chrgBchnoList.value = res.data.chrgBchnoList;
details.value = res.data.paymentRecDetailDtoList?.filter((item) => {
return item.amount > 0;
});
openDialog.value = true;
} else {
proxy.$modal.msgError(res.msg);
}
@@ -363,161 +524,172 @@ const readCardLoading = ref(false);
const loadingText = ref('');
const BusiCardInfo = ref(''); // miyao
async function handleReadCard(value) {
if (chrome.webview === undefined) {
alert('请在医保版本中调用读卡功能!');
} else {
try {
let webView = window.chrome.webview.hostObjects.CSharpAccessor;
// string url,
// string fixmedins_code,
// string businessType,
// string operatorCode,
// string operatorName,
// string officeId,
// string officeName
// if (window.CefSharp === undefined) {
// alert('请在医保版本中调用读卡功能!');
// } else {
try {
// await CefSharp.BindObjectAsync('boundAsync');
// string url,
// string fixmedins_code,
// string businessType,
// string operatorCode,
// string operatorName,
// string officeId,
// string officeName
// readCardLoading.value = true;
let jsonResult;
let cardInfo;
let userMessage = undefined;
switch (value) {
case '01': // 电子凭证
// readCardLoading.value = true;
await webView
.GetInfoByQrCodeAsync(
'http://10.47.0.67:8089/localcfc/api/hsecfc/localQrCodeQuery',
'H22010200672',
'01101',
userStore.id,
userStore.name,
'D83',
'财务科'
)
.then((res) => {
readCardLoading.value = true;
loadingText.value = '正在读取...';
jsonResult = res;
})
.catch(() => {
readCardLoading.value = false;
})
.finally(() => {
readCardLoading.value = false;
});
cardInfo = JSON.parse(jsonResult);
let message = JSON.parse(cardInfo.message);
userMessage = {
certType: '02', // 证件类型
certNo: message.data.idNo, // 身份证号
psnCertType: '02', // 居民身份证
};
userCardInfo = {
certType: '01', // 证件类型
certNo: message.data.idNo, // 身份证号
psnCertType: '01', // 居民身份证
busiCardInfo: message.data.ecToken, // 令牌
};
BusiCardInfo.value = message.data.ecToken;
console.log(BusiCardInfo.value);
break;
case '02':
break;
case '03': // 社保卡
readCardLoading.value = true;
loadingText.value = '正在读取...';
await webView
.ReadHeaSecCardAsync(
JSON.stringify({
IP: 'ddjk.jlhs.gov.cn',
PORT: 20215,
TIMEOUT: 60,
SFZ_DRIVER_TYPE: 1,
})
)
.then((res) => {
jsonResult = res;
})
.finally(() => {
readCardLoading.value = false;
});
// console.log(
// 'jsonResult',
// JSON.parse({
// IssuingAreaCode: '310000',
// SocialSecurityNumber: '371324198810224515',
// CardNumber: 'M501A1A78',
// CardIdentificationCode: '310000D15600000535925154E880AB97',
// Name: '\u5218\u5CF0',
// CardResetInfo: '00814A444686603100333E4FA9',
// SpecificationVersion: '3.00',
// IssuingDate: '20190313',
// ExpirationDate: '20290313',
// TerminalNumber: '000000000000',
// TerminalDeviceNumber: '00041161201901000005',
// Code: 0,
// ErrorMessage: null,
// })
// );
let message1 = JSON.parse(jsonResult);
userMessage = {
certType: '02', // 证件类型
certNo: message1.SocialSecurityNumber, // 身份证号
psnCertType: '02', // 居民身份证
};
userCardInfo = {
certType: '02', // 证件类型
certNo: message1.SocialSecurityNumber, // 身份证号
psnCertType: '02', // 居民身份证
busiCardInfo: message1.BusiCardInfo, //卡号
};
BusiCardInfo.value = message1.BusiCardInfo;
console.log(message1.BusiCardInfo);
break;
case '99':
break;
}
readCardLoading.value = false;
if (userMessage.certNo) {
let selectRows = chargeListRef.value.getSelectionRows();
if (selectRows.length == 0) {
proxy.$modal.msgWarning('请选择一条收费项目');
return;
}
chargeItemIdList.value = selectRows.map((item) => {
return item.id;
});
totalAmount.value = selectRows.reduce((accumulator, currentRow) => {
return accumulator + (currentRow.totalPrice || 0);
}, 0);
precharge({
patientId: patientInfo.value.patientId,
encounterId: patientInfo.value.encounterId,
chargeItemIds: chargeItemIdList.value,
ybMdtrtCertType: userCardInfo.psnCertType,
busiCardInfo: userCardInfo.busiCardInfo,
}).then((res) => {
if (res.code == 200) {
// totalAmount.value = res.data.psnCashPay;
paymentId.value = res.data.paymentId;
totalAmount.value = res.data.details.find((item) => item.payEnum == 220000).amount;
details.value = res.data.details;
// chrgBchnoList.value = res.data.chrgBchnoList;
consumablesIdList.value = selectRows.filter((item) => {
return item.serviceTable == 'wor_device_request';
}).map((item) => {
return item.id;
});
openDialog.value = true;
} else {
proxy.$modal.msgError(res.msg);
}
});
}
} catch (error) {
console.error('调用失败:', error);
readCardLoading.value = false;
// readCardLoading.value = true;
let jsonResult;
let cardInfo;
let userMessage = undefined;
switch (value) {
case '01': // 电子凭证
// readCardLoading.value = true;
await invokeYbPlugin5001({
FunctionId: 3,
url: 'http://10.47.0.67:8089/localcfc/api/hsecfc/localQrCodeQuery',
orgId: 'H22010200672',
businessType: '01101',
operatorId: userStore.id.toString(),
operatorName: userStore.name,
officeId: 'D83',
officeName: '财务科',
})
.then((res) => {
readCardLoading.value = true;
loadingText.value = '正在读取...';
jsonResult = res.data;
})
.catch(() => {
readCardLoading.value = false;
})
.finally(() => {
readCardLoading.value = false;
});
cardInfo = JSON.parse(JSON.stringify(jsonResult));
let message = JSON.parse(cardInfo.message);
userMessage = {
certType: '02', // 证件类型
certNo: message.data.idNo, // 身份证号
psnCertType: '02', // 居民身份证
};
userCardInfo = {
certType: '01', // 证件类型
certNo: message.data.idNo, // 身份证号
psnCertType: '01', // 居民身份证
busiCardInfo: message.data.ecToken, // 令牌
};
BusiCardInfo.value = message.data.ecToken;
console.log(BusiCardInfo.value);
break;
case '02':
break;
case '03': // 社保卡
readCardLoading.value = true;
loadingText.value = '正在读取...';
await invokeYbPlugin5001(
JSON.stringify({
FunctionId: 1,
IP: 'ddjk.jlhs.gov.cn',
PORT: 20215,
TIMEOUT: 60,
SFZ_DRIVER_TYPE: 1,
})
)
.then((res) => {
jsonResult = JSON.stringify(res.data);
})
.finally(() => {
readCardLoading.value = false;
});
// console.log(
// 'jsonResult',
// JSON.parse({
// IssuingAreaCode: '310000',
// SocialSecurityNumber: '371324198810224515',
// CardNumber: 'M501A1A78',
// CardIdentificationCode: '310000D15600000535925154E880AB97',
// Name: '\u5218\u5CF0',
// CardResetInfo: '00814A444686603100333E4FA9',
// SpecificationVersion: '3.00',
// IssuingDate: '20190313',
// ExpirationDate: '20290313',
// TerminalNumber: '000000000000',
// TerminalDeviceNumber: '00041161201901000005',
// Code: 0,
// ErrorMessage: null,
// })
// );
let message1 = JSON.parse(jsonResult);
userMessage = {
certType: '02', // 证件类型
certNo: message1.SocialSecurityNumber, // 身份证号
psnCertType: '02', // 居民身份证
};
userCardInfo = {
certType: '02', // 证件类型
certNo: message1.SocialSecurityNumber, // 身份证号
psnCertType: '02', // 居民身份证
busiCardInfo: message1.BusiCardInfo, //卡号
};
BusiCardInfo.value = message1.BusiCardInfo;
console.log(message1.BusiCardInfo);
break;
case '99':
break;
}
readCardLoading.value = false;
if (userMessage.certNo) {
let selectRows = chargeListRef.value.getSelectionRows();
if (selectRows.length == 0) {
proxy.$modal.msgWarning('请选择一条收费项目');
return;
}
chargeItemIdList.value = selectRows.map((item) => {
return item.id;
});
totalAmount.value = selectRows.reduce((accumulator, currentRow) => {
return accumulator + (currentRow.totalPrice || 0);
}, 0);
precharge({
patientId: patientInfo.value.patientId,
encounterId: patientInfo.value.encounterId,
chargeItemIds: chargeItemIdList.value,
ybMdtrtCertType: userCardInfo.psnCertType,
busiCardInfo: userCardInfo.busiCardInfo,
}).then((res) => {
if (res.code == 200) {
paymentId.value = res.data.id;
totalAmount.value = res.data.paymentRecDetailDtoList.find(
(item) => item.payEnum == 220000
).amount;
details.value = res.data.paymentRecDetailDtoList;
// chrgBchnoList.value = res.data.chrgBchnoList;
chargeItemIdList.value = selectRows.map((item) => {
return item.id;
});
// 打印项目赋值
chargedItems.value = selectRows;
newId.value = res.data.newId;
oldId.value = res.data.oldId;
consumablesIdList.value = selectRows
.filter((item) => {
return item.serviceTable == 'wor_device_request';
})
.map((item) => {
return item.id;
});
openDialog.value = true;
} else {
proxy.$modal.msgError(res.msg);
}
});
}
} catch (error) {
console.error('调用失败:', error);
readCardLoading.value = false;
}
// }
}
/**
@@ -541,6 +713,80 @@ function patToMedicalInsurance() {
}
});
}
/**
* 学生医保转学生自费
*/
function studentPayTosStudentSelf() {
changeStudentPayTosStudentSelf(encounterId.value).then((res) => {
if (res.code == 200) {
proxy.$modal.msgSuccess('操作成功');
}
});
}
/**
* 学生自费转学生医保
*/
function studentSelfToStudentPay() {
changeStudentSelfToStudentPay(encounterId.value).then((res) => {
if (res.code == 200) {
proxy.$modal.msgSuccess('操作成功');
}
});
}
// 添加行合并方法
function objectSpanMethod({ row, column, rowIndex, columnIndex }) {
// 只对操作列进行合并(根据列索引判断,操作列为最后一列)
if (columnIndex === 10) {
// 操作列索引为10从0开始计数
// 如果当前行的paymentId为空则不合并
if (!row.paymentId) {
return [1, 1];
}
// 查找相同paymentId的连续行
let spanCount = 1;
if (rowIndex === 0 || chargeList.value[rowIndex - 1].paymentId !== row.paymentId) {
// 这是具有相同paymentId的第一行计算需要合并的行数
for (let i = rowIndex + 1; i < chargeList.value.length; i++) {
if (chargeList.value[i].paymentId === row.paymentId) {
spanCount++;
} else {
break;
}
}
return [spanCount, 1];
} else {
// 这不是具有相同paymentId的第一行返回0表示不显示
return [0, 0];
}
}
// 其他列不合并
return [1, 1];
}
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);
});
}
</script>
<style scoped>
</style>
:deep(.no-hover-column) .cell:hover {
background-color: transparent !important;
}
:deep(.el-table__body) tr:hover td.no-hover-column {
background-color: inherit !important;
}
</style>

View File

@@ -23,8 +23,14 @@
</el-col>
<el-col :span="8">
<el-form-item label="入院日期" prop="admissionDate">
<el-date-picker v-model="formData.admissionDate" type="date" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
style="width: 100%" placeholder="请选择日期" />
<el-date-picker
v-model="formData.admissionDate"
type="date"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
style="width: 100%"
placeholder="请选择日期"
/>
</el-form-item>
</el-col>
</el-row>
@@ -46,7 +52,12 @@
<el-row>
<el-col :span="8">
<el-form-item label="重复住院">
<el-switch inline-prompt v-model="formData.isRepeatHospitalization" active-text="是" inactive-text="否" />
<el-switch
inline-prompt
v-model="formData.isRepeatHospitalization"
active-text=""
inactive-text=""
/>
</el-form-item>
</el-col>
<el-col :span="8">
@@ -75,7 +86,12 @@
</el-col>
<el-col :span="8">
<el-form-item label="急诊标志">
<el-switch inline-prompt v-model="formData.isEmergency" active-text="是" inactive-text="否" />
<el-switch
inline-prompt
v-model="formData.isEmergency"
active-text=""
inactive-text=""
/>
</el-form-item>
</el-col>
<el-col :span="8">
@@ -97,9 +113,11 @@
</div>
</template>
<script setup >
<script setup>
import { ref } from 'vue';
defineOptions({
name: 'YbregisterEdit',
});
// interface FormData {
// medicalType: string;
// diseaseName: string;
@@ -141,7 +159,6 @@ import { ref } from 'vue';
const handleSubmit = () => {
// 处理表单提交
};
</script>

View File

@@ -24,14 +24,34 @@
height="100%"
show-overflow-tooltip
>
<el-table-column type="index" width="54" align="center" label="序号" />
<el-table-column type="index" width="80" align="center" label="序号" />
<el-table-column prop="patientName" align="center" label="申请患者" />
<<<<<<< HEAD
<el-table-column prop="genderEnum_enumText" label="性别" align="center" />
<el-table-column label="年龄" align="center">
<template #default="scope">
{{ scope.row.age ? `${scope.row.age}` : '-' }}
</template>
</el-table-column>
=======
<el-table-column prop="genderEnum_enumText" width="80" label="性别" align="center" />
<el-table-column prop="age" width="80" label="年龄" align="center" />
<el-table-column prop="busNo" align="center" label="患者住院号">
<template #default="scope">
{{ scope.row.busNo || '-' }}
</template>
</el-table-column>
<el-table-column prop="contractNo" align="center" label="费用性质">
<template #default="scope">
{{ scope.row.contractNo || '-' }}
</template>
</el-table-column>
<el-table-column prop="admitSourceCode" align="center" label="入院类型">
<template #default="scope">
{{ scope.row.admitSourceCode || '-' }}
</template>
</el-table-column>
>>>>>>> v1.3
<el-table-column prop="sourceName" align="center" label="申请来源">
<template #default="scope">
{{ scope.row.sourceName || '-' }}
@@ -63,13 +83,17 @@
:registrationType="registrationType"
:alreadyEdit="alreadyEdit"
:noFile="noFile"
:is-registered="true"
@okAct="patientRegisterOK"
@cancelAct="cancelAct"
/>
</template>
<script setup >
<script setup>
import PatientRegister from './patientRegister.vue';
import { getAdmissionPage, getPatientBasicInfo, getInHospitalInfo } from './api';
import { getContractList } from './api';
const { proxy } = getCurrentInstance();
const { admit_source_code } = proxy.useDict('admit_source_code');
//const { proxy } = getCurrentInstance();
const emits = defineEmits([]);
// const props = defineProps({});
@@ -93,6 +117,7 @@ const patientRegisterVisible = ref(false);
const noFile = ref(false);
const registrationType = ref(true);
const patient = ref({});
const priceTypeList = ref({});
const doEdit = (row) => {
getPatientBasicInfo(row.patientId).then((res) => {
patient.value = res.data;
@@ -104,6 +129,7 @@ const doEdit = (row) => {
});
};
onBeforeMount(() => {});
getContract();
onMounted(() => {
getList();
});
@@ -137,9 +163,47 @@ function resetQuery() {
getList();
}
// 入院登记
const mapHospitalization = (admitSourceCode = '') => {
console.log('admit_source_code=======>', admitSourceCode);
const findObj = admit_source_code.value.find((item) => {
return item.value == admitSourceCode;
});
return findObj?.label;
};
/** 查询费用性质 */
function getContract() {
getContractList().then((response) => {
priceTypeList.value = response.data;
});
}
// 映射费用性质
const priceTypeDic = (contractNo) => {
const findObj = priceTypeList.value.find((item) => {
return item.busNo == contractNo;
});
return findObj?.contractName;
};
const getList = () => {
getAdmissionPage(queryParams.value).then((res) => {
treatHospitalizedData.value = res.data.records;
console.log('priceTypeList=======>', JSON.stringify(priceTypeList.value));
let dataList = [];
for (let index = 0; index < (res.data.records || []).length; index++) {
const obj = (res.data.records || [])[index];
const newObj = {
...obj,
};
newObj.admitSourceCode = mapHospitalization(obj.admitSourceCode);
dataList.push(newObj);
}
for (let index = 0; index < dataList.length; index++) {
const obj = dataList[index];
obj.contractNo = priceTypeDic(obj.contractNo);
}
treatHospitalizedData.value = dataList;
// treatHospitalizedData.value = res.data.records;
total.value = res.data.total;
});
};

View File

@@ -1,12 +1,12 @@
import request from '@/utils/request'
import request from '@/utils/request';
// 获取住院信息初期数据列表
export function getInit(query) {
return request({
url: '/inpatient-manage/init',
method: 'get',
params: query
})
params: query,
});
}
// 获取住院信息 分页显示
@@ -22,8 +22,8 @@ export function getAdmissionPage(query) {
return request({
url: '/inhospital-charge/register/register-info',
method: 'get',
params: query
})
params: query,
});
}
// 住院无档登记
@@ -31,8 +31,8 @@ export function addAdmissionInfo(data) {
return request({
url: '/inpatient-manage/admission-information',
method: 'post',
data: data
})
data: data,
});
}
// 住院登记
@@ -40,8 +40,8 @@ export function admissionInfo(data) {
return request({
url: '/inpatient-manage/admission-information',
method: 'put',
data: data
})
data: data,
});
}
/**
@@ -51,17 +51,18 @@ export function getOrgList() {
return request({
url: '/base-data-manage/organization/organization',
method: 'get',
})
});
}
/**
* 查询病区下拉列表
*/
export function wardList() {
export function wardList({ orgId } = {}) {
return request({
url: '/app-common/ward-list',
method: 'get'
})
url: '/inhospital-charge/register/ward-list',
method: 'get',
params: { orgId },
});
}
/**
@@ -71,56 +72,55 @@ export function diagnosisInit() {
return request({
url: '/doctor-station/diagnosis/init',
method: 'get',
})
});
}
// 查询患者相关
export function patientlLists() {
return request({
url: '/patient-manage/information/init',
method: 'get'
})
method: 'get',
});
}
// 查询患者相关
export function doctorList(id) {
return request({
url: '/inpatient-manage/doctor-list?orgId=' + id,
method: 'get'
})
method: 'get',
});
}
// 查询患者相关
export function getPatientInfo(id, statusEnum) {
return request({
url: `/inpatient-manage/admission-one?id=${id}&statusEnum=${statusEnum}`,
method: 'get'
})
method: 'get',
});
}
// 获取患者基础信息
export function getPatientBasicInfo(patientId) {
return request({
url: `/inhospital-charge/register/patient-info?patientId=${patientId}`,
method: 'get'
})
method: 'get',
});
}
// 获取患者入院信息
export function getInHospitalInfo(encounterId) {
return request({
url: `/inhospital-charge/register/in-hospital-info?encounterId=${encounterId}`,
method: 'get'
})
method: 'get',
});
}
// 获取病区床位信息
export function getBedInfo(wardBusNo) {
return request({
url: `/inhospital-charge/register/beds-num?wardBusNo=${wardBusNo}`,
method: 'get'
})
method: 'get',
});
}
// 住院登记
@@ -128,8 +128,8 @@ export function registerInHospital(data) {
return request({
url: '/inhospital-charge/register/by-cashier',
method: 'post',
data: data
})
data: data,
});
}
// 无档登记
@@ -137,16 +137,16 @@ export function noFilesRegister(data) {
return request({
url: '/inhospital-charge/register/no-files',
method: 'post',
data: data
})
data: data,
});
}
// 表单初始化
export function patientFormInit() {
return request({
url: '/patient-manage/information/init',
method: 'get'
})
method: 'get',
});
}
// 合同
@@ -154,7 +154,7 @@ export function getContractList() {
return request({
url: '/app-common/contract-list',
method: 'get',
})
});
}
/**
@@ -164,6 +164,31 @@ export function getDiagnosisDefinitionList(queryParams) {
return request({
url: '/doctor-station/diagnosis/condition-definition-metadata',
method: 'get',
params: queryParams
})
}
params: queryParams,
});
}
// 获取患者医保信息
export function gerPreInfo(userMaessage) {
return request({
url: '/yb-inpatient-request/inpatient-per-info',
method: 'post',
data: userMaessage,
});
}
// export function gerPreInfo(userMaessage) {
// return request({
// url: '/yb-request/per-info',
// method: 'post',
// params: userMaessage,
// });
// }
//获取省市医保字符串
export function getProvincesAndCities(encounterId) {
return request({
url: `/payment/bill/get-encounter-type?encounterId=${encounterId}`,
method: 'get',
});
}

View File

@@ -56,6 +56,7 @@
:inHospitalInfo="inHospitalInfo"
title="登记"
:registrationType="registrationType"
:is-registered="false"
@okAct="patientRegisterOK"
@cancelAct="cancelAct"
:noFile="noFile"
@@ -127,10 +128,12 @@ const patientYbRegisterVisible = ref(false);
const patientRegisterOK = () => {
patientRegisterVisible.value = false;
queryParams.value.searchKey = '';
getList();
emits('okList');
};
const cancelAct = () => {
getList();
patientRegisterVisible.value = false;
};

View File

@@ -11,7 +11,7 @@
{{ isEditing ? '取消' : '编辑' }}
</div> -->
<div>
<el-radio-group v-model="typeCode">
<el-radio-group v-model="typeCode" :disabled="props.isRegistered">
<el-radio label="电子凭证" value="01"></el-radio>
<el-radio label="医保卡" value="03"></el-radio>
<el-radio label="身份证" value="02"></el-radio>
@@ -19,6 +19,7 @@
<span
@click="handleReadCard(typeCode)"
style="cursor: pointer; margin: 0 12px 0 30px; color: #409eff"
v-if="!props.isRegistered"
>
{{ '读卡' }}
</span>
@@ -38,16 +39,22 @@
<el-text truncated>患者姓名</el-text>
</el-col>
<el-col :span="4" class="patInfo-value">
<el-text truncated>{{ patientInfo?.name || '-' }}</el-text>
<el-text truncated>{{ patientInfo?.patientName || '-' }}</el-text>
</el-col>
<el-col :span="2" class="patInfo-label">
<!-- <el-col :span="2" class="patInfo-label">
<el-text truncated>费别类型</el-text>
</el-col>
<el-col :span="4" class="patInfo-value">
<el-text truncated>{{ patientInfo?.ybClassEnum_enumText || '-' }}</el-text>
<!-- TODO -->
<svg-icon size="20" icon-class="hipEdit" style="cursor: pointer" @click="changFeeType" />
</el-col>
<el-text truncated>{{ patientInfo?.ybClassEnum_enumText || '-' }}</el-text> -->
<!-- TODO -->
<!-- <svg-icon
size="20"
icon-class="hipEdit"
style="cursor: pointer"
@click="changFeeType"
v-if="!props.isRegistered"
/>
</el-col> -->
</el-row>
<el-row class="patientInfos">
<el-col :span="2" class="patInfo-label">
@@ -73,7 +80,7 @@
<el-text truncated>年龄</el-text>
</el-col>
<el-col :span="4" class="patInfo-value">
<el-text truncated>{{ patientInfo?.ageString || '-' }}</el-text>
<el-text truncated>{{ patientInfo?.age || '-' }}</el-text>
</el-col>
</el-row>
<el-row class="patientInfos">
@@ -87,7 +94,7 @@
<el-text truncated>民族</el-text>
</el-col>
<el-col :span="4" class="patInfo-value">
<div>{{ patientInfo?.nationalityCode || '-' }}</div>
<div>{{ getDictLabel(nationality_code, patientInfo?.nationalityCode) || '-' }}</div>
</el-col>
<el-col :span="2" class="patInfo-label">
<el-text truncated>国籍</el-text>
@@ -139,7 +146,7 @@
<el-text truncated>病人来源</el-text>
</el-col>
<el-col :span="4" class="patInfo-value">
<div>{{ patientInfo?.organizationId_dictText || '-' }}</div>
<div>{{ props.inHospitalInfo?.inHospitalOrgName || '-' }}</div>
</el-col>
<el-col :span="2" class="patInfo-label">
<el-text truncated>单位名称</el-text>
@@ -150,24 +157,37 @@
</el-row>
</div>
<div v-else>
<PatientInfoForm ref="patientInfoFormRef" />
<PatientInfoForm ref="patientInfoFormRef" :is-view-mode="props.isRegistered" />
</div>
</div>
</template>
<script setup>
import { ref, reactive, watch } from 'vue';
import { ref, reactive, watch, onMounted } from 'vue';
import PatientInfoForm from './patientInfoForm.vue';
import { patientlLists, getOrgList } from './api';
import { patientlLists, getOrgList, gerPreInfo } from './api';
import { invokeYbPlugin5001 } from '@/api/public';
import useUserStore from '@/store/modules/user';
import { useRouter } from 'vue-router';
const { proxy } = getCurrentInstance();
const typeList = ref({});
const patientInfoFormRef = ref();
let userCardInfo = ref({});
const BusiCardInfo = ref('');
const userStore = useUserStore();
const router = useRouter();
const props = defineProps({
patientInfo: {
type: Object,
require: true,
default: () => ({}),
},
inHospitalInfo: {
type: Object,
default: () => ({}),
},
registrationType: {
type: [String, Boolean, Number], // 根据实际类型调整
default: null, // 或者 false、'' 等
@@ -181,11 +201,25 @@ const props = defineProps({
type: Boolean,
default: false,
},
//待入院,已入院区分
isRegistered: {
type: Boolean,
default: false,
},
inHospitalInfo: {
type: Object,
default: () => ({}),
required: false,
},
});
const emits = defineEmits(['onChangFeeType']);
const emits = defineEmits(['onChangFeeType', 'carReading']);
const registerRef = ref();
const typeCode = ref('01');
const organization = ref([]);
const { nationality_code } = proxy.useDict('nationality_code');
const readCardLoading = ref(false);
const loadingText = ref('正在读取...');
onMounted(() => {
getInitOptions();
@@ -242,136 +276,185 @@ const submitForm = async (callback) => {
}
});
};
const getDictLabel = (dictList, value) => {
if (!dictList || !value) return '';
const item = dictList.find((item) => item.value === value);
return item ? item.label : value;
};
async function handleReadCard(value) {
if (window.CefSharp === undefined) {
alert('请在医保版本中调用读卡功能!');
} else {
try {
await CefSharp.BindObjectAsync('boundAsync');
// string url,
// string fixmedins_code,
// string businessType,
// string operatorCode,
// string operatorName,
// string officeId,
// string officeName
try {
// await CefSharp.BindObjectAsync('boundAsync');
// string url,
// string fixmedins_code,
// string businessType,
// string operatorCode,
// string operatorName,
// string officeId,
// string officeName
// readCardLoading.value = true;
let jsonResult;
let cardInfo;
let userMessage = undefined;
switch (value) {
case '01': // 电子凭证
// readCardLoading.value = true;
await boundAsync
.getInfoByQrCodeAsync(
'http://10.47.0.67:8089/localcfc/api/hsecfc/localQrCodeQuery',
'H22010200672',
'01101',
userStore.id,
userStore.name,
'D83',
'财务科'
)
.then((res) => {
readCardLoading.value = true;
loadingText.value = '正在读取...';
jsonResult = res;
})
.catch(() => {
readCardLoading.value = false;
});
cardInfo = JSON.parse(jsonResult);
let message = JSON.parse(cardInfo.message);
userMessage = {
certType: '02', // 证件类型
certNo: message.data.idNo, // 身份证号
psnCertType: '02', // 居民身份证
};
break;
case '02':
break;
case '03': // 社保卡
readCardLoading.value = true;
loadingText.value = '正在读取...';
await boundAsync
.readHeaSecCardAsync(
JSON.stringify({
IP: 'ddjk.jlhs.gov.cn',
PORT: 20215,
TIMEOUT: 60,
SFZ_DRIVER_TYPE: 1,
})
)
.then((res) => {
jsonResult = res;
})
.finally(() => {
readCardLoading.value = false;
});
// console.log(
// 'jsonResult',
// JSON.parse({
// IssuingAreaCode: '310000',
// SocialSecurityNumber: '371324198810224515',
// CardNumber: 'M501A1A78',
// CardIdentificationCode: '310000D15600000535925154E880AB97',
// Name: '\u5218\u5CF0',
// CardResetInfo: '00814A444686603100333E4FA9',
// SpecificationVersion: '3.00',
// IssuingDate: '20190313',
// ExpirationDate: '20290313',
// TerminalNumber: '000000000000',
// TerminalDeviceNumber: '00041161201901000005',
// Code: 0,
// ErrorMessage: null,
// })
// );
let message1 = JSON.parse(jsonResult);
userMessage = {
certType: '02', // 证件类型
certNo: message1.SocialSecurityNumber, // 身份证号
psnCertType: '02', // 居民身份证
};
break;
case '99':
break;
}
readCardLoading.value = true;
if (userMessage.certNo) {
gerPreInfo(userMessage)
// readCardLoading.value = true;
// let jsonResult = null;
let jsonResult;
let cardInfo;
let userMessage = undefined;
// 调试日志检查patientInfo中的值
console.log('patientInfo:', props.patientInfo);
console.log('patientInfo中的id:', props.patientInfo?.id);
console.log('patientInfo中的encounterId:', props.patientInfo?.encounterId);
switch (value) {
case '01': // 电子凭证
// readCardLoading.value = true;
// await boundAsync
// .getInfoByQrCodeAsync(
// )
await invokeYbPlugin5001({
FunctionId: 3,
url: 'http://10.47.0.67:8089/localcfc/api/hsecfc/localQrCodeQuery',
orgId: 'H22010200672',
businessType: '01101',
operatorId: userStore.id.toString(),
operatorName: userStore.name,
officeId: 'D83',
officeName: '财务科',
})
.then((res) => {
if (res.code == 200) {
form.value.patientId = res.data.id;
form.value.name = res.data.name;
form.value.age = res.data.age;
form.value.idCard = res.data.idCard;
form.value.card = res.data.id;
form.value.contractNo = res.data.contractBusNo;
form.value.genderEnum = res.data.genderEnum;
form.value.ybAreaNo = res.data.contractName;
}
readCardLoading.value = true;
loadingText.value = '正在读取...';
console.log(res);
jsonResult = res.data;
cardInfo = JSON.parse(JSON.stringify(jsonResult));
let message = JSON.parse(cardInfo.message);
console.log('patientInfo中的encounterId:', props.patientInfo);
const encounterId = props.inHospitalInfo.encounterId || '1993854019030441985';
console.log('1111111111111111111准备使用的encounterId:', encounterId);
userMessage = {
certType: '02', // 证件类型
certNo: message.data.idNo, // 身份证号
psnCertType: '02', // 居民身份证
encounterId: encounterId || '1993854019030441985',
};
userCardInfo = {
certType: '01', // 证件类型
certNo: message.data.idNo, // 身份证号
psnCertType: '01', // 居民身份证
busiCardInfo: message.data.ecToken, // 令牌
encounterId: encounterId || '1993854019030441985',
};
BusiCardInfo.value = message.data.ecToken;
console.log(BusiCardInfo.value);
emits('carReading', jsonResult);
})
.catch(() => {
readCardLoading.value = false;
});
break;
case '02':
break;
case '03': // 社保卡
readCardLoading.value = true;
loadingText.value = '正在读取...';
await invokeYbPlugin5001(
JSON.stringify({
FunctionId: 1,
IP: 'ddjk.jlhs.gov.cn',
PORT: 20215,
TIMEOUT: 60,
SFZ_DRIVER_TYPE: 1,
})
)
.then((res) => {
jsonResult = JSON.stringify(res.data);
let message1 = JSON.parse(jsonResult);
// 从patientInfo中获取encounterId如果没有则尝试从住院号中获取
// const encounterId =
// props.patientInfo?.encounterId || props.patientInfo?.visitNo || props.patientInfo?.busNo;
// console.log('准备使用的encounterId:', encounterId);
userMessage = {
certType: '02', // 证件类型
certNo: message1.SocialSecurityNumber, // 身份证号
psnCertType: '02', // 居民身份证
encounterId: encounterId || '1993854019030441985',
};
userCardInfo = {
certType: '02', // 证件类型
certNo: message1.SocialSecurityNumber, // 身份证号
psnCertType: '02', // 居民身份证
busiCardInfo: message1.BusiCardInfo, //卡号
encounterId: encounterId || '1993854019030441985',
};
BusiCardInfo.value = message1.BusiCardInfo;
console.log(message1.BusiCardInfo);
emits('carReading', res.data);
})
.finally(() => {
readCardLoading.value = false;
});
}
} catch (error) {
console.error('调用失败:', error);
readCardLoading.value = false;
break;
case '99':
break;
}
}
}
function getPatientForm() {
console.log(patientInfoFormRef.value.form);
readCardLoading.value = true;
// 调试日志检查发送给gerPreInfo的参数
console.log('发送给gerPreInfo的参数:', userMessage);
return patientInfoFormRef.value.form;
if (userMessage && userMessage.certNo) {
gerPreInfo(userMessage)
.then((res) => {
console.log('gerPreInfo返回结果:', res);
if (res && res.code == 200 && res.data) {
form.patientId = res.data.id;
form.name = res.data.name;
form.age = res.data.age;
form.idCard = res.data.idCard;
form.card = res.data.id;
form.contractNo = res.data.contractBusNo;
form.genderEnum = res.data.genderEnum;
form.ybAreaNo = res.data.contractName;
form.encounterId = res.data.encounterId;
// 成功获取数据后跳转到 registerEdit 页面,并传递数据
// router.push({
// name: '/ybmanagement/inhospital/register/edit', // 需要根据实际路由名称调整
// params: {
// cardData: JSON.stringify(res.data), // 将完整数据作为参数传递
// cardType: value, // 卡类型
// },
// });
} else {
// 处理无有效数据的情况
ElMessage.error('未获取到有效的患者信息');
}
})
.catch((error) => {
console.error('gerPreInfo调用失败:', error);
})
.finally(() => {
readCardLoading.value = false;
});
}
} catch (error) {
console.error('调用失败:', error);
readCardLoading.value = false;
}
// }
}
// 患者费别变更
const changFeeType = () => {
emits('onChangFeeType');
};
// 无档登记收集信息
const getPatientForm = () => {
return patientInfoFormRef?.value?.form;
};
defineExpose({ submitForm, form, isEditing, getPatientForm });
</script>
@@ -404,4 +487,4 @@ defineExpose({ submitForm, form, isEditing, getPatientForm });
font-weight: 700 !important;
margin-bottom: 10px;
}
</style>
</style>

View File

@@ -210,9 +210,9 @@
v-model="form.deceasedDate"
type="datetime"
placeholder="请选择时间"
format="YYYY/MM/DD HH:mm:ss"
format="YYYY-MM-DD HH:mm:ss"
:disabled="isViewMode"
value-format="YYYY/MM/DD HH:mm:ss"
value-format="YYYY-MM-DD HH:mm:ss"
/>
</el-form-item>
</el-col>
@@ -266,6 +266,7 @@ const data = reactive({
isViewMode: false,
form: {
typeCode: '01',
genderEnum: 0,
},
rules: {
name: [{ required: true, message: '姓名不能为空', trigger: 'change' }],

View File

@@ -12,11 +12,14 @@
<el-scrollbar height="650px">
<PatientInfoComp
:patientInfo="props.patientInfo"
:inHospitalInfo="props.inHospitalInfo"
:registrationType="props.registrationType"
:initOptions="initOptions"
:noFile="noFile"
ref="patientInfoRef"
:is-registered="props.isRegistered"
@onChangFeeType="onChangFeeType"
@carReading="onCarRead"
/>
<!-- <PatientRelationList
class="relationList"
@@ -32,10 +35,24 @@
:alreadyEdit="alreadyEdit"
:inHospitalInfo="inHospitalInfo"
:noFile="noFile"
:is-registered="props.isRegistered"
/>
</el-scrollbar>
<template v-slot:footer>
<div class="advance-container">
<div v-if="currentFeeType !== 'hipCash'" class="payment-item">
<span>{{ payType() }}支付</span>
<el-input
ref="txtCodeRef"
v-model="txtCode"
style="width: 300px; margin-left: 10px"
:placeholder="payType() + '支付码'"
/>
<el-button link type="primary" @click="handleWxPay()" style="margin-left: 10px"
>扫码支付</el-button
>
<el-button link type="primary" @click="getWxPayResult()">查看结果</el-button>
</div>
<el-space>
<div>缴费预交金</div>
<el-input
@@ -45,13 +62,20 @@
@input="handleAdvanceInput"
:formatter="handleAdvanceFormatter"
:parser="handleAdvanceParser"
:disabled="alreadyEdit"
></el-input>
<div
class="feeType"
:class="currentFeeType == typeitem.type ? 'activeFeeType' : ''"
v-for="typeitem in feeTypeOptions"
:key="typeitem.type"
@click="currentFeeType = typeitem.type"
@click="
() => {
!alreadyEdit && (currentFeeType = typeitem.type);
payEnum = typeitem.payEnum;
}
"
:style="{ cursor: alreadyEdit ? 'not-allowed' : 'pointer' }"
>
<svg-icon
:icon-class="typeitem.type"
@@ -65,13 +89,9 @@
</el-space>
</div>
<el-button size="fixed" class="margin-left-auto" @click="cancelAct">取消 </el-button>
<el-button size="fixed" type="primary" @click="handleSubmit">登记</el-button>
<!-- <hip-button size="fixed" type="primary" @click="supplementMi">医保登记</hip-button> -->
<!-- <AdvancePayment
v-model="advancePaymentVisible"
@submitOk="advancePaymentSubmitOk"
:money="advance"3
/> -->
<el-button v-if="!props.isRegistered" size="fixed" type="primary" @click="handleSubmit">
登记
</el-button>
</template>
</el-dialog>
</template>
@@ -80,7 +100,13 @@ const { proxy } = getCurrentInstance();
import { ElMessageBox } from 'element-plus';
import PatientInfoComp from './patientInfo.vue';
import RegisterForm from './registerForm.vue';
import { noFilesRegister, registerInHospital, getInit } from './api';
import { noFilesRegister, registerInHospital, getProvincesAndCities } from './api';
import { getInit } from '../../../../doctorstation/components/api';
import { useRouter } from 'vue-router';
import { wxPay, WxPayResult } from '../../../../charge/cliniccharge/components/api';
import printUtils from '@/utils/printUtils';
const txtCode = ref('');
const router = useRouter();
const emits = defineEmits(['okAct', 'cancelAct']);
const props = defineProps({
@@ -103,6 +129,10 @@ const props = defineProps({
type: Boolean,
default: false,
},
isRegistered: {
type: Boolean,
default: false, // false 表示待登记true 表示已登记
},
});
watch(
@@ -122,6 +152,7 @@ import { ElMessage } from 'element-plus';
const width = '1128px';
const patientApiInfo = ref({});
const initOptions = ref({});
const payEnum = ref(220400);
/* 取消 */
const cancelAct = () => {
@@ -131,13 +162,78 @@ const patientInfoRef = ref();
/* 预交金 */
const advancePaymentVisible = ref(false);
/* 保存 */
const jumpToYbRegisterEdit = () => {
router
.push({
path: '/ybmanagement/ybInhospital/ybregisterEdit',
query: {
encounterId: '1993854019030441985',
},
})
.catch((error) => {
console.error('跳转医保登记页面失败:', error);
});
};
/* 登记 */
const handleSubmit = () => {
let params = {};
let params = {
inHospitalInfo: {},
payEnum: 0,
};
params.inHospitalInfo.payEnum = payEnum.value;
params.payEnum = payEnum.value;
console.log('params==========>', JSON.stringify(patientInfoRef?.value.getPatientForm()));
if (props.noFile) {
const paramsDic = patientInfoRef?.value.getPatientForm();
const paramsDic1 = RegisterFormRef.value.submitForm;
if (!paramsDic?.name) {
ElMessage({
type: 'error',
message: '请输入患者姓名',
});
return;
} else if (!paramsDic?.phone) {
ElMessage({
type: 'error',
message: '请输入联系方式',
});
return;
} else if (!paramsDic?.age) {
ElMessage({
type: 'error',
message: '请输入年龄',
});
return;
} else if (!paramsDic1?.inHospitalOrgId) {
ElMessage({
type: 'error',
message: '请选择入院科室',
});
return;
} else if (!paramsDic1?.wardLocationId) {
ElMessage({
type: 'error',
message: '请选择入院病区',
});
return;
} else if (!paramsDic1?.diagnosisDefinitionId) {
ElMessage({
type: 'error',
message: '请选择入院诊断',
});
return;
}
// else if (!paramsDic1?.diagnosisDesc) {
// ElMessage({
// type: 'error',
// message: '请输入诊断描述',
// });
// return;
// }
RegisterFormRef.value.validateData(async () => {
params.inHospitalInfo = RegisterFormRef.value.submitForm;
params.patientInformation = patientInfoRef.value.getPatientForm();
params.inHospitalInfo.payEnum = payEnum.value;
params.patientInformation = patientInfoRef?.value.getPatientForm();
if (params.patientInformation.idCard) {
// 验证身份证号长度是否为18位
const idCard = params.patientInformation.idCard.toString();
@@ -155,9 +251,53 @@ const handleSubmit = () => {
const performRegistration = () => {
noFilesRegister(params).then((res) => {
if (res.code == 200) {
emits('okAct');
ElMessage.success(res.msg);
advancePaymentVisible.value = true;
ElMessage.success(res.msg);
// 打印预交金收据
printDepositReceipt(props.patientInfo, params.inHospitalInfo);
cancelAct();
// 询问是否需要医保登记
// ElMessageBox.confirm('是否需要进行医保登记?', '医保登记确认', {
// confirmButtonText: '确认',
// cancelButtonText: '取消',
// type: 'info',
// })
// .then(() => {
// // 准备传递的数据
// const cardData = {
// patientInfo: params.patientInformation,
// inHospitalInfo: params.inHospitalInfo,
// encounterId: params.inHospitalInfo.encounterId,
// };
// // 跳转到医保登记页面
// try {
// router
// .push({
// path: '/ybmanagement/ybInhospital/ybregisterEdit',
// query: {
// encounterId: props.patientInfo.encounterId,
// cardData: encodeURIComponent(JSON.stringify(cardData)),
// cardType: 'inHospital',
// operationType: 'HospitalizationRegistration',
// },
// })
// .then(() => {
// console.log('路由跳转成功');
// })
// .catch((error) => {
// console.error('路由跳转失败:', error);
// ElMessage.error('跳转到医保登记页面失败');
// });
// } catch (error) {
// console.error('跳转异常:', error);
// }
// })
// .catch(() => {
// // 用户取消医保登记,关闭当前弹窗
// emits('okAct');
// });
} else {
ElMessage.error(res.msg);
}
@@ -182,13 +322,64 @@ const handleSubmit = () => {
params.patientId = props.patientInfo.patientId;
RegisterFormRef.value.validateData(async () => {
params = { ...params, ...RegisterFormRef.value.submitForm };
console.log('params', params);
const performRegistration = () => {
console.log('params', params);
registerInHospital(params).then((res) => {
if (res.code == 200) {
emits('okAct');
ElMessage.success(res.msg);
advancePaymentVisible.value = true;
// 打印预交金收据
printDepositReceipt(
props.patientInfo,
params,
RegisterFormRef.value.medicalInsuranceTitle
);
// 自费不需要弹医保
if (params.contractNo != '0000') {
// 询问是否需要医保登记
ElMessageBox.confirm('是否需要进行医保登记?', '医保登记确认', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'info',
})
.then(() => {
// 准备传递的数据
const cardData = {
patientInfo: props.patientInfo,
inHospitalInfo: params,
};
// 跳转到医保登记页面
try {
router
.push({
path: '/ybmanagement/ybInhospital/ybregisterEdit',
query: {
encounterId: props.patientInfo.encounterId,
cardData: encodeURIComponent(JSON.stringify(cardData)),
cardType: 'inHospital',
operationType: 'HospitalizationRegistration',
certType: props.patientInfo.certType,
},
})
.then(() => {
console.log('路由跳转成功');
})
.catch((error) => {
console.error('路由跳转失败:', error);
ElMessage.error('跳转到医保登记页面失败');
});
} catch (error) {
console.error('跳转异常:', error);
}
})
.catch(() => {
// 用户取消医保登记,关闭当前弹窗
emits('okAct');
});
}
cancelAct();
} else {
ElMessage.error(res.msg);
}
@@ -229,6 +420,8 @@ const closedAct = () => {
onMounted(() => {
getInit().then((res) => {
console.log('getInit=========>', JSON.stringify(res.data));
initOptions.value = res.data;
});
});
@@ -239,18 +432,22 @@ const RegisterFormRef = ref();
const feeTypeOptions = reactive([
{
type: 'hipCash',
payEnum: 220400,
label: '现金',
},
{
type: 'hipAlipay',
payEnum: 220200,
label: '支付宝',
},
{
type: 'wechat',
payEnum: 220100,
label: '微信',
},
{
type: 'hipPayCard',
payEnum: 220300,
label: '银行卡',
},
]);
@@ -279,7 +476,168 @@ const onChangFeeType = () => {
medicalInsuranceVisible.value = true;
};
/* */
/* 打印预交金收据 */
const printDepositReceipt = async (patientInfo, inHospitalInfo, medicalInsuranceTitle) => {
try {
// 构造支付方式详情文本
const paymentDetails = `现金 ${
currentFeeType.value === 'hipCash' ? advance.value || '0.00' : '0.00'
} 微信 ${currentFeeType.value === 'wechat' ? advance.value || '0.00' : '0.00'} 支付宝 ${
currentFeeType.value === 'hipAlipay' ? advance.value || '0.00' : '0.00'
} 银行 ${currentFeeType.value === 'hipPayCard' ? advance.value || '0.00' : '0.00'}`;
// 构造打印数据
const printData = {
// 患者基本信息
patientName: patientInfo.patientName || '', // 姓名
patientId: patientInfo.idCard || patientInfo.patientCode || '', // ID号
contractName: patientInfo.contractName || '自费', // 医保类别
// 住院信息
encounterNo: inHospitalInfo.encounterNo || '', // 住院号
inHospitalOrgName: inHospitalInfo.inHospitalOrgName || '', // 机构名称
// 费用信息
balanceAmount: advance.value || '0.00', // 金额
amountInWords: convertToChineseNumber(advance.value || '0.00'), // 人民币大写
// 支付方式详情
paymentDetails: paymentDetails,
// 时间信息
currentTime: new Date().toLocaleString('zh-CN', {
year: 'numeric',
month: '2-digit',
day: '2-digit',
hour: '2-digit',
minute: '2-digit',
second: '2-digit',
}),
// 其他信息
cashier: userStore?.nickName || '', // 收款人(收费员)
medicalInsuranceTitle: medicalInsuranceTitle || '', // 医保标题信息
};
console.log(printData, 'dayin 预交金printData');
// 直接导入并使用指定的预交金打印模板
const templateModule = await import('@/components/Print/AdvancePayment.json');
let template = templateModule.default || templateModule;
// 使用printUtils执行打印
await printUtils.executePrint(printData, template);
console.log('预交金收据打印成功');
} catch (error) {
console.error('打印失败:', error);
ElMessage.error('打印失败: ' + error.message);
}
};
/* 将数字转换为人民币大写 */
const convertToChineseNumber = (amount) => {
// 数字转大写
const digits = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
const units = ['', '拾', '佰', '仟', '万', '拾', '佰', '仟', '亿'];
const decimalUnits = ['角', '分'];
let [integer, decimal] = amount.toString().split('.');
decimal = decimal || '00';
decimal = decimal.padEnd(2, '0').substring(0, 2);
let result = '';
// 处理整数部分
if (parseInt(integer) === 0) {
result += '零元';
} else {
for (let i = 0; i < integer.length; i++) {
const digit = parseInt(integer[i]);
const position = integer.length - i - 1;
if (digit !== 0) {
result += digits[digit] + units[position];
} else {
// 避免连续的零
if (i > 0 && parseInt(integer[i - 1]) !== 0) {
result += digits[digit];
}
// 但需要保留万、亿等单位
if (position % 4 === 0 && position > 0) {
result += units[position];
}
}
}
result += '元';
}
// 处理小数部分
if (parseInt(decimal) === 0) {
result += '整';
} else {
if (parseInt(decimal[0]) > 0) {
result += digits[parseInt(decimal[0])] + decimalUnits[0];
}
if (parseInt(decimal[1]) > 0) {
result += digits[parseInt(decimal[1])] + decimalUnits[1];
}
}
return result;
};
/* 导入用户信息 */
import useUserStore from '@/store/modules/user';
const userStore = useUserStore();
function handleWxPay() {
wxPay({
// 支付码
txtCode: txtCode.value,
// 收费项id 住院怎么给
chargeItemIds: props.chargeItemIds,
encounterId: props.patientInfo.encounterId,
// 支付id 住院怎么给
id: props.paymentId,
// 支付详情 住院怎么给 格式[{ payEnum: 220100, amount: 0.0, payLevelEnum: 2 }]
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,
});
}
// 根据不同支付方式,显示不同的支付方式详情
const payType = () => {
switch (currentFeeType.value) {
case 'hipCash':
return '现金';
case 'hipAlipay':
return '支付宝';
case 'wechat':
return '微信卡';
case 'hipPayCard':
return '银行卡';
default:
return '';
}
};
// 读卡操作
const onCarRead = (a) => {
console.log('读卡操作:', a);
};
</script>
<style lang="scss" scoped>
.patientRegister-container {
@@ -290,7 +648,12 @@ const onChangFeeType = () => {
.advance-container {
width: 660px;
display: flex;
flex-direction: column;
.payment-item {
display: flex;
align-items: center;
margin-bottom: 12px;
}
.feeType {
display: flex;
align-items: center;

View File

@@ -10,6 +10,7 @@
ref="registerRef"
label-width="80px"
:rules="rules"
:disabled="props.isRegistered"
>
<el-row :gutter="8">
<el-col :span="6">
@@ -28,6 +29,7 @@
clearable
style="width: 100%"
v-model="submitForm.inHospitalOrgId"
:disabled="props.isRegistered"
filterable
:data="organization"
:props="{
@@ -47,7 +49,11 @@
</el-col>
<el-col :span="6">
<el-form-item label="入院病区" prop="wardLocationId">
<el-select :disabled="props.alreadyEdit" v-model="submitForm.wardLocationId">
<el-select
:disabled="props.isRegistered || !submitForm.inHospitalOrgId"
v-model="submitForm.wardLocationId"
placeholder="请先选择入院科室"
>
<el-option
v-for="item in wardListOptions"
:key="item.id"
@@ -74,6 +80,7 @@
<el-form-item label="诊断类别" prop="medTypeCode">
<el-select
v-model="submitForm.medTypeCode"
:disabled="props.isRegistered"
placeholder="诊断类别"
clearable
filterable
@@ -101,6 +108,7 @@
<el-form-item label="入院诊断" prop="diagnosisDefinitionId">
<el-select
v-model="submitForm.diagnosisDefinitionId"
:disabled="props.isRegistered"
placeholder="入院诊断"
clearable
filterable
@@ -124,11 +132,11 @@
</el-col>
<el-col :span="6">
<el-form-item label="患者病情">
<el-select v-model="submitForm.priorityEnum">
<el-select v-model="submitForm.priorityEnum" :disabled="props.isRegistered">
<el-option
v-for="item in props.initOptions.priorityEnumList"
v-for="item in props.initOptions.priorityLevelOptionOptions"
:key="item.value"
:label="item.info"
:label="item.label"
:value="item.value"
/>
</el-select>
@@ -136,7 +144,7 @@
</el-col>
<el-col :span="6">
<el-form-item label="入院类型" prop="admitSourceCode">
<el-select v-model="submitForm.admitSourceCode">
<el-select v-model="submitForm.admitSourceCode" :disabled="props.isRegistered">
<el-option
v-for="item in admit_source_code"
:key="item.value"
@@ -148,7 +156,7 @@
</el-col>
<el-col :span="6">
<el-form-item label="入院方式" prop="inWayCode">
<el-select v-model="submitForm.inWayCode">
<el-select v-model="submitForm.inWayCode" :disabled="props.isRegistered">
<el-option
v-for="item in in_way_code"
:key="item.value"
@@ -164,6 +172,7 @@
v-model="submitForm.contractNo"
placeholder="费用性质"
clearable
:disabled="props.isRegistered"
@change="getValue"
>
<el-option
@@ -179,6 +188,7 @@
<el-form-item label="入院日期" prop="startTime">
<el-date-picker
v-model="submitForm.startTime"
:disabled="props.isRegistered"
value-format="YYYY-MM-DD HH:mm:ss"
type="date"
placeholder="请选择日期"
@@ -198,6 +208,7 @@ import {
getBedInfo,
getContractList,
getDiagnosisDefinitionList,
getProvincesAndCities,
} from './api';
const { proxy } = getCurrentInstance();
const { in_way_code, admit_source_code, med_type } = proxy.useDict(
@@ -224,7 +235,7 @@ const props = defineProps({
require: true,
default: () => ({}),
},
alreadyEdit: {
isRegistered: {
type: Boolean,
default: false,
},
@@ -239,6 +250,7 @@ const wardListOptions = ref([]);
const contractList = ref([]);
const verificationStatusOptions = ref([]);
const diagnosisDefinitionList = ref([]);
const wardLoading = ref(false);
const rules = reactive({
inHospitalOrgId: [
{
@@ -268,15 +280,52 @@ const rules = reactive({
trigger: ['blur', 'change'],
},
],
diagnosisDesc: [
{
required: true,
message: '诊断描述未填写',
trigger: ['blur', 'change'],
},
],
// diagnosisDesc: [
// {
// required: true,
// message: '诊断描述未填写',
// trigger: ['blur', 'change'],
// },
// ],
});
//获取省市医保字符串
const medicalInsuranceTitle = ref('');
// 暴露给父组件使用
// defineExpose({
// medicalInsuranceTitle,
// });
const getProvincesAndCitiesInfo = async () => {
try {
if (inHospitalInfo.encounterId) {
const res = await getProvincesAndCities(props.inHospitalInfo.encounterId);
// console.log('获取省市医保字符串', res);
if (res && res.code == 200) {
// 确保有数据时才更新
medicalInsuranceTitle.value = res.data?.insutype || res.data || '';
}
}
} catch (error) {
// 静默处理错误,确保页面不会显示错误信息
console.error('获取医保省市信息失败:', error);
}
};
onMounted(() => {
getProvincesAndCitiesInfo();
});
// 监听inHospitalInfo.encounterId的变化在弹窗打开时重新调用接口
watch(
() => props.inHospitalInfo.encounterId,
(newEncounterId) => {
if (newEncounterId) {
getProvincesAndCitiesInfo();
}
},
{ immediate: true }
);
/* 提交表单 */
const submitForm = reactive({
inHospitalOrgId: props.inHospitalInfo.inHospitalOrgId,
@@ -289,25 +338,50 @@ const submitForm = reactive({
ambDiagnosisName: props.inHospitalInfo.ambDiagnosisName,
medTypeCode: '21',
});
/* 科室 病区 */
// /* 科室 病区 */
// watch(
// () => submitForm.inDocterWorkGroupCode,
// (newValue) => {
// if (newValue) {
// if (newValue == '') {
// submitForm.wardLocationId = '';
// }
// } else {
// submitForm.wardLocationId = '';
// }
// }
// );
// watch(
// () => submitForm.inNurseDeptCode,
// (newValue) => {
// if (newValue) {
// getBedInfo(newValue);
// }
// }
// );
watch(
() => submitForm.inDocterWorkGroupCode,
(newValue) => {
if (newValue) {
if (newValue == '') {
submitForm.wardLocationId = '';
() => submitForm.wardLocationId,
(newWardId) => {
if (newWardId && wardListOptions.value.length > 0) {
const selectedWard = wardListOptions.value.find((item) => item.id === newWardId);
if (selectedWard) {
handleWardClick(selectedWard);
}
} else {
submitForm.wardLocationId = '';
submitForm.totalBedsNum = undefined;
submitForm.idleBedsNum = undefined;
}
}
},
{ immediate: true }
);
watch(
() => submitForm.inNurseDeptCode,
(newValue) => {
if (newValue) {
getBedInfo(newValue);
() => props.isRegistered,
(newVal) => {
if (newVal) {
// 已登记状态可以做一些数据锁定操作
} else {
init();
}
}
);
@@ -315,25 +389,51 @@ watch(
onMounted(() => {
getInitOptions();
setValue();
setDefaultAdmitSource();
if (submitForm.inHospitalOrgId) {
handleNodeClick({ id: submitForm.inHospitalOrgId });
}
});
const setDefaultAdmitSource = () => {
if (props.noFile) return;
const defaultItem = admit_source_code.value.find((item) => item.value === '1');
if (defaultItem) {
submitForm.admitSourceCode = props.inHospitalInfo?.admitSourceCode || defaultItem.value;
}
};
function handleWardClick(item) {
submitForm.wardBusNo = item.busNo;
getBedInfo(submitForm.wardBusNo).then((res) => {
submitForm.totalBedsNum = res.data.totalBedsNum;
submitForm.idleBedsNum = res.data.idleBedsNum;
});
submitForm.totalBedsNum = undefined;
submitForm.idleBedsNum = undefined;
getBedInfo(submitForm.wardBusNo)
.then((res) => {
if (res.data) {
submitForm.totalBedsNum = res.data.totalBedsNum;
submitForm.idleBedsNum = res.data.idleBedsNum;
} else {
submitForm.totalBedsNum = 0;
submitForm.idleBedsNum = 0;
}
})
.catch((err) => {
console.error('查询病床失败:', err);
submitForm.totalBedsNum = undefined;
submitForm.idleBedsNum = undefined;
});
}
function getInitOptions() {
getOrgList().then((res) => {
organization.value = res.data.records;
// organization.value = res.data.records
organization.value = res.data.records[0].children.filter(
(record) => record.typeEnum === 2 && record.classEnum === 2
);
});
if (!props.noFile) {
wardList().then((res) => {
wardListOptions.value = res.data;
});
}
// if (!props.noFile) {
// wardList().then((res) => {
// wardListOptions.value = res.data;
// });
// }
diagnosisInit().then((res) => {
verificationStatusOptions.value = res.data.verificationStatusOptions;
});
@@ -350,15 +450,40 @@ function getDiagnosisInfo(value) {
}
function handleNodeClick(orgInfo) {
wardList({ orgId: orgInfo.id }).then((res) => {
wardListOptions.value = res.data;
});
submitForm.wardLocationId = undefined; // 切换科室时,先清空原有病区
submitForm.totalBedsNum = undefined;
submitForm.idleBedsNum = undefined;
wardListOptions.value = []; // 先清空列表,避免旧数据残留
wardLoading.value = true;
wardList({ orgId: orgInfo.id })
.then((res) => {
wardListOptions.value = res.data || [];
if (wardListOptions.value.length > 0 && !props.inHospitalInfo.wardLocationId) {
submitForm.wardLocationId = wardListOptions.value[0].id;
const defaultWard = wardListOptions.value.find(
(item) => item.id === submitForm.wardLocationId
);
if (defaultWard) {
handleWardClick(defaultWard);
}
}
})
.catch((err) => {
console.error('加载病区失败:', err);
wardListOptions.value = [];
})
.finally(() => {
wardLoading.value = false;
});
}
function handleChange(value) {
if (!value) {
wardListOptions.value = [];
submitForm.wardLocationId = undefined;
submitForm.totalBedsNum = undefined;
submitForm.idleBedsNum = undefined;
wardLoading.value = false; // 同步停止加载
}
}
@@ -385,7 +510,7 @@ function setValue() {
submitForm.ambDiagnosisName = props.inHospitalInfo?.ambDiagnosisName;
submitForm.priorityEnum = props.inHospitalInfo?.priorityEnum;
submitForm.priorityEnum_enumText = props.inHospitalInfo?.priorityEnum_enumText;
submitForm.admitSourceCode = props.inHospitalInfo?.admitSourceCode;
// submitForm.admitSourceCode = props.inHospitalInfo?.admitSourceCode;
submitForm.admitSourceCode_dictText = props.inHospitalInfo?.admitSourceCode_dictText;
submitForm.inWayCode = props.inHospitalInfo?.inWayCode;
submitForm.inWayCode_dictText = props.inHospitalInfo?.inWayCode_dictText;
@@ -406,10 +531,13 @@ const validateData = async (callback) => {
};
const init = () => {
submitForm.inDocterWorkGroupCode = '';
submitForm.wardLocationId = '';
if (!props.isRegistered) {
// 只有待登记状态才重置
submitForm.inDocterWorkGroupCode = '';
submitForm.wardLocationId = '';
}
};
defineExpose({ validateData, submitForm, init });
defineExpose({ validateData, submitForm, init, medicalInsuranceTitle });
</script>
<style lang="scss" scoped>
.registerForm-container {

View File

@@ -22,7 +22,6 @@ const props = defineProps({});
const state = reactive({});
defineExpose({ state });
const activeName = ref('first');
</script>
<style lang="scss" scoped>
.sds {

View File

@@ -2,7 +2,7 @@
<div class="container">
<el-form :model="state.form">
<div class="record-container">
<div class="title">演示医院</div>
<div class="title">长春市朝阳区中医院</div>
<div class="subtitle">入院记录</div>
<div class="header">
<span>姓名: [<el-input v-model="state.form.name" class="inline-input" />]</span>