完成99需求

This commit is contained in:
chenjinyang
2026-02-06 17:12:29 +08:00
parent 8d45cfe9db
commit d34a314f02
7 changed files with 170 additions and 29 deletions

View File

@@ -22,6 +22,11 @@ public class OpScheduleDto extends OpSchedule {
*/ */
private String patientName; private String patientName;
/**
* 就诊ID
*/
private Long encounterId;
/** /**
* 性别 * 性别
*/ */

View File

@@ -629,7 +629,12 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
chargeItem.setId(adviceSaveDto.getChargeItemId()); // 费用项id chargeItem.setId(adviceSaveDto.getChargeItemId()); // 费用项id
chargeItem.setStatusEnum(ChargeItemStatus.DRAFT.getValue()); // 收费状态 chargeItem.setStatusEnum(ChargeItemStatus.DRAFT.getValue()); // 收费状态
chargeItem.setBusNo(AssignSeqEnum.CHARGE_ITEM_NO.getPrefix().concat(medicationRequest.getBusNo())); chargeItem.setBusNo(AssignSeqEnum.CHARGE_ITEM_NO.getPrefix().concat(medicationRequest.getBusNo()));
chargeItem.setGenerateSourceEnum(GenerateSource.DOCTOR_PRESCRIPTION.getValue()); // 生成来源 // 生成来源:如果前端指定了生成来源,使用前端值;否则使用默认的医生开立
if (adviceSaveDto.getGenerateSourceEnum() != null) {
chargeItem.setGenerateSourceEnum(adviceSaveDto.getGenerateSourceEnum());
} else {
chargeItem.setGenerateSourceEnum(GenerateSource.DOCTOR_PRESCRIPTION.getValue());
}
chargeItem.setPrescriptionNo(adviceSaveDto.getPrescriptionNo()); // 处方号 chargeItem.setPrescriptionNo(adviceSaveDto.getPrescriptionNo()); // 处方号
chargeItem.setPatientId(adviceSaveDto.getPatientId()); // 患者 chargeItem.setPatientId(adviceSaveDto.getPatientId()); // 患者
chargeItem.setContextEnum(adviceSaveDto.getAdviceType()); // 类型 chargeItem.setContextEnum(adviceSaveDto.getAdviceType()); // 类型
@@ -647,6 +652,10 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
chargeItem.setConditionId(adviceSaveDto.getConditionId()); // 诊断id chargeItem.setConditionId(adviceSaveDto.getConditionId()); // 诊断id
chargeItem.setEncounterDiagnosisId(adviceSaveDto.getEncounterDiagnosisId()); // 就诊诊断id chargeItem.setEncounterDiagnosisId(adviceSaveDto.getEncounterDiagnosisId()); // 就诊诊断id
chargeItem.setDispenseId(dispenseId); // 发放ID chargeItem.setDispenseId(dispenseId); // 发放ID
// 来源业务单据号:如果前端指定了来源业务单据号,设置该字段
if (adviceSaveDto.getSourceBillNo() != null) {
chargeItem.setSourceBillNo(adviceSaveDto.getSourceBillNo());
}
chargeItem.setTenantId(tenantId); // 设置租户ID (修复本次报错) chargeItem.setTenantId(tenantId); // 设置租户ID (修复本次报错)
chargeItem.setCreateBy(currentUsername); // 设置创建人 chargeItem.setCreateBy(currentUsername); // 设置创建人
chargeItem.setCreateTime(curDate); // 设置创建时间 chargeItem.setCreateTime(curDate); // 设置创建时间

View File

@@ -235,6 +235,16 @@ public class AdviceSaveDto {
@JsonSerialize(using = ToStringSerializer.class) @JsonSerialize(using = ToStringSerializer.class)
private Long basedOnId; private Long basedOnId;
/**
* 生成来源枚举值
*/
private Integer generateSourceEnum;
/**
* 来源业务单据号
*/
private String sourceBillNo;
/** /**
* 设置默认值 * 设置默认值
*/ */

View File

@@ -29,6 +29,7 @@
cs.apply_dept_id, cs.apply_dept_id,
cs.apply_dept_name, cs.apply_dept_name,
cs.org_id, cs.org_id,
cs.encounter_id,
o.name AS org_name, o.name AS org_name,
cs.main_surgeon_name AS surgeon_name cs.main_surgeon_name AS surgeon_name
FROM op_schedule os FROM op_schedule os

View File

@@ -39,7 +39,12 @@ public enum GenerateSource implements HisEnumInterface {
/** /**
* 自动滚费 * 自动滚费
*/ */
AUTO_ROLL_FEES(5, "5", "自动滚费"); AUTO_ROLL_FEES(5, "5", "自动滚费"),
/**
* 手术计费
*/
SURGERY_BILLING(6, "6", "手术计费");
private final Integer value; private final Integer value;
private final String code; private final String code;

View File

@@ -757,6 +757,11 @@ function handleSaveSign(row, index) {
row.dbOpType = row.requestId ? '2' : '1'; row.dbOpType = row.requestId ? '2' : '1';
row.minUnitQuantity = row.quantity * row.partPercent; row.minUnitQuantity = row.quantity * row.partPercent;
row.categoryEnum = row.adviceType row.categoryEnum = row.adviceType
// 如果是手术计费,设置生成来源和来源业务单据号
if (props.patientInfo.sourceBillNo) {
row.generateSourceEnum = 6; // 手术计费
row.sourceBillNo = props.patientInfo.sourceBillNo;
}
console.log('row', row) console.log('row', row)
savePrescription({ adviceSaveList: [row] }).then((res) => { savePrescription({ adviceSaveList: [row] }).then((res) => {
if (res.code === 200) { if (res.code === 200) {

View File

@@ -763,26 +763,64 @@
</div> </div>
</template> </template>
</el-dialog> </el-dialog>
<!-- 手术计费弹窗 -->
<el-dialog :title="chargeDialogTitle" v-model="showChargeDialog" width="1400px" @close="closeChargeDialog" append-to-body>
<div style="display: flex; justify-content: space-between; height: 80vh">
<div style="width: 100%; border: 1px solid #eee; position: relative">
<div style="padding: 10px; border: 1px solid #eee; height: 50px; border-left: 0">
<el-descriptions :column="4">
<el-descriptions-item label="患者信息:" width="150">
{{
Object.keys(chargePatientInfo).length !== 0
? chargePatientInfo.patientName +
' / ' +
chargePatientInfo.age +
' / ' +
chargePatientInfo.genderEnum_enumText +
' / ' +
chargePatientInfo.typeCode_dictText
: '-'
}}
</el-descriptions-item>
<el-descriptions-item label="安排时间" width="150">
{{ Object.keys(chargePatientInfo).length !== 0 ? formatChargeDate(chargePatientInfo.registerTime) : '-' }}
</el-descriptions-item>
<el-descriptions-item label="计费账号" width="150">{{ userStore.name }}</el-descriptions-item>
<el-descriptions-item label="手术名称" width="150">{{ chargeSurgeryInfo.surgeryName }}</el-descriptions-item>
</el-descriptions>
</div>
<div style="padding: 10px">
<prescriptionlist :patientInfo="chargePatientInfo" ref="prescriptionRef" />
<div class="overlay" v-if="disabled"></div>
</div>
</div>
</div>
</el-dialog>
</div> </div>
</template> </template>
<script setup name="SurgicalSchedule"> <script setup name="SurgicalSchedule">
import { ref, reactive, onMounted } from 'vue' import { ref, reactive, onMounted, nextTick, computed } from 'vue'
import { getCurrentInstance } from 'vue' import { getCurrentInstance } from 'vue'
import { parseTime } from '@/utils/openhis' import { parseTime } from '@/utils/openhis'
import { useDict } from '@/utils/dict' import { useDict } from '@/utils/dict'
import download from '@/plugins/download' import download from '@/plugins/download'
import Prescriptionlist from '@/views/clinicmanagement/bargain/component/prescriptionlist.vue'
import useUserStore from '@/store/modules/user'
// API 导入 // API 导入
import { getSurgerySchedulePage, addSurgerySchedule, updateSurgerySchedule, deleteSurgerySchedule, getSurgeryScheduleDetail } from '@/api/surgicalschedule' import { getSurgerySchedulePage, addSurgerySchedule, updateSurgerySchedule, deleteSurgerySchedule, getSurgeryScheduleDetail } from '@/api/surgicalschedule'
import { listUser } from '@/api/system/user' import { listUser } from '@/api/system/user'
import { deptTreeSelectSelect } from '@/api/system/user' import { deptTreeSelect } from '@/api/system/user'
import { listOperatingRoom } from '@/api/operatingroom' import { listOperatingRoom } from '@/api/operatingroom'
import { getTestResultPage} from '@/views/inpatientDoctor/home/components/applicationShow/api.js' import { getTestResultPage} from '@/views/inpatientDoctor/home/components/applicationShow/api.js'
import { getTenantPage } from '@/api/system/tenant' import { getTenantPage } from '@/api/system/tenant'
import { getContract } from '@/views/inpatientDoctor/home/components/api.js'
import SurgeryCharge from '../charge/surgerycharge/index.vue' import SurgeryCharge from '../charge/surgerycharge/index.vue'
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
const userStore = useUserStore()
const loading = ref(true) const loading = ref(true)
const showSearch = ref(true) const showSearch = ref(true)
const surgeryList = ref([]) const surgeryList = ref([])
@@ -897,6 +935,13 @@ const applyTotal = ref(0)
const applyTableRef = ref() const applyTableRef = ref()
// 手术计费弹窗
const showChargeDialog = ref(false)
const chargeDialogTitle = ref('')
const chargePatientInfo = ref({})
const chargeSurgeryInfo = ref({})
const prescriptionRef = ref()
// 下拉列表数据 // 下拉列表数据
const orgList = ref([]) const orgList = ref([])
const deptList = ref([]) const deptList = ref([])
@@ -1159,39 +1204,100 @@ function handleDelete(row) {
} }
// 手术计费 // 手术计费
function handleChargeCharge(row) { async function handleChargeCharge(row) {
// 打开手术计费对话框 console.log('计费按钮被点击,行数据:', row)
// 传递患者信息和手术信息
const patientInfo = { // 检查用户信息中的机构信息
encounterId: row.patientId, // 就诊ID console.log('完整的用户信息:', JSON.stringify(userStore, null, 2))
console.log('用户机构信息:', {
organizationId: userStore.organizationId,
orgId: userStore.orgId,
tenantId: userStore.tenantId,
userInfo: userStore.userInfo
})
// 调用接口获取账户信息
let accountId = null
try {
const contractResult = await getContract({ encounterId: row.visitId })
console.log('账户信息接口返回:', contractResult)
if (contractResult.code === 200 && contractResult.data && contractResult.data.length > 0) {
// 从返回数据中提取accountId - data是数组取第一个元素的accountId
accountId = contractResult.data[0].accountId || contractResult.data[0].id
console.log('获取到的accountId:', accountId)
} else {
console.warn('获取账户信息失败:', contractResult.msg)
}
} catch (error) {
console.error('调用账户信息接口出错:', error)
}
// 设置计费弹窗数据 - 直接复制划价页面的逻辑
chargeDialogTitle.value = '手术计费 - ' + row.patientName + ' - ' + row.operName
// 构建患者信息传递encounterId和机构ID
chargePatientInfo.value = {
encounterId: row.visitId, // 就诊ID
patientId: row.patientId, patientId: row.patientId,
patientName: row.patientName, patientName: row.patientName,
genderEnum: row.gender, genderEnum: row.gender,
age: row.age, age: row.age,
organizationName: row.applyDeptName, organizationName: row.applyDeptName,
receptionTime: row.scheduleDate, registerTime: row.scheduleDate,
encounterBusNo: row.visitId, typeCode_dictText: row.applyDeptName,
categoryEnum: 1, // 门诊 genderEnum_enumText: row.gender === 0 ? '男' : row.gender === 1 ? '女' : '未知',
}; // 添加机构ID
orgId: userStore.organizationId || userStore.orgId || userStore.tenantId || 1,
// 添加账户ID
accountId: accountId,
// 添加手术申请单号用于追溯
sourceBillNo: row.applyId || row.operCode
}
const surgeryInfo = { chargeSurgeryInfo.value = {
surgeryNo: row.operCode, // 手术单号 surgeryName: row.operName,
surgeryName: row.operName, // 手术名称 surgeryNo: row.operCode
}; }
// 使用el-dialog显示手术计费组件 console.log('计费弹窗数据设置完成:', {
proxy.$modal.open({ chargeDialogTitle: chargeDialogTitle.value,
title: '手术计费', chargePatientInfo: chargePatientInfo.value,
component: SurgeryCharge, chargeSurgeryInfo: chargeSurgeryInfo.value
props: { })
patientInfo,
surgeryInfo // 打开计费弹窗
}, showChargeDialog.value = true
width: '1400px', console.log('计费弹窗状态:', showChargeDialog.value)
fullscreen: false,
}); // 延迟加载处方列表,确保组件已经渲染
nextTick(() => {
console.log('nextTick执行prescriptionRef:', prescriptionRef.value)
if (prescriptionRef.value && prescriptionRef.value.getListInfo) {
console.log('调用prescriptionRef.getListInfo()')
prescriptionRef.value.getListInfo()
}
})
} }
// 关闭计费弹窗
function closeChargeDialog() {
showChargeDialog.value = false
chargePatientInfo.value = {}
chargeSurgeryInfo.value = {}
}
// 格式化计费弹窗中的日期
function formatChargeDate(date) {
if (!date) return '-'
return new Date(date).toLocaleString()
}
// 计算是否禁用
const disabled = computed(() => {
return Object.keys(chargePatientInfo.value).length === 0
})
// 重置表单 // 重置表单
function resetForm() { function resetForm() {
Object.assign(form, { Object.assign(form, {
@@ -1457,7 +1563,7 @@ function confirmApply() {
form.applyId=selectedRow.applyId// 手术申请id form.applyId=selectedRow.applyId// 手术申请id
form.patientId = selectedRow.patientId// 患者id form.patientId = selectedRow.patientId// 患者id
form.visitId = selectedRow.encounterId // id对应填入就诊id form.visitId = selectedRow.encounterId // id对应填入就诊id
form.operCode = selectedRow.descJson.surgeryCode//手术编码 form.operCode = selectedRow.surgeryNo // 手术单号作为手术编码
form.operName = selectedRow.descJson.surgeryName//手术名称 form.operName = selectedRow.descJson.surgeryName//手术名称
form.preoperativeDiagnosis = selectedRow.preoperativeDiagnosis form.preoperativeDiagnosis = selectedRow.preoperativeDiagnosis
form.patientName = selectedRow.name// 患者姓名对应填入患者姓名 form.patientName = selectedRow.name// 患者姓名对应填入患者姓名