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

@@ -1,8 +1,56 @@
<template>
<<<<<<< HEAD
<el-dialog v-model="dialogVisible" title="补费" width="90%" :close-on-click-modal="false">
<!-- 弹窗内容 - 左右布局 -->
<div style="display: flex; gap: 20px; height: 70vh">
<!-- 左侧收费组套列表 - 卡片式布局 -->
=======
<el-dialog v-model="dialogVisible" title="补费" width="80%" :close-on-click-modal="false">
<div style="font-size: 16px; font-weight: bold; margin-bottom: 10px">
患者信息{{
props.patientInfo.patientName +
' ' +
props.patientInfo.genderEnum_enumText +
' ' +
props.patientInfo.age
}}
| 住院号{{ props.patientInfo.busNo }} | 科室{{ props.patientInfo.organizationName }} |
病区{{ props.patientInfo.wardName }} | 病房{{ props.patientInfo.houseName }} | 床号{{
props.patientInfo.bedName
}}
</div>
<div style="margin-bottom: 15px; display: flex; align-items: center; gap: 15px">
<el-select
v-model="adviceType"
placeholder="医嘱类型"
style="width: 200px"
@change="getAdviceBaseInfos"
>
<el-option
v-for="item in adviceTypeList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
<div>
<el-input
style="width: 400px"
v-model="searchText"
placeholder="输入项目名称"
@keydown.enter="getAdviceBaseInfos"
clearable
>
<template #append>
<el-button icon="Search" @click="getAdviceBaseInfos"></el-button>
</template>
</el-input>
</div>
<el-button type="primary">划价组套</el-button>
</div>
<!-- 弹窗内容 - 左右布局 -->
<div style="display: flex; gap: 20px; height: 70vh">
>>>>>>> v1.3
<div
style="
width: 250px;
@@ -12,6 +60,7 @@
flex-direction: column;
"
>
<<<<<<< HEAD
<!-- 搜索框 -->
<div style="padding: 10px; border-bottom: 1px solid #e4e7ed">
<el-input v-model="groupSearchText" placeholder="输入组套名称" clearable />
@@ -31,11 +80,48 @@
<div class="group-name">{{ group.name }}</div>
<div class="group-info">
{{ getGroupInfo(group.id) }}
=======
<!-- 诊疗耗材 -->
<div
style="flex: 1; overflow-y: auto; padding: 10px; min-height: 200px"
v-loading="adviceLoading"
element-loading-text="正在努力加载..."
element-loading-background="rgba(255, 255, 255, 0.8)"
>
<div
v-for="item in AdviceBaseInfoList"
:key="item.id"
class="item-card"
@click="selectChange(item)"
>
<div class="item-status">
<span class="status-dot"></span>
{{ getItemType_Text(item.adviceType) }}
</div>
<div class="item-name">{{ item.adviceName }}</div>
<div class="item-name">
{{
item.priceList && item.priceList.length > 0
? (item.priceList[0].price / item.partPercent).toFixed(2) +
'元' +
'/' +
item.minUnitCode_dictText
: ''
}}
</div>
<div class="item-name" v-if="item.adviceType === 2">
库存数量
{{ handleQuantity(item) }}
>>>>>>> v1.3
</div>
</div>
<!-- 只显示暂无数据文本 -->
<div
<<<<<<< HEAD
v-if="chargeGroups.length === 0"
=======
v-if="AdviceBaseInfoList.length === 0"
>>>>>>> v1.3
style="text-align: center; color: #909399; padding: 20px"
>
暂无数据
@@ -48,6 +134,7 @@
<!-- 费用项目表格 -->
<el-table :data="feeItemsList" border style="width: 100%; flex: 1">
<el-table-column label="收费项目" prop="itemName" min-width="200">
<<<<<<< HEAD
<template #default="scope">
<el-input
v-model="scope.row.itemName"
@@ -57,11 +144,30 @@
</template>
</el-table-column>
<el-table-column label="单价" prop="unitPrice" width="100" align="center">
=======
<!-- <template #default="scope">
<el-input
v-model="scope.row.adviceName"
placeholder="请输入收费项目"
style="width: 100%"
/>
</template> -->
<template #default="scope">
{{ scope.row.adviceName }}
{{
scope.row.volume === '-' || !scope.row.volume ? '' : '[' + scope.row.volume + ']'
}}
</template>
</el-table-column>
<!-- 单价 - 简化版 -->
<el-table-column label="单价" width="200" align="center">
>>>>>>> v1.3
<template #default="scope">
<el-input-number
v-model="scope.row.unitPrice"
:min="0"
:step="0.01"
<<<<<<< HEAD
precision="2"
style="width: 100px"
@change="calculateTotalAmount"
@@ -69,12 +175,21 @@
</template>
</el-table-column>
<el-table-column label="计费数量" prop="quantity" width="100" align="center">
=======
precision="6"
style="width: 150px"
/>
</template>
</el-table-column>
<el-table-column label="计费数量" prop="quantity" width="150" align="center">
>>>>>>> v1.3
<template #default="scope">
<el-input-number
v-model="scope.row.quantity"
:min="1"
:step="1"
style="width: 100px"
<<<<<<< HEAD
@change="calculateTotalAmount"
/>
</template>
@@ -92,10 +207,88 @@
<el-table-column label="特限符合" prop="special" width="100" align="center">
<template #default="scope">
<el-switch v-model="scope.row.special" />
=======
/>
</template>
</el-table-column>
<!-- <el-table-column label="最小单位" prop="minUnitCode_dictText" width="100" align="center">
<template #default="scope">
{{ scope.row.minUnitCode_dictText }}
</template>
</el-table-column> -->
<el-table-column label="单位" width="140" align="center">
<template #default="scope">
<el-select
v-model="scope.row.selectUnitCode"
placeholder="单位"
style="width: 100px"
@change="unitCodeChange(scope.row)"
>
<el-option
v-for="unit in scope.row.uniqueUnitCodes"
:key="unit.code"
:label="unit.codeText"
:value="unit.code"
/>
</el-select>
</template>
</el-table-column>
<!-- 优化后的金额列 -->
<el-table-column label="金额" width="100" align="center">
<template #default="scope">
{{ (scope.row.unitPrice * scope.row.quantity).toFixed(6) }}
</template>
</el-table-column>
<el-table-column label="执行科室/位置" prop="dept" width="250" align="center">
<template #default="scope">
<el-select
v-if="scope.row.adviceType == 3"
clearable
filterable
v-model="scope.row.positionId"
placeholder="选择科室"
style="width: 220px"
>
<el-option
v-for="dept in departmentOptions"
:key="dept.id"
:label="dept.name"
:value="dept.id"
/>
</el-select>
<el-select
v-if="scope.row.adviceType == 2"
clearable
filterable
v-model="scope.row.positionId"
placeholder="选择药房/耗材房"
style="width: 220px"
>
<el-option
v-for="dept in locationOptions"
:key="dept.value"
:label="dept.label"
:value="dept.value"
/>
</el-select>
</template>
</el-table-column>
<el-table-column label="医保等级" prop="chrgitmLv_dictText" width="150" align="center">
<template #default="scope">
{{ scope.row.chrgitmLv_dictText }}
</template>
</el-table-column>
<el-table-column label="操作" width="100" align="center">
<template #default="scope">
<el-button type="text" size="small" @click="feeItemsList.splice(scope.$index, 1)">
删除
</el-button>
>>>>>>> v1.3
</template>
</el-table-column>
</el-table>
<<<<<<< HEAD
<!-- 添加项目按钮 - 移到右侧费用项目表格下方 -->
<div
style="
@@ -113,6 +306,8 @@
+ 添加项目
</div>
=======
>>>>>>> v1.3
<!-- 底部信息区域 -->
<div style="margin-top: 20px; display: flex; flex-wrap: wrap; gap: 15px">
<div style="display: flex; align-items: center">
@@ -126,6 +321,7 @@
style="width: 200px"
/>
</div>
<<<<<<< HEAD
<div style="display: flex; align-items: center">
<span style="margin-right: 8px">执行科室</span>
@@ -158,6 +354,9 @@
</div>
</div>
=======
</div>
>>>>>>> v1.3
<!-- 总金额和操作按钮 -->
<div
style="
@@ -168,7 +367,11 @@
"
>
<div style="font-size: 14px; font-weight: bold; text-align: right">
<<<<<<< HEAD
本次补费总金额<span style="color: #ff4d4f">{{ totalAmount.toFixed(2) }}</span>
=======
本次补费总金额<span style="color: #ff4d4f">{{ totalAmount.toFixed(6) }}</span>
>>>>>>> v1.3
</div>
<div>
<el-button @click="handleCancel">取消</el-button>
@@ -181,9 +384,19 @@
</template>
<script setup>
<<<<<<< HEAD
import { ref, computed, onMounted, watch } from 'vue';
import { ElMessage } from 'element-plus';
import { formatDateStr } from '@/utils/index';
=======
import { ref, computed, onMounted, watch, reactive } from 'vue';
import { ElMessage } from 'element-plus';
import { formatDateStr } from '@/utils/index';
import { getAdviceBaseInfo, getOrgList, getDiseaseTreatmentInitLoc } from './api.js';
import useUserStore from '@/store/modules/user';
import { get } from 'lodash';
import { lo } from 'element-plus/es/locales.mjs';
>>>>>>> v1.3
// Props定义
const props = defineProps({
@@ -196,8 +409,13 @@ const props = defineProps({
default: () => [],
},
patientInfo: {
<<<<<<< HEAD
type: String,
default: '',
=======
type: Object, // 通常这类信息是对象,这里假设你已经修正了类型
default: () => ({}),
>>>>>>> v1.3
},
});
@@ -209,6 +427,7 @@ const dialogVisible = computed({
get: () => props.visible,
set: (value) => emit('update:visible', value),
});
<<<<<<< HEAD
const searchItemText = ref('');
const selectedItemName = ref('');
const feeTabs = ref('chargeItems');
@@ -226,11 +445,111 @@ const groupSearchText = ref('');
const totalAmount = computed(() => {
return feeItemsList.value.reduce((sum, item) => {
return sum + (item.unitPrice || 0) * (item.quantity || 0);
=======
const adviceTypeList = ref([
{ label: '耗材', value: 2 },
{ label: '诊疗', value: 3 },
{ label: '全部', value: '' },
]);
const adviceType = ref('');
const feeItemsList = ref([]);
const executeTime = ref('');
const departmentOptions = ref([]);
const AdviceBaseInfoList = ref([]);
const locationOptions = ref([]);
const searchText = ref('');
const userId = ref('');
const orgId = ref('');
const queryParams = ref({
pageSize: 100,
pageNum: 1,
adviceTypes: '2,3',
});
/**
* 医嘱提交数据模型
* @type {object}
* @property {number} organizationId - 提交机构ID
* @property {string} startTime - 开始时间 (ISO格式字符串如 '2023-10-27T10:00:00')
* @property {string} authoredTime - 开立时间
* @property {Array<RegAdviceItem>} regAdviceSaveList - 医嘱项目列表
*/
const submitData = reactive({
organizationId: 0,
startTime: '',
authoredTime: '',
regAdviceSaveList: [
{
dbOpType: '1', // '1':新增, '2': 修改, '3': 删除 (签发操作时传1)
adviceType: 0, // 1:药品 , 2: 耗材 , 3:项目
requestId: 0, // 请求ID
chargeItemId: 0, // 费用项id
contentJson: '',
categoryCode: '', // 医嘱详细分类代码,来自数据字典
positionId: 0, // 物理位置id | 可能是 发药药房id,耗材房id,执行科室id
pharmacologyCategoryCode: '', // 药理分类代码
partPercent: 0.0, // 拆零比
partAttributeEnum: 0, // 拆分属性-门诊
executeNum: 0, // 执行次数
prescriptionNo: '', // 处方号
quantity: 0.0, // 数量
dispensePerDuration: 0, // 每次发药供应天数
unitCode: '', // 包装单位
unitPrice: 0.0, // 单价
totalPrice: 0.0, // 总价
definitionId: 0, // 费用定价主表ID
definitionDetailId: 0, // 费用定价子表ID
lotNumber: '', // 默认产品批号
statusEnum: 0, // 请求状态
categoryEnum: 0, // 请求类型枚举 (与categoryCode的区别这是程序内部使用的数字枚举用于逻辑判断)
adviceDefinitionId: 0, // 医嘱定义ID
adviceTableName: '', // 医嘱定义对应表名
adviceName: '', // 医嘱名称
minUnitQuantity: 0.0, // 请求小单位数量
patientId: 0, // 患者ID
practitionerId: 0, // 开方医生ID
locationId: 0, // 请求发起的位置ID
performLocation: 0, // 发放/执行位置ID
founderOrgId: 0, // 开方人科室ID
encounterId: 0, // 就诊ID
accountId: 0, // 账户ID
conditionId: 0, // 诊断ID
encounterDiagnosisId: 0, // 就诊诊断ID
conditionDefinitionId: 0, // 诊断定义ID | 分方使用
therapyEnum: 0, // 治疗类型
methodCode: '', // 用法代码
rateCode: '', // 使用频次代码
dose: 0.0, // 单次剂量
firstDose: 0.0, // 首次用量
doseUnitCode: '', // 剂量单位代码
skinTestFlag: 0, // 是否皮试标识
injectFlag: 0, // 是否为注射药物
groupId: 0, // 分组id, 一组药品共用一个id
packageId: 0, // 组套id
activityId: 0, // 活动(项目)定义id
ybClassEnum: 0, // 类别医保编码
chineseHerbsDoseQuantity: 0.0, // 中药付数
sufferingFlag: 0, // 代煎标识 | 0:否 , 1:是
dosageInstruction: '', // 用药说明
sortNumber: 0, // 排序号
basedOnId: 0, // 请求基于什么的ID
},
],
});
const adviceLoading = ref(false);
// 【优化核心】计算总金额 - 使用计算属性实现实时更新
const totalAmount = computed(() => {
return feeItemsList.value.reduce((sum, item) => {
const price = Number(item.unitPrice) || 0;
const quantity = Number(item.quantity) || 0;
return sum + price * quantity;
>>>>>>> v1.3
}, 0);
});
// 初始化
onMounted(() => {
<<<<<<< HEAD
// 加载科室选项
loadDepartmentOptions();
// 加载收费组套数据
@@ -248,15 +567,32 @@ watch(
{ deep: true }
);
=======
const userStore = useUserStore();
userId.value = userStore.id;
orgId.value = userStore.orgId;
console.log(props.patientInfo, 'patientInfo in FeeDialog');
console.log('initialData in FeeDialog');
loadDepartmentOptions();
getAdviceBaseInfos();
getDiseaseInitLoc();
});
>>>>>>> v1.3
// 监听弹窗显示状态
watch(
() => props.visible,
(visible) => {
if (visible) {
<<<<<<< HEAD
// 设置默认执行时间为当前时间
executeTime.value = formatDateStr(new Date(), 'YYYY-MM-DD HH:mm:ss');
} else {
// 弹窗关闭时重置数据
=======
executeTime.value = formatDateStr(new Date(), 'YYYY-MM-DD HH:mm:ss');
} else {
>>>>>>> v1.3
resetData();
}
}
@@ -264,6 +600,7 @@ watch(
// 加载科室选项
function loadDepartmentOptions() {
<<<<<<< HEAD
// 模拟科室数据
departmentOptions.value = [
{ label: '内科', value: 'internal' },
@@ -409,6 +746,119 @@ function calculateTotalAmount() {
// 更新每个项目的金额
feeItemsList.value.forEach((item) => {
item.amount = (item.unitPrice || 0) * (item.quantity || 0);
=======
getOrgList().then((res) => {
if (res.data && res.data.records && res.data.records.length > 0) {
departmentOptions.value = res.data.records[0].children || [];
}
});
}
// 加载收费组套数据
function getAdviceBaseInfos() {
adviceLoading.value = true;
queryParams.value.searchKey = searchText.value;
queryParams.value.adviceType = adviceType.value;
queryParams.value.organizationId = orgId.value;
queryParams.value.pricingFlag = 1; // 划价标记
getAdviceBaseInfo(queryParams.value)
.then((res) => {
AdviceBaseInfoList.value = res.data?.records || [];
})
.finally(() => {
adviceLoading.value = false;
});
}
function getDiseaseInitLoc() {
getDiseaseTreatmentInitLoc(16).then((response) => {
console.log('Disease Treatment Init Loc:', response);
locationOptions.value = response.data.locationOptions;
});
}
// 获取组套类型文本
function getItemType_Text(type) {
const map = { 2: '耗材', 3: '诊疗' };
return map[type] || '其他';
}
function getUnitCodeOptions(row) {
const unitCodes = [
{ code: row.unitCode, codeText: row.unitCode_dictText },
{ code: row.minUnitCode, codeText: row.minUnitCode_dictText },
];
// 使用 Set 来跟踪已经存在的 code
const seenCodes = new Set();
const uniqueUnitCodes = unitCodes.filter((item) => {
// 如果 Set 中没有这个 code就保留它并把它加入 Set
if (!seenCodes.has(item.code)) {
seenCodes.add(item.code);
return true;
}
// 如果已经存在,就过滤掉
return false;
});
return uniqueUnitCodes;
}
// 单位变更处理
function unitCodeChange(row) {
// 获取价格
const price = row.priceList?.[0]?.price || 0;
// 根据选择的单位调整单价
if (row.selectUnitCode === row.unitCode) {
// 如果选择的是大单位 (如 "盒")
row.unitPrice = price.toFixed(6); // 单价就是原价
} else if (row.selectUnitCode === row.minUnitCode) {
// 如果选择的是小单位 (如 "个")
row.unitPrice = (price / (row.partPercent || 1)).toFixed(6); // 单价 = 原价 / 拆零比
}
}
function handleQuantity(row) {
if (row.inventoryList && row.inventoryList.length > 0) {
const totalQuantity = row.inventoryList.reduce((sum, item) => sum + (item.quantity || 0), 0);
return totalQuantity.toString() + row.minUnitCode_dictText;
}
return 0;
}
// 选择收费项目 - 添加到费用列表
function selectChange(row) {
console.log('Added item:', row, props.patientInfo);
if (row == null) {
return;
}
// 校验库存
if (row.adviceType === 2) {
if (!row.inventoryList || row.inventoryList.length === 0) {
ElMessage.warning(`"${row.adviceName}" 库存信息不可用,无法添加`);
return;
}
const totalQuantity = row.inventoryList.reduce((sum, item) => sum + (item.quantity || 0), 0);
if (totalQuantity <= 0) {
ElMessage.warning(`"${row.adviceName}" 库存不足,无法添加`);
return;
}
}
// 检查是否已存在
const exists = feeItemsList.value.some(
(existing) => existing.adviceDefinitionId === row.adviceDefinitionId
);
if (exists) {
ElMessage.warning(`"${row.adviceName}" 已存在于费用列表中`);
return;
}
//获取价格
const price = row.priceList?.[0]?.price || 0;
//获取大小单位
const uniqueUnitCodes = getUnitCodeOptions(row);
//插入费用列表
feeItemsList.value.push({
...row,
uniqueUnitCodes: uniqueUnitCodes,
unitPrice: (price / (row.partPercent || 1)).toFixed(6), // 根据拆零比计算单价
quantity: 1,
// positionId: row.positionId === null || row.positionId === undefined ? orgId : row.positionId, // 默认执行科室
selectUnitCode: row.minUnitCode, // 默认选择小单位
>>>>>>> v1.3
});
}
@@ -420,6 +870,7 @@ function handleCancel() {
// 确认操作
function handleConfirm() {
<<<<<<< HEAD
// 构建提交数据
const submitData = {
feeItems: feeItemsList.value,
@@ -442,6 +893,109 @@ function resetData() {
selectedDept.value = '';
selectedDoctor.value = '';
executor.value = '';
=======
if (feeItemsList.value.length === 0) {
ElMessage.warning('请至少添加一项费用项目');
return;
}
if (!executeTime.value) {
ElMessage.warning('请选择执行时间');
return;
}
//验证数据的完整性
if (feeItemsList.value.some((item) => !item.positionId)) {
ElMessage.warning('请为所有费用项目选择执行科室/位置');
return;
}
convertDataManually();
emit('confirm', submitData);
dialogVisible.value = false;
}
// 手动转换数据
function convertDataManually() {
// 从 feeItemsList.value 中提取机构ID
const organizationId = props.patientInfo.organizationId;
const encounterId = props.patientInfo.encounterId;
const patientId = props.patientInfo.patientId;
const accountId = props.patientInfo.accountId;
console.log('Submitting data for patientId:', props.patientInfo);
if (!organizationId || !encounterId || !patientId || !accountId) {
ElMessage.error('患者信息不完整,无法提交费用项目');
return;
}
// 设置提交数据的机构ID和时间
submitData.organizationId = organizationId;
submitData.startTime = executeTime.value;
submitData.authoredTime = executeTime.value;
// 清空并重新填充 regAdviceSaveList
submitData.regAdviceSaveList = feeItemsList.value.map((item) => {
// ... (这里是和上面computed中完全相同的映射逻辑)
const mappedItem = {
dbOpType: '1', // 默认为新增操作
adviceType: item.adviceType, // 1:药品 , 2: 耗材 , 3:项目
requestId: null, // 新增项ID为0
chargeItemId: null, // feeItemsList中没有直接对应的chargeItemId可能需要从chargeItemDefinitionId映射或设为0
contentJson: feeItemsList.value.length > 0 ? JSON.stringify(feeItemsList.value) : '',
categoryCode: item.categoryCode, //医嘱详细分类代码,来自数据字典
positionId: item.positionId, // 物理位置id | 可能是 发药药房id,耗材房id,执行科室id
pharmacologyCategoryCode: item.pharmacologyCategoryCode || '', //药品性质 | 分方使用
partPercent: item.partPercent || 1.0, // 默认拆零比为1
partAttributeEnum: item.partAttributeEnum, //拆分属性-门诊
executeNum: 1, // 默认执行次数为1
prescriptionNo: '', // 处方号
quantity: item.quantity || 0.0, // 数量
// dispensePerDuration: 0, //每次发药供应天数
unitCode: item.unitCode || '',
unitPrice: item.unitPrice.toFixed(6) || 0.0, // 单价
totalPrice: ((item.quantity || 0) * (item.unitPrice || 0)).toFixed(6), // 计算总价
definitionId: item.chargeItemDefinitionId || 0,
definitionDetailId: 0,
lotNumber: item.defaultLotNumber || '',
// statusEnum: 1, // 假设默认为“待执行”状态
categoryEnum: item.categoryCode, // 简单映射项目类型枚举值可能与adviceType相同
adviceDefinitionId: item.adviceDefinitionId || '',
adviceTableName: item.adviceTableName || '',
adviceName: item.adviceName || '',
minUnitQuantity: item.quantity || 0.0, // 假设最小单位数量等于请求数量
patientId: patientId, // 需要从外部获取
practitionerId: userId.value, // 需要从外部获取
locationId: item.adviceType === 2 ? item.positionId : null, // 请求发起的位置ID
performLocation: item.adviceType === 2 ? item.positionId : null, // 发放位置ID
founderOrgId: organizationId, // 开方科室ID可能与机构ID相同
encounterId: encounterId, // 需要从外部获取
accountId: accountId, // 需要从外部获取
// conditionId: null, // 需要从外部获取
// encounterDiagnosisId: null, // 需要从外部获取
// conditionDefinitionId: null, // 需要从外部获取
therapyEnum: 2, // 默认治疗类型 1 长期 2 临时
methodCode: item.methodCode || '',
rateCode: item.rateCode || '',
dose: item.dose || null,
// firstDose: null, // 默认无首次用量
doseUnitCode: item.doseUnitCode || '',
skinTestFlag: item.skinTestFlag,
injectFlag: item.injectFlag, //注射药物 1:是 , 0:否
// groupId: null, // 默认不分组
// packageId: null, // 默认不是组套
activityId: item.adviceType === 3 ? item.adviceDefinitionId : null, // 如果是项目类型activityId可能等于adviceDefinitionId
// ybClassEnum: 0, // 默认医保类别
// chineseHerbsDoseQuantity: null, // 默认为0非中药
// sufferingFlag: null, // 默认不代煎
dosageInstruction: item.dosageInstruction || '', //用药说明
// sortNumber: 0, // 默认排序号
basedOnId: null, // 默认无基于ID
};
return mappedItem;
});
}
// 重置数据
function resetData() {
feeItemsList.value = [];
adviceType.value = '';
searchText.value = '';
executeTime.value = '';
>>>>>>> v1.3
}
</script>
@@ -449,6 +1003,7 @@ function resetData() {
:deep(.el-dialog__body) {
padding: 20px;
}
<<<<<<< HEAD
/* 添加项目按钮样式 */
:deep(
@@ -459,6 +1014,9 @@ function resetData() {
/* 收费组套卡片样式 */
.group-card {
=======
.item-card {
>>>>>>> v1.3
background: #ffffff;
border: 1px solid #e4e7ed;
border-radius: 6px;
@@ -468,14 +1026,22 @@ function resetData() {
transition: all 0.3s ease;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}
<<<<<<< HEAD
.group-card:hover {
=======
.item-card:hover {
>>>>>>> v1.3
border-color: #409eff;
background-color: #ecf5ff;
box-shadow: 0 4px 12px rgba(64, 158, 255, 0.15);
}
<<<<<<< HEAD
.group-status {
=======
.item-status {
>>>>>>> v1.3
display: flex;
align-items: center;
margin-bottom: 8px;
@@ -483,7 +1049,10 @@ function resetData() {
font-weight: 500;
color: #606266;
}
<<<<<<< HEAD
=======
>>>>>>> v1.3
.status-dot {
width: 8px;
height: 8px;
@@ -491,14 +1060,19 @@ function resetData() {
border-radius: 50%;
margin-right: 6px;
}
<<<<<<< HEAD
.group-name {
=======
.item-name {
>>>>>>> v1.3
font-size: 16px;
font-weight: 600;
color: #303133;
margin-bottom: 8px;
word-break: break-word;
}
<<<<<<< HEAD
.group-info {
font-size: 12px;
@@ -508,3 +1082,6 @@ function resetData() {
margin-top: 4px;
}
</style>
=======
</style>
>>>>>>> v1.3

View File

@@ -213,7 +213,11 @@
<script setup>
import { ref, onMounted } from 'vue';
import { ElMessage } from 'element-plus';
<<<<<<< HEAD
import { patientInfoList } from '../../medicalOrderExecution/store/patient.js';
=======
import { patientInfoList } from '../../components/store/patient.js';
>>>>>>> v1.3
import { formatDateStr } from '@/utils/index';
// 响应式数据
@@ -449,7 +453,11 @@ function filterFeeList() {
// 查询按钮点击
function handleQuery() {
if (patientInfoList.value.length === 0) {
<<<<<<< HEAD
ElMessage.warning('请先选择患者');
=======
// ElMessage.warning('请先选择患者');
>>>>>>> v1.3
return;
}

View File

@@ -1,4 +1,8 @@
<<<<<<< HEAD
import request from '@/utils/request'
=======
import request from '@/utils/request';
>>>>>>> v1.3
/**
* 获取住院患者列表
@@ -7,8 +11,13 @@ export function getPatientList(queryParams) {
return request({
url: '/nurse-station/advice-process/inpatient',
method: 'get',
<<<<<<< HEAD
params: queryParams
})
=======
params: queryParams,
});
>>>>>>> v1.3
}
/**
@@ -18,10 +27,25 @@ export function getWardList(queryParams) {
return request({
url: '/app-common/practitioner-ward',
method: 'get',
<<<<<<< HEAD
params: queryParams
})
}
=======
params: queryParams,
});
}
/**
* 获取科室下拉列表
*/
export function getOrgList() {
return request({
url: '/base-data-manage/organization/organization',
method: 'get',
});
}
>>>>>>> v1.3
/**
* 获取当前选中患者全部医嘱
*/
@@ -29,8 +53,13 @@ export function getPrescriptionList(queryParams) {
return request({
url: '/nurse-station/advice-process/inpatient-advice',
method: 'get',
<<<<<<< HEAD
params: queryParams
})
=======
params: queryParams,
});
>>>>>>> v1.3
}
/**
@@ -40,8 +69,13 @@ export function adviceExecute(data) {
return request({
url: '/nurse-station/advice-process/advice-execute',
method: 'post',
<<<<<<< HEAD
data: data
})
=======
data: data,
});
>>>>>>> v1.3
}
/**
@@ -51,6 +85,68 @@ export function adviceCancel(data) {
return request({
url: '/nurse-station/advice-process/advice-cancel',
method: 'post',
<<<<<<< HEAD
data: data
})
}
}
=======
data: data,
});
}
/**
* 获取药品列表
*/
export function getAdviceBaseInfo(queryParams) {
return request({
url: '/doctor-station/advice/advice-base-info',
method: 'get',
params: queryParams,
});
}
/**
* 护士划价补费 -新增
*/
export function addBilling(data) {
return request({
url: '/inhospitalnursestation/nursebilling/add-billing',
method: 'post',
data: data,
});
}
/**
* 护士划价补费 -查询
*/
export function queryBilling(queryParams) {
return request({
url: '/inhospitalnursestation/nursebilling/innurse-billing-list/',
method: 'get',
params: queryParams,
});
}
/**
* 护士划价补费 -删除
*/
export function deleteBilling(data) {
return request({
url: '/inhospitalnursestation/nursebilling/del-billing',
method: 'post',
data: data,
});
}
// 目录分类子查询
export function getDiseaseTreatmentInitLoc(id) {
return request({
url: '/base-data-manage/org-loc/loc-list?locationForm=' + id,
method: 'get',
});
}
// 住院护士站费用明细
export function getCostDetail(queryParams) {
return request({
url: '/inhospitalnursestation/nursebilling/cost-detail/',
method: 'get',
params: queryParams,
});
}
>>>>>>> v1.3

View File

@@ -1,5 +1,9 @@
<template>
<<<<<<< HEAD
<div style="height: calc(100vh - 126px)">
=======
<div style="height: calc(100vh - 126px); display: flex; flex-direction: column">
>>>>>>> v1.3
<!-- 操作工具栏 -->
<div
style="
@@ -9,6 +13,10 @@
align-items: center;
justify-content: space-between;
padding: 0 15px;
<<<<<<< HEAD
=======
flex-shrink: 0;
>>>>>>> v1.3
"
>
<div style="display: flex; align-items: center">
@@ -22,7 +30,11 @@
>
<el-tab-pane label="今日" name="today"></el-tab-pane>
<el-tab-pane label="昨日" name="yesterday"></el-tab-pane>
<<<<<<< HEAD
<el-tab-pane label="其他" name="other"></el-tab-pane>
=======
<el-tab-pane label="自定义" name="custom"></el-tab-pane>
>>>>>>> v1.3
</el-tabs>
<!-- 日期选择器 -->
@@ -35,6 +47,7 @@
start-placeholder="开始日期"
end-placeholder="结束日期"
@change="handleDatePickerChange"
<<<<<<< HEAD
style="width: 240px; margin-right: 20px"
/>
@@ -53,11 +66,18 @@
/>
</el-select>
=======
:disabled="dateRange !== 'custom'"
style="width: 240px; margin-right: 20px"
/>
>>>>>>> v1.3
<!-- 查询按钮 -->
<el-button type="primary" @click="handleQuery">查询</el-button>
</div>
<div style="display: flex; align-items: center">
<<<<<<< HEAD
<!-- 全选开关 -->
<div style="display: flex; align-items: center; margin-right: 20px">
<span style="margin-right: 8px">全选</span>
@@ -119,6 +139,214 @@
</div>
<!-- 使用计费弹窗组件 -->
=======
<!-- 新增划价 -->
<el-button type="primary" @click="handAddBilling">新增划价</el-button>
</div>
</div>
<!-- 费用列表区域 - Collapse折叠面板+按encounterId分组版 -->
<div
style="flex: 1; display: flex; flex-direction: column; overflow: hidden"
v-loading="loading"
element-loading-text="数据加载中..."
element-loading-spinner="el-icon-loading"
>
<!-- 列表统计信息 -->
<div
style="
padding: 10px 15px;
background-color: #f8f9fa;
border-bottom: 1px solid #e4e7ed;
flex-shrink: 0;
"
>
<div style="display: flex; justify-content: space-between; align-items: center">
<div>
<span class="text-primary font-bold">患者医嘱列表</span>
<span style="margin-left: 15px; color: #666">
<span class="text-danger">{{ groupedPrescriptionList.length }}</span> 位患者
</span>
</div>
<!-- <div>
<el-button size="small" type="text" @click="exportData">
<el-icon><Download /></el-icon> 导出数据
</el-button>
</div> -->
</div>
</div>
<!-- 列表内容容器 -->
<div style="flex: 1; overflow-y: auto; padding: 10px; background-color: #f5f7fa">
<!-- 空状态 -->
<div v-if="groupedPrescriptionList.length === 0 && !loading" class="empty-container">
<el-empty description="暂无患者划价数据,请选择查询条件后点击查询" :image-size="120">
<el-button type="primary" @click="handleQuery">立即查询</el-button>
</el-empty>
</div>
<!-- 患者医嘱折叠面板 -->
<div v-else class="prescription-collapse-container">
<el-collapse
v-model="activeCollapseNames"
accordion
border
style="--el-collapse-border-color: #e4e7ed"
>
<!-- 按encounterId分组渲染患者折叠项 -->
<el-collapse-item
v-for="(patientGroup, index) in groupedPrescriptionList"
:key="`patient-${index}-${safeGet(patientGroup[0], 'encounterId', index)}`"
:name="`patient-${index}`"
class="patient-collapse-item"
>
<!-- 折叠面板头部 - 患者信息 -->
<template #title>
<div class="patient-header">
<div class="patient-basic-info">
<el-avatar :icon="User" size="small" style="margin-right: 10px"></el-avatar>
<div>
<span class="patient-name">{{
safeGet(patientGroup[0], 'patientName', '未知患者')
}}</span>
<span class="patient-info-tag"
>{{ safeGet(patientGroup[0], 'genderEnum_enumText', '未知') }} /
{{ safeGet(patientGroup[0], 'age', '未知') }}</span
>
<span class="patient-info-tag"
>{{ safeGet(patientGroup[0], 'bedName', '无床位') }}{{
safeGet(patientGroup[0], 'busNo', '未知编号')
}}</span
>
</div>
</div>
<div class="patient-ext-info">
<div class="ext-item">
<span class="label">住院医生</span>
<span class="value">{{
safeGet(patientGroup[0], 'admittingDoctorName', '未知')
}}</span>
</div>
<div class="ext-item">
<span class="label">预交金余额</span>
<span class="value amount">{{
formatNumber(safeGet(patientGroup[0], 'balanceAmount', 0), 4)
}}</span>
</div>
<div class="ext-item">
<span class="label">诊断</span>
<span class="value" :title="safeGet(patientGroup[0], 'conditionNames', '无')">
{{ truncateText(safeGet(patientGroup[0], 'conditionNames', '无'), 20) }}
</span>
</div>
<div class="ext-item">
<el-tag size="small">{{
safeGet(patientGroup[0], 'contractName', '未知')
}}</el-tag>
</div>
<div class="patient-amount-preview">
小计<span class="amount">{{ calculatePatientTotal(patientGroup) }}</span>
</div>
</div>
</div>
</template>
<!-- 折叠面板内容 - 医嘱表格 -->
<div class="prescription-table-container">
<el-table
:data="safeArray(patientGroup)"
border
size="small"
:ref="(el) => (tableRef[index] = el)"
@selection-change="(val) => handleTableSelectionChange(index, val)"
:header-cell-style="{ background: '#eef9fd', color: '#333' }"
:row-class-name="
({ row }) => (safeGet(row, 'status') === 'priced' ? 'priced-row' : '')
"
>
<el-table-column type="selection" width="50" align="center" />
<el-table-column label="医嘱类型" prop="therapyEnum_enumText" width="90">
<template #default="scope">
<el-tag
size="small"
:type="safeGet(scope.row, 'therapyEnum') === 1 ? 'warning' : 'primary'"
>
{{ safeGet(scope.row, 'therapyEnum_enumText', '未知') }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="划价内容" min-width="200">
<template #default="scope">
<div class="advice-content">
<span>{{ safeGet(scope.row, 'adviceName', '无') }}</span>
<template v-if="safeGet(scope.row, 'adviceTable') === 'wor_device_request'">
<span class="advice-detail">
规格:{{ safeGet(scope.row, 'volume', '无') }} / 数量:{{
safeGet(scope.row, 'quantity', 0)
}}{{ safeGet(scope.row, 'unitCode_dictText', '') }}
</span>
</template>
</div>
</template>
</el-table-column>
<el-table-column label="数量" prop="quantity" width="60">
<template #default="scope">
{{ formatNumber(safeGet(scope.row, 'quantity', 0), 0) }}
{{ safeGet(scope.row, 'unitCode_dictText', '') }}
</template>
</el-table-column>
<el-table-column label="申请时间" prop="requestTime" width="160" />
<el-table-column label="执行/发放" prop="positionName" width="120" />
<el-table-column label="单价()" width="90">
<template #default="scope">
<!-- 实际项目单价可能需要从收费项目配置中获取这里先显示0.0000 -->
{{ formatNumber(safeGet(scope.row, 'unitPrice', 0), 4) }}
</template>
</el-table-column>
<el-table-column label="操作" width="80">
<template #default="scope">
<el-button
size="small"
type="text"
@click="handleSingleDelete(scope.row)"
:disabled="safeGet(scope.row, 'status') === 'priced'"
>
撤销
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 患者级操作栏 -->
<div class="patient-actions">
<el-button
size="small"
type="primary"
plain
@click="selectAllPatientItems(index)"
>
全选
</el-button>
<el-button size="small" type="primary" @click="handleBatchDelete(index)">
批量撤销
</el-button>
<el-button size="small" type="primary" @click="handleCalculate(patientGroup)">
新增划价
</el-button>
<span class="patient-amount">
小计:<span class="amount">{{ calculatePatientTotal(patientGroup) }}</span>
</span>
</div>
</div>
</el-collapse-item>
</el-collapse>
</div>
</div>
</div>
<!-- 计费弹窗 -->
>>>>>>> v1.3
<FeeDialog
v-model:visible="dialogVisible"
:initial-data="selectedFeeItems"
@@ -130,6 +358,7 @@
</template>
<script setup>
<<<<<<< HEAD
import { ref, onMounted } from 'vue';
import { ElMessage } from 'element-plus';
import { patientInfoList } from '../../medicalOrderExecution/store/patient.js';
@@ -365,10 +594,483 @@ function getSelectedRows() {
// 暴露方法供父组件调用
defineExpose({
handleQuery,
=======
import { ref, onMounted, computed, nextTick, watch } from 'vue';
import { ElMessage, ElMessageBox } from 'element-plus';
// Element Plus 图标导入
import { User, Download } from '@element-plus/icons-vue';
import { patientInfoList } from '../../components/store/patient.js';
import { formatDateStr } from '@/utils/index';
import FeeDialog from './FeeDialog.vue';
import { addBilling, queryBilling, deleteBilling } from './api.js';
import useUserStore from '@/store/modules/user';
// ========== 核心工具函数 ==========
/**
* 安全获取对象属性,避免空值报错
* @param {Object} obj - 源对象
* @param {String} path - 属性路径
* @param {Any} defaultValue - 默认值
* @returns {Any}
*/
const safeGet = (obj, path, defaultValue = '') => {
// 1. 前置校验:如果源对象不是对象类型,直接返回默认值
if (!obj || typeof obj !== 'object') return defaultValue;
// 2. 拆分路径:把 "info.basic.name" 拆成 ["info", "basic", "name"]
const paths = path.split('.');
// 3. 初始化结果为源对象
let result = obj;
// 4. 循环遍历路径数组,逐层访问属性
for (const p of paths) {
// 5. 关键如果当前层属性不存在undefined/null直接返回默认值
if (result[p] === undefined || result[p] === null) return defaultValue;
// 6. 存在则继续访问下一层
result = result[p];
}
// 7. 所有层级都存在,返回最终属性值
return result;
};
/**
* 安全转换为数组
* @param {Any} data - 待转换数据
* @returns {Array}
*/
const safeArray = (data) => {
return Array.isArray(data) ? data : [];
};
/**
* 格式化数字保留4位小数金额专用
* @param {Number} num - 数字
* @param {Number} decimal - 小数位数默认4位
* @returns {String}
*/
const formatNumber = (num, decimal = 4) => {
if (isNaN(Number(num))) return '0.0000';
// 保留指定小数位不足补0
return Number(num).toFixed(decimal);
};
/**
* 文本截断(超出长度显示省略号)
* @param {String} text - 待处理文本
* @param {Number} length - 最大长度
* @returns {String}
*/
const truncateText = (text, length = 20) => {
if (!text || text.length <= length) return text;
return `${text.slice(0, length)}...`;
};
/**
* 按encounterId分组数据
* @param {Array} data - 原始数据
* @returns {Array} 分组后的数据(二维数组)
*/
const groupByEncounterId = (data) => {
const grouped = {};
safeArray(data).forEach((item) => {
const encounterId = safeGet(item, 'encounterId', 'unknown');
if (!grouped[encounterId]) {
grouped[encounterId] = [];
}
// 为每个项添加默认状态未划价和单价默认0实际应从收费项目中获取
grouped[encounterId].push({
...item,
status: safeGet(item, 'status', 'unpriced'), // 默认未划价
unitPrice: safeGet(item, 'unitPrice', 0), // 单价默认0实际需要对接收费项目
});
});
// 转换为数组格式
return Object.values(grouped);
};
// ========== 响应式数据 ==========
const loading = ref(false);
const dateRange = ref('today');
const dateRangeValue = ref([]);
const tableRef = ref([]);
const rawPrescriptionList = ref([]); // 原始未分组数据
const groupedPrescriptionList = ref([]); // 按encounterId分组后的数据
const activeCollapseNames = ref([]); // Collapse激活状态
const selectedRows = ref({}); // 选中的行数据
const totalItemsCount = ref(0); // 总医嘱项数
const totalAmount = ref(0); // 总金额保留4位小数
const dialogVisible = ref(false);
const selectedFeeItems = ref([]);
const currentPatientInfo = ref(null);
const queryParams = ref({
pageSize: 10000,
pageNo: 1,
});
// 用户信息
const userStore = useUserStore();
const userId = ref(safeGet(userStore, 'id', ''));
const orgId = ref(safeGet(userStore, 'orgId', ''));
// ========== 计算属性 ==========
// 计算总统计信息(总项数、总金额)
const calculateTotalStats = computed(() => {
let itemsCount = 0;
let amount = 0;
safeArray(groupedPrescriptionList.value).forEach((patientGroup) => {
safeArray(patientGroup).forEach((item) => {
itemsCount++;
// 累加单价保留4位小数精度
amount = Math.round((amount + Number(safeGet(item, 'unitPrice', 0))) * 10000) / 10000;
});
});
totalItemsCount.value = itemsCount;
totalAmount.value = amount;
});
// ========== 方法 ==========
/**
* 计算单个患者的总金额保留4位小数
* @param {Array} patientGroup - 患者医嘱列表
* @returns {String} 格式化后的金额字符串
*/
const calculatePatientTotal = (patientGroup) => {
const total = safeArray(patientGroup).reduce((sum, item) => {
return (
Math.round(
(sum + Number(safeGet(item, 'unitPrice', 0) * safeGet(item, 'quantity', 0))) * 10000
) / 10000
);
}, 0);
return formatNumber(total, 4);
};
/**
* 全选单个患者的所有项
* @param {Number} index - 患者索引
*/
const selectAllPatientItems = (index) => {
nextTick(() => {
const table = safeArray(tableRef.value)[index];
if (table && typeof table.toggleAllSelection === 'function') {
table.toggleAllSelection();
}
});
};
/**
* 处理表格选择变化
* @param {Number} index - 患者索引
* @param {Array} val - 选中行
*/
const handleTableSelectionChange = (index, val) => {
selectedRows.value[index] = safeArray(val);
console.log('selectedRows:', selectedRows.value);
// 合并所有选中行
const allSelected = [];
Object.values(selectedRows.value).forEach((rows) => {
allSelected.push(...safeArray(rows));
});
selectedFeeItems.value = allSelected;
console.log('selectedFeeItems:', selectedFeeItems.value);
};
/**
* 日期Tab切换
* @param {Object} tab - 标签页
*/
const handleDateTabClick = (tab) => {
const today = new Date();
const yesterday = new Date(today);
yesterday.setDate(today.getDate() - 1);
const format = (date) => formatDateStr(date, 'YYYY-MM-DD');
switch (safeGet(tab, 'paneName')) {
case 'today':
dateRangeValue.value = [format(today), format(today)];
break;
case 'yesterday':
dateRangeValue.value = [format(yesterday), format(yesterday)];
break;
case 'custom':
if (!dateRangeValue.value.length) {
dateRangeValue.value = [format(today), format(today)];
}
break;
}
};
/**
* 日期选择器变化
* @param {Array} val - 选中日期
*/
const handleDatePickerChange = (val) => {
const dateVal = safeArray(val);
if (dateVal.length === 2) {
dateRange.value = 'custom';
const start = new Date(dateVal[0]);
const end = new Date(dateVal[1]);
if (start > end) {
ElMessage.warning('开始日期不能晚于结束日期');
dateRangeValue.value = [dateVal[1], dateVal[0]];
}
}
};
/**
* 查询数据并按encounterId分组
*/
const handleQuery = async () => {
// 基础校验
const patientList = safeArray(patientInfoList.value);
if (patientList.length === 0) {
ElMessage.warning('请先选择患者');
return;
}
if (safeArray(dateRangeValue.value).length < 2) {
ElMessage.warning('请选择有效的查询日期');
return;
}
loading.value = true;
try {
queryParams.value = {
...queryParams.value,
encounterIds: patientList
.map((p) => safeGet(p, 'encounterId'))
.filter((id) => id)
.join(','),
startTime: `${safeArray(dateRangeValue.value)[0]} 00:00:00`,
endTime: `${safeArray(dateRangeValue.value)[1]} 23:59:59`,
};
const response = await queryBilling(queryParams.value);
const rawData = safeArray(safeGet(response, 'data.records', []));
rawPrescriptionList.value = rawData;
// 核心按encounterId分组数据
groupedPrescriptionList.value = groupByEncounterId(rawData);
// 默认展开第一个患者面板
if (groupedPrescriptionList.value.length > 0 && activeCollapseNames.value.length === 0) {
activeCollapseNames.value = ['patient-0'];
}
// 重置选中状态
selectedRows.value = {};
selectedFeeItems.value = [];
ElMessage.success(`查询成功,共找到 ${groupedPrescriptionList.value.length} 位患者的划价数据`);
} catch (error) {
console.error('查询失败:', error);
ElMessage.error(`查询失败:${safeGet(error, 'message', '网络异常')}`);
rawPrescriptionList.value = [];
groupedPrescriptionList.value = [];
} finally {
loading.value = false;
}
};
/**
* 打开新增弹窗
*/
const handAddBilling = () => {
const patientList = safeArray(patientInfoList.value);
if (patientList.length === 0) {
ElMessage.warning('请先选择患者');
return;
}
if (patientList.length > 1) {
ElMessage.warning('新增划价仅支持单患者操作');
return;
}
currentPatientInfo.value = patientList[0];
dialogVisible.value = true;
};
//新增划价
const handleCalculate = (patientGroup) => {
const patientList = safeArray(patientInfoList.value);
if (patientList.length === 0) {
ElMessage.warning('请先选择患者');
return;
}
if (patientGroup.length === 0) {
ElMessage.warning('该患者暂无医嘱信息,无法新增划价');
return;
}
const currentPatient = patientList.find(
(p) => safeGet(p, 'encounterId') === safeGet(patientGroup[0], 'encounterId')
);
if (!currentPatient) {
ElMessage.warning('无法获取当前患者信息');
return;
}
currentPatientInfo.value = currentPatient;
dialogVisible.value = true;
};
/**
* 弹窗确认
* @param {Object} data - 弹窗数据
*/
const handleFeeDialogConfirm = async (data) => {
try {
if (!data || typeof data !== 'object') {
ElMessage.warning('请填写计费信息');
return;
}
loading.value = true;
await addBilling({
...data,
operatorId: userId.value,
orgId: orgId.value,
});
ElMessage.success('计费新增成功');
dialogVisible.value = false;
await handleQuery();
} catch (error) {
ElMessage.error(`计费失败:${safeGet(error, 'message', '提交异常')}`);
} finally {
loading.value = false;
}
};
/**
* 弹窗取消
*/
const handleFeeDialogCancel = () => {
dialogVisible.value = false;
selectedFeeItems.value = [];
currentPatientInfo.value = null;
};
/**
* 单个患者批量撤销
* @param {Number} index - 患者索引
*/
const handleBatchDelete = (index) => {
const rows = safeArray(selectedRows.value[index]);
if (rows.length === 0) {
ElMessage.warning('请先选择要撤销的划价项目');
return;
}
// 第一步:显示确认弹窗
ElMessageBox.confirm(`确认对选中的 ${rows.length} 项划价内容进行批量撤销?`, '批量撤销', {
type: 'warning',
})
.then(() => {
// 用户确认后执行撤销逻辑
loading.value = true;
// 构造请求参数
const param = rows.map((row) => ({
requestId: safeGet(row, 'requestId'),
adviceType:
safeGet(row, 'adviceTable') === 'wor_device_request'
? 2
: safeGet(row, 'adviceTable') === 'wor_service_request'
? 3
: 1,
}));
// 调用批量撤销接口Promise 链式调用)
return deleteBilling(param);
})
.then(() => {
// 接口调用成功
ElMessage.success('批量撤销成功');
handleQuery(); // 重新查询刷新数据
})
.catch((error) => {
// 异常处理(取消操作/接口失败)
if (error !== 'cancel') {
// 排除用户点击取消的情况
ElMessage.error(`批量撤销失败:${safeGet(error, 'message', '操作异常')}`);
}
})
.finally(() => {
// 无论成功/失败,最终关闭加载状态
loading.value = false;
});
};
const handleSingleDelete = (row) => {
if (!row || row.length === 0) {
ElMessage.warning('请先选择要撤销的划价项目');
return;
}
// 第一步:显示确认弹窗
ElMessageBox.confirm(`确认对选中的 ${row.adviceName} 项划价内容进行批量撤销?`, '批量撤销', {
type: 'warning',
})
.then(() => {
// 用户确认后执行撤销逻辑
loading.value = true;
// 构造请求参数
const rowArr = safeArray([row]);
const param = rowArr.map((row) => ({
requestId: safeGet(row, 'requestId'),
adviceType:
safeGet(row, 'adviceTable') === 'wor_device_request'
? 2
: safeGet(row, 'adviceTable') === 'wor_service_request'
? 3
: 1,
}));
// 调用批量撤销接口Promise 链式调用)
return deleteBilling(param);
})
.then(() => {
// 接口调用成功
ElMessage.success('批量撤销成功');
handleQuery(); // 重新查询刷新数据
})
.catch((error) => {
// 异常处理(取消操作/接口失败)
if (error !== 'cancel') {
// 排除用户点击取消的情况
ElMessage.error(`批量撤销失败:${safeGet(error, 'message', '操作异常')}`);
}
})
.finally(() => {
// 无论成功/失败,最终关闭加载状态
loading.value = false;
});
};
// ========== 初始化 ==========
onMounted(() => {
// 设置默认日期
const today = new Date();
const defaultDate = formatDateStr(today, 'YYYY-MM-DD');
dateRangeValue.value = [defaultDate, defaultDate];
// 监听日期变化自动查询
watch(
[dateRange, dateRangeValue],
([newRange, newVal], [oldRange, oldVal]) => {
if (oldRange !== undefined && safeArray(newVal).length === 2) {
handleQuery();
}
},
{ deep: true }
);
// 初始化统计信息
calculateTotalStats.value;
>>>>>>> v1.3
});
</script>
<style scoped>
<<<<<<< HEAD
/* 日期tabs样式 */
.date-tabs .el-tabs__header {
margin-bottom: 0;
@@ -386,3 +1088,186 @@ defineExpose({
background-color: #eef9fd !important;
}
</style>
=======
/* 基础样式 */
.font-bold {
font-weight: 600;
}
.text-primary {
color: #409eff;
}
.text-danger {
color: #f56c6c;
}
.text-success {
color: #67c23a;
}
/* 空状态容器 */
.empty-container {
display: flex;
justify-content: center;
align-items: center;
height: 100%;
}
/* 折叠面板容器 */
.prescription-collapse-container {
--el-collapse-item-border-radius: 8px;
}
/* 患者折叠项 */
.patient-collapse-item {
margin-bottom: 12px;
border-radius: 8px;
overflow: hidden;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.05);
}
/* 患者头部 */
.patient-header {
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
padding: 4px 0;
flex-wrap: wrap;
gap: 8px;
}
.patient-basic-info {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 8px;
}
.patient-name {
font-weight: 600;
font-size: 15px;
margin-right: 10px;
}
.patient-info-tag {
color: #666;
font-size: 13px;
margin-right: 8px;
}
.patient-ext-info {
display: flex;
align-items: center;
gap: 15px;
flex-wrap: wrap;
}
.ext-item {
display: flex;
align-items: center;
font-size: 13px;
flex-wrap: wrap;
}
.ext-item .label {
color: #999;
margin-right: 4px;
}
.ext-item .amount {
color: #e6a23c;
font-weight: 600;
}
.patient-amount-preview {
font-size: 13px;
color: #333;
margin-left: 10px;
}
.patient-amount-preview .amount {
color: #e6a23c;
font-weight: 600;
}
/* 医嘱表格容器 */
.prescription-table-container {
padding: 10px 0;
}
:deep(.el-table) {
--el-table-header-text-color: #333;
--el-table-row-hover-bg-color: #f8f9fa;
--el-table-border-color: #e4e7ed;
}
.priced-row {
background-color: #f0f9ff !important;
}
.advice-content {
display: flex;
flex-direction: column;
}
.advice-detail {
font-size: 12px;
color: #447c95;
margin-top: 2px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
/* 患者操作栏 */
.patient-actions {
display: flex;
justify-content: space-between;
align-items: center;
padding: 8px 0 0;
margin-top: 8px;
border-top: 1px dashed #e4e7ed;
}
.patient-amount {
font-size: 14px;
color: #333;
}
.patient-amount .amount {
color: #e6a23c;
font-weight: 600;
}
/* 日期Tabs样式 */
.date-tabs :deep(.el-tabs__header) {
margin-bottom: 0;
}
.date-tabs :deep(.el-tabs__content) {
display: none;
}
/* 折叠面板样式优化 */
:deep(.el-collapse-item__header) {
padding: 12px 15px;
background-color: #fff;
}
:deep(.el-collapse-item__content) {
padding: 0 15px 15px;
background-color: #fff;
}
:deep(.el-collapse) {
--el-collapse-header-text-color: #333;
--el-collapse-content-bg-color: #fff;
}
/* 表格单元格溢出处理 */
:deep(.el-table__cell) {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
</style>
>>>>>>> v1.3

View File

@@ -170,7 +170,11 @@
<script setup>
import { ref, computed, onMounted } from 'vue';
import { ElMessage } from 'element-plus';
<<<<<<< HEAD
import { patientInfoList } from '../../medicalOrderExecution/store/patient.js';
=======
import { patientInfoList } from '../../components/store/patient.js';
>>>>>>> v1.3
import { getSinglePatient } from '../store/patient.js'; // 导入获取单选患者信息的方法
import { formatDateStr } from '@/utils/index';

View File

@@ -22,7 +22,11 @@
>
<el-tab-pane label="今日" name="today"></el-tab-pane>
<el-tab-pane label="昨日" name="yesterday"></el-tab-pane>
<<<<<<< HEAD
<el-tab-pane label="其他" name="other"></el-tab-pane>
=======
<!-- <el-tab-pane label="其他" name="other"></el-tab-pane> -->
>>>>>>> v1.3
</el-tabs>
<!-- 日期选择器 -->
@@ -40,13 +44,21 @@
<!-- 费用类型选择 -->
<el-select
<<<<<<< HEAD
v-model="feeType"
=======
v-model="formParams.chargeItemEnum"
>>>>>>> v1.3
placeholder="请选择费用类型"
clearable
style="width: 150px; margin-right: 20px"
>
<el-option
<<<<<<< HEAD
v-for="type in feeTypeOptions"
=======
v-for="type in med_chrgitm_type"
>>>>>>> v1.3
:key="type.value"
:label="type.label"
:value="type.value"
@@ -55,20 +67,35 @@
<!-- 执行科室选择 -->
<el-select
<<<<<<< HEAD
v-model="execDepartment"
=======
v-model="formParams.orgId"
>>>>>>> v1.3
placeholder="请选择执行科室"
clearable
style="width: 150px; margin-right: 20px"
>
<el-option
<<<<<<< HEAD
v-for="dept in departmentOptions"
:key="dept.value"
:label="dept.label"
:value="dept.value"
=======
v-for="dept in orgOptions"
:key="dept.id"
:label="dept.name"
:value="dept.id"
>>>>>>> v1.3
/>
</el-select>
<!-- 查询按钮 -->
<<<<<<< HEAD
=======
<el-button type="primary" @click="onReset">重置</el-button>
>>>>>>> v1.3
<el-button type="primary" @click="handleQuery">查询</el-button>
</div>
@@ -77,7 +104,11 @@
<el-button @click="handleExport">导出</el-button>
<!-- 打印按钮 -->
<<<<<<< HEAD
<el-button @click="handlePrint" style="margin-left: 15px">打印</el-button>
=======
<!-- <el-button @click="handlePrint" style="margin-left: 15px">打印</el-button> -->
>>>>>>> v1.3
</div>
</div>
@@ -87,6 +118,7 @@
v-loading="loading"
>
<!-- 费用汇总信息 -->
<<<<<<< HEAD
<div style="background-color: white; padding: 15px; margin-bottom: 10px; border-radius: 4px;">
<div style="display: flex; justify-content: space-between; align-items: center">
<div>
@@ -98,6 +130,23 @@
合计金额¥{{ totalAmount.toFixed(2) }}
</p>
<p style="margin: 5px 0; color: #606266; font-size: 14px;">明细项数{{ feeDetailList.length }}</p>
=======
<div style="background-color: white; padding: 15px; margin-bottom: 10px; border-radius: 4px">
<div style="display: flex; justify-content: space-between; align-items: center">
<div>
<h3 style="margin: 0; font-weight: normal; color: #303133">费用汇总</h3>
<p style="margin: 5px 0; color: #606266; font-size: 14px">
费用周期{{ formatDateRange() }}
</p>
</div>
<div style="text-align: right">
<p style="margin: 0; font-size: 18px; font-weight: bold; color: #ff4d4f">
合计金额¥{{ totalAmount.toFixed(2) }}
</p>
<p style="margin: 5px 0; color: #606266; font-size: 14px">
明细项数{{ feeDetailList.length }}
</p>
>>>>>>> v1.3
</div>
</div>
</div>
@@ -107,6 +156,7 @@
:data="feeDetailList"
border
style="width: 100%"
<<<<<<< HEAD
:header-cell-style="{ background: '#eef9fd !important' }"
@sort-change="handleSortChange"
>
@@ -127,14 +177,56 @@
<el-tag v-if="scope.row.insuranceType" size="small">{{ scope.row.insuranceType }}</el-tag>
</template>
</el-table-column>
=======
max-height="400px"
:header-cell-style="{ background: '#eef9fd !important' }"
@sort-change="handleSortChange"
>
<el-table-column label="项目名称" prop="chargeName" min-width="200" />
<el-table-column
label="费用类型"
prop="chargeItemEnum_enumText"
width="120"
align="center"
/>
<el-table-column label="单价" prop="unitPrice" width="100" align="center" sortable />
<el-table-column label="数量" prop="quantityValue" width="100" align="center" sortable />
<el-table-column label="金额" prop="totalPrice" width="100" align="center" sortable>
<template #default="scope">
<span style="color: #ff4d4f">{{ scope.row.totalPrice.toFixed(2) }}</span>
</template>
</el-table-column>
<el-table-column :prop="orgId" label="执行科室" width="120" align="center">
<template #default="scope">
{{ selectOrg(scope.row.orgId) }}
</template>
</el-table-column>
<el-table-column label="执行人" prop="practitioner" width="100" align="center" />
<el-table-column label="执行日期" prop="recordedTime" width="120" align="center">
<template #default="scope">
{{ moment(scope.row?.recordedTime).format('YYYY-MM-DD HH:mm:ss') }}
</template>
</el-table-column>
<el-table-column label="医保类型" prop="chrgitmLv_enumText" width="100" align="center">
</el-table-column>
>>>>>>> v1.3
<el-table-column label="备注" prop="remark" min-width="150" />
</el-table>
<!-- 分页 -->
<<<<<<< HEAD
<div style="margin-top: 15px; display: flex; justify-content: flex-end;">
<el-pagination
v-model:current-page="currentPage"
v-model:page-size="pageSize"
=======
<div style="margin-top: 15px; display: flex; justify-content: flex-end">
<el-pagination
v-model:current-page="formParams.pageNo"
v-model:page-size="formParams.pageSize"
>>>>>>> v1.3
:page-sizes="[10, 20, 50, 100]"
layout="total, sizes, prev, pager, next, jumper"
:total="total"
@@ -148,6 +240,7 @@
</div>
<!-- 打印预览弹窗 -->
<<<<<<< HEAD
<el-dialog v-model="printDialogVisible" title="打印预览" width="80%" :close-on-click-modal="false">
<div id="print-content">
<div style="text-align: center; margin-bottom: 20px;">
@@ -166,10 +259,36 @@
<th style="border: 1px solid #e4e7ed; padding: 8px;">金额</th>
<th style="border: 1px solid #e4e7ed; padding: 8px;">执行科室</th>
<th style="border: 1px solid #e4e7ed; padding: 8px;">执行日期</th>
=======
<el-dialog
v-model="printDialogVisible"
title="打印预览"
width="80%"
:close-on-click-modal="false"
>
<div id="print-content">
<div style="text-align: center; margin-bottom: 20px">
<h2 style="margin: 0">费用明细清单</h2>
<p style="margin: 5px 0">患者姓名{{ patientInfo || '未选择患者' }}</p>
<p style="margin: 5px 0">费用周期{{ formatDateRange() }}</p>
</div>
<table style="width: 100%; border-collapse: collapse">
<thead>
<tr style="background-color: #eef9fd">
<th style="border: 1px solid #e4e7ed; padding: 8px">项目名称</th>
<th style="border: 1px solid #e4e7ed; padding: 8px">费用类型</th>
<th style="border: 1px solid #e4e7ed; padding: 8px">单价</th>
<th style="border: 1px solid #e4e7ed; padding: 8px">数量</th>
<th style="border: 1px solid #e4e7ed; padding: 8px">金额</th>
<th style="border: 1px solid #e4e7ed; padding: 8px">执行科室</th>
<th style="border: 1px solid #e4e7ed; padding: 8px">执行日期</th>
>>>>>>> v1.3
</tr>
</thead>
<tbody>
<tr v-for="item in feeDetailList" :key="item.id">
<<<<<<< HEAD
<td style="border: 1px solid #e4e7ed; padding: 8px;">{{ item.itemName }}</td>
<td style="border: 1px solid #e4e7ed; padding: 8px;">{{ item.feeTypeName }}</td>
<td style="border: 1px solid #e4e7ed; padding: 8px;">{{ item.unitPrice.toFixed(2) }}</td>
@@ -183,11 +302,47 @@
<tr style="background-color: #f5f7fa;">
<td colspan="4" style="border: 1px solid #e4e7ed; padding: 8px; text-align: right; font-weight: bold;">合计</td>
<td colspan="3" style="border: 1px solid #e4e7ed; padding: 8px; color: #ff4d4f; font-weight: bold;">¥{{ totalAmount.toFixed(2) }}</td>
=======
<td style="border: 1px solid #e4e7ed; padding: 8px">{{ item.itemName }}</td>
<td style="border: 1px solid #e4e7ed; padding: 8px">{{ item.feeTypeName }}</td>
<td style="border: 1px solid #e4e7ed; padding: 8px">
{{ item.unitPrice.toFixed(2) }}
</td>
<td style="border: 1px solid #e4e7ed; padding: 8px">{{ item.quantity }}</td>
<td style="border: 1px solid #e4e7ed; padding: 8px">{{ item.amount.toFixed(2) }}</td>
<td style="border: 1px solid #e4e7ed; padding: 8px">{{ item.execDept }}</td>
<td style="border: 1px solid #e4e7ed; padding: 8px">{{ item.executeDate }}</td>
</tr>
</tbody>
<tfoot>
<tr style="background-color: #f5f7fa">
<td
colspan="4"
style="
border: 1px solid #e4e7ed;
padding: 8px;
text-align: right;
font-weight: bold;
"
>
合计
</td>
<td
colspan="3"
style="border: 1px solid #e4e7ed; padding: 8px; color: #ff4d4f; font-weight: bold"
>
¥{{ totalAmount.toFixed(2) }}
</td>
>>>>>>> v1.3
</tr>
</tfoot>
</table>
</div>
<<<<<<< HEAD
=======
>>>>>>> v1.3
<template #footer>
<el-button @click="printDialogVisible = false">关闭</el-button>
<el-button type="primary" @click="doPrint">打印</el-button>
@@ -197,26 +352,61 @@
</template>
<script setup>
<<<<<<< HEAD
import { ref, computed, onMounted } from 'vue';
import { ElMessage } from 'element-plus';
import { patientInfoList } from '../../medicalOrderExecution/store/patient.js';
import { formatDateStr } from '@/utils/index';
=======
import { ref, computed, onMounted, watch, reactive } from 'vue';
import moment from 'moment';
import { ElMessage } from 'element-plus';
import { patientInfoList } from '../../components/store/patient.js';
import { formatDateStr } from '@/utils/index';
import { getCostDetail } from './api.js';
import { getOrgList } from '../../../basicmanage/ward/components/api.js';
const { proxy } = getCurrentInstance();
const { med_chrgitm_type } = proxy.useDict('med_chrgitm_type');
>>>>>>> v1.3
// 响应式数据
const loading = ref(false);
const feeDetailList = ref([]);
const dateRange = ref('today'); // today, yesterday, other
const dateRangeValue = ref([]);
<<<<<<< HEAD
const feeType = ref('');
=======
>>>>>>> v1.3
const execDepartment = ref('');
const departmentOptions = ref([]);
const feeTypeOptions = ref([]);
const tableRef = ref(null);
const patientInfo = ref('');
<<<<<<< HEAD
// 分页相关
const currentPage = ref(1);
const pageSize = ref(20);
=======
const orgOptions = ref([]);
const formParams = reactive({
chargeItemEnum: undefined,
orgId: undefined,
recordedTimeSTime: undefined,
recordedTimeETime: undefined,
pageSize: 10,
pageNo: 1,
});
const props = defineProps({
activeTab: {
type: String,
},
});
// 分页相关
>>>>>>> v1.3
const total = ref(0);
// 打印相关
@@ -225,7 +415,11 @@ const printDialogVisible = ref(false);
// 计算总金额
const totalAmount = computed(() => {
return feeDetailList.value.reduce((sum, item) => {
<<<<<<< HEAD
return sum + (item.amount || 0);
=======
return sum + (item.totalPrice || 0);
>>>>>>> v1.3
}, 0);
});
@@ -234,6 +428,7 @@ onMounted(() => {
// 设置默认日期
const today = new Date();
dateRangeValue.value = [formatDateStr(today, 'YYYY-MM-DD'), formatDateStr(today, 'YYYY-MM-DD')];
<<<<<<< HEAD
// 加载科室选项
loadDepartmentOptions();
@@ -245,12 +440,58 @@ onMounted(() => {
watchPatientSelection();
});
=======
});
watch(
() => patientInfoList,
(newValue) => {
if (newValue.value.length > 1) {
if (props.activeTab == 'expenseDetail') {
ElMessage({
type: 'error',
message: '一次只能查询一位患者的费用明细',
});
return;
}
}
if (newValue.value.length == 1) {
if (!(dateRangeValue.value == null || dateRangeValue.value == undefined)) {
formParams.recordedTimeSTime = dateRangeValue.value[0] + ' ' + '00:00:00';
formParams.recordedTimeETime = dateRangeValue.value[1] + ' ' + '23:59:59';
}
patientInfo.value = newValue.value[0];
formParams.encounterId = patientInfo.value.encounterId;
getTableList();
}
if (newValue.value.length <= 0) {
feeDetailList.value = [];
}
},
{ deep: true }
);
// 获取列表信息
const getTableList = async () => {
const params = formParams;
try {
const res = await getCostDetail(params);
feeDetailList.value = res.data.records;
total.value = res.data?.total;
console.log('data======>', JSON.stringify(feeDetailList.value));
} catch (error) {}
};
>>>>>>> v1.3
// 监听患者选择变化
function watchPatientSelection() {
// 定期检查患者选择状态变化
setInterval(() => {
if (patientInfoList.value && patientInfoList.value.length > 0) {
<<<<<<< HEAD
const selectedPatient = patientInfoList.value.find(patient => patient.selected === true);
=======
const selectedPatient = patientInfoList.value.find((patient) => patient.selected === true);
>>>>>>> v1.3
if (selectedPatient) {
patientInfo.value = selectedPatient.patientName || '';
} else {
@@ -262,6 +503,7 @@ function watchPatientSelection() {
}, 300);
}
<<<<<<< HEAD
// 加载科室选项
function loadDepartmentOptions() {
// 模拟科室数据
@@ -275,6 +517,35 @@ function loadDepartmentOptions() {
{ label: '其他科室', value: 'others' },
];
}
=======
/** 查询科室 */
const getLocationInfo = () => {
getOrgList().then((res) => {
orgOptions.value = res.data?.records[0]?.children;
console.log('orgOptions======>', JSON.stringify(orgOptions.value));
});
};
getLocationInfo();
// 映射
const selectOrg = (itemid) => {
if (!itemid) return '';
const item = orgOptions.value.find((item) => {
return item.id == itemid;
});
return item?.name || '';
};
// 重置
const onReset = () => {
const today = new Date();
dateRangeValue.value = [formatDateStr(today, 'YYYY-MM-DD'), formatDateStr(today, 'YYYY-MM-DD')];
formParams.orgId = undefined;
formParams.chargeItemEnum = undefined;
formParams.recordedTimeSTime = dateRangeValue.value[0] + ' ' + '00:00:00';
formParams.recordedTimeETime = dateRangeValue.value[1] + ' ' + '23:59:59';
getTableList();
};
>>>>>>> v1.3
// 加载费用类型选项
function loadFeeTypeOptions() {
@@ -311,12 +582,26 @@ function handleDateTabClick(tab) {
break;
// other 情况保持用户选择的值
}
<<<<<<< HEAD
=======
if (!(dateRangeValue.value == null || dateRangeValue.value == undefined)) {
formParams.recordedTimeSTime = dateRangeValue.value[0] + ' ' + '00:00:00';
formParams.recordedTimeETime = dateRangeValue.value[1] + ' ' + '23:59:59';
}
>>>>>>> v1.3
}
// 处理日期选择器变化
function handleDatePickerChange() {
if (dateRangeValue.value.length > 0) {
<<<<<<< HEAD
dateRange.value = 'other';
=======
// dateRange.value = 'other';
} else {
formParams.recordedTimeSTime = undefined;
formParams.recordedTimeETime = undefined;
>>>>>>> v1.3
}
}
@@ -328,6 +613,7 @@ function formatDateRange() {
return '';
}
<<<<<<< HEAD
// 生成模拟数据
function generateMockData() {
// 费用类型映射
@@ -496,11 +782,18 @@ function handleQuery() {
loading.value = false;
}
}, 500);
=======
// 查询按钮点击
function handleQuery() {
console.log('params=======>', formParams);
getTableList();
>>>>>>> v1.3
}
// 处理排序变化
function handleSortChange({ prop, order }) {
const sortedData = [...feeDetailList.value];
<<<<<<< HEAD
if (order === 'ascending') {
sortedData.sort((a, b) => (a[prop] > b[prop]) ? 1 : -1);
@@ -508,32 +801,70 @@ function handleSortChange({ prop, order }) {
sortedData.sort((a, b) => (a[prop] < b[prop]) ? 1 : -1);
}
=======
if (order === 'ascending') {
sortedData.sort((a, b) => (a[prop] > b[prop] ? 1 : -1));
} else if (order === 'descending') {
sortedData.sort((a, b) => (a[prop] < b[prop] ? 1 : -1));
}
>>>>>>> v1.3
feeDetailList.value = sortedData;
}
// 处理分页大小变化
function handleSizeChange(newSize) {
<<<<<<< HEAD
pageSize.value = newSize;
currentPage.value = 1;
handleQuery();
=======
formParams.pageSize = newSize;
formParams.pageNo = 1;
getTableList();
>>>>>>> v1.3
}
// 处理当前页变化
function handleCurrentChange(newCurrent) {
<<<<<<< HEAD
currentPage.value = newCurrent;
handleQuery();
}
// 导出
function handleExport() {
=======
formParams.pageNo = newCurrent;
getTableList();
}
// 导出
async function handleExport() {
>>>>>>> v1.3
if (feeDetailList.value.length === 0) {
ElMessage.warning('暂无数据可导出');
return;
}
<<<<<<< HEAD
// 模拟导出操作
ElMessage.success('导出成功');
// 实际项目中这里应该调用导出API或使用Excel库生成文件
=======
try {
// 实际项目中这里应该调用导出API或使用Excel库生成文件
await proxy.$download.downloadGet(
'/inhospitalnursestation/nursebilling/excel-out',
{
...formParams,
},
`dict_${new Date().getTime()}.xlsx`
);
} catch (error) {}
>>>>>>> v1.3
}
// 打印预览
@@ -542,7 +873,11 @@ function handlePrint() {
ElMessage.warning('暂无数据可打印');
return;
}
<<<<<<< HEAD
=======
>>>>>>> v1.3
printDialogVisible.value = true;
}
@@ -551,10 +886,17 @@ function doPrint() {
try {
// 获取要打印的内容
const printContent = document.getElementById('print-content').innerHTML;
<<<<<<< HEAD
// 创建临时窗口
const printWindow = window.open('', '_blank');
=======
// 创建临时窗口
const printWindow = window.open('', '_blank');
>>>>>>> v1.3
// 写入内容
printWindow.document.write(`
<html>
@@ -574,7 +916,11 @@ function doPrint() {
</body>
</html>
`);
<<<<<<< HEAD
=======
>>>>>>> v1.3
// 打印
printWindow.document.close();
printWindow.focus();
@@ -608,4 +954,8 @@ defineExpose({
:deep(.el-table__row:hover > td) {
background-color: #eef9fd !important;
}
</style>
<<<<<<< HEAD
</style>
=======
</style>
>>>>>>> v1.3

View File

@@ -0,0 +1,874 @@
<template>
<div style="height: calc(100vh - 126px)">
<!-- 操作工具栏 -->
<div
style="
height: 51px;
border-bottom: 2px solid #e4e7ed;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 15px;
"
>
<div style="display: flex; align-items: center">
<!-- 日期选择tabs -->
<el-tabs
v-model="dateRange"
type="card"
class="date-tabs"
@tab-click="handleDateTabClick"
style="margin-right: 20px"
>
<el-tab-pane label="今日" name="today"></el-tab-pane>
<el-tab-pane label="昨日" name="yesterday"></el-tab-pane>
<!-- <el-tab-pane label="其他" name="other"></el-tab-pane> -->
</el-tabs>
<!-- 日期选择器 -->
<el-date-picker
v-model="dateRangeValue"
type="daterange"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"
@change="handleDatePickerChange"
@clear="onClear"
style="width: 240px; margin-right: 20px"
/>
<!-- 费用类型选择 -->
<el-select
v-model="formParams.chargeItemEnum"
placeholder="请选择费用类型"
clearable
style="width: 150px; margin-right: 20px"
>
<el-option
v-for="type in med_chrgitm_type"
:key="type.value"
:label="type.label"
:value="type.value"
/>
</el-select>
<!-- 执行科室选择 -->
<el-select
v-model="formParams.orgId"
placeholder="请选择执行科室"
clearable
style="width: 150px; margin-right: 20px"
>
<el-option
v-for="dept in orgOptions"
:key="dept.id"
:label="dept.name"
:value="dept.id"
/>
</el-select>
<!-- 查询按钮 -->
<el-button type="primary" @click="onReset">重置</el-button>
<el-button type="primary" @click="handleQuery">查询</el-button>
</div>
<div style="display: flex; align-items: center">
<!-- 导出按钮 -->
<el-button @click="handleExport">导出</el-button>
<!-- 打印按钮 -->
<!-- <el-button @click="handlePrint" style="margin-left: 15px">打印</el-button> -->
</div>
</div>
<!-- 费用明细列表区域 -->
<div
style="padding: 10px; background-color: #eef9fd; height: 100%; overflow-y: auto"
v-loading="loading"
>
<!-- 费用汇总信息 -->
<div style="background-color: white; padding: 15px; margin-bottom: 10px; border-radius: 4px">
<div style="display: flex; justify-content: space-between; align-items: center">
<div>
<h3 style="margin: 0; font-weight: normal; color: #303133">费用汇总</h3>
<p style="margin: 5px 0; color: #606266; font-size: 14px">
费用周期{{ formatDateRange() }}
</p>
</div>
<div style="text-align: right">
<p style="margin: 0; font-size: 18px; font-weight: bold; color: #ff4d4f">
合计金额¥{{ formatNumber(totalAmount, 4) }}
</p>
<p style="margin: 5px 0; color: #606266; font-size: 14px">
明细项数{{ groupedPrescriptionList.length }}
</p>
</div>
</div>
</div>
<!-- 列表内容容器 -->
<div
v-if="groupedPrescriptionList.length > 0"
style="
flex: 1;
overflow-y: auto;
padding: 10px;
background-color: white;
border-radius: 4px;
"
>
<!-- 患者医嘱折叠面板 -->
<div class="prescription-collapse-container">
<el-collapse
v-model="activeCollapseNames"
accordion
border
style="--el-collapse-border-color: #e4e7ed"
@change="onCollapasChange"
>
<!-- 按encounterId分组渲染患者折叠项 -->
<el-collapse-item
v-for="(patientGroup, index) in groupedPrescriptionList"
:key="`patient-${index}-${safeGet(patientGroup[0], 'encounterId', index)}`"
:name="`patient-${index}`"
class="patient-collapse-item"
>
<!-- 折叠面板头部 - 患者信息 -->
<template #title>
<div class="patient-header">
<div class="patient-basic-info">
<el-avatar :icon="User" size="small" style="margin-right: 10px"></el-avatar>
<div>
<span class="patient-name">{{
safeGet(patientGroup[0], 'patientName', '未知患者')
}}</span>
<span class="patient-info-tag"
>{{ safeGet(patientGroup[0], 'genderEnum_enumText', '未知') }} /
{{ safeGet(patientGroup[0], 'age', '未知') }}</span
>
<span class="patient-info-tag"
>{{ safeGet(patientGroup[0], 'bedName', '无床位') }}{{
safeGet(patientGroup[0], 'busNo', '未知编号')
}}</span
>
</div>
</div>
<div class="patient-ext-info">
<div class="ext-item">
<span class="label">住院医生</span>
<span class="value">{{
safeGet(patientGroup[0], 'admittingDoctorName', '未知')
}}</span>
</div>
<div class="ext-item">
<span class="label">预交金余额</span>
<span class="value amount">{{
formatNumber(safeGet(patientGroup[0], 'balanceAmount', 0), 4)
}}</span>
</div>
<div class="ext-item">
<span class="label">诊断</span>
<span class="value" :title="safeGet(patientGroup[0], 'conditionNames', '无')">
{{ truncateText(safeGet(patientGroup[0], 'conditionNames', '无'), 20) }}
</span>
</div>
<div class="ext-item">
<el-tag size="small">{{
safeGet(patientGroup[0], 'contractName', '未知')
}}</el-tag>
</div>
<div class="patient-amount-preview">
小计<span class="amount">{{ calculatePatientTotal(patientGroup) }}</span>
</div>
</div>
</div>
</template>
<!-- 折叠面板内容 - 医嘱表格 -->
<div class="prescription-table-container">
<el-table
:data="safeArray(patientGroup)"
border
size="small"
style="width: 100%; margin-top: 10px"
@sort-change="handleSortChange"
>
<el-table-column label="项目名称" prop="chargeName" min-width="200" />
<el-table-column
label="费用类型"
prop="chargeItemEnum_enumText"
width="120"
align="center"
/>
<el-table-column
label="单价"
prop="unitPrice"
width="100"
align="center"
sortable
>
<template #default="scope">
{{ formatNumber(scope.row.unitPrice, 4) }}
</template>
</el-table-column>
<el-table-column
label="数量"
prop="quantityValue"
width="100"
align="center"
sortable
/>
<el-table-column
label="金额"
prop="totalPrice"
width="100"
align="center"
sortable
>
<template #default="scope">
<span style="color: #ff4d4f">{{
formatNumber(scope.row.totalPrice, 4)
}}</span>
</template>
</el-table-column>
<el-table-column :prop="orgId" label="执行科室" width="120" align="center">
<template #default="scope">
{{ selectOrg(scope.row.orgId) }}
</template>
</el-table-column>
<el-table-column label="执行人" prop="practitioner" width="100" align="center" />
<el-table-column label="执行日期" prop="recordedTime" width="120" align="center">
<template #default="scope">
{{ moment(scope.row?.recordedTime).format('YYYY-MM-DD HH:mm:ss') }}
</template>
</el-table-column>
<el-table-column
label="医保类型"
prop="chrgitmLv_enumText"
width="100"
align="center"
>
</el-table-column>
<el-table-column label="备注" prop="remark" min-width="150" />
</el-table>
</div>
</el-collapse-item>
</el-collapse>
</div>
</div>
<!-- 无数据提示 -->
<el-empty
v-if="!loading && groupedPrescriptionList.length === 0"
description="暂无费用明细数据"
/>
</div>
<!-- 打印预览弹窗 -->
<el-dialog
v-model="printDialogVisible"
title="打印预览"
width="80%"
:close-on-click-modal="false"
>
<div id="print-content">
<div style="text-align: center; margin-bottom: 20px">
<h2 style="margin: 0">费用明细清单</h2>
<p style="margin: 5px 0">患者姓名{{ patientInfo || '未选择患者' }}</p>
<p style="margin: 5px 0">费用周期{{ formatDateRange() }}</p>
</div>
<table style="width: 100%; border-collapse: collapse">
<thead>
<tr style="background-color: #eef9fd">
<th style="border: 1px solid #e4e7ed; padding: 8px">项目名称</th>
<th style="border: 1px solid #e4e7ed; padding: 8px">费用类型</th>
<th style="border: 1px solid #e4e7ed; padding: 8px">单价</th>
<th style="border: 1px solid #e4e7ed; padding: 8px">数量</th>
<th style="border: 1px solid #e4e7ed; padding: 8px">金额</th>
<th style="border: 1px solid #e4e7ed; padding: 8px">执行科室</th>
<th style="border: 1px solid #e4e7ed; padding: 8px">执行日期</th>
</tr>
</thead>
<tbody>
<tr v-for="item in feeDetailList" :key="item.id">
<td style="border: 1px solid #e4e7ed; padding: 8px">{{ item.itemName }}</td>
<td style="border: 1px solid #e4e7ed; padding: 8px">{{ item.feeTypeName }}</td>
<td style="border: 1px solid #e4e7ed; padding: 8px">
{{ item.unitPrice.toFixed(2) }}
</td>
<td style="border: 1px solid #e4e7ed; padding: 8px">{{ item.quantity }}</td>
<td style="border: 1px solid #e4e7ed; padding: 8px">{{ item.amount.toFixed(2) }}</td>
<td style="border: 1px solid #e4e7ed; padding: 8px">{{ item.execDept }}</td>
<td style="border: 1px solid #e4e7ed; padding: 8px">{{ item.executeDate }}</td>
</tr>
</tbody>
<tfoot>
<tr style="background-color: #f5f7fa">
<td
colspan="4"
style="
border: 1px solid #e4e7ed;
padding: 8px;
text-align: right;
font-weight: bold;
"
>
合计
</td>
<td
colspan="3"
style="border: 1px solid #e4e7ed; padding: 8px; color: #ff4d4f; font-weight: bold"
>
¥{{ totalAmount.toFixed(2) }}
</td>
</tr>
</tfoot>
</table>
</div>
<template #footer>
<el-button @click="printDialogVisible = false">关闭</el-button>
<el-button type="primary" @click="doPrint">打印</el-button>
</template>
</el-dialog>
</div>
</template>
<script setup>
import { ref, computed, onMounted, watch, reactive } from 'vue';
import moment from 'moment';
import { ElMessage } from 'element-plus';
import { patientInfoList } from '../../components/store/patient.js';
import { formatDateStr } from '@/utils/index';
import { getCostDetail } from './api.js';
import { getOrgList } from '../../../basicmanage/ward/components/api.js';
import { User } from '@element-plus/icons-vue';
const { proxy } = getCurrentInstance();
const { med_chrgitm_type } = proxy.useDict('med_chrgitm_type');
const groupedPrescriptionList = ref([]); // 按encounterId分组后的数据
const activeCollapseNames = ref(['patient-0']); // Collapse激活状态
// 响应式数据
const loading = ref(false);
const feeDetailList = ref([]);
const dateRange = ref('today'); // today, yesterday, other
const dateRangeValue = ref([]);
const execDepartment = ref('');
const feeTypeOptions = ref([]);
const patientInfo = ref('');
const orgOptions = ref([]);
const selectIndex = ref(0);
const formParams = reactive({
chargeItemEnum: undefined,
orgId: undefined,
recordedTimeSTime: undefined,
recordedTimeETime: undefined,
pageSize: 10,
encounterIds: '',
pageNo: 1,
});
const props = defineProps({
activeTab: {
type: String,
},
});
// 分页相关
const total = ref(0);
// 打印相关
const printDialogVisible = ref(false);
// 计算总金额
const totalAmount = computed(() => {
console.log('feeDetailList========>', feeDetailList.value);
return feeDetailList?.value?.reduce((sum, item) => {
return sum + (item.totalPrice || 0);
}, 0);
});
// 初始化
onMounted(() => {
// 设置默认日期
const today = new Date();
dateRangeValue.value = [formatDateStr(today, 'YYYY-MM-DD'), formatDateStr(today, 'YYYY-MM-DD')];
});
watch(
() => patientInfoList,
(newValue) => {
if (newValue.value.length > 0) {
if (!(dateRangeValue.value == null || dateRangeValue.value == undefined)) {
formParams.recordedTimeSTime = dateRangeValue.value[0] + ' ' + '00:00:00';
formParams.recordedTimeETime = dateRangeValue.value[1] + ' ' + '23:59:59';
}
const encounterIds = newValue.value
.map((item) => {
return item.encounterId;
})
.join(',');
formParams.encounterIds = encounterIds;
if (props.activeTab === 'expenseDetail') {
getTableList();
}
}
if (newValue.value.length <= 0) {
feeDetailList.value = [];
groupedPrescriptionList.value = [];
}
},
{ deep: true }
);
// 获取列表信息
const getTableList = async () => {
const params = formParams;
try {
const res = await getCostDetail(params);
feeDetailList.value = res.data;
total.value = res.data?.total;
// 核心按encounterId分组数据
groupedPrescriptionList.value = groupByEncounterId(res.data);
// 默认展开第一个患者面板
if (groupedPrescriptionList.value.length > 0 && activeCollapseNames.value.length === 0) {
activeCollapseNames.value = ['patient-0'];
}
} catch (error) {}
};
// 监听患者选择变化
function watchPatientSelection() {
// 定期检查患者选择状态变化
setInterval(() => {
if (patientInfoList.value && patientInfoList.value.length > 0) {
const selectedPatient = patientInfoList.value.find((patient) => patient.selected === true);
if (selectedPatient) {
patientInfo.value = selectedPatient.patientName || '';
} else {
patientInfo.value = '未选择患者';
}
} else {
patientInfo.value = '未选择患者';
}
}, 300);
}
/** 查询科室 */
const getLocationInfo = () => {
getOrgList().then((res) => {
orgOptions.value = res.data?.records[0]?.children;
});
};
getLocationInfo();
// 映射
const selectOrg = (itemid) => {
const item = orgOptions.value.find((item) => {
return item.id == itemid;
});
return item?.name;
};
// 重置
const onReset = () => {
const today = new Date();
dateRangeValue.value = [formatDateStr(today, 'YYYY-MM-DD'), formatDateStr(today, 'YYYY-MM-DD')];
formParams.orgId = undefined;
formParams.chargeItemEnum = undefined;
formParams.recordedTimeSTime = dateRangeValue.value[0] + ' ' + '00:00:00';
formParams.recordedTimeETime = dateRangeValue.value[1] + ' ' + '23:59:59';
dateRange.value = 'today';
getTableList();
};
// 加载费用类型选项
function loadFeeTypeOptions() {
// 模拟费用类型数据
feeTypeOptions.value = [
{ label: '检查费', value: 'examine' },
{ label: '治疗费', value: 'treatment' },
{ label: '药品费', value: 'medicine' },
{ label: '材料费', value: 'material' },
{ label: '床位费', value: 'bed' },
{ label: '其他费用', value: 'others' },
];
}
// 处理日期tabs点击
function handleDateTabClick(tab) {
const rangeType = tab.paneName;
const today = new Date();
const yesterday = new Date();
yesterday.setDate(today.getDate() - 1);
switch (rangeType) {
case 'today':
dateRangeValue.value = [
formatDateStr(today, 'YYYY-MM-DD'),
formatDateStr(today, 'YYYY-MM-DD'),
];
break;
case 'yesterday':
dateRangeValue.value = [
formatDateStr(yesterday, 'YYYY-MM-DD'),
formatDateStr(yesterday, 'YYYY-MM-DD'),
];
break;
// other 情况保持用户选择的值
}
if (!(dateRangeValue.value == null || dateRangeValue.value == undefined)) {
formParams.recordedTimeSTime = dateRangeValue.value[0] + ' ' + '00:00:00';
formParams.recordedTimeETime = dateRangeValue.value[1] + ' ' + '23:59:59';
}
getTableList();
}
// 处理日期选择器变化
function handleDatePickerChange() {
if (dateRangeValue?.value?.length > 0) {
// dateRange.value = 'other';
formParams.recordedTimeSTime = dateRangeValue.value[0] + ' ' + '00:00:00';
formParams.recordedTimeETime = dateRangeValue.value[1] + ' ' + '23:59:59';
} else {
formParams.recordedTimeSTime = undefined;
formParams.recordedTimeETime = undefined;
}
}
// 清空
const onClear = () => {
console.log('1111111111');
const today = new Date();
dateRangeValue.value = [formatDateStr(today, 'YYYY-MM-DD'), formatDateStr(today, 'YYYY-MM-DD')];
formParams.orgId = undefined;
formParams.chargeItemEnum = undefined;
formParams.recordedTimeSTime = dateRangeValue.value[0] + ' ' + '00:00:00';
formParams.recordedTimeETime = dateRangeValue.value[1] + ' ' + '23:59:59';
dateRange.value = 'today';
getTableList();
};
// 格式化日期范围显示
function formatDateRange() {
if (dateRangeValue.value && dateRangeValue.value.length === 2) {
return `${dateRangeValue.value[0]}${dateRangeValue.value[1]}`;
}
return '';
}
// 查询按钮点击
function handleQuery() {
console.log('params=======>', formParams);
getTableList();
}
// 处理排序变化
function handleSortChange({ prop, order }) {
// const sortedData = [...feeDetailList.value];
const selectData = groupedPrescriptionList.value[selectIndex.value];
const sortedData = [...selectData];
if (order === 'ascending') {
sortedData.sort((a, b) => (a[prop] > b[prop] ? 1 : -1));
} else if (order === 'descending') {
sortedData.sort((a, b) => (a[prop] < b[prop] ? 1 : -1));
}
groupedPrescriptionList.value[selectIndex.value] = sortedData;
// feeDetailList.value = sortedData;
}
// 处理分页大小变化
function handleSizeChange(newSize) {
formParams.pageSize = newSize;
formParams.pageNo = 1;
getTableList();
}
// 处理当前页变化
function handleCurrentChange(newCurrent) {
formParams.pageNo = newCurrent;
getTableList();
}
// 导出
async function handleExport() {
if (groupedPrescriptionList.value.length === 0) {
ElMessage.warning('暂无数据可导出');
return;
}
try {
// 实际项目中这里应该调用导出API或使用Excel库生成文件
await proxy.$download.downloadGet(
'/inhospitalnursestation/nursebilling/excel-out',
{
...formParams,
},
`dict_${new Date().getTime()}.xlsx`
);
} catch (error) {}
}
// 打印预览
function handlePrint() {
if (feeDetailList.value.length === 0) {
ElMessage.warning('暂无数据可打印');
return;
}
printDialogVisible.value = true;
}
// 执行打印
function doPrint() {
try {
// 获取要打印的内容
const printContent = document.getElementById('print-content').innerHTML;
// 创建临时窗口
const printWindow = window.open('', '_blank');
// 写入内容
printWindow.document.write(`
<html>
<head>
<title>费用明细清单</title>
<style>
body { font-family: Arial, sans-serif; margin: 20px; }
table { width: 100%; border-collapse: collapse; }
th, td { border: 1px solid #ccc; padding: 8px; }
th { background-color: #f2f2f2; }
tfoot { font-weight: bold; }
.total-row { background-color: #f5f5f5; }
</style>
</head>
<body>
${printContent}
</body>
</html>
`);
// 打印
printWindow.document.close();
printWindow.focus();
printWindow.print();
} catch (e) {
ElMessage.error('打印失败');
console.error('Print error:', e);
}
}
// 获取当前展开折叠板索引
function onCollapasChange(select) {
if (select) {
const selectArr = select.split('-');
if (selectArr && selectArr.length > 1) {
const idx = selectArr[1];
selectIndex.value = Number(idx);
}
}
}
// ========== 核心工具函数 ==========
/**
* 安全获取对象属性,避免空值报错
* @param {Object} obj - 源对象
* @param {String} path - 属性路径
* @param {Any} defaultValue - 默认值
* @returns {Any}
*/
const safeGet = (obj, path, defaultValue = '') => {
// 1. 前置校验:如果源对象不是对象类型,直接返回默认值
if (!obj || typeof obj !== 'object') return defaultValue;
// 2. 拆分路径:把 "info.basic.name" 拆成 ["info", "basic", "name"]
const paths = path.split('.');
// 3. 初始化结果为源对象
let result = obj;
// 4. 循环遍历路径数组,逐层访问属性
for (const p of paths) {
// 5. 关键如果当前层属性不存在undefined/null直接返回默认值
if (result[p] === undefined || result[p] === null) return defaultValue;
// 6. 存在则继续访问下一层
result = result[p];
}
// 7. 所有层级都存在,返回最终属性值
return result;
};
/**
* 安全转换为数组
* @param {Any} data - 待转换数据
* @returns {Array}
*/
const safeArray = (data) => {
return Array.isArray(data) ? data : [];
};
/**
* 格式化数字保留4位小数金额专用
* @param {Number} num - 数字
* @param {Number} decimal - 小数位数默认4位
* @returns {String}
*/
const formatNumber = (num, decimal = 4) => {
if (isNaN(Number(num))) return '0.0000';
// 保留指定小数位不足补0
return Number(num).toFixed(decimal);
};
/**
* 文本截断(超出长度显示省略号)
* @param {String} text - 待处理文本
* @param {Number} length - 最大长度
* @returns {String}
*/
const truncateText = (text, length = 20) => {
if (!text || text.length <= length) return text;
return `${text.slice(0, length)}...`;
};
/**
* 按encounterId分组数据
* @param {Array} data - 原始数据
* @returns {Array} 分组后的数据(二维数组)
*/
const groupByEncounterId = (data) => {
const grouped = {};
safeArray(data).forEach((item) => {
const encounterId = safeGet(item, 'encounterId', 'unknown');
if (!grouped[encounterId]) {
grouped[encounterId] = [];
}
grouped[encounterId].push({
...item,
});
});
// 转换为数组格式
return Object.values(grouped);
};
/**
* 计算单个患者的总金额保留4位小数
* @param {Array} patientGroup - 患者医嘱列表
* @returns {String} 格式化后的金额字符串
*/
const calculatePatientTotal = (patientGroup) => {
const total = safeArray(patientGroup).reduce((sum, item) => {
return Math.round((sum + Number(safeGet(item, 'totalPrice', 0))) * 10000) / 10000;
}, 0);
return formatNumber(total, 4);
};
// 暴露方法供父组件调用
defineExpose({
handleQuery,
});
</script>
<style scoped>
/* 日期tabs样式 */
.date-tabs .el-tabs__header {
margin-bottom: 0;
}
.date-tabs .el-tabs__content {
display: none;
}
/* :deep(.el-table__header th) {
background-color: #eef9fd !important;
} */
:deep(.el-table__row:hover > td) {
background-color: #eef9fd !important;
}
/* 折叠面板容器 */
.prescription-collapse-container {
--el-collapse-item-border-radius: 8px;
}
/* 患者折叠项 */
.patient-collapse-item {
margin-bottom: 12px;
border-radius: 8px;
overflow: hidden;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.05);
}
/* 患者头部 */
.patient-header {
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
padding: 4px 0;
padding-left: 10px;
flex-wrap: wrap;
gap: 8px;
}
.patient-basic-info {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 8px;
}
.patient-name {
font-weight: 600;
font-size: 15px;
margin-right: 10px;
}
.patient-info-tag {
color: #666;
font-size: 13px;
margin-right: 8px;
}
.patient-ext-info {
display: flex;
align-items: center;
gap: 15px;
flex-wrap: wrap;
}
.ext-item {
display: flex;
align-items: center;
font-size: 13px;
flex-wrap: wrap;
}
.ext-item .label {
color: #999;
margin-right: 4px;
}
.ext-item .amount {
color: #e6a23c;
font-weight: 600;
}
.patient-amount-preview {
font-size: 13px;
color: #333;
margin-left: 10px;
}
.patient-amount-preview .amount {
color: #e6a23c;
font-weight: 600;
}
.prescription-table-container {
padding: 10px 0;
}
</style>

View File

@@ -23,9 +23,17 @@
<el-tab-pane label="在科" name="first" style="padding: 15px 10px">
<PatientList />
</el-tab-pane>
<<<<<<< HEAD
<el-tab-pane label="转科" name="second" style="padding: 0 10px">
<PatientList />
</el-tab-pane>
=======
<!-- 隐藏tab
<el-tab-pane label="转科" name="second" style="padding: 0 10px">
<PatientList />
</el-tab-pane>
-->
>>>>>>> v1.3
</el-tabs>
</div>
@@ -36,7 +44,15 @@
<el-tab-pane label="划价确费" name="billing">
<BillingList ref="billingRef" />
</el-tab-pane>
<<<<<<< HEAD
<el-tab-pane label="医嘱计费" name="orderBilling">
=======
<el-tab-pane label="费用明细查询" name="expenseDetail">
<!-- <FeeDetailQuery :activeTab="activeTab" ref="feeDetailQueryRef" /> -->
<NewfeeDetailQuery :activeTab="activeTab" ref="feeDetailQueryRef" />
</el-tab-pane>
<!-- <el-tab-pane label="医嘱计费" name="orderBilling">
>>>>>>> v1.3
<OrderBilling ref="orderBillingRef" />
</el-tab-pane>
<el-tab-pane label="费用明细查询" name="expenseDetail">
@@ -45,7 +61,11 @@
<el-tab-pane label="预交金查询" name="depositQuery">
<deposit-query ref="depositQueryRef" />
</el-tab-pane>
<<<<<<< HEAD
<!-- <el-tab-pane label="患者流转日志" name="patientFlow">
=======
<el-tab-pane label="患者流转日志" name="patientFlow">
>>>>>>> v1.3
<div style="padding: 20px; text-align: center; color: #909399">患者流转日志功能区域</div>
</el-tab-pane> -->
</el-tabs>
@@ -56,9 +76,16 @@
<script setup>
import { ref, onMounted, nextTick } from 'vue';
import { ElMessage } from 'element-plus';
<<<<<<< HEAD
import PatientList from '../medicalOrderExecution/components/patientList.vue';
import BillingList from './components/billingList.vue';
import FeeDetailQuery from './components/feeDetailQuery.vue';
=======
import PatientList from '../components/patientList.vue';
import BillingList from './components/billingList.vue';
import FeeDetailQuery from './components/feeDetailQuery.vue';
import NewfeeDetailQuery from './components/newfeeDetailQuery.vue';
>>>>>>> v1.3
import DepositQuery from './components/depositQuery.vue';
import OrderBilling from './components/OrderBilling.vue';
@@ -88,7 +115,11 @@ function handleTabChange() {
// 切换到划价确费标签时,刷新数据
if (activeTab.value === 'billing' && billingRef.value) {
nextTick(() => {
<<<<<<< HEAD
billingRef.value.handleQuery();
=======
// billingRef.value.handleQuery();
>>>>>>> v1.3
});
}
// 切换到医嘱计费标签时,刷新数据