解决合并冲突

This commit is contained in:
2025-12-10 14:20:24 +08:00
parent e1385cb3e6
commit 18f6a845e6
804 changed files with 61881 additions and 13577 deletions

View File

@@ -1,63 +1,31 @@
<template>
<div
style="display: flex; justify-content: space-between"
class="app-container"
v-loading="readCardLoading"
:element-loading-text="loadingText"
>
<div style="display: flex; justify-content: space-between" class="app-container" v-loading="readCardLoading"
:element-loading-text="loadingText">
<el-card style="width: 30%">
<template #header>
<span style="vertical-align: middle">患者列表</span>
</template>
<div style="width: 100%">
<el-input
v-model="queryParams.searchKey"
placeholder="请输入患者名/病历号"
clearable
style="width: 48%; margin-bottom: 10px; margin-right: 10px"
@keyup.enter="getPatientList"
>
<el-input v-model="queryParams.searchKey" placeholder="请输入患者名/病历号" clearable
style="width: 48%; margin-bottom: 10px; margin-right: 10px" @keyup.enter="getPatientList">
<template #append>
<el-button icon="Search" @click="getPatientList" />
</template>
</el-input>
<el-select
v-model="queryParams.statusEnum"
style="width: 48%; margin-bottom: 10px; margin-right: 10px"
placeholder="收费状态"
@change="getPatientList"
>
<el-option
v-for="item in chargeStatusOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
<el-select v-model="queryParams.statusEnum" style="width: 48%; margin-bottom: 10px; margin-right: 10px"
placeholder="收费状态" @change="getPatientList">
<el-option v-for="item in chargeStatusOptions" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
<div style="width: 100%">
<el-date-picker
v-model="receptionTime"
type="daterange"
range-separator="~"
start-placeholder="开始时间"
end-placeholder="结束时间"
placement="bottom"
value-format="YYYY-MM-DD"
style="width: 84%; margin-bottom: 10px; margin-right: 10px"
@change="getPatientList"
/>
<el-date-picker v-model="receptionTime" type="daterange" range-separator="~" start-placeholder="开始时间"
end-placeholder="结束时间" 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">
搜索
</el-button>
</div>
<el-table
ref="patientListRef"
height="620"
:data="patientList"
row-key="encounterId"
@cell-click="clickRow"
highlight-current-row
>
<el-table ref="patientListRef" height="620" :data="patientList" row-key="encounterId" @cell-click="clickRow"
highlight-current-row>
<el-table-column label="病历号" align="center" prop="encounterBusNo" />
<el-table-column label="姓名" align="center" prop="patientName" />
<!-- <el-table-column label="时间" align="center" prop="receptionTime" width="160">
@@ -80,12 +48,12 @@
{{ patientInfo.genderEnum_enumText }}
</el-descriptions-item>
<el-descriptions-item label="年龄:">{{ patientInfo.age }}</el-descriptions-item>
<el-descriptions-item label="科室:">{{
patientInfo.organizationName
}}</el-descriptions-item>
<el-descriptions-item label="就诊时间:">{{
formatDateStr(patientInfo.receptionTime, 'YYYY-MM-DD HH:mm:ss')
}}</el-descriptions-item>
<el-descriptions-item label="科室:">
{{ patientInfo.organizationName }}
</el-descriptions-item>
<el-descriptions-item label="就诊时间:">
{{ formatDateStr(patientInfo.receptionTime, 'YYYY-MM-DD HH:mm:ss') }}
</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> -->
@@ -102,47 +70,31 @@
<el-button type="primary" plain @click="handleReadCard('01')" style="width: 65px">
电子凭证
</el-button>
<el-button
type="primary"
plain
@click="handleReadCard('02')"
style="width: 65px"
:disabled="true"
>
<el-button type="primary" plain @click="handleReadCard('02')" style="width: 65px" :disabled="true">
身份证
</el-button>
<el-button type="primary" plain @click="handleReadCard('03')" style="width: 65px">
医保卡
</el-button>
<el-button
type="primary"
@click="payToSelt()"
style="margin-left: 20px"
:disabled="buttonDisabled"
>
<el-button type="primary" @click="payToSelt()" style="margin-left: 20px" :disabled="buttonDisabled">
医保转自费
</el-button>
<el-button
type="primary"
@click="patToMedicalInsurance()"
style="margin-left: 20px"
:disabled="buttonDisabled"
>
<el-button type="primary" @click="patToMedicalInsurance()" style="margin-left: 20px"
:disabled="buttonDisabled">
自费转医保
</el-button>
<span style="float: right"
>合计金额{{ totalAmounts ? totalAmounts.toFixed(2) : 0 }}</span
>
<el-button type="primary" @click="studentPayTosStudentSelf()" style="margin-left: 20px"
:disabled="buttonDisabled">
学生医保转学生自费
</el-button>
<el-button type="primary" @click="studentSelfToStudentPay()" style="margin-left: 20px"
:disabled="buttonDisabled">
学生自费转学生医保
</el-button>
<span style="float: right">合计金额{{ totalAmounts ? totalAmounts.toFixed(2) : 0 }}</span>
</div>
<el-table
ref="chargeListRef"
height="530"
:data="chargeList"
row-key="id"
@selection-change="handleSelectionChange"
v-loading="chargeLoading"
border
>
<el-table ref="chargeListRef" height="530" :data="chargeList" 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="itemName" width="200" />
@@ -152,10 +104,7 @@
<el-table-column label="费用性质" align="center" prop="contractName" />
<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
>
<el-tag :type="scope.row.statusEnum === 1 ? 'default' : 'success'" disable-transitions>
{{ scope.row.statusEnum_enumText }}
</el-tag>
</template>
@@ -166,9 +115,17 @@
</template>
</el-table-column>
<el-table-column label="收款人" align="center" prop="entererId_dictText" />
<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
:open="openDialog"
@close="handleClose"
@@ -197,11 +154,15 @@ import {
changeToMedicalInsurance,
init,
precharge,
getChargeInfo,
changeStudentPayTosStudentSelf,
changeStudentSelfToStudentPay,
} from './components/api';
import { invokeYbPlugin } from '@/api/public';
import ChargeDialog from './components/chargeDialog.vue';
import { formatDateStr } from '@/utils';
import useUserStore from '@/store/modules/user';
import Decimal from 'decimal.js';
const { proxy } = getCurrentInstance();
const userStore = useUserStore();
@@ -241,6 +202,20 @@ watch(
(newVlaue) => {
if (newVlaue && newVlaue.length > 0) {
handleTotalAmount();
} else {
totalAmounts.value = 0;
}
},
{ immediate: true }
);
watch(
() => chargeList.value,
(newVlaue) => {
if (newVlaue && newVlaue.length > 0) {
handleTotalAmount();
} else {
totalAmounts.value = 0;
}
},
{ immediate: true }
@@ -249,9 +224,16 @@ function handleSelectionChange(selection) {
selectedRows.value = selection;
}
function handleTotalAmount() {
totalAmounts.value = selectedRows.value.reduce((accumulator, currentRow) => {
return accumulator + (Number(currentRow.totalPrice) || 0);
}, 0);
if (selectedRows.value.length == 0) {
totalAmounts.value = chargeList.value.reduce((accumulator, currentRow) => {
return new Decimal(accumulator).add(currentRow.totalPrice.toFixed(2) || 0);
}, new Decimal(0));
} else {
totalAmounts.value = selectedRows.value.reduce((accumulator, currentRow) => {
return new Decimal(accumulator).add(currentRow.totalPrice.toFixed(2) || 0);
}, 0);
}
}
getPatientList();
initOption();
@@ -346,7 +328,9 @@ function confirmCharge() {
paymentId.value = res.data.paymentId;
chrgBchnoList.value = res.data.chrgBchnoList;
totalAmount.value = res.data.details.find((item) => item.payEnum == 220000).amount;
details.value = res.data.details;
details.value = res.data.details.filter((item) => {
return item.amount > 0;
});
openDialog.value = true;
} else {
proxy.$modal.msgError(res.msg);
@@ -502,6 +486,8 @@ async function handleReadCard(value) {
chargeItemIdList.value = selectRows.map((item) => {
return item.id;
});
// 打印项目赋值
chargedItems.value = selectRows;
consumablesIdList.value = selectRows
.filter((item) => {
return item.serviceTable == 'wor_device_request';
@@ -543,5 +529,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>
<style scoped>
: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>