挂号退款加退款记录
This commit is contained in:
@@ -111,6 +111,8 @@
|
||||
import { cancelRegister } from './outpatientregistration';
|
||||
import { computed, watch, reactive, ref, getCurrentInstance } from 'vue';
|
||||
import { Delete } from '@element-plus/icons-vue';
|
||||
import useUserStore from '@/store/modules/user';
|
||||
import { formatDateStr } from '@/utils/index';
|
||||
|
||||
// 获取费用性质文本
|
||||
const getFeeTypeText = computed(() => {
|
||||
@@ -162,11 +164,16 @@ const props = defineProps({
|
||||
contractName: {
|
||||
type: String,
|
||||
default: '', // 新增:接收费用性质名称
|
||||
},
|
||||
registerInfo: {
|
||||
type: Object,
|
||||
default: () => ({}), // 原挂号记录信息
|
||||
}
|
||||
});
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
const reason = ref('');
|
||||
const userStore = useUserStore();
|
||||
|
||||
const formData = reactive({
|
||||
totalAmount: 0,
|
||||
@@ -195,6 +202,17 @@ function submit() {
|
||||
proxy.$modal.msgError('请输入正确的金额');
|
||||
return;
|
||||
}
|
||||
|
||||
// 获取当前时间作为退号操作日期
|
||||
const returnDate = formatDateStr(new Date(), 'YYYY-MM-DD HH:mm:ss');
|
||||
|
||||
// 获取当前用户信息作为操作工号
|
||||
const operatorId = userStore.id || userStore.name || '';
|
||||
const operatorName = userStore.name || userStore.nickName || '';
|
||||
|
||||
// 计算退款总金额
|
||||
const refundAmount = formData.selfPay.reduce((sum, item) => sum + (Number(item.amount) || 0), 0);
|
||||
|
||||
cancelRegister({
|
||||
paymentEnum: 0,
|
||||
kindEnum: 1,
|
||||
@@ -206,6 +224,18 @@ function submit() {
|
||||
reason: reason.value,
|
||||
ybFlag: '1',
|
||||
eleFlag: '0',
|
||||
// 退号操作记录信息
|
||||
returnDate: returnDate, // 退号操作日期
|
||||
operatorId: operatorId, // 退号操作工号(用户ID)
|
||||
operatorName: operatorName, // 退号操作人姓名
|
||||
refundAmount: refundAmount, // 退款金额
|
||||
// 原挂号信息
|
||||
registerTime: props.registerInfo?.registerTime || '', // 原挂号时间
|
||||
registerAmount: props.registerInfo?.totalPrice || props.totalAmount, // 原挂号金额
|
||||
// 患者信息
|
||||
patientName: props.registerInfo?.patientName || '', // 患者姓名
|
||||
patientAge: props.registerInfo?.age || '', // 患者年龄
|
||||
patientGender: props.registerInfo?.genderEnum_enumText || '', // 患者性别
|
||||
// returnedAmount: parseFloat(returnedAmount.value),
|
||||
}).then((res) => {
|
||||
if (res.code == 200) {
|
||||
|
||||
@@ -341,7 +341,14 @@
|
||||
<el-col :span="24" class="card-box">
|
||||
<el-card>
|
||||
<template #header>
|
||||
<span style="vertical-align: middle">当日已挂号</span>
|
||||
<div style="display: flex; align-items: center; justify-content: space-between;">
|
||||
<span style="vertical-align: middle">当日已挂号</span>
|
||||
<el-radio-group v-model="queryType" @change="handleQueryTypeChange" size="small">
|
||||
<el-radio-button label="all">全部</el-radio-button>
|
||||
<el-radio-button label="normal">正常挂号</el-radio-button>
|
||||
<el-radio-button label="returned">退号记录</el-radio-button>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
</template>
|
||||
<el-input
|
||||
v-model="queryParams.searchKey"
|
||||
@@ -501,24 +508,78 @@
|
||||
<span>{{ parseTime(scope.row.registerTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" key="registerTime" prop="registerTime">
|
||||
<!-- 退号记录相关列 -->
|
||||
<el-table-column
|
||||
v-if="queryType === 'returned'"
|
||||
label="退号日期/时间"
|
||||
align="center"
|
||||
key="returnDate"
|
||||
prop="returnDate"
|
||||
width="180"
|
||||
>
|
||||
<template #default="scope">
|
||||
<el-tooltip
|
||||
:content="getReturnTooltip(scope.row)"
|
||||
placement="top"
|
||||
:disabled="!getReturnTooltip(scope.row)"
|
||||
>
|
||||
<span>
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
@click="handleReturn(scope.row)"
|
||||
:disabled="scope.row.statusEnum != 1"
|
||||
>
|
||||
退号
|
||||
</el-button>
|
||||
</span>
|
||||
</el-tooltip>
|
||||
<span>{{ scope.row.returnDate ? parseTime(scope.row.returnDate) : '-' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="queryType === 'returned'"
|
||||
label="退号原因"
|
||||
align="center"
|
||||
key="returnReason"
|
||||
prop="returnReason"
|
||||
width="200"
|
||||
:show-overflow-tooltip="true"
|
||||
>
|
||||
<template #default="scope">
|
||||
<span>{{ scope.row.returnReason || '-' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="queryType === 'returned'"
|
||||
label="退号操作人"
|
||||
align="center"
|
||||
key="operatorName"
|
||||
prop="operatorName"
|
||||
width="120"
|
||||
>
|
||||
<template #default="scope">
|
||||
<span>{{ scope.row.operatorName || '-' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="queryType === 'returned'"
|
||||
label="退号操作工号"
|
||||
align="center"
|
||||
key="operatorId"
|
||||
prop="operatorId"
|
||||
width="120"
|
||||
>
|
||||
<template #default="scope">
|
||||
<span>{{ scope.row.operatorId || '-' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="queryType === 'returned'"
|
||||
label="退款金额"
|
||||
align="center"
|
||||
key="refundAmount"
|
||||
prop="refundAmount"
|
||||
width="120"
|
||||
>
|
||||
<template #default="scope">
|
||||
<span>{{ scope.row.refundAmount ? scope.row.refundAmount.toFixed(2) + ' 元' : '-' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="queryType === 'returned'"
|
||||
label="退款方式"
|
||||
align="center"
|
||||
key="refundMethod"
|
||||
prop="refundMethod"
|
||||
width="150"
|
||||
>
|
||||
<template #default="scope">
|
||||
<span>{{ scope.row.refundMethod || '-' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -571,6 +632,7 @@
|
||||
:feeType="patientInfo.medfeePaymtdCode || ''"
|
||||
:contractName="patientInfo.contractName || ''"
|
||||
:medfee_paymtd_code="medfee_paymtd_code"
|
||||
:registerInfo="registerInfo"
|
||||
/>
|
||||
<ReprintDialog
|
||||
:open="openReprintDialog"
|
||||
@@ -664,6 +726,8 @@ const chargeItemIdList = ref([]);
|
||||
const chrgBchnoList = ref([]);
|
||||
const paymentId = ref('');
|
||||
const loadingText = ref('');
|
||||
const registerInfo = ref({}); // 原挂号记录信息
|
||||
const queryType = ref('all'); // 查询类型:all-全部, normal-正常挂号, returned-退号记录
|
||||
|
||||
// 使用 ref 定义查询所得用户信息数据
|
||||
const patientInfoList = ref(undefined);
|
||||
@@ -996,6 +1060,12 @@ function getList() {
|
||||
loading.value = false;
|
||||
outpatientRegistrationList.value = res.data.records;
|
||||
total.value = res.data.total;
|
||||
|
||||
// 调试:查看返回的数据结构(仅退号记录查询时)
|
||||
if (queryType.value === 'returned' && res.data.records && res.data.records.length > 0) {
|
||||
console.log('退号记录数据结构:', res.data.records[0]);
|
||||
console.log('所有字段:', Object.keys(res.data.records[0]));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1077,11 +1147,39 @@ function handleClear() {
|
||||
reset();
|
||||
}
|
||||
|
||||
/** 查询类型切换 */
|
||||
function handleQueryTypeChange() {
|
||||
queryParams.value.pageNo = 1;
|
||||
// 根据查询类型设置状态筛选
|
||||
if (queryType.value === 'returned') {
|
||||
// 查询退号记录(状态为6)
|
||||
queryParams.value.statusEnum = 6;
|
||||
} else if (queryType.value === 'normal') {
|
||||
// 查询正常挂号(排除退号状态)
|
||||
queryParams.value.statusEnum = undefined; // 或者设置为非6的状态
|
||||
// 如果需要排除退号,可以在后端处理,这里先不设置
|
||||
} else {
|
||||
// 查询全部
|
||||
queryParams.value.statusEnum = undefined;
|
||||
}
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNo = 1;
|
||||
queryParams.value.registerTimeSTime = dateRange.value[0] + ' 00:00:00';
|
||||
queryParams.value.registerTimeETime = dateRange.value[1] + ' 23:59:59';
|
||||
// 根据查询类型设置状态筛选
|
||||
if (queryType.value === 'returned') {
|
||||
queryParams.value.statusEnum = 6; // 退号状态
|
||||
} else if (queryType.value === 'normal') {
|
||||
// 正常挂号,不设置statusEnum或排除6
|
||||
queryParams.value.statusEnum = undefined;
|
||||
} else {
|
||||
// 全部
|
||||
queryParams.value.statusEnum = undefined;
|
||||
}
|
||||
getList();
|
||||
}
|
||||
|
||||
@@ -1226,6 +1324,18 @@ function handleReturn(row) {
|
||||
patientInfo.value.medfeePaymtdCode = row.contractNo; // 使用挂号记录中的费用性质代码
|
||||
patientInfo.value.contractName = row.contractName; // 保存费用性质名称用于显示
|
||||
|
||||
// 保存完整的原挂号记录信息,用于退号记录
|
||||
registerInfo.value = {
|
||||
...row, // 保存完整的挂号记录
|
||||
patientName: row.patientName,
|
||||
age: row.age,
|
||||
genderEnum_enumText: row.genderEnum_enumText,
|
||||
registerTime: row.registerTime,
|
||||
totalPrice: row.totalPrice,
|
||||
encounterId: row.encounterId,
|
||||
patientId: row.patientId,
|
||||
};
|
||||
|
||||
console.log('退号费用性质:', row.contractNo, row.contractName);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user