完成99需求
This commit is contained in:
@@ -757,6 +757,11 @@ function handleSaveSign(row, index) {
|
||||
row.dbOpType = row.requestId ? '2' : '1';
|
||||
row.minUnitQuantity = row.quantity * row.partPercent;
|
||||
row.categoryEnum = row.adviceType
|
||||
// 如果是手术计费,设置生成来源和来源业务单据号
|
||||
if (props.patientInfo.sourceBillNo) {
|
||||
row.generateSourceEnum = 6; // 手术计费
|
||||
row.sourceBillNo = props.patientInfo.sourceBillNo;
|
||||
}
|
||||
console.log('row', row)
|
||||
savePrescription({ adviceSaveList: [row] }).then((res) => {
|
||||
if (res.code === 200) {
|
||||
|
||||
@@ -763,26 +763,64 @@
|
||||
</div>
|
||||
</template>
|
||||
</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>
|
||||
</template>
|
||||
|
||||
<script setup name="SurgicalSchedule">
|
||||
import { ref, reactive, onMounted } from 'vue'
|
||||
import { ref, reactive, onMounted, nextTick, computed } from 'vue'
|
||||
import { getCurrentInstance } from 'vue'
|
||||
import { parseTime } from '@/utils/openhis'
|
||||
import { useDict } from '@/utils/dict'
|
||||
import download from '@/plugins/download'
|
||||
import Prescriptionlist from '@/views/clinicmanagement/bargain/component/prescriptionlist.vue'
|
||||
import useUserStore from '@/store/modules/user'
|
||||
|
||||
// API 导入
|
||||
import { getSurgerySchedulePage, addSurgerySchedule, updateSurgerySchedule, deleteSurgerySchedule, getSurgeryScheduleDetail } from '@/api/surgicalschedule'
|
||||
import { listUser } from '@/api/system/user'
|
||||
import { deptTreeSelectSelect } from '@/api/system/user'
|
||||
import { deptTreeSelect } from '@/api/system/user'
|
||||
import { listOperatingRoom } from '@/api/operatingroom'
|
||||
import { getTestResultPage} from '@/views/inpatientDoctor/home/components/applicationShow/api.js'
|
||||
import { getTenantPage } from '@/api/system/tenant'
|
||||
import { getContract } from '@/views/inpatientDoctor/home/components/api.js'
|
||||
import SurgeryCharge from '../charge/surgerycharge/index.vue'
|
||||
|
||||
const { proxy } = getCurrentInstance()
|
||||
const userStore = useUserStore()
|
||||
const loading = ref(true)
|
||||
const showSearch = ref(true)
|
||||
const surgeryList = ref([])
|
||||
@@ -897,6 +935,13 @@ const applyTotal = ref(0)
|
||||
|
||||
const applyTableRef = ref()
|
||||
|
||||
// 手术计费弹窗
|
||||
const showChargeDialog = ref(false)
|
||||
const chargeDialogTitle = ref('')
|
||||
const chargePatientInfo = ref({})
|
||||
const chargeSurgeryInfo = ref({})
|
||||
const prescriptionRef = ref()
|
||||
|
||||
// 下拉列表数据
|
||||
const orgList = ref([])
|
||||
const deptList = ref([])
|
||||
@@ -1159,39 +1204,100 @@ function handleDelete(row) {
|
||||
}
|
||||
|
||||
// 手术计费
|
||||
function handleChargeCharge(row) {
|
||||
// 打开手术计费对话框
|
||||
// 传递患者信息和手术信息
|
||||
const patientInfo = {
|
||||
encounterId: row.patientId, // 就诊ID
|
||||
async function handleChargeCharge(row) {
|
||||
console.log('计费按钮被点击,行数据:', row)
|
||||
|
||||
// 检查用户信息中的机构信息
|
||||
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,
|
||||
patientName: row.patientName,
|
||||
genderEnum: row.gender,
|
||||
age: row.age,
|
||||
organizationName: row.applyDeptName,
|
||||
receptionTime: row.scheduleDate,
|
||||
encounterBusNo: row.visitId,
|
||||
categoryEnum: 1, // 门诊
|
||||
};
|
||||
registerTime: row.scheduleDate,
|
||||
typeCode_dictText: row.applyDeptName,
|
||||
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 = {
|
||||
surgeryNo: row.operCode, // 手术单号
|
||||
surgeryName: row.operName, // 手术名称
|
||||
};
|
||||
chargeSurgeryInfo.value = {
|
||||
surgeryName: row.operName,
|
||||
surgeryNo: row.operCode
|
||||
}
|
||||
|
||||
// 使用el-dialog显示手术计费组件
|
||||
proxy.$modal.open({
|
||||
title: '手术计费',
|
||||
component: SurgeryCharge,
|
||||
props: {
|
||||
patientInfo,
|
||||
surgeryInfo
|
||||
},
|
||||
width: '1400px',
|
||||
fullscreen: false,
|
||||
});
|
||||
console.log('计费弹窗数据设置完成:', {
|
||||
chargeDialogTitle: chargeDialogTitle.value,
|
||||
chargePatientInfo: chargePatientInfo.value,
|
||||
chargeSurgeryInfo: chargeSurgeryInfo.value
|
||||
})
|
||||
|
||||
// 打开计费弹窗
|
||||
showChargeDialog.value = true
|
||||
console.log('计费弹窗状态:', showChargeDialog.value)
|
||||
|
||||
// 延迟加载处方列表,确保组件已经渲染
|
||||
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() {
|
||||
Object.assign(form, {
|
||||
@@ -1457,7 +1563,7 @@ function confirmApply() {
|
||||
form.applyId=selectedRow.applyId// 手术申请id
|
||||
form.patientId = selectedRow.patientId// 患者id
|
||||
form.visitId = selectedRow.encounterId // id对应填入就诊id
|
||||
form.operCode = selectedRow.descJson.surgeryCode//手术编码
|
||||
form.operCode = selectedRow.surgeryNo // 手术单号作为手术编码
|
||||
form.operName = selectedRow.descJson.surgeryName//手术名称
|
||||
form.preoperativeDiagnosis = selectedRow.preoperativeDiagnosis
|
||||
form.patientName = selectedRow.name// 患者姓名对应填入患者姓名
|
||||
|
||||
Reference in New Issue
Block a user