挂号退款加退款记录
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) {
|
||||
|
||||
Reference in New Issue
Block a user